]> git.sur5r.net Git - openldap/blob - configure
0d3c8152bab6a44ea377e40f344f8e4e5673bda3
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.301 2000/05/19 16:41:28 kurt Exp  
4
5 # Copyright 1998-2000 The OpenLDAP Foundation.  All Rights Reserved.
6
7 # Redistribution and use in source and binary forms are permitted only
8 # as authorized by the OpenLDAP Public License.  A copy of this
9 # license is available at http://www.OpenLDAP.org/license.html or
10 # in file LICENSE in the top-level directory of the distribution.
11
12 echo "Copyright 1998-2000 The OpenLDAP Foundation,  All Rights Reserved."
13 echo "Copying restrictions apply, see COPYRIGHT file."
14
15 # Guess values for system-dependent variables and create Makefiles.
16 # Generated automatically using autoconf version 2.13.1 
17 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
18 #
19 # This configure script is free software; the Free Software Foundation
20 # gives unlimited permission to copy, distribute and modify it.
21
22 # Defaults:
23 ac_help=
24 ac_default_prefix=/usr/local
25 # Any additions from configure.in:
26 ac_default_prefix=/usr/local
27 ac_help="$ac_help
28   --with-subdir=DIR change default subdirectory used for installs"
29 ac_help="$ac_help
30   --enable-debug        enable debugging (yes)"
31 ac_help="$ac_help
32   --enable-syslog       enable syslog support (auto)"
33 ac_help="$ac_help
34   --enable-proctitle    enable proctitle support (yes)"
35 ac_help="$ac_help
36   --enable-cache        enable caching (yes)"
37 ac_help="$ac_help
38   --enable-dns          enable V2 DX Referrals extension (no)"
39 ac_help="$ac_help
40   --enable-referrals    enable V2 Referrals extension (yes)"
41 ac_help="$ac_help
42   --enable-kbind        enable V2 Kerberos IV bind (auto)"
43 ac_help="$ac_help
44   --enable-cldap        enable connectionless ldap (no)"
45 ac_help="$ac_help
46   --enable-ldapi        enable domain socket (PF_LOCAL) ldap (no)"
47 ac_help="$ac_help
48   --enable-x-compile    enable cross compiling (no)"
49 ac_help="$ac_help
50   --enable-dmalloc      enable debug malloc support (no)"
51 ac_help="$ac_help
52   --with-cyrus-sasl     with Cyrus SASL support (auto)"
53 ac_help="$ac_help
54   --with-fetch          with fetch URL support (auto)"
55 ac_help="$ac_help
56   --with-kerberos       with support (auto)"
57 ac_help="$ac_help
58   --with-readline       with readline support (auto)"
59 ac_help="$ac_help
60   --with-threads        use threads (auto)"
61 ac_help="$ac_help
62   --with-tls            with TLS/SSL support (auto)"
63 ac_help="$ac_help
64   --with-yielding-select        with implicitly yielding select (auto)"
65 ac_help="$ac_help
66 LDAPD (X.500-to-LDAP Gateway) Options:"
67 ac_help="$ac_help
68   --enable-ldapd        enable building ldapd (no)"
69 ac_help="$ac_help
70 SLAPD (Standalone LDAP Daemon) Options:"
71 ac_help="$ac_help
72   --enable-slapd        enable building slapd (yes)"
73 ac_help="$ac_help
74     --enable-cleartext  enable cleartext passwords (yes)"
75 ac_help="$ac_help
76     --enable-crypt      enable crypt(3) passwords (auto)"
77 ac_help="$ac_help
78     --enable-kpasswd    enable kerberos password verification (no)"
79 ac_help="$ac_help
80     --enable-spasswd    enable (Cyrus) SASL password verification (no)"
81 ac_help="$ac_help
82     --enable-modules    enable dynamic module support (no)"
83 ac_help="$ac_help
84     --enable-multimaster        enable multimaster replication (no)"
85 ac_help="$ac_help
86     --enable-phonetic   enable phonetic/soundex (no)"
87 ac_help="$ac_help
88     --enable-quipu      build quipu migration tools (no)"
89 ac_help="$ac_help
90     --enable-rlookups   enable reverse lookups (auto)"
91 ac_help="$ac_help
92     --enable-aci        enable per-object ACIs (no)"
93 ac_help="$ac_help
94     --enable-wrappers   enable tcp wrapper support (no)"
95 ac_help="$ac_help
96     --enable-dynamic    enable linking built binaries with dynamic libs (no)"
97 ac_help="$ac_help
98     --enable-bdb2       enable bdb2 backend (no)"
99 ac_help="$ac_help
100       --with-bdb2-module        module type (static)"
101 ac_help="$ac_help
102     --enable-dnssrv     enable bdb2 backend (no)"
103 ac_help="$ac_help
104       --with-dnssrv-module      module type (static)"
105 ac_help="$ac_help
106     --enable-ldap       enable ldap backend (no)"
107 ac_help="$ac_help
108       --with-ldap-module        module type (static)"
109 ac_help="$ac_help
110     --enable-ldbm       enable ldbm backend (yes)"
111 ac_help="$ac_help
112       --with-ldbm-api   use LDBM API (auto)"
113 ac_help="$ac_help
114       --with-ldbm-module        module type (static)"
115 ac_help="$ac_help
116       --with-ldbm-type  use LDBM type (auto)"
117 ac_help="$ac_help
118     --enable-passwd     enable passwd backend (no)"
119 ac_help="$ac_help
120       --with-passwd-module      module type (static)"
121 ac_help="$ac_help
122     --enable-perl       enable perl backend (no)"
123 ac_help="$ac_help
124       --with-perl-module        module type (static)"
125 ac_help="$ac_help
126     --enable-shell      enable shell backend (no)"
127 ac_help="$ac_help
128       --with-shell-module       module type (static)"
129 ac_help="$ac_help
130     --enable-sql        enable sql backend (no)"
131 ac_help="$ac_help
132       --with-sql-module module type (static)"
133 ac_help="$ac_help
134     --enable-tcl        enable tcl backend (no)"
135 ac_help="$ac_help
136       --with-tcl-module module type (static)"
137 ac_help="$ac_help
138 SLURPD (Replication Daemon) Options:"
139 ac_help="$ac_help
140   --enable-slurpd       enable building slurpd (auto)"
141 ac_help="$ac_help
142 Library Generation & Linking Options"
143 ac_help="$ac_help
144   --enable-static[=PKGS]  build static libraries [default=yes]"
145 ac_help="$ac_help
146   --enable-shared[=PKGS]  build shared libraries [default=yes]"
147 ac_help="$ac_help
148   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
149 ac_help="$ac_help
150   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
151 ac_help="$ac_help
152   --disable-libtool-lock  avoid locking (might break parallel builds)"
153
154 # Initialize some variables set by options.
155 # The variables have the same names as the options, with
156 # dashes changed to underlines.
157 build=NONE
158 cache_file=./config.cache
159 exec_prefix=NONE
160 host=NONE
161 no_create=
162 nonopt=NONE
163 no_recursion=
164 prefix=NONE
165 program_prefix=NONE
166 program_suffix=NONE
167 program_transform_name=s,x,x,
168 silent=
169 site=
170 srcdir=
171 target=NONE
172 verbose=
173 x_includes=NONE
174 x_libraries=NONE
175 bindir='${exec_prefix}/bin'
176 sbindir='${exec_prefix}/sbin'
177 libexecdir='${exec_prefix}/libexec'
178 datadir='${prefix}/share'
179 sysconfdir='${prefix}/etc'
180 sharedstatedir='${prefix}/com'
181 localstatedir='${prefix}/var'
182 libdir='${exec_prefix}/lib'
183 includedir='${prefix}/include'
184 oldincludedir='/usr/include'
185 infodir='${prefix}/info'
186 mandir='${prefix}/man'
187
188 # Initialize some other variables.
189 subdirs=
190 MFLAGS= MAKEFLAGS=
191 SHELL=${CONFIG_SHELL-/bin/sh}
192 # Maximum number of lines to put in a shell here document.
193 ac_max_here_lines=12
194
195 ac_prev=
196 for ac_option
197 do
198
199   # If the previous option needs an argument, assign it.
200   if test -n "$ac_prev"; then
201     eval "$ac_prev=\$ac_option"
202     ac_prev=
203     continue
204   fi
205
206   case "$ac_option" in
207   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
208   *) ac_optarg= ;;
209   esac
210
211   # Accept the important Cygnus configure options, so we can diagnose typos.
212
213   case "$ac_option" in
214
215   -bindir | --bindir | --bindi | --bind | --bin | --bi)
216     ac_prev=bindir ;;
217   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
218     bindir="$ac_optarg" ;;
219
220   -build | --build | --buil | --bui | --bu)
221     ac_prev=build ;;
222   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
223     build="$ac_optarg" ;;
224
225   -cache-file | --cache-file | --cache-fil | --cache-fi \
226   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
227     ac_prev=cache_file ;;
228   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
229   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
230     cache_file="$ac_optarg" ;;
231
232   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
233     ac_prev=datadir ;;
234   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
235   | --da=*)
236     datadir="$ac_optarg" ;;
237
238   -disable-* | --disable-*)
239     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
240     # Reject names that are not valid shell variable names.
241     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
242       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
243     fi
244     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
245     eval "enable_${ac_feature}=no" ;;
246
247   -enable-* | --enable-*)
248     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
249     # Reject names that are not valid shell variable names.
250     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
251       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
252     fi
253     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
254     case "$ac_option" in
255       *=*) ;;
256       *) ac_optarg=yes ;;
257     esac
258     eval "enable_${ac_feature}='$ac_optarg'" ;;
259
260   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
261   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
262   | --exec | --exe | --ex)
263     ac_prev=exec_prefix ;;
264   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
265   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
266   | --exec=* | --exe=* | --ex=*)
267     exec_prefix="$ac_optarg" ;;
268
269   -gas | --gas | --ga | --g)
270     # Obsolete; use --with-gas.
271     with_gas=yes ;;
272
273   -help | --help | --hel | --he)
274     # Omit some internal or obsolete options to make the list less imposing.
275     # This message is too long to be a string in the A/UX 3.1 sh.
276     cat << EOF
277 Usage: configure [options] [host]
278 Options: [defaults in brackets after descriptions]
279 Configuration:
280   --cache-file=FILE       cache test results in FILE
281   --help                  print this message
282   --no-create             do not create output files
283   --quiet, --silent       do not print \`checking...' messages
284   --version               print the version of autoconf that created configure
285 Directory and file names:
286   --prefix=PREFIX         install architecture-independent files in PREFIX
287                           [$ac_default_prefix]
288   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
289                           [same as prefix]
290   --bindir=DIR            user executables in DIR [EPREFIX/bin]
291   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
292   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
293   --datadir=DIR           read-only architecture-independent data in DIR
294                           [PREFIX/share]
295   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
296   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
297                           [PREFIX/com]
298   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
299   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
300   --includedir=DIR        C header files in DIR [PREFIX/include]
301   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
302   --infodir=DIR           info documentation in DIR [PREFIX/info]
303   --mandir=DIR            man documentation in DIR [PREFIX/man]
304   --srcdir=DIR            find the sources in DIR [configure dir or ..]
305   --program-prefix=PREFIX prepend PREFIX to installed program names
306   --program-suffix=SUFFIX append SUFFIX to installed program names
307   --program-transform-name=PROGRAM
308                           run sed PROGRAM on installed program names
309 EOF
310     cat << EOF
311 Host type:
312   --build=BUILD           configure for building on BUILD [BUILD=HOST]
313   --host=HOST             configure for HOST [guessed]
314   --target=TARGET         configure for TARGET [TARGET=HOST]
315 Features and packages:
316   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
317   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
318   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
319   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
320   --x-includes=DIR        X include files are in DIR
321   --x-libraries=DIR       X library files are in DIR
322 EOF
323     if test -n "$ac_help"; then
324       echo "--enable and --with options recognized:$ac_help"
325     fi
326     exit 0 ;;
327
328   -host | --host | --hos | --ho)
329     ac_prev=host ;;
330   -host=* | --host=* | --hos=* | --ho=*)
331     host="$ac_optarg" ;;
332
333   -includedir | --includedir | --includedi | --included | --include \
334   | --includ | --inclu | --incl | --inc)
335     ac_prev=includedir ;;
336   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
337   | --includ=* | --inclu=* | --incl=* | --inc=*)
338     includedir="$ac_optarg" ;;
339
340   -infodir | --infodir | --infodi | --infod | --info | --inf)
341     ac_prev=infodir ;;
342   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
343     infodir="$ac_optarg" ;;
344
345   -libdir | --libdir | --libdi | --libd)
346     ac_prev=libdir ;;
347   -libdir=* | --libdir=* | --libdi=* | --libd=*)
348     libdir="$ac_optarg" ;;
349
350   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
351   | --libexe | --libex | --libe)
352     ac_prev=libexecdir ;;
353   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
354   | --libexe=* | --libex=* | --libe=*)
355     libexecdir="$ac_optarg" ;;
356
357   -localstatedir | --localstatedir | --localstatedi | --localstated \
358   | --localstate | --localstat | --localsta | --localst \
359   | --locals | --local | --loca | --loc | --lo)
360     ac_prev=localstatedir ;;
361   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
362   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
363   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
364     localstatedir="$ac_optarg" ;;
365
366   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
367     ac_prev=mandir ;;
368   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
369     mandir="$ac_optarg" ;;
370
371   -nfp | --nfp | --nf)
372     # Obsolete; use --without-fp.
373     with_fp=no ;;
374
375   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
376   | --no-cr | --no-c)
377     no_create=yes ;;
378
379   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
380   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
381     no_recursion=yes ;;
382
383   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
384   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
385   | --oldin | --oldi | --old | --ol | --o)
386     ac_prev=oldincludedir ;;
387   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
388   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
389   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
390     oldincludedir="$ac_optarg" ;;
391
392   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
393     ac_prev=prefix ;;
394   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
395     prefix="$ac_optarg" ;;
396
397   -program-prefix | --program-prefix | --program-prefi | --program-pref \
398   | --program-pre | --program-pr | --program-p)
399     ac_prev=program_prefix ;;
400   -program-prefix=* | --program-prefix=* | --program-prefi=* \
401   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
402     program_prefix="$ac_optarg" ;;
403
404   -program-suffix | --program-suffix | --program-suffi | --program-suff \
405   | --program-suf | --program-su | --program-s)
406     ac_prev=program_suffix ;;
407   -program-suffix=* | --program-suffix=* | --program-suffi=* \
408   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
409     program_suffix="$ac_optarg" ;;
410
411   -program-transform-name | --program-transform-name \
412   | --program-transform-nam | --program-transform-na \
413   | --program-transform-n | --program-transform- \
414   | --program-transform | --program-transfor \
415   | --program-transfo | --program-transf \
416   | --program-trans | --program-tran \
417   | --progr-tra | --program-tr | --program-t)
418     ac_prev=program_transform_name ;;
419   -program-transform-name=* | --program-transform-name=* \
420   | --program-transform-nam=* | --program-transform-na=* \
421   | --program-transform-n=* | --program-transform-=* \
422   | --program-transform=* | --program-transfor=* \
423   | --program-transfo=* | --program-transf=* \
424   | --program-trans=* | --program-tran=* \
425   | --progr-tra=* | --program-tr=* | --program-t=*)
426     program_transform_name="$ac_optarg" ;;
427
428   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
429   | -silent | --silent | --silen | --sile | --sil)
430     silent=yes ;;
431
432   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
433     ac_prev=sbindir ;;
434   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
435   | --sbi=* | --sb=*)
436     sbindir="$ac_optarg" ;;
437
438   -sharedstatedir | --sharedstatedir | --sharedstatedi \
439   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
440   | --sharedst | --shareds | --shared | --share | --shar \
441   | --sha | --sh)
442     ac_prev=sharedstatedir ;;
443   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
444   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
445   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
446   | --sha=* | --sh=*)
447     sharedstatedir="$ac_optarg" ;;
448
449   -site | --site | --sit)
450     ac_prev=site ;;
451   -site=* | --site=* | --sit=*)
452     site="$ac_optarg" ;;
453
454   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
455     ac_prev=srcdir ;;
456   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
457     srcdir="$ac_optarg" ;;
458
459   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
460   | --syscon | --sysco | --sysc | --sys | --sy)
461     ac_prev=sysconfdir ;;
462   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
463   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
464     sysconfdir="$ac_optarg" ;;
465
466   -target | --target | --targe | --targ | --tar | --ta | --t)
467     ac_prev=target ;;
468   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
469     target="$ac_optarg" ;;
470
471   -v | -verbose | --verbose | --verbos | --verbo | --verb)
472     verbose=yes ;;
473
474   -version | --version | --versio | --versi | --vers)
475     echo "configure generated by autoconf version 2.13.1"
476     exit 0 ;;
477
478   -with-* | --with-*)
479     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
480     # Reject names that are not valid shell variable names.
481     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
482       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
483     fi
484     ac_package=`echo $ac_package| sed 's/-/_/g'`
485     case "$ac_option" in
486       *=*) ;;
487       *) ac_optarg=yes ;;
488     esac
489     eval "with_${ac_package}='$ac_optarg'" ;;
490
491   -without-* | --without-*)
492     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
493     # Reject names that are not valid shell variable names.
494     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
495       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
496     fi
497     ac_package=`echo $ac_package| sed 's/-/_/g'`
498     eval "with_${ac_package}=no" ;;
499
500   --x)
501     # Obsolete; use --with-x.
502     with_x=yes ;;
503
504   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
505   | --x-incl | --x-inc | --x-in | --x-i)
506     ac_prev=x_includes ;;
507   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
508   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
509     x_includes="$ac_optarg" ;;
510
511   -x-libraries | --x-libraries | --x-librarie | --x-librari \
512   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
513     ac_prev=x_libraries ;;
514   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
515   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
516     x_libraries="$ac_optarg" ;;
517
518   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
519     ;;
520
521   *)
522     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
523       echo "configure: warning: $ac_option: invalid host type" 1>&2
524     fi
525     if test "x$nonopt" != xNONE; then
526       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
527     fi
528     nonopt="$ac_option"
529     ;;
530
531   esac
532 done
533
534 if test -n "$ac_prev"; then
535   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
536 fi
537
538 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
539
540 # File descriptor usage:
541 # 0 standard input
542 # 1 file creation
543 # 2 errors and warnings
544 # 3 some systems may open it to /dev/tty
545 # 4 used on the Kubota Titan
546 # 6 checking for... messages and results
547 # 5 compiler messages saved in config.log
548 if test "$silent" = yes; then
549   exec 6>/dev/null
550 else
551   exec 6>&1
552 fi
553 exec 5>./config.log
554
555 echo "\
556 This file contains any messages produced by compilers while
557 running configure, to aid debugging if configure makes a mistake.
558 " 1>&5
559
560 # Strip out --no-create and --no-recursion so they do not pile up.
561 # Also quote any args containing shell metacharacters.
562 ac_configure_args=
563 for ac_arg
564 do
565   case "$ac_arg" in
566   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
567   | --no-cr | --no-c) ;;
568   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
569   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
570   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
571   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
572   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
573   esac
574 done
575
576 # NLS nuisances.
577 # Only set these to C if already set.  These must not be set unconditionally
578 # because not all systems understand e.g. LANG=C (notably SCO).
579 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
580 # Non-C LC_CTYPE values break the ctype check.
581 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
582 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
583 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
584 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
585
586 # confdefs.h avoids OS command line length limits that DEFS can exceed.
587 rm -rf conftest* confdefs.h
588 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
589 echo > confdefs.h
590
591 # A filename unique to this package, relative to the directory that
592 # configure is in, which we can look for to find out if srcdir is correct.
593 ac_unique_file=build/version
594
595 # Find the source files, if location was not specified.
596 if test -z "$srcdir"; then
597   ac_srcdir_defaulted=yes
598   # Try the directory containing this script, then its parent.
599   ac_prog=$0
600   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
601   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
602   srcdir=$ac_confdir
603   if test ! -r $srcdir/$ac_unique_file; then
604     srcdir=..
605   fi
606 else
607   ac_srcdir_defaulted=no
608 fi
609 if test ! -r $srcdir/$ac_unique_file; then
610   if test "$ac_srcdir_defaulted" = yes; then
611     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
612   else
613     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
614   fi
615 fi
616 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
617
618 # Prefer explicitly selected file to automatically selected ones.
619 if test -z "$CONFIG_SITE"; then
620   if test "x$prefix" != xNONE; then
621     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
622   else
623     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
624   fi
625 fi
626 for ac_site_file in $CONFIG_SITE; do
627   if test -r "$ac_site_file"; then
628     echo "loading site script $ac_site_file"
629     . "$ac_site_file"
630   fi
631 done
632
633
634 ac_ext=c
635 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
636 ac_cpp='$CPP $CPPFLAGS'
637 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
638 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
639 cross_compiling=$ac_cv_prog_cc_cross
640
641 ac_exeext=
642 ac_objext=o
643 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
644   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
645   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
646     ac_n= ac_c='
647 ' ac_t='        '
648   else
649     ac_n=-n ac_c= ac_t=
650   fi
651 else
652   ac_n= ac_c='\c' ac_t=
653 fi
654
655 ac_aux_dir=
656 for ac_dir in build $srcdir/build; do
657   if test -f $ac_dir/install-sh; then
658     ac_aux_dir=$ac_dir
659     ac_install_sh="$ac_aux_dir/install-sh -c"
660     break
661   elif test -f $ac_dir/install.sh; then
662     ac_aux_dir=$ac_dir
663     ac_install_sh="$ac_aux_dir/install.sh -c"
664     break
665   elif test -f $ac_dir/shtool; then
666     ac_aux_dir=$ac_dir
667     ac_install_sh="$ac_aux_dir/shtool install -c"
668     break
669   fi
670 done
671 if test -z "$ac_aux_dir"; then
672   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
673 fi
674 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
675 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
676 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
677
678 OL_VERSION=`cat $ac_aux_dir/version`
679 if test -z "$OL_VERSION"; then
680         { echo "configure: error: could not determine version" 1>&2; exit 1; }
681 fi
682
683 echo "Configuring OpenLDAP $OL_VERSION ..."
684
685
686 echo $ac_n "checking host system type""... $ac_c" 1>&6
687 echo "configure:688: checking host system type" >&5
688 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
689
690 # Make sure we can run config.sub.
691   if $ac_config_sub sun4 >/dev/null 2>&1; then :
692     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
693   fi
694
695   ac_cv_host_alias=$host
696   case "$ac_cv_host_alias" in
697   NONE)
698     case $nonopt in
699     NONE)
700       if ac_cv_host_alias=`$ac_config_guess`; then :
701       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
702       fi ;;
703     *) ac_cv_host_alias=$nonopt ;;
704     esac ;;
705   esac
706
707   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
708   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
709   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
710   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
711 else
712   echo $ac_n "(cached) $ac_c" 1>&6
713 fi
714
715 echo "$ac_t""$ac_cv_host" 1>&6
716
717 host=$ac_cv_host
718 host_alias=$ac_cv_host_alias
719 host_cpu=$ac_cv_host_cpu
720 host_vendor=$ac_cv_host_vendor
721 host_os=$ac_cv_host_os
722
723
724
725
726
727 echo $ac_n "checking target system type""... $ac_c" 1>&6
728 echo "configure:729: checking target system type" >&5
729 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
730
731 # Make sure we can run config.sub.
732   if $ac_config_sub sun4 >/dev/null 2>&1; then :
733     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
734   fi
735
736   ac_cv_target_alias=$target
737   case "$ac_cv_target_alias" in
738   NONE)
739     case $nonopt in
740     NONE)
741       ac_cv_target_alias=$host_alias ;;
742
743     *) ac_cv_target_alias=$nonopt ;;
744     esac ;;
745   esac
746
747   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
748   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
749   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
750   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
751 else
752   echo $ac_n "(cached) $ac_c" 1>&6
753 fi
754
755 echo "$ac_t""$ac_cv_target" 1>&6
756
757 target=$ac_cv_target
758 target_alias=$ac_cv_target_alias
759 target_cpu=$ac_cv_target_cpu
760 target_vendor=$ac_cv_target_vendor
761 target_os=$ac_cv_target_os
762
763
764
765
766
767 echo $ac_n "checking build system type""... $ac_c" 1>&6
768 echo "configure:769: checking build system type" >&5
769 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
770
771 # Make sure we can run config.sub.
772   if $ac_config_sub sun4 >/dev/null 2>&1; then :
773     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
774   fi
775
776   ac_cv_build_alias=$build
777   case "$ac_cv_build_alias" in
778   NONE)
779     case $nonopt in
780     NONE)
781       ac_cv_build_alias=$host_alias ;;
782
783     *) ac_cv_build_alias=$nonopt ;;
784     esac ;;
785   esac
786
787   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
788   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
789   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
790   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
791 else
792   echo $ac_n "(cached) $ac_c" 1>&6
793 fi
794
795 echo "$ac_t""$ac_cv_build" 1>&6
796
797 build=$ac_cv_build
798 build_alias=$ac_cv_build_alias
799 build_cpu=$ac_cv_build_cpu
800 build_vendor=$ac_cv_build_vendor
801 build_os=$ac_cv_build_os
802
803
804
805
806
807 # Do some error checking and defaulting for the host and target type.
808 # The inputs are:
809 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
810 #
811 # The rules are:
812 # 1. You are not allowed to specify --host, --target, and nonopt at the
813 #    same time.
814 # 2. Host defaults to nonopt.
815 # 3. If nonopt is not specified, then host defaults to the current host,
816 #    as determined by config.guess.
817 # 4. Target and build default to nonopt.
818 # 5. If nonopt is not specified, then target and build default to host.
819
820 # The aliases save the names the user supplied, while $host etc.
821 # will get canonicalized.
822 case $host---$target---$nonopt in
823 NONE---*---* | *---NONE---* | *---*---NONE) ;;
824 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
825 esac
826
827 test "$host_alias" != "$target_alias" &&
828   test "$program_prefix$program_suffix$program_transform_name" = \
829     NONENONEs,x,x, &&
830   program_prefix=${target_alias}-
831
832
833 # Find a good install program.  We prefer a C program (faster),
834 # so one script is as good as another.  But avoid the broken or
835 # incompatible versions:
836 # SysV /etc/install, /usr/sbin/install
837 # SunOS /usr/etc/install
838 # IRIX /sbin/install
839 # AIX /bin/install
840 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
841 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
842 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
843 # ./install, which can be erroneously created by make from ./install.sh.
844 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
845 echo "configure:846: checking for a BSD compatible install" >&5
846 if test -z "$INSTALL"; then
847 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
848   echo $ac_n "(cached) $ac_c" 1>&6
849 else
850     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
851   for ac_dir in $PATH; do
852     # Account for people who put trailing slashes in PATH elements.
853     case "$ac_dir/" in
854     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
855     *)
856       # OSF1 and SCO ODT 3.0 have their own names for install.
857       # Don't use installbsd from OSF since it installs stuff as root
858       # by default.
859       for ac_prog in ginstall scoinst install; do
860         if test -f $ac_dir/$ac_prog; then
861           if test $ac_prog = install &&
862             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
863             # AIX install.  It has an incompatible calling convention.
864             :
865           elif test $ac_prog = install &&
866             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
867             # program-specific install script used by HP pwplus--don't use.
868             :
869           else
870             ac_cv_path_install="$ac_dir/$ac_prog -c"
871             break 2
872           fi
873         fi
874       done
875       ;;
876     esac
877   done
878   IFS="$ac_save_IFS"
879
880 fi
881   if test "${ac_cv_path_install+set}" = set; then
882     INSTALL="$ac_cv_path_install"
883   else
884     # As a last resort, use the slow shell script.  We don't cache a
885     # path for INSTALL within a source directory, because that will
886     # break other packages using the cache if that directory is
887     # removed, or if the path is relative.
888     INSTALL="$ac_install_sh"
889   fi
890 fi
891 echo "$ac_t""$INSTALL" 1>&6
892
893 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
894 # It thinks the first close brace ends the variable substitution.
895 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
896
897 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
898
899 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
900
901 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
902 echo "configure:903: checking whether build environment is sane" >&5
903 # Just in case
904 sleep 1
905 echo timestamp > conftestfile
906 # Do `set' in a subshell so we don't clobber the current shell's
907 # arguments.  Must try -L first in case configure is actually a
908 # symlink; some systems play weird games with the mod time of symlinks
909 # (eg FreeBSD returns the mod time of the symlink's containing
910 # directory).
911 if (
912    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
913    if test "$*" = "X"; then
914       # -L didn't work.
915       set X `ls -t $srcdir/configure conftestfile`
916    fi
917    if test "$*" != "X $srcdir/configure conftestfile" \
918       && test "$*" != "X conftestfile $srcdir/configure"; then
919
920       # If neither matched, then we have a broken ls.  This can happen
921       # if, for instance, CONFIG_SHELL is bash and it inherits a
922       # broken ls alias from the environment.  This has actually
923       # happened.  Such a system could not be considered "sane".
924       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
925 alias in your environment" 1>&2; exit 1; }
926    fi
927
928    test "$2" = conftestfile
929    )
930 then
931    # Ok.
932    :
933 else
934    { echo "configure: error: newly created file is older than distributed files!
935 Check your system clock" 1>&2; exit 1; }
936 fi
937 rm -f conftest*
938 echo "$ac_t""yes" 1>&6
939 if test "$program_transform_name" = s,x,x,; then
940   program_transform_name=
941 else
942   # Double any \ or $.  echo might interpret backslashes.
943   cat <<\EOF_SED > conftestsed
944 s,\\,\\\\,g; s,\$,$$,g
945 EOF_SED
946   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
947   rm -f conftestsed
948 fi
949 test "$program_prefix" != NONE &&
950   program_transform_name="s,^,${program_prefix},;$program_transform_name"
951 # Use a double $ so make ignores it.
952 test "$program_suffix" != NONE &&
953   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
954
955 # sed with no file args requires a program.
956 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
957
958 for ac_prog in mawk gawk nawk awk
959 do
960 # Extract the first word of "$ac_prog", so it can be a program name with args.
961 set dummy $ac_prog; ac_word=$2
962 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
963 echo "configure:964: checking for $ac_word" >&5
964 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
965   echo $ac_n "(cached) $ac_c" 1>&6
966 else
967   if test -n "$AWK"; then
968   ac_cv_prog_AWK="$AWK" # Let the user override the test.
969 else
970   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
971   ac_dummy="$PATH"
972   for ac_dir in $ac_dummy; do
973     test -z "$ac_dir" && ac_dir=.
974     if test -f $ac_dir/$ac_word; then
975       ac_cv_prog_AWK="$ac_prog"
976       break
977     fi
978   done
979   IFS="$ac_save_ifs"
980 fi
981 fi
982 AWK="$ac_cv_prog_AWK"
983 if test -n "$AWK"; then
984   echo "$ac_t""$AWK" 1>&6
985 else
986   echo "$ac_t""no" 1>&6
987 fi
988
989 test -n "$AWK" && break
990 done
991
992 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
993 echo "configure:994: checking whether ${MAKE-make} sets \${MAKE}" >&5
994 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
995 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
996   echo $ac_n "(cached) $ac_c" 1>&6
997 else
998   cat > conftestmake <<\EOF
999 all:
1000         @echo 'ac_maketemp="${MAKE}"'
1001 EOF
1002 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1003 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1004 if test -n "$ac_maketemp"; then
1005   eval ac_cv_prog_make_${ac_make}_set=yes
1006 else
1007   eval ac_cv_prog_make_${ac_make}_set=no
1008 fi
1009 rm -f conftestmake
1010 fi
1011 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1012   echo "$ac_t""yes" 1>&6
1013   SET_MAKE=
1014 else
1015   echo "$ac_t""no" 1>&6
1016   SET_MAKE="MAKE=${MAKE-make}"
1017 fi
1018
1019
1020
1021 PACKAGE=OpenLDAP
1022
1023 VERSION=$OL_VERSION
1024
1025 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1026   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1027 fi
1028
1029
1030
1031 missing_dir=`cd $ac_aux_dir && pwd`
1032 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1033 echo "configure:1034: checking for working aclocal" >&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 (aclocal --version) < /dev/null > /dev/null 2>&1; then
1038    ACLOCAL=aclocal
1039    echo "$ac_t""found" 1>&6
1040 else
1041    ACLOCAL="$missing_dir/missing aclocal"
1042    echo "$ac_t""missing" 1>&6
1043 fi
1044
1045 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1046 echo "configure:1047: checking for working autoconf" >&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 (autoconf --version) < /dev/null > /dev/null 2>&1; then
1051    AUTOCONF=autoconf
1052    echo "$ac_t""found" 1>&6
1053 else
1054    AUTOCONF="$missing_dir/missing autoconf"
1055    echo "$ac_t""missing" 1>&6
1056 fi
1057
1058 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1059 echo "configure:1060: checking for working automake" >&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 (automake --version) < /dev/null > /dev/null 2>&1; then
1064    AUTOMAKE=automake
1065    echo "$ac_t""found" 1>&6
1066 else
1067    AUTOMAKE="$missing_dir/missing automake"
1068    echo "$ac_t""missing" 1>&6
1069 fi
1070
1071 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1072 echo "configure:1073: checking for working autoheader" >&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 (autoheader --version) < /dev/null > /dev/null 2>&1; then
1077    AUTOHEADER=autoheader
1078    echo "$ac_t""found" 1>&6
1079 else
1080    AUTOHEADER="$missing_dir/missing autoheader"
1081    echo "$ac_t""missing" 1>&6
1082 fi
1083
1084 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1085 echo "configure:1086: checking for working makeinfo" >&5
1086 # Run test in a subshell; some versions of sh will print an error if
1087 # an executable is not found, even if stderr is redirected.
1088 # Redirect stdin to placate older versions of autoconf.  Sigh.
1089 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1090    MAKEINFO=makeinfo
1091    echo "$ac_t""found" 1>&6
1092 else
1093    MAKEINFO="$missing_dir/missing makeinfo"
1094    echo "$ac_t""missing" 1>&6
1095 fi
1096
1097 install_sh="$missing_dir/install-sh"
1098 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1099
1100 for ac_prog in gnutar gtar tar
1101 do
1102 # Extract the first word of "$ac_prog", so it can be a program name with args.
1103 set dummy $ac_prog; ac_word=$2
1104 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1105 echo "configure:1106: checking for $ac_word" >&5
1106 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1107   echo $ac_n "(cached) $ac_c" 1>&6
1108 else
1109   if test -n "$AMTAR"; then
1110   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1111 else
1112   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1113   ac_dummy="$PATH"
1114   for ac_dir in $ac_dummy; do
1115     test -z "$ac_dir" && ac_dir=.
1116     if test -f $ac_dir/$ac_word; then
1117       ac_cv_prog_AMTAR="$ac_prog"
1118       break
1119     fi
1120   done
1121   IFS="$ac_save_ifs"
1122 fi
1123 fi
1124 AMTAR="$ac_cv_prog_AMTAR"
1125 if test -n "$AMTAR"; then
1126   echo "$ac_t""$AMTAR" 1>&6
1127 else
1128   echo "$ac_t""no" 1>&6
1129 fi
1130
1131 test -n "$AMTAR" && break
1132 done
1133
1134
1135 AMTARFLAGS=
1136 if test -n "$AMTAR"; then
1137   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1138         AMTARFLAGS=o
1139   fi
1140 fi
1141
1142
1143
1144 cat >> confdefs.h <<EOF
1145 #define OPENLDAP_PACKAGE "$PACKAGE"
1146 EOF
1147
1148 cat >> confdefs.h <<EOF
1149 #define OPENLDAP_VERSION "$VERSION"
1150 EOF
1151
1152
1153
1154
1155 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1156 echo "configure:1157: checking configure arguments" >&5
1157
1158
1159 top_builddir=`pwd`
1160
1161 ldap_subdir="/openldap"
1162
1163 # Check whether --with-subdir or --without-subdir was given.
1164 if test "${with_subdir+set}" = set; then
1165   withval="$with_subdir"
1166   case "$withval" in
1167         no) ldap_subdir=""
1168                 ;;
1169         yes)
1170                 ;;
1171         /*|\\*)
1172                 ldap_subdir="$withval"
1173                 ;;
1174         *)
1175                 ldap_subdir="/$withval"
1176                 ;;
1177 esac
1178
1179 fi
1180
1181
1182 # OpenLDAP --enable-debug
1183         # Check whether --enable-debug or --disable-debug was given.
1184 if test "${enable_debug+set}" = set; then
1185   enableval="$enable_debug"
1186   
1187         ol_arg=invalid
1188         for ol_val in auto yes no ; do
1189                 if test "$enableval" = "$ol_val" ; then
1190                         ol_arg="$ol_val"
1191                 fi
1192         done
1193         if test "$ol_arg" = "invalid" ; then
1194                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1195         fi
1196         ol_enable_debug="$ol_arg"
1197
1198 else
1199         ol_enable_debug="yes"
1200 fi
1201 # end --enable-debug
1202 # OpenLDAP --enable-syslog
1203         # Check whether --enable-syslog or --disable-syslog was given.
1204 if test "${enable_syslog+set}" = set; then
1205   enableval="$enable_syslog"
1206   
1207         ol_arg=invalid
1208         for ol_val in auto yes no ; do
1209                 if test "$enableval" = "$ol_val" ; then
1210                         ol_arg="$ol_val"
1211                 fi
1212         done
1213         if test "$ol_arg" = "invalid" ; then
1214                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1215         fi
1216         ol_enable_syslog="$ol_arg"
1217
1218 else
1219         ol_enable_syslog="auto"
1220 fi
1221 # end --enable-syslog
1222 # OpenLDAP --enable-proctitle
1223         # Check whether --enable-proctitle or --disable-proctitle was given.
1224 if test "${enable_proctitle+set}" = set; then
1225   enableval="$enable_proctitle"
1226   
1227         ol_arg=invalid
1228         for ol_val in auto yes no ; do
1229                 if test "$enableval" = "$ol_val" ; then
1230                         ol_arg="$ol_val"
1231                 fi
1232         done
1233         if test "$ol_arg" = "invalid" ; then
1234                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1235         fi
1236         ol_enable_proctitle="$ol_arg"
1237
1238 else
1239         ol_enable_proctitle="yes"
1240 fi
1241 # end --enable-proctitle
1242 # OpenLDAP --enable-cache
1243         # Check whether --enable-cache or --disable-cache was given.
1244 if test "${enable_cache+set}" = set; then
1245   enableval="$enable_cache"
1246   
1247         ol_arg=invalid
1248         for ol_val in auto yes no ; do
1249                 if test "$enableval" = "$ol_val" ; then
1250                         ol_arg="$ol_val"
1251                 fi
1252         done
1253         if test "$ol_arg" = "invalid" ; then
1254                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
1255         fi
1256         ol_enable_cache="$ol_arg"
1257
1258 else
1259         ol_enable_cache="yes"
1260 fi
1261 # end --enable-cache
1262 # OpenLDAP --enable-dns
1263         # Check whether --enable-dns or --disable-dns was given.
1264 if test "${enable_dns+set}" = set; then
1265   enableval="$enable_dns"
1266   
1267         ol_arg=invalid
1268         for ol_val in auto yes no ; do
1269                 if test "$enableval" = "$ol_val" ; then
1270                         ol_arg="$ol_val"
1271                 fi
1272         done
1273         if test "$ol_arg" = "invalid" ; then
1274                 { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; }
1275         fi
1276         ol_enable_dns="$ol_arg"
1277
1278 else
1279         ol_enable_dns="no"
1280 fi
1281 # end --enable-dns
1282 # OpenLDAP --enable-referrals
1283         # Check whether --enable-referrals or --disable-referrals was given.
1284 if test "${enable_referrals+set}" = set; then
1285   enableval="$enable_referrals"
1286   
1287         ol_arg=invalid
1288         for ol_val in auto yes no ; do
1289                 if test "$enableval" = "$ol_val" ; then
1290                         ol_arg="$ol_val"
1291                 fi
1292         done
1293         if test "$ol_arg" = "invalid" ; then
1294                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1295         fi
1296         ol_enable_referrals="$ol_arg"
1297
1298 else
1299         ol_enable_referrals="yes"
1300 fi
1301 # end --enable-referrals
1302 # OpenLDAP --enable-kbind
1303         # Check whether --enable-kbind or --disable-kbind was given.
1304 if test "${enable_kbind+set}" = set; then
1305   enableval="$enable_kbind"
1306   
1307         ol_arg=invalid
1308         for ol_val in auto yes no ; do
1309                 if test "$enableval" = "$ol_val" ; then
1310                         ol_arg="$ol_val"
1311                 fi
1312         done
1313         if test "$ol_arg" = "invalid" ; then
1314                 { echo "configure: error: bad value $enableval for --enable-kbind" 1>&2; exit 1; }
1315         fi
1316         ol_enable_kbind="$ol_arg"
1317
1318 else
1319         ol_enable_kbind="auto"
1320 fi
1321 # end --enable-kbind
1322 # OpenLDAP --enable-cldap
1323         # Check whether --enable-cldap or --disable-cldap was given.
1324 if test "${enable_cldap+set}" = set; then
1325   enableval="$enable_cldap"
1326   
1327         ol_arg=invalid
1328         for ol_val in auto yes no ; do
1329                 if test "$enableval" = "$ol_val" ; then
1330                         ol_arg="$ol_val"
1331                 fi
1332         done
1333         if test "$ol_arg" = "invalid" ; then
1334                 { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; }
1335         fi
1336         ol_enable_cldap="$ol_arg"
1337
1338 else
1339         ol_enable_cldap="no"
1340 fi
1341 # end --enable-cldap
1342 # OpenLDAP --enable-ldapi
1343         # Check whether --enable-ldapi or --disable-ldapi was given.
1344 if test "${enable_ldapi+set}" = set; then
1345   enableval="$enable_ldapi"
1346   
1347         ol_arg=invalid
1348         for ol_val in auto yes no ; do
1349                 if test "$enableval" = "$ol_val" ; then
1350                         ol_arg="$ol_val"
1351                 fi
1352         done
1353         if test "$ol_arg" = "invalid" ; then
1354                 { echo "configure: error: bad value $enableval for --enable-ldapi" 1>&2; exit 1; }
1355         fi
1356         ol_enable_ldapi="$ol_arg"
1357
1358 else
1359         ol_enable_ldapi="no"
1360 fi
1361 # end --enable-ldapi
1362 # OpenLDAP --enable-x_compile
1363         # Check whether --enable-x_compile or --disable-x_compile was given.
1364 if test "${enable_x_compile+set}" = set; then
1365   enableval="$enable_x_compile"
1366   
1367         ol_arg=invalid
1368         for ol_val in yes no ; do
1369                 if test "$enableval" = "$ol_val" ; then
1370                         ol_arg="$ol_val"
1371                 fi
1372         done
1373         if test "$ol_arg" = "invalid" ; then
1374                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1375         fi
1376         ol_enable_x_compile="$ol_arg"
1377
1378 else
1379         ol_enable_x_compile="no"
1380 fi
1381 # end --enable-x_compile
1382
1383 # OpenLDAP --enable-dmalloc
1384         # Check whether --enable-dmalloc or --disable-dmalloc was given.
1385 if test "${enable_dmalloc+set}" = set; then
1386   enableval="$enable_dmalloc"
1387   
1388         ol_arg=invalid
1389         for ol_val in auto yes no ; do
1390                 if test "$enableval" = "$ol_val" ; then
1391                         ol_arg="$ol_val"
1392                 fi
1393         done
1394         if test "$ol_arg" = "invalid" ; then
1395                 { echo "configure: error: bad value $enableval for --enable-dmalloc" 1>&2; exit 1; }
1396         fi
1397         ol_enable_dmalloc="$ol_arg"
1398
1399 else
1400         ol_enable_dmalloc="no"
1401 fi
1402 # end --enable-dmalloc
1403
1404 # OpenLDAP --with-cyrus_sasl
1405         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1406 if test "${with_cyrus_sasl+set}" = set; then
1407   withval="$with_cyrus_sasl"
1408   
1409         ol_arg=invalid
1410         for ol_val in auto yes no  ; do
1411                 if test "$withval" = "$ol_val" ; then
1412                         ol_arg="$ol_val"
1413                 fi
1414         done
1415         if test "$ol_arg" = "invalid" ; then
1416                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1417         fi
1418         ol_with_cyrus_sasl="$ol_arg"
1419
1420 else
1421         ol_with_cyrus_sasl="auto"
1422 fi
1423 # end --with-cyrus_sasl
1424
1425 # OpenLDAP --with-fetch
1426         # Check whether --with-fetch or --without-fetch was given.
1427 if test "${with_fetch+set}" = set; then
1428   withval="$with_fetch"
1429   
1430         ol_arg=invalid
1431         for ol_val in auto yes no  ; do
1432                 if test "$withval" = "$ol_val" ; then
1433                         ol_arg="$ol_val"
1434                 fi
1435         done
1436         if test "$ol_arg" = "invalid" ; then
1437                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1438         fi
1439         ol_with_fetch="$ol_arg"
1440
1441 else
1442         ol_with_fetch="auto"
1443 fi
1444 # end --with-fetch
1445
1446 # OpenLDAP --with-kerberos
1447         # Check whether --with-kerberos or --without-kerberos was given.
1448 if test "${with_kerberos+set}" = set; then
1449   withval="$with_kerberos"
1450   
1451         ol_arg=invalid
1452         for ol_val in auto k5 k5only k425 kth k4 afs yes no ; do
1453                 if test "$withval" = "$ol_val" ; then
1454                         ol_arg="$ol_val"
1455                 fi
1456         done
1457         if test "$ol_arg" = "invalid" ; then
1458                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1459         fi
1460         ol_with_kerberos="$ol_arg"
1461
1462 else
1463         ol_with_kerberos="auto"
1464 fi
1465 # end --with-kerberos
1466
1467 # OpenLDAP --with-readline
1468         # Check whether --with-readline or --without-readline was given.
1469 if test "${with_readline+set}" = set; then
1470   withval="$with_readline"
1471   
1472         ol_arg=invalid
1473         for ol_val in auto yes no  ; do
1474                 if test "$withval" = "$ol_val" ; then
1475                         ol_arg="$ol_val"
1476                 fi
1477         done
1478         if test "$ol_arg" = "invalid" ; then
1479                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1480         fi
1481         ol_with_readline="$ol_arg"
1482
1483 else
1484         ol_with_readline="auto"
1485 fi
1486 # end --with-readline
1487
1488 # OpenLDAP --with-threads
1489         # Check whether --with-threads or --without-threads was given.
1490 if test "${with_threads+set}" = set; then
1491   withval="$with_threads"
1492   
1493         ol_arg=invalid
1494         for ol_val in auto nt posix mach pth lwp yes no manual  ; do
1495                 if test "$withval" = "$ol_val" ; then
1496                         ol_arg="$ol_val"
1497                 fi
1498         done
1499         if test "$ol_arg" = "invalid" ; then
1500                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1501         fi
1502         ol_with_threads="$ol_arg"
1503
1504 else
1505         ol_with_threads="auto"
1506 fi
1507 # end --with-threads
1508
1509 # OpenLDAP --with-tls
1510         # Check whether --with-tls or --without-tls was given.
1511 if test "${with_tls+set}" = set; then
1512   withval="$with_tls"
1513   
1514         ol_arg=invalid
1515         for ol_val in auto ssleay openssl yes no  ; do
1516                 if test "$withval" = "$ol_val" ; then
1517                         ol_arg="$ol_val"
1518                 fi
1519         done
1520         if test "$ol_arg" = "invalid" ; then
1521                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1522         fi
1523         ol_with_tls="$ol_arg"
1524
1525 else
1526         ol_with_tls="auto"
1527 fi
1528 # end --with-tls
1529
1530 # OpenLDAP --with-yielding_select
1531         # Check whether --with-yielding_select or --without-yielding_select was given.
1532 if test "${with_yielding_select+set}" = set; then
1533   withval="$with_yielding_select"
1534   
1535         ol_arg=invalid
1536         for ol_val in auto yes no manual  ; do
1537                 if test "$withval" = "$ol_val" ; then
1538                         ol_arg="$ol_val"
1539                 fi
1540         done
1541         if test "$ol_arg" = "invalid" ; then
1542                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1543         fi
1544         ol_with_yielding_select="$ol_arg"
1545
1546 else
1547         ol_with_yielding_select="auto"
1548 fi
1549 # end --with-yielding_select
1550
1551
1552 # Check whether --with-xxldapdoptions or --without-xxldapdoptions was given.
1553 if test "${with_xxldapdoptions+set}" = set; then
1554   withval="$with_xxldapdoptions"
1555   :
1556 fi
1557
1558 # OpenLDAP --enable-ldapd
1559         # Check whether --enable-ldapd or --disable-ldapd was given.
1560 if test "${enable_ldapd+set}" = set; then
1561   enableval="$enable_ldapd"
1562   
1563         ol_arg=invalid
1564         for ol_val in auto yes no ; do
1565                 if test "$enableval" = "$ol_val" ; then
1566                         ol_arg="$ol_val"
1567                 fi
1568         done
1569         if test "$ol_arg" = "invalid" ; then
1570                 { echo "configure: error: bad value $enableval for --enable-ldapd" 1>&2; exit 1; }
1571         fi
1572         ol_enable_ldapd="$ol_arg"
1573
1574 else
1575         ol_enable_ldapd="no"
1576 fi
1577 # end --enable-ldapd
1578
1579 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1580 if test "${with_xxslapdoptions+set}" = set; then
1581   withval="$with_xxslapdoptions"
1582   :
1583 fi
1584
1585 # OpenLDAP --enable-slapd
1586         # Check whether --enable-slapd or --disable-slapd was given.
1587 if test "${enable_slapd+set}" = set; then
1588   enableval="$enable_slapd"
1589   
1590         ol_arg=invalid
1591         for ol_val in auto yes no ; do
1592                 if test "$enableval" = "$ol_val" ; then
1593                         ol_arg="$ol_val"
1594                 fi
1595         done
1596         if test "$ol_arg" = "invalid" ; then
1597                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1598         fi
1599         ol_enable_slapd="$ol_arg"
1600
1601 else
1602         ol_enable_slapd="yes"
1603 fi
1604 # end --enable-slapd
1605 # OpenLDAP --enable-cleartext
1606         # Check whether --enable-cleartext or --disable-cleartext was given.
1607 if test "${enable_cleartext+set}" = set; then
1608   enableval="$enable_cleartext"
1609   
1610         ol_arg=invalid
1611         for ol_val in auto yes no ; do
1612                 if test "$enableval" = "$ol_val" ; then
1613                         ol_arg="$ol_val"
1614                 fi
1615         done
1616         if test "$ol_arg" = "invalid" ; then
1617                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1618         fi
1619         ol_enable_cleartext="$ol_arg"
1620
1621 else
1622         ol_enable_cleartext="yes"
1623 fi
1624 # end --enable-cleartext
1625 # OpenLDAP --enable-crypt
1626         # Check whether --enable-crypt or --disable-crypt was given.
1627 if test "${enable_crypt+set}" = set; then
1628   enableval="$enable_crypt"
1629   
1630         ol_arg=invalid
1631         for ol_val in auto yes no ; do
1632                 if test "$enableval" = "$ol_val" ; then
1633                         ol_arg="$ol_val"
1634                 fi
1635         done
1636         if test "$ol_arg" = "invalid" ; then
1637                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1638         fi
1639         ol_enable_crypt="$ol_arg"
1640
1641 else
1642         ol_enable_crypt="auto"
1643 fi
1644 # end --enable-crypt
1645 # OpenLDAP --enable-kpasswd
1646         # Check whether --enable-kpasswd or --disable-kpasswd was given.
1647 if test "${enable_kpasswd+set}" = set; then
1648   enableval="$enable_kpasswd"
1649   
1650         ol_arg=invalid
1651         for ol_val in auto yes no ; do
1652                 if test "$enableval" = "$ol_val" ; then
1653                         ol_arg="$ol_val"
1654                 fi
1655         done
1656         if test "$ol_arg" = "invalid" ; then
1657                 { echo "configure: error: bad value $enableval for --enable-kpasswd" 1>&2; exit 1; }
1658         fi
1659         ol_enable_kpasswd="$ol_arg"
1660
1661 else
1662         ol_enable_kpasswd="no"
1663 fi
1664 # end --enable-kpasswd
1665 # OpenLDAP --enable-spasswd
1666         # Check whether --enable-spasswd or --disable-spasswd was given.
1667 if test "${enable_spasswd+set}" = set; then
1668   enableval="$enable_spasswd"
1669   
1670         ol_arg=invalid
1671         for ol_val in auto yes no ; do
1672                 if test "$enableval" = "$ol_val" ; then
1673                         ol_arg="$ol_val"
1674                 fi
1675         done
1676         if test "$ol_arg" = "invalid" ; then
1677                 { echo "configure: error: bad value $enableval for --enable-spasswd" 1>&2; exit 1; }
1678         fi
1679         ol_enable_spasswd="$ol_arg"
1680
1681 else
1682         ol_enable_spasswd="no"
1683 fi
1684 # end --enable-spasswd
1685 # OpenLDAP --enable-modules
1686         # Check whether --enable-modules or --disable-modules was given.
1687 if test "${enable_modules+set}" = set; then
1688   enableval="$enable_modules"
1689   
1690         ol_arg=invalid
1691         for ol_val in auto yes no ; do
1692                 if test "$enableval" = "$ol_val" ; then
1693                         ol_arg="$ol_val"
1694                 fi
1695         done
1696         if test "$ol_arg" = "invalid" ; then
1697                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1698         fi
1699         ol_enable_modules="$ol_arg"
1700
1701 else
1702         ol_enable_modules="no"
1703 fi
1704 # end --enable-modules
1705 # OpenLDAP --enable-multimaster
1706         # Check whether --enable-multimaster or --disable-multimaster was given.
1707 if test "${enable_multimaster+set}" = set; then
1708   enableval="$enable_multimaster"
1709   
1710         ol_arg=invalid
1711         for ol_val in auto yes no ; do
1712                 if test "$enableval" = "$ol_val" ; then
1713                         ol_arg="$ol_val"
1714                 fi
1715         done
1716         if test "$ol_arg" = "invalid" ; then
1717                 { echo "configure: error: bad value $enableval for --enable-multimaster" 1>&2; exit 1; }
1718         fi
1719         ol_enable_multimaster="$ol_arg"
1720
1721 else
1722         ol_enable_multimaster="no"
1723 fi
1724 # end --enable-multimaster
1725 # OpenLDAP --enable-phonetic
1726         # Check whether --enable-phonetic or --disable-phonetic was given.
1727 if test "${enable_phonetic+set}" = set; then
1728   enableval="$enable_phonetic"
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-phonetic" 1>&2; exit 1; }
1738         fi
1739         ol_enable_phonetic="$ol_arg"
1740
1741 else
1742         ol_enable_phonetic="no"
1743 fi
1744 # end --enable-phonetic
1745 # OpenLDAP --enable-quipu
1746         # Check whether --enable-quipu or --disable-quipu was given.
1747 if test "${enable_quipu+set}" = set; then
1748   enableval="$enable_quipu"
1749   
1750         ol_arg=invalid
1751         for ol_val in auto yes no ; do
1752                 if test "$enableval" = "$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 $enableval for --enable-quipu" 1>&2; exit 1; }
1758         fi
1759         ol_enable_quipu="$ol_arg"
1760
1761 else
1762         ol_enable_quipu="no"
1763 fi
1764 # end --enable-quipu
1765 # OpenLDAP --enable-rlookups
1766         # Check whether --enable-rlookups or --disable-rlookups was given.
1767 if test "${enable_rlookups+set}" = set; then
1768   enableval="$enable_rlookups"
1769   
1770         ol_arg=invalid
1771         for ol_val in auto yes no ; do
1772                 if test "$enableval" = "$ol_val" ; then
1773                         ol_arg="$ol_val"
1774                 fi
1775         done
1776         if test "$ol_arg" = "invalid" ; then
1777                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1778         fi
1779         ol_enable_rlookups="$ol_arg"
1780
1781 else
1782         ol_enable_rlookups="auto"
1783 fi
1784 # end --enable-rlookups
1785 # OpenLDAP --enable-aci
1786         # Check whether --enable-aci or --disable-aci was given.
1787 if test "${enable_aci+set}" = set; then
1788   enableval="$enable_aci"
1789   
1790         ol_arg=invalid
1791         for ol_val in auto yes no ; do
1792                 if test "$enableval" = "$ol_val" ; then
1793                         ol_arg="$ol_val"
1794                 fi
1795         done
1796         if test "$ol_arg" = "invalid" ; then
1797                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1798         fi
1799         ol_enable_aci="$ol_arg"
1800
1801 else
1802         ol_enable_aci="no"
1803 fi
1804 # end --enable-aci
1805 # OpenLDAP --enable-wrappers
1806         # Check whether --enable-wrappers or --disable-wrappers was given.
1807 if test "${enable_wrappers+set}" = set; then
1808   enableval="$enable_wrappers"
1809   
1810         ol_arg=invalid
1811         for ol_val in auto yes no ; do
1812                 if test "$enableval" = "$ol_val" ; then
1813                         ol_arg="$ol_val"
1814                 fi
1815         done
1816         if test "$ol_arg" = "invalid" ; then
1817                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1818         fi
1819         ol_enable_wrappers="$ol_arg"
1820
1821 else
1822         ol_enable_wrappers="no"
1823 fi
1824 # end --enable-wrappers
1825 # OpenLDAP --enable-dynamic
1826         # Check whether --enable-dynamic or --disable-dynamic was given.
1827 if test "${enable_dynamic+set}" = set; then
1828   enableval="$enable_dynamic"
1829   
1830         ol_arg=invalid
1831         for ol_val in auto yes no ; do
1832                 if test "$enableval" = "$ol_val" ; then
1833                         ol_arg="$ol_val"
1834                 fi
1835         done
1836         if test "$ol_arg" = "invalid" ; then
1837                 { echo "configure: error: bad value $enableval for --enable-dynamic" 1>&2; exit 1; }
1838         fi
1839         ol_enable_dynamic="$ol_arg"
1840
1841 else
1842         ol_enable_dynamic="no"
1843 fi
1844 # end --enable-dynamic
1845
1846 # OpenLDAP --enable-bdb2
1847         # Check whether --enable-bdb2 or --disable-bdb2 was given.
1848 if test "${enable_bdb2+set}" = set; then
1849   enableval="$enable_bdb2"
1850   
1851         ol_arg=invalid
1852         for ol_val in auto yes no ; do
1853                 if test "$enableval" = "$ol_val" ; then
1854                         ol_arg="$ol_val"
1855                 fi
1856         done
1857         if test "$ol_arg" = "invalid" ; then
1858                 { echo "configure: error: bad value $enableval for --enable-bdb2" 1>&2; exit 1; }
1859         fi
1860         ol_enable_bdb2="$ol_arg"
1861
1862 else
1863         ol_enable_bdb2="no"
1864 fi
1865 # end --enable-bdb2
1866 # OpenLDAP --with-bdb2_module
1867         # Check whether --with-bdb2_module or --without-bdb2_module was given.
1868 if test "${with_bdb2_module+set}" = set; then
1869   withval="$with_bdb2_module"
1870   
1871         ol_arg=invalid
1872         for ol_val in static dynamic ; do
1873                 if test "$withval" = "$ol_val" ; then
1874                         ol_arg="$ol_val"
1875                 fi
1876         done
1877         if test "$ol_arg" = "invalid" ; then
1878                 { echo "configure: error: bad value $withval for --with-bdb2_module" 1>&2; exit 1; }
1879         fi
1880         ol_with_bdb2_module="$ol_arg"
1881
1882 else
1883         ol_with_bdb2_module="static"
1884 fi
1885 # end --with-bdb2_module
1886
1887 # OpenLDAP --enable-dnssrv
1888         # Check whether --enable-dnssrv or --disable-dnssrv was given.
1889 if test "${enable_dnssrv+set}" = set; then
1890   enableval="$enable_dnssrv"
1891   
1892         ol_arg=invalid
1893         for ol_val in auto yes no ; do
1894                 if test "$enableval" = "$ol_val" ; then
1895                         ol_arg="$ol_val"
1896                 fi
1897         done
1898         if test "$ol_arg" = "invalid" ; then
1899                 { echo "configure: error: bad value $enableval for --enable-dnssrv" 1>&2; exit 1; }
1900         fi
1901         ol_enable_dnssrv="$ol_arg"
1902
1903 else
1904         ol_enable_dnssrv="no"
1905 fi
1906 # end --enable-dnssrv
1907 # OpenLDAP --with-dnssrv_module
1908         # Check whether --with-dnssrv_module or --without-dnssrv_module was given.
1909 if test "${with_dnssrv_module+set}" = set; then
1910   withval="$with_dnssrv_module"
1911   
1912         ol_arg=invalid
1913         for ol_val in static dynamic ; do
1914                 if test "$withval" = "$ol_val" ; then
1915                         ol_arg="$ol_val"
1916                 fi
1917         done
1918         if test "$ol_arg" = "invalid" ; then
1919                 { echo "configure: error: bad value $withval for --with-dnssrv_module" 1>&2; exit 1; }
1920         fi
1921         ol_with_dnssrv_module="$ol_arg"
1922
1923 else
1924         ol_with_dnssrv_module="static"
1925 fi
1926 # end --with-dnssrv_module
1927
1928 # OpenLDAP --enable-ldap
1929         # Check whether --enable-ldap or --disable-ldap was given.
1930 if test "${enable_ldap+set}" = set; then
1931   enableval="$enable_ldap"
1932   
1933         ol_arg=invalid
1934         for ol_val in auto yes no ; do
1935                 if test "$enableval" = "$ol_val" ; then
1936                         ol_arg="$ol_val"
1937                 fi
1938         done
1939         if test "$ol_arg" = "invalid" ; then
1940                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1941         fi
1942         ol_enable_ldap="$ol_arg"
1943
1944 else
1945         ol_enable_ldap="no"
1946 fi
1947 # end --enable-ldap
1948 # OpenLDAP --with-ldap_module
1949         # Check whether --with-ldap_module or --without-ldap_module was given.
1950 if test "${with_ldap_module+set}" = set; then
1951   withval="$with_ldap_module"
1952   
1953         ol_arg=invalid
1954         for ol_val in static dynamic ; do
1955                 if test "$withval" = "$ol_val" ; then
1956                         ol_arg="$ol_val"
1957                 fi
1958         done
1959         if test "$ol_arg" = "invalid" ; then
1960                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
1961         fi
1962         ol_with_ldap_module="$ol_arg"
1963
1964 else
1965         ol_with_ldap_module="static"
1966 fi
1967 # end --with-ldap_module
1968
1969 # OpenLDAP --enable-ldbm
1970         # Check whether --enable-ldbm or --disable-ldbm was given.
1971 if test "${enable_ldbm+set}" = set; then
1972   enableval="$enable_ldbm"
1973   
1974         ol_arg=invalid
1975         for ol_val in auto yes no ; do
1976                 if test "$enableval" = "$ol_val" ; then
1977                         ol_arg="$ol_val"
1978                 fi
1979         done
1980         if test "$ol_arg" = "invalid" ; then
1981                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1982         fi
1983         ol_enable_ldbm="$ol_arg"
1984
1985 else
1986         ol_enable_ldbm="yes"
1987 fi
1988 # end --enable-ldbm
1989 # OpenLDAP --with-ldbm_api
1990         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1991 if test "${with_ldbm_api+set}" = set; then
1992   withval="$with_ldbm_api"
1993   
1994         ol_arg=invalid
1995         for ol_val in auto berkeley bcompat mdbm gdbm ; do
1996                 if test "$withval" = "$ol_val" ; then
1997                         ol_arg="$ol_val"
1998                 fi
1999         done
2000         if test "$ol_arg" = "invalid" ; then
2001                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
2002         fi
2003         ol_with_ldbm_api="$ol_arg"
2004
2005 else
2006         ol_with_ldbm_api="auto"
2007 fi
2008 # end --with-ldbm_api
2009
2010 # OpenLDAP --with-ldbm_module
2011         # Check whether --with-ldbm_module or --without-ldbm_module was given.
2012 if test "${with_ldbm_module+set}" = set; then
2013   withval="$with_ldbm_module"
2014   
2015         ol_arg=invalid
2016         for ol_val in static dynamic ; do
2017                 if test "$withval" = "$ol_val" ; then
2018                         ol_arg="$ol_val"
2019                 fi
2020         done
2021         if test "$ol_arg" = "invalid" ; then
2022                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
2023         fi
2024         ol_with_ldbm_module="$ol_arg"
2025
2026 else
2027         ol_with_ldbm_module="static"
2028 fi
2029 # end --with-ldbm_module
2030
2031 # OpenLDAP --with-ldbm_type
2032         # Check whether --with-ldbm_type or --without-ldbm_type was given.
2033 if test "${with_ldbm_type+set}" = set; then
2034   withval="$with_ldbm_type"
2035   
2036         ol_arg=invalid
2037         for ol_val in auto btree hash ; do
2038                 if test "$withval" = "$ol_val" ; then
2039                         ol_arg="$ol_val"
2040                 fi
2041         done
2042         if test "$ol_arg" = "invalid" ; then
2043                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
2044         fi
2045         ol_with_ldbm_type="$ol_arg"
2046
2047 else
2048         ol_with_ldbm_type="auto"
2049 fi
2050 # end --with-ldbm_type
2051
2052 # OpenLDAP --enable-passwd
2053         # Check whether --enable-passwd or --disable-passwd was given.
2054 if test "${enable_passwd+set}" = set; then
2055   enableval="$enable_passwd"
2056   
2057         ol_arg=invalid
2058         for ol_val in auto yes no ; do
2059                 if test "$enableval" = "$ol_val" ; then
2060                         ol_arg="$ol_val"
2061                 fi
2062         done
2063         if test "$ol_arg" = "invalid" ; then
2064                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
2065         fi
2066         ol_enable_passwd="$ol_arg"
2067
2068 else
2069         ol_enable_passwd="no"
2070 fi
2071 # end --enable-passwd
2072 # OpenLDAP --with-passwd_module
2073         # Check whether --with-passwd_module or --without-passwd_module was given.
2074 if test "${with_passwd_module+set}" = set; then
2075   withval="$with_passwd_module"
2076   
2077         ol_arg=invalid
2078         for ol_val in static dynamic ; do
2079                 if test "$withval" = "$ol_val" ; then
2080                         ol_arg="$ol_val"
2081                 fi
2082         done
2083         if test "$ol_arg" = "invalid" ; then
2084                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
2085         fi
2086         ol_with_passwd_module="$ol_arg"
2087
2088 else
2089         ol_with_passwd_module="static"
2090 fi
2091 # end --with-passwd_module
2092
2093 # OpenLDAP --enable-perl
2094         # Check whether --enable-perl or --disable-perl was given.
2095 if test "${enable_perl+set}" = set; then
2096   enableval="$enable_perl"
2097   
2098         ol_arg=invalid
2099         for ol_val in auto yes no ; do
2100                 if test "$enableval" = "$ol_val" ; then
2101                         ol_arg="$ol_val"
2102                 fi
2103         done
2104         if test "$ol_arg" = "invalid" ; then
2105                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
2106         fi
2107         ol_enable_perl="$ol_arg"
2108
2109 else
2110         ol_enable_perl="no"
2111 fi
2112 # end --enable-perl
2113 # OpenLDAP --with-perl_module
2114         # Check whether --with-perl_module or --without-perl_module was given.
2115 if test "${with_perl_module+set}" = set; then
2116   withval="$with_perl_module"
2117   
2118         ol_arg=invalid
2119         for ol_val in static dynamic ; do
2120                 if test "$withval" = "$ol_val" ; then
2121                         ol_arg="$ol_val"
2122                 fi
2123         done
2124         if test "$ol_arg" = "invalid" ; then
2125                 { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; }
2126         fi
2127         ol_with_perl_module="$ol_arg"
2128
2129 else
2130         ol_with_perl_module="static"
2131 fi
2132 # end --with-perl_module
2133
2134 # OpenLDAP --enable-shell
2135         # Check whether --enable-shell or --disable-shell was given.
2136 if test "${enable_shell+set}" = set; then
2137   enableval="$enable_shell"
2138   
2139         ol_arg=invalid
2140         for ol_val in auto yes no ; do
2141                 if test "$enableval" = "$ol_val" ; then
2142                         ol_arg="$ol_val"
2143                 fi
2144         done
2145         if test "$ol_arg" = "invalid" ; then
2146                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
2147         fi
2148         ol_enable_shell="$ol_arg"
2149
2150 else
2151         ol_enable_shell="no"
2152 fi
2153 # end --enable-shell
2154 # OpenLDAP --with-shell_module
2155         # Check whether --with-shell_module or --without-shell_module was given.
2156 if test "${with_shell_module+set}" = set; then
2157   withval="$with_shell_module"
2158   
2159         ol_arg=invalid
2160         for ol_val in static dynamic ; do
2161                 if test "$withval" = "$ol_val" ; then
2162                         ol_arg="$ol_val"
2163                 fi
2164         done
2165         if test "$ol_arg" = "invalid" ; then
2166                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
2167         fi
2168         ol_with_shell_module="$ol_arg"
2169
2170 else
2171         ol_with_shell_module="static"
2172 fi
2173 # end --with-shell_module
2174
2175 # OpenLDAP --enable-sql
2176         # Check whether --enable-sql or --disable-sql was given.
2177 if test "${enable_sql+set}" = set; then
2178   enableval="$enable_sql"
2179   
2180         ol_arg=invalid
2181         for ol_val in auto yes no ; do
2182                 if test "$enableval" = "$ol_val" ; then
2183                         ol_arg="$ol_val"
2184                 fi
2185         done
2186         if test "$ol_arg" = "invalid" ; then
2187                 { echo "configure: error: bad value $enableval for --enable-sql" 1>&2; exit 1; }
2188         fi
2189         ol_enable_sql="$ol_arg"
2190
2191 else
2192         ol_enable_sql="no"
2193 fi
2194 # end --enable-sql
2195 # OpenLDAP --with-sql_module
2196         # Check whether --with-sql_module or --without-sql_module was given.
2197 if test "${with_sql_module+set}" = set; then
2198   withval="$with_sql_module"
2199   
2200         ol_arg=invalid
2201         for ol_val in static dynamic ; do
2202                 if test "$withval" = "$ol_val" ; then
2203                         ol_arg="$ol_val"
2204                 fi
2205         done
2206         if test "$ol_arg" = "invalid" ; then
2207                 { echo "configure: error: bad value $withval for --with-sql_module" 1>&2; exit 1; }
2208         fi
2209         ol_with_sql_module="$ol_arg"
2210
2211 else
2212         ol_with_sql_module="static"
2213 fi
2214 # end --with-sql_module
2215
2216 # OpenLDAP --enable-tcl
2217         # Check whether --enable-tcl or --disable-tcl was given.
2218 if test "${enable_tcl+set}" = set; then
2219   enableval="$enable_tcl"
2220   
2221         ol_arg=invalid
2222         for ol_val in auto yes no ; do
2223                 if test "$enableval" = "$ol_val" ; then
2224                         ol_arg="$ol_val"
2225                 fi
2226         done
2227         if test "$ol_arg" = "invalid" ; then
2228                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
2229         fi
2230         ol_enable_tcl="$ol_arg"
2231
2232 else
2233         ol_enable_tcl="no"
2234 fi
2235 # end --enable-tcl
2236 # OpenLDAP --with-tcl_module
2237         # Check whether --with-tcl_module or --without-tcl_module was given.
2238 if test "${with_tcl_module+set}" = set; then
2239   withval="$with_tcl_module"
2240   
2241         ol_arg=invalid
2242         for ol_val in static dynamic ; do
2243                 if test "$withval" = "$ol_val" ; then
2244                         ol_arg="$ol_val"
2245                 fi
2246         done
2247         if test "$ol_arg" = "invalid" ; then
2248                 { echo "configure: error: bad value $withval for --with-tcl_module" 1>&2; exit 1; }
2249         fi
2250         ol_with_tcl_module="$ol_arg"
2251
2252 else
2253         ol_with_tcl_module="static"
2254 fi
2255 # end --with-tcl_module
2256
2257
2258 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2259 if test "${with_xxslurpdoptions+set}" = set; then
2260   withval="$with_xxslurpdoptions"
2261   :
2262 fi
2263
2264 # OpenLDAP --enable-slurpd
2265         # Check whether --enable-slurpd or --disable-slurpd was given.
2266 if test "${enable_slurpd+set}" = set; then
2267   enableval="$enable_slurpd"
2268   
2269         ol_arg=invalid
2270         for ol_val in auto yes no ; do
2271                 if test "$enableval" = "$ol_val" ; then
2272                         ol_arg="$ol_val"
2273                 fi
2274         done
2275         if test "$ol_arg" = "invalid" ; then
2276                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2277         fi
2278         ol_enable_slurpd="$ol_arg"
2279
2280 else
2281         ol_enable_slurpd="auto"
2282 fi
2283 # end --enable-slurpd
2284
2285 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2286 if test "${with_xxliboptions+set}" = set; then
2287   withval="$with_xxliboptions"
2288   :
2289 fi
2290
2291 # Check whether --enable-static or --disable-static was given.
2292 if test "${enable_static+set}" = set; then
2293   enableval="$enable_static"
2294   p=${PACKAGE-default}
2295 case "$enableval" in
2296 yes) enable_static=yes ;;
2297 no) enable_static=no ;;
2298 *)
2299   enable_static=no
2300   # Look at the argument we got.  We use all the common list separators.
2301   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2302   for pkg in $enableval; do
2303     if test "X$pkg" = "X$p"; then
2304       enable_static=yes
2305     fi
2306   done
2307   IFS="$ac_save_ifs"
2308   ;;
2309 esac
2310 else
2311   enable_static=yes
2312 fi
2313
2314 # Check whether --enable-shared or --disable-shared was given.
2315 if test "${enable_shared+set}" = set; then
2316   enableval="$enable_shared"
2317   p=${PACKAGE-default}
2318 case "$enableval" in
2319 yes) enable_shared=yes ;;
2320 no) enable_shared=no ;;
2321 *)
2322   enable_shared=no
2323   # Look at the argument we got.  We use all the common list separators.
2324   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2325   for pkg in $enableval; do
2326     if test "X$pkg" = "X$p"; then
2327       enable_shared=yes
2328     fi
2329   done
2330   IFS="$ac_save_ifs"
2331   ;;
2332 esac
2333 else
2334   enable_shared=yes
2335 fi
2336
2337
2338
2339 # validate options
2340 if test $ol_enable_dns = yes ; then
2341         if test $ol_enable_referrals = no ; then
2342                 { echo "configure: error: DNS requires --enable-referrals" 1>&2; exit 1; }
2343         fi
2344         if test $ol_enable_referrals = auto ; then
2345                 echo "configure: warning: DNS requires referrals, adding --enable-referrals" 1>&2
2346                 ol_enable_referrals=yes
2347         fi
2348 fi
2349
2350 if test $ol_enable_slapd = no ; then
2351                 if test $ol_enable_bdb2 = yes ; then
2352                 echo "configure: warning: slapd disabled, ignoring --enable-bdb2 argument" 1>&2
2353         fi
2354         if test $ol_enable_dnssrv = yes ; then
2355                 echo "configure: warning: slapd disabled, ignoring --enable-dnssrv argument" 1>&2
2356         fi
2357         if test $ol_enable_ldap = yes ; then
2358                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2359         fi
2360         if test $ol_enable_ldbm = yes ; then
2361                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2362         fi
2363         if test $ol_enable_passwd = yes ; then
2364                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2365         fi
2366         if test $ol_enable_perl = yes ; then
2367                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
2368         fi
2369         if test $ol_enable_shell = yes ; then
2370                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2371         fi
2372         if test $ol_enable_tcl = yes ; then
2373                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
2374         fi
2375         if test $ol_enable_sql = yes ; then
2376                 echo "configure: warning: slapd disabled, ignoring --enable-sql argument" 1>&2
2377         fi
2378         if test $ol_enable_modules = yes ; then
2379                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2380         fi
2381         if test $ol_enable_multimaster = yes ; then
2382                 echo "configure: warning: slapd disabled, ignoring --enable-multimaster argument" 1>&2
2383         fi
2384         if test $ol_enable_wrappers = yes ; then
2385                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2386         fi
2387         if test $ol_enable_phonetic = yes ; then
2388                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2389         fi
2390         if test $ol_enable_quipu = yes ; then
2391                 echo "configure: warning: slapd disabled, ignoring --enable-quipu argument" 1>&2
2392         fi
2393         if test $ol_enable_rlookups = yes ; then
2394                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2395         fi
2396         if test $ol_enable_aci = yes ; then
2397                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2398         fi
2399         if test $ol_with_ldbm_api != auto ; then
2400                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2401         fi
2402         if test $ol_with_ldbm_type != auto ; then
2403                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2404         fi
2405         if test $ol_with_bdb2_module != static ; then
2406                 echo "configure: warning: slapd disabled, ignoring --with-bdb2-module argument" 1>&2
2407         fi
2408         if test $ol_with_dnssrv_module != static ; then
2409                 echo "configure: warning: slapd disabled, ignoring --with-dnssrv-module argument" 1>&2
2410         fi
2411         if test $ol_with_ldap_module != static ; then
2412                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2413         fi
2414         if test $ol_with_ldbm_module != static ; then
2415                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2416         fi
2417         if test $ol_with_passwd_module != static ; then
2418                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2419         fi
2420         if test $ol_with_perl_module != static ; then
2421                 echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
2422         fi
2423         if test $ol_with_shell_module != static ; then
2424                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2425         fi
2426         if test $ol_with_tcl_module != static ; then
2427                 echo "configure: warning: slapd disabled, ignoring --with-tcl-module argument" 1>&2
2428         fi
2429         if test $ol_with_sql_module != static ; then
2430                 echo "configure: warning: slapd disabled, ignoring --with-sql-module argument" 1>&2
2431         fi
2432         if test $ol_enable_slurpd = yes ; then
2433                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2434         fi
2435
2436         # force settings to no
2437         ol_enable_bdb2=no
2438         ol_enable_dnssrv=no
2439         ol_enable_ldap=no
2440         ol_enable_ldbm=no
2441         ol_enable_passwd=no
2442         ol_enable_perl=no
2443         ol_enable_shell=no
2444         ol_enable_tcl=no
2445         ol_enable_sql=no
2446
2447         ol_enable_modules=no
2448         ol_enable_multimaster=no
2449         ol_enable_phonetic=no
2450         ol_enable_quipu=no
2451         ol_enable_rlookups=no
2452         ol_enable_aci=no
2453         ol_enable_wrappers=no
2454         ol_enable_dynamic=no
2455
2456         ol_with_ldbm_api=no
2457         ol_with_ldbm_type=no
2458
2459         ol_with_bdb2_module=static
2460         ol_with_dnssrv_module=static
2461         ol_with_ldap_module=static
2462         ol_with_ldbm_module=static
2463         ol_with_passwd_module=static
2464         ol_with_perl_module=static
2465         ol_with_shell_module=static
2466         ol_with_tcl_module=static
2467         ol_with_sql_module=static
2468
2469         ol_enable_slurpd=no
2470
2471 elif test $ol_enable_ldbm = no ; then
2472         
2473         if test $ol_with_ldbm_api != auto ; then
2474                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2475         fi
2476
2477         if test $ol_with_ldbm_type != auto ; then
2478                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2479         fi
2480
2481         if test $ol_with_ldbm_module != static ; then
2482                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2483         fi
2484
2485         if test $ol_enable_bdb2 = yes ; then
2486                 { echo "configure: error: BDB2 requires --enable-ldbm" 1>&2; exit 1; }
2487         fi
2488
2489         if test $ol_enable_modules != yes -a \
2490                 $ol_enable_dnssrv = no -a \
2491                 $ol_enable_ldap = no -a \
2492                 $ol_enable_passwd = no -a \
2493                 $ol_enable_perl = no -a \
2494                 $ol_enable_shell = no -a \
2495                 $ol_enable_sql = no -a \
2496                 $ol_enable_tcl = no ; then
2497                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2498         fi
2499
2500         ol_with_ldbm_api=no
2501         ol_with_ldbm_type=no
2502         ol_with_ldbm_module=static
2503
2504 elif test $ol_enable_bdb2 = yes ; then
2505         
2506         if test $ol_with_ldbm_api != auto -a \
2507                 $ol_with_ldbm_api != berkeley ; then
2508                 { echo "configure: error: BDB2 requires LDBM API berkeley or auto" 1>&2; exit 1; }
2509         fi
2510
2511         ol_with_ldbm_api=db2
2512
2513 else
2514         
2515         if test $ol_enable_bdb2 != no ; then
2516                 if test $ol_with_ldbm_api != auto -a \
2517                         $ol_with_ldbm_api != berkeley ; then
2518                         echo "configure: warning: BDB2 requires LDBM api berkeley or auto" 1>&2
2519                         ol_enable_bdb2=no
2520                 fi
2521         fi
2522
2523         if test $ol_with_ldbm_api = gdbm -a \
2524                 $ol_with_ldbm_type = btree ; then
2525                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2526         fi
2527         if test $ol_with_ldbm_api = mdbm -a \
2528                 $ol_with_ldbm_type = btree ; then
2529                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2530         fi
2531         if test $ol_with_ldbm_api = ndbm -a \
2532                 $ol_with_ldbm_type = btree ; then
2533                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2534         fi
2535 fi
2536
2537 if test $ol_enable_slurpd = yes ; then
2538                 if test $ol_with_threads = no ; then
2539                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2540         fi
2541 fi
2542
2543 if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
2544         if test $ol_with_kerberos = no ; then
2545                 { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
2546         fi
2547 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
2548         if test $ol_with_kerberos != auto ; then
2549                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2550         else
2551                 ol_with_kerberos=no
2552         fi
2553 fi
2554
2555 if test $ol_enable_spasswd = yes ; then
2556         if test $ol_with_cyrus_sasl = no ; then
2557                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2558         fi
2559         ol_link_spasswd=yes
2560 fi
2561
2562 echo "$ac_t""done" 1>&6
2563
2564 LDAP_LIBS=
2565 LDIF_LIBS=
2566 LDBM_LIBS=
2567 LTHREAD_LIBS=
2568 LUTIL_LIBS=
2569
2570 LDAPD_LIBS=
2571 SLAPD_LIBS=
2572 SLURPD_LIBS=
2573
2574 BUILD_LDAPD=no
2575 BUILD_SLAPD=no
2576 BUILD_SLURPD=no
2577
2578 BUILD_QUIPU=no
2579 BUILD_THREAD=no
2580
2581 BUILD_BDB2=no
2582 BUILD_DNSSRV=no
2583 BUILD_LDAP=no
2584 BUILD_LDBM=no
2585 BUILD_PASSWD=no
2586 BUILD_PERL=no
2587 BUILD_SHELL=no
2588 BUILD_SQL=no
2589 BUILD_TCL=no
2590
2591 BUILD_BDB2_DYNAMIC=static
2592 BUILD_DNSSRV_DYNAMIC=static
2593 BUILD_LDAP_DYNAMIC=static
2594 BUILD_LDBM_DYNAMIC=static
2595 BUILD_PASSWD_DYNAMIC=static
2596 BUILD_PERL_DYNAMIC=static
2597 BUILD_SHELL_DYNAMIC=static
2598 BUILD_TCL_DYNAMIC=static
2599 BUILD_SQL_DYNAMIC=static
2600
2601 SLAPD_MODULES_LDFLAGS=
2602 SLAPD_MODULES_CPPFLAGS=
2603 SLAPD_MODULES_LIST=
2604
2605 SLAPD_PERL_LDFLAGS=
2606 MOD_PERL_LDFLAGS=
2607 PERL_CPPFLAGS=
2608
2609 SLAPD_SQL_LDFLAGS=
2610 SLAPD_SQL_LIBS=
2611 SLAPD_SQL_INCLUDES=
2612
2613 MOD_TCL_LIB=
2614 KRB4_LIBS=
2615 KRB5_LIBS=
2616 READLINE_LIBS=
2617 SASL_LIBS=
2618 TERMCAP_LIBS=
2619 TLS_LIBS=
2620 MODULES_LIBS=
2621 AUTH_LIBS=
2622
2623
2624
2625 cat >> confdefs.h <<\EOF
2626 #define HAVE_MKVERSION 1
2627 EOF
2628
2629
2630
2631
2632 ol_aix_threads=no
2633 case "$target" in
2634 *-*-aix*)       if test -z "$CC" ; then
2635                 case "$ol_with_threads" in
2636                 auto | yes |  posix) ol_aix_threads=yes ;;
2637                 esac
2638         fi
2639 ;;
2640 esac
2641
2642 if test $ol_aix_threads = yes ; then
2643         if test -z "${CC}" ; then
2644                 for ac_prog in cc_r xlc_r cc
2645 do
2646 # Extract the first word of "$ac_prog", so it can be a program name with args.
2647 set dummy $ac_prog; ac_word=$2
2648 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2649 echo "configure:2650: checking for $ac_word" >&5
2650 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2651   echo $ac_n "(cached) $ac_c" 1>&6
2652 else
2653   if test -n "$CC"; then
2654   ac_cv_prog_CC="$CC" # Let the user override the test.
2655 else
2656   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2657   ac_dummy="$PATH"
2658   for ac_dir in $ac_dummy; do
2659     test -z "$ac_dir" && ac_dir=.
2660     if test -f $ac_dir/$ac_word; then
2661       ac_cv_prog_CC="$ac_prog"
2662       break
2663     fi
2664   done
2665   IFS="$ac_save_ifs"
2666 fi
2667 fi
2668 CC="$ac_cv_prog_CC"
2669 if test -n "$CC"; then
2670   echo "$ac_t""$CC" 1>&6
2671 else
2672   echo "$ac_t""no" 1>&6
2673 fi
2674
2675 test -n "$CC" && break
2676 done
2677
2678
2679                 if test "$CC" = cc ; then
2680                                                 if test $ol_with_threads != auto ; then
2681                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2682                         else
2683                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2684                         fi
2685                         ol_with_threads=no
2686                 fi
2687         fi
2688
2689         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2690                 ol_with_threads=posix
2691                 ol_cv_pthread_create=yes
2692         fi
2693 fi
2694
2695 if test -z "${CC}"; then
2696         for ac_prog in cc
2697 do
2698 # Extract the first word of "$ac_prog", so it can be a program name with args.
2699 set dummy $ac_prog; ac_word=$2
2700 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2701 echo "configure:2702: checking for $ac_word" >&5
2702 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2703   echo $ac_n "(cached) $ac_c" 1>&6
2704 else
2705   if test -n "$CC"; then
2706   ac_cv_prog_CC="$CC" # Let the user override the test.
2707 else
2708   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2709   ac_dummy="$PATH"
2710   for ac_dir in $ac_dummy; do
2711     test -z "$ac_dir" && ac_dir=.
2712     if test -f $ac_dir/$ac_word; then
2713       ac_cv_prog_CC="$ac_prog"
2714       break
2715     fi
2716   done
2717   IFS="$ac_save_ifs"
2718 fi
2719 fi
2720 CC="$ac_cv_prog_CC"
2721 if test -n "$CC"; then
2722   echo "$ac_t""$CC" 1>&6
2723 else
2724   echo "$ac_t""no" 1>&6
2725 fi
2726
2727 test -n "$CC" && break
2728 done
2729
2730 fi
2731
2732
2733
2734
2735 # Check whether --enable-fast-install or --disable-fast-install was given.
2736 if test "${enable_fast_install+set}" = set; then
2737   enableval="$enable_fast_install"
2738   p=${PACKAGE-default}
2739 case "$enableval" in
2740 yes) enable_fast_install=yes ;;
2741 no) enable_fast_install=no ;;
2742 *)
2743   enable_fast_install=no
2744   # Look at the argument we got.  We use all the common list separators.
2745   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2746   for pkg in $enableval; do
2747     if test "X$pkg" = "X$p"; then
2748       enable_fast_install=yes
2749     fi
2750   done
2751   IFS="$ac_save_ifs"
2752   ;;
2753 esac
2754 else
2755   enable_fast_install=yes
2756 fi
2757
2758 # Extract the first word of "ranlib", so it can be a program name with args.
2759 set dummy ranlib; ac_word=$2
2760 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2761 echo "configure:2762: checking for $ac_word" >&5
2762 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
2763   echo $ac_n "(cached) $ac_c" 1>&6
2764 else
2765   if test -n "$RANLIB"; then
2766   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2767 else
2768   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2769   ac_dummy="$PATH"
2770   for ac_dir in $ac_dummy; do
2771     test -z "$ac_dir" && ac_dir=.
2772     if test -f $ac_dir/$ac_word; then
2773       ac_cv_prog_RANLIB="ranlib"
2774       break
2775     fi
2776   done
2777   IFS="$ac_save_ifs"
2778   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2779 fi
2780 fi
2781 RANLIB="$ac_cv_prog_RANLIB"
2782 if test -n "$RANLIB"; then
2783   echo "$ac_t""$RANLIB" 1>&6
2784 else
2785   echo "$ac_t""no" 1>&6
2786 fi
2787
2788 # Extract the first word of "gcc", so it can be a program name with args.
2789 set dummy gcc; ac_word=$2
2790 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2791 echo "configure:2792: checking for $ac_word" >&5
2792 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2793   echo $ac_n "(cached) $ac_c" 1>&6
2794 else
2795   if test -n "$CC"; then
2796   ac_cv_prog_CC="$CC" # Let the user override the test.
2797 else
2798   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2799   ac_dummy="$PATH"
2800   for ac_dir in $ac_dummy; do
2801     test -z "$ac_dir" && ac_dir=.
2802     if test -f $ac_dir/$ac_word; then
2803       ac_cv_prog_CC="gcc"
2804       break
2805     fi
2806   done
2807   IFS="$ac_save_ifs"
2808 fi
2809 fi
2810 CC="$ac_cv_prog_CC"
2811 if test -n "$CC"; then
2812   echo "$ac_t""$CC" 1>&6
2813 else
2814   echo "$ac_t""no" 1>&6
2815 fi
2816
2817 if test -z "$CC"; then
2818   # Extract the first word of "cc", so it can be a program name with args.
2819 set dummy cc; ac_word=$2
2820 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2821 echo "configure:2822: checking for $ac_word" >&5
2822 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2823   echo $ac_n "(cached) $ac_c" 1>&6
2824 else
2825   if test -n "$CC"; then
2826   ac_cv_prog_CC="$CC" # Let the user override the test.
2827 else
2828   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2829   ac_prog_rejected=no
2830   ac_dummy="$PATH"
2831   for ac_dir in $ac_dummy; do
2832     test -z "$ac_dir" && ac_dir=.
2833     if test -f $ac_dir/$ac_word; then
2834       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2835         ac_prog_rejected=yes
2836         continue
2837       fi
2838       ac_cv_prog_CC="cc"
2839       break
2840     fi
2841   done
2842   IFS="$ac_save_ifs"
2843 if test $ac_prog_rejected = yes; then
2844   # We found a bogon in the path, so make sure we never use it.
2845   set dummy $ac_cv_prog_CC
2846   shift
2847   if test $# -gt 0; then
2848     # We chose a different compiler from the bogus one.
2849     # However, it has the same basename, so the bogon will be chosen
2850     # first if we set CC to just the basename; use the full file name.
2851     shift
2852     set dummy "$ac_dir/$ac_word" "$@"
2853     shift
2854     ac_cv_prog_CC="$@"
2855   fi
2856 fi
2857 fi
2858 fi
2859 CC="$ac_cv_prog_CC"
2860 if test -n "$CC"; then
2861   echo "$ac_t""$CC" 1>&6
2862 else
2863   echo "$ac_t""no" 1>&6
2864 fi
2865
2866   if test -z "$CC"; then
2867     case "`uname -s`" in
2868     *win32* | *WIN32* | *CYGWIN*)
2869       # Extract the first word of "cl", so it can be a program name with args.
2870 set dummy cl; ac_word=$2
2871 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2872 echo "configure:2873: checking for $ac_word" >&5
2873 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2874   echo $ac_n "(cached) $ac_c" 1>&6
2875 else
2876   if test -n "$CC"; then
2877   ac_cv_prog_CC="$CC" # Let the user override the test.
2878 else
2879   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2880   ac_dummy="$PATH"
2881   for ac_dir in $ac_dummy; do
2882     test -z "$ac_dir" && ac_dir=.
2883     if test -f $ac_dir/$ac_word; then
2884       ac_cv_prog_CC="cl"
2885       break
2886     fi
2887   done
2888   IFS="$ac_save_ifs"
2889 fi
2890 fi
2891 CC="$ac_cv_prog_CC"
2892 if test -n "$CC"; then
2893   echo "$ac_t""$CC" 1>&6
2894 else
2895   echo "$ac_t""no" 1>&6
2896 fi
2897  ;;
2898     esac
2899   fi
2900   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2901 fi
2902
2903 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2904 echo "configure:2905: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
2905
2906 ac_ext=c
2907 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2908 ac_cpp='$CPP $CPPFLAGS'
2909 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2910 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2911 cross_compiling=$ac_cv_prog_cc_cross
2912
2913 cat > conftest.$ac_ext << EOF
2914
2915 #line 2916 "configure"
2916 #include "confdefs.h"
2917
2918 main(){return(0);}
2919 EOF
2920 if { (eval echo configure:2921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2921   ac_cv_prog_cc_works=yes
2922   # If we can't run a trivial program, we are probably using a cross compiler.
2923   if (./conftest; exit) 2>/dev/null; then
2924     ac_cv_prog_cc_cross=no
2925   else
2926     ac_cv_prog_cc_cross=yes
2927   fi
2928 else
2929   echo "configure: failed program was:" >&5
2930   cat conftest.$ac_ext >&5
2931   ac_cv_prog_cc_works=no
2932 fi
2933 rm -fr conftest*
2934 ac_ext=c
2935 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2936 ac_cpp='$CPP $CPPFLAGS'
2937 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2938 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2939 cross_compiling=$ac_cv_prog_cc_cross
2940
2941 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2942 if test $ac_cv_prog_cc_works = no; then
2943   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2944 fi
2945 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2946 echo "configure:2947: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
2947 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2948 cross_compiling=$ac_cv_prog_cc_cross
2949
2950 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2951 echo "configure:2952: checking whether we are using GNU C" >&5
2952 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
2953   echo $ac_n "(cached) $ac_c" 1>&6
2954 else
2955   cat > conftest.c <<EOF
2956 #ifdef __GNUC__
2957   yes;
2958 #endif
2959 EOF
2960 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2961: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2961   ac_cv_prog_gcc=yes
2962 else
2963   ac_cv_prog_gcc=no
2964 fi
2965 fi
2966
2967 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2968
2969 if test $ac_cv_prog_gcc = yes; then
2970   GCC=yes
2971 else
2972   GCC=
2973 fi
2974
2975 ac_test_CFLAGS="${CFLAGS+set}"
2976 ac_save_CFLAGS="$CFLAGS"
2977 CFLAGS=
2978 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2979 echo "configure:2980: checking whether ${CC-cc} accepts -g" >&5
2980 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
2981   echo $ac_n "(cached) $ac_c" 1>&6
2982 else
2983   echo 'void f(){}' > conftest.c
2984 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2985   ac_cv_prog_cc_g=yes
2986 else
2987   ac_cv_prog_cc_g=no
2988 fi
2989 rm -f conftest*
2990
2991 fi
2992
2993 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2994 if test "$ac_test_CFLAGS" = set; then
2995   CFLAGS="$ac_save_CFLAGS"
2996 elif test $ac_cv_prog_cc_g = yes; then
2997   if test "$GCC" = yes; then
2998     CFLAGS="-g -O2"
2999   else
3000     CFLAGS="-g"
3001   fi
3002 else
3003   if test "$GCC" = yes; then
3004     CFLAGS="-O2"
3005   else
3006     CFLAGS=
3007   fi
3008 fi
3009
3010 # Check whether --with-gnu-ld or --without-gnu-ld was given.
3011 if test "${with_gnu_ld+set}" = set; then
3012   withval="$with_gnu_ld"
3013   test "$withval" = no || with_gnu_ld=yes
3014 else
3015   with_gnu_ld=no
3016 fi
3017
3018 ac_prog=ld
3019 if test "$ac_cv_prog_gcc" = yes; then
3020   # Check if gcc -print-prog-name=ld gives a path.
3021   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
3022 echo "configure:3023: checking for ld used by GCC" >&5
3023   ac_prog=`($CC -print-prog-name=ld) 2>&5`
3024   case "$ac_prog" in
3025     # Accept absolute paths.
3026     [\\/]* | [A-Za-z]:[\\/]*)
3027       re_direlt='/[^/][^/]*/\.\./'
3028       # Canonicalize the path of ld
3029       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3030       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3031         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3032       done
3033       test -z "$LD" && LD="$ac_prog"
3034       ;;
3035   "")
3036     # If it fails, then pretend we aren't using GCC.
3037     ac_prog=ld
3038     ;;
3039   *)
3040     # If it is relative, then search for the first ld in PATH.
3041     with_gnu_ld=unknown
3042     ;;
3043   esac
3044 elif test "$with_gnu_ld" = yes; then
3045   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
3046 echo "configure:3047: checking for GNU ld" >&5
3047 else
3048   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
3049 echo "configure:3050: checking for non-GNU ld" >&5
3050 fi
3051 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
3052   echo $ac_n "(cached) $ac_c" 1>&6
3053 else
3054   if test -z "$LD"; then
3055   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3056   for ac_dir in $PATH; do
3057     test -z "$ac_dir" && ac_dir=.
3058     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3059       ac_cv_path_LD="$ac_dir/$ac_prog"
3060       # Check to see if the program is GNU ld.  I'd rather use --version,
3061       # but apparently some GNU ld's only accept -v.
3062       # Break only if it was the GNU/non-GNU ld that we prefer.
3063       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3064         test "$with_gnu_ld" != no && break
3065       else
3066         test "$with_gnu_ld" != yes && break
3067       fi
3068     fi
3069   done
3070   IFS="$ac_save_ifs"
3071 else
3072   ac_cv_path_LD="$LD" # Let the user override the test with a path.
3073 fi
3074 fi
3075
3076 LD="$ac_cv_path_LD"
3077 if test -n "$LD"; then
3078   echo "$ac_t""$LD" 1>&6
3079 else
3080   echo "$ac_t""no" 1>&6
3081 fi
3082 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
3083 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
3084 echo "configure:3085: checking if the linker ($LD) is GNU ld" >&5
3085 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
3086   echo $ac_n "(cached) $ac_c" 1>&6
3087 else
3088   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
3089 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3090   ac_cv_prog_gnu_ld=yes
3091 else
3092   ac_cv_prog_gnu_ld=no
3093 fi
3094 fi
3095
3096 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
3097
3098
3099 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
3100 echo "configure:3101: checking for BSD-compatible nm" >&5
3101 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
3102   echo $ac_n "(cached) $ac_c" 1>&6
3103 else
3104   if test -n "$NM"; then
3105   # Let the user override the test.
3106   ac_cv_path_NM="$NM"
3107 else
3108   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3109   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3110     test -z "$ac_dir" && ac_dir=.
3111     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
3112       # Check to see if the nm accepts a BSD-compat flag.
3113       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3114       #   nm: unknown option "B" ignored
3115       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3116         ac_cv_path_NM="$ac_dir/nm -B"
3117         break
3118       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3119         ac_cv_path_NM="$ac_dir/nm -p"
3120         break
3121       else
3122         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
3123         continue # so that we can try to find one that supports BSD flags
3124       fi
3125     fi
3126   done
3127   IFS="$ac_save_ifs"
3128   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
3129 fi
3130 fi
3131
3132 NM="$ac_cv_path_NM"
3133 echo "$ac_t""$NM" 1>&6
3134
3135 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3136 echo "configure:3137: checking whether ln -s works" >&5
3137 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3138   echo $ac_n "(cached) $ac_c" 1>&6
3139 else
3140   rm -f conftestdata
3141 if ln -s X conftestdata 2>/dev/null
3142 then
3143   rm -f conftestdata
3144   ac_cv_prog_LN_S="ln -s"
3145 else
3146   ac_cv_prog_LN_S=ln
3147 fi
3148 fi
3149 LN_S="$ac_cv_prog_LN_S"
3150 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3151   echo "$ac_t""yes" 1>&6
3152 else
3153   echo "$ac_t""no" 1>&6
3154 fi
3155
3156 if test $host != $build; then
3157   ac_tool_prefix=${host_alias}-
3158 else
3159   ac_tool_prefix=
3160 fi
3161
3162
3163 case "$target" in
3164 NONE) lt_target="$host" ;;
3165 *) lt_target="$target" ;;
3166 esac
3167
3168 # Check for any special flags to pass to ltconfig.
3169 libtool_flags="--cache-file=$cache_file"
3170 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
3171 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
3172 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
3173 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
3174 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
3175 libtool_flags="$libtool_flags --enable-dlopen"
3176 libtool_flags="$libtool_flags --enable-win32-dll"
3177 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
3178 if test "${enable_libtool_lock+set}" = set; then
3179   enableval="$enable_libtool_lock"
3180   :
3181 fi
3182
3183 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
3184 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
3185
3186 # Some flags need to be propagated to the compiler or linker for good
3187 # libtool support.
3188 case "$lt_target" in
3189 *-*-irix6*)
3190   # Find out which ABI we are using.
3191   echo '#line 3192 "configure"' > conftest.$ac_ext
3192   if { (eval echo configure:3193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3193     case "`/usr/bin/file conftest.o`" in
3194     *32-bit*)
3195       LD="${LD-ld} -32"
3196       ;;
3197     *N32*)
3198       LD="${LD-ld} -n32"
3199       ;;
3200     *64-bit*)
3201       LD="${LD-ld} -64"
3202       ;;
3203     esac
3204   fi
3205   rm -rf conftest*
3206   ;;
3207
3208 *-*-sco3.2v5*)
3209   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
3210   SAVE_CFLAGS="$CFLAGS"
3211   CFLAGS="$CFLAGS -belf"
3212   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
3213 echo "configure:3214: checking whether the C compiler needs -belf" >&5
3214 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
3215   echo $ac_n "(cached) $ac_c" 1>&6
3216 else
3217   cat > conftest.$ac_ext <<EOF
3218 #line 3219 "configure"
3219 #include "confdefs.h"
3220
3221 int main() {
3222
3223 ; return 0; }
3224 EOF
3225 if { (eval echo configure:3226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3226   rm -rf conftest*
3227   lt_cv_cc_needs_belf=yes
3228 else
3229   echo "configure: failed program was:" >&5
3230   cat conftest.$ac_ext >&5
3231   rm -rf conftest*
3232   lt_cv_cc_needs_belf=no
3233 fi
3234 rm -f conftest*
3235 fi
3236
3237 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
3238   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
3239     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
3240     CFLAGS="$SAVE_CFLAGS"
3241   fi
3242   ;;
3243
3244 *-*-cygwin* | *-*-mingw*)
3245   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
3246 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
3247 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3248 echo "configure:3249: checking for $ac_word" >&5
3249 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
3250   echo $ac_n "(cached) $ac_c" 1>&6
3251 else
3252   if test -n "$DLLTOOL"; then
3253   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3254 else
3255   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3256   ac_dummy="$PATH"
3257   for ac_dir in $ac_dummy; do
3258     test -z "$ac_dir" && ac_dir=.
3259     if test -f $ac_dir/$ac_word; then
3260       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
3261       break
3262     fi
3263   done
3264   IFS="$ac_save_ifs"
3265 fi
3266 fi
3267 DLLTOOL="$ac_cv_prog_DLLTOOL"
3268 if test -n "$DLLTOOL"; then
3269   echo "$ac_t""$DLLTOOL" 1>&6
3270 else
3271   echo "$ac_t""no" 1>&6
3272 fi
3273
3274
3275 if test -z "$ac_cv_prog_DLLTOOL"; then
3276 if test -n "$ac_tool_prefix"; then
3277   # Extract the first word of "dlltool", so it can be a program name with args.
3278 set dummy dlltool; ac_word=$2
3279 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3280 echo "configure:3281: checking for $ac_word" >&5
3281 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
3282   echo $ac_n "(cached) $ac_c" 1>&6
3283 else
3284   if test -n "$DLLTOOL"; then
3285   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3286 else
3287   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3288   ac_dummy="$PATH"
3289   for ac_dir in $ac_dummy; do
3290     test -z "$ac_dir" && ac_dir=.
3291     if test -f $ac_dir/$ac_word; then
3292       ac_cv_prog_DLLTOOL="dlltool"
3293       break
3294     fi
3295   done
3296   IFS="$ac_save_ifs"
3297   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
3298 fi
3299 fi
3300 DLLTOOL="$ac_cv_prog_DLLTOOL"
3301 if test -n "$DLLTOOL"; then
3302   echo "$ac_t""$DLLTOOL" 1>&6
3303 else
3304   echo "$ac_t""no" 1>&6
3305 fi
3306
3307 else
3308   DLLTOOL="false"
3309 fi
3310 fi
3311
3312   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
3313 set dummy ${ac_tool_prefix}as; 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_prog_AS+set}\" = set"; then
3317   echo $ac_n "(cached) $ac_c" 1>&6
3318 else
3319   if test -n "$AS"; then
3320   ac_cv_prog_AS="$AS" # Let the user override the test.
3321 else
3322   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3323   ac_dummy="$PATH"
3324   for ac_dir in $ac_dummy; do
3325     test -z "$ac_dir" && ac_dir=.
3326     if test -f $ac_dir/$ac_word; then
3327       ac_cv_prog_AS="${ac_tool_prefix}as"
3328       break
3329     fi
3330   done
3331   IFS="$ac_save_ifs"
3332 fi
3333 fi
3334 AS="$ac_cv_prog_AS"
3335 if test -n "$AS"; then
3336   echo "$ac_t""$AS" 1>&6
3337 else
3338   echo "$ac_t""no" 1>&6
3339 fi
3340
3341
3342 if test -z "$ac_cv_prog_AS"; then
3343 if test -n "$ac_tool_prefix"; then
3344   # Extract the first word of "as", so it can be a program name with args.
3345 set dummy as; ac_word=$2
3346 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3347 echo "configure:3348: checking for $ac_word" >&5
3348 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3349   echo $ac_n "(cached) $ac_c" 1>&6
3350 else
3351   if test -n "$AS"; then
3352   ac_cv_prog_AS="$AS" # Let the user override the test.
3353 else
3354   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3355   ac_dummy="$PATH"
3356   for ac_dir in $ac_dummy; do
3357     test -z "$ac_dir" && ac_dir=.
3358     if test -f $ac_dir/$ac_word; then
3359       ac_cv_prog_AS="as"
3360       break
3361     fi
3362   done
3363   IFS="$ac_save_ifs"
3364   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
3365 fi
3366 fi
3367 AS="$ac_cv_prog_AS"
3368 if test -n "$AS"; then
3369   echo "$ac_t""$AS" 1>&6
3370 else
3371   echo "$ac_t""no" 1>&6
3372 fi
3373
3374 else
3375   AS="false"
3376 fi
3377 fi
3378
3379   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
3380 set dummy ${ac_tool_prefix}objdump; ac_word=$2
3381 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3382 echo "configure:3383: checking for $ac_word" >&5
3383 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3384   echo $ac_n "(cached) $ac_c" 1>&6
3385 else
3386   if test -n "$OBJDUMP"; then
3387   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3388 else
3389   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3390   ac_dummy="$PATH"
3391   for ac_dir in $ac_dummy; do
3392     test -z "$ac_dir" && ac_dir=.
3393     if test -f $ac_dir/$ac_word; then
3394       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
3395       break
3396     fi
3397   done
3398   IFS="$ac_save_ifs"
3399 fi
3400 fi
3401 OBJDUMP="$ac_cv_prog_OBJDUMP"
3402 if test -n "$OBJDUMP"; then
3403   echo "$ac_t""$OBJDUMP" 1>&6
3404 else
3405   echo "$ac_t""no" 1>&6
3406 fi
3407
3408
3409 if test -z "$ac_cv_prog_OBJDUMP"; then
3410 if test -n "$ac_tool_prefix"; then
3411   # Extract the first word of "objdump", so it can be a program name with args.
3412 set dummy objdump; ac_word=$2
3413 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3414 echo "configure:3415: checking for $ac_word" >&5
3415 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3416   echo $ac_n "(cached) $ac_c" 1>&6
3417 else
3418   if test -n "$OBJDUMP"; then
3419   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3420 else
3421   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3422   ac_dummy="$PATH"
3423   for ac_dir in $ac_dummy; do
3424     test -z "$ac_dir" && ac_dir=.
3425     if test -f $ac_dir/$ac_word; then
3426       ac_cv_prog_OBJDUMP="objdump"
3427       break
3428     fi
3429   done
3430   IFS="$ac_save_ifs"
3431   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
3432 fi
3433 fi
3434 OBJDUMP="$ac_cv_prog_OBJDUMP"
3435 if test -n "$OBJDUMP"; then
3436   echo "$ac_t""$OBJDUMP" 1>&6
3437 else
3438   echo "$ac_t""no" 1>&6
3439 fi
3440
3441 else
3442   OBJDUMP="false"
3443 fi
3444 fi
3445
3446   ;;
3447
3448 esac
3449
3450
3451 # Save cache, so that ltconfig can load it
3452
3453
3454 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
3455 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
3456 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
3457 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
3458 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
3459 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
3460 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
3461 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
3462
3463 # Reload cache, that may have been modified by ltconfig
3464
3465
3466 # This can be used to rebuild libtool when needed
3467 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
3468
3469 # Always use our own libtool.
3470 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3471
3472 # Redirect the config.log output again, so that the ltconfig log is not
3473 # clobbered by the next message.
3474 exec 5>>./config.log
3475
3476
3477 for ac_prog in mawk gawk nawk awk
3478 do
3479 # Extract the first word of "$ac_prog", so it can be a program name with args.
3480 set dummy $ac_prog; ac_word=$2
3481 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3482 echo "configure:3483: checking for $ac_word" >&5
3483 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
3484   echo $ac_n "(cached) $ac_c" 1>&6
3485 else
3486   if test -n "$AWK"; then
3487   ac_cv_prog_AWK="$AWK" # Let the user override the test.
3488 else
3489   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3490   ac_dummy="$PATH"
3491   for ac_dir in $ac_dummy; do
3492     test -z "$ac_dir" && ac_dir=.
3493     if test -f $ac_dir/$ac_word; then
3494       ac_cv_prog_AWK="$ac_prog"
3495       break
3496     fi
3497   done
3498   IFS="$ac_save_ifs"
3499 fi
3500 fi
3501 AWK="$ac_cv_prog_AWK"
3502 if test -n "$AWK"; then
3503   echo "$ac_t""$AWK" 1>&6
3504 else
3505   echo "$ac_t""no" 1>&6
3506 fi
3507
3508 test -n "$AWK" && break
3509 done
3510
3511 # test for ln hardlink support
3512 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
3513 echo "configure:3514: checking whether ln works" >&5
3514 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
3515   echo $ac_n "(cached) $ac_c" 1>&6
3516 else
3517   rm -f conftest.src conftest.dst
3518 echo "conftest" > conftest.src
3519 if ln conftest.src conftest.dst 2>/dev/null
3520 then
3521   ol_cv_prog_LN_H="ln"
3522 else
3523   ol_cv_prog_LN_H="cp"
3524 fi
3525 rm -f conftest.src conftest.dst
3526
3527 fi
3528 LN_H="$ol_cv_prog_LN_H"
3529 if test "$ol_cv_prog_LN_H" = "ln"; then
3530         echo "$ac_t""yes" 1>&6
3531 else
3532         echo "$ac_t""no" 1>&6
3533 fi
3534
3535 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3536 echo "configure:3537: checking whether ln -s works" >&5
3537 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3538   echo $ac_n "(cached) $ac_c" 1>&6
3539 else
3540   rm -f conftestdata
3541 if ln -s X conftestdata 2>/dev/null
3542 then
3543   rm -f conftestdata
3544   ac_cv_prog_LN_S="ln -s"
3545 else
3546   ac_cv_prog_LN_S=ln
3547 fi
3548 fi
3549 LN_S="$ac_cv_prog_LN_S"
3550 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3551   echo "$ac_t""yes" 1>&6
3552 else
3553   echo "$ac_t""no" 1>&6
3554 fi
3555
3556
3557 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
3558         LN_S="$LN_H"
3559 fi
3560
3561 # Extract the first word of "sendmail", so it can be a program name with args.
3562 set dummy sendmail; ac_word=$2
3563 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3564 echo "configure:3565: checking for $ac_word" >&5
3565 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
3566   echo $ac_n "(cached) $ac_c" 1>&6
3567 else
3568   case "$SENDMAIL" in
3569   /*)
3570   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
3571   ;;
3572   ?:/*)
3573   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
3574   ;;
3575   *)
3576   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3577   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
3578   for ac_dir in $ac_dummy; do 
3579     test -z "$ac_dir" && ac_dir=.
3580     if test -f $ac_dir/$ac_word; then
3581       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
3582       break
3583     fi
3584   done
3585   IFS="$ac_save_ifs"
3586   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
3587   ;;
3588 esac
3589 fi
3590 SENDMAIL="$ac_cv_path_SENDMAIL"
3591 if test -n "$SENDMAIL"; then
3592   echo "$ac_t""$SENDMAIL" 1>&6
3593 else
3594   echo "$ac_t""no" 1>&6
3595 fi
3596
3597 # Extract the first word of "vi", so it can be a program name with args.
3598 set dummy vi; ac_word=$2
3599 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3600 echo "configure:3601: checking for $ac_word" >&5
3601 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
3602   echo $ac_n "(cached) $ac_c" 1>&6
3603 else
3604   case "$EDITOR" in
3605   /*)
3606   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
3607   ;;
3608   ?:/*)
3609   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
3610   ;;
3611   *)
3612   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3613   ac_dummy="$PATH:/usr/ucb"
3614   for ac_dir in $ac_dummy; do 
3615     test -z "$ac_dir" && ac_dir=.
3616     if test -f $ac_dir/$ac_word; then
3617       ac_cv_path_EDITOR="$ac_dir/$ac_word"
3618       break
3619     fi
3620   done
3621   IFS="$ac_save_ifs"
3622   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
3623   ;;
3624 esac
3625 fi
3626 EDITOR="$ac_cv_path_EDITOR"
3627 if test -n "$EDITOR"; then
3628   echo "$ac_t""$EDITOR" 1>&6
3629 else
3630   echo "$ac_t""no" 1>&6
3631 fi
3632
3633 # Extract the first word of "finger", so it can be a program name with args.
3634 set dummy finger; ac_word=$2
3635 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3636 echo "configure:3637: checking for $ac_word" >&5
3637 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
3638   echo $ac_n "(cached) $ac_c" 1>&6
3639 else
3640   case "$FINGER" in
3641   /*)
3642   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
3643   ;;
3644   ?:/*)
3645   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
3646   ;;
3647   *)
3648   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3649   ac_dummy="$PATH:/usr/ucb"
3650   for ac_dir in $ac_dummy; do 
3651     test -z "$ac_dir" && ac_dir=.
3652     if test -f $ac_dir/$ac_word; then
3653       ac_cv_path_FINGER="$ac_dir/$ac_word"
3654       break
3655     fi
3656   done
3657   IFS="$ac_save_ifs"
3658   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
3659   ;;
3660 esac
3661 fi
3662 FINGER="$ac_cv_path_FINGER"
3663 if test -n "$FINGER"; then
3664   echo "$ac_t""$FINGER" 1>&6
3665 else
3666   echo "$ac_t""no" 1>&6
3667 fi
3668
3669
3670 ol_link_perl=no
3671 if test $ol_enable_perl != no ; then
3672         # Extract the first word of "perl", so it can be a program name with args.
3673 set dummy perl; ac_word=$2
3674 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3675 echo "configure:3676: checking for $ac_word" >&5
3676 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
3677   echo $ac_n "(cached) $ac_c" 1>&6
3678 else
3679   case "$PERLBIN" in
3680   /*)
3681   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
3682   ;;
3683   ?:/*)
3684   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
3685   ;;
3686   *)
3687   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3688   ac_dummy="$PATH"
3689   for ac_dir in $ac_dummy; do 
3690     test -z "$ac_dir" && ac_dir=.
3691     if test -f $ac_dir/$ac_word; then
3692       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
3693       break
3694     fi
3695   done
3696   IFS="$ac_save_ifs"
3697   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
3698   ;;
3699 esac
3700 fi
3701 PERLBIN="$ac_cv_path_PERLBIN"
3702 if test -n "$PERLBIN"; then
3703   echo "$ac_t""$PERLBIN" 1>&6
3704 else
3705   echo "$ac_t""no" 1>&6
3706 fi
3707
3708
3709         if test "no$PERLBIN" = "no" ; then
3710                 if test $ol_enable_perl = yes ; then
3711                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
3712                 fi
3713
3714         else
3715                 PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
3716                 if test x"$ol_with_perl_module" = "xstatic" ; then
3717                         SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3718                 else
3719                         MOD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3720                 fi
3721                                 ol_link_perl=yes
3722         fi
3723 fi
3724
3725 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3726 echo "configure:3727: checking how to run the C preprocessor" >&5
3727 # On Suns, sometimes $CPP names a directory.
3728 if test -n "$CPP" && test -d "$CPP"; then
3729   CPP=
3730 fi
3731 if test -z "$CPP"; then
3732 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3733   echo $ac_n "(cached) $ac_c" 1>&6
3734 else
3735     # This must be in double quotes, not single quotes, because CPP may get
3736   # substituted into the Makefile and "${CC-cc}" will confuse make.
3737   CPP="${CC-cc} -E"
3738   # On the NeXT, cc -E runs the code through the compiler's parser,
3739   # not just through cpp.
3740   cat > conftest.$ac_ext <<EOF
3741 #line 3742 "configure"
3742 #include "confdefs.h"
3743 #include <assert.h>
3744 Syntax Error
3745 EOF
3746 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3747 { (eval echo configure:3748: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3748 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3749 if test -z "$ac_err"; then
3750   :
3751 else
3752   echo "$ac_err" >&5
3753   echo "configure: failed program was:" >&5
3754   cat conftest.$ac_ext >&5
3755   rm -rf conftest*
3756   CPP="${CC-cc} -E -traditional-cpp"
3757   cat > conftest.$ac_ext <<EOF
3758 #line 3759 "configure"
3759 #include "confdefs.h"
3760 #include <assert.h>
3761 Syntax Error
3762 EOF
3763 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3764 { (eval echo configure:3765: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3765 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3766 if test -z "$ac_err"; then
3767   :
3768 else
3769   echo "$ac_err" >&5
3770   echo "configure: failed program was:" >&5
3771   cat conftest.$ac_ext >&5
3772   rm -rf conftest*
3773   CPP="${CC-cc} -nologo -E"
3774   cat > conftest.$ac_ext <<EOF
3775 #line 3776 "configure"
3776 #include "confdefs.h"
3777 #include <assert.h>
3778 Syntax Error
3779 EOF
3780 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3781 { (eval echo configure:3782: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3782 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3783 if test -z "$ac_err"; then
3784   :
3785 else
3786   echo "$ac_err" >&5
3787   echo "configure: failed program was:" >&5
3788   cat conftest.$ac_ext >&5
3789   rm -rf conftest*
3790   CPP=/lib/cpp
3791 fi
3792 rm -f conftest*
3793 fi
3794 rm -f conftest*
3795 fi
3796 rm -f conftest*
3797   ac_cv_prog_CPP="$CPP"
3798 fi
3799   CPP="$ac_cv_prog_CPP"
3800 else
3801   ac_cv_prog_CPP="$CPP"
3802 fi
3803 echo "$ac_t""$CPP" 1>&6
3804
3805
3806 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3807         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3808
3809 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3810         echo "configure: warning: programs compiled here do run here..." 1>&2
3811         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3812
3813 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3814         echo "configure: warning: programs compiled here do not run here..." 1>&2
3815         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3816 fi
3817
3818 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3819 echo "configure:3820: checking for AIX" >&5
3820 cat > conftest.$ac_ext <<EOF
3821 #line 3822 "configure"
3822 #include "confdefs.h"
3823 #ifdef _AIX
3824   yes
3825 #endif
3826
3827 EOF
3828 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3829   egrep "yes" >/dev/null 2>&1; then
3830   rm -rf conftest*
3831   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3832 #define _ALL_SOURCE 1
3833 EOF
3834
3835 else
3836   rm -rf conftest*
3837   echo "$ac_t""no" 1>&6
3838 fi
3839 rm -f conftest*
3840
3841
3842 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3843 echo "configure:3844: checking for POSIXized ISC" >&5
3844 if test -d /etc/conf/kconfig.d &&
3845   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3846 then
3847   echo "$ac_t""yes" 1>&6
3848   ISC=yes # If later tests want to check for ISC.
3849   cat >> confdefs.h <<\EOF
3850 #define _POSIX_SOURCE 1
3851 EOF
3852
3853   if test "$GCC" = yes; then
3854     CC="$CC -posix"
3855   else
3856     CC="$CC -Xp"
3857   fi
3858 else
3859   echo "$ac_t""no" 1>&6
3860   ISC=
3861 fi
3862
3863 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3864 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3865 echo "configure:3866: checking for minix/config.h" >&5
3866 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3867   echo $ac_n "(cached) $ac_c" 1>&6
3868 else
3869   cat > conftest.$ac_ext <<EOF
3870 #line 3871 "configure"
3871 #include "confdefs.h"
3872 #include <minix/config.h>
3873 EOF
3874 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3875 { (eval echo configure:3876: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3876 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3877 if test -z "$ac_err"; then
3878   rm -rf conftest*
3879   eval "ac_cv_header_$ac_safe=yes"
3880 else
3881   echo "$ac_err" >&5
3882   echo "configure: failed program was:" >&5
3883   cat conftest.$ac_ext >&5
3884   rm -rf conftest*
3885   eval "ac_cv_header_$ac_safe=no"
3886 fi
3887 rm -f conftest*
3888 fi
3889 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3890   echo "$ac_t""yes" 1>&6
3891   MINIX=yes
3892 else
3893   echo "$ac_t""no" 1>&6
3894 MINIX=
3895 fi
3896
3897 if test "$MINIX" = yes; then
3898   cat >> confdefs.h <<\EOF
3899 #define _POSIX_SOURCE 1
3900 EOF
3901
3902   cat >> confdefs.h <<\EOF
3903 #define _POSIX_1_SOURCE 2
3904 EOF
3905
3906   cat >> confdefs.h <<\EOF
3907 #define _MINIX 1
3908 EOF
3909
3910 fi
3911
3912
3913 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3914 echo "configure:3915: checking for Cygwin environment" >&5
3915 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
3916   echo $ac_n "(cached) $ac_c" 1>&6
3917 else
3918   cat > conftest.$ac_ext <<EOF
3919 #line 3920 "configure"
3920 #include "confdefs.h"
3921
3922 int main() {
3923
3924 #ifndef __CYGWIN__
3925 #define __CYGWIN__ __CYGWIN32__
3926 #endif
3927 return __CYGWIN__;
3928 ; return 0; }
3929 EOF
3930 if { (eval echo configure:3931: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3931   rm -rf conftest*
3932   ac_cv_cygwin=yes
3933 else
3934   echo "configure: failed program was:" >&5
3935   cat conftest.$ac_ext >&5
3936   rm -rf conftest*
3937   ac_cv_cygwin=no
3938 fi
3939 rm -f conftest*
3940 fi
3941
3942 echo "$ac_t""$ac_cv_cygwin" 1>&6
3943 CYGWIN=
3944 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3945 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3946 echo "configure:3947: checking for mingw32 environment" >&5
3947 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
3948   echo $ac_n "(cached) $ac_c" 1>&6
3949 else
3950   cat > conftest.$ac_ext <<EOF
3951 #line 3952 "configure"
3952 #include "confdefs.h"
3953
3954 int main() {
3955 return __MINGW32__;
3956 ; return 0; }
3957 EOF
3958 if { (eval echo configure:3959: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3959   rm -rf conftest*
3960   ac_cv_mingw32=yes
3961 else
3962   echo "configure: failed program was:" >&5
3963   cat conftest.$ac_ext >&5
3964   rm -rf conftest*
3965   ac_cv_mingw32=no
3966 fi
3967 rm -f conftest*
3968 fi
3969
3970 echo "$ac_t""$ac_cv_mingw32" 1>&6
3971 MINGW32=
3972 test "$ac_cv_mingw32" = yes && MINGW32=yes
3973 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
3974 echo "configure:3975: checking for EMX OS/2 environment" >&5
3975 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
3976   echo $ac_n "(cached) $ac_c" 1>&6
3977 else
3978   cat > conftest.$ac_ext <<EOF
3979 #line 3980 "configure"
3980 #include "confdefs.h"
3981
3982 int main() {
3983 return __EMX__;
3984 ; return 0; }
3985 EOF
3986 if { (eval echo configure:3987: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3987   rm -rf conftest*
3988   ac_cv_emxos2=yes
3989 else
3990   echo "configure: failed program was:" >&5
3991   cat conftest.$ac_ext >&5
3992   rm -rf conftest*
3993   ac_cv_emxos2=no
3994 fi
3995 rm -f conftest*
3996 fi
3997
3998 echo "$ac_t""$ac_cv_emxos2" 1>&6
3999 EMXOS2=
4000 test "$ac_cv_emxos2" = yes && EMXOS2=yes
4001
4002
4003
4004 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
4005 echo "configure:4006: checking for executable suffix" >&5
4006 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
4007   echo $ac_n "(cached) $ac_c" 1>&6
4008 else
4009   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
4010   ac_cv_exeext=.exe
4011 else
4012   rm -f conftest*
4013   echo 'int main () { return 0; }' > conftest.$ac_ext
4014   ac_cv_exeext=
4015   if { (eval echo configure:4016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
4016     for file in conftest.*; do
4017       case $file in
4018       *.c | *.C | *.o | *.obj | *.xcoff) ;;
4019       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
4020       esac
4021     done
4022   else
4023     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
4024   fi
4025   rm -f conftest*
4026   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
4027 fi
4028 fi
4029
4030 EXEEXT=""
4031 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
4032 echo "$ac_t""${ac_cv_exeext}" 1>&6
4033 ac_exeext=$EXEEXT
4034
4035 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
4036 echo "configure:4037: checking for object suffix" >&5
4037 if eval "test \"\${ac_cv_objext+set}\" = set"; then
4038   echo $ac_n "(cached) $ac_c" 1>&6
4039 else
4040   rm -f conftest*
4041 echo 'int i = 1;' > conftest.$ac_ext
4042 if { (eval echo configure:4043: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4043   for ac_file in conftest.*; do
4044     case $ac_file in
4045     *.c) ;;
4046     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
4047     esac
4048   done
4049 else
4050   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
4051 fi
4052 rm -f conftest*
4053 fi
4054
4055 echo "$ac_t""$ac_cv_objext" 1>&6
4056 OBJEXT=$ac_cv_objext
4057 ac_objext=$ac_cv_objext
4058
4059
4060 cat >> confdefs.h <<EOF
4061 #define EXEEXT "${EXEEXT}"
4062 EOF
4063
4064
4065 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
4066 echo "configure:4067: checking for be_app in -lbe" >&5
4067 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
4068 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4069   echo $ac_n "(cached) $ac_c" 1>&6
4070 else
4071   ac_save_LIBS="$LIBS"
4072 LIBS="-lbe -lroot -lnet $LIBS"
4073 cat > conftest.$ac_ext <<EOF
4074 #line 4075 "configure"
4075 #include "confdefs.h"
4076 /* Override any gcc2 internal prototype to avoid an error.  */
4077 /* We use char because int might match the return type of a gcc2
4078     builtin and then its argument prototype would still apply.  */
4079 char be_app();
4080
4081 int main() {
4082 be_app()
4083 ; return 0; }
4084 EOF
4085 if { (eval echo configure:4086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4086   rm -rf conftest*
4087   eval "ac_cv_lib_$ac_lib_var=yes"
4088 else
4089   echo "configure: failed program was:" >&5
4090   cat conftest.$ac_ext >&5
4091   rm -rf conftest*
4092   eval "ac_cv_lib_$ac_lib_var=no"
4093 fi
4094 rm -f conftest*
4095 LIBS="$ac_save_LIBS"
4096
4097 fi
4098 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4099   echo "$ac_t""yes" 1>&6
4100   LIBS="$LIBS -lbe -lroot -lnet"
4101 else
4102   echo "$ac_t""no" 1>&6
4103 :
4104 fi
4105
4106
4107
4108
4109
4110 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
4111 echo "configure:4112: checking for ${CC-cc} option to accept ANSI C" >&5
4112 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
4113   echo $ac_n "(cached) $ac_c" 1>&6
4114 else
4115   am_cv_prog_cc_stdc=no
4116 ac_save_CC="$CC"
4117 # Don't try gcc -ansi; that turns off useful extensions and
4118 # breaks some systems' header files.
4119 # AIX                   -qlanglvl=ansi
4120 # Ultrix and OSF/1      -std1
4121 # HP-UX 10.20 and later -Ae
4122 # HP-UX older versions  -Aa -D_HPUX_SOURCE
4123 # SVR4                  -Xc -D__EXTENSIONS__
4124 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4125 do
4126   CC="$ac_save_CC $ac_arg"
4127   cat > conftest.$ac_ext <<EOF
4128 #line 4129 "configure"
4129 #include "confdefs.h"
4130 #include <stdarg.h>
4131 #include <stdio.h>
4132 #include <sys/types.h>
4133 #include <sys/stat.h>
4134 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
4135 struct buf { int x; };
4136 FILE * (*rcsopen) (struct buf *, struct stat *, int);
4137 static char *e (p, i)
4138      char **p;
4139      int i;
4140 {
4141   return p[i];
4142 }
4143 static char *f (char * (*g) (char **, int), char **p, ...)
4144 {
4145   char *s;
4146   va_list v;
4147   va_start (v,p);
4148   s = g (p, va_arg (v,int));
4149   va_end (v);
4150   return s;
4151 }
4152 int test (int i, double x);
4153 struct s1 {int (*f) (int a);};
4154 struct s2 {int (*f) (double a);};
4155 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4156 int argc;
4157 char **argv;
4158
4159 int main() {
4160
4161 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
4162
4163 ; return 0; }
4164 EOF
4165 if { (eval echo configure:4166: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4166   rm -rf conftest*
4167   am_cv_prog_cc_stdc="$ac_arg"; break
4168 else
4169   echo "configure: failed program was:" >&5
4170   cat conftest.$ac_ext >&5
4171 fi
4172 rm -f conftest*
4173 done
4174 CC="$ac_save_CC"
4175
4176 fi
4177
4178 if test -z "$am_cv_prog_cc_stdc"; then
4179   echo "$ac_t""none needed" 1>&6
4180 else
4181   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
4182 fi
4183 case "x$am_cv_prog_cc_stdc" in
4184   x|xno) ;;
4185   *) CC="$CC $am_cv_prog_cc_stdc" ;;
4186 esac
4187
4188 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
4189         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
4190 fi
4191
4192 # test for make depend flag
4193 OL_MKDEP=
4194 OL_MKDEP_FLAGS=
4195 if test -z "${MKDEP}"; then
4196         OL_MKDEP="${CC-cc}"
4197         if test -z "${MKDEP_FLAGS}"; then
4198                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
4199 echo "configure:4200: checking for ${OL_MKDEP} depend flag" >&5
4200 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
4201   echo $ac_n "(cached) $ac_c" 1>&6
4202 else
4203   
4204                         ol_cv_mkdep=no
4205                         for flag in "-M" "-xM"; do
4206                                 cat > conftest.c <<EOF
4207  noCode;
4208 EOF
4209                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:4210: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
4210                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
4211                                 then
4212                                         if test ! -f conftest."${ac_object}" ; then
4213                                                 ol_cv_mkdep=$flag
4214                                                 OL_MKDEP_FLAGS="$flag"
4215                                                 break
4216                                         fi
4217                                 fi
4218                         done
4219                         rm -f conftest*
4220                 
4221 fi
4222
4223 echo "$ac_t""$ol_cv_mkdep" 1>&6
4224         else
4225                 cc_cv_mkdep=yes
4226                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
4227         fi
4228 else
4229         cc_cv_mkdep=yes
4230         OL_MKDEP="${MKDEP}"
4231         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
4232 fi
4233
4234
4235
4236 if test "${ol_cv_mkdep}" = no ; then
4237         # this will soon become an error
4238         echo "configure: warning: do not know how to generate dependencies" 1>&2
4239 fi
4240
4241 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
4242 echo "configure:4243: checking for afopen in -ls" >&5
4243 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
4244 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4245   echo $ac_n "(cached) $ac_c" 1>&6
4246 else
4247   ac_save_LIBS="$LIBS"
4248 LIBS="-ls  $LIBS"
4249 cat > conftest.$ac_ext <<EOF
4250 #line 4251 "configure"
4251 #include "confdefs.h"
4252 /* Override any gcc2 internal prototype to avoid an error.  */
4253 /* We use char because int might match the return type of a gcc2
4254     builtin and then its argument prototype would still apply.  */
4255 char afopen();
4256
4257 int main() {
4258 afopen()
4259 ; return 0; }
4260 EOF
4261 if { (eval echo configure:4262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4262   rm -rf conftest*
4263   eval "ac_cv_lib_$ac_lib_var=yes"
4264 else
4265   echo "configure: failed program was:" >&5
4266   cat conftest.$ac_ext >&5
4267   rm -rf conftest*
4268   eval "ac_cv_lib_$ac_lib_var=no"
4269 fi
4270 rm -f conftest*
4271 LIBS="$ac_save_LIBS"
4272
4273 fi
4274 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4275   echo "$ac_t""yes" 1>&6
4276   
4277         AUTH_LIBS=-ls
4278         cat >> confdefs.h <<\EOF
4279 #define HAVE_AIX_SECURITY 1
4280 EOF
4281
4282
4283 else
4284   echo "$ac_t""no" 1>&6
4285 fi
4286
4287
4288 ol_link_modules=no
4289 if test $ol_enable_modules != no ; then
4290         for ac_hdr in ltdl.h
4291 do
4292 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4293 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4294 echo "configure:4295: checking for $ac_hdr" >&5
4295 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4296   echo $ac_n "(cached) $ac_c" 1>&6
4297 else
4298   cat > conftest.$ac_ext <<EOF
4299 #line 4300 "configure"
4300 #include "confdefs.h"
4301 #include <$ac_hdr>
4302 EOF
4303 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4304 { (eval echo configure:4305: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4305 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4306 if test -z "$ac_err"; then
4307   rm -rf conftest*
4308   eval "ac_cv_header_$ac_safe=yes"
4309 else
4310   echo "$ac_err" >&5
4311   echo "configure: failed program was:" >&5
4312   cat conftest.$ac_ext >&5
4313   rm -rf conftest*
4314   eval "ac_cv_header_$ac_safe=no"
4315 fi
4316 rm -f conftest*
4317 fi
4318 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4319   echo "$ac_t""yes" 1>&6
4320     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4321   cat >> confdefs.h <<EOF
4322 #define $ac_tr_hdr 1
4323 EOF
4324  
4325 else
4326   echo "$ac_t""no" 1>&6
4327 fi
4328 done
4329
4330
4331         if test $ac_cv_header_ltdl_h = no ; then
4332                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
4333         fi
4334
4335         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
4336 echo "configure:4337: checking for lt_dlinit in -lltdl" >&5
4337 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
4338 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4339   echo $ac_n "(cached) $ac_c" 1>&6
4340 else
4341   ac_save_LIBS="$LIBS"
4342 LIBS="-lltdl  $LIBS"
4343 cat > conftest.$ac_ext <<EOF
4344 #line 4345 "configure"
4345 #include "confdefs.h"
4346 /* Override any gcc2 internal prototype to avoid an error.  */
4347 /* We use char because int might match the return type of a gcc2
4348     builtin and then its argument prototype would still apply.  */
4349 char lt_dlinit();
4350
4351 int main() {
4352 lt_dlinit()
4353 ; return 0; }
4354 EOF
4355 if { (eval echo configure:4356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4356   rm -rf conftest*
4357   eval "ac_cv_lib_$ac_lib_var=yes"
4358 else
4359   echo "configure: failed program was:" >&5
4360   cat conftest.$ac_ext >&5
4361   rm -rf conftest*
4362   eval "ac_cv_lib_$ac_lib_var=no"
4363 fi
4364 rm -f conftest*
4365 LIBS="$ac_save_LIBS"
4366
4367 fi
4368 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4369   echo "$ac_t""yes" 1>&6
4370   
4371             MODULES_LIBS=-lltdl
4372             cat >> confdefs.h <<\EOF
4373 #define HAVE_LIBLTDL 1
4374 EOF
4375
4376         
4377 else
4378   echo "$ac_t""no" 1>&6
4379 fi
4380
4381
4382         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
4383                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
4384         fi
4385         ol_link_modules=yes
4386 else
4387         ol_with_bdb2_module=static
4388         ol_with_dnssrv_module=static
4389         ol_with_ldap_module=static
4390         ol_with_ldbm_module=static
4391         ol_with_passwd_module=static
4392         ol_with_perl_module=static
4393         ol_with_shell_module=static
4394         ol_with_tcl_module=static
4395         ol_with_sql_module=static
4396 fi
4397
4398 # test for EBCDIC
4399 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
4400 echo "configure:4401: checking for EBCDIC" >&5
4401 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
4402   echo $ac_n "(cached) $ac_c" 1>&6
4403 else
4404   
4405         cat > conftest.$ac_ext <<EOF
4406 #line 4407 "configure"
4407 #include "confdefs.h"
4408
4409 #if !('M' == 0xd4)
4410 #include <__ASCII__/generate_error.h>
4411 #endif
4412
4413 EOF
4414 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4415 { (eval echo configure:4416: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4416 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4417 if test -z "$ac_err"; then
4418   rm -rf conftest*
4419   ol_cv_cpp_ebcdic=yes
4420 else
4421   echo "$ac_err" >&5
4422   echo "configure: failed program was:" >&5
4423   cat conftest.$ac_ext >&5
4424   rm -rf conftest*
4425   ol_cv_cpp_ebcdic=no
4426 fi
4427 rm -f conftest*
4428 fi
4429
4430 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
4431 if test $ol_cv_cpp_ebcdic = yes ; then
4432         cat >> confdefs.h <<\EOF
4433 #define HAVE_EBCDIC 1
4434 EOF
4435
4436 fi
4437
4438 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
4439 echo "configure:4440: checking for ANSI C header files" >&5
4440 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
4441   echo $ac_n "(cached) $ac_c" 1>&6
4442 else
4443   cat > conftest.$ac_ext <<EOF
4444 #line 4445 "configure"
4445 #include "confdefs.h"
4446 #include <stdlib.h>
4447 #include <stdarg.h>
4448 #include <string.h>
4449 #include <float.h>
4450 EOF
4451 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4452 { (eval echo configure:4453: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4453 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4454 if test -z "$ac_err"; then
4455   rm -rf conftest*
4456   ol_cv_header_stdc=yes
4457 else
4458   echo "$ac_err" >&5
4459   echo "configure: failed program was:" >&5
4460   cat conftest.$ac_ext >&5
4461   rm -rf conftest*
4462   ol_cv_header_stdc=no
4463 fi
4464 rm -f conftest*
4465
4466 if test $ol_cv_header_stdc = yes; then
4467   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4468 cat > conftest.$ac_ext <<EOF
4469 #line 4470 "configure"
4470 #include "confdefs.h"
4471 #include <string.h>
4472 EOF
4473 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4474   egrep "memchr" >/dev/null 2>&1; then
4475   :
4476 else
4477   rm -rf conftest*
4478   ol_cv_header_stdc=no
4479 fi
4480 rm -f conftest*
4481
4482 fi
4483
4484 if test $ol_cv_header_stdc = yes; then
4485   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4486 cat > conftest.$ac_ext <<EOF
4487 #line 4488 "configure"
4488 #include "confdefs.h"
4489 #include <stdlib.h>
4490 EOF
4491 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4492   egrep "free" >/dev/null 2>&1; then
4493   :
4494 else
4495   rm -rf conftest*
4496   ol_cv_header_stdc=no
4497 fi
4498 rm -f conftest*
4499
4500 fi
4501
4502 if test $ol_cv_header_stdc = yes; then
4503   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4504 if test "$cross_compiling" = yes; then
4505   :
4506 else
4507   cat > conftest.$ac_ext <<EOF
4508 #line 4509 "configure"
4509 #include "confdefs.h"
4510 #include <ctype.h>
4511 #ifndef HAVE_EBCDIC
4512 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4513 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4514 #else
4515 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4516                 || ('j' <= (c) && (c) <= 'r') \
4517                 || ('s' <= (c) && (c) <= 'z'))
4518 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
4519 #endif
4520 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4521 int main () { int i; for (i = 0; i < 256; i++)
4522 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4523 exit (0); }
4524
4525 EOF
4526 if { (eval echo configure:4527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4527 then
4528   :
4529 else
4530   echo "configure: failed program was:" >&5
4531   cat conftest.$ac_ext >&5
4532   rm -fr conftest*
4533   ol_cv_header_stdc=no
4534 fi
4535 rm -fr conftest*
4536 fi
4537
4538 fi
4539 fi
4540
4541 echo "$ac_t""$ol_cv_header_stdc" 1>&6
4542 if test $ol_cv_header_stdc = yes; then
4543   cat >> confdefs.h <<\EOF
4544 #define STDC_HEADERS 1
4545 EOF
4546
4547 fi
4548 ac_cv_header_stdc=disable
4549
4550
4551 if test $ol_cv_header_stdc != yes; then
4552         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
4553 fi
4554
4555 ac_header_dirent=no
4556 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4557 do
4558 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4559 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4560 echo "configure:4561: checking for $ac_hdr that defines DIR" >&5
4561 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
4562   echo $ac_n "(cached) $ac_c" 1>&6
4563 else
4564   cat > conftest.$ac_ext <<EOF
4565 #line 4566 "configure"
4566 #include "confdefs.h"
4567 #include <sys/types.h>
4568 #include <$ac_hdr>
4569 int main() {
4570 DIR *dirp = 0;
4571 ; return 0; }
4572 EOF
4573 if { (eval echo configure:4574: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4574   rm -rf conftest*
4575   eval "ac_cv_header_dirent_$ac_safe=yes"
4576 else
4577   echo "configure: failed program was:" >&5
4578   cat conftest.$ac_ext >&5
4579   rm -rf conftest*
4580   eval "ac_cv_header_dirent_$ac_safe=no"
4581 fi
4582 rm -f conftest*
4583 fi
4584 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4585   echo "$ac_t""yes" 1>&6
4586     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4587   cat >> confdefs.h <<EOF
4588 #define $ac_tr_hdr 1
4589 EOF
4590  ac_header_dirent=$ac_hdr; break
4591 else
4592   echo "$ac_t""no" 1>&6
4593 fi
4594 done
4595 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4596 if test $ac_header_dirent = dirent.h; then
4597 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4598 echo "configure:4599: checking for opendir in -ldir" >&5
4599 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
4600 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4601   echo $ac_n "(cached) $ac_c" 1>&6
4602 else
4603   ac_save_LIBS="$LIBS"
4604 LIBS="-ldir  $LIBS"
4605 cat > conftest.$ac_ext <<EOF
4606 #line 4607 "configure"
4607 #include "confdefs.h"
4608 /* Override any gcc2 internal prototype to avoid an error.  */
4609 /* We use char because int might match the return type of a gcc2
4610     builtin and then its argument prototype would still apply.  */
4611 char opendir();
4612
4613 int main() {
4614 opendir()
4615 ; return 0; }
4616 EOF
4617 if { (eval echo configure:4618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4618   rm -rf conftest*
4619   eval "ac_cv_lib_$ac_lib_var=yes"
4620 else
4621   echo "configure: failed program was:" >&5
4622   cat conftest.$ac_ext >&5
4623   rm -rf conftest*
4624   eval "ac_cv_lib_$ac_lib_var=no"
4625 fi
4626 rm -f conftest*
4627 LIBS="$ac_save_LIBS"
4628
4629 fi
4630 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4631   echo "$ac_t""yes" 1>&6
4632   LIBS="$LIBS -ldir"
4633 else
4634   echo "$ac_t""no" 1>&6
4635 fi
4636
4637 else
4638 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4639 echo "configure:4640: checking for opendir in -lx" >&5
4640 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
4641 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4642   echo $ac_n "(cached) $ac_c" 1>&6
4643 else
4644   ac_save_LIBS="$LIBS"
4645 LIBS="-lx  $LIBS"
4646 cat > conftest.$ac_ext <<EOF
4647 #line 4648 "configure"
4648 #include "confdefs.h"
4649 /* Override any gcc2 internal prototype to avoid an error.  */
4650 /* We use char because int might match the return type of a gcc2
4651     builtin and then its argument prototype would still apply.  */
4652 char opendir();
4653
4654 int main() {
4655 opendir()
4656 ; return 0; }
4657 EOF
4658 if { (eval echo configure:4659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4659   rm -rf conftest*
4660   eval "ac_cv_lib_$ac_lib_var=yes"
4661 else
4662   echo "configure: failed program was:" >&5
4663   cat conftest.$ac_ext >&5
4664   rm -rf conftest*
4665   eval "ac_cv_lib_$ac_lib_var=no"
4666 fi
4667 rm -f conftest*
4668 LIBS="$ac_save_LIBS"
4669
4670 fi
4671 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4672   echo "$ac_t""yes" 1>&6
4673   LIBS="$LIBS -lx"
4674 else
4675   echo "$ac_t""no" 1>&6
4676 fi
4677
4678 fi
4679
4680 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4681 echo "configure:4682: checking for sys/wait.h that is POSIX.1 compatible" >&5
4682 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
4683   echo $ac_n "(cached) $ac_c" 1>&6
4684 else
4685   cat > conftest.$ac_ext <<EOF
4686 #line 4687 "configure"
4687 #include "confdefs.h"
4688 #include <sys/types.h>
4689 #include <sys/wait.h>
4690 #ifndef WEXITSTATUS
4691 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4692 #endif
4693 #ifndef WIFEXITED
4694 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4695 #endif
4696 int main() {
4697 int s;
4698 wait (&s);
4699 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4700 ; return 0; }
4701 EOF
4702 if { (eval echo configure:4703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4703   rm -rf conftest*
4704   ac_cv_header_sys_wait_h=yes
4705 else
4706   echo "configure: failed program was:" >&5
4707   cat conftest.$ac_ext >&5
4708   rm -rf conftest*
4709   ac_cv_header_sys_wait_h=no
4710 fi
4711 rm -f conftest*
4712 fi
4713
4714 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4715 if test $ac_cv_header_sys_wait_h = yes; then
4716   cat >> confdefs.h <<\EOF
4717 #define HAVE_SYS_WAIT_H 1
4718 EOF
4719
4720 fi
4721
4722 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4723 echo "configure:4724: checking POSIX termios" >&5
4724 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
4725   echo $ac_n "(cached) $ac_c" 1>&6
4726 else
4727   cat > conftest.$ac_ext <<EOF
4728 #line 4729 "configure"
4729 #include "confdefs.h"
4730 #include <sys/types.h>
4731 #include <unistd.h>
4732 #include <termios.h>
4733 int main() {
4734 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4735    tcgetattr(0, 0);
4736 ; return 0; }
4737 EOF
4738 if { (eval echo configure:4739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4739   rm -rf conftest*
4740   am_cv_sys_posix_termios=yes
4741 else
4742   echo "configure: failed program was:" >&5
4743   cat conftest.$ac_ext >&5
4744   rm -rf conftest*
4745   am_cv_sys_posix_termios=no
4746 fi
4747 rm -f conftest*
4748 fi
4749
4750 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4751
4752
4753  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4754 echo "configure:4755: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4755 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
4756   echo $ac_n "(cached) $ac_c" 1>&6
4757 else
4758   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4759
4760   gwinsz_in_termios_h=no
4761   if test $am_cv_sys_posix_termios = yes; then
4762     cat > conftest.$ac_ext <<EOF
4763 #line 4764 "configure"
4764 #include "confdefs.h"
4765 #include <sys/types.h>
4766 #     include <termios.h>
4767 #     ifdef TIOCGWINSZ
4768         yes
4769 #     endif
4770     
4771 EOF
4772 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4773   egrep "yes" >/dev/null 2>&1; then
4774   rm -rf conftest*
4775   gwinsz_in_termios_h=yes
4776 fi
4777 rm -f conftest*
4778
4779   fi
4780
4781   if test $gwinsz_in_termios_h = no; then
4782     cat > conftest.$ac_ext <<EOF
4783 #line 4784 "configure"
4784 #include "confdefs.h"
4785 #include <sys/types.h>
4786 #     include <sys/ioctl.h>
4787 #     ifdef TIOCGWINSZ
4788         yes
4789 #     endif
4790     
4791 EOF
4792 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4793   egrep "yes" >/dev/null 2>&1; then
4794   rm -rf conftest*
4795   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4796 fi
4797 rm -f conftest*
4798
4799   fi
4800   
4801 fi
4802
4803 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4804   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4805     cat >> confdefs.h <<\EOF
4806 #define GWINSZ_IN_SYS_IOCTL 1
4807 EOF
4808
4809   fi
4810
4811 if test $am_cv_sys_posix_termios = yes ; then
4812         cat >> confdefs.h <<\EOF
4813 #define HAVE_POSIX_TERMIOS 1
4814 EOF
4815
4816 fi
4817
4818 for ac_hdr in \
4819         arpa/inet.h             \
4820         arpa/nameser.h  \
4821         assert.h                \
4822         conio.h                 \
4823         crypt.h                 \
4824         direct.h                \
4825         errno.h                 \
4826         fcntl.h                 \
4827         filio.h                 \
4828         getopt.h                \
4829         grp.h                   \
4830         io.h                    \
4831         libutil.h               \
4832         limits.h                \
4833         locale.h                \
4834         netinet/tcp.h   \
4835         malloc.h                \
4836         memory.h                \
4837         psap.h                  \
4838         pwd.h                   \
4839         process.h               \
4840         resolv.h                \
4841         sgtty.h                 \
4842         shadow.h                \
4843         stddef.h                \
4844         string.h                \
4845         strings.h               \
4846         sysexits.h              \
4847         sys/file.h              \
4848         sys/filio.h             \
4849         sys/errno.h             \
4850         sys/ioctl.h             \
4851         sys/param.h             \
4852         sys/resource.h  \
4853         sys/select.h    \
4854         sys/socket.h    \
4855         sys/syslog.h    \
4856         sys/time.h              \
4857         sys/types.h             \
4858         syslog.h                \
4859         termios.h               \
4860         unistd.h                \
4861         winsock.h               \
4862
4863 do
4864 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4865 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4866 echo "configure:4867: checking for $ac_hdr" >&5
4867 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4868   echo $ac_n "(cached) $ac_c" 1>&6
4869 else
4870   cat > conftest.$ac_ext <<EOF
4871 #line 4872 "configure"
4872 #include "confdefs.h"
4873 #include <$ac_hdr>
4874 EOF
4875 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4876 { (eval echo configure:4877: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4877 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4878 if test -z "$ac_err"; then
4879   rm -rf conftest*
4880   eval "ac_cv_header_$ac_safe=yes"
4881 else
4882   echo "$ac_err" >&5
4883   echo "configure: failed program was:" >&5
4884   cat conftest.$ac_ext >&5
4885   rm -rf conftest*
4886   eval "ac_cv_header_$ac_safe=no"
4887 fi
4888 rm -f conftest*
4889 fi
4890 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4891   echo "$ac_t""yes" 1>&6
4892     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4893   cat >> confdefs.h <<EOF
4894 #define $ac_tr_hdr 1
4895 EOF
4896  
4897 else
4898   echo "$ac_t""no" 1>&6
4899 fi
4900 done
4901
4902
4903
4904
4905 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
4906 echo "configure:4907: checking for sigset in -lV3" >&5
4907 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
4908 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4909   echo $ac_n "(cached) $ac_c" 1>&6
4910 else
4911   ac_save_LIBS="$LIBS"
4912 LIBS="-lV3  $LIBS"
4913 cat > conftest.$ac_ext <<EOF
4914 #line 4915 "configure"
4915 #include "confdefs.h"
4916 /* Override any gcc2 internal prototype to avoid an error.  */
4917 /* We use char because int might match the return type of a gcc2
4918     builtin and then its argument prototype would still apply.  */
4919 char sigset();
4920
4921 int main() {
4922 sigset()
4923 ; return 0; }
4924 EOF
4925 if { (eval echo configure:4926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4926   rm -rf conftest*
4927   eval "ac_cv_lib_$ac_lib_var=yes"
4928 else
4929   echo "configure: failed program was:" >&5
4930   cat conftest.$ac_ext >&5
4931   rm -rf conftest*
4932   eval "ac_cv_lib_$ac_lib_var=no"
4933 fi
4934 rm -f conftest*
4935 LIBS="$ac_save_LIBS"
4936
4937 fi
4938 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4939   echo "$ac_t""yes" 1>&6
4940     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4941     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4942   cat >> confdefs.h <<EOF
4943 #define $ac_tr_lib 1
4944 EOF
4945
4946   LIBS="-lV3 $LIBS"
4947
4948 else
4949   echo "$ac_t""no" 1>&6
4950 fi
4951
4952
4953 if test $ac_cv_header_winsock_h = yes; then
4954         echo $ac_n "checking for winsock""... $ac_c" 1>&6
4955 echo "configure:4956: checking for winsock" >&5
4956 if eval "test \"\${ol_cv_winsock+set}\" = set"; then
4957   echo $ac_n "(cached) $ac_c" 1>&6
4958 else
4959   cat > conftest.$ac_ext <<EOF
4960 #line 4961 "configure"
4961 #include "confdefs.h"
4962 #include <winsock.h>
4963 int main() {
4964
4965                         socket(0,0,0);
4966                         select(0,NULL,NULL,NULL,NULL);
4967                         closesocket(0);
4968                         gethostname(NULL,0);
4969         
4970 ; return 0; }
4971 EOF
4972 if { (eval echo configure:4973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4973   rm -rf conftest*
4974   ol_cv_winsock=yes
4975 else
4976   echo "configure: failed program was:" >&5
4977   cat conftest.$ac_ext >&5
4978   rm -rf conftest*
4979   ol_cv_winsock=no
4980 fi
4981 rm -f conftest*]
4982 fi
4983
4984 echo "$ac_t""$ol_cv_winsock" 1>&6
4985
4986         if test $ol_cv_winsock = yes ; then
4987                 cat >> confdefs.h <<\EOF
4988 #define HAVE_WINSOCK 1
4989 EOF
4990
4991                 ac_cv_func_socket=yes
4992                 ac_cv_func_select=yes
4993                 ac_cv_func_closesocket=yes
4994                 ac_cv_func_gethostname=yes
4995         fi
4996 fi
4997
4998
4999 echo $ac_n "checking for socket""... $ac_c" 1>&6
5000 echo "configure:5001: checking for socket" >&5
5001 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
5002   echo $ac_n "(cached) $ac_c" 1>&6
5003 else
5004   cat > conftest.$ac_ext <<EOF
5005 #line 5006 "configure"
5006 #include "confdefs.h"
5007 /* System header to define __stub macros and hopefully few prototypes,
5008     which can conflict with char socket(); below.  */
5009 #include <assert.h>
5010 /* Override any gcc2 internal prototype to avoid an error.  */
5011 /* We use char because int might match the return type of a gcc2
5012     builtin and then its argument prototype would still apply.  */
5013 char socket();
5014 char (*f)();
5015
5016 int main() {
5017
5018 /* The GNU C library defines this for functions which it implements
5019     to always fail with ENOSYS.  Some functions are actually named
5020     something starting with __ and the normal name is an alias.  */
5021 #if defined (__stub_socket) || defined (__stub___socket)
5022 choke me
5023 #else
5024 f = socket;
5025 #endif
5026
5027 ; return 0; }
5028 EOF
5029 if { (eval echo configure:5030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5030   rm -rf conftest*
5031   eval "ac_cv_func_socket=yes"
5032 else
5033   echo "configure: failed program was:" >&5
5034   cat conftest.$ac_ext >&5
5035   rm -rf conftest*
5036   eval "ac_cv_func_socket=no"
5037 fi
5038 rm -f conftest*
5039 fi
5040
5041 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
5042   echo "$ac_t""yes" 1>&6
5043   :
5044 else
5045   echo "$ac_t""no" 1>&6
5046         
5047         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
5048 echo "configure:5049: checking for main in -lsocket" >&5
5049 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
5050 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5051   echo $ac_n "(cached) $ac_c" 1>&6
5052 else
5053   ac_save_LIBS="$LIBS"
5054 LIBS="-lsocket  $LIBS"
5055 cat > conftest.$ac_ext <<EOF
5056 #line 5057 "configure"
5057 #include "confdefs.h"
5058
5059 int main() {
5060 main()
5061 ; return 0; }
5062 EOF
5063 if { (eval echo configure:5064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5064   rm -rf conftest*
5065   eval "ac_cv_lib_$ac_lib_var=yes"
5066 else
5067   echo "configure: failed program was:" >&5
5068   cat conftest.$ac_ext >&5
5069   rm -rf conftest*
5070   eval "ac_cv_lib_$ac_lib_var=no"
5071 fi
5072 rm -f conftest*
5073 LIBS="$ac_save_LIBS"
5074
5075 fi
5076 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5077   echo "$ac_t""yes" 1>&6
5078     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5079     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5080   cat >> confdefs.h <<EOF
5081 #define $ac_tr_lib 1
5082 EOF
5083
5084   LIBS="-lsocket $LIBS"
5085
5086 else
5087   echo "$ac_t""no" 1>&6
5088 fi
5089
5090         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
5091 echo "configure:5092: checking for main in -lnet" >&5
5092 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
5093 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5094   echo $ac_n "(cached) $ac_c" 1>&6
5095 else
5096   ac_save_LIBS="$LIBS"
5097 LIBS="-lnet  $LIBS"
5098 cat > conftest.$ac_ext <<EOF
5099 #line 5100 "configure"
5100 #include "confdefs.h"
5101
5102 int main() {
5103 main()
5104 ; return 0; }
5105 EOF
5106 if { (eval echo configure:5107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5107   rm -rf conftest*
5108   eval "ac_cv_lib_$ac_lib_var=yes"
5109 else
5110   echo "configure: failed program was:" >&5
5111   cat conftest.$ac_ext >&5
5112   rm -rf conftest*
5113   eval "ac_cv_lib_$ac_lib_var=no"
5114 fi
5115 rm -f conftest*
5116 LIBS="$ac_save_LIBS"
5117
5118 fi
5119 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5120   echo "$ac_t""yes" 1>&6
5121     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5122     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5123   cat >> confdefs.h <<EOF
5124 #define $ac_tr_lib 1
5125 EOF
5126
5127   LIBS="-lnet $LIBS"
5128
5129 else
5130   echo "$ac_t""no" 1>&6
5131 fi
5132
5133         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
5134 echo "configure:5135: checking for main in -lnsl_s" >&5
5135 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
5136 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5137   echo $ac_n "(cached) $ac_c" 1>&6
5138 else
5139   ac_save_LIBS="$LIBS"
5140 LIBS="-lnsl_s  $LIBS"
5141 cat > conftest.$ac_ext <<EOF
5142 #line 5143 "configure"
5143 #include "confdefs.h"
5144
5145 int main() {
5146 main()
5147 ; return 0; }
5148 EOF
5149 if { (eval echo configure:5150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5150   rm -rf conftest*
5151   eval "ac_cv_lib_$ac_lib_var=yes"
5152 else
5153   echo "configure: failed program was:" >&5
5154   cat conftest.$ac_ext >&5
5155   rm -rf conftest*
5156   eval "ac_cv_lib_$ac_lib_var=no"
5157 fi
5158 rm -f conftest*
5159 LIBS="$ac_save_LIBS"
5160
5161 fi
5162 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5163   echo "$ac_t""yes" 1>&6
5164     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5165     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5166   cat >> confdefs.h <<EOF
5167 #define $ac_tr_lib 1
5168 EOF
5169
5170   LIBS="-lnsl_s $LIBS"
5171
5172 else
5173   echo "$ac_t""no" 1>&6
5174 fi
5175
5176         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
5177 echo "configure:5178: checking for main in -lnsl" >&5
5178 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
5179 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5180   echo $ac_n "(cached) $ac_c" 1>&6
5181 else
5182   ac_save_LIBS="$LIBS"
5183 LIBS="-lnsl  $LIBS"
5184 cat > conftest.$ac_ext <<EOF
5185 #line 5186 "configure"
5186 #include "confdefs.h"
5187
5188 int main() {
5189 main()
5190 ; return 0; }
5191 EOF
5192 if { (eval echo configure:5193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5193   rm -rf conftest*
5194   eval "ac_cv_lib_$ac_lib_var=yes"
5195 else
5196   echo "configure: failed program was:" >&5
5197   cat conftest.$ac_ext >&5
5198   rm -rf conftest*
5199   eval "ac_cv_lib_$ac_lib_var=no"
5200 fi
5201 rm -f conftest*
5202 LIBS="$ac_save_LIBS"
5203
5204 fi
5205 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5206   echo "$ac_t""yes" 1>&6
5207     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5208     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5209   cat >> confdefs.h <<EOF
5210 #define $ac_tr_lib 1
5211 EOF
5212
5213   LIBS="-lnsl $LIBS"
5214
5215 else
5216   echo "$ac_t""no" 1>&6
5217 fi
5218
5219         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
5220 echo "configure:5221: checking for socket in -linet" >&5
5221 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
5222 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5223   echo $ac_n "(cached) $ac_c" 1>&6
5224 else
5225   ac_save_LIBS="$LIBS"
5226 LIBS="-linet  $LIBS"
5227 cat > conftest.$ac_ext <<EOF
5228 #line 5229 "configure"
5229 #include "confdefs.h"
5230 /* Override any gcc2 internal prototype to avoid an error.  */
5231 /* We use char because int might match the return type of a gcc2
5232     builtin and then its argument prototype would still apply.  */
5233 char socket();
5234
5235 int main() {
5236 socket()
5237 ; return 0; }
5238 EOF
5239 if { (eval echo configure:5240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5240   rm -rf conftest*
5241   eval "ac_cv_lib_$ac_lib_var=yes"
5242 else
5243   echo "configure: failed program was:" >&5
5244   cat conftest.$ac_ext >&5
5245   rm -rf conftest*
5246   eval "ac_cv_lib_$ac_lib_var=no"
5247 fi
5248 rm -f conftest*
5249 LIBS="$ac_save_LIBS"
5250
5251 fi
5252 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5253   echo "$ac_t""yes" 1>&6
5254     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5255     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5256   cat >> confdefs.h <<EOF
5257 #define $ac_tr_lib 1
5258 EOF
5259
5260   LIBS="-linet $LIBS"
5261
5262 else
5263   echo "$ac_t""no" 1>&6
5264 fi
5265
5266         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
5267 echo "configure:5268: checking for main in -lgen" >&5
5268 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
5269 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5270   echo $ac_n "(cached) $ac_c" 1>&6
5271 else
5272   ac_save_LIBS="$LIBS"
5273 LIBS="-lgen  $LIBS"
5274 cat > conftest.$ac_ext <<EOF
5275 #line 5276 "configure"
5276 #include "confdefs.h"
5277
5278 int main() {
5279 main()
5280 ; return 0; }
5281 EOF
5282 if { (eval echo configure:5283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5283   rm -rf conftest*
5284   eval "ac_cv_lib_$ac_lib_var=yes"
5285 else
5286   echo "configure: failed program was:" >&5
5287   cat conftest.$ac_ext >&5
5288   rm -rf conftest*
5289   eval "ac_cv_lib_$ac_lib_var=no"
5290 fi
5291 rm -f conftest*
5292 LIBS="$ac_save_LIBS"
5293
5294 fi
5295 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5296   echo "$ac_t""yes" 1>&6
5297     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5298     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5299   cat >> confdefs.h <<EOF
5300 #define $ac_tr_lib 1
5301 EOF
5302
5303   LIBS="-lgen $LIBS"
5304
5305 else
5306   echo "$ac_t""no" 1>&6
5307 fi
5308
5309
5310 fi
5311
5312
5313 echo $ac_n "checking for select""... $ac_c" 1>&6
5314 echo "configure:5315: checking for select" >&5
5315 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
5316   echo $ac_n "(cached) $ac_c" 1>&6
5317 else
5318   cat > conftest.$ac_ext <<EOF
5319 #line 5320 "configure"
5320 #include "confdefs.h"
5321 /* System header to define __stub macros and hopefully few prototypes,
5322     which can conflict with char select(); below.  */
5323 #include <assert.h>
5324 /* Override any gcc2 internal prototype to avoid an error.  */
5325 /* We use char because int might match the return type of a gcc2
5326     builtin and then its argument prototype would still apply.  */
5327 char select();
5328 char (*f)();
5329
5330 int main() {
5331
5332 /* The GNU C library defines this for functions which it implements
5333     to always fail with ENOSYS.  Some functions are actually named
5334     something starting with __ and the normal name is an alias.  */
5335 #if defined (__stub_select) || defined (__stub___select)
5336 choke me
5337 #else
5338 f = select;
5339 #endif
5340
5341 ; return 0; }
5342 EOF
5343 if { (eval echo configure:5344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5344   rm -rf conftest*
5345   eval "ac_cv_func_select=yes"
5346 else
5347   echo "configure: failed program was:" >&5
5348   cat conftest.$ac_ext >&5
5349   rm -rf conftest*
5350   eval "ac_cv_func_select=no"
5351 fi
5352 rm -f conftest*
5353 fi
5354
5355 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
5356   echo "$ac_t""yes" 1>&6
5357   :
5358 else
5359   echo "$ac_t""no" 1>&6
5360 { echo "configure: error: select() required." 1>&2; exit 1; }
5361 fi
5362
5363
5364 if test "${ac_cv_header_winsock_h}" != yes; then
5365                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
5366 echo "configure:5367: checking types of arguments for select()" >&5
5367  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
5368   echo $ac_n "(cached) $ac_c" 1>&6
5369 else
5370    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
5371   echo $ac_n "(cached) $ac_c" 1>&6
5372 else
5373     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
5374   echo $ac_n "(cached) $ac_c" 1>&6
5375 else
5376      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
5377      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
5378       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
5379        cat > conftest.$ac_ext <<EOF
5380 #line 5381 "configure"
5381 #include "confdefs.h"
5382 #ifdef HAVE_SYS_TYPES_H
5383 #include <sys/types.h>
5384 #endif
5385 #ifdef HAVE_SYS_TIME_H
5386 #include <sys/time.h>
5387 #endif
5388 #ifdef HAVE_SYS_SELECT_H
5389 #include <sys/select.h>
5390 #endif
5391 #ifdef HAVE_SYS_SOCKET_H
5392 #include <sys/socket.h>
5393 #endif
5394 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);
5395 int main() {
5396
5397 ; return 0; }
5398 EOF
5399 if { (eval echo configure:5400: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5400   rm -rf conftest*
5401           ac_not_found=no ; break 3
5402 else
5403   echo "configure: failed program was:" >&5
5404   cat conftest.$ac_ext >&5
5405   rm -rf conftest*
5406   ac_not_found=yes
5407 fi
5408 rm -f conftest*
5409       done
5410      done
5411     done
5412    
5413 fi
5414   
5415 fi
5416  
5417 fi
5418  if test "$ac_not_found" = yes; then
5419   ac_cv_func_select_arg1=int 
5420   ac_cv_func_select_arg234='int *' 
5421   ac_cv_func_select_arg5='struct timeval *'
5422  fi
5423  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
5424  cat >> confdefs.h <<EOF
5425 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
5426 EOF
5427
5428  cat >> confdefs.h <<EOF
5429 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
5430 EOF
5431
5432  cat >> confdefs.h <<EOF
5433 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
5434 EOF
5435
5436
5437 fi
5438
5439
5440 for ac_hdr in regex.h 
5441 do
5442 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5443 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5444 echo "configure:5445: checking for $ac_hdr" >&5
5445 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5446   echo $ac_n "(cached) $ac_c" 1>&6
5447 else
5448   cat > conftest.$ac_ext <<EOF
5449 #line 5450 "configure"
5450 #include "confdefs.h"
5451 #include <$ac_hdr>
5452 EOF
5453 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5454 { (eval echo configure:5455: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5455 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5456 if test -z "$ac_err"; then
5457   rm -rf conftest*
5458   eval "ac_cv_header_$ac_safe=yes"
5459 else
5460   echo "$ac_err" >&5
5461   echo "configure: failed program was:" >&5
5462   cat conftest.$ac_ext >&5
5463   rm -rf conftest*
5464   eval "ac_cv_header_$ac_safe=no"
5465 fi
5466 rm -f conftest*
5467 fi
5468 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5469   echo "$ac_t""yes" 1>&6
5470     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5471   cat >> confdefs.h <<EOF
5472 #define $ac_tr_hdr 1
5473 EOF
5474  
5475 else
5476   echo "$ac_t""no" 1>&6
5477 fi
5478 done
5479
5480 if test "$ac_cv_header_regex_h" != yes ; then
5481         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
5482 fi
5483 echo $ac_n "checking for regfree""... $ac_c" 1>&6
5484 echo "configure:5485: checking for regfree" >&5
5485 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
5486   echo $ac_n "(cached) $ac_c" 1>&6
5487 else
5488   cat > conftest.$ac_ext <<EOF
5489 #line 5490 "configure"
5490 #include "confdefs.h"
5491 /* System header to define __stub macros and hopefully few prototypes,
5492     which can conflict with char regfree(); below.  */
5493 #include <assert.h>
5494 /* Override any gcc2 internal prototype to avoid an error.  */
5495 /* We use char because int might match the return type of a gcc2
5496     builtin and then its argument prototype would still apply.  */
5497 char regfree();
5498 char (*f)();
5499
5500 int main() {
5501
5502 /* The GNU C library defines this for functions which it implements
5503     to always fail with ENOSYS.  Some functions are actually named
5504     something starting with __ and the normal name is an alias.  */
5505 #if defined (__stub_regfree) || defined (__stub___regfree)
5506 choke me
5507 #else
5508 f = regfree;
5509 #endif
5510
5511 ; return 0; }
5512 EOF
5513 if { (eval echo configure:5514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5514   rm -rf conftest*
5515   eval "ac_cv_func_regfree=yes"
5516 else
5517   echo "configure: failed program was:" >&5
5518   cat conftest.$ac_ext >&5
5519   rm -rf conftest*
5520   eval "ac_cv_func_regfree=no"
5521 fi
5522 rm -f conftest*
5523 fi
5524
5525 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
5526   echo "$ac_t""yes" 1>&6
5527   :
5528 else
5529   echo "$ac_t""no" 1>&6
5530 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
5531 fi
5532
5533
5534
5535 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
5536 echo "configure:5537: checking for compatible POSIX regex" >&5
5537 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
5538   echo $ac_n "(cached) $ac_c" 1>&6
5539 else
5540   
5541         if test "$cross_compiling" = yes; then
5542   ol_cv_c_posix_regex=cross
5543 else
5544   cat > conftest.$ac_ext <<EOF
5545 #line 5546 "configure"
5546 #include "confdefs.h"
5547
5548 #include <sys/types.h>
5549 #include <regex.h>
5550 static char *pattern, *string;
5551 main()
5552 {
5553         int rc;
5554         regex_t re;
5555
5556         pattern = "^A";
5557
5558         if(regcomp(&re, pattern, 0)) {
5559                 return -1;
5560         }
5561         
5562         string = "ALL MATCH";
5563         
5564         rc = regexec(&re, string, 0, (void*)0, 0);
5565
5566         regfree(&re);
5567
5568         return rc;
5569 }
5570 EOF
5571 if { (eval echo configure:5572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5572 then
5573   ol_cv_c_posix_regex=yes
5574 else
5575   echo "configure: failed program was:" >&5
5576   cat conftest.$ac_ext >&5
5577   rm -fr conftest*
5578   ol_cv_c_posix_regex=no
5579 fi
5580 rm -fr conftest*
5581 fi
5582
5583 fi
5584
5585 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5586
5587 if test "$ol_cv_c_posix_regex" = no ; then
5588         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5589 fi
5590
5591 echo $ac_n "checking for res_search""... $ac_c" 1>&6
5592 echo "configure:5593: checking for res_search" >&5
5593 if eval "test \"\${ac_cv_func_res_search+set}\" = set"; then
5594   echo $ac_n "(cached) $ac_c" 1>&6
5595 else
5596   cat > conftest.$ac_ext <<EOF
5597 #line 5598 "configure"
5598 #include "confdefs.h"
5599 /* System header to define __stub macros and hopefully few prototypes,
5600     which can conflict with char res_search(); below.  */
5601 #include <assert.h>
5602 /* Override any gcc2 internal prototype to avoid an error.  */
5603 /* We use char because int might match the return type of a gcc2
5604     builtin and then its argument prototype would still apply.  */
5605 char res_search();
5606 char (*f)();
5607
5608 int main() {
5609
5610 /* The GNU C library defines this for functions which it implements
5611     to always fail with ENOSYS.  Some functions are actually named
5612     something starting with __ and the normal name is an alias.  */
5613 #if defined (__stub_res_search) || defined (__stub___res_search)
5614 choke me
5615 #else
5616 f = res_search;
5617 #endif
5618
5619 ; return 0; }
5620 EOF
5621 if { (eval echo configure:5622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5622   rm -rf conftest*
5623   eval "ac_cv_func_res_search=yes"
5624 else
5625   echo "configure: failed program was:" >&5
5626   cat conftest.$ac_ext >&5
5627   rm -rf conftest*
5628   eval "ac_cv_func_res_search=no"
5629 fi
5630 rm -f conftest*
5631 fi
5632
5633 if eval "test \"`echo '$ac_cv_func_'res_search`\" = yes"; then
5634   echo "$ac_t""yes" 1>&6
5635   :
5636 else
5637   echo "$ac_t""no" 1>&6
5638 fi
5639
5640 if test $ac_cv_func_res_search = no ; then 
5641         echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
5642 echo "configure:5643: checking for res_search in -lbind" >&5
5643 ac_lib_var=`echo bind'_'res_search | sed 'y%./+-:%__p__%'`
5644 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5645   echo $ac_n "(cached) $ac_c" 1>&6
5646 else
5647   ac_save_LIBS="$LIBS"
5648 LIBS="-lbind  $LIBS"
5649 cat > conftest.$ac_ext <<EOF
5650 #line 5651 "configure"
5651 #include "confdefs.h"
5652 /* Override any gcc2 internal prototype to avoid an error.  */
5653 /* We use char because int might match the return type of a gcc2
5654     builtin and then its argument prototype would still apply.  */
5655 char res_search();
5656
5657 int main() {
5658 res_search()
5659 ; return 0; }
5660 EOF
5661 if { (eval echo configure:5662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5662   rm -rf conftest*
5663   eval "ac_cv_lib_$ac_lib_var=yes"
5664 else
5665   echo "configure: failed program was:" >&5
5666   cat conftest.$ac_ext >&5
5667   rm -rf conftest*
5668   eval "ac_cv_lib_$ac_lib_var=no"
5669 fi
5670 rm -f conftest*
5671 LIBS="$ac_save_LIBS"
5672
5673 fi
5674 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5675   echo "$ac_t""yes" 1>&6
5676     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5677     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5678   cat >> confdefs.h <<EOF
5679 #define $ac_tr_lib 1
5680 EOF
5681
5682   LIBS="-lbind $LIBS"
5683
5684 else
5685   echo "$ac_t""no" 1>&6
5686 fi
5687
5688         ac_cv_func_res_search=$ac_cv_lib_bind_res_search
5689 fi
5690
5691 if test $ac_cv_func_res_search = no ; then 
5692         echo $ac_n "checking for __res_search in -lbind""... $ac_c" 1>&6
5693 echo "configure:5694: checking for __res_search in -lbind" >&5
5694 ac_lib_var=`echo bind'_'__res_search | sed 'y%./+-:%__p__%'`
5695 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5696   echo $ac_n "(cached) $ac_c" 1>&6
5697 else
5698   ac_save_LIBS="$LIBS"
5699 LIBS="-lbind  $LIBS"
5700 cat > conftest.$ac_ext <<EOF
5701 #line 5702 "configure"
5702 #include "confdefs.h"
5703 /* Override any gcc2 internal prototype to avoid an error.  */
5704 /* We use char because int might match the return type of a gcc2
5705     builtin and then its argument prototype would still apply.  */
5706 char __res_search();
5707
5708 int main() {
5709 __res_search()
5710 ; return 0; }
5711 EOF
5712 if { (eval echo configure:5713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5713   rm -rf conftest*
5714   eval "ac_cv_lib_$ac_lib_var=yes"
5715 else
5716   echo "configure: failed program was:" >&5
5717   cat conftest.$ac_ext >&5
5718   rm -rf conftest*
5719   eval "ac_cv_lib_$ac_lib_var=no"
5720 fi
5721 rm -f conftest*
5722 LIBS="$ac_save_LIBS"
5723
5724 fi
5725 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5726   echo "$ac_t""yes" 1>&6
5727     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5728     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5729   cat >> confdefs.h <<EOF
5730 #define $ac_tr_lib 1
5731 EOF
5732
5733   LIBS="-lbind $LIBS"
5734
5735 else
5736   echo "$ac_t""no" 1>&6
5737 fi
5738
5739         ac_cv_func_res_search=$ac_cv_lib_bind___res_search
5740 fi
5741
5742 if test $ac_cv_func_res_search = no ; then 
5743         echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
5744 echo "configure:5745: checking for res_search in -lresolv" >&5
5745 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-:%__p__%'`
5746 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5747   echo $ac_n "(cached) $ac_c" 1>&6
5748 else
5749   ac_save_LIBS="$LIBS"
5750 LIBS="-lresolv  $LIBS"
5751 cat > conftest.$ac_ext <<EOF
5752 #line 5753 "configure"
5753 #include "confdefs.h"
5754 /* Override any gcc2 internal prototype to avoid an error.  */
5755 /* We use char because int might match the return type of a gcc2
5756     builtin and then its argument prototype would still apply.  */
5757 char res_search();
5758
5759 int main() {
5760 res_search()
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_lib_$ac_lib_var=yes"
5766 else
5767   echo "configure: failed program was:" >&5
5768   cat conftest.$ac_ext >&5
5769   rm -rf conftest*
5770   eval "ac_cv_lib_$ac_lib_var=no"
5771 fi
5772 rm -f conftest*
5773 LIBS="$ac_save_LIBS"
5774
5775 fi
5776 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5777   echo "$ac_t""yes" 1>&6
5778     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5779     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5780   cat >> confdefs.h <<EOF
5781 #define $ac_tr_lib 1
5782 EOF
5783
5784   LIBS="-lresolv $LIBS"
5785
5786 else
5787   echo "$ac_t""no" 1>&6
5788 fi
5789
5790         ac_cv_func_res_search=$ac_cv_lib_resolv_res_search
5791 fi
5792
5793 if test "$ac_cv_func_res_search" = yes ; then
5794         cat >> confdefs.h <<\EOF
5795 #define HAVE_RES_SEARCH 1
5796 EOF
5797
5798 elif test $ol_enable_dns = yes ; then
5799         { echo "configure: error: --enable-dns requires res_search" 1>&2; exit 1; }
5800 elif test $ol_enable_dns != no ; then
5801         echo "configure: warning: no res_search, disabling DNS support" 1>&2
5802 fi
5803
5804
5805 ol_link_isode=no
5806 if test $ol_enable_ldapd != no ; then
5807         echo "configure: warning: ldapd is not supported and may suffer from bit rot." 1>&2
5808
5809                 echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
5810 echo "configure:5811: checking for main in -lxtpp" >&5
5811 ac_lib_var=`echo xtpp'_'main | sed 'y%./+-:%__p__%'`
5812 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5813   echo $ac_n "(cached) $ac_c" 1>&6
5814 else
5815   ac_save_LIBS="$LIBS"
5816 LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
5817 cat > conftest.$ac_ext <<EOF
5818 #line 5819 "configure"
5819 #include "confdefs.h"
5820
5821 int main() {
5822 main()
5823 ; return 0; }
5824 EOF
5825 if { (eval echo configure:5826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5826   rm -rf conftest*
5827   eval "ac_cv_lib_$ac_lib_var=yes"
5828 else
5829   echo "configure: failed program was:" >&5
5830   cat conftest.$ac_ext >&5
5831   rm -rf conftest*
5832   eval "ac_cv_lib_$ac_lib_var=no"
5833 fi
5834 rm -f conftest*
5835 LIBS="$ac_save_LIBS"
5836
5837 fi
5838 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5839   echo "$ac_t""yes" 1>&6
5840   
5841                 ol_link_isode=yes
5842                 cat >> confdefs.h <<\EOF
5843 #define HAVE_XTPP 1
5844 EOF
5845
5846                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
5847                 
5848 else
5849   echo "$ac_t""no" 1>&6
5850 :
5851 fi
5852
5853         echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
5854 echo "configure:5855: checking for main in -ldsap" >&5
5855 ac_lib_var=`echo dsap'_'main | sed 'y%./+-:%__p__%'`
5856 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5857   echo $ac_n "(cached) $ac_c" 1>&6
5858 else
5859   ac_save_LIBS="$LIBS"
5860 LIBS="-ldsap -lisode $LIBS"
5861 cat > conftest.$ac_ext <<EOF
5862 #line 5863 "configure"
5863 #include "confdefs.h"
5864
5865 int main() {
5866 main()
5867 ; return 0; }
5868 EOF
5869 if { (eval echo configure:5870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5870   rm -rf conftest*
5871   eval "ac_cv_lib_$ac_lib_var=yes"
5872 else
5873   echo "configure: failed program was:" >&5
5874   cat conftest.$ac_ext >&5
5875   rm -rf conftest*
5876   eval "ac_cv_lib_$ac_lib_var=no"
5877 fi
5878 rm -f conftest*
5879 LIBS="$ac_save_LIBS"
5880
5881 fi
5882 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5883   echo "$ac_t""yes" 1>&6
5884   
5885                 ol_link_isode=yes
5886                 cat >> confdefs.h <<\EOF
5887 #define HAVE_DSAP 1
5888 EOF
5889
5890                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
5891                 
5892 else
5893   echo "$ac_t""no" 1>&6
5894 :
5895 fi
5896
5897         echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
5898 echo "configure:5899: checking for main in -lisode" >&5
5899 ac_lib_var=`echo isode'_'main | sed 'y%./+-:%__p__%'`
5900 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5901   echo $ac_n "(cached) $ac_c" 1>&6
5902 else
5903   ac_save_LIBS="$LIBS"
5904 LIBS="-lisode  $LIBS"
5905 cat > conftest.$ac_ext <<EOF
5906 #line 5907 "configure"
5907 #include "confdefs.h"
5908
5909 int main() {
5910 main()
5911 ; return 0; }
5912 EOF
5913 if { (eval echo configure:5914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5914   rm -rf conftest*
5915   eval "ac_cv_lib_$ac_lib_var=yes"
5916 else
5917   echo "configure: failed program was:" >&5
5918   cat conftest.$ac_ext >&5
5919   rm -rf conftest*
5920   eval "ac_cv_lib_$ac_lib_var=no"
5921 fi
5922 rm -f conftest*
5923 LIBS="$ac_save_LIBS"
5924
5925 fi
5926 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5927   echo "$ac_t""yes" 1>&6
5928   
5929                 ol_link_isode=yes
5930                 cat >> confdefs.h <<\EOF
5931 #define HAVE_ISODE 1
5932 EOF
5933
5934                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
5935                 
5936 else
5937   echo "$ac_t""no" 1>&6
5938 :
5939 fi
5940
5941 fi
5942
5943 if test $ol_link_isode != no; then
5944         echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
5945 echo "configure:5946: checking for main in -lpp" >&5
5946 ac_lib_var=`echo pp'_'main | sed 'y%./+-:%__p__%'`
5947 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5948   echo $ac_n "(cached) $ac_c" 1>&6
5949 else
5950   ac_save_LIBS="$LIBS"
5951 LIBS="-lpp  $LIBS"
5952 cat > conftest.$ac_ext <<EOF
5953 #line 5954 "configure"
5954 #include "confdefs.h"
5955
5956 int main() {
5957 main()
5958 ; return 0; }
5959 EOF
5960 if { (eval echo configure:5961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5961   rm -rf conftest*
5962   eval "ac_cv_lib_$ac_lib_var=yes"
5963 else
5964   echo "configure: failed program was:" >&5
5965   cat conftest.$ac_ext >&5
5966   rm -rf conftest*
5967   eval "ac_cv_lib_$ac_lib_var=no"
5968 fi
5969 rm -f conftest*
5970 LIBS="$ac_save_LIBS"
5971
5972 fi
5973 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5974   echo "$ac_t""yes" 1>&6
5975   
5976                 cat >> confdefs.h <<\EOF
5977 #define HAVE_PP 1
5978 EOF
5979
5980                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
5981                 
5982 else
5983   echo "$ac_t""no" 1>&6
5984 :
5985 fi
5986
5987
5988         # Extract the first word of "pepsy", so it can be a program name with args.
5989 set dummy pepsy; ac_word=$2
5990 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
5991 echo "configure:5992: checking for $ac_word" >&5
5992 if eval "test \"\${ac_cv_path_PEPSY+set}\" = set"; then
5993   echo $ac_n "(cached) $ac_c" 1>&6
5994 else
5995   case "$PEPSY" in
5996   /*)
5997   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a path.
5998   ;;
5999   ?:/*)
6000   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a dos path.
6001   ;;
6002   *)
6003   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
6004   ac_dummy="$PATH"
6005   for ac_dir in $ac_dummy; do 
6006     test -z "$ac_dir" && ac_dir=.
6007     if test -f $ac_dir/$ac_word; then
6008       ac_cv_path_PEPSY="$ac_dir/$ac_word"
6009       break
6010     fi
6011   done
6012   IFS="$ac_save_ifs"
6013   ;;
6014 esac
6015 fi
6016 PEPSY="$ac_cv_path_PEPSY"
6017 if test -n "$PEPSY"; then
6018   echo "$ac_t""$PEPSY" 1>&6
6019 else
6020   echo "$ac_t""no" 1>&6
6021 fi
6022
6023 fi
6024
6025 if test $ol_enable_quipu != no ; then
6026         for ac_hdr in quipu/commonarg.h
6027 do
6028 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6029 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6030 echo "configure:6031: checking for $ac_hdr" >&5
6031 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6032   echo $ac_n "(cached) $ac_c" 1>&6
6033 else
6034   cat > conftest.$ac_ext <<EOF
6035 #line 6036 "configure"
6036 #include "confdefs.h"
6037 #include <$ac_hdr>
6038 EOF
6039 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6040 { (eval echo configure:6041: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6041 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6042 if test -z "$ac_err"; then
6043   rm -rf conftest*
6044   eval "ac_cv_header_$ac_safe=yes"
6045 else
6046   echo "$ac_err" >&5
6047   echo "configure: failed program was:" >&5
6048   cat conftest.$ac_ext >&5
6049   rm -rf conftest*
6050   eval "ac_cv_header_$ac_safe=no"
6051 fi
6052 rm -f conftest*
6053 fi
6054 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6055   echo "$ac_t""yes" 1>&6
6056     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6057   cat >> confdefs.h <<EOF
6058 #define $ac_tr_hdr 1
6059 EOF
6060  
6061 else
6062   echo "$ac_t""no" 1>&6
6063 fi
6064 done
6065
6066
6067         if test $ac_cv_header_quipu_commonarg_h = yes ; then
6068                 BUILD_QUIPU=yes
6069         elif test $ol_enable_quipu = auto ; then
6070                 echo "configure: warning: no quipu for --enable-quipu=auto, disabling" 1>&2
6071         else
6072                 { echo "configure: error: no quipu for --enable-quipu=$ol_enable_quipu" 1>&2; exit 1; }
6073         fi
6074 fi
6075
6076 ol_link_kbind=no
6077 ol_link_kpasswd=no
6078 ol_link_krb5=no
6079 ol_link_krb4=no
6080
6081 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 \
6082         -o $ol_with_kerberos = k5only -o $ol_with_kerberos = k425 ; then
6083
6084         for ac_hdr in krb5.h
6085 do
6086 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6087 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6088 echo "configure:6089: checking for $ac_hdr" >&5
6089 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6090   echo $ac_n "(cached) $ac_c" 1>&6
6091 else
6092   cat > conftest.$ac_ext <<EOF
6093 #line 6094 "configure"
6094 #include "confdefs.h"
6095 #include <$ac_hdr>
6096 EOF
6097 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6098 { (eval echo configure:6099: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6099 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6100 if test -z "$ac_err"; then
6101   rm -rf conftest*
6102   eval "ac_cv_header_$ac_safe=yes"
6103 else
6104   echo "$ac_err" >&5
6105   echo "configure: failed program was:" >&5
6106   cat conftest.$ac_ext >&5
6107   rm -rf conftest*
6108   eval "ac_cv_header_$ac_safe=no"
6109 fi
6110 rm -f conftest*
6111 fi
6112 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6113   echo "$ac_t""yes" 1>&6
6114     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6115   cat >> confdefs.h <<EOF
6116 #define $ac_tr_hdr 1
6117 EOF
6118  
6119 else
6120   echo "$ac_t""no" 1>&6
6121 fi
6122 done
6123
6124
6125         if test $ac_cv_header_krb5_h = yes ; then
6126                                 for ac_hdr in heim_err.h
6127 do
6128 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6129 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6130 echo "configure:6131: checking for $ac_hdr" >&5
6131 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6132   echo $ac_n "(cached) $ac_c" 1>&6
6133 else
6134   cat > conftest.$ac_ext <<EOF
6135 #line 6136 "configure"
6136 #include "confdefs.h"
6137 #include <$ac_hdr>
6138 EOF
6139 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6140 { (eval echo configure:6141: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6141 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6142 if test -z "$ac_err"; then
6143   rm -rf conftest*
6144   eval "ac_cv_header_$ac_safe=yes"
6145 else
6146   echo "$ac_err" >&5
6147   echo "configure: failed program was:" >&5
6148   cat conftest.$ac_ext >&5
6149   rm -rf conftest*
6150   eval "ac_cv_header_$ac_safe=no"
6151 fi
6152 rm -f conftest*
6153 fi
6154 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6155   echo "$ac_t""yes" 1>&6
6156     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6157   cat >> confdefs.h <<EOF
6158 #define $ac_tr_hdr 1
6159 EOF
6160  
6161 else
6162   echo "$ac_t""no" 1>&6
6163 fi
6164 done
6165
6166                 if test $ac_cv_header_heim_err_h = yes ; then
6167                         krb5_impl=heimdal
6168                 else
6169                         krb5_impl=mit
6170                 fi
6171
6172                 if test $krb5_impl = mit; then
6173                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6174 echo "configure:6175: checking for main in -lkrb5" >&5
6175 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6176 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6177   echo $ac_n "(cached) $ac_c" 1>&6
6178 else
6179   ac_save_LIBS="$LIBS"
6180 LIBS="-lkrb5 -lcrypto -lcom_err $LIBS"
6181 cat > conftest.$ac_ext <<EOF
6182 #line 6183 "configure"
6183 #include "confdefs.h"
6184
6185 int main() {
6186 main()
6187 ; return 0; }
6188 EOF
6189 if { (eval echo configure:6190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6190   rm -rf conftest*
6191   eval "ac_cv_lib_$ac_lib_var=yes"
6192 else
6193   echo "configure: failed program was:" >&5
6194   cat conftest.$ac_ext >&5
6195   rm -rf conftest*
6196   eval "ac_cv_lib_$ac_lib_var=no"
6197 fi
6198 rm -f conftest*
6199 LIBS="$ac_save_LIBS"
6200
6201 fi
6202 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6203   echo "$ac_t""yes" 1>&6
6204   have_krb5=yes
6205                                 KRB5_LIBS="-lkrb5 -lcrypto -lcom_err"
6206 else
6207   echo "$ac_t""no" 1>&6
6208 have_krb5=no
6209 fi
6210
6211
6212                 elif test $krb5_impl = heimdal; then
6213                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6214 echo "configure:6215: checking for main in -lkrb5" >&5
6215 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6216 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6217   echo $ac_n "(cached) $ac_c" 1>&6
6218 else
6219   ac_save_LIBS="$LIBS"
6220 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6221 cat > conftest.$ac_ext <<EOF
6222 #line 6223 "configure"
6223 #include "confdefs.h"
6224
6225 int main() {
6226 main()
6227 ; return 0; }
6228 EOF
6229 if { (eval echo configure:6230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6230   rm -rf conftest*
6231   eval "ac_cv_lib_$ac_lib_var=yes"
6232 else
6233   echo "configure: failed program was:" >&5
6234   cat conftest.$ac_ext >&5
6235   rm -rf conftest*
6236   eval "ac_cv_lib_$ac_lib_var=no"
6237 fi
6238 rm -f conftest*
6239 LIBS="$ac_save_LIBS"
6240
6241 fi
6242 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6243   echo "$ac_t""yes" 1>&6
6244   have_krb5=yes
6245                                 KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
6246 else
6247   echo "$ac_t""no" 1>&6
6248 have_krb5=no
6249 fi
6250
6251
6252                         cat >> confdefs.h <<\EOF
6253 #define HAVE_HEIMDAL_KERBEROS 1
6254 EOF
6255
6256                 else
6257                         have_krb5=no
6258                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
6259                 fi
6260
6261                 if test $have_krb5 = yes ; then
6262                         ol_link_krb5=yes
6263
6264                         cat >> confdefs.h <<\EOF
6265 #define HAVE_KRB5 1
6266 EOF
6267
6268
6269                         if test $ol_enable_kpasswd != no ; then
6270                                 ol_link_kpasswd=yes;
6271                         fi
6272
6273                         if test $ol_with_kerberos = k5only ; then
6274                                 ol_with_kerberos=found
6275                         fi
6276
6277                 elif test $ol_with_kerberos != auto ; then
6278                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
6279                 fi
6280
6281         fi
6282 fi
6283
6284 if test $ol_link_krb5 = yes -a \
6285         \( $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
6286
6287         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
6288 do
6289 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6290 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6291 echo "configure:6292: checking for $ac_hdr" >&5
6292 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6293   echo $ac_n "(cached) $ac_c" 1>&6
6294 else
6295   cat > conftest.$ac_ext <<EOF
6296 #line 6297 "configure"
6297 #include "confdefs.h"
6298 #include <$ac_hdr>
6299 EOF
6300 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6301 { (eval echo configure:6302: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6302 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6303 if test -z "$ac_err"; then
6304   rm -rf conftest*
6305   eval "ac_cv_header_$ac_safe=yes"
6306 else
6307   echo "$ac_err" >&5
6308   echo "configure: failed program was:" >&5
6309   cat conftest.$ac_ext >&5
6310   rm -rf conftest*
6311   eval "ac_cv_header_$ac_safe=no"
6312 fi
6313 rm -f conftest*
6314 fi
6315 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6316   echo "$ac_t""yes" 1>&6
6317     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6318   cat >> confdefs.h <<EOF
6319 #define $ac_tr_hdr 1
6320 EOF
6321  
6322 else
6323   echo "$ac_t""no" 1>&6
6324 fi
6325 done
6326
6327
6328         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
6329                 if test $krb5_impl = mit; then
6330                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6331 echo "configure:6332: checking for main in -lkrb4" >&5
6332 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6333 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6334   echo $ac_n "(cached) $ac_c" 1>&6
6335 else
6336   ac_save_LIBS="$LIBS"
6337 LIBS="-lkrb4 -ldes425 -lkrb5 -lcrypto -lcom_err $LIBS"
6338 cat > conftest.$ac_ext <<EOF
6339 #line 6340 "configure"
6340 #include "confdefs.h"
6341
6342 int main() {
6343 main()
6344 ; return 0; }
6345 EOF
6346 if { (eval echo configure:6347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6347   rm -rf conftest*
6348   eval "ac_cv_lib_$ac_lib_var=yes"
6349 else
6350   echo "configure: failed program was:" >&5
6351   cat conftest.$ac_ext >&5
6352   rm -rf conftest*
6353   eval "ac_cv_lib_$ac_lib_var=no"
6354 fi
6355 rm -f conftest*
6356 LIBS="$ac_save_LIBS"
6357
6358 fi
6359 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6360   echo "$ac_t""yes" 1>&6
6361   have_k425=yes
6362                                 KRB4_LIBS="-lkrb4 -ldes425"
6363 else
6364   echo "$ac_t""no" 1>&6
6365 have_k425=no
6366 fi
6367
6368
6369                 elif test $krb5_impl = heimdal; then
6370                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6371 echo "configure:6372: checking for main in -lkrb4" >&5
6372 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6373 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6374   echo $ac_n "(cached) $ac_c" 1>&6
6375 else
6376   ac_save_LIBS="$LIBS"
6377 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6378 cat > conftest.$ac_ext <<EOF
6379 #line 6380 "configure"
6380 #include "confdefs.h"
6381
6382 int main() {
6383 main()
6384 ; return 0; }
6385 EOF
6386 if { (eval echo configure:6387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6387   rm -rf conftest*
6388   eval "ac_cv_lib_$ac_lib_var=yes"
6389 else
6390   echo "configure: failed program was:" >&5
6391   cat conftest.$ac_ext >&5
6392   rm -rf conftest*
6393   eval "ac_cv_lib_$ac_lib_var=no"
6394 fi
6395 rm -f conftest*
6396 LIBS="$ac_save_LIBS"
6397
6398 fi
6399 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6400   echo "$ac_t""yes" 1>&6
6401   have_k425=yes
6402                                 KRB4_LIBS="-lkrb4"
6403 else
6404   echo "$ac_t""no" 1>&6
6405 have_k425=no
6406 fi
6407
6408
6409                 else
6410                         have_425=no
6411                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
6412                 fi
6413
6414                 if test $have_k425 = yes ; then
6415                         ol_with_kerberos=found
6416                         ol_link_krb4=yes
6417
6418                         cat >> confdefs.h <<\EOF
6419 #define HAVE_KRB425 1
6420 EOF
6421
6422                         cat >> confdefs.h <<\EOF
6423 #define HAVE_KRB4 1
6424 EOF
6425
6426
6427                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
6428 echo "configure:6429: checking for des_debug in Kerberos libraries" >&5
6429 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
6430   echo $ac_n "(cached) $ac_c" 1>&6
6431 else
6432   
6433                                                                 save_LIBS="$LIBS"
6434                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
6435                                 cat > conftest.$ac_ext <<EOF
6436 #line 6437 "configure"
6437 #include "confdefs.h"
6438
6439 #include <kerberosIV/krb.h>
6440 #include <kerberosIV/des.h>
6441 extern int des_debug;
6442
6443 int main() {
6444
6445 des_debug = 1;
6446
6447 ; return 0; }
6448 EOF
6449 if { (eval echo configure:6450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6450   rm -rf conftest*
6451   ol_cv_var_des_debug=yes
6452 else
6453   echo "configure: failed program was:" >&5
6454   cat conftest.$ac_ext >&5
6455   rm -rf conftest*
6456   ol_cv_var_des_debug=no
6457 fi
6458 rm -f conftest*
6459                                                                 LIBS="$save_LIBS"
6460                         
6461 fi
6462
6463 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
6464
6465                         if test $ol_cv_var_des_debug = yes ; then
6466                                 cat >> confdefs.h <<\EOF
6467 #define HAVE_DES_DEBUG 1
6468 EOF
6469
6470                         fi
6471
6472                         LIBS="$save_LIBS"
6473                 fi
6474         fi
6475 fi
6476
6477 if test $ol_link_krb5 = yes ; then
6478         ol_with_kerberos=found
6479 fi
6480
6481 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 \
6482         -o $ol_with_kerberos = kth ; then
6483
6484         for ac_hdr in krb.h des.h krb-archaeology.h 
6485 do
6486 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6487 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6488 echo "configure:6489: checking for $ac_hdr" >&5
6489 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6490   echo $ac_n "(cached) $ac_c" 1>&6
6491 else
6492   cat > conftest.$ac_ext <<EOF
6493 #line 6494 "configure"
6494 #include "confdefs.h"
6495 #include <$ac_hdr>
6496 EOF
6497 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6498 { (eval echo configure:6499: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6499 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6500 if test -z "$ac_err"; then
6501   rm -rf conftest*
6502   eval "ac_cv_header_$ac_safe=yes"
6503 else
6504   echo "$ac_err" >&5
6505   echo "configure: failed program was:" >&5
6506   cat conftest.$ac_ext >&5
6507   rm -rf conftest*
6508   eval "ac_cv_header_$ac_safe=no"
6509 fi
6510 rm -f conftest*
6511 fi
6512 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6513   echo "$ac_t""yes" 1>&6
6514     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6515   cat >> confdefs.h <<EOF
6516 #define $ac_tr_hdr 1
6517 EOF
6518  
6519 else
6520   echo "$ac_t""no" 1>&6
6521 fi
6522 done
6523
6524
6525         if test $ac_cv_header_krb_h = yes ; then
6526                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
6527 echo "configure:6528: checking for main in -lkrb" >&5
6528 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
6529 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6530   echo $ac_n "(cached) $ac_c" 1>&6
6531 else
6532   ac_save_LIBS="$LIBS"
6533 LIBS="-lkrb -ldes $LIBS"
6534 cat > conftest.$ac_ext <<EOF
6535 #line 6536 "configure"
6536 #include "confdefs.h"
6537
6538 int main() {
6539 main()
6540 ; return 0; }
6541 EOF
6542 if { (eval echo configure:6543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6543   rm -rf conftest*
6544   eval "ac_cv_lib_$ac_lib_var=yes"
6545 else
6546   echo "configure: failed program was:" >&5
6547   cat conftest.$ac_ext >&5
6548   rm -rf conftest*
6549   eval "ac_cv_lib_$ac_lib_var=no"
6550 fi
6551 rm -f conftest*
6552 LIBS="$ac_save_LIBS"
6553
6554 fi
6555 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6556   echo "$ac_t""yes" 1>&6
6557   have_k4=yes
6558 else
6559   echo "$ac_t""no" 1>&6
6560 have_k4=no
6561 fi
6562
6563
6564                 if test $have_k4 = yes ; then
6565                         ol_with_kerberos=found
6566                         ol_link_krb4=yes
6567
6568                         cat >> confdefs.h <<\EOF
6569 #define HAVE_KRB4 1
6570 EOF
6571
6572
6573                         KRB4_LIBS="-lkrb -ldes"
6574
6575                         if test $ac_cv_header_krb_archaeology_h = yes ; then
6576                                 cat >> confdefs.h <<\EOF
6577 #define HAVE_KTH_KERBEROS 1
6578 EOF
6579
6580                         fi
6581                 fi
6582         fi
6583 fi
6584
6585 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
6586         ol_link_kpasswd=yes;
6587 fi
6588
6589 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
6590         cat >> confdefs.h <<\EOF
6591 #define HAVE_KERBEROS 1
6592 EOF
6593
6594
6595 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
6596         { echo "configure: error: Kerberos detection failed." 1>&2; exit 1; }
6597 fi
6598
6599 ol_link_tls=no
6600 if test $ol_with_tls != no ; then
6601         
6602         for ac_hdr in openssl/ssl.h ssl.h
6603 do
6604 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6605 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6606 echo "configure:6607: checking for $ac_hdr" >&5
6607 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6608   echo $ac_n "(cached) $ac_c" 1>&6
6609 else
6610   cat > conftest.$ac_ext <<EOF
6611 #line 6612 "configure"
6612 #include "confdefs.h"
6613 #include <$ac_hdr>
6614 EOF
6615 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6616 { (eval echo configure:6617: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6617 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6618 if test -z "$ac_err"; then
6619   rm -rf conftest*
6620   eval "ac_cv_header_$ac_safe=yes"
6621 else
6622   echo "$ac_err" >&5
6623   echo "configure: failed program was:" >&5
6624   cat conftest.$ac_ext >&5
6625   rm -rf conftest*
6626   eval "ac_cv_header_$ac_safe=no"
6627 fi
6628 rm -f conftest*
6629 fi
6630 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6631   echo "$ac_t""yes" 1>&6
6632     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6633   cat >> confdefs.h <<EOF
6634 #define $ac_tr_hdr 1
6635 EOF
6636  
6637 else
6638   echo "$ac_t""no" 1>&6
6639 fi
6640 done
6641
6642         
6643         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
6644                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
6645 echo "configure:6646: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
6646 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
6647 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6648   echo $ac_n "(cached) $ac_c" 1>&6
6649 else
6650   ac_save_LIBS="$LIBS"
6651 LIBS="-lssl -lcrypto $LIBS"
6652 cat > conftest.$ac_ext <<EOF
6653 #line 6654 "configure"
6654 #include "confdefs.h"
6655 /* Override any gcc2 internal prototype to avoid an error.  */
6656 /* We use char because int might match the return type of a gcc2
6657     builtin and then its argument prototype would still apply.  */
6658 char SSLeay_add_ssl_algorithms();
6659
6660 int main() {
6661 SSLeay_add_ssl_algorithms()
6662 ; return 0; }
6663 EOF
6664 if { (eval echo configure:6665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6665   rm -rf conftest*
6666   eval "ac_cv_lib_$ac_lib_var=yes"
6667 else
6668   echo "configure: failed program was:" >&5
6669   cat conftest.$ac_ext >&5
6670   rm -rf conftest*
6671   eval "ac_cv_lib_$ac_lib_var=no"
6672 fi
6673 rm -f conftest*
6674 LIBS="$ac_save_LIBS"
6675
6676 fi
6677 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6678   echo "$ac_t""yes" 1>&6
6679   have_ssleay=yes
6680                         need_rsaref=no
6681 else
6682   echo "$ac_t""no" 1>&6
6683 have_ssleay=no
6684 fi
6685
6686                         
6687                 if test $have_ssleay = no ; then
6688                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
6689 echo "configure:6690: checking for SSL_library_init in -lssl" >&5
6690 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
6691 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6692   echo $ac_n "(cached) $ac_c" 1>&6
6693 else
6694   ac_save_LIBS="$LIBS"
6695 LIBS="-lssl -lcrypto $LIBS"
6696 cat > conftest.$ac_ext <<EOF
6697 #line 6698 "configure"
6698 #include "confdefs.h"
6699 /* Override any gcc2 internal prototype to avoid an error.  */
6700 /* We use char because int might match the return type of a gcc2
6701     builtin and then its argument prototype would still apply.  */
6702 char SSL_library_init();
6703
6704 int main() {
6705 SSL_library_init()
6706 ; return 0; }
6707 EOF
6708 if { (eval echo configure:6709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6709   rm -rf conftest*
6710   eval "ac_cv_lib_$ac_lib_var=yes"
6711 else
6712   echo "configure: failed program was:" >&5
6713   cat conftest.$ac_ext >&5
6714   rm -rf conftest*
6715   eval "ac_cv_lib_$ac_lib_var=no"
6716 fi
6717 rm -f conftest*
6718 LIBS="$ac_save_LIBS"
6719
6720 fi
6721 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6722   echo "$ac_t""yes" 1>&6
6723   have_ssleay=yes
6724                                 need_rsaref=no
6725 else
6726   echo "$ac_t""no" 1>&6
6727 have_ssleay=no
6728 fi
6729
6730                 fi
6731
6732                 if test $have_ssleay = no ; then
6733                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
6734 echo "configure:6735: checking for ssl3_accept in -lssl" >&5
6735 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
6736 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6737   echo $ac_n "(cached) $ac_c" 1>&6
6738 else
6739   ac_save_LIBS="$LIBS"
6740 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
6741 cat > conftest.$ac_ext <<EOF
6742 #line 6743 "configure"
6743 #include "confdefs.h"
6744 /* Override any gcc2 internal prototype to avoid an error.  */
6745 /* We use char because int might match the return type of a gcc2
6746     builtin and then its argument prototype would still apply.  */
6747 char ssl3_accept();
6748
6749 int main() {
6750 ssl3_accept()
6751 ; return 0; }
6752 EOF
6753 if { (eval echo configure:6754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6754   rm -rf conftest*
6755   eval "ac_cv_lib_$ac_lib_var=yes"
6756 else
6757   echo "configure: failed program was:" >&5
6758   cat conftest.$ac_ext >&5
6759   rm -rf conftest*
6760   eval "ac_cv_lib_$ac_lib_var=no"
6761 fi
6762 rm -f conftest*
6763 LIBS="$ac_save_LIBS"
6764
6765 fi
6766 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6767   echo "$ac_t""yes" 1>&6
6768   have_ssleay=yes
6769                                 need_rsaref=yes
6770 else
6771   echo "$ac_t""no" 1>&6
6772 have_ssleay=no
6773 fi
6774
6775                 fi
6776
6777                 if test $have_ssleay = yes ; then
6778                         ol_with_tls=found
6779                         ol_link_tls=yes
6780
6781                         cat >> confdefs.h <<\EOF
6782 #define HAVE_SSLEAY 1
6783 EOF
6784
6785
6786                         if test $need_rsaref = yes; then
6787                                 cat >> confdefs.h <<\EOF
6788 #define HAVE_RSAREF 1
6789 EOF
6790
6791
6792                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
6793                         else
6794                                 TLS_LIBS="-lssl -lcrypto"
6795                         fi
6796                 fi
6797         fi
6798 fi
6799
6800 if test $ol_link_tls = yes ; then
6801         cat >> confdefs.h <<\EOF
6802 #define HAVE_TLS 1
6803 EOF
6804
6805 fi      
6806
6807 for ac_func in \
6808         ctime_r                 \
6809         gethostbyname_r gethostbyaddr_r \
6810
6811 do
6812 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6813 echo "configure:6814: checking for $ac_func" >&5
6814 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6815   echo $ac_n "(cached) $ac_c" 1>&6
6816 else
6817   cat > conftest.$ac_ext <<EOF
6818 #line 6819 "configure"
6819 #include "confdefs.h"
6820 /* System header to define __stub macros and hopefully few prototypes,
6821     which can conflict with char $ac_func(); below.  */
6822 #include <assert.h>
6823 /* Override any gcc2 internal prototype to avoid an error.  */
6824 /* We use char because int might match the return type of a gcc2
6825     builtin and then its argument prototype would still apply.  */
6826 char $ac_func();
6827 char (*f)();
6828
6829 int main() {
6830
6831 /* The GNU C library defines this for functions which it implements
6832     to always fail with ENOSYS.  Some functions are actually named
6833     something starting with __ and the normal name is an alias.  */
6834 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6835 choke me
6836 #else
6837 f = $ac_func;
6838 #endif
6839
6840 ; return 0; }
6841 EOF
6842 if { (eval echo configure:6843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6843   rm -rf conftest*
6844   eval "ac_cv_func_$ac_func=yes"
6845 else
6846   echo "configure: failed program was:" >&5
6847   cat conftest.$ac_ext >&5
6848   rm -rf conftest*
6849   eval "ac_cv_func_$ac_func=no"
6850 fi
6851 rm -f conftest*
6852 fi
6853
6854 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6855   echo "$ac_t""yes" 1>&6
6856     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6857   cat >> confdefs.h <<EOF
6858 #define $ac_tr_func 1
6859 EOF
6860  
6861 else
6862   echo "$ac_t""no" 1>&6
6863 fi
6864 done
6865
6866
6867 if test "$ac_cv_func_ctime_r" = no ; then
6868         ol_cv_func_ctime_r_nargs=0
6869 else
6870         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
6871 echo "configure:6872: checking number of arguments of ctime_r" >&5
6872 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
6873   echo $ac_n "(cached) $ac_c" 1>&6
6874 else
6875   cat > conftest.$ac_ext <<EOF
6876 #line 6877 "configure"
6877 #include "confdefs.h"
6878 #include <time.h>
6879 int main() {
6880 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
6881 ; return 0; }
6882 EOF
6883 if { (eval echo configure:6884: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6884   rm -rf conftest*
6885   ol_cv_func_ctime_r_nargs3=yes
6886 else
6887   echo "configure: failed program was:" >&5
6888   cat conftest.$ac_ext >&5
6889   rm -rf conftest*
6890   ol_cv_func_ctime_r_nargs3=no
6891 fi
6892 rm -f conftest*
6893
6894         cat > conftest.$ac_ext <<EOF
6895 #line 6896 "configure"
6896 #include "confdefs.h"
6897 #include <time.h>
6898 int main() {
6899 time_t ti; char *buffer; ctime_r(&ti,buffer);
6900 ; return 0; }
6901 EOF
6902 if { (eval echo configure:6903: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6903   rm -rf conftest*
6904   ol_cv_func_ctime_r_nargs2=yes
6905 else
6906   echo "configure: failed program was:" >&5
6907   cat conftest.$ac_ext >&5
6908   rm -rf conftest*
6909   ol_cv_func_ctime_r_nargs2=no
6910 fi
6911 rm -f conftest*
6912
6913         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
6914                 $ol_cv_func_ctime_r_nargs2 = no ; then
6915
6916                 ol_cv_func_ctime_r_nargs=3
6917
6918         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
6919                 $ol_cv_func_ctime_r_nargs2 = yes ; then
6920
6921                 ol_cv_func_ctime_r_nargs=2
6922
6923         else
6924                 ol_cv_func_ctime_r_nargs=0
6925         fi
6926   
6927 fi
6928
6929 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
6930
6931   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
6932         cat >> confdefs.h <<EOF
6933 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
6934 EOF
6935
6936   fi
6937
6938 fi
6939
6940 if test "$ac_cv_func_gethostbyname_r" = yes ; then
6941         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
6942 echo "configure:6943: checking number of arguments of gethostbyname_r" >&5
6943 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
6944   echo $ac_n "(cached) $ac_c" 1>&6
6945 else
6946   cat > conftest.$ac_ext <<EOF
6947 #line 6948 "configure"
6948 #include "confdefs.h"
6949 #include <sys/types.h>
6950 #include <sys/socket.h>
6951 #include <netinet/in.h>
6952 #include <netdb.h>
6953 #define BUFSIZE (sizeof(struct hostent)+10)
6954 int main() {
6955 struct hostent hent; char buffer[BUFSIZE];
6956                 int bufsize=BUFSIZE;int h_errno;
6957                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
6958                         buffer, bufsize, &h_errno);
6959 ; return 0; }
6960 EOF
6961 if { (eval echo configure:6962: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6962   rm -rf conftest*
6963   ol_cv_func_gethostbyname_r_nargs5=yes
6964 else
6965   echo "configure: failed program was:" >&5
6966   cat conftest.$ac_ext >&5
6967   rm -rf conftest*
6968   ol_cv_func_gethostbyname_r_nargs5=no
6969 fi
6970 rm -f conftest*
6971
6972         cat > conftest.$ac_ext <<EOF
6973 #line 6974 "configure"
6974 #include "confdefs.h"
6975 #include <sys/types.h>
6976 #include <sys/socket.h>
6977 #include <netinet/in.h>
6978 #include <netdb.h>
6979 #define BUFSIZE (sizeof(struct hostent)+10)
6980 int main() {
6981 struct hostent hent;struct hostent *rhent;
6982                 char buffer[BUFSIZE];
6983                 int bufsize=BUFSIZE;int h_errno;
6984                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
6985                         &rhent, &h_errno);
6986 ; return 0; }
6987 EOF
6988 if { (eval echo configure:6989: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6989   rm -rf conftest*
6990   ol_cv_func_gethostbyname_r_nargs6=yes
6991 else
6992   echo "configure: failed program was:" >&5
6993   cat conftest.$ac_ext >&5
6994   rm -rf conftest*
6995   ol_cv_func_gethostbyname_r_nargs6=no
6996 fi
6997 rm -f conftest*
6998
6999         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
7000                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
7001
7002                 ol_cv_func_gethostbyname_r_nargs=5
7003
7004         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
7005                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
7006
7007                 ol_cv_func_gethostbyname_r_nargs=6
7008
7009         else
7010                 ol_cv_func_gethostbyname_r_nargs=0
7011         fi
7012   
7013 fi
7014
7015 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
7016   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
7017         cat >> confdefs.h <<EOF
7018 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
7019 EOF
7020
7021   fi
7022
7023 else
7024         ol_cv_func_gethostbyname_r_nargs=0
7025 fi
7026  
7027 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
7028         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
7029 echo "configure:7030: checking number of arguments of gethostbyaddr_r" >&5
7030 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
7031   echo $ac_n "(cached) $ac_c" 1>&6
7032 else
7033   cat > conftest.$ac_ext <<EOF
7034 #line 7035 "configure"
7035 #include "confdefs.h"
7036 #include <sys/types.h>
7037 #include <sys/socket.h>
7038 #include <netinet/in.h>
7039 #include <netdb.h>
7040 #define BUFSIZE (sizeof(struct hostent)+10)
7041 int main() {
7042 struct hostent hent; char buffer[BUFSIZE]; 
7043             struct in_addr add;
7044             size_t alen=sizeof(struct in_addr);
7045             int bufsize=BUFSIZE;int h_errno;
7046                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7047                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
7048 ; return 0; }
7049 EOF
7050 if { (eval echo configure:7051: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7051   rm -rf conftest*
7052   ol_cv_func_gethostbyaddr_r_nargs7=yes
7053 else
7054   echo "configure: failed program was:" >&5
7055   cat conftest.$ac_ext >&5
7056   rm -rf conftest*
7057   ol_cv_func_gethostbyaddr_r_nargs7=no
7058 fi
7059 rm -f conftest*
7060
7061         cat > conftest.$ac_ext <<EOF
7062 #line 7063 "configure"
7063 #include "confdefs.h"
7064 #include <sys/types.h>
7065 #include <sys/socket.h>
7066 #include <netinet/in.h>
7067 #include <netdb.h>
7068 #define BUFSIZE (sizeof(struct hostent)+10)
7069 int main() {
7070 struct hostent hent;
7071                 struct hostent *rhent; char buffer[BUFSIZE]; 
7072                 struct in_addr add;
7073                 size_t alen=sizeof(struct in_addr);
7074                 int bufsize=BUFSIZE;int h_errno;
7075                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7076                         alen, AF_INET, &hent, buffer, bufsize, 
7077                         &rhent, &h_errno);
7078 ; return 0; }
7079 EOF
7080 if { (eval echo configure:7081: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7081   rm -rf conftest*
7082   ol_cv_func_gethostbyaddr_r_nargs8=yes
7083 else
7084   echo "configure: failed program was:" >&5
7085   cat conftest.$ac_ext >&5
7086   rm -rf conftest*
7087   ol_cv_func_gethostbyaddr_r_nargs8=no
7088 fi
7089 rm -f conftest*
7090
7091         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
7092                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
7093
7094                 ol_cv_func_gethostbyaddr_r_nargs=7
7095
7096         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
7097                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
7098
7099                 ol_cv_func_gethostbyaddr_r_nargs=8
7100
7101         else
7102                 ol_cv_func_gethostbyaddr_r_nargs=0
7103         fi
7104   
7105 fi
7106
7107 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
7108   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
7109     cat >> confdefs.h <<EOF
7110 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
7111 EOF
7112
7113   fi
7114
7115 else
7116         ol_cv_func_gethostbyaddr_r_nargs=0
7117 fi
7118
7119 if test "$ac_cv_func_ctime_r" = yes \
7120         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
7121         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
7122         -a "$ac_cv_func_gethostbyname_r" = yes \
7123         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
7124         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
7125         -a "$ac_cv_func_gethostbyaddr_r" = yes \
7126         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
7127         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
7128         ; then
7129  
7130         cat >> confdefs.h <<\EOF
7131 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
7132 EOF
7133
7134 fi
7135
7136 ol_link_threads=no
7137
7138 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7139         -o $ol_with_threads = nt ; then
7140
7141         
7142         echo $ac_n "checking for NT Threads""... $ac_c" 1>&6
7143 echo "configure:7144: checking for NT Threads" >&5
7144 if eval "test \"\${ol_cv_nt_threads+set}\" = set"; then
7145   echo $ac_n "(cached) $ac_c" 1>&6
7146 else
7147   
7148                 echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
7149 echo "configure:7150: checking for _beginthread" >&5
7150 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
7151   echo $ac_n "(cached) $ac_c" 1>&6
7152 else
7153   cat > conftest.$ac_ext <<EOF
7154 #line 7155 "configure"
7155 #include "confdefs.h"
7156 /* System header to define __stub macros and hopefully few prototypes,
7157     which can conflict with char _beginthread(); below.  */
7158 #include <assert.h>
7159 /* Override any gcc2 internal prototype to avoid an error.  */
7160 /* We use char because int might match the return type of a gcc2
7161     builtin and then its argument prototype would still apply.  */
7162 char _beginthread();
7163 char (*f)();
7164
7165 int main() {
7166
7167 /* The GNU C library defines this for functions which it implements
7168     to always fail with ENOSYS.  Some functions are actually named
7169     something starting with __ and the normal name is an alias.  */
7170 #if defined (__stub__beginthread) || defined (__stub____beginthread)
7171 choke me
7172 #else
7173 f = _beginthread;
7174 #endif
7175
7176 ; return 0; }
7177 EOF
7178 if { (eval echo configure:7179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7179   rm -rf conftest*
7180   eval "ac_cv_func__beginthread=yes"
7181 else
7182   echo "configure: failed program was:" >&5
7183   cat conftest.$ac_ext >&5
7184   rm -rf conftest*
7185   eval "ac_cv_func__beginthread=no"
7186 fi
7187 rm -f conftest*
7188 fi
7189
7190 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
7191   echo "$ac_t""yes" 1>&6
7192   ol_cv_nt_threads=yes
7193 else
7194   echo "$ac_t""no" 1>&6
7195 ol_cv_nt_threads=no
7196 fi
7197
7198         
7199 fi
7200
7201 echo "$ac_t""$ol_cv_nt_threads" 1>&6
7202
7203         if test $ol_cv_nt_threads = yes ; then
7204                 cat >> confdefs.h <<\EOF
7205 #define HAVE_NT_THREADS 1
7206 EOF
7207
7208         fi
7209
7210
7211         if test "$ol_cv_nt_threads" = yes ; then
7212         ol_link_threads=nt
7213         ol_with_threads=found
7214         ol_with_yielding_select=yes
7215
7216                 cat >> confdefs.h <<\EOF
7217 #define HAVE_NT_SERVICE_MANAGER 1
7218 EOF
7219
7220                 cat >> confdefs.h <<\EOF
7221 #define HAVE_NT_EVENT_LOG 1
7222 EOF
7223
7224         fi
7225
7226         if test $ol_with_threads = nt ; then
7227                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
7228         fi
7229 fi
7230
7231 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7232         -o $ol_with_threads = posix ; then
7233
7234         for ac_hdr in pthread.h
7235 do
7236 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7237 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7238 echo "configure:7239: checking for $ac_hdr" >&5
7239 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7240   echo $ac_n "(cached) $ac_c" 1>&6
7241 else
7242   cat > conftest.$ac_ext <<EOF
7243 #line 7244 "configure"
7244 #include "confdefs.h"
7245 #include <$ac_hdr>
7246 EOF
7247 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7248 { (eval echo configure:7249: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7249 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7250 if test -z "$ac_err"; then
7251   rm -rf conftest*
7252   eval "ac_cv_header_$ac_safe=yes"
7253 else
7254   echo "$ac_err" >&5
7255   echo "configure: failed program was:" >&5
7256   cat conftest.$ac_ext >&5
7257   rm -rf conftest*
7258   eval "ac_cv_header_$ac_safe=no"
7259 fi
7260 rm -f conftest*
7261 fi
7262 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7263   echo "$ac_t""yes" 1>&6
7264     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7265   cat >> confdefs.h <<EOF
7266 #define $ac_tr_hdr 1
7267 EOF
7268  
7269 else
7270   echo "$ac_t""no" 1>&6
7271 fi
7272 done
7273
7274
7275         if test $ac_cv_header_pthread_h = yes ; then
7276                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
7277 echo "configure:7278: checking POSIX thread version" >&5
7278 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
7279   echo $ac_n "(cached) $ac_c" 1>&6
7280 else
7281   
7282         cat > conftest.$ac_ext <<EOF
7283 #line 7284 "configure"
7284 #include "confdefs.h"
7285
7286 #               include <pthread.h>
7287                 /* this check could be improved */
7288 #               ifdef PTHREAD_ONCE_INIT
7289                         pthread_version_final;
7290 #               endif
7291         
7292 EOF
7293 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7294   egrep "pthread_version_final" >/dev/null 2>&1; then
7295   rm -rf conftest*
7296   ol_pthread_final=yes
7297 else
7298   rm -rf conftest*
7299   ol_pthread_final=no
7300 fi
7301 rm -f conftest*
7302
7303
7304         cat > conftest.$ac_ext <<EOF
7305 #line 7306 "configure"
7306 #include "confdefs.h"
7307
7308 #               include <pthread.h>
7309                 /* this check could be improved */
7310 #               ifdef pthread_once_init
7311                         pthread_version_draft4;
7312 #               endif
7313         
7314 EOF
7315 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7316   egrep "pthread_version_draft4" >/dev/null 2>&1; then
7317   rm -rf conftest*
7318   ol_pthread_draft4=yes
7319 else
7320   rm -rf conftest*
7321   ol_pthread_draft4=no
7322 fi
7323 rm -f conftest*
7324
7325
7326         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
7327                 ol_cv_pthread_version=final
7328         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
7329                 ol_cv_pthread_version=draft4
7330         else
7331                 ol_cv_pthread_version=unknown
7332         fi
7333
7334 fi
7335
7336 echo "$ac_t""$ol_cv_pthread_version" 1>&6
7337
7338
7339                 if test $ol_cv_pthread_version = final ; then
7340                         cat >> confdefs.h <<\EOF
7341 #define HAVE_PTHREADS_FINAL 1
7342 EOF
7343
7344                 elif test $ol_cv_pthread_version = draft4 ; then
7345                         cat >> confdefs.h <<\EOF
7346 #define HAVE_PTHREADS_D4 1
7347 EOF
7348
7349                 else
7350                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
7351                 fi
7352
7353                 # consider threads found
7354                 ol_with_threads=found
7355
7356                 
7357         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
7358 echo "configure:7359: checking for LinuxThreads pthread.h" >&5
7359 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
7360   echo $ac_n "(cached) $ac_c" 1>&6
7361 else
7362   cat > conftest.$ac_ext <<EOF
7363 #line 7364 "configure"
7364 #include "confdefs.h"
7365 #include <pthread.h>
7366 EOF
7367 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7368   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
7369   rm -rf conftest*
7370   ol_cv_header_linux_threads=yes
7371 else
7372   rm -rf conftest*
7373   ol_cv_header_linux_threads=no
7374 fi
7375 rm -f conftest*
7376
7377                 
7378 fi
7379
7380 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
7381         if test $ol_cv_header_linux_threads = yes; then
7382                 cat >> confdefs.h <<\EOF
7383 #define HAVE_LINUX_THREADS 1
7384 EOF
7385
7386         fi
7387
7388                 
7389         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
7390 echo "configure:7391: checking for GNU Pth pthread.h" >&5
7391 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
7392   echo $ac_n "(cached) $ac_c" 1>&6
7393 else
7394   cat > conftest.$ac_ext <<EOF
7395 #line 7396 "configure"
7396 #include "confdefs.h"
7397 #include <pthread.h>
7398 #ifdef _POSIX_THREAD_IS_GNU_PTH
7399         __gnu_pth__;
7400 #endif
7401
7402 EOF
7403 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7404   egrep "__gnu_pth__" >/dev/null 2>&1; then
7405   rm -rf conftest*
7406   ol_cv_header_gnu_pth_pthread_h=yes
7407 else
7408   rm -rf conftest*
7409   ol_cv_header_gnu_pth_pthread_h=no
7410 fi
7411 rm -f conftest*
7412
7413                 
7414 fi
7415
7416 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
7417
7418
7419                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
7420                         for ac_hdr in sched.h
7421 do
7422 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7423 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7424 echo "configure:7425: checking for $ac_hdr" >&5
7425 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7426   echo $ac_n "(cached) $ac_c" 1>&6
7427 else
7428   cat > conftest.$ac_ext <<EOF
7429 #line 7430 "configure"
7430 #include "confdefs.h"
7431 #include <$ac_hdr>
7432 EOF
7433 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7434 { (eval echo configure:7435: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7435 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7436 if test -z "$ac_err"; then
7437   rm -rf conftest*
7438   eval "ac_cv_header_$ac_safe=yes"
7439 else
7440   echo "$ac_err" >&5
7441   echo "configure: failed program was:" >&5
7442   cat conftest.$ac_ext >&5
7443   rm -rf conftest*
7444   eval "ac_cv_header_$ac_safe=no"
7445 fi
7446 rm -f conftest*
7447 fi
7448 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7449   echo "$ac_t""yes" 1>&6
7450     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7451   cat >> confdefs.h <<EOF
7452 #define $ac_tr_hdr 1
7453 EOF
7454  
7455 else
7456   echo "$ac_t""no" 1>&6
7457 fi
7458 done
7459
7460                 fi
7461
7462                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
7463                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
7464 echo "configure:7465: checking for pthread_create in default libraries" >&5
7465 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
7466   echo $ac_n "(cached) $ac_c" 1>&6
7467 else
7468   
7469                 if test "$cross_compiling" = yes; then
7470   cat > conftest.$ac_ext <<EOF
7471 #line 7472 "configure"
7472 #include "confdefs.h"
7473 /* pthread test headers */
7474 #include <pthread.h>
7475 #ifndef NULL
7476 #define NULL (void*)0
7477 #endif
7478
7479 static void *task(p)
7480         void *p;
7481 {
7482         return (void *) (p == NULL);
7483 }
7484
7485 int main() {
7486
7487         /* pthread test function */
7488         pthread_t t;
7489         int status;
7490 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7491         /* This system (e.g. AIX) defaults detached; must override */
7492         pthread_attr_t attr;
7493
7494         status = pthread_attr_init(&attr);
7495         if( status ) exit( status );
7496
7497         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7498         if( status ) exit( status );
7499
7500 #define ATTR    &attr
7501 #else
7502 #if HAVE_PTHREADS_D4
7503 #define ATTR    pthread_attr_default
7504 #else
7505 #define ATTR    NULL
7506 #endif
7507 #endif
7508         /* make sure pthread_create() isn't just a stub */
7509         status = pthread_create(&t, ATTR, task, NULL);
7510         if( status ) exit( status );
7511
7512         /* make sure pthread_detach() isn't just a stub */
7513 #if HAVE_PTHREADS_D4
7514         status = pthread_detach( &t );
7515 #else
7516         status = pthread_detach( t );
7517 #endif
7518
7519 #ifdef HAVE_LINUX_THREADS
7520         pthread_kill_other_threads_np();
7521 #endif
7522
7523         exit( status );
7524
7525 ; return 0; }
7526 EOF
7527 if { (eval echo configure:7528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7528   rm -rf conftest*
7529   ol_cv_pthread_create=yes
7530 else
7531   echo "configure: failed program was:" >&5
7532   cat conftest.$ac_ext >&5
7533   rm -rf conftest*
7534   ol_cv_pthread_create=no
7535 fi
7536 rm -f conftest*
7537 else
7538   cat > conftest.$ac_ext <<EOF
7539 #line 7540 "configure"
7540 #include "confdefs.h"
7541 /* pthread test headers */
7542 #include <pthread.h>
7543 #ifndef NULL
7544 #define NULL (void*)0
7545 #endif
7546
7547 static void *task(p)
7548         void *p;
7549 {
7550         return (void *) (p == NULL);
7551 }
7552
7553
7554 int main(argc, argv)
7555         int argc;
7556         char **argv;
7557 {
7558
7559         /* pthread test function */
7560         pthread_t t;
7561         int status;
7562 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7563         /* This system (e.g. AIX) defaults detached; must override */
7564         pthread_attr_t attr;
7565
7566         status = pthread_attr_init(&attr);
7567         if( status ) exit( status );
7568
7569         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7570         if( status ) exit( status );
7571
7572 #define ATTR    &attr
7573 #else
7574 #if HAVE_PTHREADS_D4
7575 #define ATTR    pthread_attr_default
7576 #else
7577 #define ATTR    NULL
7578 #endif
7579 #endif
7580         /* make sure pthread_create() isn't just a stub */
7581         status = pthread_create(&t, ATTR, task, NULL);
7582         if( status ) exit( status );
7583
7584         /* make sure pthread_detach() isn't just a stub */
7585 #if HAVE_PTHREADS_D4
7586         status = pthread_detach( &t );
7587 #else
7588         status = pthread_detach( t );
7589 #endif
7590
7591 #ifdef HAVE_LINUX_THREADS
7592         pthread_kill_other_threads_np();
7593 #endif
7594
7595         exit( status );
7596
7597 }
7598
7599 EOF
7600 if { (eval echo configure:7601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7601 then
7602   ol_cv_pthread_create=yes
7603 else
7604   echo "configure: failed program was:" >&5
7605   cat conftest.$ac_ext >&5
7606   rm -fr conftest*
7607   ol_cv_pthread_create=no
7608 fi
7609 rm -fr conftest*
7610 fi
7611
7612 fi
7613
7614 echo "$ac_t""$ol_cv_pthread_create" 1>&6
7615
7616                 if test $ol_cv_pthread_create != no ; then
7617                         ol_link_threads=posix
7618                         ol_link_pthreads=""
7619                 fi
7620                 
7621                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
7622 if test "$ol_link_threads" = no ; then
7623         # try -kthread
7624         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
7625 echo "configure:7626: checking for pthread link with -kthread" >&5
7626 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
7627   echo $ac_n "(cached) $ac_c" 1>&6
7628 else
7629   
7630                 # save the flags
7631                 ol_LIBS="$LIBS"
7632                 LIBS="-kthread $LIBS"
7633
7634                 if test "$cross_compiling" = yes; then
7635   cat > conftest.$ac_ext <<EOF
7636 #line 7637 "configure"
7637 #include "confdefs.h"
7638 /* pthread test headers */
7639 #include <pthread.h>
7640 #ifndef NULL
7641 #define NULL (void*)0
7642 #endif
7643
7644 static void *task(p)
7645         void *p;
7646 {
7647         return (void *) (p == NULL);
7648 }
7649
7650 int main() {
7651
7652         /* pthread test function */
7653         pthread_t t;
7654         int status;
7655 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7656         /* This system (e.g. AIX) defaults detached; must override */
7657         pthread_attr_t attr;
7658
7659         status = pthread_attr_init(&attr);
7660         if( status ) exit( status );
7661
7662         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7663         if( status ) exit( status );
7664
7665 #define ATTR    &attr
7666 #else
7667 #if HAVE_PTHREADS_D4
7668 #define ATTR    pthread_attr_default
7669 #else
7670 #define ATTR    NULL
7671 #endif
7672 #endif
7673         /* make sure pthread_create() isn't just a stub */
7674         status = pthread_create(&t, ATTR, task, NULL);
7675         if( status ) exit( status );
7676
7677         /* make sure pthread_detach() isn't just a stub */
7678 #if HAVE_PTHREADS_D4
7679         status = pthread_detach( &t );
7680 #else
7681         status = pthread_detach( t );
7682 #endif
7683
7684 #ifdef HAVE_LINUX_THREADS
7685         pthread_kill_other_threads_np();
7686 #endif
7687
7688         exit( status );
7689
7690 ; return 0; }
7691 EOF
7692 if { (eval echo configure:7693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7693   rm -rf conftest*
7694   ol_cv_pthread_kthread=yes
7695 else
7696   echo "configure: failed program was:" >&5
7697   cat conftest.$ac_ext >&5
7698   rm -rf conftest*
7699   ol_cv_pthread_kthread=no
7700 fi
7701 rm -f conftest*
7702 else
7703   cat > conftest.$ac_ext <<EOF
7704 #line 7705 "configure"
7705 #include "confdefs.h"
7706 /* pthread test headers */
7707 #include <pthread.h>
7708 #ifndef NULL
7709 #define NULL (void*)0
7710 #endif
7711
7712 static void *task(p)
7713         void *p;
7714 {
7715         return (void *) (p == NULL);
7716 }
7717
7718
7719 int main(argc, argv)
7720         int argc;
7721         char **argv;
7722 {
7723
7724         /* pthread test function */
7725         pthread_t t;
7726         int status;
7727 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7728         /* This system (e.g. AIX) defaults detached; must override */
7729         pthread_attr_t attr;
7730
7731         status = pthread_attr_init(&attr);
7732         if( status ) exit( status );
7733
7734         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7735         if( status ) exit( status );
7736
7737 #define ATTR    &attr
7738 #else
7739 #if HAVE_PTHREADS_D4
7740 #define ATTR    pthread_attr_default
7741 #else
7742 #define ATTR    NULL
7743 #endif
7744 #endif
7745         /* make sure pthread_create() isn't just a stub */
7746         status = pthread_create(&t, ATTR, task, NULL);
7747         if( status ) exit( status );
7748
7749         /* make sure pthread_detach() isn't just a stub */
7750 #if HAVE_PTHREADS_D4
7751         status = pthread_detach( &t );
7752 #else
7753         status = pthread_detach( t );
7754 #endif
7755
7756 #ifdef HAVE_LINUX_THREADS
7757         pthread_kill_other_threads_np();
7758 #endif
7759
7760         exit( status );
7761
7762 }
7763
7764 EOF
7765 if { (eval echo configure:7766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7766 then
7767   ol_cv_pthread_kthread=yes
7768 else
7769   echo "configure: failed program was:" >&5
7770   cat conftest.$ac_ext >&5
7771   rm -fr conftest*
7772   ol_cv_pthread_kthread=no
7773 fi
7774 rm -fr conftest*
7775 fi
7776
7777
7778                 # restore the LIBS
7779                 LIBS="$ol_LIBS"
7780         
7781 fi
7782
7783 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
7784
7785         if test $ol_cv_pthread_kthread = yes ; then
7786                 ol_link_pthreads="-kthread"
7787                 ol_link_threads=posix
7788         fi
7789 fi
7790
7791                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
7792 if test "$ol_link_threads" = no ; then
7793         # try -pthread
7794         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
7795 echo "configure:7796: checking for pthread link with -pthread" >&5
7796 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
7797   echo $ac_n "(cached) $ac_c" 1>&6
7798 else
7799   
7800                 # save the flags
7801                 ol_LIBS="$LIBS"
7802                 LIBS="-pthread $LIBS"
7803
7804                 if test "$cross_compiling" = yes; then
7805   cat > conftest.$ac_ext <<EOF
7806 #line 7807 "configure"
7807 #include "confdefs.h"
7808 /* pthread test headers */
7809 #include <pthread.h>
7810 #ifndef NULL
7811 #define NULL (void*)0
7812 #endif
7813
7814 static void *task(p)
7815         void *p;
7816 {
7817         return (void *) (p == NULL);
7818 }
7819
7820 int main() {
7821
7822         /* pthread test function */
7823         pthread_t t;
7824         int status;
7825 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7826         /* This system (e.g. AIX) defaults detached; must override */
7827         pthread_attr_t attr;
7828
7829         status = pthread_attr_init(&attr);
7830         if( status ) exit( status );
7831
7832         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7833         if( status ) exit( status );
7834
7835 #define ATTR    &attr
7836 #else
7837 #if HAVE_PTHREADS_D4
7838 #define ATTR    pthread_attr_default
7839 #else
7840 #define ATTR    NULL
7841 #endif
7842 #endif
7843         /* make sure pthread_create() isn't just a stub */
7844         status = pthread_create(&t, ATTR, task, NULL);
7845         if( status ) exit( status );
7846
7847         /* make sure pthread_detach() isn't just a stub */
7848 #if HAVE_PTHREADS_D4
7849         status = pthread_detach( &t );
7850 #else
7851         status = pthread_detach( t );
7852 #endif
7853
7854 #ifdef HAVE_LINUX_THREADS
7855         pthread_kill_other_threads_np();
7856 #endif
7857
7858         exit( status );
7859
7860 ; return 0; }
7861 EOF
7862 if { (eval echo configure:7863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7863   rm -rf conftest*
7864   ol_cv_pthread_pthread=yes
7865 else
7866   echo "configure: failed program was:" >&5
7867   cat conftest.$ac_ext >&5
7868   rm -rf conftest*
7869   ol_cv_pthread_pthread=no
7870 fi
7871 rm -f conftest*
7872 else
7873   cat > conftest.$ac_ext <<EOF
7874 #line 7875 "configure"
7875 #include "confdefs.h"
7876 /* pthread test headers */
7877 #include <pthread.h>
7878 #ifndef NULL
7879 #define NULL (void*)0
7880 #endif
7881
7882 static void *task(p)
7883         void *p;
7884 {
7885         return (void *) (p == NULL);
7886 }
7887
7888
7889 int main(argc, argv)
7890         int argc;
7891         char **argv;
7892 {
7893
7894         /* pthread test function */
7895         pthread_t t;
7896         int status;
7897 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7898         /* This system (e.g. AIX) defaults detached; must override */
7899         pthread_attr_t attr;
7900
7901         status = pthread_attr_init(&attr);
7902         if( status ) exit( status );
7903
7904         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7905         if( status ) exit( status );
7906
7907 #define ATTR    &attr
7908 #else
7909 #if HAVE_PTHREADS_D4
7910 #define ATTR    pthread_attr_default
7911 #else
7912 #define ATTR    NULL
7913 #endif
7914 #endif
7915         /* make sure pthread_create() isn't just a stub */
7916         status = pthread_create(&t, ATTR, task, NULL);
7917         if( status ) exit( status );
7918
7919         /* make sure pthread_detach() isn't just a stub */
7920 #if HAVE_PTHREADS_D4
7921         status = pthread_detach( &t );
7922 #else
7923         status = pthread_detach( t );
7924 #endif
7925
7926 #ifdef HAVE_LINUX_THREADS
7927         pthread_kill_other_threads_np();
7928 #endif
7929
7930         exit( status );
7931
7932 }
7933
7934 EOF
7935 if { (eval echo configure:7936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7936 then
7937   ol_cv_pthread_pthread=yes
7938 else
7939   echo "configure: failed program was:" >&5
7940   cat conftest.$ac_ext >&5
7941   rm -fr conftest*
7942   ol_cv_pthread_pthread=no
7943 fi
7944 rm -fr conftest*
7945 fi
7946
7947
7948                 # restore the LIBS
7949                 LIBS="$ol_LIBS"
7950         
7951 fi
7952
7953 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
7954
7955         if test $ol_cv_pthread_pthread = yes ; then
7956                 ol_link_pthreads="-pthread"
7957                 ol_link_threads=posix
7958         fi
7959 fi
7960
7961                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
7962 if test "$ol_link_threads" = no ; then
7963         # try -pthreads
7964         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
7965 echo "configure:7966: checking for pthread link with -pthreads" >&5
7966 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
7967   echo $ac_n "(cached) $ac_c" 1>&6
7968 else
7969   
7970                 # save the flags
7971                 ol_LIBS="$LIBS"
7972                 LIBS="-pthreads $LIBS"
7973
7974                 if test "$cross_compiling" = yes; then
7975   cat > conftest.$ac_ext <<EOF
7976 #line 7977 "configure"
7977 #include "confdefs.h"
7978 /* pthread test headers */
7979 #include <pthread.h>
7980 #ifndef NULL
7981 #define NULL (void*)0
7982 #endif
7983
7984 static void *task(p)
7985         void *p;
7986 {
7987         return (void *) (p == NULL);
7988 }
7989
7990 int main() {
7991
7992         /* pthread test function */
7993         pthread_t t;
7994         int status;
7995 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7996         /* This system (e.g. AIX) defaults detached; must override */
7997         pthread_attr_t attr;
7998
7999         status = pthread_attr_init(&attr);
8000         if( status ) exit( status );
8001
8002         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8003         if( status ) exit( status );
8004
8005 #define ATTR    &attr
8006 #else
8007 #if HAVE_PTHREADS_D4
8008 #define ATTR    pthread_attr_default
8009 #else
8010 #define ATTR    NULL
8011 #endif
8012 #endif
8013         /* make sure pthread_create() isn't just a stub */
8014         status = pthread_create(&t, ATTR, task, NULL);
8015         if( status ) exit( status );
8016
8017         /* make sure pthread_detach() isn't just a stub */
8018 #if HAVE_PTHREADS_D4
8019         status = pthread_detach( &t );
8020 #else
8021         status = pthread_detach( t );
8022 #endif
8023
8024 #ifdef HAVE_LINUX_THREADS
8025         pthread_kill_other_threads_np();
8026 #endif
8027
8028         exit( status );
8029
8030 ; return 0; }
8031 EOF
8032 if { (eval echo configure:8033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8033   rm -rf conftest*
8034   ol_cv_pthread_pthreads=yes
8035 else
8036   echo "configure: failed program was:" >&5
8037   cat conftest.$ac_ext >&5
8038   rm -rf conftest*
8039   ol_cv_pthread_pthreads=no
8040 fi
8041 rm -f conftest*
8042 else
8043   cat > conftest.$ac_ext <<EOF
8044 #line 8045 "configure"
8045 #include "confdefs.h"
8046 /* pthread test headers */
8047 #include <pthread.h>
8048 #ifndef NULL
8049 #define NULL (void*)0
8050 #endif
8051
8052 static void *task(p)
8053         void *p;
8054 {
8055         return (void *) (p == NULL);
8056 }
8057
8058
8059 int main(argc, argv)
8060         int argc;
8061         char **argv;
8062 {
8063
8064         /* pthread test function */
8065         pthread_t t;
8066         int status;
8067 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8068         /* This system (e.g. AIX) defaults detached; must override */
8069         pthread_attr_t attr;
8070
8071         status = pthread_attr_init(&attr);
8072         if( status ) exit( status );
8073
8074         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8075         if( status ) exit( status );
8076
8077 #define ATTR    &attr
8078 #else
8079 #if HAVE_PTHREADS_D4
8080 #define ATTR    pthread_attr_default
8081 #else
8082 #define ATTR    NULL
8083 #endif
8084 #endif
8085         /* make sure pthread_create() isn't just a stub */
8086         status = pthread_create(&t, ATTR, task, NULL);
8087         if( status ) exit( status );
8088
8089         /* make sure pthread_detach() isn't just a stub */
8090 #if HAVE_PTHREADS_D4
8091         status = pthread_detach( &t );
8092 #else
8093         status = pthread_detach( t );
8094 #endif
8095
8096 #ifdef HAVE_LINUX_THREADS
8097         pthread_kill_other_threads_np();
8098 #endif
8099
8100         exit( status );
8101
8102 }
8103
8104 EOF
8105 if { (eval echo configure:8106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8106 then
8107   ol_cv_pthread_pthreads=yes
8108 else
8109   echo "configure: failed program was:" >&5
8110   cat conftest.$ac_ext >&5
8111   rm -fr conftest*
8112   ol_cv_pthread_pthreads=no
8113 fi
8114 rm -fr conftest*
8115 fi
8116
8117
8118                 # restore the LIBS
8119                 LIBS="$ol_LIBS"
8120         
8121 fi
8122
8123 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
8124
8125         if test $ol_cv_pthread_pthreads = yes ; then
8126                 ol_link_pthreads="-pthreads"
8127                 ol_link_threads=posix
8128         fi
8129 fi
8130
8131                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
8132 if test "$ol_link_threads" = no ; then
8133         # try -mthreads
8134         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
8135 echo "configure:8136: checking for pthread link with -mthreads" >&5
8136 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
8137   echo $ac_n "(cached) $ac_c" 1>&6
8138 else
8139   
8140                 # save the flags
8141                 ol_LIBS="$LIBS"
8142                 LIBS="-mthreads $LIBS"
8143
8144                 if test "$cross_compiling" = yes; then
8145   cat > conftest.$ac_ext <<EOF
8146 #line 8147 "configure"
8147 #include "confdefs.h"
8148 /* pthread test headers */
8149 #include <pthread.h>
8150 #ifndef NULL
8151 #define NULL (void*)0
8152 #endif
8153
8154 static void *task(p)
8155         void *p;
8156 {
8157         return (void *) (p == NULL);
8158 }
8159
8160 int main() {
8161
8162         /* pthread test function */
8163         pthread_t t;
8164         int status;
8165 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8166         /* This system (e.g. AIX) defaults detached; must override */
8167         pthread_attr_t attr;
8168
8169         status = pthread_attr_init(&attr);
8170         if( status ) exit( status );
8171
8172         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8173         if( status ) exit( status );
8174
8175 #define ATTR    &attr
8176 #else
8177 #if HAVE_PTHREADS_D4
8178 #define ATTR    pthread_attr_default
8179 #else
8180 #define ATTR    NULL
8181 #endif
8182 #endif
8183         /* make sure pthread_create() isn't just a stub */
8184         status = pthread_create(&t, ATTR, task, NULL);
8185         if( status ) exit( status );
8186
8187         /* make sure pthread_detach() isn't just a stub */
8188 #if HAVE_PTHREADS_D4
8189         status = pthread_detach( &t );
8190 #else
8191         status = pthread_detach( t );
8192 #endif
8193
8194 #ifdef HAVE_LINUX_THREADS
8195         pthread_kill_other_threads_np();
8196 #endif
8197
8198         exit( status );
8199
8200 ; return 0; }
8201 EOF
8202 if { (eval echo configure:8203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8203   rm -rf conftest*
8204   ol_cv_pthread_mthreads=yes
8205 else
8206   echo "configure: failed program was:" >&5
8207   cat conftest.$ac_ext >&5
8208   rm -rf conftest*
8209   ol_cv_pthread_mthreads=no
8210 fi
8211 rm -f conftest*
8212 else
8213   cat > conftest.$ac_ext <<EOF
8214 #line 8215 "configure"
8215 #include "confdefs.h"
8216 /* pthread test headers */
8217 #include <pthread.h>
8218 #ifndef NULL
8219 #define NULL (void*)0
8220 #endif
8221
8222 static void *task(p)
8223         void *p;
8224 {
8225         return (void *) (p == NULL);
8226 }
8227
8228
8229 int main(argc, argv)
8230         int argc;
8231         char **argv;
8232 {
8233
8234         /* pthread test function */
8235         pthread_t t;
8236         int status;
8237 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8238         /* This system (e.g. AIX) defaults detached; must override */
8239         pthread_attr_t attr;
8240
8241         status = pthread_attr_init(&attr);
8242         if( status ) exit( status );
8243
8244         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8245         if( status ) exit( status );
8246
8247 #define ATTR    &attr
8248 #else
8249 #if HAVE_PTHREADS_D4
8250 #define ATTR    pthread_attr_default
8251 #else
8252 #define ATTR    NULL
8253 #endif
8254 #endif
8255         /* make sure pthread_create() isn't just a stub */
8256         status = pthread_create(&t, ATTR, task, NULL);
8257         if( status ) exit( status );
8258
8259         /* make sure pthread_detach() isn't just a stub */
8260 #if HAVE_PTHREADS_D4
8261         status = pthread_detach( &t );
8262 #else
8263         status = pthread_detach( t );
8264 #endif
8265
8266 #ifdef HAVE_LINUX_THREADS
8267         pthread_kill_other_threads_np();
8268 #endif
8269
8270         exit( status );
8271
8272 }
8273
8274 EOF
8275 if { (eval echo configure:8276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8276 then
8277   ol_cv_pthread_mthreads=yes
8278 else
8279   echo "configure: failed program was:" >&5
8280   cat conftest.$ac_ext >&5
8281   rm -fr conftest*
8282   ol_cv_pthread_mthreads=no
8283 fi
8284 rm -fr conftest*
8285 fi
8286
8287
8288                 # restore the LIBS
8289                 LIBS="$ol_LIBS"
8290         
8291 fi
8292
8293 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
8294
8295         if test $ol_cv_pthread_mthreads = yes ; then
8296                 ol_link_pthreads="-mthreads"
8297                 ol_link_threads=posix
8298         fi
8299 fi
8300
8301                 # Pthread try link: -thread (ol_cv_pthread_thread)
8302 if test "$ol_link_threads" = no ; then
8303         # try -thread
8304         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
8305 echo "configure:8306: checking for pthread link with -thread" >&5
8306 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
8307   echo $ac_n "(cached) $ac_c" 1>&6
8308 else
8309   
8310                 # save the flags
8311                 ol_LIBS="$LIBS"
8312                 LIBS="-thread $LIBS"
8313
8314                 if test "$cross_compiling" = yes; then
8315   cat > conftest.$ac_ext <<EOF
8316 #line 8317 "configure"
8317 #include "confdefs.h"
8318 /* pthread test headers */
8319 #include <pthread.h>
8320 #ifndef NULL
8321 #define NULL (void*)0
8322 #endif
8323
8324 static void *task(p)
8325         void *p;
8326 {
8327         return (void *) (p == NULL);
8328 }
8329
8330 int main() {
8331
8332         /* pthread test function */
8333         pthread_t t;
8334         int status;
8335 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8336         /* This system (e.g. AIX) defaults detached; must override */
8337         pthread_attr_t attr;
8338
8339         status = pthread_attr_init(&attr);
8340         if( status ) exit( status );
8341
8342         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8343         if( status ) exit( status );
8344
8345 #define ATTR    &attr
8346 #else
8347 #if HAVE_PTHREADS_D4
8348 #define ATTR    pthread_attr_default
8349 #else
8350 #define ATTR    NULL
8351 #endif
8352 #endif
8353         /* make sure pthread_create() isn't just a stub */
8354         status = pthread_create(&t, ATTR, task, NULL);
8355         if( status ) exit( status );
8356
8357         /* make sure pthread_detach() isn't just a stub */
8358 #if HAVE_PTHREADS_D4
8359         status = pthread_detach( &t );
8360 #else
8361         status = pthread_detach( t );
8362 #endif
8363
8364 #ifdef HAVE_LINUX_THREADS
8365         pthread_kill_other_threads_np();
8366 #endif
8367
8368         exit( status );
8369
8370 ; return 0; }
8371 EOF
8372 if { (eval echo configure:8373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8373   rm -rf conftest*
8374   ol_cv_pthread_thread=yes
8375 else
8376   echo "configure: failed program was:" >&5
8377   cat conftest.$ac_ext >&5
8378   rm -rf conftest*
8379   ol_cv_pthread_thread=no
8380 fi
8381 rm -f conftest*
8382 else
8383   cat > conftest.$ac_ext <<EOF
8384 #line 8385 "configure"
8385 #include "confdefs.h"
8386 /* pthread test headers */
8387 #include <pthread.h>
8388 #ifndef NULL
8389 #define NULL (void*)0
8390 #endif
8391
8392 static void *task(p)
8393         void *p;
8394 {
8395         return (void *) (p == NULL);
8396 }
8397
8398
8399 int main(argc, argv)
8400         int argc;
8401         char **argv;
8402 {
8403
8404         /* pthread test function */
8405         pthread_t t;
8406         int status;
8407 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8408         /* This system (e.g. AIX) defaults detached; must override */
8409         pthread_attr_t attr;
8410
8411         status = pthread_attr_init(&attr);
8412         if( status ) exit( status );
8413
8414         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8415         if( status ) exit( status );
8416
8417 #define ATTR    &attr
8418 #else
8419 #if HAVE_PTHREADS_D4
8420 #define ATTR    pthread_attr_default
8421 #else
8422 #define ATTR    NULL
8423 #endif
8424 #endif
8425         /* make sure pthread_create() isn't just a stub */
8426         status = pthread_create(&t, ATTR, task, NULL);
8427         if( status ) exit( status );
8428
8429         /* make sure pthread_detach() isn't just a stub */
8430 #if HAVE_PTHREADS_D4
8431         status = pthread_detach( &t );
8432 #else
8433         status = pthread_detach( t );
8434 #endif
8435
8436 #ifdef HAVE_LINUX_THREADS
8437         pthread_kill_other_threads_np();
8438 #endif
8439
8440         exit( status );
8441
8442 }
8443
8444 EOF
8445 if { (eval echo configure:8446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8446 then
8447   ol_cv_pthread_thread=yes
8448 else
8449   echo "configure: failed program was:" >&5
8450   cat conftest.$ac_ext >&5
8451   rm -fr conftest*
8452   ol_cv_pthread_thread=no
8453 fi
8454 rm -fr conftest*
8455 fi
8456
8457
8458                 # restore the LIBS
8459                 LIBS="$ol_LIBS"
8460         
8461 fi
8462
8463 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
8464
8465         if test $ol_cv_pthread_thread = yes ; then
8466                 ol_link_pthreads="-thread"
8467                 ol_link_threads=posix
8468         fi
8469 fi
8470
8471
8472                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
8473 if test "$ol_link_threads" = no ; then
8474         # try -lpthread -lmach -lexc -lc_r
8475         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
8476 echo "configure:8477: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
8477 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
8478   echo $ac_n "(cached) $ac_c" 1>&6
8479 else
8480   
8481                 # save the flags
8482                 ol_LIBS="$LIBS"
8483                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
8484
8485                 if test "$cross_compiling" = yes; then
8486   cat > conftest.$ac_ext <<EOF
8487 #line 8488 "configure"
8488 #include "confdefs.h"
8489 /* pthread test headers */
8490 #include <pthread.h>
8491 #ifndef NULL
8492 #define NULL (void*)0
8493 #endif
8494
8495 static void *task(p)
8496         void *p;
8497 {
8498         return (void *) (p == NULL);
8499 }
8500
8501 int main() {
8502
8503         /* pthread test function */
8504         pthread_t t;
8505         int status;
8506 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8507         /* This system (e.g. AIX) defaults detached; must override */
8508         pthread_attr_t attr;
8509
8510         status = pthread_attr_init(&attr);
8511         if( status ) exit( status );
8512
8513         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8514         if( status ) exit( status );
8515
8516 #define ATTR    &attr
8517 #else
8518 #if HAVE_PTHREADS_D4
8519 #define ATTR    pthread_attr_default
8520 #else
8521 #define ATTR    NULL
8522 #endif
8523 #endif
8524         /* make sure pthread_create() isn't just a stub */
8525         status = pthread_create(&t, ATTR, task, NULL);
8526         if( status ) exit( status );
8527
8528         /* make sure pthread_detach() isn't just a stub */
8529 #if HAVE_PTHREADS_D4
8530         status = pthread_detach( &t );
8531 #else
8532         status = pthread_detach( t );
8533 #endif
8534
8535 #ifdef HAVE_LINUX_THREADS
8536         pthread_kill_other_threads_np();
8537 #endif
8538
8539         exit( status );
8540
8541 ; return 0; }
8542 EOF
8543 if { (eval echo configure:8544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8544   rm -rf conftest*
8545   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8546 else
8547   echo "configure: failed program was:" >&5
8548   cat conftest.$ac_ext >&5
8549   rm -rf conftest*
8550   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8551 fi
8552 rm -f conftest*
8553 else
8554   cat > conftest.$ac_ext <<EOF
8555 #line 8556 "configure"
8556 #include "confdefs.h"
8557 /* pthread test headers */
8558 #include <pthread.h>
8559 #ifndef NULL
8560 #define NULL (void*)0
8561 #endif
8562
8563 static void *task(p)
8564         void *p;
8565 {
8566         return (void *) (p == NULL);
8567 }
8568
8569
8570 int main(argc, argv)
8571         int argc;
8572         char **argv;
8573 {
8574
8575         /* pthread test function */
8576         pthread_t t;
8577         int status;
8578 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8579         /* This system (e.g. AIX) defaults detached; must override */
8580         pthread_attr_t attr;
8581
8582         status = pthread_attr_init(&attr);
8583         if( status ) exit( status );
8584
8585         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8586         if( status ) exit( status );
8587
8588 #define ATTR    &attr
8589 #else
8590 #if HAVE_PTHREADS_D4
8591 #define ATTR    pthread_attr_default
8592 #else
8593 #define ATTR    NULL
8594 #endif
8595 #endif
8596         /* make sure pthread_create() isn't just a stub */
8597         status = pthread_create(&t, ATTR, task, NULL);
8598         if( status ) exit( status );
8599
8600         /* make sure pthread_detach() isn't just a stub */
8601 #if HAVE_PTHREADS_D4
8602         status = pthread_detach( &t );
8603 #else
8604         status = pthread_detach( t );
8605 #endif
8606
8607 #ifdef HAVE_LINUX_THREADS
8608         pthread_kill_other_threads_np();
8609 #endif
8610
8611         exit( status );
8612
8613 }
8614
8615 EOF
8616 if { (eval echo configure:8617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8617 then
8618   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8619 else
8620   echo "configure: failed program was:" >&5
8621   cat conftest.$ac_ext >&5
8622   rm -fr conftest*
8623   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8624 fi
8625 rm -fr conftest*
8626 fi
8627
8628
8629                 # restore the LIBS
8630                 LIBS="$ol_LIBS"
8631         
8632 fi
8633
8634 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
8635
8636         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
8637                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
8638                 ol_link_threads=posix
8639         fi
8640 fi
8641
8642                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
8643 if test "$ol_link_threads" = no ; then
8644         # try -lpthread -lmach -lexc
8645         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
8646 echo "configure:8647: checking for pthread link with -lpthread -lmach -lexc" >&5
8647 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
8648   echo $ac_n "(cached) $ac_c" 1>&6
8649 else
8650   
8651                 # save the flags
8652                 ol_LIBS="$LIBS"
8653                 LIBS="-lpthread -lmach -lexc $LIBS"
8654
8655                 if test "$cross_compiling" = yes; then
8656   cat > conftest.$ac_ext <<EOF
8657 #line 8658 "configure"
8658 #include "confdefs.h"
8659 /* pthread test headers */
8660 #include <pthread.h>
8661 #ifndef NULL
8662 #define NULL (void*)0
8663 #endif
8664
8665 static void *task(p)
8666         void *p;
8667 {
8668         return (void *) (p == NULL);
8669 }
8670
8671 int main() {
8672
8673         /* pthread test function */
8674         pthread_t t;
8675         int status;
8676 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8677         /* This system (e.g. AIX) defaults detached; must override */
8678         pthread_attr_t attr;
8679
8680         status = pthread_attr_init(&attr);
8681         if( status ) exit( status );
8682
8683         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8684         if( status ) exit( status );
8685
8686 #define ATTR    &attr
8687 #else
8688 #if HAVE_PTHREADS_D4
8689 #define ATTR    pthread_attr_default
8690 #else
8691 #define ATTR    NULL
8692 #endif
8693 #endif
8694         /* make sure pthread_create() isn't just a stub */
8695         status = pthread_create(&t, ATTR, task, NULL);
8696         if( status ) exit( status );
8697
8698         /* make sure pthread_detach() isn't just a stub */
8699 #if HAVE_PTHREADS_D4
8700         status = pthread_detach( &t );
8701 #else
8702         status = pthread_detach( t );
8703 #endif
8704
8705 #ifdef HAVE_LINUX_THREADS
8706         pthread_kill_other_threads_np();
8707 #endif
8708
8709         exit( status );
8710
8711 ; return 0; }
8712 EOF
8713 if { (eval echo configure:8714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8714   rm -rf conftest*
8715   ol_cv_pthread_lpthread_lmach_lexc=yes
8716 else
8717   echo "configure: failed program was:" >&5
8718   cat conftest.$ac_ext >&5
8719   rm -rf conftest*
8720   ol_cv_pthread_lpthread_lmach_lexc=no
8721 fi
8722 rm -f conftest*
8723 else
8724   cat > conftest.$ac_ext <<EOF
8725 #line 8726 "configure"
8726 #include "confdefs.h"
8727 /* pthread test headers */
8728 #include <pthread.h>
8729 #ifndef NULL
8730 #define NULL (void*)0
8731 #endif
8732
8733 static void *task(p)
8734         void *p;
8735 {
8736         return (void *) (p == NULL);
8737 }
8738
8739
8740 int main(argc, argv)
8741         int argc;
8742         char **argv;
8743 {
8744
8745         /* pthread test function */
8746         pthread_t t;
8747         int status;
8748 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8749         /* This system (e.g. AIX) defaults detached; must override */
8750         pthread_attr_t attr;
8751
8752         status = pthread_attr_init(&attr);
8753         if( status ) exit( status );
8754
8755         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8756         if( status ) exit( status );
8757
8758 #define ATTR    &attr
8759 #else
8760 #if HAVE_PTHREADS_D4
8761 #define ATTR    pthread_attr_default
8762 #else
8763 #define ATTR    NULL
8764 #endif
8765 #endif
8766         /* make sure pthread_create() isn't just a stub */
8767         status = pthread_create(&t, ATTR, task, NULL);
8768         if( status ) exit( status );
8769
8770         /* make sure pthread_detach() isn't just a stub */
8771 #if HAVE_PTHREADS_D4
8772         status = pthread_detach( &t );
8773 #else
8774         status = pthread_detach( t );
8775 #endif
8776
8777 #ifdef HAVE_LINUX_THREADS
8778         pthread_kill_other_threads_np();
8779 #endif
8780
8781         exit( status );
8782
8783 }
8784
8785 EOF
8786 if { (eval echo configure:8787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8787 then
8788   ol_cv_pthread_lpthread_lmach_lexc=yes
8789 else
8790   echo "configure: failed program was:" >&5
8791   cat conftest.$ac_ext >&5
8792   rm -fr conftest*
8793   ol_cv_pthread_lpthread_lmach_lexc=no
8794 fi
8795 rm -fr conftest*
8796 fi
8797
8798
8799                 # restore the LIBS
8800                 LIBS="$ol_LIBS"
8801         
8802 fi
8803
8804 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
8805
8806         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
8807                 ol_link_pthreads="-lpthread -lmach -lexc"
8808                 ol_link_threads=posix
8809         fi
8810 fi
8811
8812
8813                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
8814 if test "$ol_link_threads" = no ; then
8815         # try -lpthread -Wl,-woff,85
8816         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
8817 echo "configure:8818: checking for pthread link with -lpthread -Wl,-woff,85" >&5
8818 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
8819   echo $ac_n "(cached) $ac_c" 1>&6
8820 else
8821   
8822                 # save the flags
8823                 ol_LIBS="$LIBS"
8824                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
8825
8826                 if test "$cross_compiling" = yes; then
8827   cat > conftest.$ac_ext <<EOF
8828 #line 8829 "configure"
8829 #include "confdefs.h"
8830 /* pthread test headers */
8831 #include <pthread.h>
8832 #ifndef NULL
8833 #define NULL (void*)0
8834 #endif
8835
8836 static void *task(p)
8837         void *p;
8838 {
8839         return (void *) (p == NULL);
8840 }
8841
8842 int main() {
8843
8844         /* pthread test function */
8845         pthread_t t;
8846         int status;
8847 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8848         /* This system (e.g. AIX) defaults detached; must override */
8849         pthread_attr_t attr;
8850
8851         status = pthread_attr_init(&attr);
8852         if( status ) exit( status );
8853
8854         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8855         if( status ) exit( status );
8856
8857 #define ATTR    &attr
8858 #else
8859 #if HAVE_PTHREADS_D4
8860 #define ATTR    pthread_attr_default
8861 #else
8862 #define ATTR    NULL
8863 #endif
8864 #endif
8865         /* make sure pthread_create() isn't just a stub */
8866         status = pthread_create(&t, ATTR, task, NULL);
8867         if( status ) exit( status );
8868
8869         /* make sure pthread_detach() isn't just a stub */
8870 #if HAVE_PTHREADS_D4
8871         status = pthread_detach( &t );
8872 #else
8873         status = pthread_detach( t );
8874 #endif
8875
8876 #ifdef HAVE_LINUX_THREADS
8877         pthread_kill_other_threads_np();
8878 #endif
8879
8880         exit( status );
8881
8882 ; return 0; }
8883 EOF
8884 if { (eval echo configure:8885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8885   rm -rf conftest*
8886   ol_cv_pthread_lib_lpthread_woff=yes
8887 else
8888   echo "configure: failed program was:" >&5
8889   cat conftest.$ac_ext >&5
8890   rm -rf conftest*
8891   ol_cv_pthread_lib_lpthread_woff=no
8892 fi
8893 rm -f conftest*
8894 else
8895   cat > conftest.$ac_ext <<EOF
8896 #line 8897 "configure"
8897 #include "confdefs.h"
8898 /* pthread test headers */
8899 #include <pthread.h>
8900 #ifndef NULL
8901 #define NULL (void*)0
8902 #endif
8903
8904 static void *task(p)
8905         void *p;
8906 {
8907         return (void *) (p == NULL);
8908 }
8909
8910
8911 int main(argc, argv)
8912         int argc;
8913         char **argv;
8914 {
8915
8916         /* pthread test function */
8917         pthread_t t;
8918         int status;
8919 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8920         /* This system (e.g. AIX) defaults detached; must override */
8921         pthread_attr_t attr;
8922
8923         status = pthread_attr_init(&attr);
8924         if( status ) exit( status );
8925
8926         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8927         if( status ) exit( status );
8928
8929 #define ATTR    &attr
8930 #else
8931 #if HAVE_PTHREADS_D4
8932 #define ATTR    pthread_attr_default
8933 #else
8934 #define ATTR    NULL
8935 #endif
8936 #endif
8937         /* make sure pthread_create() isn't just a stub */
8938         status = pthread_create(&t, ATTR, task, NULL);
8939         if( status ) exit( status );
8940
8941         /* make sure pthread_detach() isn't just a stub */
8942 #if HAVE_PTHREADS_D4
8943         status = pthread_detach( &t );
8944 #else
8945         status = pthread_detach( t );
8946 #endif
8947
8948 #ifdef HAVE_LINUX_THREADS
8949         pthread_kill_other_threads_np();
8950 #endif
8951
8952         exit( status );
8953
8954 }
8955
8956 EOF
8957 if { (eval echo configure:8958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8958 then
8959   ol_cv_pthread_lib_lpthread_woff=yes
8960 else
8961   echo "configure: failed program was:" >&5
8962   cat conftest.$ac_ext >&5
8963   rm -fr conftest*
8964   ol_cv_pthread_lib_lpthread_woff=no
8965 fi
8966 rm -fr conftest*
8967 fi
8968
8969
8970                 # restore the LIBS
8971                 LIBS="$ol_LIBS"
8972         
8973 fi
8974
8975 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
8976
8977         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
8978                 ol_link_pthreads="-lpthread -Wl,-woff,85"
8979                 ol_link_threads=posix
8980         fi
8981 fi
8982
8983
8984                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
8985 if test "$ol_link_threads" = no ; then
8986         # try -lpthread
8987         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
8988 echo "configure:8989: checking for pthread link with -lpthread" >&5
8989 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
8990   echo $ac_n "(cached) $ac_c" 1>&6
8991 else
8992   
8993                 # save the flags
8994                 ol_LIBS="$LIBS"
8995                 LIBS="-lpthread $LIBS"
8996
8997                 if test "$cross_compiling" = yes; then
8998   cat > conftest.$ac_ext <<EOF
8999 #line 9000 "configure"
9000 #include "confdefs.h"
9001 /* pthread test headers */
9002 #include <pthread.h>
9003 #ifndef NULL
9004 #define NULL (void*)0
9005 #endif
9006
9007 static void *task(p)
9008         void *p;
9009 {
9010         return (void *) (p == NULL);
9011 }
9012
9013 int main() {
9014
9015         /* pthread test function */
9016         pthread_t t;
9017         int status;
9018 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9019         /* This system (e.g. AIX) defaults detached; must override */
9020         pthread_attr_t attr;
9021
9022         status = pthread_attr_init(&attr);
9023         if( status ) exit( status );
9024
9025         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9026         if( status ) exit( status );
9027
9028 #define ATTR    &attr
9029 #else
9030 #if HAVE_PTHREADS_D4
9031 #define ATTR    pthread_attr_default
9032 #else
9033 #define ATTR    NULL
9034 #endif
9035 #endif
9036         /* make sure pthread_create() isn't just a stub */
9037         status = pthread_create(&t, ATTR, task, NULL);
9038         if( status ) exit( status );
9039
9040         /* make sure pthread_detach() isn't just a stub */
9041 #if HAVE_PTHREADS_D4
9042         status = pthread_detach( &t );
9043 #else
9044         status = pthread_detach( t );
9045 #endif
9046
9047 #ifdef HAVE_LINUX_THREADS
9048         pthread_kill_other_threads_np();
9049 #endif
9050
9051         exit( status );
9052
9053 ; return 0; }
9054 EOF
9055 if { (eval echo configure:9056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9056   rm -rf conftest*
9057   ol_cv_pthread_lpthread=yes
9058 else
9059   echo "configure: failed program was:" >&5
9060   cat conftest.$ac_ext >&5
9061   rm -rf conftest*
9062   ol_cv_pthread_lpthread=no
9063 fi
9064 rm -f conftest*
9065 else
9066   cat > conftest.$ac_ext <<EOF
9067 #line 9068 "configure"
9068 #include "confdefs.h"
9069 /* pthread test headers */
9070 #include <pthread.h>
9071 #ifndef NULL
9072 #define NULL (void*)0
9073 #endif
9074
9075 static void *task(p)
9076         void *p;
9077 {
9078         return (void *) (p == NULL);
9079 }
9080
9081
9082 int main(argc, argv)
9083         int argc;
9084         char **argv;
9085 {
9086
9087         /* pthread test function */
9088         pthread_t t;
9089         int status;
9090 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9091         /* This system (e.g. AIX) defaults detached; must override */
9092         pthread_attr_t attr;
9093
9094         status = pthread_attr_init(&attr);
9095         if( status ) exit( status );
9096
9097         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9098         if( status ) exit( status );
9099
9100 #define ATTR    &attr
9101 #else
9102 #if HAVE_PTHREADS_D4
9103 #define ATTR    pthread_attr_default
9104 #else
9105 #define ATTR    NULL
9106 #endif
9107 #endif
9108         /* make sure pthread_create() isn't just a stub */
9109         status = pthread_create(&t, ATTR, task, NULL);
9110         if( status ) exit( status );
9111
9112         /* make sure pthread_detach() isn't just a stub */
9113 #if HAVE_PTHREADS_D4
9114         status = pthread_detach( &t );
9115 #else
9116         status = pthread_detach( t );
9117 #endif
9118
9119 #ifdef HAVE_LINUX_THREADS
9120         pthread_kill_other_threads_np();
9121 #endif
9122
9123         exit( status );
9124
9125 }
9126
9127 EOF
9128 if { (eval echo configure:9129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9129 then
9130   ol_cv_pthread_lpthread=yes
9131 else
9132   echo "configure: failed program was:" >&5
9133   cat conftest.$ac_ext >&5
9134   rm -fr conftest*
9135   ol_cv_pthread_lpthread=no
9136 fi
9137 rm -fr conftest*
9138 fi
9139
9140
9141                 # restore the LIBS
9142                 LIBS="$ol_LIBS"
9143         
9144 fi
9145
9146 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
9147
9148         if test $ol_cv_pthread_lpthread = yes ; then
9149                 ol_link_pthreads="-lpthread"
9150                 ol_link_threads=posix
9151         fi
9152 fi
9153
9154                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
9155 if test "$ol_link_threads" = no ; then
9156         # try -lc_r
9157         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
9158 echo "configure:9159: checking for pthread link with -lc_r" >&5
9159 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
9160   echo $ac_n "(cached) $ac_c" 1>&6
9161 else
9162   
9163                 # save the flags
9164                 ol_LIBS="$LIBS"
9165                 LIBS="-lc_r $LIBS"
9166
9167                 if test "$cross_compiling" = yes; then
9168   cat > conftest.$ac_ext <<EOF
9169 #line 9170 "configure"
9170 #include "confdefs.h"
9171 /* pthread test headers */
9172 #include <pthread.h>
9173 #ifndef NULL
9174 #define NULL (void*)0
9175 #endif
9176
9177 static void *task(p)
9178         void *p;
9179 {
9180         return (void *) (p == NULL);
9181 }
9182
9183 int main() {
9184
9185         /* pthread test function */
9186         pthread_t t;
9187         int status;
9188 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9189         /* This system (e.g. AIX) defaults detached; must override */
9190         pthread_attr_t attr;
9191
9192         status = pthread_attr_init(&attr);
9193         if( status ) exit( status );
9194
9195         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9196         if( status ) exit( status );
9197
9198 #define ATTR    &attr
9199 #else
9200 #if HAVE_PTHREADS_D4
9201 #define ATTR    pthread_attr_default
9202 #else
9203 #define ATTR    NULL
9204 #endif
9205 #endif
9206         /* make sure pthread_create() isn't just a stub */
9207         status = pthread_create(&t, ATTR, task, NULL);
9208         if( status ) exit( status );
9209
9210         /* make sure pthread_detach() isn't just a stub */
9211 #if HAVE_PTHREADS_D4
9212         status = pthread_detach( &t );
9213 #else
9214         status = pthread_detach( t );
9215 #endif
9216
9217 #ifdef HAVE_LINUX_THREADS
9218         pthread_kill_other_threads_np();
9219 #endif
9220
9221         exit( status );
9222
9223 ; return 0; }
9224 EOF
9225 if { (eval echo configure:9226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9226   rm -rf conftest*
9227   ol_cv_pthread_lc_r=yes
9228 else
9229   echo "configure: failed program was:" >&5
9230   cat conftest.$ac_ext >&5
9231   rm -rf conftest*
9232   ol_cv_pthread_lc_r=no
9233 fi
9234 rm -f conftest*
9235 else
9236   cat > conftest.$ac_ext <<EOF
9237 #line 9238 "configure"
9238 #include "confdefs.h"
9239 /* pthread test headers */
9240 #include <pthread.h>
9241 #ifndef NULL
9242 #define NULL (void*)0
9243 #endif
9244
9245 static void *task(p)
9246         void *p;
9247 {
9248         return (void *) (p == NULL);
9249 }
9250
9251
9252 int main(argc, argv)
9253         int argc;
9254         char **argv;
9255 {
9256
9257         /* pthread test function */
9258         pthread_t t;
9259         int status;
9260 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9261         /* This system (e.g. AIX) defaults detached; must override */
9262         pthread_attr_t attr;
9263
9264         status = pthread_attr_init(&attr);
9265         if( status ) exit( status );
9266
9267         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9268         if( status ) exit( status );
9269
9270 #define ATTR    &attr
9271 #else
9272 #if HAVE_PTHREADS_D4
9273 #define ATTR    pthread_attr_default
9274 #else
9275 #define ATTR    NULL
9276 #endif
9277 #endif
9278         /* make sure pthread_create() isn't just a stub */
9279         status = pthread_create(&t, ATTR, task, NULL);
9280         if( status ) exit( status );
9281
9282         /* make sure pthread_detach() isn't just a stub */
9283 #if HAVE_PTHREADS_D4
9284         status = pthread_detach( &t );
9285 #else
9286         status = pthread_detach( t );
9287 #endif
9288
9289 #ifdef HAVE_LINUX_THREADS
9290         pthread_kill_other_threads_np();
9291 #endif
9292
9293         exit( status );
9294
9295 }
9296
9297 EOF
9298 if { (eval echo configure:9299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9299 then
9300   ol_cv_pthread_lc_r=yes
9301 else
9302   echo "configure: failed program was:" >&5
9303   cat conftest.$ac_ext >&5
9304   rm -fr conftest*
9305   ol_cv_pthread_lc_r=no
9306 fi
9307 rm -fr conftest*
9308 fi
9309
9310
9311                 # restore the LIBS
9312                 LIBS="$ol_LIBS"
9313         
9314 fi
9315
9316 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
9317
9318         if test $ol_cv_pthread_lc_r = yes ; then
9319                 ol_link_pthreads="-lc_r"
9320                 ol_link_threads=posix
9321         fi
9322 fi
9323
9324
9325                 # Pthread try link: -threads (ol_cv_pthread_threads)
9326 if test "$ol_link_threads" = no ; then
9327         # try -threads
9328         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
9329 echo "configure:9330: checking for pthread link with -threads" >&5
9330 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
9331   echo $ac_n "(cached) $ac_c" 1>&6
9332 else
9333   
9334                 # save the flags
9335                 ol_LIBS="$LIBS"
9336                 LIBS="-threads $LIBS"
9337
9338                 if test "$cross_compiling" = yes; then
9339   cat > conftest.$ac_ext <<EOF
9340 #line 9341 "configure"
9341 #include "confdefs.h"
9342 /* pthread test headers */
9343 #include <pthread.h>
9344 #ifndef NULL
9345 #define NULL (void*)0
9346 #endif
9347
9348 static void *task(p)
9349         void *p;
9350 {
9351         return (void *) (p == NULL);
9352 }
9353
9354 int main() {
9355
9356         /* pthread test function */
9357         pthread_t t;
9358         int status;
9359 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9360         /* This system (e.g. AIX) defaults detached; must override */
9361         pthread_attr_t attr;
9362
9363         status = pthread_attr_init(&attr);
9364         if( status ) exit( status );
9365
9366         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9367         if( status ) exit( status );
9368
9369 #define ATTR    &attr
9370 #else
9371 #if HAVE_PTHREADS_D4
9372 #define ATTR    pthread_attr_default
9373 #else
9374 #define ATTR    NULL
9375 #endif
9376 #endif
9377         /* make sure pthread_create() isn't just a stub */
9378         status = pthread_create(&t, ATTR, task, NULL);
9379         if( status ) exit( status );
9380
9381         /* make sure pthread_detach() isn't just a stub */
9382 #if HAVE_PTHREADS_D4
9383         status = pthread_detach( &t );
9384 #else
9385         status = pthread_detach( t );
9386 #endif
9387
9388 #ifdef HAVE_LINUX_THREADS
9389         pthread_kill_other_threads_np();
9390 #endif
9391
9392         exit( status );
9393
9394 ; return 0; }
9395 EOF
9396 if { (eval echo configure:9397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9397   rm -rf conftest*
9398   ol_cv_pthread_threads=yes
9399 else
9400   echo "configure: failed program was:" >&5
9401   cat conftest.$ac_ext >&5
9402   rm -rf conftest*
9403   ol_cv_pthread_threads=no
9404 fi
9405 rm -f conftest*
9406 else
9407   cat > conftest.$ac_ext <<EOF
9408 #line 9409 "configure"
9409 #include "confdefs.h"
9410 /* pthread test headers */
9411 #include <pthread.h>
9412 #ifndef NULL
9413 #define NULL (void*)0
9414 #endif
9415
9416 static void *task(p)
9417         void *p;
9418 {
9419         return (void *) (p == NULL);
9420 }
9421
9422
9423 int main(argc, argv)
9424         int argc;
9425         char **argv;
9426 {
9427
9428         /* pthread test function */
9429         pthread_t t;
9430         int status;
9431 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9432         /* This system (e.g. AIX) defaults detached; must override */
9433         pthread_attr_t attr;
9434
9435         status = pthread_attr_init(&attr);
9436         if( status ) exit( status );
9437
9438         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9439         if( status ) exit( status );
9440
9441 #define ATTR    &attr
9442 #else
9443 #if HAVE_PTHREADS_D4
9444 #define ATTR    pthread_attr_default
9445 #else
9446 #define ATTR    NULL
9447 #endif
9448 #endif
9449         /* make sure pthread_create() isn't just a stub */
9450         status = pthread_create(&t, ATTR, task, NULL);
9451         if( status ) exit( status );
9452
9453         /* make sure pthread_detach() isn't just a stub */
9454 #if HAVE_PTHREADS_D4
9455         status = pthread_detach( &t );
9456 #else
9457         status = pthread_detach( t );
9458 #endif
9459
9460 #ifdef HAVE_LINUX_THREADS
9461         pthread_kill_other_threads_np();
9462 #endif
9463
9464         exit( status );
9465
9466 }
9467
9468 EOF
9469 if { (eval echo configure:9470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9470 then
9471   ol_cv_pthread_threads=yes
9472 else
9473   echo "configure: failed program was:" >&5
9474   cat conftest.$ac_ext >&5
9475   rm -fr conftest*
9476   ol_cv_pthread_threads=no
9477 fi
9478 rm -fr conftest*
9479 fi
9480
9481
9482                 # restore the LIBS
9483                 LIBS="$ol_LIBS"
9484         
9485 fi
9486
9487 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
9488
9489         if test $ol_cv_pthread_threads = yes ; then
9490                 ol_link_pthreads="-threads"
9491                 ol_link_threads=posix
9492         fi
9493 fi
9494
9495
9496                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
9497 if test "$ol_link_threads" = no ; then
9498         # try -lpthreads -lmach -lexc -lc_r
9499         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
9500 echo "configure:9501: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
9501 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
9502   echo $ac_n "(cached) $ac_c" 1>&6
9503 else
9504   
9505                 # save the flags
9506                 ol_LIBS="$LIBS"
9507                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
9508
9509                 if test "$cross_compiling" = yes; then
9510   cat > conftest.$ac_ext <<EOF
9511 #line 9512 "configure"
9512 #include "confdefs.h"
9513 /* pthread test headers */
9514 #include <pthread.h>
9515 #ifndef NULL
9516 #define NULL (void*)0
9517 #endif
9518
9519 static void *task(p)
9520         void *p;
9521 {
9522         return (void *) (p == NULL);
9523 }
9524
9525 int main() {
9526
9527         /* pthread test function */
9528         pthread_t t;
9529         int status;
9530 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9531         /* This system (e.g. AIX) defaults detached; must override */
9532         pthread_attr_t attr;
9533
9534         status = pthread_attr_init(&attr);
9535         if( status ) exit( status );
9536
9537         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9538         if( status ) exit( status );
9539
9540 #define ATTR    &attr
9541 #else
9542 #if HAVE_PTHREADS_D4
9543 #define ATTR    pthread_attr_default
9544 #else
9545 #define ATTR    NULL
9546 #endif
9547 #endif
9548         /* make sure pthread_create() isn't just a stub */
9549         status = pthread_create(&t, ATTR, task, NULL);
9550         if( status ) exit( status );
9551
9552         /* make sure pthread_detach() isn't just a stub */
9553 #if HAVE_PTHREADS_D4
9554         status = pthread_detach( &t );
9555 #else
9556         status = pthread_detach( t );
9557 #endif
9558
9559 #ifdef HAVE_LINUX_THREADS
9560         pthread_kill_other_threads_np();
9561 #endif
9562
9563         exit( status );
9564
9565 ; return 0; }
9566 EOF
9567 if { (eval echo configure:9568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9568   rm -rf conftest*
9569   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
9570 else
9571   echo "configure: failed program was:" >&5
9572   cat conftest.$ac_ext >&5
9573   rm -rf conftest*
9574   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
9575 fi
9576 rm -f conftest*
9577 else
9578   cat > conftest.$ac_ext <<EOF
9579 #line 9580 "configure"
9580 #include "confdefs.h"
9581 /* pthread test headers */
9582 #include <pthread.h>
9583 #ifndef NULL
9584 #define NULL (void*)0
9585 #endif
9586
9587 static void *task(p)
9588         void *p;
9589 {
9590         return (void *) (p == NULL);
9591 }
9592
9593
9594 int main(argc, argv)
9595         int argc;
9596         char **argv;
9597 {
9598
9599         /* pthread test function */
9600         pthread_t t;
9601         int status;
9602 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9603         /* This system (e.g. AIX) defaults detached; must override */
9604         pthread_attr_t attr;
9605
9606         status = pthread_attr_init(&attr);
9607         if( status ) exit( status );
9608
9609         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9610         if( status ) exit( status );
9611
9612 #define ATTR    &attr
9613 #else
9614 #if HAVE_PTHREADS_D4
9615 #define ATTR    pthread_attr_default
9616 #else
9617 #define ATTR    NULL
9618 #endif
9619 #endif
9620         /* make sure pthread_create() isn't just a stub */
9621         status = pthread_create(&t, ATTR, task, NULL);
9622         if( status ) exit( status );
9623
9624         /* make sure pthread_detach() isn't just a stub */
9625 #if HAVE_PTHREADS_D4
9626         status = pthread_detach( &t );
9627 #else
9628         status = pthread_detach( t );
9629 #endif
9630
9631 #ifdef HAVE_LINUX_THREADS
9632         pthread_kill_other_threads_np();
9633 #endif
9634
9635         exit( status );
9636
9637 }
9638
9639 EOF
9640 if { (eval echo configure:9641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9641 then
9642   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
9643 else
9644   echo "configure: failed program was:" >&5
9645   cat conftest.$ac_ext >&5
9646   rm -fr conftest*
9647   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
9648 fi
9649 rm -fr conftest*
9650 fi
9651
9652
9653                 # restore the LIBS
9654                 LIBS="$ol_LIBS"
9655         
9656 fi
9657
9658 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
9659
9660         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
9661                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
9662                 ol_link_threads=posix
9663         fi
9664 fi
9665
9666                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
9667 if test "$ol_link_threads" = no ; then
9668         # try -lpthreads -lmach -lexc
9669         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
9670 echo "configure:9671: checking for pthread link with -lpthreads -lmach -lexc" >&5
9671 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
9672   echo $ac_n "(cached) $ac_c" 1>&6
9673 else
9674   
9675                 # save the flags
9676                 ol_LIBS="$LIBS"
9677                 LIBS="-lpthreads -lmach -lexc $LIBS"
9678
9679                 if test "$cross_compiling" = yes; then
9680   cat > conftest.$ac_ext <<EOF
9681 #line 9682 "configure"
9682 #include "confdefs.h"
9683 /* pthread test headers */
9684 #include <pthread.h>
9685 #ifndef NULL
9686 #define NULL (void*)0
9687 #endif
9688
9689 static void *task(p)
9690         void *p;
9691 {
9692         return (void *) (p == NULL);
9693 }
9694
9695 int main() {
9696
9697         /* pthread test function */
9698         pthread_t t;
9699         int status;
9700 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9701         /* This system (e.g. AIX) defaults detached; must override */
9702         pthread_attr_t attr;
9703
9704         status = pthread_attr_init(&attr);
9705         if( status ) exit( status );
9706
9707         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9708         if( status ) exit( status );
9709
9710 #define ATTR    &attr
9711 #else
9712 #if HAVE_PTHREADS_D4
9713 #define ATTR    pthread_attr_default
9714 #else
9715 #define ATTR    NULL
9716 #endif
9717 #endif
9718         /* make sure pthread_create() isn't just a stub */
9719         status = pthread_create(&t, ATTR, task, NULL);
9720         if( status ) exit( status );
9721
9722         /* make sure pthread_detach() isn't just a stub */
9723 #if HAVE_PTHREADS_D4
9724         status = pthread_detach( &t );
9725 #else
9726         status = pthread_detach( t );
9727 #endif
9728
9729 #ifdef HAVE_LINUX_THREADS
9730         pthread_kill_other_threads_np();
9731 #endif
9732
9733         exit( status );
9734
9735 ; return 0; }
9736 EOF
9737 if { (eval echo configure:9738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9738   rm -rf conftest*
9739   ol_cv_pthread_lpthreads_lmach_lexc=yes
9740 else
9741   echo "configure: failed program was:" >&5
9742   cat conftest.$ac_ext >&5
9743   rm -rf conftest*
9744   ol_cv_pthread_lpthreads_lmach_lexc=no
9745 fi
9746 rm -f conftest*
9747 else
9748   cat > conftest.$ac_ext <<EOF
9749 #line 9750 "configure"
9750 #include "confdefs.h"
9751 /* pthread test headers */
9752 #include <pthread.h>
9753 #ifndef NULL
9754 #define NULL (void*)0
9755 #endif
9756
9757 static void *task(p)
9758         void *p;
9759 {
9760         return (void *) (p == NULL);
9761 }
9762
9763
9764 int main(argc, argv)
9765         int argc;
9766         char **argv;
9767 {
9768
9769         /* pthread test function */
9770         pthread_t t;
9771         int status;
9772 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9773         /* This system (e.g. AIX) defaults detached; must override */
9774         pthread_attr_t attr;
9775
9776         status = pthread_attr_init(&attr);
9777         if( status ) exit( status );
9778
9779         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9780         if( status ) exit( status );
9781
9782 #define ATTR    &attr
9783 #else
9784 #if HAVE_PTHREADS_D4
9785 #define ATTR    pthread_attr_default
9786 #else
9787 #define ATTR    NULL
9788 #endif
9789 #endif
9790         /* make sure pthread_create() isn't just a stub */
9791         status = pthread_create(&t, ATTR, task, NULL);
9792         if( status ) exit( status );
9793
9794         /* make sure pthread_detach() isn't just a stub */
9795 #if HAVE_PTHREADS_D4
9796         status = pthread_detach( &t );
9797 #else
9798         status = pthread_detach( t );
9799 #endif
9800
9801 #ifdef HAVE_LINUX_THREADS
9802         pthread_kill_other_threads_np();
9803 #endif
9804
9805         exit( status );
9806
9807 }
9808
9809 EOF
9810 if { (eval echo configure:9811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9811 then
9812   ol_cv_pthread_lpthreads_lmach_lexc=yes
9813 else
9814   echo "configure: failed program was:" >&5
9815   cat conftest.$ac_ext >&5
9816   rm -fr conftest*
9817   ol_cv_pthread_lpthreads_lmach_lexc=no
9818 fi
9819 rm -fr conftest*
9820 fi
9821
9822
9823                 # restore the LIBS
9824                 LIBS="$ol_LIBS"
9825         
9826 fi
9827
9828 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
9829
9830         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
9831                 ol_link_pthreads="-lpthreads -lmach -lexc"
9832                 ol_link_threads=posix
9833         fi
9834 fi
9835
9836                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
9837 if test "$ol_link_threads" = no ; then
9838         # try -lpthreads -lexc
9839         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
9840 echo "configure:9841: checking for pthread link with -lpthreads -lexc" >&5
9841 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
9842   echo $ac_n "(cached) $ac_c" 1>&6
9843 else
9844   
9845                 # save the flags
9846                 ol_LIBS="$LIBS"
9847                 LIBS="-lpthreads -lexc $LIBS"
9848
9849                 if test "$cross_compiling" = yes; then
9850   cat > conftest.$ac_ext <<EOF
9851 #line 9852 "configure"
9852 #include "confdefs.h"
9853 /* pthread test headers */
9854 #include <pthread.h>
9855 #ifndef NULL
9856 #define NULL (void*)0
9857 #endif
9858
9859 static void *task(p)
9860         void *p;
9861 {
9862         return (void *) (p == NULL);
9863 }
9864
9865 int main() {
9866
9867         /* pthread test function */
9868         pthread_t t;
9869         int status;
9870 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9871         /* This system (e.g. AIX) defaults detached; must override */
9872         pthread_attr_t attr;
9873
9874         status = pthread_attr_init(&attr);
9875         if( status ) exit( status );
9876
9877         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9878         if( status ) exit( status );
9879
9880 #define ATTR    &attr
9881 #else
9882 #if HAVE_PTHREADS_D4
9883 #define ATTR    pthread_attr_default
9884 #else
9885 #define ATTR    NULL
9886 #endif
9887 #endif
9888         /* make sure pthread_create() isn't just a stub */
9889         status = pthread_create(&t, ATTR, task, NULL);
9890         if( status ) exit( status );
9891
9892         /* make sure pthread_detach() isn't just a stub */
9893 #if HAVE_PTHREADS_D4
9894         status = pthread_detach( &t );
9895 #else
9896         status = pthread_detach( t );
9897 #endif
9898
9899 #ifdef HAVE_LINUX_THREADS
9900         pthread_kill_other_threads_np();
9901 #endif
9902
9903         exit( status );
9904
9905 ; return 0; }
9906 EOF
9907 if { (eval echo configure:9908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9908   rm -rf conftest*
9909   ol_cv_pthread_lpthreads_lexc=yes
9910 else
9911   echo "configure: failed program was:" >&5
9912   cat conftest.$ac_ext >&5
9913   rm -rf conftest*
9914   ol_cv_pthread_lpthreads_lexc=no
9915 fi
9916 rm -f conftest*
9917 else
9918   cat > conftest.$ac_ext <<EOF
9919 #line 9920 "configure"
9920 #include "confdefs.h"
9921 /* pthread test headers */
9922 #include <pthread.h>
9923 #ifndef NULL
9924 #define NULL (void*)0
9925 #endif
9926
9927 static void *task(p)
9928         void *p;
9929 {
9930         return (void *) (p == NULL);
9931 }
9932
9933
9934 int main(argc, argv)
9935         int argc;
9936         char **argv;
9937 {
9938
9939         /* pthread test function */
9940         pthread_t t;
9941         int status;
9942 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9943         /* This system (e.g. AIX) defaults detached; must override */
9944         pthread_attr_t attr;
9945
9946         status = pthread_attr_init(&attr);
9947         if( status ) exit( status );
9948
9949         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9950         if( status ) exit( status );
9951
9952 #define ATTR    &attr
9953 #else
9954 #if HAVE_PTHREADS_D4
9955 #define ATTR    pthread_attr_default
9956 #else
9957 #define ATTR    NULL
9958 #endif
9959 #endif
9960         /* make sure pthread_create() isn't just a stub */
9961         status = pthread_create(&t, ATTR, task, NULL);
9962         if( status ) exit( status );
9963
9964         /* make sure pthread_detach() isn't just a stub */
9965 #if HAVE_PTHREADS_D4
9966         status = pthread_detach( &t );
9967 #else
9968         status = pthread_detach( t );
9969 #endif
9970
9971 #ifdef HAVE_LINUX_THREADS
9972         pthread_kill_other_threads_np();
9973 #endif
9974
9975         exit( status );
9976
9977 }
9978
9979 EOF
9980 if { (eval echo configure:9981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9981 then
9982   ol_cv_pthread_lpthreads_lexc=yes
9983 else
9984   echo "configure: failed program was:" >&5
9985   cat conftest.$ac_ext >&5
9986   rm -fr conftest*
9987   ol_cv_pthread_lpthreads_lexc=no
9988 fi
9989 rm -fr conftest*
9990 fi
9991
9992
9993                 # restore the LIBS
9994                 LIBS="$ol_LIBS"
9995         
9996 fi
9997
9998 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
9999
10000         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
10001                 ol_link_pthreads="-lpthreads -lexc"
10002                 ol_link_threads=posix
10003         fi
10004 fi
10005
10006
10007                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
10008 if test "$ol_link_threads" = no ; then
10009         # try -lpthreads
10010         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
10011 echo "configure:10012: checking for pthread link with -lpthreads" >&5
10012 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
10013   echo $ac_n "(cached) $ac_c" 1>&6
10014 else
10015   
10016                 # save the flags
10017                 ol_LIBS="$LIBS"
10018                 LIBS="-lpthreads $LIBS"
10019
10020                 if test "$cross_compiling" = yes; then
10021   cat > conftest.$ac_ext <<EOF
10022 #line 10023 "configure"
10023 #include "confdefs.h"
10024 /* pthread test headers */
10025 #include <pthread.h>
10026 #ifndef NULL
10027 #define NULL (void*)0
10028 #endif
10029
10030 static void *task(p)
10031         void *p;
10032 {
10033         return (void *) (p == NULL);
10034 }
10035
10036 int main() {
10037
10038         /* pthread test function */
10039         pthread_t t;
10040         int status;
10041 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
10042         /* This system (e.g. AIX) defaults detached; must override */
10043         pthread_attr_t attr;
10044
10045         status = pthread_attr_init(&attr);
10046         if( status ) exit( status );
10047
10048         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
10049         if( status ) exit( status );
10050
10051 #define ATTR    &attr
10052 #else
10053 #if HAVE_PTHREADS_D4
10054 #define ATTR    pthread_attr_default
10055 #else
10056 #define ATTR    NULL
10057 #endif
10058 #endif
10059         /* make sure pthread_create() isn't just a stub */
10060         status = pthread_create(&t, ATTR, task, NULL);
10061         if( status ) exit( status );
10062
10063         /* make sure pthread_detach() isn't just a stub */
10064 #if HAVE_PTHREADS_D4
10065         status = pthread_detach( &t );
10066 #else
10067         status = pthread_detach( t );
10068 #endif
10069
10070 #ifdef HAVE_LINUX_THREADS
10071         pthread_kill_other_threads_np();
10072 #endif
10073
10074         exit( status );
10075
10076 ; return 0; }
10077 EOF
10078 if { (eval echo configure:10079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10079   rm -rf conftest*
10080   ol_cv_pthread_lib_lpthreads=yes
10081 else
10082   echo "configure: failed program was:" >&5
10083   cat conftest.$ac_ext >&5
10084   rm -rf conftest*
10085   ol_cv_pthread_lib_lpthreads=no
10086 fi
10087 rm -f conftest*
10088 else
10089   cat > conftest.$ac_ext <<EOF
10090 #line 10091 "configure"
10091 #include "confdefs.h"
10092 /* pthread test headers */
10093 #include <pthread.h>
10094 #ifndef NULL
10095 #define NULL (void*)0
10096 #endif
10097
10098 static void *task(p)
10099         void *p;
10100 {
10101         return (void *) (p == NULL);
10102 }
10103
10104
10105 int main(argc, argv)
10106         int argc;
10107         char **argv;
10108 {
10109
10110         /* pthread test function */
10111         pthread_t t;
10112         int status;
10113 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
10114         /* This system (e.g. AIX) defaults detached; must override */
10115         pthread_attr_t attr;
10116
10117         status = pthread_attr_init(&attr);
10118         if( status ) exit( status );
10119
10120         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
10121         if( status ) exit( status );
10122
10123 #define ATTR    &attr
10124 #else
10125 #if HAVE_PTHREADS_D4
10126 #define ATTR    pthread_attr_default
10127 #else
10128 #define ATTR    NULL
10129 #endif
10130 #endif
10131         /* make sure pthread_create() isn't just a stub */
10132         status = pthread_create(&t, ATTR, task, NULL);
10133         if( status ) exit( status );
10134
10135         /* make sure pthread_detach() isn't just a stub */
10136 #if HAVE_PTHREADS_D4
10137         status = pthread_detach( &t );
10138 #else
10139         status = pthread_detach( t );
10140 #endif
10141
10142 #ifdef HAVE_LINUX_THREADS
10143         pthread_kill_other_threads_np();
10144 #endif
10145
10146         exit( status );
10147
10148 }
10149
10150 EOF
10151 if { (eval echo configure:10152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10152 then
10153   ol_cv_pthread_lib_lpthreads=yes
10154 else
10155   echo "configure: failed program was:" >&5
10156   cat conftest.$ac_ext >&5
10157   rm -fr conftest*
10158   ol_cv_pthread_lib_lpthreads=no
10159 fi
10160 rm -fr conftest*
10161 fi
10162
10163
10164                 # restore the LIBS
10165                 LIBS="$ol_LIBS"
10166         
10167 fi
10168
10169 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
10170
10171         if test $ol_cv_pthread_lib_lpthreads = yes ; then
10172                 ol_link_pthreads="-lpthreads"
10173                 ol_link_threads=posix
10174         fi
10175 fi
10176
10177
10178                 if test $ol_link_threads != no ; then
10179                         cat >> confdefs.h <<\EOF
10180 #define HAVE_PTHREADS 1
10181 EOF
10182
10183
10184                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
10185
10186                                                 save_CPPFLAGS="$CPPFLAGS"
10187                         save_LIBS="$LIBS"
10188                         LIBS="$LTHREAD_LIBS $LIBS"
10189
10190                                                                                                 for ac_func in sched_yield pthread_yield
10191 do
10192 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10193 echo "configure:10194: checking for $ac_func" >&5
10194 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10195   echo $ac_n "(cached) $ac_c" 1>&6
10196 else
10197   cat > conftest.$ac_ext <<EOF
10198 #line 10199 "configure"
10199 #include "confdefs.h"
10200 /* System header to define __stub macros and hopefully few prototypes,
10201     which can conflict with char $ac_func(); below.  */
10202 #include <assert.h>
10203 /* Override any gcc2 internal prototype to avoid an error.  */
10204 /* We use char because int might match the return type of a gcc2
10205     builtin and then its argument prototype would still apply.  */
10206 char $ac_func();
10207 char (*f)();
10208
10209 int main() {
10210
10211 /* The GNU C library defines this for functions which it implements
10212     to always fail with ENOSYS.  Some functions are actually named
10213     something starting with __ and the normal name is an alias.  */
10214 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10215 choke me
10216 #else
10217 f = $ac_func;
10218 #endif
10219
10220 ; return 0; }
10221 EOF
10222 if { (eval echo configure:10223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10223   rm -rf conftest*
10224   eval "ac_cv_func_$ac_func=yes"
10225 else
10226   echo "configure: failed program was:" >&5
10227   cat conftest.$ac_ext >&5
10228   rm -rf conftest*
10229   eval "ac_cv_func_$ac_func=no"
10230 fi
10231 rm -f conftest*
10232 fi
10233
10234 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10235   echo "$ac_t""yes" 1>&6
10236     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10237   cat >> confdefs.h <<EOF
10238 #define $ac_tr_func 1
10239 EOF
10240  
10241 else
10242   echo "$ac_t""no" 1>&6
10243 fi
10244 done
10245
10246
10247                         if test $ac_cv_func_sched_yield = no -a \
10248                                 $ac_cv_func_pthread_yield = no ; then
10249                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
10250 echo "configure:10251: checking for sched_yield in -lrt" >&5
10251 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
10252 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10253   echo $ac_n "(cached) $ac_c" 1>&6
10254 else
10255   ac_save_LIBS="$LIBS"
10256 LIBS="-lrt  $LIBS"
10257 cat > conftest.$ac_ext <<EOF
10258 #line 10259 "configure"
10259 #include "confdefs.h"
10260 /* Override any gcc2 internal prototype to avoid an error.  */
10261 /* We use char because int might match the return type of a gcc2
10262     builtin and then its argument prototype would still apply.  */
10263 char sched_yield();
10264
10265 int main() {
10266 sched_yield()
10267 ; return 0; }
10268 EOF
10269 if { (eval echo configure:10270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10270   rm -rf conftest*
10271   eval "ac_cv_lib_$ac_lib_var=yes"
10272 else
10273   echo "configure: failed program was:" >&5
10274   cat conftest.$ac_ext >&5
10275   rm -rf conftest*
10276   eval "ac_cv_lib_$ac_lib_var=no"
10277 fi
10278 rm -f conftest*
10279 LIBS="$ac_save_LIBS"
10280
10281 fi
10282 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10283   echo "$ac_t""yes" 1>&6
10284   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
10285                                         cat >> confdefs.h <<\EOF
10286 #define HAVE_SCHED_YIELD 1
10287 EOF
10288
10289                                         ac_cv_func_sched_yield=yes
10290 else
10291   echo "$ac_t""no" 1>&6
10292 ac_cv_func_sched_yield=no
10293 fi
10294
10295                         fi
10296                         if test $ac_cv_func_sched_yield = no -a \
10297                                 $ac_cv_func_pthread_yield = no ; then
10298                                                                                                 for ac_func in thr_yield
10299 do
10300 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10301 echo "configure:10302: checking for $ac_func" >&5
10302 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10303   echo $ac_n "(cached) $ac_c" 1>&6
10304 else
10305   cat > conftest.$ac_ext <<EOF
10306 #line 10307 "configure"
10307 #include "confdefs.h"
10308 /* System header to define __stub macros and hopefully few prototypes,
10309     which can conflict with char $ac_func(); below.  */
10310 #include <assert.h>
10311 /* Override any gcc2 internal prototype to avoid an error.  */
10312 /* We use char because int might match the return type of a gcc2
10313     builtin and then its argument prototype would still apply.  */
10314 char $ac_func();
10315 char (*f)();
10316
10317 int main() {
10318
10319 /* The GNU C library defines this for functions which it implements
10320     to always fail with ENOSYS.  Some functions are actually named
10321     something starting with __ and the normal name is an alias.  */
10322 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10323 choke me
10324 #else
10325 f = $ac_func;
10326 #endif
10327
10328 ; return 0; }
10329 EOF
10330 if { (eval echo configure:10331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10331   rm -rf conftest*
10332   eval "ac_cv_func_$ac_func=yes"
10333 else
10334   echo "configure: failed program was:" >&5
10335   cat conftest.$ac_ext >&5
10336   rm -rf conftest*
10337   eval "ac_cv_func_$ac_func=no"
10338 fi
10339 rm -f conftest*
10340 fi
10341
10342 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10343   echo "$ac_t""yes" 1>&6
10344     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10345   cat >> confdefs.h <<EOF
10346 #define $ac_tr_func 1
10347 EOF
10348  
10349 else
10350   echo "$ac_t""no" 1>&6
10351 fi
10352 done
10353
10354                         fi
10355                         if test $ac_cv_func_sched_yield = no -a \
10356                                 $ac_cv_func_pthread_yield = no -a \
10357                                 "$ac_cv_func_thr_yield" = no ; then
10358                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
10359                         fi
10360
10361                                                 for ac_func in pthread_kill
10362 do
10363 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10364 echo "configure:10365: checking for $ac_func" >&5
10365 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10366   echo $ac_n "(cached) $ac_c" 1>&6
10367 else
10368   cat > conftest.$ac_ext <<EOF
10369 #line 10370 "configure"
10370 #include "confdefs.h"
10371 /* System header to define __stub macros and hopefully few prototypes,
10372     which can conflict with char $ac_func(); below.  */
10373 #include <assert.h>
10374 /* Override any gcc2 internal prototype to avoid an error.  */
10375 /* We use char because int might match the return type of a gcc2
10376     builtin and then its argument prototype would still apply.  */
10377 char $ac_func();
10378 char (*f)();
10379
10380 int main() {
10381
10382 /* The GNU C library defines this for functions which it implements
10383     to always fail with ENOSYS.  Some functions are actually named
10384     something starting with __ and the normal name is an alias.  */
10385 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10386 choke me
10387 #else
10388 f = $ac_func;
10389 #endif
10390
10391 ; return 0; }
10392 EOF
10393 if { (eval echo configure:10394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10394   rm -rf conftest*
10395   eval "ac_cv_func_$ac_func=yes"
10396 else
10397   echo "configure: failed program was:" >&5
10398   cat conftest.$ac_ext >&5
10399   rm -rf conftest*
10400   eval "ac_cv_func_$ac_func=no"
10401 fi
10402 rm -f conftest*
10403 fi
10404
10405 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10406   echo "$ac_t""yes" 1>&6
10407     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10408   cat >> confdefs.h <<EOF
10409 #define $ac_tr_func 1
10410 EOF
10411  
10412 else
10413   echo "$ac_t""no" 1>&6
10414 fi
10415 done
10416
10417
10418                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
10419 echo "configure:10420: checking for pthread_detach with <pthread.h>" >&5
10420 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
10421   echo $ac_n "(cached) $ac_c" 1>&6
10422 else
10423   
10424                                                                 cat > conftest.$ac_ext <<EOF
10425 #line 10426 "configure"
10426 #include "confdefs.h"
10427
10428 #include <pthread.h>
10429 #ifndef NULL
10430 #define NULL (void*)0
10431 #endif
10432
10433 int main() {
10434 pthread_detach(NULL);
10435 ; return 0; }
10436 EOF
10437 if { (eval echo configure:10438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10438   rm -rf conftest*
10439   ol_cv_func_pthread_detach=yes
10440 else
10441   echo "configure: failed program was:" >&5
10442   cat conftest.$ac_ext >&5
10443   rm -rf conftest*
10444   ol_cv_func_pthread_detach=no
10445 fi
10446 rm -f conftest*
10447                         
10448 fi
10449
10450 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
10451
10452                         if test $ol_cv_func_pthread_detach = no ; then
10453                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
10454                         fi
10455
10456                         cat >> confdefs.h <<\EOF
10457 #define HAVE_PTHREAD_DETACH 1
10458 EOF
10459
10460
10461                                                 for ac_func in \
10462                                 pthread_setconcurrency \
10463                                 pthread_getconcurrency \
10464                                 thr_setconcurrency \
10465                                 thr_getconcurrency \
10466                         
10467 do
10468 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10469 echo "configure:10470: checking for $ac_func" >&5
10470 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10471   echo $ac_n "(cached) $ac_c" 1>&6
10472 else
10473   cat > conftest.$ac_ext <<EOF
10474 #line 10475 "configure"
10475 #include "confdefs.h"
10476 /* System header to define __stub macros and hopefully few prototypes,
10477     which can conflict with char $ac_func(); below.  */
10478 #include <assert.h>
10479 /* Override any gcc2 internal prototype to avoid an error.  */
10480 /* We use char because int might match the return type of a gcc2
10481     builtin and then its argument prototype would still apply.  */
10482 char $ac_func();
10483 char (*f)();
10484
10485 int main() {
10486
10487 /* The GNU C library defines this for functions which it implements
10488     to always fail with ENOSYS.  Some functions are actually named
10489     something starting with __ and the normal name is an alias.  */
10490 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10491 choke me
10492 #else
10493 f = $ac_func;
10494 #endif
10495
10496 ; return 0; }
10497 EOF
10498 if { (eval echo configure:10499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10499   rm -rf conftest*
10500   eval "ac_cv_func_$ac_func=yes"
10501 else
10502   echo "configure: failed program was:" >&5
10503   cat conftest.$ac_ext >&5
10504   rm -rf conftest*
10505   eval "ac_cv_func_$ac_func=no"
10506 fi
10507 rm -f conftest*
10508 fi
10509
10510 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10511   echo "$ac_t""yes" 1>&6
10512     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10513   cat >> confdefs.h <<EOF
10514 #define $ac_tr_func 1
10515 EOF
10516  
10517 else
10518   echo "$ac_t""no" 1>&6
10519 fi
10520 done
10521
10522
10523                         
10524         echo $ac_n "checking for pthread_kill_other_threads_np""... $ac_c" 1>&6
10525 echo "configure:10526: checking for pthread_kill_other_threads_np" >&5
10526 if eval "test \"\${ac_cv_func_pthread_kill_other_threads_np+set}\" = set"; then
10527   echo $ac_n "(cached) $ac_c" 1>&6
10528 else
10529   cat > conftest.$ac_ext <<EOF
10530 #line 10531 "configure"
10531 #include "confdefs.h"
10532 /* System header to define __stub macros and hopefully few prototypes,
10533     which can conflict with char pthread_kill_other_threads_np(); below.  */
10534 #include <assert.h>
10535 /* Override any gcc2 internal prototype to avoid an error.  */
10536 /* We use char because int might match the return type of a gcc2
10537     builtin and then its argument prototype would still apply.  */
10538 char pthread_kill_other_threads_np();
10539 char (*f)();
10540
10541 int main() {
10542
10543 /* The GNU C library defines this for functions which it implements
10544     to always fail with ENOSYS.  Some functions are actually named
10545     something starting with __ and the normal name is an alias.  */
10546 #if defined (__stub_pthread_kill_other_threads_np) || defined (__stub___pthread_kill_other_threads_np)
10547 choke me
10548 #else
10549 f = pthread_kill_other_threads_np;
10550 #endif
10551
10552 ; return 0; }
10553 EOF
10554 if { (eval echo configure:10555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10555   rm -rf conftest*
10556   eval "ac_cv_func_pthread_kill_other_threads_np=yes"
10557 else
10558   echo "configure: failed program was:" >&5
10559   cat conftest.$ac_ext >&5
10560   rm -rf conftest*
10561   eval "ac_cv_func_pthread_kill_other_threads_np=no"
10562 fi
10563 rm -f conftest*
10564 fi
10565
10566 if eval "test \"`echo '$ac_cv_func_'pthread_kill_other_threads_np`\" = yes"; then
10567   echo "$ac_t""yes" 1>&6
10568   :
10569 else
10570   echo "$ac_t""no" 1>&6
10571 fi
10572
10573         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
10574 echo "configure:10575: checking for LinuxThreads implementation" >&5
10575 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
10576   echo $ac_n "(cached) $ac_c" 1>&6
10577 else
10578   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
10579 fi
10580
10581 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
10582
10583                         
10584         
10585         
10586         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
10587 echo "configure:10588: checking for LinuxThreads consistency" >&5
10588 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
10589   echo $ac_n "(cached) $ac_c" 1>&6
10590 else
10591   
10592                 if test $ol_cv_header_linux_threads = yes -a \
10593                         $ol_cv_sys_linux_threads = yes; then
10594                         ol_cv_linux_threads=yes
10595                 elif test $ol_cv_header_linux_threads = no -a \
10596                         $ol_cv_sys_linux_threads = no; then
10597                         ol_cv_linux_threads=no
10598                 else
10599                         ol_cv_linux_threads=error
10600                 fi
10601         
10602 fi
10603
10604 echo "$ac_t""$ol_cv_linux_threads" 1>&6
10605
10606
10607                         if test $ol_cv_linux_threads = error; then
10608                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
10609                         fi
10610
10611                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
10612 echo "configure:10613: checking if pthread_create() works" >&5
10613 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
10614   echo $ac_n "(cached) $ac_c" 1>&6
10615 else
10616   
10617                         if test "$cross_compiling" = yes; then
10618                                 ol_cv_pthread_create_works=yes
10619 else
10620   cat > conftest.$ac_ext <<EOF
10621 #line 10622 "configure"
10622 #include "confdefs.h"
10623 /* pthread test headers */
10624 #include <pthread.h>
10625 #ifndef NULL
10626 #define NULL (void*)0
10627 #endif
10628
10629 static void *task(p)
10630         void *p;
10631 {
10632         return (void *) (p == NULL);
10633 }
10634
10635
10636 int main(argc, argv)
10637         int argc;
10638         char **argv;
10639 {
10640
10641         /* pthread test function */
10642         pthread_t t;
10643         int status;
10644 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
10645         /* This system (e.g. AIX) defaults detached; must override */
10646         pthread_attr_t attr;
10647
10648         status = pthread_attr_init(&attr);
10649         if( status ) exit( status );
10650
10651         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
10652         if( status ) exit( status );
10653
10654 #define ATTR    &attr
10655 #else
10656 #if HAVE_PTHREADS_D4
10657 #define ATTR    pthread_attr_default
10658 #else
10659 #define ATTR    NULL
10660 #endif
10661 #endif
10662         /* make sure pthread_create() isn't just a stub */
10663         status = pthread_create(&t, ATTR, task, NULL);
10664         if( status ) exit( status );
10665
10666         /* make sure pthread_detach() isn't just a stub */
10667 #if HAVE_PTHREADS_D4
10668         status = pthread_detach( &t );
10669 #else
10670         status = pthread_detach( t );
10671 #endif
10672
10673 #ifdef HAVE_LINUX_THREADS
10674         pthread_kill_other_threads_np();
10675 #endif
10676
10677         exit( status );
10678
10679 }
10680
10681 EOF
10682 if { (eval echo configure:10683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10683 then
10684   ol_cv_pthread_create_works=yes
10685 else
10686   echo "configure: failed program was:" >&5
10687   cat conftest.$ac_ext >&5
10688   rm -fr conftest*
10689   ol_cv_pthread_create_works=no
10690 fi
10691 rm -fr conftest*
10692 fi
10693
10694 fi
10695
10696 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
10697
10698                         if test $ol_cv_pthread_create_works = no ; then
10699                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
10700                         fi
10701
10702                                                 if test $ol_with_yielding_select = auto ; then
10703                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
10704 echo "configure:10705: checking if select yields when using pthreads" >&5
10705 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
10706   echo $ac_n "(cached) $ac_c" 1>&6
10707 else
10708   
10709                                 if test "$cross_compiling" = yes; then
10710   ol_cv_pthread_select_yields=cross
10711 else
10712   cat > conftest.$ac_ext <<EOF
10713 #line 10714 "configure"
10714 #include "confdefs.h"
10715
10716 #include <sys/types.h>
10717 #include <sys/time.h>
10718 #include <unistd.h>
10719 #include <pthread.h>
10720 #ifndef NULL
10721 #define NULL (void*) 0
10722 #endif
10723
10724 static int fildes[2];
10725
10726 static void *task(p)
10727         void *p;
10728 {
10729         int i;
10730         struct timeval tv;
10731
10732         fd_set rfds;
10733
10734         tv.tv_sec=10;
10735         tv.tv_usec=0;
10736
10737         FD_ZERO(&rfds);
10738         FD_SET(fildes[0], &rfds);
10739
10740         /* we're not interested in any fds */
10741         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
10742
10743         if(i < 0) {
10744                 perror("select");
10745                 exit(10);
10746         }
10747
10748         exit(0); /* if we exit here, the select blocked the whole process */
10749 }
10750
10751 int main(argc, argv)
10752         int argc;
10753         char **argv;
10754 {
10755         pthread_t t;
10756
10757         /* create a pipe to select */
10758         if(pipe(&fildes[0])) {
10759                 perror("select");
10760                 exit(1);
10761         }
10762
10763 #ifdef HAVE_PTHREAD_SETCONCURRENCY
10764         (void) pthread_setconcurrency(2);
10765 #else
10766 #ifdef HAVE_THR_SETCONCURRENCY
10767         /* Set Solaris LWP concurrency to 2 */
10768         thr_setconcurrency(2);
10769 #endif
10770 #endif
10771
10772 #if HAVE_PTHREADS_D4
10773         pthread_create(&t, pthread_attr_default, task, NULL);
10774 #else
10775         pthread_create(&t, NULL, task, NULL);
10776 #endif
10777
10778 #if HAVE_SCHED_YIELD
10779         sched_yield();  /* make sure task runs first */
10780 #else
10781 #ifdef HAVE_PTHREAD_YIELD
10782         pthread_yield();        /* make sure task runs first */
10783 #endif
10784 #endif
10785
10786         exit(2);
10787 }
10788 EOF
10789 if { (eval echo configure:10790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10790 then
10791   ol_cv_pthread_select_yields=no
10792 else
10793   echo "configure: failed program was:" >&5
10794   cat conftest.$ac_ext >&5
10795   rm -fr conftest*
10796   ol_cv_pthread_select_yields=yes
10797 fi
10798 rm -fr conftest*
10799 fi
10800
10801 fi
10802
10803 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
10804
10805                                 if test $ol_cv_pthread_select_yields = cross ; then
10806                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
10807                                 fi
10808
10809                                 if test $ol_cv_pthread_select_yields = yes ; then
10810                                         ol_with_yielding_select=yes
10811                                 fi
10812                         fi
10813
10814                                                 CPPFLAGS="$save_CPPFLAGS"
10815                         LIBS="$save_LIBS"
10816                 else
10817                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
10818                 fi
10819         fi
10820
10821         if test $ol_with_threads = posix ; then
10822                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
10823         fi
10824 fi
10825
10826 if test $ol_with_threads = auto -o $ol_with_threads = yes \
10827         -o $ol_with_threads = mach ; then
10828
10829                 for ac_hdr in mach/cthreads.h
10830 do
10831 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10832 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10833 echo "configure:10834: checking for $ac_hdr" >&5
10834 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10835   echo $ac_n "(cached) $ac_c" 1>&6
10836 else
10837   cat > conftest.$ac_ext <<EOF
10838 #line 10839 "configure"
10839 #include "confdefs.h"
10840 #include <$ac_hdr>
10841 EOF
10842 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10843 { (eval echo configure:10844: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10844 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10845 if test -z "$ac_err"; then
10846   rm -rf conftest*
10847   eval "ac_cv_header_$ac_safe=yes"
10848 else
10849   echo "$ac_err" >&5
10850   echo "configure: failed program was:" >&5
10851   cat conftest.$ac_ext >&5
10852   rm -rf conftest*
10853   eval "ac_cv_header_$ac_safe=no"
10854 fi
10855 rm -f conftest*
10856 fi
10857 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10858   echo "$ac_t""yes" 1>&6
10859     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10860   cat >> confdefs.h <<EOF
10861 #define $ac_tr_hdr 1
10862 EOF
10863  
10864 else
10865   echo "$ac_t""no" 1>&6
10866 fi
10867 done
10868
10869         if test $ac_cv_header_mach_cthreads_h = yes ; then
10870                 ol_with_threads=found
10871
10872                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
10873 echo "configure:10874: checking for cthread_fork" >&5
10874 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
10875   echo $ac_n "(cached) $ac_c" 1>&6
10876 else
10877   cat > conftest.$ac_ext <<EOF
10878 #line 10879 "configure"
10879 #include "confdefs.h"
10880 /* System header to define __stub macros and hopefully few prototypes,
10881     which can conflict with char cthread_fork(); below.  */
10882 #include <assert.h>
10883 /* Override any gcc2 internal prototype to avoid an error.  */
10884 /* We use char because int might match the return type of a gcc2
10885     builtin and then its argument prototype would still apply.  */
10886 char cthread_fork();
10887 char (*f)();
10888
10889 int main() {
10890
10891 /* The GNU C library defines this for functions which it implements
10892     to always fail with ENOSYS.  Some functions are actually named
10893     something starting with __ and the normal name is an alias.  */
10894 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
10895 choke me
10896 #else
10897 f = cthread_fork;
10898 #endif
10899
10900 ; return 0; }
10901 EOF
10902 if { (eval echo configure:10903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10903   rm -rf conftest*
10904   eval "ac_cv_func_cthread_fork=yes"
10905 else
10906   echo "configure: failed program was:" >&5
10907   cat conftest.$ac_ext >&5
10908   rm -rf conftest*
10909   eval "ac_cv_func_cthread_fork=no"
10910 fi
10911 rm -f conftest*
10912 fi
10913
10914 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
10915   echo "$ac_t""yes" 1>&6
10916   ol_link_threads=yes
10917 else
10918   echo "$ac_t""no" 1>&6
10919 fi
10920
10921
10922                 if test $ol_link_threads = no ; then
10923                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
10924 echo "configure:10925: checking for cthread_fork with -all_load" >&5
10925 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
10926   echo $ac_n "(cached) $ac_c" 1>&6
10927 else
10928   
10929                                                                 save_LIBS="$LIBS"
10930                                 LIBS="-all_load $LIBS"
10931                                 cat > conftest.$ac_ext <<EOF
10932 #line 10933 "configure"
10933 #include "confdefs.h"
10934 #include <mach/cthreads.h>
10935 int main() {
10936
10937                                         cthread_fork((void *)0, (void *)0);
10938                                         
10939 ; return 0; }
10940 EOF
10941 if { (eval echo configure:10942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10942   rm -rf conftest*
10943   ol_cv_cthread_all_load=yes
10944 else
10945   echo "configure: failed program was:" >&5
10946   cat conftest.$ac_ext >&5
10947   rm -rf conftest*
10948   ol_cv_cthread_all_load=no
10949 fi
10950 rm -f conftest*
10951                                                                 LIBS="$save_LIBS"
10952                         
10953 fi
10954
10955 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
10956
10957                         if test $ol_cv_cthread_all_load = yes ; then
10958                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
10959                                 ol_link_threads=mach
10960                         fi
10961                 fi
10962
10963                 if test $ol_link_threads != no ; then
10964                         : check for cthread specific functionality here
10965                         cat >> confdefs.h <<\EOF
10966 #define HAVE_MACH_CTHREADS 1
10967 EOF
10968
10969                 else
10970                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
10971                 fi
10972         fi
10973
10974         if test $ol_with_threads = mach ; then
10975                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
10976         fi
10977 fi
10978
10979 if test $ol_with_threads = auto -o $ol_with_threads = yes \
10980         -o $ol_with_threads = pth ; then
10981
10982         for ac_hdr in pth.h
10983 do
10984 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10985 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10986 echo "configure:10987: checking for $ac_hdr" >&5
10987 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10988   echo $ac_n "(cached) $ac_c" 1>&6
10989 else
10990   cat > conftest.$ac_ext <<EOF
10991 #line 10992 "configure"
10992 #include "confdefs.h"
10993 #include <$ac_hdr>
10994 EOF
10995 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10996 { (eval echo configure:10997: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10997 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10998 if test -z "$ac_err"; then
10999   rm -rf conftest*
11000   eval "ac_cv_header_$ac_safe=yes"
11001 else
11002   echo "$ac_err" >&5
11003   echo "configure: failed program was:" >&5
11004   cat conftest.$ac_ext >&5
11005   rm -rf conftest*
11006   eval "ac_cv_header_$ac_safe=no"
11007 fi
11008 rm -f conftest*
11009 fi
11010 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11011   echo "$ac_t""yes" 1>&6
11012     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11013   cat >> confdefs.h <<EOF
11014 #define $ac_tr_hdr 1
11015 EOF
11016  
11017 else
11018   echo "$ac_t""no" 1>&6
11019 fi
11020 done
11021
11022
11023         if test $ac_cv_header_pth_h = yes ; then
11024                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
11025 echo "configure:11026: checking for pth_version in -lpth" >&5
11026 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
11027 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11028   echo $ac_n "(cached) $ac_c" 1>&6
11029 else
11030   ac_save_LIBS="$LIBS"
11031 LIBS="-lpth  $LIBS"
11032 cat > conftest.$ac_ext <<EOF
11033 #line 11034 "configure"
11034 #include "confdefs.h"
11035 /* Override any gcc2 internal prototype to avoid an error.  */
11036 /* We use char because int might match the return type of a gcc2
11037     builtin and then its argument prototype would still apply.  */
11038 char pth_version();
11039
11040 int main() {
11041 pth_version()
11042 ; return 0; }
11043 EOF
11044 if { (eval echo configure:11045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11045   rm -rf conftest*
11046   eval "ac_cv_lib_$ac_lib_var=yes"
11047 else
11048   echo "configure: failed program was:" >&5
11049   cat conftest.$ac_ext >&5
11050   rm -rf conftest*
11051   eval "ac_cv_lib_$ac_lib_var=no"
11052 fi
11053 rm -f conftest*
11054 LIBS="$ac_save_LIBS"
11055
11056 fi
11057 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11058   echo "$ac_t""yes" 1>&6
11059   have_pth=yes
11060 else
11061   echo "$ac_t""no" 1>&6
11062 have_pth=no
11063 fi
11064
11065
11066                 if test $have_pth = yes ; then
11067                         cat >> confdefs.h <<\EOF
11068 #define HAVE_GNU_PTH 1
11069 EOF
11070
11071                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
11072                         ol_link_threads=pth
11073
11074                         if test $ol_with_yielding_select = auto ; then
11075                                 ol_with_yielding_select=yes
11076                         fi
11077                 fi
11078         fi
11079 fi
11080
11081 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11082         -o $ol_with_threads = lwp ; then
11083
11084                 for ac_hdr in thread.h synch.h
11085 do
11086 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11087 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11088 echo "configure:11089: checking for $ac_hdr" >&5
11089 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11090   echo $ac_n "(cached) $ac_c" 1>&6
11091 else
11092   cat > conftest.$ac_ext <<EOF
11093 #line 11094 "configure"
11094 #include "confdefs.h"
11095 #include <$ac_hdr>
11096 EOF
11097 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11098 { (eval echo configure:11099: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11099 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11100 if test -z "$ac_err"; then
11101   rm -rf conftest*
11102   eval "ac_cv_header_$ac_safe=yes"
11103 else
11104   echo "$ac_err" >&5
11105   echo "configure: failed program was:" >&5
11106   cat conftest.$ac_ext >&5
11107   rm -rf conftest*
11108   eval "ac_cv_header_$ac_safe=no"
11109 fi
11110 rm -f conftest*
11111 fi
11112 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11113   echo "$ac_t""yes" 1>&6
11114     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11115   cat >> confdefs.h <<EOF
11116 #define $ac_tr_hdr 1
11117 EOF
11118  
11119 else
11120   echo "$ac_t""no" 1>&6
11121 fi
11122 done
11123
11124         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
11125                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
11126 echo "configure:11127: checking for thr_create in -lthread" >&5
11127 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
11128 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11129   echo $ac_n "(cached) $ac_c" 1>&6
11130 else
11131   ac_save_LIBS="$LIBS"
11132 LIBS="-lthread  $LIBS"
11133 cat > conftest.$ac_ext <<EOF
11134 #line 11135 "configure"
11135 #include "confdefs.h"
11136 /* Override any gcc2 internal prototype to avoid an error.  */
11137 /* We use char because int might match the return type of a gcc2
11138     builtin and then its argument prototype would still apply.  */
11139 char thr_create();
11140
11141 int main() {
11142 thr_create()
11143 ; return 0; }
11144 EOF
11145 if { (eval echo configure:11146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11146   rm -rf conftest*
11147   eval "ac_cv_lib_$ac_lib_var=yes"
11148 else
11149   echo "configure: failed program was:" >&5
11150   cat conftest.$ac_ext >&5
11151   rm -rf conftest*
11152   eval "ac_cv_lib_$ac_lib_var=no"
11153 fi
11154 rm -f conftest*
11155 LIBS="$ac_save_LIBS"
11156
11157 fi
11158 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11159   echo "$ac_t""yes" 1>&6
11160   have_thr=yes
11161 else
11162   echo "$ac_t""no" 1>&6
11163 have_thr=no
11164 fi
11165
11166
11167                 if test $have_thr = yes ; then
11168                         cat >> confdefs.h <<\EOF
11169 #define HAVE_THR 1
11170 EOF
11171
11172                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
11173                         ol_link_threads=thr
11174
11175                         if test $ol_with_yielding_select = auto ; then
11176                                 ol_with_yielding_select=yes
11177                         fi
11178
11179                                                 for ac_func in \
11180                                 thr_setconcurrency \
11181                                 thr_getconcurrency \
11182                         
11183 do
11184 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11185 echo "configure:11186: checking for $ac_func" >&5
11186 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11187   echo $ac_n "(cached) $ac_c" 1>&6
11188 else
11189   cat > conftest.$ac_ext <<EOF
11190 #line 11191 "configure"
11191 #include "confdefs.h"
11192 /* System header to define __stub macros and hopefully few prototypes,
11193     which can conflict with char $ac_func(); below.  */
11194 #include <assert.h>
11195 /* Override any gcc2 internal prototype to avoid an error.  */
11196 /* We use char because int might match the return type of a gcc2
11197     builtin and then its argument prototype would still apply.  */
11198 char $ac_func();
11199 char (*f)();
11200
11201 int main() {
11202
11203 /* The GNU C library defines this for functions which it implements
11204     to always fail with ENOSYS.  Some functions are actually named
11205     something starting with __ and the normal name is an alias.  */
11206 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11207 choke me
11208 #else
11209 f = $ac_func;
11210 #endif
11211
11212 ; return 0; }
11213 EOF
11214 if { (eval echo configure:11215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11215   rm -rf conftest*
11216   eval "ac_cv_func_$ac_func=yes"
11217 else
11218   echo "configure: failed program was:" >&5
11219   cat conftest.$ac_ext >&5
11220   rm -rf conftest*
11221   eval "ac_cv_func_$ac_func=no"
11222 fi
11223 rm -f conftest*
11224 fi
11225
11226 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11227   echo "$ac_t""yes" 1>&6
11228     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11229   cat >> confdefs.h <<EOF
11230 #define $ac_tr_func 1
11231 EOF
11232  
11233 else
11234   echo "$ac_t""no" 1>&6
11235 fi
11236 done
11237
11238                 fi
11239         fi
11240
11241                 for ac_hdr in lwp/lwp.h
11242 do
11243 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11244 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11245 echo "configure:11246: checking for $ac_hdr" >&5
11246 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11247   echo $ac_n "(cached) $ac_c" 1>&6
11248 else
11249   cat > conftest.$ac_ext <<EOF
11250 #line 11251 "configure"
11251 #include "confdefs.h"
11252 #include <$ac_hdr>
11253 EOF
11254 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11255 { (eval echo configure:11256: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11256 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11257 if test -z "$ac_err"; then
11258   rm -rf conftest*
11259   eval "ac_cv_header_$ac_safe=yes"
11260 else
11261   echo "$ac_err" >&5
11262   echo "configure: failed program was:" >&5
11263   cat conftest.$ac_ext >&5
11264   rm -rf conftest*
11265   eval "ac_cv_header_$ac_safe=no"
11266 fi
11267 rm -f conftest*
11268 fi
11269 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11270   echo "$ac_t""yes" 1>&6
11271     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11272   cat >> confdefs.h <<EOF
11273 #define $ac_tr_hdr 1
11274 EOF
11275  
11276 else
11277   echo "$ac_t""no" 1>&6
11278 fi
11279 done
11280
11281         if test $ac_cv_header_lwp_lwp_h = yes ; then
11282                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
11283 echo "configure:11284: checking for lwp_create in -llwp" >&5
11284 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
11285 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11286   echo $ac_n "(cached) $ac_c" 1>&6
11287 else
11288   ac_save_LIBS="$LIBS"
11289 LIBS="-llwp  $LIBS"
11290 cat > conftest.$ac_ext <<EOF
11291 #line 11292 "configure"
11292 #include "confdefs.h"
11293 /* Override any gcc2 internal prototype to avoid an error.  */
11294 /* We use char because int might match the return type of a gcc2
11295     builtin and then its argument prototype would still apply.  */
11296 char lwp_create();
11297
11298 int main() {
11299 lwp_create()
11300 ; return 0; }
11301 EOF
11302 if { (eval echo configure:11303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11303   rm -rf conftest*
11304   eval "ac_cv_lib_$ac_lib_var=yes"
11305 else
11306   echo "configure: failed program was:" >&5
11307   cat conftest.$ac_ext >&5
11308   rm -rf conftest*
11309   eval "ac_cv_lib_$ac_lib_var=no"
11310 fi
11311 rm -f conftest*
11312 LIBS="$ac_save_LIBS"
11313
11314 fi
11315 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11316   echo "$ac_t""yes" 1>&6
11317   have_lwp=yes
11318 else
11319   echo "$ac_t""no" 1>&6
11320 have_lwp=no
11321 fi
11322
11323
11324                 if test $have_lwp = yes ; then
11325                         cat >> confdefs.h <<\EOF
11326 #define HAVE_LWP 1
11327 EOF
11328
11329                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
11330                         ol_link_threads=lwp
11331
11332                         if test $ol_with_yielding_select = auto ; then
11333                                 ol_with_yielding_select=no
11334                         fi
11335                 fi
11336         fi
11337 fi
11338
11339 if test $ol_with_yielding_select = yes ; then
11340         cat >> confdefs.h <<\EOF
11341 #define HAVE_YIELDING_SELECT 1
11342 EOF
11343
11344 fi
11345
11346 if test $ol_with_threads = manual ; then
11347                 ol_link_threads=yes
11348
11349         echo "configure: warning: thread defines and link options must be set manually" 1>&2
11350
11351         for ac_hdr in pthread.h sched.h
11352 do
11353 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11354 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11355 echo "configure:11356: checking for $ac_hdr" >&5
11356 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11357   echo $ac_n "(cached) $ac_c" 1>&6
11358 else
11359   cat > conftest.$ac_ext <<EOF
11360 #line 11361 "configure"
11361 #include "confdefs.h"
11362 #include <$ac_hdr>
11363 EOF
11364 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11365 { (eval echo configure:11366: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11366 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11367 if test -z "$ac_err"; then
11368   rm -rf conftest*
11369   eval "ac_cv_header_$ac_safe=yes"
11370 else
11371   echo "$ac_err" >&5
11372   echo "configure: failed program was:" >&5
11373   cat conftest.$ac_ext >&5
11374   rm -rf conftest*
11375   eval "ac_cv_header_$ac_safe=no"
11376 fi
11377 rm -f conftest*
11378 fi
11379 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11380   echo "$ac_t""yes" 1>&6
11381     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11382   cat >> confdefs.h <<EOF
11383 #define $ac_tr_hdr 1
11384 EOF
11385  
11386 else
11387   echo "$ac_t""no" 1>&6
11388 fi
11389 done
11390
11391         for ac_func in sched_yield pthread_yield
11392 do
11393 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11394 echo "configure:11395: checking for $ac_func" >&5
11395 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11396   echo $ac_n "(cached) $ac_c" 1>&6
11397 else
11398   cat > conftest.$ac_ext <<EOF
11399 #line 11400 "configure"
11400 #include "confdefs.h"
11401 /* System header to define __stub macros and hopefully few prototypes,
11402     which can conflict with char $ac_func(); below.  */
11403 #include <assert.h>
11404 /* Override any gcc2 internal prototype to avoid an error.  */
11405 /* We use char because int might match the return type of a gcc2
11406     builtin and then its argument prototype would still apply.  */
11407 char $ac_func();
11408 char (*f)();
11409
11410 int main() {
11411
11412 /* The GNU C library defines this for functions which it implements
11413     to always fail with ENOSYS.  Some functions are actually named
11414     something starting with __ and the normal name is an alias.  */
11415 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11416 choke me
11417 #else
11418 f = $ac_func;
11419 #endif
11420
11421 ; return 0; }
11422 EOF
11423 if { (eval echo configure:11424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11424   rm -rf conftest*
11425   eval "ac_cv_func_$ac_func=yes"
11426 else
11427   echo "configure: failed program was:" >&5
11428   cat conftest.$ac_ext >&5
11429   rm -rf conftest*
11430   eval "ac_cv_func_$ac_func=no"
11431 fi
11432 rm -f conftest*
11433 fi
11434
11435 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11436   echo "$ac_t""yes" 1>&6
11437     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11438   cat >> confdefs.h <<EOF
11439 #define $ac_tr_func 1
11440 EOF
11441  
11442 else
11443   echo "$ac_t""no" 1>&6
11444 fi
11445 done
11446
11447         
11448         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
11449 echo "configure:11450: checking for LinuxThreads pthread.h" >&5
11450 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
11451   echo $ac_n "(cached) $ac_c" 1>&6
11452 else
11453   cat > conftest.$ac_ext <<EOF
11454 #line 11455 "configure"
11455 #include "confdefs.h"
11456 #include <pthread.h>
11457 EOF
11458 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11459   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
11460   rm -rf conftest*
11461   ol_cv_header_linux_threads=yes
11462 else
11463   rm -rf conftest*
11464   ol_cv_header_linux_threads=no
11465 fi
11466 rm -f conftest*
11467
11468                 
11469 fi
11470
11471 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
11472         if test $ol_cv_header_linux_threads = yes; then
11473                 cat >> confdefs.h <<\EOF
11474 #define HAVE_LINUX_THREADS 1
11475 EOF
11476
11477         fi
11478
11479
11480         for ac_hdr in mach/cthreads.h
11481 do
11482 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11483 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11484 echo "configure:11485: checking for $ac_hdr" >&5
11485 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11486   echo $ac_n "(cached) $ac_c" 1>&6
11487 else
11488   cat > conftest.$ac_ext <<EOF
11489 #line 11490 "configure"
11490 #include "confdefs.h"
11491 #include <$ac_hdr>
11492 EOF
11493 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11494 { (eval echo configure:11495: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11495 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11496 if test -z "$ac_err"; then
11497   rm -rf conftest*
11498   eval "ac_cv_header_$ac_safe=yes"
11499 else
11500   echo "$ac_err" >&5
11501   echo "configure: failed program was:" >&5
11502   cat conftest.$ac_ext >&5
11503   rm -rf conftest*
11504   eval "ac_cv_header_$ac_safe=no"
11505 fi
11506 rm -f conftest*
11507 fi
11508 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11509   echo "$ac_t""yes" 1>&6
11510     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11511   cat >> confdefs.h <<EOF
11512 #define $ac_tr_hdr 1
11513 EOF
11514  
11515 else
11516   echo "$ac_t""no" 1>&6
11517 fi
11518 done
11519
11520         for ac_hdr in lwp/lwp.h
11521 do
11522 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11523 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11524 echo "configure:11525: checking for $ac_hdr" >&5
11525 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11526   echo $ac_n "(cached) $ac_c" 1>&6
11527 else
11528   cat > conftest.$ac_ext <<EOF
11529 #line 11530 "configure"
11530 #include "confdefs.h"
11531 #include <$ac_hdr>
11532 EOF
11533 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11534 { (eval echo configure:11535: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11535 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11536 if test -z "$ac_err"; then
11537   rm -rf conftest*
11538   eval "ac_cv_header_$ac_safe=yes"
11539 else
11540   echo "$ac_err" >&5
11541   echo "configure: failed program was:" >&5
11542   cat conftest.$ac_ext >&5
11543   rm -rf conftest*
11544   eval "ac_cv_header_$ac_safe=no"
11545 fi
11546 rm -f conftest*
11547 fi
11548 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11549   echo "$ac_t""yes" 1>&6
11550     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11551   cat >> confdefs.h <<EOF
11552 #define $ac_tr_hdr 1
11553 EOF
11554  
11555 else
11556   echo "$ac_t""no" 1>&6
11557 fi
11558 done
11559
11560         for ac_hdr in thread.h synch.h
11561 do
11562 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11563 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11564 echo "configure:11565: checking for $ac_hdr" >&5
11565 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11566   echo $ac_n "(cached) $ac_c" 1>&6
11567 else
11568   cat > conftest.$ac_ext <<EOF
11569 #line 11570 "configure"
11570 #include "confdefs.h"
11571 #include <$ac_hdr>
11572 EOF
11573 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11574 { (eval echo configure:11575: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11575 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11576 if test -z "$ac_err"; then
11577   rm -rf conftest*
11578   eval "ac_cv_header_$ac_safe=yes"
11579 else
11580   echo "$ac_err" >&5
11581   echo "configure: failed program was:" >&5
11582   cat conftest.$ac_ext >&5
11583   rm -rf conftest*
11584   eval "ac_cv_header_$ac_safe=no"
11585 fi
11586 rm -f conftest*
11587 fi
11588 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11589   echo "$ac_t""yes" 1>&6
11590     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11591   cat >> confdefs.h <<EOF
11592 #define $ac_tr_hdr 1
11593 EOF
11594  
11595 else
11596   echo "$ac_t""no" 1>&6
11597 fi
11598 done
11599
11600 fi
11601
11602 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
11603                         cat >> confdefs.h <<\EOF
11604 #define REENTRANT 1
11605 EOF
11606
11607         cat >> confdefs.h <<\EOF
11608 #define _REENTRANT 1
11609 EOF
11610
11611         cat >> confdefs.h <<\EOF
11612 #define THREAD_SAFE 1
11613 EOF
11614
11615         cat >> confdefs.h <<\EOF
11616 #define _THREAD_SAFE 1
11617 EOF
11618
11619         cat >> confdefs.h <<\EOF
11620 #define THREADSAFE 1
11621 EOF
11622
11623         cat >> confdefs.h <<\EOF
11624 #define _THREADSAFE 1
11625 EOF
11626
11627         cat >> confdefs.h <<\EOF
11628 #define _SGI_MP_SOURCE 1
11629 EOF
11630
11631
11632                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
11633 echo "configure:11634: checking for thread specific errno" >&5
11634 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
11635   echo $ac_n "(cached) $ac_c" 1>&6
11636 else
11637   
11638                 cat > conftest.$ac_ext <<EOF
11639 #line 11640 "configure"
11640 #include "confdefs.h"
11641 #include <errno.h>
11642 int main() {
11643 errno = 0;
11644 ; return 0; }
11645 EOF
11646 if { (eval echo configure:11647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11647   rm -rf conftest*
11648   ol_cv_errno_thread_specific=yes
11649 else
11650   echo "configure: failed program was:" >&5
11651   cat conftest.$ac_ext >&5
11652   rm -rf conftest*
11653   ol_cv_errno_thread_specific=no
11654 fi
11655 rm -f conftest*
11656         
11657 fi
11658
11659 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
11660
11661                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
11662 echo "configure:11663: checking for thread specific h_errno" >&5
11663 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
11664   echo $ac_n "(cached) $ac_c" 1>&6
11665 else
11666   
11667                 cat > conftest.$ac_ext <<EOF
11668 #line 11669 "configure"
11669 #include "confdefs.h"
11670 #include <netdb.h>
11671 int main() {
11672 h_errno = 0;
11673 ; return 0; }
11674 EOF
11675 if { (eval echo configure:11676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11676   rm -rf conftest*
11677   ol_cv_h_errno_thread_specific=yes
11678 else
11679   echo "configure: failed program was:" >&5
11680   cat conftest.$ac_ext >&5
11681   rm -rf conftest*
11682   ol_cv_h_errno_thread_specific=no
11683 fi
11684 rm -f conftest*
11685         
11686 fi
11687
11688 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
11689
11690         if test $ol_cv_errno_thread_specific != yes \
11691                 -o $ol_cv_h_errno_thread_specific != yes ; then
11692                 LIBS="$LTHREAD_LIBS $LIBS"
11693                 LTHREAD_LIBS=""
11694         fi
11695
11696 fi  
11697
11698 if test $ol_link_threads = no ; then
11699         if test $ol_with_threads = yes ; then
11700                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
11701         fi
11702
11703         if test $ol_with_threads = auto ; then
11704                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
11705                 ol_with_threads=no
11706         fi
11707
11708         cat >> confdefs.h <<\EOF
11709 #define NO_THREADS 1
11710 EOF
11711
11712         LTHREAD_LIBS=""
11713 fi
11714
11715 if test $ol_link_threads != no ; then
11716         cat >> confdefs.h <<\EOF
11717 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
11718 EOF
11719
11720 fi
11721
11722 ol_link_ldbm=no 
11723
11724 if test $ol_with_ldbm_api = auto \
11725         -o $ol_with_ldbm_api = berkeley \
11726         -o $ol_with_ldbm_api = bcompat ; then
11727
11728         if test $ol_with_ldbm_api = bcompat; then \
11729                 ol_cv_berkeley_db=no
11730 for ac_hdr in db_185.h db.h
11731 do
11732 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11733 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11734 echo "configure:11735: checking for $ac_hdr" >&5
11735 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11736   echo $ac_n "(cached) $ac_c" 1>&6
11737 else
11738   cat > conftest.$ac_ext <<EOF
11739 #line 11740 "configure"
11740 #include "confdefs.h"
11741 #include <$ac_hdr>
11742 EOF
11743 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11744 { (eval echo configure:11745: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11745 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11746 if test -z "$ac_err"; then
11747   rm -rf conftest*
11748   eval "ac_cv_header_$ac_safe=yes"
11749 else
11750   echo "$ac_err" >&5
11751   echo "configure: failed program was:" >&5
11752   cat conftest.$ac_ext >&5
11753   rm -rf conftest*
11754   eval "ac_cv_header_$ac_safe=no"
11755 fi
11756 rm -f conftest*
11757 fi
11758 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11759   echo "$ac_t""yes" 1>&6
11760     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11761   cat >> confdefs.h <<EOF
11762 #define $ac_tr_hdr 1
11763 EOF
11764  
11765 else
11766   echo "$ac_t""no" 1>&6
11767 fi
11768 done
11769
11770 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
11771         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
11772 echo "configure:11773: checking if Berkeley DB header compatibility" >&5
11773 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
11774   echo $ac_n "(cached) $ac_c" 1>&6
11775 else
11776   
11777                 cat > conftest.$ac_ext <<EOF
11778 #line 11779 "configure"
11779 #include "confdefs.h"
11780
11781 #if HAVE_DB_185_H
11782 #       include <db_185.h>
11783 #else
11784 #       include <db.h>
11785 #endif
11786
11787  /* this check could be improved */
11788 #ifndef DB_VERSION_MAJOR
11789 #       define DB_VERSION_MAJOR 1
11790 #endif
11791
11792 #if DB_VERSION_MAJOR == 1 
11793         __db_version_1
11794 #endif
11795
11796 EOF
11797 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11798   egrep "__db_version_1" >/dev/null 2>&1; then
11799   rm -rf conftest*
11800   ol_cv_header_db1=yes
11801 else
11802   rm -rf conftest*
11803   ol_cv_header_db1=no
11804 fi
11805 rm -f conftest*
11806
11807 fi
11808
11809 echo "$ac_t""$ol_cv_header_db1" 1>&6
11810
11811         if test ol_cv_header_db1=yes ; then
11812                 ol_cv_lib_db=no
11813 if test $ol_cv_lib_db = no ; then
11814         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
11815 echo "configure:11816: checking for Berkeley DB link (default)" >&5
11816 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
11817   echo $ac_n "(cached) $ac_c" 1>&6
11818 else
11819   
11820         ol_DB_LIB=
11821         ol_LIBS=$LIBS
11822         LIBS="$ol_DB_LIB $LIBS"
11823
11824         cat > conftest.$ac_ext <<EOF
11825 #line 11826 "configure"
11826 #include "confdefs.h"
11827
11828 #ifdef HAVE_DB_185_H
11829 # include <db_185.h>
11830 #else
11831 # include <db.h>
11832 #endif
11833
11834 #ifndef DB_VERSION_MAJOR
11835 # define DB_VERSION_MAJOR 1
11836 #endif
11837
11838 #ifndef NULL
11839 #define NULL ((void*)0)
11840 #endif
11841
11842 int main() {
11843
11844 #if DB_VERSION_MAJOR > 1
11845         db_appexit( NULL );
11846 #else
11847         (void) dbopen( NULL, 0, 0, 0, NULL);
11848 #endif
11849
11850 ; return 0; }
11851 EOF
11852 if { (eval echo configure:11853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11853   rm -rf conftest*
11854   ol_cv_db_none=yes
11855 else
11856   echo "configure: failed program was:" >&5
11857   cat conftest.$ac_ext >&5
11858   rm -rf conftest*
11859   ol_cv_db_none=no
11860 fi
11861 rm -f conftest*
11862
11863         LIBS="$ol_LIBS"
11864
11865 fi
11866
11867 echo "$ac_t""$ol_cv_db_none" 1>&6
11868
11869         if test $ol_cv_db_none = yes ; then
11870                 ol_cv_lib_db=yes
11871         fi
11872 fi
11873
11874 if test $ol_cv_lib_db = no ; then
11875         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
11876 echo "configure:11877: checking for Berkeley DB link (-ldb)" >&5
11877 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
11878   echo $ac_n "(cached) $ac_c" 1>&6
11879 else
11880   
11881         ol_DB_LIB=-ldb
11882         ol_LIBS=$LIBS
11883         LIBS="$ol_DB_LIB $LIBS"
11884
11885         cat > conftest.$ac_ext <<EOF
11886 #line 11887 "configure"
11887 #include "confdefs.h"
11888
11889 #ifdef HAVE_DB_185_H
11890 # include <db_185.h>
11891 #else
11892 # include <db.h>
11893 #endif
11894
11895 #ifndef DB_VERSION_MAJOR
11896 # define DB_VERSION_MAJOR 1
11897 #endif
11898
11899 #ifndef NULL
11900 #define NULL ((void*)0)
11901 #endif
11902
11903 int main() {
11904
11905 #if DB_VERSION_MAJOR > 1
11906         db_appexit( NULL );
11907 #else
11908         (void) dbopen( NULL, 0, 0, 0, NULL);
11909 #endif
11910
11911 ; return 0; }
11912 EOF
11913 if { (eval echo configure:11914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11914   rm -rf conftest*
11915   ol_cv_db_db=yes
11916 else
11917   echo "configure: failed program was:" >&5
11918   cat conftest.$ac_ext >&5
11919   rm -rf conftest*
11920   ol_cv_db_db=no
11921 fi
11922 rm -f conftest*
11923
11924         LIBS="$ol_LIBS"
11925
11926 fi
11927
11928 echo "$ac_t""$ol_cv_db_db" 1>&6
11929
11930         if test $ol_cv_db_db = yes ; then
11931                 ol_cv_lib_db=-ldb
11932         fi
11933 fi
11934
11935 if test $ol_cv_lib_db = no ; then
11936         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
11937 echo "configure:11938: checking for Berkeley DB link (-ldb3)" >&5
11938 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
11939   echo $ac_n "(cached) $ac_c" 1>&6
11940 else
11941   
11942         ol_DB_LIB=-ldb3
11943         ol_LIBS=$LIBS
11944         LIBS="$ol_DB_LIB $LIBS"
11945
11946         cat > conftest.$ac_ext <<EOF
11947 #line 11948 "configure"
11948 #include "confdefs.h"
11949
11950 #ifdef HAVE_DB_185_H
11951 # include <db_185.h>
11952 #else
11953 # include <db.h>
11954 #endif
11955
11956 #ifndef DB_VERSION_MAJOR
11957 # define DB_VERSION_MAJOR 1
11958 #endif
11959
11960 #ifndef NULL
11961 #define NULL ((void*)0)
11962 #endif
11963
11964 int main() {
11965
11966 #if DB_VERSION_MAJOR > 1
11967         db_appexit( NULL );
11968 #else
11969         (void) dbopen( NULL, 0, 0, 0, NULL);
11970 #endif
11971
11972 ; return 0; }
11973 EOF
11974 if { (eval echo configure:11975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11975   rm -rf conftest*
11976   ol_cv_db_db3=yes
11977 else
11978   echo "configure: failed program was:" >&5
11979   cat conftest.$ac_ext >&5
11980   rm -rf conftest*
11981   ol_cv_db_db3=no
11982 fi
11983 rm -f conftest*
11984
11985         LIBS="$ol_LIBS"
11986
11987 fi
11988
11989 echo "$ac_t""$ol_cv_db_db3" 1>&6
11990
11991         if test $ol_cv_db_db3 = yes ; then
11992                 ol_cv_lib_db=-ldb3
11993         fi
11994 fi
11995
11996 if test $ol_cv_lib_db = no ; then
11997         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
11998 echo "configure:11999: checking for Berkeley DB link (-ldb2)" >&5
11999 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
12000   echo $ac_n "(cached) $ac_c" 1>&6
12001 else
12002   
12003         ol_DB_LIB=-ldb2
12004         ol_LIBS=$LIBS
12005         LIBS="$ol_DB_LIB $LIBS"
12006
12007         cat > conftest.$ac_ext <<EOF
12008 #line 12009 "configure"
12009 #include "confdefs.h"
12010
12011 #ifdef HAVE_DB_185_H
12012 # include <db_185.h>
12013 #else
12014 # include <db.h>
12015 #endif
12016
12017 #ifndef DB_VERSION_MAJOR
12018 # define DB_VERSION_MAJOR 1
12019 #endif
12020
12021 #ifndef NULL
12022 #define NULL ((void*)0)
12023 #endif
12024
12025 int main() {
12026
12027 #if DB_VERSION_MAJOR > 1
12028         db_appexit( NULL );
12029 #else
12030         (void) dbopen( NULL, 0, 0, 0, NULL);
12031 #endif
12032
12033 ; return 0; }
12034 EOF
12035 if { (eval echo configure:12036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12036   rm -rf conftest*
12037   ol_cv_db_db2=yes
12038 else
12039   echo "configure: failed program was:" >&5
12040   cat conftest.$ac_ext >&5
12041   rm -rf conftest*
12042   ol_cv_db_db2=no
12043 fi
12044 rm -f conftest*
12045
12046         LIBS="$ol_LIBS"
12047
12048 fi
12049
12050 echo "$ac_t""$ol_cv_db_db2" 1>&6
12051
12052         if test $ol_cv_db_db2 = yes ; then
12053                 ol_cv_lib_db=-ldb2
12054         fi
12055 fi
12056
12057 if test $ol_cv_lib_db = no ; then
12058         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
12059 echo "configure:12060: checking for Berkeley DB link (-ldb1)" >&5
12060 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
12061   echo $ac_n "(cached) $ac_c" 1>&6
12062 else
12063   
12064         ol_DB_LIB=-ldb1
12065         ol_LIBS=$LIBS
12066         LIBS="$ol_DB_LIB $LIBS"
12067
12068         cat > conftest.$ac_ext <<EOF
12069 #line 12070 "configure"
12070 #include "confdefs.h"
12071
12072 #ifdef HAVE_DB_185_H
12073 # include <db_185.h>
12074 #else
12075 # include <db.h>
12076 #endif
12077
12078 #ifndef DB_VERSION_MAJOR
12079 # define DB_VERSION_MAJOR 1
12080 #endif
12081
12082 #ifndef NULL
12083 #define NULL ((void*)0)
12084 #endif
12085
12086 int main() {
12087
12088 #if DB_VERSION_MAJOR > 1
12089         db_appexit( NULL );
12090 #else
12091         (void) dbopen( NULL, 0, 0, 0, NULL);
12092 #endif
12093
12094 ; return 0; }
12095 EOF
12096 if { (eval echo configure:12097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12097   rm -rf conftest*
12098   ol_cv_db_db1=yes
12099 else
12100   echo "configure: failed program was:" >&5
12101   cat conftest.$ac_ext >&5
12102   rm -rf conftest*
12103   ol_cv_db_db1=no
12104 fi
12105 rm -f conftest*
12106
12107         LIBS="$ol_LIBS"
12108
12109 fi
12110
12111 echo "$ac_t""$ol_cv_db_db1" 1>&6
12112
12113         if test $ol_cv_db_db1 = yes ; then
12114                 ol_cv_lib_db=-ldb1
12115         fi
12116 fi
12117
12118
12119                 if test "$ol_cv_lib_db" != no ; then
12120                         ol_cv_berkeley_db=yes
12121                 fi
12122         fi
12123 fi
12124
12125         else
12126                 ol_cv_berkeley_db=no
12127 for ac_hdr in db.h
12128 do
12129 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12130 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12131 echo "configure:12132: checking for $ac_hdr" >&5
12132 if eval "test \"\${ac_cv_header_$ac_safe+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 #include <$ac_hdr>
12139 EOF
12140 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12141 { (eval echo configure:12142: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12142 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12143 if test -z "$ac_err"; then
12144   rm -rf conftest*
12145   eval "ac_cv_header_$ac_safe=yes"
12146 else
12147   echo "$ac_err" >&5
12148   echo "configure: failed program was:" >&5
12149   cat conftest.$ac_ext >&5
12150   rm -rf conftest*
12151   eval "ac_cv_header_$ac_safe=no"
12152 fi
12153 rm -f conftest*
12154 fi
12155 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12156   echo "$ac_t""yes" 1>&6
12157     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12158   cat >> confdefs.h <<EOF
12159 #define $ac_tr_hdr 1
12160 EOF
12161  
12162 else
12163   echo "$ac_t""no" 1>&6
12164 fi
12165 done
12166
12167 if test $ac_cv_header_db_h = yes; then
12168         ol_cv_lib_db=no
12169 if test $ol_cv_lib_db = no ; then
12170         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
12171 echo "configure:12172: checking for Berkeley DB link (default)" >&5
12172 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
12173   echo $ac_n "(cached) $ac_c" 1>&6
12174 else
12175   
12176         ol_DB_LIB=
12177         ol_LIBS=$LIBS
12178         LIBS="$ol_DB_LIB $LIBS"
12179
12180         cat > conftest.$ac_ext <<EOF
12181 #line 12182 "configure"
12182 #include "confdefs.h"
12183
12184 #ifdef HAVE_DB_185_H
12185 # include <db_185.h>
12186 #else
12187 # include <db.h>
12188 #endif
12189
12190 #ifndef DB_VERSION_MAJOR
12191 # define DB_VERSION_MAJOR 1
12192 #endif
12193
12194 #ifndef NULL
12195 #define NULL ((void*)0)
12196 #endif
12197
12198 int main() {
12199
12200 #if DB_VERSION_MAJOR > 1
12201         db_appexit( NULL );
12202 #else
12203         (void) dbopen( NULL, 0, 0, 0, NULL);
12204 #endif
12205
12206 ; return 0; }
12207 EOF
12208 if { (eval echo configure:12209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12209   rm -rf conftest*
12210   ol_cv_db_none=yes
12211 else
12212   echo "configure: failed program was:" >&5
12213   cat conftest.$ac_ext >&5
12214   rm -rf conftest*
12215   ol_cv_db_none=no
12216 fi
12217 rm -f conftest*
12218
12219         LIBS="$ol_LIBS"
12220
12221 fi
12222
12223 echo "$ac_t""$ol_cv_db_none" 1>&6
12224
12225         if test $ol_cv_db_none = yes ; then
12226                 ol_cv_lib_db=yes
12227         fi
12228 fi
12229
12230 if test $ol_cv_lib_db = no ; then
12231         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
12232 echo "configure:12233: checking for Berkeley DB link (-ldb)" >&5
12233 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
12234   echo $ac_n "(cached) $ac_c" 1>&6
12235 else
12236   
12237         ol_DB_LIB=-ldb
12238         ol_LIBS=$LIBS
12239         LIBS="$ol_DB_LIB $LIBS"
12240
12241         cat > conftest.$ac_ext <<EOF
12242 #line 12243 "configure"
12243 #include "confdefs.h"
12244
12245 #ifdef HAVE_DB_185_H
12246 # include <db_185.h>
12247 #else
12248 # include <db.h>
12249 #endif
12250
12251 #ifndef DB_VERSION_MAJOR
12252 # define DB_VERSION_MAJOR 1
12253 #endif
12254
12255 #ifndef NULL
12256 #define NULL ((void*)0)
12257 #endif
12258
12259 int main() {
12260
12261 #if DB_VERSION_MAJOR > 1
12262         db_appexit( NULL );
12263 #else
12264         (void) dbopen( NULL, 0, 0, 0, NULL);
12265 #endif
12266
12267 ; return 0; }
12268 EOF
12269 if { (eval echo configure:12270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12270   rm -rf conftest*
12271   ol_cv_db_db=yes
12272 else
12273   echo "configure: failed program was:" >&5
12274   cat conftest.$ac_ext >&5
12275   rm -rf conftest*
12276   ol_cv_db_db=no
12277 fi
12278 rm -f conftest*
12279
12280         LIBS="$ol_LIBS"
12281
12282 fi
12283
12284 echo "$ac_t""$ol_cv_db_db" 1>&6
12285
12286         if test $ol_cv_db_db = yes ; then
12287                 ol_cv_lib_db=-ldb
12288         fi
12289 fi
12290
12291 if test $ol_cv_lib_db = no ; then
12292         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
12293 echo "configure:12294: checking for Berkeley DB link (-ldb3)" >&5
12294 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
12295   echo $ac_n "(cached) $ac_c" 1>&6
12296 else
12297   
12298         ol_DB_LIB=-ldb3
12299         ol_LIBS=$LIBS
12300         LIBS="$ol_DB_LIB $LIBS"
12301
12302         cat > conftest.$ac_ext <<EOF
12303 #line 12304 "configure"
12304 #include "confdefs.h"
12305
12306 #ifdef HAVE_DB_185_H
12307 # include <db_185.h>
12308 #else
12309 # include <db.h>
12310 #endif
12311
12312 #ifndef DB_VERSION_MAJOR
12313 # define DB_VERSION_MAJOR 1
12314 #endif
12315
12316 #ifndef NULL
12317 #define NULL ((void*)0)
12318 #endif
12319
12320 int main() {
12321
12322 #if DB_VERSION_MAJOR > 1
12323         db_appexit( NULL );
12324 #else
12325         (void) dbopen( NULL, 0, 0, 0, NULL);
12326 #endif
12327
12328 ; return 0; }
12329 EOF
12330 if { (eval echo configure:12331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12331   rm -rf conftest*
12332   ol_cv_db_db3=yes
12333 else
12334   echo "configure: failed program was:" >&5
12335   cat conftest.$ac_ext >&5
12336   rm -rf conftest*
12337   ol_cv_db_db3=no
12338 fi
12339 rm -f conftest*
12340
12341         LIBS="$ol_LIBS"
12342
12343 fi
12344
12345 echo "$ac_t""$ol_cv_db_db3" 1>&6
12346
12347         if test $ol_cv_db_db3 = yes ; then
12348                 ol_cv_lib_db=-ldb3
12349         fi
12350 fi
12351
12352 if test $ol_cv_lib_db = no ; then
12353         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
12354 echo "configure:12355: checking for Berkeley DB link (-ldb2)" >&5
12355 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
12356   echo $ac_n "(cached) $ac_c" 1>&6
12357 else
12358   
12359         ol_DB_LIB=-ldb2
12360         ol_LIBS=$LIBS
12361         LIBS="$ol_DB_LIB $LIBS"
12362
12363         cat > conftest.$ac_ext <<EOF
12364 #line 12365 "configure"
12365 #include "confdefs.h"
12366
12367 #ifdef HAVE_DB_185_H
12368 # include <db_185.h>
12369 #else
12370 # include <db.h>
12371 #endif
12372
12373 #ifndef DB_VERSION_MAJOR
12374 # define DB_VERSION_MAJOR 1
12375 #endif
12376
12377 #ifndef NULL
12378 #define NULL ((void*)0)
12379 #endif
12380
12381 int main() {
12382
12383 #if DB_VERSION_MAJOR > 1
12384         db_appexit( NULL );
12385 #else
12386         (void) dbopen( NULL, 0, 0, 0, NULL);
12387 #endif
12388
12389 ; return 0; }
12390 EOF
12391 if { (eval echo configure:12392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12392   rm -rf conftest*
12393   ol_cv_db_db2=yes
12394 else
12395   echo "configure: failed program was:" >&5
12396   cat conftest.$ac_ext >&5
12397   rm -rf conftest*
12398   ol_cv_db_db2=no
12399 fi
12400 rm -f conftest*
12401
12402         LIBS="$ol_LIBS"
12403
12404 fi
12405
12406 echo "$ac_t""$ol_cv_db_db2" 1>&6
12407
12408         if test $ol_cv_db_db2 = yes ; then
12409                 ol_cv_lib_db=-ldb2
12410         fi
12411 fi
12412
12413 if test $ol_cv_lib_db = no ; then
12414         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
12415 echo "configure:12416: checking for Berkeley DB link (-ldb1)" >&5
12416 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
12417   echo $ac_n "(cached) $ac_c" 1>&6
12418 else
12419   
12420         ol_DB_LIB=-ldb1
12421         ol_LIBS=$LIBS
12422         LIBS="$ol_DB_LIB $LIBS"
12423
12424         cat > conftest.$ac_ext <<EOF
12425 #line 12426 "configure"
12426 #include "confdefs.h"
12427
12428 #ifdef HAVE_DB_185_H
12429 # include <db_185.h>
12430 #else
12431 # include <db.h>
12432 #endif
12433
12434 #ifndef DB_VERSION_MAJOR
12435 # define DB_VERSION_MAJOR 1
12436 #endif
12437
12438 #ifndef NULL
12439 #define NULL ((void*)0)
12440 #endif
12441
12442 int main() {
12443
12444 #if DB_VERSION_MAJOR > 1
12445         db_appexit( NULL );
12446 #else
12447         (void) dbopen( NULL, 0, 0, 0, NULL);
12448 #endif
12449
12450 ; return 0; }
12451 EOF
12452 if { (eval echo configure:12453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12453   rm -rf conftest*
12454   ol_cv_db_db1=yes
12455 else
12456   echo "configure: failed program was:" >&5
12457   cat conftest.$ac_ext >&5
12458   rm -rf conftest*
12459   ol_cv_db_db1=no
12460 fi
12461 rm -f conftest*
12462
12463         LIBS="$ol_LIBS"
12464
12465 fi
12466
12467 echo "$ac_t""$ol_cv_db_db1" 1>&6
12468
12469         if test $ol_cv_db_db1 = yes ; then
12470                 ol_cv_lib_db=-ldb1
12471         fi
12472 fi
12473
12474
12475         if test "$ol_cv_lib_db" != no ; then
12476                 ol_cv_berkeley_db=yes
12477                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
12478 echo "configure:12479: checking for Berkeley DB thread support" >&5
12479 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
12480   echo $ac_n "(cached) $ac_c" 1>&6
12481 else
12482   
12483         ol_LIBS="$LIBS"
12484         if test $ol_cv_lib_db != yes ; then
12485                 LIBS="$ol_cv_lib_db"
12486         fi
12487
12488         if test "$cross_compiling" = yes; then
12489   ol_cv_berkeley_db_thread=cross
12490 else
12491   cat > conftest.$ac_ext <<EOF
12492 #line 12493 "configure"
12493 #include "confdefs.h"
12494
12495 #ifdef HAVE_DB_185_H
12496         choke me;
12497 #else
12498 #include <db.h>
12499 #endif
12500 #ifndef NULL
12501 #define NULL ((void *)0)
12502 #endif
12503 main()
12504 {
12505         int rc;
12506         DB_ENV env;
12507         u_int32_t flags = DB_CREATE | DB_THREAD;
12508
12509         memset( &env, '\0', sizeof(env) );
12510
12511         rc = db_appinit( NULL, NULL, &env, flags );
12512
12513         if( rc == 0 ) {
12514                 db_appexit( &env );
12515         }
12516
12517         return rc;
12518 }
12519 EOF
12520 if { (eval echo configure:12521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12521 then
12522   ol_cv_berkeley_db_thread=yes
12523 else
12524   echo "configure: failed program was:" >&5
12525   cat conftest.$ac_ext >&5
12526   rm -fr conftest*
12527   ol_cv_berkeley_db_thread=no
12528 fi
12529 rm -fr conftest*
12530 fi
12531
12532
12533         LIBS="$ol_LIBS"
12534
12535         if test $ol_cv_berkeley_db_thread != no ; then
12536                 cat >> confdefs.h <<\EOF
12537 #define HAVE_BERKELEY_DB_THREAD 1
12538 EOF
12539
12540         fi
12541
12542 fi
12543
12544 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
12545         fi
12546 fi
12547
12548         fi
12549
12550         if test $ol_cv_berkeley_db != no ; then
12551                 cat >> confdefs.h <<\EOF
12552 #define HAVE_BERKELEY_DB 1
12553 EOF
12554
12555
12556                 ol_link_ldbm=berkeley
12557                 ol_with_ldbm_api=db
12558
12559                 if test $ol_with_ldbm_type = hash ; then
12560                         cat >> confdefs.h <<\EOF
12561 #define LDBM_USE_DBHASH 1
12562 EOF
12563
12564                 else
12565                         cat >> confdefs.h <<\EOF
12566 #define LDBM_USE_DBBTREE 1
12567 EOF
12568
12569                 fi
12570
12571                                                 if test $ol_cv_lib_db != yes ; then
12572                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
12573                 fi
12574         fi
12575 fi
12576
12577 exit
12578
12579 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
12580         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
12581         ol_with_ldbm_api=none
12582 fi
12583
12584 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
12585         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
12586 echo "configure:12587: checking for MDBM library" >&5
12587 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
12588   echo $ac_n "(cached) $ac_c" 1>&6
12589 else
12590         ol_LIBS="$LIBS"
12591         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
12592 echo "configure:12593: checking for mdbm_set_chain" >&5
12593 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
12594   echo $ac_n "(cached) $ac_c" 1>&6
12595 else
12596   cat > conftest.$ac_ext <<EOF
12597 #line 12598 "configure"
12598 #include "confdefs.h"
12599 /* System header to define __stub macros and hopefully few prototypes,
12600     which can conflict with char mdbm_set_chain(); below.  */
12601 #include <assert.h>
12602 /* Override any gcc2 internal prototype to avoid an error.  */
12603 /* We use char because int might match the return type of a gcc2
12604     builtin and then its argument prototype would still apply.  */
12605 char mdbm_set_chain();
12606 char (*f)();
12607
12608 int main() {
12609
12610 /* The GNU C library defines this for functions which it implements
12611     to always fail with ENOSYS.  Some functions are actually named
12612     something starting with __ and the normal name is an alias.  */
12613 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
12614 choke me
12615 #else
12616 f = mdbm_set_chain;
12617 #endif
12618
12619 ; return 0; }
12620 EOF
12621 if { (eval echo configure:12622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12622   rm -rf conftest*
12623   eval "ac_cv_func_mdbm_set_chain=yes"
12624 else
12625   echo "configure: failed program was:" >&5
12626   cat conftest.$ac_ext >&5
12627   rm -rf conftest*
12628   eval "ac_cv_func_mdbm_set_chain=no"
12629 fi
12630 rm -f conftest*
12631 fi
12632
12633 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
12634   echo "$ac_t""yes" 1>&6
12635   ol_cv_lib_mdbm=yes
12636 else
12637   echo "$ac_t""no" 1>&6
12638
12639                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
12640 echo "configure:12641: checking for mdbm_set_chain in -lmdbm" >&5
12641 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
12642 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12643   echo $ac_n "(cached) $ac_c" 1>&6
12644 else
12645   ac_save_LIBS="$LIBS"
12646 LIBS="-lmdbm  $LIBS"
12647 cat > conftest.$ac_ext <<EOF
12648 #line 12649 "configure"
12649 #include "confdefs.h"
12650 /* Override any gcc2 internal prototype to avoid an error.  */
12651 /* We use char because int might match the return type of a gcc2
12652     builtin and then its argument prototype would still apply.  */
12653 char mdbm_set_chain();
12654
12655 int main() {
12656 mdbm_set_chain()
12657 ; return 0; }
12658 EOF
12659 if { (eval echo configure:12660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12660   rm -rf conftest*
12661   eval "ac_cv_lib_$ac_lib_var=yes"
12662 else
12663   echo "configure: failed program was:" >&5
12664   cat conftest.$ac_ext >&5
12665   rm -rf conftest*
12666   eval "ac_cv_lib_$ac_lib_var=no"
12667 fi
12668 rm -f conftest*
12669 LIBS="$ac_save_LIBS"
12670
12671 fi
12672 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12673   echo "$ac_t""yes" 1>&6
12674   ol_cv_lib_mdbm=-lmdbm
12675 else
12676   echo "$ac_t""no" 1>&6
12677 ol_cv_lib_mdbm=no
12678 fi
12679
12680         
12681 fi
12682
12683         LIBS="$ol_LIBS"
12684
12685 fi
12686
12687 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
12688
12689
12690  for ac_hdr in mdbm.h
12691 do
12692 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12693 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12694 echo "configure:12695: checking for $ac_hdr" >&5
12695 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12696   echo $ac_n "(cached) $ac_c" 1>&6
12697 else
12698   cat > conftest.$ac_ext <<EOF
12699 #line 12700 "configure"
12700 #include "confdefs.h"
12701 #include <$ac_hdr>
12702 EOF
12703 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12704 { (eval echo configure:12705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12705 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12706 if test -z "$ac_err"; then
12707   rm -rf conftest*
12708   eval "ac_cv_header_$ac_safe=yes"
12709 else
12710   echo "$ac_err" >&5
12711   echo "configure: failed program was:" >&5
12712   cat conftest.$ac_ext >&5
12713   rm -rf conftest*
12714   eval "ac_cv_header_$ac_safe=no"
12715 fi
12716 rm -f conftest*
12717 fi
12718 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12719   echo "$ac_t""yes" 1>&6
12720     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12721   cat >> confdefs.h <<EOF
12722 #define $ac_tr_hdr 1
12723 EOF
12724  
12725 else
12726   echo "$ac_t""no" 1>&6
12727 fi
12728 done
12729
12730  echo $ac_n "checking for db""... $ac_c" 1>&6
12731 echo "configure:12732: checking for db" >&5
12732 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
12733   echo $ac_n "(cached) $ac_c" 1>&6
12734 else
12735   
12736         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
12737                 ol_cv_mdbm=no
12738         else
12739                 ol_cv_mdbm=yes
12740         fi
12741
12742 fi
12743
12744 echo "$ac_t""$ol_cv_mdbm" 1>&6
12745  if test $ol_cv_mdbm = yes ; then
12746         cat >> confdefs.h <<\EOF
12747 #define HAVE_MDBM 1
12748 EOF
12749
12750  fi
12751
12752
12753         if test $ol_cv_mdbm = yes ; then
12754                 ol_link_ldbm=mdbm
12755                 ol_with_ldbm_api=mdbm
12756                 if test $ol_cv_lib_mdbm != yes ; then
12757                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
12758                 fi
12759         fi
12760 fi
12761
12762 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
12763         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
12764 echo "configure:12765: checking for GDBM library" >&5
12765 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
12766   echo $ac_n "(cached) $ac_c" 1>&6
12767 else
12768         ol_LIBS="$LIBS"
12769         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
12770 echo "configure:12771: checking for gdbm_open" >&5
12771 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
12772   echo $ac_n "(cached) $ac_c" 1>&6
12773 else
12774   cat > conftest.$ac_ext <<EOF
12775 #line 12776 "configure"
12776 #include "confdefs.h"
12777 /* System header to define __stub macros and hopefully few prototypes,
12778     which can conflict with char gdbm_open(); below.  */
12779 #include <assert.h>
12780 /* Override any gcc2 internal prototype to avoid an error.  */
12781 /* We use char because int might match the return type of a gcc2
12782     builtin and then its argument prototype would still apply.  */
12783 char gdbm_open();
12784 char (*f)();
12785
12786 int main() {
12787
12788 /* The GNU C library defines this for functions which it implements
12789     to always fail with ENOSYS.  Some functions are actually named
12790     something starting with __ and the normal name is an alias.  */
12791 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
12792 choke me
12793 #else
12794 f = gdbm_open;
12795 #endif
12796
12797 ; return 0; }
12798 EOF
12799 if { (eval echo configure:12800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12800   rm -rf conftest*
12801   eval "ac_cv_func_gdbm_open=yes"
12802 else
12803   echo "configure: failed program was:" >&5
12804   cat conftest.$ac_ext >&5
12805   rm -rf conftest*
12806   eval "ac_cv_func_gdbm_open=no"
12807 fi
12808 rm -f conftest*
12809 fi
12810
12811 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
12812   echo "$ac_t""yes" 1>&6
12813   ol_cv_lib_gdbm=yes
12814 else
12815   echo "$ac_t""no" 1>&6
12816
12817                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
12818 echo "configure:12819: checking for gdbm_open in -lgdbm" >&5
12819 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
12820 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12821   echo $ac_n "(cached) $ac_c" 1>&6
12822 else
12823   ac_save_LIBS="$LIBS"
12824 LIBS="-lgdbm  $LIBS"
12825 cat > conftest.$ac_ext <<EOF
12826 #line 12827 "configure"
12827 #include "confdefs.h"
12828 /* Override any gcc2 internal prototype to avoid an error.  */
12829 /* We use char because int might match the return type of a gcc2
12830     builtin and then its argument prototype would still apply.  */
12831 char gdbm_open();
12832
12833 int main() {
12834 gdbm_open()
12835 ; return 0; }
12836 EOF
12837 if { (eval echo configure:12838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12838   rm -rf conftest*
12839   eval "ac_cv_lib_$ac_lib_var=yes"
12840 else
12841   echo "configure: failed program was:" >&5
12842   cat conftest.$ac_ext >&5
12843   rm -rf conftest*
12844   eval "ac_cv_lib_$ac_lib_var=no"
12845 fi
12846 rm -f conftest*
12847 LIBS="$ac_save_LIBS"
12848
12849 fi
12850 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12851   echo "$ac_t""yes" 1>&6
12852   ol_cv_lib_gdbm=-lgdbm
12853 else
12854   echo "$ac_t""no" 1>&6
12855 ol_cv_lib_gdbm=no
12856 fi
12857
12858         
12859 fi
12860
12861         LIBS="$ol_LIBS"
12862
12863 fi
12864
12865 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
12866
12867
12868  for ac_hdr in gdbm.h
12869 do
12870 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12871 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12872 echo "configure:12873: checking for $ac_hdr" >&5
12873 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12874   echo $ac_n "(cached) $ac_c" 1>&6
12875 else
12876   cat > conftest.$ac_ext <<EOF
12877 #line 12878 "configure"
12878 #include "confdefs.h"
12879 #include <$ac_hdr>
12880 EOF
12881 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12882 { (eval echo configure:12883: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12883 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12884 if test -z "$ac_err"; then
12885   rm -rf conftest*
12886   eval "ac_cv_header_$ac_safe=yes"
12887 else
12888   echo "$ac_err" >&5
12889   echo "configure: failed program was:" >&5
12890   cat conftest.$ac_ext >&5
12891   rm -rf conftest*
12892   eval "ac_cv_header_$ac_safe=no"
12893 fi
12894 rm -f conftest*
12895 fi
12896 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12897   echo "$ac_t""yes" 1>&6
12898     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12899   cat >> confdefs.h <<EOF
12900 #define $ac_tr_hdr 1
12901 EOF
12902  
12903 else
12904   echo "$ac_t""no" 1>&6
12905 fi
12906 done
12907
12908  echo $ac_n "checking for db""... $ac_c" 1>&6
12909 echo "configure:12910: checking for db" >&5
12910 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
12911   echo $ac_n "(cached) $ac_c" 1>&6
12912 else
12913   
12914         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
12915                 ol_cv_gdbm=no
12916         else
12917                 ol_cv_gdbm=yes
12918         fi
12919
12920 fi
12921
12922 echo "$ac_t""$ol_cv_gdbm" 1>&6
12923  if test $ol_cv_gdbm = yes ; then
12924         cat >> confdefs.h <<\EOF
12925 #define HAVE_GDBM 1
12926 EOF
12927
12928  fi
12929
12930
12931         if test $ol_cv_gdbm = yes ; then
12932                 ol_link_ldbm=gdbm
12933                 ol_with_ldbm_api=gdbm
12934
12935                 if test $ol_cv_lib_gdbm != yes ; then
12936                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
12937                 fi
12938         fi
12939 fi
12940
12941 if test $ol_with_ldbm_api = ndbm ; then
12942         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
12943 echo "configure:12944: checking for NDBM library" >&5
12944 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
12945   echo $ac_n "(cached) $ac_c" 1>&6
12946 else
12947         ol_LIBS="$LIBS"
12948         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
12949 echo "configure:12950: checking for dbm_open" >&5
12950 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
12951   echo $ac_n "(cached) $ac_c" 1>&6
12952 else
12953   cat > conftest.$ac_ext <<EOF
12954 #line 12955 "configure"
12955 #include "confdefs.h"
12956 /* System header to define __stub macros and hopefully few prototypes,
12957     which can conflict with char dbm_open(); below.  */
12958 #include <assert.h>
12959 /* Override any gcc2 internal prototype to avoid an error.  */
12960 /* We use char because int might match the return type of a gcc2
12961     builtin and then its argument prototype would still apply.  */
12962 char dbm_open();
12963 char (*f)();
12964
12965 int main() {
12966
12967 /* The GNU C library defines this for functions which it implements
12968     to always fail with ENOSYS.  Some functions are actually named
12969     something starting with __ and the normal name is an alias.  */
12970 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
12971 choke me
12972 #else
12973 f = dbm_open;
12974 #endif
12975
12976 ; return 0; }
12977 EOF
12978 if { (eval echo configure:12979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12979   rm -rf conftest*
12980   eval "ac_cv_func_dbm_open=yes"
12981 else
12982   echo "configure: failed program was:" >&5
12983   cat conftest.$ac_ext >&5
12984   rm -rf conftest*
12985   eval "ac_cv_func_dbm_open=no"
12986 fi
12987 rm -f conftest*
12988 fi
12989
12990 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
12991   echo "$ac_t""yes" 1>&6
12992   ol_cv_lib_ndbm=yes
12993 else
12994   echo "$ac_t""no" 1>&6
12995
12996                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
12997 echo "configure:12998: checking for dbm_open in -lndbm" >&5
12998 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
12999 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13000   echo $ac_n "(cached) $ac_c" 1>&6
13001 else
13002   ac_save_LIBS="$LIBS"
13003 LIBS="-lndbm  $LIBS"
13004 cat > conftest.$ac_ext <<EOF
13005 #line 13006 "configure"
13006 #include "confdefs.h"
13007 /* Override any gcc2 internal prototype to avoid an error.  */
13008 /* We use char because int might match the return type of a gcc2
13009     builtin and then its argument prototype would still apply.  */
13010 char dbm_open();
13011
13012 int main() {
13013 dbm_open()
13014 ; return 0; }
13015 EOF
13016 if { (eval echo configure:13017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13017   rm -rf conftest*
13018   eval "ac_cv_lib_$ac_lib_var=yes"
13019 else
13020   echo "configure: failed program was:" >&5
13021   cat conftest.$ac_ext >&5
13022   rm -rf conftest*
13023   eval "ac_cv_lib_$ac_lib_var=no"
13024 fi
13025 rm -f conftest*
13026 LIBS="$ac_save_LIBS"
13027
13028 fi
13029 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13030   echo "$ac_t""yes" 1>&6
13031   ol_cv_lib_ndbm=-lndbm
13032 else
13033   echo "$ac_t""no" 1>&6
13034
13035                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
13036 echo "configure:13037: checking for dbm_open in -ldbm" >&5
13037 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
13038 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13039   echo $ac_n "(cached) $ac_c" 1>&6
13040 else
13041   ac_save_LIBS="$LIBS"
13042 LIBS="-ldbm  $LIBS"
13043 cat > conftest.$ac_ext <<EOF
13044 #line 13045 "configure"
13045 #include "confdefs.h"
13046 /* Override any gcc2 internal prototype to avoid an error.  */
13047 /* We use char because int might match the return type of a gcc2
13048     builtin and then its argument prototype would still apply.  */
13049 char dbm_open();
13050
13051 int main() {
13052 dbm_open()
13053 ; return 0; }
13054 EOF
13055 if { (eval echo configure:13056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13056   rm -rf conftest*
13057   eval "ac_cv_lib_$ac_lib_var=yes"
13058 else
13059   echo "configure: failed program was:" >&5
13060   cat conftest.$ac_ext >&5
13061   rm -rf conftest*
13062   eval "ac_cv_lib_$ac_lib_var=no"
13063 fi
13064 rm -f conftest*
13065 LIBS="$ac_save_LIBS"
13066
13067 fi
13068 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13069   echo "$ac_t""yes" 1>&6
13070   ol_cv_lib_ndbm=-ldbm
13071 else
13072   echo "$ac_t""no" 1>&6
13073 ol_cv_lib_ndbm=no
13074 fi
13075                 
13076 fi
13077
13078         
13079 fi
13080
13081         LIBS="$ol_LIBS"
13082
13083 fi
13084
13085 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
13086
13087
13088  for ac_hdr in ndbm.h
13089 do
13090 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13091 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13092 echo "configure:13093: checking for $ac_hdr" >&5
13093 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13094   echo $ac_n "(cached) $ac_c" 1>&6
13095 else
13096   cat > conftest.$ac_ext <<EOF
13097 #line 13098 "configure"
13098 #include "confdefs.h"
13099 #include <$ac_hdr>
13100 EOF
13101 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13102 { (eval echo configure:13103: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13103 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13104 if test -z "$ac_err"; then
13105   rm -rf conftest*
13106   eval "ac_cv_header_$ac_safe=yes"
13107 else
13108   echo "$ac_err" >&5
13109   echo "configure: failed program was:" >&5
13110   cat conftest.$ac_ext >&5
13111   rm -rf conftest*
13112   eval "ac_cv_header_$ac_safe=no"
13113 fi
13114 rm -f conftest*
13115 fi
13116 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13117   echo "$ac_t""yes" 1>&6
13118     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13119   cat >> confdefs.h <<EOF
13120 #define $ac_tr_hdr 1
13121 EOF
13122  
13123 else
13124   echo "$ac_t""no" 1>&6
13125 fi
13126 done
13127
13128  echo $ac_n "checking for db""... $ac_c" 1>&6
13129 echo "configure:13130: checking for db" >&5
13130 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
13131   echo $ac_n "(cached) $ac_c" 1>&6
13132 else
13133   
13134         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
13135                 ol_cv_ndbm=no
13136         else
13137                 ol_cv_ndbm=yes
13138         fi
13139
13140 fi
13141
13142 echo "$ac_t""$ol_cv_ndbm" 1>&6
13143  if test $ol_cv_ndbm = yes ; then
13144         cat >> confdefs.h <<\EOF
13145 #define HAVE_NDBM 1
13146 EOF
13147
13148  fi
13149
13150
13151         if test $ol_cv_ndbm = yes ; then
13152                 ol_link_ldbm=ndbm
13153                 ol_with_ldbm_api=ndbm
13154
13155                 if test $ol_cv_lib_ndbm != yes ; then
13156                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
13157                 fi
13158         fi
13159 fi
13160
13161 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
13162         echo "configure: warning: could not find suitable LDBM backend" 1>&2
13163         if test $ol_enable_ldbm = yes ; then
13164                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
13165         fi
13166
13167         echo "configure: warning: disabling LDBM" 1>&2
13168         ol_enable_ldbm=no
13169 fi
13170
13171 ol_link_bdb2=no
13172 if test $ol_enable_bdb2 != no ; then
13173         if test $ol_enable_bdb2 = yes -a $ol_link_ldbm != berkeley ; then
13174                 { echo "configure: error: BDB2 requires LDBM BerkeleyDB 2" 1>&2; exit 1; }
13175         elif test $ol_link_ldbm = berkeley ; then
13176                 ol_link_bdb2=$ol_link_ldbm
13177         fi
13178 fi
13179
13180 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
13181         LINK_BINS_DYNAMIC="yes"
13182 else
13183         LINK_BINS_DYNAMIC="no"
13184 fi
13185
13186 if test $ol_enable_wrappers != no ; then
13187         for ac_hdr in tcpd.h
13188 do
13189 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13190 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13191 echo "configure:13192: checking for $ac_hdr" >&5
13192 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13193   echo $ac_n "(cached) $ac_c" 1>&6
13194 else
13195   cat > conftest.$ac_ext <<EOF
13196 #line 13197 "configure"
13197 #include "confdefs.h"
13198 #include <$ac_hdr>
13199 EOF
13200 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13201 { (eval echo configure:13202: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13202 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13203 if test -z "$ac_err"; then
13204   rm -rf conftest*
13205   eval "ac_cv_header_$ac_safe=yes"
13206 else
13207   echo "$ac_err" >&5
13208   echo "configure: failed program was:" >&5
13209   cat conftest.$ac_ext >&5
13210   rm -rf conftest*
13211   eval "ac_cv_header_$ac_safe=no"
13212 fi
13213 rm -f conftest*
13214 fi
13215 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13216   echo "$ac_t""yes" 1>&6
13217     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13218   cat >> confdefs.h <<EOF
13219 #define $ac_tr_hdr 1
13220 EOF
13221  
13222 else
13223   echo "$ac_t""no" 1>&6
13224 fi
13225 done
13226
13227
13228         if test $ac_cv_header_tcpd_h != yes ; then
13229                 have_wrappers=no
13230         else
13231                 cat > conftest.$ac_ext <<EOF
13232 #line 13233 "configure"
13233 #include "confdefs.h"
13234
13235 int allow_severity = 0;
13236 int deny_severity  = 0;
13237                 
13238 int main() {
13239 hosts_access()
13240 ; return 0; }
13241 EOF
13242 if { (eval echo configure:13243: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13243   rm -rf conftest*
13244   have_wrappers=yes
13245 else
13246   echo "configure: failed program was:" >&5
13247   cat conftest.$ac_ext >&5
13248   rm -rf conftest*
13249   have_wrappers=no
13250 fi
13251 rm -f conftest*
13252         fi
13253
13254         if test $have_wrappers = yes ; then
13255                 cat >> confdefs.h <<\EOF
13256 #define HAVE_TCPD 1
13257 EOF
13258
13259                 WRAP_LIBS="-lwrap"
13260
13261                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
13262 echo "configure:13263: checking for main in -lnsl" >&5
13263 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
13264 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13265   echo $ac_n "(cached) $ac_c" 1>&6
13266 else
13267   ac_save_LIBS="$LIBS"
13268 LIBS="-lnsl  $LIBS"
13269 cat > conftest.$ac_ext <<EOF
13270 #line 13271 "configure"
13271 #include "confdefs.h"
13272
13273 int main() {
13274 main()
13275 ; return 0; }
13276 EOF
13277 if { (eval echo configure:13278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13278   rm -rf conftest*
13279   eval "ac_cv_lib_$ac_lib_var=yes"
13280 else
13281   echo "configure: failed program was:" >&5
13282   cat conftest.$ac_ext >&5
13283   rm -rf conftest*
13284   eval "ac_cv_lib_$ac_lib_var=no"
13285 fi
13286 rm -f conftest*
13287 LIBS="$ac_save_LIBS"
13288
13289 fi
13290 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13291   echo "$ac_t""yes" 1>&6
13292     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
13293     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
13294   cat >> confdefs.h <<EOF
13295 #define $ac_tr_lib 1
13296 EOF
13297
13298   LIBS="-lnsl $LIBS"
13299
13300 else
13301   echo "$ac_t""no" 1>&6
13302 fi
13303
13304         else
13305                 echo "configure: warning: could not find -lwrap" 1>&2
13306                 if test $ol_enable_wrappers = yes ; then
13307                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
13308                 fi
13309
13310                 echo "configure: warning: disabling wrappers support" 1>&2
13311                 ol_enable_wrappers=no
13312                 WRAP_LIBS=""
13313         fi
13314 fi
13315
13316 if test $ol_enable_syslog != no ; then
13317         echo $ac_n "checking for openlog""... $ac_c" 1>&6
13318 echo "configure:13319: checking for openlog" >&5
13319 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
13320   echo $ac_n "(cached) $ac_c" 1>&6
13321 else
13322   cat > conftest.$ac_ext <<EOF
13323 #line 13324 "configure"
13324 #include "confdefs.h"
13325 /* System header to define __stub macros and hopefully few prototypes,
13326     which can conflict with char openlog(); below.  */
13327 #include <assert.h>
13328 /* Override any gcc2 internal prototype to avoid an error.  */
13329 /* We use char because int might match the return type of a gcc2
13330     builtin and then its argument prototype would still apply.  */
13331 char openlog();
13332 char (*f)();
13333
13334 int main() {
13335
13336 /* The GNU C library defines this for functions which it implements
13337     to always fail with ENOSYS.  Some functions are actually named
13338     something starting with __ and the normal name is an alias.  */
13339 #if defined (__stub_openlog) || defined (__stub___openlog)
13340 choke me
13341 #else
13342 f = openlog;
13343 #endif
13344
13345 ; return 0; }
13346 EOF
13347 if { (eval echo configure:13348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13348   rm -rf conftest*
13349   eval "ac_cv_func_openlog=yes"
13350 else
13351   echo "configure: failed program was:" >&5
13352   cat conftest.$ac_ext >&5
13353   rm -rf conftest*
13354   eval "ac_cv_func_openlog=no"
13355 fi
13356 rm -f conftest*
13357 fi
13358
13359 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
13360   echo "$ac_t""yes" 1>&6
13361   :
13362 else
13363   echo "$ac_t""no" 1>&6
13364 fi
13365
13366         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
13367                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
13368         fi
13369         ol_enable_syslog=$ac_cv_func_openlog
13370 fi
13371
13372 if test $ol_enable_dmalloc != no ; then
13373         for ac_hdr in dmalloc.h
13374 do
13375 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13376 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13377 echo "configure:13378: checking for $ac_hdr" >&5
13378 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13379   echo $ac_n "(cached) $ac_c" 1>&6
13380 else
13381   cat > conftest.$ac_ext <<EOF
13382 #line 13383 "configure"
13383 #include "confdefs.h"
13384 #include <$ac_hdr>
13385 EOF
13386 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13387 { (eval echo configure:13388: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13388 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13389 if test -z "$ac_err"; then
13390   rm -rf conftest*
13391   eval "ac_cv_header_$ac_safe=yes"
13392 else
13393   echo "$ac_err" >&5
13394   echo "configure: failed program was:" >&5
13395   cat conftest.$ac_ext >&5
13396   rm -rf conftest*
13397   eval "ac_cv_header_$ac_safe=no"
13398 fi
13399 rm -f conftest*
13400 fi
13401 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13402   echo "$ac_t""yes" 1>&6
13403     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13404   cat >> confdefs.h <<EOF
13405 #define $ac_tr_hdr 1
13406 EOF
13407  
13408 else
13409   echo "$ac_t""no" 1>&6
13410 fi
13411 done
13412
13413         echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
13414 echo "configure:13415: checking for dmalloc_shutdown in -ldmalloc" >&5
13415 ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-:%__p__%'`
13416 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13417   echo $ac_n "(cached) $ac_c" 1>&6
13418 else
13419   ac_save_LIBS="$LIBS"
13420 LIBS="-ldmalloc  $LIBS"
13421 cat > conftest.$ac_ext <<EOF
13422 #line 13423 "configure"
13423 #include "confdefs.h"
13424 /* Override any gcc2 internal prototype to avoid an error.  */
13425 /* We use char because int might match the return type of a gcc2
13426     builtin and then its argument prototype would still apply.  */
13427 char dmalloc_shutdown();
13428
13429 int main() {
13430 dmalloc_shutdown()
13431 ; return 0; }
13432 EOF
13433 if { (eval echo configure:13434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13434   rm -rf conftest*
13435   eval "ac_cv_lib_$ac_lib_var=yes"
13436 else
13437   echo "configure: failed program was:" >&5
13438   cat conftest.$ac_ext >&5
13439   rm -rf conftest*
13440   eval "ac_cv_lib_$ac_lib_var=no"
13441 fi
13442 rm -f conftest*
13443 LIBS="$ac_save_LIBS"
13444
13445 fi
13446 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13447   echo "$ac_t""yes" 1>&6
13448     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
13449     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
13450   cat >> confdefs.h <<EOF
13451 #define $ac_tr_lib 1
13452 EOF
13453
13454   LIBS="-ldmalloc $LIBS"
13455
13456 else
13457   echo "$ac_t""no" 1>&6
13458 fi
13459
13460 fi
13461
13462 if test $ol_enable_tcl != no ; then
13463         for ac_hdr in tcl.h
13464 do
13465 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13466 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13467 echo "configure:13468: checking for $ac_hdr" >&5
13468 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13469   echo $ac_n "(cached) $ac_c" 1>&6
13470 else
13471   cat > conftest.$ac_ext <<EOF
13472 #line 13473 "configure"
13473 #include "confdefs.h"
13474 #include <$ac_hdr>
13475 EOF
13476 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13477 { (eval echo configure:13478: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13478 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13479 if test -z "$ac_err"; then
13480   rm -rf conftest*
13481   eval "ac_cv_header_$ac_safe=yes"
13482 else
13483   echo "$ac_err" >&5
13484   echo "configure: failed program was:" >&5
13485   cat conftest.$ac_ext >&5
13486   rm -rf conftest*
13487   eval "ac_cv_header_$ac_safe=no"
13488 fi
13489 rm -f conftest*
13490 fi
13491 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13492   echo "$ac_t""yes" 1>&6
13493     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13494   cat >> confdefs.h <<EOF
13495 #define $ac_tr_hdr 1
13496 EOF
13497  
13498 else
13499   echo "$ac_t""no" 1>&6
13500 fi
13501 done
13502
13503
13504         if test $ac_cv_header_tcl_h != yes ; then
13505                 have_tcl=no
13506         else
13507                 for lib in tcl tcl7.6 tcl8.0 tcl8.2 ; do
13508                         echo $ac_n "checking for main in -l$lib""... $ac_c" 1>&6
13509 echo "configure:13510: checking for main in -l$lib" >&5
13510 ac_lib_var=`echo $lib'_'main | sed 'y%./+-:%__p__%'`
13511 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13512   echo $ac_n "(cached) $ac_c" 1>&6
13513 else
13514   ac_save_LIBS="$LIBS"
13515 LIBS="-l$lib  $LIBS"
13516 cat > conftest.$ac_ext <<EOF
13517 #line 13518 "configure"
13518 #include "confdefs.h"
13519
13520 int main() {
13521 main()
13522 ; return 0; }
13523 EOF
13524 if { (eval echo configure:13525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13525   rm -rf conftest*
13526   eval "ac_cv_lib_$ac_lib_var=yes"
13527 else
13528   echo "configure: failed program was:" >&5
13529   cat conftest.$ac_ext >&5
13530   rm -rf conftest*
13531   eval "ac_cv_lib_$ac_lib_var=no"
13532 fi
13533 rm -f conftest*
13534 LIBS="$ac_save_LIBS"
13535
13536 fi
13537 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13538   echo "$ac_t""yes" 1>&6
13539   have_tcl=yes
13540                            if test x"$ol_with_tcl_module" = "xstatic" ; then
13541                                SLAPD_LIBS="$SLAPD_LIBS -l${lib}"
13542                            else
13543                                MOD_TCL_LIB="-l${lib}"
13544                            fi;break
13545 else
13546   echo "$ac_t""no" 1>&6
13547 have_tcl=no
13548 fi
13549
13550                 done
13551         fi
13552
13553         if test $have_tcl != yes ; then
13554                 echo "configure: warning: could not find -ltcl" 1>&2
13555                 if test $ol_enable_tcl = yes ; then
13556                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
13557                 fi
13558
13559                 ol_enable_tcl=no
13560         fi
13561 fi
13562
13563 ol_link_termcap=no
13564 for ac_hdr in termcap.h ncurses.h
13565 do
13566 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13567 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13568 echo "configure:13569: checking for $ac_hdr" >&5
13569 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13570   echo $ac_n "(cached) $ac_c" 1>&6
13571 else
13572   cat > conftest.$ac_ext <<EOF
13573 #line 13574 "configure"
13574 #include "confdefs.h"
13575 #include <$ac_hdr>
13576 EOF
13577 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13578 { (eval echo configure:13579: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13579 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13580 if test -z "$ac_err"; then
13581   rm -rf conftest*
13582   eval "ac_cv_header_$ac_safe=yes"
13583 else
13584   echo "$ac_err" >&5
13585   echo "configure: failed program was:" >&5
13586   cat conftest.$ac_ext >&5
13587   rm -rf conftest*
13588   eval "ac_cv_header_$ac_safe=no"
13589 fi
13590 rm -f conftest*
13591 fi
13592 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13593   echo "$ac_t""yes" 1>&6
13594     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13595   cat >> confdefs.h <<EOF
13596 #define $ac_tr_hdr 1
13597 EOF
13598  
13599 else
13600   echo "$ac_t""no" 1>&6
13601 fi
13602 done
13603
13604
13605 if test $ol_link_termcap = no ; then
13606         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
13607 echo "configure:13608: checking for tputs in -ltermcap" >&5
13608 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
13609 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13610   echo $ac_n "(cached) $ac_c" 1>&6
13611 else
13612   ac_save_LIBS="$LIBS"
13613 LIBS="-ltermcap  $LIBS"
13614 cat > conftest.$ac_ext <<EOF
13615 #line 13616 "configure"
13616 #include "confdefs.h"
13617 /* Override any gcc2 internal prototype to avoid an error.  */
13618 /* We use char because int might match the return type of a gcc2
13619     builtin and then its argument prototype would still apply.  */
13620 char tputs();
13621
13622 int main() {
13623 tputs()
13624 ; return 0; }
13625 EOF
13626 if { (eval echo configure:13627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13627   rm -rf conftest*
13628   eval "ac_cv_lib_$ac_lib_var=yes"
13629 else
13630   echo "configure: failed program was:" >&5
13631   cat conftest.$ac_ext >&5
13632   rm -rf conftest*
13633   eval "ac_cv_lib_$ac_lib_var=no"
13634 fi
13635 rm -f conftest*
13636 LIBS="$ac_save_LIBS"
13637
13638 fi
13639 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13640   echo "$ac_t""yes" 1>&6
13641   have_termcap=yes
13642 else
13643   echo "$ac_t""no" 1>&6
13644 have_termcap=no
13645 fi
13646
13647         if test $have_termcap = yes ; then
13648                 cat >> confdefs.h <<\EOF
13649 #define HAVE_TERMCAP 1
13650 EOF
13651
13652                 ol_link_termcap=yes
13653                 TERMCAP_LIBS=-ltermcap
13654         fi
13655 fi
13656
13657 if test $ol_link_termcap = no ; then
13658         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
13659 echo "configure:13660: checking for initscr in -lncurses" >&5
13660 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
13661 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13662   echo $ac_n "(cached) $ac_c" 1>&6
13663 else
13664   ac_save_LIBS="$LIBS"
13665 LIBS="-lncurses  $LIBS"
13666 cat > conftest.$ac_ext <<EOF
13667 #line 13668 "configure"
13668 #include "confdefs.h"
13669 /* Override any gcc2 internal prototype to avoid an error.  */
13670 /* We use char because int might match the return type of a gcc2
13671     builtin and then its argument prototype would still apply.  */
13672 char initscr();
13673
13674 int main() {
13675 initscr()
13676 ; return 0; }
13677 EOF
13678 if { (eval echo configure:13679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13679   rm -rf conftest*
13680   eval "ac_cv_lib_$ac_lib_var=yes"
13681 else
13682   echo "configure: failed program was:" >&5
13683   cat conftest.$ac_ext >&5
13684   rm -rf conftest*
13685   eval "ac_cv_lib_$ac_lib_var=no"
13686 fi
13687 rm -f conftest*
13688 LIBS="$ac_save_LIBS"
13689
13690 fi
13691 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13692   echo "$ac_t""yes" 1>&6
13693   have_ncurses=yes
13694 else
13695   echo "$ac_t""no" 1>&6
13696 have_ncurses=no
13697 fi
13698
13699         if test $have_ncurses = yes ; then
13700                 cat >> confdefs.h <<\EOF
13701 #define HAVE_NCURSES 1
13702 EOF
13703
13704                 ol_link_termcap=yes
13705                 TERMCAP_LIBS=-lncurses
13706         fi
13707 fi
13708
13709 if test $ol_link_termcap = no ; then
13710         cat >> confdefs.h <<\EOF
13711 #define NO_TERMCAP 1
13712 EOF
13713
13714         TERMCAP_LIBS=
13715 fi
13716
13717 ol_link_sasl=no
13718 ol_link_spasswd=no
13719 if test $ol_with_cyrus_sasl != no ; then
13720         ac_safe=`echo "sasl.h" | sed 'y%./+-%__p_%'`
13721 echo $ac_n "checking for sasl.h""... $ac_c" 1>&6
13722 echo "configure:13723: checking for sasl.h" >&5
13723 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13724   echo $ac_n "(cached) $ac_c" 1>&6
13725 else
13726   cat > conftest.$ac_ext <<EOF
13727 #line 13728 "configure"
13728 #include "confdefs.h"
13729 #include <sasl.h>
13730 EOF
13731 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13732 { (eval echo configure:13733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13733 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13734 if test -z "$ac_err"; then
13735   rm -rf conftest*
13736   eval "ac_cv_header_$ac_safe=yes"
13737 else
13738   echo "$ac_err" >&5
13739   echo "configure: failed program was:" >&5
13740   cat conftest.$ac_ext >&5
13741   rm -rf conftest*
13742   eval "ac_cv_header_$ac_safe=no"
13743 fi
13744 rm -f conftest*
13745 fi
13746 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13747   echo "$ac_t""yes" 1>&6
13748   :
13749 else
13750   echo "$ac_t""no" 1>&6
13751 fi
13752
13753
13754         if test $ac_cv_header_sasl_h = yes ; then
13755                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
13756 echo "configure:13757: checking for sasl_client_init in -lsasl" >&5
13757 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
13758 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13759   echo $ac_n "(cached) $ac_c" 1>&6
13760 else
13761   ac_save_LIBS="$LIBS"
13762 LIBS="-lsasl  $LIBS"
13763 cat > conftest.$ac_ext <<EOF
13764 #line 13765 "configure"
13765 #include "confdefs.h"
13766 /* Override any gcc2 internal prototype to avoid an error.  */
13767 /* We use char because int might match the return type of a gcc2
13768     builtin and then its argument prototype would still apply.  */
13769 char sasl_client_init();
13770
13771 int main() {
13772 sasl_client_init()
13773 ; return 0; }
13774 EOF
13775 if { (eval echo configure:13776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13776   rm -rf conftest*
13777   eval "ac_cv_lib_$ac_lib_var=yes"
13778 else
13779   echo "configure: failed program was:" >&5
13780   cat conftest.$ac_ext >&5
13781   rm -rf conftest*
13782   eval "ac_cv_lib_$ac_lib_var=no"
13783 fi
13784 rm -f conftest*
13785 LIBS="$ac_save_LIBS"
13786
13787 fi
13788 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13789   echo "$ac_t""yes" 1>&6
13790   have_cyrus_sasl=yes
13791 else
13792   echo "$ac_t""no" 1>&6
13793 have_cyrus_sasl=no
13794 fi
13795
13796
13797                 if test $have_cyrus_sasl != no ; then
13798                         SASL_LIBS="-lsasl"
13799                         cat >> confdefs.h <<\EOF
13800 #define HAVE_CYRUS_SASL 1
13801 EOF
13802
13803                         ol_link_sasl=yes
13804                 fi
13805         fi
13806
13807         if test $ol_link_sasl = no -a $ol_with_cyrus_sasl = yes ; then
13808                 { echo "configure: error: no suitable API for --with-cyrus-sasl=$ol_with_cyrus_sasl" 1>&2; exit 1; }
13809         fi
13810 fi
13811
13812 if test $cross_compiling != yes ; then
13813         dev=no
13814         if test -r /dev/urandom ; then
13815                 dev="/dev/urandom";
13816         elif test -r /idev/urandom ; then
13817                 dev="/idev/urandom";
13818         elif test -r /dev/srandom ; then
13819                 dev="/dev/srandom";
13820         elif test -r /dev/random ; then
13821                 dev="/dev/random";
13822         elif test -r /idev/random ; then
13823                 dev="/idev/random";
13824         fi
13825
13826         if test $dev != no ; then
13827                 cat >> confdefs.h <<EOF
13828 #define URANDOM_DEVICE "$dev"
13829 EOF
13830
13831         fi
13832 fi
13833
13834 ol_link_fetch=no
13835 if test $ol_with_fetch != no ; then
13836         ol_LIBS=$LIBS
13837 LIBS="-lfetch -lcom_err $LIBS"
13838 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
13839 echo "configure:13840: checking fetch(3) library" >&5
13840 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
13841   echo $ac_n "(cached) $ac_c" 1>&6
13842 else
13843   
13844         cat > conftest.$ac_ext <<EOF
13845 #line 13846 "configure"
13846 #include "confdefs.h"
13847
13848 #include <sys/param.h>
13849 #include <stdio.h>
13850 #include <fetch.h>
13851 int main() {
13852 struct url *u = fetchParseURL("file:///"); 
13853 ; return 0; }
13854 EOF
13855 if { (eval echo configure:13856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13856   rm -rf conftest*
13857   ol_cv_lib_fetch=yes
13858 else
13859   echo "configure: failed program was:" >&5
13860   cat conftest.$ac_ext >&5
13861   rm -rf conftest*
13862   ol_cv_lib_fetch=no
13863 fi
13864 rm -f conftest*
13865 fi
13866
13867 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
13868 LIBS=$ol_LIBS
13869 if test $ol_cv_lib_fetch != no ; then
13870         ol_link_fetch="-lfetch -lcom_err"
13871         cat >> confdefs.h <<\EOF
13872 #define HAVE_FETCH 1
13873 EOF
13874
13875 fi
13876
13877
13878         if test $ol_cv_lib_fetch != no ; then
13879                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
13880                 ol_link_fetch=freebsd
13881
13882         elif test $ol_with_fetch != auto ; then
13883                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
13884         fi 
13885 fi
13886
13887 ol_link_readline=no
13888 if test $ol_with_readline != no ; then
13889         for ac_hdr in readline/readline.h readline/history.h
13890 do
13891 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13892 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13893 echo "configure:13894: checking for $ac_hdr" >&5
13894 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13895   echo $ac_n "(cached) $ac_c" 1>&6
13896 else
13897   cat > conftest.$ac_ext <<EOF
13898 #line 13899 "configure"
13899 #include "confdefs.h"
13900 #include <$ac_hdr>
13901 EOF
13902 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13903 { (eval echo configure:13904: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13904 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13905 if test -z "$ac_err"; then
13906   rm -rf conftest*
13907   eval "ac_cv_header_$ac_safe=yes"
13908 else
13909   echo "$ac_err" >&5
13910   echo "configure: failed program was:" >&5
13911   cat conftest.$ac_ext >&5
13912   rm -rf conftest*
13913   eval "ac_cv_header_$ac_safe=no"
13914 fi
13915 rm -f conftest*
13916 fi
13917 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13918   echo "$ac_t""yes" 1>&6
13919     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13920   cat >> confdefs.h <<EOF
13921 #define $ac_tr_hdr 1
13922 EOF
13923  
13924 else
13925   echo "$ac_t""no" 1>&6
13926 fi
13927 done
13928
13929
13930         if test $ac_cv_header_readline_readline_h = yes ; then
13931                 save_LIBS="$LIBS"
13932                 LIBS="$TERMCAP_LIBS $LIBS"
13933                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
13934 echo "configure:13935: checking for readline in -lreadline" >&5
13935 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
13936 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13937   echo $ac_n "(cached) $ac_c" 1>&6
13938 else
13939   ac_save_LIBS="$LIBS"
13940 LIBS="-lreadline  $LIBS"
13941 cat > conftest.$ac_ext <<EOF
13942 #line 13943 "configure"
13943 #include "confdefs.h"
13944 /* Override any gcc2 internal prototype to avoid an error.  */
13945 /* We use char because int might match the return type of a gcc2
13946     builtin and then its argument prototype would still apply.  */
13947 char readline();
13948
13949 int main() {
13950 readline()
13951 ; return 0; }
13952 EOF
13953 if { (eval echo configure:13954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13954   rm -rf conftest*
13955   eval "ac_cv_lib_$ac_lib_var=yes"
13956 else
13957   echo "configure: failed program was:" >&5
13958   cat conftest.$ac_ext >&5
13959   rm -rf conftest*
13960   eval "ac_cv_lib_$ac_lib_var=no"
13961 fi
13962 rm -f conftest*
13963 LIBS="$ac_save_LIBS"
13964
13965 fi
13966 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13967   echo "$ac_t""yes" 1>&6
13968   have_readline=yes
13969 else
13970   echo "$ac_t""no" 1>&6
13971 have_readline=no
13972 fi
13973
13974                 LIBS="$save_LIBS"
13975                         
13976                 if test $have_readline = yes ; then
13977                         ol_with_readline=found
13978                         ol_link_readline=yes
13979
13980                         READLINE_LIBS="-lreadline"
13981                 fi
13982         fi
13983 fi
13984
13985 if test $ol_link_readline = yes ; then
13986         cat >> confdefs.h <<\EOF
13987 #define HAVE_READLINE 1
13988 EOF
13989
13990 fi
13991
13992
13993 if test $ol_enable_crypt != no ; then
13994         echo $ac_n "checking for crypt""... $ac_c" 1>&6
13995 echo "configure:13996: checking for crypt" >&5
13996 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
13997   echo $ac_n "(cached) $ac_c" 1>&6
13998 else
13999   cat > conftest.$ac_ext <<EOF
14000 #line 14001 "configure"
14001 #include "confdefs.h"
14002 /* System header to define __stub macros and hopefully few prototypes,
14003     which can conflict with char crypt(); below.  */
14004 #include <assert.h>
14005 /* Override any gcc2 internal prototype to avoid an error.  */
14006 /* We use char because int might match the return type of a gcc2
14007     builtin and then its argument prototype would still apply.  */
14008 char crypt();
14009 char (*f)();
14010
14011 int main() {
14012
14013 /* The GNU C library defines this for functions which it implements
14014     to always fail with ENOSYS.  Some functions are actually named
14015     something starting with __ and the normal name is an alias.  */
14016 #if defined (__stub_crypt) || defined (__stub___crypt)
14017 choke me
14018 #else
14019 f = crypt;
14020 #endif
14021
14022 ; return 0; }
14023 EOF
14024 if { (eval echo configure:14025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14025   rm -rf conftest*
14026   eval "ac_cv_func_crypt=yes"
14027 else
14028   echo "configure: failed program was:" >&5
14029   cat conftest.$ac_ext >&5
14030   rm -rf conftest*
14031   eval "ac_cv_func_crypt=no"
14032 fi
14033 rm -f conftest*
14034 fi
14035
14036 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
14037   echo "$ac_t""yes" 1>&6
14038   have_crypt=yes
14039 else
14040   echo "$ac_t""no" 1>&6
14041
14042                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
14043 echo "configure:14044: checking for crypt in -lcrypt" >&5
14044 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
14045 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14046   echo $ac_n "(cached) $ac_c" 1>&6
14047 else
14048   ac_save_LIBS="$LIBS"
14049 LIBS="-lcrypt  $LIBS"
14050 cat > conftest.$ac_ext <<EOF
14051 #line 14052 "configure"
14052 #include "confdefs.h"
14053 /* Override any gcc2 internal prototype to avoid an error.  */
14054 /* We use char because int might match the return type of a gcc2
14055     builtin and then its argument prototype would still apply.  */
14056 char crypt();
14057
14058 int main() {
14059 crypt()
14060 ; return 0; }
14061 EOF
14062 if { (eval echo configure:14063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14063   rm -rf conftest*
14064   eval "ac_cv_lib_$ac_lib_var=yes"
14065 else
14066   echo "configure: failed program was:" >&5
14067   cat conftest.$ac_ext >&5
14068   rm -rf conftest*
14069   eval "ac_cv_lib_$ac_lib_var=no"
14070 fi
14071 rm -f conftest*
14072 LIBS="$ac_save_LIBS"
14073
14074 fi
14075 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14076   echo "$ac_t""yes" 1>&6
14077   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
14078                         have_crypt=yes
14079 else
14080   echo "$ac_t""no" 1>&6
14081 have_crypt=no
14082 fi
14083
14084 fi
14085
14086
14087         if test $have_crypt = yes ; then
14088                 cat >> confdefs.h <<\EOF
14089 #define HAVE_CRYPT 1
14090 EOF
14091
14092         else
14093                 echo "configure: warning: could not find crypt" 1>&2
14094                 if test $ol_enable_crypt = yes ; then
14095                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
14096                 fi
14097
14098                 echo "configure: warning: disabling crypt support" 1>&2
14099                 ol_enable_crypt=no
14100         fi
14101 fi
14102
14103 if test $ol_enable_proctitle != no ; then
14104         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
14105 echo "configure:14106: checking for setproctitle" >&5
14106 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
14107   echo $ac_n "(cached) $ac_c" 1>&6
14108 else
14109   cat > conftest.$ac_ext <<EOF
14110 #line 14111 "configure"
14111 #include "confdefs.h"
14112 /* System header to define __stub macros and hopefully few prototypes,
14113     which can conflict with char setproctitle(); below.  */
14114 #include <assert.h>
14115 /* Override any gcc2 internal prototype to avoid an error.  */
14116 /* We use char because int might match the return type of a gcc2
14117     builtin and then its argument prototype would still apply.  */
14118 char setproctitle();
14119 char (*f)();
14120
14121 int main() {
14122
14123 /* The GNU C library defines this for functions which it implements
14124     to always fail with ENOSYS.  Some functions are actually named
14125     something starting with __ and the normal name is an alias.  */
14126 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
14127 choke me
14128 #else
14129 f = setproctitle;
14130 #endif
14131
14132 ; return 0; }
14133 EOF
14134 if { (eval echo configure:14135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14135   rm -rf conftest*
14136   eval "ac_cv_func_setproctitle=yes"
14137 else
14138   echo "configure: failed program was:" >&5
14139   cat conftest.$ac_ext >&5
14140   rm -rf conftest*
14141   eval "ac_cv_func_setproctitle=no"
14142 fi
14143 rm -f conftest*
14144 fi
14145
14146 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
14147   echo "$ac_t""yes" 1>&6
14148   have_setproctitle=yes
14149 else
14150   echo "$ac_t""no" 1>&6
14151
14152                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
14153 echo "configure:14154: checking for setproctitle in -lutil" >&5
14154 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
14155 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14156   echo $ac_n "(cached) $ac_c" 1>&6
14157 else
14158   ac_save_LIBS="$LIBS"
14159 LIBS="-lutil  $LIBS"
14160 cat > conftest.$ac_ext <<EOF
14161 #line 14162 "configure"
14162 #include "confdefs.h"
14163 /* Override any gcc2 internal prototype to avoid an error.  */
14164 /* We use char because int might match the return type of a gcc2
14165     builtin and then its argument prototype would still apply.  */
14166 char setproctitle();
14167
14168 int main() {
14169 setproctitle()
14170 ; return 0; }
14171 EOF
14172 if { (eval echo configure:14173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14173   rm -rf conftest*
14174   eval "ac_cv_lib_$ac_lib_var=yes"
14175 else
14176   echo "configure: failed program was:" >&5
14177   cat conftest.$ac_ext >&5
14178   rm -rf conftest*
14179   eval "ac_cv_lib_$ac_lib_var=no"
14180 fi
14181 rm -f conftest*
14182 LIBS="$ac_save_LIBS"
14183
14184 fi
14185 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14186   echo "$ac_t""yes" 1>&6
14187   have_setproctitle=yes
14188                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
14189 else
14190   echo "$ac_t""no" 1>&6
14191 have_setproctitle=no
14192                         LIBOBJS="$LIBOBJS setproctitle.o"
14193                         LIBSRCS="$LIBSRCS setproctitle.c"
14194 fi
14195
14196 fi
14197
14198
14199         if test $have_setproctitle = yes ; then
14200                 cat >> confdefs.h <<\EOF
14201 #define HAVE_SETPROCTITLE 1
14202 EOF
14203
14204         fi
14205 fi
14206
14207 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
14208 echo "configure:14209: checking for ANSI C header files" >&5
14209 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
14210   echo $ac_n "(cached) $ac_c" 1>&6
14211 else
14212   cat > conftest.$ac_ext <<EOF
14213 #line 14214 "configure"
14214 #include "confdefs.h"
14215 #include <stdlib.h>
14216 #include <stdarg.h>
14217 #include <string.h>
14218 #include <float.h>
14219 EOF
14220 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14221 { (eval echo configure:14222: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14222 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14223 if test -z "$ac_err"; then
14224   rm -rf conftest*
14225   ac_cv_header_stdc=yes
14226 else
14227   echo "$ac_err" >&5
14228   echo "configure: failed program was:" >&5
14229   cat conftest.$ac_ext >&5
14230   rm -rf conftest*
14231   ac_cv_header_stdc=no
14232 fi
14233 rm -f conftest*
14234
14235 if test $ac_cv_header_stdc = yes; then
14236   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14237 cat > conftest.$ac_ext <<EOF
14238 #line 14239 "configure"
14239 #include "confdefs.h"
14240 #include <string.h>
14241 EOF
14242 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14243   egrep "memchr" >/dev/null 2>&1; then
14244   :
14245 else
14246   rm -rf conftest*
14247   ac_cv_header_stdc=no
14248 fi
14249 rm -f conftest*
14250
14251 fi
14252
14253 if test $ac_cv_header_stdc = yes; then
14254   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14255 cat > conftest.$ac_ext <<EOF
14256 #line 14257 "configure"
14257 #include "confdefs.h"
14258 #include <stdlib.h>
14259 EOF
14260 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14261   egrep "free" >/dev/null 2>&1; then
14262   :
14263 else
14264   rm -rf conftest*
14265   ac_cv_header_stdc=no
14266 fi
14267 rm -f conftest*
14268
14269 fi
14270
14271 if test $ac_cv_header_stdc = yes; then
14272   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14273 if test "$cross_compiling" = yes; then
14274   :
14275 else
14276   cat > conftest.$ac_ext <<EOF
14277 #line 14278 "configure"
14278 #include "confdefs.h"
14279 #include <ctype.h>
14280 #if ((' ' & 0x0FF) == 0x020)
14281 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14282 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14283 #else
14284 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14285  || ('j' <= (c) && (c) <= 'r') \
14286  || ('s' <= (c) && (c) <= 'z'))
14287 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14288 #endif
14289 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14290 int main () { int i; for (i = 0; i < 256; i++)
14291 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
14292 exit (0); }
14293
14294 EOF
14295 if { (eval echo configure:14296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14296 then
14297   :
14298 else
14299   echo "configure: failed program was:" >&5
14300   cat conftest.$ac_ext >&5
14301   rm -fr conftest*
14302   ac_cv_header_stdc=no
14303 fi
14304 rm -fr conftest*
14305 fi
14306
14307 fi
14308 fi
14309
14310 echo "$ac_t""$ac_cv_header_stdc" 1>&6
14311 if test $ac_cv_header_stdc = yes; then
14312   cat >> confdefs.h <<\EOF
14313 #define STDC_HEADERS 1
14314 EOF
14315
14316 fi
14317
14318 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
14319 echo "configure:14320: checking for mode_t" >&5
14320 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
14321   echo $ac_n "(cached) $ac_c" 1>&6
14322 else
14323   cat > conftest.$ac_ext <<EOF
14324 #line 14325 "configure"
14325 #include "confdefs.h"
14326 #include <sys/types.h>
14327 #if STDC_HEADERS
14328 #include <stdlib.h>
14329 #include <stddef.h>
14330 #endif
14331
14332 EOF
14333 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14334   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14335   rm -rf conftest*
14336   eval "ac_cv_type_mode_t=yes"
14337 else
14338   rm -rf conftest*
14339   eval "ac_cv_type_mode_t=no"
14340 fi
14341 rm -f conftest*
14342
14343 fi
14344 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
14345   echo "$ac_t""yes" 1>&6
14346 else
14347   echo "$ac_t""no" 1>&6
14348   cat >> confdefs.h <<EOF
14349 #define mode_t int
14350 EOF
14351
14352 fi
14353
14354 echo $ac_n "checking for off_t""... $ac_c" 1>&6
14355 echo "configure:14356: checking for off_t" >&5
14356 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
14357   echo $ac_n "(cached) $ac_c" 1>&6
14358 else
14359   cat > conftest.$ac_ext <<EOF
14360 #line 14361 "configure"
14361 #include "confdefs.h"
14362 #include <sys/types.h>
14363 #if STDC_HEADERS
14364 #include <stdlib.h>
14365 #include <stddef.h>
14366 #endif
14367
14368 EOF
14369 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14370   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14371   rm -rf conftest*
14372   eval "ac_cv_type_off_t=yes"
14373 else
14374   rm -rf conftest*
14375   eval "ac_cv_type_off_t=no"
14376 fi
14377 rm -f conftest*
14378
14379 fi
14380 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
14381   echo "$ac_t""yes" 1>&6
14382 else
14383   echo "$ac_t""no" 1>&6
14384   cat >> confdefs.h <<EOF
14385 #define off_t long
14386 EOF
14387
14388 fi
14389
14390 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
14391 echo "configure:14392: checking for pid_t" >&5
14392 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
14393   echo $ac_n "(cached) $ac_c" 1>&6
14394 else
14395   cat > conftest.$ac_ext <<EOF
14396 #line 14397 "configure"
14397 #include "confdefs.h"
14398 #include <sys/types.h>
14399 #if STDC_HEADERS
14400 #include <stdlib.h>
14401 #include <stddef.h>
14402 #endif
14403
14404 EOF
14405 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14406   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14407   rm -rf conftest*
14408   eval "ac_cv_type_pid_t=yes"
14409 else
14410   rm -rf conftest*
14411   eval "ac_cv_type_pid_t=no"
14412 fi
14413 rm -f conftest*
14414
14415 fi
14416 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
14417   echo "$ac_t""yes" 1>&6
14418 else
14419   echo "$ac_t""no" 1>&6
14420   cat >> confdefs.h <<EOF
14421 #define pid_t int
14422 EOF
14423
14424 fi
14425
14426 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
14427 echo "configure:14428: checking for ptrdiff_t" >&5
14428 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
14429   echo $ac_n "(cached) $ac_c" 1>&6
14430 else
14431   cat > conftest.$ac_ext <<EOF
14432 #line 14433 "configure"
14433 #include "confdefs.h"
14434 #include <stddef.h>
14435 int main() {
14436 ptrdiff_t p
14437 ; return 0; }
14438 EOF
14439 if { (eval echo configure:14440: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14440   rm -rf conftest*
14441   am_cv_type_ptrdiff_t=yes
14442 else
14443   echo "configure: failed program was:" >&5
14444   cat conftest.$ac_ext >&5
14445   rm -rf conftest*
14446   am_cv_type_ptrdiff_t=no
14447 fi
14448 rm -f conftest*
14449 fi
14450
14451 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
14452    if test $am_cv_type_ptrdiff_t = yes; then
14453      cat >> confdefs.h <<\EOF
14454 #define HAVE_PTRDIFF_T 1
14455 EOF
14456
14457    fi
14458
14459 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
14460 echo "configure:14461: checking return type of signal handlers" >&5
14461 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
14462   echo $ac_n "(cached) $ac_c" 1>&6
14463 else
14464   cat > conftest.$ac_ext <<EOF
14465 #line 14466 "configure"
14466 #include "confdefs.h"
14467 #include <sys/types.h>
14468 #include <signal.h>
14469 #ifdef signal
14470 #undef signal
14471 #endif
14472 #ifdef __cplusplus
14473 extern "C" void (*signal (int, void (*)(int)))(int);
14474 #else
14475 void (*signal ()) ();
14476 #endif
14477
14478 int main() {
14479 int i;
14480 ; return 0; }
14481 EOF
14482 if { (eval echo configure:14483: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14483   rm -rf conftest*
14484   ac_cv_type_signal=void
14485 else
14486   echo "configure: failed program was:" >&5
14487   cat conftest.$ac_ext >&5
14488   rm -rf conftest*
14489   ac_cv_type_signal=int
14490 fi
14491 rm -f conftest*
14492 fi
14493
14494 echo "$ac_t""$ac_cv_type_signal" 1>&6
14495 cat >> confdefs.h <<EOF
14496 #define RETSIGTYPE $ac_cv_type_signal
14497 EOF
14498
14499
14500 echo $ac_n "checking for size_t""... $ac_c" 1>&6
14501 echo "configure:14502: checking for size_t" >&5
14502 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
14503   echo $ac_n "(cached) $ac_c" 1>&6
14504 else
14505   cat > conftest.$ac_ext <<EOF
14506 #line 14507 "configure"
14507 #include "confdefs.h"
14508 #include <sys/types.h>
14509 #if STDC_HEADERS
14510 #include <stdlib.h>
14511 #include <stddef.h>
14512 #endif
14513
14514 EOF
14515 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14516   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14517   rm -rf conftest*
14518   eval "ac_cv_type_size_t=yes"
14519 else
14520   rm -rf conftest*
14521   eval "ac_cv_type_size_t=no"
14522 fi
14523 rm -f conftest*
14524
14525 fi
14526 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
14527   echo "$ac_t""yes" 1>&6
14528 else
14529   echo "$ac_t""no" 1>&6
14530   cat >> confdefs.h <<EOF
14531 #define size_t unsigned
14532 EOF
14533
14534 fi
14535
14536
14537 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
14538 echo "configure:14539: checking for ssize_t" >&5
14539 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
14540   echo $ac_n "(cached) $ac_c" 1>&6
14541 else
14542   cat > conftest.$ac_ext <<EOF
14543 #line 14544 "configure"
14544 #include "confdefs.h"
14545 #include <sys/types.h>
14546 #if STDC_HEADERS
14547 #include <stdlib.h>
14548 #include <stddef.h>
14549 #endif
14550
14551 EOF
14552 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14553   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14554   rm -rf conftest*
14555   eval "ac_cv_type_ssize_t=yes"
14556 else
14557   rm -rf conftest*
14558   eval "ac_cv_type_ssize_t=no"
14559 fi
14560 rm -f conftest*
14561
14562 fi
14563 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
14564   echo "$ac_t""yes" 1>&6
14565 else
14566   echo "$ac_t""no" 1>&6
14567   cat >> confdefs.h <<EOF
14568 #define ssize_t signed int
14569 EOF
14570
14571 fi
14572
14573 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
14574 echo "configure:14575: checking for caddr_t" >&5
14575 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
14576   echo $ac_n "(cached) $ac_c" 1>&6
14577 else
14578   cat > conftest.$ac_ext <<EOF
14579 #line 14580 "configure"
14580 #include "confdefs.h"
14581 #include <sys/types.h>
14582 #if STDC_HEADERS
14583 #include <stdlib.h>
14584 #include <stddef.h>
14585 #endif
14586
14587 EOF
14588 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14589   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14590   rm -rf conftest*
14591   eval "ac_cv_type_caddr_t=yes"
14592 else
14593   rm -rf conftest*
14594   eval "ac_cv_type_caddr_t=no"
14595 fi
14596 rm -f conftest*
14597
14598 fi
14599 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
14600   echo "$ac_t""yes" 1>&6
14601 else
14602   echo "$ac_t""no" 1>&6
14603   cat >> confdefs.h <<EOF
14604 #define caddr_t char *
14605 EOF
14606
14607 fi
14608
14609
14610 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
14611 echo "configure:14612: checking for socklen_t" >&5
14612 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
14613   echo $ac_n "(cached) $ac_c" 1>&6
14614 else
14615   cat > conftest.$ac_ext <<EOF
14616 #line 14617 "configure"
14617 #include "confdefs.h"
14618
14619 #ifdef HAVE_SYS_TYPES_H
14620 #include <sys/types.h>
14621 #endif
14622 #ifdef HAVE_SYS_SOCKET_H
14623 #include <sys/socket.h>
14624 #endif
14625
14626 int main() {
14627 socklen_t len;
14628 ; return 0; }
14629 EOF
14630 if { (eval echo configure:14631: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14631   rm -rf conftest*
14632   ol_cv_type_socklen_t=yes
14633 else
14634   echo "configure: failed program was:" >&5
14635   cat conftest.$ac_ext >&5
14636   rm -rf conftest*
14637   ol_cv_type_socklen_t=no
14638 fi
14639 rm -f conftest*
14640 fi
14641
14642 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
14643   if test $ol_cv_type_socklen_t = no; then
14644     cat >> confdefs.h <<\EOF
14645 #define socklen_t int
14646 EOF
14647
14648   fi
14649  
14650 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
14651 echo "configure:14652: checking for member st_blksize in aggregate type struct stat" >&5
14652 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
14653   echo $ac_n "(cached) $ac_c" 1>&6
14654 else
14655   cat > conftest.$ac_ext <<EOF
14656 #line 14657 "configure"
14657 #include "confdefs.h"
14658 #include <sys/types.h>
14659 #include <sys/stat.h>
14660 int main() {
14661 struct stat foo; foo.st_blksize;
14662 ; return 0; }
14663 EOF
14664 if { (eval echo configure:14665: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14665   rm -rf conftest*
14666   ac_cv_c_struct_member_st_blksize=yes
14667 else
14668   echo "configure: failed program was:" >&5
14669   cat conftest.$ac_ext >&5
14670   rm -rf conftest*
14671   ac_cv_c_struct_member_st_blksize=no
14672 fi
14673 rm -f conftest*
14674 fi
14675
14676 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
14677 st_blksize="$ac_cv_c_struct_member_st_blksize"
14678 if test $ac_cv_c_struct_member_st_blksize = yes; then
14679   cat >> confdefs.h <<\EOF
14680 #define HAVE_ST_BLKSIZE 1
14681 EOF
14682
14683 fi
14684
14685 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
14686 echo "configure:14687: checking whether time.h and sys/time.h may both be included" >&5
14687 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
14688   echo $ac_n "(cached) $ac_c" 1>&6
14689 else
14690   cat > conftest.$ac_ext <<EOF
14691 #line 14692 "configure"
14692 #include "confdefs.h"
14693 #include <sys/types.h>
14694 #include <sys/time.h>
14695 #include <time.h>
14696 int main() {
14697 struct tm *tp;
14698 ; return 0; }
14699 EOF
14700 if { (eval echo configure:14701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14701   rm -rf conftest*
14702   ac_cv_header_time=yes
14703 else
14704   echo "configure: failed program was:" >&5
14705   cat conftest.$ac_ext >&5
14706   rm -rf conftest*
14707   ac_cv_header_time=no
14708 fi
14709 rm -f conftest*
14710 fi
14711
14712 echo "$ac_t""$ac_cv_header_time" 1>&6
14713 if test $ac_cv_header_time = yes; then
14714   cat >> confdefs.h <<\EOF
14715 #define TIME_WITH_SYS_TIME 1
14716 EOF
14717
14718 fi
14719
14720 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
14721 echo "configure:14722: checking whether struct tm is in sys/time.h or time.h" >&5
14722 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
14723   echo $ac_n "(cached) $ac_c" 1>&6
14724 else
14725   cat > conftest.$ac_ext <<EOF
14726 #line 14727 "configure"
14727 #include "confdefs.h"
14728 #include <sys/types.h>
14729 #include <time.h>
14730 int main() {
14731 struct tm *tp; tp->tm_sec;
14732 ; return 0; }
14733 EOF
14734 if { (eval echo configure:14735: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14735   rm -rf conftest*
14736   ac_cv_struct_tm=time.h
14737 else
14738   echo "configure: failed program was:" >&5
14739   cat conftest.$ac_ext >&5
14740   rm -rf conftest*
14741   ac_cv_struct_tm=sys/time.h
14742 fi
14743 rm -f conftest*
14744 fi
14745
14746 echo "$ac_t""$ac_cv_struct_tm" 1>&6
14747 if test $ac_cv_struct_tm = sys/time.h; then
14748   cat >> confdefs.h <<\EOF
14749 #define TM_IN_SYS_TIME 1
14750 EOF
14751
14752 fi
14753
14754 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
14755 echo "configure:14756: checking for uid_t in sys/types.h" >&5
14756 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
14757   echo $ac_n "(cached) $ac_c" 1>&6
14758 else
14759   cat > conftest.$ac_ext <<EOF
14760 #line 14761 "configure"
14761 #include "confdefs.h"
14762 #include <sys/types.h>
14763 EOF
14764 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14765   egrep "uid_t" >/dev/null 2>&1; then
14766   rm -rf conftest*
14767   ac_cv_type_uid_t=yes
14768 else
14769   rm -rf conftest*
14770   ac_cv_type_uid_t=no
14771 fi
14772 rm -f conftest*
14773
14774 fi
14775
14776 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
14777 if test $ac_cv_type_uid_t = no; then
14778   cat >> confdefs.h <<\EOF
14779 #define uid_t int
14780 EOF
14781
14782   cat >> confdefs.h <<\EOF
14783 #define gid_t int
14784 EOF
14785
14786 fi
14787
14788 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
14789 echo "configure:14790: checking for sig_atomic_t" >&5
14790 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
14791   echo $ac_n "(cached) $ac_c" 1>&6
14792 else
14793   cat > conftest.$ac_ext <<EOF
14794 #line 14795 "configure"
14795 #include "confdefs.h"
14796 #include <signal.h>
14797 int main() {
14798 sig_atomic_t atomic;
14799 ; return 0; }
14800 EOF
14801 if { (eval echo configure:14802: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14802   rm -rf conftest*
14803   ol_cv_type_sig_atomic_t=yes
14804 else
14805   echo "configure: failed program was:" >&5
14806   cat conftest.$ac_ext >&5
14807   rm -rf conftest*
14808   ol_cv_type_sig_atomic_t=no
14809 fi
14810 rm -f conftest*
14811 fi
14812
14813 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
14814   if test $ol_cv_type_sig_atomic_t = no; then
14815     cat >> confdefs.h <<\EOF
14816 #define sig_atomic_t int
14817 EOF
14818
14819   fi
14820  
14821
14822
14823 # test for pw_gecos in struct passwd
14824 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
14825 echo "configure:14826: checking struct passwd for pw_gecos" >&5
14826 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
14827   echo $ac_n "(cached) $ac_c" 1>&6
14828 else
14829   
14830         cat > conftest.$ac_ext <<EOF
14831 #line 14832 "configure"
14832 #include "confdefs.h"
14833 #include <pwd.h>
14834 int main() {
14835
14836         struct passwd pwd;
14837         pwd.pw_gecos = pwd.pw_name;
14838
14839 ; return 0; }
14840 EOF
14841 if { (eval echo configure:14842: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14842   rm -rf conftest*
14843   ol_cv_struct_passwd_pw_gecos=yes
14844 else
14845   echo "configure: failed program was:" >&5
14846   cat conftest.$ac_ext >&5
14847   rm -rf conftest*
14848   ol_cv_struct_passwd_pw_gecos=no
14849 fi
14850 rm -f conftest*
14851 fi
14852
14853 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
14854 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
14855         cat >> confdefs.h <<\EOF
14856 #define HAVE_PW_GECOS 1
14857 EOF
14858
14859 fi
14860
14861 # test for pw_passwd in struct passwd
14862 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
14863 echo "configure:14864: checking struct passwd for pw_passwd" >&5
14864 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
14865   echo $ac_n "(cached) $ac_c" 1>&6
14866 else
14867   
14868         cat > conftest.$ac_ext <<EOF
14869 #line 14870 "configure"
14870 #include "confdefs.h"
14871 #include <pwd.h>
14872 int main() {
14873
14874         struct passwd pwd;
14875         pwd.pw_passwd = pwd.pw_name;
14876
14877 ; return 0; }
14878 EOF
14879 if { (eval echo configure:14880: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14880   rm -rf conftest*
14881   ol_cv_struct_passwd_pw_passwd=yes
14882 else
14883   echo "configure: failed program was:" >&5
14884   cat conftest.$ac_ext >&5
14885   rm -rf conftest*
14886   ol_cv_struct_passwd_pw_passwd=no
14887 fi
14888 rm -f conftest*
14889 fi
14890
14891 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
14892 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
14893         cat >> confdefs.h <<\EOF
14894 #define HAVE_PW_PASSWD 1
14895 EOF
14896
14897 fi
14898
14899
14900 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
14901 echo "configure:14902: checking if toupper() requires islower()" >&5
14902 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
14903   echo $ac_n "(cached) $ac_c" 1>&6
14904 else
14905   
14906         if test "$cross_compiling" = yes; then
14907   ol_cv_c_upper_lower=safe
14908 else
14909   cat > conftest.$ac_ext <<EOF
14910 #line 14911 "configure"
14911 #include "confdefs.h"
14912
14913 #include <ctype.h>
14914 main()
14915 {
14916         if ('C' == toupper('C'))
14917                 exit(0);
14918         else
14919                 exit(1);
14920 }
14921 EOF
14922 if { (eval echo configure:14923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14923 then
14924   ol_cv_c_upper_lower=no
14925 else
14926   echo "configure: failed program was:" >&5
14927   cat conftest.$ac_ext >&5
14928   rm -fr conftest*
14929   ol_cv_c_upper_lower=yes
14930 fi
14931 rm -fr conftest*
14932 fi
14933
14934 fi
14935
14936 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
14937 if test $ol_cv_c_upper_lower != no ; then
14938         cat >> confdefs.h <<\EOF
14939 #define C_UPPER_LOWER 1
14940 EOF
14941
14942 fi
14943
14944 echo $ac_n "checking for working const""... $ac_c" 1>&6
14945 echo "configure:14946: checking for working const" >&5
14946 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
14947   echo $ac_n "(cached) $ac_c" 1>&6
14948 else
14949   cat > conftest.$ac_ext <<EOF
14950 #line 14951 "configure"
14951 #include "confdefs.h"
14952
14953 int main() {
14954
14955 /* Ultrix mips cc rejects this.  */
14956 typedef int charset[2]; const charset x;
14957 /* SunOS 4.1.1 cc rejects this.  */
14958 char const *const *ccp;
14959 char **p;
14960 /* NEC SVR4.0.2 mips cc rejects this.  */
14961 struct point {int x, y;};
14962 static struct point const zero = {0,0};
14963 /* AIX XL C 1.02.0.0 rejects this.
14964    It does not let you subtract one const X* pointer from another in an arm
14965    of an if-expression whose if-part is not a constant expression */
14966 const char *g = "string";
14967 ccp = &g + (g ? g-g : 0);
14968 /* HPUX 7.0 cc rejects these. */
14969 ++ccp;
14970 p = (char**) ccp;
14971 ccp = (char const *const *) p;
14972 { /* SCO 3.2v4 cc rejects this.  */
14973   char *t;
14974   char const *s = 0 ? (char *) 0 : (char const *) 0;
14975
14976   *t++ = 0;
14977 }
14978 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
14979   int x[] = {25, 17};
14980   const int *foo = &x[0];
14981   ++foo;
14982 }
14983 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
14984   typedef const int *iptr;
14985   iptr p = 0;
14986   ++p;
14987 }
14988 { /* AIX XL C 1.02.0.0 rejects this saying
14989      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
14990   struct s { int j; const int *ap[3]; };
14991   struct s *b; b->j = 5;
14992 }
14993 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
14994   const int foo = 10;
14995 }
14996
14997 ; return 0; }
14998 EOF
14999 if { (eval echo configure:15000: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15000   rm -rf conftest*
15001   ac_cv_c_const=yes
15002 else
15003   echo "configure: failed program was:" >&5
15004   cat conftest.$ac_ext >&5
15005   rm -rf conftest*
15006   ac_cv_c_const=no
15007 fi
15008 rm -f conftest*
15009 fi
15010
15011 echo "$ac_t""$ac_cv_c_const" 1>&6
15012 if test $ac_cv_c_const = no; then
15013   cat >> confdefs.h <<\EOF
15014 #define const 
15015 EOF
15016
15017 fi
15018
15019 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
15020 echo "configure:15021: checking if compiler understands volatile" >&5
15021 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
15022   echo $ac_n "(cached) $ac_c" 1>&6
15023 else
15024   cat > conftest.$ac_ext <<EOF
15025 #line 15026 "configure"
15026 #include "confdefs.h"
15027 int x, y, z;
15028 int main() {
15029 volatile int a; int * volatile b = x ? &y : &z;
15030       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
15031       *b = 0;
15032 ; return 0; }
15033 EOF
15034 if { (eval echo configure:15035: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15035   rm -rf conftest*
15036   ol_cv_c_volatile=yes
15037 else
15038   echo "configure: failed program was:" >&5
15039   cat conftest.$ac_ext >&5
15040   rm -rf conftest*
15041   ol_cv_c_volatile=no
15042 fi
15043 rm -f conftest*
15044 fi
15045
15046 echo "$ac_t""$ol_cv_c_volatile" 1>&6
15047   if test $ol_cv_c_volatile = yes; then
15048     : 
15049   else
15050     cat >> confdefs.h <<\EOF
15051 #define volatile 
15052 EOF
15053
15054   fi
15055  
15056
15057 if test $cross_compiling = yes ; then
15058         cat >> confdefs.h <<\EOF
15059 #define CROSS_COMPILING 1
15060 EOF
15061
15062 else
15063         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
15064 echo "configure:15065: checking whether byte ordering is bigendian" >&5
15065 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
15066   echo $ac_n "(cached) $ac_c" 1>&6
15067 else
15068   ac_cv_c_bigendian=unknown
15069 # See if sys/param.h defines the BYTE_ORDER macro.
15070 cat > conftest.$ac_ext <<EOF
15071 #line 15072 "configure"
15072 #include "confdefs.h"
15073 #include <sys/types.h>
15074 #include <sys/param.h>
15075 int main() {
15076
15077 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
15078  bogus endian macros
15079 #endif
15080 ; return 0; }
15081 EOF
15082 if { (eval echo configure:15083: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15083   rm -rf conftest*
15084   # It does; now see whether it defined to BIG_ENDIAN or not.
15085 cat > conftest.$ac_ext <<EOF
15086 #line 15087 "configure"
15087 #include "confdefs.h"
15088 #include <sys/types.h>
15089 #include <sys/param.h>
15090 int main() {
15091
15092 #if BYTE_ORDER != BIG_ENDIAN
15093  not big endian
15094 #endif
15095 ; return 0; }
15096 EOF
15097 if { (eval echo configure:15098: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15098   rm -rf conftest*
15099   ac_cv_c_bigendian=yes
15100 else
15101   echo "configure: failed program was:" >&5
15102   cat conftest.$ac_ext >&5
15103   rm -rf conftest*
15104   ac_cv_c_bigendian=no
15105 fi
15106 rm -f conftest*
15107 else
15108   echo "configure: failed program was:" >&5
15109   cat conftest.$ac_ext >&5
15110 fi
15111 rm -f conftest*
15112 if test $ac_cv_c_bigendian = unknown; then
15113 if test "$cross_compiling" = yes; then
15114     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
15115 else
15116   cat > conftest.$ac_ext <<EOF
15117 #line 15118 "configure"
15118 #include "confdefs.h"
15119 main () {
15120   /* Are we little or big endian?  From Harbison&Steele.  */
15121   union
15122   {
15123     long l;
15124     char c[sizeof (long)];
15125   } u;
15126   u.l = 1;
15127   exit (u.c[sizeof (long) - 1] == 1);
15128 }
15129 EOF
15130 if { (eval echo configure:15131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15131 then
15132   ac_cv_c_bigendian=no
15133 else
15134   echo "configure: failed program was:" >&5
15135   cat conftest.$ac_ext >&5
15136   rm -fr conftest*
15137   ac_cv_c_bigendian=yes
15138 fi
15139 rm -fr conftest*
15140 fi
15141
15142 fi
15143 fi
15144
15145 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
15146 if test $ac_cv_c_bigendian = yes; then
15147   cat >> confdefs.h <<\EOF
15148 #define WORDS_BIGENDIAN 1
15149 EOF
15150
15151 fi
15152
15153 fi
15154
15155 echo $ac_n "checking size of short""... $ac_c" 1>&6
15156 echo "configure:15157: checking size of short" >&5 
15157 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
15158   echo $ac_n "(cached) $ac_c" 1>&6
15159 else
15160   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
15161   cat > conftest.$ac_ext <<EOF
15162 #line 15163 "configure"
15163 #include "confdefs.h"
15164 #include "confdefs.h" 
15165 #include <sys/types.h> 
15166  
15167
15168 int main() {
15169 switch (0) case 0: case (sizeof (short) == $ac_size):;
15170 ; return 0; }
15171 EOF
15172 if { (eval echo configure:15173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15173   rm -rf conftest*
15174   ac_cv_sizeof_short=$ac_size
15175 else
15176   echo "configure: failed program was:" >&5
15177   cat conftest.$ac_ext >&5
15178 fi
15179 rm -f conftest* 
15180   if test x$ac_cv_sizeof_short != x ; then break; fi 
15181 done 
15182
15183 fi
15184  
15185 if test x$ac_cv_sizeof_short = x ; then 
15186   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
15187 fi 
15188 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
15189 cat >> confdefs.h <<EOF
15190 #define SIZEOF_SHORT $ac_cv_sizeof_short
15191 EOF
15192  
15193  
15194 echo $ac_n "checking size of int""... $ac_c" 1>&6
15195 echo "configure:15196: checking size of int" >&5 
15196 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
15197   echo $ac_n "(cached) $ac_c" 1>&6
15198 else
15199   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
15200   cat > conftest.$ac_ext <<EOF
15201 #line 15202 "configure"
15202 #include "confdefs.h"
15203 #include "confdefs.h" 
15204 #include <sys/types.h> 
15205  
15206
15207 int main() {
15208 switch (0) case 0: case (sizeof (int) == $ac_size):;
15209 ; return 0; }
15210 EOF
15211 if { (eval echo configure:15212: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15212   rm -rf conftest*
15213   ac_cv_sizeof_int=$ac_size
15214 else
15215   echo "configure: failed program was:" >&5
15216   cat conftest.$ac_ext >&5
15217 fi
15218 rm -f conftest* 
15219   if test x$ac_cv_sizeof_int != x ; then break; fi 
15220 done 
15221
15222 fi
15223  
15224 if test x$ac_cv_sizeof_int = x ; then 
15225   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
15226 fi 
15227 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
15228 cat >> confdefs.h <<EOF
15229 #define SIZEOF_INT $ac_cv_sizeof_int
15230 EOF
15231  
15232  
15233 echo $ac_n "checking size of long""... $ac_c" 1>&6
15234 echo "configure:15235: checking size of long" >&5 
15235 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
15236   echo $ac_n "(cached) $ac_c" 1>&6
15237 else
15238   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
15239   cat > conftest.$ac_ext <<EOF
15240 #line 15241 "configure"
15241 #include "confdefs.h"
15242 #include "confdefs.h" 
15243 #include <sys/types.h> 
15244  
15245
15246 int main() {
15247 switch (0) case 0: case (sizeof (long) == $ac_size):;
15248 ; return 0; }
15249 EOF
15250 if { (eval echo configure:15251: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15251   rm -rf conftest*
15252   ac_cv_sizeof_long=$ac_size
15253 else
15254   echo "configure: failed program was:" >&5
15255   cat conftest.$ac_ext >&5
15256 fi
15257 rm -f conftest* 
15258   if test x$ac_cv_sizeof_long != x ; then break; fi 
15259 done 
15260
15261 fi
15262  
15263 if test x$ac_cv_sizeof_long = x ; then 
15264   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
15265 fi 
15266 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
15267 cat >> confdefs.h <<EOF
15268 #define SIZEOF_LONG $ac_cv_sizeof_long
15269 EOF
15270  
15271
15272
15273 if test "$ac_cv_sizeof_int" -lt 4 ; then
15274         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
15275
15276         cat >> confdefs.h <<\EOF
15277 #define LBER_INT_T long
15278 EOF
15279
15280 else
15281         cat >> confdefs.h <<\EOF
15282 #define LBER_INT_T int
15283 EOF
15284
15285 fi
15286
15287 cat >> confdefs.h <<\EOF
15288 #define LBER_LEN_T long
15289 EOF
15290
15291 cat >> confdefs.h <<\EOF
15292 #define LBER_SOCKET_T int
15293 EOF
15294
15295 cat >> confdefs.h <<\EOF
15296 #define LBER_TAG_T long
15297 EOF
15298
15299
15300 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
15301 echo "configure:15302: checking for 8-bit clean memcmp" >&5
15302 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
15303   echo $ac_n "(cached) $ac_c" 1>&6
15304 else
15305   if test "$cross_compiling" = yes; then
15306   ac_cv_func_memcmp_clean=no
15307 else
15308   cat > conftest.$ac_ext <<EOF
15309 #line 15310 "configure"
15310 #include "confdefs.h"
15311
15312 main()
15313 {
15314   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
15315   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
15316 }
15317
15318 EOF
15319 if { (eval echo configure:15320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15320 then
15321   ac_cv_func_memcmp_clean=yes
15322 else
15323   echo "configure: failed program was:" >&5
15324   cat conftest.$ac_ext >&5
15325   rm -fr conftest*
15326   ac_cv_func_memcmp_clean=no
15327 fi
15328 rm -fr conftest*
15329 fi
15330
15331 fi
15332
15333 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
15334 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
15335
15336 echo $ac_n "checking for strftime""... $ac_c" 1>&6
15337 echo "configure:15338: checking for strftime" >&5
15338 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
15339   echo $ac_n "(cached) $ac_c" 1>&6
15340 else
15341   cat > conftest.$ac_ext <<EOF
15342 #line 15343 "configure"
15343 #include "confdefs.h"
15344 /* System header to define __stub macros and hopefully few prototypes,
15345     which can conflict with char strftime(); below.  */
15346 #include <assert.h>
15347 /* Override any gcc2 internal prototype to avoid an error.  */
15348 /* We use char because int might match the return type of a gcc2
15349     builtin and then its argument prototype would still apply.  */
15350 char strftime();
15351 char (*f)();
15352
15353 int main() {
15354
15355 /* The GNU C library defines this for functions which it implements
15356     to always fail with ENOSYS.  Some functions are actually named
15357     something starting with __ and the normal name is an alias.  */
15358 #if defined (__stub_strftime) || defined (__stub___strftime)
15359 choke me
15360 #else
15361 f = strftime;
15362 #endif
15363
15364 ; return 0; }
15365 EOF
15366 if { (eval echo configure:15367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15367   rm -rf conftest*
15368   eval "ac_cv_func_strftime=yes"
15369 else
15370   echo "configure: failed program was:" >&5
15371   cat conftest.$ac_ext >&5
15372   rm -rf conftest*
15373   eval "ac_cv_func_strftime=no"
15374 fi
15375 rm -f conftest*
15376 fi
15377
15378 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
15379   echo "$ac_t""yes" 1>&6
15380   cat >> confdefs.h <<\EOF
15381 #define HAVE_STRFTIME 1
15382 EOF
15383
15384 else
15385   echo "$ac_t""no" 1>&6
15386 # strftime is in -lintl on SCO UNIX.
15387 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
15388 echo "configure:15389: checking for strftime in -lintl" >&5
15389 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
15390 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15391   echo $ac_n "(cached) $ac_c" 1>&6
15392 else
15393   ac_save_LIBS="$LIBS"
15394 LIBS="-lintl  $LIBS"
15395 cat > conftest.$ac_ext <<EOF
15396 #line 15397 "configure"
15397 #include "confdefs.h"
15398 /* Override any gcc2 internal prototype to avoid an error.  */
15399 /* We use char because int might match the return type of a gcc2
15400     builtin and then its argument prototype would still apply.  */
15401 char strftime();
15402
15403 int main() {
15404 strftime()
15405 ; return 0; }
15406 EOF
15407 if { (eval echo configure:15408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15408   rm -rf conftest*
15409   eval "ac_cv_lib_$ac_lib_var=yes"
15410 else
15411   echo "configure: failed program was:" >&5
15412   cat conftest.$ac_ext >&5
15413   rm -rf conftest*
15414   eval "ac_cv_lib_$ac_lib_var=no"
15415 fi
15416 rm -f conftest*
15417 LIBS="$ac_save_LIBS"
15418
15419 fi
15420 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15421   echo "$ac_t""yes" 1>&6
15422   cat >> confdefs.h <<\EOF
15423 #define HAVE_STRFTIME 1
15424 EOF
15425
15426 LIBS="-lintl $LIBS"
15427 else
15428   echo "$ac_t""no" 1>&6
15429 fi
15430
15431 fi
15432
15433
15434 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
15435 echo "configure:15436: checking for inet_aton()" >&5
15436 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
15437   echo $ac_n "(cached) $ac_c" 1>&6
15438 else
15439   cat > conftest.$ac_ext <<EOF
15440 #line 15441 "configure"
15441 #include "confdefs.h"
15442
15443 #ifdef HAVE_SYS_TYPES_H
15444 #       include <sys/types.h>
15445 #endif
15446 #ifdef HAVE_SYS_SOCKET_H
15447 #       include <sys/socket.h>
15448 #       ifdef HAVE_SYS_SELECT_H
15449 #               include <sys/select.h>
15450 #       endif
15451 #       include <netinet/in.h>
15452 #       ifdef HAVE_ARPA_INET_H
15453 #               include <arpa/inet.h>
15454 #       endif
15455 #endif
15456
15457 int main() {
15458 struct in_addr in;
15459 int rc = inet_aton( "255.255.255.255", &in );
15460 ; return 0; }
15461 EOF
15462 if { (eval echo configure:15463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15463   rm -rf conftest*
15464   ol_cv_func_inet_aton=yes
15465 else
15466   echo "configure: failed program was:" >&5
15467   cat conftest.$ac_ext >&5
15468   rm -rf conftest*
15469   ol_cv_func_inet_aton=no
15470 fi
15471 rm -f conftest*
15472 fi
15473
15474 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
15475   if test $ol_cv_func_inet_aton != no; then
15476     cat >> confdefs.h <<\EOF
15477 #define HAVE_INET_ATON 1
15478 EOF
15479
15480   fi
15481  
15482
15483 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
15484 echo "configure:15485: checking for _spawnlp" >&5
15485 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
15486   echo $ac_n "(cached) $ac_c" 1>&6
15487 else
15488   cat > conftest.$ac_ext <<EOF
15489 #line 15490 "configure"
15490 #include "confdefs.h"
15491 /* System header to define __stub macros and hopefully few prototypes,
15492     which can conflict with char _spawnlp(); below.  */
15493 #include <assert.h>
15494 /* Override any gcc2 internal prototype to avoid an error.  */
15495 /* We use char because int might match the return type of a gcc2
15496     builtin and then its argument prototype would still apply.  */
15497 char _spawnlp();
15498 char (*f)();
15499
15500 int main() {
15501
15502 /* The GNU C library defines this for functions which it implements
15503     to always fail with ENOSYS.  Some functions are actually named
15504     something starting with __ and the normal name is an alias.  */
15505 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
15506 choke me
15507 #else
15508 f = _spawnlp;
15509 #endif
15510
15511 ; return 0; }
15512 EOF
15513 if { (eval echo configure:15514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15514   rm -rf conftest*
15515   eval "ac_cv_func__spawnlp=yes"
15516 else
15517   echo "configure: failed program was:" >&5
15518   cat conftest.$ac_ext >&5
15519   rm -rf conftest*
15520   eval "ac_cv_func__spawnlp=no"
15521 fi
15522 rm -f conftest*
15523 fi
15524
15525 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
15526   echo "$ac_t""yes" 1>&6
15527   cat >> confdefs.h <<\EOF
15528 #define HAVE_SPAWNLP 1
15529 EOF
15530
15531 else
15532   echo "$ac_t""no" 1>&6
15533 fi
15534
15535
15536 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
15537 echo "configure:15538: checking for _snprintf" >&5
15538 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
15539   echo $ac_n "(cached) $ac_c" 1>&6
15540 else
15541   cat > conftest.$ac_ext <<EOF
15542 #line 15543 "configure"
15543 #include "confdefs.h"
15544 /* System header to define __stub macros and hopefully few prototypes,
15545     which can conflict with char _snprintf(); below.  */
15546 #include <assert.h>
15547 /* Override any gcc2 internal prototype to avoid an error.  */
15548 /* We use char because int might match the return type of a gcc2
15549     builtin and then its argument prototype would still apply.  */
15550 char _snprintf();
15551 char (*f)();
15552
15553 int main() {
15554
15555 /* The GNU C library defines this for functions which it implements
15556     to always fail with ENOSYS.  Some functions are actually named
15557     something starting with __ and the normal name is an alias.  */
15558 #if defined (__stub__snprintf) || defined (__stub____snprintf)
15559 choke me
15560 #else
15561 f = _snprintf;
15562 #endif
15563
15564 ; return 0; }
15565 EOF
15566 if { (eval echo configure:15567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15567   rm -rf conftest*
15568   eval "ac_cv_func__snprintf=yes"
15569 else
15570   echo "configure: failed program was:" >&5
15571   cat conftest.$ac_ext >&5
15572   rm -rf conftest*
15573   eval "ac_cv_func__snprintf=no"
15574 fi
15575 rm -f conftest*
15576 fi
15577
15578 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
15579   echo "$ac_t""yes" 1>&6
15580   ac_cv_func_snprintf=yes
15581         cat >> confdefs.h <<\EOF
15582 #define snprintf _snprintf
15583 EOF
15584
15585
15586 else
15587   echo "$ac_t""no" 1>&6
15588 fi
15589
15590
15591 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
15592 echo "configure:15593: checking for _vsnprintf" >&5
15593 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
15594   echo $ac_n "(cached) $ac_c" 1>&6
15595 else
15596   cat > conftest.$ac_ext <<EOF
15597 #line 15598 "configure"
15598 #include "confdefs.h"
15599 /* System header to define __stub macros and hopefully few prototypes,
15600     which can conflict with char _vsnprintf(); below.  */
15601 #include <assert.h>
15602 /* Override any gcc2 internal prototype to avoid an error.  */
15603 /* We use char because int might match the return type of a gcc2
15604     builtin and then its argument prototype would still apply.  */
15605 char _vsnprintf();
15606 char (*f)();
15607
15608 int main() {
15609
15610 /* The GNU C library defines this for functions which it implements
15611     to always fail with ENOSYS.  Some functions are actually named
15612     something starting with __ and the normal name is an alias.  */
15613 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
15614 choke me
15615 #else
15616 f = _vsnprintf;
15617 #endif
15618
15619 ; return 0; }
15620 EOF
15621 if { (eval echo configure:15622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15622   rm -rf conftest*
15623   eval "ac_cv_func__vsnprintf=yes"
15624 else
15625   echo "configure: failed program was:" >&5
15626   cat conftest.$ac_ext >&5
15627   rm -rf conftest*
15628   eval "ac_cv_func__vsnprintf=no"
15629 fi
15630 rm -f conftest*
15631 fi
15632
15633 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
15634   echo "$ac_t""yes" 1>&6
15635   ac_cv_func_vsnprintf=yes
15636         cat >> confdefs.h <<\EOF
15637 #define vsnprintf _vsnprintf
15638 EOF
15639
15640
15641 else
15642   echo "$ac_t""no" 1>&6
15643 fi
15644
15645
15646 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
15647 echo "configure:15648: checking for vprintf" >&5
15648 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
15649   echo $ac_n "(cached) $ac_c" 1>&6
15650 else
15651   cat > conftest.$ac_ext <<EOF
15652 #line 15653 "configure"
15653 #include "confdefs.h"
15654 /* System header to define __stub macros and hopefully few prototypes,
15655     which can conflict with char vprintf(); below.  */
15656 #include <assert.h>
15657 /* Override any gcc2 internal prototype to avoid an error.  */
15658 /* We use char because int might match the return type of a gcc2
15659     builtin and then its argument prototype would still apply.  */
15660 char vprintf();
15661 char (*f)();
15662
15663 int main() {
15664
15665 /* The GNU C library defines this for functions which it implements
15666     to always fail with ENOSYS.  Some functions are actually named
15667     something starting with __ and the normal name is an alias.  */
15668 #if defined (__stub_vprintf) || defined (__stub___vprintf)
15669 choke me
15670 #else
15671 f = vprintf;
15672 #endif
15673
15674 ; return 0; }
15675 EOF
15676 if { (eval echo configure:15677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15677   rm -rf conftest*
15678   eval "ac_cv_func_vprintf=yes"
15679 else
15680   echo "configure: failed program was:" >&5
15681   cat conftest.$ac_ext >&5
15682   rm -rf conftest*
15683   eval "ac_cv_func_vprintf=no"
15684 fi
15685 rm -f conftest*
15686 fi
15687
15688 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
15689   echo "$ac_t""yes" 1>&6
15690   cat >> confdefs.h <<\EOF
15691 #define HAVE_VPRINTF 1
15692 EOF
15693
15694 else
15695   echo "$ac_t""no" 1>&6
15696 fi
15697
15698 if test "$ac_cv_func_vprintf" != yes; then
15699 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
15700 echo "configure:15701: checking for _doprnt" >&5
15701 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
15702   echo $ac_n "(cached) $ac_c" 1>&6
15703 else
15704   cat > conftest.$ac_ext <<EOF
15705 #line 15706 "configure"
15706 #include "confdefs.h"
15707 /* System header to define __stub macros and hopefully few prototypes,
15708     which can conflict with char _doprnt(); below.  */
15709 #include <assert.h>
15710 /* Override any gcc2 internal prototype to avoid an error.  */
15711 /* We use char because int might match the return type of a gcc2
15712     builtin and then its argument prototype would still apply.  */
15713 char _doprnt();
15714 char (*f)();
15715
15716 int main() {
15717
15718 /* The GNU C library defines this for functions which it implements
15719     to always fail with ENOSYS.  Some functions are actually named
15720     something starting with __ and the normal name is an alias.  */
15721 #if defined (__stub__doprnt) || defined (__stub____doprnt)
15722 choke me
15723 #else
15724 f = _doprnt;
15725 #endif
15726
15727 ; return 0; }
15728 EOF
15729 if { (eval echo configure:15730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15730   rm -rf conftest*
15731   eval "ac_cv_func__doprnt=yes"
15732 else
15733   echo "configure: failed program was:" >&5
15734   cat conftest.$ac_ext >&5
15735   rm -rf conftest*
15736   eval "ac_cv_func__doprnt=no"
15737 fi
15738 rm -f conftest*
15739 fi
15740
15741 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
15742   echo "$ac_t""yes" 1>&6
15743   cat >> confdefs.h <<\EOF
15744 #define HAVE_DOPRNT 1
15745 EOF
15746
15747 else
15748   echo "$ac_t""no" 1>&6
15749 fi
15750
15751 fi
15752
15753
15754 if test $ac_cv_func_vprintf = yes ; then
15755                 for ac_func in vsnprintf vsprintf
15756 do
15757 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15758 echo "configure:15759: checking for $ac_func" >&5
15759 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15760   echo $ac_n "(cached) $ac_c" 1>&6
15761 else
15762   cat > conftest.$ac_ext <<EOF
15763 #line 15764 "configure"
15764 #include "confdefs.h"
15765 /* System header to define __stub macros and hopefully few prototypes,
15766     which can conflict with char $ac_func(); below.  */
15767 #include <assert.h>
15768 /* Override any gcc2 internal prototype to avoid an error.  */
15769 /* We use char because int might match the return type of a gcc2
15770     builtin and then its argument prototype would still apply.  */
15771 char $ac_func();
15772 char (*f)();
15773
15774 int main() {
15775
15776 /* The GNU C library defines this for functions which it implements
15777     to always fail with ENOSYS.  Some functions are actually named
15778     something starting with __ and the normal name is an alias.  */
15779 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15780 choke me
15781 #else
15782 f = $ac_func;
15783 #endif
15784
15785 ; return 0; }
15786 EOF
15787 if { (eval echo configure:15788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15788   rm -rf conftest*
15789   eval "ac_cv_func_$ac_func=yes"
15790 else
15791   echo "configure: failed program was:" >&5
15792   cat conftest.$ac_ext >&5
15793   rm -rf conftest*
15794   eval "ac_cv_func_$ac_func=no"
15795 fi
15796 rm -f conftest*
15797 fi
15798
15799 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15800   echo "$ac_t""yes" 1>&6
15801     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15802   cat >> confdefs.h <<EOF
15803 #define $ac_tr_func 1
15804 EOF
15805  
15806 else
15807   echo "$ac_t""no" 1>&6
15808 fi
15809 done
15810
15811 fi
15812
15813 for ac_func in \
15814         bcopy                   \
15815         closesocket             \
15816         chroot                  \
15817         endgrent                \
15818         endpwent                \
15819         flock                   \
15820         getdtablesize   \
15821         getgrgid                \
15822         gethostname             \
15823         getpass                 \
15824         getpassphrase   \
15825         getpwuid                \
15826         getpwnam                \
15827         getspnam                \
15828         gettimeofday    \
15829         initgroups              \
15830         lockf                   \
15831         memcpy                  \
15832         memmove                 \
15833         mkstemp                 \
15834         pipe                    \
15835         read                    \
15836         recv                    \
15837         recvfrom                \
15838         setpwfile               \
15839         setgid                  \
15840         setegid                 \
15841         setsid                  \
15842         setuid                  \
15843         seteuid                 \
15844         sigaction               \
15845         signal                  \
15846         sigset                  \
15847         snprintf                \
15848         strdup                  \
15849         strerror                \
15850         strpbrk                 \
15851         strrchr                 \
15852         strsep                  \
15853         strstr                  \
15854         strtol                  \
15855         strtoul                 \
15856         strspn                  \
15857         sysconf                 \
15858         waitpid                 \
15859         wait4                   \
15860         write                   \
15861         send                    \
15862         sendto                  \
15863
15864 do
15865 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15866 echo "configure:15867: checking for $ac_func" >&5
15867 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15868   echo $ac_n "(cached) $ac_c" 1>&6
15869 else
15870   cat > conftest.$ac_ext <<EOF
15871 #line 15872 "configure"
15872 #include "confdefs.h"
15873 /* System header to define __stub macros and hopefully few prototypes,
15874     which can conflict with char $ac_func(); below.  */
15875 #include <assert.h>
15876 /* Override any gcc2 internal prototype to avoid an error.  */
15877 /* We use char because int might match the return type of a gcc2
15878     builtin and then its argument prototype would still apply.  */
15879 char $ac_func();
15880 char (*f)();
15881
15882 int main() {
15883
15884 /* The GNU C library defines this for functions which it implements
15885     to always fail with ENOSYS.  Some functions are actually named
15886     something starting with __ and the normal name is an alias.  */
15887 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15888 choke me
15889 #else
15890 f = $ac_func;
15891 #endif
15892
15893 ; return 0; }
15894 EOF
15895 if { (eval echo configure:15896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15896   rm -rf conftest*
15897   eval "ac_cv_func_$ac_func=yes"
15898 else
15899   echo "configure: failed program was:" >&5
15900   cat conftest.$ac_ext >&5
15901   rm -rf conftest*
15902   eval "ac_cv_func_$ac_func=no"
15903 fi
15904 rm -f conftest*
15905 fi
15906
15907 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15908   echo "$ac_t""yes" 1>&6
15909     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15910   cat >> confdefs.h <<EOF
15911 #define $ac_tr_func 1
15912 EOF
15913  
15914 else
15915   echo "$ac_t""no" 1>&6
15916 fi
15917 done
15918
15919
15920 for ac_func in getopt tempnam
15921 do
15922 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15923 echo "configure:15924: checking for $ac_func" >&5
15924 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15925   echo $ac_n "(cached) $ac_c" 1>&6
15926 else
15927   cat > conftest.$ac_ext <<EOF
15928 #line 15929 "configure"
15929 #include "confdefs.h"
15930 /* System header to define __stub macros and hopefully few prototypes,
15931     which can conflict with char $ac_func(); below.  */
15932 #include <assert.h>
15933 /* Override any gcc2 internal prototype to avoid an error.  */
15934 /* We use char because int might match the return type of a gcc2
15935     builtin and then its argument prototype would still apply.  */
15936 char $ac_func();
15937 char (*f)();
15938
15939 int main() {
15940
15941 /* The GNU C library defines this for functions which it implements
15942     to always fail with ENOSYS.  Some functions are actually named
15943     something starting with __ and the normal name is an alias.  */
15944 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15945 choke me
15946 #else
15947 f = $ac_func;
15948 #endif
15949
15950 ; return 0; }
15951 EOF
15952 if { (eval echo configure:15953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15953   rm -rf conftest*
15954   eval "ac_cv_func_$ac_func=yes"
15955 else
15956   echo "configure: failed program was:" >&5
15957   cat conftest.$ac_ext >&5
15958   rm -rf conftest*
15959   eval "ac_cv_func_$ac_func=no"
15960 fi
15961 rm -f conftest*
15962 fi
15963
15964 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15965   echo "$ac_t""yes" 1>&6
15966     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15967   cat >> confdefs.h <<EOF
15968 #define $ac_tr_func 1
15969 EOF
15970  
15971 else
15972   echo "$ac_t""no" 1>&6
15973 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
15974 fi
15975 done
15976
15977
15978
15979 if test "$ac_cv_func_getopt" != yes; then
15980     LIBSRCS="$LIBSRCS getopt.c"
15981 fi
15982
15983 if test "$ac_cv_func_tempnam" != yes; then
15984     LIBSRCS="$LIBSRCS tempnam.c"
15985 fi
15986
15987 # Check Configuration
15988 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
15989 echo "configure:15990: checking declaration of sys_errlist" >&5
15990 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
15991   echo $ac_n "(cached) $ac_c" 1>&6
15992 else
15993   
15994         cat > conftest.$ac_ext <<EOF
15995 #line 15996 "configure"
15996 #include "confdefs.h"
15997
15998 #include <stdio.h>
15999 #include <sys/types.h>
16000 #include <errno.h>
16001 #ifdef WINNT
16002 #include <stdlib.h>
16003 #endif 
16004 int main() {
16005 char *c = (char *) *sys_errlist
16006 ; return 0; }
16007 EOF
16008 if { (eval echo configure:16009: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16009   rm -rf conftest*
16010   ol_cv_dcl_sys_errlist=yes
16011         ol_cv_have_sys_errlist=yes
16012 else
16013   echo "configure: failed program was:" >&5
16014   cat conftest.$ac_ext >&5
16015   rm -rf conftest*
16016   ol_cv_dcl_sys_errlist=no
16017 fi
16018 rm -f conftest*
16019 fi
16020
16021 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
16022 #
16023 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
16024 if test $ol_cv_dcl_sys_errlist = no ; then
16025         cat >> confdefs.h <<\EOF
16026 #define DECL_SYS_ERRLIST 1
16027 EOF
16028
16029
16030         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
16031 echo "configure:16032: checking existence of sys_errlist" >&5
16032 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
16033   echo $ac_n "(cached) $ac_c" 1>&6
16034 else
16035   
16036                 cat > conftest.$ac_ext <<EOF
16037 #line 16038 "configure"
16038 #include "confdefs.h"
16039 #include <errno.h>
16040 int main() {
16041 char *c = (char *) *sys_errlist
16042 ; return 0; }
16043 EOF
16044 if { (eval echo configure:16045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16045   rm -rf conftest*
16046   ol_cv_have_sys_errlist=yes
16047 else
16048   echo "configure: failed program was:" >&5
16049   cat conftest.$ac_ext >&5
16050   rm -rf conftest*
16051   ol_cv_have_sys_errlist=no
16052 fi
16053 rm -f conftest*
16054 fi
16055
16056 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
16057 fi
16058 if test $ol_cv_have_sys_errlist = yes ; then
16059         cat >> confdefs.h <<\EOF
16060 #define HAVE_SYS_ERRLIST 1
16061 EOF
16062
16063 fi
16064
16065
16066
16067 if test "$ol_enable_debug" != no ; then
16068         cat >> confdefs.h <<\EOF
16069 #define LDAP_DEBUG 1
16070 EOF
16071
16072 fi
16073 if test "$ol_enable_syslog" = yes ; then
16074         cat >> confdefs.h <<\EOF
16075 #define LDAP_SYSLOG 1
16076 EOF
16077
16078 fi
16079 if test "$ol_enable_libui" = yes ; then
16080         cat >> confdefs.h <<\EOF
16081 #define LDAP_LIBUI 1
16082 EOF
16083
16084 fi
16085 if test "$ol_enable_cache" = no ; then
16086         cat >> confdefs.h <<\EOF
16087 #define LDAP_NOCACHE 1
16088 EOF
16089
16090 fi
16091 if test "$ol_link_kbind" != no ; then
16092         cat >> confdefs.h <<\EOF
16093 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
16094 EOF
16095
16096 fi
16097 if test "$ol_enable_dns" != no ; then
16098         cat >> confdefs.h <<\EOF
16099 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS LDAP_VENDOR_VERSION
16100 EOF
16101
16102 fi
16103 if test "$ol_enable_proctitle" != no ; then
16104         cat >> confdefs.h <<\EOF
16105 #define LDAP_PROCTITLE 1
16106 EOF
16107
16108 fi
16109 if test "$ol_enable_referrals" != no ; then
16110         cat >> confdefs.h <<\EOF
16111 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
16112 EOF
16113
16114 fi
16115 if test "$ol_enable_cldap" != no ; then
16116         cat >> confdefs.h <<\EOF
16117 #define LDAP_CONNECTIONLESS 1
16118 EOF
16119
16120 fi
16121 if test "$ol_enable_ldapi" != no; then
16122         cat >> confdefs.h <<\EOF
16123 #define USE_PF_LOCAL 1
16124 EOF
16125
16126 fi
16127
16128 if test "$ol_enable_cleartext" != no ; then
16129         cat >> confdefs.h <<\EOF
16130 #define SLAPD_CLEARTEXT 1
16131 EOF
16132
16133 fi
16134 if test "$ol_enable_crypt" != no ; then
16135         cat >> confdefs.h <<\EOF
16136 #define SLAPD_CRYPT 1
16137 EOF
16138
16139 fi
16140 if test "$ol_link_kpasswd" != no ; then
16141         cat >> confdefs.h <<\EOF
16142 #define SLAPD_KPASSWD 1
16143 EOF
16144
16145 fi
16146 if test "$ol_link_spasswd" != no ; then
16147         cat >> confdefs.h <<\EOF
16148 #define SLAPD_SPASSWD 1
16149 EOF
16150
16151 fi
16152 if test "$ol_enable_multimaster" != no ; then
16153         cat >> confdefs.h <<\EOF
16154 #define SLAPD_MULTIMASTER 1
16155 EOF
16156
16157 fi
16158 if test "$ol_enable_phonetic" != no ; then
16159         cat >> confdefs.h <<\EOF
16160 #define SLAPD_PHONETIC 1
16161 EOF
16162
16163 fi
16164 if test "$ol_enable_rlookups" != no ; then
16165         cat >> confdefs.h <<\EOF
16166 #define SLAPD_RLOOKUPS 1
16167 EOF
16168
16169 fi
16170 if test "$ol_enable_aci" != no ; then
16171         cat >> confdefs.h <<\EOF
16172 #define SLAPD_ACI_ENABLED 1
16173 EOF
16174
16175 fi
16176
16177 if test "$ol_link_modules" != no ; then
16178         cat >> confdefs.h <<\EOF
16179 #define SLAPD_MODULES 1
16180 EOF
16181
16182         BUILD_SLAPD=yes
16183         SLAPD_MODULES_LDFLAGS="-dlopen self"
16184 fi
16185
16186 if test "$ol_link_bdb2" != no ; then
16187         cat >> confdefs.h <<\EOF
16188 #define SLAPD_BDB2 1
16189 EOF
16190
16191         BUILD_SLAPD=yes
16192         BUILD_BDB2=yes
16193         if test "$ol_with_bdb2_module" != static ; then
16194                 cat >> confdefs.h <<\EOF
16195 #define SLAPD_BDB2_DYNAMIC 1
16196 EOF
16197
16198                 BUILD_BDB2=mod
16199                 BUILD_BDB2_DYNAMIC=shared
16200                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-bdb2/back_bdb2.la"
16201         fi
16202 fi
16203
16204 if test "$ol_enable_dnssrv" != no ; then
16205         cat >> confdefs.h <<\EOF
16206 #define SLAPD_DNSSRV 1
16207 EOF
16208
16209         BUILD_SLAPD=yes
16210         BUILD_DNSSRV=yes
16211         if test "$ol_with_dnssrv_module" != static ; then
16212                 cat >> confdefs.h <<\EOF
16213 #define SLAPD_DNSSRV_DYNAMIC 1
16214 EOF
16215
16216                 BUILD_DNSSRV=mod
16217                 BUILD_DNSSRV_DYNAMIC=shared
16218                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
16219         fi
16220 fi
16221
16222 if test "$ol_enable_ldap" != no ; then
16223         cat >> confdefs.h <<\EOF
16224 #define SLAPD_LDAP 1
16225 EOF
16226
16227         BUILD_SLAPD=yes
16228         BUILD_LDAP=yes
16229         if test "$ol_with_ldap_module" != static ; then
16230                 cat >> confdefs.h <<\EOF
16231 #define SLAPD_LDAP_DYNAMIC 1
16232 EOF
16233
16234                 BUILD_LDAP=mod
16235                 BUILD_LDAP_DYNAMIC=shared
16236                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
16237         fi
16238 fi
16239
16240 if test "$ol_link_ldbm" != no ; then
16241         cat >> confdefs.h <<\EOF
16242 #define SLAPD_LDBM 1
16243 EOF
16244
16245         BUILD_SLAPD=yes
16246         BUILD_LDBM=yes
16247         if test "$ol_with_ldbm_module" != static ; then
16248                 cat >> confdefs.h <<\EOF
16249 #define SLAPD_LDBM_DYNAMIC 1
16250 EOF
16251
16252                 BUILD_LDBM=mod
16253                 BUILD_LDBM_DYNAMIC=shared
16254                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
16255         fi
16256 fi
16257
16258 if test "$ol_enable_passwd" != no ; then
16259         cat >> confdefs.h <<\EOF
16260 #define SLAPD_PASSWD 1
16261 EOF
16262
16263         BUILD_SLAPD=yes
16264         BUILD_PASSWD=yes
16265         if test "$ol_with_passwd_module" != static ; then
16266                 cat >> confdefs.h <<\EOF
16267 #define SLAPD_PASSWD_DYNAMIC 1
16268 EOF
16269
16270                 BUILD_PASSWD=mod
16271                 BUILD_PASSWD_DYNAMIC=shared
16272                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
16273         fi
16274 fi
16275
16276 if test "$ol_link_perl" != no ; then
16277         cat >> confdefs.h <<\EOF
16278 #define SLAPD_PERL 1
16279 EOF
16280
16281         BUILD_SLAPD=yes
16282         BUILD_PERL=yes
16283         if test "$ol_with_perl_module" != static ; then
16284                 cat >> confdefs.h <<\EOF
16285 #define SLAPD_PERL_DYNAMIC 1
16286 EOF
16287
16288                 BUILD_PERL=mod
16289                 BUILD_PERL_DYNAMIC=shared
16290                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-perl/back_perl.la"
16291         fi
16292 fi
16293
16294 if test "$ol_enable_shell" != no ; then
16295         cat >> confdefs.h <<\EOF
16296 #define SLAPD_SHELL 1
16297 EOF
16298
16299         BUILD_SLAPD=yes
16300         BUILD_SHELL=yes
16301         if test "$ol_with_shell_module" != static ; then
16302                 cat >> confdefs.h <<\EOF
16303 #define SLAPD_SHELL_DYNAMIC 1
16304 EOF
16305
16306                 BUILD_SHELL=mod
16307                 BUILD_SHELL_DYNAMIC=shared
16308                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
16309         fi
16310 fi
16311
16312 if test "$ol_enable_tcl" != no ; then
16313         cat >> confdefs.h <<\EOF
16314 #define SLAPD_TCL 1
16315 EOF
16316
16317         BUILD_SLAPD=yes
16318         BUILD_TCL=yes
16319         if test "$ol_with_tcl_module" != static; then
16320                 cat >> confdefs.h <<\EOF
16321 #define SLAPD_TCL_DYNAMIC 1
16322 EOF
16323
16324                 BUILD_TCL=mod
16325                 BUILD_TCL_DYNAMIC=shared
16326                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-tcl/back_tcl.la"
16327         fi
16328 fi
16329
16330 if test "$ol_enable_sql" != no ; then
16331         cat >> confdefs.h <<\EOF
16332 #define SLAPD_SQL 1
16333 EOF
16334
16335         BUILD_SLAPD=yes
16336         BUILD_SQL=yes
16337         SLAPD_SQL_LIBS=-liodbc
16338         if test "$ol_with_sql_module" != static; then
16339                 cat >> confdefs.h <<\EOF
16340 #define SLAPD_SQL_DYNAMIC 1
16341 EOF
16342
16343                 BUILD_SQL=mod
16344                 BUILD_SQL_DYNAMIC=shared
16345                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
16346         fi
16347 fi
16348
16349 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
16350         $BUILD_SLAPD = yes ; then
16351         BUILD_SLURPD=yes
16352 fi
16353
16354 if test "$ol_link_isode" != no ; then
16355         BUILD_LDAPD=yes
16356 fi
16357
16358
16359 if test "$LINK_BINS_DYNAMIC" = yes; then
16360     LIB_LINKAGE=DYN
16361     LT_LIB_LINKAGE=shared
16362 else
16363     LIB_LINKAGE=STAT
16364     LT_LIB_LINKAGE=static
16365 fi
16366
16367 if test "$ac_cv_mingw32" = yes ; then
16368     PLAT=NT
16369     DYN_EXT=dll
16370 else
16371     PLAT=UNIX
16372     DYN_EXT=so
16373 fi
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384   
16385   
16386   
16387   
16388   
16389   
16390   
16391   
16392   
16393   
16394   
16395   
16396   
16397   
16398   
16399   
16400   
16401   
16402   
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439 trap '' 1 2 15
16440
16441 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
16442
16443 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16444 # Let make expand exec_prefix.
16445 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
16446
16447 # Any assignment to VPATH causes Sun make to only execute
16448 # the first set of double-colon rules, so remove it if not needed.
16449 # If there is a colon in the path, we need to keep it.
16450 if test "x$srcdir" = x.; then
16451   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
16452 fi
16453
16454 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
16455
16456 DEFS=-DHAVE_CONFIG_H
16457
16458 # Without the "./", some shells look in PATH for config.status.
16459 : ${CONFIG_STATUS=./config.status}
16460
16461 echo creating $CONFIG_STATUS
16462 rm -f $CONFIG_STATUS
16463 cat > $CONFIG_STATUS <<EOF
16464 #! /bin/sh
16465 # Generated automatically by configure.
16466 # Run this file to recreate the current configuration.
16467 # This directory was configured as follows,
16468 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
16469 #
16470 # $0 $ac_configure_args
16471 #
16472 # Compiler output produced by configure, useful for debugging
16473 # configure, is in ./config.log if it exists.
16474
16475 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
16476 for ac_option
16477 do
16478   case "\$ac_option" in
16479   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16480     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
16481     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
16482   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
16483     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
16484     exit 0 ;;
16485   -help | --help | --hel | --he | --h)
16486     echo "\$ac_cs_usage"; exit 0 ;;
16487   *) echo "\$ac_cs_usage"; exit 1 ;;
16488   esac
16489 done
16490
16491 ac_given_srcdir=$srcdir
16492 ac_given_INSTALL="$INSTALL"
16493
16494 trap 'rm -fr `echo "\
16495 Makefile:build/top.mk:Makefile.in:build/dir.mk \
16496 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
16497 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
16498 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
16499 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
16500 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
16501 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
16502 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
16503 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
16504 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
16505 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
16506 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
16507 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
16508 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
16509 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
16510 include/Makefile:build/top.mk:include/Makefile.in \
16511 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
16512 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
16513 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
16514 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
16515 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
16516 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
16517 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
16518 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
16519 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
16520 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
16521 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
16522 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
16523 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/mod.mk \
16524 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
16525 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
16526 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
16527 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
16528 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
16529 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
16530 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
16531 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
16532 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
16533 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
16534 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
16535 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
16536 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
16537 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
16538 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
16539 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
16540  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
16541 EOF
16542 cat >> $CONFIG_STATUS <<EOF
16543
16544 # Protect against being on the right side of a sed subst in config.status.
16545 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
16546  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
16547 $ac_vpsub
16548 $extrasub
16549 s%@SHELL@%$SHELL%g
16550 s%@CFLAGS@%$CFLAGS%g
16551 s%@CPPFLAGS@%$CPPFLAGS%g
16552 s%@CXXFLAGS@%$CXXFLAGS%g
16553 s%@FFLAGS@%$FFLAGS%g
16554 s%@DEFS@%$DEFS%g
16555 s%@LDFLAGS@%$LDFLAGS%g
16556 s%@LIBS@%$LIBS%g
16557 s%@exec_prefix@%$exec_prefix%g
16558 s%@prefix@%$prefix%g
16559 s%@program_transform_name@%$program_transform_name%g
16560 s%@bindir@%$bindir%g
16561 s%@sbindir@%$sbindir%g
16562 s%@libexecdir@%$libexecdir%g
16563 s%@datadir@%$datadir%g
16564 s%@sysconfdir@%$sysconfdir%g
16565 s%@sharedstatedir@%$sharedstatedir%g
16566 s%@localstatedir@%$localstatedir%g
16567 s%@libdir@%$libdir%g
16568 s%@includedir@%$includedir%g
16569 s%@oldincludedir@%$oldincludedir%g
16570 s%@infodir@%$infodir%g
16571 s%@mandir@%$mandir%g
16572 s%@host@%$host%g
16573 s%@host_alias@%$host_alias%g
16574 s%@host_cpu@%$host_cpu%g
16575 s%@host_vendor@%$host_vendor%g
16576 s%@host_os@%$host_os%g
16577 s%@target@%$target%g
16578 s%@target_alias@%$target_alias%g
16579 s%@target_cpu@%$target_cpu%g
16580 s%@target_vendor@%$target_vendor%g
16581 s%@target_os@%$target_os%g
16582 s%@build@%$build%g
16583 s%@build_alias@%$build_alias%g
16584 s%@build_cpu@%$build_cpu%g
16585 s%@build_vendor@%$build_vendor%g
16586 s%@build_os@%$build_os%g
16587 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
16588 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
16589 s%@INSTALL_DATA@%$INSTALL_DATA%g
16590 s%@PACKAGE@%$PACKAGE%g
16591 s%@VERSION@%$VERSION%g
16592 s%@ACLOCAL@%$ACLOCAL%g
16593 s%@AUTOCONF@%$AUTOCONF%g
16594 s%@AUTOMAKE@%$AUTOMAKE%g
16595 s%@AUTOHEADER@%$AUTOHEADER%g
16596 s%@MAKEINFO@%$MAKEINFO%g
16597 s%@install_sh@%$install_sh%g
16598 s%@AMTAR@%$AMTAR%g
16599 s%@AWK@%$AWK%g
16600 s%@AMTARFLAGS@%$AMTARFLAGS%g
16601 s%@SET_MAKE@%$SET_MAKE%g
16602 s%@top_builddir@%$top_builddir%g
16603 s%@ldap_subdir@%$ldap_subdir%g
16604 s%@CC@%$CC%g
16605 s%@RANLIB@%$RANLIB%g
16606 s%@LN_S@%$LN_S%g
16607 s%@DLLTOOL@%$DLLTOOL%g
16608 s%@AS@%$AS%g
16609 s%@OBJDUMP@%$OBJDUMP%g
16610 s%@LIBTOOL@%$LIBTOOL%g
16611 s%@LN_H@%$LN_H%g
16612 s%@SENDMAIL@%$SENDMAIL%g
16613 s%@EDITOR@%$EDITOR%g
16614 s%@FINGER@%$FINGER%g
16615 s%@PERLBIN@%$PERLBIN%g
16616 s%@CPP@%$CPP%g
16617 s%@EXEEXT@%$EXEEXT%g
16618 s%@OBJEXT@%$OBJEXT%g
16619 s%@OL_MKDEP@%$OL_MKDEP%g
16620 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
16621 s%@PEPSY@%$PEPSY%g
16622 s%@LIBOBJS@%$LIBOBJS%g
16623 s%@LIBSRCS@%$LIBSRCS%g
16624 s%@PLAT@%$PLAT%g
16625 s%@LIB_LINKAGE@%$LIB_LINKAGE%g
16626 s%@LT_LIB_LINKAGE@%$LT_LIB_LINKAGE%g
16627 s%@DYN_EXT@%$DYN_EXT%g
16628 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
16629 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
16630 s%@BUILD_BDB2@%$BUILD_BDB2%g
16631 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
16632 s%@BUILD_LDAP@%$BUILD_LDAP%g
16633 s%@BUILD_LDBM@%$BUILD_LDBM%g
16634 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
16635 s%@BUILD_PERL@%$BUILD_PERL%g
16636 s%@BUILD_QUIPU@%$BUILD_QUIPU%g
16637 s%@BUILD_SHELL@%$BUILD_SHELL%g
16638 s%@BUILD_SQL@%$BUILD_SQL%g
16639 s%@BUILD_TCL@%$BUILD_TCL%g
16640 s%@BUILD_BDB2_DYNAMIC@%$BUILD_BDB2_DYNAMIC%g
16641 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
16642 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
16643 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
16644 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
16645 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
16646 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
16647 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
16648 s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
16649 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
16650 s%@LDAP_LIBS@%$LDAP_LIBS%g
16651 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
16652 s%@LDIF_LIBS@%$LDIF_LIBS%g
16653 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
16654 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
16655 s%@LDBM_LIBS@%$LDBM_LIBS%g
16656 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
16657 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
16658 s%@WRAP_LIBS@%$WRAP_LIBS%g
16659 s%@MOD_TCL_LIB@%$MOD_TCL_LIB%g
16660 s%@LINK_BINS_DYNAMIC@%$LINK_BINS_DYNAMIC%g
16661 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
16662 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
16663 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
16664 s%@PERL_CPPFLAGS@%$PERL_CPPFLAGS%g
16665 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
16666 s%@MOD_PERL_LDFLAGS@%$MOD_PERL_LDFLAGS%g
16667 s%@KRB4_LIBS@%$KRB4_LIBS%g
16668 s%@KRB5_LIBS@%$KRB5_LIBS%g
16669 s%@READLINE_LIBS@%$READLINE_LIBS%g
16670 s%@SASL_LIBS@%$SASL_LIBS%g
16671 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
16672 s%@TLS_LIBS@%$TLS_LIBS%g
16673 s%@MODULES_LIBS@%$MODULES_LIBS%g
16674 s%@AUTH_LIBS@%$AUTH_LIBS%g
16675 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
16676 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
16677 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
16678
16679 CEOF
16680 EOF
16681
16682 cat >> $CONFIG_STATUS <<\EOF
16683
16684 # Split the substitutions into bite-sized pieces for seds with
16685 # small command number limits, like on Digital OSF/1 and HP-UX.
16686 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
16687 ac_file=1 # Number of current file.
16688 ac_beg=1 # First line for current file.
16689 ac_end=$ac_max_sed_cmds # Line after last line for current file.
16690 ac_more_lines=:
16691 ac_sed_cmds=""
16692 while $ac_more_lines; do
16693   if test $ac_beg -gt 1; then
16694     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
16695   else
16696     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
16697   fi
16698   if test ! -s conftest.s$ac_file; then
16699     ac_more_lines=false
16700     rm -f conftest.s$ac_file
16701   else
16702     if test -z "$ac_sed_cmds"; then
16703       ac_sed_cmds="sed -f conftest.s$ac_file"
16704     else
16705       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
16706     fi
16707     ac_file=`expr $ac_file + 1`
16708     ac_beg=$ac_end
16709     ac_end=`expr $ac_end + $ac_max_sed_cmds`
16710   fi
16711 done
16712 if test -z "$ac_sed_cmds"; then
16713   ac_sed_cmds=cat
16714 fi
16715 EOF
16716
16717 cat >> $CONFIG_STATUS <<EOF
16718
16719 CONFIG_FILES=\${CONFIG_FILES-"\
16720 Makefile:build/top.mk:Makefile.in:build/dir.mk \
16721 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
16722 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
16723 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
16724 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
16725 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
16726 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
16727 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
16728 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
16729 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
16730 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
16731 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
16732 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
16733 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
16734 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
16735 include/Makefile:build/top.mk:include/Makefile.in \
16736 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
16737 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
16738 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
16739 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
16740 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
16741 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
16742 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
16743 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
16744 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
16745 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
16746 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
16747 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
16748 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/mod.mk \
16749 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
16750 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
16751 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
16752 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
16753 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
16754 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
16755 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
16756 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
16757 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
16758 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
16759 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
16760 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
16761 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
16762 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
16763 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
16764 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
16765 "}
16766 EOF
16767 cat >> $CONFIG_STATUS <<\EOF
16768 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
16769   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16770   case "$ac_file" in
16771   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
16772        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
16773   *) ac_file_in="${ac_file}.in" ;;
16774   esac
16775
16776   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
16777
16778   # Remove last slash and all that follows it.  Not all systems have dirname.
16779   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
16780   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16781     # The file is in a subdirectory.
16782     test ! -d "$ac_dir" && mkdir "$ac_dir"
16783     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
16784     # A "../" for each directory in $ac_dir_suffix.
16785     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
16786   else
16787     ac_dir_suffix= ac_dots=
16788   fi
16789
16790   case "$ac_given_srcdir" in
16791   .)  srcdir=.
16792       if test -z "$ac_dots"; then top_srcdir=.
16793       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
16794   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
16795   *) # Relative path.
16796     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
16797     top_srcdir="$ac_dots$ac_given_srcdir" ;;
16798   esac
16799
16800   case "$ac_given_INSTALL" in
16801   [/$]*) INSTALL="$ac_given_INSTALL" ;;
16802   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
16803   esac
16804
16805   echo creating "$ac_file"
16806   rm -f "$ac_file"
16807   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
16808   case "$ac_file" in
16809   *[Mm]akefile*) ac_comsub="1i\\
16810 # $configure_input" ;;
16811   *) ac_comsub= ;;
16812   esac
16813
16814   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
16815   sed -e "$ac_comsub
16816 s%@configure_input@%$configure_input%g
16817 s%@srcdir@%$srcdir%g
16818 s%@top_srcdir@%$top_srcdir%g
16819 s%@INSTALL@%$INSTALL%g
16820 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
16821 fi; done
16822 rm -f conftest.s*
16823
16824 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
16825 # NAME is the cpp macro being defined and VALUE is the value it is being given.
16826 #
16827 # ac_d sets the value in "#define NAME VALUE" lines.
16828 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
16829 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
16830 ac_dC='\3'
16831 ac_dD='%g'
16832 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
16833 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16834 ac_uB='\([      ]\)%\1#\2define\3'
16835 ac_uC=' '
16836 ac_uD='\4%g'
16837 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
16838 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16839 ac_eB='$%\1#\2define\3'
16840 ac_eC=' '
16841 ac_eD='%g'
16842
16843 if test "${CONFIG_HEADERS+set}" != set; then
16844 EOF
16845 cat >> $CONFIG_STATUS <<EOF
16846   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
16847 EOF
16848 cat >> $CONFIG_STATUS <<\EOF
16849 fi
16850 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
16851   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16852   case "$ac_file" in
16853   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
16854        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
16855   *) ac_file_in="${ac_file}.in" ;;
16856   esac
16857
16858   echo creating $ac_file
16859
16860   rm -f conftest.frag conftest.in conftest.out
16861   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
16862   cat $ac_file_inputs > conftest.in
16863
16864 EOF
16865
16866 # Transform confdefs.h into a sed script conftest.vals that substitutes
16867 # the proper values into config.h.in to produce config.h.  And first:
16868 # Protect against being on the right side of a sed subst in config.status.
16869 # Protect against being in an unquoted here document in config.status.
16870 rm -f conftest.vals
16871 cat > conftest.hdr <<\EOF
16872 s/[\\&%]/\\&/g
16873 s%[\\$`]%\\&%g
16874 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
16875 s%ac_d%ac_u%gp
16876 s%ac_u%ac_e%gp
16877 EOF
16878 sed -n -f conftest.hdr confdefs.h > conftest.vals
16879 rm -f conftest.hdr
16880
16881 # This sed command replaces #undef with comments.  This is necessary, for
16882 # example, in the case of _POSIX_SOURCE, which is predefined and required
16883 # on some systems where configure will not decide to define it.
16884 cat >> conftest.vals <<\EOF
16885 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
16886 EOF
16887
16888 # Break up conftest.vals because some shells have a limit on
16889 # the size of here documents, and old seds have small limits too.
16890
16891 rm -f conftest.tail
16892 while :
16893 do
16894   ac_lines=`grep -c . conftest.vals`
16895   # grep -c gives empty output for an empty file on some AIX systems.
16896   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
16897   # Write a limited-size here document to conftest.frag.
16898   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
16899   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
16900   echo 'CEOF
16901   sed -f conftest.frag conftest.in > conftest.out
16902   rm -f conftest.in
16903   mv conftest.out conftest.in
16904 ' >> $CONFIG_STATUS
16905   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
16906   rm -f conftest.vals
16907   mv conftest.tail conftest.vals
16908 done
16909 rm -f conftest.vals
16910
16911 cat >> $CONFIG_STATUS <<\EOF
16912   rm -f conftest.frag conftest.h
16913   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
16914   cat conftest.in >> conftest.h
16915   rm -f conftest.in
16916   if cmp -s $ac_file conftest.h 2>/dev/null; then
16917     echo "$ac_file is unchanged"
16918     rm -f conftest.h
16919   else
16920     # Remove last slash and all that follows it.  Not all systems have dirname.
16921       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
16922       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16923       # The file is in a subdirectory.
16924       test ! -d "$ac_dir" && mkdir "$ac_dir"
16925     fi
16926     rm -f $ac_file
16927     mv conftest.h $ac_file
16928   fi
16929 fi; done
16930
16931 EOF
16932 cat >> $CONFIG_STATUS <<EOF
16933
16934 EOF
16935 cat >> $CONFIG_STATUS <<\EOF
16936
16937 date > stamp-h
16938 echo Please \"make depend\" to build dependencies
16939
16940 exit 0
16941 EOF
16942 chmod +x $CONFIG_STATUS
16943 rm -fr confdefs* $ac_clean_files
16944 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
16945