]> git.sur5r.net Git - openldap/blob - configure
82b8016426831c5b36d49b8a326881b21944c150
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.223.2.36 2001/12/04 18:15:24 kurt Exp  
4
5 # Copyright 1998-2002 The OpenLDAP Foundation.  All Rights Reserved.
6
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted only as authorized by the OpenLDAP
9 # Public License.  A copy of this license is available at
10 # http://www.OpenLDAP.org/license.html or in file LICENSE in the
11 # top-level directory of the distribution.
12
13 echo "Copyright 1998-2002 The OpenLDAP Foundation,  All Rights Reserved."
14 echo "Restrictions apply, see COPYRIGHT and LICENSE files."
15
16 # Guess values for system-dependent variables and create Makefiles.
17 # Generated automatically using autoconf version 2.13.1 
18 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
19 #
20 # This configure script is free software; the Free Software Foundation
21 # gives unlimited permission to copy, distribute and modify it.
22
23 # Defaults:
24 ac_help=
25 ac_default_prefix=/usr/local
26 # Any additions from configure.in:
27 ac_default_prefix=/usr/local
28 ac_help="$ac_help
29   --with-subdir=DIR       change default subdirectory used for installs"
30 ac_help="$ac_help
31   --enable-debug          enable debugging [yes]"
32 ac_help="$ac_help
33   --enable-syslog         enable syslog support [auto]"
34 ac_help="$ac_help
35   --enable-proctitle      enable proctitle support [yes]"
36 ac_help="$ac_help
37   --enable-cache          enable caching (experimental) [no]"
38 ac_help="$ac_help
39   --enable-referrals      enable LDAPv2+ Referrals (experimental) [no]"
40 ac_help="$ac_help
41   --enable-kbind          enable LDAPv2+ Kerberos IV bind (deprecated) [no]"
42 ac_help="$ac_help
43   --enable-ipv6           enable IPv6 support [auto]"
44 ac_help="$ac_help
45   --enable-local          enable AF_LOCAL (AF_UNIX) socket support [auto]"
46 ac_help="$ac_help
47   --enable-x-compile      enable cross compiling [no]"
48 ac_help="$ac_help
49   --with-cyrus-sasl       with Cyrus SASL support [auto]"
50 ac_help="$ac_help
51   --with-fetch            with fetch URL support [auto]"
52 ac_help="$ac_help
53   --with-kerberos         with Kerberos support [auto]"
54 ac_help="$ac_help
55   --with-readline         with readline support [auto]"
56 ac_help="$ac_help
57   --with-threads          with threads [auto]"
58 ac_help="$ac_help
59   --with-tls              with TLS/SSL support [auto]"
60 ac_help="$ac_help
61   --with-yielding-select  with implicitly yielding select [auto]"
62 ac_help="$ac_help
63 SLAPD (Standalone LDAP Daemon) Options:"
64 ac_help="$ac_help
65   --enable-slapd          enable building slapd [yes]"
66 ac_help="$ac_help
67     --enable-cleartext    enable cleartext passwords [yes]"
68 ac_help="$ac_help
69     --enable-crypt        enable crypt(3) passwords [auto]"
70 ac_help="$ac_help
71     --enable-kpasswd      enable kerberos password verification [no]"
72 ac_help="$ac_help
73     --enable-spasswd      enable (Cyrus) SASL password verification [no]"
74 ac_help="$ac_help
75     --enable-modules      enable dynamic module support [no]"
76 ac_help="$ac_help
77     --enable-phonetic     enable phonetic/soundex [no]"
78 ac_help="$ac_help
79     --enable-rlookups     enable reverse lookups [no]"
80 ac_help="$ac_help
81     --enable-aci          enable per-object ACIs [no]"
82 ac_help="$ac_help
83     --enable-wrappers     enable tcp wrapper support [no]"
84 ac_help="$ac_help
85     --enable-dynamic      enable linking built binaries with dynamic libs [no]"
86 ac_help="$ac_help
87     --enable-dnssrv       enable dnssrv backend [no]"
88 ac_help="$ac_help
89     --with-dnssrv-module  module type [static]"
90 ac_help="$ac_help
91     --enable-ldap         enable ldap backend [no]"
92 ac_help="$ac_help
93     --with-ldap-module    module type [static]"
94 ac_help="$ac_help
95     --enable-ldbm         enable ldbm backend [yes]"
96 ac_help="$ac_help
97     --with-ldbm-api       with LDBM API [auto]"
98 ac_help="$ac_help
99     --with-ldbm-module    module type [static]"
100 ac_help="$ac_help
101     --with-ldbm-type      use LDBM type [auto]"
102 ac_help="$ac_help
103     --enable-passwd       enable passwd backend [no]"
104 ac_help="$ac_help
105     --with-passwd-module  module type [static]"
106 ac_help="$ac_help
107     --enable-shell        enable shell backend [no]"
108 ac_help="$ac_help
109     --with-shell-module   module type [static]"
110 ac_help="$ac_help
111     --enable-sql          enable sql backend [no]"
112 ac_help="$ac_help
113     --with-sql-module     module type [static]"
114 ac_help="$ac_help
115 SLURPD (Replication Daemon) Options:"
116 ac_help="$ac_help
117   --enable-slurpd         enable building slurpd [auto]"
118 ac_help="$ac_help
119 Library Generation & Linking Options"
120 ac_help="$ac_help
121   --enable-static[=PKGS]  build static libraries [default=yes]"
122 ac_help="$ac_help
123   --enable-shared[=PKGS]  build shared libraries [default=yes]"
124 ac_help="$ac_help
125   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
126 ac_help="$ac_help
127   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
128 ac_help="$ac_help
129   --disable-libtool-lock  avoid locking (might break parallel builds)"
130
131 # Initialize some variables set by options.
132 # The variables have the same names as the options, with
133 # dashes changed to underlines.
134 build=NONE
135 cache_file=./config.cache
136 exec_prefix=NONE
137 host=NONE
138 no_create=
139 nonopt=NONE
140 no_recursion=
141 prefix=NONE
142 program_prefix=NONE
143 program_suffix=NONE
144 program_transform_name=s,x,x,
145 silent=
146 site=
147 srcdir=
148 target=NONE
149 verbose=
150 x_includes=NONE
151 x_libraries=NONE
152 bindir='${exec_prefix}/bin'
153 sbindir='${exec_prefix}/sbin'
154 libexecdir='${exec_prefix}/libexec'
155 datadir='${prefix}/share'
156 sysconfdir='${prefix}/etc'
157 sharedstatedir='${prefix}/com'
158 localstatedir='${prefix}/var'
159 libdir='${exec_prefix}/lib'
160 includedir='${prefix}/include'
161 oldincludedir='/usr/include'
162 infodir='${prefix}/info'
163 mandir='${prefix}/man'
164
165 # Initialize some other variables.
166 subdirs=
167 MFLAGS= MAKEFLAGS=
168 SHELL=${CONFIG_SHELL-/bin/sh}
169 # Maximum number of lines to put in a shell here document.
170 ac_max_here_lines=12
171
172 ac_prev=
173 for ac_option
174 do
175
176   # If the previous option needs an argument, assign it.
177   if test -n "$ac_prev"; then
178     eval "$ac_prev=\$ac_option"
179     ac_prev=
180     continue
181   fi
182
183   case "$ac_option" in
184   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
185   *) ac_optarg= ;;
186   esac
187
188   # Accept the important Cygnus configure options, so we can diagnose typos.
189
190   case "$ac_option" in
191
192   -bindir | --bindir | --bindi | --bind | --bin | --bi)
193     ac_prev=bindir ;;
194   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
195     bindir="$ac_optarg" ;;
196
197   -build | --build | --buil | --bui | --bu)
198     ac_prev=build ;;
199   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
200     build="$ac_optarg" ;;
201
202   -cache-file | --cache-file | --cache-fil | --cache-fi \
203   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
204     ac_prev=cache_file ;;
205   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
206   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
207     cache_file="$ac_optarg" ;;
208
209   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
210     ac_prev=datadir ;;
211   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
212   | --da=*)
213     datadir="$ac_optarg" ;;
214
215   -disable-* | --disable-*)
216     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
217     # Reject names that are not valid shell variable names.
218     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
219       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
220     fi
221     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
222     eval "enable_${ac_feature}=no" ;;
223
224   -enable-* | --enable-*)
225     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
226     # Reject names that are not valid shell variable names.
227     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
228       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
229     fi
230     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
231     case "$ac_option" in
232       *=*) ;;
233       *) ac_optarg=yes ;;
234     esac
235     eval "enable_${ac_feature}='$ac_optarg'" ;;
236
237   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
238   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
239   | --exec | --exe | --ex)
240     ac_prev=exec_prefix ;;
241   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
242   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
243   | --exec=* | --exe=* | --ex=*)
244     exec_prefix="$ac_optarg" ;;
245
246   -gas | --gas | --ga | --g)
247     # Obsolete; use --with-gas.
248     with_gas=yes ;;
249
250   -help | --help | --hel | --he)
251     # Omit some internal or obsolete options to make the list less imposing.
252     # This message is too long to be a string in the A/UX 3.1 sh.
253     cat << EOF
254 Usage: configure [options] [host]
255 Options: [defaults in brackets after descriptions]
256 Configuration:
257   --cache-file=FILE       cache test results in FILE
258   --help                  print this message
259   --no-create             do not create output files
260   --quiet, --silent       do not print \`checking...' messages
261   --version               print the version of autoconf that created configure
262 Directory and file names:
263   --prefix=PREFIX         install architecture-independent files in PREFIX
264                           [$ac_default_prefix]
265   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
266                           [same as prefix]
267   --bindir=DIR            user executables in DIR [EPREFIX/bin]
268   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
269   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
270   --datadir=DIR           read-only architecture-independent data in DIR
271                           [PREFIX/share]
272   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
273   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
274                           [PREFIX/com]
275   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
276   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
277   --includedir=DIR        C header files in DIR [PREFIX/include]
278   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
279   --infodir=DIR           info documentation in DIR [PREFIX/info]
280   --mandir=DIR            man documentation in DIR [PREFIX/man]
281   --srcdir=DIR            find the sources in DIR [configure dir or ..]
282   --program-prefix=PREFIX prepend PREFIX to installed program names
283   --program-suffix=SUFFIX append SUFFIX to installed program names
284   --program-transform-name=PROGRAM
285                           run sed PROGRAM on installed program names
286 EOF
287     cat << EOF
288 Host type:
289   --build=BUILD           configure for building on BUILD [BUILD=HOST]
290   --host=HOST             configure for HOST [guessed]
291   --target=TARGET         configure for TARGET [TARGET=HOST]
292 Features and packages:
293   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
294   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
295   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
296   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
297   --x-includes=DIR        X include files are in DIR
298   --x-libraries=DIR       X library files are in DIR
299 EOF
300     if test -n "$ac_help"; then
301       echo "--enable and --with options recognized:$ac_help"
302     fi
303     exit 0 ;;
304
305   -host | --host | --hos | --ho)
306     ac_prev=host ;;
307   -host=* | --host=* | --hos=* | --ho=*)
308     host="$ac_optarg" ;;
309
310   -includedir | --includedir | --includedi | --included | --include \
311   | --includ | --inclu | --incl | --inc)
312     ac_prev=includedir ;;
313   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
314   | --includ=* | --inclu=* | --incl=* | --inc=*)
315     includedir="$ac_optarg" ;;
316
317   -infodir | --infodir | --infodi | --infod | --info | --inf)
318     ac_prev=infodir ;;
319   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
320     infodir="$ac_optarg" ;;
321
322   -libdir | --libdir | --libdi | --libd)
323     ac_prev=libdir ;;
324   -libdir=* | --libdir=* | --libdi=* | --libd=*)
325     libdir="$ac_optarg" ;;
326
327   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
328   | --libexe | --libex | --libe)
329     ac_prev=libexecdir ;;
330   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
331   | --libexe=* | --libex=* | --libe=*)
332     libexecdir="$ac_optarg" ;;
333
334   -localstatedir | --localstatedir | --localstatedi | --localstated \
335   | --localstate | --localstat | --localsta | --localst \
336   | --locals | --local | --loca | --loc | --lo)
337     ac_prev=localstatedir ;;
338   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
339   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
340   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
341     localstatedir="$ac_optarg" ;;
342
343   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
344     ac_prev=mandir ;;
345   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
346     mandir="$ac_optarg" ;;
347
348   -nfp | --nfp | --nf)
349     # Obsolete; use --without-fp.
350     with_fp=no ;;
351
352   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
353   | --no-cr | --no-c)
354     no_create=yes ;;
355
356   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
357   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
358     no_recursion=yes ;;
359
360   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
361   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
362   | --oldin | --oldi | --old | --ol | --o)
363     ac_prev=oldincludedir ;;
364   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
365   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
366   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
367     oldincludedir="$ac_optarg" ;;
368
369   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
370     ac_prev=prefix ;;
371   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
372     prefix="$ac_optarg" ;;
373
374   -program-prefix | --program-prefix | --program-prefi | --program-pref \
375   | --program-pre | --program-pr | --program-p)
376     ac_prev=program_prefix ;;
377   -program-prefix=* | --program-prefix=* | --program-prefi=* \
378   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
379     program_prefix="$ac_optarg" ;;
380
381   -program-suffix | --program-suffix | --program-suffi | --program-suff \
382   | --program-suf | --program-su | --program-s)
383     ac_prev=program_suffix ;;
384   -program-suffix=* | --program-suffix=* | --program-suffi=* \
385   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
386     program_suffix="$ac_optarg" ;;
387
388   -program-transform-name | --program-transform-name \
389   | --program-transform-nam | --program-transform-na \
390   | --program-transform-n | --program-transform- \
391   | --program-transform | --program-transfor \
392   | --program-transfo | --program-transf \
393   | --program-trans | --program-tran \
394   | --progr-tra | --program-tr | --program-t)
395     ac_prev=program_transform_name ;;
396   -program-transform-name=* | --program-transform-name=* \
397   | --program-transform-nam=* | --program-transform-na=* \
398   | --program-transform-n=* | --program-transform-=* \
399   | --program-transform=* | --program-transfor=* \
400   | --program-transfo=* | --program-transf=* \
401   | --program-trans=* | --program-tran=* \
402   | --progr-tra=* | --program-tr=* | --program-t=*)
403     program_transform_name="$ac_optarg" ;;
404
405   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
406   | -silent | --silent | --silen | --sile | --sil)
407     silent=yes ;;
408
409   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
410     ac_prev=sbindir ;;
411   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
412   | --sbi=* | --sb=*)
413     sbindir="$ac_optarg" ;;
414
415   -sharedstatedir | --sharedstatedir | --sharedstatedi \
416   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
417   | --sharedst | --shareds | --shared | --share | --shar \
418   | --sha | --sh)
419     ac_prev=sharedstatedir ;;
420   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
421   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
422   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
423   | --sha=* | --sh=*)
424     sharedstatedir="$ac_optarg" ;;
425
426   -site | --site | --sit)
427     ac_prev=site ;;
428   -site=* | --site=* | --sit=*)
429     site="$ac_optarg" ;;
430
431   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
432     ac_prev=srcdir ;;
433   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
434     srcdir="$ac_optarg" ;;
435
436   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
437   | --syscon | --sysco | --sysc | --sys | --sy)
438     ac_prev=sysconfdir ;;
439   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
440   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
441     sysconfdir="$ac_optarg" ;;
442
443   -target | --target | --targe | --targ | --tar | --ta | --t)
444     ac_prev=target ;;
445   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
446     target="$ac_optarg" ;;
447
448   -v | -verbose | --verbose | --verbos | --verbo | --verb)
449     verbose=yes ;;
450
451   -version | --version | --versio | --versi | --vers)
452     echo "configure generated by autoconf version 2.13.1"
453     exit 0 ;;
454
455   -with-* | --with-*)
456     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
457     # Reject names that are not valid shell variable names.
458     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
459       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
460     fi
461     ac_package=`echo $ac_package| sed 's/-/_/g'`
462     case "$ac_option" in
463       *=*) ;;
464       *) ac_optarg=yes ;;
465     esac
466     eval "with_${ac_package}='$ac_optarg'" ;;
467
468   -without-* | --without-*)
469     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
470     # Reject names that are not valid shell variable names.
471     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
472       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
473     fi
474     ac_package=`echo $ac_package| sed 's/-/_/g'`
475     eval "with_${ac_package}=no" ;;
476
477   --x)
478     # Obsolete; use --with-x.
479     with_x=yes ;;
480
481   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
482   | --x-incl | --x-inc | --x-in | --x-i)
483     ac_prev=x_includes ;;
484   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
485   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
486     x_includes="$ac_optarg" ;;
487
488   -x-libraries | --x-libraries | --x-librarie | --x-librari \
489   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
490     ac_prev=x_libraries ;;
491   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
492   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
493     x_libraries="$ac_optarg" ;;
494
495   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
496     ;;
497
498   *)
499     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
500       echo "configure: warning: $ac_option: invalid host type" 1>&2
501     fi
502     if test "x$nonopt" != xNONE; then
503       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
504     fi
505     nonopt="$ac_option"
506     ;;
507
508   esac
509 done
510
511 if test -n "$ac_prev"; then
512   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
513 fi
514
515 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
516
517 # File descriptor usage:
518 # 0 standard input
519 # 1 file creation
520 # 2 errors and warnings
521 # 3 some systems may open it to /dev/tty
522 # 4 used on the Kubota Titan
523 # 6 checking for... messages and results
524 # 5 compiler messages saved in config.log
525 if test "$silent" = yes; then
526   exec 6>/dev/null
527 else
528   exec 6>&1
529 fi
530 exec 5>./config.log
531
532 echo "\
533 This file contains any messages produced by compilers while
534 running configure, to aid debugging if configure makes a mistake.
535 " 1>&5
536
537 # Strip out --no-create and --no-recursion so they do not pile up.
538 # Also quote any args containing shell metacharacters.
539 ac_configure_args=
540 for ac_arg
541 do
542   case "$ac_arg" in
543   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
544   | --no-cr | --no-c) ;;
545   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
546   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
547   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
548   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
549   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
550   esac
551 done
552
553 # NLS nuisances.
554 # Only set these to C if already set.  These must not be set unconditionally
555 # because not all systems understand e.g. LANG=C (notably SCO).
556 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
557 # Non-C LC_CTYPE values break the ctype check.
558 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
559 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
560 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
561 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
562
563 # confdefs.h avoids OS command line length limits that DEFS can exceed.
564 rm -rf conftest* confdefs.h
565 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
566 echo > confdefs.h
567
568 # A filename unique to this package, relative to the directory that
569 # configure is in, which we can look for to find out if srcdir is correct.
570 ac_unique_file=build/version
571
572 # Find the source files, if location was not specified.
573 if test -z "$srcdir"; then
574   ac_srcdir_defaulted=yes
575   # Try the directory containing this script, then its parent.
576   ac_prog=$0
577   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
578   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
579   srcdir=$ac_confdir
580   if test ! -r $srcdir/$ac_unique_file; then
581     srcdir=..
582   fi
583 else
584   ac_srcdir_defaulted=no
585 fi
586 if test ! -r $srcdir/$ac_unique_file; then
587   if test "$ac_srcdir_defaulted" = yes; then
588     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
589   else
590     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
591   fi
592 fi
593 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
594
595 # Prefer explicitly selected file to automatically selected ones.
596 if test -z "$CONFIG_SITE"; then
597   if test "x$prefix" != xNONE; then
598     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
599   else
600     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
601   fi
602 fi
603 for ac_site_file in $CONFIG_SITE; do
604   if test -r "$ac_site_file"; then
605     echo "loading site script $ac_site_file"
606     . "$ac_site_file"
607   fi
608 done
609
610
611 ac_ext=c
612 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
613 ac_cpp='$CPP $CPPFLAGS'
614 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
615 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
616 cross_compiling=$ac_cv_prog_cc_cross
617
618 ac_exeext=
619 ac_objext=o
620 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
621   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
622   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
623     ac_n= ac_c='
624 ' ac_t='        '
625   else
626     ac_n=-n ac_c= ac_t=
627   fi
628 else
629   ac_n= ac_c='\c' ac_t=
630 fi
631
632
633 # set unset (borrowed from autoconf 2.49c)
634 if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
635   ol_unset=unset
636 else
637   ol_unset=false
638 fi
639 # unset CDPATH
640 $ol_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
641
642 ac_aux_dir=
643 for ac_dir in build $srcdir/build; do
644   if test -f $ac_dir/install-sh; then
645     ac_aux_dir=$ac_dir
646     ac_install_sh="$ac_aux_dir/install-sh -c"
647     break
648   elif test -f $ac_dir/install.sh; then
649     ac_aux_dir=$ac_dir
650     ac_install_sh="$ac_aux_dir/install.sh -c"
651     break
652   elif test -f $ac_dir/shtool; then
653     ac_aux_dir=$ac_dir
654     ac_install_sh="$ac_aux_dir/shtool install -c"
655     break
656   fi
657 done
658 if test -z "$ac_aux_dir"; then
659   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
660 fi
661 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
662 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
663 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
664
665 OL_VERSION=`cat $ac_aux_dir/version`
666 if test -z "$OL_VERSION"; then
667         { echo "configure: error: could not determine version" 1>&2; exit 1; }
668 fi
669
670 echo "Configuring OpenLDAP $OL_VERSION ..."
671
672
673 echo $ac_n "checking host system type""... $ac_c" 1>&6
674 echo "configure:675: checking host system type" >&5
675 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
676
677 # Make sure we can run config.sub.
678   if $ac_config_sub sun4 >/dev/null 2>&1; then :
679     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
680   fi
681
682   ac_cv_host_alias=$host
683   case "$ac_cv_host_alias" in
684   NONE)
685     case $nonopt in
686     NONE)
687       if ac_cv_host_alias=`$ac_config_guess`; then :
688       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
689       fi ;;
690     *) ac_cv_host_alias=$nonopt ;;
691     esac ;;
692   esac
693
694   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
695   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
696   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
697   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
698 else
699   echo $ac_n "(cached) $ac_c" 1>&6
700 fi
701
702 echo "$ac_t""$ac_cv_host" 1>&6
703
704 host=$ac_cv_host
705 host_alias=$ac_cv_host_alias
706 host_cpu=$ac_cv_host_cpu
707 host_vendor=$ac_cv_host_vendor
708 host_os=$ac_cv_host_os
709
710
711
712
713
714 echo $ac_n "checking target system type""... $ac_c" 1>&6
715 echo "configure:716: checking target system type" >&5
716 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
717
718 # Make sure we can run config.sub.
719   if $ac_config_sub sun4 >/dev/null 2>&1; then :
720     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
721   fi
722
723   ac_cv_target_alias=$target
724   case "$ac_cv_target_alias" in
725   NONE)
726     case $nonopt in
727     NONE)
728       ac_cv_target_alias=$host_alias ;;
729
730     *) ac_cv_target_alias=$nonopt ;;
731     esac ;;
732   esac
733
734   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
735   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
736   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
737   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
738 else
739   echo $ac_n "(cached) $ac_c" 1>&6
740 fi
741
742 echo "$ac_t""$ac_cv_target" 1>&6
743
744 target=$ac_cv_target
745 target_alias=$ac_cv_target_alias
746 target_cpu=$ac_cv_target_cpu
747 target_vendor=$ac_cv_target_vendor
748 target_os=$ac_cv_target_os
749
750
751
752
753
754 echo $ac_n "checking build system type""... $ac_c" 1>&6
755 echo "configure:756: checking build system type" >&5
756 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
757
758 # Make sure we can run config.sub.
759   if $ac_config_sub sun4 >/dev/null 2>&1; then :
760     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
761   fi
762
763   ac_cv_build_alias=$build
764   case "$ac_cv_build_alias" in
765   NONE)
766     case $nonopt in
767     NONE)
768       ac_cv_build_alias=$host_alias ;;
769
770     *) ac_cv_build_alias=$nonopt ;;
771     esac ;;
772   esac
773
774   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
775   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
776   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
777   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
778 else
779   echo $ac_n "(cached) $ac_c" 1>&6
780 fi
781
782 echo "$ac_t""$ac_cv_build" 1>&6
783
784 build=$ac_cv_build
785 build_alias=$ac_cv_build_alias
786 build_cpu=$ac_cv_build_cpu
787 build_vendor=$ac_cv_build_vendor
788 build_os=$ac_cv_build_os
789
790
791
792
793
794 # Do some error checking and defaulting for the host and target type.
795 # The inputs are:
796 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
797 #
798 # The rules are:
799 # 1. You are not allowed to specify --host, --target, and nonopt at the
800 #    same time.
801 # 2. Host defaults to nonopt.
802 # 3. If nonopt is not specified, then host defaults to the current host,
803 #    as determined by config.guess.
804 # 4. Target and build default to nonopt.
805 # 5. If nonopt is not specified, then target and build default to host.
806
807 # The aliases save the names the user supplied, while $host etc.
808 # will get canonicalized.
809 case $host---$target---$nonopt in
810 NONE---*---* | *---NONE---* | *---*---NONE) ;;
811 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
812 esac
813
814 test "$host_alias" != "$target_alias" &&
815   test "$program_prefix$program_suffix$program_transform_name" = \
816     NONENONEs,x,x, &&
817   program_prefix=${target_alias}-
818
819
820 # Find a good install program.  We prefer a C program (faster),
821 # so one script is as good as another.  But avoid the broken or
822 # incompatible versions:
823 # SysV /etc/install, /usr/sbin/install
824 # SunOS /usr/etc/install
825 # IRIX /sbin/install
826 # AIX /bin/install
827 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
828 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
829 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
830 # ./install, which can be erroneously created by make from ./install.sh.
831 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
832 echo "configure:833: checking for a BSD compatible install" >&5
833 if test -z "$INSTALL"; then
834 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
835   echo $ac_n "(cached) $ac_c" 1>&6
836 else
837     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
838   for ac_dir in $PATH; do
839     # Account for people who put trailing slashes in PATH elements.
840     case "$ac_dir/" in
841     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
842     *)
843       # OSF1 and SCO ODT 3.0 have their own names for install.
844       # Don't use installbsd from OSF since it installs stuff as root
845       # by default.
846       for ac_prog in ginstall scoinst install; do
847         if test -f $ac_dir/$ac_prog; then
848           if test $ac_prog = install &&
849             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
850             # AIX install.  It has an incompatible calling convention.
851             :
852           elif test $ac_prog = install &&
853             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
854             # program-specific install script used by HP pwplus--don't use.
855             :
856           else
857             ac_cv_path_install="$ac_dir/$ac_prog -c"
858             break 2
859           fi
860         fi
861       done
862       ;;
863     esac
864   done
865   IFS="$ac_save_IFS"
866
867 fi
868   if test "${ac_cv_path_install+set}" = set; then
869     INSTALL="$ac_cv_path_install"
870   else
871     # As a last resort, use the slow shell script.  We don't cache a
872     # path for INSTALL within a source directory, because that will
873     # break other packages using the cache if that directory is
874     # removed, or if the path is relative.
875     INSTALL="$ac_install_sh"
876   fi
877 fi
878 echo "$ac_t""$INSTALL" 1>&6
879
880 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
881 # It thinks the first close brace ends the variable substitution.
882 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
883
884 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
885
886 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
887
888 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
889 echo "configure:890: checking whether build environment is sane" >&5
890 # Just in case
891 sleep 1
892 echo timestamp > conftestfile
893 # Do `set' in a subshell so we don't clobber the current shell's
894 # arguments.  Must try -L first in case configure is actually a
895 # symlink; some systems play weird games with the mod time of symlinks
896 # (eg FreeBSD returns the mod time of the symlink's containing
897 # directory).
898 if (
899    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
900    if test "$*" = "X"; then
901       # -L didn't work.
902       set X `ls -t $srcdir/configure conftestfile`
903    fi
904    if test "$*" != "X $srcdir/configure conftestfile" \
905       && test "$*" != "X conftestfile $srcdir/configure"; then
906
907       # If neither matched, then we have a broken ls.  This can happen
908       # if, for instance, CONFIG_SHELL is bash and it inherits a
909       # broken ls alias from the environment.  This has actually
910       # happened.  Such a system could not be considered "sane".
911       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
912 alias in your environment" 1>&2; exit 1; }
913    fi
914
915    test "$2" = conftestfile
916    )
917 then
918    # Ok.
919    :
920 else
921    { echo "configure: error: newly created file is older than distributed files!
922 Check your system clock" 1>&2; exit 1; }
923 fi
924 rm -f conftest*
925 echo "$ac_t""yes" 1>&6
926 if test "$program_transform_name" = s,x,x,; then
927   program_transform_name=
928 else
929   # Double any \ or $.  echo might interpret backslashes.
930   cat <<\EOF_SED > conftestsed
931 s,\\,\\\\,g; s,\$,$$,g
932 EOF_SED
933   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
934   rm -f conftestsed
935 fi
936 test "$program_prefix" != NONE &&
937   program_transform_name="s,^,${program_prefix},;$program_transform_name"
938 # Use a double $ so make ignores it.
939 test "$program_suffix" != NONE &&
940   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
941
942 # sed with no file args requires a program.
943 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
944
945 for ac_prog in mawk gawk nawk awk
946 do
947 # Extract the first word of "$ac_prog", so it can be a program name with args.
948 set dummy $ac_prog; ac_word=$2
949 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
950 echo "configure:951: checking for $ac_word" >&5
951 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
952   echo $ac_n "(cached) $ac_c" 1>&6
953 else
954   if test -n "$AWK"; then
955   ac_cv_prog_AWK="$AWK" # Let the user override the test.
956 else
957   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
958   ac_dummy="$PATH"
959   for ac_dir in $ac_dummy; do
960     test -z "$ac_dir" && ac_dir=.
961     if test -f $ac_dir/$ac_word; then
962       ac_cv_prog_AWK="$ac_prog"
963       break
964     fi
965   done
966   IFS="$ac_save_ifs"
967 fi
968 fi
969 AWK="$ac_cv_prog_AWK"
970 if test -n "$AWK"; then
971   echo "$ac_t""$AWK" 1>&6
972 else
973   echo "$ac_t""no" 1>&6
974 fi
975
976 test -n "$AWK" && break
977 done
978
979 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
980 echo "configure:981: checking whether ${MAKE-make} sets \${MAKE}" >&5
981 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
982 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
983   echo $ac_n "(cached) $ac_c" 1>&6
984 else
985   cat > conftestmake <<\EOF
986 all:
987         @echo 'ac_maketemp="${MAKE}"'
988 EOF
989 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
990 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
991 if test -n "$ac_maketemp"; then
992   eval ac_cv_prog_make_${ac_make}_set=yes
993 else
994   eval ac_cv_prog_make_${ac_make}_set=no
995 fi
996 rm -f conftestmake
997 fi
998 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
999   echo "$ac_t""yes" 1>&6
1000   SET_MAKE=
1001 else
1002   echo "$ac_t""no" 1>&6
1003   SET_MAKE="MAKE=${MAKE-make}"
1004 fi
1005
1006
1007
1008 PACKAGE=OpenLDAP
1009
1010 VERSION=$OL_VERSION
1011
1012 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1013   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1014 fi
1015
1016
1017
1018 missing_dir=`cd $ac_aux_dir && pwd`
1019 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1020 echo "configure:1021: checking for working aclocal" >&5
1021 # Run test in a subshell; some versions of sh will print an error if
1022 # an executable is not found, even if stderr is redirected.
1023 # Redirect stdin to placate older versions of autoconf.  Sigh.
1024 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1025    ACLOCAL=aclocal
1026    echo "$ac_t""found" 1>&6
1027 else
1028    ACLOCAL="$missing_dir/missing aclocal"
1029    echo "$ac_t""missing" 1>&6
1030 fi
1031
1032 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1033 echo "configure:1034: checking for working autoconf" >&5
1034 # Run test in a subshell; some versions of sh will print an error if
1035 # an executable is not found, even if stderr is redirected.
1036 # Redirect stdin to placate older versions of autoconf.  Sigh.
1037 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1038    AUTOCONF=autoconf
1039    echo "$ac_t""found" 1>&6
1040 else
1041    AUTOCONF="$missing_dir/missing autoconf"
1042    echo "$ac_t""missing" 1>&6
1043 fi
1044
1045 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1046 echo "configure:1047: checking for working automake" >&5
1047 # Run test in a subshell; some versions of sh will print an error if
1048 # an executable is not found, even if stderr is redirected.
1049 # Redirect stdin to placate older versions of autoconf.  Sigh.
1050 if (automake --version) < /dev/null > /dev/null 2>&1; then
1051    AUTOMAKE=automake
1052    echo "$ac_t""found" 1>&6
1053 else
1054    AUTOMAKE="$missing_dir/missing automake"
1055    echo "$ac_t""missing" 1>&6
1056 fi
1057
1058 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1059 echo "configure:1060: checking for working autoheader" >&5
1060 # Run test in a subshell; some versions of sh will print an error if
1061 # an executable is not found, even if stderr is redirected.
1062 # Redirect stdin to placate older versions of autoconf.  Sigh.
1063 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1064    AUTOHEADER=autoheader
1065    echo "$ac_t""found" 1>&6
1066 else
1067    AUTOHEADER="$missing_dir/missing autoheader"
1068    echo "$ac_t""missing" 1>&6
1069 fi
1070
1071 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1072 echo "configure:1073: checking for working makeinfo" >&5
1073 # Run test in a subshell; some versions of sh will print an error if
1074 # an executable is not found, even if stderr is redirected.
1075 # Redirect stdin to placate older versions of autoconf.  Sigh.
1076 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1077    MAKEINFO=makeinfo
1078    echo "$ac_t""found" 1>&6
1079 else
1080    MAKEINFO="$missing_dir/missing makeinfo"
1081    echo "$ac_t""missing" 1>&6
1082 fi
1083
1084 install_sh="$missing_dir/install-sh"
1085 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1086
1087 for ac_prog in gnutar gtar tar
1088 do
1089 # Extract the first word of "$ac_prog", so it can be a program name with args.
1090 set dummy $ac_prog; ac_word=$2
1091 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1092 echo "configure:1093: checking for $ac_word" >&5
1093 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1094   echo $ac_n "(cached) $ac_c" 1>&6
1095 else
1096   if test -n "$AMTAR"; then
1097   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1098 else
1099   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1100   ac_dummy="$PATH"
1101   for ac_dir in $ac_dummy; do
1102     test -z "$ac_dir" && ac_dir=.
1103     if test -f $ac_dir/$ac_word; then
1104       ac_cv_prog_AMTAR="$ac_prog"
1105       break
1106     fi
1107   done
1108   IFS="$ac_save_ifs"
1109 fi
1110 fi
1111 AMTAR="$ac_cv_prog_AMTAR"
1112 if test -n "$AMTAR"; then
1113   echo "$ac_t""$AMTAR" 1>&6
1114 else
1115   echo "$ac_t""no" 1>&6
1116 fi
1117
1118 test -n "$AMTAR" && break
1119 done
1120
1121
1122 AMTARFLAGS=
1123 if test -n "$AMTAR"; then
1124   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1125         AMTARFLAGS=o
1126   fi
1127 fi
1128
1129 cat >> confdefs.h <<EOF
1130 #define OPENLDAP_PACKAGE "$PACKAGE"
1131 EOF
1132
1133 cat >> confdefs.h <<EOF
1134 #define OPENLDAP_VERSION "$VERSION"
1135 EOF
1136
1137
1138
1139
1140 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1141 echo "configure:1142: checking configure arguments" >&5
1142
1143
1144 top_builddir=`pwd`
1145
1146 ldap_subdir="/openldap"
1147
1148 # Check whether --with-subdir or --without-subdir was given.
1149 if test "${with_subdir+set}" = set; then
1150   withval="$with_subdir"
1151   case "$withval" in
1152         no) ldap_subdir=""
1153                 ;;
1154         yes)
1155                 ;;
1156         /*|\\*)
1157                 ldap_subdir="$withval"
1158                 ;;
1159         *)
1160                 ldap_subdir="/$withval"
1161                 ;;
1162 esac
1163
1164 fi
1165
1166
1167 # OpenLDAP --enable-debug
1168         # Check whether --enable-debug or --disable-debug was given.
1169 if test "${enable_debug+set}" = set; then
1170   enableval="$enable_debug"
1171   
1172         ol_arg=invalid
1173         for ol_val in auto yes no ; do
1174                 if test "$enableval" = "$ol_val" ; then
1175                         ol_arg="$ol_val"
1176                 fi
1177         done
1178         if test "$ol_arg" = "invalid" ; then
1179                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1180         fi
1181         ol_enable_debug="$ol_arg"
1182
1183 else
1184         ol_enable_debug="yes"
1185 fi
1186 # end --enable-debug
1187 # OpenLDAP --enable-syslog
1188         # Check whether --enable-syslog or --disable-syslog was given.
1189 if test "${enable_syslog+set}" = set; then
1190   enableval="$enable_syslog"
1191   
1192         ol_arg=invalid
1193         for ol_val in auto yes no ; do
1194                 if test "$enableval" = "$ol_val" ; then
1195                         ol_arg="$ol_val"
1196                 fi
1197         done
1198         if test "$ol_arg" = "invalid" ; then
1199                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1200         fi
1201         ol_enable_syslog="$ol_arg"
1202
1203 else
1204         ol_enable_syslog="auto"
1205 fi
1206 # end --enable-syslog
1207 # OpenLDAP --enable-proctitle
1208         # Check whether --enable-proctitle or --disable-proctitle was given.
1209 if test "${enable_proctitle+set}" = set; then
1210   enableval="$enable_proctitle"
1211   
1212         ol_arg=invalid
1213         for ol_val in auto yes no ; do
1214                 if test "$enableval" = "$ol_val" ; then
1215                         ol_arg="$ol_val"
1216                 fi
1217         done
1218         if test "$ol_arg" = "invalid" ; then
1219                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1220         fi
1221         ol_enable_proctitle="$ol_arg"
1222
1223 else
1224         ol_enable_proctitle="yes"
1225 fi
1226 # end --enable-proctitle
1227 # OpenLDAP --enable-cache
1228         # Check whether --enable-cache or --disable-cache was given.
1229 if test "${enable_cache+set}" = set; then
1230   enableval="$enable_cache"
1231   
1232         ol_arg=invalid
1233         for ol_val in auto yes no ; do
1234                 if test "$enableval" = "$ol_val" ; then
1235                         ol_arg="$ol_val"
1236                 fi
1237         done
1238         if test "$ol_arg" = "invalid" ; then
1239                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
1240         fi
1241         ol_enable_cache="$ol_arg"
1242
1243 else
1244         ol_enable_cache="no"
1245 fi
1246 # end --enable-cache
1247 # OpenLDAP --enable-referrals
1248         # Check whether --enable-referrals or --disable-referrals was given.
1249 if test "${enable_referrals+set}" = set; then
1250   enableval="$enable_referrals"
1251   
1252         ol_arg=invalid
1253         for ol_val in auto yes no ; do
1254                 if test "$enableval" = "$ol_val" ; then
1255                         ol_arg="$ol_val"
1256                 fi
1257         done
1258         if test "$ol_arg" = "invalid" ; then
1259                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1260         fi
1261         ol_enable_referrals="$ol_arg"
1262
1263 else
1264         ol_enable_referrals="no"
1265 fi
1266 # end --enable-referrals
1267 # OpenLDAP --enable-kbind
1268         # Check whether --enable-kbind or --disable-kbind was given.
1269 if test "${enable_kbind+set}" = set; then
1270   enableval="$enable_kbind"
1271   
1272         ol_arg=invalid
1273         for ol_val in auto yes no ; do
1274                 if test "$enableval" = "$ol_val" ; then
1275                         ol_arg="$ol_val"
1276                 fi
1277         done
1278         if test "$ol_arg" = "invalid" ; then
1279                 { echo "configure: error: bad value $enableval for --enable-kbind" 1>&2; exit 1; }
1280         fi
1281         ol_enable_kbind="$ol_arg"
1282
1283 else
1284         ol_enable_kbind="no"
1285 fi
1286 # end --enable-kbind
1287 # OpenLDAP --enable-ipv6
1288         # Check whether --enable-ipv6 or --disable-ipv6 was given.
1289 if test "${enable_ipv6+set}" = set; then
1290   enableval="$enable_ipv6"
1291   
1292         ol_arg=invalid
1293         for ol_val in auto yes no ; do
1294                 if test "$enableval" = "$ol_val" ; then
1295                         ol_arg="$ol_val"
1296                 fi
1297         done
1298         if test "$ol_arg" = "invalid" ; then
1299                 { echo "configure: error: bad value $enableval for --enable-ipv6" 1>&2; exit 1; }
1300         fi
1301         ol_enable_ipv6="$ol_arg"
1302
1303 else
1304         ol_enable_ipv6="auto"
1305 fi
1306 # end --enable-ipv6
1307 # OpenLDAP --enable-local
1308         # Check whether --enable-local or --disable-local was given.
1309 if test "${enable_local+set}" = set; then
1310   enableval="$enable_local"
1311   
1312         ol_arg=invalid
1313         for ol_val in auto yes no ; do
1314                 if test "$enableval" = "$ol_val" ; then
1315                         ol_arg="$ol_val"
1316                 fi
1317         done
1318         if test "$ol_arg" = "invalid" ; then
1319                 { echo "configure: error: bad value $enableval for --enable-local" 1>&2; exit 1; }
1320         fi
1321         ol_enable_local="$ol_arg"
1322
1323 else
1324         ol_enable_local="auto"
1325 fi
1326 # end --enable-local
1327 # OpenLDAP --enable-x_compile
1328         # Check whether --enable-x_compile or --disable-x_compile was given.
1329 if test "${enable_x_compile+set}" = set; then
1330   enableval="$enable_x_compile"
1331   
1332         ol_arg=invalid
1333         for ol_val in yes no ; do
1334                 if test "$enableval" = "$ol_val" ; then
1335                         ol_arg="$ol_val"
1336                 fi
1337         done
1338         if test "$ol_arg" = "invalid" ; then
1339                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1340         fi
1341         ol_enable_x_compile="$ol_arg"
1342
1343 else
1344         ol_enable_x_compile="no"
1345 fi
1346 # end --enable-x_compile
1347
1348
1349 # OpenLDAP --with-cyrus_sasl
1350         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1351 if test "${with_cyrus_sasl+set}" = set; then
1352   withval="$with_cyrus_sasl"
1353   
1354         ol_arg=invalid
1355         for ol_val in auto yes no  ; do
1356                 if test "$withval" = "$ol_val" ; then
1357                         ol_arg="$ol_val"
1358                 fi
1359         done
1360         if test "$ol_arg" = "invalid" ; then
1361                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1362         fi
1363         ol_with_cyrus_sasl="$ol_arg"
1364
1365 else
1366         ol_with_cyrus_sasl="auto"
1367 fi
1368 # end --with-cyrus_sasl
1369
1370 # OpenLDAP --with-fetch
1371         # Check whether --with-fetch or --without-fetch was given.
1372 if test "${with_fetch+set}" = set; then
1373   withval="$with_fetch"
1374   
1375         ol_arg=invalid
1376         for ol_val in auto yes no  ; do
1377                 if test "$withval" = "$ol_val" ; then
1378                         ol_arg="$ol_val"
1379                 fi
1380         done
1381         if test "$ol_arg" = "invalid" ; then
1382                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1383         fi
1384         ol_with_fetch="$ol_arg"
1385
1386 else
1387         ol_with_fetch="auto"
1388 fi
1389 # end --with-fetch
1390
1391 # OpenLDAP --with-kerberos
1392         # Check whether --with-kerberos or --without-kerberos was given.
1393 if test "${with_kerberos+set}" = set; then
1394   withval="$with_kerberos"
1395   
1396         ol_arg=invalid
1397         for ol_val in auto k5 k5only k425 kth k4 afs yes no ; do
1398                 if test "$withval" = "$ol_val" ; then
1399                         ol_arg="$ol_val"
1400                 fi
1401         done
1402         if test "$ol_arg" = "invalid" ; then
1403                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1404         fi
1405         ol_with_kerberos="$ol_arg"
1406
1407 else
1408         ol_with_kerberos="auto"
1409 fi
1410 # end --with-kerberos
1411
1412 # OpenLDAP --with-readline
1413         # Check whether --with-readline or --without-readline was given.
1414 if test "${with_readline+set}" = set; then
1415   withval="$with_readline"
1416   
1417         ol_arg=invalid
1418         for ol_val in auto yes no  ; do
1419                 if test "$withval" = "$ol_val" ; then
1420                         ol_arg="$ol_val"
1421                 fi
1422         done
1423         if test "$ol_arg" = "invalid" ; then
1424                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1425         fi
1426         ol_with_readline="$ol_arg"
1427
1428 else
1429         ol_with_readline="auto"
1430 fi
1431 # end --with-readline
1432
1433 # OpenLDAP --with-threads
1434         # Check whether --with-threads or --without-threads was given.
1435 if test "${with_threads+set}" = set; then
1436   withval="$with_threads"
1437   
1438         ol_arg=invalid
1439         for ol_val in auto nt posix mach pth lwp yes no manual  ; do
1440                 if test "$withval" = "$ol_val" ; then
1441                         ol_arg="$ol_val"
1442                 fi
1443         done
1444         if test "$ol_arg" = "invalid" ; then
1445                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1446         fi
1447         ol_with_threads="$ol_arg"
1448
1449 else
1450         ol_with_threads="auto"
1451 fi
1452 # end --with-threads
1453
1454 # OpenLDAP --with-tls
1455         # Check whether --with-tls or --without-tls was given.
1456 if test "${with_tls+set}" = set; then
1457   withval="$with_tls"
1458   
1459         ol_arg=invalid
1460         for ol_val in auto ssleay openssl yes no  ; do
1461                 if test "$withval" = "$ol_val" ; then
1462                         ol_arg="$ol_val"
1463                 fi
1464         done
1465         if test "$ol_arg" = "invalid" ; then
1466                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1467         fi
1468         ol_with_tls="$ol_arg"
1469
1470 else
1471         ol_with_tls="auto"
1472 fi
1473 # end --with-tls
1474
1475 # OpenLDAP --with-yielding_select
1476         # Check whether --with-yielding_select or --without-yielding_select was given.
1477 if test "${with_yielding_select+set}" = set; then
1478   withval="$with_yielding_select"
1479   
1480         ol_arg=invalid
1481         for ol_val in auto yes no manual  ; do
1482                 if test "$withval" = "$ol_val" ; then
1483                         ol_arg="$ol_val"
1484                 fi
1485         done
1486         if test "$ol_arg" = "invalid" ; then
1487                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1488         fi
1489         ol_with_yielding_select="$ol_arg"
1490
1491 else
1492         ol_with_yielding_select="auto"
1493 fi
1494 # end --with-yielding_select
1495
1496
1497
1498 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1499 if test "${with_xxslapdoptions+set}" = set; then
1500   withval="$with_xxslapdoptions"
1501   :
1502 fi
1503
1504 # OpenLDAP --enable-slapd
1505         # Check whether --enable-slapd or --disable-slapd was given.
1506 if test "${enable_slapd+set}" = set; then
1507   enableval="$enable_slapd"
1508   
1509         ol_arg=invalid
1510         for ol_val in auto yes no ; do
1511                 if test "$enableval" = "$ol_val" ; then
1512                         ol_arg="$ol_val"
1513                 fi
1514         done
1515         if test "$ol_arg" = "invalid" ; then
1516                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1517         fi
1518         ol_enable_slapd="$ol_arg"
1519
1520 else
1521         ol_enable_slapd="yes"
1522 fi
1523 # end --enable-slapd
1524 # OpenLDAP --enable-cleartext
1525         # Check whether --enable-cleartext or --disable-cleartext was given.
1526 if test "${enable_cleartext+set}" = set; then
1527   enableval="$enable_cleartext"
1528   
1529         ol_arg=invalid
1530         for ol_val in auto yes no ; do
1531                 if test "$enableval" = "$ol_val" ; then
1532                         ol_arg="$ol_val"
1533                 fi
1534         done
1535         if test "$ol_arg" = "invalid" ; then
1536                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1537         fi
1538         ol_enable_cleartext="$ol_arg"
1539
1540 else
1541         ol_enable_cleartext="yes"
1542 fi
1543 # end --enable-cleartext
1544 # OpenLDAP --enable-crypt
1545         # Check whether --enable-crypt or --disable-crypt was given.
1546 if test "${enable_crypt+set}" = set; then
1547   enableval="$enable_crypt"
1548   
1549         ol_arg=invalid
1550         for ol_val in auto yes no ; do
1551                 if test "$enableval" = "$ol_val" ; then
1552                         ol_arg="$ol_val"
1553                 fi
1554         done
1555         if test "$ol_arg" = "invalid" ; then
1556                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1557         fi
1558         ol_enable_crypt="$ol_arg"
1559
1560 else
1561         ol_enable_crypt="auto"
1562 fi
1563 # end --enable-crypt
1564 # OpenLDAP --enable-kpasswd
1565         # Check whether --enable-kpasswd or --disable-kpasswd was given.
1566 if test "${enable_kpasswd+set}" = set; then
1567   enableval="$enable_kpasswd"
1568   
1569         ol_arg=invalid
1570         for ol_val in auto yes no ; do
1571                 if test "$enableval" = "$ol_val" ; then
1572                         ol_arg="$ol_val"
1573                 fi
1574         done
1575         if test "$ol_arg" = "invalid" ; then
1576                 { echo "configure: error: bad value $enableval for --enable-kpasswd" 1>&2; exit 1; }
1577         fi
1578         ol_enable_kpasswd="$ol_arg"
1579
1580 else
1581         ol_enable_kpasswd="no"
1582 fi
1583 # end --enable-kpasswd
1584 # OpenLDAP --enable-spasswd
1585         # Check whether --enable-spasswd or --disable-spasswd was given.
1586 if test "${enable_spasswd+set}" = set; then
1587   enableval="$enable_spasswd"
1588   
1589         ol_arg=invalid
1590         for ol_val in auto yes no ; do
1591                 if test "$enableval" = "$ol_val" ; then
1592                         ol_arg="$ol_val"
1593                 fi
1594         done
1595         if test "$ol_arg" = "invalid" ; then
1596                 { echo "configure: error: bad value $enableval for --enable-spasswd" 1>&2; exit 1; }
1597         fi
1598         ol_enable_spasswd="$ol_arg"
1599
1600 else
1601         ol_enable_spasswd="no"
1602 fi
1603 # end --enable-spasswd
1604 # OpenLDAP --enable-modules
1605         # Check whether --enable-modules or --disable-modules was given.
1606 if test "${enable_modules+set}" = set; then
1607   enableval="$enable_modules"
1608   
1609         ol_arg=invalid
1610         for ol_val in auto yes no ; do
1611                 if test "$enableval" = "$ol_val" ; then
1612                         ol_arg="$ol_val"
1613                 fi
1614         done
1615         if test "$ol_arg" = "invalid" ; then
1616                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1617         fi
1618         ol_enable_modules="$ol_arg"
1619
1620 else
1621         ol_enable_modules="no"
1622 fi
1623 # end --enable-modules
1624 # OpenLDAP --enable-phonetic
1625         # Check whether --enable-phonetic or --disable-phonetic was given.
1626 if test "${enable_phonetic+set}" = set; then
1627   enableval="$enable_phonetic"
1628   
1629         ol_arg=invalid
1630         for ol_val in auto yes no ; do
1631                 if test "$enableval" = "$ol_val" ; then
1632                         ol_arg="$ol_val"
1633                 fi
1634         done
1635         if test "$ol_arg" = "invalid" ; then
1636                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1637         fi
1638         ol_enable_phonetic="$ol_arg"
1639
1640 else
1641         ol_enable_phonetic="no"
1642 fi
1643 # end --enable-phonetic
1644 # OpenLDAP --enable-rlookups
1645         # Check whether --enable-rlookups or --disable-rlookups was given.
1646 if test "${enable_rlookups+set}" = set; then
1647   enableval="$enable_rlookups"
1648   
1649         ol_arg=invalid
1650         for ol_val in auto yes no ; do
1651                 if test "$enableval" = "$ol_val" ; then
1652                         ol_arg="$ol_val"
1653                 fi
1654         done
1655         if test "$ol_arg" = "invalid" ; then
1656                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1657         fi
1658         ol_enable_rlookups="$ol_arg"
1659
1660 else
1661         ol_enable_rlookups="no"
1662 fi
1663 # end --enable-rlookups
1664 # OpenLDAP --enable-aci
1665         # Check whether --enable-aci or --disable-aci was given.
1666 if test "${enable_aci+set}" = set; then
1667   enableval="$enable_aci"
1668   
1669         ol_arg=invalid
1670         for ol_val in auto yes no ; do
1671                 if test "$enableval" = "$ol_val" ; then
1672                         ol_arg="$ol_val"
1673                 fi
1674         done
1675         if test "$ol_arg" = "invalid" ; then
1676                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1677         fi
1678         ol_enable_aci="$ol_arg"
1679
1680 else
1681         ol_enable_aci="no"
1682 fi
1683 # end --enable-aci
1684 # OpenLDAP --enable-wrappers
1685         # Check whether --enable-wrappers or --disable-wrappers was given.
1686 if test "${enable_wrappers+set}" = set; then
1687   enableval="$enable_wrappers"
1688   
1689         ol_arg=invalid
1690         for ol_val in auto yes no ; do
1691                 if test "$enableval" = "$ol_val" ; then
1692                         ol_arg="$ol_val"
1693                 fi
1694         done
1695         if test "$ol_arg" = "invalid" ; then
1696                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1697         fi
1698         ol_enable_wrappers="$ol_arg"
1699
1700 else
1701         ol_enable_wrappers="no"
1702 fi
1703 # end --enable-wrappers
1704 # OpenLDAP --enable-dynamic
1705         # Check whether --enable-dynamic or --disable-dynamic was given.
1706 if test "${enable_dynamic+set}" = set; then
1707   enableval="$enable_dynamic"
1708   
1709         ol_arg=invalid
1710         for ol_val in auto yes no ; do
1711                 if test "$enableval" = "$ol_val" ; then
1712                         ol_arg="$ol_val"
1713                 fi
1714         done
1715         if test "$ol_arg" = "invalid" ; then
1716                 { echo "configure: error: bad value $enableval for --enable-dynamic" 1>&2; exit 1; }
1717         fi
1718         ol_enable_dynamic="$ol_arg"
1719
1720 else
1721         ol_enable_dynamic="no"
1722 fi
1723 # end --enable-dynamic
1724
1725 # OpenLDAP --enable-dnssrv
1726         # Check whether --enable-dnssrv or --disable-dnssrv was given.
1727 if test "${enable_dnssrv+set}" = set; then
1728   enableval="$enable_dnssrv"
1729   
1730         ol_arg=invalid
1731         for ol_val in auto yes no ; do
1732                 if test "$enableval" = "$ol_val" ; then
1733                         ol_arg="$ol_val"
1734                 fi
1735         done
1736         if test "$ol_arg" = "invalid" ; then
1737                 { echo "configure: error: bad value $enableval for --enable-dnssrv" 1>&2; exit 1; }
1738         fi
1739         ol_enable_dnssrv="$ol_arg"
1740
1741 else
1742         ol_enable_dnssrv="no"
1743 fi
1744 # end --enable-dnssrv
1745 # OpenLDAP --with-dnssrv_module
1746         # Check whether --with-dnssrv_module or --without-dnssrv_module was given.
1747 if test "${with_dnssrv_module+set}" = set; then
1748   withval="$with_dnssrv_module"
1749   
1750         ol_arg=invalid
1751         for ol_val in static dynamic ; do
1752                 if test "$withval" = "$ol_val" ; then
1753                         ol_arg="$ol_val"
1754                 fi
1755         done
1756         if test "$ol_arg" = "invalid" ; then
1757                 { echo "configure: error: bad value $withval for --with-dnssrv_module" 1>&2; exit 1; }
1758         fi
1759         ol_with_dnssrv_module="$ol_arg"
1760
1761 else
1762         ol_with_dnssrv_module="static"
1763 fi
1764 # end --with-dnssrv_module
1765
1766 # OpenLDAP --enable-ldap
1767         # Check whether --enable-ldap or --disable-ldap was given.
1768 if test "${enable_ldap+set}" = set; then
1769   enableval="$enable_ldap"
1770   
1771         ol_arg=invalid
1772         for ol_val in auto yes no ; do
1773                 if test "$enableval" = "$ol_val" ; then
1774                         ol_arg="$ol_val"
1775                 fi
1776         done
1777         if test "$ol_arg" = "invalid" ; then
1778                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1779         fi
1780         ol_enable_ldap="$ol_arg"
1781
1782 else
1783         ol_enable_ldap="no"
1784 fi
1785 # end --enable-ldap
1786 # OpenLDAP --with-ldap_module
1787         # Check whether --with-ldap_module or --without-ldap_module was given.
1788 if test "${with_ldap_module+set}" = set; then
1789   withval="$with_ldap_module"
1790   
1791         ol_arg=invalid
1792         for ol_val in static dynamic ; do
1793                 if test "$withval" = "$ol_val" ; then
1794                         ol_arg="$ol_val"
1795                 fi
1796         done
1797         if test "$ol_arg" = "invalid" ; then
1798                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
1799         fi
1800         ol_with_ldap_module="$ol_arg"
1801
1802 else
1803         ol_with_ldap_module="static"
1804 fi
1805 # end --with-ldap_module
1806
1807 # OpenLDAP --enable-ldbm
1808         # Check whether --enable-ldbm or --disable-ldbm was given.
1809 if test "${enable_ldbm+set}" = set; then
1810   enableval="$enable_ldbm"
1811   
1812         ol_arg=invalid
1813         for ol_val in auto yes no ; do
1814                 if test "$enableval" = "$ol_val" ; then
1815                         ol_arg="$ol_val"
1816                 fi
1817         done
1818         if test "$ol_arg" = "invalid" ; then
1819                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1820         fi
1821         ol_enable_ldbm="$ol_arg"
1822
1823 else
1824         ol_enable_ldbm="yes"
1825 fi
1826 # end --enable-ldbm
1827 # OpenLDAP --with-ldbm_api
1828         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1829 if test "${with_ldbm_api+set}" = set; then
1830   withval="$with_ldbm_api"
1831   
1832         ol_arg=invalid
1833         for ol_val in auto berkeley bcompat mdbm gdbm ; do
1834                 if test "$withval" = "$ol_val" ; then
1835                         ol_arg="$ol_val"
1836                 fi
1837         done
1838         if test "$ol_arg" = "invalid" ; then
1839                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1840         fi
1841         ol_with_ldbm_api="$ol_arg"
1842
1843 else
1844         ol_with_ldbm_api="auto"
1845 fi
1846 # end --with-ldbm_api
1847
1848 # OpenLDAP --with-ldbm_module
1849         # Check whether --with-ldbm_module or --without-ldbm_module was given.
1850 if test "${with_ldbm_module+set}" = set; then
1851   withval="$with_ldbm_module"
1852   
1853         ol_arg=invalid
1854         for ol_val in static dynamic ; do
1855                 if test "$withval" = "$ol_val" ; then
1856                         ol_arg="$ol_val"
1857                 fi
1858         done
1859         if test "$ol_arg" = "invalid" ; then
1860                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
1861         fi
1862         ol_with_ldbm_module="$ol_arg"
1863
1864 else
1865         ol_with_ldbm_module="static"
1866 fi
1867 # end --with-ldbm_module
1868
1869 # OpenLDAP --with-ldbm_type
1870         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1871 if test "${with_ldbm_type+set}" = set; then
1872   withval="$with_ldbm_type"
1873   
1874         ol_arg=invalid
1875         for ol_val in auto btree hash ; do
1876                 if test "$withval" = "$ol_val" ; then
1877                         ol_arg="$ol_val"
1878                 fi
1879         done
1880         if test "$ol_arg" = "invalid" ; then
1881                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1882         fi
1883         ol_with_ldbm_type="$ol_arg"
1884
1885 else
1886         ol_with_ldbm_type="auto"
1887 fi
1888 # end --with-ldbm_type
1889
1890 # OpenLDAP --enable-passwd
1891         # Check whether --enable-passwd or --disable-passwd was given.
1892 if test "${enable_passwd+set}" = set; then
1893   enableval="$enable_passwd"
1894   
1895         ol_arg=invalid
1896         for ol_val in auto yes no ; do
1897                 if test "$enableval" = "$ol_val" ; then
1898                         ol_arg="$ol_val"
1899                 fi
1900         done
1901         if test "$ol_arg" = "invalid" ; then
1902                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1903         fi
1904         ol_enable_passwd="$ol_arg"
1905
1906 else
1907         ol_enable_passwd="no"
1908 fi
1909 # end --enable-passwd
1910 # OpenLDAP --with-passwd_module
1911         # Check whether --with-passwd_module or --without-passwd_module was given.
1912 if test "${with_passwd_module+set}" = set; then
1913   withval="$with_passwd_module"
1914   
1915         ol_arg=invalid
1916         for ol_val in static dynamic ; do
1917                 if test "$withval" = "$ol_val" ; then
1918                         ol_arg="$ol_val"
1919                 fi
1920         done
1921         if test "$ol_arg" = "invalid" ; then
1922                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
1923         fi
1924         ol_with_passwd_module="$ol_arg"
1925
1926 else
1927         ol_with_passwd_module="static"
1928 fi
1929 # end --with-passwd_module
1930
1931 # OpenLDAP --enable-shell
1932         # Check whether --enable-shell or --disable-shell was given.
1933 if test "${enable_shell+set}" = set; then
1934   enableval="$enable_shell"
1935   
1936         ol_arg=invalid
1937         for ol_val in auto yes no ; do
1938                 if test "$enableval" = "$ol_val" ; then
1939                         ol_arg="$ol_val"
1940                 fi
1941         done
1942         if test "$ol_arg" = "invalid" ; then
1943                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
1944         fi
1945         ol_enable_shell="$ol_arg"
1946
1947 else
1948         ol_enable_shell="no"
1949 fi
1950 # end --enable-shell
1951 # OpenLDAP --with-shell_module
1952         # Check whether --with-shell_module or --without-shell_module was given.
1953 if test "${with_shell_module+set}" = set; then
1954   withval="$with_shell_module"
1955   
1956         ol_arg=invalid
1957         for ol_val in static dynamic ; do
1958                 if test "$withval" = "$ol_val" ; then
1959                         ol_arg="$ol_val"
1960                 fi
1961         done
1962         if test "$ol_arg" = "invalid" ; then
1963                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
1964         fi
1965         ol_with_shell_module="$ol_arg"
1966
1967 else
1968         ol_with_shell_module="static"
1969 fi
1970 # end --with-shell_module
1971
1972 # OpenLDAP --enable-sql
1973         # Check whether --enable-sql or --disable-sql was given.
1974 if test "${enable_sql+set}" = set; then
1975   enableval="$enable_sql"
1976   
1977         ol_arg=invalid
1978         for ol_val in auto yes no ; do
1979                 if test "$enableval" = "$ol_val" ; then
1980                         ol_arg="$ol_val"
1981                 fi
1982         done
1983         if test "$ol_arg" = "invalid" ; then
1984                 { echo "configure: error: bad value $enableval for --enable-sql" 1>&2; exit 1; }
1985         fi
1986         ol_enable_sql="$ol_arg"
1987
1988 else
1989         ol_enable_sql="no"
1990 fi
1991 # end --enable-sql
1992 # OpenLDAP --with-sql_module
1993         # Check whether --with-sql_module or --without-sql_module was given.
1994 if test "${with_sql_module+set}" = set; then
1995   withval="$with_sql_module"
1996   
1997         ol_arg=invalid
1998         for ol_val in static dynamic ; do
1999                 if test "$withval" = "$ol_val" ; then
2000                         ol_arg="$ol_val"
2001                 fi
2002         done
2003         if test "$ol_arg" = "invalid" ; then
2004                 { echo "configure: error: bad value $withval for --with-sql_module" 1>&2; exit 1; }
2005         fi
2006         ol_with_sql_module="$ol_arg"
2007
2008 else
2009         ol_with_sql_module="static"
2010 fi
2011 # end --with-sql_module
2012
2013
2014 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2015 if test "${with_xxslurpdoptions+set}" = set; then
2016   withval="$with_xxslurpdoptions"
2017   :
2018 fi
2019
2020 # OpenLDAP --enable-slurpd
2021         # Check whether --enable-slurpd or --disable-slurpd was given.
2022 if test "${enable_slurpd+set}" = set; then
2023   enableval="$enable_slurpd"
2024   
2025         ol_arg=invalid
2026         for ol_val in auto yes no ; do
2027                 if test "$enableval" = "$ol_val" ; then
2028                         ol_arg="$ol_val"
2029                 fi
2030         done
2031         if test "$ol_arg" = "invalid" ; then
2032                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2033         fi
2034         ol_enable_slurpd="$ol_arg"
2035
2036 else
2037         ol_enable_slurpd="auto"
2038 fi
2039 # end --enable-slurpd
2040
2041 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2042 if test "${with_xxliboptions+set}" = set; then
2043   withval="$with_xxliboptions"
2044   :
2045 fi
2046
2047 # Check whether --enable-static or --disable-static was given.
2048 if test "${enable_static+set}" = set; then
2049   enableval="$enable_static"
2050   p=${PACKAGE-default}
2051 case "$enableval" in
2052 yes) enable_static=yes ;;
2053 no) enable_static=no ;;
2054 *)
2055   enable_static=no
2056   # Look at the argument we got.  We use all the common list separators.
2057   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2058   for pkg in $enableval; do
2059     if test "X$pkg" = "X$p"; then
2060       enable_static=yes
2061     fi
2062   done
2063   IFS="$ac_save_ifs"
2064   ;;
2065 esac
2066 else
2067   enable_static=yes
2068 fi
2069
2070 # Check whether --enable-shared or --disable-shared was given.
2071 if test "${enable_shared+set}" = set; then
2072   enableval="$enable_shared"
2073   p=${PACKAGE-default}
2074 case "$enableval" in
2075 yes) enable_shared=yes ;;
2076 no) enable_shared=no ;;
2077 *)
2078   enable_shared=no
2079   # Look at the argument we got.  We use all the common list separators.
2080   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2081   for pkg in $enableval; do
2082     if test "X$pkg" = "X$p"; then
2083       enable_shared=yes
2084     fi
2085   done
2086   IFS="$ac_save_ifs"
2087   ;;
2088 esac
2089 else
2090   enable_shared=yes
2091 fi
2092
2093
2094
2095 # validate options
2096 if test $ol_enable_slapd = no ; then
2097                 if test $ol_enable_dnssrv = yes ; then
2098                 echo "configure: warning: slapd disabled, ignoring --enable-dnssrv argument" 1>&2
2099         fi
2100         if test $ol_enable_ldap = yes ; then
2101                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2102         fi
2103         if test $ol_enable_ldbm = yes ; then
2104                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2105         fi
2106         if test $ol_enable_passwd = yes ; then
2107                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2108         fi
2109         if test $ol_enable_shell = yes ; then
2110                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2111         fi
2112         if test $ol_enable_sql = yes ; then
2113                 echo "configure: warning: slapd disabled, ignoring --enable-sql argument" 1>&2
2114         fi
2115         if test $ol_enable_modules = yes ; then
2116                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2117         fi
2118         if test $ol_enable_wrappers = yes ; then
2119                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2120         fi
2121         if test $ol_enable_phonetic = yes ; then
2122                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2123         fi
2124         if test $ol_enable_rlookups = yes ; then
2125                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2126         fi
2127         if test $ol_enable_aci = yes ; then
2128                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2129         fi
2130         if test $ol_with_ldbm_api != auto ; then
2131                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2132         fi
2133         if test $ol_with_ldbm_type != auto ; then
2134                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2135         fi
2136         if test $ol_with_dnssrv_module != static ; then
2137                 echo "configure: warning: slapd disabled, ignoring --with-dnssrv-module argument" 1>&2
2138         fi
2139         if test $ol_with_ldap_module != static ; then
2140                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2141         fi
2142         if test $ol_with_ldbm_module != static ; then
2143                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2144         fi
2145         if test $ol_with_passwd_module != static ; then
2146                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2147         fi
2148         if test $ol_with_shell_module != static ; then
2149                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2150         fi
2151         if test $ol_with_sql_module != static ; then
2152                 echo "configure: warning: slapd disabled, ignoring --with-sql-module argument" 1>&2
2153         fi
2154         if test $ol_enable_slurpd = yes ; then
2155                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2156         fi
2157
2158         # force settings to no
2159         ol_enable_dnssrv=no
2160         ol_enable_ldap=no
2161         ol_enable_ldbm=no
2162         ol_enable_passwd=no
2163         ol_enable_shell=no
2164         ol_enable_sql=no
2165
2166         ol_enable_modules=no
2167         ol_enable_phonetic=no
2168         ol_enable_rlookups=no
2169         ol_enable_aci=no
2170         ol_enable_wrappers=no
2171         ol_enable_dynamic=no
2172
2173         ol_with_ldbm_api=no
2174         ol_with_ldbm_type=no
2175
2176         ol_with_dnssrv_module=static
2177         ol_with_ldap_module=static
2178         ol_with_ldbm_module=static
2179         ol_with_passwd_module=static
2180         ol_with_shell_module=static
2181         ol_with_sql_module=static
2182
2183         ol_enable_slurpd=no
2184
2185 elif test $ol_enable_ldbm = no ; then
2186         
2187         if test $ol_with_ldbm_api != auto ; then
2188                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2189         fi
2190
2191         if test $ol_with_ldbm_type != auto ; then
2192                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2193         fi
2194
2195         if test $ol_with_ldbm_module != static ; then
2196                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2197         fi
2198
2199         if test $ol_enable_modules != yes -a \
2200                 $ol_enable_dnssrv = no -a \
2201                 $ol_enable_ldap = no -a \
2202                 $ol_enable_passwd = no -a \
2203                 $ol_enable_shell = no -a \
2204                 $ol_enable_sql = no ; then
2205                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2206         fi
2207
2208         ol_with_ldbm_api=no
2209         ol_with_ldbm_type=no
2210         ol_with_ldbm_module=static
2211
2212 else
2213                 if test $ol_with_ldbm_api = gdbm -a \
2214                 $ol_with_ldbm_type = btree ; then
2215                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2216         fi
2217         if test $ol_with_ldbm_api = mdbm -a \
2218                 $ol_with_ldbm_type = btree ; then
2219                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2220         fi
2221         if test $ol_with_ldbm_api = ndbm -a \
2222                 $ol_with_ldbm_type = btree ; then
2223                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2224         fi
2225 fi
2226
2227 if test $ol_enable_slurpd = yes ; then
2228                 if test $ol_with_threads = no ; then
2229                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2230         fi
2231 fi
2232
2233 if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
2234         if test $ol_with_kerberos = no ; then
2235                 { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
2236         elif test $ol_with_kerberos = auto ; then
2237                 ol_with_kerberos=yes
2238         fi
2239
2240 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
2241         if test $ol_with_kerberos = auto ; then
2242                 ol_with_kerberos=no
2243         elif test $ol_with_kerberos != no ; then
2244                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2245                 ol_with_kerberos=no
2246         fi
2247 fi
2248
2249 if test $ol_enable_spasswd = yes ; then
2250         if test $ol_with_cyrus_sasl = no ; then
2251                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2252         fi
2253         ol_with_cyrus_sasl=yes
2254 fi
2255
2256 echo "$ac_t""done" 1>&6
2257
2258 LDAP_LIBS=
2259 LDIF_LIBS=
2260 LDBM_LIBS=
2261 LTHREAD_LIBS=
2262 LUTIL_LIBS=
2263
2264 SLAPD_LIBS=
2265 SLURPD_LIBS=
2266
2267 BUILD_SLAPD=no
2268 BUILD_SLURPD=no
2269
2270 BUILD_THREAD=no
2271
2272 BUILD_DNSSRV=no
2273 BUILD_LDAP=no
2274 BUILD_LDBM=no
2275 BUILD_PASSWD=no
2276 BUILD_SHELL=no
2277 BUILD_SQL=no
2278
2279 BUILD_DNSSRV_DYNAMIC=static
2280 BUILD_LDAP_DYNAMIC=static
2281 BUILD_LDBM_DYNAMIC=static
2282 BUILD_PASSWD_DYNAMIC=static
2283 BUILD_SHELL_DYNAMIC=static
2284 BUILD_SQL_DYNAMIC=static
2285
2286 SLAPD_MODULES_LDFLAGS=
2287 SLAPD_MODULES_CPPFLAGS=
2288 SLAPD_MODULES_LIST=
2289
2290 SLAPD_SQL_LDFLAGS=
2291 SLAPD_SQL_LIBS=
2292 SLAPD_SQL_INCLUDES=
2293
2294 KRB4_LIBS=
2295 KRB5_LIBS=
2296 READLINE_LIBS=
2297 SASL_LIBS=
2298 TERMCAP_LIBS=
2299 TLS_LIBS=
2300 MODULES_LIBS=
2301 AUTH_LIBS=
2302
2303
2304
2305 cat >> confdefs.h <<\EOF
2306 #define HAVE_MKVERSION 1
2307 EOF
2308
2309
2310
2311
2312 ol_aix_threads=no
2313 case "$target" in
2314 *-*-aix*)       if test -z "$CC" ; then
2315                 case "$ol_with_threads" in
2316                 auto | yes |  posix) ol_aix_threads=yes ;;
2317                 esac
2318         fi
2319 ;;
2320 esac
2321
2322 if test $ol_aix_threads = yes ; then
2323         if test -z "${CC}" ; then
2324                 for ac_prog in cc_r xlc_r cc
2325 do
2326 # Extract the first word of "$ac_prog", so it can be a program name with args.
2327 set dummy $ac_prog; ac_word=$2
2328 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2329 echo "configure:2330: checking for $ac_word" >&5
2330 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2331   echo $ac_n "(cached) $ac_c" 1>&6
2332 else
2333   if test -n "$CC"; then
2334   ac_cv_prog_CC="$CC" # Let the user override the test.
2335 else
2336   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2337   ac_dummy="$PATH"
2338   for ac_dir in $ac_dummy; do
2339     test -z "$ac_dir" && ac_dir=.
2340     if test -f $ac_dir/$ac_word; then
2341       ac_cv_prog_CC="$ac_prog"
2342       break
2343     fi
2344   done
2345   IFS="$ac_save_ifs"
2346 fi
2347 fi
2348 CC="$ac_cv_prog_CC"
2349 if test -n "$CC"; then
2350   echo "$ac_t""$CC" 1>&6
2351 else
2352   echo "$ac_t""no" 1>&6
2353 fi
2354
2355 test -n "$CC" && break
2356 done
2357
2358
2359                 if test "$CC" = cc ; then
2360                                                 if test $ol_with_threads != auto ; then
2361                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2362                         else
2363                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2364                         fi
2365                         ol_with_threads=no
2366                 fi
2367         fi
2368
2369         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2370                 ol_with_threads=posix
2371                 ol_cv_pthread_create=yes
2372         fi
2373 fi
2374
2375 if test -z "${CC}"; then
2376         for ac_prog in cc
2377 do
2378 # Extract the first word of "$ac_prog", so it can be a program name with args.
2379 set dummy $ac_prog; ac_word=$2
2380 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2381 echo "configure:2382: checking for $ac_word" >&5
2382 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2383   echo $ac_n "(cached) $ac_c" 1>&6
2384 else
2385   if test -n "$CC"; then
2386   ac_cv_prog_CC="$CC" # Let the user override the test.
2387 else
2388   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2389   ac_dummy="$PATH"
2390   for ac_dir in $ac_dummy; do
2391     test -z "$ac_dir" && ac_dir=.
2392     if test -f $ac_dir/$ac_word; then
2393       ac_cv_prog_CC="$ac_prog"
2394       break
2395     fi
2396   done
2397   IFS="$ac_save_ifs"
2398 fi
2399 fi
2400 CC="$ac_cv_prog_CC"
2401 if test -n "$CC"; then
2402   echo "$ac_t""$CC" 1>&6
2403 else
2404   echo "$ac_t""no" 1>&6
2405 fi
2406
2407 test -n "$CC" && break
2408 done
2409
2410 fi
2411
2412
2413 for ac_prog in ar gar
2414 do
2415 # Extract the first word of "$ac_prog", so it can be a program name with args.
2416 set dummy $ac_prog; ac_word=$2
2417 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2418 echo "configure:2419: checking for $ac_word" >&5
2419 if eval "test \"\${ac_cv_prog_AR+set}\" = set"; then
2420   echo $ac_n "(cached) $ac_c" 1>&6
2421 else
2422   if test -n "$AR"; then
2423   ac_cv_prog_AR="$AR" # Let the user override the test.
2424 else
2425   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2426   ac_dummy="$PATH"
2427   for ac_dir in $ac_dummy; do
2428     test -z "$ac_dir" && ac_dir=.
2429     if test -f $ac_dir/$ac_word; then
2430       ac_cv_prog_AR="$ac_prog"
2431       break
2432     fi
2433   done
2434   IFS="$ac_save_ifs"
2435 fi
2436 fi
2437 AR="$ac_cv_prog_AR"
2438 if test -n "$AR"; then
2439   echo "$ac_t""$AR" 1>&6
2440 else
2441   echo "$ac_t""no" 1>&6
2442 fi
2443
2444 test -n "$AR" && break
2445 done
2446
2447
2448
2449
2450 # Check whether --enable-fast-install or --disable-fast-install was given.
2451 if test "${enable_fast_install+set}" = set; then
2452   enableval="$enable_fast_install"
2453   p=${PACKAGE-default}
2454 case "$enableval" in
2455 yes) enable_fast_install=yes ;;
2456 no) enable_fast_install=no ;;
2457 *)
2458   enable_fast_install=no
2459   # Look at the argument we got.  We use all the common list separators.
2460   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2461   for pkg in $enableval; do
2462     if test "X$pkg" = "X$p"; then
2463       enable_fast_install=yes
2464     fi
2465   done
2466   IFS="$ac_save_ifs"
2467   ;;
2468 esac
2469 else
2470   enable_fast_install=yes
2471 fi
2472
2473 # Extract the first word of "ranlib", so it can be a program name with args.
2474 set dummy ranlib; ac_word=$2
2475 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2476 echo "configure:2477: checking for $ac_word" >&5
2477 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
2478   echo $ac_n "(cached) $ac_c" 1>&6
2479 else
2480   if test -n "$RANLIB"; then
2481   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2482 else
2483   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2484   ac_dummy="$PATH"
2485   for ac_dir in $ac_dummy; do
2486     test -z "$ac_dir" && ac_dir=.
2487     if test -f $ac_dir/$ac_word; then
2488       ac_cv_prog_RANLIB="ranlib"
2489       break
2490     fi
2491   done
2492   IFS="$ac_save_ifs"
2493   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2494 fi
2495 fi
2496 RANLIB="$ac_cv_prog_RANLIB"
2497 if test -n "$RANLIB"; then
2498   echo "$ac_t""$RANLIB" 1>&6
2499 else
2500   echo "$ac_t""no" 1>&6
2501 fi
2502
2503 # Extract the first word of "gcc", so it can be a program name with args.
2504 set dummy gcc; ac_word=$2
2505 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2506 echo "configure:2507: checking for $ac_word" >&5
2507 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2508   echo $ac_n "(cached) $ac_c" 1>&6
2509 else
2510   if test -n "$CC"; then
2511   ac_cv_prog_CC="$CC" # Let the user override the test.
2512 else
2513   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2514   ac_dummy="$PATH"
2515   for ac_dir in $ac_dummy; do
2516     test -z "$ac_dir" && ac_dir=.
2517     if test -f $ac_dir/$ac_word; then
2518       ac_cv_prog_CC="gcc"
2519       break
2520     fi
2521   done
2522   IFS="$ac_save_ifs"
2523 fi
2524 fi
2525 CC="$ac_cv_prog_CC"
2526 if test -n "$CC"; then
2527   echo "$ac_t""$CC" 1>&6
2528 else
2529   echo "$ac_t""no" 1>&6
2530 fi
2531
2532 if test -z "$CC"; then
2533   # Extract the first word of "cc", so it can be a program name with args.
2534 set dummy cc; ac_word=$2
2535 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2536 echo "configure:2537: checking for $ac_word" >&5
2537 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2538   echo $ac_n "(cached) $ac_c" 1>&6
2539 else
2540   if test -n "$CC"; then
2541   ac_cv_prog_CC="$CC" # Let the user override the test.
2542 else
2543   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2544   ac_prog_rejected=no
2545   ac_dummy="$PATH"
2546   for ac_dir in $ac_dummy; do
2547     test -z "$ac_dir" && ac_dir=.
2548     if test -f $ac_dir/$ac_word; then
2549       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2550         ac_prog_rejected=yes
2551         continue
2552       fi
2553       ac_cv_prog_CC="cc"
2554       break
2555     fi
2556   done
2557   IFS="$ac_save_ifs"
2558 if test $ac_prog_rejected = yes; then
2559   # We found a bogon in the path, so make sure we never use it.
2560   set dummy $ac_cv_prog_CC
2561   shift
2562   if test $# -gt 0; then
2563     # We chose a different compiler from the bogus one.
2564     # However, it has the same basename, so the bogon will be chosen
2565     # first if we set CC to just the basename; use the full file name.
2566     shift
2567     set dummy "$ac_dir/$ac_word" "$@"
2568     shift
2569     ac_cv_prog_CC="$@"
2570   fi
2571 fi
2572 fi
2573 fi
2574 CC="$ac_cv_prog_CC"
2575 if test -n "$CC"; then
2576   echo "$ac_t""$CC" 1>&6
2577 else
2578   echo "$ac_t""no" 1>&6
2579 fi
2580
2581   if test -z "$CC"; then
2582     case "`uname -s`" in
2583     *win32* | *WIN32* | *CYGWIN*)
2584       # Extract the first word of "cl", so it can be a program name with args.
2585 set dummy cl; ac_word=$2
2586 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2587 echo "configure:2588: checking for $ac_word" >&5
2588 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2589   echo $ac_n "(cached) $ac_c" 1>&6
2590 else
2591   if test -n "$CC"; then
2592   ac_cv_prog_CC="$CC" # Let the user override the test.
2593 else
2594   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2595   ac_dummy="$PATH"
2596   for ac_dir in $ac_dummy; do
2597     test -z "$ac_dir" && ac_dir=.
2598     if test -f $ac_dir/$ac_word; then
2599       ac_cv_prog_CC="cl"
2600       break
2601     fi
2602   done
2603   IFS="$ac_save_ifs"
2604 fi
2605 fi
2606 CC="$ac_cv_prog_CC"
2607 if test -n "$CC"; then
2608   echo "$ac_t""$CC" 1>&6
2609 else
2610   echo "$ac_t""no" 1>&6
2611 fi
2612  ;;
2613     esac
2614   fi
2615   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2616 fi
2617
2618 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2619 echo "configure:2620: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
2620
2621 ac_ext=c
2622 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2623 ac_cpp='$CPP $CPPFLAGS'
2624 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2625 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2626 cross_compiling=$ac_cv_prog_cc_cross
2627
2628 cat > conftest.$ac_ext << EOF
2629
2630 #line 2631 "configure"
2631 #include "confdefs.h"
2632
2633 main(){return(0);}
2634 EOF
2635 if { (eval echo configure:2636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2636   ac_cv_prog_cc_works=yes
2637   # If we can't run a trivial program, we are probably using a cross compiler.
2638   if (./conftest; exit) 2>/dev/null; then
2639     ac_cv_prog_cc_cross=no
2640   else
2641     ac_cv_prog_cc_cross=yes
2642   fi
2643 else
2644   echo "configure: failed program was:" >&5
2645   cat conftest.$ac_ext >&5
2646   ac_cv_prog_cc_works=no
2647 fi
2648 rm -fr conftest*
2649 ac_ext=c
2650 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2651 ac_cpp='$CPP $CPPFLAGS'
2652 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2653 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2654 cross_compiling=$ac_cv_prog_cc_cross
2655
2656 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2657 if test $ac_cv_prog_cc_works = no; then
2658   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2659 fi
2660 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2661 echo "configure:2662: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
2662 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2663 cross_compiling=$ac_cv_prog_cc_cross
2664
2665 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2666 echo "configure:2667: checking whether we are using GNU C" >&5
2667 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
2668   echo $ac_n "(cached) $ac_c" 1>&6
2669 else
2670   cat > conftest.c <<EOF
2671 #ifdef __GNUC__
2672   yes;
2673 #endif
2674 EOF
2675 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2676: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2676   ac_cv_prog_gcc=yes
2677 else
2678   ac_cv_prog_gcc=no
2679 fi
2680 fi
2681
2682 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2683
2684 if test $ac_cv_prog_gcc = yes; then
2685   GCC=yes
2686 else
2687   GCC=
2688 fi
2689
2690 ac_test_CFLAGS="${CFLAGS+set}"
2691 ac_save_CFLAGS="$CFLAGS"
2692 CFLAGS=
2693 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2694 echo "configure:2695: checking whether ${CC-cc} accepts -g" >&5
2695 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
2696   echo $ac_n "(cached) $ac_c" 1>&6
2697 else
2698   echo 'void f(){}' > conftest.c
2699 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2700   ac_cv_prog_cc_g=yes
2701 else
2702   ac_cv_prog_cc_g=no
2703 fi
2704 rm -f conftest*
2705
2706 fi
2707
2708 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2709 if test "$ac_test_CFLAGS" = set; then
2710   CFLAGS="$ac_save_CFLAGS"
2711 elif test $ac_cv_prog_cc_g = yes; then
2712   if test "$GCC" = yes; then
2713     CFLAGS="-g -O2"
2714   else
2715     CFLAGS="-g"
2716   fi
2717 else
2718   if test "$GCC" = yes; then
2719     CFLAGS="-O2"
2720   else
2721     CFLAGS=
2722   fi
2723 fi
2724
2725 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2726 if test "${with_gnu_ld+set}" = set; then
2727   withval="$with_gnu_ld"
2728   test "$withval" = no || with_gnu_ld=yes
2729 else
2730   with_gnu_ld=no
2731 fi
2732
2733 ac_prog=ld
2734 if test "$ac_cv_prog_gcc" = yes; then
2735   # Check if gcc -print-prog-name=ld gives a path.
2736   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2737 echo "configure:2738: checking for ld used by GCC" >&5
2738   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2739   case "$ac_prog" in
2740     # Accept absolute paths.
2741     [\\/]* | [A-Za-z]:[\\/]*)
2742       re_direlt='/[^/][^/]*/\.\./'
2743       # Canonicalize the path of ld
2744       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2745       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2746         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2747       done
2748       test -z "$LD" && LD="$ac_prog"
2749       ;;
2750   "")
2751     # If it fails, then pretend we aren't using GCC.
2752     ac_prog=ld
2753     ;;
2754   *)
2755     # If it is relative, then search for the first ld in PATH.
2756     with_gnu_ld=unknown
2757     ;;
2758   esac
2759 elif test "$with_gnu_ld" = yes; then
2760   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2761 echo "configure:2762: checking for GNU ld" >&5
2762 else
2763   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2764 echo "configure:2765: checking for non-GNU ld" >&5
2765 fi
2766 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
2767   echo $ac_n "(cached) $ac_c" 1>&6
2768 else
2769   if test -z "$LD"; then
2770   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2771   for ac_dir in $PATH; do
2772     test -z "$ac_dir" && ac_dir=.
2773     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2774       ac_cv_path_LD="$ac_dir/$ac_prog"
2775       # Check to see if the program is GNU ld.  I'd rather use --version,
2776       # but apparently some GNU ld's only accept -v.
2777       # Break only if it was the GNU/non-GNU ld that we prefer.
2778       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2779         test "$with_gnu_ld" != no && break
2780       else
2781         test "$with_gnu_ld" != yes && break
2782       fi
2783     fi
2784   done
2785   IFS="$ac_save_ifs"
2786 else
2787   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2788 fi
2789 fi
2790
2791 LD="$ac_cv_path_LD"
2792 if test -n "$LD"; then
2793   echo "$ac_t""$LD" 1>&6
2794 else
2795   echo "$ac_t""no" 1>&6
2796 fi
2797 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2798 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2799 echo "configure:2800: checking if the linker ($LD) is GNU ld" >&5
2800 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
2801   echo $ac_n "(cached) $ac_c" 1>&6
2802 else
2803   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2804 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2805   ac_cv_prog_gnu_ld=yes
2806 else
2807   ac_cv_prog_gnu_ld=no
2808 fi
2809 fi
2810
2811 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2812
2813
2814 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2815 echo "configure:2816: checking for BSD-compatible nm" >&5
2816 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
2817   echo $ac_n "(cached) $ac_c" 1>&6
2818 else
2819   if test -n "$NM"; then
2820   # Let the user override the test.
2821   ac_cv_path_NM="$NM"
2822 else
2823   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2824   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
2825     test -z "$ac_dir" && ac_dir=.
2826     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
2827       # Check to see if the nm accepts a BSD-compat flag.
2828       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2829       #   nm: unknown option "B" ignored
2830       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2831         ac_cv_path_NM="$ac_dir/nm -B"
2832         break
2833       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2834         ac_cv_path_NM="$ac_dir/nm -p"
2835         break
2836       else
2837         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
2838         continue # so that we can try to find one that supports BSD flags
2839       fi
2840     fi
2841   done
2842   IFS="$ac_save_ifs"
2843   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2844 fi
2845 fi
2846
2847 NM="$ac_cv_path_NM"
2848 echo "$ac_t""$NM" 1>&6
2849
2850 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2851 echo "configure:2852: checking whether ln -s works" >&5
2852 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
2853   echo $ac_n "(cached) $ac_c" 1>&6
2854 else
2855   rm -f conftestdata
2856 if ln -s X conftestdata 2>/dev/null
2857 then
2858   rm -f conftestdata
2859   ac_cv_prog_LN_S="ln -s"
2860 else
2861   ac_cv_prog_LN_S=ln
2862 fi
2863 fi
2864 LN_S="$ac_cv_prog_LN_S"
2865 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2866   echo "$ac_t""yes" 1>&6
2867 else
2868   echo "$ac_t""no" 1>&6
2869 fi
2870
2871 if test $host != $build; then
2872   ac_tool_prefix=${host_alias}-
2873 else
2874   ac_tool_prefix=
2875 fi
2876
2877
2878 case "$target" in
2879 NONE) lt_target="$host" ;;
2880 *) lt_target="$target" ;;
2881 esac
2882
2883 # Check for any special flags to pass to ltconfig.
2884 libtool_flags="--cache-file=$cache_file"
2885 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2886 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2887 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
2888 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2889 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2890 libtool_flags="$libtool_flags --enable-dlopen"
2891 libtool_flags="$libtool_flags --enable-win32-dll"
2892 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
2893 if test "${enable_libtool_lock+set}" = set; then
2894   enableval="$enable_libtool_lock"
2895   :
2896 fi
2897
2898 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
2899 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
2900
2901 # Some flags need to be propagated to the compiler or linker for good
2902 # libtool support.
2903 case "$lt_target" in
2904 *-*-irix6*)
2905   # Find out which ABI we are using.
2906   echo '#line 2907 "configure"' > conftest.$ac_ext
2907   if { (eval echo configure:2908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2908     case "`/usr/bin/file conftest.o`" in
2909     *32-bit*)
2910       LD="${LD-ld} -32"
2911       ;;
2912     *N32*)
2913       LD="${LD-ld} -n32"
2914       ;;
2915     *64-bit*)
2916       LD="${LD-ld} -64"
2917       ;;
2918     esac
2919   fi
2920   rm -rf conftest*
2921   ;;
2922
2923 *-*-sco3.2v5*)
2924   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2925   SAVE_CFLAGS="$CFLAGS"
2926   CFLAGS="$CFLAGS -belf"
2927   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
2928 echo "configure:2929: checking whether the C compiler needs -belf" >&5
2929 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
2930   echo $ac_n "(cached) $ac_c" 1>&6
2931 else
2932   cat > conftest.$ac_ext <<EOF
2933 #line 2934 "configure"
2934 #include "confdefs.h"
2935
2936 int main() {
2937
2938 ; return 0; }
2939 EOF
2940 if { (eval echo configure:2941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2941   rm -rf conftest*
2942   lt_cv_cc_needs_belf=yes
2943 else
2944   echo "configure: failed program was:" >&5
2945   cat conftest.$ac_ext >&5
2946   rm -rf conftest*
2947   lt_cv_cc_needs_belf=no
2948 fi
2949 rm -f conftest*
2950 fi
2951
2952 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
2953   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2954     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2955     CFLAGS="$SAVE_CFLAGS"
2956   fi
2957   ;;
2958
2959 *-*-cygwin* | *-*-mingw*)
2960   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
2961 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
2962 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2963 echo "configure:2964: checking for $ac_word" >&5
2964 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
2965   echo $ac_n "(cached) $ac_c" 1>&6
2966 else
2967   if test -n "$DLLTOOL"; then
2968   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
2969 else
2970   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2971   ac_dummy="$PATH"
2972   for ac_dir in $ac_dummy; do
2973     test -z "$ac_dir" && ac_dir=.
2974     if test -f $ac_dir/$ac_word; then
2975       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
2976       break
2977     fi
2978   done
2979   IFS="$ac_save_ifs"
2980 fi
2981 fi
2982 DLLTOOL="$ac_cv_prog_DLLTOOL"
2983 if test -n "$DLLTOOL"; then
2984   echo "$ac_t""$DLLTOOL" 1>&6
2985 else
2986   echo "$ac_t""no" 1>&6
2987 fi
2988
2989
2990 if test -z "$ac_cv_prog_DLLTOOL"; then
2991 if test -n "$ac_tool_prefix"; then
2992   # Extract the first word of "dlltool", so it can be a program name with args.
2993 set dummy dlltool; ac_word=$2
2994 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2995 echo "configure:2996: checking for $ac_word" >&5
2996 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
2997   echo $ac_n "(cached) $ac_c" 1>&6
2998 else
2999   if test -n "$DLLTOOL"; then
3000   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3001 else
3002   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3003   ac_dummy="$PATH"
3004   for ac_dir in $ac_dummy; do
3005     test -z "$ac_dir" && ac_dir=.
3006     if test -f $ac_dir/$ac_word; then
3007       ac_cv_prog_DLLTOOL="dlltool"
3008       break
3009     fi
3010   done
3011   IFS="$ac_save_ifs"
3012   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
3013 fi
3014 fi
3015 DLLTOOL="$ac_cv_prog_DLLTOOL"
3016 if test -n "$DLLTOOL"; then
3017   echo "$ac_t""$DLLTOOL" 1>&6
3018 else
3019   echo "$ac_t""no" 1>&6
3020 fi
3021
3022 else
3023   DLLTOOL="false"
3024 fi
3025 fi
3026
3027   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
3028 set dummy ${ac_tool_prefix}as; ac_word=$2
3029 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3030 echo "configure:3031: checking for $ac_word" >&5
3031 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3032   echo $ac_n "(cached) $ac_c" 1>&6
3033 else
3034   if test -n "$AS"; then
3035   ac_cv_prog_AS="$AS" # Let the user override the test.
3036 else
3037   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3038   ac_dummy="$PATH"
3039   for ac_dir in $ac_dummy; do
3040     test -z "$ac_dir" && ac_dir=.
3041     if test -f $ac_dir/$ac_word; then
3042       ac_cv_prog_AS="${ac_tool_prefix}as"
3043       break
3044     fi
3045   done
3046   IFS="$ac_save_ifs"
3047 fi
3048 fi
3049 AS="$ac_cv_prog_AS"
3050 if test -n "$AS"; then
3051   echo "$ac_t""$AS" 1>&6
3052 else
3053   echo "$ac_t""no" 1>&6
3054 fi
3055
3056
3057 if test -z "$ac_cv_prog_AS"; then
3058 if test -n "$ac_tool_prefix"; then
3059   # Extract the first word of "as", so it can be a program name with args.
3060 set dummy as; ac_word=$2
3061 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3062 echo "configure:3063: checking for $ac_word" >&5
3063 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3064   echo $ac_n "(cached) $ac_c" 1>&6
3065 else
3066   if test -n "$AS"; then
3067   ac_cv_prog_AS="$AS" # Let the user override the test.
3068 else
3069   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3070   ac_dummy="$PATH"
3071   for ac_dir in $ac_dummy; do
3072     test -z "$ac_dir" && ac_dir=.
3073     if test -f $ac_dir/$ac_word; then
3074       ac_cv_prog_AS="as"
3075       break
3076     fi
3077   done
3078   IFS="$ac_save_ifs"
3079   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
3080 fi
3081 fi
3082 AS="$ac_cv_prog_AS"
3083 if test -n "$AS"; then
3084   echo "$ac_t""$AS" 1>&6
3085 else
3086   echo "$ac_t""no" 1>&6
3087 fi
3088
3089 else
3090   AS="false"
3091 fi
3092 fi
3093
3094   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
3095 set dummy ${ac_tool_prefix}objdump; ac_word=$2
3096 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3097 echo "configure:3098: checking for $ac_word" >&5
3098 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3099   echo $ac_n "(cached) $ac_c" 1>&6
3100 else
3101   if test -n "$OBJDUMP"; then
3102   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3103 else
3104   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3105   ac_dummy="$PATH"
3106   for ac_dir in $ac_dummy; do
3107     test -z "$ac_dir" && ac_dir=.
3108     if test -f $ac_dir/$ac_word; then
3109       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
3110       break
3111     fi
3112   done
3113   IFS="$ac_save_ifs"
3114 fi
3115 fi
3116 OBJDUMP="$ac_cv_prog_OBJDUMP"
3117 if test -n "$OBJDUMP"; then
3118   echo "$ac_t""$OBJDUMP" 1>&6
3119 else
3120   echo "$ac_t""no" 1>&6
3121 fi
3122
3123
3124 if test -z "$ac_cv_prog_OBJDUMP"; then
3125 if test -n "$ac_tool_prefix"; then
3126   # Extract the first word of "objdump", so it can be a program name with args.
3127 set dummy objdump; ac_word=$2
3128 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3129 echo "configure:3130: checking for $ac_word" >&5
3130 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3131   echo $ac_n "(cached) $ac_c" 1>&6
3132 else
3133   if test -n "$OBJDUMP"; then
3134   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3135 else
3136   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3137   ac_dummy="$PATH"
3138   for ac_dir in $ac_dummy; do
3139     test -z "$ac_dir" && ac_dir=.
3140     if test -f $ac_dir/$ac_word; then
3141       ac_cv_prog_OBJDUMP="objdump"
3142       break
3143     fi
3144   done
3145   IFS="$ac_save_ifs"
3146   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
3147 fi
3148 fi
3149 OBJDUMP="$ac_cv_prog_OBJDUMP"
3150 if test -n "$OBJDUMP"; then
3151   echo "$ac_t""$OBJDUMP" 1>&6
3152 else
3153   echo "$ac_t""no" 1>&6
3154 fi
3155
3156 else
3157   OBJDUMP="false"
3158 fi
3159 fi
3160
3161   ;;
3162
3163 esac
3164
3165
3166 # Save cache, so that ltconfig can load it
3167
3168
3169 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
3170 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
3171 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
3172 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
3173 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
3174 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
3175 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
3176 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
3177
3178 # Reload cache, that may have been modified by ltconfig
3179
3180
3181 # This can be used to rebuild libtool when needed
3182 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
3183
3184 # Always use our own libtool.
3185 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3186
3187 # Redirect the config.log output again, so that the ltconfig log is not
3188 # clobbered by the next message.
3189 exec 5>>./config.log
3190
3191
3192 for ac_prog in mawk gawk nawk awk
3193 do
3194 # Extract the first word of "$ac_prog", so it can be a program name with args.
3195 set dummy $ac_prog; ac_word=$2
3196 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3197 echo "configure:3198: checking for $ac_word" >&5
3198 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
3199   echo $ac_n "(cached) $ac_c" 1>&6
3200 else
3201   if test -n "$AWK"; then
3202   ac_cv_prog_AWK="$AWK" # Let the user override the test.
3203 else
3204   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3205   ac_dummy="$PATH"
3206   for ac_dir in $ac_dummy; do
3207     test -z "$ac_dir" && ac_dir=.
3208     if test -f $ac_dir/$ac_word; then
3209       ac_cv_prog_AWK="$ac_prog"
3210       break
3211     fi
3212   done
3213   IFS="$ac_save_ifs"
3214 fi
3215 fi
3216 AWK="$ac_cv_prog_AWK"
3217 if test -n "$AWK"; then
3218   echo "$ac_t""$AWK" 1>&6
3219 else
3220   echo "$ac_t""no" 1>&6
3221 fi
3222
3223 test -n "$AWK" && break
3224 done
3225
3226 # test for ln hardlink support
3227 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
3228 echo "configure:3229: checking whether ln works" >&5
3229 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
3230   echo $ac_n "(cached) $ac_c" 1>&6
3231 else
3232   rm -f conftest.src conftest.dst
3233 echo "conftest" > conftest.src
3234 if ln conftest.src conftest.dst 2>/dev/null
3235 then
3236   ol_cv_prog_LN_H="ln"
3237 else
3238   ol_cv_prog_LN_H="cp"
3239 fi
3240 rm -f conftest.src conftest.dst
3241
3242 fi
3243 LN_H="$ol_cv_prog_LN_H"
3244 if test "$ol_cv_prog_LN_H" = "ln"; then
3245         echo "$ac_t""yes" 1>&6
3246 else
3247         echo "$ac_t""no" 1>&6
3248 fi
3249
3250 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3251 echo "configure:3252: checking whether ln -s works" >&5
3252 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3253   echo $ac_n "(cached) $ac_c" 1>&6
3254 else
3255   rm -f conftestdata
3256 if ln -s X conftestdata 2>/dev/null
3257 then
3258   rm -f conftestdata
3259   ac_cv_prog_LN_S="ln -s"
3260 else
3261   ac_cv_prog_LN_S=ln
3262 fi
3263 fi
3264 LN_S="$ac_cv_prog_LN_S"
3265 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3266   echo "$ac_t""yes" 1>&6
3267 else
3268   echo "$ac_t""no" 1>&6
3269 fi
3270
3271
3272 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
3273         LN_S="$LN_H"
3274 fi
3275
3276 # Extract the first word of "sendmail", so it can be a program name with args.
3277 set dummy sendmail; ac_word=$2
3278 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3279 echo "configure:3280: checking for $ac_word" >&5
3280 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
3281   echo $ac_n "(cached) $ac_c" 1>&6
3282 else
3283   case "$SENDMAIL" in
3284   /*)
3285   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
3286   ;;
3287   ?:/*)
3288   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
3289   ;;
3290   *)
3291   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3292   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
3293   for ac_dir in $ac_dummy; do 
3294     test -z "$ac_dir" && ac_dir=.
3295     if test -f $ac_dir/$ac_word; then
3296       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
3297       break
3298     fi
3299   done
3300   IFS="$ac_save_ifs"
3301   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
3302   ;;
3303 esac
3304 fi
3305 SENDMAIL="$ac_cv_path_SENDMAIL"
3306 if test -n "$SENDMAIL"; then
3307   echo "$ac_t""$SENDMAIL" 1>&6
3308 else
3309   echo "$ac_t""no" 1>&6
3310 fi
3311
3312 # Extract the first word of "vi", so it can be a program name with args.
3313 set dummy vi; ac_word=$2
3314 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3315 echo "configure:3316: checking for $ac_word" >&5
3316 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
3317   echo $ac_n "(cached) $ac_c" 1>&6
3318 else
3319   case "$EDITOR" in
3320   /*)
3321   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
3322   ;;
3323   ?:/*)
3324   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
3325   ;;
3326   *)
3327   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3328   ac_dummy="$PATH:/usr/ucb"
3329   for ac_dir in $ac_dummy; do 
3330     test -z "$ac_dir" && ac_dir=.
3331     if test -f $ac_dir/$ac_word; then
3332       ac_cv_path_EDITOR="$ac_dir/$ac_word"
3333       break
3334     fi
3335   done
3336   IFS="$ac_save_ifs"
3337   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
3338   ;;
3339 esac
3340 fi
3341 EDITOR="$ac_cv_path_EDITOR"
3342 if test -n "$EDITOR"; then
3343   echo "$ac_t""$EDITOR" 1>&6
3344 else
3345   echo "$ac_t""no" 1>&6
3346 fi
3347
3348 # Extract the first word of "finger", so it can be a program name with args.
3349 set dummy finger; ac_word=$2
3350 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3351 echo "configure:3352: checking for $ac_word" >&5
3352 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
3353   echo $ac_n "(cached) $ac_c" 1>&6
3354 else
3355   case "$FINGER" in
3356   /*)
3357   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
3358   ;;
3359   ?:/*)
3360   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
3361   ;;
3362   *)
3363   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3364   ac_dummy="$PATH:/usr/ucb"
3365   for ac_dir in $ac_dummy; do 
3366     test -z "$ac_dir" && ac_dir=.
3367     if test -f $ac_dir/$ac_word; then
3368       ac_cv_path_FINGER="$ac_dir/$ac_word"
3369       break
3370     fi
3371   done
3372   IFS="$ac_save_ifs"
3373   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
3374   ;;
3375 esac
3376 fi
3377 FINGER="$ac_cv_path_FINGER"
3378 if test -n "$FINGER"; then
3379   echo "$ac_t""$FINGER" 1>&6
3380 else
3381   echo "$ac_t""no" 1>&6
3382 fi
3383
3384
3385 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3386 echo "configure:3387: checking how to run the C preprocessor" >&5
3387 # On Suns, sometimes $CPP names a directory.
3388 if test -n "$CPP" && test -d "$CPP"; then
3389   CPP=
3390 fi
3391 if test -z "$CPP"; then
3392 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3393   echo $ac_n "(cached) $ac_c" 1>&6
3394 else
3395     # This must be in double quotes, not single quotes, because CPP may get
3396   # substituted into the Makefile and "${CC-cc}" will confuse make.
3397   CPP="${CC-cc} -E"
3398   # On the NeXT, cc -E runs the code through the compiler's parser,
3399   # not just through cpp.
3400   cat > conftest.$ac_ext <<EOF
3401 #line 3402 "configure"
3402 #include "confdefs.h"
3403 #include <assert.h>
3404 Syntax Error
3405 EOF
3406 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3407 { (eval echo configure:3408: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3408 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3409 if test -z "$ac_err"; then
3410   :
3411 else
3412   echo "$ac_err" >&5
3413   echo "configure: failed program was:" >&5
3414   cat conftest.$ac_ext >&5
3415   rm -rf conftest*
3416   CPP="${CC-cc} -E -traditional-cpp"
3417   cat > conftest.$ac_ext <<EOF
3418 #line 3419 "configure"
3419 #include "confdefs.h"
3420 #include <assert.h>
3421 Syntax Error
3422 EOF
3423 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3424 { (eval echo configure:3425: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3425 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3426 if test -z "$ac_err"; then
3427   :
3428 else
3429   echo "$ac_err" >&5
3430   echo "configure: failed program was:" >&5
3431   cat conftest.$ac_ext >&5
3432   rm -rf conftest*
3433   CPP="${CC-cc} -nologo -E"
3434   cat > conftest.$ac_ext <<EOF
3435 #line 3436 "configure"
3436 #include "confdefs.h"
3437 #include <assert.h>
3438 Syntax Error
3439 EOF
3440 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3441 { (eval echo configure:3442: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3442 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3443 if test -z "$ac_err"; then
3444   :
3445 else
3446   echo "$ac_err" >&5
3447   echo "configure: failed program was:" >&5
3448   cat conftest.$ac_ext >&5
3449   rm -rf conftest*
3450   CPP=/lib/cpp
3451 fi
3452 rm -f conftest*
3453 fi
3454 rm -f conftest*
3455 fi
3456 rm -f conftest*
3457   ac_cv_prog_CPP="$CPP"
3458 fi
3459   CPP="$ac_cv_prog_CPP"
3460 else
3461   ac_cv_prog_CPP="$CPP"
3462 fi
3463 echo "$ac_t""$CPP" 1>&6
3464
3465
3466 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3467         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3468
3469 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3470         echo "configure: warning: programs compiled here do run here..." 1>&2
3471         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3472
3473 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3474         echo "configure: warning: programs compiled here do not run here..." 1>&2
3475         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3476 fi
3477
3478 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3479 echo "configure:3480: checking for AIX" >&5
3480 cat > conftest.$ac_ext <<EOF
3481 #line 3482 "configure"
3482 #include "confdefs.h"
3483 #ifdef _AIX
3484   yes
3485 #endif
3486
3487 EOF
3488 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3489   egrep "yes" >/dev/null 2>&1; then
3490   rm -rf conftest*
3491   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3492 #define _ALL_SOURCE 1
3493 EOF
3494
3495 else
3496   rm -rf conftest*
3497   echo "$ac_t""no" 1>&6
3498 fi
3499 rm -f conftest*
3500
3501
3502 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3503 echo "configure:3504: checking for POSIXized ISC" >&5
3504 if test -d /etc/conf/kconfig.d &&
3505   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3506 then
3507   echo "$ac_t""yes" 1>&6
3508   ISC=yes # If later tests want to check for ISC.
3509   cat >> confdefs.h <<\EOF
3510 #define _POSIX_SOURCE 1
3511 EOF
3512
3513   if test "$GCC" = yes; then
3514     CC="$CC -posix"
3515   else
3516     CC="$CC -Xp"
3517   fi
3518 else
3519   echo "$ac_t""no" 1>&6
3520   ISC=
3521 fi
3522
3523 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3524 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3525 echo "configure:3526: checking for minix/config.h" >&5
3526 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3527   echo $ac_n "(cached) $ac_c" 1>&6
3528 else
3529   cat > conftest.$ac_ext <<EOF
3530 #line 3531 "configure"
3531 #include "confdefs.h"
3532 #include <minix/config.h>
3533 EOF
3534 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3535 { (eval echo configure:3536: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3536 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3537 if test -z "$ac_err"; then
3538   rm -rf conftest*
3539   eval "ac_cv_header_$ac_safe=yes"
3540 else
3541   echo "$ac_err" >&5
3542   echo "configure: failed program was:" >&5
3543   cat conftest.$ac_ext >&5
3544   rm -rf conftest*
3545   eval "ac_cv_header_$ac_safe=no"
3546 fi
3547 rm -f conftest*
3548 fi
3549 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3550   echo "$ac_t""yes" 1>&6
3551   MINIX=yes
3552 else
3553   echo "$ac_t""no" 1>&6
3554 MINIX=
3555 fi
3556
3557 if test "$MINIX" = yes; then
3558   cat >> confdefs.h <<\EOF
3559 #define _POSIX_SOURCE 1
3560 EOF
3561
3562   cat >> confdefs.h <<\EOF
3563 #define _POSIX_1_SOURCE 2
3564 EOF
3565
3566   cat >> confdefs.h <<\EOF
3567 #define _MINIX 1
3568 EOF
3569
3570 fi
3571
3572
3573 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3574 echo "configure:3575: checking for Cygwin environment" >&5
3575 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
3576   echo $ac_n "(cached) $ac_c" 1>&6
3577 else
3578   cat > conftest.$ac_ext <<EOF
3579 #line 3580 "configure"
3580 #include "confdefs.h"
3581
3582 int main() {
3583
3584 #ifndef __CYGWIN__
3585 #define __CYGWIN__ __CYGWIN32__
3586 #endif
3587 return __CYGWIN__;
3588 ; return 0; }
3589 EOF
3590 if { (eval echo configure:3591: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3591   rm -rf conftest*
3592   ac_cv_cygwin=yes
3593 else
3594   echo "configure: failed program was:" >&5
3595   cat conftest.$ac_ext >&5
3596   rm -rf conftest*
3597   ac_cv_cygwin=no
3598 fi
3599 rm -f conftest*
3600 fi
3601
3602 echo "$ac_t""$ac_cv_cygwin" 1>&6
3603 CYGWIN=
3604 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3605 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3606 echo "configure:3607: checking for mingw32 environment" >&5
3607 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
3608   echo $ac_n "(cached) $ac_c" 1>&6
3609 else
3610   cat > conftest.$ac_ext <<EOF
3611 #line 3612 "configure"
3612 #include "confdefs.h"
3613
3614 int main() {
3615 return __MINGW32__;
3616 ; return 0; }
3617 EOF
3618 if { (eval echo configure:3619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3619   rm -rf conftest*
3620   ac_cv_mingw32=yes
3621 else
3622   echo "configure: failed program was:" >&5
3623   cat conftest.$ac_ext >&5
3624   rm -rf conftest*
3625   ac_cv_mingw32=no
3626 fi
3627 rm -f conftest*
3628 fi
3629
3630 echo "$ac_t""$ac_cv_mingw32" 1>&6
3631 MINGW32=
3632 test "$ac_cv_mingw32" = yes && MINGW32=yes
3633 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
3634 echo "configure:3635: checking for EMX OS/2 environment" >&5
3635 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
3636   echo $ac_n "(cached) $ac_c" 1>&6
3637 else
3638   cat > conftest.$ac_ext <<EOF
3639 #line 3640 "configure"
3640 #include "confdefs.h"
3641
3642 int main() {
3643 return __EMX__;
3644 ; return 0; }
3645 EOF
3646 if { (eval echo configure:3647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3647   rm -rf conftest*
3648   ac_cv_emxos2=yes
3649 else
3650   echo "configure: failed program was:" >&5
3651   cat conftest.$ac_ext >&5
3652   rm -rf conftest*
3653   ac_cv_emxos2=no
3654 fi
3655 rm -f conftest*
3656 fi
3657
3658 echo "$ac_t""$ac_cv_emxos2" 1>&6
3659 EMXOS2=
3660 test "$ac_cv_emxos2" = yes && EMXOS2=yes
3661
3662
3663
3664 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
3665 echo "configure:3666: checking for executable suffix" >&5
3666 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
3667   echo $ac_n "(cached) $ac_c" 1>&6
3668 else
3669   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
3670   ac_cv_exeext=.exe
3671 else
3672   rm -f conftest*
3673   echo 'int main () { return 0; }' > conftest.$ac_ext
3674   ac_cv_exeext=
3675   if { (eval echo configure:3676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
3676     for file in conftest.*; do
3677       case $file in
3678       *.c | *.C | *.o | *.obj | *.xcoff) ;;
3679       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
3680       esac
3681     done
3682   else
3683     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
3684   fi
3685   rm -f conftest*
3686   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
3687 fi
3688 fi
3689
3690 EXEEXT=""
3691 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
3692 echo "$ac_t""${ac_cv_exeext}" 1>&6
3693 ac_exeext=$EXEEXT
3694
3695 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3696 echo "configure:3697: checking for object suffix" >&5
3697 if eval "test \"\${ac_cv_objext+set}\" = set"; then
3698   echo $ac_n "(cached) $ac_c" 1>&6
3699 else
3700   rm -f conftest*
3701 echo 'int i = 1;' > conftest.$ac_ext
3702 if { (eval echo configure:3703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3703   for ac_file in conftest.*; do
3704     case $ac_file in
3705     *.c) ;;
3706     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
3707     esac
3708   done
3709 else
3710   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
3711 fi
3712 rm -f conftest*
3713 fi
3714
3715 echo "$ac_t""$ac_cv_objext" 1>&6
3716 OBJEXT=$ac_cv_objext
3717 ac_objext=$ac_cv_objext
3718
3719
3720 cat >> confdefs.h <<EOF
3721 #define EXEEXT "${EXEEXT}"
3722 EOF
3723
3724
3725 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
3726 echo "configure:3727: checking for be_app in -lbe" >&5
3727 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
3728 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3729   echo $ac_n "(cached) $ac_c" 1>&6
3730 else
3731   ac_save_LIBS="$LIBS"
3732 LIBS="-lbe -lroot -lnet $LIBS"
3733 cat > conftest.$ac_ext <<EOF
3734 #line 3735 "configure"
3735 #include "confdefs.h"
3736 /* Override any gcc2 internal prototype to avoid an error.  */
3737 /* We use char because int might match the return type of a gcc2
3738     builtin and then its argument prototype would still apply.  */
3739 char be_app();
3740
3741 int main() {
3742 be_app()
3743 ; return 0; }
3744 EOF
3745 if { (eval echo configure:3746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3746   rm -rf conftest*
3747   eval "ac_cv_lib_$ac_lib_var=yes"
3748 else
3749   echo "configure: failed program was:" >&5
3750   cat conftest.$ac_ext >&5
3751   rm -rf conftest*
3752   eval "ac_cv_lib_$ac_lib_var=no"
3753 fi
3754 rm -f conftest*
3755 LIBS="$ac_save_LIBS"
3756
3757 fi
3758 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3759   echo "$ac_t""yes" 1>&6
3760   LIBS="$LIBS -lbe -lroot -lnet"
3761 else
3762   echo "$ac_t""no" 1>&6
3763 :
3764 fi
3765
3766
3767
3768
3769
3770 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
3771 echo "configure:3772: checking for ${CC-cc} option to accept ANSI C" >&5
3772 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
3773   echo $ac_n "(cached) $ac_c" 1>&6
3774 else
3775   am_cv_prog_cc_stdc=no
3776 ac_save_CC="$CC"
3777 # Don't try gcc -ansi; that turns off useful extensions and
3778 # breaks some systems' header files.
3779 # AIX                   -qlanglvl=ansi
3780 # Ultrix and OSF/1      -std1
3781 # HP-UX 10.20 and later -Ae
3782 # HP-UX older versions  -Aa -D_HPUX_SOURCE
3783 # SVR4                  -Xc -D__EXTENSIONS__
3784 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3785 do
3786   CC="$ac_save_CC $ac_arg"
3787   cat > conftest.$ac_ext <<EOF
3788 #line 3789 "configure"
3789 #include "confdefs.h"
3790 #include <stdarg.h>
3791 #include <stdio.h>
3792 #include <sys/types.h>
3793 #include <sys/stat.h>
3794 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3795 struct buf { int x; };
3796 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3797 static char *e (p, i)
3798      char **p;
3799      int i;
3800 {
3801   return p[i];
3802 }
3803 static char *f (char * (*g) (char **, int), char **p, ...)
3804 {
3805   char *s;
3806   va_list v;
3807   va_start (v,p);
3808   s = g (p, va_arg (v,int));
3809   va_end (v);
3810   return s;
3811 }
3812 int test (int i, double x);
3813 struct s1 {int (*f) (int a);};
3814 struct s2 {int (*f) (double a);};
3815 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3816 int argc;
3817 char **argv;
3818
3819 int main() {
3820
3821 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3822
3823 ; return 0; }
3824 EOF
3825 if { (eval echo configure:3826: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3826   rm -rf conftest*
3827   am_cv_prog_cc_stdc="$ac_arg"; break
3828 else
3829   echo "configure: failed program was:" >&5
3830   cat conftest.$ac_ext >&5
3831 fi
3832 rm -f conftest*
3833 done
3834 CC="$ac_save_CC"
3835
3836 fi
3837
3838 if test -z "$am_cv_prog_cc_stdc"; then
3839   echo "$ac_t""none needed" 1>&6
3840 else
3841   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
3842 fi
3843 case "x$am_cv_prog_cc_stdc" in
3844   x|xno) ;;
3845   *) CC="$CC $am_cv_prog_cc_stdc" ;;
3846 esac
3847
3848 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
3849         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
3850 fi
3851
3852 # test for make depend flag
3853 OL_MKDEP=
3854 OL_MKDEP_FLAGS=
3855 if test -z "${MKDEP}"; then
3856         OL_MKDEP="${CC-cc}"
3857         if test -z "${MKDEP_FLAGS}"; then
3858                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
3859 echo "configure:3860: checking for ${OL_MKDEP} depend flag" >&5
3860 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
3861   echo $ac_n "(cached) $ac_c" 1>&6
3862 else
3863   
3864                         ol_cv_mkdep=no
3865                         for flag in "-M" "-xM"; do
3866                                 cat > conftest.c <<EOF
3867  noCode;
3868 EOF
3869                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3870: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
3870                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
3871                                 then
3872                                         if test ! -f conftest."${ac_object}" ; then
3873                                                 ol_cv_mkdep=$flag
3874                                                 OL_MKDEP_FLAGS="$flag"
3875                                                 break
3876                                         fi
3877                                 fi
3878                         done
3879                         rm -f conftest*
3880                 
3881 fi
3882
3883 echo "$ac_t""$ol_cv_mkdep" 1>&6
3884         else
3885                 cc_cv_mkdep=yes
3886                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3887         fi
3888 else
3889         cc_cv_mkdep=yes
3890         OL_MKDEP="${MKDEP}"
3891         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3892 fi
3893
3894
3895
3896 if test "${ol_cv_mkdep}" = no ; then
3897         # this will soon become an error
3898         echo "configure: warning: do not know how to generate dependencies" 1>&2
3899 fi
3900
3901 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
3902 echo "configure:3903: checking for afopen in -ls" >&5
3903 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
3904 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3905   echo $ac_n "(cached) $ac_c" 1>&6
3906 else
3907   ac_save_LIBS="$LIBS"
3908 LIBS="-ls  $LIBS"
3909 cat > conftest.$ac_ext <<EOF
3910 #line 3911 "configure"
3911 #include "confdefs.h"
3912 /* Override any gcc2 internal prototype to avoid an error.  */
3913 /* We use char because int might match the return type of a gcc2
3914     builtin and then its argument prototype would still apply.  */
3915 char afopen();
3916
3917 int main() {
3918 afopen()
3919 ; return 0; }
3920 EOF
3921 if { (eval echo configure:3922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3922   rm -rf conftest*
3923   eval "ac_cv_lib_$ac_lib_var=yes"
3924 else
3925   echo "configure: failed program was:" >&5
3926   cat conftest.$ac_ext >&5
3927   rm -rf conftest*
3928   eval "ac_cv_lib_$ac_lib_var=no"
3929 fi
3930 rm -f conftest*
3931 LIBS="$ac_save_LIBS"
3932
3933 fi
3934 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3935   echo "$ac_t""yes" 1>&6
3936   
3937         AUTH_LIBS=-ls
3938         cat >> confdefs.h <<\EOF
3939 #define HAVE_AIX_SECURITY 1
3940 EOF
3941
3942
3943 else
3944   echo "$ac_t""no" 1>&6
3945 fi
3946
3947
3948
3949 ol_link_modules=no
3950 if test $ol_enable_modules != no ; then
3951         for ac_hdr in ltdl.h
3952 do
3953 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3954 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3955 echo "configure:3956: checking for $ac_hdr" >&5
3956 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3957   echo $ac_n "(cached) $ac_c" 1>&6
3958 else
3959   cat > conftest.$ac_ext <<EOF
3960 #line 3961 "configure"
3961 #include "confdefs.h"
3962 #include <$ac_hdr>
3963 EOF
3964 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3965 { (eval echo configure:3966: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3966 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3967 if test -z "$ac_err"; then
3968   rm -rf conftest*
3969   eval "ac_cv_header_$ac_safe=yes"
3970 else
3971   echo "$ac_err" >&5
3972   echo "configure: failed program was:" >&5
3973   cat conftest.$ac_ext >&5
3974   rm -rf conftest*
3975   eval "ac_cv_header_$ac_safe=no"
3976 fi
3977 rm -f conftest*
3978 fi
3979 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3980   echo "$ac_t""yes" 1>&6
3981     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3982   cat >> confdefs.h <<EOF
3983 #define $ac_tr_hdr 1
3984 EOF
3985  
3986 else
3987   echo "$ac_t""no" 1>&6
3988 fi
3989 done
3990
3991
3992         if test $ac_cv_header_ltdl_h = no ; then
3993                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
3994         fi
3995
3996         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
3997 echo "configure:3998: checking for lt_dlinit in -lltdl" >&5
3998 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
3999 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4000   echo $ac_n "(cached) $ac_c" 1>&6
4001 else
4002   ac_save_LIBS="$LIBS"
4003 LIBS="-lltdl  $LIBS"
4004 cat > conftest.$ac_ext <<EOF
4005 #line 4006 "configure"
4006 #include "confdefs.h"
4007 /* Override any gcc2 internal prototype to avoid an error.  */
4008 /* We use char because int might match the return type of a gcc2
4009     builtin and then its argument prototype would still apply.  */
4010 char lt_dlinit();
4011
4012 int main() {
4013 lt_dlinit()
4014 ; return 0; }
4015 EOF
4016 if { (eval echo configure:4017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4017   rm -rf conftest*
4018   eval "ac_cv_lib_$ac_lib_var=yes"
4019 else
4020   echo "configure: failed program was:" >&5
4021   cat conftest.$ac_ext >&5
4022   rm -rf conftest*
4023   eval "ac_cv_lib_$ac_lib_var=no"
4024 fi
4025 rm -f conftest*
4026 LIBS="$ac_save_LIBS"
4027
4028 fi
4029 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4030   echo "$ac_t""yes" 1>&6
4031   
4032             MODULES_LIBS=-lltdl
4033             cat >> confdefs.h <<\EOF
4034 #define HAVE_LIBLTDL 1
4035 EOF
4036
4037         
4038 else
4039   echo "$ac_t""no" 1>&6
4040 fi
4041
4042
4043         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
4044                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
4045         fi
4046         ol_link_modules=yes
4047 else
4048         ol_with_dnssrv_module=static
4049         ol_with_ldap_module=static
4050         ol_with_ldbm_module=static
4051         ol_with_passwd_module=static
4052         ol_with_shell_module=static
4053         ol_with_sql_module=static
4054 fi
4055
4056 # test for EBCDIC
4057 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
4058 echo "configure:4059: checking for EBCDIC" >&5
4059 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
4060   echo $ac_n "(cached) $ac_c" 1>&6
4061 else
4062   
4063         cat > conftest.$ac_ext <<EOF
4064 #line 4065 "configure"
4065 #include "confdefs.h"
4066
4067 #if !('M' == 0xd4)
4068 #include <__ASCII__/generate_error.h>
4069 #endif
4070
4071 EOF
4072 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4073 { (eval echo configure:4074: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4074 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4075 if test -z "$ac_err"; then
4076   rm -rf conftest*
4077   ol_cv_cpp_ebcdic=yes
4078 else
4079   echo "$ac_err" >&5
4080   echo "configure: failed program was:" >&5
4081   cat conftest.$ac_ext >&5
4082   rm -rf conftest*
4083   ol_cv_cpp_ebcdic=no
4084 fi
4085 rm -f conftest*
4086 fi
4087
4088 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
4089 if test $ol_cv_cpp_ebcdic = yes ; then
4090         cat >> confdefs.h <<\EOF
4091 #define HAVE_EBCDIC 1
4092 EOF
4093
4094 fi
4095
4096 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
4097 echo "configure:4098: checking for ANSI C header files" >&5
4098 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
4099   echo $ac_n "(cached) $ac_c" 1>&6
4100 else
4101   cat > conftest.$ac_ext <<EOF
4102 #line 4103 "configure"
4103 #include "confdefs.h"
4104 #include <stdlib.h>
4105 #include <stdarg.h>
4106 #include <string.h>
4107 #include <float.h>
4108 EOF
4109 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4110 { (eval echo configure:4111: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4111 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4112 if test -z "$ac_err"; then
4113   rm -rf conftest*
4114   ol_cv_header_stdc=yes
4115 else
4116   echo "$ac_err" >&5
4117   echo "configure: failed program was:" >&5
4118   cat conftest.$ac_ext >&5
4119   rm -rf conftest*
4120   ol_cv_header_stdc=no
4121 fi
4122 rm -f conftest*
4123
4124 if test $ol_cv_header_stdc = yes; then
4125   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4126 cat > conftest.$ac_ext <<EOF
4127 #line 4128 "configure"
4128 #include "confdefs.h"
4129 #include <string.h>
4130 EOF
4131 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4132   egrep "memchr" >/dev/null 2>&1; then
4133   :
4134 else
4135   rm -rf conftest*
4136   ol_cv_header_stdc=no
4137 fi
4138 rm -f conftest*
4139
4140 fi
4141
4142 if test $ol_cv_header_stdc = yes; then
4143   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4144 cat > conftest.$ac_ext <<EOF
4145 #line 4146 "configure"
4146 #include "confdefs.h"
4147 #include <stdlib.h>
4148 EOF
4149 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4150   egrep "free" >/dev/null 2>&1; then
4151   :
4152 else
4153   rm -rf conftest*
4154   ol_cv_header_stdc=no
4155 fi
4156 rm -f conftest*
4157
4158 fi
4159
4160 if test $ol_cv_header_stdc = yes; then
4161   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4162 if test "$cross_compiling" = yes; then
4163   :
4164 else
4165   cat > conftest.$ac_ext <<EOF
4166 #line 4167 "configure"
4167 #include "confdefs.h"
4168 #include <ctype.h>
4169 #ifndef HAVE_EBCDIC
4170 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4171 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4172 #else
4173 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4174                 || ('j' <= (c) && (c) <= 'r') \
4175                 || ('s' <= (c) && (c) <= 'z'))
4176 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
4177 #endif
4178 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4179 int main () { int i; for (i = 0; i < 256; i++)
4180 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4181 exit (0); }
4182
4183 EOF
4184 if { (eval echo configure:4185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4185 then
4186   :
4187 else
4188   echo "configure: failed program was:" >&5
4189   cat conftest.$ac_ext >&5
4190   rm -fr conftest*
4191   ol_cv_header_stdc=no
4192 fi
4193 rm -fr conftest*
4194 fi
4195
4196 fi
4197 fi
4198
4199 echo "$ac_t""$ol_cv_header_stdc" 1>&6
4200 if test $ol_cv_header_stdc = yes; then
4201   cat >> confdefs.h <<\EOF
4202 #define STDC_HEADERS 1
4203 EOF
4204
4205 fi
4206 ac_cv_header_stdc=disable
4207
4208
4209 if test $ol_cv_header_stdc != yes; then
4210         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
4211 fi
4212
4213 ac_header_dirent=no
4214 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4215 do
4216 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4217 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4218 echo "configure:4219: checking for $ac_hdr that defines DIR" >&5
4219 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
4220   echo $ac_n "(cached) $ac_c" 1>&6
4221 else
4222   cat > conftest.$ac_ext <<EOF
4223 #line 4224 "configure"
4224 #include "confdefs.h"
4225 #include <sys/types.h>
4226 #include <$ac_hdr>
4227 int main() {
4228 DIR *dirp = 0;
4229 ; return 0; }
4230 EOF
4231 if { (eval echo configure:4232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4232   rm -rf conftest*
4233   eval "ac_cv_header_dirent_$ac_safe=yes"
4234 else
4235   echo "configure: failed program was:" >&5
4236   cat conftest.$ac_ext >&5
4237   rm -rf conftest*
4238   eval "ac_cv_header_dirent_$ac_safe=no"
4239 fi
4240 rm -f conftest*
4241 fi
4242 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4243   echo "$ac_t""yes" 1>&6
4244     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4245   cat >> confdefs.h <<EOF
4246 #define $ac_tr_hdr 1
4247 EOF
4248  ac_header_dirent=$ac_hdr; break
4249 else
4250   echo "$ac_t""no" 1>&6
4251 fi
4252 done
4253 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4254 if test $ac_header_dirent = dirent.h; then
4255 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4256 echo "configure:4257: checking for opendir in -ldir" >&5
4257 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
4258 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4259   echo $ac_n "(cached) $ac_c" 1>&6
4260 else
4261   ac_save_LIBS="$LIBS"
4262 LIBS="-ldir  $LIBS"
4263 cat > conftest.$ac_ext <<EOF
4264 #line 4265 "configure"
4265 #include "confdefs.h"
4266 /* Override any gcc2 internal prototype to avoid an error.  */
4267 /* We use char because int might match the return type of a gcc2
4268     builtin and then its argument prototype would still apply.  */
4269 char opendir();
4270
4271 int main() {
4272 opendir()
4273 ; return 0; }
4274 EOF
4275 if { (eval echo configure:4276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4276   rm -rf conftest*
4277   eval "ac_cv_lib_$ac_lib_var=yes"
4278 else
4279   echo "configure: failed program was:" >&5
4280   cat conftest.$ac_ext >&5
4281   rm -rf conftest*
4282   eval "ac_cv_lib_$ac_lib_var=no"
4283 fi
4284 rm -f conftest*
4285 LIBS="$ac_save_LIBS"
4286
4287 fi
4288 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4289   echo "$ac_t""yes" 1>&6
4290   LIBS="$LIBS -ldir"
4291 else
4292   echo "$ac_t""no" 1>&6
4293 fi
4294
4295 else
4296 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4297 echo "configure:4298: checking for opendir in -lx" >&5
4298 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
4299 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4300   echo $ac_n "(cached) $ac_c" 1>&6
4301 else
4302   ac_save_LIBS="$LIBS"
4303 LIBS="-lx  $LIBS"
4304 cat > conftest.$ac_ext <<EOF
4305 #line 4306 "configure"
4306 #include "confdefs.h"
4307 /* Override any gcc2 internal prototype to avoid an error.  */
4308 /* We use char because int might match the return type of a gcc2
4309     builtin and then its argument prototype would still apply.  */
4310 char opendir();
4311
4312 int main() {
4313 opendir()
4314 ; return 0; }
4315 EOF
4316 if { (eval echo configure:4317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4317   rm -rf conftest*
4318   eval "ac_cv_lib_$ac_lib_var=yes"
4319 else
4320   echo "configure: failed program was:" >&5
4321   cat conftest.$ac_ext >&5
4322   rm -rf conftest*
4323   eval "ac_cv_lib_$ac_lib_var=no"
4324 fi
4325 rm -f conftest*
4326 LIBS="$ac_save_LIBS"
4327
4328 fi
4329 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4330   echo "$ac_t""yes" 1>&6
4331   LIBS="$LIBS -lx"
4332 else
4333   echo "$ac_t""no" 1>&6
4334 fi
4335
4336 fi
4337
4338 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4339 echo "configure:4340: checking for sys/wait.h that is POSIX.1 compatible" >&5
4340 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
4341   echo $ac_n "(cached) $ac_c" 1>&6
4342 else
4343   cat > conftest.$ac_ext <<EOF
4344 #line 4345 "configure"
4345 #include "confdefs.h"
4346 #include <sys/types.h>
4347 #include <sys/wait.h>
4348 #ifndef WEXITSTATUS
4349 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4350 #endif
4351 #ifndef WIFEXITED
4352 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4353 #endif
4354 int main() {
4355 int s;
4356 wait (&s);
4357 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4358 ; return 0; }
4359 EOF
4360 if { (eval echo configure:4361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4361   rm -rf conftest*
4362   ac_cv_header_sys_wait_h=yes
4363 else
4364   echo "configure: failed program was:" >&5
4365   cat conftest.$ac_ext >&5
4366   rm -rf conftest*
4367   ac_cv_header_sys_wait_h=no
4368 fi
4369 rm -f conftest*
4370 fi
4371
4372 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4373 if test $ac_cv_header_sys_wait_h = yes; then
4374   cat >> confdefs.h <<\EOF
4375 #define HAVE_SYS_WAIT_H 1
4376 EOF
4377
4378 fi
4379
4380 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4381 echo "configure:4382: checking POSIX termios" >&5
4382 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
4383   echo $ac_n "(cached) $ac_c" 1>&6
4384 else
4385   cat > conftest.$ac_ext <<EOF
4386 #line 4387 "configure"
4387 #include "confdefs.h"
4388 #include <sys/types.h>
4389 #include <unistd.h>
4390 #include <termios.h>
4391 int main() {
4392 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4393    tcgetattr(0, 0);
4394 ; return 0; }
4395 EOF
4396 if { (eval echo configure:4397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4397   rm -rf conftest*
4398   am_cv_sys_posix_termios=yes
4399 else
4400   echo "configure: failed program was:" >&5
4401   cat conftest.$ac_ext >&5
4402   rm -rf conftest*
4403   am_cv_sys_posix_termios=no
4404 fi
4405 rm -f conftest*
4406 fi
4407
4408 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4409
4410
4411  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4412 echo "configure:4413: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4413 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
4414   echo $ac_n "(cached) $ac_c" 1>&6
4415 else
4416   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4417
4418   gwinsz_in_termios_h=no
4419   if test $am_cv_sys_posix_termios = yes; then
4420     cat > conftest.$ac_ext <<EOF
4421 #line 4422 "configure"
4422 #include "confdefs.h"
4423 #include <sys/types.h>
4424 #     include <termios.h>
4425 #     ifdef TIOCGWINSZ
4426         yes
4427 #     endif
4428     
4429 EOF
4430 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4431   egrep "yes" >/dev/null 2>&1; then
4432   rm -rf conftest*
4433   gwinsz_in_termios_h=yes
4434 fi
4435 rm -f conftest*
4436
4437   fi
4438
4439   if test $gwinsz_in_termios_h = no; then
4440     cat > conftest.$ac_ext <<EOF
4441 #line 4442 "configure"
4442 #include "confdefs.h"
4443 #include <sys/types.h>
4444 #     include <sys/ioctl.h>
4445 #     ifdef TIOCGWINSZ
4446         yes
4447 #     endif
4448     
4449 EOF
4450 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4451   egrep "yes" >/dev/null 2>&1; then
4452   rm -rf conftest*
4453   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4454 fi
4455 rm -f conftest*
4456
4457   fi
4458   
4459 fi
4460
4461 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4462   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4463     cat >> confdefs.h <<\EOF
4464 #define GWINSZ_IN_SYS_IOCTL 1
4465 EOF
4466
4467   fi
4468
4469 if test $am_cv_sys_posix_termios = yes ; then
4470         cat >> confdefs.h <<\EOF
4471 #define HAVE_POSIX_TERMIOS 1
4472 EOF
4473
4474 fi
4475
4476 for ac_hdr in \
4477         arpa/inet.h             \
4478         arpa/nameser.h  \
4479         assert.h                \
4480         conio.h                 \
4481         crypt.h                 \
4482         direct.h                \
4483         errno.h                 \
4484         fcntl.h                 \
4485         filio.h                 \
4486         getopt.h                \
4487         grp.h                   \
4488         io.h                    \
4489         libutil.h               \
4490         limits.h                \
4491         locale.h                \
4492         netinet/tcp.h   \
4493         malloc.h                \
4494         memory.h                \
4495         psap.h                  \
4496         pwd.h                   \
4497         process.h               \
4498         resolv.h                \
4499         sgtty.h                 \
4500         shadow.h                \
4501         stddef.h                \
4502         string.h                \
4503         strings.h               \
4504         sysexits.h              \
4505         sys/file.h              \
4506         sys/filio.h             \
4507         sys/errno.h             \
4508         sys/ioctl.h             \
4509         sys/param.h             \
4510         sys/resource.h  \
4511         sys/select.h    \
4512         sys/socket.h    \
4513         sys/syslog.h    \
4514         sys/time.h              \
4515         sys/types.h             \
4516         syslog.h                \
4517         termios.h               \
4518         unistd.h                \
4519         winsock.h               \
4520
4521 do
4522 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4523 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4524 echo "configure:4525: checking for $ac_hdr" >&5
4525 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4526   echo $ac_n "(cached) $ac_c" 1>&6
4527 else
4528   cat > conftest.$ac_ext <<EOF
4529 #line 4530 "configure"
4530 #include "confdefs.h"
4531 #include <$ac_hdr>
4532 EOF
4533 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4534 { (eval echo configure:4535: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4535 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4536 if test -z "$ac_err"; then
4537   rm -rf conftest*
4538   eval "ac_cv_header_$ac_safe=yes"
4539 else
4540   echo "$ac_err" >&5
4541   echo "configure: failed program was:" >&5
4542   cat conftest.$ac_ext >&5
4543   rm -rf conftest*
4544   eval "ac_cv_header_$ac_safe=no"
4545 fi
4546 rm -f conftest*
4547 fi
4548 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4549   echo "$ac_t""yes" 1>&6
4550     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4551   cat >> confdefs.h <<EOF
4552 #define $ac_tr_hdr 1
4553 EOF
4554  
4555 else
4556   echo "$ac_t""no" 1>&6
4557 fi
4558 done
4559
4560
4561
4562
4563 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
4564 echo "configure:4565: checking for dlopen" >&5
4565 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
4566   echo $ac_n "(cached) $ac_c" 1>&6
4567 else
4568   cat > conftest.$ac_ext <<EOF
4569 #line 4570 "configure"
4570 #include "confdefs.h"
4571 /* System header to define __stub macros and hopefully few prototypes,
4572     which can conflict with char dlopen(); below.  */
4573 #include <assert.h>
4574 /* Override any gcc2 internal prototype to avoid an error.  */
4575 /* We use char because int might match the return type of a gcc2
4576     builtin and then its argument prototype would still apply.  */
4577 char dlopen();
4578 char (*f)();
4579
4580 int main() {
4581
4582 /* The GNU C library defines this for functions which it implements
4583     to always fail with ENOSYS.  Some functions are actually named
4584     something starting with __ and the normal name is an alias.  */
4585 #if defined (__stub_dlopen) || defined (__stub___dlopen)
4586 choke me
4587 #else
4588 f = dlopen;
4589 #endif
4590
4591 ; return 0; }
4592 EOF
4593 if { (eval echo configure:4594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4594   rm -rf conftest*
4595   eval "ac_cv_func_dlopen=yes"
4596 else
4597   echo "configure: failed program was:" >&5
4598   cat conftest.$ac_ext >&5
4599   rm -rf conftest*
4600   eval "ac_cv_func_dlopen=no"
4601 fi
4602 rm -f conftest*
4603 fi
4604
4605 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
4606   echo "$ac_t""yes" 1>&6
4607   :
4608 else
4609   echo "$ac_t""no" 1>&6
4610 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
4611 echo "configure:4612: checking for dlopen in -ldl" >&5
4612 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
4613 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4614   echo $ac_n "(cached) $ac_c" 1>&6
4615 else
4616   ac_save_LIBS="$LIBS"
4617 LIBS="-ldl  $LIBS"
4618 cat > conftest.$ac_ext <<EOF
4619 #line 4620 "configure"
4620 #include "confdefs.h"
4621 /* Override any gcc2 internal prototype to avoid an error.  */
4622 /* We use char because int might match the return type of a gcc2
4623     builtin and then its argument prototype would still apply.  */
4624 char dlopen();
4625
4626 int main() {
4627 dlopen()
4628 ; return 0; }
4629 EOF
4630 if { (eval echo configure:4631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4631   rm -rf conftest*
4632   eval "ac_cv_lib_$ac_lib_var=yes"
4633 else
4634   echo "configure: failed program was:" >&5
4635   cat conftest.$ac_ext >&5
4636   rm -rf conftest*
4637   eval "ac_cv_lib_$ac_lib_var=no"
4638 fi
4639 rm -f conftest*
4640 LIBS="$ac_save_LIBS"
4641
4642 fi
4643 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4644   echo "$ac_t""yes" 1>&6
4645     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4646     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4647   cat >> confdefs.h <<EOF
4648 #define $ac_tr_lib 1
4649 EOF
4650
4651   LIBS="-ldl $LIBS"
4652
4653 else
4654   echo "$ac_t""no" 1>&6
4655 fi
4656
4657 fi
4658
4659
4660 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
4661 echo "configure:4662: checking for sigset in -lV3" >&5
4662 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
4663 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4664   echo $ac_n "(cached) $ac_c" 1>&6
4665 else
4666   ac_save_LIBS="$LIBS"
4667 LIBS="-lV3  $LIBS"
4668 cat > conftest.$ac_ext <<EOF
4669 #line 4670 "configure"
4670 #include "confdefs.h"
4671 /* Override any gcc2 internal prototype to avoid an error.  */
4672 /* We use char because int might match the return type of a gcc2
4673     builtin and then its argument prototype would still apply.  */
4674 char sigset();
4675
4676 int main() {
4677 sigset()
4678 ; return 0; }
4679 EOF
4680 if { (eval echo configure:4681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4681   rm -rf conftest*
4682   eval "ac_cv_lib_$ac_lib_var=yes"
4683 else
4684   echo "configure: failed program was:" >&5
4685   cat conftest.$ac_ext >&5
4686   rm -rf conftest*
4687   eval "ac_cv_lib_$ac_lib_var=no"
4688 fi
4689 rm -f conftest*
4690 LIBS="$ac_save_LIBS"
4691
4692 fi
4693 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4694   echo "$ac_t""yes" 1>&6
4695     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4696     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4697   cat >> confdefs.h <<EOF
4698 #define $ac_tr_lib 1
4699 EOF
4700
4701   LIBS="-lV3 $LIBS"
4702
4703 else
4704   echo "$ac_t""no" 1>&6
4705 fi
4706
4707
4708 if test $ac_cv_header_winsock_h = yes; then
4709         echo $ac_n "checking for winsock""... $ac_c" 1>&6
4710 echo "configure:4711: checking for winsock" >&5
4711 if eval "test \"\${ol_cv_winsock+set}\" = set"; then
4712   echo $ac_n "(cached) $ac_c" 1>&6
4713 else
4714   cat > conftest.$ac_ext <<EOF
4715 #line 4716 "configure"
4716 #include "confdefs.h"
4717 #include <winsock.h>
4718 int main() {
4719
4720                         socket(0,0,0);
4721                         select(0,NULL,NULL,NULL,NULL);
4722                         closesocket(0);
4723                         gethostname(NULL,0);
4724         
4725 ; return 0; }
4726 EOF
4727 if { (eval echo configure:4728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4728   rm -rf conftest*
4729   ol_cv_winsock=yes
4730 else
4731   echo "configure: failed program was:" >&5
4732   cat conftest.$ac_ext >&5
4733   rm -rf conftest*
4734   ol_cv_winsock=no
4735 fi
4736 rm -f conftest*
4737 fi
4738
4739 echo "$ac_t""$ol_cv_winsock" 1>&6
4740
4741         if test $ol_cv_winsock = yes ; then
4742                 cat >> confdefs.h <<\EOF
4743 #define HAVE_WINSOCK 1
4744 EOF
4745
4746                 ac_cv_func_socket=yes
4747                 ac_cv_func_select=yes
4748                 ac_cv_func_closesocket=yes
4749                 ac_cv_func_gethostname=yes
4750         fi
4751 fi
4752
4753
4754 echo $ac_n "checking for socket""... $ac_c" 1>&6
4755 echo "configure:4756: checking for socket" >&5
4756 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
4757   echo $ac_n "(cached) $ac_c" 1>&6
4758 else
4759   cat > conftest.$ac_ext <<EOF
4760 #line 4761 "configure"
4761 #include "confdefs.h"
4762 /* System header to define __stub macros and hopefully few prototypes,
4763     which can conflict with char socket(); below.  */
4764 #include <assert.h>
4765 /* Override any gcc2 internal prototype to avoid an error.  */
4766 /* We use char because int might match the return type of a gcc2
4767     builtin and then its argument prototype would still apply.  */
4768 char socket();
4769 char (*f)();
4770
4771 int main() {
4772
4773 /* The GNU C library defines this for functions which it implements
4774     to always fail with ENOSYS.  Some functions are actually named
4775     something starting with __ and the normal name is an alias.  */
4776 #if defined (__stub_socket) || defined (__stub___socket)
4777 choke me
4778 #else
4779 f = socket;
4780 #endif
4781
4782 ; return 0; }
4783 EOF
4784 if { (eval echo configure:4785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4785   rm -rf conftest*
4786   eval "ac_cv_func_socket=yes"
4787 else
4788   echo "configure: failed program was:" >&5
4789   cat conftest.$ac_ext >&5
4790   rm -rf conftest*
4791   eval "ac_cv_func_socket=no"
4792 fi
4793 rm -f conftest*
4794 fi
4795
4796 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
4797   echo "$ac_t""yes" 1>&6
4798   :
4799 else
4800   echo "$ac_t""no" 1>&6
4801         
4802         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
4803 echo "configure:4804: checking for main in -lsocket" >&5
4804 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
4805 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4806   echo $ac_n "(cached) $ac_c" 1>&6
4807 else
4808   ac_save_LIBS="$LIBS"
4809 LIBS="-lsocket  $LIBS"
4810 cat > conftest.$ac_ext <<EOF
4811 #line 4812 "configure"
4812 #include "confdefs.h"
4813
4814 int main() {
4815 main()
4816 ; return 0; }
4817 EOF
4818 if { (eval echo configure:4819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4819   rm -rf conftest*
4820   eval "ac_cv_lib_$ac_lib_var=yes"
4821 else
4822   echo "configure: failed program was:" >&5
4823   cat conftest.$ac_ext >&5
4824   rm -rf conftest*
4825   eval "ac_cv_lib_$ac_lib_var=no"
4826 fi
4827 rm -f conftest*
4828 LIBS="$ac_save_LIBS"
4829
4830 fi
4831 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4832   echo "$ac_t""yes" 1>&6
4833     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4834     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4835   cat >> confdefs.h <<EOF
4836 #define $ac_tr_lib 1
4837 EOF
4838
4839   LIBS="-lsocket $LIBS"
4840
4841 else
4842   echo "$ac_t""no" 1>&6
4843 fi
4844
4845         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
4846 echo "configure:4847: checking for main in -lnet" >&5
4847 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
4848 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4849   echo $ac_n "(cached) $ac_c" 1>&6
4850 else
4851   ac_save_LIBS="$LIBS"
4852 LIBS="-lnet  $LIBS"
4853 cat > conftest.$ac_ext <<EOF
4854 #line 4855 "configure"
4855 #include "confdefs.h"
4856
4857 int main() {
4858 main()
4859 ; return 0; }
4860 EOF
4861 if { (eval echo configure:4862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4862   rm -rf conftest*
4863   eval "ac_cv_lib_$ac_lib_var=yes"
4864 else
4865   echo "configure: failed program was:" >&5
4866   cat conftest.$ac_ext >&5
4867   rm -rf conftest*
4868   eval "ac_cv_lib_$ac_lib_var=no"
4869 fi
4870 rm -f conftest*
4871 LIBS="$ac_save_LIBS"
4872
4873 fi
4874 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4875   echo "$ac_t""yes" 1>&6
4876     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4877     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4878   cat >> confdefs.h <<EOF
4879 #define $ac_tr_lib 1
4880 EOF
4881
4882   LIBS="-lnet $LIBS"
4883
4884 else
4885   echo "$ac_t""no" 1>&6
4886 fi
4887
4888         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
4889 echo "configure:4890: checking for main in -lnsl_s" >&5
4890 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
4891 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4892   echo $ac_n "(cached) $ac_c" 1>&6
4893 else
4894   ac_save_LIBS="$LIBS"
4895 LIBS="-lnsl_s  $LIBS"
4896 cat > conftest.$ac_ext <<EOF
4897 #line 4898 "configure"
4898 #include "confdefs.h"
4899
4900 int main() {
4901 main()
4902 ; return 0; }
4903 EOF
4904 if { (eval echo configure:4905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4905   rm -rf conftest*
4906   eval "ac_cv_lib_$ac_lib_var=yes"
4907 else
4908   echo "configure: failed program was:" >&5
4909   cat conftest.$ac_ext >&5
4910   rm -rf conftest*
4911   eval "ac_cv_lib_$ac_lib_var=no"
4912 fi
4913 rm -f conftest*
4914 LIBS="$ac_save_LIBS"
4915
4916 fi
4917 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4918   echo "$ac_t""yes" 1>&6
4919     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4920     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4921   cat >> confdefs.h <<EOF
4922 #define $ac_tr_lib 1
4923 EOF
4924
4925   LIBS="-lnsl_s $LIBS"
4926
4927 else
4928   echo "$ac_t""no" 1>&6
4929 fi
4930
4931         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
4932 echo "configure:4933: checking for main in -lnsl" >&5
4933 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
4934 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4935   echo $ac_n "(cached) $ac_c" 1>&6
4936 else
4937   ac_save_LIBS="$LIBS"
4938 LIBS="-lnsl  $LIBS"
4939 cat > conftest.$ac_ext <<EOF
4940 #line 4941 "configure"
4941 #include "confdefs.h"
4942
4943 int main() {
4944 main()
4945 ; return 0; }
4946 EOF
4947 if { (eval echo configure:4948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4948   rm -rf conftest*
4949   eval "ac_cv_lib_$ac_lib_var=yes"
4950 else
4951   echo "configure: failed program was:" >&5
4952   cat conftest.$ac_ext >&5
4953   rm -rf conftest*
4954   eval "ac_cv_lib_$ac_lib_var=no"
4955 fi
4956 rm -f conftest*
4957 LIBS="$ac_save_LIBS"
4958
4959 fi
4960 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4961   echo "$ac_t""yes" 1>&6
4962     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4963     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4964   cat >> confdefs.h <<EOF
4965 #define $ac_tr_lib 1
4966 EOF
4967
4968   LIBS="-lnsl $LIBS"
4969
4970 else
4971   echo "$ac_t""no" 1>&6
4972 fi
4973
4974         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
4975 echo "configure:4976: checking for socket in -linet" >&5
4976 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
4977 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4978   echo $ac_n "(cached) $ac_c" 1>&6
4979 else
4980   ac_save_LIBS="$LIBS"
4981 LIBS="-linet  $LIBS"
4982 cat > conftest.$ac_ext <<EOF
4983 #line 4984 "configure"
4984 #include "confdefs.h"
4985 /* Override any gcc2 internal prototype to avoid an error.  */
4986 /* We use char because int might match the return type of a gcc2
4987     builtin and then its argument prototype would still apply.  */
4988 char socket();
4989
4990 int main() {
4991 socket()
4992 ; return 0; }
4993 EOF
4994 if { (eval echo configure:4995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4995   rm -rf conftest*
4996   eval "ac_cv_lib_$ac_lib_var=yes"
4997 else
4998   echo "configure: failed program was:" >&5
4999   cat conftest.$ac_ext >&5
5000   rm -rf conftest*
5001   eval "ac_cv_lib_$ac_lib_var=no"
5002 fi
5003 rm -f conftest*
5004 LIBS="$ac_save_LIBS"
5005
5006 fi
5007 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5008   echo "$ac_t""yes" 1>&6
5009     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5010     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5011   cat >> confdefs.h <<EOF
5012 #define $ac_tr_lib 1
5013 EOF
5014
5015   LIBS="-linet $LIBS"
5016
5017 else
5018   echo "$ac_t""no" 1>&6
5019 fi
5020
5021         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
5022 echo "configure:5023: checking for main in -lgen" >&5
5023 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
5024 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5025   echo $ac_n "(cached) $ac_c" 1>&6
5026 else
5027   ac_save_LIBS="$LIBS"
5028 LIBS="-lgen  $LIBS"
5029 cat > conftest.$ac_ext <<EOF
5030 #line 5031 "configure"
5031 #include "confdefs.h"
5032
5033 int main() {
5034 main()
5035 ; return 0; }
5036 EOF
5037 if { (eval echo configure:5038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5038   rm -rf conftest*
5039   eval "ac_cv_lib_$ac_lib_var=yes"
5040 else
5041   echo "configure: failed program was:" >&5
5042   cat conftest.$ac_ext >&5
5043   rm -rf conftest*
5044   eval "ac_cv_lib_$ac_lib_var=no"
5045 fi
5046 rm -f conftest*
5047 LIBS="$ac_save_LIBS"
5048
5049 fi
5050 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5051   echo "$ac_t""yes" 1>&6
5052     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5053     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5054   cat >> confdefs.h <<EOF
5055 #define $ac_tr_lib 1
5056 EOF
5057
5058   LIBS="-lgen $LIBS"
5059
5060 else
5061   echo "$ac_t""no" 1>&6
5062 fi
5063
5064
5065 fi
5066
5067
5068 echo $ac_n "checking for select""... $ac_c" 1>&6
5069 echo "configure:5070: checking for select" >&5
5070 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
5071   echo $ac_n "(cached) $ac_c" 1>&6
5072 else
5073   cat > conftest.$ac_ext <<EOF
5074 #line 5075 "configure"
5075 #include "confdefs.h"
5076 /* System header to define __stub macros and hopefully few prototypes,
5077     which can conflict with char select(); below.  */
5078 #include <assert.h>
5079 /* Override any gcc2 internal prototype to avoid an error.  */
5080 /* We use char because int might match the return type of a gcc2
5081     builtin and then its argument prototype would still apply.  */
5082 char select();
5083 char (*f)();
5084
5085 int main() {
5086
5087 /* The GNU C library defines this for functions which it implements
5088     to always fail with ENOSYS.  Some functions are actually named
5089     something starting with __ and the normal name is an alias.  */
5090 #if defined (__stub_select) || defined (__stub___select)
5091 choke me
5092 #else
5093 f = select;
5094 #endif
5095
5096 ; return 0; }
5097 EOF
5098 if { (eval echo configure:5099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5099   rm -rf conftest*
5100   eval "ac_cv_func_select=yes"
5101 else
5102   echo "configure: failed program was:" >&5
5103   cat conftest.$ac_ext >&5
5104   rm -rf conftest*
5105   eval "ac_cv_func_select=no"
5106 fi
5107 rm -f conftest*
5108 fi
5109
5110 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
5111   echo "$ac_t""yes" 1>&6
5112   :
5113 else
5114   echo "$ac_t""no" 1>&6
5115 { echo "configure: error: select() required." 1>&2; exit 1; }
5116 fi
5117
5118
5119 if test "${ac_cv_header_winsock_h}" != yes; then
5120                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
5121 echo "configure:5122: checking types of arguments for select()" >&5
5122  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
5123   echo $ac_n "(cached) $ac_c" 1>&6
5124 else
5125    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
5126   echo $ac_n "(cached) $ac_c" 1>&6
5127 else
5128     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
5129   echo $ac_n "(cached) $ac_c" 1>&6
5130 else
5131      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
5132      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
5133       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
5134        cat > conftest.$ac_ext <<EOF
5135 #line 5136 "configure"
5136 #include "confdefs.h"
5137 #ifdef HAVE_SYS_TYPES_H
5138 #include <sys/types.h>
5139 #endif
5140 #ifdef HAVE_SYS_TIME_H
5141 #include <sys/time.h>
5142 #endif
5143 #ifdef HAVE_SYS_SELECT_H
5144 #include <sys/select.h>
5145 #endif
5146 #ifdef HAVE_SYS_SOCKET_H
5147 #include <sys/socket.h>
5148 #endif
5149 extern select ($ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5);
5150 int main() {
5151
5152 ; return 0; }
5153 EOF
5154 if { (eval echo configure:5155: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5155   rm -rf conftest*
5156           ac_not_found=no ; break 3
5157 else
5158   echo "configure: failed program was:" >&5
5159   cat conftest.$ac_ext >&5
5160   rm -rf conftest*
5161   ac_not_found=yes
5162 fi
5163 rm -f conftest*
5164       done
5165      done
5166     done
5167    
5168 fi
5169   
5170 fi
5171  
5172 fi
5173  if test "$ac_not_found" = yes; then
5174   ac_cv_func_select_arg1=int 
5175   ac_cv_func_select_arg234='int *' 
5176   ac_cv_func_select_arg5='struct timeval *'
5177  fi
5178  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
5179  cat >> confdefs.h <<EOF
5180 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
5181 EOF
5182
5183  cat >> confdefs.h <<EOF
5184 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
5185 EOF
5186
5187  cat >> confdefs.h <<EOF
5188 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
5189 EOF
5190
5191
5192 fi
5193
5194
5195 for ac_hdr in regex.h 
5196 do
5197 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5198 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5199 echo "configure:5200: checking for $ac_hdr" >&5
5200 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5201   echo $ac_n "(cached) $ac_c" 1>&6
5202 else
5203   cat > conftest.$ac_ext <<EOF
5204 #line 5205 "configure"
5205 #include "confdefs.h"
5206 #include <$ac_hdr>
5207 EOF
5208 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5209 { (eval echo configure:5210: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5210 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5211 if test -z "$ac_err"; then
5212   rm -rf conftest*
5213   eval "ac_cv_header_$ac_safe=yes"
5214 else
5215   echo "$ac_err" >&5
5216   echo "configure: failed program was:" >&5
5217   cat conftest.$ac_ext >&5
5218   rm -rf conftest*
5219   eval "ac_cv_header_$ac_safe=no"
5220 fi
5221 rm -f conftest*
5222 fi
5223 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5224   echo "$ac_t""yes" 1>&6
5225     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5226   cat >> confdefs.h <<EOF
5227 #define $ac_tr_hdr 1
5228 EOF
5229  
5230 else
5231   echo "$ac_t""no" 1>&6
5232 fi
5233 done
5234
5235 if test "$ac_cv_header_regex_h" != yes ; then
5236         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
5237 fi
5238 echo $ac_n "checking for regfree""... $ac_c" 1>&6
5239 echo "configure:5240: checking for regfree" >&5
5240 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
5241   echo $ac_n "(cached) $ac_c" 1>&6
5242 else
5243   cat > conftest.$ac_ext <<EOF
5244 #line 5245 "configure"
5245 #include "confdefs.h"
5246 /* System header to define __stub macros and hopefully few prototypes,
5247     which can conflict with char regfree(); below.  */
5248 #include <assert.h>
5249 /* Override any gcc2 internal prototype to avoid an error.  */
5250 /* We use char because int might match the return type of a gcc2
5251     builtin and then its argument prototype would still apply.  */
5252 char regfree();
5253 char (*f)();
5254
5255 int main() {
5256
5257 /* The GNU C library defines this for functions which it implements
5258     to always fail with ENOSYS.  Some functions are actually named
5259     something starting with __ and the normal name is an alias.  */
5260 #if defined (__stub_regfree) || defined (__stub___regfree)
5261 choke me
5262 #else
5263 f = regfree;
5264 #endif
5265
5266 ; return 0; }
5267 EOF
5268 if { (eval echo configure:5269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5269   rm -rf conftest*
5270   eval "ac_cv_func_regfree=yes"
5271 else
5272   echo "configure: failed program was:" >&5
5273   cat conftest.$ac_ext >&5
5274   rm -rf conftest*
5275   eval "ac_cv_func_regfree=no"
5276 fi
5277 rm -f conftest*
5278 fi
5279
5280 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
5281   echo "$ac_t""yes" 1>&6
5282   :
5283 else
5284   echo "$ac_t""no" 1>&6
5285 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
5286 fi
5287
5288
5289
5290 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
5291 echo "configure:5292: checking for compatible POSIX regex" >&5
5292 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
5293   echo $ac_n "(cached) $ac_c" 1>&6
5294 else
5295   
5296         if test "$cross_compiling" = yes; then
5297   ol_cv_c_posix_regex=cross
5298 else
5299   cat > conftest.$ac_ext <<EOF
5300 #line 5301 "configure"
5301 #include "confdefs.h"
5302
5303 #include <sys/types.h>
5304 #include <regex.h>
5305 static char *pattern, *string;
5306 main()
5307 {
5308         int rc;
5309         regex_t re;
5310
5311         pattern = "^A";
5312
5313         if(regcomp(&re, pattern, 0)) {
5314                 return -1;
5315         }
5316         
5317         string = "ALL MATCH";
5318         
5319         rc = regexec(&re, string, 0, (void*)0, 0);
5320
5321         regfree(&re);
5322
5323         return rc;
5324 }
5325 EOF
5326 if { (eval echo configure:5327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5327 then
5328   ol_cv_c_posix_regex=yes
5329 else
5330   echo "configure: failed program was:" >&5
5331   cat conftest.$ac_ext >&5
5332   rm -fr conftest*
5333   ol_cv_c_posix_regex=no
5334 fi
5335 rm -fr conftest*
5336 fi
5337
5338 fi
5339
5340 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5341
5342 if test "$ol_cv_c_posix_regex" = no ; then
5343         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5344 fi
5345
5346 ol_link_dnssrv=no
5347 echo $ac_n "checking for res_query""... $ac_c" 1>&6
5348 echo "configure:5349: checking for res_query" >&5
5349 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
5350   echo $ac_n "(cached) $ac_c" 1>&6
5351 else
5352   cat > conftest.$ac_ext <<EOF
5353 #line 5354 "configure"
5354 #include "confdefs.h"
5355 /* System header to define __stub macros and hopefully few prototypes,
5356     which can conflict with char res_query(); below.  */
5357 #include <assert.h>
5358 /* Override any gcc2 internal prototype to avoid an error.  */
5359 /* We use char because int might match the return type of a gcc2
5360     builtin and then its argument prototype would still apply.  */
5361 char res_query();
5362 char (*f)();
5363
5364 int main() {
5365
5366 /* The GNU C library defines this for functions which it implements
5367     to always fail with ENOSYS.  Some functions are actually named
5368     something starting with __ and the normal name is an alias.  */
5369 #if defined (__stub_res_query) || defined (__stub___res_query)
5370 choke me
5371 #else
5372 f = res_query;
5373 #endif
5374
5375 ; return 0; }
5376 EOF
5377 if { (eval echo configure:5378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5378   rm -rf conftest*
5379   eval "ac_cv_func_res_query=yes"
5380 else
5381   echo "configure: failed program was:" >&5
5382   cat conftest.$ac_ext >&5
5383   rm -rf conftest*
5384   eval "ac_cv_func_res_query=no"
5385 fi
5386 rm -f conftest*
5387 fi
5388
5389 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
5390   echo "$ac_t""yes" 1>&6
5391   :
5392 else
5393   echo "$ac_t""no" 1>&6
5394 fi
5395
5396 if test $ac_cv_func_res_query = no ; then 
5397         echo $ac_n "checking for __res_query""... $ac_c" 1>&6
5398 echo "configure:5399: checking for __res_query" >&5
5399 if eval "test \"\${ac_cv_func___res_query+set}\" = set"; then
5400   echo $ac_n "(cached) $ac_c" 1>&6
5401 else
5402   cat > conftest.$ac_ext <<EOF
5403 #line 5404 "configure"
5404 #include "confdefs.h"
5405 /* System header to define __stub macros and hopefully few prototypes,
5406     which can conflict with char __res_query(); below.  */
5407 #include <assert.h>
5408 /* Override any gcc2 internal prototype to avoid an error.  */
5409 /* We use char because int might match the return type of a gcc2
5410     builtin and then its argument prototype would still apply.  */
5411 char __res_query();
5412 char (*f)();
5413
5414 int main() {
5415
5416 /* The GNU C library defines this for functions which it implements
5417     to always fail with ENOSYS.  Some functions are actually named
5418     something starting with __ and the normal name is an alias.  */
5419 #if defined (__stub___res_query) || defined (__stub_____res_query)
5420 choke me
5421 #else
5422 f = __res_query;
5423 #endif
5424
5425 ; return 0; }
5426 EOF
5427 if { (eval echo configure:5428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5428   rm -rf conftest*
5429   eval "ac_cv_func___res_query=yes"
5430 else
5431   echo "configure: failed program was:" >&5
5432   cat conftest.$ac_ext >&5
5433   rm -rf conftest*
5434   eval "ac_cv_func___res_query=no"
5435 fi
5436 rm -f conftest*
5437 fi
5438
5439 if eval "test \"`echo '$ac_cv_func_'__res_query`\" = yes"; then
5440   echo "$ac_t""yes" 1>&6
5441   :
5442 else
5443   echo "$ac_t""no" 1>&6
5444 fi
5445
5446         ac_cv_func_res_query=$ac_cv_func___res_query
5447 fi
5448
5449 if test $ac_cv_func_res_query = no ; then 
5450         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
5451 echo "configure:5452: checking for res_query in -lbind" >&5
5452 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
5453 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5454   echo $ac_n "(cached) $ac_c" 1>&6
5455 else
5456   ac_save_LIBS="$LIBS"
5457 LIBS="-lbind  $LIBS"
5458 cat > conftest.$ac_ext <<EOF
5459 #line 5460 "configure"
5460 #include "confdefs.h"
5461 /* Override any gcc2 internal prototype to avoid an error.  */
5462 /* We use char because int might match the return type of a gcc2
5463     builtin and then its argument prototype would still apply.  */
5464 char res_query();
5465
5466 int main() {
5467 res_query()
5468 ; return 0; }
5469 EOF
5470 if { (eval echo configure:5471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5471   rm -rf conftest*
5472   eval "ac_cv_lib_$ac_lib_var=yes"
5473 else
5474   echo "configure: failed program was:" >&5
5475   cat conftest.$ac_ext >&5
5476   rm -rf conftest*
5477   eval "ac_cv_lib_$ac_lib_var=no"
5478 fi
5479 rm -f conftest*
5480 LIBS="$ac_save_LIBS"
5481
5482 fi
5483 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5484   echo "$ac_t""yes" 1>&6
5485     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5486     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5487   cat >> confdefs.h <<EOF
5488 #define $ac_tr_lib 1
5489 EOF
5490
5491   LIBS="-lbind $LIBS"
5492
5493 else
5494   echo "$ac_t""no" 1>&6
5495 fi
5496
5497         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
5498 fi
5499
5500 if test $ac_cv_func_res_query = no ; then 
5501         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
5502 echo "configure:5503: checking for __res_query in -lbind" >&5
5503 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
5504 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5505   echo $ac_n "(cached) $ac_c" 1>&6
5506 else
5507   ac_save_LIBS="$LIBS"
5508 LIBS="-lbind  $LIBS"
5509 cat > conftest.$ac_ext <<EOF
5510 #line 5511 "configure"
5511 #include "confdefs.h"
5512 /* Override any gcc2 internal prototype to avoid an error.  */
5513 /* We use char because int might match the return type of a gcc2
5514     builtin and then its argument prototype would still apply.  */
5515 char __res_query();
5516
5517 int main() {
5518 __res_query()
5519 ; return 0; }
5520 EOF
5521 if { (eval echo configure:5522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5522   rm -rf conftest*
5523   eval "ac_cv_lib_$ac_lib_var=yes"
5524 else
5525   echo "configure: failed program was:" >&5
5526   cat conftest.$ac_ext >&5
5527   rm -rf conftest*
5528   eval "ac_cv_lib_$ac_lib_var=no"
5529 fi
5530 rm -f conftest*
5531 LIBS="$ac_save_LIBS"
5532
5533 fi
5534 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5535   echo "$ac_t""yes" 1>&6
5536     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5537     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5538   cat >> confdefs.h <<EOF
5539 #define $ac_tr_lib 1
5540 EOF
5541
5542   LIBS="-lbind $LIBS"
5543
5544 else
5545   echo "$ac_t""no" 1>&6
5546 fi
5547
5548         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
5549 fi
5550
5551 if test $ac_cv_func_res_query = no ; then 
5552         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
5553 echo "configure:5554: checking for res_query in -lresolv" >&5
5554 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
5555 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5556   echo $ac_n "(cached) $ac_c" 1>&6
5557 else
5558   ac_save_LIBS="$LIBS"
5559 LIBS="-lresolv  $LIBS"
5560 cat > conftest.$ac_ext <<EOF
5561 #line 5562 "configure"
5562 #include "confdefs.h"
5563 /* Override any gcc2 internal prototype to avoid an error.  */
5564 /* We use char because int might match the return type of a gcc2
5565     builtin and then its argument prototype would still apply.  */
5566 char res_query();
5567
5568 int main() {
5569 res_query()
5570 ; return 0; }
5571 EOF
5572 if { (eval echo configure:5573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5573   rm -rf conftest*
5574   eval "ac_cv_lib_$ac_lib_var=yes"
5575 else
5576   echo "configure: failed program was:" >&5
5577   cat conftest.$ac_ext >&5
5578   rm -rf conftest*
5579   eval "ac_cv_lib_$ac_lib_var=no"
5580 fi
5581 rm -f conftest*
5582 LIBS="$ac_save_LIBS"
5583
5584 fi
5585 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5586   echo "$ac_t""yes" 1>&6
5587     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5588     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5589   cat >> confdefs.h <<EOF
5590 #define $ac_tr_lib 1
5591 EOF
5592
5593   LIBS="-lresolv $LIBS"
5594
5595 else
5596   echo "$ac_t""no" 1>&6
5597 fi
5598
5599         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
5600 fi
5601
5602 if test $ac_cv_func_res_query = no ; then 
5603         echo $ac_n "checking for __res_query in -lresolv""... $ac_c" 1>&6
5604 echo "configure:5605: checking for __res_query in -lresolv" >&5
5605 ac_lib_var=`echo resolv'_'__res_query | sed 'y%./+-:%__p__%'`
5606 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5607   echo $ac_n "(cached) $ac_c" 1>&6
5608 else
5609   ac_save_LIBS="$LIBS"
5610 LIBS="-lresolv  $LIBS"
5611 cat > conftest.$ac_ext <<EOF
5612 #line 5613 "configure"
5613 #include "confdefs.h"
5614 /* Override any gcc2 internal prototype to avoid an error.  */
5615 /* We use char because int might match the return type of a gcc2
5616     builtin and then its argument prototype would still apply.  */
5617 char __res_query();
5618
5619 int main() {
5620 __res_query()
5621 ; return 0; }
5622 EOF
5623 if { (eval echo configure:5624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5624   rm -rf conftest*
5625   eval "ac_cv_lib_$ac_lib_var=yes"
5626 else
5627   echo "configure: failed program was:" >&5
5628   cat conftest.$ac_ext >&5
5629   rm -rf conftest*
5630   eval "ac_cv_lib_$ac_lib_var=no"
5631 fi
5632 rm -f conftest*
5633 LIBS="$ac_save_LIBS"
5634
5635 fi
5636 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5637   echo "$ac_t""yes" 1>&6
5638     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5639     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5640   cat >> confdefs.h <<EOF
5641 #define $ac_tr_lib 1
5642 EOF
5643
5644   LIBS="-lresolv $LIBS"
5645
5646 else
5647   echo "$ac_t""no" 1>&6
5648 fi
5649
5650         ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
5651 fi
5652
5653 if test "$ac_cv_func_res_query" = yes ; then
5654         cat >> confdefs.h <<\EOF
5655 #define HAVE_RES_QUERY 1
5656 EOF
5657
5658
5659         if test $ol_enable_dnssrv != no ; then
5660                 ol_link_dnssrv=yes
5661         fi
5662 fi
5663
5664 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
5665         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
5666 fi
5667
5668 for ac_func in getaddrinfo inet_ntop 
5669 do
5670 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5671 echo "configure:5672: checking for $ac_func" >&5
5672 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
5673   echo $ac_n "(cached) $ac_c" 1>&6
5674 else
5675   cat > conftest.$ac_ext <<EOF
5676 #line 5677 "configure"
5677 #include "confdefs.h"
5678 /* System header to define __stub macros and hopefully few prototypes,
5679     which can conflict with char $ac_func(); below.  */
5680 #include <assert.h>
5681 /* Override any gcc2 internal prototype to avoid an error.  */
5682 /* We use char because int might match the return type of a gcc2
5683     builtin and then its argument prototype would still apply.  */
5684 char $ac_func();
5685 char (*f)();
5686
5687 int main() {
5688
5689 /* The GNU C library defines this for functions which it implements
5690     to always fail with ENOSYS.  Some functions are actually named
5691     something starting with __ and the normal name is an alias.  */
5692 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5693 choke me
5694 #else
5695 f = $ac_func;
5696 #endif
5697
5698 ; return 0; }
5699 EOF
5700 if { (eval echo configure:5701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5701   rm -rf conftest*
5702   eval "ac_cv_func_$ac_func=yes"
5703 else
5704   echo "configure: failed program was:" >&5
5705   cat conftest.$ac_ext >&5
5706   rm -rf conftest*
5707   eval "ac_cv_func_$ac_func=no"
5708 fi
5709 rm -f conftest*
5710 fi
5711
5712 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5713   echo "$ac_t""yes" 1>&6
5714     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5715   cat >> confdefs.h <<EOF
5716 #define $ac_tr_func 1
5717 EOF
5718  
5719 else
5720   echo "$ac_t""no" 1>&6
5721 fi
5722 done
5723
5724
5725 ol_link_ipv6=no
5726 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
5727         if test $ol_enable_ipv6 = yes ; then
5728                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
5729         fi
5730 else
5731         for ac_func in gai_strerror 
5732 do
5733 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5734 echo "configure:5735: checking for $ac_func" >&5
5735 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
5736   echo $ac_n "(cached) $ac_c" 1>&6
5737 else
5738   cat > conftest.$ac_ext <<EOF
5739 #line 5740 "configure"
5740 #include "confdefs.h"
5741 /* System header to define __stub macros and hopefully few prototypes,
5742     which can conflict with char $ac_func(); below.  */
5743 #include <assert.h>
5744 /* Override any gcc2 internal prototype to avoid an error.  */
5745 /* We use char because int might match the return type of a gcc2
5746     builtin and then its argument prototype would still apply.  */
5747 char $ac_func();
5748 char (*f)();
5749
5750 int main() {
5751
5752 /* The GNU C library defines this for functions which it implements
5753     to always fail with ENOSYS.  Some functions are actually named
5754     something starting with __ and the normal name is an alias.  */
5755 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5756 choke me
5757 #else
5758 f = $ac_func;
5759 #endif
5760
5761 ; return 0; }
5762 EOF
5763 if { (eval echo configure:5764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5764   rm -rf conftest*
5765   eval "ac_cv_func_$ac_func=yes"
5766 else
5767   echo "configure: failed program was:" >&5
5768   cat conftest.$ac_ext >&5
5769   rm -rf conftest*
5770   eval "ac_cv_func_$ac_func=no"
5771 fi
5772 rm -f conftest*
5773 fi
5774
5775 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5776   echo "$ac_t""yes" 1>&6
5777     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5778   cat >> confdefs.h <<EOF
5779 #define $ac_tr_func 1
5780 EOF
5781  
5782 else
5783   echo "$ac_t""no" 1>&6
5784 fi
5785 done
5786
5787
5788         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
5789 echo "configure:5790: checking INET6_ADDRSTRLEN" >&5
5790 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
5791   echo $ac_n "(cached) $ac_c" 1>&6
5792 else
5793   
5794                 cat > conftest.$ac_ext <<EOF
5795 #line 5796 "configure"
5796 #include "confdefs.h"
5797
5798 #                       include <netinet/in.h>
5799 #                       ifdef INET6_ADDRSTRLEN
5800                                 __has_inet6_addrstrlen__;
5801 #                       endif
5802                 
5803 EOF
5804 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5805   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
5806   rm -rf conftest*
5807   ol_cv_inet6_addrstrlen=yes
5808 else
5809   rm -rf conftest*
5810   ol_cv_inet6_addrstrlen=no
5811 fi
5812 rm -f conftest*
5813
5814 fi
5815
5816 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
5817
5818         if test $ol_cv_inet6_addrstrlen = yes ; then
5819                 ol_link_ipv6=yes
5820         elif test $ol_enable_ipv6 = yes ; then
5821                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
5822         fi
5823 fi
5824
5825 if test $ol_enable_local != no ; then
5826         for ac_hdr in sys/un.h 
5827 do
5828 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5829 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5830 echo "configure:5831: checking for $ac_hdr" >&5
5831 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5832   echo $ac_n "(cached) $ac_c" 1>&6
5833 else
5834   cat > conftest.$ac_ext <<EOF
5835 #line 5836 "configure"
5836 #include "confdefs.h"
5837 #include <$ac_hdr>
5838 EOF
5839 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5840 { (eval echo configure:5841: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5841 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5842 if test -z "$ac_err"; then
5843   rm -rf conftest*
5844   eval "ac_cv_header_$ac_safe=yes"
5845 else
5846   echo "$ac_err" >&5
5847   echo "configure: failed program was:" >&5
5848   cat conftest.$ac_ext >&5
5849   rm -rf conftest*
5850   eval "ac_cv_header_$ac_safe=no"
5851 fi
5852 rm -f conftest*
5853 fi
5854 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5855   echo "$ac_t""yes" 1>&6
5856     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5857   cat >> confdefs.h <<EOF
5858 #define $ac_tr_hdr 1
5859 EOF
5860  
5861 else
5862   echo "$ac_t""no" 1>&6
5863 fi
5864 done
5865
5866
5867         if test $ol_enable_local = auto ; then
5868                 ol_enable_local=$ac_cv_header_sys_un_h
5869         elif test $ac_cv_header_sys_un_h = no ; then
5870                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
5871         fi
5872 fi
5873
5874 ol_link_kbind=no
5875 ol_link_kpasswd=no
5876 ol_link_krb5=no
5877 ol_link_krb4=no
5878
5879 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
5880         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
5881         -o $ol_with_kerberos = k425 ; then
5882
5883         for ac_hdr in krb5.h
5884 do
5885 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5886 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5887 echo "configure:5888: checking for $ac_hdr" >&5
5888 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5889   echo $ac_n "(cached) $ac_c" 1>&6
5890 else
5891   cat > conftest.$ac_ext <<EOF
5892 #line 5893 "configure"
5893 #include "confdefs.h"
5894 #include <$ac_hdr>
5895 EOF
5896 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5897 { (eval echo configure:5898: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5898 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5899 if test -z "$ac_err"; then
5900   rm -rf conftest*
5901   eval "ac_cv_header_$ac_safe=yes"
5902 else
5903   echo "$ac_err" >&5
5904   echo "configure: failed program was:" >&5
5905   cat conftest.$ac_ext >&5
5906   rm -rf conftest*
5907   eval "ac_cv_header_$ac_safe=no"
5908 fi
5909 rm -f conftest*
5910 fi
5911 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5912   echo "$ac_t""yes" 1>&6
5913     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5914   cat >> confdefs.h <<EOF
5915 #define $ac_tr_hdr 1
5916 EOF
5917  
5918 else
5919   echo "$ac_t""no" 1>&6
5920 fi
5921 done
5922
5923
5924         if test $ac_cv_header_krb5_h = yes ; then
5925                                 for ac_hdr in heim_err.h
5926 do
5927 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5928 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5929 echo "configure:5930: checking for $ac_hdr" >&5
5930 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5931   echo $ac_n "(cached) $ac_c" 1>&6
5932 else
5933   cat > conftest.$ac_ext <<EOF
5934 #line 5935 "configure"
5935 #include "confdefs.h"
5936 #include <$ac_hdr>
5937 EOF
5938 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5939 { (eval echo configure:5940: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5940 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5941 if test -z "$ac_err"; then
5942   rm -rf conftest*
5943   eval "ac_cv_header_$ac_safe=yes"
5944 else
5945   echo "$ac_err" >&5
5946   echo "configure: failed program was:" >&5
5947   cat conftest.$ac_ext >&5
5948   rm -rf conftest*
5949   eval "ac_cv_header_$ac_safe=no"
5950 fi
5951 rm -f conftest*
5952 fi
5953 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5954   echo "$ac_t""yes" 1>&6
5955     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5956   cat >> confdefs.h <<EOF
5957 #define $ac_tr_hdr 1
5958 EOF
5959  
5960 else
5961   echo "$ac_t""no" 1>&6
5962 fi
5963 done
5964
5965                 if test $ac_cv_header_heim_err_h = yes ; then
5966                         krb5_impl=heimdal
5967                 else
5968                         krb5_impl=mit
5969                 fi
5970
5971                 if test $krb5_impl = mit; then
5972                         echo $ac_n "checking for main in -lk5crypto""... $ac_c" 1>&6
5973 echo "configure:5974: checking for main in -lk5crypto" >&5
5974 ac_lib_var=`echo k5crypto'_'main | sed 'y%./+-:%__p__%'`
5975 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5976   echo $ac_n "(cached) $ac_c" 1>&6
5977 else
5978   ac_save_LIBS="$LIBS"
5979 LIBS="-lk5crypto  $LIBS"
5980 cat > conftest.$ac_ext <<EOF
5981 #line 5982 "configure"
5982 #include "confdefs.h"
5983
5984 int main() {
5985 main()
5986 ; return 0; }
5987 EOF
5988 if { (eval echo configure:5989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5989   rm -rf conftest*
5990   eval "ac_cv_lib_$ac_lib_var=yes"
5991 else
5992   echo "configure: failed program was:" >&5
5993   cat conftest.$ac_ext >&5
5994   rm -rf conftest*
5995   eval "ac_cv_lib_$ac_lib_var=no"
5996 fi
5997 rm -f conftest*
5998 LIBS="$ac_save_LIBS"
5999
6000 fi
6001 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6002   echo "$ac_t""yes" 1>&6
6003   krb5crypto=k5crypto
6004 else
6005   echo "$ac_t""no" 1>&6
6006 krb5crypto=crypto
6007 fi
6008
6009
6010                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6011 echo "configure:6012: checking for main in -lkrb5" >&5
6012 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6013 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6014   echo $ac_n "(cached) $ac_c" 1>&6
6015 else
6016   ac_save_LIBS="$LIBS"
6017 LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
6018 cat > conftest.$ac_ext <<EOF
6019 #line 6020 "configure"
6020 #include "confdefs.h"
6021
6022 int main() {
6023 main()
6024 ; return 0; }
6025 EOF
6026 if { (eval echo configure:6027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6027   rm -rf conftest*
6028   eval "ac_cv_lib_$ac_lib_var=yes"
6029 else
6030   echo "configure: failed program was:" >&5
6031   cat conftest.$ac_ext >&5
6032   rm -rf conftest*
6033   eval "ac_cv_lib_$ac_lib_var=no"
6034 fi
6035 rm -f conftest*
6036 LIBS="$ac_save_LIBS"
6037
6038 fi
6039 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6040   echo "$ac_t""yes" 1>&6
6041   have_krb5=yes
6042                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lcom_err"
6043 else
6044   echo "$ac_t""no" 1>&6
6045 have_krb5=no
6046 fi
6047
6048
6049                 elif test $krb5_impl = heimdal; then
6050                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6051 echo "configure:6052: checking for main in -lkrb5" >&5
6052 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6053 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6054   echo $ac_n "(cached) $ac_c" 1>&6
6055 else
6056   ac_save_LIBS="$LIBS"
6057 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6058 cat > conftest.$ac_ext <<EOF
6059 #line 6060 "configure"
6060 #include "confdefs.h"
6061
6062 int main() {
6063 main()
6064 ; return 0; }
6065 EOF
6066 if { (eval echo configure:6067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6067   rm -rf conftest*
6068   eval "ac_cv_lib_$ac_lib_var=yes"
6069 else
6070   echo "configure: failed program was:" >&5
6071   cat conftest.$ac_ext >&5
6072   rm -rf conftest*
6073   eval "ac_cv_lib_$ac_lib_var=no"
6074 fi
6075 rm -f conftest*
6076 LIBS="$ac_save_LIBS"
6077
6078 fi
6079 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6080   echo "$ac_t""yes" 1>&6
6081   have_krb5=yes
6082                                 KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
6083 else
6084   echo "$ac_t""no" 1>&6
6085 have_krb5=no
6086 fi
6087
6088
6089                         cat >> confdefs.h <<\EOF
6090 #define HAVE_HEIMDAL_KERBEROS 1
6091 EOF
6092
6093
6094                 else
6095                         have_krb5=no
6096                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
6097                 fi
6098
6099                 if test $have_krb5 = yes ; then
6100                         ol_link_krb5=yes
6101
6102                         cat >> confdefs.h <<\EOF
6103 #define HAVE_KRB5 1
6104 EOF
6105
6106
6107                         if test $ol_enable_kpasswd != no ; then
6108                                 ol_link_kpasswd=yes;
6109                         fi
6110
6111                         if test $ol_with_kerberos = k5only ; then
6112                                 ol_with_kerberos=found
6113                         fi
6114
6115                 elif test $ol_with_kerberos != auto ; then
6116                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
6117                 fi
6118
6119         fi
6120 fi
6121
6122 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
6123         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
6124
6125         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
6126 do
6127 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6128 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6129 echo "configure:6130: checking for $ac_hdr" >&5
6130 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6131   echo $ac_n "(cached) $ac_c" 1>&6
6132 else
6133   cat > conftest.$ac_ext <<EOF
6134 #line 6135 "configure"
6135 #include "confdefs.h"
6136 #include <$ac_hdr>
6137 EOF
6138 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6139 { (eval echo configure:6140: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6140 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6141 if test -z "$ac_err"; then
6142   rm -rf conftest*
6143   eval "ac_cv_header_$ac_safe=yes"
6144 else
6145   echo "$ac_err" >&5
6146   echo "configure: failed program was:" >&5
6147   cat conftest.$ac_ext >&5
6148   rm -rf conftest*
6149   eval "ac_cv_header_$ac_safe=no"
6150 fi
6151 rm -f conftest*
6152 fi
6153 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6154   echo "$ac_t""yes" 1>&6
6155     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6156   cat >> confdefs.h <<EOF
6157 #define $ac_tr_hdr 1
6158 EOF
6159  
6160 else
6161   echo "$ac_t""no" 1>&6
6162 fi
6163 done
6164
6165
6166         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
6167                 if test $krb5_impl = mit; then
6168                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6169 echo "configure:6170: checking for main in -lkrb4" >&5
6170 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6171 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6172   echo $ac_n "(cached) $ac_c" 1>&6
6173 else
6174   ac_save_LIBS="$LIBS"
6175 LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
6176 cat > conftest.$ac_ext <<EOF
6177 #line 6178 "configure"
6178 #include "confdefs.h"
6179
6180 int main() {
6181 main()
6182 ; return 0; }
6183 EOF
6184 if { (eval echo configure:6185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6185   rm -rf conftest*
6186   eval "ac_cv_lib_$ac_lib_var=yes"
6187 else
6188   echo "configure: failed program was:" >&5
6189   cat conftest.$ac_ext >&5
6190   rm -rf conftest*
6191   eval "ac_cv_lib_$ac_lib_var=no"
6192 fi
6193 rm -f conftest*
6194 LIBS="$ac_save_LIBS"
6195
6196 fi
6197 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6198   echo "$ac_t""yes" 1>&6
6199   have_k425=yes
6200                                 KRB4_LIBS="-lkrb4 -ldes425"
6201 else
6202   echo "$ac_t""no" 1>&6
6203 have_k425=no
6204 fi
6205
6206
6207                 elif test $krb5_impl = heimdal; then
6208                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6209 echo "configure:6210: checking for main in -lkrb4" >&5
6210 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6211 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6212   echo $ac_n "(cached) $ac_c" 1>&6
6213 else
6214   ac_save_LIBS="$LIBS"
6215 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6216 cat > conftest.$ac_ext <<EOF
6217 #line 6218 "configure"
6218 #include "confdefs.h"
6219
6220 int main() {
6221 main()
6222 ; return 0; }
6223 EOF
6224 if { (eval echo configure:6225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6225   rm -rf conftest*
6226   eval "ac_cv_lib_$ac_lib_var=yes"
6227 else
6228   echo "configure: failed program was:" >&5
6229   cat conftest.$ac_ext >&5
6230   rm -rf conftest*
6231   eval "ac_cv_lib_$ac_lib_var=no"
6232 fi
6233 rm -f conftest*
6234 LIBS="$ac_save_LIBS"
6235
6236 fi
6237 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6238   echo "$ac_t""yes" 1>&6
6239   have_k425=yes
6240                                 KRB4_LIBS="-lkrb4"
6241 else
6242   echo "$ac_t""no" 1>&6
6243 have_k425=no
6244 fi
6245
6246
6247                 else
6248                         have_425=no
6249                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
6250                 fi
6251
6252                 if test $have_k425 = yes ; then
6253                         ol_with_kerberos=found
6254                         ol_link_krb4=yes
6255
6256                         cat >> confdefs.h <<\EOF
6257 #define HAVE_KRB425 1
6258 EOF
6259
6260                         cat >> confdefs.h <<\EOF
6261 #define HAVE_KRB4 1
6262 EOF
6263
6264
6265                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
6266 echo "configure:6267: checking for des_debug in Kerberos libraries" >&5
6267 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
6268   echo $ac_n "(cached) $ac_c" 1>&6
6269 else
6270   
6271                                                                 save_LIBS="$LIBS"
6272                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
6273                                 cat > conftest.$ac_ext <<EOF
6274 #line 6275 "configure"
6275 #include "confdefs.h"
6276
6277 #include <kerberosIV/krb.h>
6278 #include <kerberosIV/des.h>
6279 extern int des_debug;
6280
6281 int main() {
6282
6283 des_debug = 1;
6284
6285 ; return 0; }
6286 EOF
6287 if { (eval echo configure:6288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6288   rm -rf conftest*
6289   ol_cv_var_des_debug=yes
6290 else
6291   echo "configure: failed program was:" >&5
6292   cat conftest.$ac_ext >&5
6293   rm -rf conftest*
6294   ol_cv_var_des_debug=no
6295 fi
6296 rm -f conftest*
6297                                                                 LIBS="$save_LIBS"
6298                         
6299 fi
6300
6301 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
6302
6303                         if test $ol_cv_var_des_debug = yes ; then
6304                                 cat >> confdefs.h <<\EOF
6305 #define HAVE_DES_DEBUG 1
6306 EOF
6307
6308                         fi
6309
6310                         LIBS="$save_LIBS"
6311                 fi
6312         fi
6313 fi
6314
6315 if test $ol_link_krb5 = yes ; then
6316         ol_with_kerberos=found
6317 fi
6318
6319 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6320         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
6321
6322         for ac_hdr in krb.h des.h krb-archaeology.h 
6323 do
6324 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6325 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6326 echo "configure:6327: checking for $ac_hdr" >&5
6327 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6328   echo $ac_n "(cached) $ac_c" 1>&6
6329 else
6330   cat > conftest.$ac_ext <<EOF
6331 #line 6332 "configure"
6332 #include "confdefs.h"
6333 #include <$ac_hdr>
6334 EOF
6335 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6336 { (eval echo configure:6337: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6337 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6338 if test -z "$ac_err"; then
6339   rm -rf conftest*
6340   eval "ac_cv_header_$ac_safe=yes"
6341 else
6342   echo "$ac_err" >&5
6343   echo "configure: failed program was:" >&5
6344   cat conftest.$ac_ext >&5
6345   rm -rf conftest*
6346   eval "ac_cv_header_$ac_safe=no"
6347 fi
6348 rm -f conftest*
6349 fi
6350 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6351   echo "$ac_t""yes" 1>&6
6352     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6353   cat >> confdefs.h <<EOF
6354 #define $ac_tr_hdr 1
6355 EOF
6356  
6357 else
6358   echo "$ac_t""no" 1>&6
6359 fi
6360 done
6361
6362
6363         if test $ac_cv_header_krb_h = yes ; then
6364                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
6365 echo "configure:6366: checking for main in -lkrb" >&5
6366 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
6367 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6368   echo $ac_n "(cached) $ac_c" 1>&6
6369 else
6370   ac_save_LIBS="$LIBS"
6371 LIBS="-lkrb -ldes $LIBS"
6372 cat > conftest.$ac_ext <<EOF
6373 #line 6374 "configure"
6374 #include "confdefs.h"
6375
6376 int main() {
6377 main()
6378 ; return 0; }
6379 EOF
6380 if { (eval echo configure:6381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6381   rm -rf conftest*
6382   eval "ac_cv_lib_$ac_lib_var=yes"
6383 else
6384   echo "configure: failed program was:" >&5
6385   cat conftest.$ac_ext >&5
6386   rm -rf conftest*
6387   eval "ac_cv_lib_$ac_lib_var=no"
6388 fi
6389 rm -f conftest*
6390 LIBS="$ac_save_LIBS"
6391
6392 fi
6393 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6394   echo "$ac_t""yes" 1>&6
6395   have_k4=yes
6396 else
6397   echo "$ac_t""no" 1>&6
6398 have_k4=no
6399 fi
6400
6401
6402                 if test $have_k4 = yes ; then
6403                         ol_with_kerberos=found
6404                         ol_link_krb4=yes
6405
6406                         cat >> confdefs.h <<\EOF
6407 #define HAVE_KRB4 1
6408 EOF
6409
6410
6411                         KRB4_LIBS="-lkrb -ldes"
6412
6413                         if test $ac_cv_header_krb_archaeology_h = yes ; then
6414                                 cat >> confdefs.h <<\EOF
6415 #define HAVE_KTH_KERBEROS 1
6416 EOF
6417
6418                         fi
6419                 fi
6420         fi
6421 fi
6422
6423 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
6424         ol_link_kpasswd=yes
6425 fi
6426
6427 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
6428         ol_link_kbind=yes
6429
6430 elif test $ol_enable_kbind = yes ; then
6431         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
6432 fi
6433
6434 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
6435         cat >> confdefs.h <<\EOF
6436 #define HAVE_KERBEROS 1
6437 EOF
6438
6439
6440 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
6441         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
6442 fi
6443
6444 ol_link_tls=no
6445 if test $ol_with_tls != no ; then
6446         for ac_hdr in openssl/ssl.h ssl.h
6447 do
6448 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6449 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6450 echo "configure:6451: checking for $ac_hdr" >&5
6451 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6452   echo $ac_n "(cached) $ac_c" 1>&6
6453 else
6454   cat > conftest.$ac_ext <<EOF
6455 #line 6456 "configure"
6456 #include "confdefs.h"
6457 #include <$ac_hdr>
6458 EOF
6459 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6460 { (eval echo configure:6461: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6461 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6462 if test -z "$ac_err"; then
6463   rm -rf conftest*
6464   eval "ac_cv_header_$ac_safe=yes"
6465 else
6466   echo "$ac_err" >&5
6467   echo "configure: failed program was:" >&5
6468   cat conftest.$ac_ext >&5
6469   rm -rf conftest*
6470   eval "ac_cv_header_$ac_safe=no"
6471 fi
6472 rm -f conftest*
6473 fi
6474 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6475   echo "$ac_t""yes" 1>&6
6476     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6477   cat >> confdefs.h <<EOF
6478 #define $ac_tr_hdr 1
6479 EOF
6480  
6481 else
6482   echo "$ac_t""no" 1>&6
6483 fi
6484 done
6485
6486         
6487         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
6488                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
6489 echo "configure:6490: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
6490 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
6491 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6492   echo $ac_n "(cached) $ac_c" 1>&6
6493 else
6494   ac_save_LIBS="$LIBS"
6495 LIBS="-lssl -lcrypto $LIBS"
6496 cat > conftest.$ac_ext <<EOF
6497 #line 6498 "configure"
6498 #include "confdefs.h"
6499 /* Override any gcc2 internal prototype to avoid an error.  */
6500 /* We use char because int might match the return type of a gcc2
6501     builtin and then its argument prototype would still apply.  */
6502 char SSLeay_add_ssl_algorithms();
6503
6504 int main() {
6505 SSLeay_add_ssl_algorithms()
6506 ; return 0; }
6507 EOF
6508 if { (eval echo configure:6509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6509   rm -rf conftest*
6510   eval "ac_cv_lib_$ac_lib_var=yes"
6511 else
6512   echo "configure: failed program was:" >&5
6513   cat conftest.$ac_ext >&5
6514   rm -rf conftest*
6515   eval "ac_cv_lib_$ac_lib_var=no"
6516 fi
6517 rm -f conftest*
6518 LIBS="$ac_save_LIBS"
6519
6520 fi
6521 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6522   echo "$ac_t""yes" 1>&6
6523   have_ssleay=yes
6524                         need_rsaref=no
6525 else
6526   echo "$ac_t""no" 1>&6
6527 have_ssleay=no
6528 fi
6529
6530                         
6531                 if test $have_ssleay = no ; then
6532                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
6533 echo "configure:6534: checking for SSL_library_init in -lssl" >&5
6534 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
6535 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6536   echo $ac_n "(cached) $ac_c" 1>&6
6537 else
6538   ac_save_LIBS="$LIBS"
6539 LIBS="-lssl -lcrypto $LIBS"
6540 cat > conftest.$ac_ext <<EOF
6541 #line 6542 "configure"
6542 #include "confdefs.h"
6543 /* Override any gcc2 internal prototype to avoid an error.  */
6544 /* We use char because int might match the return type of a gcc2
6545     builtin and then its argument prototype would still apply.  */
6546 char SSL_library_init();
6547
6548 int main() {
6549 SSL_library_init()
6550 ; return 0; }
6551 EOF
6552 if { (eval echo configure:6553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6553   rm -rf conftest*
6554   eval "ac_cv_lib_$ac_lib_var=yes"
6555 else
6556   echo "configure: failed program was:" >&5
6557   cat conftest.$ac_ext >&5
6558   rm -rf conftest*
6559   eval "ac_cv_lib_$ac_lib_var=no"
6560 fi
6561 rm -f conftest*
6562 LIBS="$ac_save_LIBS"
6563
6564 fi
6565 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6566   echo "$ac_t""yes" 1>&6
6567   have_ssleay=yes
6568                                 need_rsaref=no
6569 else
6570   echo "$ac_t""no" 1>&6
6571 have_ssleay=no
6572 fi
6573
6574                 fi
6575
6576                 if test $have_ssleay = no ; then
6577                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
6578 echo "configure:6579: checking for ssl3_accept in -lssl" >&5
6579 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
6580 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6581   echo $ac_n "(cached) $ac_c" 1>&6
6582 else
6583   ac_save_LIBS="$LIBS"
6584 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
6585 cat > conftest.$ac_ext <<EOF
6586 #line 6587 "configure"
6587 #include "confdefs.h"
6588 /* Override any gcc2 internal prototype to avoid an error.  */
6589 /* We use char because int might match the return type of a gcc2
6590     builtin and then its argument prototype would still apply.  */
6591 char ssl3_accept();
6592
6593 int main() {
6594 ssl3_accept()
6595 ; return 0; }
6596 EOF
6597 if { (eval echo configure:6598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6598   rm -rf conftest*
6599   eval "ac_cv_lib_$ac_lib_var=yes"
6600 else
6601   echo "configure: failed program was:" >&5
6602   cat conftest.$ac_ext >&5
6603   rm -rf conftest*
6604   eval "ac_cv_lib_$ac_lib_var=no"
6605 fi
6606 rm -f conftest*
6607 LIBS="$ac_save_LIBS"
6608
6609 fi
6610 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6611   echo "$ac_t""yes" 1>&6
6612   have_ssleay=yes
6613                                 need_rsaref=yes
6614 else
6615   echo "$ac_t""no" 1>&6
6616 have_ssleay=no
6617 fi
6618
6619                 fi
6620
6621                 if test $have_ssleay = yes ; then
6622                         ol_with_tls=found
6623                         ol_link_tls=yes
6624
6625                         cat >> confdefs.h <<\EOF
6626 #define HAVE_SSLEAY 1
6627 EOF
6628
6629
6630                         if test $need_rsaref = yes; then
6631                                 cat >> confdefs.h <<\EOF
6632 #define HAVE_RSAREF 1
6633 EOF
6634
6635
6636                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
6637                         else
6638                                 TLS_LIBS="-lssl -lcrypto"
6639                         fi
6640                 fi
6641         fi
6642
6643 else
6644         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6645 fi
6646
6647 if test $ol_link_tls = yes ; then
6648         cat >> confdefs.h <<\EOF
6649 #define HAVE_TLS 1
6650 EOF
6651
6652
6653 elif test $ol_with_tls = auto ; then
6654         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
6655         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6656
6657 elif test $ol_with_tls != no ; then
6658         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
6659 fi
6660
6661 for ac_func in \
6662         ctime_r                 \
6663         gethostbyname_r gethostbyaddr_r \
6664
6665 do
6666 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6667 echo "configure:6668: checking for $ac_func" >&5
6668 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6669   echo $ac_n "(cached) $ac_c" 1>&6
6670 else
6671   cat > conftest.$ac_ext <<EOF
6672 #line 6673 "configure"
6673 #include "confdefs.h"
6674 /* System header to define __stub macros and hopefully few prototypes,
6675     which can conflict with char $ac_func(); below.  */
6676 #include <assert.h>
6677 /* Override any gcc2 internal prototype to avoid an error.  */
6678 /* We use char because int might match the return type of a gcc2
6679     builtin and then its argument prototype would still apply.  */
6680 char $ac_func();
6681 char (*f)();
6682
6683 int main() {
6684
6685 /* The GNU C library defines this for functions which it implements
6686     to always fail with ENOSYS.  Some functions are actually named
6687     something starting with __ and the normal name is an alias.  */
6688 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6689 choke me
6690 #else
6691 f = $ac_func;
6692 #endif
6693
6694 ; return 0; }
6695 EOF
6696 if { (eval echo configure:6697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6697   rm -rf conftest*
6698   eval "ac_cv_func_$ac_func=yes"
6699 else
6700   echo "configure: failed program was:" >&5
6701   cat conftest.$ac_ext >&5
6702   rm -rf conftest*
6703   eval "ac_cv_func_$ac_func=no"
6704 fi
6705 rm -f conftest*
6706 fi
6707
6708 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6709   echo "$ac_t""yes" 1>&6
6710     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6711   cat >> confdefs.h <<EOF
6712 #define $ac_tr_func 1
6713 EOF
6714  
6715 else
6716   echo "$ac_t""no" 1>&6
6717 fi
6718 done
6719
6720
6721 if test "$ac_cv_func_ctime_r" = no ; then
6722         ol_cv_func_ctime_r_nargs=0
6723 else
6724         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
6725 echo "configure:6726: checking number of arguments of ctime_r" >&5
6726 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
6727   echo $ac_n "(cached) $ac_c" 1>&6
6728 else
6729   cat > conftest.$ac_ext <<EOF
6730 #line 6731 "configure"
6731 #include "confdefs.h"
6732 #include <time.h>
6733 int main() {
6734 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
6735 ; return 0; }
6736 EOF
6737 if { (eval echo configure:6738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6738   rm -rf conftest*
6739   ol_cv_func_ctime_r_nargs3=yes
6740 else
6741   echo "configure: failed program was:" >&5
6742   cat conftest.$ac_ext >&5
6743   rm -rf conftest*
6744   ol_cv_func_ctime_r_nargs3=no
6745 fi
6746 rm -f conftest*
6747
6748         cat > conftest.$ac_ext <<EOF
6749 #line 6750 "configure"
6750 #include "confdefs.h"
6751 #include <time.h>
6752 int main() {
6753 time_t ti; char *buffer; ctime_r(&ti,buffer);
6754 ; return 0; }
6755 EOF
6756 if { (eval echo configure:6757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6757   rm -rf conftest*
6758   ol_cv_func_ctime_r_nargs2=yes
6759 else
6760   echo "configure: failed program was:" >&5
6761   cat conftest.$ac_ext >&5
6762   rm -rf conftest*
6763   ol_cv_func_ctime_r_nargs2=no
6764 fi
6765 rm -f conftest*
6766
6767         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
6768                 $ol_cv_func_ctime_r_nargs2 = no ; then
6769
6770                 ol_cv_func_ctime_r_nargs=3
6771
6772         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
6773                 $ol_cv_func_ctime_r_nargs2 = yes ; then
6774
6775                 ol_cv_func_ctime_r_nargs=2
6776
6777         else
6778                 ol_cv_func_ctime_r_nargs=0
6779         fi
6780   
6781 fi
6782
6783 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
6784
6785   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
6786         cat >> confdefs.h <<EOF
6787 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
6788 EOF
6789
6790   fi
6791
6792 fi
6793
6794 if test "$ac_cv_func_gethostbyname_r" = yes ; then
6795         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
6796 echo "configure:6797: checking number of arguments of gethostbyname_r" >&5
6797 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
6798   echo $ac_n "(cached) $ac_c" 1>&6
6799 else
6800   cat > conftest.$ac_ext <<EOF
6801 #line 6802 "configure"
6802 #include "confdefs.h"
6803 #include <sys/types.h>
6804 #include <sys/socket.h>
6805 #include <netinet/in.h>
6806 #include <netdb.h>
6807 #define BUFSIZE (sizeof(struct hostent)+10)
6808 int main() {
6809 struct hostent hent; char buffer[BUFSIZE];
6810                 int bufsize=BUFSIZE;int h_errno;
6811                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
6812                         buffer, bufsize, &h_errno);
6813 ; return 0; }
6814 EOF
6815 if { (eval echo configure:6816: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6816   rm -rf conftest*
6817   ol_cv_func_gethostbyname_r_nargs5=yes
6818 else
6819   echo "configure: failed program was:" >&5
6820   cat conftest.$ac_ext >&5
6821   rm -rf conftest*
6822   ol_cv_func_gethostbyname_r_nargs5=no
6823 fi
6824 rm -f conftest*
6825
6826         cat > conftest.$ac_ext <<EOF
6827 #line 6828 "configure"
6828 #include "confdefs.h"
6829 #include <sys/types.h>
6830 #include <sys/socket.h>
6831 #include <netinet/in.h>
6832 #include <netdb.h>
6833 #define BUFSIZE (sizeof(struct hostent)+10)
6834 int main() {
6835 struct hostent hent;struct hostent *rhent;
6836                 char buffer[BUFSIZE];
6837                 int bufsize=BUFSIZE;int h_errno;
6838                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
6839                         &rhent, &h_errno);
6840 ; return 0; }
6841 EOF
6842 if { (eval echo configure:6843: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6843   rm -rf conftest*
6844   ol_cv_func_gethostbyname_r_nargs6=yes
6845 else
6846   echo "configure: failed program was:" >&5
6847   cat conftest.$ac_ext >&5
6848   rm -rf conftest*
6849   ol_cv_func_gethostbyname_r_nargs6=no
6850 fi
6851 rm -f conftest*
6852
6853         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
6854                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
6855
6856                 ol_cv_func_gethostbyname_r_nargs=5
6857
6858         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
6859                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
6860
6861                 ol_cv_func_gethostbyname_r_nargs=6
6862
6863         else
6864                 ol_cv_func_gethostbyname_r_nargs=0
6865         fi
6866   
6867 fi
6868
6869 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
6870   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
6871         cat >> confdefs.h <<EOF
6872 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
6873 EOF
6874
6875   fi
6876
6877 else
6878         ol_cv_func_gethostbyname_r_nargs=0
6879 fi
6880  
6881 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
6882         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
6883 echo "configure:6884: checking number of arguments of gethostbyaddr_r" >&5
6884 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
6885   echo $ac_n "(cached) $ac_c" 1>&6
6886 else
6887   cat > conftest.$ac_ext <<EOF
6888 #line 6889 "configure"
6889 #include "confdefs.h"
6890 #include <sys/types.h>
6891 #include <sys/socket.h>
6892 #include <netinet/in.h>
6893 #include <netdb.h>
6894 #define BUFSIZE (sizeof(struct hostent)+10)
6895 int main() {
6896 struct hostent hent; char buffer[BUFSIZE]; 
6897             struct in_addr add;
6898             size_t alen=sizeof(struct in_addr);
6899             int bufsize=BUFSIZE;int h_errno;
6900                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
6901                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
6902 ; return 0; }
6903 EOF
6904 if { (eval echo configure:6905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6905   rm -rf conftest*
6906   ol_cv_func_gethostbyaddr_r_nargs7=yes
6907 else
6908   echo "configure: failed program was:" >&5
6909   cat conftest.$ac_ext >&5
6910   rm -rf conftest*
6911   ol_cv_func_gethostbyaddr_r_nargs7=no
6912 fi
6913 rm -f conftest*
6914
6915         cat > conftest.$ac_ext <<EOF
6916 #line 6917 "configure"
6917 #include "confdefs.h"
6918 #include <sys/types.h>
6919 #include <sys/socket.h>
6920 #include <netinet/in.h>
6921 #include <netdb.h>
6922 #define BUFSIZE (sizeof(struct hostent)+10)
6923 int main() {
6924 struct hostent hent;
6925                 struct hostent *rhent; char buffer[BUFSIZE]; 
6926                 struct in_addr add;
6927                 size_t alen=sizeof(struct in_addr);
6928                 int bufsize=BUFSIZE;int h_errno;
6929                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
6930                         alen, AF_INET, &hent, buffer, bufsize, 
6931                         &rhent, &h_errno);
6932 ; return 0; }
6933 EOF
6934 if { (eval echo configure:6935: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6935   rm -rf conftest*
6936   ol_cv_func_gethostbyaddr_r_nargs8=yes
6937 else
6938   echo "configure: failed program was:" >&5
6939   cat conftest.$ac_ext >&5
6940   rm -rf conftest*
6941   ol_cv_func_gethostbyaddr_r_nargs8=no
6942 fi
6943 rm -f conftest*
6944
6945         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
6946                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
6947
6948                 ol_cv_func_gethostbyaddr_r_nargs=7
6949
6950         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
6951                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
6952
6953                 ol_cv_func_gethostbyaddr_r_nargs=8
6954
6955         else
6956                 ol_cv_func_gethostbyaddr_r_nargs=0
6957         fi
6958   
6959 fi
6960
6961 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
6962   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
6963     cat >> confdefs.h <<EOF
6964 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
6965 EOF
6966
6967   fi
6968
6969 else
6970         ol_cv_func_gethostbyaddr_r_nargs=0
6971 fi
6972
6973 if test "$ac_cv_func_ctime_r" = yes \
6974         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
6975         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
6976         -a "$ac_cv_func_gethostbyname_r" = yes \
6977         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
6978         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
6979         -a "$ac_cv_func_gethostbyaddr_r" = yes \
6980         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
6981         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
6982         ; then
6983  
6984         cat >> confdefs.h <<\EOF
6985 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
6986 EOF
6987
6988 fi
6989
6990 ol_link_threads=no
6991
6992 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6993         -o $ol_with_threads = nt ; then
6994
6995         
6996         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
6997 echo "configure:6998: checking for _beginthread" >&5
6998 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
6999   echo $ac_n "(cached) $ac_c" 1>&6
7000 else
7001   cat > conftest.$ac_ext <<EOF
7002 #line 7003 "configure"
7003 #include "confdefs.h"
7004 /* System header to define __stub macros and hopefully few prototypes,
7005     which can conflict with char _beginthread(); below.  */
7006 #include <assert.h>
7007 /* Override any gcc2 internal prototype to avoid an error.  */
7008 /* We use char because int might match the return type of a gcc2
7009     builtin and then its argument prototype would still apply.  */
7010 char _beginthread();
7011 char (*f)();
7012
7013 int main() {
7014
7015 /* The GNU C library defines this for functions which it implements
7016     to always fail with ENOSYS.  Some functions are actually named
7017     something starting with __ and the normal name is an alias.  */
7018 #if defined (__stub__beginthread) || defined (__stub____beginthread)
7019 choke me
7020 #else
7021 f = _beginthread;
7022 #endif
7023
7024 ; return 0; }
7025 EOF
7026 if { (eval echo configure:7027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7027   rm -rf conftest*
7028   eval "ac_cv_func__beginthread=yes"
7029 else
7030   echo "configure: failed program was:" >&5
7031   cat conftest.$ac_ext >&5
7032   rm -rf conftest*
7033   eval "ac_cv_func__beginthread=no"
7034 fi
7035 rm -f conftest*
7036 fi
7037
7038 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
7039   echo "$ac_t""yes" 1>&6
7040   :
7041 else
7042   echo "$ac_t""no" 1>&6
7043 fi
7044
7045
7046         if test $ac_cv_func__beginthread = yes ; then
7047                 cat >> confdefs.h <<\EOF
7048 #define HAVE_NT_THREADS 1
7049 EOF
7050
7051         fi
7052
7053
7054         if test "$ol_cv_nt_threads" = yes ; then
7055         ol_link_threads=nt
7056         ol_with_threads=found
7057         ol_with_yielding_select=yes
7058
7059                 cat >> confdefs.h <<\EOF
7060 #define HAVE_NT_SERVICE_MANAGER 1
7061 EOF
7062
7063                 cat >> confdefs.h <<\EOF
7064 #define HAVE_NT_EVENT_LOG 1
7065 EOF
7066
7067         fi
7068
7069         if test $ol_with_threads = nt ; then
7070                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
7071         fi
7072 fi
7073
7074 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7075         -o $ol_with_threads = posix ; then
7076
7077         for ac_hdr in pthread.h
7078 do
7079 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7080 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7081 echo "configure:7082: checking for $ac_hdr" >&5
7082 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7083   echo $ac_n "(cached) $ac_c" 1>&6
7084 else
7085   cat > conftest.$ac_ext <<EOF
7086 #line 7087 "configure"
7087 #include "confdefs.h"
7088 #include <$ac_hdr>
7089 EOF
7090 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7091 { (eval echo configure:7092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7092 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7093 if test -z "$ac_err"; then
7094   rm -rf conftest*
7095   eval "ac_cv_header_$ac_safe=yes"
7096 else
7097   echo "$ac_err" >&5
7098   echo "configure: failed program was:" >&5
7099   cat conftest.$ac_ext >&5
7100   rm -rf conftest*
7101   eval "ac_cv_header_$ac_safe=no"
7102 fi
7103 rm -f conftest*
7104 fi
7105 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7106   echo "$ac_t""yes" 1>&6
7107     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7108   cat >> confdefs.h <<EOF
7109 #define $ac_tr_hdr 1
7110 EOF
7111  
7112 else
7113   echo "$ac_t""no" 1>&6
7114 fi
7115 done
7116
7117
7118         if test $ac_cv_header_pthread_h = yes ; then
7119                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
7120 echo "configure:7121: checking POSIX thread version" >&5
7121 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
7122   echo $ac_n "(cached) $ac_c" 1>&6
7123 else
7124   
7125         cat > conftest.$ac_ext <<EOF
7126 #line 7127 "configure"
7127 #include "confdefs.h"
7128
7129 #               include <pthread.h>
7130                 /* this check could be improved */
7131 #               ifdef PTHREAD_ONCE_INIT
7132                         pthread_version_final;
7133 #               endif
7134         
7135 EOF
7136 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7137   egrep "pthread_version_final" >/dev/null 2>&1; then
7138   rm -rf conftest*
7139   ol_pthread_final=yes
7140 else
7141   rm -rf conftest*
7142   ol_pthread_final=no
7143 fi
7144 rm -f conftest*
7145
7146
7147         cat > conftest.$ac_ext <<EOF
7148 #line 7149 "configure"
7149 #include "confdefs.h"
7150
7151 #               include <pthread.h>
7152                 /* this check could be improved */
7153 #               ifdef pthread_once_init
7154                         pthread_version_draft4;
7155 #               endif
7156         
7157 EOF
7158 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7159   egrep "pthread_version_draft4" >/dev/null 2>&1; then
7160   rm -rf conftest*
7161   ol_pthread_draft4=yes
7162 else
7163   rm -rf conftest*
7164   ol_pthread_draft4=no
7165 fi
7166 rm -f conftest*
7167
7168
7169         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
7170                 ol_cv_pthread_version=final
7171         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
7172                 ol_cv_pthread_version=draft4
7173         else
7174                 ol_cv_pthread_version=unknown
7175         fi
7176
7177 fi
7178
7179 echo "$ac_t""$ol_cv_pthread_version" 1>&6
7180
7181
7182                 if test $ol_cv_pthread_version = final ; then
7183                         cat >> confdefs.h <<\EOF
7184 #define HAVE_PTHREADS_FINAL 1
7185 EOF
7186
7187                 elif test $ol_cv_pthread_version = draft4 ; then
7188                         cat >> confdefs.h <<\EOF
7189 #define HAVE_PTHREADS_D4 1
7190 EOF
7191
7192                 else
7193                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
7194                 fi
7195
7196                 # consider threads found
7197                 ol_with_threads=found
7198
7199                 
7200         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
7201 echo "configure:7202: checking for LinuxThreads pthread.h" >&5
7202 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
7203   echo $ac_n "(cached) $ac_c" 1>&6
7204 else
7205   cat > conftest.$ac_ext <<EOF
7206 #line 7207 "configure"
7207 #include "confdefs.h"
7208 #include <pthread.h>
7209 EOF
7210 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7211   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
7212   rm -rf conftest*
7213   ol_cv_header_linux_threads=yes
7214 else
7215   rm -rf conftest*
7216   ol_cv_header_linux_threads=no
7217 fi
7218 rm -f conftest*
7219
7220                 
7221 fi
7222
7223 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
7224         if test $ol_cv_header_linux_threads = yes; then
7225                 cat >> confdefs.h <<\EOF
7226 #define HAVE_LINUX_THREADS 1
7227 EOF
7228
7229         fi
7230
7231                 
7232         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
7233 echo "configure:7234: checking for GNU Pth pthread.h" >&5
7234 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
7235   echo $ac_n "(cached) $ac_c" 1>&6
7236 else
7237   cat > conftest.$ac_ext <<EOF
7238 #line 7239 "configure"
7239 #include "confdefs.h"
7240 #include <pthread.h>
7241 #ifdef _POSIX_THREAD_IS_GNU_PTH
7242         __gnu_pth__;
7243 #endif
7244
7245 EOF
7246 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7247   egrep "__gnu_pth__" >/dev/null 2>&1; then
7248   rm -rf conftest*
7249   ol_cv_header_gnu_pth_pthread_h=yes
7250 else
7251   rm -rf conftest*
7252   ol_cv_header_gnu_pth_pthread_h=no
7253 fi
7254 rm -f conftest*
7255
7256                 
7257 fi
7258
7259 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
7260
7261
7262                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
7263                         for ac_hdr in sched.h
7264 do
7265 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7266 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7267 echo "configure:7268: checking for $ac_hdr" >&5
7268 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7269   echo $ac_n "(cached) $ac_c" 1>&6
7270 else
7271   cat > conftest.$ac_ext <<EOF
7272 #line 7273 "configure"
7273 #include "confdefs.h"
7274 #include <$ac_hdr>
7275 EOF
7276 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7277 { (eval echo configure:7278: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7278 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7279 if test -z "$ac_err"; then
7280   rm -rf conftest*
7281   eval "ac_cv_header_$ac_safe=yes"
7282 else
7283   echo "$ac_err" >&5
7284   echo "configure: failed program was:" >&5
7285   cat conftest.$ac_ext >&5
7286   rm -rf conftest*
7287   eval "ac_cv_header_$ac_safe=no"
7288 fi
7289 rm -f conftest*
7290 fi
7291 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7292   echo "$ac_t""yes" 1>&6
7293     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7294   cat >> confdefs.h <<EOF
7295 #define $ac_tr_hdr 1
7296 EOF
7297  
7298 else
7299   echo "$ac_t""no" 1>&6
7300 fi
7301 done
7302
7303                 fi
7304
7305                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
7306                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
7307 echo "configure:7308: checking for pthread_create in default libraries" >&5
7308 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
7309   echo $ac_n "(cached) $ac_c" 1>&6
7310 else
7311   
7312                 if test "$cross_compiling" = yes; then
7313   cat > conftest.$ac_ext <<EOF
7314 #line 7315 "configure"
7315 #include "confdefs.h"
7316 /* pthread test headers */
7317 #include <pthread.h>
7318 #ifndef NULL
7319 #define NULL (void*)0
7320 #endif
7321
7322 static void *task(p)
7323         void *p;
7324 {
7325         return (void *) (p == NULL);
7326 }
7327
7328 int main() {
7329
7330         /* pthread test function */
7331         pthread_t t;
7332         int status;
7333         int detach = 1;
7334
7335 #ifdef HAVE_PTHREADS_FINAL
7336         /* Final pthreads */
7337         pthread_attr_t attr;
7338
7339         status = pthread_attr_init(&attr);
7340         if( status ) return status;
7341
7342 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7343         if( !detach ) {
7344 #if defined( PTHREAD_CREATE_JOINABLE )
7345                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7346 #else
7347                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7348 #endif
7349
7350 #ifdef PTHREAD_CREATE_DETACHED
7351         } else {
7352                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7353 #endif
7354         }
7355         if( status ) return status;
7356 #endif
7357
7358         status = pthread_create( &t, &attr, task, NULL );
7359         if( status ) return status;
7360
7361 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7362         if( detach ) {
7363                 /* give thread a chance to complete */
7364                 /* it should remain joinable and hence detachable */
7365                 sleep( 1 );
7366
7367                 status = pthread_detach( t );
7368                 if( status ) return status;
7369         }
7370 #endif
7371
7372 #else
7373         /* Draft 4 pthreads */
7374         status = pthread_create( &t, pthread_attr_default, task, NULL );
7375         if( status ) return status;
7376
7377         if( detach ) {
7378                 /* give thread a chance to complete */
7379                 /* it should remain joinable and hence detachable */
7380                 sleep( 1 );
7381
7382                 status = pthread_detach( &t );
7383                 if( status ) return status;
7384         }
7385 #endif
7386
7387 #ifdef HAVE_LINUX_THREADS
7388         pthread_kill_other_threads_np();
7389 #endif
7390
7391         return 0;
7392
7393 ; return 0; }
7394 EOF
7395 if { (eval echo configure:7396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7396   rm -rf conftest*
7397   ol_cv_pthread_create=yes
7398 else
7399   echo "configure: failed program was:" >&5
7400   cat conftest.$ac_ext >&5
7401   rm -rf conftest*
7402   ol_cv_pthread_create=no
7403 fi
7404 rm -f conftest*
7405 else
7406   cat > conftest.$ac_ext <<EOF
7407 #line 7408 "configure"
7408 #include "confdefs.h"
7409 /* pthread test headers */
7410 #include <pthread.h>
7411 #ifndef NULL
7412 #define NULL (void*)0
7413 #endif
7414
7415 static void *task(p)
7416         void *p;
7417 {
7418         return (void *) (p == NULL);
7419 }
7420
7421
7422 int main(argc, argv)
7423         int argc;
7424         char **argv;
7425 {
7426
7427         /* pthread test function */
7428         pthread_t t;
7429         int status;
7430         int detach = 1;
7431
7432 #ifdef HAVE_PTHREADS_FINAL
7433         /* Final pthreads */
7434         pthread_attr_t attr;
7435
7436         status = pthread_attr_init(&attr);
7437         if( status ) return status;
7438
7439 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7440         if( !detach ) {
7441 #if defined( PTHREAD_CREATE_JOINABLE )
7442                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7443 #else
7444                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7445 #endif
7446
7447 #ifdef PTHREAD_CREATE_DETACHED
7448         } else {
7449                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7450 #endif
7451         }
7452         if( status ) return status;
7453 #endif
7454
7455         status = pthread_create( &t, &attr, task, NULL );
7456         if( status ) return status;
7457
7458 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7459         if( detach ) {
7460                 /* give thread a chance to complete */
7461                 /* it should remain joinable and hence detachable */
7462                 sleep( 1 );
7463
7464                 status = pthread_detach( t );
7465                 if( status ) return status;
7466         }
7467 #endif
7468
7469 #else
7470         /* Draft 4 pthreads */
7471         status = pthread_create( &t, pthread_attr_default, task, NULL );
7472         if( status ) return status;
7473
7474         if( detach ) {
7475                 /* give thread a chance to complete */
7476                 /* it should remain joinable and hence detachable */
7477                 sleep( 1 );
7478
7479                 status = pthread_detach( &t );
7480                 if( status ) return status;
7481         }
7482 #endif
7483
7484 #ifdef HAVE_LINUX_THREADS
7485         pthread_kill_other_threads_np();
7486 #endif
7487
7488         return 0;
7489
7490 }
7491
7492 EOF
7493 if { (eval echo configure:7494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7494 then
7495   ol_cv_pthread_create=yes
7496 else
7497   echo "configure: failed program was:" >&5
7498   cat conftest.$ac_ext >&5
7499   rm -fr conftest*
7500   ol_cv_pthread_create=no
7501 fi
7502 rm -fr conftest*
7503 fi
7504
7505 fi
7506
7507 echo "$ac_t""$ol_cv_pthread_create" 1>&6
7508
7509                 if test $ol_cv_pthread_create != no ; then
7510                         ol_link_threads=posix
7511                         ol_link_pthreads=""
7512                 fi
7513                 
7514                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
7515 if test "$ol_link_threads" = no ; then
7516         # try -kthread
7517         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
7518 echo "configure:7519: checking for pthread link with -kthread" >&5
7519 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
7520   echo $ac_n "(cached) $ac_c" 1>&6
7521 else
7522   
7523                 # save the flags
7524                 ol_LIBS="$LIBS"
7525                 LIBS="-kthread $LIBS"
7526
7527                 if test "$cross_compiling" = yes; then
7528   cat > conftest.$ac_ext <<EOF
7529 #line 7530 "configure"
7530 #include "confdefs.h"
7531 /* pthread test headers */
7532 #include <pthread.h>
7533 #ifndef NULL
7534 #define NULL (void*)0
7535 #endif
7536
7537 static void *task(p)
7538         void *p;
7539 {
7540         return (void *) (p == NULL);
7541 }
7542
7543 int main() {
7544
7545         /* pthread test function */
7546         pthread_t t;
7547         int status;
7548         int detach = 1;
7549
7550 #ifdef HAVE_PTHREADS_FINAL
7551         /* Final pthreads */
7552         pthread_attr_t attr;
7553
7554         status = pthread_attr_init(&attr);
7555         if( status ) return status;
7556
7557 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7558         if( !detach ) {
7559 #if defined( PTHREAD_CREATE_JOINABLE )
7560                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7561 #else
7562                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7563 #endif
7564
7565 #ifdef PTHREAD_CREATE_DETACHED
7566         } else {
7567                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7568 #endif
7569         }
7570         if( status ) return status;
7571 #endif
7572
7573         status = pthread_create( &t, &attr, task, NULL );
7574         if( status ) return status;
7575
7576 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7577         if( detach ) {
7578                 /* give thread a chance to complete */
7579                 /* it should remain joinable and hence detachable */
7580                 sleep( 1 );
7581
7582                 status = pthread_detach( t );
7583                 if( status ) return status;
7584         }
7585 #endif
7586
7587 #else
7588         /* Draft 4 pthreads */
7589         status = pthread_create( &t, pthread_attr_default, task, NULL );
7590         if( status ) return status;
7591
7592         if( detach ) {
7593                 /* give thread a chance to complete */
7594                 /* it should remain joinable and hence detachable */
7595                 sleep( 1 );
7596
7597                 status = pthread_detach( &t );
7598                 if( status ) return status;
7599         }
7600 #endif
7601
7602 #ifdef HAVE_LINUX_THREADS
7603         pthread_kill_other_threads_np();
7604 #endif
7605
7606         return 0;
7607
7608 ; return 0; }
7609 EOF
7610 if { (eval echo configure:7611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7611   rm -rf conftest*
7612   ol_cv_pthread_kthread=yes
7613 else
7614   echo "configure: failed program was:" >&5
7615   cat conftest.$ac_ext >&5
7616   rm -rf conftest*
7617   ol_cv_pthread_kthread=no
7618 fi
7619 rm -f conftest*
7620 else
7621   cat > conftest.$ac_ext <<EOF
7622 #line 7623 "configure"
7623 #include "confdefs.h"
7624 /* pthread test headers */
7625 #include <pthread.h>
7626 #ifndef NULL
7627 #define NULL (void*)0
7628 #endif
7629
7630 static void *task(p)
7631         void *p;
7632 {
7633         return (void *) (p == NULL);
7634 }
7635
7636
7637 int main(argc, argv)
7638         int argc;
7639         char **argv;
7640 {
7641
7642         /* pthread test function */
7643         pthread_t t;
7644         int status;
7645         int detach = 1;
7646
7647 #ifdef HAVE_PTHREADS_FINAL
7648         /* Final pthreads */
7649         pthread_attr_t attr;
7650
7651         status = pthread_attr_init(&attr);
7652         if( status ) return status;
7653
7654 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7655         if( !detach ) {
7656 #if defined( PTHREAD_CREATE_JOINABLE )
7657                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7658 #else
7659                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7660 #endif
7661
7662 #ifdef PTHREAD_CREATE_DETACHED
7663         } else {
7664                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7665 #endif
7666         }
7667         if( status ) return status;
7668 #endif
7669
7670         status = pthread_create( &t, &attr, task, NULL );
7671         if( status ) return status;
7672
7673 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7674         if( detach ) {
7675                 /* give thread a chance to complete */
7676                 /* it should remain joinable and hence detachable */
7677                 sleep( 1 );
7678
7679                 status = pthread_detach( t );
7680                 if( status ) return status;
7681         }
7682 #endif
7683
7684 #else
7685         /* Draft 4 pthreads */
7686         status = pthread_create( &t, pthread_attr_default, task, NULL );
7687         if( status ) return status;
7688
7689         if( detach ) {
7690                 /* give thread a chance to complete */
7691                 /* it should remain joinable and hence detachable */
7692                 sleep( 1 );
7693
7694                 status = pthread_detach( &t );
7695                 if( status ) return status;
7696         }
7697 #endif
7698
7699 #ifdef HAVE_LINUX_THREADS
7700         pthread_kill_other_threads_np();
7701 #endif
7702
7703         return 0;
7704
7705 }
7706
7707 EOF
7708 if { (eval echo configure:7709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7709 then
7710   ol_cv_pthread_kthread=yes
7711 else
7712   echo "configure: failed program was:" >&5
7713   cat conftest.$ac_ext >&5
7714   rm -fr conftest*
7715   ol_cv_pthread_kthread=no
7716 fi
7717 rm -fr conftest*
7718 fi
7719
7720
7721                 # restore the LIBS
7722                 LIBS="$ol_LIBS"
7723         
7724 fi
7725
7726 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
7727
7728         if test $ol_cv_pthread_kthread = yes ; then
7729                 ol_link_pthreads="-kthread"
7730                 ol_link_threads=posix
7731         fi
7732 fi
7733
7734                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
7735 if test "$ol_link_threads" = no ; then
7736         # try -pthread
7737         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
7738 echo "configure:7739: checking for pthread link with -pthread" >&5
7739 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
7740   echo $ac_n "(cached) $ac_c" 1>&6
7741 else
7742   
7743                 # save the flags
7744                 ol_LIBS="$LIBS"
7745                 LIBS="-pthread $LIBS"
7746
7747                 if test "$cross_compiling" = yes; then
7748   cat > conftest.$ac_ext <<EOF
7749 #line 7750 "configure"
7750 #include "confdefs.h"
7751 /* pthread test headers */
7752 #include <pthread.h>
7753 #ifndef NULL
7754 #define NULL (void*)0
7755 #endif
7756
7757 static void *task(p)
7758         void *p;
7759 {
7760         return (void *) (p == NULL);
7761 }
7762
7763 int main() {
7764
7765         /* pthread test function */
7766         pthread_t t;
7767         int status;
7768         int detach = 1;
7769
7770 #ifdef HAVE_PTHREADS_FINAL
7771         /* Final pthreads */
7772         pthread_attr_t attr;
7773
7774         status = pthread_attr_init(&attr);
7775         if( status ) return status;
7776
7777 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7778         if( !detach ) {
7779 #if defined( PTHREAD_CREATE_JOINABLE )
7780                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7781 #else
7782                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7783 #endif
7784
7785 #ifdef PTHREAD_CREATE_DETACHED
7786         } else {
7787                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7788 #endif
7789         }
7790         if( status ) return status;
7791 #endif
7792
7793         status = pthread_create( &t, &attr, task, NULL );
7794         if( status ) return status;
7795
7796 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7797         if( detach ) {
7798                 /* give thread a chance to complete */
7799                 /* it should remain joinable and hence detachable */
7800                 sleep( 1 );
7801
7802                 status = pthread_detach( t );
7803                 if( status ) return status;
7804         }
7805 #endif
7806
7807 #else
7808         /* Draft 4 pthreads */
7809         status = pthread_create( &t, pthread_attr_default, task, NULL );
7810         if( status ) return status;
7811
7812         if( detach ) {
7813                 /* give thread a chance to complete */
7814                 /* it should remain joinable and hence detachable */
7815                 sleep( 1 );
7816
7817                 status = pthread_detach( &t );
7818                 if( status ) return status;
7819         }
7820 #endif
7821
7822 #ifdef HAVE_LINUX_THREADS
7823         pthread_kill_other_threads_np();
7824 #endif
7825
7826         return 0;
7827
7828 ; return 0; }
7829 EOF
7830 if { (eval echo configure:7831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7831   rm -rf conftest*
7832   ol_cv_pthread_pthread=yes
7833 else
7834   echo "configure: failed program was:" >&5
7835   cat conftest.$ac_ext >&5
7836   rm -rf conftest*
7837   ol_cv_pthread_pthread=no
7838 fi
7839 rm -f conftest*
7840 else
7841   cat > conftest.$ac_ext <<EOF
7842 #line 7843 "configure"
7843 #include "confdefs.h"
7844 /* pthread test headers */
7845 #include <pthread.h>
7846 #ifndef NULL
7847 #define NULL (void*)0
7848 #endif
7849
7850 static void *task(p)
7851         void *p;
7852 {
7853         return (void *) (p == NULL);
7854 }
7855
7856
7857 int main(argc, argv)
7858         int argc;
7859         char **argv;
7860 {
7861
7862         /* pthread test function */
7863         pthread_t t;
7864         int status;
7865         int detach = 1;
7866
7867 #ifdef HAVE_PTHREADS_FINAL
7868         /* Final pthreads */
7869         pthread_attr_t attr;
7870
7871         status = pthread_attr_init(&attr);
7872         if( status ) return status;
7873
7874 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7875         if( !detach ) {
7876 #if defined( PTHREAD_CREATE_JOINABLE )
7877                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7878 #else
7879                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7880 #endif
7881
7882 #ifdef PTHREAD_CREATE_DETACHED
7883         } else {
7884                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7885 #endif
7886         }
7887         if( status ) return status;
7888 #endif
7889
7890         status = pthread_create( &t, &attr, task, NULL );
7891         if( status ) return status;
7892
7893 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7894         if( detach ) {
7895                 /* give thread a chance to complete */
7896                 /* it should remain joinable and hence detachable */
7897                 sleep( 1 );
7898
7899                 status = pthread_detach( t );
7900                 if( status ) return status;
7901         }
7902 #endif
7903
7904 #else
7905         /* Draft 4 pthreads */
7906         status = pthread_create( &t, pthread_attr_default, task, NULL );
7907         if( status ) return status;
7908
7909         if( detach ) {
7910                 /* give thread a chance to complete */
7911                 /* it should remain joinable and hence detachable */
7912                 sleep( 1 );
7913
7914                 status = pthread_detach( &t );
7915                 if( status ) return status;
7916         }
7917 #endif
7918
7919 #ifdef HAVE_LINUX_THREADS
7920         pthread_kill_other_threads_np();
7921 #endif
7922
7923         return 0;
7924
7925 }
7926
7927 EOF
7928 if { (eval echo configure:7929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7929 then
7930   ol_cv_pthread_pthread=yes
7931 else
7932   echo "configure: failed program was:" >&5
7933   cat conftest.$ac_ext >&5
7934   rm -fr conftest*
7935   ol_cv_pthread_pthread=no
7936 fi
7937 rm -fr conftest*
7938 fi
7939
7940
7941                 # restore the LIBS
7942                 LIBS="$ol_LIBS"
7943         
7944 fi
7945
7946 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
7947
7948         if test $ol_cv_pthread_pthread = yes ; then
7949                 ol_link_pthreads="-pthread"
7950                 ol_link_threads=posix
7951         fi
7952 fi
7953
7954                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
7955 if test "$ol_link_threads" = no ; then
7956         # try -pthreads
7957         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
7958 echo "configure:7959: checking for pthread link with -pthreads" >&5
7959 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
7960   echo $ac_n "(cached) $ac_c" 1>&6
7961 else
7962   
7963                 # save the flags
7964                 ol_LIBS="$LIBS"
7965                 LIBS="-pthreads $LIBS"
7966
7967                 if test "$cross_compiling" = yes; then
7968   cat > conftest.$ac_ext <<EOF
7969 #line 7970 "configure"
7970 #include "confdefs.h"
7971 /* pthread test headers */
7972 #include <pthread.h>
7973 #ifndef NULL
7974 #define NULL (void*)0
7975 #endif
7976
7977 static void *task(p)
7978         void *p;
7979 {
7980         return (void *) (p == NULL);
7981 }
7982
7983 int main() {
7984
7985         /* pthread test function */
7986         pthread_t t;
7987         int status;
7988         int detach = 1;
7989
7990 #ifdef HAVE_PTHREADS_FINAL
7991         /* Final pthreads */
7992         pthread_attr_t attr;
7993
7994         status = pthread_attr_init(&attr);
7995         if( status ) return status;
7996
7997 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7998         if( !detach ) {
7999 #if defined( PTHREAD_CREATE_JOINABLE )
8000                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8001 #else
8002                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8003 #endif
8004
8005 #ifdef PTHREAD_CREATE_DETACHED
8006         } else {
8007                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8008 #endif
8009         }
8010         if( status ) return status;
8011 #endif
8012
8013         status = pthread_create( &t, &attr, task, NULL );
8014         if( status ) return status;
8015
8016 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8017         if( detach ) {
8018                 /* give thread a chance to complete */
8019                 /* it should remain joinable and hence detachable */
8020                 sleep( 1 );
8021
8022                 status = pthread_detach( t );
8023                 if( status ) return status;
8024         }
8025 #endif
8026
8027 #else
8028         /* Draft 4 pthreads */
8029         status = pthread_create( &t, pthread_attr_default, task, NULL );
8030         if( status ) return status;
8031
8032         if( detach ) {
8033                 /* give thread a chance to complete */
8034                 /* it should remain joinable and hence detachable */
8035                 sleep( 1 );
8036
8037                 status = pthread_detach( &t );
8038                 if( status ) return status;
8039         }
8040 #endif
8041
8042 #ifdef HAVE_LINUX_THREADS
8043         pthread_kill_other_threads_np();
8044 #endif
8045
8046         return 0;
8047
8048 ; return 0; }
8049 EOF
8050 if { (eval echo configure:8051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8051   rm -rf conftest*
8052   ol_cv_pthread_pthreads=yes
8053 else
8054   echo "configure: failed program was:" >&5
8055   cat conftest.$ac_ext >&5
8056   rm -rf conftest*
8057   ol_cv_pthread_pthreads=no
8058 fi
8059 rm -f conftest*
8060 else
8061   cat > conftest.$ac_ext <<EOF
8062 #line 8063 "configure"
8063 #include "confdefs.h"
8064 /* pthread test headers */
8065 #include <pthread.h>
8066 #ifndef NULL
8067 #define NULL (void*)0
8068 #endif
8069
8070 static void *task(p)
8071         void *p;
8072 {
8073         return (void *) (p == NULL);
8074 }
8075
8076
8077 int main(argc, argv)
8078         int argc;
8079         char **argv;
8080 {
8081
8082         /* pthread test function */
8083         pthread_t t;
8084         int status;
8085         int detach = 1;
8086
8087 #ifdef HAVE_PTHREADS_FINAL
8088         /* Final pthreads */
8089         pthread_attr_t attr;
8090
8091         status = pthread_attr_init(&attr);
8092         if( status ) return status;
8093
8094 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8095         if( !detach ) {
8096 #if defined( PTHREAD_CREATE_JOINABLE )
8097                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8098 #else
8099                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8100 #endif
8101
8102 #ifdef PTHREAD_CREATE_DETACHED
8103         } else {
8104                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8105 #endif
8106         }
8107         if( status ) return status;
8108 #endif
8109
8110         status = pthread_create( &t, &attr, task, NULL );
8111         if( status ) return status;
8112
8113 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8114         if( detach ) {
8115                 /* give thread a chance to complete */
8116                 /* it should remain joinable and hence detachable */
8117                 sleep( 1 );
8118
8119                 status = pthread_detach( t );
8120                 if( status ) return status;
8121         }
8122 #endif
8123
8124 #else
8125         /* Draft 4 pthreads */
8126         status = pthread_create( &t, pthread_attr_default, task, NULL );
8127         if( status ) return status;
8128
8129         if( detach ) {
8130                 /* give thread a chance to complete */
8131                 /* it should remain joinable and hence detachable */
8132                 sleep( 1 );
8133
8134                 status = pthread_detach( &t );
8135                 if( status ) return status;
8136         }
8137 #endif
8138
8139 #ifdef HAVE_LINUX_THREADS
8140         pthread_kill_other_threads_np();
8141 #endif
8142
8143         return 0;
8144
8145 }
8146
8147 EOF
8148 if { (eval echo configure:8149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8149 then
8150   ol_cv_pthread_pthreads=yes
8151 else
8152   echo "configure: failed program was:" >&5
8153   cat conftest.$ac_ext >&5
8154   rm -fr conftest*
8155   ol_cv_pthread_pthreads=no
8156 fi
8157 rm -fr conftest*
8158 fi
8159
8160
8161                 # restore the LIBS
8162                 LIBS="$ol_LIBS"
8163         
8164 fi
8165
8166 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
8167
8168         if test $ol_cv_pthread_pthreads = yes ; then
8169                 ol_link_pthreads="-pthreads"
8170                 ol_link_threads=posix
8171         fi
8172 fi
8173
8174                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
8175 if test "$ol_link_threads" = no ; then
8176         # try -mthreads
8177         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
8178 echo "configure:8179: checking for pthread link with -mthreads" >&5
8179 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
8180   echo $ac_n "(cached) $ac_c" 1>&6
8181 else
8182   
8183                 # save the flags
8184                 ol_LIBS="$LIBS"
8185                 LIBS="-mthreads $LIBS"
8186
8187                 if test "$cross_compiling" = yes; then
8188   cat > conftest.$ac_ext <<EOF
8189 #line 8190 "configure"
8190 #include "confdefs.h"
8191 /* pthread test headers */
8192 #include <pthread.h>
8193 #ifndef NULL
8194 #define NULL (void*)0
8195 #endif
8196
8197 static void *task(p)
8198         void *p;
8199 {
8200         return (void *) (p == NULL);
8201 }
8202
8203 int main() {
8204
8205         /* pthread test function */
8206         pthread_t t;
8207         int status;
8208         int detach = 1;
8209
8210 #ifdef HAVE_PTHREADS_FINAL
8211         /* Final pthreads */
8212         pthread_attr_t attr;
8213
8214         status = pthread_attr_init(&attr);
8215         if( status ) return status;
8216
8217 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8218         if( !detach ) {
8219 #if defined( PTHREAD_CREATE_JOINABLE )
8220                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8221 #else
8222                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8223 #endif
8224
8225 #ifdef PTHREAD_CREATE_DETACHED
8226         } else {
8227                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8228 #endif
8229         }
8230         if( status ) return status;
8231 #endif
8232
8233         status = pthread_create( &t, &attr, task, NULL );
8234         if( status ) return status;
8235
8236 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8237         if( detach ) {
8238                 /* give thread a chance to complete */
8239                 /* it should remain joinable and hence detachable */
8240                 sleep( 1 );
8241
8242                 status = pthread_detach( t );
8243                 if( status ) return status;
8244         }
8245 #endif
8246
8247 #else
8248         /* Draft 4 pthreads */
8249         status = pthread_create( &t, pthread_attr_default, task, NULL );
8250         if( status ) return status;
8251
8252         if( detach ) {
8253                 /* give thread a chance to complete */
8254                 /* it should remain joinable and hence detachable */
8255                 sleep( 1 );
8256
8257                 status = pthread_detach( &t );
8258                 if( status ) return status;
8259         }
8260 #endif
8261
8262 #ifdef HAVE_LINUX_THREADS
8263         pthread_kill_other_threads_np();
8264 #endif
8265
8266         return 0;
8267
8268 ; return 0; }
8269 EOF
8270 if { (eval echo configure:8271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8271   rm -rf conftest*
8272   ol_cv_pthread_mthreads=yes
8273 else
8274   echo "configure: failed program was:" >&5
8275   cat conftest.$ac_ext >&5
8276   rm -rf conftest*
8277   ol_cv_pthread_mthreads=no
8278 fi
8279 rm -f conftest*
8280 else
8281   cat > conftest.$ac_ext <<EOF
8282 #line 8283 "configure"
8283 #include "confdefs.h"
8284 /* pthread test headers */
8285 #include <pthread.h>
8286 #ifndef NULL
8287 #define NULL (void*)0
8288 #endif
8289
8290 static void *task(p)
8291         void *p;
8292 {
8293         return (void *) (p == NULL);
8294 }
8295
8296
8297 int main(argc, argv)
8298         int argc;
8299         char **argv;
8300 {
8301
8302         /* pthread test function */
8303         pthread_t t;
8304         int status;
8305         int detach = 1;
8306
8307 #ifdef HAVE_PTHREADS_FINAL
8308         /* Final pthreads */
8309         pthread_attr_t attr;
8310
8311         status = pthread_attr_init(&attr);
8312         if( status ) return status;
8313
8314 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8315         if( !detach ) {
8316 #if defined( PTHREAD_CREATE_JOINABLE )
8317                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8318 #else
8319                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8320 #endif
8321
8322 #ifdef PTHREAD_CREATE_DETACHED
8323         } else {
8324                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8325 #endif
8326         }
8327         if( status ) return status;
8328 #endif
8329
8330         status = pthread_create( &t, &attr, task, NULL );
8331         if( status ) return status;
8332
8333 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8334         if( detach ) {
8335                 /* give thread a chance to complete */
8336                 /* it should remain joinable and hence detachable */
8337                 sleep( 1 );
8338
8339                 status = pthread_detach( t );
8340                 if( status ) return status;
8341         }
8342 #endif
8343
8344 #else
8345         /* Draft 4 pthreads */
8346         status = pthread_create( &t, pthread_attr_default, task, NULL );
8347         if( status ) return status;
8348
8349         if( detach ) {
8350                 /* give thread a chance to complete */
8351                 /* it should remain joinable and hence detachable */
8352                 sleep( 1 );
8353
8354                 status = pthread_detach( &t );
8355                 if( status ) return status;
8356         }
8357 #endif
8358
8359 #ifdef HAVE_LINUX_THREADS
8360         pthread_kill_other_threads_np();
8361 #endif
8362
8363         return 0;
8364
8365 }
8366
8367 EOF
8368 if { (eval echo configure:8369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8369 then
8370   ol_cv_pthread_mthreads=yes
8371 else
8372   echo "configure: failed program was:" >&5
8373   cat conftest.$ac_ext >&5
8374   rm -fr conftest*
8375   ol_cv_pthread_mthreads=no
8376 fi
8377 rm -fr conftest*
8378 fi
8379
8380
8381                 # restore the LIBS
8382                 LIBS="$ol_LIBS"
8383         
8384 fi
8385
8386 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
8387
8388         if test $ol_cv_pthread_mthreads = yes ; then
8389                 ol_link_pthreads="-mthreads"
8390                 ol_link_threads=posix
8391         fi
8392 fi
8393
8394                 # Pthread try link: -thread (ol_cv_pthread_thread)
8395 if test "$ol_link_threads" = no ; then
8396         # try -thread
8397         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
8398 echo "configure:8399: checking for pthread link with -thread" >&5
8399 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
8400   echo $ac_n "(cached) $ac_c" 1>&6
8401 else
8402   
8403                 # save the flags
8404                 ol_LIBS="$LIBS"
8405                 LIBS="-thread $LIBS"
8406
8407                 if test "$cross_compiling" = yes; then
8408   cat > conftest.$ac_ext <<EOF
8409 #line 8410 "configure"
8410 #include "confdefs.h"
8411 /* pthread test headers */
8412 #include <pthread.h>
8413 #ifndef NULL
8414 #define NULL (void*)0
8415 #endif
8416
8417 static void *task(p)
8418         void *p;
8419 {
8420         return (void *) (p == NULL);
8421 }
8422
8423 int main() {
8424
8425         /* pthread test function */
8426         pthread_t t;
8427         int status;
8428         int detach = 1;
8429
8430 #ifdef HAVE_PTHREADS_FINAL
8431         /* Final pthreads */
8432         pthread_attr_t attr;
8433
8434         status = pthread_attr_init(&attr);
8435         if( status ) return status;
8436
8437 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8438         if( !detach ) {
8439 #if defined( PTHREAD_CREATE_JOINABLE )
8440                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8441 #else
8442                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8443 #endif
8444
8445 #ifdef PTHREAD_CREATE_DETACHED
8446         } else {
8447                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8448 #endif
8449         }
8450         if( status ) return status;
8451 #endif
8452
8453         status = pthread_create( &t, &attr, task, NULL );
8454         if( status ) return status;
8455
8456 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8457         if( detach ) {
8458                 /* give thread a chance to complete */
8459                 /* it should remain joinable and hence detachable */
8460                 sleep( 1 );
8461
8462                 status = pthread_detach( t );
8463                 if( status ) return status;
8464         }
8465 #endif
8466
8467 #else
8468         /* Draft 4 pthreads */
8469         status = pthread_create( &t, pthread_attr_default, task, NULL );
8470         if( status ) return status;
8471
8472         if( detach ) {
8473                 /* give thread a chance to complete */
8474                 /* it should remain joinable and hence detachable */
8475                 sleep( 1 );
8476
8477                 status = pthread_detach( &t );
8478                 if( status ) return status;
8479         }
8480 #endif
8481
8482 #ifdef HAVE_LINUX_THREADS
8483         pthread_kill_other_threads_np();
8484 #endif
8485
8486         return 0;
8487
8488 ; return 0; }
8489 EOF
8490 if { (eval echo configure:8491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8491   rm -rf conftest*
8492   ol_cv_pthread_thread=yes
8493 else
8494   echo "configure: failed program was:" >&5
8495   cat conftest.$ac_ext >&5
8496   rm -rf conftest*
8497   ol_cv_pthread_thread=no
8498 fi
8499 rm -f conftest*
8500 else
8501   cat > conftest.$ac_ext <<EOF
8502 #line 8503 "configure"
8503 #include "confdefs.h"
8504 /* pthread test headers */
8505 #include <pthread.h>
8506 #ifndef NULL
8507 #define NULL (void*)0
8508 #endif
8509
8510 static void *task(p)
8511         void *p;
8512 {
8513         return (void *) (p == NULL);
8514 }
8515
8516
8517 int main(argc, argv)
8518         int argc;
8519         char **argv;
8520 {
8521
8522         /* pthread test function */
8523         pthread_t t;
8524         int status;
8525         int detach = 1;
8526
8527 #ifdef HAVE_PTHREADS_FINAL
8528         /* Final pthreads */
8529         pthread_attr_t attr;
8530
8531         status = pthread_attr_init(&attr);
8532         if( status ) return status;
8533
8534 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8535         if( !detach ) {
8536 #if defined( PTHREAD_CREATE_JOINABLE )
8537                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8538 #else
8539                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8540 #endif
8541
8542 #ifdef PTHREAD_CREATE_DETACHED
8543         } else {
8544                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8545 #endif
8546         }
8547         if( status ) return status;
8548 #endif
8549
8550         status = pthread_create( &t, &attr, task, NULL );
8551         if( status ) return status;
8552
8553 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8554         if( detach ) {
8555                 /* give thread a chance to complete */
8556                 /* it should remain joinable and hence detachable */
8557                 sleep( 1 );
8558
8559                 status = pthread_detach( t );
8560                 if( status ) return status;
8561         }
8562 #endif
8563
8564 #else
8565         /* Draft 4 pthreads */
8566         status = pthread_create( &t, pthread_attr_default, task, NULL );
8567         if( status ) return status;
8568
8569         if( detach ) {
8570                 /* give thread a chance to complete */
8571                 /* it should remain joinable and hence detachable */
8572                 sleep( 1 );
8573
8574                 status = pthread_detach( &t );
8575                 if( status ) return status;
8576         }
8577 #endif
8578
8579 #ifdef HAVE_LINUX_THREADS
8580         pthread_kill_other_threads_np();
8581 #endif
8582
8583         return 0;
8584
8585 }
8586
8587 EOF
8588 if { (eval echo configure:8589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8589 then
8590   ol_cv_pthread_thread=yes
8591 else
8592   echo "configure: failed program was:" >&5
8593   cat conftest.$ac_ext >&5
8594   rm -fr conftest*
8595   ol_cv_pthread_thread=no
8596 fi
8597 rm -fr conftest*
8598 fi
8599
8600
8601                 # restore the LIBS
8602                 LIBS="$ol_LIBS"
8603         
8604 fi
8605
8606 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
8607
8608         if test $ol_cv_pthread_thread = yes ; then
8609                 ol_link_pthreads="-thread"
8610                 ol_link_threads=posix
8611         fi
8612 fi
8613
8614
8615                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
8616 if test "$ol_link_threads" = no ; then
8617         # try -lpthread -lmach -lexc -lc_r
8618         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
8619 echo "configure:8620: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
8620 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
8621   echo $ac_n "(cached) $ac_c" 1>&6
8622 else
8623   
8624                 # save the flags
8625                 ol_LIBS="$LIBS"
8626                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
8627
8628                 if test "$cross_compiling" = yes; then
8629   cat > conftest.$ac_ext <<EOF
8630 #line 8631 "configure"
8631 #include "confdefs.h"
8632 /* pthread test headers */
8633 #include <pthread.h>
8634 #ifndef NULL
8635 #define NULL (void*)0
8636 #endif
8637
8638 static void *task(p)
8639         void *p;
8640 {
8641         return (void *) (p == NULL);
8642 }
8643
8644 int main() {
8645
8646         /* pthread test function */
8647         pthread_t t;
8648         int status;
8649         int detach = 1;
8650
8651 #ifdef HAVE_PTHREADS_FINAL
8652         /* Final pthreads */
8653         pthread_attr_t attr;
8654
8655         status = pthread_attr_init(&attr);
8656         if( status ) return status;
8657
8658 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8659         if( !detach ) {
8660 #if defined( PTHREAD_CREATE_JOINABLE )
8661                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8662 #else
8663                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8664 #endif
8665
8666 #ifdef PTHREAD_CREATE_DETACHED
8667         } else {
8668                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8669 #endif
8670         }
8671         if( status ) return status;
8672 #endif
8673
8674         status = pthread_create( &t, &attr, task, NULL );
8675         if( status ) return status;
8676
8677 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8678         if( detach ) {
8679                 /* give thread a chance to complete */
8680                 /* it should remain joinable and hence detachable */
8681                 sleep( 1 );
8682
8683                 status = pthread_detach( t );
8684                 if( status ) return status;
8685         }
8686 #endif
8687
8688 #else
8689         /* Draft 4 pthreads */
8690         status = pthread_create( &t, pthread_attr_default, task, NULL );
8691         if( status ) return status;
8692
8693         if( detach ) {
8694                 /* give thread a chance to complete */
8695                 /* it should remain joinable and hence detachable */
8696                 sleep( 1 );
8697
8698                 status = pthread_detach( &t );
8699                 if( status ) return status;
8700         }
8701 #endif
8702
8703 #ifdef HAVE_LINUX_THREADS
8704         pthread_kill_other_threads_np();
8705 #endif
8706
8707         return 0;
8708
8709 ; return 0; }
8710 EOF
8711 if { (eval echo configure:8712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8712   rm -rf conftest*
8713   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8714 else
8715   echo "configure: failed program was:" >&5
8716   cat conftest.$ac_ext >&5
8717   rm -rf conftest*
8718   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8719 fi
8720 rm -f conftest*
8721 else
8722   cat > conftest.$ac_ext <<EOF
8723 #line 8724 "configure"
8724 #include "confdefs.h"
8725 /* pthread test headers */
8726 #include <pthread.h>
8727 #ifndef NULL
8728 #define NULL (void*)0
8729 #endif
8730
8731 static void *task(p)
8732         void *p;
8733 {
8734         return (void *) (p == NULL);
8735 }
8736
8737
8738 int main(argc, argv)
8739         int argc;
8740         char **argv;
8741 {
8742
8743         /* pthread test function */
8744         pthread_t t;
8745         int status;
8746         int detach = 1;
8747
8748 #ifdef HAVE_PTHREADS_FINAL
8749         /* Final pthreads */
8750         pthread_attr_t attr;
8751
8752         status = pthread_attr_init(&attr);
8753         if( status ) return status;
8754
8755 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8756         if( !detach ) {
8757 #if defined( PTHREAD_CREATE_JOINABLE )
8758                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8759 #else
8760                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8761 #endif
8762
8763 #ifdef PTHREAD_CREATE_DETACHED
8764         } else {
8765                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8766 #endif
8767         }
8768         if( status ) return status;
8769 #endif
8770
8771         status = pthread_create( &t, &attr, task, NULL );
8772         if( status ) return status;
8773
8774 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8775         if( detach ) {
8776                 /* give thread a chance to complete */
8777                 /* it should remain joinable and hence detachable */
8778                 sleep( 1 );
8779
8780                 status = pthread_detach( t );
8781                 if( status ) return status;
8782         }
8783 #endif
8784
8785 #else
8786         /* Draft 4 pthreads */
8787         status = pthread_create( &t, pthread_attr_default, task, NULL );
8788         if( status ) return status;
8789
8790         if( detach ) {
8791                 /* give thread a chance to complete */
8792                 /* it should remain joinable and hence detachable */
8793                 sleep( 1 );
8794
8795                 status = pthread_detach( &t );
8796                 if( status ) return status;
8797         }
8798 #endif
8799
8800 #ifdef HAVE_LINUX_THREADS
8801         pthread_kill_other_threads_np();
8802 #endif
8803
8804         return 0;
8805
8806 }
8807
8808 EOF
8809 if { (eval echo configure:8810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8810 then
8811   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8812 else
8813   echo "configure: failed program was:" >&5
8814   cat conftest.$ac_ext >&5
8815   rm -fr conftest*
8816   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8817 fi
8818 rm -fr conftest*
8819 fi
8820
8821
8822                 # restore the LIBS
8823                 LIBS="$ol_LIBS"
8824         
8825 fi
8826
8827 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
8828
8829         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
8830                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
8831                 ol_link_threads=posix
8832         fi
8833 fi
8834
8835                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
8836 if test "$ol_link_threads" = no ; then
8837         # try -lpthread -lmach -lexc
8838         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
8839 echo "configure:8840: checking for pthread link with -lpthread -lmach -lexc" >&5
8840 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
8841   echo $ac_n "(cached) $ac_c" 1>&6
8842 else
8843   
8844                 # save the flags
8845                 ol_LIBS="$LIBS"
8846                 LIBS="-lpthread -lmach -lexc $LIBS"
8847
8848                 if test "$cross_compiling" = yes; then
8849   cat > conftest.$ac_ext <<EOF
8850 #line 8851 "configure"
8851 #include "confdefs.h"
8852 /* pthread test headers */
8853 #include <pthread.h>
8854 #ifndef NULL
8855 #define NULL (void*)0
8856 #endif
8857
8858 static void *task(p)
8859         void *p;
8860 {
8861         return (void *) (p == NULL);
8862 }
8863
8864 int main() {
8865
8866         /* pthread test function */
8867         pthread_t t;
8868         int status;
8869         int detach = 1;
8870
8871 #ifdef HAVE_PTHREADS_FINAL
8872         /* Final pthreads */
8873         pthread_attr_t attr;
8874
8875         status = pthread_attr_init(&attr);
8876         if( status ) return status;
8877
8878 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8879         if( !detach ) {
8880 #if defined( PTHREAD_CREATE_JOINABLE )
8881                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8882 #else
8883                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8884 #endif
8885
8886 #ifdef PTHREAD_CREATE_DETACHED
8887         } else {
8888                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8889 #endif
8890         }
8891         if( status ) return status;
8892 #endif
8893
8894         status = pthread_create( &t, &attr, task, NULL );
8895         if( status ) return status;
8896
8897 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8898         if( detach ) {
8899                 /* give thread a chance to complete */
8900                 /* it should remain joinable and hence detachable */
8901                 sleep( 1 );
8902
8903                 status = pthread_detach( t );
8904                 if( status ) return status;
8905         }
8906 #endif
8907
8908 #else
8909         /* Draft 4 pthreads */
8910         status = pthread_create( &t, pthread_attr_default, task, NULL );
8911         if( status ) return status;
8912
8913         if( detach ) {
8914                 /* give thread a chance to complete */
8915                 /* it should remain joinable and hence detachable */
8916                 sleep( 1 );
8917
8918                 status = pthread_detach( &t );
8919                 if( status ) return status;
8920         }
8921 #endif
8922
8923 #ifdef HAVE_LINUX_THREADS
8924         pthread_kill_other_threads_np();
8925 #endif
8926
8927         return 0;
8928
8929 ; return 0; }
8930 EOF
8931 if { (eval echo configure:8932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8932   rm -rf conftest*
8933   ol_cv_pthread_lpthread_lmach_lexc=yes
8934 else
8935   echo "configure: failed program was:" >&5
8936   cat conftest.$ac_ext >&5
8937   rm -rf conftest*
8938   ol_cv_pthread_lpthread_lmach_lexc=no
8939 fi
8940 rm -f conftest*
8941 else
8942   cat > conftest.$ac_ext <<EOF
8943 #line 8944 "configure"
8944 #include "confdefs.h"
8945 /* pthread test headers */
8946 #include <pthread.h>
8947 #ifndef NULL
8948 #define NULL (void*)0
8949 #endif
8950
8951 static void *task(p)
8952         void *p;
8953 {
8954         return (void *) (p == NULL);
8955 }
8956
8957
8958 int main(argc, argv)
8959         int argc;
8960         char **argv;
8961 {
8962
8963         /* pthread test function */
8964         pthread_t t;
8965         int status;
8966         int detach = 1;
8967
8968 #ifdef HAVE_PTHREADS_FINAL
8969         /* Final pthreads */
8970         pthread_attr_t attr;
8971
8972         status = pthread_attr_init(&attr);
8973         if( status ) return status;
8974
8975 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8976         if( !detach ) {
8977 #if defined( PTHREAD_CREATE_JOINABLE )
8978                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8979 #else
8980                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8981 #endif
8982
8983 #ifdef PTHREAD_CREATE_DETACHED
8984         } else {
8985                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8986 #endif
8987         }
8988         if( status ) return status;
8989 #endif
8990
8991         status = pthread_create( &t, &attr, task, NULL );
8992         if( status ) return status;
8993
8994 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8995         if( detach ) {
8996                 /* give thread a chance to complete */
8997                 /* it should remain joinable and hence detachable */
8998                 sleep( 1 );
8999
9000                 status = pthread_detach( t );
9001                 if( status ) return status;
9002         }
9003 #endif
9004
9005 #else
9006         /* Draft 4 pthreads */
9007         status = pthread_create( &t, pthread_attr_default, task, NULL );
9008         if( status ) return status;
9009
9010         if( detach ) {
9011                 /* give thread a chance to complete */
9012                 /* it should remain joinable and hence detachable */
9013                 sleep( 1 );
9014
9015                 status = pthread_detach( &t );
9016                 if( status ) return status;
9017         }
9018 #endif
9019
9020 #ifdef HAVE_LINUX_THREADS
9021         pthread_kill_other_threads_np();
9022 #endif
9023
9024         return 0;
9025
9026 }
9027
9028 EOF
9029 if { (eval echo configure:9030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9030 then
9031   ol_cv_pthread_lpthread_lmach_lexc=yes
9032 else
9033   echo "configure: failed program was:" >&5
9034   cat conftest.$ac_ext >&5
9035   rm -fr conftest*
9036   ol_cv_pthread_lpthread_lmach_lexc=no
9037 fi
9038 rm -fr conftest*
9039 fi
9040
9041
9042                 # restore the LIBS
9043                 LIBS="$ol_LIBS"
9044         
9045 fi
9046
9047 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
9048
9049         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
9050                 ol_link_pthreads="-lpthread -lmach -lexc"
9051                 ol_link_threads=posix
9052         fi
9053 fi
9054
9055
9056                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
9057 if test "$ol_link_threads" = no ; then
9058         # try -lpthread -Wl,-woff,85
9059         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
9060 echo "configure:9061: checking for pthread link with -lpthread -Wl,-woff,85" >&5
9061 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
9062   echo $ac_n "(cached) $ac_c" 1>&6
9063 else
9064   
9065                 # save the flags
9066                 ol_LIBS="$LIBS"
9067                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
9068
9069                 if test "$cross_compiling" = yes; then
9070   cat > conftest.$ac_ext <<EOF
9071 #line 9072 "configure"
9072 #include "confdefs.h"
9073 /* pthread test headers */
9074 #include <pthread.h>
9075 #ifndef NULL
9076 #define NULL (void*)0
9077 #endif
9078
9079 static void *task(p)
9080         void *p;
9081 {
9082         return (void *) (p == NULL);
9083 }
9084
9085 int main() {
9086
9087         /* pthread test function */
9088         pthread_t t;
9089         int status;
9090         int detach = 1;
9091
9092 #ifdef HAVE_PTHREADS_FINAL
9093         /* Final pthreads */
9094         pthread_attr_t attr;
9095
9096         status = pthread_attr_init(&attr);
9097         if( status ) return status;
9098
9099 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9100         if( !detach ) {
9101 #if defined( PTHREAD_CREATE_JOINABLE )
9102                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9103 #else
9104                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9105 #endif
9106
9107 #ifdef PTHREAD_CREATE_DETACHED
9108         } else {
9109                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9110 #endif
9111         }
9112         if( status ) return status;
9113 #endif
9114
9115         status = pthread_create( &t, &attr, task, NULL );
9116         if( status ) return status;
9117
9118 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9119         if( detach ) {
9120                 /* give thread a chance to complete */
9121                 /* it should remain joinable and hence detachable */
9122                 sleep( 1 );
9123
9124                 status = pthread_detach( t );
9125                 if( status ) return status;
9126         }
9127 #endif
9128
9129 #else
9130         /* Draft 4 pthreads */
9131         status = pthread_create( &t, pthread_attr_default, task, NULL );
9132         if( status ) return status;
9133
9134         if( detach ) {
9135                 /* give thread a chance to complete */
9136                 /* it should remain joinable and hence detachable */
9137                 sleep( 1 );
9138
9139                 status = pthread_detach( &t );
9140                 if( status ) return status;
9141         }
9142 #endif
9143
9144 #ifdef HAVE_LINUX_THREADS
9145         pthread_kill_other_threads_np();
9146 #endif
9147
9148         return 0;
9149
9150 ; return 0; }
9151 EOF
9152 if { (eval echo configure:9153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9153   rm -rf conftest*
9154   ol_cv_pthread_lib_lpthread_woff=yes
9155 else
9156   echo "configure: failed program was:" >&5
9157   cat conftest.$ac_ext >&5
9158   rm -rf conftest*
9159   ol_cv_pthread_lib_lpthread_woff=no
9160 fi
9161 rm -f conftest*
9162 else
9163   cat > conftest.$ac_ext <<EOF
9164 #line 9165 "configure"
9165 #include "confdefs.h"
9166 /* pthread test headers */
9167 #include <pthread.h>
9168 #ifndef NULL
9169 #define NULL (void*)0
9170 #endif
9171
9172 static void *task(p)
9173         void *p;
9174 {
9175         return (void *) (p == NULL);
9176 }
9177
9178
9179 int main(argc, argv)
9180         int argc;
9181         char **argv;
9182 {
9183
9184         /* pthread test function */
9185         pthread_t t;
9186         int status;
9187         int detach = 1;
9188
9189 #ifdef HAVE_PTHREADS_FINAL
9190         /* Final pthreads */
9191         pthread_attr_t attr;
9192
9193         status = pthread_attr_init(&attr);
9194         if( status ) return status;
9195
9196 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9197         if( !detach ) {
9198 #if defined( PTHREAD_CREATE_JOINABLE )
9199                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9200 #else
9201                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9202 #endif
9203
9204 #ifdef PTHREAD_CREATE_DETACHED
9205         } else {
9206                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9207 #endif
9208         }
9209         if( status ) return status;
9210 #endif
9211
9212         status = pthread_create( &t, &attr, task, NULL );
9213         if( status ) return status;
9214
9215 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9216         if( detach ) {
9217                 /* give thread a chance to complete */
9218                 /* it should remain joinable and hence detachable */
9219                 sleep( 1 );
9220
9221                 status = pthread_detach( t );
9222                 if( status ) return status;
9223         }
9224 #endif
9225
9226 #else
9227         /* Draft 4 pthreads */
9228         status = pthread_create( &t, pthread_attr_default, task, NULL );
9229         if( status ) return status;
9230
9231         if( detach ) {
9232                 /* give thread a chance to complete */
9233                 /* it should remain joinable and hence detachable */
9234                 sleep( 1 );
9235
9236                 status = pthread_detach( &t );
9237                 if( status ) return status;
9238         }
9239 #endif
9240
9241 #ifdef HAVE_LINUX_THREADS
9242         pthread_kill_other_threads_np();
9243 #endif
9244
9245         return 0;
9246
9247 }
9248
9249 EOF
9250 if { (eval echo configure:9251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9251 then
9252   ol_cv_pthread_lib_lpthread_woff=yes
9253 else
9254   echo "configure: failed program was:" >&5
9255   cat conftest.$ac_ext >&5
9256   rm -fr conftest*
9257   ol_cv_pthread_lib_lpthread_woff=no
9258 fi
9259 rm -fr conftest*
9260 fi
9261
9262
9263                 # restore the LIBS
9264                 LIBS="$ol_LIBS"
9265         
9266 fi
9267
9268 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
9269
9270         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
9271                 ol_link_pthreads="-lpthread -Wl,-woff,85"
9272                 ol_link_threads=posix
9273         fi
9274 fi
9275
9276
9277                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
9278 if test "$ol_link_threads" = no ; then
9279         # try -lpthread
9280         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
9281 echo "configure:9282: checking for pthread link with -lpthread" >&5
9282 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
9283   echo $ac_n "(cached) $ac_c" 1>&6
9284 else
9285   
9286                 # save the flags
9287                 ol_LIBS="$LIBS"
9288                 LIBS="-lpthread $LIBS"
9289
9290                 if test "$cross_compiling" = yes; then
9291   cat > conftest.$ac_ext <<EOF
9292 #line 9293 "configure"
9293 #include "confdefs.h"
9294 /* pthread test headers */
9295 #include <pthread.h>
9296 #ifndef NULL
9297 #define NULL (void*)0
9298 #endif
9299
9300 static void *task(p)
9301         void *p;
9302 {
9303         return (void *) (p == NULL);
9304 }
9305
9306 int main() {
9307
9308         /* pthread test function */
9309         pthread_t t;
9310         int status;
9311         int detach = 1;
9312
9313 #ifdef HAVE_PTHREADS_FINAL
9314         /* Final pthreads */
9315         pthread_attr_t attr;
9316
9317         status = pthread_attr_init(&attr);
9318         if( status ) return status;
9319
9320 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9321         if( !detach ) {
9322 #if defined( PTHREAD_CREATE_JOINABLE )
9323                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9324 #else
9325                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9326 #endif
9327
9328 #ifdef PTHREAD_CREATE_DETACHED
9329         } else {
9330                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9331 #endif
9332         }
9333         if( status ) return status;
9334 #endif
9335
9336         status = pthread_create( &t, &attr, task, NULL );
9337         if( status ) return status;
9338
9339 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9340         if( detach ) {
9341                 /* give thread a chance to complete */
9342                 /* it should remain joinable and hence detachable */
9343                 sleep( 1 );
9344
9345                 status = pthread_detach( t );
9346                 if( status ) return status;
9347         }
9348 #endif
9349
9350 #else
9351         /* Draft 4 pthreads */
9352         status = pthread_create( &t, pthread_attr_default, task, NULL );
9353         if( status ) return status;
9354
9355         if( detach ) {
9356                 /* give thread a chance to complete */
9357                 /* it should remain joinable and hence detachable */
9358                 sleep( 1 );
9359
9360                 status = pthread_detach( &t );
9361                 if( status ) return status;
9362         }
9363 #endif
9364
9365 #ifdef HAVE_LINUX_THREADS
9366         pthread_kill_other_threads_np();
9367 #endif
9368
9369         return 0;
9370
9371 ; return 0; }
9372 EOF
9373 if { (eval echo configure:9374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9374   rm -rf conftest*
9375   ol_cv_pthread_lpthread=yes
9376 else
9377   echo "configure: failed program was:" >&5
9378   cat conftest.$ac_ext >&5
9379   rm -rf conftest*
9380   ol_cv_pthread_lpthread=no
9381 fi
9382 rm -f conftest*
9383 else
9384   cat > conftest.$ac_ext <<EOF
9385 #line 9386 "configure"
9386 #include "confdefs.h"
9387 /* pthread test headers */
9388 #include <pthread.h>
9389 #ifndef NULL
9390 #define NULL (void*)0
9391 #endif
9392
9393 static void *task(p)
9394         void *p;
9395 {
9396         return (void *) (p == NULL);
9397 }
9398
9399
9400 int main(argc, argv)
9401         int argc;
9402         char **argv;
9403 {
9404
9405         /* pthread test function */
9406         pthread_t t;
9407         int status;
9408         int detach = 1;
9409
9410 #ifdef HAVE_PTHREADS_FINAL
9411         /* Final pthreads */
9412         pthread_attr_t attr;
9413
9414         status = pthread_attr_init(&attr);
9415         if( status ) return status;
9416
9417 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9418         if( !detach ) {
9419 #if defined( PTHREAD_CREATE_JOINABLE )
9420                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9421 #else
9422                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9423 #endif
9424
9425 #ifdef PTHREAD_CREATE_DETACHED
9426         } else {
9427                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9428 #endif
9429         }
9430         if( status ) return status;
9431 #endif
9432
9433         status = pthread_create( &t, &attr, task, NULL );
9434         if( status ) return status;
9435
9436 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9437         if( detach ) {
9438                 /* give thread a chance to complete */
9439                 /* it should remain joinable and hence detachable */
9440                 sleep( 1 );
9441
9442                 status = pthread_detach( t );
9443                 if( status ) return status;
9444         }
9445 #endif
9446
9447 #else
9448         /* Draft 4 pthreads */
9449         status = pthread_create( &t, pthread_attr_default, task, NULL );
9450         if( status ) return status;
9451
9452         if( detach ) {
9453                 /* give thread a chance to complete */
9454                 /* it should remain joinable and hence detachable */
9455                 sleep( 1 );
9456
9457                 status = pthread_detach( &t );
9458                 if( status ) return status;
9459         }
9460 #endif
9461
9462 #ifdef HAVE_LINUX_THREADS
9463         pthread_kill_other_threads_np();
9464 #endif
9465
9466         return 0;
9467
9468 }
9469
9470 EOF
9471 if { (eval echo configure:9472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9472 then
9473   ol_cv_pthread_lpthread=yes
9474 else
9475   echo "configure: failed program was:" >&5
9476   cat conftest.$ac_ext >&5
9477   rm -fr conftest*
9478   ol_cv_pthread_lpthread=no
9479 fi
9480 rm -fr conftest*
9481 fi
9482
9483
9484                 # restore the LIBS
9485                 LIBS="$ol_LIBS"
9486         
9487 fi
9488
9489 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
9490
9491         if test $ol_cv_pthread_lpthread = yes ; then
9492                 ol_link_pthreads="-lpthread"
9493                 ol_link_threads=posix
9494         fi
9495 fi
9496
9497                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
9498 if test "$ol_link_threads" = no ; then
9499         # try -lc_r
9500         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
9501 echo "configure:9502: checking for pthread link with -lc_r" >&5
9502 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
9503   echo $ac_n "(cached) $ac_c" 1>&6
9504 else
9505   
9506                 # save the flags
9507                 ol_LIBS="$LIBS"
9508                 LIBS="-lc_r $LIBS"
9509
9510                 if test "$cross_compiling" = yes; then
9511   cat > conftest.$ac_ext <<EOF
9512 #line 9513 "configure"
9513 #include "confdefs.h"
9514 /* pthread test headers */
9515 #include <pthread.h>
9516 #ifndef NULL
9517 #define NULL (void*)0
9518 #endif
9519
9520 static void *task(p)
9521         void *p;
9522 {
9523         return (void *) (p == NULL);
9524 }
9525
9526 int main() {
9527
9528         /* pthread test function */
9529         pthread_t t;
9530         int status;
9531         int detach = 1;
9532
9533 #ifdef HAVE_PTHREADS_FINAL
9534         /* Final pthreads */
9535         pthread_attr_t attr;
9536
9537         status = pthread_attr_init(&attr);
9538         if( status ) return status;
9539
9540 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9541         if( !detach ) {
9542 #if defined( PTHREAD_CREATE_JOINABLE )
9543                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9544 #else
9545                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9546 #endif
9547
9548 #ifdef PTHREAD_CREATE_DETACHED
9549         } else {
9550                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9551 #endif
9552         }
9553         if( status ) return status;
9554 #endif
9555
9556         status = pthread_create( &t, &attr, task, NULL );
9557         if( status ) return status;
9558
9559 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9560         if( detach ) {
9561                 /* give thread a chance to complete */
9562                 /* it should remain joinable and hence detachable */
9563                 sleep( 1 );
9564
9565                 status = pthread_detach( t );
9566                 if( status ) return status;
9567         }
9568 #endif
9569
9570 #else
9571         /* Draft 4 pthreads */
9572         status = pthread_create( &t, pthread_attr_default, task, NULL );
9573         if( status ) return status;
9574
9575         if( detach ) {
9576                 /* give thread a chance to complete */
9577                 /* it should remain joinable and hence detachable */
9578                 sleep( 1 );
9579
9580                 status = pthread_detach( &t );
9581                 if( status ) return status;
9582         }
9583 #endif
9584
9585 #ifdef HAVE_LINUX_THREADS
9586         pthread_kill_other_threads_np();
9587 #endif
9588
9589         return 0;
9590
9591 ; return 0; }
9592 EOF
9593 if { (eval echo configure:9594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9594   rm -rf conftest*
9595   ol_cv_pthread_lc_r=yes
9596 else
9597   echo "configure: failed program was:" >&5
9598   cat conftest.$ac_ext >&5
9599   rm -rf conftest*
9600   ol_cv_pthread_lc_r=no
9601 fi
9602 rm -f conftest*
9603 else
9604   cat > conftest.$ac_ext <<EOF
9605 #line 9606 "configure"
9606 #include "confdefs.h"
9607 /* pthread test headers */
9608 #include <pthread.h>
9609 #ifndef NULL
9610 #define NULL (void*)0
9611 #endif
9612
9613 static void *task(p)
9614         void *p;
9615 {
9616         return (void *) (p == NULL);
9617 }
9618
9619
9620 int main(argc, argv)
9621         int argc;
9622         char **argv;
9623 {
9624
9625         /* pthread test function */
9626         pthread_t t;
9627         int status;
9628         int detach = 1;
9629
9630 #ifdef HAVE_PTHREADS_FINAL
9631         /* Final pthreads */
9632         pthread_attr_t attr;
9633
9634         status = pthread_attr_init(&attr);
9635         if( status ) return status;
9636
9637 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9638         if( !detach ) {
9639 #if defined( PTHREAD_CREATE_JOINABLE )
9640                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9641 #else
9642                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9643 #endif
9644
9645 #ifdef PTHREAD_CREATE_DETACHED
9646         } else {
9647                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9648 #endif
9649         }
9650         if( status ) return status;
9651 #endif
9652
9653         status = pthread_create( &t, &attr, task, NULL );
9654         if( status ) return status;
9655
9656 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9657         if( detach ) {
9658                 /* give thread a chance to complete */
9659                 /* it should remain joinable and hence detachable */
9660                 sleep( 1 );
9661
9662                 status = pthread_detach( t );
9663                 if( status ) return status;
9664         }
9665 #endif
9666
9667 #else
9668         /* Draft 4 pthreads */
9669         status = pthread_create( &t, pthread_attr_default, task, NULL );
9670         if( status ) return status;
9671
9672         if( detach ) {
9673                 /* give thread a chance to complete */
9674                 /* it should remain joinable and hence detachable */
9675                 sleep( 1 );
9676
9677                 status = pthread_detach( &t );
9678                 if( status ) return status;
9679         }
9680 #endif
9681
9682 #ifdef HAVE_LINUX_THREADS
9683         pthread_kill_other_threads_np();
9684 #endif
9685
9686         return 0;
9687
9688 }
9689
9690 EOF
9691 if { (eval echo configure:9692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9692 then
9693   ol_cv_pthread_lc_r=yes
9694 else
9695   echo "configure: failed program was:" >&5
9696   cat conftest.$ac_ext >&5
9697   rm -fr conftest*
9698   ol_cv_pthread_lc_r=no
9699 fi
9700 rm -fr conftest*
9701 fi
9702
9703
9704                 # restore the LIBS
9705                 LIBS="$ol_LIBS"
9706         
9707 fi
9708
9709 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
9710
9711         if test $ol_cv_pthread_lc_r = yes ; then
9712                 ol_link_pthreads="-lc_r"
9713                 ol_link_threads=posix
9714         fi
9715 fi
9716
9717
9718                 # Pthread try link: -threads (ol_cv_pthread_threads)
9719 if test "$ol_link_threads" = no ; then
9720         # try -threads
9721         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
9722 echo "configure:9723: checking for pthread link with -threads" >&5
9723 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
9724   echo $ac_n "(cached) $ac_c" 1>&6
9725 else
9726   
9727                 # save the flags
9728                 ol_LIBS="$LIBS"
9729                 LIBS="-threads $LIBS"
9730
9731                 if test "$cross_compiling" = yes; then
9732   cat > conftest.$ac_ext <<EOF
9733 #line 9734 "configure"
9734 #include "confdefs.h"
9735 /* pthread test headers */
9736 #include <pthread.h>
9737 #ifndef NULL
9738 #define NULL (void*)0
9739 #endif
9740
9741 static void *task(p)
9742         void *p;
9743 {
9744         return (void *) (p == NULL);
9745 }
9746
9747 int main() {
9748
9749         /* pthread test function */
9750         pthread_t t;
9751         int status;
9752         int detach = 1;
9753
9754 #ifdef HAVE_PTHREADS_FINAL
9755         /* Final pthreads */
9756         pthread_attr_t attr;
9757
9758         status = pthread_attr_init(&attr);
9759         if( status ) return status;
9760
9761 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9762         if( !detach ) {
9763 #if defined( PTHREAD_CREATE_JOINABLE )
9764                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9765 #else
9766                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9767 #endif
9768
9769 #ifdef PTHREAD_CREATE_DETACHED
9770         } else {
9771                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9772 #endif
9773         }
9774         if( status ) return status;
9775 #endif
9776
9777         status = pthread_create( &t, &attr, task, NULL );
9778         if( status ) return status;
9779
9780 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9781         if( detach ) {
9782                 /* give thread a chance to complete */
9783                 /* it should remain joinable and hence detachable */
9784                 sleep( 1 );
9785
9786                 status = pthread_detach( t );
9787                 if( status ) return status;
9788         }
9789 #endif
9790
9791 #else
9792         /* Draft 4 pthreads */
9793         status = pthread_create( &t, pthread_attr_default, task, NULL );
9794         if( status ) return status;
9795
9796         if( detach ) {
9797                 /* give thread a chance to complete */
9798                 /* it should remain joinable and hence detachable */
9799                 sleep( 1 );
9800
9801                 status = pthread_detach( &t );
9802                 if( status ) return status;
9803         }
9804 #endif
9805
9806 #ifdef HAVE_LINUX_THREADS
9807         pthread_kill_other_threads_np();
9808 #endif
9809
9810         return 0;
9811
9812 ; return 0; }
9813 EOF
9814 if { (eval echo configure:9815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9815   rm -rf conftest*
9816   ol_cv_pthread_threads=yes
9817 else
9818   echo "configure: failed program was:" >&5
9819   cat conftest.$ac_ext >&5
9820   rm -rf conftest*
9821   ol_cv_pthread_threads=no
9822 fi
9823 rm -f conftest*
9824 else
9825   cat > conftest.$ac_ext <<EOF
9826 #line 9827 "configure"
9827 #include "confdefs.h"
9828 /* pthread test headers */
9829 #include <pthread.h>
9830 #ifndef NULL
9831 #define NULL (void*)0
9832 #endif
9833
9834 static void *task(p)
9835         void *p;
9836 {
9837         return (void *) (p == NULL);
9838 }
9839
9840
9841 int main(argc, argv)
9842         int argc;
9843         char **argv;
9844 {
9845
9846         /* pthread test function */
9847         pthread_t t;
9848         int status;
9849         int detach = 1;
9850
9851 #ifdef HAVE_PTHREADS_FINAL
9852         /* Final pthreads */
9853         pthread_attr_t attr;
9854
9855         status = pthread_attr_init(&attr);
9856         if( status ) return status;
9857
9858 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9859         if( !detach ) {
9860 #if defined( PTHREAD_CREATE_JOINABLE )
9861                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9862 #else
9863                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9864 #endif
9865
9866 #ifdef PTHREAD_CREATE_DETACHED
9867         } else {
9868                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9869 #endif
9870         }
9871         if( status ) return status;
9872 #endif
9873
9874         status = pthread_create( &t, &attr, task, NULL );
9875         if( status ) return status;
9876
9877 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9878         if( detach ) {
9879                 /* give thread a chance to complete */
9880                 /* it should remain joinable and hence detachable */
9881                 sleep( 1 );
9882
9883                 status = pthread_detach( t );
9884                 if( status ) return status;
9885         }
9886 #endif
9887
9888 #else
9889         /* Draft 4 pthreads */
9890         status = pthread_create( &t, pthread_attr_default, task, NULL );
9891         if( status ) return status;
9892
9893         if( detach ) {
9894                 /* give thread a chance to complete */
9895                 /* it should remain joinable and hence detachable */
9896                 sleep( 1 );
9897
9898                 status = pthread_detach( &t );
9899                 if( status ) return status;
9900         }
9901 #endif
9902
9903 #ifdef HAVE_LINUX_THREADS
9904         pthread_kill_other_threads_np();
9905 #endif
9906
9907         return 0;
9908
9909 }
9910
9911 EOF
9912 if { (eval echo configure:9913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9913 then
9914   ol_cv_pthread_threads=yes
9915 else
9916   echo "configure: failed program was:" >&5
9917   cat conftest.$ac_ext >&5
9918   rm -fr conftest*
9919   ol_cv_pthread_threads=no
9920 fi
9921 rm -fr conftest*
9922 fi
9923
9924
9925                 # restore the LIBS
9926                 LIBS="$ol_LIBS"
9927         
9928 fi
9929
9930 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
9931
9932         if test $ol_cv_pthread_threads = yes ; then
9933                 ol_link_pthreads="-threads"
9934                 ol_link_threads=posix
9935         fi
9936 fi
9937
9938
9939                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
9940 if test "$ol_link_threads" = no ; then
9941         # try -lpthreads -lmach -lexc -lc_r
9942         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
9943 echo "configure:9944: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
9944 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
9945   echo $ac_n "(cached) $ac_c" 1>&6
9946 else
9947   
9948                 # save the flags
9949                 ol_LIBS="$LIBS"
9950                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
9951
9952                 if test "$cross_compiling" = yes; then
9953   cat > conftest.$ac_ext <<EOF
9954 #line 9955 "configure"
9955 #include "confdefs.h"
9956 /* pthread test headers */
9957 #include <pthread.h>
9958 #ifndef NULL
9959 #define NULL (void*)0
9960 #endif
9961
9962 static void *task(p)
9963         void *p;
9964 {
9965         return (void *) (p == NULL);
9966 }
9967
9968 int main() {
9969
9970         /* pthread test function */
9971         pthread_t t;
9972         int status;
9973         int detach = 1;
9974
9975 #ifdef HAVE_PTHREADS_FINAL
9976         /* Final pthreads */
9977         pthread_attr_t attr;
9978
9979         status = pthread_attr_init(&attr);
9980         if( status ) return status;
9981
9982 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9983         if( !detach ) {
9984 #if defined( PTHREAD_CREATE_JOINABLE )
9985                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9986 #else
9987                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9988 #endif
9989
9990 #ifdef PTHREAD_CREATE_DETACHED
9991         } else {
9992                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9993 #endif
9994         }
9995         if( status ) return status;
9996 #endif
9997
9998         status = pthread_create( &t, &attr, task, NULL );
9999         if( status ) return status;
10000
10001 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10002         if( detach ) {
10003                 /* give thread a chance to complete */
10004                 /* it should remain joinable and hence detachable */
10005                 sleep( 1 );
10006
10007                 status = pthread_detach( t );
10008                 if( status ) return status;
10009         }
10010 #endif
10011
10012 #else
10013         /* Draft 4 pthreads */
10014         status = pthread_create( &t, pthread_attr_default, task, NULL );
10015         if( status ) return status;
10016
10017         if( detach ) {
10018                 /* give thread a chance to complete */
10019                 /* it should remain joinable and hence detachable */
10020                 sleep( 1 );
10021
10022                 status = pthread_detach( &t );
10023                 if( status ) return status;
10024         }
10025 #endif
10026
10027 #ifdef HAVE_LINUX_THREADS
10028         pthread_kill_other_threads_np();
10029 #endif
10030
10031         return 0;
10032
10033 ; return 0; }
10034 EOF
10035 if { (eval echo configure:10036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10036   rm -rf conftest*
10037   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10038 else
10039   echo "configure: failed program was:" >&5
10040   cat conftest.$ac_ext >&5
10041   rm -rf conftest*
10042   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10043 fi
10044 rm -f conftest*
10045 else
10046   cat > conftest.$ac_ext <<EOF
10047 #line 10048 "configure"
10048 #include "confdefs.h"
10049 /* pthread test headers */
10050 #include <pthread.h>
10051 #ifndef NULL
10052 #define NULL (void*)0
10053 #endif
10054
10055 static void *task(p)
10056         void *p;
10057 {
10058         return (void *) (p == NULL);
10059 }
10060
10061
10062 int main(argc, argv)
10063         int argc;
10064         char **argv;
10065 {
10066
10067         /* pthread test function */
10068         pthread_t t;
10069         int status;
10070         int detach = 1;
10071
10072 #ifdef HAVE_PTHREADS_FINAL
10073         /* Final pthreads */
10074         pthread_attr_t attr;
10075
10076         status = pthread_attr_init(&attr);
10077         if( status ) return status;
10078
10079 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10080         if( !detach ) {
10081 #if defined( PTHREAD_CREATE_JOINABLE )
10082                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10083 #else
10084                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10085 #endif
10086
10087 #ifdef PTHREAD_CREATE_DETACHED
10088         } else {
10089                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10090 #endif
10091         }
10092         if( status ) return status;
10093 #endif
10094
10095         status = pthread_create( &t, &attr, task, NULL );
10096         if( status ) return status;
10097
10098 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10099         if( detach ) {
10100                 /* give thread a chance to complete */
10101                 /* it should remain joinable and hence detachable */
10102                 sleep( 1 );
10103
10104                 status = pthread_detach( t );
10105                 if( status ) return status;
10106         }
10107 #endif
10108
10109 #else
10110         /* Draft 4 pthreads */
10111         status = pthread_create( &t, pthread_attr_default, task, NULL );
10112         if( status ) return status;
10113
10114         if( detach ) {
10115                 /* give thread a chance to complete */
10116                 /* it should remain joinable and hence detachable */
10117                 sleep( 1 );
10118
10119                 status = pthread_detach( &t );
10120                 if( status ) return status;
10121         }
10122 #endif
10123
10124 #ifdef HAVE_LINUX_THREADS
10125         pthread_kill_other_threads_np();
10126 #endif
10127
10128         return 0;
10129
10130 }
10131
10132 EOF
10133 if { (eval echo configure:10134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10134 then
10135   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10136 else
10137   echo "configure: failed program was:" >&5
10138   cat conftest.$ac_ext >&5
10139   rm -fr conftest*
10140   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10141 fi
10142 rm -fr conftest*
10143 fi
10144
10145
10146                 # restore the LIBS
10147                 LIBS="$ol_LIBS"
10148         
10149 fi
10150
10151 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
10152
10153         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
10154                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
10155                 ol_link_threads=posix
10156         fi
10157 fi
10158
10159                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
10160 if test "$ol_link_threads" = no ; then
10161         # try -lpthreads -lmach -lexc
10162         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
10163 echo "configure:10164: checking for pthread link with -lpthreads -lmach -lexc" >&5
10164 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
10165   echo $ac_n "(cached) $ac_c" 1>&6
10166 else
10167   
10168                 # save the flags
10169                 ol_LIBS="$LIBS"
10170                 LIBS="-lpthreads -lmach -lexc $LIBS"
10171
10172                 if test "$cross_compiling" = yes; then
10173   cat > conftest.$ac_ext <<EOF
10174 #line 10175 "configure"
10175 #include "confdefs.h"
10176 /* pthread test headers */
10177 #include <pthread.h>
10178 #ifndef NULL
10179 #define NULL (void*)0
10180 #endif
10181
10182 static void *task(p)
10183         void *p;
10184 {
10185         return (void *) (p == NULL);
10186 }
10187
10188 int main() {
10189
10190         /* pthread test function */
10191         pthread_t t;
10192         int status;
10193         int detach = 1;
10194
10195 #ifdef HAVE_PTHREADS_FINAL
10196         /* Final pthreads */
10197         pthread_attr_t attr;
10198
10199         status = pthread_attr_init(&attr);
10200         if( status ) return status;
10201
10202 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10203         if( !detach ) {
10204 #if defined( PTHREAD_CREATE_JOINABLE )
10205                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10206 #else
10207                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10208 #endif
10209
10210 #ifdef PTHREAD_CREATE_DETACHED
10211         } else {
10212                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10213 #endif
10214         }
10215         if( status ) return status;
10216 #endif
10217
10218         status = pthread_create( &t, &attr, task, NULL );
10219         if( status ) return status;
10220
10221 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10222         if( detach ) {
10223                 /* give thread a chance to complete */
10224                 /* it should remain joinable and hence detachable */
10225                 sleep( 1 );
10226
10227                 status = pthread_detach( t );
10228                 if( status ) return status;
10229         }
10230 #endif
10231
10232 #else
10233         /* Draft 4 pthreads */
10234         status = pthread_create( &t, pthread_attr_default, task, NULL );
10235         if( status ) return status;
10236
10237         if( detach ) {
10238                 /* give thread a chance to complete */
10239                 /* it should remain joinable and hence detachable */
10240                 sleep( 1 );
10241
10242                 status = pthread_detach( &t );
10243                 if( status ) return status;
10244         }
10245 #endif
10246
10247 #ifdef HAVE_LINUX_THREADS
10248         pthread_kill_other_threads_np();
10249 #endif
10250
10251         return 0;
10252
10253 ; return 0; }
10254 EOF
10255 if { (eval echo configure:10256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10256   rm -rf conftest*
10257   ol_cv_pthread_lpthreads_lmach_lexc=yes
10258 else
10259   echo "configure: failed program was:" >&5
10260   cat conftest.$ac_ext >&5
10261   rm -rf conftest*
10262   ol_cv_pthread_lpthreads_lmach_lexc=no
10263 fi
10264 rm -f conftest*
10265 else
10266   cat > conftest.$ac_ext <<EOF
10267 #line 10268 "configure"
10268 #include "confdefs.h"
10269 /* pthread test headers */
10270 #include <pthread.h>
10271 #ifndef NULL
10272 #define NULL (void*)0
10273 #endif
10274
10275 static void *task(p)
10276         void *p;
10277 {
10278         return (void *) (p == NULL);
10279 }
10280
10281
10282 int main(argc, argv)
10283         int argc;
10284         char **argv;
10285 {
10286
10287         /* pthread test function */
10288         pthread_t t;
10289         int status;
10290         int detach = 1;
10291
10292 #ifdef HAVE_PTHREADS_FINAL
10293         /* Final pthreads */
10294         pthread_attr_t attr;
10295
10296         status = pthread_attr_init(&attr);
10297         if( status ) return status;
10298
10299 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10300         if( !detach ) {
10301 #if defined( PTHREAD_CREATE_JOINABLE )
10302                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10303 #else
10304                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10305 #endif
10306
10307 #ifdef PTHREAD_CREATE_DETACHED
10308         } else {
10309                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10310 #endif
10311         }
10312         if( status ) return status;
10313 #endif
10314
10315         status = pthread_create( &t, &attr, task, NULL );
10316         if( status ) return status;
10317
10318 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10319         if( detach ) {
10320                 /* give thread a chance to complete */
10321                 /* it should remain joinable and hence detachable */
10322                 sleep( 1 );
10323
10324                 status = pthread_detach( t );
10325                 if( status ) return status;
10326         }
10327 #endif
10328
10329 #else
10330         /* Draft 4 pthreads */
10331         status = pthread_create( &t, pthread_attr_default, task, NULL );
10332         if( status ) return status;
10333
10334         if( detach ) {
10335                 /* give thread a chance to complete */
10336                 /* it should remain joinable and hence detachable */
10337                 sleep( 1 );
10338
10339                 status = pthread_detach( &t );
10340                 if( status ) return status;
10341         }
10342 #endif
10343
10344 #ifdef HAVE_LINUX_THREADS
10345         pthread_kill_other_threads_np();
10346 #endif
10347
10348         return 0;
10349
10350 }
10351
10352 EOF
10353 if { (eval echo configure:10354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10354 then
10355   ol_cv_pthread_lpthreads_lmach_lexc=yes
10356 else
10357   echo "configure: failed program was:" >&5
10358   cat conftest.$ac_ext >&5
10359   rm -fr conftest*
10360   ol_cv_pthread_lpthreads_lmach_lexc=no
10361 fi
10362 rm -fr conftest*
10363 fi
10364
10365
10366                 # restore the LIBS
10367                 LIBS="$ol_LIBS"
10368         
10369 fi
10370
10371 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
10372
10373         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
10374                 ol_link_pthreads="-lpthreads -lmach -lexc"
10375                 ol_link_threads=posix
10376         fi
10377 fi
10378
10379                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
10380 if test "$ol_link_threads" = no ; then
10381         # try -lpthreads -lexc
10382         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
10383 echo "configure:10384: checking for pthread link with -lpthreads -lexc" >&5
10384 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
10385   echo $ac_n "(cached) $ac_c" 1>&6
10386 else
10387   
10388                 # save the flags
10389                 ol_LIBS="$LIBS"
10390                 LIBS="-lpthreads -lexc $LIBS"
10391
10392                 if test "$cross_compiling" = yes; then
10393   cat > conftest.$ac_ext <<EOF
10394 #line 10395 "configure"
10395 #include "confdefs.h"
10396 /* pthread test headers */
10397 #include <pthread.h>
10398 #ifndef NULL
10399 #define NULL (void*)0
10400 #endif
10401
10402 static void *task(p)
10403         void *p;
10404 {
10405         return (void *) (p == NULL);
10406 }
10407
10408 int main() {
10409
10410         /* pthread test function */
10411         pthread_t t;
10412         int status;
10413         int detach = 1;
10414
10415 #ifdef HAVE_PTHREADS_FINAL
10416         /* Final pthreads */
10417         pthread_attr_t attr;
10418
10419         status = pthread_attr_init(&attr);
10420         if( status ) return status;
10421
10422 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10423         if( !detach ) {
10424 #if defined( PTHREAD_CREATE_JOINABLE )
10425                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10426 #else
10427                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10428 #endif
10429
10430 #ifdef PTHREAD_CREATE_DETACHED
10431         } else {
10432                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10433 #endif
10434         }
10435         if( status ) return status;
10436 #endif
10437
10438         status = pthread_create( &t, &attr, task, NULL );
10439         if( status ) return status;
10440
10441 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10442         if( detach ) {
10443                 /* give thread a chance to complete */
10444                 /* it should remain joinable and hence detachable */
10445                 sleep( 1 );
10446
10447                 status = pthread_detach( t );
10448                 if( status ) return status;
10449         }
10450 #endif
10451
10452 #else
10453         /* Draft 4 pthreads */
10454         status = pthread_create( &t, pthread_attr_default, task, NULL );
10455         if( status ) return status;
10456
10457         if( detach ) {
10458                 /* give thread a chance to complete */
10459                 /* it should remain joinable and hence detachable */
10460                 sleep( 1 );
10461
10462                 status = pthread_detach( &t );
10463                 if( status ) return status;
10464         }
10465 #endif
10466
10467 #ifdef HAVE_LINUX_THREADS
10468         pthread_kill_other_threads_np();
10469 #endif
10470
10471         return 0;
10472
10473 ; return 0; }
10474 EOF
10475 if { (eval echo configure:10476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10476   rm -rf conftest*
10477   ol_cv_pthread_lpthreads_lexc=yes
10478 else
10479   echo "configure: failed program was:" >&5
10480   cat conftest.$ac_ext >&5
10481   rm -rf conftest*
10482   ol_cv_pthread_lpthreads_lexc=no
10483 fi
10484 rm -f conftest*
10485 else
10486   cat > conftest.$ac_ext <<EOF
10487 #line 10488 "configure"
10488 #include "confdefs.h"
10489 /* pthread test headers */
10490 #include <pthread.h>
10491 #ifndef NULL
10492 #define NULL (void*)0
10493 #endif
10494
10495 static void *task(p)
10496         void *p;
10497 {
10498         return (void *) (p == NULL);
10499 }
10500
10501
10502 int main(argc, argv)
10503         int argc;
10504         char **argv;
10505 {
10506
10507         /* pthread test function */
10508         pthread_t t;
10509         int status;
10510         int detach = 1;
10511
10512 #ifdef HAVE_PTHREADS_FINAL
10513         /* Final pthreads */
10514         pthread_attr_t attr;
10515
10516         status = pthread_attr_init(&attr);
10517         if( status ) return status;
10518
10519 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10520         if( !detach ) {
10521 #if defined( PTHREAD_CREATE_JOINABLE )
10522                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10523 #else
10524                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10525 #endif
10526
10527 #ifdef PTHREAD_CREATE_DETACHED
10528         } else {
10529                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10530 #endif
10531         }
10532         if( status ) return status;
10533 #endif
10534
10535         status = pthread_create( &t, &attr, task, NULL );
10536         if( status ) return status;
10537
10538 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10539         if( detach ) {
10540                 /* give thread a chance to complete */
10541                 /* it should remain joinable and hence detachable */
10542                 sleep( 1 );
10543
10544                 status = pthread_detach( t );
10545                 if( status ) return status;
10546         }
10547 #endif
10548
10549 #else
10550         /* Draft 4 pthreads */
10551         status = pthread_create( &t, pthread_attr_default, task, NULL );
10552         if( status ) return status;
10553
10554         if( detach ) {
10555                 /* give thread a chance to complete */
10556                 /* it should remain joinable and hence detachable */
10557                 sleep( 1 );
10558
10559                 status = pthread_detach( &t );
10560                 if( status ) return status;
10561         }
10562 #endif
10563
10564 #ifdef HAVE_LINUX_THREADS
10565         pthread_kill_other_threads_np();
10566 #endif
10567
10568         return 0;
10569
10570 }
10571
10572 EOF
10573 if { (eval echo configure:10574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10574 then
10575   ol_cv_pthread_lpthreads_lexc=yes
10576 else
10577   echo "configure: failed program was:" >&5
10578   cat conftest.$ac_ext >&5
10579   rm -fr conftest*
10580   ol_cv_pthread_lpthreads_lexc=no
10581 fi
10582 rm -fr conftest*
10583 fi
10584
10585
10586                 # restore the LIBS
10587                 LIBS="$ol_LIBS"
10588         
10589 fi
10590
10591 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
10592
10593         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
10594                 ol_link_pthreads="-lpthreads -lexc"
10595                 ol_link_threads=posix
10596         fi
10597 fi
10598
10599
10600                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
10601 if test "$ol_link_threads" = no ; then
10602         # try -lpthreads
10603         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
10604 echo "configure:10605: checking for pthread link with -lpthreads" >&5
10605 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
10606   echo $ac_n "(cached) $ac_c" 1>&6
10607 else
10608   
10609                 # save the flags
10610                 ol_LIBS="$LIBS"
10611                 LIBS="-lpthreads $LIBS"
10612
10613                 if test "$cross_compiling" = yes; then
10614   cat > conftest.$ac_ext <<EOF
10615 #line 10616 "configure"
10616 #include "confdefs.h"
10617 /* pthread test headers */
10618 #include <pthread.h>
10619 #ifndef NULL
10620 #define NULL (void*)0
10621 #endif
10622
10623 static void *task(p)
10624         void *p;
10625 {
10626         return (void *) (p == NULL);
10627 }
10628
10629 int main() {
10630
10631         /* pthread test function */
10632         pthread_t t;
10633         int status;
10634         int detach = 1;
10635
10636 #ifdef HAVE_PTHREADS_FINAL
10637         /* Final pthreads */
10638         pthread_attr_t attr;
10639
10640         status = pthread_attr_init(&attr);
10641         if( status ) return status;
10642
10643 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10644         if( !detach ) {
10645 #if defined( PTHREAD_CREATE_JOINABLE )
10646                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10647 #else
10648                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10649 #endif
10650
10651 #ifdef PTHREAD_CREATE_DETACHED
10652         } else {
10653                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10654 #endif
10655         }
10656         if( status ) return status;
10657 #endif
10658
10659         status = pthread_create( &t, &attr, task, NULL );
10660         if( status ) return status;
10661
10662 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10663         if( detach ) {
10664                 /* give thread a chance to complete */
10665                 /* it should remain joinable and hence detachable */
10666                 sleep( 1 );
10667
10668                 status = pthread_detach( t );
10669                 if( status ) return status;
10670         }
10671 #endif
10672
10673 #else
10674         /* Draft 4 pthreads */
10675         status = pthread_create( &t, pthread_attr_default, task, NULL );
10676         if( status ) return status;
10677
10678         if( detach ) {
10679                 /* give thread a chance to complete */
10680                 /* it should remain joinable and hence detachable */
10681                 sleep( 1 );
10682
10683                 status = pthread_detach( &t );
10684                 if( status ) return status;
10685         }
10686 #endif
10687
10688 #ifdef HAVE_LINUX_THREADS
10689         pthread_kill_other_threads_np();
10690 #endif
10691
10692         return 0;
10693
10694 ; return 0; }
10695 EOF
10696 if { (eval echo configure:10697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10697   rm -rf conftest*
10698   ol_cv_pthread_lib_lpthreads=yes
10699 else
10700   echo "configure: failed program was:" >&5
10701   cat conftest.$ac_ext >&5
10702   rm -rf conftest*
10703   ol_cv_pthread_lib_lpthreads=no
10704 fi
10705 rm -f conftest*
10706 else
10707   cat > conftest.$ac_ext <<EOF
10708 #line 10709 "configure"
10709 #include "confdefs.h"
10710 /* pthread test headers */
10711 #include <pthread.h>
10712 #ifndef NULL
10713 #define NULL (void*)0
10714 #endif
10715
10716 static void *task(p)
10717         void *p;
10718 {
10719         return (void *) (p == NULL);
10720 }
10721
10722
10723 int main(argc, argv)
10724         int argc;
10725         char **argv;
10726 {
10727
10728         /* pthread test function */
10729         pthread_t t;
10730         int status;
10731         int detach = 1;
10732
10733 #ifdef HAVE_PTHREADS_FINAL
10734         /* Final pthreads */
10735         pthread_attr_t attr;
10736
10737         status = pthread_attr_init(&attr);
10738         if( status ) return status;
10739
10740 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10741         if( !detach ) {
10742 #if defined( PTHREAD_CREATE_JOINABLE )
10743                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10744 #else
10745                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10746 #endif
10747
10748 #ifdef PTHREAD_CREATE_DETACHED
10749         } else {
10750                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10751 #endif
10752         }
10753         if( status ) return status;
10754 #endif
10755
10756         status = pthread_create( &t, &attr, task, NULL );
10757         if( status ) return status;
10758
10759 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10760         if( detach ) {
10761                 /* give thread a chance to complete */
10762                 /* it should remain joinable and hence detachable */
10763                 sleep( 1 );
10764
10765                 status = pthread_detach( t );
10766                 if( status ) return status;
10767         }
10768 #endif
10769
10770 #else
10771         /* Draft 4 pthreads */
10772         status = pthread_create( &t, pthread_attr_default, task, NULL );
10773         if( status ) return status;
10774
10775         if( detach ) {
10776                 /* give thread a chance to complete */
10777                 /* it should remain joinable and hence detachable */
10778                 sleep( 1 );
10779
10780                 status = pthread_detach( &t );
10781                 if( status ) return status;
10782         }
10783 #endif
10784
10785 #ifdef HAVE_LINUX_THREADS
10786         pthread_kill_other_threads_np();
10787 #endif
10788
10789         return 0;
10790
10791 }
10792
10793 EOF
10794 if { (eval echo configure:10795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10795 then
10796   ol_cv_pthread_lib_lpthreads=yes
10797 else
10798   echo "configure: failed program was:" >&5
10799   cat conftest.$ac_ext >&5
10800   rm -fr conftest*
10801   ol_cv_pthread_lib_lpthreads=no
10802 fi
10803 rm -fr conftest*
10804 fi
10805
10806
10807                 # restore the LIBS
10808                 LIBS="$ol_LIBS"
10809         
10810 fi
10811
10812 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
10813
10814         if test $ol_cv_pthread_lib_lpthreads = yes ; then
10815                 ol_link_pthreads="-lpthreads"
10816                 ol_link_threads=posix
10817         fi
10818 fi
10819
10820
10821                 if test $ol_link_threads != no ; then
10822                         cat >> confdefs.h <<\EOF
10823 #define HAVE_PTHREADS 1
10824 EOF
10825
10826
10827                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
10828
10829                                                 save_CPPFLAGS="$CPPFLAGS"
10830                         save_LIBS="$LIBS"
10831                         LIBS="$LTHREAD_LIBS $LIBS"
10832
10833                                                                                                 for ac_func in sched_yield pthread_yield
10834 do
10835 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10836 echo "configure:10837: checking for $ac_func" >&5
10837 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10838   echo $ac_n "(cached) $ac_c" 1>&6
10839 else
10840   cat > conftest.$ac_ext <<EOF
10841 #line 10842 "configure"
10842 #include "confdefs.h"
10843 /* System header to define __stub macros and hopefully few prototypes,
10844     which can conflict with char $ac_func(); below.  */
10845 #include <assert.h>
10846 /* Override any gcc2 internal prototype to avoid an error.  */
10847 /* We use char because int might match the return type of a gcc2
10848     builtin and then its argument prototype would still apply.  */
10849 char $ac_func();
10850 char (*f)();
10851
10852 int main() {
10853
10854 /* The GNU C library defines this for functions which it implements
10855     to always fail with ENOSYS.  Some functions are actually named
10856     something starting with __ and the normal name is an alias.  */
10857 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10858 choke me
10859 #else
10860 f = $ac_func;
10861 #endif
10862
10863 ; return 0; }
10864 EOF
10865 if { (eval echo configure:10866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10866   rm -rf conftest*
10867   eval "ac_cv_func_$ac_func=yes"
10868 else
10869   echo "configure: failed program was:" >&5
10870   cat conftest.$ac_ext >&5
10871   rm -rf conftest*
10872   eval "ac_cv_func_$ac_func=no"
10873 fi
10874 rm -f conftest*
10875 fi
10876
10877 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10878   echo "$ac_t""yes" 1>&6
10879     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10880   cat >> confdefs.h <<EOF
10881 #define $ac_tr_func 1
10882 EOF
10883  
10884 else
10885   echo "$ac_t""no" 1>&6
10886 fi
10887 done
10888
10889
10890                         if test $ac_cv_func_sched_yield = no -a \
10891                                 $ac_cv_func_pthread_yield = no ; then
10892                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
10893 echo "configure:10894: checking for sched_yield in -lrt" >&5
10894 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
10895 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10896   echo $ac_n "(cached) $ac_c" 1>&6
10897 else
10898   ac_save_LIBS="$LIBS"
10899 LIBS="-lrt  $LIBS"
10900 cat > conftest.$ac_ext <<EOF
10901 #line 10902 "configure"
10902 #include "confdefs.h"
10903 /* Override any gcc2 internal prototype to avoid an error.  */
10904 /* We use char because int might match the return type of a gcc2
10905     builtin and then its argument prototype would still apply.  */
10906 char sched_yield();
10907
10908 int main() {
10909 sched_yield()
10910 ; return 0; }
10911 EOF
10912 if { (eval echo configure:10913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10913   rm -rf conftest*
10914   eval "ac_cv_lib_$ac_lib_var=yes"
10915 else
10916   echo "configure: failed program was:" >&5
10917   cat conftest.$ac_ext >&5
10918   rm -rf conftest*
10919   eval "ac_cv_lib_$ac_lib_var=no"
10920 fi
10921 rm -f conftest*
10922 LIBS="$ac_save_LIBS"
10923
10924 fi
10925 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10926   echo "$ac_t""yes" 1>&6
10927   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
10928                                         cat >> confdefs.h <<\EOF
10929 #define HAVE_SCHED_YIELD 1
10930 EOF
10931
10932                                         ac_cv_func_sched_yield=yes
10933 else
10934   echo "$ac_t""no" 1>&6
10935 ac_cv_func_sched_yield=no
10936 fi
10937
10938                         fi
10939                         if test $ac_cv_func_sched_yield = no -a \
10940                                 $ac_cv_func_pthread_yield = no ; then
10941                                                                                                 for ac_func in thr_yield
10942 do
10943 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10944 echo "configure:10945: checking for $ac_func" >&5
10945 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10946   echo $ac_n "(cached) $ac_c" 1>&6
10947 else
10948   cat > conftest.$ac_ext <<EOF
10949 #line 10950 "configure"
10950 #include "confdefs.h"
10951 /* System header to define __stub macros and hopefully few prototypes,
10952     which can conflict with char $ac_func(); below.  */
10953 #include <assert.h>
10954 /* Override any gcc2 internal prototype to avoid an error.  */
10955 /* We use char because int might match the return type of a gcc2
10956     builtin and then its argument prototype would still apply.  */
10957 char $ac_func();
10958 char (*f)();
10959
10960 int main() {
10961
10962 /* The GNU C library defines this for functions which it implements
10963     to always fail with ENOSYS.  Some functions are actually named
10964     something starting with __ and the normal name is an alias.  */
10965 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10966 choke me
10967 #else
10968 f = $ac_func;
10969 #endif
10970
10971 ; return 0; }
10972 EOF
10973 if { (eval echo configure:10974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10974   rm -rf conftest*
10975   eval "ac_cv_func_$ac_func=yes"
10976 else
10977   echo "configure: failed program was:" >&5
10978   cat conftest.$ac_ext >&5
10979   rm -rf conftest*
10980   eval "ac_cv_func_$ac_func=no"
10981 fi
10982 rm -f conftest*
10983 fi
10984
10985 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10986   echo "$ac_t""yes" 1>&6
10987     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10988   cat >> confdefs.h <<EOF
10989 #define $ac_tr_func 1
10990 EOF
10991  
10992 else
10993   echo "$ac_t""no" 1>&6
10994 fi
10995 done
10996
10997                         fi
10998                         if test $ac_cv_func_sched_yield = no -a \
10999                                 $ac_cv_func_pthread_yield = no -a \
11000                                 "$ac_cv_func_thr_yield" = no ; then
11001                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
11002                         fi
11003
11004                                                 for ac_func in pthread_kill pthread_rwlock_destroy
11005 do
11006 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11007 echo "configure:11008: checking for $ac_func" >&5
11008 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11009   echo $ac_n "(cached) $ac_c" 1>&6
11010 else
11011   cat > conftest.$ac_ext <<EOF
11012 #line 11013 "configure"
11013 #include "confdefs.h"
11014 /* System header to define __stub macros and hopefully few prototypes,
11015     which can conflict with char $ac_func(); below.  */
11016 #include <assert.h>
11017 /* Override any gcc2 internal prototype to avoid an error.  */
11018 /* We use char because int might match the return type of a gcc2
11019     builtin and then its argument prototype would still apply.  */
11020 char $ac_func();
11021 char (*f)();
11022
11023 int main() {
11024
11025 /* The GNU C library defines this for functions which it implements
11026     to always fail with ENOSYS.  Some functions are actually named
11027     something starting with __ and the normal name is an alias.  */
11028 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11029 choke me
11030 #else
11031 f = $ac_func;
11032 #endif
11033
11034 ; return 0; }
11035 EOF
11036 if { (eval echo configure:11037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11037   rm -rf conftest*
11038   eval "ac_cv_func_$ac_func=yes"
11039 else
11040   echo "configure: failed program was:" >&5
11041   cat conftest.$ac_ext >&5
11042   rm -rf conftest*
11043   eval "ac_cv_func_$ac_func=no"
11044 fi
11045 rm -f conftest*
11046 fi
11047
11048 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11049   echo "$ac_t""yes" 1>&6
11050     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11051   cat >> confdefs.h <<EOF
11052 #define $ac_tr_func 1
11053 EOF
11054  
11055 else
11056   echo "$ac_t""no" 1>&6
11057 fi
11058 done
11059
11060
11061                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
11062 echo "configure:11063: checking for pthread_detach with <pthread.h>" >&5
11063 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
11064   echo $ac_n "(cached) $ac_c" 1>&6
11065 else
11066   
11067                                                                 cat > conftest.$ac_ext <<EOF
11068 #line 11069 "configure"
11069 #include "confdefs.h"
11070
11071 #include <pthread.h>
11072 #ifndef NULL
11073 #define NULL (void*)0
11074 #endif
11075
11076 int main() {
11077 pthread_detach(NULL);
11078 ; return 0; }
11079 EOF
11080 if { (eval echo configure:11081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11081   rm -rf conftest*
11082   ol_cv_func_pthread_detach=yes
11083 else
11084   echo "configure: failed program was:" >&5
11085   cat conftest.$ac_ext >&5
11086   rm -rf conftest*
11087   ol_cv_func_pthread_detach=no
11088 fi
11089 rm -f conftest*
11090                         
11091 fi
11092
11093 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
11094
11095                         if test $ol_cv_func_pthread_detach = no ; then
11096                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
11097                         fi
11098
11099                         cat >> confdefs.h <<\EOF
11100 #define HAVE_PTHREAD_DETACH 1
11101 EOF
11102
11103
11104                                                 for ac_func in \
11105                                 pthread_setconcurrency \
11106                                 pthread_getconcurrency \
11107                                 thr_setconcurrency \
11108                                 thr_getconcurrency \
11109                         
11110 do
11111 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11112 echo "configure:11113: checking for $ac_func" >&5
11113 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11114   echo $ac_n "(cached) $ac_c" 1>&6
11115 else
11116   cat > conftest.$ac_ext <<EOF
11117 #line 11118 "configure"
11118 #include "confdefs.h"
11119 /* System header to define __stub macros and hopefully few prototypes,
11120     which can conflict with char $ac_func(); below.  */
11121 #include <assert.h>
11122 /* Override any gcc2 internal prototype to avoid an error.  */
11123 /* We use char because int might match the return type of a gcc2
11124     builtin and then its argument prototype would still apply.  */
11125 char $ac_func();
11126 char (*f)();
11127
11128 int main() {
11129
11130 /* The GNU C library defines this for functions which it implements
11131     to always fail with ENOSYS.  Some functions are actually named
11132     something starting with __ and the normal name is an alias.  */
11133 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11134 choke me
11135 #else
11136 f = $ac_func;
11137 #endif
11138
11139 ; return 0; }
11140 EOF
11141 if { (eval echo configure:11142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11142   rm -rf conftest*
11143   eval "ac_cv_func_$ac_func=yes"
11144 else
11145   echo "configure: failed program was:" >&5
11146   cat conftest.$ac_ext >&5
11147   rm -rf conftest*
11148   eval "ac_cv_func_$ac_func=no"
11149 fi
11150 rm -f conftest*
11151 fi
11152
11153 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11154   echo "$ac_t""yes" 1>&6
11155     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11156   cat >> confdefs.h <<EOF
11157 #define $ac_tr_func 1
11158 EOF
11159  
11160 else
11161   echo "$ac_t""no" 1>&6
11162 fi
11163 done
11164
11165
11166                         
11167         for ac_func in pthread_kill_other_threads_np
11168 do
11169 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11170 echo "configure:11171: checking for $ac_func" >&5
11171 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11172   echo $ac_n "(cached) $ac_c" 1>&6
11173 else
11174   cat > conftest.$ac_ext <<EOF
11175 #line 11176 "configure"
11176 #include "confdefs.h"
11177 /* System header to define __stub macros and hopefully few prototypes,
11178     which can conflict with char $ac_func(); below.  */
11179 #include <assert.h>
11180 /* Override any gcc2 internal prototype to avoid an error.  */
11181 /* We use char because int might match the return type of a gcc2
11182     builtin and then its argument prototype would still apply.  */
11183 char $ac_func();
11184 char (*f)();
11185
11186 int main() {
11187
11188 /* The GNU C library defines this for functions which it implements
11189     to always fail with ENOSYS.  Some functions are actually named
11190     something starting with __ and the normal name is an alias.  */
11191 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11192 choke me
11193 #else
11194 f = $ac_func;
11195 #endif
11196
11197 ; return 0; }
11198 EOF
11199 if { (eval echo configure:11200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11200   rm -rf conftest*
11201   eval "ac_cv_func_$ac_func=yes"
11202 else
11203   echo "configure: failed program was:" >&5
11204   cat conftest.$ac_ext >&5
11205   rm -rf conftest*
11206   eval "ac_cv_func_$ac_func=no"
11207 fi
11208 rm -f conftest*
11209 fi
11210
11211 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11212   echo "$ac_t""yes" 1>&6
11213     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11214   cat >> confdefs.h <<EOF
11215 #define $ac_tr_func 1
11216 EOF
11217  
11218 else
11219   echo "$ac_t""no" 1>&6
11220 fi
11221 done
11222
11223         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
11224 echo "configure:11225: checking for LinuxThreads implementation" >&5
11225 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
11226   echo $ac_n "(cached) $ac_c" 1>&6
11227 else
11228   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
11229 fi
11230
11231 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
11232
11233                         
11234         
11235         
11236         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
11237 echo "configure:11238: checking for LinuxThreads consistency" >&5
11238 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
11239   echo $ac_n "(cached) $ac_c" 1>&6
11240 else
11241   
11242                 if test $ol_cv_header_linux_threads = yes -a \
11243                         $ol_cv_sys_linux_threads = yes; then
11244                         ol_cv_linux_threads=yes
11245                 elif test $ol_cv_header_linux_threads = no -a \
11246                         $ol_cv_sys_linux_threads = no; then
11247                         ol_cv_linux_threads=no
11248                 else
11249                         ol_cv_linux_threads=error
11250                 fi
11251         
11252 fi
11253
11254 echo "$ac_t""$ol_cv_linux_threads" 1>&6
11255
11256
11257                         if test $ol_cv_linux_threads = error; then
11258                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
11259                         fi
11260
11261                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
11262 echo "configure:11263: checking if pthread_create() works" >&5
11263 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
11264   echo $ac_n "(cached) $ac_c" 1>&6
11265 else
11266   
11267                         if test "$cross_compiling" = yes; then
11268                                 ol_cv_pthread_create_works=yes
11269 else
11270   cat > conftest.$ac_ext <<EOF
11271 #line 11272 "configure"
11272 #include "confdefs.h"
11273 /* pthread test headers */
11274 #include <pthread.h>
11275 #ifndef NULL
11276 #define NULL (void*)0
11277 #endif
11278
11279 static void *task(p)
11280         void *p;
11281 {
11282         return (void *) (p == NULL);
11283 }
11284
11285
11286 int main(argc, argv)
11287         int argc;
11288         char **argv;
11289 {
11290
11291         /* pthread test function */
11292         pthread_t t;
11293         int status;
11294         int detach = 1;
11295
11296 #ifdef HAVE_PTHREADS_FINAL
11297         /* Final pthreads */
11298         pthread_attr_t attr;
11299
11300         status = pthread_attr_init(&attr);
11301         if( status ) return status;
11302
11303 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11304         if( !detach ) {
11305 #if defined( PTHREAD_CREATE_JOINABLE )
11306                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11307 #else
11308                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11309 #endif
11310
11311 #ifdef PTHREAD_CREATE_DETACHED
11312         } else {
11313                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11314 #endif
11315         }
11316         if( status ) return status;
11317 #endif
11318
11319         status = pthread_create( &t, &attr, task, NULL );
11320         if( status ) return status;
11321
11322 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11323         if( detach ) {
11324                 /* give thread a chance to complete */
11325                 /* it should remain joinable and hence detachable */
11326                 sleep( 1 );
11327
11328                 status = pthread_detach( t );
11329                 if( status ) return status;
11330         }
11331 #endif
11332
11333 #else
11334         /* Draft 4 pthreads */
11335         status = pthread_create( &t, pthread_attr_default, task, NULL );
11336         if( status ) return status;
11337
11338         if( detach ) {
11339                 /* give thread a chance to complete */
11340                 /* it should remain joinable and hence detachable */
11341                 sleep( 1 );
11342
11343                 status = pthread_detach( &t );
11344                 if( status ) return status;
11345         }
11346 #endif
11347
11348 #ifdef HAVE_LINUX_THREADS
11349         pthread_kill_other_threads_np();
11350 #endif
11351
11352         return 0;
11353
11354 }
11355
11356 EOF
11357 if { (eval echo configure:11358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11358 then
11359   ol_cv_pthread_create_works=yes
11360 else
11361   echo "configure: failed program was:" >&5
11362   cat conftest.$ac_ext >&5
11363   rm -fr conftest*
11364   ol_cv_pthread_create_works=no
11365 fi
11366 rm -fr conftest*
11367 fi
11368
11369 fi
11370
11371 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
11372
11373                         if test $ol_cv_pthread_create_works = no ; then
11374                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
11375                         fi
11376
11377                                                 if test $ol_with_yielding_select = auto ; then
11378                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
11379 echo "configure:11380: checking if select yields when using pthreads" >&5
11380 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
11381   echo $ac_n "(cached) $ac_c" 1>&6
11382 else
11383   
11384                                 if test "$cross_compiling" = yes; then
11385   ol_cv_pthread_select_yields=cross
11386 else
11387   cat > conftest.$ac_ext <<EOF
11388 #line 11389 "configure"
11389 #include "confdefs.h"
11390
11391 #include <sys/types.h>
11392 #include <sys/time.h>
11393 #include <unistd.h>
11394 #include <pthread.h>
11395 #ifndef NULL
11396 #define NULL (void*) 0
11397 #endif
11398
11399 static int fildes[2];
11400
11401 static void *task(p)
11402         void *p;
11403 {
11404         int i;
11405         struct timeval tv;
11406
11407         fd_set rfds;
11408
11409         tv.tv_sec=10;
11410         tv.tv_usec=0;
11411
11412         FD_ZERO(&rfds);
11413         FD_SET(fildes[0], &rfds);
11414
11415         /* we're not interested in any fds */
11416         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
11417
11418         if(i < 0) {
11419                 perror("select");
11420                 exit(10);
11421         }
11422
11423         exit(0); /* if we exit here, the select blocked the whole process */
11424 }
11425
11426 int main(argc, argv)
11427         int argc;
11428         char **argv;
11429 {
11430         pthread_t t;
11431
11432         /* create a pipe to select */
11433         if(pipe(&fildes[0])) {
11434                 perror("select");
11435                 exit(1);
11436         }
11437
11438 #ifdef HAVE_PTHREAD_SETCONCURRENCY
11439         (void) pthread_setconcurrency(2);
11440 #else
11441 #ifdef HAVE_THR_SETCONCURRENCY
11442         /* Set Solaris LWP concurrency to 2 */
11443         thr_setconcurrency(2);
11444 #endif
11445 #endif
11446
11447 #if HAVE_PTHREADS_D4
11448         pthread_create(&t, pthread_attr_default, task, NULL);
11449 #else
11450         pthread_create(&t, NULL, task, NULL);
11451 #endif
11452
11453 #if HAVE_SCHED_YIELD
11454         sched_yield();  /* make sure task runs first */
11455 #else
11456 #ifdef HAVE_PTHREAD_YIELD
11457         pthread_yield();        /* make sure task runs first */
11458 #endif
11459 #endif
11460
11461         exit(2);
11462 }
11463 EOF
11464 if { (eval echo configure:11465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11465 then
11466   ol_cv_pthread_select_yields=no
11467 else
11468   echo "configure: failed program was:" >&5
11469   cat conftest.$ac_ext >&5
11470   rm -fr conftest*
11471   ol_cv_pthread_select_yields=yes
11472 fi
11473 rm -fr conftest*
11474 fi
11475
11476 fi
11477
11478 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
11479
11480                                 if test $ol_cv_pthread_select_yields = cross ; then
11481                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
11482                                 fi
11483
11484                                 if test $ol_cv_pthread_select_yields = yes ; then
11485                                         ol_with_yielding_select=yes
11486                                 fi
11487                         fi
11488
11489                                                 CPPFLAGS="$save_CPPFLAGS"
11490                         LIBS="$save_LIBS"
11491                 else
11492                         { echo "configure: error: could not locate usable POSIX Threads" 1>&2; exit 1; }
11493                 fi
11494         fi
11495
11496         if test $ol_with_threads = posix ; then
11497                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
11498         fi
11499 fi
11500
11501 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11502         -o $ol_with_threads = mach ; then
11503
11504                 for ac_hdr in mach/cthreads.h cthread.h
11505 do
11506 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11507 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11508 echo "configure:11509: checking for $ac_hdr" >&5
11509 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11510   echo $ac_n "(cached) $ac_c" 1>&6
11511 else
11512   cat > conftest.$ac_ext <<EOF
11513 #line 11514 "configure"
11514 #include "confdefs.h"
11515 #include <$ac_hdr>
11516 EOF
11517 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11518 { (eval echo configure:11519: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11519 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11520 if test -z "$ac_err"; then
11521   rm -rf conftest*
11522   eval "ac_cv_header_$ac_safe=yes"
11523 else
11524   echo "$ac_err" >&5
11525   echo "configure: failed program was:" >&5
11526   cat conftest.$ac_ext >&5
11527   rm -rf conftest*
11528   eval "ac_cv_header_$ac_safe=no"
11529 fi
11530 rm -f conftest*
11531 fi
11532 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11533   echo "$ac_t""yes" 1>&6
11534     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11535   cat >> confdefs.h <<EOF
11536 #define $ac_tr_hdr 1
11537 EOF
11538  
11539 else
11540   echo "$ac_t""no" 1>&6
11541 fi
11542 done
11543
11544         if test $ac_cv_header_mach_cthreads_h = yes ; then
11545                 ol_with_threads=found
11546
11547                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
11548 echo "configure:11549: checking for cthread_fork" >&5
11549 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
11550   echo $ac_n "(cached) $ac_c" 1>&6
11551 else
11552   cat > conftest.$ac_ext <<EOF
11553 #line 11554 "configure"
11554 #include "confdefs.h"
11555 /* System header to define __stub macros and hopefully few prototypes,
11556     which can conflict with char cthread_fork(); below.  */
11557 #include <assert.h>
11558 /* Override any gcc2 internal prototype to avoid an error.  */
11559 /* We use char because int might match the return type of a gcc2
11560     builtin and then its argument prototype would still apply.  */
11561 char cthread_fork();
11562 char (*f)();
11563
11564 int main() {
11565
11566 /* The GNU C library defines this for functions which it implements
11567     to always fail with ENOSYS.  Some functions are actually named
11568     something starting with __ and the normal name is an alias.  */
11569 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
11570 choke me
11571 #else
11572 f = cthread_fork;
11573 #endif
11574
11575 ; return 0; }
11576 EOF
11577 if { (eval echo configure:11578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11578   rm -rf conftest*
11579   eval "ac_cv_func_cthread_fork=yes"
11580 else
11581   echo "configure: failed program was:" >&5
11582   cat conftest.$ac_ext >&5
11583   rm -rf conftest*
11584   eval "ac_cv_func_cthread_fork=no"
11585 fi
11586 rm -f conftest*
11587 fi
11588
11589 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
11590   echo "$ac_t""yes" 1>&6
11591   ol_link_threads=yes
11592 else
11593   echo "$ac_t""no" 1>&6
11594 fi
11595
11596
11597                 if test $ol_link_threads = no ; then
11598                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
11599 echo "configure:11600: checking for cthread_fork with -all_load" >&5
11600 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
11601   echo $ac_n "(cached) $ac_c" 1>&6
11602 else
11603   
11604                                                                 save_LIBS="$LIBS"
11605                                 LIBS="-all_load $LIBS"
11606                                 cat > conftest.$ac_ext <<EOF
11607 #line 11608 "configure"
11608 #include "confdefs.h"
11609 #include <mach/cthreads.h>
11610 int main() {
11611
11612                                         cthread_fork((void *)0, (void *)0);
11613                                         
11614 ; return 0; }
11615 EOF
11616 if { (eval echo configure:11617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11617   rm -rf conftest*
11618   ol_cv_cthread_all_load=yes
11619 else
11620   echo "configure: failed program was:" >&5
11621   cat conftest.$ac_ext >&5
11622   rm -rf conftest*
11623   ol_cv_cthread_all_load=no
11624 fi
11625 rm -f conftest*
11626                                                                 LIBS="$save_LIBS"
11627                         
11628 fi
11629
11630 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
11631
11632                         if test $ol_cv_cthread_all_load = yes ; then
11633                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
11634                                 ol_link_threads=mach
11635                         fi
11636                 fi
11637
11638     elif test $ac_cv_header_cthreads_h = yes ; then
11639                                 
11640                 ol_with_threads=found
11641  
11642                                 save_LIBS="$LIBS"
11643                 LIBS="$LIBS -lthreads"
11644                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
11645 echo "configure:11646: checking for cthread_fork" >&5
11646 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
11647   echo $ac_n "(cached) $ac_c" 1>&6
11648 else
11649   cat > conftest.$ac_ext <<EOF
11650 #line 11651 "configure"
11651 #include "confdefs.h"
11652 /* System header to define __stub macros and hopefully few prototypes,
11653     which can conflict with char cthread_fork(); below.  */
11654 #include <assert.h>
11655 /* Override any gcc2 internal prototype to avoid an error.  */
11656 /* We use char because int might match the return type of a gcc2
11657     builtin and then its argument prototype would still apply.  */
11658 char cthread_fork();
11659 char (*f)();
11660
11661 int main() {
11662
11663 /* The GNU C library defines this for functions which it implements
11664     to always fail with ENOSYS.  Some functions are actually named
11665     something starting with __ and the normal name is an alias.  */
11666 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
11667 choke me
11668 #else
11669 f = cthread_fork;
11670 #endif
11671
11672 ; return 0; }
11673 EOF
11674 if { (eval echo configure:11675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11675   rm -rf conftest*
11676   eval "ac_cv_func_cthread_fork=yes"
11677 else
11678   echo "configure: failed program was:" >&5
11679   cat conftest.$ac_ext >&5
11680   rm -rf conftest*
11681   eval "ac_cv_func_cthread_fork=no"
11682 fi
11683 rm -f conftest*
11684 fi
11685
11686 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
11687   echo "$ac_t""yes" 1>&6
11688   ol_link_threads=yes
11689 else
11690   echo "$ac_t""no" 1>&6
11691 fi
11692
11693                 LIBS="$save_LIBS"
11694
11695                 if test $ol_link_threads = yes ; then
11696                         LTHREAD_LIBS="-lthreads"
11697                         ol_link_threads=mach
11698                 else
11699                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
11700                 fi
11701
11702         elif test $ol_with_threads = mach ; then
11703                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
11704         fi
11705
11706         if test $ol_link_threads = mach ; then
11707                 cat >> confdefs.h <<\EOF
11708 #define HAVE_MACH_CTHREADS 1
11709 EOF
11710
11711         elif test $ol_with_threads = found ; then
11712                 { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
11713         fi
11714 fi
11715
11716 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11717         -o $ol_with_threads = pth ; then
11718
11719         for ac_hdr in pth.h
11720 do
11721 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11722 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11723 echo "configure:11724: checking for $ac_hdr" >&5
11724 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11725   echo $ac_n "(cached) $ac_c" 1>&6
11726 else
11727   cat > conftest.$ac_ext <<EOF
11728 #line 11729 "configure"
11729 #include "confdefs.h"
11730 #include <$ac_hdr>
11731 EOF
11732 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11733 { (eval echo configure:11734: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11734 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11735 if test -z "$ac_err"; then
11736   rm -rf conftest*
11737   eval "ac_cv_header_$ac_safe=yes"
11738 else
11739   echo "$ac_err" >&5
11740   echo "configure: failed program was:" >&5
11741   cat conftest.$ac_ext >&5
11742   rm -rf conftest*
11743   eval "ac_cv_header_$ac_safe=no"
11744 fi
11745 rm -f conftest*
11746 fi
11747 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11748   echo "$ac_t""yes" 1>&6
11749     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11750   cat >> confdefs.h <<EOF
11751 #define $ac_tr_hdr 1
11752 EOF
11753  
11754 else
11755   echo "$ac_t""no" 1>&6
11756 fi
11757 done
11758
11759
11760         if test $ac_cv_header_pth_h = yes ; then
11761                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
11762 echo "configure:11763: checking for pth_version in -lpth" >&5
11763 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
11764 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11765   echo $ac_n "(cached) $ac_c" 1>&6
11766 else
11767   ac_save_LIBS="$LIBS"
11768 LIBS="-lpth  $LIBS"
11769 cat > conftest.$ac_ext <<EOF
11770 #line 11771 "configure"
11771 #include "confdefs.h"
11772 /* Override any gcc2 internal prototype to avoid an error.  */
11773 /* We use char because int might match the return type of a gcc2
11774     builtin and then its argument prototype would still apply.  */
11775 char pth_version();
11776
11777 int main() {
11778 pth_version()
11779 ; return 0; }
11780 EOF
11781 if { (eval echo configure:11782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11782   rm -rf conftest*
11783   eval "ac_cv_lib_$ac_lib_var=yes"
11784 else
11785   echo "configure: failed program was:" >&5
11786   cat conftest.$ac_ext >&5
11787   rm -rf conftest*
11788   eval "ac_cv_lib_$ac_lib_var=no"
11789 fi
11790 rm -f conftest*
11791 LIBS="$ac_save_LIBS"
11792
11793 fi
11794 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11795   echo "$ac_t""yes" 1>&6
11796   have_pth=yes
11797 else
11798   echo "$ac_t""no" 1>&6
11799 have_pth=no
11800 fi
11801
11802
11803                 if test $have_pth = yes ; then
11804                         cat >> confdefs.h <<\EOF
11805 #define HAVE_GNU_PTH 1
11806 EOF
11807
11808                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
11809                         ol_link_threads=pth
11810
11811                         if test $ol_with_yielding_select = auto ; then
11812                                 ol_with_yielding_select=yes
11813                         fi
11814                 fi
11815         fi
11816 fi
11817
11818 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11819         -o $ol_with_threads = lwp ; then
11820
11821                 for ac_hdr in thread.h synch.h
11822 do
11823 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11824 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11825 echo "configure:11826: checking for $ac_hdr" >&5
11826 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11827   echo $ac_n "(cached) $ac_c" 1>&6
11828 else
11829   cat > conftest.$ac_ext <<EOF
11830 #line 11831 "configure"
11831 #include "confdefs.h"
11832 #include <$ac_hdr>
11833 EOF
11834 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11835 { (eval echo configure:11836: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11836 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11837 if test -z "$ac_err"; then
11838   rm -rf conftest*
11839   eval "ac_cv_header_$ac_safe=yes"
11840 else
11841   echo "$ac_err" >&5
11842   echo "configure: failed program was:" >&5
11843   cat conftest.$ac_ext >&5
11844   rm -rf conftest*
11845   eval "ac_cv_header_$ac_safe=no"
11846 fi
11847 rm -f conftest*
11848 fi
11849 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11850   echo "$ac_t""yes" 1>&6
11851     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11852   cat >> confdefs.h <<EOF
11853 #define $ac_tr_hdr 1
11854 EOF
11855  
11856 else
11857   echo "$ac_t""no" 1>&6
11858 fi
11859 done
11860
11861         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
11862                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
11863 echo "configure:11864: checking for thr_create in -lthread" >&5
11864 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
11865 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11866   echo $ac_n "(cached) $ac_c" 1>&6
11867 else
11868   ac_save_LIBS="$LIBS"
11869 LIBS="-lthread  $LIBS"
11870 cat > conftest.$ac_ext <<EOF
11871 #line 11872 "configure"
11872 #include "confdefs.h"
11873 /* Override any gcc2 internal prototype to avoid an error.  */
11874 /* We use char because int might match the return type of a gcc2
11875     builtin and then its argument prototype would still apply.  */
11876 char thr_create();
11877
11878 int main() {
11879 thr_create()
11880 ; return 0; }
11881 EOF
11882 if { (eval echo configure:11883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11883   rm -rf conftest*
11884   eval "ac_cv_lib_$ac_lib_var=yes"
11885 else
11886   echo "configure: failed program was:" >&5
11887   cat conftest.$ac_ext >&5
11888   rm -rf conftest*
11889   eval "ac_cv_lib_$ac_lib_var=no"
11890 fi
11891 rm -f conftest*
11892 LIBS="$ac_save_LIBS"
11893
11894 fi
11895 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11896   echo "$ac_t""yes" 1>&6
11897   have_thr=yes
11898 else
11899   echo "$ac_t""no" 1>&6
11900 have_thr=no
11901 fi
11902
11903
11904                 if test $have_thr = yes ; then
11905                         cat >> confdefs.h <<\EOF
11906 #define HAVE_THR 1
11907 EOF
11908
11909                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
11910                         ol_link_threads=thr
11911
11912                         if test $ol_with_yielding_select = auto ; then
11913                                 ol_with_yielding_select=yes
11914                         fi
11915
11916                                                 for ac_func in \
11917                                 thr_setconcurrency \
11918                                 thr_getconcurrency \
11919                         
11920 do
11921 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11922 echo "configure:11923: checking for $ac_func" >&5
11923 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11924   echo $ac_n "(cached) $ac_c" 1>&6
11925 else
11926   cat > conftest.$ac_ext <<EOF
11927 #line 11928 "configure"
11928 #include "confdefs.h"
11929 /* System header to define __stub macros and hopefully few prototypes,
11930     which can conflict with char $ac_func(); below.  */
11931 #include <assert.h>
11932 /* Override any gcc2 internal prototype to avoid an error.  */
11933 /* We use char because int might match the return type of a gcc2
11934     builtin and then its argument prototype would still apply.  */
11935 char $ac_func();
11936 char (*f)();
11937
11938 int main() {
11939
11940 /* The GNU C library defines this for functions which it implements
11941     to always fail with ENOSYS.  Some functions are actually named
11942     something starting with __ and the normal name is an alias.  */
11943 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11944 choke me
11945 #else
11946 f = $ac_func;
11947 #endif
11948
11949 ; return 0; }
11950 EOF
11951 if { (eval echo configure:11952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11952   rm -rf conftest*
11953   eval "ac_cv_func_$ac_func=yes"
11954 else
11955   echo "configure: failed program was:" >&5
11956   cat conftest.$ac_ext >&5
11957   rm -rf conftest*
11958   eval "ac_cv_func_$ac_func=no"
11959 fi
11960 rm -f conftest*
11961 fi
11962
11963 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11964   echo "$ac_t""yes" 1>&6
11965     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11966   cat >> confdefs.h <<EOF
11967 #define $ac_tr_func 1
11968 EOF
11969  
11970 else
11971   echo "$ac_t""no" 1>&6
11972 fi
11973 done
11974
11975                 fi
11976         fi
11977
11978                 for ac_hdr in lwp/lwp.h
11979 do
11980 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11981 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11982 echo "configure:11983: checking for $ac_hdr" >&5
11983 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11984   echo $ac_n "(cached) $ac_c" 1>&6
11985 else
11986   cat > conftest.$ac_ext <<EOF
11987 #line 11988 "configure"
11988 #include "confdefs.h"
11989 #include <$ac_hdr>
11990 EOF
11991 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11992 { (eval echo configure:11993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11993 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11994 if test -z "$ac_err"; then
11995   rm -rf conftest*
11996   eval "ac_cv_header_$ac_safe=yes"
11997 else
11998   echo "$ac_err" >&5
11999   echo "configure: failed program was:" >&5
12000   cat conftest.$ac_ext >&5
12001   rm -rf conftest*
12002   eval "ac_cv_header_$ac_safe=no"
12003 fi
12004 rm -f conftest*
12005 fi
12006 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12007   echo "$ac_t""yes" 1>&6
12008     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12009   cat >> confdefs.h <<EOF
12010 #define $ac_tr_hdr 1
12011 EOF
12012  
12013 else
12014   echo "$ac_t""no" 1>&6
12015 fi
12016 done
12017
12018         if test $ac_cv_header_lwp_lwp_h = yes ; then
12019                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
12020 echo "configure:12021: checking for lwp_create in -llwp" >&5
12021 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
12022 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12023   echo $ac_n "(cached) $ac_c" 1>&6
12024 else
12025   ac_save_LIBS="$LIBS"
12026 LIBS="-llwp  $LIBS"
12027 cat > conftest.$ac_ext <<EOF
12028 #line 12029 "configure"
12029 #include "confdefs.h"
12030 /* Override any gcc2 internal prototype to avoid an error.  */
12031 /* We use char because int might match the return type of a gcc2
12032     builtin and then its argument prototype would still apply.  */
12033 char lwp_create();
12034
12035 int main() {
12036 lwp_create()
12037 ; return 0; }
12038 EOF
12039 if { (eval echo configure:12040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12040   rm -rf conftest*
12041   eval "ac_cv_lib_$ac_lib_var=yes"
12042 else
12043   echo "configure: failed program was:" >&5
12044   cat conftest.$ac_ext >&5
12045   rm -rf conftest*
12046   eval "ac_cv_lib_$ac_lib_var=no"
12047 fi
12048 rm -f conftest*
12049 LIBS="$ac_save_LIBS"
12050
12051 fi
12052 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12053   echo "$ac_t""yes" 1>&6
12054   have_lwp=yes
12055 else
12056   echo "$ac_t""no" 1>&6
12057 have_lwp=no
12058 fi
12059
12060
12061                 if test $have_lwp = yes ; then
12062                         cat >> confdefs.h <<\EOF
12063 #define HAVE_LWP 1
12064 EOF
12065
12066                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
12067                         ol_link_threads=lwp
12068
12069                         if test $ol_with_yielding_select = auto ; then
12070                                 ol_with_yielding_select=no
12071                         fi
12072                 fi
12073         fi
12074 fi
12075
12076 if test $ol_with_yielding_select = yes ; then
12077         cat >> confdefs.h <<\EOF
12078 #define HAVE_YIELDING_SELECT 1
12079 EOF
12080
12081 fi
12082
12083 if test $ol_with_threads = manual ; then
12084                 ol_link_threads=yes
12085
12086         echo "configure: warning: thread defines and link options must be set manually" 1>&2
12087
12088         for ac_hdr in pthread.h sched.h
12089 do
12090 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12091 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12092 echo "configure:12093: checking for $ac_hdr" >&5
12093 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12094   echo $ac_n "(cached) $ac_c" 1>&6
12095 else
12096   cat > conftest.$ac_ext <<EOF
12097 #line 12098 "configure"
12098 #include "confdefs.h"
12099 #include <$ac_hdr>
12100 EOF
12101 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12102 { (eval echo configure:12103: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12103 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12104 if test -z "$ac_err"; then
12105   rm -rf conftest*
12106   eval "ac_cv_header_$ac_safe=yes"
12107 else
12108   echo "$ac_err" >&5
12109   echo "configure: failed program was:" >&5
12110   cat conftest.$ac_ext >&5
12111   rm -rf conftest*
12112   eval "ac_cv_header_$ac_safe=no"
12113 fi
12114 rm -f conftest*
12115 fi
12116 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12117   echo "$ac_t""yes" 1>&6
12118     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12119   cat >> confdefs.h <<EOF
12120 #define $ac_tr_hdr 1
12121 EOF
12122  
12123 else
12124   echo "$ac_t""no" 1>&6
12125 fi
12126 done
12127
12128         for ac_func in sched_yield pthread_yield
12129 do
12130 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12131 echo "configure:12132: checking for $ac_func" >&5
12132 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12133   echo $ac_n "(cached) $ac_c" 1>&6
12134 else
12135   cat > conftest.$ac_ext <<EOF
12136 #line 12137 "configure"
12137 #include "confdefs.h"
12138 /* System header to define __stub macros and hopefully few prototypes,
12139     which can conflict with char $ac_func(); below.  */
12140 #include <assert.h>
12141 /* Override any gcc2 internal prototype to avoid an error.  */
12142 /* We use char because int might match the return type of a gcc2
12143     builtin and then its argument prototype would still apply.  */
12144 char $ac_func();
12145 char (*f)();
12146
12147 int main() {
12148
12149 /* The GNU C library defines this for functions which it implements
12150     to always fail with ENOSYS.  Some functions are actually named
12151     something starting with __ and the normal name is an alias.  */
12152 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12153 choke me
12154 #else
12155 f = $ac_func;
12156 #endif
12157
12158 ; return 0; }
12159 EOF
12160 if { (eval echo configure:12161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12161   rm -rf conftest*
12162   eval "ac_cv_func_$ac_func=yes"
12163 else
12164   echo "configure: failed program was:" >&5
12165   cat conftest.$ac_ext >&5
12166   rm -rf conftest*
12167   eval "ac_cv_func_$ac_func=no"
12168 fi
12169 rm -f conftest*
12170 fi
12171
12172 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12173   echo "$ac_t""yes" 1>&6
12174     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12175   cat >> confdefs.h <<EOF
12176 #define $ac_tr_func 1
12177 EOF
12178  
12179 else
12180   echo "$ac_t""no" 1>&6
12181 fi
12182 done
12183
12184         
12185         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
12186 echo "configure:12187: checking for LinuxThreads pthread.h" >&5
12187 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
12188   echo $ac_n "(cached) $ac_c" 1>&6
12189 else
12190   cat > conftest.$ac_ext <<EOF
12191 #line 12192 "configure"
12192 #include "confdefs.h"
12193 #include <pthread.h>
12194 EOF
12195 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12196   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
12197   rm -rf conftest*
12198   ol_cv_header_linux_threads=yes
12199 else
12200   rm -rf conftest*
12201   ol_cv_header_linux_threads=no
12202 fi
12203 rm -f conftest*
12204
12205                 
12206 fi
12207
12208 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
12209         if test $ol_cv_header_linux_threads = yes; then
12210                 cat >> confdefs.h <<\EOF
12211 #define HAVE_LINUX_THREADS 1
12212 EOF
12213
12214         fi
12215
12216
12217         for ac_hdr in mach/cthreads.h
12218 do
12219 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12220 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12221 echo "configure:12222: checking for $ac_hdr" >&5
12222 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12223   echo $ac_n "(cached) $ac_c" 1>&6
12224 else
12225   cat > conftest.$ac_ext <<EOF
12226 #line 12227 "configure"
12227 #include "confdefs.h"
12228 #include <$ac_hdr>
12229 EOF
12230 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12231 { (eval echo configure:12232: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12232 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12233 if test -z "$ac_err"; then
12234   rm -rf conftest*
12235   eval "ac_cv_header_$ac_safe=yes"
12236 else
12237   echo "$ac_err" >&5
12238   echo "configure: failed program was:" >&5
12239   cat conftest.$ac_ext >&5
12240   rm -rf conftest*
12241   eval "ac_cv_header_$ac_safe=no"
12242 fi
12243 rm -f conftest*
12244 fi
12245 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12246   echo "$ac_t""yes" 1>&6
12247     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12248   cat >> confdefs.h <<EOF
12249 #define $ac_tr_hdr 1
12250 EOF
12251  
12252 else
12253   echo "$ac_t""no" 1>&6
12254 fi
12255 done
12256
12257         for ac_hdr in lwp/lwp.h
12258 do
12259 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12260 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12261 echo "configure:12262: checking for $ac_hdr" >&5
12262 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12263   echo $ac_n "(cached) $ac_c" 1>&6
12264 else
12265   cat > conftest.$ac_ext <<EOF
12266 #line 12267 "configure"
12267 #include "confdefs.h"
12268 #include <$ac_hdr>
12269 EOF
12270 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12271 { (eval echo configure:12272: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12272 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12273 if test -z "$ac_err"; then
12274   rm -rf conftest*
12275   eval "ac_cv_header_$ac_safe=yes"
12276 else
12277   echo "$ac_err" >&5
12278   echo "configure: failed program was:" >&5
12279   cat conftest.$ac_ext >&5
12280   rm -rf conftest*
12281   eval "ac_cv_header_$ac_safe=no"
12282 fi
12283 rm -f conftest*
12284 fi
12285 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12286   echo "$ac_t""yes" 1>&6
12287     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12288   cat >> confdefs.h <<EOF
12289 #define $ac_tr_hdr 1
12290 EOF
12291  
12292 else
12293   echo "$ac_t""no" 1>&6
12294 fi
12295 done
12296
12297         for ac_hdr in thread.h synch.h
12298 do
12299 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12300 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12301 echo "configure:12302: checking for $ac_hdr" >&5
12302 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12303   echo $ac_n "(cached) $ac_c" 1>&6
12304 else
12305   cat > conftest.$ac_ext <<EOF
12306 #line 12307 "configure"
12307 #include "confdefs.h"
12308 #include <$ac_hdr>
12309 EOF
12310 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12311 { (eval echo configure:12312: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12312 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12313 if test -z "$ac_err"; then
12314   rm -rf conftest*
12315   eval "ac_cv_header_$ac_safe=yes"
12316 else
12317   echo "$ac_err" >&5
12318   echo "configure: failed program was:" >&5
12319   cat conftest.$ac_ext >&5
12320   rm -rf conftest*
12321   eval "ac_cv_header_$ac_safe=no"
12322 fi
12323 rm -f conftest*
12324 fi
12325 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12326   echo "$ac_t""yes" 1>&6
12327     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12328   cat >> confdefs.h <<EOF
12329 #define $ac_tr_hdr 1
12330 EOF
12331  
12332 else
12333   echo "$ac_t""no" 1>&6
12334 fi
12335 done
12336
12337 fi
12338
12339 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
12340                         cat >> confdefs.h <<\EOF
12341 #define REENTRANT 1
12342 EOF
12343
12344         cat >> confdefs.h <<\EOF
12345 #define _REENTRANT 1
12346 EOF
12347
12348         cat >> confdefs.h <<\EOF
12349 #define THREAD_SAFE 1
12350 EOF
12351
12352         cat >> confdefs.h <<\EOF
12353 #define _THREAD_SAFE 1
12354 EOF
12355
12356         cat >> confdefs.h <<\EOF
12357 #define THREADSAFE 1
12358 EOF
12359
12360         cat >> confdefs.h <<\EOF
12361 #define _THREADSAFE 1
12362 EOF
12363
12364         cat >> confdefs.h <<\EOF
12365 #define _SGI_MP_SOURCE 1
12366 EOF
12367
12368
12369                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
12370 echo "configure:12371: checking for thread specific errno" >&5
12371 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
12372   echo $ac_n "(cached) $ac_c" 1>&6
12373 else
12374   
12375                 cat > conftest.$ac_ext <<EOF
12376 #line 12377 "configure"
12377 #include "confdefs.h"
12378 #include <errno.h>
12379 int main() {
12380 errno = 0;
12381 ; return 0; }
12382 EOF
12383 if { (eval echo configure:12384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12384   rm -rf conftest*
12385   ol_cv_errno_thread_specific=yes
12386 else
12387   echo "configure: failed program was:" >&5
12388   cat conftest.$ac_ext >&5
12389   rm -rf conftest*
12390   ol_cv_errno_thread_specific=no
12391 fi
12392 rm -f conftest*
12393         
12394 fi
12395
12396 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
12397
12398                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
12399 echo "configure:12400: checking for thread specific h_errno" >&5
12400 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
12401   echo $ac_n "(cached) $ac_c" 1>&6
12402 else
12403   
12404                 cat > conftest.$ac_ext <<EOF
12405 #line 12406 "configure"
12406 #include "confdefs.h"
12407 #include <netdb.h>
12408 int main() {
12409 h_errno = 0;
12410 ; return 0; }
12411 EOF
12412 if { (eval echo configure:12413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12413   rm -rf conftest*
12414   ol_cv_h_errno_thread_specific=yes
12415 else
12416   echo "configure: failed program was:" >&5
12417   cat conftest.$ac_ext >&5
12418   rm -rf conftest*
12419   ol_cv_h_errno_thread_specific=no
12420 fi
12421 rm -f conftest*
12422         
12423 fi
12424
12425 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
12426
12427         if test $ol_cv_errno_thread_specific != yes \
12428                 -o $ol_cv_h_errno_thread_specific != yes ; then
12429                 LIBS="$LTHREAD_LIBS $LIBS"
12430                 LTHREAD_LIBS=""
12431         fi
12432
12433 fi  
12434
12435 if test $ol_link_threads = no ; then
12436         if test $ol_with_threads = yes ; then
12437                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
12438         fi
12439
12440         if test $ol_with_threads = auto ; then
12441                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
12442                 ol_with_threads=no
12443         fi
12444
12445         cat >> confdefs.h <<\EOF
12446 #define NO_THREADS 1
12447 EOF
12448
12449         LTHREAD_LIBS=""
12450 fi
12451
12452 if test $ol_link_threads != no ; then
12453         cat >> confdefs.h <<\EOF
12454 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
12455 EOF
12456
12457 fi
12458
12459 ol_link_ldbm=no 
12460
12461 if test $ol_with_ldbm_api = auto \
12462         -o $ol_with_ldbm_api = berkeley \
12463         -o $ol_with_ldbm_api = bcompat ; then
12464
12465         if test $ol_with_ldbm_api = bcompat; then \
12466                 ol_cv_berkeley_db=no
12467 for ac_hdr in db_185.h db.h
12468 do
12469 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12470 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12471 echo "configure:12472: checking for $ac_hdr" >&5
12472 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12473   echo $ac_n "(cached) $ac_c" 1>&6
12474 else
12475   cat > conftest.$ac_ext <<EOF
12476 #line 12477 "configure"
12477 #include "confdefs.h"
12478 #include <$ac_hdr>
12479 EOF
12480 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12481 { (eval echo configure:12482: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12482 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12483 if test -z "$ac_err"; then
12484   rm -rf conftest*
12485   eval "ac_cv_header_$ac_safe=yes"
12486 else
12487   echo "$ac_err" >&5
12488   echo "configure: failed program was:" >&5
12489   cat conftest.$ac_ext >&5
12490   rm -rf conftest*
12491   eval "ac_cv_header_$ac_safe=no"
12492 fi
12493 rm -f conftest*
12494 fi
12495 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12496   echo "$ac_t""yes" 1>&6
12497     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12498   cat >> confdefs.h <<EOF
12499 #define $ac_tr_hdr 1
12500 EOF
12501  
12502 else
12503   echo "$ac_t""no" 1>&6
12504 fi
12505 done
12506
12507 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
12508         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
12509 echo "configure:12510: checking if Berkeley DB header compatibility" >&5
12510 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
12511   echo $ac_n "(cached) $ac_c" 1>&6
12512 else
12513   
12514                 cat > conftest.$ac_ext <<EOF
12515 #line 12516 "configure"
12516 #include "confdefs.h"
12517
12518 #if HAVE_DB_185_H
12519 #       include <db_185.h>
12520 #else
12521 #       include <db.h>
12522 #endif
12523
12524  /* this check could be improved */
12525 #ifndef DB_VERSION_MAJOR
12526 #       define DB_VERSION_MAJOR 1
12527 #endif
12528
12529 #if DB_VERSION_MAJOR == 1 
12530         __db_version_1
12531 #endif
12532
12533 EOF
12534 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12535   egrep "__db_version_1" >/dev/null 2>&1; then
12536   rm -rf conftest*
12537   ol_cv_header_db1=yes
12538 else
12539   rm -rf conftest*
12540   ol_cv_header_db1=no
12541 fi
12542 rm -f conftest*
12543
12544 fi
12545
12546 echo "$ac_t""$ol_cv_header_db1" 1>&6
12547
12548         if test $ol_cv_header_db1 = yes ; then
12549                 ol_cv_lib_db=no
12550 if test $ol_cv_lib_db = no ; then
12551         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
12552 echo "configure:12553: checking for Berkeley DB link (default)" >&5
12553 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
12554   echo $ac_n "(cached) $ac_c" 1>&6
12555 else
12556   
12557         ol_DB_LIB=
12558         ol_LIBS=$LIBS
12559         LIBS="$ol_DB_LIB $LIBS"
12560
12561         cat > conftest.$ac_ext <<EOF
12562 #line 12563 "configure"
12563 #include "confdefs.h"
12564
12565 #ifdef HAVE_DB_185_H
12566 # include <db_185.h>
12567 #else
12568 # include <db.h>
12569 #endif
12570
12571 #ifndef DB_VERSION_MAJOR
12572 # define DB_VERSION_MAJOR 1
12573 #endif
12574
12575 #ifndef NULL
12576 #define NULL ((void*)0)
12577 #endif
12578
12579 int main() {
12580
12581 #if DB_VERSION_MAJOR > 1
12582         {
12583                 char *version;
12584                 int major, minor, patch;
12585
12586                 version = db_version( &major, &minor, &patch );
12587
12588                 if( major != DB_VERSION_MAJOR ||
12589                         minor < DB_VERSION_MINOR )
12590                 {
12591                         printf("Berkeley DB version mismatch\n"
12592                                 "\texpected: %s\n\tgot: %s\n",
12593                                 DB_VERSION_STRING, version);
12594                         return 1;
12595                 }
12596         }
12597 #endif
12598
12599 #if DB_VERSION_MAJOR > 2
12600         db_env_create( NULL, 0 );
12601 #elif DB_VERSION_MAJOR > 1
12602         db_appexit( NULL );
12603 #else
12604         (void) dbopen( NULL, 0, 0, 0, NULL);
12605 #endif
12606
12607 ; return 0; }
12608 EOF
12609 if { (eval echo configure:12610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12610   rm -rf conftest*
12611   ol_cv_db_none=yes
12612 else
12613   echo "configure: failed program was:" >&5
12614   cat conftest.$ac_ext >&5
12615   rm -rf conftest*
12616   ol_cv_db_none=no
12617 fi
12618 rm -f conftest*
12619
12620         LIBS="$ol_LIBS"
12621
12622 fi
12623
12624 echo "$ac_t""$ol_cv_db_none" 1>&6
12625
12626         if test $ol_cv_db_none = yes ; then
12627                 ol_cv_lib_db=yes
12628         fi
12629 fi
12630
12631 if test $ol_cv_lib_db = no ; then
12632         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
12633 echo "configure:12634: checking for Berkeley DB link (-ldb)" >&5
12634 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
12635   echo $ac_n "(cached) $ac_c" 1>&6
12636 else
12637   
12638         ol_DB_LIB=-ldb
12639         ol_LIBS=$LIBS
12640         LIBS="$ol_DB_LIB $LIBS"
12641
12642         cat > conftest.$ac_ext <<EOF
12643 #line 12644 "configure"
12644 #include "confdefs.h"
12645
12646 #ifdef HAVE_DB_185_H
12647 # include <db_185.h>
12648 #else
12649 # include <db.h>
12650 #endif
12651
12652 #ifndef DB_VERSION_MAJOR
12653 # define DB_VERSION_MAJOR 1
12654 #endif
12655
12656 #ifndef NULL
12657 #define NULL ((void*)0)
12658 #endif
12659
12660 int main() {
12661
12662 #if DB_VERSION_MAJOR > 1
12663         {
12664                 char *version;
12665                 int major, minor, patch;
12666
12667                 version = db_version( &major, &minor, &patch );
12668
12669                 if( major != DB_VERSION_MAJOR ||
12670                         minor < DB_VERSION_MINOR )
12671                 {
12672                         printf("Berkeley DB version mismatch\n"
12673                                 "\texpected: %s\n\tgot: %s\n",
12674                                 DB_VERSION_STRING, version);
12675                         return 1;
12676                 }
12677         }
12678 #endif
12679
12680 #if DB_VERSION_MAJOR > 2
12681         db_env_create( NULL, 0 );
12682 #elif DB_VERSION_MAJOR > 1
12683         db_appexit( NULL );
12684 #else
12685         (void) dbopen( NULL, 0, 0, 0, NULL);
12686 #endif
12687
12688 ; return 0; }
12689 EOF
12690 if { (eval echo configure:12691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12691   rm -rf conftest*
12692   ol_cv_db_db=yes
12693 else
12694   echo "configure: failed program was:" >&5
12695   cat conftest.$ac_ext >&5
12696   rm -rf conftest*
12697   ol_cv_db_db=no
12698 fi
12699 rm -f conftest*
12700
12701         LIBS="$ol_LIBS"
12702
12703 fi
12704
12705 echo "$ac_t""$ol_cv_db_db" 1>&6
12706
12707         if test $ol_cv_db_db = yes ; then
12708                 ol_cv_lib_db=-ldb
12709         fi
12710 fi
12711
12712 if test $ol_cv_lib_db = no ; then
12713         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
12714 echo "configure:12715: checking for Berkeley DB link (-ldb3)" >&5
12715 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
12716   echo $ac_n "(cached) $ac_c" 1>&6
12717 else
12718   
12719         ol_DB_LIB=-ldb3
12720         ol_LIBS=$LIBS
12721         LIBS="$ol_DB_LIB $LIBS"
12722
12723         cat > conftest.$ac_ext <<EOF
12724 #line 12725 "configure"
12725 #include "confdefs.h"
12726
12727 #ifdef HAVE_DB_185_H
12728 # include <db_185.h>
12729 #else
12730 # include <db.h>
12731 #endif
12732
12733 #ifndef DB_VERSION_MAJOR
12734 # define DB_VERSION_MAJOR 1
12735 #endif
12736
12737 #ifndef NULL
12738 #define NULL ((void*)0)
12739 #endif
12740
12741 int main() {
12742
12743 #if DB_VERSION_MAJOR > 1
12744         {
12745                 char *version;
12746                 int major, minor, patch;
12747
12748                 version = db_version( &major, &minor, &patch );
12749
12750                 if( major != DB_VERSION_MAJOR ||
12751                         minor < DB_VERSION_MINOR )
12752                 {
12753                         printf("Berkeley DB version mismatch\n"
12754                                 "\texpected: %s\n\tgot: %s\n",
12755                                 DB_VERSION_STRING, version);
12756                         return 1;
12757                 }
12758         }
12759 #endif
12760
12761 #if DB_VERSION_MAJOR > 2
12762         db_env_create( NULL, 0 );
12763 #elif DB_VERSION_MAJOR > 1
12764         db_appexit( NULL );
12765 #else
12766         (void) dbopen( NULL, 0, 0, 0, NULL);
12767 #endif
12768
12769 ; return 0; }
12770 EOF
12771 if { (eval echo configure:12772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12772   rm -rf conftest*
12773   ol_cv_db_db3=yes
12774 else
12775   echo "configure: failed program was:" >&5
12776   cat conftest.$ac_ext >&5
12777   rm -rf conftest*
12778   ol_cv_db_db3=no
12779 fi
12780 rm -f conftest*
12781
12782         LIBS="$ol_LIBS"
12783
12784 fi
12785
12786 echo "$ac_t""$ol_cv_db_db3" 1>&6
12787
12788         if test $ol_cv_db_db3 = yes ; then
12789                 ol_cv_lib_db=-ldb3
12790         fi
12791 fi
12792
12793 if test $ol_cv_lib_db = no ; then
12794         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
12795 echo "configure:12796: checking for Berkeley DB link (-ldb2)" >&5
12796 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
12797   echo $ac_n "(cached) $ac_c" 1>&6
12798 else
12799   
12800         ol_DB_LIB=-ldb2
12801         ol_LIBS=$LIBS
12802         LIBS="$ol_DB_LIB $LIBS"
12803
12804         cat > conftest.$ac_ext <<EOF
12805 #line 12806 "configure"
12806 #include "confdefs.h"
12807
12808 #ifdef HAVE_DB_185_H
12809 # include <db_185.h>
12810 #else
12811 # include <db.h>
12812 #endif
12813
12814 #ifndef DB_VERSION_MAJOR
12815 # define DB_VERSION_MAJOR 1
12816 #endif
12817
12818 #ifndef NULL
12819 #define NULL ((void*)0)
12820 #endif
12821
12822 int main() {
12823
12824 #if DB_VERSION_MAJOR > 1
12825         {
12826                 char *version;
12827                 int major, minor, patch;
12828
12829                 version = db_version( &major, &minor, &patch );
12830
12831                 if( major != DB_VERSION_MAJOR ||
12832                         minor < DB_VERSION_MINOR )
12833                 {
12834                         printf("Berkeley DB version mismatch\n"
12835                                 "\texpected: %s\n\tgot: %s\n",
12836                                 DB_VERSION_STRING, version);
12837                         return 1;
12838                 }
12839         }
12840 #endif
12841
12842 #if DB_VERSION_MAJOR > 2
12843         db_env_create( NULL, 0 );
12844 #elif DB_VERSION_MAJOR > 1
12845         db_appexit( NULL );
12846 #else
12847         (void) dbopen( NULL, 0, 0, 0, NULL);
12848 #endif
12849
12850 ; return 0; }
12851 EOF
12852 if { (eval echo configure:12853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12853   rm -rf conftest*
12854   ol_cv_db_db2=yes
12855 else
12856   echo "configure: failed program was:" >&5
12857   cat conftest.$ac_ext >&5
12858   rm -rf conftest*
12859   ol_cv_db_db2=no
12860 fi
12861 rm -f conftest*
12862
12863         LIBS="$ol_LIBS"
12864
12865 fi
12866
12867 echo "$ac_t""$ol_cv_db_db2" 1>&6
12868
12869         if test $ol_cv_db_db2 = yes ; then
12870                 ol_cv_lib_db=-ldb2
12871         fi
12872 fi
12873
12874 if test $ol_cv_lib_db = no ; then
12875         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
12876 echo "configure:12877: checking for Berkeley DB link (-ldb1)" >&5
12877 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
12878   echo $ac_n "(cached) $ac_c" 1>&6
12879 else
12880   
12881         ol_DB_LIB=-ldb1
12882         ol_LIBS=$LIBS
12883         LIBS="$ol_DB_LIB $LIBS"
12884
12885         cat > conftest.$ac_ext <<EOF
12886 #line 12887 "configure"
12887 #include "confdefs.h"
12888
12889 #ifdef HAVE_DB_185_H
12890 # include <db_185.h>
12891 #else
12892 # include <db.h>
12893 #endif
12894
12895 #ifndef DB_VERSION_MAJOR
12896 # define DB_VERSION_MAJOR 1
12897 #endif
12898
12899 #ifndef NULL
12900 #define NULL ((void*)0)
12901 #endif
12902
12903 int main() {
12904
12905 #if DB_VERSION_MAJOR > 1
12906         {
12907                 char *version;
12908                 int major, minor, patch;
12909
12910                 version = db_version( &major, &minor, &patch );
12911
12912                 if( major != DB_VERSION_MAJOR ||
12913                         minor < DB_VERSION_MINOR )
12914                 {
12915                         printf("Berkeley DB version mismatch\n"
12916                                 "\texpected: %s\n\tgot: %s\n",
12917                                 DB_VERSION_STRING, version);
12918                         return 1;
12919                 }
12920         }
12921 #endif
12922
12923 #if DB_VERSION_MAJOR > 2
12924         db_env_create( NULL, 0 );
12925 #elif DB_VERSION_MAJOR > 1
12926         db_appexit( NULL );
12927 #else
12928         (void) dbopen( NULL, 0, 0, 0, NULL);
12929 #endif
12930
12931 ; return 0; }
12932 EOF
12933 if { (eval echo configure:12934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12934   rm -rf conftest*
12935   ol_cv_db_db1=yes
12936 else
12937   echo "configure: failed program was:" >&5
12938   cat conftest.$ac_ext >&5
12939   rm -rf conftest*
12940   ol_cv_db_db1=no
12941 fi
12942 rm -f conftest*
12943
12944         LIBS="$ol_LIBS"
12945
12946 fi
12947
12948 echo "$ac_t""$ol_cv_db_db1" 1>&6
12949
12950         if test $ol_cv_db_db1 = yes ; then
12951                 ol_cv_lib_db=-ldb1
12952         fi
12953 fi
12954
12955
12956                 if test "$ol_cv_lib_db" != no ; then
12957                         ol_cv_berkeley_db=yes
12958                 fi
12959         fi
12960 fi
12961
12962         else
12963                 ol_cv_berkeley_db=no
12964 for ac_hdr in db.h
12965 do
12966 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12967 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12968 echo "configure:12969: checking for $ac_hdr" >&5
12969 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12970   echo $ac_n "(cached) $ac_c" 1>&6
12971 else
12972   cat > conftest.$ac_ext <<EOF
12973 #line 12974 "configure"
12974 #include "confdefs.h"
12975 #include <$ac_hdr>
12976 EOF
12977 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12978 { (eval echo configure:12979: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12979 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12980 if test -z "$ac_err"; then
12981   rm -rf conftest*
12982   eval "ac_cv_header_$ac_safe=yes"
12983 else
12984   echo "$ac_err" >&5
12985   echo "configure: failed program was:" >&5
12986   cat conftest.$ac_ext >&5
12987   rm -rf conftest*
12988   eval "ac_cv_header_$ac_safe=no"
12989 fi
12990 rm -f conftest*
12991 fi
12992 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12993   echo "$ac_t""yes" 1>&6
12994     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12995   cat >> confdefs.h <<EOF
12996 #define $ac_tr_hdr 1
12997 EOF
12998  
12999 else
13000   echo "$ac_t""no" 1>&6
13001 fi
13002 done
13003
13004 if test $ac_cv_header_db_h = yes; then
13005         ol_cv_lib_db=no
13006 if test $ol_cv_lib_db = no ; then
13007         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
13008 echo "configure:13009: checking for Berkeley DB link (default)" >&5
13009 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
13010   echo $ac_n "(cached) $ac_c" 1>&6
13011 else
13012   
13013         ol_DB_LIB=
13014         ol_LIBS=$LIBS
13015         LIBS="$ol_DB_LIB $LIBS"
13016
13017         cat > conftest.$ac_ext <<EOF
13018 #line 13019 "configure"
13019 #include "confdefs.h"
13020
13021 #ifdef HAVE_DB_185_H
13022 # include <db_185.h>
13023 #else
13024 # include <db.h>
13025 #endif
13026
13027 #ifndef DB_VERSION_MAJOR
13028 # define DB_VERSION_MAJOR 1
13029 #endif
13030
13031 #ifndef NULL
13032 #define NULL ((void*)0)
13033 #endif
13034
13035 int main() {
13036
13037 #if DB_VERSION_MAJOR > 1
13038         {
13039                 char *version;
13040                 int major, minor, patch;
13041
13042                 version = db_version( &major, &minor, &patch );
13043
13044                 if( major != DB_VERSION_MAJOR ||
13045                         minor < DB_VERSION_MINOR )
13046                 {
13047                         printf("Berkeley DB version mismatch\n"
13048                                 "\texpected: %s\n\tgot: %s\n",
13049                                 DB_VERSION_STRING, version);
13050                         return 1;
13051                 }
13052         }
13053 #endif
13054
13055 #if DB_VERSION_MAJOR > 2
13056         db_env_create( NULL, 0 );
13057 #elif DB_VERSION_MAJOR > 1
13058         db_appexit( NULL );
13059 #else
13060         (void) dbopen( NULL, 0, 0, 0, NULL);
13061 #endif
13062
13063 ; return 0; }
13064 EOF
13065 if { (eval echo configure:13066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13066   rm -rf conftest*
13067   ol_cv_db_none=yes
13068 else
13069   echo "configure: failed program was:" >&5
13070   cat conftest.$ac_ext >&5
13071   rm -rf conftest*
13072   ol_cv_db_none=no
13073 fi
13074 rm -f conftest*
13075
13076         LIBS="$ol_LIBS"
13077
13078 fi
13079
13080 echo "$ac_t""$ol_cv_db_none" 1>&6
13081
13082         if test $ol_cv_db_none = yes ; then
13083                 ol_cv_lib_db=yes
13084         fi
13085 fi
13086
13087 if test $ol_cv_lib_db = no ; then
13088         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
13089 echo "configure:13090: checking for Berkeley DB link (-ldb)" >&5
13090 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
13091   echo $ac_n "(cached) $ac_c" 1>&6
13092 else
13093   
13094         ol_DB_LIB=-ldb
13095         ol_LIBS=$LIBS
13096         LIBS="$ol_DB_LIB $LIBS"
13097
13098         cat > conftest.$ac_ext <<EOF
13099 #line 13100 "configure"
13100 #include "confdefs.h"
13101
13102 #ifdef HAVE_DB_185_H
13103 # include <db_185.h>
13104 #else
13105 # include <db.h>
13106 #endif
13107
13108 #ifndef DB_VERSION_MAJOR
13109 # define DB_VERSION_MAJOR 1
13110 #endif
13111
13112 #ifndef NULL
13113 #define NULL ((void*)0)
13114 #endif
13115
13116 int main() {
13117
13118 #if DB_VERSION_MAJOR > 1
13119         {
13120                 char *version;
13121                 int major, minor, patch;
13122
13123                 version = db_version( &major, &minor, &patch );
13124
13125                 if( major != DB_VERSION_MAJOR ||
13126                         minor < DB_VERSION_MINOR )
13127                 {
13128                         printf("Berkeley DB version mismatch\n"
13129                                 "\texpected: %s\n\tgot: %s\n",
13130                                 DB_VERSION_STRING, version);
13131                         return 1;
13132                 }
13133         }
13134 #endif
13135
13136 #if DB_VERSION_MAJOR > 2
13137         db_env_create( NULL, 0 );
13138 #elif DB_VERSION_MAJOR > 1
13139         db_appexit( NULL );
13140 #else
13141         (void) dbopen( NULL, 0, 0, 0, NULL);
13142 #endif
13143
13144 ; return 0; }
13145 EOF
13146 if { (eval echo configure:13147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13147   rm -rf conftest*
13148   ol_cv_db_db=yes
13149 else
13150   echo "configure: failed program was:" >&5
13151   cat conftest.$ac_ext >&5
13152   rm -rf conftest*
13153   ol_cv_db_db=no
13154 fi
13155 rm -f conftest*
13156
13157         LIBS="$ol_LIBS"
13158
13159 fi
13160
13161 echo "$ac_t""$ol_cv_db_db" 1>&6
13162
13163         if test $ol_cv_db_db = yes ; then
13164                 ol_cv_lib_db=-ldb
13165         fi
13166 fi
13167
13168 if test $ol_cv_lib_db = no ; then
13169         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
13170 echo "configure:13171: checking for Berkeley DB link (-ldb3)" >&5
13171 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
13172   echo $ac_n "(cached) $ac_c" 1>&6
13173 else
13174   
13175         ol_DB_LIB=-ldb3
13176         ol_LIBS=$LIBS
13177         LIBS="$ol_DB_LIB $LIBS"
13178
13179         cat > conftest.$ac_ext <<EOF
13180 #line 13181 "configure"
13181 #include "confdefs.h"
13182
13183 #ifdef HAVE_DB_185_H
13184 # include <db_185.h>
13185 #else
13186 # include <db.h>
13187 #endif
13188
13189 #ifndef DB_VERSION_MAJOR
13190 # define DB_VERSION_MAJOR 1
13191 #endif
13192
13193 #ifndef NULL
13194 #define NULL ((void*)0)
13195 #endif
13196
13197 int main() {
13198
13199 #if DB_VERSION_MAJOR > 1
13200         {
13201                 char *version;
13202                 int major, minor, patch;
13203
13204                 version = db_version( &major, &minor, &patch );
13205
13206                 if( major != DB_VERSION_MAJOR ||
13207                         minor < DB_VERSION_MINOR )
13208                 {
13209                         printf("Berkeley DB version mismatch\n"
13210                                 "\texpected: %s\n\tgot: %s\n",
13211                                 DB_VERSION_STRING, version);
13212                         return 1;
13213                 }
13214         }
13215 #endif
13216
13217 #if DB_VERSION_MAJOR > 2
13218         db_env_create( NULL, 0 );
13219 #elif DB_VERSION_MAJOR > 1
13220         db_appexit( NULL );
13221 #else
13222         (void) dbopen( NULL, 0, 0, 0, NULL);
13223 #endif
13224
13225 ; return 0; }
13226 EOF
13227 if { (eval echo configure:13228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13228   rm -rf conftest*
13229   ol_cv_db_db3=yes
13230 else
13231   echo "configure: failed program was:" >&5
13232   cat conftest.$ac_ext >&5
13233   rm -rf conftest*
13234   ol_cv_db_db3=no
13235 fi
13236 rm -f conftest*
13237
13238         LIBS="$ol_LIBS"
13239
13240 fi
13241
13242 echo "$ac_t""$ol_cv_db_db3" 1>&6
13243
13244         if test $ol_cv_db_db3 = yes ; then
13245                 ol_cv_lib_db=-ldb3
13246         fi
13247 fi
13248
13249 if test $ol_cv_lib_db = no ; then
13250         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
13251 echo "configure:13252: checking for Berkeley DB link (-ldb2)" >&5
13252 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
13253   echo $ac_n "(cached) $ac_c" 1>&6
13254 else
13255   
13256         ol_DB_LIB=-ldb2
13257         ol_LIBS=$LIBS
13258         LIBS="$ol_DB_LIB $LIBS"
13259
13260         cat > conftest.$ac_ext <<EOF
13261 #line 13262 "configure"
13262 #include "confdefs.h"
13263
13264 #ifdef HAVE_DB_185_H
13265 # include <db_185.h>
13266 #else
13267 # include <db.h>
13268 #endif
13269
13270 #ifndef DB_VERSION_MAJOR
13271 # define DB_VERSION_MAJOR 1
13272 #endif
13273
13274 #ifndef NULL
13275 #define NULL ((void*)0)
13276 #endif
13277
13278 int main() {
13279
13280 #if DB_VERSION_MAJOR > 1
13281         {
13282                 char *version;
13283                 int major, minor, patch;
13284
13285                 version = db_version( &major, &minor, &patch );
13286
13287                 if( major != DB_VERSION_MAJOR ||
13288                         minor < DB_VERSION_MINOR )
13289                 {
13290                         printf("Berkeley DB version mismatch\n"
13291                                 "\texpected: %s\n\tgot: %s\n",
13292                                 DB_VERSION_STRING, version);
13293                         return 1;
13294                 }
13295         }
13296 #endif
13297
13298 #if DB_VERSION_MAJOR > 2
13299         db_env_create( NULL, 0 );
13300 #elif DB_VERSION_MAJOR > 1
13301         db_appexit( NULL );
13302 #else
13303         (void) dbopen( NULL, 0, 0, 0, NULL);
13304 #endif
13305
13306 ; return 0; }
13307 EOF
13308 if { (eval echo configure:13309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13309   rm -rf conftest*
13310   ol_cv_db_db2=yes
13311 else
13312   echo "configure: failed program was:" >&5
13313   cat conftest.$ac_ext >&5
13314   rm -rf conftest*
13315   ol_cv_db_db2=no
13316 fi
13317 rm -f conftest*
13318
13319         LIBS="$ol_LIBS"
13320
13321 fi
13322
13323 echo "$ac_t""$ol_cv_db_db2" 1>&6
13324
13325         if test $ol_cv_db_db2 = yes ; then
13326                 ol_cv_lib_db=-ldb2
13327         fi
13328 fi
13329
13330 if test $ol_cv_lib_db = no ; then
13331         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13332 echo "configure:13333: checking for Berkeley DB link (-ldb1)" >&5
13333 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
13334   echo $ac_n "(cached) $ac_c" 1>&6
13335 else
13336   
13337         ol_DB_LIB=-ldb1
13338         ol_LIBS=$LIBS
13339         LIBS="$ol_DB_LIB $LIBS"
13340
13341         cat > conftest.$ac_ext <<EOF
13342 #line 13343 "configure"
13343 #include "confdefs.h"
13344
13345 #ifdef HAVE_DB_185_H
13346 # include <db_185.h>
13347 #else
13348 # include <db.h>
13349 #endif
13350
13351 #ifndef DB_VERSION_MAJOR
13352 # define DB_VERSION_MAJOR 1
13353 #endif
13354
13355 #ifndef NULL
13356 #define NULL ((void*)0)
13357 #endif
13358
13359 int main() {
13360
13361 #if DB_VERSION_MAJOR > 1
13362         {
13363                 char *version;
13364                 int major, minor, patch;
13365
13366                 version = db_version( &major, &minor, &patch );
13367
13368                 if( major != DB_VERSION_MAJOR ||
13369                         minor < DB_VERSION_MINOR )
13370                 {
13371                         printf("Berkeley DB version mismatch\n"
13372                                 "\texpected: %s\n\tgot: %s\n",
13373                                 DB_VERSION_STRING, version);
13374                         return 1;
13375                 }
13376         }
13377 #endif
13378
13379 #if DB_VERSION_MAJOR > 2
13380         db_env_create( NULL, 0 );
13381 #elif DB_VERSION_MAJOR > 1
13382         db_appexit( NULL );
13383 #else
13384         (void) dbopen( NULL, 0, 0, 0, NULL);
13385 #endif
13386
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   ol_cv_db_db1=yes
13392 else
13393   echo "configure: failed program was:" >&5
13394   cat conftest.$ac_ext >&5
13395   rm -rf conftest*
13396   ol_cv_db_db1=no
13397 fi
13398 rm -f conftest*
13399
13400         LIBS="$ol_LIBS"
13401
13402 fi
13403
13404 echo "$ac_t""$ol_cv_db_db1" 1>&6
13405
13406         if test $ol_cv_db_db1 = yes ; then
13407                 ol_cv_lib_db=-ldb1
13408         fi
13409 fi
13410
13411
13412         if test "$ol_cv_lib_db" != no ; then
13413                 ol_cv_berkeley_db=yes
13414                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
13415 echo "configure:13416: checking for Berkeley DB thread support" >&5
13416 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
13417   echo $ac_n "(cached) $ac_c" 1>&6
13418 else
13419   
13420         ol_LIBS="$LIBS"
13421         if test $ol_cv_lib_db != yes ; then
13422                 LIBS="$ol_cv_lib_db"
13423         fi
13424
13425         if test "$cross_compiling" = yes; then
13426   ol_cv_berkeley_db_thread=cross
13427 else
13428   cat > conftest.$ac_ext <<EOF
13429 #line 13430 "configure"
13430 #include "confdefs.h"
13431
13432 #ifdef HAVE_DB_185_H
13433         choke me;
13434 #else
13435 #include <db.h>
13436 #endif
13437 #ifndef NULL
13438 #define NULL ((void *)0)
13439 #endif
13440 main()
13441 {
13442         int rc;
13443         u_int32_t flags = DB_CREATE |
13444 #ifdef DB_PRIVATE
13445                 DB_PRIVATE |
13446 #endif
13447                 DB_THREAD;
13448
13449 #if DB_VERSION_MAJOR > 2
13450         DB_ENV *env = NULL;
13451
13452         rc = db_env_create( &env, 0 );
13453
13454         flags |= DB_INIT_MPOOL;
13455 #ifdef DB_MPOOL_PRIVATE
13456         flags |= DB_MPOOL_PRIVATE;
13457 #endif
13458
13459         if( rc ) {
13460                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13461                 return rc;
13462         }
13463
13464 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
13465         rc = env->open( env, NULL, flags, 0 );
13466 #else
13467         rc = env->open( env, NULL, NULL, flags, 0 );
13468 #endif
13469
13470         if ( rc == 0 ) {
13471                 rc = env->close( env, 0 );
13472         }
13473
13474         if( rc ) {
13475                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13476                 return rc;
13477         }
13478
13479 #else
13480         DB_ENV env;
13481         memset( &env, '\0', sizeof(env) );
13482
13483         rc = db_appinit( NULL, NULL, &env, flags );
13484
13485         if( rc == 0 ) {
13486                 db_appexit( &env );
13487         }
13488
13489         unlink("__db_mpool.share");
13490         unlink("__db_lock.share");
13491 #endif
13492
13493         return rc;
13494 }
13495 EOF
13496 if { (eval echo configure:13497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13497 then
13498   ol_cv_berkeley_db_thread=yes
13499 else
13500   echo "configure: failed program was:" >&5
13501   cat conftest.$ac_ext >&5
13502   rm -fr conftest*
13503   ol_cv_berkeley_db_thread=no
13504 fi
13505 rm -fr conftest*
13506 fi
13507
13508
13509         LIBS="$ol_LIBS"
13510
13511         if test $ol_cv_berkeley_db_thread != no ; then
13512                 cat >> confdefs.h <<\EOF
13513 #define HAVE_BERKELEY_DB_THREAD 1
13514 EOF
13515
13516         fi
13517
13518 fi
13519
13520 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
13521         fi
13522 fi
13523
13524         fi
13525
13526         if test $ol_cv_berkeley_db != no ; then
13527                 cat >> confdefs.h <<\EOF
13528 #define HAVE_BERKELEY_DB 1
13529 EOF
13530
13531
13532                 ol_link_ldbm=berkeley
13533                 ol_with_ldbm_api=db
13534
13535                 if test $ol_with_ldbm_type = hash ; then
13536                         cat >> confdefs.h <<\EOF
13537 #define LDBM_USE_DBHASH 1
13538 EOF
13539
13540                 else
13541                         cat >> confdefs.h <<\EOF
13542 #define LDBM_USE_DBBTREE 1
13543 EOF
13544
13545                 fi
13546
13547                                                 if test $ol_cv_lib_db != yes ; then
13548                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
13549                 fi
13550         fi
13551 fi
13552
13553 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
13554         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
13555         ol_with_ldbm_api=none
13556 fi
13557
13558 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
13559         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
13560 echo "configure:13561: checking for MDBM library" >&5
13561 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
13562   echo $ac_n "(cached) $ac_c" 1>&6
13563 else
13564         ol_LIBS="$LIBS"
13565         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
13566 echo "configure:13567: checking for mdbm_set_chain" >&5
13567 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
13568   echo $ac_n "(cached) $ac_c" 1>&6
13569 else
13570   cat > conftest.$ac_ext <<EOF
13571 #line 13572 "configure"
13572 #include "confdefs.h"
13573 /* System header to define __stub macros and hopefully few prototypes,
13574     which can conflict with char mdbm_set_chain(); below.  */
13575 #include <assert.h>
13576 /* Override any gcc2 internal prototype to avoid an error.  */
13577 /* We use char because int might match the return type of a gcc2
13578     builtin and then its argument prototype would still apply.  */
13579 char mdbm_set_chain();
13580 char (*f)();
13581
13582 int main() {
13583
13584 /* The GNU C library defines this for functions which it implements
13585     to always fail with ENOSYS.  Some functions are actually named
13586     something starting with __ and the normal name is an alias.  */
13587 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
13588 choke me
13589 #else
13590 f = mdbm_set_chain;
13591 #endif
13592
13593 ; return 0; }
13594 EOF
13595 if { (eval echo configure:13596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13596   rm -rf conftest*
13597   eval "ac_cv_func_mdbm_set_chain=yes"
13598 else
13599   echo "configure: failed program was:" >&5
13600   cat conftest.$ac_ext >&5
13601   rm -rf conftest*
13602   eval "ac_cv_func_mdbm_set_chain=no"
13603 fi
13604 rm -f conftest*
13605 fi
13606
13607 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
13608   echo "$ac_t""yes" 1>&6
13609   ol_cv_lib_mdbm=yes
13610 else
13611   echo "$ac_t""no" 1>&6
13612
13613                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
13614 echo "configure:13615: checking for mdbm_set_chain in -lmdbm" >&5
13615 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
13616 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13617   echo $ac_n "(cached) $ac_c" 1>&6
13618 else
13619   ac_save_LIBS="$LIBS"
13620 LIBS="-lmdbm  $LIBS"
13621 cat > conftest.$ac_ext <<EOF
13622 #line 13623 "configure"
13623 #include "confdefs.h"
13624 /* Override any gcc2 internal prototype to avoid an error.  */
13625 /* We use char because int might match the return type of a gcc2
13626     builtin and then its argument prototype would still apply.  */
13627 char mdbm_set_chain();
13628
13629 int main() {
13630 mdbm_set_chain()
13631 ; return 0; }
13632 EOF
13633 if { (eval echo configure:13634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13634   rm -rf conftest*
13635   eval "ac_cv_lib_$ac_lib_var=yes"
13636 else
13637   echo "configure: failed program was:" >&5
13638   cat conftest.$ac_ext >&5
13639   rm -rf conftest*
13640   eval "ac_cv_lib_$ac_lib_var=no"
13641 fi
13642 rm -f conftest*
13643 LIBS="$ac_save_LIBS"
13644
13645 fi
13646 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13647   echo "$ac_t""yes" 1>&6
13648   ol_cv_lib_mdbm=-lmdbm
13649 else
13650   echo "$ac_t""no" 1>&6
13651 ol_cv_lib_mdbm=no
13652 fi
13653
13654         
13655 fi
13656
13657         LIBS="$ol_LIBS"
13658
13659 fi
13660
13661 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
13662
13663
13664  for ac_hdr in mdbm.h
13665 do
13666 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13667 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13668 echo "configure:13669: checking for $ac_hdr" >&5
13669 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13670   echo $ac_n "(cached) $ac_c" 1>&6
13671 else
13672   cat > conftest.$ac_ext <<EOF
13673 #line 13674 "configure"
13674 #include "confdefs.h"
13675 #include <$ac_hdr>
13676 EOF
13677 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13678 { (eval echo configure:13679: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13679 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13680 if test -z "$ac_err"; then
13681   rm -rf conftest*
13682   eval "ac_cv_header_$ac_safe=yes"
13683 else
13684   echo "$ac_err" >&5
13685   echo "configure: failed program was:" >&5
13686   cat conftest.$ac_ext >&5
13687   rm -rf conftest*
13688   eval "ac_cv_header_$ac_safe=no"
13689 fi
13690 rm -f conftest*
13691 fi
13692 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13693   echo "$ac_t""yes" 1>&6
13694     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13695   cat >> confdefs.h <<EOF
13696 #define $ac_tr_hdr 1
13697 EOF
13698  
13699 else
13700   echo "$ac_t""no" 1>&6
13701 fi
13702 done
13703
13704  echo $ac_n "checking for db""... $ac_c" 1>&6
13705 echo "configure:13706: checking for db" >&5
13706 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
13707   echo $ac_n "(cached) $ac_c" 1>&6
13708 else
13709   
13710         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
13711                 ol_cv_mdbm=no
13712         else
13713                 ol_cv_mdbm=yes
13714         fi
13715
13716 fi
13717
13718 echo "$ac_t""$ol_cv_mdbm" 1>&6
13719  if test $ol_cv_mdbm = yes ; then
13720         cat >> confdefs.h <<\EOF
13721 #define HAVE_MDBM 1
13722 EOF
13723
13724  fi
13725
13726
13727         if test $ol_cv_mdbm = yes ; then
13728                 ol_link_ldbm=mdbm
13729                 ol_with_ldbm_api=mdbm
13730                 if test $ol_cv_lib_mdbm != yes ; then
13731                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
13732                 fi
13733         fi
13734 fi
13735
13736 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
13737         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
13738 echo "configure:13739: checking for GDBM library" >&5
13739 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
13740   echo $ac_n "(cached) $ac_c" 1>&6
13741 else
13742         ol_LIBS="$LIBS"
13743         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
13744 echo "configure:13745: checking for gdbm_open" >&5
13745 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
13746   echo $ac_n "(cached) $ac_c" 1>&6
13747 else
13748   cat > conftest.$ac_ext <<EOF
13749 #line 13750 "configure"
13750 #include "confdefs.h"
13751 /* System header to define __stub macros and hopefully few prototypes,
13752     which can conflict with char gdbm_open(); below.  */
13753 #include <assert.h>
13754 /* Override any gcc2 internal prototype to avoid an error.  */
13755 /* We use char because int might match the return type of a gcc2
13756     builtin and then its argument prototype would still apply.  */
13757 char gdbm_open();
13758 char (*f)();
13759
13760 int main() {
13761
13762 /* The GNU C library defines this for functions which it implements
13763     to always fail with ENOSYS.  Some functions are actually named
13764     something starting with __ and the normal name is an alias.  */
13765 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
13766 choke me
13767 #else
13768 f = gdbm_open;
13769 #endif
13770
13771 ; return 0; }
13772 EOF
13773 if { (eval echo configure:13774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13774   rm -rf conftest*
13775   eval "ac_cv_func_gdbm_open=yes"
13776 else
13777   echo "configure: failed program was:" >&5
13778   cat conftest.$ac_ext >&5
13779   rm -rf conftest*
13780   eval "ac_cv_func_gdbm_open=no"
13781 fi
13782 rm -f conftest*
13783 fi
13784
13785 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
13786   echo "$ac_t""yes" 1>&6
13787   ol_cv_lib_gdbm=yes
13788 else
13789   echo "$ac_t""no" 1>&6
13790
13791                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
13792 echo "configure:13793: checking for gdbm_open in -lgdbm" >&5
13793 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
13794 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13795   echo $ac_n "(cached) $ac_c" 1>&6
13796 else
13797   ac_save_LIBS="$LIBS"
13798 LIBS="-lgdbm  $LIBS"
13799 cat > conftest.$ac_ext <<EOF
13800 #line 13801 "configure"
13801 #include "confdefs.h"
13802 /* Override any gcc2 internal prototype to avoid an error.  */
13803 /* We use char because int might match the return type of a gcc2
13804     builtin and then its argument prototype would still apply.  */
13805 char gdbm_open();
13806
13807 int main() {
13808 gdbm_open()
13809 ; return 0; }
13810 EOF
13811 if { (eval echo configure:13812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13812   rm -rf conftest*
13813   eval "ac_cv_lib_$ac_lib_var=yes"
13814 else
13815   echo "configure: failed program was:" >&5
13816   cat conftest.$ac_ext >&5
13817   rm -rf conftest*
13818   eval "ac_cv_lib_$ac_lib_var=no"
13819 fi
13820 rm -f conftest*
13821 LIBS="$ac_save_LIBS"
13822
13823 fi
13824 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13825   echo "$ac_t""yes" 1>&6
13826   ol_cv_lib_gdbm=-lgdbm
13827 else
13828   echo "$ac_t""no" 1>&6
13829 ol_cv_lib_gdbm=no
13830 fi
13831
13832         
13833 fi
13834
13835         LIBS="$ol_LIBS"
13836
13837 fi
13838
13839 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
13840
13841
13842  for ac_hdr in gdbm.h
13843 do
13844 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13845 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13846 echo "configure:13847: checking for $ac_hdr" >&5
13847 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13848   echo $ac_n "(cached) $ac_c" 1>&6
13849 else
13850   cat > conftest.$ac_ext <<EOF
13851 #line 13852 "configure"
13852 #include "confdefs.h"
13853 #include <$ac_hdr>
13854 EOF
13855 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13856 { (eval echo configure:13857: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13857 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13858 if test -z "$ac_err"; then
13859   rm -rf conftest*
13860   eval "ac_cv_header_$ac_safe=yes"
13861 else
13862   echo "$ac_err" >&5
13863   echo "configure: failed program was:" >&5
13864   cat conftest.$ac_ext >&5
13865   rm -rf conftest*
13866   eval "ac_cv_header_$ac_safe=no"
13867 fi
13868 rm -f conftest*
13869 fi
13870 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13871   echo "$ac_t""yes" 1>&6
13872     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13873   cat >> confdefs.h <<EOF
13874 #define $ac_tr_hdr 1
13875 EOF
13876  
13877 else
13878   echo "$ac_t""no" 1>&6
13879 fi
13880 done
13881
13882  echo $ac_n "checking for db""... $ac_c" 1>&6
13883 echo "configure:13884: checking for db" >&5
13884 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
13885   echo $ac_n "(cached) $ac_c" 1>&6
13886 else
13887   
13888         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
13889                 ol_cv_gdbm=no
13890         else
13891                 ol_cv_gdbm=yes
13892         fi
13893
13894 fi
13895
13896 echo "$ac_t""$ol_cv_gdbm" 1>&6
13897  if test $ol_cv_gdbm = yes ; then
13898         cat >> confdefs.h <<\EOF
13899 #define HAVE_GDBM 1
13900 EOF
13901
13902  fi
13903
13904
13905         if test $ol_cv_gdbm = yes ; then
13906                 ol_link_ldbm=gdbm
13907                 ol_with_ldbm_api=gdbm
13908
13909                 if test $ol_cv_lib_gdbm != yes ; then
13910                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
13911                 fi
13912         fi
13913 fi
13914
13915 if test $ol_with_ldbm_api = ndbm ; then
13916         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
13917 echo "configure:13918: checking for NDBM library" >&5
13918 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
13919   echo $ac_n "(cached) $ac_c" 1>&6
13920 else
13921         ol_LIBS="$LIBS"
13922         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
13923 echo "configure:13924: checking for dbm_open" >&5
13924 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
13925   echo $ac_n "(cached) $ac_c" 1>&6
13926 else
13927   cat > conftest.$ac_ext <<EOF
13928 #line 13929 "configure"
13929 #include "confdefs.h"
13930 /* System header to define __stub macros and hopefully few prototypes,
13931     which can conflict with char dbm_open(); below.  */
13932 #include <assert.h>
13933 /* Override any gcc2 internal prototype to avoid an error.  */
13934 /* We use char because int might match the return type of a gcc2
13935     builtin and then its argument prototype would still apply.  */
13936 char dbm_open();
13937 char (*f)();
13938
13939 int main() {
13940
13941 /* The GNU C library defines this for functions which it implements
13942     to always fail with ENOSYS.  Some functions are actually named
13943     something starting with __ and the normal name is an alias.  */
13944 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
13945 choke me
13946 #else
13947 f = dbm_open;
13948 #endif
13949
13950 ; return 0; }
13951 EOF
13952 if { (eval echo configure:13953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13953   rm -rf conftest*
13954   eval "ac_cv_func_dbm_open=yes"
13955 else
13956   echo "configure: failed program was:" >&5
13957   cat conftest.$ac_ext >&5
13958   rm -rf conftest*
13959   eval "ac_cv_func_dbm_open=no"
13960 fi
13961 rm -f conftest*
13962 fi
13963
13964 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
13965   echo "$ac_t""yes" 1>&6
13966   ol_cv_lib_ndbm=yes
13967 else
13968   echo "$ac_t""no" 1>&6
13969
13970                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
13971 echo "configure:13972: checking for dbm_open in -lndbm" >&5
13972 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
13973 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13974   echo $ac_n "(cached) $ac_c" 1>&6
13975 else
13976   ac_save_LIBS="$LIBS"
13977 LIBS="-lndbm  $LIBS"
13978 cat > conftest.$ac_ext <<EOF
13979 #line 13980 "configure"
13980 #include "confdefs.h"
13981 /* Override any gcc2 internal prototype to avoid an error.  */
13982 /* We use char because int might match the return type of a gcc2
13983     builtin and then its argument prototype would still apply.  */
13984 char dbm_open();
13985
13986 int main() {
13987 dbm_open()
13988 ; return 0; }
13989 EOF
13990 if { (eval echo configure:13991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13991   rm -rf conftest*
13992   eval "ac_cv_lib_$ac_lib_var=yes"
13993 else
13994   echo "configure: failed program was:" >&5
13995   cat conftest.$ac_ext >&5
13996   rm -rf conftest*
13997   eval "ac_cv_lib_$ac_lib_var=no"
13998 fi
13999 rm -f conftest*
14000 LIBS="$ac_save_LIBS"
14001
14002 fi
14003 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14004   echo "$ac_t""yes" 1>&6
14005   ol_cv_lib_ndbm=-lndbm
14006 else
14007   echo "$ac_t""no" 1>&6
14008
14009                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
14010 echo "configure:14011: checking for dbm_open in -ldbm" >&5
14011 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
14012 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14013   echo $ac_n "(cached) $ac_c" 1>&6
14014 else
14015   ac_save_LIBS="$LIBS"
14016 LIBS="-ldbm  $LIBS"
14017 cat > conftest.$ac_ext <<EOF
14018 #line 14019 "configure"
14019 #include "confdefs.h"
14020 /* Override any gcc2 internal prototype to avoid an error.  */
14021 /* We use char because int might match the return type of a gcc2
14022     builtin and then its argument prototype would still apply.  */
14023 char dbm_open();
14024
14025 int main() {
14026 dbm_open()
14027 ; return 0; }
14028 EOF
14029 if { (eval echo configure:14030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14030   rm -rf conftest*
14031   eval "ac_cv_lib_$ac_lib_var=yes"
14032 else
14033   echo "configure: failed program was:" >&5
14034   cat conftest.$ac_ext >&5
14035   rm -rf conftest*
14036   eval "ac_cv_lib_$ac_lib_var=no"
14037 fi
14038 rm -f conftest*
14039 LIBS="$ac_save_LIBS"
14040
14041 fi
14042 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14043   echo "$ac_t""yes" 1>&6
14044   ol_cv_lib_ndbm=-ldbm
14045 else
14046   echo "$ac_t""no" 1>&6
14047 ol_cv_lib_ndbm=no
14048 fi
14049                 
14050 fi
14051
14052         
14053 fi
14054
14055         LIBS="$ol_LIBS"
14056
14057 fi
14058
14059 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
14060
14061
14062  for ac_hdr in ndbm.h
14063 do
14064 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14065 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14066 echo "configure:14067: checking for $ac_hdr" >&5
14067 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14068   echo $ac_n "(cached) $ac_c" 1>&6
14069 else
14070   cat > conftest.$ac_ext <<EOF
14071 #line 14072 "configure"
14072 #include "confdefs.h"
14073 #include <$ac_hdr>
14074 EOF
14075 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14076 { (eval echo configure:14077: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14077 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14078 if test -z "$ac_err"; then
14079   rm -rf conftest*
14080   eval "ac_cv_header_$ac_safe=yes"
14081 else
14082   echo "$ac_err" >&5
14083   echo "configure: failed program was:" >&5
14084   cat conftest.$ac_ext >&5
14085   rm -rf conftest*
14086   eval "ac_cv_header_$ac_safe=no"
14087 fi
14088 rm -f conftest*
14089 fi
14090 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14091   echo "$ac_t""yes" 1>&6
14092     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14093   cat >> confdefs.h <<EOF
14094 #define $ac_tr_hdr 1
14095 EOF
14096  
14097 else
14098   echo "$ac_t""no" 1>&6
14099 fi
14100 done
14101
14102  echo $ac_n "checking for db""... $ac_c" 1>&6
14103 echo "configure:14104: checking for db" >&5
14104 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
14105   echo $ac_n "(cached) $ac_c" 1>&6
14106 else
14107   
14108         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
14109                 ol_cv_ndbm=no
14110         else
14111                 ol_cv_ndbm=yes
14112         fi
14113
14114 fi
14115
14116 echo "$ac_t""$ol_cv_ndbm" 1>&6
14117  if test $ol_cv_ndbm = yes ; then
14118         cat >> confdefs.h <<\EOF
14119 #define HAVE_NDBM 1
14120 EOF
14121
14122  fi
14123
14124
14125         if test $ol_cv_ndbm = yes ; then
14126                 ol_link_ldbm=ndbm
14127                 ol_with_ldbm_api=ndbm
14128
14129                 if test $ol_cv_lib_ndbm != yes ; then
14130                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
14131                 fi
14132         fi
14133 fi
14134
14135 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
14136         echo "configure: warning: could not find suitable LDBM backend" 1>&2
14137         if test $ol_enable_ldbm = yes ; then
14138                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
14139         fi
14140
14141         echo "configure: warning: disabling LDBM" 1>&2
14142         ol_enable_ldbm=no
14143 fi
14144
14145 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
14146         LINK_BINS_DYNAMIC="yes"
14147 else
14148         LINK_BINS_DYNAMIC="no"
14149 fi
14150
14151 if test $ol_enable_wrappers != no ; then
14152         for ac_hdr in tcpd.h
14153 do
14154 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14155 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14156 echo "configure:14157: checking for $ac_hdr" >&5
14157 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14158   echo $ac_n "(cached) $ac_c" 1>&6
14159 else
14160   cat > conftest.$ac_ext <<EOF
14161 #line 14162 "configure"
14162 #include "confdefs.h"
14163 #include <$ac_hdr>
14164 EOF
14165 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14166 { (eval echo configure:14167: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14167 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14168 if test -z "$ac_err"; then
14169   rm -rf conftest*
14170   eval "ac_cv_header_$ac_safe=yes"
14171 else
14172   echo "$ac_err" >&5
14173   echo "configure: failed program was:" >&5
14174   cat conftest.$ac_ext >&5
14175   rm -rf conftest*
14176   eval "ac_cv_header_$ac_safe=no"
14177 fi
14178 rm -f conftest*
14179 fi
14180 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14181   echo "$ac_t""yes" 1>&6
14182     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14183   cat >> confdefs.h <<EOF
14184 #define $ac_tr_hdr 1
14185 EOF
14186  
14187 else
14188   echo "$ac_t""no" 1>&6
14189 fi
14190 done
14191
14192
14193         if test $ac_cv_header_tcpd_h != yes ; then
14194                 have_wrappers=no
14195         else
14196                 cat > conftest.$ac_ext <<EOF
14197 #line 14198 "configure"
14198 #include "confdefs.h"
14199
14200 int allow_severity = 0;
14201 int deny_severity  = 0;
14202                 
14203 int main() {
14204 hosts_access()
14205 ; return 0; }
14206 EOF
14207 if { (eval echo configure:14208: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14208   rm -rf conftest*
14209   have_wrappers=yes
14210 else
14211   echo "configure: failed program was:" >&5
14212   cat conftest.$ac_ext >&5
14213   rm -rf conftest*
14214   have_wrappers=no
14215 fi
14216 rm -f conftest*
14217         fi
14218
14219         if test $have_wrappers = yes ; then
14220                 cat >> confdefs.h <<\EOF
14221 #define HAVE_TCPD 1
14222 EOF
14223
14224                 WRAP_LIBS="-lwrap"
14225
14226                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
14227 echo "configure:14228: checking for main in -lnsl" >&5
14228 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
14229 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14230   echo $ac_n "(cached) $ac_c" 1>&6
14231 else
14232   ac_save_LIBS="$LIBS"
14233 LIBS="-lnsl  $LIBS"
14234 cat > conftest.$ac_ext <<EOF
14235 #line 14236 "configure"
14236 #include "confdefs.h"
14237
14238 int main() {
14239 main()
14240 ; return 0; }
14241 EOF
14242 if { (eval echo configure:14243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14243   rm -rf conftest*
14244   eval "ac_cv_lib_$ac_lib_var=yes"
14245 else
14246   echo "configure: failed program was:" >&5
14247   cat conftest.$ac_ext >&5
14248   rm -rf conftest*
14249   eval "ac_cv_lib_$ac_lib_var=no"
14250 fi
14251 rm -f conftest*
14252 LIBS="$ac_save_LIBS"
14253
14254 fi
14255 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14256   echo "$ac_t""yes" 1>&6
14257     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
14258     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
14259   cat >> confdefs.h <<EOF
14260 #define $ac_tr_lib 1
14261 EOF
14262
14263   LIBS="-lnsl $LIBS"
14264
14265 else
14266   echo "$ac_t""no" 1>&6
14267 fi
14268
14269         else
14270                 echo "configure: warning: could not find -lwrap" 1>&2
14271                 if test $ol_enable_wrappers = yes ; then
14272                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
14273                 fi
14274
14275                 echo "configure: warning: disabling wrappers support" 1>&2
14276                 ol_enable_wrappers=no
14277                 WRAP_LIBS=""
14278         fi
14279 fi
14280
14281 if test $ol_enable_syslog != no ; then
14282         echo $ac_n "checking for openlog""... $ac_c" 1>&6
14283 echo "configure:14284: checking for openlog" >&5
14284 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
14285   echo $ac_n "(cached) $ac_c" 1>&6
14286 else
14287   cat > conftest.$ac_ext <<EOF
14288 #line 14289 "configure"
14289 #include "confdefs.h"
14290 /* System header to define __stub macros and hopefully few prototypes,
14291     which can conflict with char openlog(); below.  */
14292 #include <assert.h>
14293 /* Override any gcc2 internal prototype to avoid an error.  */
14294 /* We use char because int might match the return type of a gcc2
14295     builtin and then its argument prototype would still apply.  */
14296 char openlog();
14297 char (*f)();
14298
14299 int main() {
14300
14301 /* The GNU C library defines this for functions which it implements
14302     to always fail with ENOSYS.  Some functions are actually named
14303     something starting with __ and the normal name is an alias.  */
14304 #if defined (__stub_openlog) || defined (__stub___openlog)
14305 choke me
14306 #else
14307 f = openlog;
14308 #endif
14309
14310 ; return 0; }
14311 EOF
14312 if { (eval echo configure:14313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14313   rm -rf conftest*
14314   eval "ac_cv_func_openlog=yes"
14315 else
14316   echo "configure: failed program was:" >&5
14317   cat conftest.$ac_ext >&5
14318   rm -rf conftest*
14319   eval "ac_cv_func_openlog=no"
14320 fi
14321 rm -f conftest*
14322 fi
14323
14324 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
14325   echo "$ac_t""yes" 1>&6
14326   :
14327 else
14328   echo "$ac_t""no" 1>&6
14329 fi
14330
14331         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
14332                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
14333         fi
14334         ol_enable_syslog=$ac_cv_func_openlog
14335 fi
14336
14337 ol_link_sql=no
14338 if test $ol_enable_sql != no ; then
14339         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
14340 echo "configure:14341: checking for SQLDriverConnect in -liodbc" >&5
14341 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14342 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14343   echo $ac_n "(cached) $ac_c" 1>&6
14344 else
14345   ac_save_LIBS="$LIBS"
14346 LIBS="-liodbc  $LIBS"
14347 cat > conftest.$ac_ext <<EOF
14348 #line 14349 "configure"
14349 #include "confdefs.h"
14350 /* Override any gcc2 internal prototype to avoid an error.  */
14351 /* We use char because int might match the return type of a gcc2
14352     builtin and then its argument prototype would still apply.  */
14353 char SQLDriverConnect();
14354
14355 int main() {
14356 SQLDriverConnect()
14357 ; return 0; }
14358 EOF
14359 if { (eval echo configure:14360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14360   rm -rf conftest*
14361   eval "ac_cv_lib_$ac_lib_var=yes"
14362 else
14363   echo "configure: failed program was:" >&5
14364   cat conftest.$ac_ext >&5
14365   rm -rf conftest*
14366   eval "ac_cv_lib_$ac_lib_var=no"
14367 fi
14368 rm -f conftest*
14369 LIBS="$ac_save_LIBS"
14370
14371 fi
14372 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14373   echo "$ac_t""yes" 1>&6
14374   have_iodbc=yes
14375 else
14376   echo "$ac_t""no" 1>&6
14377 have_iodbc=no
14378 fi
14379
14380         if test $have_iodbc = yes ; then
14381                 ol_link_sql="-liodbc"
14382         else
14383                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
14384 echo "configure:14385: checking for SQLDriverConnect in -lodbc" >&5
14385 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14386 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14387   echo $ac_n "(cached) $ac_c" 1>&6
14388 else
14389   ac_save_LIBS="$LIBS"
14390 LIBS="-lodbc  $LIBS"
14391 cat > conftest.$ac_ext <<EOF
14392 #line 14393 "configure"
14393 #include "confdefs.h"
14394 /* Override any gcc2 internal prototype to avoid an error.  */
14395 /* We use char because int might match the return type of a gcc2
14396     builtin and then its argument prototype would still apply.  */
14397 char SQLDriverConnect();
14398
14399 int main() {
14400 SQLDriverConnect()
14401 ; return 0; }
14402 EOF
14403 if { (eval echo configure:14404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14404   rm -rf conftest*
14405   eval "ac_cv_lib_$ac_lib_var=yes"
14406 else
14407   echo "configure: failed program was:" >&5
14408   cat conftest.$ac_ext >&5
14409   rm -rf conftest*
14410   eval "ac_cv_lib_$ac_lib_var=no"
14411 fi
14412 rm -f conftest*
14413 LIBS="$ac_save_LIBS"
14414
14415 fi
14416 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14417   echo "$ac_t""yes" 1>&6
14418   have_odbc=yes
14419 else
14420   echo "$ac_t""no" 1>&6
14421 have_odbc=no
14422 fi
14423
14424                 if test $have_odbc = yes ; then
14425                         ol_link_sql="-lodbc"
14426                 fi
14427         fi
14428
14429         if test $ol_link_sql != no ; then
14430                 SLAPD_SQL_LIBS="$ol_link_sql"
14431
14432         elif test $ol_enable_sql != auto ; then
14433                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
14434         fi
14435 fi
14436
14437 ol_link_termcap=no
14438 for ac_hdr in termcap.h ncurses.h
14439 do
14440 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14441 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14442 echo "configure:14443: checking for $ac_hdr" >&5
14443 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14444   echo $ac_n "(cached) $ac_c" 1>&6
14445 else
14446   cat > conftest.$ac_ext <<EOF
14447 #line 14448 "configure"
14448 #include "confdefs.h"
14449 #include <$ac_hdr>
14450 EOF
14451 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14452 { (eval echo configure:14453: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14453 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14454 if test -z "$ac_err"; then
14455   rm -rf conftest*
14456   eval "ac_cv_header_$ac_safe=yes"
14457 else
14458   echo "$ac_err" >&5
14459   echo "configure: failed program was:" >&5
14460   cat conftest.$ac_ext >&5
14461   rm -rf conftest*
14462   eval "ac_cv_header_$ac_safe=no"
14463 fi
14464 rm -f conftest*
14465 fi
14466 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14467   echo "$ac_t""yes" 1>&6
14468     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14469   cat >> confdefs.h <<EOF
14470 #define $ac_tr_hdr 1
14471 EOF
14472  
14473 else
14474   echo "$ac_t""no" 1>&6
14475 fi
14476 done
14477
14478
14479 if test $ol_link_termcap = no ; then
14480         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
14481 echo "configure:14482: checking for tputs in -ltermcap" >&5
14482 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
14483 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14484   echo $ac_n "(cached) $ac_c" 1>&6
14485 else
14486   ac_save_LIBS="$LIBS"
14487 LIBS="-ltermcap  $LIBS"
14488 cat > conftest.$ac_ext <<EOF
14489 #line 14490 "configure"
14490 #include "confdefs.h"
14491 /* Override any gcc2 internal prototype to avoid an error.  */
14492 /* We use char because int might match the return type of a gcc2
14493     builtin and then its argument prototype would still apply.  */
14494 char tputs();
14495
14496 int main() {
14497 tputs()
14498 ; return 0; }
14499 EOF
14500 if { (eval echo configure:14501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14501   rm -rf conftest*
14502   eval "ac_cv_lib_$ac_lib_var=yes"
14503 else
14504   echo "configure: failed program was:" >&5
14505   cat conftest.$ac_ext >&5
14506   rm -rf conftest*
14507   eval "ac_cv_lib_$ac_lib_var=no"
14508 fi
14509 rm -f conftest*
14510 LIBS="$ac_save_LIBS"
14511
14512 fi
14513 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14514   echo "$ac_t""yes" 1>&6
14515   have_termcap=yes
14516 else
14517   echo "$ac_t""no" 1>&6
14518 have_termcap=no
14519 fi
14520
14521         if test $have_termcap = yes ; then
14522                 cat >> confdefs.h <<\EOF
14523 #define HAVE_TERMCAP 1
14524 EOF
14525
14526                 ol_link_termcap=yes
14527                 TERMCAP_LIBS=-ltermcap
14528         fi
14529 fi
14530
14531 if test $ol_link_termcap = no ; then
14532         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
14533 echo "configure:14534: checking for initscr in -lncurses" >&5
14534 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
14535 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14536   echo $ac_n "(cached) $ac_c" 1>&6
14537 else
14538   ac_save_LIBS="$LIBS"
14539 LIBS="-lncurses  $LIBS"
14540 cat > conftest.$ac_ext <<EOF
14541 #line 14542 "configure"
14542 #include "confdefs.h"
14543 /* Override any gcc2 internal prototype to avoid an error.  */
14544 /* We use char because int might match the return type of a gcc2
14545     builtin and then its argument prototype would still apply.  */
14546 char initscr();
14547
14548 int main() {
14549 initscr()
14550 ; return 0; }
14551 EOF
14552 if { (eval echo configure:14553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14553   rm -rf conftest*
14554   eval "ac_cv_lib_$ac_lib_var=yes"
14555 else
14556   echo "configure: failed program was:" >&5
14557   cat conftest.$ac_ext >&5
14558   rm -rf conftest*
14559   eval "ac_cv_lib_$ac_lib_var=no"
14560 fi
14561 rm -f conftest*
14562 LIBS="$ac_save_LIBS"
14563
14564 fi
14565 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14566   echo "$ac_t""yes" 1>&6
14567   have_ncurses=yes
14568 else
14569   echo "$ac_t""no" 1>&6
14570 have_ncurses=no
14571 fi
14572
14573         if test $have_ncurses = yes ; then
14574                 cat >> confdefs.h <<\EOF
14575 #define HAVE_NCURSES 1
14576 EOF
14577
14578                 ol_link_termcap=yes
14579                 TERMCAP_LIBS=-lncurses
14580         fi
14581 fi
14582
14583 if test $ol_link_termcap = no ; then
14584         cat >> confdefs.h <<\EOF
14585 #define NO_TERMCAP 1
14586 EOF
14587
14588         TERMCAP_LIBS=
14589 fi
14590
14591 ol_link_sasl=no
14592 ol_link_spasswd=no
14593 if test $ol_with_cyrus_sasl != no ; then
14594         for ac_hdr in sasl.h
14595 do
14596 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14597 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14598 echo "configure:14599: checking for $ac_hdr" >&5
14599 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14600   echo $ac_n "(cached) $ac_c" 1>&6
14601 else
14602   cat > conftest.$ac_ext <<EOF
14603 #line 14604 "configure"
14604 #include "confdefs.h"
14605 #include <$ac_hdr>
14606 EOF
14607 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14608 { (eval echo configure:14609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14609 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14610 if test -z "$ac_err"; then
14611   rm -rf conftest*
14612   eval "ac_cv_header_$ac_safe=yes"
14613 else
14614   echo "$ac_err" >&5
14615   echo "configure: failed program was:" >&5
14616   cat conftest.$ac_ext >&5
14617   rm -rf conftest*
14618   eval "ac_cv_header_$ac_safe=no"
14619 fi
14620 rm -f conftest*
14621 fi
14622 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14623   echo "$ac_t""yes" 1>&6
14624     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14625   cat >> confdefs.h <<EOF
14626 #define $ac_tr_hdr 1
14627 EOF
14628  
14629 else
14630   echo "$ac_t""no" 1>&6
14631 fi
14632 done
14633
14634
14635         if test $ac_cv_header_sasl_h = yes ; then
14636                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
14637 echo "configure:14638: checking for sasl_client_init in -lsasl" >&5
14638 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
14639 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14640   echo $ac_n "(cached) $ac_c" 1>&6
14641 else
14642   ac_save_LIBS="$LIBS"
14643 LIBS="-lsasl  $LIBS"
14644 cat > conftest.$ac_ext <<EOF
14645 #line 14646 "configure"
14646 #include "confdefs.h"
14647 /* Override any gcc2 internal prototype to avoid an error.  */
14648 /* We use char because int might match the return type of a gcc2
14649     builtin and then its argument prototype would still apply.  */
14650 char sasl_client_init();
14651
14652 int main() {
14653 sasl_client_init()
14654 ; return 0; }
14655 EOF
14656 if { (eval echo configure:14657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14657   rm -rf conftest*
14658   eval "ac_cv_lib_$ac_lib_var=yes"
14659 else
14660   echo "configure: failed program was:" >&5
14661   cat conftest.$ac_ext >&5
14662   rm -rf conftest*
14663   eval "ac_cv_lib_$ac_lib_var=no"
14664 fi
14665 rm -f conftest*
14666 LIBS="$ac_save_LIBS"
14667
14668 fi
14669 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14670   echo "$ac_t""yes" 1>&6
14671   have_cyrus_sasl=yes
14672 else
14673   echo "$ac_t""no" 1>&6
14674 have_cyrus_sasl=no
14675 fi
14676
14677
14678                 if test $have_cyrus_sasl != no ; then
14679                         SASL_LIBS="-lsasl"
14680                         cat >> confdefs.h <<\EOF
14681 #define HAVE_CYRUS_SASL 1
14682 EOF
14683
14684                         ol_link_sasl=yes
14685                 fi
14686         fi
14687
14688         if test $ol_link_sasl = no ; then
14689                 if test $ol_with_cyrus_sasl != auto ; then
14690                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
14691                 else
14692                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
14693                         echo "configure: warning: SASL authentication not supported!" 1>&2
14694                         if test $ol_link_tls = no ; then
14695                                 echo "configure: warning: Strong authentication not supported!" 1>&2
14696                         fi
14697                 fi
14698
14699         elif test $ol_enable_spasswd != no ; then
14700                 ol_link_spasswd=yes
14701         fi
14702
14703 else
14704         echo "configure: warning: SASL authentication not supported!" 1>&2
14705         if test $ol_link_tls = no ; then
14706                 echo "configure: warning: Strong authentication not supported!" 1>&2
14707         fi
14708 fi
14709
14710 if test $cross_compiling != yes ; then
14711         dev=no
14712         if test -r /dev/urandom ; then
14713                 dev="/dev/urandom";
14714         elif test -r /idev/urandom ; then
14715                 dev="/idev/urandom";
14716         elif test -r /dev/srandom ; then
14717                 dev="/dev/srandom";
14718         elif test -r /dev/random ; then
14719                 dev="/dev/random";
14720         elif test -r /idev/random ; then
14721                 dev="/idev/random";
14722         fi
14723
14724         if test $dev != no ; then
14725                 cat >> confdefs.h <<EOF
14726 #define URANDOM_DEVICE "$dev"
14727 EOF
14728
14729         fi
14730 fi
14731
14732 ol_link_fetch=no
14733 if test $ol_with_fetch != no ; then
14734         ol_LIBS=$LIBS
14735 LIBS="-lfetch -lcom_err $LIBS"
14736 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
14737 echo "configure:14738: checking fetch(3) library" >&5
14738 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
14739   echo $ac_n "(cached) $ac_c" 1>&6
14740 else
14741   
14742         cat > conftest.$ac_ext <<EOF
14743 #line 14744 "configure"
14744 #include "confdefs.h"
14745
14746 #include <sys/param.h>
14747 #include <stdio.h>
14748 #include <fetch.h>
14749 int main() {
14750 struct url *u = fetchParseURL("file:///"); 
14751 ; return 0; }
14752 EOF
14753 if { (eval echo configure:14754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14754   rm -rf conftest*
14755   ol_cv_lib_fetch=yes
14756 else
14757   echo "configure: failed program was:" >&5
14758   cat conftest.$ac_ext >&5
14759   rm -rf conftest*
14760   ol_cv_lib_fetch=no
14761 fi
14762 rm -f conftest*
14763 fi
14764
14765 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
14766 LIBS=$ol_LIBS
14767 if test $ol_cv_lib_fetch != no ; then
14768         ol_link_fetch="-lfetch -lcom_err"
14769         cat >> confdefs.h <<\EOF
14770 #define HAVE_FETCH 1
14771 EOF
14772
14773 fi
14774
14775
14776         if test $ol_cv_lib_fetch != no ; then
14777                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
14778                 ol_link_fetch=freebsd
14779
14780         elif test $ol_with_fetch != auto ; then
14781                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
14782         fi 
14783 fi
14784
14785 ol_link_readline=no
14786 if test $ol_with_readline != no ; then
14787         for ac_hdr in readline/readline.h readline/history.h
14788 do
14789 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14790 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14791 echo "configure:14792: checking for $ac_hdr" >&5
14792 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14793   echo $ac_n "(cached) $ac_c" 1>&6
14794 else
14795   cat > conftest.$ac_ext <<EOF
14796 #line 14797 "configure"
14797 #include "confdefs.h"
14798 #include <$ac_hdr>
14799 EOF
14800 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14801 { (eval echo configure:14802: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14802 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14803 if test -z "$ac_err"; then
14804   rm -rf conftest*
14805   eval "ac_cv_header_$ac_safe=yes"
14806 else
14807   echo "$ac_err" >&5
14808   echo "configure: failed program was:" >&5
14809   cat conftest.$ac_ext >&5
14810   rm -rf conftest*
14811   eval "ac_cv_header_$ac_safe=no"
14812 fi
14813 rm -f conftest*
14814 fi
14815 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14816   echo "$ac_t""yes" 1>&6
14817     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14818   cat >> confdefs.h <<EOF
14819 #define $ac_tr_hdr 1
14820 EOF
14821  
14822 else
14823   echo "$ac_t""no" 1>&6
14824 fi
14825 done
14826
14827
14828         if test $ac_cv_header_readline_readline_h = yes ; then
14829                 save_LIBS="$LIBS"
14830                 LIBS="$TERMCAP_LIBS $LIBS"
14831                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
14832 echo "configure:14833: checking for readline in -lreadline" >&5
14833 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
14834 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14835   echo $ac_n "(cached) $ac_c" 1>&6
14836 else
14837   ac_save_LIBS="$LIBS"
14838 LIBS="-lreadline  $LIBS"
14839 cat > conftest.$ac_ext <<EOF
14840 #line 14841 "configure"
14841 #include "confdefs.h"
14842 /* Override any gcc2 internal prototype to avoid an error.  */
14843 /* We use char because int might match the return type of a gcc2
14844     builtin and then its argument prototype would still apply.  */
14845 char readline();
14846
14847 int main() {
14848 readline()
14849 ; return 0; }
14850 EOF
14851 if { (eval echo configure:14852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14852   rm -rf conftest*
14853   eval "ac_cv_lib_$ac_lib_var=yes"
14854 else
14855   echo "configure: failed program was:" >&5
14856   cat conftest.$ac_ext >&5
14857   rm -rf conftest*
14858   eval "ac_cv_lib_$ac_lib_var=no"
14859 fi
14860 rm -f conftest*
14861 LIBS="$ac_save_LIBS"
14862
14863 fi
14864 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14865   echo "$ac_t""yes" 1>&6
14866   have_readline=yes
14867 else
14868   echo "$ac_t""no" 1>&6
14869 have_readline=no
14870 fi
14871
14872                 LIBS="$save_LIBS"
14873                         
14874                 if test $have_readline = yes ; then
14875                         ol_with_readline=found
14876                         ol_link_readline=yes
14877
14878                         READLINE_LIBS="-lreadline"
14879                 fi
14880         fi
14881 fi
14882
14883 if test $ol_link_readline = yes ; then
14884         cat >> confdefs.h <<\EOF
14885 #define HAVE_READLINE 1
14886 EOF
14887
14888 fi
14889
14890
14891 if test $ol_enable_crypt != no ; then
14892         echo $ac_n "checking for crypt""... $ac_c" 1>&6
14893 echo "configure:14894: checking for crypt" >&5
14894 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
14895   echo $ac_n "(cached) $ac_c" 1>&6
14896 else
14897   cat > conftest.$ac_ext <<EOF
14898 #line 14899 "configure"
14899 #include "confdefs.h"
14900 /* System header to define __stub macros and hopefully few prototypes,
14901     which can conflict with char crypt(); below.  */
14902 #include <assert.h>
14903 /* Override any gcc2 internal prototype to avoid an error.  */
14904 /* We use char because int might match the return type of a gcc2
14905     builtin and then its argument prototype would still apply.  */
14906 char crypt();
14907 char (*f)();
14908
14909 int main() {
14910
14911 /* The GNU C library defines this for functions which it implements
14912     to always fail with ENOSYS.  Some functions are actually named
14913     something starting with __ and the normal name is an alias.  */
14914 #if defined (__stub_crypt) || defined (__stub___crypt)
14915 choke me
14916 #else
14917 f = crypt;
14918 #endif
14919
14920 ; return 0; }
14921 EOF
14922 if { (eval echo configure:14923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14923   rm -rf conftest*
14924   eval "ac_cv_func_crypt=yes"
14925 else
14926   echo "configure: failed program was:" >&5
14927   cat conftest.$ac_ext >&5
14928   rm -rf conftest*
14929   eval "ac_cv_func_crypt=no"
14930 fi
14931 rm -f conftest*
14932 fi
14933
14934 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
14935   echo "$ac_t""yes" 1>&6
14936   have_crypt=yes
14937 else
14938   echo "$ac_t""no" 1>&6
14939
14940                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
14941 echo "configure:14942: checking for crypt in -lcrypt" >&5
14942 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
14943 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14944   echo $ac_n "(cached) $ac_c" 1>&6
14945 else
14946   ac_save_LIBS="$LIBS"
14947 LIBS="-lcrypt  $LIBS"
14948 cat > conftest.$ac_ext <<EOF
14949 #line 14950 "configure"
14950 #include "confdefs.h"
14951 /* Override any gcc2 internal prototype to avoid an error.  */
14952 /* We use char because int might match the return type of a gcc2
14953     builtin and then its argument prototype would still apply.  */
14954 char crypt();
14955
14956 int main() {
14957 crypt()
14958 ; return 0; }
14959 EOF
14960 if { (eval echo configure:14961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14961   rm -rf conftest*
14962   eval "ac_cv_lib_$ac_lib_var=yes"
14963 else
14964   echo "configure: failed program was:" >&5
14965   cat conftest.$ac_ext >&5
14966   rm -rf conftest*
14967   eval "ac_cv_lib_$ac_lib_var=no"
14968 fi
14969 rm -f conftest*
14970 LIBS="$ac_save_LIBS"
14971
14972 fi
14973 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14974   echo "$ac_t""yes" 1>&6
14975   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
14976                         have_crypt=yes
14977 else
14978   echo "$ac_t""no" 1>&6
14979 have_crypt=no
14980 fi
14981
14982 fi
14983
14984
14985         if test $have_crypt = yes ; then
14986                 cat >> confdefs.h <<\EOF
14987 #define HAVE_CRYPT 1
14988 EOF
14989
14990         else
14991                 echo "configure: warning: could not find crypt" 1>&2
14992                 if test $ol_enable_crypt = yes ; then
14993                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
14994                 fi
14995
14996                 echo "configure: warning: disabling crypt support" 1>&2
14997                 ol_enable_crypt=no
14998         fi
14999 fi
15000
15001 if test $ol_enable_proctitle != no ; then
15002         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
15003 echo "configure:15004: checking for setproctitle" >&5
15004 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
15005   echo $ac_n "(cached) $ac_c" 1>&6
15006 else
15007   cat > conftest.$ac_ext <<EOF
15008 #line 15009 "configure"
15009 #include "confdefs.h"
15010 /* System header to define __stub macros and hopefully few prototypes,
15011     which can conflict with char setproctitle(); below.  */
15012 #include <assert.h>
15013 /* Override any gcc2 internal prototype to avoid an error.  */
15014 /* We use char because int might match the return type of a gcc2
15015     builtin and then its argument prototype would still apply.  */
15016 char setproctitle();
15017 char (*f)();
15018
15019 int main() {
15020
15021 /* The GNU C library defines this for functions which it implements
15022     to always fail with ENOSYS.  Some functions are actually named
15023     something starting with __ and the normal name is an alias.  */
15024 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
15025 choke me
15026 #else
15027 f = setproctitle;
15028 #endif
15029
15030 ; return 0; }
15031 EOF
15032 if { (eval echo configure:15033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15033   rm -rf conftest*
15034   eval "ac_cv_func_setproctitle=yes"
15035 else
15036   echo "configure: failed program was:" >&5
15037   cat conftest.$ac_ext >&5
15038   rm -rf conftest*
15039   eval "ac_cv_func_setproctitle=no"
15040 fi
15041 rm -f conftest*
15042 fi
15043
15044 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
15045   echo "$ac_t""yes" 1>&6
15046   have_setproctitle=yes
15047 else
15048   echo "$ac_t""no" 1>&6
15049
15050                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
15051 echo "configure:15052: checking for setproctitle in -lutil" >&5
15052 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
15053 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15054   echo $ac_n "(cached) $ac_c" 1>&6
15055 else
15056   ac_save_LIBS="$LIBS"
15057 LIBS="-lutil  $LIBS"
15058 cat > conftest.$ac_ext <<EOF
15059 #line 15060 "configure"
15060 #include "confdefs.h"
15061 /* Override any gcc2 internal prototype to avoid an error.  */
15062 /* We use char because int might match the return type of a gcc2
15063     builtin and then its argument prototype would still apply.  */
15064 char setproctitle();
15065
15066 int main() {
15067 setproctitle()
15068 ; return 0; }
15069 EOF
15070 if { (eval echo configure:15071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15071   rm -rf conftest*
15072   eval "ac_cv_lib_$ac_lib_var=yes"
15073 else
15074   echo "configure: failed program was:" >&5
15075   cat conftest.$ac_ext >&5
15076   rm -rf conftest*
15077   eval "ac_cv_lib_$ac_lib_var=no"
15078 fi
15079 rm -f conftest*
15080 LIBS="$ac_save_LIBS"
15081
15082 fi
15083 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15084   echo "$ac_t""yes" 1>&6
15085   have_setproctitle=yes
15086                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
15087 else
15088   echo "$ac_t""no" 1>&6
15089 have_setproctitle=no
15090                         LIBOBJS="$LIBOBJS setproctitle.o"
15091                         LIBSRCS="$LIBSRCS setproctitle.c"
15092 fi
15093
15094 fi
15095
15096
15097         if test $have_setproctitle = yes ; then
15098                 cat >> confdefs.h <<\EOF
15099 #define HAVE_SETPROCTITLE 1
15100 EOF
15101
15102         fi
15103 fi
15104
15105 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
15106 echo "configure:15107: checking for ANSI C header files" >&5
15107 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
15108   echo $ac_n "(cached) $ac_c" 1>&6
15109 else
15110   cat > conftest.$ac_ext <<EOF
15111 #line 15112 "configure"
15112 #include "confdefs.h"
15113 #include <stdlib.h>
15114 #include <stdarg.h>
15115 #include <string.h>
15116 #include <float.h>
15117 EOF
15118 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15119 { (eval echo configure:15120: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15120 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15121 if test -z "$ac_err"; then
15122   rm -rf conftest*
15123   ac_cv_header_stdc=yes
15124 else
15125   echo "$ac_err" >&5
15126   echo "configure: failed program was:" >&5
15127   cat conftest.$ac_ext >&5
15128   rm -rf conftest*
15129   ac_cv_header_stdc=no
15130 fi
15131 rm -f conftest*
15132
15133 if test $ac_cv_header_stdc = yes; then
15134   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15135 cat > conftest.$ac_ext <<EOF
15136 #line 15137 "configure"
15137 #include "confdefs.h"
15138 #include <string.h>
15139 EOF
15140 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15141   egrep "memchr" >/dev/null 2>&1; then
15142   :
15143 else
15144   rm -rf conftest*
15145   ac_cv_header_stdc=no
15146 fi
15147 rm -f conftest*
15148
15149 fi
15150
15151 if test $ac_cv_header_stdc = yes; then
15152   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15153 cat > conftest.$ac_ext <<EOF
15154 #line 15155 "configure"
15155 #include "confdefs.h"
15156 #include <stdlib.h>
15157 EOF
15158 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15159   egrep "free" >/dev/null 2>&1; then
15160   :
15161 else
15162   rm -rf conftest*
15163   ac_cv_header_stdc=no
15164 fi
15165 rm -f conftest*
15166
15167 fi
15168
15169 if test $ac_cv_header_stdc = yes; then
15170   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15171 if test "$cross_compiling" = yes; then
15172   :
15173 else
15174   cat > conftest.$ac_ext <<EOF
15175 #line 15176 "configure"
15176 #include "confdefs.h"
15177 #include <ctype.h>
15178 #if ((' ' & 0x0FF) == 0x020)
15179 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15180 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15181 #else
15182 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15183  || ('j' <= (c) && (c) <= 'r') \
15184  || ('s' <= (c) && (c) <= 'z'))
15185 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15186 #endif
15187 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15188 int main () { int i; for (i = 0; i < 256; i++)
15189 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
15190 exit (0); }
15191
15192 EOF
15193 if { (eval echo configure:15194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15194 then
15195   :
15196 else
15197   echo "configure: failed program was:" >&5
15198   cat conftest.$ac_ext >&5
15199   rm -fr conftest*
15200   ac_cv_header_stdc=no
15201 fi
15202 rm -fr conftest*
15203 fi
15204
15205 fi
15206 fi
15207
15208 echo "$ac_t""$ac_cv_header_stdc" 1>&6
15209 if test $ac_cv_header_stdc = yes; then
15210   cat >> confdefs.h <<\EOF
15211 #define STDC_HEADERS 1
15212 EOF
15213
15214 fi
15215
15216 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
15217 echo "configure:15218: checking for mode_t" >&5
15218 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
15219   echo $ac_n "(cached) $ac_c" 1>&6
15220 else
15221   cat > conftest.$ac_ext <<EOF
15222 #line 15223 "configure"
15223 #include "confdefs.h"
15224 #include <sys/types.h>
15225 #if STDC_HEADERS
15226 #include <stdlib.h>
15227 #include <stddef.h>
15228 #endif
15229
15230 EOF
15231 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15232   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15233   rm -rf conftest*
15234   eval "ac_cv_type_mode_t=yes"
15235 else
15236   rm -rf conftest*
15237   eval "ac_cv_type_mode_t=no"
15238 fi
15239 rm -f conftest*
15240
15241 fi
15242 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
15243   echo "$ac_t""yes" 1>&6
15244 else
15245   echo "$ac_t""no" 1>&6
15246   cat >> confdefs.h <<EOF
15247 #define mode_t int
15248 EOF
15249
15250 fi
15251
15252 echo $ac_n "checking for off_t""... $ac_c" 1>&6
15253 echo "configure:15254: checking for off_t" >&5
15254 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
15255   echo $ac_n "(cached) $ac_c" 1>&6
15256 else
15257   cat > conftest.$ac_ext <<EOF
15258 #line 15259 "configure"
15259 #include "confdefs.h"
15260 #include <sys/types.h>
15261 #if STDC_HEADERS
15262 #include <stdlib.h>
15263 #include <stddef.h>
15264 #endif
15265
15266 EOF
15267 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15268   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15269   rm -rf conftest*
15270   eval "ac_cv_type_off_t=yes"
15271 else
15272   rm -rf conftest*
15273   eval "ac_cv_type_off_t=no"
15274 fi
15275 rm -f conftest*
15276
15277 fi
15278 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
15279   echo "$ac_t""yes" 1>&6
15280 else
15281   echo "$ac_t""no" 1>&6
15282   cat >> confdefs.h <<EOF
15283 #define off_t long
15284 EOF
15285
15286 fi
15287
15288 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
15289 echo "configure:15290: checking for pid_t" >&5
15290 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
15291   echo $ac_n "(cached) $ac_c" 1>&6
15292 else
15293   cat > conftest.$ac_ext <<EOF
15294 #line 15295 "configure"
15295 #include "confdefs.h"
15296 #include <sys/types.h>
15297 #if STDC_HEADERS
15298 #include <stdlib.h>
15299 #include <stddef.h>
15300 #endif
15301
15302 EOF
15303 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15304   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15305   rm -rf conftest*
15306   eval "ac_cv_type_pid_t=yes"
15307 else
15308   rm -rf conftest*
15309   eval "ac_cv_type_pid_t=no"
15310 fi
15311 rm -f conftest*
15312
15313 fi
15314 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
15315   echo "$ac_t""yes" 1>&6
15316 else
15317   echo "$ac_t""no" 1>&6
15318   cat >> confdefs.h <<EOF
15319 #define pid_t int
15320 EOF
15321
15322 fi
15323
15324 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
15325 echo "configure:15326: checking for ptrdiff_t" >&5
15326 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
15327   echo $ac_n "(cached) $ac_c" 1>&6
15328 else
15329   cat > conftest.$ac_ext <<EOF
15330 #line 15331 "configure"
15331 #include "confdefs.h"
15332 #include <stddef.h>
15333 int main() {
15334 ptrdiff_t p
15335 ; return 0; }
15336 EOF
15337 if { (eval echo configure:15338: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15338   rm -rf conftest*
15339   am_cv_type_ptrdiff_t=yes
15340 else
15341   echo "configure: failed program was:" >&5
15342   cat conftest.$ac_ext >&5
15343   rm -rf conftest*
15344   am_cv_type_ptrdiff_t=no
15345 fi
15346 rm -f conftest*
15347 fi
15348
15349 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
15350    if test $am_cv_type_ptrdiff_t = yes; then
15351      cat >> confdefs.h <<\EOF
15352 #define HAVE_PTRDIFF_T 1
15353 EOF
15354
15355    fi
15356
15357 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
15358 echo "configure:15359: checking return type of signal handlers" >&5
15359 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
15360   echo $ac_n "(cached) $ac_c" 1>&6
15361 else
15362   cat > conftest.$ac_ext <<EOF
15363 #line 15364 "configure"
15364 #include "confdefs.h"
15365 #include <sys/types.h>
15366 #include <signal.h>
15367 #ifdef signal
15368 #undef signal
15369 #endif
15370 #ifdef __cplusplus
15371 extern "C" void (*signal (int, void (*)(int)))(int);
15372 #else
15373 void (*signal ()) ();
15374 #endif
15375
15376 int main() {
15377 int i;
15378 ; return 0; }
15379 EOF
15380 if { (eval echo configure:15381: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15381   rm -rf conftest*
15382   ac_cv_type_signal=void
15383 else
15384   echo "configure: failed program was:" >&5
15385   cat conftest.$ac_ext >&5
15386   rm -rf conftest*
15387   ac_cv_type_signal=int
15388 fi
15389 rm -f conftest*
15390 fi
15391
15392 echo "$ac_t""$ac_cv_type_signal" 1>&6
15393 cat >> confdefs.h <<EOF
15394 #define RETSIGTYPE $ac_cv_type_signal
15395 EOF
15396
15397
15398 echo $ac_n "checking for size_t""... $ac_c" 1>&6
15399 echo "configure:15400: checking for size_t" >&5
15400 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
15401   echo $ac_n "(cached) $ac_c" 1>&6
15402 else
15403   cat > conftest.$ac_ext <<EOF
15404 #line 15405 "configure"
15405 #include "confdefs.h"
15406 #include <sys/types.h>
15407 #if STDC_HEADERS
15408 #include <stdlib.h>
15409 #include <stddef.h>
15410 #endif
15411
15412 EOF
15413 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15414   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15415   rm -rf conftest*
15416   eval "ac_cv_type_size_t=yes"
15417 else
15418   rm -rf conftest*
15419   eval "ac_cv_type_size_t=no"
15420 fi
15421 rm -f conftest*
15422
15423 fi
15424 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
15425   echo "$ac_t""yes" 1>&6
15426 else
15427   echo "$ac_t""no" 1>&6
15428   cat >> confdefs.h <<EOF
15429 #define size_t unsigned
15430 EOF
15431
15432 fi
15433
15434
15435 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
15436 echo "configure:15437: checking for ssize_t" >&5
15437 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
15438   echo $ac_n "(cached) $ac_c" 1>&6
15439 else
15440   cat > conftest.$ac_ext <<EOF
15441 #line 15442 "configure"
15442 #include "confdefs.h"
15443 #include <sys/types.h>
15444 #if STDC_HEADERS
15445 #include <stdlib.h>
15446 #include <stddef.h>
15447 #endif
15448
15449 EOF
15450 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15451   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15452   rm -rf conftest*
15453   eval "ac_cv_type_ssize_t=yes"
15454 else
15455   rm -rf conftest*
15456   eval "ac_cv_type_ssize_t=no"
15457 fi
15458 rm -f conftest*
15459
15460 fi
15461 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
15462   echo "$ac_t""yes" 1>&6
15463 else
15464   echo "$ac_t""no" 1>&6
15465   cat >> confdefs.h <<EOF
15466 #define ssize_t signed int
15467 EOF
15468
15469 fi
15470
15471 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
15472 echo "configure:15473: checking for caddr_t" >&5
15473 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
15474   echo $ac_n "(cached) $ac_c" 1>&6
15475 else
15476   cat > conftest.$ac_ext <<EOF
15477 #line 15478 "configure"
15478 #include "confdefs.h"
15479 #include <sys/types.h>
15480 #if STDC_HEADERS
15481 #include <stdlib.h>
15482 #include <stddef.h>
15483 #endif
15484
15485 EOF
15486 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15487   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15488   rm -rf conftest*
15489   eval "ac_cv_type_caddr_t=yes"
15490 else
15491   rm -rf conftest*
15492   eval "ac_cv_type_caddr_t=no"
15493 fi
15494 rm -f conftest*
15495
15496 fi
15497 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
15498   echo "$ac_t""yes" 1>&6
15499 else
15500   echo "$ac_t""no" 1>&6
15501   cat >> confdefs.h <<EOF
15502 #define caddr_t char *
15503 EOF
15504
15505 fi
15506
15507
15508 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
15509 echo "configure:15510: checking for socklen_t" >&5
15510 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
15511   echo $ac_n "(cached) $ac_c" 1>&6
15512 else
15513   cat > conftest.$ac_ext <<EOF
15514 #line 15515 "configure"
15515 #include "confdefs.h"
15516
15517 #ifdef HAVE_SYS_TYPES_H
15518 #include <sys/types.h>
15519 #endif
15520 #ifdef HAVE_SYS_SOCKET_H
15521 #include <sys/socket.h>
15522 #endif
15523
15524 int main() {
15525 socklen_t len;
15526 ; return 0; }
15527 EOF
15528 if { (eval echo configure:15529: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15529   rm -rf conftest*
15530   ol_cv_type_socklen_t=yes
15531 else
15532   echo "configure: failed program was:" >&5
15533   cat conftest.$ac_ext >&5
15534   rm -rf conftest*
15535   ol_cv_type_socklen_t=no
15536 fi
15537 rm -f conftest*
15538 fi
15539
15540 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
15541   if test $ol_cv_type_socklen_t = no; then
15542     cat >> confdefs.h <<\EOF
15543 #define socklen_t int
15544 EOF
15545
15546   fi
15547  
15548 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
15549 echo "configure:15550: checking for member st_blksize in aggregate type struct stat" >&5
15550 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
15551   echo $ac_n "(cached) $ac_c" 1>&6
15552 else
15553   cat > conftest.$ac_ext <<EOF
15554 #line 15555 "configure"
15555 #include "confdefs.h"
15556 #include <sys/types.h>
15557 #include <sys/stat.h>
15558 int main() {
15559 struct stat foo; foo.st_blksize;
15560 ; return 0; }
15561 EOF
15562 if { (eval echo configure:15563: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15563   rm -rf conftest*
15564   ac_cv_c_struct_member_st_blksize=yes
15565 else
15566   echo "configure: failed program was:" >&5
15567   cat conftest.$ac_ext >&5
15568   rm -rf conftest*
15569   ac_cv_c_struct_member_st_blksize=no
15570 fi
15571 rm -f conftest*
15572 fi
15573
15574 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
15575 st_blksize="$ac_cv_c_struct_member_st_blksize"
15576 if test $ac_cv_c_struct_member_st_blksize = yes; then
15577   cat >> confdefs.h <<\EOF
15578 #define HAVE_ST_BLKSIZE 1
15579 EOF
15580
15581 fi
15582
15583 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
15584 echo "configure:15585: checking whether time.h and sys/time.h may both be included" >&5
15585 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
15586   echo $ac_n "(cached) $ac_c" 1>&6
15587 else
15588   cat > conftest.$ac_ext <<EOF
15589 #line 15590 "configure"
15590 #include "confdefs.h"
15591 #include <sys/types.h>
15592 #include <sys/time.h>
15593 #include <time.h>
15594 int main() {
15595 struct tm *tp;
15596 ; return 0; }
15597 EOF
15598 if { (eval echo configure:15599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15599   rm -rf conftest*
15600   ac_cv_header_time=yes
15601 else
15602   echo "configure: failed program was:" >&5
15603   cat conftest.$ac_ext >&5
15604   rm -rf conftest*
15605   ac_cv_header_time=no
15606 fi
15607 rm -f conftest*
15608 fi
15609
15610 echo "$ac_t""$ac_cv_header_time" 1>&6
15611 if test $ac_cv_header_time = yes; then
15612   cat >> confdefs.h <<\EOF
15613 #define TIME_WITH_SYS_TIME 1
15614 EOF
15615
15616 fi
15617
15618 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
15619 echo "configure:15620: checking whether struct tm is in sys/time.h or time.h" >&5
15620 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
15621   echo $ac_n "(cached) $ac_c" 1>&6
15622 else
15623   cat > conftest.$ac_ext <<EOF
15624 #line 15625 "configure"
15625 #include "confdefs.h"
15626 #include <sys/types.h>
15627 #include <time.h>
15628 int main() {
15629 struct tm *tp; tp->tm_sec;
15630 ; return 0; }
15631 EOF
15632 if { (eval echo configure:15633: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15633   rm -rf conftest*
15634   ac_cv_struct_tm=time.h
15635 else
15636   echo "configure: failed program was:" >&5
15637   cat conftest.$ac_ext >&5
15638   rm -rf conftest*
15639   ac_cv_struct_tm=sys/time.h
15640 fi
15641 rm -f conftest*
15642 fi
15643
15644 echo "$ac_t""$ac_cv_struct_tm" 1>&6
15645 if test $ac_cv_struct_tm = sys/time.h; then
15646   cat >> confdefs.h <<\EOF
15647 #define TM_IN_SYS_TIME 1
15648 EOF
15649
15650 fi
15651
15652 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
15653 echo "configure:15654: checking for uid_t in sys/types.h" >&5
15654 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
15655   echo $ac_n "(cached) $ac_c" 1>&6
15656 else
15657   cat > conftest.$ac_ext <<EOF
15658 #line 15659 "configure"
15659 #include "confdefs.h"
15660 #include <sys/types.h>
15661 EOF
15662 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15663   egrep "uid_t" >/dev/null 2>&1; then
15664   rm -rf conftest*
15665   ac_cv_type_uid_t=yes
15666 else
15667   rm -rf conftest*
15668   ac_cv_type_uid_t=no
15669 fi
15670 rm -f conftest*
15671
15672 fi
15673
15674 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
15675 if test $ac_cv_type_uid_t = no; then
15676   cat >> confdefs.h <<\EOF
15677 #define uid_t int
15678 EOF
15679
15680   cat >> confdefs.h <<\EOF
15681 #define gid_t int
15682 EOF
15683
15684 fi
15685
15686 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
15687 echo "configure:15688: checking for sig_atomic_t" >&5
15688 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
15689   echo $ac_n "(cached) $ac_c" 1>&6
15690 else
15691   cat > conftest.$ac_ext <<EOF
15692 #line 15693 "configure"
15693 #include "confdefs.h"
15694 #include <signal.h>
15695 int main() {
15696 sig_atomic_t atomic;
15697 ; return 0; }
15698 EOF
15699 if { (eval echo configure:15700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15700   rm -rf conftest*
15701   ol_cv_type_sig_atomic_t=yes
15702 else
15703   echo "configure: failed program was:" >&5
15704   cat conftest.$ac_ext >&5
15705   rm -rf conftest*
15706   ol_cv_type_sig_atomic_t=no
15707 fi
15708 rm -f conftest*
15709 fi
15710
15711 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
15712   if test $ol_cv_type_sig_atomic_t = no; then
15713     cat >> confdefs.h <<\EOF
15714 #define sig_atomic_t int
15715 EOF
15716
15717   fi
15718  
15719
15720
15721 # test for pw_gecos in struct passwd
15722 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
15723 echo "configure:15724: checking struct passwd for pw_gecos" >&5
15724 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
15725   echo $ac_n "(cached) $ac_c" 1>&6
15726 else
15727   
15728         cat > conftest.$ac_ext <<EOF
15729 #line 15730 "configure"
15730 #include "confdefs.h"
15731 #include <pwd.h>
15732 int main() {
15733
15734         struct passwd pwd;
15735         pwd.pw_gecos = pwd.pw_name;
15736
15737 ; return 0; }
15738 EOF
15739 if { (eval echo configure:15740: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15740   rm -rf conftest*
15741   ol_cv_struct_passwd_pw_gecos=yes
15742 else
15743   echo "configure: failed program was:" >&5
15744   cat conftest.$ac_ext >&5
15745   rm -rf conftest*
15746   ol_cv_struct_passwd_pw_gecos=no
15747 fi
15748 rm -f conftest*
15749 fi
15750
15751 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
15752 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
15753         cat >> confdefs.h <<\EOF
15754 #define HAVE_PW_GECOS 1
15755 EOF
15756
15757 fi
15758
15759 # test for pw_passwd in struct passwd
15760 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
15761 echo "configure:15762: checking struct passwd for pw_passwd" >&5
15762 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
15763   echo $ac_n "(cached) $ac_c" 1>&6
15764 else
15765   
15766         cat > conftest.$ac_ext <<EOF
15767 #line 15768 "configure"
15768 #include "confdefs.h"
15769 #include <pwd.h>
15770 int main() {
15771
15772         struct passwd pwd;
15773         pwd.pw_passwd = pwd.pw_name;
15774
15775 ; return 0; }
15776 EOF
15777 if { (eval echo configure:15778: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15778   rm -rf conftest*
15779   ol_cv_struct_passwd_pw_passwd=yes
15780 else
15781   echo "configure: failed program was:" >&5
15782   cat conftest.$ac_ext >&5
15783   rm -rf conftest*
15784   ol_cv_struct_passwd_pw_passwd=no
15785 fi
15786 rm -f conftest*
15787 fi
15788
15789 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
15790 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
15791         cat >> confdefs.h <<\EOF
15792 #define HAVE_PW_PASSWD 1
15793 EOF
15794
15795 fi
15796
15797
15798 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
15799 echo "configure:15800: checking if toupper() requires islower()" >&5
15800 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
15801   echo $ac_n "(cached) $ac_c" 1>&6
15802 else
15803   
15804         if test "$cross_compiling" = yes; then
15805   ol_cv_c_upper_lower=safe
15806 else
15807   cat > conftest.$ac_ext <<EOF
15808 #line 15809 "configure"
15809 #include "confdefs.h"
15810
15811 #include <ctype.h>
15812 main()
15813 {
15814         if ('C' == toupper('C'))
15815                 exit(0);
15816         else
15817                 exit(1);
15818 }
15819 EOF
15820 if { (eval echo configure:15821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15821 then
15822   ol_cv_c_upper_lower=no
15823 else
15824   echo "configure: failed program was:" >&5
15825   cat conftest.$ac_ext >&5
15826   rm -fr conftest*
15827   ol_cv_c_upper_lower=yes
15828 fi
15829 rm -fr conftest*
15830 fi
15831
15832 fi
15833
15834 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
15835 if test $ol_cv_c_upper_lower != no ; then
15836         cat >> confdefs.h <<\EOF
15837 #define C_UPPER_LOWER 1
15838 EOF
15839
15840 fi
15841
15842 echo $ac_n "checking for working const""... $ac_c" 1>&6
15843 echo "configure:15844: checking for working const" >&5
15844 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
15845   echo $ac_n "(cached) $ac_c" 1>&6
15846 else
15847   cat > conftest.$ac_ext <<EOF
15848 #line 15849 "configure"
15849 #include "confdefs.h"
15850
15851 int main() {
15852
15853 /* Ultrix mips cc rejects this.  */
15854 typedef int charset[2]; const charset x;
15855 /* SunOS 4.1.1 cc rejects this.  */
15856 char const *const *ccp;
15857 char **p;
15858 /* NEC SVR4.0.2 mips cc rejects this.  */
15859 struct point {int x, y;};
15860 static struct point const zero = {0,0};
15861 /* AIX XL C 1.02.0.0 rejects this.
15862    It does not let you subtract one const X* pointer from another in an arm
15863    of an if-expression whose if-part is not a constant expression */
15864 const char *g = "string";
15865 ccp = &g + (g ? g-g : 0);
15866 /* HPUX 7.0 cc rejects these. */
15867 ++ccp;
15868 p = (char**) ccp;
15869 ccp = (char const *const *) p;
15870 { /* SCO 3.2v4 cc rejects this.  */
15871   char *t;
15872   char const *s = 0 ? (char *) 0 : (char const *) 0;
15873
15874   *t++ = 0;
15875 }
15876 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
15877   int x[] = {25, 17};
15878   const int *foo = &x[0];
15879   ++foo;
15880 }
15881 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
15882   typedef const int *iptr;
15883   iptr p = 0;
15884   ++p;
15885 }
15886 { /* AIX XL C 1.02.0.0 rejects this saying
15887      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
15888   struct s { int j; const int *ap[3]; };
15889   struct s *b; b->j = 5;
15890 }
15891 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
15892   const int foo = 10;
15893 }
15894
15895 ; return 0; }
15896 EOF
15897 if { (eval echo configure:15898: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15898   rm -rf conftest*
15899   ac_cv_c_const=yes
15900 else
15901   echo "configure: failed program was:" >&5
15902   cat conftest.$ac_ext >&5
15903   rm -rf conftest*
15904   ac_cv_c_const=no
15905 fi
15906 rm -f conftest*
15907 fi
15908
15909 echo "$ac_t""$ac_cv_c_const" 1>&6
15910 if test $ac_cv_c_const = no; then
15911   cat >> confdefs.h <<\EOF
15912 #define const 
15913 EOF
15914
15915 fi
15916
15917 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
15918 echo "configure:15919: checking if compiler understands volatile" >&5
15919 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
15920   echo $ac_n "(cached) $ac_c" 1>&6
15921 else
15922   cat > conftest.$ac_ext <<EOF
15923 #line 15924 "configure"
15924 #include "confdefs.h"
15925 int x, y, z;
15926 int main() {
15927 volatile int a; int * volatile b = x ? &y : &z;
15928       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
15929       *b = 0;
15930 ; return 0; }
15931 EOF
15932 if { (eval echo configure:15933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15933   rm -rf conftest*
15934   ol_cv_c_volatile=yes
15935 else
15936   echo "configure: failed program was:" >&5
15937   cat conftest.$ac_ext >&5
15938   rm -rf conftest*
15939   ol_cv_c_volatile=no
15940 fi
15941 rm -f conftest*
15942 fi
15943
15944 echo "$ac_t""$ol_cv_c_volatile" 1>&6
15945   if test $ol_cv_c_volatile = yes; then
15946     : 
15947   else
15948     cat >> confdefs.h <<\EOF
15949 #define volatile 
15950 EOF
15951
15952   fi
15953  
15954
15955 if test $cross_compiling = yes ; then
15956         cat >> confdefs.h <<\EOF
15957 #define CROSS_COMPILING 1
15958 EOF
15959
15960 else
15961         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
15962 echo "configure:15963: checking whether byte ordering is bigendian" >&5
15963 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
15964   echo $ac_n "(cached) $ac_c" 1>&6
15965 else
15966   ac_cv_c_bigendian=unknown
15967 # See if sys/param.h defines the BYTE_ORDER macro.
15968 cat > conftest.$ac_ext <<EOF
15969 #line 15970 "configure"
15970 #include "confdefs.h"
15971 #include <sys/types.h>
15972 #include <sys/param.h>
15973 int main() {
15974
15975 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
15976  bogus endian macros
15977 #endif
15978 ; return 0; }
15979 EOF
15980 if { (eval echo configure:15981: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15981   rm -rf conftest*
15982   # It does; now see whether it defined to BIG_ENDIAN or not.
15983 cat > conftest.$ac_ext <<EOF
15984 #line 15985 "configure"
15985 #include "confdefs.h"
15986 #include <sys/types.h>
15987 #include <sys/param.h>
15988 int main() {
15989
15990 #if BYTE_ORDER != BIG_ENDIAN
15991  not big endian
15992 #endif
15993 ; return 0; }
15994 EOF
15995 if { (eval echo configure:15996: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15996   rm -rf conftest*
15997   ac_cv_c_bigendian=yes
15998 else
15999   echo "configure: failed program was:" >&5
16000   cat conftest.$ac_ext >&5
16001   rm -rf conftest*
16002   ac_cv_c_bigendian=no
16003 fi
16004 rm -f conftest*
16005 else
16006   echo "configure: failed program was:" >&5
16007   cat conftest.$ac_ext >&5
16008 fi
16009 rm -f conftest*
16010 if test $ac_cv_c_bigendian = unknown; then
16011 if test "$cross_compiling" = yes; then
16012     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
16013 else
16014   cat > conftest.$ac_ext <<EOF
16015 #line 16016 "configure"
16016 #include "confdefs.h"
16017 main () {
16018   /* Are we little or big endian?  From Harbison&Steele.  */
16019   union
16020   {
16021     long l;
16022     char c[sizeof (long)];
16023   } u;
16024   u.l = 1;
16025   exit (u.c[sizeof (long) - 1] == 1);
16026 }
16027 EOF
16028 if { (eval echo configure:16029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16029 then
16030   ac_cv_c_bigendian=no
16031 else
16032   echo "configure: failed program was:" >&5
16033   cat conftest.$ac_ext >&5
16034   rm -fr conftest*
16035   ac_cv_c_bigendian=yes
16036 fi
16037 rm -fr conftest*
16038 fi
16039
16040 fi
16041 fi
16042
16043 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
16044 if test $ac_cv_c_bigendian = yes; then
16045   cat >> confdefs.h <<\EOF
16046 #define WORDS_BIGENDIAN 1
16047 EOF
16048
16049 fi
16050
16051 fi
16052
16053 echo $ac_n "checking size of short""... $ac_c" 1>&6
16054 echo "configure:16055: checking size of short" >&5 
16055 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
16056   echo $ac_n "(cached) $ac_c" 1>&6
16057 else
16058   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16059   cat > conftest.$ac_ext <<EOF
16060 #line 16061 "configure"
16061 #include "confdefs.h"
16062 #include "confdefs.h" 
16063 #include <sys/types.h> 
16064  
16065
16066 int main() {
16067 switch (0) case 0: case (sizeof (short) == $ac_size):;
16068 ; return 0; }
16069 EOF
16070 if { (eval echo configure:16071: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16071   rm -rf conftest*
16072   ac_cv_sizeof_short=$ac_size
16073 else
16074   echo "configure: failed program was:" >&5
16075   cat conftest.$ac_ext >&5
16076 fi
16077 rm -f conftest* 
16078   if test x$ac_cv_sizeof_short != x ; then break; fi 
16079 done 
16080
16081 fi
16082  
16083 if test x$ac_cv_sizeof_short = x ; then 
16084   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
16085 fi 
16086 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
16087 cat >> confdefs.h <<EOF
16088 #define SIZEOF_SHORT $ac_cv_sizeof_short
16089 EOF
16090  
16091  
16092 echo $ac_n "checking size of int""... $ac_c" 1>&6
16093 echo "configure:16094: checking size of int" >&5 
16094 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
16095   echo $ac_n "(cached) $ac_c" 1>&6
16096 else
16097   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16098   cat > conftest.$ac_ext <<EOF
16099 #line 16100 "configure"
16100 #include "confdefs.h"
16101 #include "confdefs.h" 
16102 #include <sys/types.h> 
16103  
16104
16105 int main() {
16106 switch (0) case 0: case (sizeof (int) == $ac_size):;
16107 ; return 0; }
16108 EOF
16109 if { (eval echo configure:16110: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16110   rm -rf conftest*
16111   ac_cv_sizeof_int=$ac_size
16112 else
16113   echo "configure: failed program was:" >&5
16114   cat conftest.$ac_ext >&5
16115 fi
16116 rm -f conftest* 
16117   if test x$ac_cv_sizeof_int != x ; then break; fi 
16118 done 
16119
16120 fi
16121  
16122 if test x$ac_cv_sizeof_int = x ; then 
16123   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
16124 fi 
16125 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
16126 cat >> confdefs.h <<EOF
16127 #define SIZEOF_INT $ac_cv_sizeof_int
16128 EOF
16129  
16130  
16131 echo $ac_n "checking size of long""... $ac_c" 1>&6
16132 echo "configure:16133: checking size of long" >&5 
16133 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
16134   echo $ac_n "(cached) $ac_c" 1>&6
16135 else
16136   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16137   cat > conftest.$ac_ext <<EOF
16138 #line 16139 "configure"
16139 #include "confdefs.h"
16140 #include "confdefs.h" 
16141 #include <sys/types.h> 
16142  
16143
16144 int main() {
16145 switch (0) case 0: case (sizeof (long) == $ac_size):;
16146 ; return 0; }
16147 EOF
16148 if { (eval echo configure:16149: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16149   rm -rf conftest*
16150   ac_cv_sizeof_long=$ac_size
16151 else
16152   echo "configure: failed program was:" >&5
16153   cat conftest.$ac_ext >&5
16154 fi
16155 rm -f conftest* 
16156   if test x$ac_cv_sizeof_long != x ; then break; fi 
16157 done 
16158
16159 fi
16160  
16161 if test x$ac_cv_sizeof_long = x ; then 
16162   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
16163 fi 
16164 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
16165 cat >> confdefs.h <<EOF
16166 #define SIZEOF_LONG $ac_cv_sizeof_long
16167 EOF
16168  
16169
16170
16171 if test "$ac_cv_sizeof_int" -lt 4 ; then
16172         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
16173
16174         cat >> confdefs.h <<\EOF
16175 #define LBER_INT_T long
16176 EOF
16177
16178 else
16179         cat >> confdefs.h <<\EOF
16180 #define LBER_INT_T int
16181 EOF
16182
16183 fi
16184
16185 cat >> confdefs.h <<\EOF
16186 #define LBER_LEN_T long
16187 EOF
16188
16189 cat >> confdefs.h <<\EOF
16190 #define LBER_SOCKET_T int
16191 EOF
16192
16193 cat >> confdefs.h <<\EOF
16194 #define LBER_TAG_T long
16195 EOF
16196
16197
16198 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
16199 echo "configure:16200: checking for 8-bit clean memcmp" >&5
16200 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
16201   echo $ac_n "(cached) $ac_c" 1>&6
16202 else
16203   if test "$cross_compiling" = yes; then
16204   ac_cv_func_memcmp_clean=no
16205 else
16206   cat > conftest.$ac_ext <<EOF
16207 #line 16208 "configure"
16208 #include "confdefs.h"
16209
16210 main()
16211 {
16212   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
16213   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
16214 }
16215
16216 EOF
16217 if { (eval echo configure:16218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16218 then
16219   ac_cv_func_memcmp_clean=yes
16220 else
16221   echo "configure: failed program was:" >&5
16222   cat conftest.$ac_ext >&5
16223   rm -fr conftest*
16224   ac_cv_func_memcmp_clean=no
16225 fi
16226 rm -fr conftest*
16227 fi
16228
16229 fi
16230
16231 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
16232 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
16233
16234 echo $ac_n "checking for strftime""... $ac_c" 1>&6
16235 echo "configure:16236: checking for strftime" >&5
16236 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
16237   echo $ac_n "(cached) $ac_c" 1>&6
16238 else
16239   cat > conftest.$ac_ext <<EOF
16240 #line 16241 "configure"
16241 #include "confdefs.h"
16242 /* System header to define __stub macros and hopefully few prototypes,
16243     which can conflict with char strftime(); below.  */
16244 #include <assert.h>
16245 /* Override any gcc2 internal prototype to avoid an error.  */
16246 /* We use char because int might match the return type of a gcc2
16247     builtin and then its argument prototype would still apply.  */
16248 char strftime();
16249 char (*f)();
16250
16251 int main() {
16252
16253 /* The GNU C library defines this for functions which it implements
16254     to always fail with ENOSYS.  Some functions are actually named
16255     something starting with __ and the normal name is an alias.  */
16256 #if defined (__stub_strftime) || defined (__stub___strftime)
16257 choke me
16258 #else
16259 f = strftime;
16260 #endif
16261
16262 ; return 0; }
16263 EOF
16264 if { (eval echo configure:16265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16265   rm -rf conftest*
16266   eval "ac_cv_func_strftime=yes"
16267 else
16268   echo "configure: failed program was:" >&5
16269   cat conftest.$ac_ext >&5
16270   rm -rf conftest*
16271   eval "ac_cv_func_strftime=no"
16272 fi
16273 rm -f conftest*
16274 fi
16275
16276 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
16277   echo "$ac_t""yes" 1>&6
16278   cat >> confdefs.h <<\EOF
16279 #define HAVE_STRFTIME 1
16280 EOF
16281
16282 else
16283   echo "$ac_t""no" 1>&6
16284 # strftime is in -lintl on SCO UNIX.
16285 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
16286 echo "configure:16287: checking for strftime in -lintl" >&5
16287 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
16288 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
16289   echo $ac_n "(cached) $ac_c" 1>&6
16290 else
16291   ac_save_LIBS="$LIBS"
16292 LIBS="-lintl  $LIBS"
16293 cat > conftest.$ac_ext <<EOF
16294 #line 16295 "configure"
16295 #include "confdefs.h"
16296 /* Override any gcc2 internal prototype to avoid an error.  */
16297 /* We use char because int might match the return type of a gcc2
16298     builtin and then its argument prototype would still apply.  */
16299 char strftime();
16300
16301 int main() {
16302 strftime()
16303 ; return 0; }
16304 EOF
16305 if { (eval echo configure:16306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16306   rm -rf conftest*
16307   eval "ac_cv_lib_$ac_lib_var=yes"
16308 else
16309   echo "configure: failed program was:" >&5
16310   cat conftest.$ac_ext >&5
16311   rm -rf conftest*
16312   eval "ac_cv_lib_$ac_lib_var=no"
16313 fi
16314 rm -f conftest*
16315 LIBS="$ac_save_LIBS"
16316
16317 fi
16318 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
16319   echo "$ac_t""yes" 1>&6
16320   cat >> confdefs.h <<\EOF
16321 #define HAVE_STRFTIME 1
16322 EOF
16323
16324 LIBS="-lintl $LIBS"
16325 else
16326   echo "$ac_t""no" 1>&6
16327 fi
16328
16329 fi
16330
16331
16332 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
16333 echo "configure:16334: checking for inet_aton()" >&5
16334 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
16335   echo $ac_n "(cached) $ac_c" 1>&6
16336 else
16337   cat > conftest.$ac_ext <<EOF
16338 #line 16339 "configure"
16339 #include "confdefs.h"
16340
16341 #ifdef HAVE_SYS_TYPES_H
16342 #       include <sys/types.h>
16343 #endif
16344 #ifdef HAVE_SYS_SOCKET_H
16345 #       include <sys/socket.h>
16346 #       ifdef HAVE_SYS_SELECT_H
16347 #               include <sys/select.h>
16348 #       endif
16349 #       include <netinet/in.h>
16350 #       ifdef HAVE_ARPA_INET_H
16351 #               include <arpa/inet.h>
16352 #       endif
16353 #endif
16354
16355 int main() {
16356 struct in_addr in;
16357 int rc = inet_aton( "255.255.255.255", &in );
16358 ; return 0; }
16359 EOF
16360 if { (eval echo configure:16361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16361   rm -rf conftest*
16362   ol_cv_func_inet_aton=yes
16363 else
16364   echo "configure: failed program was:" >&5
16365   cat conftest.$ac_ext >&5
16366   rm -rf conftest*
16367   ol_cv_func_inet_aton=no
16368 fi
16369 rm -f conftest*
16370 fi
16371
16372 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
16373   if test $ol_cv_func_inet_aton != no; then
16374     cat >> confdefs.h <<\EOF
16375 #define HAVE_INET_ATON 1
16376 EOF
16377
16378   fi
16379  
16380
16381 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
16382 echo "configure:16383: checking for _spawnlp" >&5
16383 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
16384   echo $ac_n "(cached) $ac_c" 1>&6
16385 else
16386   cat > conftest.$ac_ext <<EOF
16387 #line 16388 "configure"
16388 #include "confdefs.h"
16389 /* System header to define __stub macros and hopefully few prototypes,
16390     which can conflict with char _spawnlp(); below.  */
16391 #include <assert.h>
16392 /* Override any gcc2 internal prototype to avoid an error.  */
16393 /* We use char because int might match the return type of a gcc2
16394     builtin and then its argument prototype would still apply.  */
16395 char _spawnlp();
16396 char (*f)();
16397
16398 int main() {
16399
16400 /* The GNU C library defines this for functions which it implements
16401     to always fail with ENOSYS.  Some functions are actually named
16402     something starting with __ and the normal name is an alias.  */
16403 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
16404 choke me
16405 #else
16406 f = _spawnlp;
16407 #endif
16408
16409 ; return 0; }
16410 EOF
16411 if { (eval echo configure:16412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16412   rm -rf conftest*
16413   eval "ac_cv_func__spawnlp=yes"
16414 else
16415   echo "configure: failed program was:" >&5
16416   cat conftest.$ac_ext >&5
16417   rm -rf conftest*
16418   eval "ac_cv_func__spawnlp=no"
16419 fi
16420 rm -f conftest*
16421 fi
16422
16423 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
16424   echo "$ac_t""yes" 1>&6
16425   cat >> confdefs.h <<\EOF
16426 #define HAVE_SPAWNLP 1
16427 EOF
16428
16429 else
16430   echo "$ac_t""no" 1>&6
16431 fi
16432
16433
16434 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
16435 echo "configure:16436: checking for _snprintf" >&5
16436 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
16437   echo $ac_n "(cached) $ac_c" 1>&6
16438 else
16439   cat > conftest.$ac_ext <<EOF
16440 #line 16441 "configure"
16441 #include "confdefs.h"
16442 /* System header to define __stub macros and hopefully few prototypes,
16443     which can conflict with char _snprintf(); below.  */
16444 #include <assert.h>
16445 /* Override any gcc2 internal prototype to avoid an error.  */
16446 /* We use char because int might match the return type of a gcc2
16447     builtin and then its argument prototype would still apply.  */
16448 char _snprintf();
16449 char (*f)();
16450
16451 int main() {
16452
16453 /* The GNU C library defines this for functions which it implements
16454     to always fail with ENOSYS.  Some functions are actually named
16455     something starting with __ and the normal name is an alias.  */
16456 #if defined (__stub__snprintf) || defined (__stub____snprintf)
16457 choke me
16458 #else
16459 f = _snprintf;
16460 #endif
16461
16462 ; return 0; }
16463 EOF
16464 if { (eval echo configure:16465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16465   rm -rf conftest*
16466   eval "ac_cv_func__snprintf=yes"
16467 else
16468   echo "configure: failed program was:" >&5
16469   cat conftest.$ac_ext >&5
16470   rm -rf conftest*
16471   eval "ac_cv_func__snprintf=no"
16472 fi
16473 rm -f conftest*
16474 fi
16475
16476 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
16477   echo "$ac_t""yes" 1>&6
16478   ac_cv_func_snprintf=yes
16479         cat >> confdefs.h <<\EOF
16480 #define snprintf _snprintf
16481 EOF
16482
16483
16484 else
16485   echo "$ac_t""no" 1>&6
16486 fi
16487
16488
16489 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
16490 echo "configure:16491: checking for _vsnprintf" >&5
16491 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
16492   echo $ac_n "(cached) $ac_c" 1>&6
16493 else
16494   cat > conftest.$ac_ext <<EOF
16495 #line 16496 "configure"
16496 #include "confdefs.h"
16497 /* System header to define __stub macros and hopefully few prototypes,
16498     which can conflict with char _vsnprintf(); below.  */
16499 #include <assert.h>
16500 /* Override any gcc2 internal prototype to avoid an error.  */
16501 /* We use char because int might match the return type of a gcc2
16502     builtin and then its argument prototype would still apply.  */
16503 char _vsnprintf();
16504 char (*f)();
16505
16506 int main() {
16507
16508 /* The GNU C library defines this for functions which it implements
16509     to always fail with ENOSYS.  Some functions are actually named
16510     something starting with __ and the normal name is an alias.  */
16511 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
16512 choke me
16513 #else
16514 f = _vsnprintf;
16515 #endif
16516
16517 ; return 0; }
16518 EOF
16519 if { (eval echo configure:16520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16520   rm -rf conftest*
16521   eval "ac_cv_func__vsnprintf=yes"
16522 else
16523   echo "configure: failed program was:" >&5
16524   cat conftest.$ac_ext >&5
16525   rm -rf conftest*
16526   eval "ac_cv_func__vsnprintf=no"
16527 fi
16528 rm -f conftest*
16529 fi
16530
16531 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
16532   echo "$ac_t""yes" 1>&6
16533   ac_cv_func_vsnprintf=yes
16534         cat >> confdefs.h <<\EOF
16535 #define vsnprintf _vsnprintf
16536 EOF
16537
16538
16539 else
16540   echo "$ac_t""no" 1>&6
16541 fi
16542
16543
16544 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
16545 echo "configure:16546: checking for vprintf" >&5
16546 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
16547   echo $ac_n "(cached) $ac_c" 1>&6
16548 else
16549   cat > conftest.$ac_ext <<EOF
16550 #line 16551 "configure"
16551 #include "confdefs.h"
16552 /* System header to define __stub macros and hopefully few prototypes,
16553     which can conflict with char vprintf(); below.  */
16554 #include <assert.h>
16555 /* Override any gcc2 internal prototype to avoid an error.  */
16556 /* We use char because int might match the return type of a gcc2
16557     builtin and then its argument prototype would still apply.  */
16558 char vprintf();
16559 char (*f)();
16560
16561 int main() {
16562
16563 /* The GNU C library defines this for functions which it implements
16564     to always fail with ENOSYS.  Some functions are actually named
16565     something starting with __ and the normal name is an alias.  */
16566 #if defined (__stub_vprintf) || defined (__stub___vprintf)
16567 choke me
16568 #else
16569 f = vprintf;
16570 #endif
16571
16572 ; return 0; }
16573 EOF
16574 if { (eval echo configure:16575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16575   rm -rf conftest*
16576   eval "ac_cv_func_vprintf=yes"
16577 else
16578   echo "configure: failed program was:" >&5
16579   cat conftest.$ac_ext >&5
16580   rm -rf conftest*
16581   eval "ac_cv_func_vprintf=no"
16582 fi
16583 rm -f conftest*
16584 fi
16585
16586 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
16587   echo "$ac_t""yes" 1>&6
16588   cat >> confdefs.h <<\EOF
16589 #define HAVE_VPRINTF 1
16590 EOF
16591
16592 else
16593   echo "$ac_t""no" 1>&6
16594 fi
16595
16596 if test "$ac_cv_func_vprintf" != yes; then
16597 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
16598 echo "configure:16599: checking for _doprnt" >&5
16599 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
16600   echo $ac_n "(cached) $ac_c" 1>&6
16601 else
16602   cat > conftest.$ac_ext <<EOF
16603 #line 16604 "configure"
16604 #include "confdefs.h"
16605 /* System header to define __stub macros and hopefully few prototypes,
16606     which can conflict with char _doprnt(); below.  */
16607 #include <assert.h>
16608 /* Override any gcc2 internal prototype to avoid an error.  */
16609 /* We use char because int might match the return type of a gcc2
16610     builtin and then its argument prototype would still apply.  */
16611 char _doprnt();
16612 char (*f)();
16613
16614 int main() {
16615
16616 /* The GNU C library defines this for functions which it implements
16617     to always fail with ENOSYS.  Some functions are actually named
16618     something starting with __ and the normal name is an alias.  */
16619 #if defined (__stub__doprnt) || defined (__stub____doprnt)
16620 choke me
16621 #else
16622 f = _doprnt;
16623 #endif
16624
16625 ; return 0; }
16626 EOF
16627 if { (eval echo configure:16628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16628   rm -rf conftest*
16629   eval "ac_cv_func__doprnt=yes"
16630 else
16631   echo "configure: failed program was:" >&5
16632   cat conftest.$ac_ext >&5
16633   rm -rf conftest*
16634   eval "ac_cv_func__doprnt=no"
16635 fi
16636 rm -f conftest*
16637 fi
16638
16639 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
16640   echo "$ac_t""yes" 1>&6
16641   cat >> confdefs.h <<\EOF
16642 #define HAVE_DOPRNT 1
16643 EOF
16644
16645 else
16646   echo "$ac_t""no" 1>&6
16647 fi
16648
16649 fi
16650
16651
16652 if test $ac_cv_func_vprintf = yes ; then
16653                 for ac_func in vsnprintf vsprintf
16654 do
16655 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16656 echo "configure:16657: checking for $ac_func" >&5
16657 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16658   echo $ac_n "(cached) $ac_c" 1>&6
16659 else
16660   cat > conftest.$ac_ext <<EOF
16661 #line 16662 "configure"
16662 #include "confdefs.h"
16663 /* System header to define __stub macros and hopefully few prototypes,
16664     which can conflict with char $ac_func(); below.  */
16665 #include <assert.h>
16666 /* Override any gcc2 internal prototype to avoid an error.  */
16667 /* We use char because int might match the return type of a gcc2
16668     builtin and then its argument prototype would still apply.  */
16669 char $ac_func();
16670 char (*f)();
16671
16672 int main() {
16673
16674 /* The GNU C library defines this for functions which it implements
16675     to always fail with ENOSYS.  Some functions are actually named
16676     something starting with __ and the normal name is an alias.  */
16677 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16678 choke me
16679 #else
16680 f = $ac_func;
16681 #endif
16682
16683 ; return 0; }
16684 EOF
16685 if { (eval echo configure:16686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16686   rm -rf conftest*
16687   eval "ac_cv_func_$ac_func=yes"
16688 else
16689   echo "configure: failed program was:" >&5
16690   cat conftest.$ac_ext >&5
16691   rm -rf conftest*
16692   eval "ac_cv_func_$ac_func=no"
16693 fi
16694 rm -f conftest*
16695 fi
16696
16697 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16698   echo "$ac_t""yes" 1>&6
16699     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16700   cat >> confdefs.h <<EOF
16701 #define $ac_tr_func 1
16702 EOF
16703  
16704 else
16705   echo "$ac_t""no" 1>&6
16706 fi
16707 done
16708
16709 fi
16710
16711 for ac_func in \
16712         bcopy                   \
16713         closesocket             \
16714         chroot                  \
16715         endgrent                \
16716         endpwent                \
16717         fcntl                   \
16718         flock                   \
16719         getdtablesize   \
16720         getgrgid                \
16721         gethostname             \
16722         getpass                 \
16723         getpassphrase   \
16724         getpwuid                \
16725         getpwnam                \
16726         getspnam                \
16727         gettimeofday    \
16728         initgroups              \
16729         lockf                   \
16730         memcpy                  \
16731         memmove                 \
16732         mkstemp                 \
16733         pipe                    \
16734         read                    \
16735         recv                    \
16736         recvfrom                \
16737         setpwfile               \
16738         setgid                  \
16739         setegid                 \
16740         setsid                  \
16741         setuid                  \
16742         seteuid                 \
16743         sigaction               \
16744         signal                  \
16745         sigset                  \
16746         strdup                  \
16747         strerror                \
16748         strpbrk                 \
16749         strrchr                 \
16750         strsep                  \
16751         strstr                  \
16752         strtol                  \
16753         strtoul                 \
16754         strspn                  \
16755         sysconf                 \
16756         usleep                  \
16757         waitpid                 \
16758         wait4                   \
16759         write                   \
16760         send                    \
16761         sendto                  \
16762
16763 do
16764 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16765 echo "configure:16766: checking for $ac_func" >&5
16766 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16767   echo $ac_n "(cached) $ac_c" 1>&6
16768 else
16769   cat > conftest.$ac_ext <<EOF
16770 #line 16771 "configure"
16771 #include "confdefs.h"
16772 /* System header to define __stub macros and hopefully few prototypes,
16773     which can conflict with char $ac_func(); below.  */
16774 #include <assert.h>
16775 /* Override any gcc2 internal prototype to avoid an error.  */
16776 /* We use char because int might match the return type of a gcc2
16777     builtin and then its argument prototype would still apply.  */
16778 char $ac_func();
16779 char (*f)();
16780
16781 int main() {
16782
16783 /* The GNU C library defines this for functions which it implements
16784     to always fail with ENOSYS.  Some functions are actually named
16785     something starting with __ and the normal name is an alias.  */
16786 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16787 choke me
16788 #else
16789 f = $ac_func;
16790 #endif
16791
16792 ; return 0; }
16793 EOF
16794 if { (eval echo configure:16795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16795   rm -rf conftest*
16796   eval "ac_cv_func_$ac_func=yes"
16797 else
16798   echo "configure: failed program was:" >&5
16799   cat conftest.$ac_ext >&5
16800   rm -rf conftest*
16801   eval "ac_cv_func_$ac_func=no"
16802 fi
16803 rm -f conftest*
16804 fi
16805
16806 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16807   echo "$ac_t""yes" 1>&6
16808     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16809   cat >> confdefs.h <<EOF
16810 #define $ac_tr_func 1
16811 EOF
16812  
16813 else
16814   echo "$ac_t""no" 1>&6
16815 fi
16816 done
16817
16818
16819 for ac_func in getopt tempnam
16820 do
16821 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16822 echo "configure:16823: checking for $ac_func" >&5
16823 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16824   echo $ac_n "(cached) $ac_c" 1>&6
16825 else
16826   cat > conftest.$ac_ext <<EOF
16827 #line 16828 "configure"
16828 #include "confdefs.h"
16829 /* System header to define __stub macros and hopefully few prototypes,
16830     which can conflict with char $ac_func(); below.  */
16831 #include <assert.h>
16832 /* Override any gcc2 internal prototype to avoid an error.  */
16833 /* We use char because int might match the return type of a gcc2
16834     builtin and then its argument prototype would still apply.  */
16835 char $ac_func();
16836 char (*f)();
16837
16838 int main() {
16839
16840 /* The GNU C library defines this for functions which it implements
16841     to always fail with ENOSYS.  Some functions are actually named
16842     something starting with __ and the normal name is an alias.  */
16843 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16844 choke me
16845 #else
16846 f = $ac_func;
16847 #endif
16848
16849 ; return 0; }
16850 EOF
16851 if { (eval echo configure:16852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16852   rm -rf conftest*
16853   eval "ac_cv_func_$ac_func=yes"
16854 else
16855   echo "configure: failed program was:" >&5
16856   cat conftest.$ac_ext >&5
16857   rm -rf conftest*
16858   eval "ac_cv_func_$ac_func=no"
16859 fi
16860 rm -f conftest*
16861 fi
16862
16863 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16864   echo "$ac_t""yes" 1>&6
16865     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16866   cat >> confdefs.h <<EOF
16867 #define $ac_tr_func 1
16868 EOF
16869  
16870 else
16871   echo "$ac_t""no" 1>&6
16872 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
16873 fi
16874 done
16875
16876
16877
16878 if test "$ac_cv_func_getopt" != yes; then
16879     LIBSRCS="$LIBSRCS getopt.c"
16880 fi
16881
16882 if test "$ac_cv_func_tempnam" != yes; then
16883     LIBSRCS="$LIBSRCS tempnam.c"
16884 fi
16885
16886 # Check Configuration
16887 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
16888 echo "configure:16889: checking declaration of sys_errlist" >&5
16889 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
16890   echo $ac_n "(cached) $ac_c" 1>&6
16891 else
16892   
16893         cat > conftest.$ac_ext <<EOF
16894 #line 16895 "configure"
16895 #include "confdefs.h"
16896
16897 #include <stdio.h>
16898 #include <sys/types.h>
16899 #include <errno.h>
16900 #ifdef WINNT
16901 #include <stdlib.h>
16902 #endif 
16903 int main() {
16904 char *c = (char *) *sys_errlist
16905 ; return 0; }
16906 EOF
16907 if { (eval echo configure:16908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16908   rm -rf conftest*
16909   ol_cv_dcl_sys_errlist=yes
16910         ol_cv_have_sys_errlist=yes
16911 else
16912   echo "configure: failed program was:" >&5
16913   cat conftest.$ac_ext >&5
16914   rm -rf conftest*
16915   ol_cv_dcl_sys_errlist=no
16916 fi
16917 rm -f conftest*
16918 fi
16919
16920 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
16921 #
16922 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
16923 if test $ol_cv_dcl_sys_errlist = no ; then
16924         cat >> confdefs.h <<\EOF
16925 #define DECL_SYS_ERRLIST 1
16926 EOF
16927
16928
16929         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
16930 echo "configure:16931: checking existence of sys_errlist" >&5
16931 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
16932   echo $ac_n "(cached) $ac_c" 1>&6
16933 else
16934   
16935                 cat > conftest.$ac_ext <<EOF
16936 #line 16937 "configure"
16937 #include "confdefs.h"
16938 #include <errno.h>
16939 int main() {
16940 char *c = (char *) *sys_errlist
16941 ; return 0; }
16942 EOF
16943 if { (eval echo configure:16944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16944   rm -rf conftest*
16945   ol_cv_have_sys_errlist=yes
16946 else
16947   echo "configure: failed program was:" >&5
16948   cat conftest.$ac_ext >&5
16949   rm -rf conftest*
16950   ol_cv_have_sys_errlist=no
16951 fi
16952 rm -f conftest*
16953 fi
16954
16955 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
16956 fi
16957 if test $ol_cv_have_sys_errlist = yes ; then
16958         cat >> confdefs.h <<\EOF
16959 #define HAVE_SYS_ERRLIST 1
16960 EOF
16961
16962 fi
16963
16964
16965
16966 if test "$ol_enable_debug" != no ; then
16967         cat >> confdefs.h <<\EOF
16968 #define LDAP_DEBUG 1
16969 EOF
16970
16971 fi
16972 if test "$ol_enable_syslog" = yes ; then
16973         cat >> confdefs.h <<\EOF
16974 #define LDAP_SYSLOG 1
16975 EOF
16976
16977 fi
16978 if test "$ol_enable_cache" = no ; then
16979         cat >> confdefs.h <<\EOF
16980 #define LDAP_NOCACHE 1
16981 EOF
16982
16983 fi
16984 if test "$ol_link_kbind" != no ; then
16985         cat >> confdefs.h <<\EOF
16986 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
16987 EOF
16988
16989 fi
16990 if test "$ol_enable_proctitle" != no ; then
16991         cat >> confdefs.h <<\EOF
16992 #define LDAP_PROCTITLE 1
16993 EOF
16994
16995 fi
16996 if test "$ol_enable_referrals" != no ; then
16997         cat >> confdefs.h <<\EOF
16998 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
16999 EOF
17000
17001 fi
17002 if test "$ol_enable_local" != no; then
17003         cat >> confdefs.h <<\EOF
17004 #define LDAP_PF_LOCAL 1
17005 EOF
17006
17007 fi
17008 if test "$ol_link_ipv6" != no; then
17009         cat >> confdefs.h <<\EOF
17010 #define LDAP_PF_INET6 1
17011 EOF
17012
17013 fi
17014 if test "$ol_enable_cleartext" != no ; then
17015         cat >> confdefs.h <<\EOF
17016 #define SLAPD_CLEARTEXT 1
17017 EOF
17018
17019 fi
17020 if test "$ol_enable_crypt" != no ; then
17021         cat >> confdefs.h <<\EOF
17022 #define SLAPD_CRYPT 1
17023 EOF
17024
17025 fi
17026 if test "$ol_link_kpasswd" != no ; then
17027         cat >> confdefs.h <<\EOF
17028 #define SLAPD_KPASSWD 1
17029 EOF
17030
17031 fi
17032 if test "$ol_link_spasswd" != no ; then
17033         cat >> confdefs.h <<\EOF
17034 #define SLAPD_SPASSWD 1
17035 EOF
17036
17037 fi
17038 if test "$ol_enable_phonetic" != no ; then
17039         cat >> confdefs.h <<\EOF
17040 #define SLAPD_PHONETIC 1
17041 EOF
17042
17043 fi
17044 if test "$ol_enable_rlookups" != no ; then
17045         cat >> confdefs.h <<\EOF
17046 #define SLAPD_RLOOKUPS 1
17047 EOF
17048
17049 fi
17050 if test "$ol_enable_aci" != no ; then
17051         cat >> confdefs.h <<\EOF
17052 #define SLAPD_ACI_ENABLED 1
17053 EOF
17054
17055 fi
17056
17057 if test "$ol_link_modules" != no ; then
17058         cat >> confdefs.h <<\EOF
17059 #define SLAPD_MODULES 1
17060 EOF
17061
17062         BUILD_SLAPD=yes
17063         SLAPD_MODULES_LDFLAGS="-dlopen self"
17064 fi
17065
17066 if test "$ol_link_dnssrv" != no ; then
17067         cat >> confdefs.h <<\EOF
17068 #define SLAPD_DNSSRV 1
17069 EOF
17070
17071         BUILD_SLAPD=yes
17072         BUILD_DNSSRV=yes
17073         if test "$ol_with_dnssrv_module" != static ; then
17074                 cat >> confdefs.h <<\EOF
17075 #define SLAPD_DNSSRV_DYNAMIC 1
17076 EOF
17077
17078                 BUILD_DNSSRV=mod
17079                 BUILD_DNSSRV_DYNAMIC=shared
17080                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
17081         fi
17082 fi
17083
17084 if test "$ol_enable_ldap" != no ; then
17085         cat >> confdefs.h <<\EOF
17086 #define SLAPD_LDAP 1
17087 EOF
17088
17089         BUILD_SLAPD=yes
17090         BUILD_LDAP=yes
17091         if test "$ol_with_ldap_module" != static ; then
17092                 cat >> confdefs.h <<\EOF
17093 #define SLAPD_LDAP_DYNAMIC 1
17094 EOF
17095
17096                 BUILD_LDAP=mod
17097                 BUILD_LDAP_DYNAMIC=shared
17098                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
17099         fi
17100 fi
17101
17102 if test "$ol_link_ldbm" != no ; then
17103         cat >> confdefs.h <<\EOF
17104 #define SLAPD_LDBM 1
17105 EOF
17106
17107         BUILD_SLAPD=yes
17108         BUILD_LDBM=yes
17109         if test "$ol_with_ldbm_module" != static ; then
17110                 cat >> confdefs.h <<\EOF
17111 #define SLAPD_LDBM_DYNAMIC 1
17112 EOF
17113
17114                 BUILD_LDBM=mod
17115                 BUILD_LDBM_DYNAMIC=shared
17116                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
17117         fi
17118 fi
17119
17120 if test "$ol_enable_passwd" != no ; then
17121         cat >> confdefs.h <<\EOF
17122 #define SLAPD_PASSWD 1
17123 EOF
17124
17125         BUILD_SLAPD=yes
17126         BUILD_PASSWD=yes
17127         if test "$ol_with_passwd_module" != static ; then
17128                 cat >> confdefs.h <<\EOF
17129 #define SLAPD_PASSWD_DYNAMIC 1
17130 EOF
17131
17132                 BUILD_PASSWD=mod
17133                 BUILD_PASSWD_DYNAMIC=shared
17134                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
17135         fi
17136 fi
17137
17138 if test "$ol_enable_shell" != no ; then
17139         cat >> confdefs.h <<\EOF
17140 #define SLAPD_SHELL 1
17141 EOF
17142
17143         BUILD_SLAPD=yes
17144         BUILD_SHELL=yes
17145         if test "$ol_with_shell_module" != static ; then
17146                 cat >> confdefs.h <<\EOF
17147 #define SLAPD_SHELL_DYNAMIC 1
17148 EOF
17149
17150                 BUILD_SHELL=mod
17151                 BUILD_SHELL_DYNAMIC=shared
17152                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
17153         fi
17154 fi
17155
17156 if test "$ol_enable_sql" != no ; then
17157         cat >> confdefs.h <<\EOF
17158 #define SLAPD_SQL 1
17159 EOF
17160
17161         BUILD_SLAPD=yes
17162         BUILD_SQL=yes
17163         if test "$ol_with_sql_module" != static; then
17164                 cat >> confdefs.h <<\EOF
17165 #define SLAPD_SQL_DYNAMIC 1
17166 EOF
17167
17168                 BUILD_SQL=mod
17169                 BUILD_SQL_DYNAMIC=shared
17170                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
17171         fi
17172 fi
17173
17174 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
17175         $BUILD_SLAPD = yes ; then
17176         BUILD_SLURPD=yes
17177 fi
17178
17179
17180 if test "$LINK_BINS_DYNAMIC" = yes; then
17181     LIB_LINKAGE=DYN
17182     LT_LIB_LINKAGE=shared
17183 else
17184     LIB_LINKAGE=STAT
17185     LT_LIB_LINKAGE=static
17186 fi
17187
17188 if test "$ac_cv_mingw32" = yes ; then
17189     PLAT=NT
17190     DYN_EXT=dll
17191 else
17192     PLAT=UNIX
17193     DYN_EXT=so
17194 fi
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204   
17205   
17206   
17207   
17208   
17209   
17210   
17211   
17212   
17213   
17214   
17215   
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246 trap '' 1 2 15
17247
17248 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
17249
17250 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17251 # Let make expand exec_prefix.
17252 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17253
17254 # Any assignment to VPATH causes Sun make to only execute
17255 # the first set of double-colon rules, so remove it if not needed.
17256 # If there is a colon in the path, we need to keep it.
17257 if test "x$srcdir" = x.; then
17258   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
17259 fi
17260
17261 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
17262
17263 DEFS=-DHAVE_CONFIG_H
17264
17265 # Without the "./", some shells look in PATH for config.status.
17266 : ${CONFIG_STATUS=./config.status}
17267
17268 echo creating $CONFIG_STATUS
17269 rm -f $CONFIG_STATUS
17270 cat > $CONFIG_STATUS <<EOF
17271 #! /bin/sh
17272 # Generated automatically by configure.
17273 # Run this file to recreate the current configuration.
17274 # This directory was configured as follows,
17275 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
17276 #
17277 # $0 $ac_configure_args
17278 #
17279 # Compiler output produced by configure, useful for debugging
17280 # configure, is in ./config.log if it exists.
17281
17282 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
17283 for ac_option
17284 do
17285   case "\$ac_option" in
17286   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17287     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
17288     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
17289   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
17290     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
17291     exit 0 ;;
17292   -help | --help | --hel | --he | --h)
17293     echo "\$ac_cs_usage"; exit 0 ;;
17294   *) echo "\$ac_cs_usage"; exit 1 ;;
17295   esac
17296 done
17297
17298 ac_given_srcdir=$srcdir
17299 ac_given_INSTALL="$INSTALL"
17300
17301 trap 'rm -fr `echo "\
17302 Makefile:build/top.mk:Makefile.in:build/dir.mk \
17303 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
17304 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
17305 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
17306 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
17307 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
17308 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
17309 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
17310 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
17311 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
17312 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
17313 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
17314 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
17315 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
17316 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
17317 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
17318 include/Makefile:build/top.mk:include/Makefile.in \
17319 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
17320 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
17321 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17322 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17323 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
17324 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
17325 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
17326 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
17327 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
17328 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
17329 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
17330 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
17331 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
17332 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
17333 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
17334 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
17335 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
17336 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
17337 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
17338 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
17339 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
17340 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
17341 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
17342  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
17343 EOF
17344 cat >> $CONFIG_STATUS <<EOF
17345
17346 # Protect against being on the right side of a sed subst in config.status.
17347 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
17348  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
17349 $ac_vpsub
17350 $extrasub
17351 s%@SHELL@%$SHELL%g
17352 s%@CFLAGS@%$CFLAGS%g
17353 s%@CPPFLAGS@%$CPPFLAGS%g
17354 s%@CXXFLAGS@%$CXXFLAGS%g
17355 s%@FFLAGS@%$FFLAGS%g
17356 s%@DEFS@%$DEFS%g
17357 s%@LDFLAGS@%$LDFLAGS%g
17358 s%@LIBS@%$LIBS%g
17359 s%@exec_prefix@%$exec_prefix%g
17360 s%@prefix@%$prefix%g
17361 s%@program_transform_name@%$program_transform_name%g
17362 s%@bindir@%$bindir%g
17363 s%@sbindir@%$sbindir%g
17364 s%@libexecdir@%$libexecdir%g
17365 s%@datadir@%$datadir%g
17366 s%@sysconfdir@%$sysconfdir%g
17367 s%@sharedstatedir@%$sharedstatedir%g
17368 s%@localstatedir@%$localstatedir%g
17369 s%@libdir@%$libdir%g
17370 s%@includedir@%$includedir%g
17371 s%@oldincludedir@%$oldincludedir%g
17372 s%@infodir@%$infodir%g
17373 s%@mandir@%$mandir%g
17374 s%@host@%$host%g
17375 s%@host_alias@%$host_alias%g
17376 s%@host_cpu@%$host_cpu%g
17377 s%@host_vendor@%$host_vendor%g
17378 s%@host_os@%$host_os%g
17379 s%@target@%$target%g
17380 s%@target_alias@%$target_alias%g
17381 s%@target_cpu@%$target_cpu%g
17382 s%@target_vendor@%$target_vendor%g
17383 s%@target_os@%$target_os%g
17384 s%@build@%$build%g
17385 s%@build_alias@%$build_alias%g
17386 s%@build_cpu@%$build_cpu%g
17387 s%@build_vendor@%$build_vendor%g
17388 s%@build_os@%$build_os%g
17389 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
17390 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
17391 s%@INSTALL_DATA@%$INSTALL_DATA%g
17392 s%@PACKAGE@%$PACKAGE%g
17393 s%@VERSION@%$VERSION%g
17394 s%@ACLOCAL@%$ACLOCAL%g
17395 s%@AUTOCONF@%$AUTOCONF%g
17396 s%@AUTOMAKE@%$AUTOMAKE%g
17397 s%@AUTOHEADER@%$AUTOHEADER%g
17398 s%@MAKEINFO@%$MAKEINFO%g
17399 s%@install_sh@%$install_sh%g
17400 s%@AMTAR@%$AMTAR%g
17401 s%@AWK@%$AWK%g
17402 s%@AMTARFLAGS@%$AMTARFLAGS%g
17403 s%@SET_MAKE@%$SET_MAKE%g
17404 s%@top_builddir@%$top_builddir%g
17405 s%@ldap_subdir@%$ldap_subdir%g
17406 s%@CC@%$CC%g
17407 s%@AR@%$AR%g
17408 s%@RANLIB@%$RANLIB%g
17409 s%@LN_S@%$LN_S%g
17410 s%@DLLTOOL@%$DLLTOOL%g
17411 s%@AS@%$AS%g
17412 s%@OBJDUMP@%$OBJDUMP%g
17413 s%@LIBTOOL@%$LIBTOOL%g
17414 s%@LN_H@%$LN_H%g
17415 s%@SENDMAIL@%$SENDMAIL%g
17416 s%@EDITOR@%$EDITOR%g
17417 s%@FINGER@%$FINGER%g
17418 s%@CPP@%$CPP%g
17419 s%@EXEEXT@%$EXEEXT%g
17420 s%@OBJEXT@%$OBJEXT%g
17421 s%@OL_MKDEP@%$OL_MKDEP%g
17422 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
17423 s%@LIBOBJS@%$LIBOBJS%g
17424 s%@LIBSRCS@%$LIBSRCS%g
17425 s%@PLAT@%$PLAT%g
17426 s%@LIB_LINKAGE@%$LIB_LINKAGE%g
17427 s%@LT_LIB_LINKAGE@%$LT_LIB_LINKAGE%g
17428 s%@DYN_EXT@%$DYN_EXT%g
17429 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
17430 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
17431 s%@BUILD_LDAP@%$BUILD_LDAP%g
17432 s%@BUILD_LDBM@%$BUILD_LDBM%g
17433 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
17434 s%@BUILD_SHELL@%$BUILD_SHELL%g
17435 s%@BUILD_SQL@%$BUILD_SQL%g
17436 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
17437 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
17438 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
17439 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
17440 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
17441 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
17442 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
17443 s%@LDAP_LIBS@%$LDAP_LIBS%g
17444 s%@LDIF_LIBS@%$LDIF_LIBS%g
17445 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
17446 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
17447 s%@LDBM_LIBS@%$LDBM_LIBS%g
17448 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
17449 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
17450 s%@WRAP_LIBS@%$WRAP_LIBS%g
17451 s%@LINK_BINS_DYNAMIC@%$LINK_BINS_DYNAMIC%g
17452 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
17453 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
17454 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
17455 s%@KRB4_LIBS@%$KRB4_LIBS%g
17456 s%@KRB5_LIBS@%$KRB5_LIBS%g
17457 s%@READLINE_LIBS@%$READLINE_LIBS%g
17458 s%@SASL_LIBS@%$SASL_LIBS%g
17459 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
17460 s%@TLS_LIBS@%$TLS_LIBS%g
17461 s%@MODULES_LIBS@%$MODULES_LIBS%g
17462 s%@AUTH_LIBS@%$AUTH_LIBS%g
17463 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
17464 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
17465 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
17466
17467 CEOF
17468 EOF
17469
17470 cat >> $CONFIG_STATUS <<\EOF
17471
17472 # Split the substitutions into bite-sized pieces for seds with
17473 # small command number limits, like on Digital OSF/1 and HP-UX.
17474 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
17475 ac_file=1 # Number of current file.
17476 ac_beg=1 # First line for current file.
17477 ac_end=$ac_max_sed_cmds # Line after last line for current file.
17478 ac_more_lines=:
17479 ac_sed_cmds=""
17480 while $ac_more_lines; do
17481   if test $ac_beg -gt 1; then
17482     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
17483   else
17484     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
17485   fi
17486   if test ! -s conftest.s$ac_file; then
17487     ac_more_lines=false
17488     rm -f conftest.s$ac_file
17489   else
17490     if test -z "$ac_sed_cmds"; then
17491       ac_sed_cmds="sed -f conftest.s$ac_file"
17492     else
17493       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
17494     fi
17495     ac_file=`expr $ac_file + 1`
17496     ac_beg=$ac_end
17497     ac_end=`expr $ac_end + $ac_max_sed_cmds`
17498   fi
17499 done
17500 if test -z "$ac_sed_cmds"; then
17501   ac_sed_cmds=cat
17502 fi
17503 EOF
17504
17505 cat >> $CONFIG_STATUS <<EOF
17506
17507 CONFIG_FILES=\${CONFIG_FILES-"\
17508 Makefile:build/top.mk:Makefile.in:build/dir.mk \
17509 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
17510 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
17511 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
17512 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
17513 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
17514 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
17515 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
17516 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
17517 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
17518 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
17519 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
17520 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
17521 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
17522 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
17523 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
17524 include/Makefile:build/top.mk:include/Makefile.in \
17525 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
17526 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
17527 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17528 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17529 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
17530 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
17531 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
17532 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
17533 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
17534 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
17535 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
17536 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
17537 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
17538 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
17539 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
17540 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
17541 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
17542 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
17543 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
17544 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
17545 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
17546 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
17547 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
17548 "}
17549 EOF
17550 cat >> $CONFIG_STATUS <<\EOF
17551 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
17552   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17553   case "$ac_file" in
17554   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
17555        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
17556   *) ac_file_in="${ac_file}.in" ;;
17557   esac
17558
17559   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
17560
17561   # Remove last slash and all that follows it.  Not all systems have dirname.
17562   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
17563   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17564     # The file is in a subdirectory.
17565     test ! -d "$ac_dir" && mkdir "$ac_dir"
17566     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
17567     # A "../" for each directory in $ac_dir_suffix.
17568     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
17569   else
17570     ac_dir_suffix= ac_dots=
17571   fi
17572
17573   case "$ac_given_srcdir" in
17574   .)  srcdir=.
17575       if test -z "$ac_dots"; then top_srcdir=.
17576       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
17577   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
17578   *) # Relative path.
17579     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
17580     top_srcdir="$ac_dots$ac_given_srcdir" ;;
17581   esac
17582
17583   case "$ac_given_INSTALL" in
17584   [/$]*) INSTALL="$ac_given_INSTALL" ;;
17585   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
17586   esac
17587
17588   echo creating "$ac_file"
17589   rm -f "$ac_file"
17590   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
17591   case "$ac_file" in
17592   *[Mm]akefile*) ac_comsub="1i\\
17593 # $configure_input" ;;
17594   *) ac_comsub= ;;
17595   esac
17596
17597   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
17598   sed -e "$ac_comsub
17599 s%@configure_input@%$configure_input%g
17600 s%@srcdir@%$srcdir%g
17601 s%@top_srcdir@%$top_srcdir%g
17602 s%@INSTALL@%$INSTALL%g
17603 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
17604 fi; done
17605 rm -f conftest.s*
17606
17607 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
17608 # NAME is the cpp macro being defined and VALUE is the value it is being given.
17609 #
17610 # ac_d sets the value in "#define NAME VALUE" lines.
17611 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
17612 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
17613 ac_dC='\3'
17614 ac_dD='%g'
17615 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
17616 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17617 ac_uB='\([      ]\)%\1#\2define\3'
17618 ac_uC=' '
17619 ac_uD='\4%g'
17620 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
17621 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17622 ac_eB='$%\1#\2define\3'
17623 ac_eC=' '
17624 ac_eD='%g'
17625
17626 if test "${CONFIG_HEADERS+set}" != set; then
17627 EOF
17628 cat >> $CONFIG_STATUS <<EOF
17629   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
17630 EOF
17631 cat >> $CONFIG_STATUS <<\EOF
17632 fi
17633 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
17634   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17635   case "$ac_file" in
17636   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
17637        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
17638   *) ac_file_in="${ac_file}.in" ;;
17639   esac
17640
17641   echo creating $ac_file
17642
17643   rm -f conftest.frag conftest.in conftest.out
17644   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
17645   cat $ac_file_inputs > conftest.in
17646
17647 EOF
17648
17649 # Transform confdefs.h into a sed script conftest.vals that substitutes
17650 # the proper values into config.h.in to produce config.h.  And first:
17651 # Protect against being on the right side of a sed subst in config.status.
17652 # Protect against being in an unquoted here document in config.status.
17653 rm -f conftest.vals
17654 cat > conftest.hdr <<\EOF
17655 s/[\\&%]/\\&/g
17656 s%[\\$`]%\\&%g
17657 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
17658 s%ac_d%ac_u%gp
17659 s%ac_u%ac_e%gp
17660 EOF
17661 sed -n -f conftest.hdr confdefs.h > conftest.vals
17662 rm -f conftest.hdr
17663
17664 # This sed command replaces #undef with comments.  This is necessary, for
17665 # example, in the case of _POSIX_SOURCE, which is predefined and required
17666 # on some systems where configure will not decide to define it.
17667 cat >> conftest.vals <<\EOF
17668 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
17669 EOF
17670
17671 # Break up conftest.vals because some shells have a limit on
17672 # the size of here documents, and old seds have small limits too.
17673
17674 rm -f conftest.tail
17675 while :
17676 do
17677   ac_lines=`grep -c . conftest.vals`
17678   # grep -c gives empty output for an empty file on some AIX systems.
17679   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
17680   # Write a limited-size here document to conftest.frag.
17681   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
17682   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
17683   echo 'CEOF
17684   sed -f conftest.frag conftest.in > conftest.out
17685   rm -f conftest.in
17686   mv conftest.out conftest.in
17687 ' >> $CONFIG_STATUS
17688   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
17689   rm -f conftest.vals
17690   mv conftest.tail conftest.vals
17691 done
17692 rm -f conftest.vals
17693
17694 cat >> $CONFIG_STATUS <<\EOF
17695   rm -f conftest.frag conftest.h
17696   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
17697   cat conftest.in >> conftest.h
17698   rm -f conftest.in
17699   if cmp -s $ac_file conftest.h 2>/dev/null; then
17700     echo "$ac_file is unchanged"
17701     rm -f conftest.h
17702   else
17703     # Remove last slash and all that follows it.  Not all systems have dirname.
17704       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
17705       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17706       # The file is in a subdirectory.
17707       test ! -d "$ac_dir" && mkdir "$ac_dir"
17708     fi
17709     rm -f $ac_file
17710     mv conftest.h $ac_file
17711   fi
17712 fi; done
17713
17714 EOF
17715 cat >> $CONFIG_STATUS <<EOF
17716
17717 EOF
17718 cat >> $CONFIG_STATUS <<\EOF
17719
17720 date > stamp-h
17721 echo Please \"make depend\" to build dependencies
17722
17723 exit 0
17724 EOF
17725 chmod +x $CONFIG_STATUS
17726 rm -fr confdefs* $ac_clean_files
17727 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
17728