]> git.sur5r.net Git - openldap/blob - configure
29fc9b02ee929b1e91592d659166ba6bbfe6f0f3
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.356 2001/05/28 20:00:27 kurt Exp  
4
5 # Copyright 1998-2001 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-2001 The OpenLDAP Foundation,  All Rights Reserved."
13 echo "Restrictions apply, see COPYRIGHT and LICENSE files."
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 (experimental) [no]"
37 ac_help="$ac_help
38   --enable-referrals      enable V2 Referrals (experimental) [no]"
39 ac_help="$ac_help
40   --enable-kbind          enable V2 Kerberos IV bind (deprecated) [no]"
41 ac_help="$ac_help
42   --enable-ipv6           enable IPv6 support [auto]"
43 ac_help="$ac_help
44   --enable-local          enable AF_LOCAL (AF_UNIX) socket support [auto]"
45 ac_help="$ac_help
46     --enable-rewrite      enable rewrite [no]"
47 ac_help="$ac_help
48   --enable-x-compile      enable cross compiling [no]"
49 ac_help="$ac_help
50   --with-cyrus-sasl       with Cyrus SASL support [auto]"
51 ac_help="$ac_help
52   --with-fetch            with fetch URL support [auto]"
53 ac_help="$ac_help
54   --with-kerberos         with support [auto]"
55 ac_help="$ac_help
56   --with-readline         with readline support [auto]"
57 ac_help="$ac_help
58   --with-threads          with threads [auto]"
59 ac_help="$ac_help
60   --with-tls              with TLS/SSL support [auto]"
61 ac_help="$ac_help
62   --with-yielding-select  with implicitly yielding select [auto]"
63 ac_help="$ac_help
64 SLAPD (Standalone LDAP Daemon) Options:"
65 ac_help="$ac_help
66   --enable-slapd          enable building slapd [yes]"
67 ac_help="$ac_help
68     --enable-aci          enable per-object ACIs (experimental) [no]"
69 ac_help="$ac_help
70     --enable-cleartext    enable cleartext passwords [yes]"
71 ac_help="$ac_help
72     --enable-crypt        enable crypt(3) passwords [no]"
73 ac_help="$ac_help
74     --enable-dynamic      enable linking built binaries with dynamic libs [no]"
75 ac_help="$ac_help
76     --enable-kpasswd      enable Kerberos password verification [no]"
77 ac_help="$ac_help
78     --enable-lmpasswd     enable LAN Manager passwords [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-phonetic     enable phonetic/soundex [no]"
85 ac_help="$ac_help
86     --enable-rlookups     enable reverse lookups [no]"
87 ac_help="$ac_help
88     --enable-slp          enable SLPv2 support [no]"
89 ac_help="$ac_help
90     --enable-wrappers     enable tcp wrapper support [no]"
91 ac_help="$ac_help
92     --enable-bdb          enable Berkeley DB backend [no]"
93 ac_help="$ac_help
94     --with-bdb-module     module type [static]"
95 ac_help="$ac_help
96     --enable-dnssrv       enable dnssrv backend [no]"
97 ac_help="$ac_help
98     --with-dnssrv-module  module type [static]"
99 ac_help="$ac_help
100     --enable-ldap         enable ldap backend [no]"
101 ac_help="$ac_help
102     --with-ldap-module    module type [static]"
103 ac_help="$ac_help
104     --enable-ldbm         enable ldbm backend [yes]"
105 ac_help="$ac_help
106     --with-ldbm-api       with LDBM API [auto]"
107 ac_help="$ac_help
108     --with-ldbm-module    module type [static]"
109 ac_help="$ac_help
110     --with-ldbm-type      use LDBM type [auto]"
111 ac_help="$ac_help
112     --enable-meta         enable metadirectory backend [no]"
113 ac_help="$ac_help
114     --with-meta-module    module type [static]"
115 ac_help="$ac_help
116     --enable-passwd       enable passwd backend [no]"
117 ac_help="$ac_help
118     --with-passwd-module  module type [static]"
119 ac_help="$ac_help
120     --enable-perl         enable perl backend [no]"
121 ac_help="$ac_help
122     --with-perl-module    module type [static]"
123 ac_help="$ac_help
124     --enable-shell        enable shell backend [no]"
125 ac_help="$ac_help
126     --with-shell-module   module type [static]"
127 ac_help="$ac_help
128     --enable-sql          enable sql backend [no]"
129 ac_help="$ac_help
130     --with-sql-module     module type [static]"
131 ac_help="$ac_help
132     --enable-tcl          enable tcl backend [no]"
133 ac_help="$ac_help
134     --with-tcl-module     module type [static]"
135 ac_help="$ac_help
136 SLURPD (Replication Daemon) Options:"
137 ac_help="$ac_help
138   --enable-slurpd         enable building slurpd [auto]"
139 ac_help="$ac_help
140 Library Generation & Linking Options"
141 ac_help="$ac_help
142   --enable-static[=PKGS]  build static libraries [default=yes]"
143 ac_help="$ac_help
144   --enable-shared[=PKGS]  build shared libraries [default=yes]"
145 ac_help="$ac_help
146   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
147 ac_help="$ac_help
148   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
149 ac_help="$ac_help
150   --disable-libtool-lock  avoid locking (might break parallel builds)"
151
152 # Initialize some variables set by options.
153 # The variables have the same names as the options, with
154 # dashes changed to underlines.
155 build=NONE
156 cache_file=./config.cache
157 exec_prefix=NONE
158 host=NONE
159 no_create=
160 nonopt=NONE
161 no_recursion=
162 prefix=NONE
163 program_prefix=NONE
164 program_suffix=NONE
165 program_transform_name=s,x,x,
166 silent=
167 site=
168 srcdir=
169 target=NONE
170 verbose=
171 x_includes=NONE
172 x_libraries=NONE
173 bindir='${exec_prefix}/bin'
174 sbindir='${exec_prefix}/sbin'
175 libexecdir='${exec_prefix}/libexec'
176 datadir='${prefix}/share'
177 sysconfdir='${prefix}/etc'
178 sharedstatedir='${prefix}/com'
179 localstatedir='${prefix}/var'
180 libdir='${exec_prefix}/lib'
181 includedir='${prefix}/include'
182 oldincludedir='/usr/include'
183 infodir='${prefix}/info'
184 mandir='${prefix}/man'
185
186 # Initialize some other variables.
187 subdirs=
188 MFLAGS= MAKEFLAGS=
189 SHELL=${CONFIG_SHELL-/bin/sh}
190 # Maximum number of lines to put in a shell here document.
191 ac_max_here_lines=12
192
193 ac_prev=
194 for ac_option
195 do
196
197   # If the previous option needs an argument, assign it.
198   if test -n "$ac_prev"; then
199     eval "$ac_prev=\$ac_option"
200     ac_prev=
201     continue
202   fi
203
204   case "$ac_option" in
205   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
206   *) ac_optarg= ;;
207   esac
208
209   # Accept the important Cygnus configure options, so we can diagnose typos.
210
211   case "$ac_option" in
212
213   -bindir | --bindir | --bindi | --bind | --bin | --bi)
214     ac_prev=bindir ;;
215   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
216     bindir="$ac_optarg" ;;
217
218   -build | --build | --buil | --bui | --bu)
219     ac_prev=build ;;
220   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
221     build="$ac_optarg" ;;
222
223   -cache-file | --cache-file | --cache-fil | --cache-fi \
224   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
225     ac_prev=cache_file ;;
226   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
227   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
228     cache_file="$ac_optarg" ;;
229
230   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
231     ac_prev=datadir ;;
232   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
233   | --da=*)
234     datadir="$ac_optarg" ;;
235
236   -disable-* | --disable-*)
237     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
238     # Reject names that are not valid shell variable names.
239     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
240       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
241     fi
242     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
243     eval "enable_${ac_feature}=no" ;;
244
245   -enable-* | --enable-*)
246     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
247     # Reject names that are not valid shell variable names.
248     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
249       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
250     fi
251     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
252     case "$ac_option" in
253       *=*) ;;
254       *) ac_optarg=yes ;;
255     esac
256     eval "enable_${ac_feature}='$ac_optarg'" ;;
257
258   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
259   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
260   | --exec | --exe | --ex)
261     ac_prev=exec_prefix ;;
262   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
263   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
264   | --exec=* | --exe=* | --ex=*)
265     exec_prefix="$ac_optarg" ;;
266
267   -gas | --gas | --ga | --g)
268     # Obsolete; use --with-gas.
269     with_gas=yes ;;
270
271   -help | --help | --hel | --he)
272     # Omit some internal or obsolete options to make the list less imposing.
273     # This message is too long to be a string in the A/UX 3.1 sh.
274     cat << EOF
275 Usage: configure [options] [host]
276 Options: [defaults in brackets after descriptions]
277 Configuration:
278   --cache-file=FILE       cache test results in FILE
279   --help                  print this message
280   --no-create             do not create output files
281   --quiet, --silent       do not print \`checking...' messages
282   --version               print the version of autoconf that created configure
283 Directory and file names:
284   --prefix=PREFIX         install architecture-independent files in PREFIX
285                           [$ac_default_prefix]
286   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
287                           [same as prefix]
288   --bindir=DIR            user executables in DIR [EPREFIX/bin]
289   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
290   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
291   --datadir=DIR           read-only architecture-independent data in DIR
292                           [PREFIX/share]
293   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
294   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
295                           [PREFIX/com]
296   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
297   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
298   --includedir=DIR        C header files in DIR [PREFIX/include]
299   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
300   --infodir=DIR           info documentation in DIR [PREFIX/info]
301   --mandir=DIR            man documentation in DIR [PREFIX/man]
302   --srcdir=DIR            find the sources in DIR [configure dir or ..]
303   --program-prefix=PREFIX prepend PREFIX to installed program names
304   --program-suffix=SUFFIX append SUFFIX to installed program names
305   --program-transform-name=PROGRAM
306                           run sed PROGRAM on installed program names
307 EOF
308     cat << EOF
309 Host type:
310   --build=BUILD           configure for building on BUILD [BUILD=HOST]
311   --host=HOST             configure for HOST [guessed]
312   --target=TARGET         configure for TARGET [TARGET=HOST]
313 Features and packages:
314   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
315   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
316   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
317   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
318   --x-includes=DIR        X include files are in DIR
319   --x-libraries=DIR       X library files are in DIR
320 EOF
321     if test -n "$ac_help"; then
322       echo "--enable and --with options recognized:$ac_help"
323     fi
324     exit 0 ;;
325
326   -host | --host | --hos | --ho)
327     ac_prev=host ;;
328   -host=* | --host=* | --hos=* | --ho=*)
329     host="$ac_optarg" ;;
330
331   -includedir | --includedir | --includedi | --included | --include \
332   | --includ | --inclu | --incl | --inc)
333     ac_prev=includedir ;;
334   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
335   | --includ=* | --inclu=* | --incl=* | --inc=*)
336     includedir="$ac_optarg" ;;
337
338   -infodir | --infodir | --infodi | --infod | --info | --inf)
339     ac_prev=infodir ;;
340   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
341     infodir="$ac_optarg" ;;
342
343   -libdir | --libdir | --libdi | --libd)
344     ac_prev=libdir ;;
345   -libdir=* | --libdir=* | --libdi=* | --libd=*)
346     libdir="$ac_optarg" ;;
347
348   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
349   | --libexe | --libex | --libe)
350     ac_prev=libexecdir ;;
351   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
352   | --libexe=* | --libex=* | --libe=*)
353     libexecdir="$ac_optarg" ;;
354
355   -localstatedir | --localstatedir | --localstatedi | --localstated \
356   | --localstate | --localstat | --localsta | --localst \
357   | --locals | --local | --loca | --loc | --lo)
358     ac_prev=localstatedir ;;
359   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
360   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
361   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
362     localstatedir="$ac_optarg" ;;
363
364   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
365     ac_prev=mandir ;;
366   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
367     mandir="$ac_optarg" ;;
368
369   -nfp | --nfp | --nf)
370     # Obsolete; use --without-fp.
371     with_fp=no ;;
372
373   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
374   | --no-cr | --no-c)
375     no_create=yes ;;
376
377   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
378   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
379     no_recursion=yes ;;
380
381   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
382   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
383   | --oldin | --oldi | --old | --ol | --o)
384     ac_prev=oldincludedir ;;
385   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
386   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
387   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
388     oldincludedir="$ac_optarg" ;;
389
390   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
391     ac_prev=prefix ;;
392   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
393     prefix="$ac_optarg" ;;
394
395   -program-prefix | --program-prefix | --program-prefi | --program-pref \
396   | --program-pre | --program-pr | --program-p)
397     ac_prev=program_prefix ;;
398   -program-prefix=* | --program-prefix=* | --program-prefi=* \
399   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
400     program_prefix="$ac_optarg" ;;
401
402   -program-suffix | --program-suffix | --program-suffi | --program-suff \
403   | --program-suf | --program-su | --program-s)
404     ac_prev=program_suffix ;;
405   -program-suffix=* | --program-suffix=* | --program-suffi=* \
406   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
407     program_suffix="$ac_optarg" ;;
408
409   -program-transform-name | --program-transform-name \
410   | --program-transform-nam | --program-transform-na \
411   | --program-transform-n | --program-transform- \
412   | --program-transform | --program-transfor \
413   | --program-transfo | --program-transf \
414   | --program-trans | --program-tran \
415   | --progr-tra | --program-tr | --program-t)
416     ac_prev=program_transform_name ;;
417   -program-transform-name=* | --program-transform-name=* \
418   | --program-transform-nam=* | --program-transform-na=* \
419   | --program-transform-n=* | --program-transform-=* \
420   | --program-transform=* | --program-transfor=* \
421   | --program-transfo=* | --program-transf=* \
422   | --program-trans=* | --program-tran=* \
423   | --progr-tra=* | --program-tr=* | --program-t=*)
424     program_transform_name="$ac_optarg" ;;
425
426   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
427   | -silent | --silent | --silen | --sile | --sil)
428     silent=yes ;;
429
430   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
431     ac_prev=sbindir ;;
432   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
433   | --sbi=* | --sb=*)
434     sbindir="$ac_optarg" ;;
435
436   -sharedstatedir | --sharedstatedir | --sharedstatedi \
437   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
438   | --sharedst | --shareds | --shared | --share | --shar \
439   | --sha | --sh)
440     ac_prev=sharedstatedir ;;
441   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
442   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
443   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
444   | --sha=* | --sh=*)
445     sharedstatedir="$ac_optarg" ;;
446
447   -site | --site | --sit)
448     ac_prev=site ;;
449   -site=* | --site=* | --sit=*)
450     site="$ac_optarg" ;;
451
452   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
453     ac_prev=srcdir ;;
454   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
455     srcdir="$ac_optarg" ;;
456
457   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
458   | --syscon | --sysco | --sysc | --sys | --sy)
459     ac_prev=sysconfdir ;;
460   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
461   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
462     sysconfdir="$ac_optarg" ;;
463
464   -target | --target | --targe | --targ | --tar | --ta | --t)
465     ac_prev=target ;;
466   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
467     target="$ac_optarg" ;;
468
469   -v | -verbose | --verbose | --verbos | --verbo | --verb)
470     verbose=yes ;;
471
472   -version | --version | --versio | --versi | --vers)
473     echo "configure generated by autoconf version 2.13.1"
474     exit 0 ;;
475
476   -with-* | --with-*)
477     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
478     # Reject names that are not valid shell variable names.
479     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
480       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
481     fi
482     ac_package=`echo $ac_package| sed 's/-/_/g'`
483     case "$ac_option" in
484       *=*) ;;
485       *) ac_optarg=yes ;;
486     esac
487     eval "with_${ac_package}='$ac_optarg'" ;;
488
489   -without-* | --without-*)
490     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
491     # Reject names that are not valid shell variable names.
492     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
493       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
494     fi
495     ac_package=`echo $ac_package| sed 's/-/_/g'`
496     eval "with_${ac_package}=no" ;;
497
498   --x)
499     # Obsolete; use --with-x.
500     with_x=yes ;;
501
502   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
503   | --x-incl | --x-inc | --x-in | --x-i)
504     ac_prev=x_includes ;;
505   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
506   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
507     x_includes="$ac_optarg" ;;
508
509   -x-libraries | --x-libraries | --x-librarie | --x-librari \
510   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
511     ac_prev=x_libraries ;;
512   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
513   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
514     x_libraries="$ac_optarg" ;;
515
516   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
517     ;;
518
519   *)
520     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
521       echo "configure: warning: $ac_option: invalid host type" 1>&2
522     fi
523     if test "x$nonopt" != xNONE; then
524       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
525     fi
526     nonopt="$ac_option"
527     ;;
528
529   esac
530 done
531
532 if test -n "$ac_prev"; then
533   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
534 fi
535
536 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
537
538 # File descriptor usage:
539 # 0 standard input
540 # 1 file creation
541 # 2 errors and warnings
542 # 3 some systems may open it to /dev/tty
543 # 4 used on the Kubota Titan
544 # 6 checking for... messages and results
545 # 5 compiler messages saved in config.log
546 if test "$silent" = yes; then
547   exec 6>/dev/null
548 else
549   exec 6>&1
550 fi
551 exec 5>./config.log
552
553 echo "\
554 This file contains any messages produced by compilers while
555 running configure, to aid debugging if configure makes a mistake.
556 " 1>&5
557
558 # Strip out --no-create and --no-recursion so they do not pile up.
559 # Also quote any args containing shell metacharacters.
560 ac_configure_args=
561 for ac_arg
562 do
563   case "$ac_arg" in
564   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
565   | --no-cr | --no-c) ;;
566   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
567   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
568   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
569   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
570   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
571   esac
572 done
573
574 # NLS nuisances.
575 # Only set these to C if already set.  These must not be set unconditionally
576 # because not all systems understand e.g. LANG=C (notably SCO).
577 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
578 # Non-C LC_CTYPE values break the ctype check.
579 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
580 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
581 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
582 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
583
584 # confdefs.h avoids OS command line length limits that DEFS can exceed.
585 rm -rf conftest* confdefs.h
586 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
587 echo > confdefs.h
588
589 # A filename unique to this package, relative to the directory that
590 # configure is in, which we can look for to find out if srcdir is correct.
591 ac_unique_file=build/version.sh
592
593 # Find the source files, if location was not specified.
594 if test -z "$srcdir"; then
595   ac_srcdir_defaulted=yes
596   # Try the directory containing this script, then its parent.
597   ac_prog=$0
598   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
599   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
600   srcdir=$ac_confdir
601   if test ! -r $srcdir/$ac_unique_file; then
602     srcdir=..
603   fi
604 else
605   ac_srcdir_defaulted=no
606 fi
607 if test ! -r $srcdir/$ac_unique_file; then
608   if test "$ac_srcdir_defaulted" = yes; then
609     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
610   else
611     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
612   fi
613 fi
614 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
615
616 # Prefer explicitly selected file to automatically selected ones.
617 if test -z "$CONFIG_SITE"; then
618   if test "x$prefix" != xNONE; then
619     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
620   else
621     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
622   fi
623 fi
624 for ac_site_file in $CONFIG_SITE; do
625   if test -r "$ac_site_file"; then
626     echo "loading site script $ac_site_file"
627     . "$ac_site_file"
628   fi
629 done
630
631
632 ac_ext=c
633 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
634 ac_cpp='$CPP $CPPFLAGS'
635 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
636 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
637 cross_compiling=$ac_cv_prog_cc_cross
638
639 ac_exeext=
640 ac_objext=o
641 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
642   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
643   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
644     ac_n= ac_c='
645 ' ac_t='        '
646   else
647     ac_n=-n ac_c= ac_t=
648   fi
649 else
650   ac_n= ac_c='\c' ac_t=
651 fi
652
653
654 # set unset (borrowed from autoconf 2.49c)
655 if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
656   ol_unset=unset
657 else
658   ol_unset=false
659 fi
660 # unset CDPATH
661 $ol_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
662
663 ac_aux_dir=
664 for ac_dir in build $srcdir/build; do
665   if test -f $ac_dir/install-sh; then
666     ac_aux_dir=$ac_dir
667     ac_install_sh="$ac_aux_dir/install-sh -c"
668     break
669   elif test -f $ac_dir/install.sh; then
670     ac_aux_dir=$ac_dir
671     ac_install_sh="$ac_aux_dir/install.sh -c"
672     break
673   elif test -f $ac_dir/shtool; then
674     ac_aux_dir=$ac_dir
675     ac_install_sh="$ac_aux_dir/shtool install -c"
676     break
677   fi
678 done
679 if test -z "$ac_aux_dir"; then
680   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
681 fi
682 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
683 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
684 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
685
686 eval `$ac_aux_dir/version.sh`
687 if test -z "$OL_STRING"; then
688         { echo "configure: error: could not determine version" 1>&2; exit 1; }
689 fi
690
691 echo "Configuring $OL_STRING ..."
692
693
694 echo $ac_n "checking host system type""... $ac_c" 1>&6
695 echo "configure:696: checking host system type" >&5
696 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
697
698 # Make sure we can run config.sub.
699   if $ac_config_sub sun4 >/dev/null 2>&1; then :
700     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
701   fi
702
703   ac_cv_host_alias=$host
704   case "$ac_cv_host_alias" in
705   NONE)
706     case $nonopt in
707     NONE)
708       if ac_cv_host_alias=`$ac_config_guess`; then :
709       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
710       fi ;;
711     *) ac_cv_host_alias=$nonopt ;;
712     esac ;;
713   esac
714
715   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
716   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
717   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
718   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
719 else
720   echo $ac_n "(cached) $ac_c" 1>&6
721 fi
722
723 echo "$ac_t""$ac_cv_host" 1>&6
724
725 host=$ac_cv_host
726 host_alias=$ac_cv_host_alias
727 host_cpu=$ac_cv_host_cpu
728 host_vendor=$ac_cv_host_vendor
729 host_os=$ac_cv_host_os
730
731
732
733
734
735 echo $ac_n "checking target system type""... $ac_c" 1>&6
736 echo "configure:737: checking target system type" >&5
737 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
738
739 # Make sure we can run config.sub.
740   if $ac_config_sub sun4 >/dev/null 2>&1; then :
741     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
742   fi
743
744   ac_cv_target_alias=$target
745   case "$ac_cv_target_alias" in
746   NONE)
747     case $nonopt in
748     NONE)
749       ac_cv_target_alias=$host_alias ;;
750
751     *) ac_cv_target_alias=$nonopt ;;
752     esac ;;
753   esac
754
755   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
756   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
757   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
758   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
759 else
760   echo $ac_n "(cached) $ac_c" 1>&6
761 fi
762
763 echo "$ac_t""$ac_cv_target" 1>&6
764
765 target=$ac_cv_target
766 target_alias=$ac_cv_target_alias
767 target_cpu=$ac_cv_target_cpu
768 target_vendor=$ac_cv_target_vendor
769 target_os=$ac_cv_target_os
770
771
772
773
774
775 echo $ac_n "checking build system type""... $ac_c" 1>&6
776 echo "configure:777: checking build system type" >&5
777 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
778
779 # Make sure we can run config.sub.
780   if $ac_config_sub sun4 >/dev/null 2>&1; then :
781     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
782   fi
783
784   ac_cv_build_alias=$build
785   case "$ac_cv_build_alias" in
786   NONE)
787     case $nonopt in
788     NONE)
789       ac_cv_build_alias=$host_alias ;;
790
791     *) ac_cv_build_alias=$nonopt ;;
792     esac ;;
793   esac
794
795   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
796   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
797   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
798   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
799 else
800   echo $ac_n "(cached) $ac_c" 1>&6
801 fi
802
803 echo "$ac_t""$ac_cv_build" 1>&6
804
805 build=$ac_cv_build
806 build_alias=$ac_cv_build_alias
807 build_cpu=$ac_cv_build_cpu
808 build_vendor=$ac_cv_build_vendor
809 build_os=$ac_cv_build_os
810
811
812
813
814
815 # Do some error checking and defaulting for the host and target type.
816 # The inputs are:
817 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
818 #
819 # The rules are:
820 # 1. You are not allowed to specify --host, --target, and nonopt at the
821 #    same time.
822 # 2. Host defaults to nonopt.
823 # 3. If nonopt is not specified, then host defaults to the current host,
824 #    as determined by config.guess.
825 # 4. Target and build default to nonopt.
826 # 5. If nonopt is not specified, then target and build default to host.
827
828 # The aliases save the names the user supplied, while $host etc.
829 # will get canonicalized.
830 case $host---$target---$nonopt in
831 NONE---*---* | *---NONE---* | *---*---NONE) ;;
832 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
833 esac
834
835 test "$host_alias" != "$target_alias" &&
836   test "$program_prefix$program_suffix$program_transform_name" = \
837     NONENONEs,x,x, &&
838   program_prefix=${target_alias}-
839
840
841 # Find a good install program.  We prefer a C program (faster),
842 # so one script is as good as another.  But avoid the broken or
843 # incompatible versions:
844 # SysV /etc/install, /usr/sbin/install
845 # SunOS /usr/etc/install
846 # IRIX /sbin/install
847 # AIX /bin/install
848 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
849 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
850 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
851 # ./install, which can be erroneously created by make from ./install.sh.
852 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
853 echo "configure:854: checking for a BSD compatible install" >&5
854 if test -z "$INSTALL"; then
855 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
856   echo $ac_n "(cached) $ac_c" 1>&6
857 else
858     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
859   for ac_dir in $PATH; do
860     # Account for people who put trailing slashes in PATH elements.
861     case "$ac_dir/" in
862     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
863     *)
864       # OSF1 and SCO ODT 3.0 have their own names for install.
865       # Don't use installbsd from OSF since it installs stuff as root
866       # by default.
867       for ac_prog in ginstall scoinst install; do
868         if test -f $ac_dir/$ac_prog; then
869           if test $ac_prog = install &&
870             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
871             # AIX install.  It has an incompatible calling convention.
872             :
873           elif test $ac_prog = install &&
874             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
875             # program-specific install script used by HP pwplus--don't use.
876             :
877           else
878             ac_cv_path_install="$ac_dir/$ac_prog -c"
879             break 2
880           fi
881         fi
882       done
883       ;;
884     esac
885   done
886   IFS="$ac_save_IFS"
887
888 fi
889   if test "${ac_cv_path_install+set}" = set; then
890     INSTALL="$ac_cv_path_install"
891   else
892     # As a last resort, use the slow shell script.  We don't cache a
893     # path for INSTALL within a source directory, because that will
894     # break other packages using the cache if that directory is
895     # removed, or if the path is relative.
896     INSTALL="$ac_install_sh"
897   fi
898 fi
899 echo "$ac_t""$INSTALL" 1>&6
900
901 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
902 # It thinks the first close brace ends the variable substitution.
903 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
904
905 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
906
907 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
908
909 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
910 echo "configure:911: checking whether build environment is sane" >&5
911 # Just in case
912 sleep 1
913 echo timestamp > conftestfile
914 # Do `set' in a subshell so we don't clobber the current shell's
915 # arguments.  Must try -L first in case configure is actually a
916 # symlink; some systems play weird games with the mod time of symlinks
917 # (eg FreeBSD returns the mod time of the symlink's containing
918 # directory).
919 if (
920    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
921    if test "$*" = "X"; then
922       # -L didn't work.
923       set X `ls -t $srcdir/configure conftestfile`
924    fi
925    if test "$*" != "X $srcdir/configure conftestfile" \
926       && test "$*" != "X conftestfile $srcdir/configure"; then
927
928       # If neither matched, then we have a broken ls.  This can happen
929       # if, for instance, CONFIG_SHELL is bash and it inherits a
930       # broken ls alias from the environment.  This has actually
931       # happened.  Such a system could not be considered "sane".
932       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
933 alias in your environment" 1>&2; exit 1; }
934    fi
935
936    test "$2" = conftestfile
937    )
938 then
939    # Ok.
940    :
941 else
942    { echo "configure: error: newly created file is older than distributed files!
943 Check your system clock" 1>&2; exit 1; }
944 fi
945 rm -f conftest*
946 echo "$ac_t""yes" 1>&6
947 if test "$program_transform_name" = s,x,x,; then
948   program_transform_name=
949 else
950   # Double any \ or $.  echo might interpret backslashes.
951   cat <<\EOF_SED > conftestsed
952 s,\\,\\\\,g; s,\$,$$,g
953 EOF_SED
954   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
955   rm -f conftestsed
956 fi
957 test "$program_prefix" != NONE &&
958   program_transform_name="s,^,${program_prefix},;$program_transform_name"
959 # Use a double $ so make ignores it.
960 test "$program_suffix" != NONE &&
961   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
962
963 # sed with no file args requires a program.
964 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
965
966 for ac_prog in mawk gawk nawk awk
967 do
968 # Extract the first word of "$ac_prog", so it can be a program name with args.
969 set dummy $ac_prog; ac_word=$2
970 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
971 echo "configure:972: checking for $ac_word" >&5
972 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
973   echo $ac_n "(cached) $ac_c" 1>&6
974 else
975   if test -n "$AWK"; then
976   ac_cv_prog_AWK="$AWK" # Let the user override the test.
977 else
978   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
979   ac_dummy="$PATH"
980   for ac_dir in $ac_dummy; do
981     test -z "$ac_dir" && ac_dir=.
982     if test -f $ac_dir/$ac_word; then
983       ac_cv_prog_AWK="$ac_prog"
984       break
985     fi
986   done
987   IFS="$ac_save_ifs"
988 fi
989 fi
990 AWK="$ac_cv_prog_AWK"
991 if test -n "$AWK"; then
992   echo "$ac_t""$AWK" 1>&6
993 else
994   echo "$ac_t""no" 1>&6
995 fi
996
997 test -n "$AWK" && break
998 done
999
1000 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1001 echo "configure:1002: checking whether ${MAKE-make} sets \${MAKE}" >&5
1002 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1003 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1004   echo $ac_n "(cached) $ac_c" 1>&6
1005 else
1006   cat > conftestmake <<\EOF
1007 all:
1008         @echo 'ac_maketemp="${MAKE}"'
1009 EOF
1010 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1011 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1012 if test -n "$ac_maketemp"; then
1013   eval ac_cv_prog_make_${ac_make}_set=yes
1014 else
1015   eval ac_cv_prog_make_${ac_make}_set=no
1016 fi
1017 rm -f conftestmake
1018 fi
1019 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1020   echo "$ac_t""yes" 1>&6
1021   SET_MAKE=
1022 else
1023   echo "$ac_t""no" 1>&6
1024   SET_MAKE="MAKE=${MAKE-make}"
1025 fi
1026
1027
1028
1029 PACKAGE=$OL_PACKAGE
1030
1031 VERSION=$OL_VERSION
1032
1033 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1034   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1035 fi
1036
1037
1038
1039 missing_dir=`cd $ac_aux_dir && pwd`
1040 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1041 echo "configure:1042: checking for working aclocal" >&5
1042 # Run test in a subshell; some versions of sh will print an error if
1043 # an executable is not found, even if stderr is redirected.
1044 # Redirect stdin to placate older versions of autoconf.  Sigh.
1045 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1046    ACLOCAL=aclocal
1047    echo "$ac_t""found" 1>&6
1048 else
1049    ACLOCAL="$missing_dir/missing aclocal"
1050    echo "$ac_t""missing" 1>&6
1051 fi
1052
1053 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1054 echo "configure:1055: checking for working autoconf" >&5
1055 # Run test in a subshell; some versions of sh will print an error if
1056 # an executable is not found, even if stderr is redirected.
1057 # Redirect stdin to placate older versions of autoconf.  Sigh.
1058 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1059    AUTOCONF=autoconf
1060    echo "$ac_t""found" 1>&6
1061 else
1062    AUTOCONF="$missing_dir/missing autoconf"
1063    echo "$ac_t""missing" 1>&6
1064 fi
1065
1066 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1067 echo "configure:1068: checking for working automake" >&5
1068 # Run test in a subshell; some versions of sh will print an error if
1069 # an executable is not found, even if stderr is redirected.
1070 # Redirect stdin to placate older versions of autoconf.  Sigh.
1071 if (automake --version) < /dev/null > /dev/null 2>&1; then
1072    AUTOMAKE=automake
1073    echo "$ac_t""found" 1>&6
1074 else
1075    AUTOMAKE="$missing_dir/missing automake"
1076    echo "$ac_t""missing" 1>&6
1077 fi
1078
1079 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1080 echo "configure:1081: checking for working autoheader" >&5
1081 # Run test in a subshell; some versions of sh will print an error if
1082 # an executable is not found, even if stderr is redirected.
1083 # Redirect stdin to placate older versions of autoconf.  Sigh.
1084 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1085    AUTOHEADER=autoheader
1086    echo "$ac_t""found" 1>&6
1087 else
1088    AUTOHEADER="$missing_dir/missing autoheader"
1089    echo "$ac_t""missing" 1>&6
1090 fi
1091
1092 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1093 echo "configure:1094: checking for working makeinfo" >&5
1094 # Run test in a subshell; some versions of sh will print an error if
1095 # an executable is not found, even if stderr is redirected.
1096 # Redirect stdin to placate older versions of autoconf.  Sigh.
1097 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1098    MAKEINFO=makeinfo
1099    echo "$ac_t""found" 1>&6
1100 else
1101    MAKEINFO="$missing_dir/missing makeinfo"
1102    echo "$ac_t""missing" 1>&6
1103 fi
1104
1105 install_sh="$missing_dir/install-sh"
1106 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1107
1108 for ac_prog in gnutar gtar tar
1109 do
1110 # Extract the first word of "$ac_prog", so it can be a program name with args.
1111 set dummy $ac_prog; ac_word=$2
1112 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1113 echo "configure:1114: checking for $ac_word" >&5
1114 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1115   echo $ac_n "(cached) $ac_c" 1>&6
1116 else
1117   if test -n "$AMTAR"; then
1118   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1119 else
1120   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1121   ac_dummy="$PATH"
1122   for ac_dir in $ac_dummy; do
1123     test -z "$ac_dir" && ac_dir=.
1124     if test -f $ac_dir/$ac_word; then
1125       ac_cv_prog_AMTAR="$ac_prog"
1126       break
1127     fi
1128   done
1129   IFS="$ac_save_ifs"
1130 fi
1131 fi
1132 AMTAR="$ac_cv_prog_AMTAR"
1133 if test -n "$AMTAR"; then
1134   echo "$ac_t""$AMTAR" 1>&6
1135 else
1136   echo "$ac_t""no" 1>&6
1137 fi
1138
1139 test -n "$AMTAR" && break
1140 done
1141
1142
1143 AMTARFLAGS=
1144 if test -n "$AMTAR"; then
1145   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1146         AMTARFLAGS=o
1147   fi
1148 fi
1149
1150 cat >> confdefs.h <<EOF
1151 #define OPENLDAP_PACKAGE "$PACKAGE"
1152 EOF
1153
1154 cat >> confdefs.h <<EOF
1155 #define OPENLDAP_VERSION "$VERSION"
1156 EOF
1157
1158
1159 cat >> confdefs.h <<EOF
1160 #define LDAP_VENDOR_VERSION $OL_API_INC
1161 EOF
1162
1163 cat >> confdefs.h <<EOF
1164 #define LDAP_VENDOR_VERSION_MAJOR $OL_MAJOR
1165 EOF
1166
1167 cat >> confdefs.h <<EOF
1168 #define LDAP_VENDOR_VERSION_MINOR $OL_MINOR
1169 EOF
1170
1171 cat >> confdefs.h <<EOF
1172 #define LDAP_VENDOR_VERSION_PATCH $OL_PATCH
1173 EOF
1174
1175
1176 OPENLDAP_LIBVERSION=$OL_API_LIB
1177
1178
1179
1180 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1181 echo "configure:1182: checking configure arguments" >&5
1182
1183
1184 top_builddir=`pwd`
1185
1186 ldap_subdir="/openldap"
1187
1188 # Check whether --with-subdir or --without-subdir was given.
1189 if test "${with_subdir+set}" = set; then
1190   withval="$with_subdir"
1191   case "$withval" in
1192         no) ldap_subdir=""
1193                 ;;
1194         yes)
1195                 ;;
1196         /*|\\*)
1197                 ldap_subdir="$withval"
1198                 ;;
1199         *)
1200                 ldap_subdir="/$withval"
1201                 ;;
1202 esac
1203
1204 fi
1205
1206
1207 # OpenLDAP --enable-debug
1208         # Check whether --enable-debug or --disable-debug was given.
1209 if test "${enable_debug+set}" = set; then
1210   enableval="$enable_debug"
1211   
1212         ol_arg=invalid
1213         for ol_val in auto yes no ; do
1214                 if test "$enableval" = "$ol_val" ; then
1215                         ol_arg="$ol_val"
1216                 fi
1217         done
1218         if test "$ol_arg" = "invalid" ; then
1219                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1220         fi
1221         ol_enable_debug="$ol_arg"
1222
1223 else
1224         ol_enable_debug="yes"
1225 fi
1226 # end --enable-debug
1227 # OpenLDAP --enable-syslog
1228         # Check whether --enable-syslog or --disable-syslog was given.
1229 if test "${enable_syslog+set}" = set; then
1230   enableval="$enable_syslog"
1231   
1232         ol_arg=invalid
1233         for ol_val in auto yes no ; do
1234                 if test "$enableval" = "$ol_val" ; then
1235                         ol_arg="$ol_val"
1236                 fi
1237         done
1238         if test "$ol_arg" = "invalid" ; then
1239                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1240         fi
1241         ol_enable_syslog="$ol_arg"
1242
1243 else
1244         ol_enable_syslog="auto"
1245 fi
1246 # end --enable-syslog
1247 # OpenLDAP --enable-proctitle
1248         # Check whether --enable-proctitle or --disable-proctitle was given.
1249 if test "${enable_proctitle+set}" = set; then
1250   enableval="$enable_proctitle"
1251   
1252         ol_arg=invalid
1253         for ol_val in auto yes no ; do
1254                 if test "$enableval" = "$ol_val" ; then
1255                         ol_arg="$ol_val"
1256                 fi
1257         done
1258         if test "$ol_arg" = "invalid" ; then
1259                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1260         fi
1261         ol_enable_proctitle="$ol_arg"
1262
1263 else
1264         ol_enable_proctitle="yes"
1265 fi
1266 # end --enable-proctitle
1267 # OpenLDAP --enable-cache
1268         # Check whether --enable-cache or --disable-cache was given.
1269 if test "${enable_cache+set}" = set; then
1270   enableval="$enable_cache"
1271   
1272         ol_arg=invalid
1273         for ol_val in auto yes no ; do
1274                 if test "$enableval" = "$ol_val" ; then
1275                         ol_arg="$ol_val"
1276                 fi
1277         done
1278         if test "$ol_arg" = "invalid" ; then
1279                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
1280         fi
1281         ol_enable_cache="$ol_arg"
1282
1283 else
1284         ol_enable_cache="no"
1285 fi
1286 # end --enable-cache
1287 # OpenLDAP --enable-referrals
1288         # Check whether --enable-referrals or --disable-referrals was given.
1289 if test "${enable_referrals+set}" = set; then
1290   enableval="$enable_referrals"
1291   
1292         ol_arg=invalid
1293         for ol_val in auto yes no ; do
1294                 if test "$enableval" = "$ol_val" ; then
1295                         ol_arg="$ol_val"
1296                 fi
1297         done
1298         if test "$ol_arg" = "invalid" ; then
1299                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1300         fi
1301         ol_enable_referrals="$ol_arg"
1302
1303 else
1304         ol_enable_referrals="no"
1305 fi
1306 # end --enable-referrals
1307 # OpenLDAP --enable-kbind
1308         # Check whether --enable-kbind or --disable-kbind was given.
1309 if test "${enable_kbind+set}" = set; then
1310   enableval="$enable_kbind"
1311   
1312         ol_arg=invalid
1313         for ol_val in auto yes no ; do
1314                 if test "$enableval" = "$ol_val" ; then
1315                         ol_arg="$ol_val"
1316                 fi
1317         done
1318         if test "$ol_arg" = "invalid" ; then
1319                 { echo "configure: error: bad value $enableval for --enable-kbind" 1>&2; exit 1; }
1320         fi
1321         ol_enable_kbind="$ol_arg"
1322
1323 else
1324         ol_enable_kbind="no"
1325 fi
1326 # end --enable-kbind
1327 # OpenLDAP --enable-ipv6
1328         # Check whether --enable-ipv6 or --disable-ipv6 was given.
1329 if test "${enable_ipv6+set}" = set; then
1330   enableval="$enable_ipv6"
1331   
1332         ol_arg=invalid
1333         for ol_val in auto yes no ; do
1334                 if test "$enableval" = "$ol_val" ; then
1335                         ol_arg="$ol_val"
1336                 fi
1337         done
1338         if test "$ol_arg" = "invalid" ; then
1339                 { echo "configure: error: bad value $enableval for --enable-ipv6" 1>&2; exit 1; }
1340         fi
1341         ol_enable_ipv6="$ol_arg"
1342
1343 else
1344         ol_enable_ipv6="auto"
1345 fi
1346 # end --enable-ipv6
1347 # OpenLDAP --enable-local
1348         # Check whether --enable-local or --disable-local was given.
1349 if test "${enable_local+set}" = set; then
1350   enableval="$enable_local"
1351   
1352         ol_arg=invalid
1353         for ol_val in auto yes no ; do
1354                 if test "$enableval" = "$ol_val" ; then
1355                         ol_arg="$ol_val"
1356                 fi
1357         done
1358         if test "$ol_arg" = "invalid" ; then
1359                 { echo "configure: error: bad value $enableval for --enable-local" 1>&2; exit 1; }
1360         fi
1361         ol_enable_local="$ol_arg"
1362
1363 else
1364         ol_enable_local="auto"
1365 fi
1366 # end --enable-local
1367 # OpenLDAP --enable-rewrite
1368         # Check whether --enable-rewrite or --disable-rewrite was given.
1369 if test "${enable_rewrite+set}" = set; then
1370   enableval="$enable_rewrite"
1371   
1372         ol_arg=invalid
1373         for ol_val in auto yes no ; do
1374                 if test "$enableval" = "$ol_val" ; then
1375                         ol_arg="$ol_val"
1376                 fi
1377         done
1378         if test "$ol_arg" = "invalid" ; then
1379                 { echo "configure: error: bad value $enableval for --enable-rewrite" 1>&2; exit 1; }
1380         fi
1381         ol_enable_rewrite="$ol_arg"
1382
1383 else
1384         ol_enable_rewrite="no"
1385 fi
1386 # end --enable-rewrite
1387 # OpenLDAP --enable-x_compile
1388         # Check whether --enable-x_compile or --disable-x_compile was given.
1389 if test "${enable_x_compile+set}" = set; then
1390   enableval="$enable_x_compile"
1391   
1392         ol_arg=invalid
1393         for ol_val in yes no ; do
1394                 if test "$enableval" = "$ol_val" ; then
1395                         ol_arg="$ol_val"
1396                 fi
1397         done
1398         if test "$ol_arg" = "invalid" ; then
1399                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1400         fi
1401         ol_enable_x_compile="$ol_arg"
1402
1403 else
1404         ol_enable_x_compile="no"
1405 fi
1406 # end --enable-x_compile
1407
1408
1409 # OpenLDAP --with-cyrus_sasl
1410         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1411 if test "${with_cyrus_sasl+set}" = set; then
1412   withval="$with_cyrus_sasl"
1413   
1414         ol_arg=invalid
1415         for ol_val in auto yes no  ; do
1416                 if test "$withval" = "$ol_val" ; then
1417                         ol_arg="$ol_val"
1418                 fi
1419         done
1420         if test "$ol_arg" = "invalid" ; then
1421                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1422         fi
1423         ol_with_cyrus_sasl="$ol_arg"
1424
1425 else
1426         ol_with_cyrus_sasl="auto"
1427 fi
1428 # end --with-cyrus_sasl
1429
1430 # OpenLDAP --with-fetch
1431         # Check whether --with-fetch or --without-fetch was given.
1432 if test "${with_fetch+set}" = set; then
1433   withval="$with_fetch"
1434   
1435         ol_arg=invalid
1436         for ol_val in auto yes no  ; do
1437                 if test "$withval" = "$ol_val" ; then
1438                         ol_arg="$ol_val"
1439                 fi
1440         done
1441         if test "$ol_arg" = "invalid" ; then
1442                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1443         fi
1444         ol_with_fetch="$ol_arg"
1445
1446 else
1447         ol_with_fetch="auto"
1448 fi
1449 # end --with-fetch
1450
1451 # OpenLDAP --with-kerberos
1452         # Check whether --with-kerberos or --without-kerberos was given.
1453 if test "${with_kerberos+set}" = set; then
1454   withval="$with_kerberos"
1455   
1456         ol_arg=invalid
1457         for ol_val in auto k5 k5only k425 kth k4 afs yes no ; do
1458                 if test "$withval" = "$ol_val" ; then
1459                         ol_arg="$ol_val"
1460                 fi
1461         done
1462         if test "$ol_arg" = "invalid" ; then
1463                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1464         fi
1465         ol_with_kerberos="$ol_arg"
1466
1467 else
1468         ol_with_kerberos="auto"
1469 fi
1470 # end --with-kerberos
1471
1472 # OpenLDAP --with-readline
1473         # Check whether --with-readline or --without-readline was given.
1474 if test "${with_readline+set}" = set; then
1475   withval="$with_readline"
1476   
1477         ol_arg=invalid
1478         for ol_val in auto yes no  ; do
1479                 if test "$withval" = "$ol_val" ; then
1480                         ol_arg="$ol_val"
1481                 fi
1482         done
1483         if test "$ol_arg" = "invalid" ; then
1484                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1485         fi
1486         ol_with_readline="$ol_arg"
1487
1488 else
1489         ol_with_readline="auto"
1490 fi
1491 # end --with-readline
1492
1493 # OpenLDAP --with-threads
1494         # Check whether --with-threads or --without-threads was given.
1495 if test "${with_threads+set}" = set; then
1496   withval="$with_threads"
1497   
1498         ol_arg=invalid
1499         for ol_val in auto nt posix mach pth lwp yes no manual  ; do
1500                 if test "$withval" = "$ol_val" ; then
1501                         ol_arg="$ol_val"
1502                 fi
1503         done
1504         if test "$ol_arg" = "invalid" ; then
1505                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1506         fi
1507         ol_with_threads="$ol_arg"
1508
1509 else
1510         ol_with_threads="auto"
1511 fi
1512 # end --with-threads
1513
1514 # OpenLDAP --with-tls
1515         # Check whether --with-tls or --without-tls was given.
1516 if test "${with_tls+set}" = set; then
1517   withval="$with_tls"
1518   
1519         ol_arg=invalid
1520         for ol_val in auto ssleay openssl yes no  ; do
1521                 if test "$withval" = "$ol_val" ; then
1522                         ol_arg="$ol_val"
1523                 fi
1524         done
1525         if test "$ol_arg" = "invalid" ; then
1526                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1527         fi
1528         ol_with_tls="$ol_arg"
1529
1530 else
1531         ol_with_tls="auto"
1532 fi
1533 # end --with-tls
1534
1535 # OpenLDAP --with-yielding_select
1536         # Check whether --with-yielding_select or --without-yielding_select was given.
1537 if test "${with_yielding_select+set}" = set; then
1538   withval="$with_yielding_select"
1539   
1540         ol_arg=invalid
1541         for ol_val in auto yes no manual  ; do
1542                 if test "$withval" = "$ol_val" ; then
1543                         ol_arg="$ol_val"
1544                 fi
1545         done
1546         if test "$ol_arg" = "invalid" ; then
1547                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1548         fi
1549         ol_with_yielding_select="$ol_arg"
1550
1551 else
1552         ol_with_yielding_select="auto"
1553 fi
1554 # end --with-yielding_select
1555
1556
1557
1558 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1559 if test "${with_xxslapdoptions+set}" = set; then
1560   withval="$with_xxslapdoptions"
1561   :
1562 fi
1563
1564 # OpenLDAP --enable-slapd
1565         # Check whether --enable-slapd or --disable-slapd was given.
1566 if test "${enable_slapd+set}" = set; then
1567   enableval="$enable_slapd"
1568   
1569         ol_arg=invalid
1570         for ol_val in auto yes no ; do
1571                 if test "$enableval" = "$ol_val" ; then
1572                         ol_arg="$ol_val"
1573                 fi
1574         done
1575         if test "$ol_arg" = "invalid" ; then
1576                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1577         fi
1578         ol_enable_slapd="$ol_arg"
1579
1580 else
1581         ol_enable_slapd="yes"
1582 fi
1583 # end --enable-slapd
1584 # OpenLDAP --enable-aci
1585         # Check whether --enable-aci or --disable-aci was given.
1586 if test "${enable_aci+set}" = set; then
1587   enableval="$enable_aci"
1588   
1589         ol_arg=invalid
1590         for ol_val in auto yes no ; do
1591                 if test "$enableval" = "$ol_val" ; then
1592                         ol_arg="$ol_val"
1593                 fi
1594         done
1595         if test "$ol_arg" = "invalid" ; then
1596                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1597         fi
1598         ol_enable_aci="$ol_arg"
1599
1600 else
1601         ol_enable_aci="no"
1602 fi
1603 # end --enable-aci
1604 # OpenLDAP --enable-cleartext
1605         # Check whether --enable-cleartext or --disable-cleartext was given.
1606 if test "${enable_cleartext+set}" = set; then
1607   enableval="$enable_cleartext"
1608   
1609         ol_arg=invalid
1610         for ol_val in auto yes no ; do
1611                 if test "$enableval" = "$ol_val" ; then
1612                         ol_arg="$ol_val"
1613                 fi
1614         done
1615         if test "$ol_arg" = "invalid" ; then
1616                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1617         fi
1618         ol_enable_cleartext="$ol_arg"
1619
1620 else
1621         ol_enable_cleartext="yes"
1622 fi
1623 # end --enable-cleartext
1624 # OpenLDAP --enable-crypt
1625         # Check whether --enable-crypt or --disable-crypt was given.
1626 if test "${enable_crypt+set}" = set; then
1627   enableval="$enable_crypt"
1628   
1629         ol_arg=invalid
1630         for ol_val in auto yes no ; do
1631                 if test "$enableval" = "$ol_val" ; then
1632                         ol_arg="$ol_val"
1633                 fi
1634         done
1635         if test "$ol_arg" = "invalid" ; then
1636                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1637         fi
1638         ol_enable_crypt="$ol_arg"
1639
1640 else
1641         ol_enable_crypt="no"
1642 fi
1643 # end --enable-crypt
1644 # OpenLDAP --enable-dynamic
1645         # Check whether --enable-dynamic or --disable-dynamic was given.
1646 if test "${enable_dynamic+set}" = set; then
1647   enableval="$enable_dynamic"
1648   
1649         ol_arg=invalid
1650         for ol_val in auto yes no ; do
1651                 if test "$enableval" = "$ol_val" ; then
1652                         ol_arg="$ol_val"
1653                 fi
1654         done
1655         if test "$ol_arg" = "invalid" ; then
1656                 { echo "configure: error: bad value $enableval for --enable-dynamic" 1>&2; exit 1; }
1657         fi
1658         ol_enable_dynamic="$ol_arg"
1659
1660 else
1661         ol_enable_dynamic="no"
1662 fi
1663 # end --enable-dynamic
1664 # OpenLDAP --enable-kpasswd
1665         # Check whether --enable-kpasswd or --disable-kpasswd was given.
1666 if test "${enable_kpasswd+set}" = set; then
1667   enableval="$enable_kpasswd"
1668   
1669         ol_arg=invalid
1670         for ol_val in auto yes no ; do
1671                 if test "$enableval" = "$ol_val" ; then
1672                         ol_arg="$ol_val"
1673                 fi
1674         done
1675         if test "$ol_arg" = "invalid" ; then
1676                 { echo "configure: error: bad value $enableval for --enable-kpasswd" 1>&2; exit 1; }
1677         fi
1678         ol_enable_kpasswd="$ol_arg"
1679
1680 else
1681         ol_enable_kpasswd="no"
1682 fi
1683 # end --enable-kpasswd
1684 # OpenLDAP --enable-lmpasswd
1685         # Check whether --enable-lmpasswd or --disable-lmpasswd was given.
1686 if test "${enable_lmpasswd+set}" = set; then
1687   enableval="$enable_lmpasswd"
1688   
1689         ol_arg=invalid
1690         for ol_val in auto yes no ; do
1691                 if test "$enableval" = "$ol_val" ; then
1692                         ol_arg="$ol_val"
1693                 fi
1694         done
1695         if test "$ol_arg" = "invalid" ; then
1696                 { echo "configure: error: bad value $enableval for --enable-lmpasswd" 1>&2; exit 1; }
1697         fi
1698         ol_enable_lmpasswd="$ol_arg"
1699
1700 else
1701         ol_enable_lmpasswd="no"
1702 fi
1703 # end --enable-lmpasswd
1704 # OpenLDAP --enable-spasswd
1705         # Check whether --enable-spasswd or --disable-spasswd was given.
1706 if test "${enable_spasswd+set}" = set; then
1707   enableval="$enable_spasswd"
1708   
1709         ol_arg=invalid
1710         for ol_val in auto yes no ; do
1711                 if test "$enableval" = "$ol_val" ; then
1712                         ol_arg="$ol_val"
1713                 fi
1714         done
1715         if test "$ol_arg" = "invalid" ; then
1716                 { echo "configure: error: bad value $enableval for --enable-spasswd" 1>&2; exit 1; }
1717         fi
1718         ol_enable_spasswd="$ol_arg"
1719
1720 else
1721         ol_enable_spasswd="no"
1722 fi
1723 # end --enable-spasswd
1724 # OpenLDAP --enable-modules
1725         # Check whether --enable-modules or --disable-modules was given.
1726 if test "${enable_modules+set}" = set; then
1727   enableval="$enable_modules"
1728   
1729         ol_arg=invalid
1730         for ol_val in auto yes no ; do
1731                 if test "$enableval" = "$ol_val" ; then
1732                         ol_arg="$ol_val"
1733                 fi
1734         done
1735         if test "$ol_arg" = "invalid" ; then
1736                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1737         fi
1738         ol_enable_modules="$ol_arg"
1739
1740 else
1741         ol_enable_modules="no"
1742 fi
1743 # end --enable-modules
1744 # OpenLDAP --enable-phonetic
1745         # Check whether --enable-phonetic or --disable-phonetic was given.
1746 if test "${enable_phonetic+set}" = set; then
1747   enableval="$enable_phonetic"
1748   
1749         ol_arg=invalid
1750         for ol_val in auto yes no ; do
1751                 if test "$enableval" = "$ol_val" ; then
1752                         ol_arg="$ol_val"
1753                 fi
1754         done
1755         if test "$ol_arg" = "invalid" ; then
1756                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1757         fi
1758         ol_enable_phonetic="$ol_arg"
1759
1760 else
1761         ol_enable_phonetic="no"
1762 fi
1763 # end --enable-phonetic
1764 # OpenLDAP --enable-rlookups
1765         # Check whether --enable-rlookups or --disable-rlookups was given.
1766 if test "${enable_rlookups+set}" = set; then
1767   enableval="$enable_rlookups"
1768   
1769         ol_arg=invalid
1770         for ol_val in auto yes no ; do
1771                 if test "$enableval" = "$ol_val" ; then
1772                         ol_arg="$ol_val"
1773                 fi
1774         done
1775         if test "$ol_arg" = "invalid" ; then
1776                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1777         fi
1778         ol_enable_rlookups="$ol_arg"
1779
1780 else
1781         ol_enable_rlookups="no"
1782 fi
1783 # end --enable-rlookups
1784 # OpenLDAP --enable-slp
1785         # Check whether --enable-slp or --disable-slp was given.
1786 if test "${enable_slp+set}" = set; then
1787   enableval="$enable_slp"
1788   
1789         ol_arg=invalid
1790         for ol_val in auto yes no ; do
1791                 if test "$enableval" = "$ol_val" ; then
1792                         ol_arg="$ol_val"
1793                 fi
1794         done
1795         if test "$ol_arg" = "invalid" ; then
1796                 { echo "configure: error: bad value $enableval for --enable-slp" 1>&2; exit 1; }
1797         fi
1798         ol_enable_slp="$ol_arg"
1799
1800 else
1801         ol_enable_slp="no"
1802 fi
1803 # end --enable-slp
1804 # OpenLDAP --enable-wrappers
1805         # Check whether --enable-wrappers or --disable-wrappers was given.
1806 if test "${enable_wrappers+set}" = set; then
1807   enableval="$enable_wrappers"
1808   
1809         ol_arg=invalid
1810         for ol_val in auto yes no ; do
1811                 if test "$enableval" = "$ol_val" ; then
1812                         ol_arg="$ol_val"
1813                 fi
1814         done
1815         if test "$ol_arg" = "invalid" ; then
1816                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1817         fi
1818         ol_enable_wrappers="$ol_arg"
1819
1820 else
1821         ol_enable_wrappers="no"
1822 fi
1823 # end --enable-wrappers
1824
1825 # OpenLDAP --enable-bdb
1826         # Check whether --enable-bdb or --disable-bdb was given.
1827 if test "${enable_bdb+set}" = set; then
1828   enableval="$enable_bdb"
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-bdb" 1>&2; exit 1; }
1838         fi
1839         ol_enable_bdb="$ol_arg"
1840
1841 else
1842         ol_enable_bdb="no"
1843 fi
1844 # end --enable-bdb
1845 # OpenLDAP --with-bdb_module
1846         # Check whether --with-bdb_module or --without-bdb_module was given.
1847 if test "${with_bdb_module+set}" = set; then
1848   withval="$with_bdb_module"
1849   
1850         ol_arg=invalid
1851         for ol_val in static dynamic ; do
1852                 if test "$withval" = "$ol_val" ; then
1853                         ol_arg="$ol_val"
1854                 fi
1855         done
1856         if test "$ol_arg" = "invalid" ; then
1857                 { echo "configure: error: bad value $withval for --with-bdb_module" 1>&2; exit 1; }
1858         fi
1859         ol_with_bdb_module="$ol_arg"
1860
1861 else
1862         ol_with_bdb_module="static"
1863 fi
1864 # end --with-bdb_module
1865
1866 # OpenLDAP --enable-dnssrv
1867         # Check whether --enable-dnssrv or --disable-dnssrv was given.
1868 if test "${enable_dnssrv+set}" = set; then
1869   enableval="$enable_dnssrv"
1870   
1871         ol_arg=invalid
1872         for ol_val in auto yes no ; do
1873                 if test "$enableval" = "$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 $enableval for --enable-dnssrv" 1>&2; exit 1; }
1879         fi
1880         ol_enable_dnssrv="$ol_arg"
1881
1882 else
1883         ol_enable_dnssrv="no"
1884 fi
1885 # end --enable-dnssrv
1886 # OpenLDAP --with-dnssrv_module
1887         # Check whether --with-dnssrv_module or --without-dnssrv_module was given.
1888 if test "${with_dnssrv_module+set}" = set; then
1889   withval="$with_dnssrv_module"
1890   
1891         ol_arg=invalid
1892         for ol_val in static dynamic ; do
1893                 if test "$withval" = "$ol_val" ; then
1894                         ol_arg="$ol_val"
1895                 fi
1896         done
1897         if test "$ol_arg" = "invalid" ; then
1898                 { echo "configure: error: bad value $withval for --with-dnssrv_module" 1>&2; exit 1; }
1899         fi
1900         ol_with_dnssrv_module="$ol_arg"
1901
1902 else
1903         ol_with_dnssrv_module="static"
1904 fi
1905 # end --with-dnssrv_module
1906
1907 # OpenLDAP --enable-ldap
1908         # Check whether --enable-ldap or --disable-ldap was given.
1909 if test "${enable_ldap+set}" = set; then
1910   enableval="$enable_ldap"
1911   
1912         ol_arg=invalid
1913         for ol_val in auto yes no ; do
1914                 if test "$enableval" = "$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 $enableval for --enable-ldap" 1>&2; exit 1; }
1920         fi
1921         ol_enable_ldap="$ol_arg"
1922
1923 else
1924         ol_enable_ldap="no"
1925 fi
1926 # end --enable-ldap
1927 # OpenLDAP --with-ldap_module
1928         # Check whether --with-ldap_module or --without-ldap_module was given.
1929 if test "${with_ldap_module+set}" = set; then
1930   withval="$with_ldap_module"
1931   
1932         ol_arg=invalid
1933         for ol_val in static dynamic ; do
1934                 if test "$withval" = "$ol_val" ; then
1935                         ol_arg="$ol_val"
1936                 fi
1937         done
1938         if test "$ol_arg" = "invalid" ; then
1939                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
1940         fi
1941         ol_with_ldap_module="$ol_arg"
1942
1943 else
1944         ol_with_ldap_module="static"
1945 fi
1946 # end --with-ldap_module
1947
1948 # OpenLDAP --enable-ldbm
1949         # Check whether --enable-ldbm or --disable-ldbm was given.
1950 if test "${enable_ldbm+set}" = set; then
1951   enableval="$enable_ldbm"
1952   
1953         ol_arg=invalid
1954         for ol_val in auto yes no ; do
1955                 if test "$enableval" = "$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 $enableval for --enable-ldbm" 1>&2; exit 1; }
1961         fi
1962         ol_enable_ldbm="$ol_arg"
1963
1964 else
1965         ol_enable_ldbm="yes"
1966 fi
1967 # end --enable-ldbm
1968 # OpenLDAP --with-ldbm_api
1969         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1970 if test "${with_ldbm_api+set}" = set; then
1971   withval="$with_ldbm_api"
1972   
1973         ol_arg=invalid
1974         for ol_val in auto berkeley bcompat mdbm gdbm ; do
1975                 if test "$withval" = "$ol_val" ; then
1976                         ol_arg="$ol_val"
1977                 fi
1978         done
1979         if test "$ol_arg" = "invalid" ; then
1980                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1981         fi
1982         ol_with_ldbm_api="$ol_arg"
1983
1984 else
1985         ol_with_ldbm_api="auto"
1986 fi
1987 # end --with-ldbm_api
1988
1989 # OpenLDAP --with-ldbm_module
1990         # Check whether --with-ldbm_module or --without-ldbm_module was given.
1991 if test "${with_ldbm_module+set}" = set; then
1992   withval="$with_ldbm_module"
1993   
1994         ol_arg=invalid
1995         for ol_val in static dynamic ; 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_module" 1>&2; exit 1; }
2002         fi
2003         ol_with_ldbm_module="$ol_arg"
2004
2005 else
2006         ol_with_ldbm_module="static"
2007 fi
2008 # end --with-ldbm_module
2009
2010 # OpenLDAP --with-ldbm_type
2011         # Check whether --with-ldbm_type or --without-ldbm_type was given.
2012 if test "${with_ldbm_type+set}" = set; then
2013   withval="$with_ldbm_type"
2014   
2015         ol_arg=invalid
2016         for ol_val in auto btree hash ; 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_type" 1>&2; exit 1; }
2023         fi
2024         ol_with_ldbm_type="$ol_arg"
2025
2026 else
2027         ol_with_ldbm_type="auto"
2028 fi
2029 # end --with-ldbm_type
2030
2031 # OpenLDAP --enable-meta
2032         # Check whether --enable-meta or --disable-meta was given.
2033 if test "${enable_meta+set}" = set; then
2034   enableval="$enable_meta"
2035   
2036         ol_arg=invalid
2037         for ol_val in auto yes no ; do
2038                 if test "$enableval" = "$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 $enableval for --enable-meta" 1>&2; exit 1; }
2044         fi
2045         ol_enable_meta="$ol_arg"
2046
2047 else
2048         ol_enable_meta="no"
2049 fi
2050 # end --enable-meta
2051 # OpenLDAP --with-meta_module
2052         # Check whether --with-meta_module or --without-meta_module was given.
2053 if test "${with_meta_module+set}" = set; then
2054   withval="$with_meta_module"
2055   
2056         ol_arg=invalid
2057         for ol_val in static dynamic ; do
2058                 if test "$withval" = "$ol_val" ; then
2059                         ol_arg="$ol_val"
2060                 fi
2061         done
2062         if test "$ol_arg" = "invalid" ; then
2063                 { echo "configure: error: bad value $withval for --with-meta_module" 1>&2; exit 1; }
2064         fi
2065         ol_with_meta_module="$ol_arg"
2066
2067 else
2068         ol_with_meta_module="static"
2069 fi
2070 # end --with-meta_module
2071
2072 # OpenLDAP --enable-passwd
2073         # Check whether --enable-passwd or --disable-passwd was given.
2074 if test "${enable_passwd+set}" = set; then
2075   enableval="$enable_passwd"
2076   
2077         ol_arg=invalid
2078         for ol_val in auto yes no ; do
2079                 if test "$enableval" = "$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 $enableval for --enable-passwd" 1>&2; exit 1; }
2085         fi
2086         ol_enable_passwd="$ol_arg"
2087
2088 else
2089         ol_enable_passwd="no"
2090 fi
2091 # end --enable-passwd
2092 # OpenLDAP --with-passwd_module
2093         # Check whether --with-passwd_module or --without-passwd_module was given.
2094 if test "${with_passwd_module+set}" = set; then
2095   withval="$with_passwd_module"
2096   
2097         ol_arg=invalid
2098         for ol_val in static dynamic ; do
2099                 if test "$withval" = "$ol_val" ; then
2100                         ol_arg="$ol_val"
2101                 fi
2102         done
2103         if test "$ol_arg" = "invalid" ; then
2104                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
2105         fi
2106         ol_with_passwd_module="$ol_arg"
2107
2108 else
2109         ol_with_passwd_module="static"
2110 fi
2111 # end --with-passwd_module
2112
2113 # OpenLDAP --enable-perl
2114         # Check whether --enable-perl or --disable-perl was given.
2115 if test "${enable_perl+set}" = set; then
2116   enableval="$enable_perl"
2117   
2118         ol_arg=invalid
2119         for ol_val in auto yes no ; do
2120                 if test "$enableval" = "$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 $enableval for --enable-perl" 1>&2; exit 1; }
2126         fi
2127         ol_enable_perl="$ol_arg"
2128
2129 else
2130         ol_enable_perl="no"
2131 fi
2132 # end --enable-perl
2133 # OpenLDAP --with-perl_module
2134         # Check whether --with-perl_module or --without-perl_module was given.
2135 if test "${with_perl_module+set}" = set; then
2136   withval="$with_perl_module"
2137   
2138         ol_arg=invalid
2139         for ol_val in static dynamic ; do
2140                 if test "$withval" = "$ol_val" ; then
2141                         ol_arg="$ol_val"
2142                 fi
2143         done
2144         if test "$ol_arg" = "invalid" ; then
2145                 { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; }
2146         fi
2147         ol_with_perl_module="$ol_arg"
2148
2149 else
2150         ol_with_perl_module="static"
2151 fi
2152 # end --with-perl_module
2153
2154 # OpenLDAP --enable-shell
2155         # Check whether --enable-shell or --disable-shell was given.
2156 if test "${enable_shell+set}" = set; then
2157   enableval="$enable_shell"
2158   
2159         ol_arg=invalid
2160         for ol_val in auto yes no ; do
2161                 if test "$enableval" = "$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 $enableval for --enable-shell" 1>&2; exit 1; }
2167         fi
2168         ol_enable_shell="$ol_arg"
2169
2170 else
2171         ol_enable_shell="no"
2172 fi
2173 # end --enable-shell
2174 # OpenLDAP --with-shell_module
2175         # Check whether --with-shell_module or --without-shell_module was given.
2176 if test "${with_shell_module+set}" = set; then
2177   withval="$with_shell_module"
2178   
2179         ol_arg=invalid
2180         for ol_val in static dynamic ; do
2181                 if test "$withval" = "$ol_val" ; then
2182                         ol_arg="$ol_val"
2183                 fi
2184         done
2185         if test "$ol_arg" = "invalid" ; then
2186                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
2187         fi
2188         ol_with_shell_module="$ol_arg"
2189
2190 else
2191         ol_with_shell_module="static"
2192 fi
2193 # end --with-shell_module
2194
2195 # OpenLDAP --enable-sql
2196         # Check whether --enable-sql or --disable-sql was given.
2197 if test "${enable_sql+set}" = set; then
2198   enableval="$enable_sql"
2199   
2200         ol_arg=invalid
2201         for ol_val in auto yes no ; do
2202                 if test "$enableval" = "$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 $enableval for --enable-sql" 1>&2; exit 1; }
2208         fi
2209         ol_enable_sql="$ol_arg"
2210
2211 else
2212         ol_enable_sql="no"
2213 fi
2214 # end --enable-sql
2215 # OpenLDAP --with-sql_module
2216         # Check whether --with-sql_module or --without-sql_module was given.
2217 if test "${with_sql_module+set}" = set; then
2218   withval="$with_sql_module"
2219   
2220         ol_arg=invalid
2221         for ol_val in static dynamic ; do
2222                 if test "$withval" = "$ol_val" ; then
2223                         ol_arg="$ol_val"
2224                 fi
2225         done
2226         if test "$ol_arg" = "invalid" ; then
2227                 { echo "configure: error: bad value $withval for --with-sql_module" 1>&2; exit 1; }
2228         fi
2229         ol_with_sql_module="$ol_arg"
2230
2231 else
2232         ol_with_sql_module="static"
2233 fi
2234 # end --with-sql_module
2235
2236 # OpenLDAP --enable-tcl
2237         # Check whether --enable-tcl or --disable-tcl was given.
2238 if test "${enable_tcl+set}" = set; then
2239   enableval="$enable_tcl"
2240   
2241         ol_arg=invalid
2242         for ol_val in auto yes no ; do
2243                 if test "$enableval" = "$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 $enableval for --enable-tcl" 1>&2; exit 1; }
2249         fi
2250         ol_enable_tcl="$ol_arg"
2251
2252 else
2253         ol_enable_tcl="no"
2254 fi
2255 # end --enable-tcl
2256 # OpenLDAP --with-tcl_module
2257         # Check whether --with-tcl_module or --without-tcl_module was given.
2258 if test "${with_tcl_module+set}" = set; then
2259   withval="$with_tcl_module"
2260   
2261         ol_arg=invalid
2262         for ol_val in static dynamic ; do
2263                 if test "$withval" = "$ol_val" ; then
2264                         ol_arg="$ol_val"
2265                 fi
2266         done
2267         if test "$ol_arg" = "invalid" ; then
2268                 { echo "configure: error: bad value $withval for --with-tcl_module" 1>&2; exit 1; }
2269         fi
2270         ol_with_tcl_module="$ol_arg"
2271
2272 else
2273         ol_with_tcl_module="static"
2274 fi
2275 # end --with-tcl_module
2276
2277
2278 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2279 if test "${with_xxslurpdoptions+set}" = set; then
2280   withval="$with_xxslurpdoptions"
2281   :
2282 fi
2283
2284 # OpenLDAP --enable-slurpd
2285         # Check whether --enable-slurpd or --disable-slurpd was given.
2286 if test "${enable_slurpd+set}" = set; then
2287   enableval="$enable_slurpd"
2288   
2289         ol_arg=invalid
2290         for ol_val in auto yes no ; do
2291                 if test "$enableval" = "$ol_val" ; then
2292                         ol_arg="$ol_val"
2293                 fi
2294         done
2295         if test "$ol_arg" = "invalid" ; then
2296                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2297         fi
2298         ol_enable_slurpd="$ol_arg"
2299
2300 else
2301         ol_enable_slurpd="auto"
2302 fi
2303 # end --enable-slurpd
2304
2305 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2306 if test "${with_xxliboptions+set}" = set; then
2307   withval="$with_xxliboptions"
2308   :
2309 fi
2310
2311 # Check whether --enable-static or --disable-static was given.
2312 if test "${enable_static+set}" = set; then
2313   enableval="$enable_static"
2314   p=${PACKAGE-default}
2315 case "$enableval" in
2316 yes) enable_static=yes ;;
2317 no) enable_static=no ;;
2318 *)
2319   enable_static=no
2320   # Look at the argument we got.  We use all the common list separators.
2321   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2322   for pkg in $enableval; do
2323     if test "X$pkg" = "X$p"; then
2324       enable_static=yes
2325     fi
2326   done
2327   IFS="$ac_save_ifs"
2328   ;;
2329 esac
2330 else
2331   enable_static=yes
2332 fi
2333
2334 # Check whether --enable-shared or --disable-shared was given.
2335 if test "${enable_shared+set}" = set; then
2336   enableval="$enable_shared"
2337   p=${PACKAGE-default}
2338 case "$enableval" in
2339 yes) enable_shared=yes ;;
2340 no) enable_shared=no ;;
2341 *)
2342   enable_shared=no
2343   # Look at the argument we got.  We use all the common list separators.
2344   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2345   for pkg in $enableval; do
2346     if test "X$pkg" = "X$p"; then
2347       enable_shared=yes
2348     fi
2349   done
2350   IFS="$ac_save_ifs"
2351   ;;
2352 esac
2353 else
2354   enable_shared=yes
2355 fi
2356
2357
2358
2359 # validate options
2360 if test $ol_enable_slapd = no ; then
2361                 if test $ol_enable_bdb = yes ; then
2362                 echo "configure: warning: slapd disabled, ignoring --enable-bdb argument" 1>&2
2363         fi
2364         if test $ol_enable_dnssrv = yes ; then
2365                 echo "configure: warning: slapd disabled, ignoring --enable-dnssrv argument" 1>&2
2366         fi
2367         if test $ol_enable_ldap = yes ; then
2368                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2369         fi
2370         if test $ol_enable_ldbm = yes ; then
2371                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2372         fi
2373         if test $ol_enable_meta = yes ; then
2374                 echo "configure: warning: slapd disabled, ignoring --enable-meta argument" 1>&2
2375         fi
2376         if test $ol_enable_passwd = yes ; then
2377                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2378         fi
2379         if test $ol_enable_perl = yes ; then
2380                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
2381         fi
2382         if test $ol_enable_shell = yes ; then
2383                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2384         fi
2385         if test $ol_enable_tcl = yes ; then
2386                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
2387         fi
2388         if test $ol_enable_sql = yes ; then
2389                 echo "configure: warning: slapd disabled, ignoring --enable-sql argument" 1>&2
2390         fi
2391         if test $ol_enable_modules = yes ; then
2392                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2393         fi
2394         if test $ol_enable_wrappers = yes ; then
2395                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2396         fi
2397         if test $ol_enable_phonetic = yes ; then
2398                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2399         fi
2400         if test $ol_enable_rlookups = yes ; then
2401                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2402         fi
2403         if test $ol_enable_aci = yes ; then
2404                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2405         fi
2406         if test $ol_with_ldbm_api != auto ; then
2407                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2408         fi
2409         if test $ol_with_ldbm_type != auto ; then
2410                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2411         fi
2412         if test $ol_with_bdb_module != static ; then
2413                 echo "configure: warning: slapd disabled, ignoring --with-bdb-module argument" 1>&2
2414         fi
2415         if test $ol_with_dnssrv_module != static ; then
2416                 echo "configure: warning: slapd disabled, ignoring --with-dnssrv-module argument" 1>&2
2417         fi
2418         if test $ol_with_ldap_module != static ; then
2419                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2420         fi
2421         if test $ol_with_ldbm_module != static ; then
2422                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2423         fi
2424         if test $ol_with_meta_module != static ; then
2425                 echo "configure: warning: slapd disabled, ignoring --with-meta-module argument" 1>&2
2426         fi
2427         if test $ol_with_passwd_module != static ; then
2428                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2429         fi
2430         if test $ol_with_perl_module != static ; then
2431                 echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
2432         fi
2433         if test $ol_with_shell_module != static ; then
2434                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2435         fi
2436         if test $ol_with_tcl_module != static ; then
2437                 echo "configure: warning: slapd disabled, ignoring --with-tcl-module argument" 1>&2
2438         fi
2439         if test $ol_with_sql_module != static ; then
2440                 echo "configure: warning: slapd disabled, ignoring --with-sql-module argument" 1>&2
2441         fi
2442         if test $ol_enable_slurpd = yes ; then
2443                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2444         fi
2445         if test $ol_enable_rewrite = yes ; then
2446                 echo "configure: warning: slapd disabled, ignoring --enable-rewrite argument" 1>&2
2447         fi
2448
2449         # force settings to no
2450         ol_enable_bdb=no
2451         ol_enable_dnssrv=no
2452         ol_enable_ldap=no
2453         ol_enable_ldbm=no
2454         ol_enable_meta=no
2455         ol_enable_passwd=no
2456         ol_enable_perl=no
2457         ol_enable_shell=no
2458         ol_enable_tcl=no
2459         ol_enable_sql=no
2460
2461         ol_enable_modules=no
2462         ol_enable_phonetic=no
2463         ol_enable_rlookups=no
2464         ol_enable_aci=no
2465         ol_enable_wrappers=no
2466         ol_enable_dynamic=no
2467
2468         ol_with_ldbm_api=no
2469         ol_with_ldbm_type=no
2470
2471         ol_with_bdb_module=static
2472         ol_with_dnssrv_module=static
2473         ol_with_ldap_module=static
2474         ol_with_ldbm_module=static
2475         ol_with_meta_module=static
2476         ol_with_passwd_module=static
2477         ol_with_perl_module=static
2478         ol_with_shell_module=static
2479         ol_with_tcl_module=static
2480         ol_with_sql_module=static
2481
2482         ol_enable_slurpd=no
2483
2484         ol_enable_rewrite=no
2485
2486 elif test $ol_enable_ldbm = no ; then
2487         
2488         if test $ol_with_ldbm_api != auto ; then
2489                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2490         fi
2491
2492         if test $ol_with_ldbm_type != auto ; then
2493                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2494         fi
2495
2496         if test $ol_with_ldbm_module != static ; then
2497                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2498         fi
2499
2500         if test $ol_enable_modules != yes -a \
2501                 $ol_enable_bdb = no -a \
2502                 $ol_enable_dnssrv = no -a \
2503                 $ol_enable_ldap = no -a \
2504                 $ol_enable_meta = no -a \
2505                 $ol_enable_passwd = no -a \
2506                 $ol_enable_perl = no -a \
2507                 $ol_enable_shell = no -a \
2508                 $ol_enable_sql = no -a \
2509                 $ol_enable_tcl = no ; then
2510                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2511         fi
2512
2513         ol_with_ldbm_api=no
2514         ol_with_ldbm_type=no
2515         ol_with_ldbm_module=static
2516
2517 else
2518                 if test $ol_with_ldbm_api = gdbm -a \
2519                 $ol_with_ldbm_type = btree ; then
2520                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2521         fi
2522         if test $ol_with_ldbm_api = mdbm -a \
2523                 $ol_with_ldbm_type = btree ; then
2524                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2525         fi
2526         if test $ol_with_ldbm_api = ndbm -a \
2527                 $ol_with_ldbm_type = btree ; then
2528                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2529         fi
2530 fi
2531
2532 if test $ol_enable_slurpd = yes ; then
2533                 if test $ol_with_threads = no ; then
2534                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2535         fi
2536 fi
2537
2538 if test $ol_enable_lmpasswd = yes ; then
2539         if test $ol_with_tls = no ; then
2540                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
2541         fi
2542 fi
2543
2544 if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
2545         if test $ol_with_kerberos = no ; then
2546                 { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
2547         fi
2548         ol_with_kerberos=yes
2549 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
2550         if test $ol_with_kerberos != no -a $ol_with_kerberos != auto ; then
2551                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2552         fi
2553         ol_with_kerberos=no
2554 fi
2555
2556 if test $ol_enable_spasswd = yes ; then
2557         if test $ol_with_cyrus_sasl = no ; then
2558                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2559         fi
2560         ol_with_cyrus_sasl=yes
2561 fi
2562
2563 echo "$ac_t""done" 1>&6
2564
2565 LDAP_LIBS=
2566 LDIF_LIBS=
2567 LDBM_LIBS=
2568 LTHREAD_LIBS=
2569 LUTIL_LIBS=
2570
2571 SLAPD_LIBS=
2572 SLURPD_LIBS=
2573
2574 BUILD_SLAPD=no
2575 BUILD_SLURPD=no
2576
2577 BUILD_THREAD=no
2578
2579 BUILD_BDB=no
2580 BUILD_DNSSRV=no
2581 BUILD_LDAP=no
2582 BUILD_LDBM=no
2583 BUILD_META=no
2584 BUILD_PASSWD=no
2585 BUILD_PERL=no
2586 BUILD_SHELL=no
2587 BUILD_SQL=no
2588 BUILD_TCL=no
2589
2590 BUILD_BDB_DYNAMIC=static
2591 BUILD_DNSSRV_DYNAMIC=static
2592 BUILD_LDAP_DYNAMIC=static
2593 BUILD_LDBM_DYNAMIC=static
2594 BUILD_META_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 SLAPD_SLP_LIBS=
2624
2625
2626
2627 cat >> confdefs.h <<\EOF
2628 #define HAVE_MKVERSION 1
2629 EOF
2630
2631
2632
2633
2634 ol_aix_threads=no
2635 case "$target" in
2636 *-*-aix*)       if test -z "$CC" ; then
2637                 case "$ol_with_threads" in
2638                 auto | yes |  posix) ol_aix_threads=yes ;;
2639                 esac
2640         fi
2641 ;;
2642 esac
2643
2644 if test $ol_aix_threads = yes ; then
2645         if test -z "${CC}" ; then
2646                 for ac_prog in cc_r xlc_r cc
2647 do
2648 # Extract the first word of "$ac_prog", so it can be a program name with args.
2649 set dummy $ac_prog; ac_word=$2
2650 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2651 echo "configure:2652: checking for $ac_word" >&5
2652 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2653   echo $ac_n "(cached) $ac_c" 1>&6
2654 else
2655   if test -n "$CC"; then
2656   ac_cv_prog_CC="$CC" # Let the user override the test.
2657 else
2658   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2659   ac_dummy="$PATH"
2660   for ac_dir in $ac_dummy; do
2661     test -z "$ac_dir" && ac_dir=.
2662     if test -f $ac_dir/$ac_word; then
2663       ac_cv_prog_CC="$ac_prog"
2664       break
2665     fi
2666   done
2667   IFS="$ac_save_ifs"
2668 fi
2669 fi
2670 CC="$ac_cv_prog_CC"
2671 if test -n "$CC"; then
2672   echo "$ac_t""$CC" 1>&6
2673 else
2674   echo "$ac_t""no" 1>&6
2675 fi
2676
2677 test -n "$CC" && break
2678 done
2679
2680
2681                 if test "$CC" = cc ; then
2682                                                 if test $ol_with_threads != auto ; then
2683                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2684                         else
2685                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2686                         fi
2687                         ol_with_threads=no
2688                 fi
2689         fi
2690
2691         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2692                 ol_with_threads=posix
2693                 ol_cv_pthread_create=yes
2694         fi
2695 fi
2696
2697 if test -z "${CC}"; then
2698         for ac_prog in cc
2699 do
2700 # Extract the first word of "$ac_prog", so it can be a program name with args.
2701 set dummy $ac_prog; ac_word=$2
2702 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2703 echo "configure:2704: checking for $ac_word" >&5
2704 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2705   echo $ac_n "(cached) $ac_c" 1>&6
2706 else
2707   if test -n "$CC"; then
2708   ac_cv_prog_CC="$CC" # Let the user override the test.
2709 else
2710   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2711   ac_dummy="$PATH"
2712   for ac_dir in $ac_dummy; do
2713     test -z "$ac_dir" && ac_dir=.
2714     if test -f $ac_dir/$ac_word; then
2715       ac_cv_prog_CC="$ac_prog"
2716       break
2717     fi
2718   done
2719   IFS="$ac_save_ifs"
2720 fi
2721 fi
2722 CC="$ac_cv_prog_CC"
2723 if test -n "$CC"; then
2724   echo "$ac_t""$CC" 1>&6
2725 else
2726   echo "$ac_t""no" 1>&6
2727 fi
2728
2729 test -n "$CC" && break
2730 done
2731
2732 fi
2733
2734
2735
2736
2737 # Check whether --enable-fast-install or --disable-fast-install was given.
2738 if test "${enable_fast_install+set}" = set; then
2739   enableval="$enable_fast_install"
2740   p=${PACKAGE-default}
2741 case "$enableval" in
2742 yes) enable_fast_install=yes ;;
2743 no) enable_fast_install=no ;;
2744 *)
2745   enable_fast_install=no
2746   # Look at the argument we got.  We use all the common list separators.
2747   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2748   for pkg in $enableval; do
2749     if test "X$pkg" = "X$p"; then
2750       enable_fast_install=yes
2751     fi
2752   done
2753   IFS="$ac_save_ifs"
2754   ;;
2755 esac
2756 else
2757   enable_fast_install=yes
2758 fi
2759
2760 # Extract the first word of "ranlib", so it can be a program name with args.
2761 set dummy ranlib; ac_word=$2
2762 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2763 echo "configure:2764: checking for $ac_word" >&5
2764 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
2765   echo $ac_n "(cached) $ac_c" 1>&6
2766 else
2767   if test -n "$RANLIB"; then
2768   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2769 else
2770   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2771   ac_dummy="$PATH"
2772   for ac_dir in $ac_dummy; do
2773     test -z "$ac_dir" && ac_dir=.
2774     if test -f $ac_dir/$ac_word; then
2775       ac_cv_prog_RANLIB="ranlib"
2776       break
2777     fi
2778   done
2779   IFS="$ac_save_ifs"
2780   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2781 fi
2782 fi
2783 RANLIB="$ac_cv_prog_RANLIB"
2784 if test -n "$RANLIB"; then
2785   echo "$ac_t""$RANLIB" 1>&6
2786 else
2787   echo "$ac_t""no" 1>&6
2788 fi
2789
2790 # Extract the first word of "gcc", so it can be a program name with args.
2791 set dummy gcc; ac_word=$2
2792 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2793 echo "configure:2794: checking for $ac_word" >&5
2794 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2795   echo $ac_n "(cached) $ac_c" 1>&6
2796 else
2797   if test -n "$CC"; then
2798   ac_cv_prog_CC="$CC" # Let the user override the test.
2799 else
2800   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2801   ac_dummy="$PATH"
2802   for ac_dir in $ac_dummy; do
2803     test -z "$ac_dir" && ac_dir=.
2804     if test -f $ac_dir/$ac_word; then
2805       ac_cv_prog_CC="gcc"
2806       break
2807     fi
2808   done
2809   IFS="$ac_save_ifs"
2810 fi
2811 fi
2812 CC="$ac_cv_prog_CC"
2813 if test -n "$CC"; then
2814   echo "$ac_t""$CC" 1>&6
2815 else
2816   echo "$ac_t""no" 1>&6
2817 fi
2818
2819 if test -z "$CC"; then
2820   # Extract the first word of "cc", so it can be a program name with args.
2821 set dummy cc; ac_word=$2
2822 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2823 echo "configure:2824: checking for $ac_word" >&5
2824 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2825   echo $ac_n "(cached) $ac_c" 1>&6
2826 else
2827   if test -n "$CC"; then
2828   ac_cv_prog_CC="$CC" # Let the user override the test.
2829 else
2830   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2831   ac_prog_rejected=no
2832   ac_dummy="$PATH"
2833   for ac_dir in $ac_dummy; do
2834     test -z "$ac_dir" && ac_dir=.
2835     if test -f $ac_dir/$ac_word; then
2836       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2837         ac_prog_rejected=yes
2838         continue
2839       fi
2840       ac_cv_prog_CC="cc"
2841       break
2842     fi
2843   done
2844   IFS="$ac_save_ifs"
2845 if test $ac_prog_rejected = yes; then
2846   # We found a bogon in the path, so make sure we never use it.
2847   set dummy $ac_cv_prog_CC
2848   shift
2849   if test $# -gt 0; then
2850     # We chose a different compiler from the bogus one.
2851     # However, it has the same basename, so the bogon will be chosen
2852     # first if we set CC to just the basename; use the full file name.
2853     shift
2854     set dummy "$ac_dir/$ac_word" "$@"
2855     shift
2856     ac_cv_prog_CC="$@"
2857   fi
2858 fi
2859 fi
2860 fi
2861 CC="$ac_cv_prog_CC"
2862 if test -n "$CC"; then
2863   echo "$ac_t""$CC" 1>&6
2864 else
2865   echo "$ac_t""no" 1>&6
2866 fi
2867
2868   if test -z "$CC"; then
2869     case "`uname -s`" in
2870     *win32* | *WIN32* | *CYGWIN*)
2871       # Extract the first word of "cl", so it can be a program name with args.
2872 set dummy cl; ac_word=$2
2873 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2874 echo "configure:2875: checking for $ac_word" >&5
2875 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2876   echo $ac_n "(cached) $ac_c" 1>&6
2877 else
2878   if test -n "$CC"; then
2879   ac_cv_prog_CC="$CC" # Let the user override the test.
2880 else
2881   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2882   ac_dummy="$PATH"
2883   for ac_dir in $ac_dummy; do
2884     test -z "$ac_dir" && ac_dir=.
2885     if test -f $ac_dir/$ac_word; then
2886       ac_cv_prog_CC="cl"
2887       break
2888     fi
2889   done
2890   IFS="$ac_save_ifs"
2891 fi
2892 fi
2893 CC="$ac_cv_prog_CC"
2894 if test -n "$CC"; then
2895   echo "$ac_t""$CC" 1>&6
2896 else
2897   echo "$ac_t""no" 1>&6
2898 fi
2899  ;;
2900     esac
2901   fi
2902   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2903 fi
2904
2905 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2906 echo "configure:2907: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
2907
2908 ac_ext=c
2909 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2910 ac_cpp='$CPP $CPPFLAGS'
2911 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2912 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2913 cross_compiling=$ac_cv_prog_cc_cross
2914
2915 cat > conftest.$ac_ext << EOF
2916
2917 #line 2918 "configure"
2918 #include "confdefs.h"
2919
2920 main(){return(0);}
2921 EOF
2922 if { (eval echo configure:2923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2923   ac_cv_prog_cc_works=yes
2924   # If we can't run a trivial program, we are probably using a cross compiler.
2925   if (./conftest; exit) 2>/dev/null; then
2926     ac_cv_prog_cc_cross=no
2927   else
2928     ac_cv_prog_cc_cross=yes
2929   fi
2930 else
2931   echo "configure: failed program was:" >&5
2932   cat conftest.$ac_ext >&5
2933   ac_cv_prog_cc_works=no
2934 fi
2935 rm -fr conftest*
2936 ac_ext=c
2937 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2938 ac_cpp='$CPP $CPPFLAGS'
2939 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2940 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2941 cross_compiling=$ac_cv_prog_cc_cross
2942
2943 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2944 if test $ac_cv_prog_cc_works = no; then
2945   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2946 fi
2947 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2948 echo "configure:2949: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
2949 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2950 cross_compiling=$ac_cv_prog_cc_cross
2951
2952 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2953 echo "configure:2954: checking whether we are using GNU C" >&5
2954 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
2955   echo $ac_n "(cached) $ac_c" 1>&6
2956 else
2957   cat > conftest.c <<EOF
2958 #ifdef __GNUC__
2959   yes;
2960 #endif
2961 EOF
2962 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2963: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2963   ac_cv_prog_gcc=yes
2964 else
2965   ac_cv_prog_gcc=no
2966 fi
2967 fi
2968
2969 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2970
2971 if test $ac_cv_prog_gcc = yes; then
2972   GCC=yes
2973 else
2974   GCC=
2975 fi
2976
2977 ac_test_CFLAGS="${CFLAGS+set}"
2978 ac_save_CFLAGS="$CFLAGS"
2979 CFLAGS=
2980 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2981 echo "configure:2982: checking whether ${CC-cc} accepts -g" >&5
2982 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
2983   echo $ac_n "(cached) $ac_c" 1>&6
2984 else
2985   echo 'void f(){}' > conftest.c
2986 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2987   ac_cv_prog_cc_g=yes
2988 else
2989   ac_cv_prog_cc_g=no
2990 fi
2991 rm -f conftest*
2992
2993 fi
2994
2995 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2996 if test "$ac_test_CFLAGS" = set; then
2997   CFLAGS="$ac_save_CFLAGS"
2998 elif test $ac_cv_prog_cc_g = yes; then
2999   if test "$GCC" = yes; then
3000     CFLAGS="-g -O2"
3001   else
3002     CFLAGS="-g"
3003   fi
3004 else
3005   if test "$GCC" = yes; then
3006     CFLAGS="-O2"
3007   else
3008     CFLAGS=
3009   fi
3010 fi
3011
3012 # Check whether --with-gnu-ld or --without-gnu-ld was given.
3013 if test "${with_gnu_ld+set}" = set; then
3014   withval="$with_gnu_ld"
3015   test "$withval" = no || with_gnu_ld=yes
3016 else
3017   with_gnu_ld=no
3018 fi
3019
3020 ac_prog=ld
3021 if test "$ac_cv_prog_gcc" = yes; then
3022   # Check if gcc -print-prog-name=ld gives a path.
3023   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
3024 echo "configure:3025: checking for ld used by GCC" >&5
3025   ac_prog=`($CC -print-prog-name=ld) 2>&5`
3026   case "$ac_prog" in
3027     # Accept absolute paths.
3028     [\\/]* | [A-Za-z]:[\\/]*)
3029       re_direlt='/[^/][^/]*/\.\./'
3030       # Canonicalize the path of ld
3031       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3032       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3033         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3034       done
3035       test -z "$LD" && LD="$ac_prog"
3036       ;;
3037   "")
3038     # If it fails, then pretend we aren't using GCC.
3039     ac_prog=ld
3040     ;;
3041   *)
3042     # If it is relative, then search for the first ld in PATH.
3043     with_gnu_ld=unknown
3044     ;;
3045   esac
3046 elif test "$with_gnu_ld" = yes; then
3047   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
3048 echo "configure:3049: checking for GNU ld" >&5
3049 else
3050   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
3051 echo "configure:3052: checking for non-GNU ld" >&5
3052 fi
3053 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
3054   echo $ac_n "(cached) $ac_c" 1>&6
3055 else
3056   if test -z "$LD"; then
3057   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3058   for ac_dir in $PATH; do
3059     test -z "$ac_dir" && ac_dir=.
3060     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3061       ac_cv_path_LD="$ac_dir/$ac_prog"
3062       # Check to see if the program is GNU ld.  I'd rather use --version,
3063       # but apparently some GNU ld's only accept -v.
3064       # Break only if it was the GNU/non-GNU ld that we prefer.
3065       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3066         test "$with_gnu_ld" != no && break
3067       else
3068         test "$with_gnu_ld" != yes && break
3069       fi
3070     fi
3071   done
3072   IFS="$ac_save_ifs"
3073 else
3074   ac_cv_path_LD="$LD" # Let the user override the test with a path.
3075 fi
3076 fi
3077
3078 LD="$ac_cv_path_LD"
3079 if test -n "$LD"; then
3080   echo "$ac_t""$LD" 1>&6
3081 else
3082   echo "$ac_t""no" 1>&6
3083 fi
3084 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
3085 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
3086 echo "configure:3087: checking if the linker ($LD) is GNU ld" >&5
3087 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
3088   echo $ac_n "(cached) $ac_c" 1>&6
3089 else
3090   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
3091 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3092   ac_cv_prog_gnu_ld=yes
3093 else
3094   ac_cv_prog_gnu_ld=no
3095 fi
3096 fi
3097
3098 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
3099
3100
3101 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
3102 echo "configure:3103: checking for BSD-compatible nm" >&5
3103 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
3104   echo $ac_n "(cached) $ac_c" 1>&6
3105 else
3106   if test -n "$NM"; then
3107   # Let the user override the test.
3108   ac_cv_path_NM="$NM"
3109 else
3110   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3111   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3112     test -z "$ac_dir" && ac_dir=.
3113     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
3114       # Check to see if the nm accepts a BSD-compat flag.
3115       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3116       #   nm: unknown option "B" ignored
3117       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3118         ac_cv_path_NM="$ac_dir/nm -B"
3119         break
3120       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3121         ac_cv_path_NM="$ac_dir/nm -p"
3122         break
3123       else
3124         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
3125         continue # so that we can try to find one that supports BSD flags
3126       fi
3127     fi
3128   done
3129   IFS="$ac_save_ifs"
3130   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
3131 fi
3132 fi
3133
3134 NM="$ac_cv_path_NM"
3135 echo "$ac_t""$NM" 1>&6
3136
3137 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3138 echo "configure:3139: checking whether ln -s works" >&5
3139 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3140   echo $ac_n "(cached) $ac_c" 1>&6
3141 else
3142   rm -f conftestdata
3143 if ln -s X conftestdata 2>/dev/null
3144 then
3145   rm -f conftestdata
3146   ac_cv_prog_LN_S="ln -s"
3147 else
3148   ac_cv_prog_LN_S=ln
3149 fi
3150 fi
3151 LN_S="$ac_cv_prog_LN_S"
3152 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3153   echo "$ac_t""yes" 1>&6
3154 else
3155   echo "$ac_t""no" 1>&6
3156 fi
3157
3158 if test $host != $build; then
3159   ac_tool_prefix=${host_alias}-
3160 else
3161   ac_tool_prefix=
3162 fi
3163
3164
3165 case "$target" in
3166 NONE) lt_target="$host" ;;
3167 *) lt_target="$target" ;;
3168 esac
3169
3170 # Check for any special flags to pass to ltconfig.
3171 libtool_flags="--cache-file=$cache_file"
3172 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
3173 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
3174 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
3175 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
3176 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
3177 libtool_flags="$libtool_flags --enable-dlopen"
3178 libtool_flags="$libtool_flags --enable-win32-dll"
3179 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
3180 if test "${enable_libtool_lock+set}" = set; then
3181   enableval="$enable_libtool_lock"
3182   :
3183 fi
3184
3185 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
3186 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
3187
3188 # Some flags need to be propagated to the compiler or linker for good
3189 # libtool support.
3190 case "$lt_target" in
3191 *-*-irix6*)
3192   # Find out which ABI we are using.
3193   echo '#line 3194 "configure"' > conftest.$ac_ext
3194   if { (eval echo configure:3195: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3195     case "`/usr/bin/file conftest.o`" in
3196     *32-bit*)
3197       LD="${LD-ld} -32"
3198       ;;
3199     *N32*)
3200       LD="${LD-ld} -n32"
3201       ;;
3202     *64-bit*)
3203       LD="${LD-ld} -64"
3204       ;;
3205     esac
3206   fi
3207   rm -rf conftest*
3208   ;;
3209
3210 *-*-sco3.2v5*)
3211   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
3212   SAVE_CFLAGS="$CFLAGS"
3213   CFLAGS="$CFLAGS -belf"
3214   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
3215 echo "configure:3216: checking whether the C compiler needs -belf" >&5
3216 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
3217   echo $ac_n "(cached) $ac_c" 1>&6
3218 else
3219   cat > conftest.$ac_ext <<EOF
3220 #line 3221 "configure"
3221 #include "confdefs.h"
3222
3223 int main() {
3224
3225 ; return 0; }
3226 EOF
3227 if { (eval echo configure:3228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3228   rm -rf conftest*
3229   lt_cv_cc_needs_belf=yes
3230 else
3231   echo "configure: failed program was:" >&5
3232   cat conftest.$ac_ext >&5
3233   rm -rf conftest*
3234   lt_cv_cc_needs_belf=no
3235 fi
3236 rm -f conftest*
3237 fi
3238
3239 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
3240   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
3241     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
3242     CFLAGS="$SAVE_CFLAGS"
3243   fi
3244   ;;
3245
3246 *-*-cygwin* | *-*-mingw*)
3247   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
3248 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
3249 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3250 echo "configure:3251: checking for $ac_word" >&5
3251 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
3252   echo $ac_n "(cached) $ac_c" 1>&6
3253 else
3254   if test -n "$DLLTOOL"; then
3255   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3256 else
3257   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3258   ac_dummy="$PATH"
3259   for ac_dir in $ac_dummy; do
3260     test -z "$ac_dir" && ac_dir=.
3261     if test -f $ac_dir/$ac_word; then
3262       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
3263       break
3264     fi
3265   done
3266   IFS="$ac_save_ifs"
3267 fi
3268 fi
3269 DLLTOOL="$ac_cv_prog_DLLTOOL"
3270 if test -n "$DLLTOOL"; then
3271   echo "$ac_t""$DLLTOOL" 1>&6
3272 else
3273   echo "$ac_t""no" 1>&6
3274 fi
3275
3276
3277 if test -z "$ac_cv_prog_DLLTOOL"; then
3278 if test -n "$ac_tool_prefix"; then
3279   # Extract the first word of "dlltool", so it can be a program name with args.
3280 set dummy dlltool; ac_word=$2
3281 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3282 echo "configure:3283: checking for $ac_word" >&5
3283 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
3284   echo $ac_n "(cached) $ac_c" 1>&6
3285 else
3286   if test -n "$DLLTOOL"; then
3287   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3288 else
3289   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3290   ac_dummy="$PATH"
3291   for ac_dir in $ac_dummy; do
3292     test -z "$ac_dir" && ac_dir=.
3293     if test -f $ac_dir/$ac_word; then
3294       ac_cv_prog_DLLTOOL="dlltool"
3295       break
3296     fi
3297   done
3298   IFS="$ac_save_ifs"
3299   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
3300 fi
3301 fi
3302 DLLTOOL="$ac_cv_prog_DLLTOOL"
3303 if test -n "$DLLTOOL"; then
3304   echo "$ac_t""$DLLTOOL" 1>&6
3305 else
3306   echo "$ac_t""no" 1>&6
3307 fi
3308
3309 else
3310   DLLTOOL="false"
3311 fi
3312 fi
3313
3314   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
3315 set dummy ${ac_tool_prefix}as; ac_word=$2
3316 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3317 echo "configure:3318: checking for $ac_word" >&5
3318 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3319   echo $ac_n "(cached) $ac_c" 1>&6
3320 else
3321   if test -n "$AS"; then
3322   ac_cv_prog_AS="$AS" # Let the user override the test.
3323 else
3324   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3325   ac_dummy="$PATH"
3326   for ac_dir in $ac_dummy; do
3327     test -z "$ac_dir" && ac_dir=.
3328     if test -f $ac_dir/$ac_word; then
3329       ac_cv_prog_AS="${ac_tool_prefix}as"
3330       break
3331     fi
3332   done
3333   IFS="$ac_save_ifs"
3334 fi
3335 fi
3336 AS="$ac_cv_prog_AS"
3337 if test -n "$AS"; then
3338   echo "$ac_t""$AS" 1>&6
3339 else
3340   echo "$ac_t""no" 1>&6
3341 fi
3342
3343
3344 if test -z "$ac_cv_prog_AS"; then
3345 if test -n "$ac_tool_prefix"; then
3346   # Extract the first word of "as", so it can be a program name with args.
3347 set dummy as; ac_word=$2
3348 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3349 echo "configure:3350: checking for $ac_word" >&5
3350 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3351   echo $ac_n "(cached) $ac_c" 1>&6
3352 else
3353   if test -n "$AS"; then
3354   ac_cv_prog_AS="$AS" # Let the user override the test.
3355 else
3356   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3357   ac_dummy="$PATH"
3358   for ac_dir in $ac_dummy; do
3359     test -z "$ac_dir" && ac_dir=.
3360     if test -f $ac_dir/$ac_word; then
3361       ac_cv_prog_AS="as"
3362       break
3363     fi
3364   done
3365   IFS="$ac_save_ifs"
3366   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
3367 fi
3368 fi
3369 AS="$ac_cv_prog_AS"
3370 if test -n "$AS"; then
3371   echo "$ac_t""$AS" 1>&6
3372 else
3373   echo "$ac_t""no" 1>&6
3374 fi
3375
3376 else
3377   AS="false"
3378 fi
3379 fi
3380
3381   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
3382 set dummy ${ac_tool_prefix}objdump; ac_word=$2
3383 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3384 echo "configure:3385: checking for $ac_word" >&5
3385 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3386   echo $ac_n "(cached) $ac_c" 1>&6
3387 else
3388   if test -n "$OBJDUMP"; then
3389   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3390 else
3391   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3392   ac_dummy="$PATH"
3393   for ac_dir in $ac_dummy; do
3394     test -z "$ac_dir" && ac_dir=.
3395     if test -f $ac_dir/$ac_word; then
3396       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
3397       break
3398     fi
3399   done
3400   IFS="$ac_save_ifs"
3401 fi
3402 fi
3403 OBJDUMP="$ac_cv_prog_OBJDUMP"
3404 if test -n "$OBJDUMP"; then
3405   echo "$ac_t""$OBJDUMP" 1>&6
3406 else
3407   echo "$ac_t""no" 1>&6
3408 fi
3409
3410
3411 if test -z "$ac_cv_prog_OBJDUMP"; then
3412 if test -n "$ac_tool_prefix"; then
3413   # Extract the first word of "objdump", so it can be a program name with args.
3414 set dummy objdump; ac_word=$2
3415 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3416 echo "configure:3417: checking for $ac_word" >&5
3417 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3418   echo $ac_n "(cached) $ac_c" 1>&6
3419 else
3420   if test -n "$OBJDUMP"; then
3421   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3422 else
3423   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3424   ac_dummy="$PATH"
3425   for ac_dir in $ac_dummy; do
3426     test -z "$ac_dir" && ac_dir=.
3427     if test -f $ac_dir/$ac_word; then
3428       ac_cv_prog_OBJDUMP="objdump"
3429       break
3430     fi
3431   done
3432   IFS="$ac_save_ifs"
3433   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
3434 fi
3435 fi
3436 OBJDUMP="$ac_cv_prog_OBJDUMP"
3437 if test -n "$OBJDUMP"; then
3438   echo "$ac_t""$OBJDUMP" 1>&6
3439 else
3440   echo "$ac_t""no" 1>&6
3441 fi
3442
3443 else
3444   OBJDUMP="false"
3445 fi
3446 fi
3447
3448   ;;
3449
3450 esac
3451
3452
3453 # Save cache, so that ltconfig can load it
3454
3455
3456 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
3457 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
3458 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
3459 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
3460 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
3461 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
3462 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
3463 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
3464
3465 # Reload cache, that may have been modified by ltconfig
3466
3467
3468 # This can be used to rebuild libtool when needed
3469 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
3470
3471 # Always use our own libtool.
3472 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3473
3474 # Redirect the config.log output again, so that the ltconfig log is not
3475 # clobbered by the next message.
3476 exec 5>>./config.log
3477
3478
3479 for ac_prog in mawk gawk nawk awk
3480 do
3481 # Extract the first word of "$ac_prog", so it can be a program name with args.
3482 set dummy $ac_prog; ac_word=$2
3483 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3484 echo "configure:3485: checking for $ac_word" >&5
3485 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
3486   echo $ac_n "(cached) $ac_c" 1>&6
3487 else
3488   if test -n "$AWK"; then
3489   ac_cv_prog_AWK="$AWK" # Let the user override the test.
3490 else
3491   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3492   ac_dummy="$PATH"
3493   for ac_dir in $ac_dummy; do
3494     test -z "$ac_dir" && ac_dir=.
3495     if test -f $ac_dir/$ac_word; then
3496       ac_cv_prog_AWK="$ac_prog"
3497       break
3498     fi
3499   done
3500   IFS="$ac_save_ifs"
3501 fi
3502 fi
3503 AWK="$ac_cv_prog_AWK"
3504 if test -n "$AWK"; then
3505   echo "$ac_t""$AWK" 1>&6
3506 else
3507   echo "$ac_t""no" 1>&6
3508 fi
3509
3510 test -n "$AWK" && break
3511 done
3512
3513 # test for ln hardlink support
3514 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
3515 echo "configure:3516: checking whether ln works" >&5
3516 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
3517   echo $ac_n "(cached) $ac_c" 1>&6
3518 else
3519   rm -f conftest.src conftest.dst
3520 echo "conftest" > conftest.src
3521 if ln conftest.src conftest.dst 2>/dev/null
3522 then
3523   ol_cv_prog_LN_H="ln"
3524 else
3525   ol_cv_prog_LN_H="cp"
3526 fi
3527 rm -f conftest.src conftest.dst
3528
3529 fi
3530 LN_H="$ol_cv_prog_LN_H"
3531 if test "$ol_cv_prog_LN_H" = "ln"; then
3532         echo "$ac_t""yes" 1>&6
3533 else
3534         echo "$ac_t""no" 1>&6
3535 fi
3536
3537 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3538 echo "configure:3539: checking whether ln -s works" >&5
3539 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3540   echo $ac_n "(cached) $ac_c" 1>&6
3541 else
3542   rm -f conftestdata
3543 if ln -s X conftestdata 2>/dev/null
3544 then
3545   rm -f conftestdata
3546   ac_cv_prog_LN_S="ln -s"
3547 else
3548   ac_cv_prog_LN_S=ln
3549 fi
3550 fi
3551 LN_S="$ac_cv_prog_LN_S"
3552 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3553   echo "$ac_t""yes" 1>&6
3554 else
3555   echo "$ac_t""no" 1>&6
3556 fi
3557
3558
3559 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
3560         LN_S="$LN_H"
3561 fi
3562
3563 # Extract the first word of "sendmail", so it can be a program name with args.
3564 set dummy sendmail; ac_word=$2
3565 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3566 echo "configure:3567: checking for $ac_word" >&5
3567 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
3568   echo $ac_n "(cached) $ac_c" 1>&6
3569 else
3570   case "$SENDMAIL" in
3571   /*)
3572   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
3573   ;;
3574   ?:/*)
3575   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
3576   ;;
3577   *)
3578   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3579   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
3580   for ac_dir in $ac_dummy; do 
3581     test -z "$ac_dir" && ac_dir=.
3582     if test -f $ac_dir/$ac_word; then
3583       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
3584       break
3585     fi
3586   done
3587   IFS="$ac_save_ifs"
3588   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
3589   ;;
3590 esac
3591 fi
3592 SENDMAIL="$ac_cv_path_SENDMAIL"
3593 if test -n "$SENDMAIL"; then
3594   echo "$ac_t""$SENDMAIL" 1>&6
3595 else
3596   echo "$ac_t""no" 1>&6
3597 fi
3598
3599 # Extract the first word of "vi", so it can be a program name with args.
3600 set dummy vi; ac_word=$2
3601 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3602 echo "configure:3603: checking for $ac_word" >&5
3603 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
3604   echo $ac_n "(cached) $ac_c" 1>&6
3605 else
3606   case "$EDITOR" in
3607   /*)
3608   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
3609   ;;
3610   ?:/*)
3611   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
3612   ;;
3613   *)
3614   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3615   ac_dummy="$PATH:/usr/ucb"
3616   for ac_dir in $ac_dummy; do 
3617     test -z "$ac_dir" && ac_dir=.
3618     if test -f $ac_dir/$ac_word; then
3619       ac_cv_path_EDITOR="$ac_dir/$ac_word"
3620       break
3621     fi
3622   done
3623   IFS="$ac_save_ifs"
3624   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
3625   ;;
3626 esac
3627 fi
3628 EDITOR="$ac_cv_path_EDITOR"
3629 if test -n "$EDITOR"; then
3630   echo "$ac_t""$EDITOR" 1>&6
3631 else
3632   echo "$ac_t""no" 1>&6
3633 fi
3634
3635 # Extract the first word of "finger", so it can be a program name with args.
3636 set dummy finger; ac_word=$2
3637 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3638 echo "configure:3639: checking for $ac_word" >&5
3639 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
3640   echo $ac_n "(cached) $ac_c" 1>&6
3641 else
3642   case "$FINGER" in
3643   /*)
3644   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
3645   ;;
3646   ?:/*)
3647   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
3648   ;;
3649   *)
3650   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3651   ac_dummy="$PATH:/usr/ucb"
3652   for ac_dir in $ac_dummy; do 
3653     test -z "$ac_dir" && ac_dir=.
3654     if test -f $ac_dir/$ac_word; then
3655       ac_cv_path_FINGER="$ac_dir/$ac_word"
3656       break
3657     fi
3658   done
3659   IFS="$ac_save_ifs"
3660   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
3661   ;;
3662 esac
3663 fi
3664 FINGER="$ac_cv_path_FINGER"
3665 if test -n "$FINGER"; then
3666   echo "$ac_t""$FINGER" 1>&6
3667 else
3668   echo "$ac_t""no" 1>&6
3669 fi
3670
3671
3672 ol_link_perl=no
3673 if test $ol_enable_perl != no ; then
3674         # Extract the first word of "perl", so it can be a program name with args.
3675 set dummy perl; ac_word=$2
3676 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3677 echo "configure:3678: checking for $ac_word" >&5
3678 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
3679   echo $ac_n "(cached) $ac_c" 1>&6
3680 else
3681   case "$PERLBIN" in
3682   /*)
3683   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
3684   ;;
3685   ?:/*)
3686   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
3687   ;;
3688   *)
3689   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3690   ac_dummy="$PATH"
3691   for ac_dir in $ac_dummy; do 
3692     test -z "$ac_dir" && ac_dir=.
3693     if test -f $ac_dir/$ac_word; then
3694       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
3695       break
3696     fi
3697   done
3698   IFS="$ac_save_ifs"
3699   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
3700   ;;
3701 esac
3702 fi
3703 PERLBIN="$ac_cv_path_PERLBIN"
3704 if test -n "$PERLBIN"; then
3705   echo "$ac_t""$PERLBIN" 1>&6
3706 else
3707   echo "$ac_t""no" 1>&6
3708 fi
3709
3710
3711         if test "no$PERLBIN" = "no" ; then
3712                 if test $ol_enable_perl = yes ; then
3713                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
3714                 fi
3715
3716         else
3717                 PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
3718                 if test x"$ol_with_perl_module" = "xstatic" ; then
3719                         SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3720                 else
3721                         MOD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3722                 fi
3723                                 ol_link_perl=yes
3724         fi
3725 fi
3726
3727 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3728 echo "configure:3729: checking how to run the C preprocessor" >&5
3729 # On Suns, sometimes $CPP names a directory.
3730 if test -n "$CPP" && test -d "$CPP"; then
3731   CPP=
3732 fi
3733 if test -z "$CPP"; then
3734 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3735   echo $ac_n "(cached) $ac_c" 1>&6
3736 else
3737     # This must be in double quotes, not single quotes, because CPP may get
3738   # substituted into the Makefile and "${CC-cc}" will confuse make.
3739   CPP="${CC-cc} -E"
3740   # On the NeXT, cc -E runs the code through the compiler's parser,
3741   # not just through cpp.
3742   cat > conftest.$ac_ext <<EOF
3743 #line 3744 "configure"
3744 #include "confdefs.h"
3745 #include <assert.h>
3746 Syntax Error
3747 EOF
3748 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3749 { (eval echo configure:3750: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3750 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3751 if test -z "$ac_err"; then
3752   :
3753 else
3754   echo "$ac_err" >&5
3755   echo "configure: failed program was:" >&5
3756   cat conftest.$ac_ext >&5
3757   rm -rf conftest*
3758   CPP="${CC-cc} -E -traditional-cpp"
3759   cat > conftest.$ac_ext <<EOF
3760 #line 3761 "configure"
3761 #include "confdefs.h"
3762 #include <assert.h>
3763 Syntax Error
3764 EOF
3765 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3766 { (eval echo configure:3767: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3767 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3768 if test -z "$ac_err"; then
3769   :
3770 else
3771   echo "$ac_err" >&5
3772   echo "configure: failed program was:" >&5
3773   cat conftest.$ac_ext >&5
3774   rm -rf conftest*
3775   CPP="${CC-cc} -nologo -E"
3776   cat > conftest.$ac_ext <<EOF
3777 #line 3778 "configure"
3778 #include "confdefs.h"
3779 #include <assert.h>
3780 Syntax Error
3781 EOF
3782 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3783 { (eval echo configure:3784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3784 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3785 if test -z "$ac_err"; then
3786   :
3787 else
3788   echo "$ac_err" >&5
3789   echo "configure: failed program was:" >&5
3790   cat conftest.$ac_ext >&5
3791   rm -rf conftest*
3792   CPP=/lib/cpp
3793 fi
3794 rm -f conftest*
3795 fi
3796 rm -f conftest*
3797 fi
3798 rm -f conftest*
3799   ac_cv_prog_CPP="$CPP"
3800 fi
3801   CPP="$ac_cv_prog_CPP"
3802 else
3803   ac_cv_prog_CPP="$CPP"
3804 fi
3805 echo "$ac_t""$CPP" 1>&6
3806
3807
3808 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3809         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3810
3811 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3812         echo "configure: warning: programs compiled here do run here..." 1>&2
3813         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3814
3815 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3816         echo "configure: warning: programs compiled here do not run here..." 1>&2
3817         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3818 fi
3819
3820 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3821 echo "configure:3822: checking for AIX" >&5
3822 cat > conftest.$ac_ext <<EOF
3823 #line 3824 "configure"
3824 #include "confdefs.h"
3825 #ifdef _AIX
3826   yes
3827 #endif
3828
3829 EOF
3830 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3831   egrep "yes" >/dev/null 2>&1; then
3832   rm -rf conftest*
3833   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3834 #define _ALL_SOURCE 1
3835 EOF
3836
3837 else
3838   rm -rf conftest*
3839   echo "$ac_t""no" 1>&6
3840 fi
3841 rm -f conftest*
3842
3843
3844 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3845 echo "configure:3846: checking for POSIXized ISC" >&5
3846 if test -d /etc/conf/kconfig.d &&
3847   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3848 then
3849   echo "$ac_t""yes" 1>&6
3850   ISC=yes # If later tests want to check for ISC.
3851   cat >> confdefs.h <<\EOF
3852 #define _POSIX_SOURCE 1
3853 EOF
3854
3855   if test "$GCC" = yes; then
3856     CC="$CC -posix"
3857   else
3858     CC="$CC -Xp"
3859   fi
3860 else
3861   echo "$ac_t""no" 1>&6
3862   ISC=
3863 fi
3864
3865 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3866 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3867 echo "configure:3868: checking for minix/config.h" >&5
3868 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3869   echo $ac_n "(cached) $ac_c" 1>&6
3870 else
3871   cat > conftest.$ac_ext <<EOF
3872 #line 3873 "configure"
3873 #include "confdefs.h"
3874 #include <minix/config.h>
3875 EOF
3876 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3877 { (eval echo configure:3878: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3878 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3879 if test -z "$ac_err"; then
3880   rm -rf conftest*
3881   eval "ac_cv_header_$ac_safe=yes"
3882 else
3883   echo "$ac_err" >&5
3884   echo "configure: failed program was:" >&5
3885   cat conftest.$ac_ext >&5
3886   rm -rf conftest*
3887   eval "ac_cv_header_$ac_safe=no"
3888 fi
3889 rm -f conftest*
3890 fi
3891 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3892   echo "$ac_t""yes" 1>&6
3893   MINIX=yes
3894 else
3895   echo "$ac_t""no" 1>&6
3896 MINIX=
3897 fi
3898
3899 if test "$MINIX" = yes; then
3900   cat >> confdefs.h <<\EOF
3901 #define _POSIX_SOURCE 1
3902 EOF
3903
3904   cat >> confdefs.h <<\EOF
3905 #define _POSIX_1_SOURCE 2
3906 EOF
3907
3908   cat >> confdefs.h <<\EOF
3909 #define _MINIX 1
3910 EOF
3911
3912 fi
3913
3914
3915 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3916 echo "configure:3917: checking for Cygwin environment" >&5
3917 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
3918   echo $ac_n "(cached) $ac_c" 1>&6
3919 else
3920   cat > conftest.$ac_ext <<EOF
3921 #line 3922 "configure"
3922 #include "confdefs.h"
3923
3924 int main() {
3925
3926 #ifndef __CYGWIN__
3927 #define __CYGWIN__ __CYGWIN32__
3928 #endif
3929 return __CYGWIN__;
3930 ; return 0; }
3931 EOF
3932 if { (eval echo configure:3933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3933   rm -rf conftest*
3934   ac_cv_cygwin=yes
3935 else
3936   echo "configure: failed program was:" >&5
3937   cat conftest.$ac_ext >&5
3938   rm -rf conftest*
3939   ac_cv_cygwin=no
3940 fi
3941 rm -f conftest*
3942 fi
3943
3944 echo "$ac_t""$ac_cv_cygwin" 1>&6
3945 CYGWIN=
3946 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3947 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3948 echo "configure:3949: checking for mingw32 environment" >&5
3949 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
3950   echo $ac_n "(cached) $ac_c" 1>&6
3951 else
3952   cat > conftest.$ac_ext <<EOF
3953 #line 3954 "configure"
3954 #include "confdefs.h"
3955
3956 int main() {
3957 return __MINGW32__;
3958 ; return 0; }
3959 EOF
3960 if { (eval echo configure:3961: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3961   rm -rf conftest*
3962   ac_cv_mingw32=yes
3963 else
3964   echo "configure: failed program was:" >&5
3965   cat conftest.$ac_ext >&5
3966   rm -rf conftest*
3967   ac_cv_mingw32=no
3968 fi
3969 rm -f conftest*
3970 fi
3971
3972 echo "$ac_t""$ac_cv_mingw32" 1>&6
3973 MINGW32=
3974 test "$ac_cv_mingw32" = yes && MINGW32=yes
3975 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
3976 echo "configure:3977: checking for EMX OS/2 environment" >&5
3977 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
3978   echo $ac_n "(cached) $ac_c" 1>&6
3979 else
3980   cat > conftest.$ac_ext <<EOF
3981 #line 3982 "configure"
3982 #include "confdefs.h"
3983
3984 int main() {
3985 return __EMX__;
3986 ; return 0; }
3987 EOF
3988 if { (eval echo configure:3989: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3989   rm -rf conftest*
3990   ac_cv_emxos2=yes
3991 else
3992   echo "configure: failed program was:" >&5
3993   cat conftest.$ac_ext >&5
3994   rm -rf conftest*
3995   ac_cv_emxos2=no
3996 fi
3997 rm -f conftest*
3998 fi
3999
4000 echo "$ac_t""$ac_cv_emxos2" 1>&6
4001 EMXOS2=
4002 test "$ac_cv_emxos2" = yes && EMXOS2=yes
4003
4004
4005
4006 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
4007 echo "configure:4008: checking for executable suffix" >&5
4008 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
4009   echo $ac_n "(cached) $ac_c" 1>&6
4010 else
4011   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
4012   ac_cv_exeext=.exe
4013 else
4014   rm -f conftest*
4015   echo 'int main () { return 0; }' > conftest.$ac_ext
4016   ac_cv_exeext=
4017   if { (eval echo configure:4018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
4018     for file in conftest.*; do
4019       case $file in
4020       *.c | *.C | *.o | *.obj | *.xcoff) ;;
4021       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
4022       esac
4023     done
4024   else
4025     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
4026   fi
4027   rm -f conftest*
4028   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
4029 fi
4030 fi
4031
4032 EXEEXT=""
4033 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
4034 echo "$ac_t""${ac_cv_exeext}" 1>&6
4035 ac_exeext=$EXEEXT
4036
4037 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
4038 echo "configure:4039: checking for object suffix" >&5
4039 if eval "test \"\${ac_cv_objext+set}\" = set"; then
4040   echo $ac_n "(cached) $ac_c" 1>&6
4041 else
4042   rm -f conftest*
4043 echo 'int i = 1;' > conftest.$ac_ext
4044 if { (eval echo configure:4045: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4045   for ac_file in conftest.*; do
4046     case $ac_file in
4047     *.c) ;;
4048     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
4049     esac
4050   done
4051 else
4052   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
4053 fi
4054 rm -f conftest*
4055 fi
4056
4057 echo "$ac_t""$ac_cv_objext" 1>&6
4058 OBJEXT=$ac_cv_objext
4059 ac_objext=$ac_cv_objext
4060
4061
4062 cat >> confdefs.h <<EOF
4063 #define EXEEXT "${EXEEXT}"
4064 EOF
4065
4066
4067 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
4068 echo "configure:4069: checking for be_app in -lbe" >&5
4069 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
4070 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4071   echo $ac_n "(cached) $ac_c" 1>&6
4072 else
4073   ac_save_LIBS="$LIBS"
4074 LIBS="-lbe -lroot -lnet $LIBS"
4075 cat > conftest.$ac_ext <<EOF
4076 #line 4077 "configure"
4077 #include "confdefs.h"
4078 /* Override any gcc2 internal prototype to avoid an error.  */
4079 /* We use char because int might match the return type of a gcc2
4080     builtin and then its argument prototype would still apply.  */
4081 char be_app();
4082
4083 int main() {
4084 be_app()
4085 ; return 0; }
4086 EOF
4087 if { (eval echo configure:4088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4088   rm -rf conftest*
4089   eval "ac_cv_lib_$ac_lib_var=yes"
4090 else
4091   echo "configure: failed program was:" >&5
4092   cat conftest.$ac_ext >&5
4093   rm -rf conftest*
4094   eval "ac_cv_lib_$ac_lib_var=no"
4095 fi
4096 rm -f conftest*
4097 LIBS="$ac_save_LIBS"
4098
4099 fi
4100 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4101   echo "$ac_t""yes" 1>&6
4102   LIBS="$LIBS -lbe -lroot -lnet"
4103 else
4104   echo "$ac_t""no" 1>&6
4105 :
4106 fi
4107
4108
4109
4110
4111
4112 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
4113 echo "configure:4114: checking for ${CC-cc} option to accept ANSI C" >&5
4114 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
4115   echo $ac_n "(cached) $ac_c" 1>&6
4116 else
4117   am_cv_prog_cc_stdc=no
4118 ac_save_CC="$CC"
4119 # Don't try gcc -ansi; that turns off useful extensions and
4120 # breaks some systems' header files.
4121 # AIX                   -qlanglvl=ansi
4122 # Ultrix and OSF/1      -std1
4123 # HP-UX 10.20 and later -Ae
4124 # HP-UX older versions  -Aa -D_HPUX_SOURCE
4125 # SVR4                  -Xc -D__EXTENSIONS__
4126 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4127 do
4128   CC="$ac_save_CC $ac_arg"
4129   cat > conftest.$ac_ext <<EOF
4130 #line 4131 "configure"
4131 #include "confdefs.h"
4132 #include <stdarg.h>
4133 #include <stdio.h>
4134 #include <sys/types.h>
4135 #include <sys/stat.h>
4136 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
4137 struct buf { int x; };
4138 FILE * (*rcsopen) (struct buf *, struct stat *, int);
4139 static char *e (p, i)
4140      char **p;
4141      int i;
4142 {
4143   return p[i];
4144 }
4145 static char *f (char * (*g) (char **, int), char **p, ...)
4146 {
4147   char *s;
4148   va_list v;
4149   va_start (v,p);
4150   s = g (p, va_arg (v,int));
4151   va_end (v);
4152   return s;
4153 }
4154 int test (int i, double x);
4155 struct s1 {int (*f) (int a);};
4156 struct s2 {int (*f) (double a);};
4157 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4158 int argc;
4159 char **argv;
4160
4161 int main() {
4162
4163 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
4164
4165 ; return 0; }
4166 EOF
4167 if { (eval echo configure:4168: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4168   rm -rf conftest*
4169   am_cv_prog_cc_stdc="$ac_arg"; break
4170 else
4171   echo "configure: failed program was:" >&5
4172   cat conftest.$ac_ext >&5
4173 fi
4174 rm -f conftest*
4175 done
4176 CC="$ac_save_CC"
4177
4178 fi
4179
4180 if test -z "$am_cv_prog_cc_stdc"; then
4181   echo "$ac_t""none needed" 1>&6
4182 else
4183   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
4184 fi
4185 case "x$am_cv_prog_cc_stdc" in
4186   x|xno) ;;
4187   *) CC="$CC $am_cv_prog_cc_stdc" ;;
4188 esac
4189
4190 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
4191         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
4192 fi
4193
4194 # test for make depend flag
4195 OL_MKDEP=
4196 OL_MKDEP_FLAGS=
4197 if test -z "${MKDEP}"; then
4198         OL_MKDEP="${CC-cc}"
4199         if test -z "${MKDEP_FLAGS}"; then
4200                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
4201 echo "configure:4202: checking for ${OL_MKDEP} depend flag" >&5
4202 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
4203   echo $ac_n "(cached) $ac_c" 1>&6
4204 else
4205   
4206                         ol_cv_mkdep=no
4207                         for flag in "-M" "-xM"; do
4208                                 cat > conftest.c <<EOF
4209  noCode;
4210 EOF
4211                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:4212: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
4212                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
4213                                 then
4214                                         if test ! -f conftest."${ac_object}" ; then
4215                                                 ol_cv_mkdep=$flag
4216                                                 OL_MKDEP_FLAGS="$flag"
4217                                                 break
4218                                         fi
4219                                 fi
4220                         done
4221                         rm -f conftest*
4222                 
4223 fi
4224
4225 echo "$ac_t""$ol_cv_mkdep" 1>&6
4226         else
4227                 cc_cv_mkdep=yes
4228                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
4229         fi
4230 else
4231         cc_cv_mkdep=yes
4232         OL_MKDEP="${MKDEP}"
4233         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
4234 fi
4235
4236
4237
4238 if test "${ol_cv_mkdep}" = no ; then
4239         # this will soon become an error
4240         echo "configure: warning: do not know how to generate dependencies" 1>&2
4241 fi
4242
4243 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
4244 echo "configure:4245: checking for afopen in -ls" >&5
4245 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
4246 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4247   echo $ac_n "(cached) $ac_c" 1>&6
4248 else
4249   ac_save_LIBS="$LIBS"
4250 LIBS="-ls  $LIBS"
4251 cat > conftest.$ac_ext <<EOF
4252 #line 4253 "configure"
4253 #include "confdefs.h"
4254 /* Override any gcc2 internal prototype to avoid an error.  */
4255 /* We use char because int might match the return type of a gcc2
4256     builtin and then its argument prototype would still apply.  */
4257 char afopen();
4258
4259 int main() {
4260 afopen()
4261 ; return 0; }
4262 EOF
4263 if { (eval echo configure:4264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4264   rm -rf conftest*
4265   eval "ac_cv_lib_$ac_lib_var=yes"
4266 else
4267   echo "configure: failed program was:" >&5
4268   cat conftest.$ac_ext >&5
4269   rm -rf conftest*
4270   eval "ac_cv_lib_$ac_lib_var=no"
4271 fi
4272 rm -f conftest*
4273 LIBS="$ac_save_LIBS"
4274
4275 fi
4276 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4277   echo "$ac_t""yes" 1>&6
4278   
4279         AUTH_LIBS=-ls
4280         cat >> confdefs.h <<\EOF
4281 #define HAVE_AIX_SECURITY 1
4282 EOF
4283
4284
4285 else
4286   echo "$ac_t""no" 1>&6
4287 fi
4288
4289
4290
4291 ol_link_modules=no
4292 if test $ol_enable_modules != no ; then
4293         for ac_hdr in ltdl.h
4294 do
4295 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4296 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4297 echo "configure:4298: checking for $ac_hdr" >&5
4298 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4299   echo $ac_n "(cached) $ac_c" 1>&6
4300 else
4301   cat > conftest.$ac_ext <<EOF
4302 #line 4303 "configure"
4303 #include "confdefs.h"
4304 #include <$ac_hdr>
4305 EOF
4306 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4307 { (eval echo configure:4308: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4308 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4309 if test -z "$ac_err"; then
4310   rm -rf conftest*
4311   eval "ac_cv_header_$ac_safe=yes"
4312 else
4313   echo "$ac_err" >&5
4314   echo "configure: failed program was:" >&5
4315   cat conftest.$ac_ext >&5
4316   rm -rf conftest*
4317   eval "ac_cv_header_$ac_safe=no"
4318 fi
4319 rm -f conftest*
4320 fi
4321 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4322   echo "$ac_t""yes" 1>&6
4323     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4324   cat >> confdefs.h <<EOF
4325 #define $ac_tr_hdr 1
4326 EOF
4327  
4328 else
4329   echo "$ac_t""no" 1>&6
4330 fi
4331 done
4332
4333
4334         if test $ac_cv_header_ltdl_h = no ; then
4335                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
4336         fi
4337
4338         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
4339 echo "configure:4340: checking for lt_dlinit in -lltdl" >&5
4340 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
4341 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4342   echo $ac_n "(cached) $ac_c" 1>&6
4343 else
4344   ac_save_LIBS="$LIBS"
4345 LIBS="-lltdl  $LIBS"
4346 cat > conftest.$ac_ext <<EOF
4347 #line 4348 "configure"
4348 #include "confdefs.h"
4349 /* Override any gcc2 internal prototype to avoid an error.  */
4350 /* We use char because int might match the return type of a gcc2
4351     builtin and then its argument prototype would still apply.  */
4352 char lt_dlinit();
4353
4354 int main() {
4355 lt_dlinit()
4356 ; return 0; }
4357 EOF
4358 if { (eval echo configure:4359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4359   rm -rf conftest*
4360   eval "ac_cv_lib_$ac_lib_var=yes"
4361 else
4362   echo "configure: failed program was:" >&5
4363   cat conftest.$ac_ext >&5
4364   rm -rf conftest*
4365   eval "ac_cv_lib_$ac_lib_var=no"
4366 fi
4367 rm -f conftest*
4368 LIBS="$ac_save_LIBS"
4369
4370 fi
4371 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4372   echo "$ac_t""yes" 1>&6
4373   
4374             MODULES_LIBS=-lltdl
4375             cat >> confdefs.h <<\EOF
4376 #define HAVE_LIBLTDL 1
4377 EOF
4378
4379         
4380 else
4381   echo "$ac_t""no" 1>&6
4382 fi
4383
4384
4385         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
4386                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
4387         fi
4388         ol_link_modules=yes
4389 else
4390         ol_with_bdb_module=static
4391         ol_with_dnssrv_module=static
4392         ol_with_ldap_module=static
4393         ol_with_ldbm_module=static
4394         ol_with_meta_module=static
4395         ol_with_passwd_module=static
4396         ol_with_perl_module=static
4397         ol_with_shell_module=static
4398         ol_with_tcl_module=static
4399         ol_with_sql_module=static
4400 fi
4401
4402 # test for EBCDIC
4403 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
4404 echo "configure:4405: checking for EBCDIC" >&5
4405 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
4406   echo $ac_n "(cached) $ac_c" 1>&6
4407 else
4408   
4409         cat > conftest.$ac_ext <<EOF
4410 #line 4411 "configure"
4411 #include "confdefs.h"
4412
4413 #if !('M' == 0xd4)
4414 #include <__ASCII__/generate_error.h>
4415 #endif
4416
4417 EOF
4418 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4419 { (eval echo configure:4420: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4420 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4421 if test -z "$ac_err"; then
4422   rm -rf conftest*
4423   ol_cv_cpp_ebcdic=yes
4424 else
4425   echo "$ac_err" >&5
4426   echo "configure: failed program was:" >&5
4427   cat conftest.$ac_ext >&5
4428   rm -rf conftest*
4429   ol_cv_cpp_ebcdic=no
4430 fi
4431 rm -f conftest*
4432 fi
4433
4434 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
4435 if test $ol_cv_cpp_ebcdic = yes ; then
4436         cat >> confdefs.h <<\EOF
4437 #define HAVE_EBCDIC 1
4438 EOF
4439
4440 fi
4441
4442 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
4443 echo "configure:4444: checking for ANSI C header files" >&5
4444 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
4445   echo $ac_n "(cached) $ac_c" 1>&6
4446 else
4447   cat > conftest.$ac_ext <<EOF
4448 #line 4449 "configure"
4449 #include "confdefs.h"
4450 #include <stdlib.h>
4451 #include <stdarg.h>
4452 #include <string.h>
4453 #include <float.h>
4454 EOF
4455 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4456 { (eval echo configure:4457: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4457 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4458 if test -z "$ac_err"; then
4459   rm -rf conftest*
4460   ol_cv_header_stdc=yes
4461 else
4462   echo "$ac_err" >&5
4463   echo "configure: failed program was:" >&5
4464   cat conftest.$ac_ext >&5
4465   rm -rf conftest*
4466   ol_cv_header_stdc=no
4467 fi
4468 rm -f conftest*
4469
4470 if test $ol_cv_header_stdc = yes; then
4471   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4472 cat > conftest.$ac_ext <<EOF
4473 #line 4474 "configure"
4474 #include "confdefs.h"
4475 #include <string.h>
4476 EOF
4477 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4478   egrep "memchr" >/dev/null 2>&1; then
4479   :
4480 else
4481   rm -rf conftest*
4482   ol_cv_header_stdc=no
4483 fi
4484 rm -f conftest*
4485
4486 fi
4487
4488 if test $ol_cv_header_stdc = yes; then
4489   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4490 cat > conftest.$ac_ext <<EOF
4491 #line 4492 "configure"
4492 #include "confdefs.h"
4493 #include <stdlib.h>
4494 EOF
4495 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4496   egrep "free" >/dev/null 2>&1; then
4497   :
4498 else
4499   rm -rf conftest*
4500   ol_cv_header_stdc=no
4501 fi
4502 rm -f conftest*
4503
4504 fi
4505
4506 if test $ol_cv_header_stdc = yes; then
4507   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4508 if test "$cross_compiling" = yes; then
4509   :
4510 else
4511   cat > conftest.$ac_ext <<EOF
4512 #line 4513 "configure"
4513 #include "confdefs.h"
4514 #include <ctype.h>
4515 #ifndef HAVE_EBCDIC
4516 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4517 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4518 #else
4519 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4520                 || ('j' <= (c) && (c) <= 'r') \
4521                 || ('s' <= (c) && (c) <= 'z'))
4522 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
4523 #endif
4524 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4525 int main () { int i; for (i = 0; i < 256; i++)
4526 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4527 exit (0); }
4528
4529 EOF
4530 if { (eval echo configure:4531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4531 then
4532   :
4533 else
4534   echo "configure: failed program was:" >&5
4535   cat conftest.$ac_ext >&5
4536   rm -fr conftest*
4537   ol_cv_header_stdc=no
4538 fi
4539 rm -fr conftest*
4540 fi
4541
4542 fi
4543 fi
4544
4545 echo "$ac_t""$ol_cv_header_stdc" 1>&6
4546 if test $ol_cv_header_stdc = yes; then
4547   cat >> confdefs.h <<\EOF
4548 #define STDC_HEADERS 1
4549 EOF
4550
4551 fi
4552 ac_cv_header_stdc=disable
4553
4554
4555 if test $ol_cv_header_stdc != yes; then
4556         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
4557 fi
4558
4559 ac_header_dirent=no
4560 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4561 do
4562 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4563 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4564 echo "configure:4565: checking for $ac_hdr that defines DIR" >&5
4565 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
4566   echo $ac_n "(cached) $ac_c" 1>&6
4567 else
4568   cat > conftest.$ac_ext <<EOF
4569 #line 4570 "configure"
4570 #include "confdefs.h"
4571 #include <sys/types.h>
4572 #include <$ac_hdr>
4573 int main() {
4574 DIR *dirp = 0;
4575 ; return 0; }
4576 EOF
4577 if { (eval echo configure:4578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4578   rm -rf conftest*
4579   eval "ac_cv_header_dirent_$ac_safe=yes"
4580 else
4581   echo "configure: failed program was:" >&5
4582   cat conftest.$ac_ext >&5
4583   rm -rf conftest*
4584   eval "ac_cv_header_dirent_$ac_safe=no"
4585 fi
4586 rm -f conftest*
4587 fi
4588 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4589   echo "$ac_t""yes" 1>&6
4590     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4591   cat >> confdefs.h <<EOF
4592 #define $ac_tr_hdr 1
4593 EOF
4594  ac_header_dirent=$ac_hdr; break
4595 else
4596   echo "$ac_t""no" 1>&6
4597 fi
4598 done
4599 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4600 if test $ac_header_dirent = dirent.h; then
4601 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4602 echo "configure:4603: checking for opendir in -ldir" >&5
4603 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
4604 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4605   echo $ac_n "(cached) $ac_c" 1>&6
4606 else
4607   ac_save_LIBS="$LIBS"
4608 LIBS="-ldir  $LIBS"
4609 cat > conftest.$ac_ext <<EOF
4610 #line 4611 "configure"
4611 #include "confdefs.h"
4612 /* Override any gcc2 internal prototype to avoid an error.  */
4613 /* We use char because int might match the return type of a gcc2
4614     builtin and then its argument prototype would still apply.  */
4615 char opendir();
4616
4617 int main() {
4618 opendir()
4619 ; return 0; }
4620 EOF
4621 if { (eval echo configure:4622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4622   rm -rf conftest*
4623   eval "ac_cv_lib_$ac_lib_var=yes"
4624 else
4625   echo "configure: failed program was:" >&5
4626   cat conftest.$ac_ext >&5
4627   rm -rf conftest*
4628   eval "ac_cv_lib_$ac_lib_var=no"
4629 fi
4630 rm -f conftest*
4631 LIBS="$ac_save_LIBS"
4632
4633 fi
4634 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4635   echo "$ac_t""yes" 1>&6
4636   LIBS="$LIBS -ldir"
4637 else
4638   echo "$ac_t""no" 1>&6
4639 fi
4640
4641 else
4642 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4643 echo "configure:4644: checking for opendir in -lx" >&5
4644 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
4645 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4646   echo $ac_n "(cached) $ac_c" 1>&6
4647 else
4648   ac_save_LIBS="$LIBS"
4649 LIBS="-lx  $LIBS"
4650 cat > conftest.$ac_ext <<EOF
4651 #line 4652 "configure"
4652 #include "confdefs.h"
4653 /* Override any gcc2 internal prototype to avoid an error.  */
4654 /* We use char because int might match the return type of a gcc2
4655     builtin and then its argument prototype would still apply.  */
4656 char opendir();
4657
4658 int main() {
4659 opendir()
4660 ; return 0; }
4661 EOF
4662 if { (eval echo configure:4663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4663   rm -rf conftest*
4664   eval "ac_cv_lib_$ac_lib_var=yes"
4665 else
4666   echo "configure: failed program was:" >&5
4667   cat conftest.$ac_ext >&5
4668   rm -rf conftest*
4669   eval "ac_cv_lib_$ac_lib_var=no"
4670 fi
4671 rm -f conftest*
4672 LIBS="$ac_save_LIBS"
4673
4674 fi
4675 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4676   echo "$ac_t""yes" 1>&6
4677   LIBS="$LIBS -lx"
4678 else
4679   echo "$ac_t""no" 1>&6
4680 fi
4681
4682 fi
4683
4684 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4685 echo "configure:4686: checking for sys/wait.h that is POSIX.1 compatible" >&5
4686 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
4687   echo $ac_n "(cached) $ac_c" 1>&6
4688 else
4689   cat > conftest.$ac_ext <<EOF
4690 #line 4691 "configure"
4691 #include "confdefs.h"
4692 #include <sys/types.h>
4693 #include <sys/wait.h>
4694 #ifndef WEXITSTATUS
4695 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4696 #endif
4697 #ifndef WIFEXITED
4698 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4699 #endif
4700 int main() {
4701 int s;
4702 wait (&s);
4703 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4704 ; return 0; }
4705 EOF
4706 if { (eval echo configure:4707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4707   rm -rf conftest*
4708   ac_cv_header_sys_wait_h=yes
4709 else
4710   echo "configure: failed program was:" >&5
4711   cat conftest.$ac_ext >&5
4712   rm -rf conftest*
4713   ac_cv_header_sys_wait_h=no
4714 fi
4715 rm -f conftest*
4716 fi
4717
4718 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4719 if test $ac_cv_header_sys_wait_h = yes; then
4720   cat >> confdefs.h <<\EOF
4721 #define HAVE_SYS_WAIT_H 1
4722 EOF
4723
4724 fi
4725
4726 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4727 echo "configure:4728: checking POSIX termios" >&5
4728 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
4729   echo $ac_n "(cached) $ac_c" 1>&6
4730 else
4731   cat > conftest.$ac_ext <<EOF
4732 #line 4733 "configure"
4733 #include "confdefs.h"
4734 #include <sys/types.h>
4735 #include <unistd.h>
4736 #include <termios.h>
4737 int main() {
4738 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4739    tcgetattr(0, 0);
4740 ; return 0; }
4741 EOF
4742 if { (eval echo configure:4743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4743   rm -rf conftest*
4744   am_cv_sys_posix_termios=yes
4745 else
4746   echo "configure: failed program was:" >&5
4747   cat conftest.$ac_ext >&5
4748   rm -rf conftest*
4749   am_cv_sys_posix_termios=no
4750 fi
4751 rm -f conftest*
4752 fi
4753
4754 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4755
4756
4757  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4758 echo "configure:4759: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4759 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
4760   echo $ac_n "(cached) $ac_c" 1>&6
4761 else
4762   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4763
4764   gwinsz_in_termios_h=no
4765   if test $am_cv_sys_posix_termios = yes; then
4766     cat > conftest.$ac_ext <<EOF
4767 #line 4768 "configure"
4768 #include "confdefs.h"
4769 #include <sys/types.h>
4770 #     include <termios.h>
4771 #     ifdef TIOCGWINSZ
4772         yes
4773 #     endif
4774     
4775 EOF
4776 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4777   egrep "yes" >/dev/null 2>&1; then
4778   rm -rf conftest*
4779   gwinsz_in_termios_h=yes
4780 fi
4781 rm -f conftest*
4782
4783   fi
4784
4785   if test $gwinsz_in_termios_h = no; then
4786     cat > conftest.$ac_ext <<EOF
4787 #line 4788 "configure"
4788 #include "confdefs.h"
4789 #include <sys/types.h>
4790 #     include <sys/ioctl.h>
4791 #     ifdef TIOCGWINSZ
4792         yes
4793 #     endif
4794     
4795 EOF
4796 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4797   egrep "yes" >/dev/null 2>&1; then
4798   rm -rf conftest*
4799   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4800 fi
4801 rm -f conftest*
4802
4803   fi
4804   
4805 fi
4806
4807 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4808   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4809     cat >> confdefs.h <<\EOF
4810 #define GWINSZ_IN_SYS_IOCTL 1
4811 EOF
4812
4813   fi
4814
4815 if test $am_cv_sys_posix_termios = yes ; then
4816         cat >> confdefs.h <<\EOF
4817 #define HAVE_POSIX_TERMIOS 1
4818 EOF
4819
4820 fi
4821
4822 for ac_hdr in \
4823         arpa/inet.h             \
4824         arpa/nameser.h  \
4825         assert.h                \
4826         conio.h                 \
4827         crypt.h                 \
4828         direct.h                \
4829         errno.h                 \
4830         fcntl.h                 \
4831         filio.h                 \
4832         getopt.h                \
4833         grp.h                   \
4834         io.h                    \
4835         libutil.h               \
4836         limits.h                \
4837         locale.h                \
4838         netinet/tcp.h   \
4839         malloc.h                \
4840         memory.h                \
4841         psap.h                  \
4842         pwd.h                   \
4843         process.h               \
4844         resolv.h                \
4845         sgtty.h                 \
4846         shadow.h                \
4847         stddef.h                \
4848         string.h                \
4849         strings.h               \
4850         sysexits.h              \
4851         sys/file.h              \
4852         sys/filio.h             \
4853         sys/errno.h             \
4854         sys/ioctl.h             \
4855         sys/param.h             \
4856         sys/resource.h  \
4857         sys/select.h    \
4858         sys/socket.h    \
4859         sys/syslog.h    \
4860         sys/time.h              \
4861         sys/types.h             \
4862         syslog.h                \
4863         termios.h               \
4864         unistd.h                \
4865         winsock.h               \
4866
4867 do
4868 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4869 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4870 echo "configure:4871: checking for $ac_hdr" >&5
4871 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4872   echo $ac_n "(cached) $ac_c" 1>&6
4873 else
4874   cat > conftest.$ac_ext <<EOF
4875 #line 4876 "configure"
4876 #include "confdefs.h"
4877 #include <$ac_hdr>
4878 EOF
4879 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4880 { (eval echo configure:4881: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4881 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4882 if test -z "$ac_err"; then
4883   rm -rf conftest*
4884   eval "ac_cv_header_$ac_safe=yes"
4885 else
4886   echo "$ac_err" >&5
4887   echo "configure: failed program was:" >&5
4888   cat conftest.$ac_ext >&5
4889   rm -rf conftest*
4890   eval "ac_cv_header_$ac_safe=no"
4891 fi
4892 rm -f conftest*
4893 fi
4894 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4895   echo "$ac_t""yes" 1>&6
4896     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4897   cat >> confdefs.h <<EOF
4898 #define $ac_tr_hdr 1
4899 EOF
4900  
4901 else
4902   echo "$ac_t""no" 1>&6
4903 fi
4904 done
4905
4906
4907
4908
4909 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
4910 echo "configure:4911: checking for dlopen" >&5
4911 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
4912   echo $ac_n "(cached) $ac_c" 1>&6
4913 else
4914   cat > conftest.$ac_ext <<EOF
4915 #line 4916 "configure"
4916 #include "confdefs.h"
4917 /* System header to define __stub macros and hopefully few prototypes,
4918     which can conflict with char dlopen(); below.  */
4919 #include <assert.h>
4920 /* Override any gcc2 internal prototype to avoid an error.  */
4921 /* We use char because int might match the return type of a gcc2
4922     builtin and then its argument prototype would still apply.  */
4923 char dlopen();
4924 char (*f)();
4925
4926 int main() {
4927
4928 /* The GNU C library defines this for functions which it implements
4929     to always fail with ENOSYS.  Some functions are actually named
4930     something starting with __ and the normal name is an alias.  */
4931 #if defined (__stub_dlopen) || defined (__stub___dlopen)
4932 choke me
4933 #else
4934 f = dlopen;
4935 #endif
4936
4937 ; return 0; }
4938 EOF
4939 if { (eval echo configure:4940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4940   rm -rf conftest*
4941   eval "ac_cv_func_dlopen=yes"
4942 else
4943   echo "configure: failed program was:" >&5
4944   cat conftest.$ac_ext >&5
4945   rm -rf conftest*
4946   eval "ac_cv_func_dlopen=no"
4947 fi
4948 rm -f conftest*
4949 fi
4950
4951 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
4952   echo "$ac_t""yes" 1>&6
4953   :
4954 else
4955   echo "$ac_t""no" 1>&6
4956 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
4957 echo "configure:4958: checking for dlopen in -ldl" >&5
4958 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
4959 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4960   echo $ac_n "(cached) $ac_c" 1>&6
4961 else
4962   ac_save_LIBS="$LIBS"
4963 LIBS="-ldl  $LIBS"
4964 cat > conftest.$ac_ext <<EOF
4965 #line 4966 "configure"
4966 #include "confdefs.h"
4967 /* Override any gcc2 internal prototype to avoid an error.  */
4968 /* We use char because int might match the return type of a gcc2
4969     builtin and then its argument prototype would still apply.  */
4970 char dlopen();
4971
4972 int main() {
4973 dlopen()
4974 ; return 0; }
4975 EOF
4976 if { (eval echo configure:4977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4977   rm -rf conftest*
4978   eval "ac_cv_lib_$ac_lib_var=yes"
4979 else
4980   echo "configure: failed program was:" >&5
4981   cat conftest.$ac_ext >&5
4982   rm -rf conftest*
4983   eval "ac_cv_lib_$ac_lib_var=no"
4984 fi
4985 rm -f conftest*
4986 LIBS="$ac_save_LIBS"
4987
4988 fi
4989 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4990   echo "$ac_t""yes" 1>&6
4991     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4992     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4993   cat >> confdefs.h <<EOF
4994 #define $ac_tr_lib 1
4995 EOF
4996
4997   LIBS="-ldl $LIBS"
4998
4999 else
5000   echo "$ac_t""no" 1>&6
5001 fi
5002
5003 fi
5004
5005
5006 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
5007 echo "configure:5008: checking for sigset in -lV3" >&5
5008 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
5009 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5010   echo $ac_n "(cached) $ac_c" 1>&6
5011 else
5012   ac_save_LIBS="$LIBS"
5013 LIBS="-lV3  $LIBS"
5014 cat > conftest.$ac_ext <<EOF
5015 #line 5016 "configure"
5016 #include "confdefs.h"
5017 /* Override any gcc2 internal prototype to avoid an error.  */
5018 /* We use char because int might match the return type of a gcc2
5019     builtin and then its argument prototype would still apply.  */
5020 char sigset();
5021
5022 int main() {
5023 sigset()
5024 ; return 0; }
5025 EOF
5026 if { (eval echo configure:5027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5027   rm -rf conftest*
5028   eval "ac_cv_lib_$ac_lib_var=yes"
5029 else
5030   echo "configure: failed program was:" >&5
5031   cat conftest.$ac_ext >&5
5032   rm -rf conftest*
5033   eval "ac_cv_lib_$ac_lib_var=no"
5034 fi
5035 rm -f conftest*
5036 LIBS="$ac_save_LIBS"
5037
5038 fi
5039 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5040   echo "$ac_t""yes" 1>&6
5041     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5042     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5043   cat >> confdefs.h <<EOF
5044 #define $ac_tr_lib 1
5045 EOF
5046
5047   LIBS="-lV3 $LIBS"
5048
5049 else
5050   echo "$ac_t""no" 1>&6
5051 fi
5052
5053
5054 if test $ac_cv_header_winsock_h = yes; then
5055         echo $ac_n "checking for winsock""... $ac_c" 1>&6
5056 echo "configure:5057: checking for winsock" >&5
5057 if eval "test \"\${ol_cv_winsock+set}\" = set"; then
5058   echo $ac_n "(cached) $ac_c" 1>&6
5059 else
5060   cat > conftest.$ac_ext <<EOF
5061 #line 5062 "configure"
5062 #include "confdefs.h"
5063 #include <winsock.h>
5064 int main() {
5065
5066                         socket(0,0,0);
5067                         select(0,NULL,NULL,NULL,NULL);
5068                         closesocket(0);
5069                         gethostname(NULL,0);
5070         
5071 ; return 0; }
5072 EOF
5073 if { (eval echo configure:5074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5074   rm -rf conftest*
5075   ol_cv_winsock=yes
5076 else
5077   echo "configure: failed program was:" >&5
5078   cat conftest.$ac_ext >&5
5079   rm -rf conftest*
5080   ol_cv_winsock=no
5081 fi
5082 rm -f conftest*]
5083 fi
5084
5085 echo "$ac_t""$ol_cv_winsock" 1>&6
5086
5087         if test $ol_cv_winsock = yes ; then
5088                 cat >> confdefs.h <<\EOF
5089 #define HAVE_WINSOCK 1
5090 EOF
5091
5092                 ac_cv_func_socket=yes
5093                 ac_cv_func_select=yes
5094                 ac_cv_func_closesocket=yes
5095                 ac_cv_func_gethostname=yes
5096         fi
5097 fi
5098
5099
5100 echo $ac_n "checking for socket""... $ac_c" 1>&6
5101 echo "configure:5102: checking for socket" >&5
5102 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
5103   echo $ac_n "(cached) $ac_c" 1>&6
5104 else
5105   cat > conftest.$ac_ext <<EOF
5106 #line 5107 "configure"
5107 #include "confdefs.h"
5108 /* System header to define __stub macros and hopefully few prototypes,
5109     which can conflict with char socket(); below.  */
5110 #include <assert.h>
5111 /* Override any gcc2 internal prototype to avoid an error.  */
5112 /* We use char because int might match the return type of a gcc2
5113     builtin and then its argument prototype would still apply.  */
5114 char socket();
5115 char (*f)();
5116
5117 int main() {
5118
5119 /* The GNU C library defines this for functions which it implements
5120     to always fail with ENOSYS.  Some functions are actually named
5121     something starting with __ and the normal name is an alias.  */
5122 #if defined (__stub_socket) || defined (__stub___socket)
5123 choke me
5124 #else
5125 f = socket;
5126 #endif
5127
5128 ; return 0; }
5129 EOF
5130 if { (eval echo configure:5131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5131   rm -rf conftest*
5132   eval "ac_cv_func_socket=yes"
5133 else
5134   echo "configure: failed program was:" >&5
5135   cat conftest.$ac_ext >&5
5136   rm -rf conftest*
5137   eval "ac_cv_func_socket=no"
5138 fi
5139 rm -f conftest*
5140 fi
5141
5142 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
5143   echo "$ac_t""yes" 1>&6
5144   :
5145 else
5146   echo "$ac_t""no" 1>&6
5147         
5148         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
5149 echo "configure:5150: checking for main in -lsocket" >&5
5150 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
5151 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5152   echo $ac_n "(cached) $ac_c" 1>&6
5153 else
5154   ac_save_LIBS="$LIBS"
5155 LIBS="-lsocket  $LIBS"
5156 cat > conftest.$ac_ext <<EOF
5157 #line 5158 "configure"
5158 #include "confdefs.h"
5159
5160 int main() {
5161 main()
5162 ; return 0; }
5163 EOF
5164 if { (eval echo configure:5165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5165   rm -rf conftest*
5166   eval "ac_cv_lib_$ac_lib_var=yes"
5167 else
5168   echo "configure: failed program was:" >&5
5169   cat conftest.$ac_ext >&5
5170   rm -rf conftest*
5171   eval "ac_cv_lib_$ac_lib_var=no"
5172 fi
5173 rm -f conftest*
5174 LIBS="$ac_save_LIBS"
5175
5176 fi
5177 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5178   echo "$ac_t""yes" 1>&6
5179     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5180     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5181   cat >> confdefs.h <<EOF
5182 #define $ac_tr_lib 1
5183 EOF
5184
5185   LIBS="-lsocket $LIBS"
5186
5187 else
5188   echo "$ac_t""no" 1>&6
5189 fi
5190
5191         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
5192 echo "configure:5193: checking for main in -lnet" >&5
5193 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
5194 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5195   echo $ac_n "(cached) $ac_c" 1>&6
5196 else
5197   ac_save_LIBS="$LIBS"
5198 LIBS="-lnet  $LIBS"
5199 cat > conftest.$ac_ext <<EOF
5200 #line 5201 "configure"
5201 #include "confdefs.h"
5202
5203 int main() {
5204 main()
5205 ; return 0; }
5206 EOF
5207 if { (eval echo configure:5208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5208   rm -rf conftest*
5209   eval "ac_cv_lib_$ac_lib_var=yes"
5210 else
5211   echo "configure: failed program was:" >&5
5212   cat conftest.$ac_ext >&5
5213   rm -rf conftest*
5214   eval "ac_cv_lib_$ac_lib_var=no"
5215 fi
5216 rm -f conftest*
5217 LIBS="$ac_save_LIBS"
5218
5219 fi
5220 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5221   echo "$ac_t""yes" 1>&6
5222     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5223     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5224   cat >> confdefs.h <<EOF
5225 #define $ac_tr_lib 1
5226 EOF
5227
5228   LIBS="-lnet $LIBS"
5229
5230 else
5231   echo "$ac_t""no" 1>&6
5232 fi
5233
5234         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
5235 echo "configure:5236: checking for main in -lnsl_s" >&5
5236 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
5237 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5238   echo $ac_n "(cached) $ac_c" 1>&6
5239 else
5240   ac_save_LIBS="$LIBS"
5241 LIBS="-lnsl_s  $LIBS"
5242 cat > conftest.$ac_ext <<EOF
5243 #line 5244 "configure"
5244 #include "confdefs.h"
5245
5246 int main() {
5247 main()
5248 ; return 0; }
5249 EOF
5250 if { (eval echo configure:5251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5251   rm -rf conftest*
5252   eval "ac_cv_lib_$ac_lib_var=yes"
5253 else
5254   echo "configure: failed program was:" >&5
5255   cat conftest.$ac_ext >&5
5256   rm -rf conftest*
5257   eval "ac_cv_lib_$ac_lib_var=no"
5258 fi
5259 rm -f conftest*
5260 LIBS="$ac_save_LIBS"
5261
5262 fi
5263 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5264   echo "$ac_t""yes" 1>&6
5265     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5266     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5267   cat >> confdefs.h <<EOF
5268 #define $ac_tr_lib 1
5269 EOF
5270
5271   LIBS="-lnsl_s $LIBS"
5272
5273 else
5274   echo "$ac_t""no" 1>&6
5275 fi
5276
5277         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
5278 echo "configure:5279: checking for main in -lnsl" >&5
5279 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
5280 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5281   echo $ac_n "(cached) $ac_c" 1>&6
5282 else
5283   ac_save_LIBS="$LIBS"
5284 LIBS="-lnsl  $LIBS"
5285 cat > conftest.$ac_ext <<EOF
5286 #line 5287 "configure"
5287 #include "confdefs.h"
5288
5289 int main() {
5290 main()
5291 ; return 0; }
5292 EOF
5293 if { (eval echo configure:5294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5294   rm -rf conftest*
5295   eval "ac_cv_lib_$ac_lib_var=yes"
5296 else
5297   echo "configure: failed program was:" >&5
5298   cat conftest.$ac_ext >&5
5299   rm -rf conftest*
5300   eval "ac_cv_lib_$ac_lib_var=no"
5301 fi
5302 rm -f conftest*
5303 LIBS="$ac_save_LIBS"
5304
5305 fi
5306 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5307   echo "$ac_t""yes" 1>&6
5308     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5309     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5310   cat >> confdefs.h <<EOF
5311 #define $ac_tr_lib 1
5312 EOF
5313
5314   LIBS="-lnsl $LIBS"
5315
5316 else
5317   echo "$ac_t""no" 1>&6
5318 fi
5319
5320         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
5321 echo "configure:5322: checking for socket in -linet" >&5
5322 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
5323 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5324   echo $ac_n "(cached) $ac_c" 1>&6
5325 else
5326   ac_save_LIBS="$LIBS"
5327 LIBS="-linet  $LIBS"
5328 cat > conftest.$ac_ext <<EOF
5329 #line 5330 "configure"
5330 #include "confdefs.h"
5331 /* Override any gcc2 internal prototype to avoid an error.  */
5332 /* We use char because int might match the return type of a gcc2
5333     builtin and then its argument prototype would still apply.  */
5334 char socket();
5335
5336 int main() {
5337 socket()
5338 ; return 0; }
5339 EOF
5340 if { (eval echo configure:5341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5341   rm -rf conftest*
5342   eval "ac_cv_lib_$ac_lib_var=yes"
5343 else
5344   echo "configure: failed program was:" >&5
5345   cat conftest.$ac_ext >&5
5346   rm -rf conftest*
5347   eval "ac_cv_lib_$ac_lib_var=no"
5348 fi
5349 rm -f conftest*
5350 LIBS="$ac_save_LIBS"
5351
5352 fi
5353 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5354   echo "$ac_t""yes" 1>&6
5355     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5356     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5357   cat >> confdefs.h <<EOF
5358 #define $ac_tr_lib 1
5359 EOF
5360
5361   LIBS="-linet $LIBS"
5362
5363 else
5364   echo "$ac_t""no" 1>&6
5365 fi
5366
5367         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
5368 echo "configure:5369: checking for main in -lgen" >&5
5369 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
5370 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5371   echo $ac_n "(cached) $ac_c" 1>&6
5372 else
5373   ac_save_LIBS="$LIBS"
5374 LIBS="-lgen  $LIBS"
5375 cat > conftest.$ac_ext <<EOF
5376 #line 5377 "configure"
5377 #include "confdefs.h"
5378
5379 int main() {
5380 main()
5381 ; return 0; }
5382 EOF
5383 if { (eval echo configure:5384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5384   rm -rf conftest*
5385   eval "ac_cv_lib_$ac_lib_var=yes"
5386 else
5387   echo "configure: failed program was:" >&5
5388   cat conftest.$ac_ext >&5
5389   rm -rf conftest*
5390   eval "ac_cv_lib_$ac_lib_var=no"
5391 fi
5392 rm -f conftest*
5393 LIBS="$ac_save_LIBS"
5394
5395 fi
5396 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5397   echo "$ac_t""yes" 1>&6
5398     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5399     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5400   cat >> confdefs.h <<EOF
5401 #define $ac_tr_lib 1
5402 EOF
5403
5404   LIBS="-lgen $LIBS"
5405
5406 else
5407   echo "$ac_t""no" 1>&6
5408 fi
5409
5410
5411 fi
5412
5413
5414 echo $ac_n "checking for select""... $ac_c" 1>&6
5415 echo "configure:5416: checking for select" >&5
5416 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
5417   echo $ac_n "(cached) $ac_c" 1>&6
5418 else
5419   cat > conftest.$ac_ext <<EOF
5420 #line 5421 "configure"
5421 #include "confdefs.h"
5422 /* System header to define __stub macros and hopefully few prototypes,
5423     which can conflict with char select(); below.  */
5424 #include <assert.h>
5425 /* Override any gcc2 internal prototype to avoid an error.  */
5426 /* We use char because int might match the return type of a gcc2
5427     builtin and then its argument prototype would still apply.  */
5428 char select();
5429 char (*f)();
5430
5431 int main() {
5432
5433 /* The GNU C library defines this for functions which it implements
5434     to always fail with ENOSYS.  Some functions are actually named
5435     something starting with __ and the normal name is an alias.  */
5436 #if defined (__stub_select) || defined (__stub___select)
5437 choke me
5438 #else
5439 f = select;
5440 #endif
5441
5442 ; return 0; }
5443 EOF
5444 if { (eval echo configure:5445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5445   rm -rf conftest*
5446   eval "ac_cv_func_select=yes"
5447 else
5448   echo "configure: failed program was:" >&5
5449   cat conftest.$ac_ext >&5
5450   rm -rf conftest*
5451   eval "ac_cv_func_select=no"
5452 fi
5453 rm -f conftest*
5454 fi
5455
5456 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
5457   echo "$ac_t""yes" 1>&6
5458   :
5459 else
5460   echo "$ac_t""no" 1>&6
5461 { echo "configure: error: select() required." 1>&2; exit 1; }
5462 fi
5463
5464
5465 if test "${ac_cv_header_winsock_h}" != yes; then
5466                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
5467 echo "configure:5468: checking types of arguments for select()" >&5
5468  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
5469   echo $ac_n "(cached) $ac_c" 1>&6
5470 else
5471    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
5472   echo $ac_n "(cached) $ac_c" 1>&6
5473 else
5474     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
5475   echo $ac_n "(cached) $ac_c" 1>&6
5476 else
5477      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
5478      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
5479       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
5480        cat > conftest.$ac_ext <<EOF
5481 #line 5482 "configure"
5482 #include "confdefs.h"
5483 #ifdef HAVE_SYS_TYPES_H
5484 #include <sys/types.h>
5485 #endif
5486 #ifdef HAVE_SYS_TIME_H
5487 #include <sys/time.h>
5488 #endif
5489 #ifdef HAVE_SYS_SELECT_H
5490 #include <sys/select.h>
5491 #endif
5492 #ifdef HAVE_SYS_SOCKET_H
5493 #include <sys/socket.h>
5494 #endif
5495 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);
5496 int main() {
5497
5498 ; return 0; }
5499 EOF
5500 if { (eval echo configure:5501: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5501   rm -rf conftest*
5502           ac_not_found=no ; break 3
5503 else
5504   echo "configure: failed program was:" >&5
5505   cat conftest.$ac_ext >&5
5506   rm -rf conftest*
5507   ac_not_found=yes
5508 fi
5509 rm -f conftest*
5510       done
5511      done
5512     done
5513    
5514 fi
5515   
5516 fi
5517  
5518 fi
5519  if test "$ac_not_found" = yes; then
5520   ac_cv_func_select_arg1=int 
5521   ac_cv_func_select_arg234='int *' 
5522   ac_cv_func_select_arg5='struct timeval *'
5523  fi
5524  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
5525  cat >> confdefs.h <<EOF
5526 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
5527 EOF
5528
5529  cat >> confdefs.h <<EOF
5530 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
5531 EOF
5532
5533  cat >> confdefs.h <<EOF
5534 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
5535 EOF
5536
5537
5538 fi
5539
5540
5541 for ac_hdr in regex.h 
5542 do
5543 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5544 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5545 echo "configure:5546: checking for $ac_hdr" >&5
5546 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5547   echo $ac_n "(cached) $ac_c" 1>&6
5548 else
5549   cat > conftest.$ac_ext <<EOF
5550 #line 5551 "configure"
5551 #include "confdefs.h"
5552 #include <$ac_hdr>
5553 EOF
5554 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5555 { (eval echo configure:5556: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5556 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5557 if test -z "$ac_err"; then
5558   rm -rf conftest*
5559   eval "ac_cv_header_$ac_safe=yes"
5560 else
5561   echo "$ac_err" >&5
5562   echo "configure: failed program was:" >&5
5563   cat conftest.$ac_ext >&5
5564   rm -rf conftest*
5565   eval "ac_cv_header_$ac_safe=no"
5566 fi
5567 rm -f conftest*
5568 fi
5569 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5570   echo "$ac_t""yes" 1>&6
5571     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5572   cat >> confdefs.h <<EOF
5573 #define $ac_tr_hdr 1
5574 EOF
5575  
5576 else
5577   echo "$ac_t""no" 1>&6
5578 fi
5579 done
5580
5581 if test "$ac_cv_header_regex_h" != yes ; then
5582         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
5583 fi
5584 echo $ac_n "checking for regfree""... $ac_c" 1>&6
5585 echo "configure:5586: checking for regfree" >&5
5586 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
5587   echo $ac_n "(cached) $ac_c" 1>&6
5588 else
5589   cat > conftest.$ac_ext <<EOF
5590 #line 5591 "configure"
5591 #include "confdefs.h"
5592 /* System header to define __stub macros and hopefully few prototypes,
5593     which can conflict with char regfree(); below.  */
5594 #include <assert.h>
5595 /* Override any gcc2 internal prototype to avoid an error.  */
5596 /* We use char because int might match the return type of a gcc2
5597     builtin and then its argument prototype would still apply.  */
5598 char regfree();
5599 char (*f)();
5600
5601 int main() {
5602
5603 /* The GNU C library defines this for functions which it implements
5604     to always fail with ENOSYS.  Some functions are actually named
5605     something starting with __ and the normal name is an alias.  */
5606 #if defined (__stub_regfree) || defined (__stub___regfree)
5607 choke me
5608 #else
5609 f = regfree;
5610 #endif
5611
5612 ; return 0; }
5613 EOF
5614 if { (eval echo configure:5615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5615   rm -rf conftest*
5616   eval "ac_cv_func_regfree=yes"
5617 else
5618   echo "configure: failed program was:" >&5
5619   cat conftest.$ac_ext >&5
5620   rm -rf conftest*
5621   eval "ac_cv_func_regfree=no"
5622 fi
5623 rm -f conftest*
5624 fi
5625
5626 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
5627   echo "$ac_t""yes" 1>&6
5628   :
5629 else
5630   echo "$ac_t""no" 1>&6
5631 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
5632 fi
5633
5634
5635
5636 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
5637 echo "configure:5638: checking for compatible POSIX regex" >&5
5638 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
5639   echo $ac_n "(cached) $ac_c" 1>&6
5640 else
5641   
5642         if test "$cross_compiling" = yes; then
5643   ol_cv_c_posix_regex=cross
5644 else
5645   cat > conftest.$ac_ext <<EOF
5646 #line 5647 "configure"
5647 #include "confdefs.h"
5648
5649 #include <sys/types.h>
5650 #include <regex.h>
5651 static char *pattern, *string;
5652 main()
5653 {
5654         int rc;
5655         regex_t re;
5656
5657         pattern = "^A";
5658
5659         if(regcomp(&re, pattern, 0)) {
5660                 return -1;
5661         }
5662         
5663         string = "ALL MATCH";
5664         
5665         rc = regexec(&re, string, 0, (void*)0, 0);
5666
5667         regfree(&re);
5668
5669         return rc;
5670 }
5671 EOF
5672 if { (eval echo configure:5673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5673 then
5674   ol_cv_c_posix_regex=yes
5675 else
5676   echo "configure: failed program was:" >&5
5677   cat conftest.$ac_ext >&5
5678   rm -fr conftest*
5679   ol_cv_c_posix_regex=no
5680 fi
5681 rm -fr conftest*
5682 fi
5683
5684 fi
5685
5686 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5687
5688 if test "$ol_cv_c_posix_regex" = no ; then
5689         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5690 fi
5691
5692 ol_link_dnssrv=no
5693 echo $ac_n "checking for res_query""... $ac_c" 1>&6
5694 echo "configure:5695: checking for res_query" >&5
5695 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
5696   echo $ac_n "(cached) $ac_c" 1>&6
5697 else
5698   cat > conftest.$ac_ext <<EOF
5699 #line 5700 "configure"
5700 #include "confdefs.h"
5701 /* System header to define __stub macros and hopefully few prototypes,
5702     which can conflict with char res_query(); below.  */
5703 #include <assert.h>
5704 /* Override any gcc2 internal prototype to avoid an error.  */
5705 /* We use char because int might match the return type of a gcc2
5706     builtin and then its argument prototype would still apply.  */
5707 char res_query();
5708 char (*f)();
5709
5710 int main() {
5711
5712 /* The GNU C library defines this for functions which it implements
5713     to always fail with ENOSYS.  Some functions are actually named
5714     something starting with __ and the normal name is an alias.  */
5715 #if defined (__stub_res_query) || defined (__stub___res_query)
5716 choke me
5717 #else
5718 f = res_query;
5719 #endif
5720
5721 ; return 0; }
5722 EOF
5723 if { (eval echo configure:5724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5724   rm -rf conftest*
5725   eval "ac_cv_func_res_query=yes"
5726 else
5727   echo "configure: failed program was:" >&5
5728   cat conftest.$ac_ext >&5
5729   rm -rf conftest*
5730   eval "ac_cv_func_res_query=no"
5731 fi
5732 rm -f conftest*
5733 fi
5734
5735 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
5736   echo "$ac_t""yes" 1>&6
5737   :
5738 else
5739   echo "$ac_t""no" 1>&6
5740 fi
5741
5742 if test $ac_cv_func_res_query = no ; then 
5743         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
5744 echo "configure:5745: checking for res_query in -lbind" >&5
5745 ac_lib_var=`echo bind'_'res_query | 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="-lbind  $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_query();
5758
5759 int main() {
5760 res_query()
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 bind | 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="-lbind $LIBS"
5785
5786 else
5787   echo "$ac_t""no" 1>&6
5788 fi
5789
5790         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
5791 fi
5792
5793 if test $ac_cv_func_res_query = no ; then 
5794         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
5795 echo "configure:5796: checking for __res_query in -lbind" >&5
5796 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
5797 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5798   echo $ac_n "(cached) $ac_c" 1>&6
5799 else
5800   ac_save_LIBS="$LIBS"
5801 LIBS="-lbind  $LIBS"
5802 cat > conftest.$ac_ext <<EOF
5803 #line 5804 "configure"
5804 #include "confdefs.h"
5805 /* Override any gcc2 internal prototype to avoid an error.  */
5806 /* We use char because int might match the return type of a gcc2
5807     builtin and then its argument prototype would still apply.  */
5808 char __res_query();
5809
5810 int main() {
5811 __res_query()
5812 ; return 0; }
5813 EOF
5814 if { (eval echo configure:5815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5815   rm -rf conftest*
5816   eval "ac_cv_lib_$ac_lib_var=yes"
5817 else
5818   echo "configure: failed program was:" >&5
5819   cat conftest.$ac_ext >&5
5820   rm -rf conftest*
5821   eval "ac_cv_lib_$ac_lib_var=no"
5822 fi
5823 rm -f conftest*
5824 LIBS="$ac_save_LIBS"
5825
5826 fi
5827 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5828   echo "$ac_t""yes" 1>&6
5829     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5830     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5831   cat >> confdefs.h <<EOF
5832 #define $ac_tr_lib 1
5833 EOF
5834
5835   LIBS="-lbind $LIBS"
5836
5837 else
5838   echo "$ac_t""no" 1>&6
5839 fi
5840
5841         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
5842 fi
5843
5844 if test $ac_cv_func_res_query = no ; then 
5845         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
5846 echo "configure:5847: checking for res_query in -lresolv" >&5
5847 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
5848 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5849   echo $ac_n "(cached) $ac_c" 1>&6
5850 else
5851   ac_save_LIBS="$LIBS"
5852 LIBS="-lresolv  $LIBS"
5853 cat > conftest.$ac_ext <<EOF
5854 #line 5855 "configure"
5855 #include "confdefs.h"
5856 /* Override any gcc2 internal prototype to avoid an error.  */
5857 /* We use char because int might match the return type of a gcc2
5858     builtin and then its argument prototype would still apply.  */
5859 char res_query();
5860
5861 int main() {
5862 res_query()
5863 ; return 0; }
5864 EOF
5865 if { (eval echo configure:5866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5866   rm -rf conftest*
5867   eval "ac_cv_lib_$ac_lib_var=yes"
5868 else
5869   echo "configure: failed program was:" >&5
5870   cat conftest.$ac_ext >&5
5871   rm -rf conftest*
5872   eval "ac_cv_lib_$ac_lib_var=no"
5873 fi
5874 rm -f conftest*
5875 LIBS="$ac_save_LIBS"
5876
5877 fi
5878 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5879   echo "$ac_t""yes" 1>&6
5880     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5881     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5882   cat >> confdefs.h <<EOF
5883 #define $ac_tr_lib 1
5884 EOF
5885
5886   LIBS="-lresolv $LIBS"
5887
5888 else
5889   echo "$ac_t""no" 1>&6
5890 fi
5891
5892         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
5893 fi
5894
5895 if test "$ac_cv_func_res_query" = yes ; then
5896         cat >> confdefs.h <<\EOF
5897 #define HAVE_RES_QUERY 1
5898 EOF
5899
5900
5901         if test $ol_enable_dnssrv != no ; then
5902                 ol_link_dnssrv=yes
5903         fi
5904 fi
5905
5906 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
5907         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
5908 fi
5909
5910 for ac_func in getaddrinfo inet_ntop 
5911 do
5912 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5913 echo "configure:5914: checking for $ac_func" >&5
5914 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
5915   echo $ac_n "(cached) $ac_c" 1>&6
5916 else
5917   cat > conftest.$ac_ext <<EOF
5918 #line 5919 "configure"
5919 #include "confdefs.h"
5920 /* System header to define __stub macros and hopefully few prototypes,
5921     which can conflict with char $ac_func(); below.  */
5922 #include <assert.h>
5923 /* Override any gcc2 internal prototype to avoid an error.  */
5924 /* We use char because int might match the return type of a gcc2
5925     builtin and then its argument prototype would still apply.  */
5926 char $ac_func();
5927 char (*f)();
5928
5929 int main() {
5930
5931 /* The GNU C library defines this for functions which it implements
5932     to always fail with ENOSYS.  Some functions are actually named
5933     something starting with __ and the normal name is an alias.  */
5934 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5935 choke me
5936 #else
5937 f = $ac_func;
5938 #endif
5939
5940 ; return 0; }
5941 EOF
5942 if { (eval echo configure:5943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5943   rm -rf conftest*
5944   eval "ac_cv_func_$ac_func=yes"
5945 else
5946   echo "configure: failed program was:" >&5
5947   cat conftest.$ac_ext >&5
5948   rm -rf conftest*
5949   eval "ac_cv_func_$ac_func=no"
5950 fi
5951 rm -f conftest*
5952 fi
5953
5954 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5955   echo "$ac_t""yes" 1>&6
5956     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5957   cat >> confdefs.h <<EOF
5958 #define $ac_tr_func 1
5959 EOF
5960  
5961 else
5962   echo "$ac_t""no" 1>&6
5963 fi
5964 done
5965
5966
5967 ol_link_ipv6=no
5968 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
5969         if test $ol_enable_ipv6 = yes ; then
5970                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
5971         fi
5972 else
5973         for ac_func in gai_strerror 
5974 do
5975 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5976 echo "configure:5977: checking for $ac_func" >&5
5977 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
5978   echo $ac_n "(cached) $ac_c" 1>&6
5979 else
5980   cat > conftest.$ac_ext <<EOF
5981 #line 5982 "configure"
5982 #include "confdefs.h"
5983 /* System header to define __stub macros and hopefully few prototypes,
5984     which can conflict with char $ac_func(); below.  */
5985 #include <assert.h>
5986 /* Override any gcc2 internal prototype to avoid an error.  */
5987 /* We use char because int might match the return type of a gcc2
5988     builtin and then its argument prototype would still apply.  */
5989 char $ac_func();
5990 char (*f)();
5991
5992 int main() {
5993
5994 /* The GNU C library defines this for functions which it implements
5995     to always fail with ENOSYS.  Some functions are actually named
5996     something starting with __ and the normal name is an alias.  */
5997 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5998 choke me
5999 #else
6000 f = $ac_func;
6001 #endif
6002
6003 ; return 0; }
6004 EOF
6005 if { (eval echo configure:6006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6006   rm -rf conftest*
6007   eval "ac_cv_func_$ac_func=yes"
6008 else
6009   echo "configure: failed program was:" >&5
6010   cat conftest.$ac_ext >&5
6011   rm -rf conftest*
6012   eval "ac_cv_func_$ac_func=no"
6013 fi
6014 rm -f conftest*
6015 fi
6016
6017 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6018   echo "$ac_t""yes" 1>&6
6019     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6020   cat >> confdefs.h <<EOF
6021 #define $ac_tr_func 1
6022 EOF
6023  
6024 else
6025   echo "$ac_t""no" 1>&6
6026 fi
6027 done
6028
6029
6030         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
6031 echo "configure:6032: checking INET6_ADDRSTRLEN" >&5
6032 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
6033   echo $ac_n "(cached) $ac_c" 1>&6
6034 else
6035   
6036                 cat > conftest.$ac_ext <<EOF
6037 #line 6038 "configure"
6038 #include "confdefs.h"
6039
6040 #                       include <netinet/in.h>
6041 #                       ifdef INET6_ADDRSTRLEN
6042                                 __has_inet6_addrstrlen__;
6043 #                       endif
6044                 
6045 EOF
6046 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6047   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
6048   rm -rf conftest*
6049   ol_cv_inet6_addrstrlen=yes
6050 else
6051   rm -rf conftest*
6052   ol_cv_inet6_addrstrlen=no
6053 fi
6054 rm -f conftest*
6055
6056 fi
6057
6058 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
6059
6060         if test $ol_cv_inet6_addrstrlen = yes ; then
6061                 ol_link_ipv6=yes
6062         elif test $ol_enable_ipv6 = yes ; then
6063                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
6064         fi
6065 fi
6066
6067 if test $ol_enable_local != no ; then
6068         for ac_hdr in sys/un.h 
6069 do
6070 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6071 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6072 echo "configure:6073: checking for $ac_hdr" >&5
6073 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6074   echo $ac_n "(cached) $ac_c" 1>&6
6075 else
6076   cat > conftest.$ac_ext <<EOF
6077 #line 6078 "configure"
6078 #include "confdefs.h"
6079 #include <$ac_hdr>
6080 EOF
6081 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6082 { (eval echo configure:6083: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6083 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6084 if test -z "$ac_err"; then
6085   rm -rf conftest*
6086   eval "ac_cv_header_$ac_safe=yes"
6087 else
6088   echo "$ac_err" >&5
6089   echo "configure: failed program was:" >&5
6090   cat conftest.$ac_ext >&5
6091   rm -rf conftest*
6092   eval "ac_cv_header_$ac_safe=no"
6093 fi
6094 rm -f conftest*
6095 fi
6096 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6097   echo "$ac_t""yes" 1>&6
6098     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6099   cat >> confdefs.h <<EOF
6100 #define $ac_tr_hdr 1
6101 EOF
6102  
6103 else
6104   echo "$ac_t""no" 1>&6
6105 fi
6106 done
6107
6108
6109         if test $ol_enable_local = auto ; then
6110                 ol_enable_local=$ac_cv_header_sys_un_h
6111         elif test $ac_cv_header_sys_un_h = no ; then
6112                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
6113         fi
6114 fi
6115
6116 ol_link_kbind=no
6117 ol_link_kpasswd=no
6118 ol_link_krb5=no
6119 ol_link_krb4=no
6120
6121 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6122         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
6123         -o $ol_with_kerberos = k425 ; then
6124
6125         for ac_hdr in krb5.h
6126 do
6127 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6128 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6129 echo "configure:6130: checking for $ac_hdr" >&5
6130 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6131   echo $ac_n "(cached) $ac_c" 1>&6
6132 else
6133   cat > conftest.$ac_ext <<EOF
6134 #line 6135 "configure"
6135 #include "confdefs.h"
6136 #include <$ac_hdr>
6137 EOF
6138 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6139 { (eval echo configure:6140: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6140 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6141 if test -z "$ac_err"; then
6142   rm -rf conftest*
6143   eval "ac_cv_header_$ac_safe=yes"
6144 else
6145   echo "$ac_err" >&5
6146   echo "configure: failed program was:" >&5
6147   cat conftest.$ac_ext >&5
6148   rm -rf conftest*
6149   eval "ac_cv_header_$ac_safe=no"
6150 fi
6151 rm -f conftest*
6152 fi
6153 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6154   echo "$ac_t""yes" 1>&6
6155     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6156   cat >> confdefs.h <<EOF
6157 #define $ac_tr_hdr 1
6158 EOF
6159  
6160 else
6161   echo "$ac_t""no" 1>&6
6162 fi
6163 done
6164
6165
6166         if test $ac_cv_header_krb5_h = yes ; then
6167                                 for ac_hdr in heim_err.h
6168 do
6169 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6170 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6171 echo "configure:6172: checking for $ac_hdr" >&5
6172 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6173   echo $ac_n "(cached) $ac_c" 1>&6
6174 else
6175   cat > conftest.$ac_ext <<EOF
6176 #line 6177 "configure"
6177 #include "confdefs.h"
6178 #include <$ac_hdr>
6179 EOF
6180 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6181 { (eval echo configure:6182: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6182 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6183 if test -z "$ac_err"; then
6184   rm -rf conftest*
6185   eval "ac_cv_header_$ac_safe=yes"
6186 else
6187   echo "$ac_err" >&5
6188   echo "configure: failed program was:" >&5
6189   cat conftest.$ac_ext >&5
6190   rm -rf conftest*
6191   eval "ac_cv_header_$ac_safe=no"
6192 fi
6193 rm -f conftest*
6194 fi
6195 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6196   echo "$ac_t""yes" 1>&6
6197     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6198   cat >> confdefs.h <<EOF
6199 #define $ac_tr_hdr 1
6200 EOF
6201  
6202 else
6203   echo "$ac_t""no" 1>&6
6204 fi
6205 done
6206
6207                 if test $ac_cv_header_heim_err_h = yes ; then
6208                         krb5_impl=heimdal
6209                 else
6210                         krb5_impl=mit
6211                 fi
6212
6213                 if test $krb5_impl = mit; then
6214                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6215 echo "configure:6216: checking for main in -lkrb5" >&5
6216 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6217 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6218   echo $ac_n "(cached) $ac_c" 1>&6
6219 else
6220   ac_save_LIBS="$LIBS"
6221 LIBS="-lkrb5 -lcrypto -lcom_err $LIBS"
6222 cat > conftest.$ac_ext <<EOF
6223 #line 6224 "configure"
6224 #include "confdefs.h"
6225
6226 int main() {
6227 main()
6228 ; return 0; }
6229 EOF
6230 if { (eval echo configure:6231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6231   rm -rf conftest*
6232   eval "ac_cv_lib_$ac_lib_var=yes"
6233 else
6234   echo "configure: failed program was:" >&5
6235   cat conftest.$ac_ext >&5
6236   rm -rf conftest*
6237   eval "ac_cv_lib_$ac_lib_var=no"
6238 fi
6239 rm -f conftest*
6240 LIBS="$ac_save_LIBS"
6241
6242 fi
6243 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6244   echo "$ac_t""yes" 1>&6
6245   have_krb5=yes
6246                                 KRB5_LIBS="-lkrb5 -lcrypto -lcom_err"
6247 else
6248   echo "$ac_t""no" 1>&6
6249 have_krb5=no
6250 fi
6251
6252
6253                 elif test $krb5_impl = heimdal; then
6254                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6255 echo "configure:6256: checking for main in -lkrb5" >&5
6256 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6257 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6258   echo $ac_n "(cached) $ac_c" 1>&6
6259 else
6260   ac_save_LIBS="$LIBS"
6261 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6262 cat > conftest.$ac_ext <<EOF
6263 #line 6264 "configure"
6264 #include "confdefs.h"
6265
6266 int main() {
6267 main()
6268 ; return 0; }
6269 EOF
6270 if { (eval echo configure:6271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6271   rm -rf conftest*
6272   eval "ac_cv_lib_$ac_lib_var=yes"
6273 else
6274   echo "configure: failed program was:" >&5
6275   cat conftest.$ac_ext >&5
6276   rm -rf conftest*
6277   eval "ac_cv_lib_$ac_lib_var=no"
6278 fi
6279 rm -f conftest*
6280 LIBS="$ac_save_LIBS"
6281
6282 fi
6283 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6284   echo "$ac_t""yes" 1>&6
6285   have_krb5=yes
6286                                 KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
6287 else
6288   echo "$ac_t""no" 1>&6
6289 have_krb5=no
6290 fi
6291
6292
6293                         cat >> confdefs.h <<\EOF
6294 #define HAVE_HEIMDAL_KERBEROS 1
6295 EOF
6296
6297                 else
6298                         have_krb5=no
6299                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
6300                 fi
6301
6302                 if test $have_krb5 = yes ; then
6303                         ol_link_krb5=yes
6304
6305                         cat >> confdefs.h <<\EOF
6306 #define HAVE_KRB5 1
6307 EOF
6308
6309
6310                         if test $ol_enable_kpasswd != no ; then
6311                                 ol_link_kpasswd=yes;
6312                         fi
6313
6314                         if test $ol_with_kerberos = k5only ; then
6315                                 ol_with_kerberos=found
6316                         fi
6317
6318                 elif test $ol_with_kerberos != auto ; then
6319                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
6320                 fi
6321
6322         fi
6323 fi
6324
6325 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
6326         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
6327
6328         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
6329 do
6330 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6331 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6332 echo "configure:6333: checking for $ac_hdr" >&5
6333 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6334   echo $ac_n "(cached) $ac_c" 1>&6
6335 else
6336   cat > conftest.$ac_ext <<EOF
6337 #line 6338 "configure"
6338 #include "confdefs.h"
6339 #include <$ac_hdr>
6340 EOF
6341 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6342 { (eval echo configure:6343: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6343 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6344 if test -z "$ac_err"; then
6345   rm -rf conftest*
6346   eval "ac_cv_header_$ac_safe=yes"
6347 else
6348   echo "$ac_err" >&5
6349   echo "configure: failed program was:" >&5
6350   cat conftest.$ac_ext >&5
6351   rm -rf conftest*
6352   eval "ac_cv_header_$ac_safe=no"
6353 fi
6354 rm -f conftest*
6355 fi
6356 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6357   echo "$ac_t""yes" 1>&6
6358     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6359   cat >> confdefs.h <<EOF
6360 #define $ac_tr_hdr 1
6361 EOF
6362  
6363 else
6364   echo "$ac_t""no" 1>&6
6365 fi
6366 done
6367
6368
6369         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
6370                 if test $krb5_impl = mit; then
6371                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6372 echo "configure:6373: checking for main in -lkrb4" >&5
6373 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6374 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6375   echo $ac_n "(cached) $ac_c" 1>&6
6376 else
6377   ac_save_LIBS="$LIBS"
6378 LIBS="-lkrb4 -ldes425 -lkrb5 -lcrypto -lcom_err $LIBS"
6379 cat > conftest.$ac_ext <<EOF
6380 #line 6381 "configure"
6381 #include "confdefs.h"
6382
6383 int main() {
6384 main()
6385 ; return 0; }
6386 EOF
6387 if { (eval echo configure:6388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6388   rm -rf conftest*
6389   eval "ac_cv_lib_$ac_lib_var=yes"
6390 else
6391   echo "configure: failed program was:" >&5
6392   cat conftest.$ac_ext >&5
6393   rm -rf conftest*
6394   eval "ac_cv_lib_$ac_lib_var=no"
6395 fi
6396 rm -f conftest*
6397 LIBS="$ac_save_LIBS"
6398
6399 fi
6400 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6401   echo "$ac_t""yes" 1>&6
6402   have_k425=yes
6403                                 KRB4_LIBS="-lkrb4 -ldes425"
6404 else
6405   echo "$ac_t""no" 1>&6
6406 have_k425=no
6407 fi
6408
6409
6410                 elif test $krb5_impl = heimdal; then
6411                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6412 echo "configure:6413: checking for main in -lkrb4" >&5
6413 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6414 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6415   echo $ac_n "(cached) $ac_c" 1>&6
6416 else
6417   ac_save_LIBS="$LIBS"
6418 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6419 cat > conftest.$ac_ext <<EOF
6420 #line 6421 "configure"
6421 #include "confdefs.h"
6422
6423 int main() {
6424 main()
6425 ; return 0; }
6426 EOF
6427 if { (eval echo configure:6428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6428   rm -rf conftest*
6429   eval "ac_cv_lib_$ac_lib_var=yes"
6430 else
6431   echo "configure: failed program was:" >&5
6432   cat conftest.$ac_ext >&5
6433   rm -rf conftest*
6434   eval "ac_cv_lib_$ac_lib_var=no"
6435 fi
6436 rm -f conftest*
6437 LIBS="$ac_save_LIBS"
6438
6439 fi
6440 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6441   echo "$ac_t""yes" 1>&6
6442   have_k425=yes
6443                                 KRB4_LIBS="-lkrb4"
6444 else
6445   echo "$ac_t""no" 1>&6
6446 have_k425=no
6447 fi
6448
6449
6450                 else
6451                         have_425=no
6452                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
6453                 fi
6454
6455                 if test $have_k425 = yes ; then
6456                         ol_with_kerberos=found
6457                         ol_link_krb4=yes
6458
6459                         cat >> confdefs.h <<\EOF
6460 #define HAVE_KRB425 1
6461 EOF
6462
6463                         cat >> confdefs.h <<\EOF
6464 #define HAVE_KRB4 1
6465 EOF
6466
6467
6468                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
6469 echo "configure:6470: checking for des_debug in Kerberos libraries" >&5
6470 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
6471   echo $ac_n "(cached) $ac_c" 1>&6
6472 else
6473   
6474                                                                 save_LIBS="$LIBS"
6475                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
6476                                 cat > conftest.$ac_ext <<EOF
6477 #line 6478 "configure"
6478 #include "confdefs.h"
6479
6480 #include <kerberosIV/krb.h>
6481 #include <kerberosIV/des.h>
6482 extern int des_debug;
6483
6484 int main() {
6485
6486 des_debug = 1;
6487
6488 ; return 0; }
6489 EOF
6490 if { (eval echo configure:6491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6491   rm -rf conftest*
6492   ol_cv_var_des_debug=yes
6493 else
6494   echo "configure: failed program was:" >&5
6495   cat conftest.$ac_ext >&5
6496   rm -rf conftest*
6497   ol_cv_var_des_debug=no
6498 fi
6499 rm -f conftest*
6500                                                                 LIBS="$save_LIBS"
6501                         
6502 fi
6503
6504 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
6505
6506                         if test $ol_cv_var_des_debug = yes ; then
6507                                 cat >> confdefs.h <<\EOF
6508 #define HAVE_DES_DEBUG 1
6509 EOF
6510
6511                         fi
6512
6513                         LIBS="$save_LIBS"
6514                 fi
6515         fi
6516 fi
6517
6518 if test $ol_link_krb5 = yes ; then
6519         ol_with_kerberos=found
6520 fi
6521
6522 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6523         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
6524
6525         for ac_hdr in krb.h des.h krb-archaeology.h 
6526 do
6527 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6528 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6529 echo "configure:6530: checking for $ac_hdr" >&5
6530 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6531   echo $ac_n "(cached) $ac_c" 1>&6
6532 else
6533   cat > conftest.$ac_ext <<EOF
6534 #line 6535 "configure"
6535 #include "confdefs.h"
6536 #include <$ac_hdr>
6537 EOF
6538 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6539 { (eval echo configure:6540: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6540 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6541 if test -z "$ac_err"; then
6542   rm -rf conftest*
6543   eval "ac_cv_header_$ac_safe=yes"
6544 else
6545   echo "$ac_err" >&5
6546   echo "configure: failed program was:" >&5
6547   cat conftest.$ac_ext >&5
6548   rm -rf conftest*
6549   eval "ac_cv_header_$ac_safe=no"
6550 fi
6551 rm -f conftest*
6552 fi
6553 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6554   echo "$ac_t""yes" 1>&6
6555     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6556   cat >> confdefs.h <<EOF
6557 #define $ac_tr_hdr 1
6558 EOF
6559  
6560 else
6561   echo "$ac_t""no" 1>&6
6562 fi
6563 done
6564
6565
6566         if test $ac_cv_header_krb_h = yes ; then
6567                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
6568 echo "configure:6569: checking for main in -lkrb" >&5
6569 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
6570 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6571   echo $ac_n "(cached) $ac_c" 1>&6
6572 else
6573   ac_save_LIBS="$LIBS"
6574 LIBS="-lkrb -ldes $LIBS"
6575 cat > conftest.$ac_ext <<EOF
6576 #line 6577 "configure"
6577 #include "confdefs.h"
6578
6579 int main() {
6580 main()
6581 ; return 0; }
6582 EOF
6583 if { (eval echo configure:6584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6584   rm -rf conftest*
6585   eval "ac_cv_lib_$ac_lib_var=yes"
6586 else
6587   echo "configure: failed program was:" >&5
6588   cat conftest.$ac_ext >&5
6589   rm -rf conftest*
6590   eval "ac_cv_lib_$ac_lib_var=no"
6591 fi
6592 rm -f conftest*
6593 LIBS="$ac_save_LIBS"
6594
6595 fi
6596 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6597   echo "$ac_t""yes" 1>&6
6598   have_k4=yes
6599 else
6600   echo "$ac_t""no" 1>&6
6601 have_k4=no
6602 fi
6603
6604
6605                 if test $have_k4 = yes ; then
6606                         ol_with_kerberos=found
6607                         ol_link_krb4=yes
6608
6609                         cat >> confdefs.h <<\EOF
6610 #define HAVE_KRB4 1
6611 EOF
6612
6613
6614                         KRB4_LIBS="-lkrb -ldes"
6615
6616                         if test $ac_cv_header_krb_archaeology_h = yes ; then
6617                                 cat >> confdefs.h <<\EOF
6618 #define HAVE_KTH_KERBEROS 1
6619 EOF
6620
6621                         fi
6622                 fi
6623         fi
6624 fi
6625
6626 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
6627         ol_link_kpasswd=yes
6628 fi
6629
6630 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
6631         ol_link_kbind=yes
6632
6633 elif test $ol_enable_kbind = yes ; then
6634         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
6635 fi
6636
6637 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
6638         cat >> confdefs.h <<\EOF
6639 #define HAVE_KERBEROS 1
6640 EOF
6641
6642
6643 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
6644         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
6645 fi
6646
6647 ol_link_tls=no
6648 if test $ol_with_tls != no ; then
6649         for ac_hdr in openssl/ssl.h ssl.h
6650 do
6651 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6652 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6653 echo "configure:6654: checking for $ac_hdr" >&5
6654 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6655   echo $ac_n "(cached) $ac_c" 1>&6
6656 else
6657   cat > conftest.$ac_ext <<EOF
6658 #line 6659 "configure"
6659 #include "confdefs.h"
6660 #include <$ac_hdr>
6661 EOF
6662 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6663 { (eval echo configure:6664: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6664 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6665 if test -z "$ac_err"; then
6666   rm -rf conftest*
6667   eval "ac_cv_header_$ac_safe=yes"
6668 else
6669   echo "$ac_err" >&5
6670   echo "configure: failed program was:" >&5
6671   cat conftest.$ac_ext >&5
6672   rm -rf conftest*
6673   eval "ac_cv_header_$ac_safe=no"
6674 fi
6675 rm -f conftest*
6676 fi
6677 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6678   echo "$ac_t""yes" 1>&6
6679     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6680   cat >> confdefs.h <<EOF
6681 #define $ac_tr_hdr 1
6682 EOF
6683  
6684 else
6685   echo "$ac_t""no" 1>&6
6686 fi
6687 done
6688
6689         
6690         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
6691                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
6692 echo "configure:6693: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
6693 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
6694 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6695   echo $ac_n "(cached) $ac_c" 1>&6
6696 else
6697   ac_save_LIBS="$LIBS"
6698 LIBS="-lssl -lcrypto $LIBS"
6699 cat > conftest.$ac_ext <<EOF
6700 #line 6701 "configure"
6701 #include "confdefs.h"
6702 /* Override any gcc2 internal prototype to avoid an error.  */
6703 /* We use char because int might match the return type of a gcc2
6704     builtin and then its argument prototype would still apply.  */
6705 char SSLeay_add_ssl_algorithms();
6706
6707 int main() {
6708 SSLeay_add_ssl_algorithms()
6709 ; return 0; }
6710 EOF
6711 if { (eval echo configure:6712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6712   rm -rf conftest*
6713   eval "ac_cv_lib_$ac_lib_var=yes"
6714 else
6715   echo "configure: failed program was:" >&5
6716   cat conftest.$ac_ext >&5
6717   rm -rf conftest*
6718   eval "ac_cv_lib_$ac_lib_var=no"
6719 fi
6720 rm -f conftest*
6721 LIBS="$ac_save_LIBS"
6722
6723 fi
6724 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6725   echo "$ac_t""yes" 1>&6
6726   have_ssleay=yes
6727                         need_rsaref=no
6728 else
6729   echo "$ac_t""no" 1>&6
6730 have_ssleay=no
6731 fi
6732
6733                         
6734                 if test $have_ssleay = no ; then
6735                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
6736 echo "configure:6737: checking for SSL_library_init in -lssl" >&5
6737 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
6738 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6739   echo $ac_n "(cached) $ac_c" 1>&6
6740 else
6741   ac_save_LIBS="$LIBS"
6742 LIBS="-lssl -lcrypto $LIBS"
6743 cat > conftest.$ac_ext <<EOF
6744 #line 6745 "configure"
6745 #include "confdefs.h"
6746 /* Override any gcc2 internal prototype to avoid an error.  */
6747 /* We use char because int might match the return type of a gcc2
6748     builtin and then its argument prototype would still apply.  */
6749 char SSL_library_init();
6750
6751 int main() {
6752 SSL_library_init()
6753 ; return 0; }
6754 EOF
6755 if { (eval echo configure:6756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6756   rm -rf conftest*
6757   eval "ac_cv_lib_$ac_lib_var=yes"
6758 else
6759   echo "configure: failed program was:" >&5
6760   cat conftest.$ac_ext >&5
6761   rm -rf conftest*
6762   eval "ac_cv_lib_$ac_lib_var=no"
6763 fi
6764 rm -f conftest*
6765 LIBS="$ac_save_LIBS"
6766
6767 fi
6768 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6769   echo "$ac_t""yes" 1>&6
6770   have_ssleay=yes
6771                                 need_rsaref=no
6772 else
6773   echo "$ac_t""no" 1>&6
6774 have_ssleay=no
6775 fi
6776
6777                 fi
6778
6779                 if test $have_ssleay = no ; then
6780                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
6781 echo "configure:6782: checking for ssl3_accept in -lssl" >&5
6782 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
6783 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6784   echo $ac_n "(cached) $ac_c" 1>&6
6785 else
6786   ac_save_LIBS="$LIBS"
6787 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
6788 cat > conftest.$ac_ext <<EOF
6789 #line 6790 "configure"
6790 #include "confdefs.h"
6791 /* Override any gcc2 internal prototype to avoid an error.  */
6792 /* We use char because int might match the return type of a gcc2
6793     builtin and then its argument prototype would still apply.  */
6794 char ssl3_accept();
6795
6796 int main() {
6797 ssl3_accept()
6798 ; return 0; }
6799 EOF
6800 if { (eval echo configure:6801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6801   rm -rf conftest*
6802   eval "ac_cv_lib_$ac_lib_var=yes"
6803 else
6804   echo "configure: failed program was:" >&5
6805   cat conftest.$ac_ext >&5
6806   rm -rf conftest*
6807   eval "ac_cv_lib_$ac_lib_var=no"
6808 fi
6809 rm -f conftest*
6810 LIBS="$ac_save_LIBS"
6811
6812 fi
6813 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6814   echo "$ac_t""yes" 1>&6
6815   have_ssleay=yes
6816                                 need_rsaref=yes
6817 else
6818   echo "$ac_t""no" 1>&6
6819 have_ssleay=no
6820 fi
6821
6822                 fi
6823
6824                 if test $have_ssleay = yes ; then
6825                         ol_with_tls=found
6826                         ol_link_tls=yes
6827
6828                         cat >> confdefs.h <<\EOF
6829 #define HAVE_SSLEAY 1
6830 EOF
6831
6832
6833                         if test $need_rsaref = yes; then
6834                                 cat >> confdefs.h <<\EOF
6835 #define HAVE_RSAREF 1
6836 EOF
6837
6838
6839                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
6840                         else
6841                                 TLS_LIBS="-lssl -lcrypto"
6842                         fi
6843                 fi
6844         fi
6845
6846 else
6847         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6848 fi
6849
6850 if test $ol_link_tls = yes ; then
6851         cat >> confdefs.h <<\EOF
6852 #define HAVE_TLS 1
6853 EOF
6854
6855
6856 elif test $ol_with_tls = auto ; then
6857         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
6858         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6859
6860 elif test $ol_with_tls != no ; then
6861         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
6862 fi
6863
6864 if test $ol_enable_lmpasswd != no; then
6865         if test $ol_link_tls != yes ; then
6866                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
6867         fi
6868
6869         cat >> confdefs.h <<\EOF
6870 #define SLAPD_LMHASH 1
6871 EOF
6872
6873 fi
6874
6875 for ac_func in \
6876         ctime_r                 \
6877         gethostbyname_r gethostbyaddr_r \
6878
6879 do
6880 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6881 echo "configure:6882: checking for $ac_func" >&5
6882 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6883   echo $ac_n "(cached) $ac_c" 1>&6
6884 else
6885   cat > conftest.$ac_ext <<EOF
6886 #line 6887 "configure"
6887 #include "confdefs.h"
6888 /* System header to define __stub macros and hopefully few prototypes,
6889     which can conflict with char $ac_func(); below.  */
6890 #include <assert.h>
6891 /* Override any gcc2 internal prototype to avoid an error.  */
6892 /* We use char because int might match the return type of a gcc2
6893     builtin and then its argument prototype would still apply.  */
6894 char $ac_func();
6895 char (*f)();
6896
6897 int main() {
6898
6899 /* The GNU C library defines this for functions which it implements
6900     to always fail with ENOSYS.  Some functions are actually named
6901     something starting with __ and the normal name is an alias.  */
6902 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6903 choke me
6904 #else
6905 f = $ac_func;
6906 #endif
6907
6908 ; return 0; }
6909 EOF
6910 if { (eval echo configure:6911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6911   rm -rf conftest*
6912   eval "ac_cv_func_$ac_func=yes"
6913 else
6914   echo "configure: failed program was:" >&5
6915   cat conftest.$ac_ext >&5
6916   rm -rf conftest*
6917   eval "ac_cv_func_$ac_func=no"
6918 fi
6919 rm -f conftest*
6920 fi
6921
6922 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6923   echo "$ac_t""yes" 1>&6
6924     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6925   cat >> confdefs.h <<EOF
6926 #define $ac_tr_func 1
6927 EOF
6928  
6929 else
6930   echo "$ac_t""no" 1>&6
6931 fi
6932 done
6933
6934
6935 if test "$ac_cv_func_ctime_r" = no ; then
6936         ol_cv_func_ctime_r_nargs=0
6937 else
6938         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
6939 echo "configure:6940: checking number of arguments of ctime_r" >&5
6940 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
6941   echo $ac_n "(cached) $ac_c" 1>&6
6942 else
6943   cat > conftest.$ac_ext <<EOF
6944 #line 6945 "configure"
6945 #include "confdefs.h"
6946 #include <time.h>
6947 int main() {
6948 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
6949 ; return 0; }
6950 EOF
6951 if { (eval echo configure:6952: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6952   rm -rf conftest*
6953   ol_cv_func_ctime_r_nargs3=yes
6954 else
6955   echo "configure: failed program was:" >&5
6956   cat conftest.$ac_ext >&5
6957   rm -rf conftest*
6958   ol_cv_func_ctime_r_nargs3=no
6959 fi
6960 rm -f conftest*
6961
6962         cat > conftest.$ac_ext <<EOF
6963 #line 6964 "configure"
6964 #include "confdefs.h"
6965 #include <time.h>
6966 int main() {
6967 time_t ti; char *buffer; ctime_r(&ti,buffer);
6968 ; return 0; }
6969 EOF
6970 if { (eval echo configure:6971: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6971   rm -rf conftest*
6972   ol_cv_func_ctime_r_nargs2=yes
6973 else
6974   echo "configure: failed program was:" >&5
6975   cat conftest.$ac_ext >&5
6976   rm -rf conftest*
6977   ol_cv_func_ctime_r_nargs2=no
6978 fi
6979 rm -f conftest*
6980
6981         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
6982                 $ol_cv_func_ctime_r_nargs2 = no ; then
6983
6984                 ol_cv_func_ctime_r_nargs=3
6985
6986         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
6987                 $ol_cv_func_ctime_r_nargs2 = yes ; then
6988
6989                 ol_cv_func_ctime_r_nargs=2
6990
6991         else
6992                 ol_cv_func_ctime_r_nargs=0
6993         fi
6994   
6995 fi
6996
6997 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
6998
6999   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
7000         cat >> confdefs.h <<EOF
7001 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
7002 EOF
7003
7004   fi
7005
7006 fi
7007
7008 if test "$ac_cv_func_gethostbyname_r" = yes ; then
7009         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
7010 echo "configure:7011: checking number of arguments of gethostbyname_r" >&5
7011 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
7012   echo $ac_n "(cached) $ac_c" 1>&6
7013 else
7014   cat > conftest.$ac_ext <<EOF
7015 #line 7016 "configure"
7016 #include "confdefs.h"
7017 #include <sys/types.h>
7018 #include <sys/socket.h>
7019 #include <netinet/in.h>
7020 #include <netdb.h>
7021 #define BUFSIZE (sizeof(struct hostent)+10)
7022 int main() {
7023 struct hostent hent; char buffer[BUFSIZE];
7024                 int bufsize=BUFSIZE;int h_errno;
7025                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
7026                         buffer, bufsize, &h_errno);
7027 ; return 0; }
7028 EOF
7029 if { (eval echo configure:7030: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7030   rm -rf conftest*
7031   ol_cv_func_gethostbyname_r_nargs5=yes
7032 else
7033   echo "configure: failed program was:" >&5
7034   cat conftest.$ac_ext >&5
7035   rm -rf conftest*
7036   ol_cv_func_gethostbyname_r_nargs5=no
7037 fi
7038 rm -f conftest*
7039
7040         cat > conftest.$ac_ext <<EOF
7041 #line 7042 "configure"
7042 #include "confdefs.h"
7043 #include <sys/types.h>
7044 #include <sys/socket.h>
7045 #include <netinet/in.h>
7046 #include <netdb.h>
7047 #define BUFSIZE (sizeof(struct hostent)+10)
7048 int main() {
7049 struct hostent hent;struct hostent *rhent;
7050                 char buffer[BUFSIZE];
7051                 int bufsize=BUFSIZE;int h_errno;
7052                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
7053                         &rhent, &h_errno);
7054 ; return 0; }
7055 EOF
7056 if { (eval echo configure:7057: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7057   rm -rf conftest*
7058   ol_cv_func_gethostbyname_r_nargs6=yes
7059 else
7060   echo "configure: failed program was:" >&5
7061   cat conftest.$ac_ext >&5
7062   rm -rf conftest*
7063   ol_cv_func_gethostbyname_r_nargs6=no
7064 fi
7065 rm -f conftest*
7066
7067         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
7068                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
7069
7070                 ol_cv_func_gethostbyname_r_nargs=5
7071
7072         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
7073                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
7074
7075                 ol_cv_func_gethostbyname_r_nargs=6
7076
7077         else
7078                 ol_cv_func_gethostbyname_r_nargs=0
7079         fi
7080   
7081 fi
7082
7083 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
7084   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
7085         cat >> confdefs.h <<EOF
7086 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
7087 EOF
7088
7089   fi
7090
7091 else
7092         ol_cv_func_gethostbyname_r_nargs=0
7093 fi
7094  
7095 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
7096         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
7097 echo "configure:7098: checking number of arguments of gethostbyaddr_r" >&5
7098 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
7099   echo $ac_n "(cached) $ac_c" 1>&6
7100 else
7101   cat > conftest.$ac_ext <<EOF
7102 #line 7103 "configure"
7103 #include "confdefs.h"
7104 #include <sys/types.h>
7105 #include <sys/socket.h>
7106 #include <netinet/in.h>
7107 #include <netdb.h>
7108 #define BUFSIZE (sizeof(struct hostent)+10)
7109 int main() {
7110 struct hostent hent; char buffer[BUFSIZE]; 
7111             struct in_addr add;
7112             size_t alen=sizeof(struct in_addr);
7113             int bufsize=BUFSIZE;int h_errno;
7114                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7115                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
7116 ; return 0; }
7117 EOF
7118 if { (eval echo configure:7119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7119   rm -rf conftest*
7120   ol_cv_func_gethostbyaddr_r_nargs7=yes
7121 else
7122   echo "configure: failed program was:" >&5
7123   cat conftest.$ac_ext >&5
7124   rm -rf conftest*
7125   ol_cv_func_gethostbyaddr_r_nargs7=no
7126 fi
7127 rm -f conftest*
7128
7129         cat > conftest.$ac_ext <<EOF
7130 #line 7131 "configure"
7131 #include "confdefs.h"
7132 #include <sys/types.h>
7133 #include <sys/socket.h>
7134 #include <netinet/in.h>
7135 #include <netdb.h>
7136 #define BUFSIZE (sizeof(struct hostent)+10)
7137 int main() {
7138 struct hostent hent;
7139                 struct hostent *rhent; char buffer[BUFSIZE]; 
7140                 struct in_addr add;
7141                 size_t alen=sizeof(struct in_addr);
7142                 int bufsize=BUFSIZE;int h_errno;
7143                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7144                         alen, AF_INET, &hent, buffer, bufsize, 
7145                         &rhent, &h_errno);
7146 ; return 0; }
7147 EOF
7148 if { (eval echo configure:7149: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7149   rm -rf conftest*
7150   ol_cv_func_gethostbyaddr_r_nargs8=yes
7151 else
7152   echo "configure: failed program was:" >&5
7153   cat conftest.$ac_ext >&5
7154   rm -rf conftest*
7155   ol_cv_func_gethostbyaddr_r_nargs8=no
7156 fi
7157 rm -f conftest*
7158
7159         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
7160                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
7161
7162                 ol_cv_func_gethostbyaddr_r_nargs=7
7163
7164         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
7165                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
7166
7167                 ol_cv_func_gethostbyaddr_r_nargs=8
7168
7169         else
7170                 ol_cv_func_gethostbyaddr_r_nargs=0
7171         fi
7172   
7173 fi
7174
7175 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
7176   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
7177     cat >> confdefs.h <<EOF
7178 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
7179 EOF
7180
7181   fi
7182
7183 else
7184         ol_cv_func_gethostbyaddr_r_nargs=0
7185 fi
7186
7187 if test "$ac_cv_func_ctime_r" = yes \
7188         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
7189         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
7190         -a "$ac_cv_func_gethostbyname_r" = yes \
7191         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
7192         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
7193         -a "$ac_cv_func_gethostbyaddr_r" = yes \
7194         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
7195         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
7196         ; then
7197  
7198         cat >> confdefs.h <<\EOF
7199 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
7200 EOF
7201
7202 fi
7203
7204 ol_link_threads=no
7205
7206 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7207         -o $ol_with_threads = nt ; then
7208
7209         
7210         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
7211 echo "configure:7212: checking for _beginthread" >&5
7212 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
7213   echo $ac_n "(cached) $ac_c" 1>&6
7214 else
7215   cat > conftest.$ac_ext <<EOF
7216 #line 7217 "configure"
7217 #include "confdefs.h"
7218 /* System header to define __stub macros and hopefully few prototypes,
7219     which can conflict with char _beginthread(); below.  */
7220 #include <assert.h>
7221 /* Override any gcc2 internal prototype to avoid an error.  */
7222 /* We use char because int might match the return type of a gcc2
7223     builtin and then its argument prototype would still apply.  */
7224 char _beginthread();
7225 char (*f)();
7226
7227 int main() {
7228
7229 /* The GNU C library defines this for functions which it implements
7230     to always fail with ENOSYS.  Some functions are actually named
7231     something starting with __ and the normal name is an alias.  */
7232 #if defined (__stub__beginthread) || defined (__stub____beginthread)
7233 choke me
7234 #else
7235 f = _beginthread;
7236 #endif
7237
7238 ; return 0; }
7239 EOF
7240 if { (eval echo configure:7241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7241   rm -rf conftest*
7242   eval "ac_cv_func__beginthread=yes"
7243 else
7244   echo "configure: failed program was:" >&5
7245   cat conftest.$ac_ext >&5
7246   rm -rf conftest*
7247   eval "ac_cv_func__beginthread=no"
7248 fi
7249 rm -f conftest*
7250 fi
7251
7252 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
7253   echo "$ac_t""yes" 1>&6
7254   :
7255 else
7256   echo "$ac_t""no" 1>&6
7257 fi
7258
7259
7260         if test $ac_cv_func__beginthread = yes ; then
7261                 cat >> confdefs.h <<\EOF
7262 #define HAVE_NT_THREADS 1
7263 EOF
7264
7265         fi
7266
7267
7268         if test "$ol_cv_nt_threads" = yes ; then
7269         ol_link_threads=nt
7270         ol_with_threads=found
7271         ol_with_yielding_select=yes
7272
7273                 cat >> confdefs.h <<\EOF
7274 #define HAVE_NT_SERVICE_MANAGER 1
7275 EOF
7276
7277                 cat >> confdefs.h <<\EOF
7278 #define HAVE_NT_EVENT_LOG 1
7279 EOF
7280
7281         fi
7282
7283         if test $ol_with_threads = nt ; then
7284                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
7285         fi
7286 fi
7287
7288 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7289         -o $ol_with_threads = posix ; then
7290
7291         for ac_hdr in pthread.h
7292 do
7293 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7294 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7295 echo "configure:7296: checking for $ac_hdr" >&5
7296 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7297   echo $ac_n "(cached) $ac_c" 1>&6
7298 else
7299   cat > conftest.$ac_ext <<EOF
7300 #line 7301 "configure"
7301 #include "confdefs.h"
7302 #include <$ac_hdr>
7303 EOF
7304 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7305 { (eval echo configure:7306: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7306 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7307 if test -z "$ac_err"; then
7308   rm -rf conftest*
7309   eval "ac_cv_header_$ac_safe=yes"
7310 else
7311   echo "$ac_err" >&5
7312   echo "configure: failed program was:" >&5
7313   cat conftest.$ac_ext >&5
7314   rm -rf conftest*
7315   eval "ac_cv_header_$ac_safe=no"
7316 fi
7317 rm -f conftest*
7318 fi
7319 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7320   echo "$ac_t""yes" 1>&6
7321     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7322   cat >> confdefs.h <<EOF
7323 #define $ac_tr_hdr 1
7324 EOF
7325  
7326 else
7327   echo "$ac_t""no" 1>&6
7328 fi
7329 done
7330
7331
7332         if test $ac_cv_header_pthread_h = yes ; then
7333                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
7334 echo "configure:7335: checking POSIX thread version" >&5
7335 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
7336   echo $ac_n "(cached) $ac_c" 1>&6
7337 else
7338   
7339         cat > conftest.$ac_ext <<EOF
7340 #line 7341 "configure"
7341 #include "confdefs.h"
7342
7343 #               include <pthread.h>
7344                 /* this check could be improved */
7345 #               ifdef PTHREAD_ONCE_INIT
7346                         pthread_version_final;
7347 #               endif
7348         
7349 EOF
7350 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7351   egrep "pthread_version_final" >/dev/null 2>&1; then
7352   rm -rf conftest*
7353   ol_pthread_final=yes
7354 else
7355   rm -rf conftest*
7356   ol_pthread_final=no
7357 fi
7358 rm -f conftest*
7359
7360
7361         cat > conftest.$ac_ext <<EOF
7362 #line 7363 "configure"
7363 #include "confdefs.h"
7364
7365 #               include <pthread.h>
7366                 /* this check could be improved */
7367 #               ifdef pthread_once_init
7368                         pthread_version_draft4;
7369 #               endif
7370         
7371 EOF
7372 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7373   egrep "pthread_version_draft4" >/dev/null 2>&1; then
7374   rm -rf conftest*
7375   ol_pthread_draft4=yes
7376 else
7377   rm -rf conftest*
7378   ol_pthread_draft4=no
7379 fi
7380 rm -f conftest*
7381
7382
7383         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
7384                 ol_cv_pthread_version=final
7385         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
7386                 ol_cv_pthread_version=draft4
7387         else
7388                 ol_cv_pthread_version=unknown
7389         fi
7390
7391 fi
7392
7393 echo "$ac_t""$ol_cv_pthread_version" 1>&6
7394
7395
7396                 if test $ol_cv_pthread_version = final ; then
7397                         cat >> confdefs.h <<\EOF
7398 #define HAVE_PTHREADS_FINAL 1
7399 EOF
7400
7401                 elif test $ol_cv_pthread_version = draft4 ; then
7402                         cat >> confdefs.h <<\EOF
7403 #define HAVE_PTHREADS_D4 1
7404 EOF
7405
7406                 else
7407                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
7408                 fi
7409
7410                 # consider threads found
7411                 ol_with_threads=found
7412
7413                 
7414         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
7415 echo "configure:7416: checking for LinuxThreads pthread.h" >&5
7416 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
7417   echo $ac_n "(cached) $ac_c" 1>&6
7418 else
7419   cat > conftest.$ac_ext <<EOF
7420 #line 7421 "configure"
7421 #include "confdefs.h"
7422 #include <pthread.h>
7423 EOF
7424 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7425   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
7426   rm -rf conftest*
7427   ol_cv_header_linux_threads=yes
7428 else
7429   rm -rf conftest*
7430   ol_cv_header_linux_threads=no
7431 fi
7432 rm -f conftest*
7433
7434                 
7435 fi
7436
7437 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
7438         if test $ol_cv_header_linux_threads = yes; then
7439                 cat >> confdefs.h <<\EOF
7440 #define HAVE_LINUX_THREADS 1
7441 EOF
7442
7443         fi
7444
7445                 
7446         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
7447 echo "configure:7448: checking for GNU Pth pthread.h" >&5
7448 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
7449   echo $ac_n "(cached) $ac_c" 1>&6
7450 else
7451   cat > conftest.$ac_ext <<EOF
7452 #line 7453 "configure"
7453 #include "confdefs.h"
7454 #include <pthread.h>
7455 #ifdef _POSIX_THREAD_IS_GNU_PTH
7456         __gnu_pth__;
7457 #endif
7458
7459 EOF
7460 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7461   egrep "__gnu_pth__" >/dev/null 2>&1; then
7462   rm -rf conftest*
7463   ol_cv_header_gnu_pth_pthread_h=yes
7464 else
7465   rm -rf conftest*
7466   ol_cv_header_gnu_pth_pthread_h=no
7467 fi
7468 rm -f conftest*
7469
7470                 
7471 fi
7472
7473 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
7474
7475
7476                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
7477                         for ac_hdr in sched.h
7478 do
7479 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7480 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7481 echo "configure:7482: checking for $ac_hdr" >&5
7482 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7483   echo $ac_n "(cached) $ac_c" 1>&6
7484 else
7485   cat > conftest.$ac_ext <<EOF
7486 #line 7487 "configure"
7487 #include "confdefs.h"
7488 #include <$ac_hdr>
7489 EOF
7490 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7491 { (eval echo configure:7492: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7492 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7493 if test -z "$ac_err"; then
7494   rm -rf conftest*
7495   eval "ac_cv_header_$ac_safe=yes"
7496 else
7497   echo "$ac_err" >&5
7498   echo "configure: failed program was:" >&5
7499   cat conftest.$ac_ext >&5
7500   rm -rf conftest*
7501   eval "ac_cv_header_$ac_safe=no"
7502 fi
7503 rm -f conftest*
7504 fi
7505 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7506   echo "$ac_t""yes" 1>&6
7507     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7508   cat >> confdefs.h <<EOF
7509 #define $ac_tr_hdr 1
7510 EOF
7511  
7512 else
7513   echo "$ac_t""no" 1>&6
7514 fi
7515 done
7516
7517                 fi
7518
7519                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
7520                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
7521 echo "configure:7522: checking for pthread_create in default libraries" >&5
7522 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
7523   echo $ac_n "(cached) $ac_c" 1>&6
7524 else
7525   
7526                 if test "$cross_compiling" = yes; then
7527   cat > conftest.$ac_ext <<EOF
7528 #line 7529 "configure"
7529 #include "confdefs.h"
7530 /* pthread test headers */
7531 #include <pthread.h>
7532 #ifndef NULL
7533 #define NULL (void*)0
7534 #endif
7535
7536 static void *task(p)
7537         void *p;
7538 {
7539         return (void *) (p == NULL);
7540 }
7541
7542 int main() {
7543
7544         /* pthread test function */
7545         pthread_t t;
7546         int status;
7547 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7548         /* This system (e.g. AIX) defaults detached; must override */
7549         pthread_attr_t attr;
7550
7551         status = pthread_attr_init(&attr);
7552         if( status ) exit( status );
7553
7554         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7555         if( status ) exit( status );
7556
7557 #       define  ATTR    &attr
7558 #elif defined( HAVE_PTHREADS_D4 )
7559 #       define  ATTR    pthread_attr_default
7560 #else
7561 #       define  ATTR    NULL
7562 #endif
7563
7564         /* make sure pthread_create() isn't just a stub */
7565         status = pthread_create(&t, ATTR, task, NULL);
7566         if( status ) exit( status );
7567
7568         /* give the thread a chance to complete...
7569      * it should remain joinable and hence detachable
7570          */
7571         sleep( 1 );
7572
7573         /* make sure pthread_detach() isn't just a stub */
7574 #if HAVE_PTHREADS_D4
7575         status = pthread_detach( &t );
7576 #else
7577         status = pthread_detach( t );
7578 #endif
7579
7580 #ifdef HAVE_LINUX_THREADS
7581         pthread_kill_other_threads_np();
7582 #endif
7583
7584         exit( status );
7585
7586 ; return 0; }
7587 EOF
7588 if { (eval echo configure:7589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7589   rm -rf conftest*
7590   ol_cv_pthread_create=yes
7591 else
7592   echo "configure: failed program was:" >&5
7593   cat conftest.$ac_ext >&5
7594   rm -rf conftest*
7595   ol_cv_pthread_create=no
7596 fi
7597 rm -f conftest*
7598 else
7599   cat > conftest.$ac_ext <<EOF
7600 #line 7601 "configure"
7601 #include "confdefs.h"
7602 /* pthread test headers */
7603 #include <pthread.h>
7604 #ifndef NULL
7605 #define NULL (void*)0
7606 #endif
7607
7608 static void *task(p)
7609         void *p;
7610 {
7611         return (void *) (p == NULL);
7612 }
7613
7614
7615 int main(argc, argv)
7616         int argc;
7617         char **argv;
7618 {
7619
7620         /* pthread test function */
7621         pthread_t t;
7622         int status;
7623 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7624         /* This system (e.g. AIX) defaults detached; must override */
7625         pthread_attr_t attr;
7626
7627         status = pthread_attr_init(&attr);
7628         if( status ) exit( status );
7629
7630         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7631         if( status ) exit( status );
7632
7633 #       define  ATTR    &attr
7634 #elif defined( HAVE_PTHREADS_D4 )
7635 #       define  ATTR    pthread_attr_default
7636 #else
7637 #       define  ATTR    NULL
7638 #endif
7639
7640         /* make sure pthread_create() isn't just a stub */
7641         status = pthread_create(&t, ATTR, task, NULL);
7642         if( status ) exit( status );
7643
7644         /* give the thread a chance to complete...
7645      * it should remain joinable and hence detachable
7646          */
7647         sleep( 1 );
7648
7649         /* make sure pthread_detach() isn't just a stub */
7650 #if HAVE_PTHREADS_D4
7651         status = pthread_detach( &t );
7652 #else
7653         status = pthread_detach( t );
7654 #endif
7655
7656 #ifdef HAVE_LINUX_THREADS
7657         pthread_kill_other_threads_np();
7658 #endif
7659
7660         exit( status );
7661
7662 }
7663
7664 EOF
7665 if { (eval echo configure:7666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7666 then
7667   ol_cv_pthread_create=yes
7668 else
7669   echo "configure: failed program was:" >&5
7670   cat conftest.$ac_ext >&5
7671   rm -fr conftest*
7672   ol_cv_pthread_create=no
7673 fi
7674 rm -fr conftest*
7675 fi
7676
7677 fi
7678
7679 echo "$ac_t""$ol_cv_pthread_create" 1>&6
7680
7681                 if test $ol_cv_pthread_create != no ; then
7682                         ol_link_threads=posix
7683                         ol_link_pthreads=""
7684                 fi
7685                 
7686                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
7687 if test "$ol_link_threads" = no ; then
7688         # try -kthread
7689         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
7690 echo "configure:7691: checking for pthread link with -kthread" >&5
7691 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
7692   echo $ac_n "(cached) $ac_c" 1>&6
7693 else
7694   
7695                 # save the flags
7696                 ol_LIBS="$LIBS"
7697                 LIBS="-kthread $LIBS"
7698
7699                 if test "$cross_compiling" = yes; then
7700   cat > conftest.$ac_ext <<EOF
7701 #line 7702 "configure"
7702 #include "confdefs.h"
7703 /* pthread test headers */
7704 #include <pthread.h>
7705 #ifndef NULL
7706 #define NULL (void*)0
7707 #endif
7708
7709 static void *task(p)
7710         void *p;
7711 {
7712         return (void *) (p == NULL);
7713 }
7714
7715 int main() {
7716
7717         /* pthread test function */
7718         pthread_t t;
7719         int status;
7720 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7721         /* This system (e.g. AIX) defaults detached; must override */
7722         pthread_attr_t attr;
7723
7724         status = pthread_attr_init(&attr);
7725         if( status ) exit( status );
7726
7727         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7728         if( status ) exit( status );
7729
7730 #       define  ATTR    &attr
7731 #elif defined( HAVE_PTHREADS_D4 )
7732 #       define  ATTR    pthread_attr_default
7733 #else
7734 #       define  ATTR    NULL
7735 #endif
7736
7737         /* make sure pthread_create() isn't just a stub */
7738         status = pthread_create(&t, ATTR, task, NULL);
7739         if( status ) exit( status );
7740
7741         /* give the thread a chance to complete...
7742      * it should remain joinable and hence detachable
7743          */
7744         sleep( 1 );
7745
7746         /* make sure pthread_detach() isn't just a stub */
7747 #if HAVE_PTHREADS_D4
7748         status = pthread_detach( &t );
7749 #else
7750         status = pthread_detach( t );
7751 #endif
7752
7753 #ifdef HAVE_LINUX_THREADS
7754         pthread_kill_other_threads_np();
7755 #endif
7756
7757         exit( status );
7758
7759 ; return 0; }
7760 EOF
7761 if { (eval echo configure:7762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7762   rm -rf conftest*
7763   ol_cv_pthread_kthread=yes
7764 else
7765   echo "configure: failed program was:" >&5
7766   cat conftest.$ac_ext >&5
7767   rm -rf conftest*
7768   ol_cv_pthread_kthread=no
7769 fi
7770 rm -f conftest*
7771 else
7772   cat > conftest.$ac_ext <<EOF
7773 #line 7774 "configure"
7774 #include "confdefs.h"
7775 /* pthread test headers */
7776 #include <pthread.h>
7777 #ifndef NULL
7778 #define NULL (void*)0
7779 #endif
7780
7781 static void *task(p)
7782         void *p;
7783 {
7784         return (void *) (p == NULL);
7785 }
7786
7787
7788 int main(argc, argv)
7789         int argc;
7790         char **argv;
7791 {
7792
7793         /* pthread test function */
7794         pthread_t t;
7795         int status;
7796 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7797         /* This system (e.g. AIX) defaults detached; must override */
7798         pthread_attr_t attr;
7799
7800         status = pthread_attr_init(&attr);
7801         if( status ) exit( status );
7802
7803         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7804         if( status ) exit( status );
7805
7806 #       define  ATTR    &attr
7807 #elif defined( HAVE_PTHREADS_D4 )
7808 #       define  ATTR    pthread_attr_default
7809 #else
7810 #       define  ATTR    NULL
7811 #endif
7812
7813         /* make sure pthread_create() isn't just a stub */
7814         status = pthread_create(&t, ATTR, task, NULL);
7815         if( status ) exit( status );
7816
7817         /* give the thread a chance to complete...
7818      * it should remain joinable and hence detachable
7819          */
7820         sleep( 1 );
7821
7822         /* make sure pthread_detach() isn't just a stub */
7823 #if HAVE_PTHREADS_D4
7824         status = pthread_detach( &t );
7825 #else
7826         status = pthread_detach( t );
7827 #endif
7828
7829 #ifdef HAVE_LINUX_THREADS
7830         pthread_kill_other_threads_np();
7831 #endif
7832
7833         exit( status );
7834
7835 }
7836
7837 EOF
7838 if { (eval echo configure:7839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7839 then
7840   ol_cv_pthread_kthread=yes
7841 else
7842   echo "configure: failed program was:" >&5
7843   cat conftest.$ac_ext >&5
7844   rm -fr conftest*
7845   ol_cv_pthread_kthread=no
7846 fi
7847 rm -fr conftest*
7848 fi
7849
7850
7851                 # restore the LIBS
7852                 LIBS="$ol_LIBS"
7853         
7854 fi
7855
7856 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
7857
7858         if test $ol_cv_pthread_kthread = yes ; then
7859                 ol_link_pthreads="-kthread"
7860                 ol_link_threads=posix
7861         fi
7862 fi
7863
7864                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
7865 if test "$ol_link_threads" = no ; then
7866         # try -pthread
7867         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
7868 echo "configure:7869: checking for pthread link with -pthread" >&5
7869 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
7870   echo $ac_n "(cached) $ac_c" 1>&6
7871 else
7872   
7873                 # save the flags
7874                 ol_LIBS="$LIBS"
7875                 LIBS="-pthread $LIBS"
7876
7877                 if test "$cross_compiling" = yes; then
7878   cat > conftest.$ac_ext <<EOF
7879 #line 7880 "configure"
7880 #include "confdefs.h"
7881 /* pthread test headers */
7882 #include <pthread.h>
7883 #ifndef NULL
7884 #define NULL (void*)0
7885 #endif
7886
7887 static void *task(p)
7888         void *p;
7889 {
7890         return (void *) (p == NULL);
7891 }
7892
7893 int main() {
7894
7895         /* pthread test function */
7896         pthread_t t;
7897         int status;
7898 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7899         /* This system (e.g. AIX) defaults detached; must override */
7900         pthread_attr_t attr;
7901
7902         status = pthread_attr_init(&attr);
7903         if( status ) exit( status );
7904
7905         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7906         if( status ) exit( status );
7907
7908 #       define  ATTR    &attr
7909 #elif defined( HAVE_PTHREADS_D4 )
7910 #       define  ATTR    pthread_attr_default
7911 #else
7912 #       define  ATTR    NULL
7913 #endif
7914
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         /* give the thread a chance to complete...
7920      * it should remain joinable and hence detachable
7921          */
7922         sleep( 1 );
7923
7924         /* make sure pthread_detach() isn't just a stub */
7925 #if HAVE_PTHREADS_D4
7926         status = pthread_detach( &t );
7927 #else
7928         status = pthread_detach( t );
7929 #endif
7930
7931 #ifdef HAVE_LINUX_THREADS
7932         pthread_kill_other_threads_np();
7933 #endif
7934
7935         exit( status );
7936
7937 ; return 0; }
7938 EOF
7939 if { (eval echo configure:7940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7940   rm -rf conftest*
7941   ol_cv_pthread_pthread=yes
7942 else
7943   echo "configure: failed program was:" >&5
7944   cat conftest.$ac_ext >&5
7945   rm -rf conftest*
7946   ol_cv_pthread_pthread=no
7947 fi
7948 rm -f conftest*
7949 else
7950   cat > conftest.$ac_ext <<EOF
7951 #line 7952 "configure"
7952 #include "confdefs.h"
7953 /* pthread test headers */
7954 #include <pthread.h>
7955 #ifndef NULL
7956 #define NULL (void*)0
7957 #endif
7958
7959 static void *task(p)
7960         void *p;
7961 {
7962         return (void *) (p == NULL);
7963 }
7964
7965
7966 int main(argc, argv)
7967         int argc;
7968         char **argv;
7969 {
7970
7971         /* pthread test function */
7972         pthread_t t;
7973         int status;
7974 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7975         /* This system (e.g. AIX) defaults detached; must override */
7976         pthread_attr_t attr;
7977
7978         status = pthread_attr_init(&attr);
7979         if( status ) exit( status );
7980
7981         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7982         if( status ) exit( status );
7983
7984 #       define  ATTR    &attr
7985 #elif defined( HAVE_PTHREADS_D4 )
7986 #       define  ATTR    pthread_attr_default
7987 #else
7988 #       define  ATTR    NULL
7989 #endif
7990
7991         /* make sure pthread_create() isn't just a stub */
7992         status = pthread_create(&t, ATTR, task, NULL);
7993         if( status ) exit( status );
7994
7995         /* give the thread a chance to complete...
7996      * it should remain joinable and hence detachable
7997          */
7998         sleep( 1 );
7999
8000         /* make sure pthread_detach() isn't just a stub */
8001 #if HAVE_PTHREADS_D4
8002         status = pthread_detach( &t );
8003 #else
8004         status = pthread_detach( t );
8005 #endif
8006
8007 #ifdef HAVE_LINUX_THREADS
8008         pthread_kill_other_threads_np();
8009 #endif
8010
8011         exit( status );
8012
8013 }
8014
8015 EOF
8016 if { (eval echo configure:8017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8017 then
8018   ol_cv_pthread_pthread=yes
8019 else
8020   echo "configure: failed program was:" >&5
8021   cat conftest.$ac_ext >&5
8022   rm -fr conftest*
8023   ol_cv_pthread_pthread=no
8024 fi
8025 rm -fr conftest*
8026 fi
8027
8028
8029                 # restore the LIBS
8030                 LIBS="$ol_LIBS"
8031         
8032 fi
8033
8034 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
8035
8036         if test $ol_cv_pthread_pthread = yes ; then
8037                 ol_link_pthreads="-pthread"
8038                 ol_link_threads=posix
8039         fi
8040 fi
8041
8042                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
8043 if test "$ol_link_threads" = no ; then
8044         # try -pthreads
8045         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
8046 echo "configure:8047: checking for pthread link with -pthreads" >&5
8047 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
8048   echo $ac_n "(cached) $ac_c" 1>&6
8049 else
8050   
8051                 # save the flags
8052                 ol_LIBS="$LIBS"
8053                 LIBS="-pthreads $LIBS"
8054
8055                 if test "$cross_compiling" = yes; then
8056   cat > conftest.$ac_ext <<EOF
8057 #line 8058 "configure"
8058 #include "confdefs.h"
8059 /* pthread test headers */
8060 #include <pthread.h>
8061 #ifndef NULL
8062 #define NULL (void*)0
8063 #endif
8064
8065 static void *task(p)
8066         void *p;
8067 {
8068         return (void *) (p == NULL);
8069 }
8070
8071 int main() {
8072
8073         /* pthread test function */
8074         pthread_t t;
8075         int status;
8076 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8077         /* This system (e.g. AIX) defaults detached; must override */
8078         pthread_attr_t attr;
8079
8080         status = pthread_attr_init(&attr);
8081         if( status ) exit( status );
8082
8083         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8084         if( status ) exit( status );
8085
8086 #       define  ATTR    &attr
8087 #elif defined( HAVE_PTHREADS_D4 )
8088 #       define  ATTR    pthread_attr_default
8089 #else
8090 #       define  ATTR    NULL
8091 #endif
8092
8093         /* make sure pthread_create() isn't just a stub */
8094         status = pthread_create(&t, ATTR, task, NULL);
8095         if( status ) exit( status );
8096
8097         /* give the thread a chance to complete...
8098      * it should remain joinable and hence detachable
8099          */
8100         sleep( 1 );
8101
8102         /* make sure pthread_detach() isn't just a stub */
8103 #if HAVE_PTHREADS_D4
8104         status = pthread_detach( &t );
8105 #else
8106         status = pthread_detach( t );
8107 #endif
8108
8109 #ifdef HAVE_LINUX_THREADS
8110         pthread_kill_other_threads_np();
8111 #endif
8112
8113         exit( status );
8114
8115 ; return 0; }
8116 EOF
8117 if { (eval echo configure:8118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8118   rm -rf conftest*
8119   ol_cv_pthread_pthreads=yes
8120 else
8121   echo "configure: failed program was:" >&5
8122   cat conftest.$ac_ext >&5
8123   rm -rf conftest*
8124   ol_cv_pthread_pthreads=no
8125 fi
8126 rm -f conftest*
8127 else
8128   cat > conftest.$ac_ext <<EOF
8129 #line 8130 "configure"
8130 #include "confdefs.h"
8131 /* pthread test headers */
8132 #include <pthread.h>
8133 #ifndef NULL
8134 #define NULL (void*)0
8135 #endif
8136
8137 static void *task(p)
8138         void *p;
8139 {
8140         return (void *) (p == NULL);
8141 }
8142
8143
8144 int main(argc, argv)
8145         int argc;
8146         char **argv;
8147 {
8148
8149         /* pthread test function */
8150         pthread_t t;
8151         int status;
8152 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8153         /* This system (e.g. AIX) defaults detached; must override */
8154         pthread_attr_t attr;
8155
8156         status = pthread_attr_init(&attr);
8157         if( status ) exit( status );
8158
8159         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8160         if( status ) exit( status );
8161
8162 #       define  ATTR    &attr
8163 #elif defined( HAVE_PTHREADS_D4 )
8164 #       define  ATTR    pthread_attr_default
8165 #else
8166 #       define  ATTR    NULL
8167 #endif
8168
8169         /* make sure pthread_create() isn't just a stub */
8170         status = pthread_create(&t, ATTR, task, NULL);
8171         if( status ) exit( status );
8172
8173         /* give the thread a chance to complete...
8174      * it should remain joinable and hence detachable
8175          */
8176         sleep( 1 );
8177
8178         /* make sure pthread_detach() isn't just a stub */
8179 #if HAVE_PTHREADS_D4
8180         status = pthread_detach( &t );
8181 #else
8182         status = pthread_detach( t );
8183 #endif
8184
8185 #ifdef HAVE_LINUX_THREADS
8186         pthread_kill_other_threads_np();
8187 #endif
8188
8189         exit( status );
8190
8191 }
8192
8193 EOF
8194 if { (eval echo configure:8195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8195 then
8196   ol_cv_pthread_pthreads=yes
8197 else
8198   echo "configure: failed program was:" >&5
8199   cat conftest.$ac_ext >&5
8200   rm -fr conftest*
8201   ol_cv_pthread_pthreads=no
8202 fi
8203 rm -fr conftest*
8204 fi
8205
8206
8207                 # restore the LIBS
8208                 LIBS="$ol_LIBS"
8209         
8210 fi
8211
8212 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
8213
8214         if test $ol_cv_pthread_pthreads = yes ; then
8215                 ol_link_pthreads="-pthreads"
8216                 ol_link_threads=posix
8217         fi
8218 fi
8219
8220                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
8221 if test "$ol_link_threads" = no ; then
8222         # try -mthreads
8223         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
8224 echo "configure:8225: checking for pthread link with -mthreads" >&5
8225 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
8226   echo $ac_n "(cached) $ac_c" 1>&6
8227 else
8228   
8229                 # save the flags
8230                 ol_LIBS="$LIBS"
8231                 LIBS="-mthreads $LIBS"
8232
8233                 if test "$cross_compiling" = yes; then
8234   cat > conftest.$ac_ext <<EOF
8235 #line 8236 "configure"
8236 #include "confdefs.h"
8237 /* pthread test headers */
8238 #include <pthread.h>
8239 #ifndef NULL
8240 #define NULL (void*)0
8241 #endif
8242
8243 static void *task(p)
8244         void *p;
8245 {
8246         return (void *) (p == NULL);
8247 }
8248
8249 int main() {
8250
8251         /* pthread test function */
8252         pthread_t t;
8253         int status;
8254 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8255         /* This system (e.g. AIX) defaults detached; must override */
8256         pthread_attr_t attr;
8257
8258         status = pthread_attr_init(&attr);
8259         if( status ) exit( status );
8260
8261         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8262         if( status ) exit( status );
8263
8264 #       define  ATTR    &attr
8265 #elif defined( HAVE_PTHREADS_D4 )
8266 #       define  ATTR    pthread_attr_default
8267 #else
8268 #       define  ATTR    NULL
8269 #endif
8270
8271         /* make sure pthread_create() isn't just a stub */
8272         status = pthread_create(&t, ATTR, task, NULL);
8273         if( status ) exit( status );
8274
8275         /* give the thread a chance to complete...
8276      * it should remain joinable and hence detachable
8277          */
8278         sleep( 1 );
8279
8280         /* make sure pthread_detach() isn't just a stub */
8281 #if HAVE_PTHREADS_D4
8282         status = pthread_detach( &t );
8283 #else
8284         status = pthread_detach( t );
8285 #endif
8286
8287 #ifdef HAVE_LINUX_THREADS
8288         pthread_kill_other_threads_np();
8289 #endif
8290
8291         exit( status );
8292
8293 ; return 0; }
8294 EOF
8295 if { (eval echo configure:8296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8296   rm -rf conftest*
8297   ol_cv_pthread_mthreads=yes
8298 else
8299   echo "configure: failed program was:" >&5
8300   cat conftest.$ac_ext >&5
8301   rm -rf conftest*
8302   ol_cv_pthread_mthreads=no
8303 fi
8304 rm -f conftest*
8305 else
8306   cat > conftest.$ac_ext <<EOF
8307 #line 8308 "configure"
8308 #include "confdefs.h"
8309 /* pthread test headers */
8310 #include <pthread.h>
8311 #ifndef NULL
8312 #define NULL (void*)0
8313 #endif
8314
8315 static void *task(p)
8316         void *p;
8317 {
8318         return (void *) (p == NULL);
8319 }
8320
8321
8322 int main(argc, argv)
8323         int argc;
8324         char **argv;
8325 {
8326
8327         /* pthread test function */
8328         pthread_t t;
8329         int status;
8330 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8331         /* This system (e.g. AIX) defaults detached; must override */
8332         pthread_attr_t attr;
8333
8334         status = pthread_attr_init(&attr);
8335         if( status ) exit( status );
8336
8337         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8338         if( status ) exit( status );
8339
8340 #       define  ATTR    &attr
8341 #elif defined( HAVE_PTHREADS_D4 )
8342 #       define  ATTR    pthread_attr_default
8343 #else
8344 #       define  ATTR    NULL
8345 #endif
8346
8347         /* make sure pthread_create() isn't just a stub */
8348         status = pthread_create(&t, ATTR, task, NULL);
8349         if( status ) exit( status );
8350
8351         /* give the thread a chance to complete...
8352      * it should remain joinable and hence detachable
8353          */
8354         sleep( 1 );
8355
8356         /* make sure pthread_detach() isn't just a stub */
8357 #if HAVE_PTHREADS_D4
8358         status = pthread_detach( &t );
8359 #else
8360         status = pthread_detach( t );
8361 #endif
8362
8363 #ifdef HAVE_LINUX_THREADS
8364         pthread_kill_other_threads_np();
8365 #endif
8366
8367         exit( status );
8368
8369 }
8370
8371 EOF
8372 if { (eval echo configure:8373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8373 then
8374   ol_cv_pthread_mthreads=yes
8375 else
8376   echo "configure: failed program was:" >&5
8377   cat conftest.$ac_ext >&5
8378   rm -fr conftest*
8379   ol_cv_pthread_mthreads=no
8380 fi
8381 rm -fr conftest*
8382 fi
8383
8384
8385                 # restore the LIBS
8386                 LIBS="$ol_LIBS"
8387         
8388 fi
8389
8390 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
8391
8392         if test $ol_cv_pthread_mthreads = yes ; then
8393                 ol_link_pthreads="-mthreads"
8394                 ol_link_threads=posix
8395         fi
8396 fi
8397
8398                 # Pthread try link: -thread (ol_cv_pthread_thread)
8399 if test "$ol_link_threads" = no ; then
8400         # try -thread
8401         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
8402 echo "configure:8403: checking for pthread link with -thread" >&5
8403 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
8404   echo $ac_n "(cached) $ac_c" 1>&6
8405 else
8406   
8407                 # save the flags
8408                 ol_LIBS="$LIBS"
8409                 LIBS="-thread $LIBS"
8410
8411                 if test "$cross_compiling" = yes; then
8412   cat > conftest.$ac_ext <<EOF
8413 #line 8414 "configure"
8414 #include "confdefs.h"
8415 /* pthread test headers */
8416 #include <pthread.h>
8417 #ifndef NULL
8418 #define NULL (void*)0
8419 #endif
8420
8421 static void *task(p)
8422         void *p;
8423 {
8424         return (void *) (p == NULL);
8425 }
8426
8427 int main() {
8428
8429         /* pthread test function */
8430         pthread_t t;
8431         int status;
8432 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8433         /* This system (e.g. AIX) defaults detached; must override */
8434         pthread_attr_t attr;
8435
8436         status = pthread_attr_init(&attr);
8437         if( status ) exit( status );
8438
8439         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8440         if( status ) exit( status );
8441
8442 #       define  ATTR    &attr
8443 #elif defined( HAVE_PTHREADS_D4 )
8444 #       define  ATTR    pthread_attr_default
8445 #else
8446 #       define  ATTR    NULL
8447 #endif
8448
8449         /* make sure pthread_create() isn't just a stub */
8450         status = pthread_create(&t, ATTR, task, NULL);
8451         if( status ) exit( status );
8452
8453         /* give the thread a chance to complete...
8454      * it should remain joinable and hence detachable
8455          */
8456         sleep( 1 );
8457
8458         /* make sure pthread_detach() isn't just a stub */
8459 #if HAVE_PTHREADS_D4
8460         status = pthread_detach( &t );
8461 #else
8462         status = pthread_detach( t );
8463 #endif
8464
8465 #ifdef HAVE_LINUX_THREADS
8466         pthread_kill_other_threads_np();
8467 #endif
8468
8469         exit( status );
8470
8471 ; return 0; }
8472 EOF
8473 if { (eval echo configure:8474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8474   rm -rf conftest*
8475   ol_cv_pthread_thread=yes
8476 else
8477   echo "configure: failed program was:" >&5
8478   cat conftest.$ac_ext >&5
8479   rm -rf conftest*
8480   ol_cv_pthread_thread=no
8481 fi
8482 rm -f conftest*
8483 else
8484   cat > conftest.$ac_ext <<EOF
8485 #line 8486 "configure"
8486 #include "confdefs.h"
8487 /* pthread test headers */
8488 #include <pthread.h>
8489 #ifndef NULL
8490 #define NULL (void*)0
8491 #endif
8492
8493 static void *task(p)
8494         void *p;
8495 {
8496         return (void *) (p == NULL);
8497 }
8498
8499
8500 int main(argc, argv)
8501         int argc;
8502         char **argv;
8503 {
8504
8505         /* pthread test function */
8506         pthread_t t;
8507         int status;
8508 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8509         /* This system (e.g. AIX) defaults detached; must override */
8510         pthread_attr_t attr;
8511
8512         status = pthread_attr_init(&attr);
8513         if( status ) exit( status );
8514
8515         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8516         if( status ) exit( status );
8517
8518 #       define  ATTR    &attr
8519 #elif defined( HAVE_PTHREADS_D4 )
8520 #       define  ATTR    pthread_attr_default
8521 #else
8522 #       define  ATTR    NULL
8523 #endif
8524
8525         /* make sure pthread_create() isn't just a stub */
8526         status = pthread_create(&t, ATTR, task, NULL);
8527         if( status ) exit( status );
8528
8529         /* give the thread a chance to complete...
8530      * it should remain joinable and hence detachable
8531          */
8532         sleep( 1 );
8533
8534         /* make sure pthread_detach() isn't just a stub */
8535 #if HAVE_PTHREADS_D4
8536         status = pthread_detach( &t );
8537 #else
8538         status = pthread_detach( t );
8539 #endif
8540
8541 #ifdef HAVE_LINUX_THREADS
8542         pthread_kill_other_threads_np();
8543 #endif
8544
8545         exit( status );
8546
8547 }
8548
8549 EOF
8550 if { (eval echo configure:8551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8551 then
8552   ol_cv_pthread_thread=yes
8553 else
8554   echo "configure: failed program was:" >&5
8555   cat conftest.$ac_ext >&5
8556   rm -fr conftest*
8557   ol_cv_pthread_thread=no
8558 fi
8559 rm -fr conftest*
8560 fi
8561
8562
8563                 # restore the LIBS
8564                 LIBS="$ol_LIBS"
8565         
8566 fi
8567
8568 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
8569
8570         if test $ol_cv_pthread_thread = yes ; then
8571                 ol_link_pthreads="-thread"
8572                 ol_link_threads=posix
8573         fi
8574 fi
8575
8576
8577                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
8578 if test "$ol_link_threads" = no ; then
8579         # try -lpthread -lmach -lexc -lc_r
8580         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
8581 echo "configure:8582: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
8582 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
8583   echo $ac_n "(cached) $ac_c" 1>&6
8584 else
8585   
8586                 # save the flags
8587                 ol_LIBS="$LIBS"
8588                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
8589
8590                 if test "$cross_compiling" = yes; then
8591   cat > conftest.$ac_ext <<EOF
8592 #line 8593 "configure"
8593 #include "confdefs.h"
8594 /* pthread test headers */
8595 #include <pthread.h>
8596 #ifndef NULL
8597 #define NULL (void*)0
8598 #endif
8599
8600 static void *task(p)
8601         void *p;
8602 {
8603         return (void *) (p == NULL);
8604 }
8605
8606 int main() {
8607
8608         /* pthread test function */
8609         pthread_t t;
8610         int status;
8611 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8612         /* This system (e.g. AIX) defaults detached; must override */
8613         pthread_attr_t attr;
8614
8615         status = pthread_attr_init(&attr);
8616         if( status ) exit( status );
8617
8618         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8619         if( status ) exit( status );
8620
8621 #       define  ATTR    &attr
8622 #elif defined( HAVE_PTHREADS_D4 )
8623 #       define  ATTR    pthread_attr_default
8624 #else
8625 #       define  ATTR    NULL
8626 #endif
8627
8628         /* make sure pthread_create() isn't just a stub */
8629         status = pthread_create(&t, ATTR, task, NULL);
8630         if( status ) exit( status );
8631
8632         /* give the thread a chance to complete...
8633      * it should remain joinable and hence detachable
8634          */
8635         sleep( 1 );
8636
8637         /* make sure pthread_detach() isn't just a stub */
8638 #if HAVE_PTHREADS_D4
8639         status = pthread_detach( &t );
8640 #else
8641         status = pthread_detach( t );
8642 #endif
8643
8644 #ifdef HAVE_LINUX_THREADS
8645         pthread_kill_other_threads_np();
8646 #endif
8647
8648         exit( status );
8649
8650 ; return 0; }
8651 EOF
8652 if { (eval echo configure:8653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8653   rm -rf conftest*
8654   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8655 else
8656   echo "configure: failed program was:" >&5
8657   cat conftest.$ac_ext >&5
8658   rm -rf conftest*
8659   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8660 fi
8661 rm -f conftest*
8662 else
8663   cat > conftest.$ac_ext <<EOF
8664 #line 8665 "configure"
8665 #include "confdefs.h"
8666 /* pthread test headers */
8667 #include <pthread.h>
8668 #ifndef NULL
8669 #define NULL (void*)0
8670 #endif
8671
8672 static void *task(p)
8673         void *p;
8674 {
8675         return (void *) (p == NULL);
8676 }
8677
8678
8679 int main(argc, argv)
8680         int argc;
8681         char **argv;
8682 {
8683
8684         /* pthread test function */
8685         pthread_t t;
8686         int status;
8687 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8688         /* This system (e.g. AIX) defaults detached; must override */
8689         pthread_attr_t attr;
8690
8691         status = pthread_attr_init(&attr);
8692         if( status ) exit( status );
8693
8694         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8695         if( status ) exit( status );
8696
8697 #       define  ATTR    &attr
8698 #elif defined( HAVE_PTHREADS_D4 )
8699 #       define  ATTR    pthread_attr_default
8700 #else
8701 #       define  ATTR    NULL
8702 #endif
8703
8704         /* make sure pthread_create() isn't just a stub */
8705         status = pthread_create(&t, ATTR, task, NULL);
8706         if( status ) exit( status );
8707
8708         /* give the thread a chance to complete...
8709      * it should remain joinable and hence detachable
8710          */
8711         sleep( 1 );
8712
8713         /* make sure pthread_detach() isn't just a stub */
8714 #if HAVE_PTHREADS_D4
8715         status = pthread_detach( &t );
8716 #else
8717         status = pthread_detach( t );
8718 #endif
8719
8720 #ifdef HAVE_LINUX_THREADS
8721         pthread_kill_other_threads_np();
8722 #endif
8723
8724         exit( status );
8725
8726 }
8727
8728 EOF
8729 if { (eval echo configure:8730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8730 then
8731   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8732 else
8733   echo "configure: failed program was:" >&5
8734   cat conftest.$ac_ext >&5
8735   rm -fr conftest*
8736   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8737 fi
8738 rm -fr conftest*
8739 fi
8740
8741
8742                 # restore the LIBS
8743                 LIBS="$ol_LIBS"
8744         
8745 fi
8746
8747 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
8748
8749         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
8750                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
8751                 ol_link_threads=posix
8752         fi
8753 fi
8754
8755                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
8756 if test "$ol_link_threads" = no ; then
8757         # try -lpthread -lmach -lexc
8758         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
8759 echo "configure:8760: checking for pthread link with -lpthread -lmach -lexc" >&5
8760 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
8761   echo $ac_n "(cached) $ac_c" 1>&6
8762 else
8763   
8764                 # save the flags
8765                 ol_LIBS="$LIBS"
8766                 LIBS="-lpthread -lmach -lexc $LIBS"
8767
8768                 if test "$cross_compiling" = yes; then
8769   cat > conftest.$ac_ext <<EOF
8770 #line 8771 "configure"
8771 #include "confdefs.h"
8772 /* pthread test headers */
8773 #include <pthread.h>
8774 #ifndef NULL
8775 #define NULL (void*)0
8776 #endif
8777
8778 static void *task(p)
8779         void *p;
8780 {
8781         return (void *) (p == NULL);
8782 }
8783
8784 int main() {
8785
8786         /* pthread test function */
8787         pthread_t t;
8788         int status;
8789 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8790         /* This system (e.g. AIX) defaults detached; must override */
8791         pthread_attr_t attr;
8792
8793         status = pthread_attr_init(&attr);
8794         if( status ) exit( status );
8795
8796         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8797         if( status ) exit( status );
8798
8799 #       define  ATTR    &attr
8800 #elif defined( HAVE_PTHREADS_D4 )
8801 #       define  ATTR    pthread_attr_default
8802 #else
8803 #       define  ATTR    NULL
8804 #endif
8805
8806         /* make sure pthread_create() isn't just a stub */
8807         status = pthread_create(&t, ATTR, task, NULL);
8808         if( status ) exit( status );
8809
8810         /* give the thread a chance to complete...
8811      * it should remain joinable and hence detachable
8812          */
8813         sleep( 1 );
8814
8815         /* make sure pthread_detach() isn't just a stub */
8816 #if HAVE_PTHREADS_D4
8817         status = pthread_detach( &t );
8818 #else
8819         status = pthread_detach( t );
8820 #endif
8821
8822 #ifdef HAVE_LINUX_THREADS
8823         pthread_kill_other_threads_np();
8824 #endif
8825
8826         exit( status );
8827
8828 ; return 0; }
8829 EOF
8830 if { (eval echo configure:8831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8831   rm -rf conftest*
8832   ol_cv_pthread_lpthread_lmach_lexc=yes
8833 else
8834   echo "configure: failed program was:" >&5
8835   cat conftest.$ac_ext >&5
8836   rm -rf conftest*
8837   ol_cv_pthread_lpthread_lmach_lexc=no
8838 fi
8839 rm -f conftest*
8840 else
8841   cat > conftest.$ac_ext <<EOF
8842 #line 8843 "configure"
8843 #include "confdefs.h"
8844 /* pthread test headers */
8845 #include <pthread.h>
8846 #ifndef NULL
8847 #define NULL (void*)0
8848 #endif
8849
8850 static void *task(p)
8851         void *p;
8852 {
8853         return (void *) (p == NULL);
8854 }
8855
8856
8857 int main(argc, argv)
8858         int argc;
8859         char **argv;
8860 {
8861
8862         /* pthread test function */
8863         pthread_t t;
8864         int status;
8865 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8866         /* This system (e.g. AIX) defaults detached; must override */
8867         pthread_attr_t attr;
8868
8869         status = pthread_attr_init(&attr);
8870         if( status ) exit( status );
8871
8872         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8873         if( status ) exit( status );
8874
8875 #       define  ATTR    &attr
8876 #elif defined( HAVE_PTHREADS_D4 )
8877 #       define  ATTR    pthread_attr_default
8878 #else
8879 #       define  ATTR    NULL
8880 #endif
8881
8882         /* make sure pthread_create() isn't just a stub */
8883         status = pthread_create(&t, ATTR, task, NULL);
8884         if( status ) exit( status );
8885
8886         /* give the thread a chance to complete...
8887      * it should remain joinable and hence detachable
8888          */
8889         sleep( 1 );
8890
8891         /* make sure pthread_detach() isn't just a stub */
8892 #if HAVE_PTHREADS_D4
8893         status = pthread_detach( &t );
8894 #else
8895         status = pthread_detach( t );
8896 #endif
8897
8898 #ifdef HAVE_LINUX_THREADS
8899         pthread_kill_other_threads_np();
8900 #endif
8901
8902         exit( status );
8903
8904 }
8905
8906 EOF
8907 if { (eval echo configure:8908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8908 then
8909   ol_cv_pthread_lpthread_lmach_lexc=yes
8910 else
8911   echo "configure: failed program was:" >&5
8912   cat conftest.$ac_ext >&5
8913   rm -fr conftest*
8914   ol_cv_pthread_lpthread_lmach_lexc=no
8915 fi
8916 rm -fr conftest*
8917 fi
8918
8919
8920                 # restore the LIBS
8921                 LIBS="$ol_LIBS"
8922         
8923 fi
8924
8925 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
8926
8927         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
8928                 ol_link_pthreads="-lpthread -lmach -lexc"
8929                 ol_link_threads=posix
8930         fi
8931 fi
8932
8933
8934                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
8935 if test "$ol_link_threads" = no ; then
8936         # try -lpthread -Wl,-woff,85
8937         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
8938 echo "configure:8939: checking for pthread link with -lpthread -Wl,-woff,85" >&5
8939 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
8940   echo $ac_n "(cached) $ac_c" 1>&6
8941 else
8942   
8943                 # save the flags
8944                 ol_LIBS="$LIBS"
8945                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
8946
8947                 if test "$cross_compiling" = yes; then
8948   cat > conftest.$ac_ext <<EOF
8949 #line 8950 "configure"
8950 #include "confdefs.h"
8951 /* pthread test headers */
8952 #include <pthread.h>
8953 #ifndef NULL
8954 #define NULL (void*)0
8955 #endif
8956
8957 static void *task(p)
8958         void *p;
8959 {
8960         return (void *) (p == NULL);
8961 }
8962
8963 int main() {
8964
8965         /* pthread test function */
8966         pthread_t t;
8967         int status;
8968 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8969         /* This system (e.g. AIX) defaults detached; must override */
8970         pthread_attr_t attr;
8971
8972         status = pthread_attr_init(&attr);
8973         if( status ) exit( status );
8974
8975         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8976         if( status ) exit( status );
8977
8978 #       define  ATTR    &attr
8979 #elif defined( HAVE_PTHREADS_D4 )
8980 #       define  ATTR    pthread_attr_default
8981 #else
8982 #       define  ATTR    NULL
8983 #endif
8984
8985         /* make sure pthread_create() isn't just a stub */
8986         status = pthread_create(&t, ATTR, task, NULL);
8987         if( status ) exit( status );
8988
8989         /* give the thread a chance to complete...
8990      * it should remain joinable and hence detachable
8991          */
8992         sleep( 1 );
8993
8994         /* make sure pthread_detach() isn't just a stub */
8995 #if HAVE_PTHREADS_D4
8996         status = pthread_detach( &t );
8997 #else
8998         status = pthread_detach( t );
8999 #endif
9000
9001 #ifdef HAVE_LINUX_THREADS
9002         pthread_kill_other_threads_np();
9003 #endif
9004
9005         exit( status );
9006
9007 ; return 0; }
9008 EOF
9009 if { (eval echo configure:9010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9010   rm -rf conftest*
9011   ol_cv_pthread_lib_lpthread_woff=yes
9012 else
9013   echo "configure: failed program was:" >&5
9014   cat conftest.$ac_ext >&5
9015   rm -rf conftest*
9016   ol_cv_pthread_lib_lpthread_woff=no
9017 fi
9018 rm -f conftest*
9019 else
9020   cat > conftest.$ac_ext <<EOF
9021 #line 9022 "configure"
9022 #include "confdefs.h"
9023 /* pthread test headers */
9024 #include <pthread.h>
9025 #ifndef NULL
9026 #define NULL (void*)0
9027 #endif
9028
9029 static void *task(p)
9030         void *p;
9031 {
9032         return (void *) (p == NULL);
9033 }
9034
9035
9036 int main(argc, argv)
9037         int argc;
9038         char **argv;
9039 {
9040
9041         /* pthread test function */
9042         pthread_t t;
9043         int status;
9044 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9045         /* This system (e.g. AIX) defaults detached; must override */
9046         pthread_attr_t attr;
9047
9048         status = pthread_attr_init(&attr);
9049         if( status ) exit( status );
9050
9051         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9052         if( status ) exit( status );
9053
9054 #       define  ATTR    &attr
9055 #elif defined( HAVE_PTHREADS_D4 )
9056 #       define  ATTR    pthread_attr_default
9057 #else
9058 #       define  ATTR    NULL
9059 #endif
9060
9061         /* make sure pthread_create() isn't just a stub */
9062         status = pthread_create(&t, ATTR, task, NULL);
9063         if( status ) exit( status );
9064
9065         /* give the thread a chance to complete...
9066      * it should remain joinable and hence detachable
9067          */
9068         sleep( 1 );
9069
9070         /* make sure pthread_detach() isn't just a stub */
9071 #if HAVE_PTHREADS_D4
9072         status = pthread_detach( &t );
9073 #else
9074         status = pthread_detach( t );
9075 #endif
9076
9077 #ifdef HAVE_LINUX_THREADS
9078         pthread_kill_other_threads_np();
9079 #endif
9080
9081         exit( status );
9082
9083 }
9084
9085 EOF
9086 if { (eval echo configure:9087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9087 then
9088   ol_cv_pthread_lib_lpthread_woff=yes
9089 else
9090   echo "configure: failed program was:" >&5
9091   cat conftest.$ac_ext >&5
9092   rm -fr conftest*
9093   ol_cv_pthread_lib_lpthread_woff=no
9094 fi
9095 rm -fr conftest*
9096 fi
9097
9098
9099                 # restore the LIBS
9100                 LIBS="$ol_LIBS"
9101         
9102 fi
9103
9104 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
9105
9106         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
9107                 ol_link_pthreads="-lpthread -Wl,-woff,85"
9108                 ol_link_threads=posix
9109         fi
9110 fi
9111
9112
9113                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
9114 if test "$ol_link_threads" = no ; then
9115         # try -lpthread
9116         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
9117 echo "configure:9118: checking for pthread link with -lpthread" >&5
9118 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
9119   echo $ac_n "(cached) $ac_c" 1>&6
9120 else
9121   
9122                 # save the flags
9123                 ol_LIBS="$LIBS"
9124                 LIBS="-lpthread $LIBS"
9125
9126                 if test "$cross_compiling" = yes; then
9127   cat > conftest.$ac_ext <<EOF
9128 #line 9129 "configure"
9129 #include "confdefs.h"
9130 /* pthread test headers */
9131 #include <pthread.h>
9132 #ifndef NULL
9133 #define NULL (void*)0
9134 #endif
9135
9136 static void *task(p)
9137         void *p;
9138 {
9139         return (void *) (p == NULL);
9140 }
9141
9142 int main() {
9143
9144         /* pthread test function */
9145         pthread_t t;
9146         int status;
9147 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9148         /* This system (e.g. AIX) defaults detached; must override */
9149         pthread_attr_t attr;
9150
9151         status = pthread_attr_init(&attr);
9152         if( status ) exit( status );
9153
9154         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9155         if( status ) exit( status );
9156
9157 #       define  ATTR    &attr
9158 #elif defined( HAVE_PTHREADS_D4 )
9159 #       define  ATTR    pthread_attr_default
9160 #else
9161 #       define  ATTR    NULL
9162 #endif
9163
9164         /* make sure pthread_create() isn't just a stub */
9165         status = pthread_create(&t, ATTR, task, NULL);
9166         if( status ) exit( status );
9167
9168         /* give the thread a chance to complete...
9169      * it should remain joinable and hence detachable
9170          */
9171         sleep( 1 );
9172
9173         /* make sure pthread_detach() isn't just a stub */
9174 #if HAVE_PTHREADS_D4
9175         status = pthread_detach( &t );
9176 #else
9177         status = pthread_detach( t );
9178 #endif
9179
9180 #ifdef HAVE_LINUX_THREADS
9181         pthread_kill_other_threads_np();
9182 #endif
9183
9184         exit( status );
9185
9186 ; return 0; }
9187 EOF
9188 if { (eval echo configure:9189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9189   rm -rf conftest*
9190   ol_cv_pthread_lpthread=yes
9191 else
9192   echo "configure: failed program was:" >&5
9193   cat conftest.$ac_ext >&5
9194   rm -rf conftest*
9195   ol_cv_pthread_lpthread=no
9196 fi
9197 rm -f conftest*
9198 else
9199   cat > conftest.$ac_ext <<EOF
9200 #line 9201 "configure"
9201 #include "confdefs.h"
9202 /* pthread test headers */
9203 #include <pthread.h>
9204 #ifndef NULL
9205 #define NULL (void*)0
9206 #endif
9207
9208 static void *task(p)
9209         void *p;
9210 {
9211         return (void *) (p == NULL);
9212 }
9213
9214
9215 int main(argc, argv)
9216         int argc;
9217         char **argv;
9218 {
9219
9220         /* pthread test function */
9221         pthread_t t;
9222         int status;
9223 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9224         /* This system (e.g. AIX) defaults detached; must override */
9225         pthread_attr_t attr;
9226
9227         status = pthread_attr_init(&attr);
9228         if( status ) exit( status );
9229
9230         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9231         if( status ) exit( status );
9232
9233 #       define  ATTR    &attr
9234 #elif defined( HAVE_PTHREADS_D4 )
9235 #       define  ATTR    pthread_attr_default
9236 #else
9237 #       define  ATTR    NULL
9238 #endif
9239
9240         /* make sure pthread_create() isn't just a stub */
9241         status = pthread_create(&t, ATTR, task, NULL);
9242         if( status ) exit( status );
9243
9244         /* give the thread a chance to complete...
9245      * it should remain joinable and hence detachable
9246          */
9247         sleep( 1 );
9248
9249         /* make sure pthread_detach() isn't just a stub */
9250 #if HAVE_PTHREADS_D4
9251         status = pthread_detach( &t );
9252 #else
9253         status = pthread_detach( t );
9254 #endif
9255
9256 #ifdef HAVE_LINUX_THREADS
9257         pthread_kill_other_threads_np();
9258 #endif
9259
9260         exit( status );
9261
9262 }
9263
9264 EOF
9265 if { (eval echo configure:9266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9266 then
9267   ol_cv_pthread_lpthread=yes
9268 else
9269   echo "configure: failed program was:" >&5
9270   cat conftest.$ac_ext >&5
9271   rm -fr conftest*
9272   ol_cv_pthread_lpthread=no
9273 fi
9274 rm -fr conftest*
9275 fi
9276
9277
9278                 # restore the LIBS
9279                 LIBS="$ol_LIBS"
9280         
9281 fi
9282
9283 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
9284
9285         if test $ol_cv_pthread_lpthread = yes ; then
9286                 ol_link_pthreads="-lpthread"
9287                 ol_link_threads=posix
9288         fi
9289 fi
9290
9291                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
9292 if test "$ol_link_threads" = no ; then
9293         # try -lc_r
9294         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
9295 echo "configure:9296: checking for pthread link with -lc_r" >&5
9296 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
9297   echo $ac_n "(cached) $ac_c" 1>&6
9298 else
9299   
9300                 # save the flags
9301                 ol_LIBS="$LIBS"
9302                 LIBS="-lc_r $LIBS"
9303
9304                 if test "$cross_compiling" = yes; then
9305   cat > conftest.$ac_ext <<EOF
9306 #line 9307 "configure"
9307 #include "confdefs.h"
9308 /* pthread test headers */
9309 #include <pthread.h>
9310 #ifndef NULL
9311 #define NULL (void*)0
9312 #endif
9313
9314 static void *task(p)
9315         void *p;
9316 {
9317         return (void *) (p == NULL);
9318 }
9319
9320 int main() {
9321
9322         /* pthread test function */
9323         pthread_t t;
9324         int status;
9325 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9326         /* This system (e.g. AIX) defaults detached; must override */
9327         pthread_attr_t attr;
9328
9329         status = pthread_attr_init(&attr);
9330         if( status ) exit( status );
9331
9332         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9333         if( status ) exit( status );
9334
9335 #       define  ATTR    &attr
9336 #elif defined( HAVE_PTHREADS_D4 )
9337 #       define  ATTR    pthread_attr_default
9338 #else
9339 #       define  ATTR    NULL
9340 #endif
9341
9342         /* make sure pthread_create() isn't just a stub */
9343         status = pthread_create(&t, ATTR, task, NULL);
9344         if( status ) exit( status );
9345
9346         /* give the thread a chance to complete...
9347      * it should remain joinable and hence detachable
9348          */
9349         sleep( 1 );
9350
9351         /* make sure pthread_detach() isn't just a stub */
9352 #if HAVE_PTHREADS_D4
9353         status = pthread_detach( &t );
9354 #else
9355         status = pthread_detach( t );
9356 #endif
9357
9358 #ifdef HAVE_LINUX_THREADS
9359         pthread_kill_other_threads_np();
9360 #endif
9361
9362         exit( status );
9363
9364 ; return 0; }
9365 EOF
9366 if { (eval echo configure:9367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9367   rm -rf conftest*
9368   ol_cv_pthread_lc_r=yes
9369 else
9370   echo "configure: failed program was:" >&5
9371   cat conftest.$ac_ext >&5
9372   rm -rf conftest*
9373   ol_cv_pthread_lc_r=no
9374 fi
9375 rm -f conftest*
9376 else
9377   cat > conftest.$ac_ext <<EOF
9378 #line 9379 "configure"
9379 #include "confdefs.h"
9380 /* pthread test headers */
9381 #include <pthread.h>
9382 #ifndef NULL
9383 #define NULL (void*)0
9384 #endif
9385
9386 static void *task(p)
9387         void *p;
9388 {
9389         return (void *) (p == NULL);
9390 }
9391
9392
9393 int main(argc, argv)
9394         int argc;
9395         char **argv;
9396 {
9397
9398         /* pthread test function */
9399         pthread_t t;
9400         int status;
9401 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9402         /* This system (e.g. AIX) defaults detached; must override */
9403         pthread_attr_t attr;
9404
9405         status = pthread_attr_init(&attr);
9406         if( status ) exit( status );
9407
9408         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9409         if( status ) exit( status );
9410
9411 #       define  ATTR    &attr
9412 #elif defined( HAVE_PTHREADS_D4 )
9413 #       define  ATTR    pthread_attr_default
9414 #else
9415 #       define  ATTR    NULL
9416 #endif
9417
9418         /* make sure pthread_create() isn't just a stub */
9419         status = pthread_create(&t, ATTR, task, NULL);
9420         if( status ) exit( status );
9421
9422         /* give the thread a chance to complete...
9423      * it should remain joinable and hence detachable
9424          */
9425         sleep( 1 );
9426
9427         /* make sure pthread_detach() isn't just a stub */
9428 #if HAVE_PTHREADS_D4
9429         status = pthread_detach( &t );
9430 #else
9431         status = pthread_detach( t );
9432 #endif
9433
9434 #ifdef HAVE_LINUX_THREADS
9435         pthread_kill_other_threads_np();
9436 #endif
9437
9438         exit( status );
9439
9440 }
9441
9442 EOF
9443 if { (eval echo configure:9444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9444 then
9445   ol_cv_pthread_lc_r=yes
9446 else
9447   echo "configure: failed program was:" >&5
9448   cat conftest.$ac_ext >&5
9449   rm -fr conftest*
9450   ol_cv_pthread_lc_r=no
9451 fi
9452 rm -fr conftest*
9453 fi
9454
9455
9456                 # restore the LIBS
9457                 LIBS="$ol_LIBS"
9458         
9459 fi
9460
9461 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
9462
9463         if test $ol_cv_pthread_lc_r = yes ; then
9464                 ol_link_pthreads="-lc_r"
9465                 ol_link_threads=posix
9466         fi
9467 fi
9468
9469
9470                 # Pthread try link: -threads (ol_cv_pthread_threads)
9471 if test "$ol_link_threads" = no ; then
9472         # try -threads
9473         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
9474 echo "configure:9475: checking for pthread link with -threads" >&5
9475 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
9476   echo $ac_n "(cached) $ac_c" 1>&6
9477 else
9478   
9479                 # save the flags
9480                 ol_LIBS="$LIBS"
9481                 LIBS="-threads $LIBS"
9482
9483                 if test "$cross_compiling" = yes; then
9484   cat > conftest.$ac_ext <<EOF
9485 #line 9486 "configure"
9486 #include "confdefs.h"
9487 /* pthread test headers */
9488 #include <pthread.h>
9489 #ifndef NULL
9490 #define NULL (void*)0
9491 #endif
9492
9493 static void *task(p)
9494         void *p;
9495 {
9496         return (void *) (p == NULL);
9497 }
9498
9499 int main() {
9500
9501         /* pthread test function */
9502         pthread_t t;
9503         int status;
9504 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9505         /* This system (e.g. AIX) defaults detached; must override */
9506         pthread_attr_t attr;
9507
9508         status = pthread_attr_init(&attr);
9509         if( status ) exit( status );
9510
9511         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9512         if( status ) exit( status );
9513
9514 #       define  ATTR    &attr
9515 #elif defined( HAVE_PTHREADS_D4 )
9516 #       define  ATTR    pthread_attr_default
9517 #else
9518 #       define  ATTR    NULL
9519 #endif
9520
9521         /* make sure pthread_create() isn't just a stub */
9522         status = pthread_create(&t, ATTR, task, NULL);
9523         if( status ) exit( status );
9524
9525         /* give the thread a chance to complete...
9526      * it should remain joinable and hence detachable
9527          */
9528         sleep( 1 );
9529
9530         /* make sure pthread_detach() isn't just a stub */
9531 #if HAVE_PTHREADS_D4
9532         status = pthread_detach( &t );
9533 #else
9534         status = pthread_detach( t );
9535 #endif
9536
9537 #ifdef HAVE_LINUX_THREADS
9538         pthread_kill_other_threads_np();
9539 #endif
9540
9541         exit( status );
9542
9543 ; return 0; }
9544 EOF
9545 if { (eval echo configure:9546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9546   rm -rf conftest*
9547   ol_cv_pthread_threads=yes
9548 else
9549   echo "configure: failed program was:" >&5
9550   cat conftest.$ac_ext >&5
9551   rm -rf conftest*
9552   ol_cv_pthread_threads=no
9553 fi
9554 rm -f conftest*
9555 else
9556   cat > conftest.$ac_ext <<EOF
9557 #line 9558 "configure"
9558 #include "confdefs.h"
9559 /* pthread test headers */
9560 #include <pthread.h>
9561 #ifndef NULL
9562 #define NULL (void*)0
9563 #endif
9564
9565 static void *task(p)
9566         void *p;
9567 {
9568         return (void *) (p == NULL);
9569 }
9570
9571
9572 int main(argc, argv)
9573         int argc;
9574         char **argv;
9575 {
9576
9577         /* pthread test function */
9578         pthread_t t;
9579         int status;
9580 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9581         /* This system (e.g. AIX) defaults detached; must override */
9582         pthread_attr_t attr;
9583
9584         status = pthread_attr_init(&attr);
9585         if( status ) exit( status );
9586
9587         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9588         if( status ) exit( status );
9589
9590 #       define  ATTR    &attr
9591 #elif defined( HAVE_PTHREADS_D4 )
9592 #       define  ATTR    pthread_attr_default
9593 #else
9594 #       define  ATTR    NULL
9595 #endif
9596
9597         /* make sure pthread_create() isn't just a stub */
9598         status = pthread_create(&t, ATTR, task, NULL);
9599         if( status ) exit( status );
9600
9601         /* give the thread a chance to complete...
9602      * it should remain joinable and hence detachable
9603          */
9604         sleep( 1 );
9605
9606         /* make sure pthread_detach() isn't just a stub */
9607 #if HAVE_PTHREADS_D4
9608         status = pthread_detach( &t );
9609 #else
9610         status = pthread_detach( t );
9611 #endif
9612
9613 #ifdef HAVE_LINUX_THREADS
9614         pthread_kill_other_threads_np();
9615 #endif
9616
9617         exit( status );
9618
9619 }
9620
9621 EOF
9622 if { (eval echo configure:9623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9623 then
9624   ol_cv_pthread_threads=yes
9625 else
9626   echo "configure: failed program was:" >&5
9627   cat conftest.$ac_ext >&5
9628   rm -fr conftest*
9629   ol_cv_pthread_threads=no
9630 fi
9631 rm -fr conftest*
9632 fi
9633
9634
9635                 # restore the LIBS
9636                 LIBS="$ol_LIBS"
9637         
9638 fi
9639
9640 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
9641
9642         if test $ol_cv_pthread_threads = yes ; then
9643                 ol_link_pthreads="-threads"
9644                 ol_link_threads=posix
9645         fi
9646 fi
9647
9648
9649                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
9650 if test "$ol_link_threads" = no ; then
9651         # try -lpthreads -lmach -lexc -lc_r
9652         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
9653 echo "configure:9654: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
9654 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
9655   echo $ac_n "(cached) $ac_c" 1>&6
9656 else
9657   
9658                 # save the flags
9659                 ol_LIBS="$LIBS"
9660                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
9661
9662                 if test "$cross_compiling" = yes; then
9663   cat > conftest.$ac_ext <<EOF
9664 #line 9665 "configure"
9665 #include "confdefs.h"
9666 /* pthread test headers */
9667 #include <pthread.h>
9668 #ifndef NULL
9669 #define NULL (void*)0
9670 #endif
9671
9672 static void *task(p)
9673         void *p;
9674 {
9675         return (void *) (p == NULL);
9676 }
9677
9678 int main() {
9679
9680         /* pthread test function */
9681         pthread_t t;
9682         int status;
9683 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9684         /* This system (e.g. AIX) defaults detached; must override */
9685         pthread_attr_t attr;
9686
9687         status = pthread_attr_init(&attr);
9688         if( status ) exit( status );
9689
9690         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9691         if( status ) exit( status );
9692
9693 #       define  ATTR    &attr
9694 #elif defined( HAVE_PTHREADS_D4 )
9695 #       define  ATTR    pthread_attr_default
9696 #else
9697 #       define  ATTR    NULL
9698 #endif
9699
9700         /* make sure pthread_create() isn't just a stub */
9701         status = pthread_create(&t, ATTR, task, NULL);
9702         if( status ) exit( status );
9703
9704         /* give the thread a chance to complete...
9705      * it should remain joinable and hence detachable
9706          */
9707         sleep( 1 );
9708
9709         /* make sure pthread_detach() isn't just a stub */
9710 #if HAVE_PTHREADS_D4
9711         status = pthread_detach( &t );
9712 #else
9713         status = pthread_detach( t );
9714 #endif
9715
9716 #ifdef HAVE_LINUX_THREADS
9717         pthread_kill_other_threads_np();
9718 #endif
9719
9720         exit( status );
9721
9722 ; return 0; }
9723 EOF
9724 if { (eval echo configure:9725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9725   rm -rf conftest*
9726   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
9727 else
9728   echo "configure: failed program was:" >&5
9729   cat conftest.$ac_ext >&5
9730   rm -rf conftest*
9731   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
9732 fi
9733 rm -f conftest*
9734 else
9735   cat > conftest.$ac_ext <<EOF
9736 #line 9737 "configure"
9737 #include "confdefs.h"
9738 /* pthread test headers */
9739 #include <pthread.h>
9740 #ifndef NULL
9741 #define NULL (void*)0
9742 #endif
9743
9744 static void *task(p)
9745         void *p;
9746 {
9747         return (void *) (p == NULL);
9748 }
9749
9750
9751 int main(argc, argv)
9752         int argc;
9753         char **argv;
9754 {
9755
9756         /* pthread test function */
9757         pthread_t t;
9758         int status;
9759 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9760         /* This system (e.g. AIX) defaults detached; must override */
9761         pthread_attr_t attr;
9762
9763         status = pthread_attr_init(&attr);
9764         if( status ) exit( status );
9765
9766         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9767         if( status ) exit( status );
9768
9769 #       define  ATTR    &attr
9770 #elif defined( HAVE_PTHREADS_D4 )
9771 #       define  ATTR    pthread_attr_default
9772 #else
9773 #       define  ATTR    NULL
9774 #endif
9775
9776         /* make sure pthread_create() isn't just a stub */
9777         status = pthread_create(&t, ATTR, task, NULL);
9778         if( status ) exit( status );
9779
9780         /* give the thread a chance to complete...
9781      * it should remain joinable and hence detachable
9782          */
9783         sleep( 1 );
9784
9785         /* make sure pthread_detach() isn't just a stub */
9786 #if HAVE_PTHREADS_D4
9787         status = pthread_detach( &t );
9788 #else
9789         status = pthread_detach( t );
9790 #endif
9791
9792 #ifdef HAVE_LINUX_THREADS
9793         pthread_kill_other_threads_np();
9794 #endif
9795
9796         exit( status );
9797
9798 }
9799
9800 EOF
9801 if { (eval echo configure:9802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9802 then
9803   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
9804 else
9805   echo "configure: failed program was:" >&5
9806   cat conftest.$ac_ext >&5
9807   rm -fr conftest*
9808   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
9809 fi
9810 rm -fr conftest*
9811 fi
9812
9813
9814                 # restore the LIBS
9815                 LIBS="$ol_LIBS"
9816         
9817 fi
9818
9819 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
9820
9821         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
9822                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
9823                 ol_link_threads=posix
9824         fi
9825 fi
9826
9827                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
9828 if test "$ol_link_threads" = no ; then
9829         # try -lpthreads -lmach -lexc
9830         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
9831 echo "configure:9832: checking for pthread link with -lpthreads -lmach -lexc" >&5
9832 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
9833   echo $ac_n "(cached) $ac_c" 1>&6
9834 else
9835   
9836                 # save the flags
9837                 ol_LIBS="$LIBS"
9838                 LIBS="-lpthreads -lmach -lexc $LIBS"
9839
9840                 if test "$cross_compiling" = yes; then
9841   cat > conftest.$ac_ext <<EOF
9842 #line 9843 "configure"
9843 #include "confdefs.h"
9844 /* pthread test headers */
9845 #include <pthread.h>
9846 #ifndef NULL
9847 #define NULL (void*)0
9848 #endif
9849
9850 static void *task(p)
9851         void *p;
9852 {
9853         return (void *) (p == NULL);
9854 }
9855
9856 int main() {
9857
9858         /* pthread test function */
9859         pthread_t t;
9860         int status;
9861 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9862         /* This system (e.g. AIX) defaults detached; must override */
9863         pthread_attr_t attr;
9864
9865         status = pthread_attr_init(&attr);
9866         if( status ) exit( status );
9867
9868         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9869         if( status ) exit( status );
9870
9871 #       define  ATTR    &attr
9872 #elif defined( HAVE_PTHREADS_D4 )
9873 #       define  ATTR    pthread_attr_default
9874 #else
9875 #       define  ATTR    NULL
9876 #endif
9877
9878         /* make sure pthread_create() isn't just a stub */
9879         status = pthread_create(&t, ATTR, task, NULL);
9880         if( status ) exit( status );
9881
9882         /* give the thread a chance to complete...
9883      * it should remain joinable and hence detachable
9884          */
9885         sleep( 1 );
9886
9887         /* make sure pthread_detach() isn't just a stub */
9888 #if HAVE_PTHREADS_D4
9889         status = pthread_detach( &t );
9890 #else
9891         status = pthread_detach( t );
9892 #endif
9893
9894 #ifdef HAVE_LINUX_THREADS
9895         pthread_kill_other_threads_np();
9896 #endif
9897
9898         exit( status );
9899
9900 ; return 0; }
9901 EOF
9902 if { (eval echo configure:9903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9903   rm -rf conftest*
9904   ol_cv_pthread_lpthreads_lmach_lexc=yes
9905 else
9906   echo "configure: failed program was:" >&5
9907   cat conftest.$ac_ext >&5
9908   rm -rf conftest*
9909   ol_cv_pthread_lpthreads_lmach_lexc=no
9910 fi
9911 rm -f conftest*
9912 else
9913   cat > conftest.$ac_ext <<EOF
9914 #line 9915 "configure"
9915 #include "confdefs.h"
9916 /* pthread test headers */
9917 #include <pthread.h>
9918 #ifndef NULL
9919 #define NULL (void*)0
9920 #endif
9921
9922 static void *task(p)
9923         void *p;
9924 {
9925         return (void *) (p == NULL);
9926 }
9927
9928
9929 int main(argc, argv)
9930         int argc;
9931         char **argv;
9932 {
9933
9934         /* pthread test function */
9935         pthread_t t;
9936         int status;
9937 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9938         /* This system (e.g. AIX) defaults detached; must override */
9939         pthread_attr_t attr;
9940
9941         status = pthread_attr_init(&attr);
9942         if( status ) exit( status );
9943
9944         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9945         if( status ) exit( status );
9946
9947 #       define  ATTR    &attr
9948 #elif defined( HAVE_PTHREADS_D4 )
9949 #       define  ATTR    pthread_attr_default
9950 #else
9951 #       define  ATTR    NULL
9952 #endif
9953
9954         /* make sure pthread_create() isn't just a stub */
9955         status = pthread_create(&t, ATTR, task, NULL);
9956         if( status ) exit( status );
9957
9958         /* give the thread a chance to complete...
9959      * it should remain joinable and hence detachable
9960          */
9961         sleep( 1 );
9962
9963         /* make sure pthread_detach() isn't just a stub */
9964 #if HAVE_PTHREADS_D4
9965         status = pthread_detach( &t );
9966 #else
9967         status = pthread_detach( t );
9968 #endif
9969
9970 #ifdef HAVE_LINUX_THREADS
9971         pthread_kill_other_threads_np();
9972 #endif
9973
9974         exit( status );
9975
9976 }
9977
9978 EOF
9979 if { (eval echo configure:9980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9980 then
9981   ol_cv_pthread_lpthreads_lmach_lexc=yes
9982 else
9983   echo "configure: failed program was:" >&5
9984   cat conftest.$ac_ext >&5
9985   rm -fr conftest*
9986   ol_cv_pthread_lpthreads_lmach_lexc=no
9987 fi
9988 rm -fr conftest*
9989 fi
9990
9991
9992                 # restore the LIBS
9993                 LIBS="$ol_LIBS"
9994         
9995 fi
9996
9997 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
9998
9999         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
10000                 ol_link_pthreads="-lpthreads -lmach -lexc"
10001                 ol_link_threads=posix
10002         fi
10003 fi
10004
10005                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
10006 if test "$ol_link_threads" = no ; then
10007         # try -lpthreads -lexc
10008         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
10009 echo "configure:10010: checking for pthread link with -lpthreads -lexc" >&5
10010 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
10011   echo $ac_n "(cached) $ac_c" 1>&6
10012 else
10013   
10014                 # save the flags
10015                 ol_LIBS="$LIBS"
10016                 LIBS="-lpthreads -lexc $LIBS"
10017
10018                 if test "$cross_compiling" = yes; then
10019   cat > conftest.$ac_ext <<EOF
10020 #line 10021 "configure"
10021 #include "confdefs.h"
10022 /* pthread test headers */
10023 #include <pthread.h>
10024 #ifndef NULL
10025 #define NULL (void*)0
10026 #endif
10027
10028 static void *task(p)
10029         void *p;
10030 {
10031         return (void *) (p == NULL);
10032 }
10033
10034 int main() {
10035
10036         /* pthread test function */
10037         pthread_t t;
10038         int status;
10039 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
10040         /* This system (e.g. AIX) defaults detached; must override */
10041         pthread_attr_t attr;
10042
10043         status = pthread_attr_init(&attr);
10044         if( status ) exit( status );
10045
10046         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
10047         if( status ) exit( status );
10048
10049 #       define  ATTR    &attr
10050 #elif defined( HAVE_PTHREADS_D4 )
10051 #       define  ATTR    pthread_attr_default
10052 #else
10053 #       define  ATTR    NULL
10054 #endif
10055
10056         /* make sure pthread_create() isn't just a stub */
10057         status = pthread_create(&t, ATTR, task, NULL);
10058         if( status ) exit( status );
10059
10060         /* give the thread a chance to complete...
10061      * it should remain joinable and hence detachable
10062          */
10063         sleep( 1 );
10064
10065         /* make sure pthread_detach() isn't just a stub */
10066 #if HAVE_PTHREADS_D4
10067         status = pthread_detach( &t );
10068 #else
10069         status = pthread_detach( t );
10070 #endif
10071
10072 #ifdef HAVE_LINUX_THREADS
10073         pthread_kill_other_threads_np();
10074 #endif
10075
10076         exit( status );
10077
10078 ; return 0; }
10079 EOF
10080 if { (eval echo configure:10081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10081   rm -rf conftest*
10082   ol_cv_pthread_lpthreads_lexc=yes
10083 else
10084   echo "configure: failed program was:" >&5
10085   cat conftest.$ac_ext >&5
10086   rm -rf conftest*
10087   ol_cv_pthread_lpthreads_lexc=no
10088 fi
10089 rm -f conftest*
10090 else
10091   cat > conftest.$ac_ext <<EOF
10092 #line 10093 "configure"
10093 #include "confdefs.h"
10094 /* pthread test headers */
10095 #include <pthread.h>
10096 #ifndef NULL
10097 #define NULL (void*)0
10098 #endif
10099
10100 static void *task(p)
10101         void *p;
10102 {
10103         return (void *) (p == NULL);
10104 }
10105
10106
10107 int main(argc, argv)
10108         int argc;
10109         char **argv;
10110 {
10111
10112         /* pthread test function */
10113         pthread_t t;
10114         int status;
10115 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
10116         /* This system (e.g. AIX) defaults detached; must override */
10117         pthread_attr_t attr;
10118
10119         status = pthread_attr_init(&attr);
10120         if( status ) exit( status );
10121
10122         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
10123         if( status ) exit( status );
10124
10125 #       define  ATTR    &attr
10126 #elif defined( HAVE_PTHREADS_D4 )
10127 #       define  ATTR    pthread_attr_default
10128 #else
10129 #       define  ATTR    NULL
10130 #endif
10131
10132         /* make sure pthread_create() isn't just a stub */
10133         status = pthread_create(&t, ATTR, task, NULL);
10134         if( status ) exit( status );
10135
10136         /* give the thread a chance to complete...
10137      * it should remain joinable and hence detachable
10138          */
10139         sleep( 1 );
10140
10141         /* make sure pthread_detach() isn't just a stub */
10142 #if HAVE_PTHREADS_D4
10143         status = pthread_detach( &t );
10144 #else
10145         status = pthread_detach( t );
10146 #endif
10147
10148 #ifdef HAVE_LINUX_THREADS
10149         pthread_kill_other_threads_np();
10150 #endif
10151
10152         exit( status );
10153
10154 }
10155
10156 EOF
10157 if { (eval echo configure:10158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10158 then
10159   ol_cv_pthread_lpthreads_lexc=yes
10160 else
10161   echo "configure: failed program was:" >&5
10162   cat conftest.$ac_ext >&5
10163   rm -fr conftest*
10164   ol_cv_pthread_lpthreads_lexc=no
10165 fi
10166 rm -fr conftest*
10167 fi
10168
10169
10170                 # restore the LIBS
10171                 LIBS="$ol_LIBS"
10172         
10173 fi
10174
10175 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
10176
10177         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
10178                 ol_link_pthreads="-lpthreads -lexc"
10179                 ol_link_threads=posix
10180         fi
10181 fi
10182
10183
10184                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
10185 if test "$ol_link_threads" = no ; then
10186         # try -lpthreads
10187         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
10188 echo "configure:10189: checking for pthread link with -lpthreads" >&5
10189 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
10190   echo $ac_n "(cached) $ac_c" 1>&6
10191 else
10192   
10193                 # save the flags
10194                 ol_LIBS="$LIBS"
10195                 LIBS="-lpthreads $LIBS"
10196
10197                 if test "$cross_compiling" = yes; then
10198   cat > conftest.$ac_ext <<EOF
10199 #line 10200 "configure"
10200 #include "confdefs.h"
10201 /* pthread test headers */
10202 #include <pthread.h>
10203 #ifndef NULL
10204 #define NULL (void*)0
10205 #endif
10206
10207 static void *task(p)
10208         void *p;
10209 {
10210         return (void *) (p == NULL);
10211 }
10212
10213 int main() {
10214
10215         /* pthread test function */
10216         pthread_t t;
10217         int status;
10218 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
10219         /* This system (e.g. AIX) defaults detached; must override */
10220         pthread_attr_t attr;
10221
10222         status = pthread_attr_init(&attr);
10223         if( status ) exit( status );
10224
10225         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
10226         if( status ) exit( status );
10227
10228 #       define  ATTR    &attr
10229 #elif defined( HAVE_PTHREADS_D4 )
10230 #       define  ATTR    pthread_attr_default
10231 #else
10232 #       define  ATTR    NULL
10233 #endif
10234
10235         /* make sure pthread_create() isn't just a stub */
10236         status = pthread_create(&t, ATTR, task, NULL);
10237         if( status ) exit( status );
10238
10239         /* give the thread a chance to complete...
10240      * it should remain joinable and hence detachable
10241          */
10242         sleep( 1 );
10243
10244         /* make sure pthread_detach() isn't just a stub */
10245 #if HAVE_PTHREADS_D4
10246         status = pthread_detach( &t );
10247 #else
10248         status = pthread_detach( t );
10249 #endif
10250
10251 #ifdef HAVE_LINUX_THREADS
10252         pthread_kill_other_threads_np();
10253 #endif
10254
10255         exit( status );
10256
10257 ; return 0; }
10258 EOF
10259 if { (eval echo configure:10260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10260   rm -rf conftest*
10261   ol_cv_pthread_lib_lpthreads=yes
10262 else
10263   echo "configure: failed program was:" >&5
10264   cat conftest.$ac_ext >&5
10265   rm -rf conftest*
10266   ol_cv_pthread_lib_lpthreads=no
10267 fi
10268 rm -f conftest*
10269 else
10270   cat > conftest.$ac_ext <<EOF
10271 #line 10272 "configure"
10272 #include "confdefs.h"
10273 /* pthread test headers */
10274 #include <pthread.h>
10275 #ifndef NULL
10276 #define NULL (void*)0
10277 #endif
10278
10279 static void *task(p)
10280         void *p;
10281 {
10282         return (void *) (p == NULL);
10283 }
10284
10285
10286 int main(argc, argv)
10287         int argc;
10288         char **argv;
10289 {
10290
10291         /* pthread test function */
10292         pthread_t t;
10293         int status;
10294 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
10295         /* This system (e.g. AIX) defaults detached; must override */
10296         pthread_attr_t attr;
10297
10298         status = pthread_attr_init(&attr);
10299         if( status ) exit( status );
10300
10301         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
10302         if( status ) exit( status );
10303
10304 #       define  ATTR    &attr
10305 #elif defined( HAVE_PTHREADS_D4 )
10306 #       define  ATTR    pthread_attr_default
10307 #else
10308 #       define  ATTR    NULL
10309 #endif
10310
10311         /* make sure pthread_create() isn't just a stub */
10312         status = pthread_create(&t, ATTR, task, NULL);
10313         if( status ) exit( status );
10314
10315         /* give the thread a chance to complete...
10316      * it should remain joinable and hence detachable
10317          */
10318         sleep( 1 );
10319
10320         /* make sure pthread_detach() isn't just a stub */
10321 #if HAVE_PTHREADS_D4
10322         status = pthread_detach( &t );
10323 #else
10324         status = pthread_detach( t );
10325 #endif
10326
10327 #ifdef HAVE_LINUX_THREADS
10328         pthread_kill_other_threads_np();
10329 #endif
10330
10331         exit( status );
10332
10333 }
10334
10335 EOF
10336 if { (eval echo configure:10337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10337 then
10338   ol_cv_pthread_lib_lpthreads=yes
10339 else
10340   echo "configure: failed program was:" >&5
10341   cat conftest.$ac_ext >&5
10342   rm -fr conftest*
10343   ol_cv_pthread_lib_lpthreads=no
10344 fi
10345 rm -fr conftest*
10346 fi
10347
10348
10349                 # restore the LIBS
10350                 LIBS="$ol_LIBS"
10351         
10352 fi
10353
10354 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
10355
10356         if test $ol_cv_pthread_lib_lpthreads = yes ; then
10357                 ol_link_pthreads="-lpthreads"
10358                 ol_link_threads=posix
10359         fi
10360 fi
10361
10362
10363                 if test $ol_link_threads != no ; then
10364                         cat >> confdefs.h <<\EOF
10365 #define HAVE_PTHREADS 1
10366 EOF
10367
10368
10369                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
10370
10371                                                 save_CPPFLAGS="$CPPFLAGS"
10372                         save_LIBS="$LIBS"
10373                         LIBS="$LTHREAD_LIBS $LIBS"
10374
10375                                                                                                 for ac_func in sched_yield pthread_yield
10376 do
10377 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10378 echo "configure:10379: checking for $ac_func" >&5
10379 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10380   echo $ac_n "(cached) $ac_c" 1>&6
10381 else
10382   cat > conftest.$ac_ext <<EOF
10383 #line 10384 "configure"
10384 #include "confdefs.h"
10385 /* System header to define __stub macros and hopefully few prototypes,
10386     which can conflict with char $ac_func(); below.  */
10387 #include <assert.h>
10388 /* Override any gcc2 internal prototype to avoid an error.  */
10389 /* We use char because int might match the return type of a gcc2
10390     builtin and then its argument prototype would still apply.  */
10391 char $ac_func();
10392 char (*f)();
10393
10394 int main() {
10395
10396 /* The GNU C library defines this for functions which it implements
10397     to always fail with ENOSYS.  Some functions are actually named
10398     something starting with __ and the normal name is an alias.  */
10399 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10400 choke me
10401 #else
10402 f = $ac_func;
10403 #endif
10404
10405 ; return 0; }
10406 EOF
10407 if { (eval echo configure:10408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10408   rm -rf conftest*
10409   eval "ac_cv_func_$ac_func=yes"
10410 else
10411   echo "configure: failed program was:" >&5
10412   cat conftest.$ac_ext >&5
10413   rm -rf conftest*
10414   eval "ac_cv_func_$ac_func=no"
10415 fi
10416 rm -f conftest*
10417 fi
10418
10419 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10420   echo "$ac_t""yes" 1>&6
10421     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10422   cat >> confdefs.h <<EOF
10423 #define $ac_tr_func 1
10424 EOF
10425  
10426 else
10427   echo "$ac_t""no" 1>&6
10428 fi
10429 done
10430
10431
10432                         if test $ac_cv_func_sched_yield = no -a \
10433                                 $ac_cv_func_pthread_yield = no ; then
10434                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
10435 echo "configure:10436: checking for sched_yield in -lrt" >&5
10436 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
10437 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10438   echo $ac_n "(cached) $ac_c" 1>&6
10439 else
10440   ac_save_LIBS="$LIBS"
10441 LIBS="-lrt  $LIBS"
10442 cat > conftest.$ac_ext <<EOF
10443 #line 10444 "configure"
10444 #include "confdefs.h"
10445 /* Override any gcc2 internal prototype to avoid an error.  */
10446 /* We use char because int might match the return type of a gcc2
10447     builtin and then its argument prototype would still apply.  */
10448 char sched_yield();
10449
10450 int main() {
10451 sched_yield()
10452 ; return 0; }
10453 EOF
10454 if { (eval echo configure:10455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10455   rm -rf conftest*
10456   eval "ac_cv_lib_$ac_lib_var=yes"
10457 else
10458   echo "configure: failed program was:" >&5
10459   cat conftest.$ac_ext >&5
10460   rm -rf conftest*
10461   eval "ac_cv_lib_$ac_lib_var=no"
10462 fi
10463 rm -f conftest*
10464 LIBS="$ac_save_LIBS"
10465
10466 fi
10467 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10468   echo "$ac_t""yes" 1>&6
10469   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
10470                                         cat >> confdefs.h <<\EOF
10471 #define HAVE_SCHED_YIELD 1
10472 EOF
10473
10474                                         ac_cv_func_sched_yield=yes
10475 else
10476   echo "$ac_t""no" 1>&6
10477 ac_cv_func_sched_yield=no
10478 fi
10479
10480                         fi
10481                         if test $ac_cv_func_sched_yield = no -a \
10482                                 $ac_cv_func_pthread_yield = no ; then
10483                                                                                                 for ac_func in thr_yield
10484 do
10485 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10486 echo "configure:10487: checking for $ac_func" >&5
10487 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10488   echo $ac_n "(cached) $ac_c" 1>&6
10489 else
10490   cat > conftest.$ac_ext <<EOF
10491 #line 10492 "configure"
10492 #include "confdefs.h"
10493 /* System header to define __stub macros and hopefully few prototypes,
10494     which can conflict with char $ac_func(); below.  */
10495 #include <assert.h>
10496 /* Override any gcc2 internal prototype to avoid an error.  */
10497 /* We use char because int might match the return type of a gcc2
10498     builtin and then its argument prototype would still apply.  */
10499 char $ac_func();
10500 char (*f)();
10501
10502 int main() {
10503
10504 /* The GNU C library defines this for functions which it implements
10505     to always fail with ENOSYS.  Some functions are actually named
10506     something starting with __ and the normal name is an alias.  */
10507 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10508 choke me
10509 #else
10510 f = $ac_func;
10511 #endif
10512
10513 ; return 0; }
10514 EOF
10515 if { (eval echo configure:10516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10516   rm -rf conftest*
10517   eval "ac_cv_func_$ac_func=yes"
10518 else
10519   echo "configure: failed program was:" >&5
10520   cat conftest.$ac_ext >&5
10521   rm -rf conftest*
10522   eval "ac_cv_func_$ac_func=no"
10523 fi
10524 rm -f conftest*
10525 fi
10526
10527 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10528   echo "$ac_t""yes" 1>&6
10529     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10530   cat >> confdefs.h <<EOF
10531 #define $ac_tr_func 1
10532 EOF
10533  
10534 else
10535   echo "$ac_t""no" 1>&6
10536 fi
10537 done
10538
10539                         fi
10540                         if test $ac_cv_func_sched_yield = no -a \
10541                                 $ac_cv_func_pthread_yield = no -a \
10542                                 "$ac_cv_func_thr_yield" = no ; then
10543                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
10544                         fi
10545
10546                                                 for ac_func in pthread_kill pthread_rwlock_destroy
10547 do
10548 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10549 echo "configure:10550: checking for $ac_func" >&5
10550 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10551   echo $ac_n "(cached) $ac_c" 1>&6
10552 else
10553   cat > conftest.$ac_ext <<EOF
10554 #line 10555 "configure"
10555 #include "confdefs.h"
10556 /* System header to define __stub macros and hopefully few prototypes,
10557     which can conflict with char $ac_func(); below.  */
10558 #include <assert.h>
10559 /* Override any gcc2 internal prototype to avoid an error.  */
10560 /* We use char because int might match the return type of a gcc2
10561     builtin and then its argument prototype would still apply.  */
10562 char $ac_func();
10563 char (*f)();
10564
10565 int main() {
10566
10567 /* The GNU C library defines this for functions which it implements
10568     to always fail with ENOSYS.  Some functions are actually named
10569     something starting with __ and the normal name is an alias.  */
10570 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10571 choke me
10572 #else
10573 f = $ac_func;
10574 #endif
10575
10576 ; return 0; }
10577 EOF
10578 if { (eval echo configure:10579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10579   rm -rf conftest*
10580   eval "ac_cv_func_$ac_func=yes"
10581 else
10582   echo "configure: failed program was:" >&5
10583   cat conftest.$ac_ext >&5
10584   rm -rf conftest*
10585   eval "ac_cv_func_$ac_func=no"
10586 fi
10587 rm -f conftest*
10588 fi
10589
10590 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10591   echo "$ac_t""yes" 1>&6
10592     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10593   cat >> confdefs.h <<EOF
10594 #define $ac_tr_func 1
10595 EOF
10596  
10597 else
10598   echo "$ac_t""no" 1>&6
10599 fi
10600 done
10601
10602
10603                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
10604 echo "configure:10605: checking for pthread_detach with <pthread.h>" >&5
10605 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
10606   echo $ac_n "(cached) $ac_c" 1>&6
10607 else
10608   
10609                                                                 cat > conftest.$ac_ext <<EOF
10610 #line 10611 "configure"
10611 #include "confdefs.h"
10612
10613 #include <pthread.h>
10614 #ifndef NULL
10615 #define NULL (void*)0
10616 #endif
10617
10618 int main() {
10619 pthread_detach(NULL);
10620 ; return 0; }
10621 EOF
10622 if { (eval echo configure:10623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10623   rm -rf conftest*
10624   ol_cv_func_pthread_detach=yes
10625 else
10626   echo "configure: failed program was:" >&5
10627   cat conftest.$ac_ext >&5
10628   rm -rf conftest*
10629   ol_cv_func_pthread_detach=no
10630 fi
10631 rm -f conftest*
10632                         
10633 fi
10634
10635 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
10636
10637                         if test $ol_cv_func_pthread_detach = no ; then
10638                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
10639                         fi
10640
10641                         cat >> confdefs.h <<\EOF
10642 #define HAVE_PTHREAD_DETACH 1
10643 EOF
10644
10645
10646                                                 for ac_func in \
10647                                 pthread_setconcurrency \
10648                                 pthread_getconcurrency \
10649                                 thr_setconcurrency \
10650                                 thr_getconcurrency \
10651                         
10652 do
10653 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10654 echo "configure:10655: checking for $ac_func" >&5
10655 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10656   echo $ac_n "(cached) $ac_c" 1>&6
10657 else
10658   cat > conftest.$ac_ext <<EOF
10659 #line 10660 "configure"
10660 #include "confdefs.h"
10661 /* System header to define __stub macros and hopefully few prototypes,
10662     which can conflict with char $ac_func(); below.  */
10663 #include <assert.h>
10664 /* Override any gcc2 internal prototype to avoid an error.  */
10665 /* We use char because int might match the return type of a gcc2
10666     builtin and then its argument prototype would still apply.  */
10667 char $ac_func();
10668 char (*f)();
10669
10670 int main() {
10671
10672 /* The GNU C library defines this for functions which it implements
10673     to always fail with ENOSYS.  Some functions are actually named
10674     something starting with __ and the normal name is an alias.  */
10675 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10676 choke me
10677 #else
10678 f = $ac_func;
10679 #endif
10680
10681 ; return 0; }
10682 EOF
10683 if { (eval echo configure:10684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10684   rm -rf conftest*
10685   eval "ac_cv_func_$ac_func=yes"
10686 else
10687   echo "configure: failed program was:" >&5
10688   cat conftest.$ac_ext >&5
10689   rm -rf conftest*
10690   eval "ac_cv_func_$ac_func=no"
10691 fi
10692 rm -f conftest*
10693 fi
10694
10695 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10696   echo "$ac_t""yes" 1>&6
10697     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10698   cat >> confdefs.h <<EOF
10699 #define $ac_tr_func 1
10700 EOF
10701  
10702 else
10703   echo "$ac_t""no" 1>&6
10704 fi
10705 done
10706
10707
10708                         
10709         for ac_func in pthread_kill_other_threads_np
10710 do
10711 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10712 echo "configure:10713: checking for $ac_func" >&5
10713 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10714   echo $ac_n "(cached) $ac_c" 1>&6
10715 else
10716   cat > conftest.$ac_ext <<EOF
10717 #line 10718 "configure"
10718 #include "confdefs.h"
10719 /* System header to define __stub macros and hopefully few prototypes,
10720     which can conflict with char $ac_func(); below.  */
10721 #include <assert.h>
10722 /* Override any gcc2 internal prototype to avoid an error.  */
10723 /* We use char because int might match the return type of a gcc2
10724     builtin and then its argument prototype would still apply.  */
10725 char $ac_func();
10726 char (*f)();
10727
10728 int main() {
10729
10730 /* The GNU C library defines this for functions which it implements
10731     to always fail with ENOSYS.  Some functions are actually named
10732     something starting with __ and the normal name is an alias.  */
10733 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10734 choke me
10735 #else
10736 f = $ac_func;
10737 #endif
10738
10739 ; return 0; }
10740 EOF
10741 if { (eval echo configure:10742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10742   rm -rf conftest*
10743   eval "ac_cv_func_$ac_func=yes"
10744 else
10745   echo "configure: failed program was:" >&5
10746   cat conftest.$ac_ext >&5
10747   rm -rf conftest*
10748   eval "ac_cv_func_$ac_func=no"
10749 fi
10750 rm -f conftest*
10751 fi
10752
10753 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10754   echo "$ac_t""yes" 1>&6
10755     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10756   cat >> confdefs.h <<EOF
10757 #define $ac_tr_func 1
10758 EOF
10759  
10760 else
10761   echo "$ac_t""no" 1>&6
10762 fi
10763 done
10764
10765         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
10766 echo "configure:10767: checking for LinuxThreads implementation" >&5
10767 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
10768   echo $ac_n "(cached) $ac_c" 1>&6
10769 else
10770   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
10771 fi
10772
10773 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
10774
10775                         
10776         
10777         
10778         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
10779 echo "configure:10780: checking for LinuxThreads consistency" >&5
10780 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
10781   echo $ac_n "(cached) $ac_c" 1>&6
10782 else
10783   
10784                 if test $ol_cv_header_linux_threads = yes -a \
10785                         $ol_cv_sys_linux_threads = yes; then
10786                         ol_cv_linux_threads=yes
10787                 elif test $ol_cv_header_linux_threads = no -a \
10788                         $ol_cv_sys_linux_threads = no; then
10789                         ol_cv_linux_threads=no
10790                 else
10791                         ol_cv_linux_threads=error
10792                 fi
10793         
10794 fi
10795
10796 echo "$ac_t""$ol_cv_linux_threads" 1>&6
10797
10798
10799                         if test $ol_cv_linux_threads = error; then
10800                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
10801                         fi
10802
10803                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
10804 echo "configure:10805: checking if pthread_create() works" >&5
10805 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
10806   echo $ac_n "(cached) $ac_c" 1>&6
10807 else
10808   
10809                         if test "$cross_compiling" = yes; then
10810                                 ol_cv_pthread_create_works=yes
10811 else
10812   cat > conftest.$ac_ext <<EOF
10813 #line 10814 "configure"
10814 #include "confdefs.h"
10815 /* pthread test headers */
10816 #include <pthread.h>
10817 #ifndef NULL
10818 #define NULL (void*)0
10819 #endif
10820
10821 static void *task(p)
10822         void *p;
10823 {
10824         return (void *) (p == NULL);
10825 }
10826
10827
10828 int main(argc, argv)
10829         int argc;
10830         char **argv;
10831 {
10832
10833         /* pthread test function */
10834         pthread_t t;
10835         int status;
10836 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
10837         /* This system (e.g. AIX) defaults detached; must override */
10838         pthread_attr_t attr;
10839
10840         status = pthread_attr_init(&attr);
10841         if( status ) exit( status );
10842
10843         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
10844         if( status ) exit( status );
10845
10846 #       define  ATTR    &attr
10847 #elif defined( HAVE_PTHREADS_D4 )
10848 #       define  ATTR    pthread_attr_default
10849 #else
10850 #       define  ATTR    NULL
10851 #endif
10852
10853         /* make sure pthread_create() isn't just a stub */
10854         status = pthread_create(&t, ATTR, task, NULL);
10855         if( status ) exit( status );
10856
10857         /* give the thread a chance to complete...
10858      * it should remain joinable and hence detachable
10859          */
10860         sleep( 1 );
10861
10862         /* make sure pthread_detach() isn't just a stub */
10863 #if HAVE_PTHREADS_D4
10864         status = pthread_detach( &t );
10865 #else
10866         status = pthread_detach( t );
10867 #endif
10868
10869 #ifdef HAVE_LINUX_THREADS
10870         pthread_kill_other_threads_np();
10871 #endif
10872
10873         exit( status );
10874
10875 }
10876
10877 EOF
10878 if { (eval echo configure:10879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10879 then
10880   ol_cv_pthread_create_works=yes
10881 else
10882   echo "configure: failed program was:" >&5
10883   cat conftest.$ac_ext >&5
10884   rm -fr conftest*
10885   ol_cv_pthread_create_works=no
10886 fi
10887 rm -fr conftest*
10888 fi
10889
10890 fi
10891
10892 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
10893
10894                         if test $ol_cv_pthread_create_works = no ; then
10895                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
10896                         fi
10897
10898                                                 if test $ol_with_yielding_select = auto ; then
10899                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
10900 echo "configure:10901: checking if select yields when using pthreads" >&5
10901 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
10902   echo $ac_n "(cached) $ac_c" 1>&6
10903 else
10904   
10905                                 if test "$cross_compiling" = yes; then
10906   ol_cv_pthread_select_yields=cross
10907 else
10908   cat > conftest.$ac_ext <<EOF
10909 #line 10910 "configure"
10910 #include "confdefs.h"
10911
10912 #include <sys/types.h>
10913 #include <sys/time.h>
10914 #include <unistd.h>
10915 #include <pthread.h>
10916 #ifndef NULL
10917 #define NULL (void*) 0
10918 #endif
10919
10920 static int fildes[2];
10921
10922 static void *task(p)
10923         void *p;
10924 {
10925         int i;
10926         struct timeval tv;
10927
10928         fd_set rfds;
10929
10930         tv.tv_sec=10;
10931         tv.tv_usec=0;
10932
10933         FD_ZERO(&rfds);
10934         FD_SET(fildes[0], &rfds);
10935
10936         /* we're not interested in any fds */
10937         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
10938
10939         if(i < 0) {
10940                 perror("select");
10941                 exit(10);
10942         }
10943
10944         exit(0); /* if we exit here, the select blocked the whole process */
10945 }
10946
10947 int main(argc, argv)
10948         int argc;
10949         char **argv;
10950 {
10951         pthread_t t;
10952
10953         /* create a pipe to select */
10954         if(pipe(&fildes[0])) {
10955                 perror("select");
10956                 exit(1);
10957         }
10958
10959 #ifdef HAVE_PTHREAD_SETCONCURRENCY
10960         (void) pthread_setconcurrency(2);
10961 #else
10962 #ifdef HAVE_THR_SETCONCURRENCY
10963         /* Set Solaris LWP concurrency to 2 */
10964         thr_setconcurrency(2);
10965 #endif
10966 #endif
10967
10968 #if HAVE_PTHREADS_D4
10969         pthread_create(&t, pthread_attr_default, task, NULL);
10970 #else
10971         pthread_create(&t, NULL, task, NULL);
10972 #endif
10973
10974 #if HAVE_SCHED_YIELD
10975         sched_yield();  /* make sure task runs first */
10976 #else
10977 #ifdef HAVE_PTHREAD_YIELD
10978         pthread_yield();        /* make sure task runs first */
10979 #endif
10980 #endif
10981
10982         exit(2);
10983 }
10984 EOF
10985 if { (eval echo configure:10986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10986 then
10987   ol_cv_pthread_select_yields=no
10988 else
10989   echo "configure: failed program was:" >&5
10990   cat conftest.$ac_ext >&5
10991   rm -fr conftest*
10992   ol_cv_pthread_select_yields=yes
10993 fi
10994 rm -fr conftest*
10995 fi
10996
10997 fi
10998
10999 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
11000
11001                                 if test $ol_cv_pthread_select_yields = cross ; then
11002                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
11003                                 fi
11004
11005                                 if test $ol_cv_pthread_select_yields = yes ; then
11006                                         ol_with_yielding_select=yes
11007                                 fi
11008                         fi
11009
11010                                                 CPPFLAGS="$save_CPPFLAGS"
11011                         LIBS="$save_LIBS"
11012                 else
11013                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
11014                 fi
11015         fi
11016
11017         if test $ol_with_threads = posix ; then
11018                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
11019         fi
11020 fi
11021
11022 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11023         -o $ol_with_threads = mach ; then
11024
11025                 for ac_hdr in mach/cthreads.h
11026 do
11027 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11028 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11029 echo "configure:11030: checking for $ac_hdr" >&5
11030 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11031   echo $ac_n "(cached) $ac_c" 1>&6
11032 else
11033   cat > conftest.$ac_ext <<EOF
11034 #line 11035 "configure"
11035 #include "confdefs.h"
11036 #include <$ac_hdr>
11037 EOF
11038 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11039 { (eval echo configure:11040: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11040 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11041 if test -z "$ac_err"; then
11042   rm -rf conftest*
11043   eval "ac_cv_header_$ac_safe=yes"
11044 else
11045   echo "$ac_err" >&5
11046   echo "configure: failed program was:" >&5
11047   cat conftest.$ac_ext >&5
11048   rm -rf conftest*
11049   eval "ac_cv_header_$ac_safe=no"
11050 fi
11051 rm -f conftest*
11052 fi
11053 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11054   echo "$ac_t""yes" 1>&6
11055     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11056   cat >> confdefs.h <<EOF
11057 #define $ac_tr_hdr 1
11058 EOF
11059  
11060 else
11061   echo "$ac_t""no" 1>&6
11062 fi
11063 done
11064
11065         if test $ac_cv_header_mach_cthreads_h = yes ; then
11066                 ol_with_threads=found
11067
11068                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
11069 echo "configure:11070: checking for cthread_fork" >&5
11070 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
11071   echo $ac_n "(cached) $ac_c" 1>&6
11072 else
11073   cat > conftest.$ac_ext <<EOF
11074 #line 11075 "configure"
11075 #include "confdefs.h"
11076 /* System header to define __stub macros and hopefully few prototypes,
11077     which can conflict with char cthread_fork(); below.  */
11078 #include <assert.h>
11079 /* Override any gcc2 internal prototype to avoid an error.  */
11080 /* We use char because int might match the return type of a gcc2
11081     builtin and then its argument prototype would still apply.  */
11082 char cthread_fork();
11083 char (*f)();
11084
11085 int main() {
11086
11087 /* The GNU C library defines this for functions which it implements
11088     to always fail with ENOSYS.  Some functions are actually named
11089     something starting with __ and the normal name is an alias.  */
11090 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
11091 choke me
11092 #else
11093 f = cthread_fork;
11094 #endif
11095
11096 ; return 0; }
11097 EOF
11098 if { (eval echo configure:11099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11099   rm -rf conftest*
11100   eval "ac_cv_func_cthread_fork=yes"
11101 else
11102   echo "configure: failed program was:" >&5
11103   cat conftest.$ac_ext >&5
11104   rm -rf conftest*
11105   eval "ac_cv_func_cthread_fork=no"
11106 fi
11107 rm -f conftest*
11108 fi
11109
11110 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
11111   echo "$ac_t""yes" 1>&6
11112   ol_link_threads=yes
11113 else
11114   echo "$ac_t""no" 1>&6
11115 fi
11116
11117
11118                 if test $ol_link_threads = no ; then
11119                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
11120 echo "configure:11121: checking for cthread_fork with -all_load" >&5
11121 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
11122   echo $ac_n "(cached) $ac_c" 1>&6
11123 else
11124   
11125                                                                 save_LIBS="$LIBS"
11126                                 LIBS="-all_load $LIBS"
11127                                 cat > conftest.$ac_ext <<EOF
11128 #line 11129 "configure"
11129 #include "confdefs.h"
11130 #include <mach/cthreads.h>
11131 int main() {
11132
11133                                         cthread_fork((void *)0, (void *)0);
11134                                         
11135 ; return 0; }
11136 EOF
11137 if { (eval echo configure:11138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11138   rm -rf conftest*
11139   ol_cv_cthread_all_load=yes
11140 else
11141   echo "configure: failed program was:" >&5
11142   cat conftest.$ac_ext >&5
11143   rm -rf conftest*
11144   ol_cv_cthread_all_load=no
11145 fi
11146 rm -f conftest*
11147                                                                 LIBS="$save_LIBS"
11148                         
11149 fi
11150
11151 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
11152
11153                         if test $ol_cv_cthread_all_load = yes ; then
11154                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
11155                                 ol_link_threads=mach
11156                         fi
11157                 fi
11158
11159                 if test $ol_link_threads != no ; then
11160                         : check for cthread specific functionality here
11161                         cat >> confdefs.h <<\EOF
11162 #define HAVE_MACH_CTHREADS 1
11163 EOF
11164
11165                 else
11166                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
11167                 fi
11168         fi
11169
11170         if test $ol_with_threads = mach ; then
11171                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
11172         fi
11173 fi
11174
11175 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11176         -o $ol_with_threads = pth ; then
11177
11178         for ac_hdr in pth.h
11179 do
11180 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11181 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11182 echo "configure:11183: checking for $ac_hdr" >&5
11183 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11184   echo $ac_n "(cached) $ac_c" 1>&6
11185 else
11186   cat > conftest.$ac_ext <<EOF
11187 #line 11188 "configure"
11188 #include "confdefs.h"
11189 #include <$ac_hdr>
11190 EOF
11191 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11192 { (eval echo configure:11193: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11193 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11194 if test -z "$ac_err"; then
11195   rm -rf conftest*
11196   eval "ac_cv_header_$ac_safe=yes"
11197 else
11198   echo "$ac_err" >&5
11199   echo "configure: failed program was:" >&5
11200   cat conftest.$ac_ext >&5
11201   rm -rf conftest*
11202   eval "ac_cv_header_$ac_safe=no"
11203 fi
11204 rm -f conftest*
11205 fi
11206 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11207   echo "$ac_t""yes" 1>&6
11208     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11209   cat >> confdefs.h <<EOF
11210 #define $ac_tr_hdr 1
11211 EOF
11212  
11213 else
11214   echo "$ac_t""no" 1>&6
11215 fi
11216 done
11217
11218
11219         if test $ac_cv_header_pth_h = yes ; then
11220                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
11221 echo "configure:11222: checking for pth_version in -lpth" >&5
11222 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
11223 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11224   echo $ac_n "(cached) $ac_c" 1>&6
11225 else
11226   ac_save_LIBS="$LIBS"
11227 LIBS="-lpth  $LIBS"
11228 cat > conftest.$ac_ext <<EOF
11229 #line 11230 "configure"
11230 #include "confdefs.h"
11231 /* Override any gcc2 internal prototype to avoid an error.  */
11232 /* We use char because int might match the return type of a gcc2
11233     builtin and then its argument prototype would still apply.  */
11234 char pth_version();
11235
11236 int main() {
11237 pth_version()
11238 ; return 0; }
11239 EOF
11240 if { (eval echo configure:11241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11241   rm -rf conftest*
11242   eval "ac_cv_lib_$ac_lib_var=yes"
11243 else
11244   echo "configure: failed program was:" >&5
11245   cat conftest.$ac_ext >&5
11246   rm -rf conftest*
11247   eval "ac_cv_lib_$ac_lib_var=no"
11248 fi
11249 rm -f conftest*
11250 LIBS="$ac_save_LIBS"
11251
11252 fi
11253 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11254   echo "$ac_t""yes" 1>&6
11255   have_pth=yes
11256 else
11257   echo "$ac_t""no" 1>&6
11258 have_pth=no
11259 fi
11260
11261
11262                 if test $have_pth = yes ; then
11263                         cat >> confdefs.h <<\EOF
11264 #define HAVE_GNU_PTH 1
11265 EOF
11266
11267                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
11268                         ol_link_threads=pth
11269
11270                         if test $ol_with_yielding_select = auto ; then
11271                                 ol_with_yielding_select=yes
11272                         fi
11273                 fi
11274         fi
11275 fi
11276
11277 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11278         -o $ol_with_threads = lwp ; then
11279
11280                 for ac_hdr in thread.h synch.h
11281 do
11282 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11283 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11284 echo "configure:11285: checking for $ac_hdr" >&5
11285 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11286   echo $ac_n "(cached) $ac_c" 1>&6
11287 else
11288   cat > conftest.$ac_ext <<EOF
11289 #line 11290 "configure"
11290 #include "confdefs.h"
11291 #include <$ac_hdr>
11292 EOF
11293 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11294 { (eval echo configure:11295: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11295 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11296 if test -z "$ac_err"; then
11297   rm -rf conftest*
11298   eval "ac_cv_header_$ac_safe=yes"
11299 else
11300   echo "$ac_err" >&5
11301   echo "configure: failed program was:" >&5
11302   cat conftest.$ac_ext >&5
11303   rm -rf conftest*
11304   eval "ac_cv_header_$ac_safe=no"
11305 fi
11306 rm -f conftest*
11307 fi
11308 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11309   echo "$ac_t""yes" 1>&6
11310     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11311   cat >> confdefs.h <<EOF
11312 #define $ac_tr_hdr 1
11313 EOF
11314  
11315 else
11316   echo "$ac_t""no" 1>&6
11317 fi
11318 done
11319
11320         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
11321                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
11322 echo "configure:11323: checking for thr_create in -lthread" >&5
11323 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
11324 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11325   echo $ac_n "(cached) $ac_c" 1>&6
11326 else
11327   ac_save_LIBS="$LIBS"
11328 LIBS="-lthread  $LIBS"
11329 cat > conftest.$ac_ext <<EOF
11330 #line 11331 "configure"
11331 #include "confdefs.h"
11332 /* Override any gcc2 internal prototype to avoid an error.  */
11333 /* We use char because int might match the return type of a gcc2
11334     builtin and then its argument prototype would still apply.  */
11335 char thr_create();
11336
11337 int main() {
11338 thr_create()
11339 ; return 0; }
11340 EOF
11341 if { (eval echo configure:11342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11342   rm -rf conftest*
11343   eval "ac_cv_lib_$ac_lib_var=yes"
11344 else
11345   echo "configure: failed program was:" >&5
11346   cat conftest.$ac_ext >&5
11347   rm -rf conftest*
11348   eval "ac_cv_lib_$ac_lib_var=no"
11349 fi
11350 rm -f conftest*
11351 LIBS="$ac_save_LIBS"
11352
11353 fi
11354 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11355   echo "$ac_t""yes" 1>&6
11356   have_thr=yes
11357 else
11358   echo "$ac_t""no" 1>&6
11359 have_thr=no
11360 fi
11361
11362
11363                 if test $have_thr = yes ; then
11364                         cat >> confdefs.h <<\EOF
11365 #define HAVE_THR 1
11366 EOF
11367
11368                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
11369                         ol_link_threads=thr
11370
11371                         if test $ol_with_yielding_select = auto ; then
11372                                 ol_with_yielding_select=yes
11373                         fi
11374
11375                                                 for ac_func in \
11376                                 thr_setconcurrency \
11377                                 thr_getconcurrency \
11378                         
11379 do
11380 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11381 echo "configure:11382: checking for $ac_func" >&5
11382 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11383   echo $ac_n "(cached) $ac_c" 1>&6
11384 else
11385   cat > conftest.$ac_ext <<EOF
11386 #line 11387 "configure"
11387 #include "confdefs.h"
11388 /* System header to define __stub macros and hopefully few prototypes,
11389     which can conflict with char $ac_func(); below.  */
11390 #include <assert.h>
11391 /* Override any gcc2 internal prototype to avoid an error.  */
11392 /* We use char because int might match the return type of a gcc2
11393     builtin and then its argument prototype would still apply.  */
11394 char $ac_func();
11395 char (*f)();
11396
11397 int main() {
11398
11399 /* The GNU C library defines this for functions which it implements
11400     to always fail with ENOSYS.  Some functions are actually named
11401     something starting with __ and the normal name is an alias.  */
11402 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11403 choke me
11404 #else
11405 f = $ac_func;
11406 #endif
11407
11408 ; return 0; }
11409 EOF
11410 if { (eval echo configure:11411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11411   rm -rf conftest*
11412   eval "ac_cv_func_$ac_func=yes"
11413 else
11414   echo "configure: failed program was:" >&5
11415   cat conftest.$ac_ext >&5
11416   rm -rf conftest*
11417   eval "ac_cv_func_$ac_func=no"
11418 fi
11419 rm -f conftest*
11420 fi
11421
11422 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11423   echo "$ac_t""yes" 1>&6
11424     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11425   cat >> confdefs.h <<EOF
11426 #define $ac_tr_func 1
11427 EOF
11428  
11429 else
11430   echo "$ac_t""no" 1>&6
11431 fi
11432 done
11433
11434                 fi
11435         fi
11436
11437                 for ac_hdr in lwp/lwp.h
11438 do
11439 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11440 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11441 echo "configure:11442: checking for $ac_hdr" >&5
11442 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11443   echo $ac_n "(cached) $ac_c" 1>&6
11444 else
11445   cat > conftest.$ac_ext <<EOF
11446 #line 11447 "configure"
11447 #include "confdefs.h"
11448 #include <$ac_hdr>
11449 EOF
11450 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11451 { (eval echo configure:11452: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11452 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11453 if test -z "$ac_err"; then
11454   rm -rf conftest*
11455   eval "ac_cv_header_$ac_safe=yes"
11456 else
11457   echo "$ac_err" >&5
11458   echo "configure: failed program was:" >&5
11459   cat conftest.$ac_ext >&5
11460   rm -rf conftest*
11461   eval "ac_cv_header_$ac_safe=no"
11462 fi
11463 rm -f conftest*
11464 fi
11465 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11466   echo "$ac_t""yes" 1>&6
11467     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11468   cat >> confdefs.h <<EOF
11469 #define $ac_tr_hdr 1
11470 EOF
11471  
11472 else
11473   echo "$ac_t""no" 1>&6
11474 fi
11475 done
11476
11477         if test $ac_cv_header_lwp_lwp_h = yes ; then
11478                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
11479 echo "configure:11480: checking for lwp_create in -llwp" >&5
11480 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
11481 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11482   echo $ac_n "(cached) $ac_c" 1>&6
11483 else
11484   ac_save_LIBS="$LIBS"
11485 LIBS="-llwp  $LIBS"
11486 cat > conftest.$ac_ext <<EOF
11487 #line 11488 "configure"
11488 #include "confdefs.h"
11489 /* Override any gcc2 internal prototype to avoid an error.  */
11490 /* We use char because int might match the return type of a gcc2
11491     builtin and then its argument prototype would still apply.  */
11492 char lwp_create();
11493
11494 int main() {
11495 lwp_create()
11496 ; return 0; }
11497 EOF
11498 if { (eval echo configure:11499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11499   rm -rf conftest*
11500   eval "ac_cv_lib_$ac_lib_var=yes"
11501 else
11502   echo "configure: failed program was:" >&5
11503   cat conftest.$ac_ext >&5
11504   rm -rf conftest*
11505   eval "ac_cv_lib_$ac_lib_var=no"
11506 fi
11507 rm -f conftest*
11508 LIBS="$ac_save_LIBS"
11509
11510 fi
11511 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11512   echo "$ac_t""yes" 1>&6
11513   have_lwp=yes
11514 else
11515   echo "$ac_t""no" 1>&6
11516 have_lwp=no
11517 fi
11518
11519
11520                 if test $have_lwp = yes ; then
11521                         cat >> confdefs.h <<\EOF
11522 #define HAVE_LWP 1
11523 EOF
11524
11525                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
11526                         ol_link_threads=lwp
11527
11528                         if test $ol_with_yielding_select = auto ; then
11529                                 ol_with_yielding_select=no
11530                         fi
11531                 fi
11532         fi
11533 fi
11534
11535 if test $ol_with_yielding_select = yes ; then
11536         cat >> confdefs.h <<\EOF
11537 #define HAVE_YIELDING_SELECT 1
11538 EOF
11539
11540 fi
11541
11542 if test $ol_with_threads = manual ; then
11543                 ol_link_threads=yes
11544
11545         echo "configure: warning: thread defines and link options must be set manually" 1>&2
11546
11547         for ac_hdr in pthread.h sched.h
11548 do
11549 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11550 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11551 echo "configure:11552: checking for $ac_hdr" >&5
11552 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11553   echo $ac_n "(cached) $ac_c" 1>&6
11554 else
11555   cat > conftest.$ac_ext <<EOF
11556 #line 11557 "configure"
11557 #include "confdefs.h"
11558 #include <$ac_hdr>
11559 EOF
11560 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11561 { (eval echo configure:11562: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11562 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11563 if test -z "$ac_err"; then
11564   rm -rf conftest*
11565   eval "ac_cv_header_$ac_safe=yes"
11566 else
11567   echo "$ac_err" >&5
11568   echo "configure: failed program was:" >&5
11569   cat conftest.$ac_ext >&5
11570   rm -rf conftest*
11571   eval "ac_cv_header_$ac_safe=no"
11572 fi
11573 rm -f conftest*
11574 fi
11575 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11576   echo "$ac_t""yes" 1>&6
11577     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11578   cat >> confdefs.h <<EOF
11579 #define $ac_tr_hdr 1
11580 EOF
11581  
11582 else
11583   echo "$ac_t""no" 1>&6
11584 fi
11585 done
11586
11587         for ac_func in sched_yield pthread_yield
11588 do
11589 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11590 echo "configure:11591: checking for $ac_func" >&5
11591 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11592   echo $ac_n "(cached) $ac_c" 1>&6
11593 else
11594   cat > conftest.$ac_ext <<EOF
11595 #line 11596 "configure"
11596 #include "confdefs.h"
11597 /* System header to define __stub macros and hopefully few prototypes,
11598     which can conflict with char $ac_func(); below.  */
11599 #include <assert.h>
11600 /* Override any gcc2 internal prototype to avoid an error.  */
11601 /* We use char because int might match the return type of a gcc2
11602     builtin and then its argument prototype would still apply.  */
11603 char $ac_func();
11604 char (*f)();
11605
11606 int main() {
11607
11608 /* The GNU C library defines this for functions which it implements
11609     to always fail with ENOSYS.  Some functions are actually named
11610     something starting with __ and the normal name is an alias.  */
11611 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11612 choke me
11613 #else
11614 f = $ac_func;
11615 #endif
11616
11617 ; return 0; }
11618 EOF
11619 if { (eval echo configure:11620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11620   rm -rf conftest*
11621   eval "ac_cv_func_$ac_func=yes"
11622 else
11623   echo "configure: failed program was:" >&5
11624   cat conftest.$ac_ext >&5
11625   rm -rf conftest*
11626   eval "ac_cv_func_$ac_func=no"
11627 fi
11628 rm -f conftest*
11629 fi
11630
11631 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11632   echo "$ac_t""yes" 1>&6
11633     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11634   cat >> confdefs.h <<EOF
11635 #define $ac_tr_func 1
11636 EOF
11637  
11638 else
11639   echo "$ac_t""no" 1>&6
11640 fi
11641 done
11642
11643         
11644         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
11645 echo "configure:11646: checking for LinuxThreads pthread.h" >&5
11646 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
11647   echo $ac_n "(cached) $ac_c" 1>&6
11648 else
11649   cat > conftest.$ac_ext <<EOF
11650 #line 11651 "configure"
11651 #include "confdefs.h"
11652 #include <pthread.h>
11653 EOF
11654 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11655   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
11656   rm -rf conftest*
11657   ol_cv_header_linux_threads=yes
11658 else
11659   rm -rf conftest*
11660   ol_cv_header_linux_threads=no
11661 fi
11662 rm -f conftest*
11663
11664                 
11665 fi
11666
11667 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
11668         if test $ol_cv_header_linux_threads = yes; then
11669                 cat >> confdefs.h <<\EOF
11670 #define HAVE_LINUX_THREADS 1
11671 EOF
11672
11673         fi
11674
11675
11676         for ac_hdr in mach/cthreads.h
11677 do
11678 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11679 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11680 echo "configure:11681: checking for $ac_hdr" >&5
11681 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11682   echo $ac_n "(cached) $ac_c" 1>&6
11683 else
11684   cat > conftest.$ac_ext <<EOF
11685 #line 11686 "configure"
11686 #include "confdefs.h"
11687 #include <$ac_hdr>
11688 EOF
11689 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11690 { (eval echo configure:11691: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11691 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11692 if test -z "$ac_err"; then
11693   rm -rf conftest*
11694   eval "ac_cv_header_$ac_safe=yes"
11695 else
11696   echo "$ac_err" >&5
11697   echo "configure: failed program was:" >&5
11698   cat conftest.$ac_ext >&5
11699   rm -rf conftest*
11700   eval "ac_cv_header_$ac_safe=no"
11701 fi
11702 rm -f conftest*
11703 fi
11704 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11705   echo "$ac_t""yes" 1>&6
11706     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11707   cat >> confdefs.h <<EOF
11708 #define $ac_tr_hdr 1
11709 EOF
11710  
11711 else
11712   echo "$ac_t""no" 1>&6
11713 fi
11714 done
11715
11716         for ac_hdr in lwp/lwp.h
11717 do
11718 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11719 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11720 echo "configure:11721: checking for $ac_hdr" >&5
11721 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11722   echo $ac_n "(cached) $ac_c" 1>&6
11723 else
11724   cat > conftest.$ac_ext <<EOF
11725 #line 11726 "configure"
11726 #include "confdefs.h"
11727 #include <$ac_hdr>
11728 EOF
11729 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11730 { (eval echo configure:11731: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11731 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11732 if test -z "$ac_err"; then
11733   rm -rf conftest*
11734   eval "ac_cv_header_$ac_safe=yes"
11735 else
11736   echo "$ac_err" >&5
11737   echo "configure: failed program was:" >&5
11738   cat conftest.$ac_ext >&5
11739   rm -rf conftest*
11740   eval "ac_cv_header_$ac_safe=no"
11741 fi
11742 rm -f conftest*
11743 fi
11744 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11745   echo "$ac_t""yes" 1>&6
11746     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11747   cat >> confdefs.h <<EOF
11748 #define $ac_tr_hdr 1
11749 EOF
11750  
11751 else
11752   echo "$ac_t""no" 1>&6
11753 fi
11754 done
11755
11756         for ac_hdr in thread.h synch.h
11757 do
11758 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11759 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11760 echo "configure:11761: checking for $ac_hdr" >&5
11761 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11762   echo $ac_n "(cached) $ac_c" 1>&6
11763 else
11764   cat > conftest.$ac_ext <<EOF
11765 #line 11766 "configure"
11766 #include "confdefs.h"
11767 #include <$ac_hdr>
11768 EOF
11769 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11770 { (eval echo configure:11771: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11771 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11772 if test -z "$ac_err"; then
11773   rm -rf conftest*
11774   eval "ac_cv_header_$ac_safe=yes"
11775 else
11776   echo "$ac_err" >&5
11777   echo "configure: failed program was:" >&5
11778   cat conftest.$ac_ext >&5
11779   rm -rf conftest*
11780   eval "ac_cv_header_$ac_safe=no"
11781 fi
11782 rm -f conftest*
11783 fi
11784 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11785   echo "$ac_t""yes" 1>&6
11786     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11787   cat >> confdefs.h <<EOF
11788 #define $ac_tr_hdr 1
11789 EOF
11790  
11791 else
11792   echo "$ac_t""no" 1>&6
11793 fi
11794 done
11795
11796 fi
11797
11798 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
11799                         cat >> confdefs.h <<\EOF
11800 #define REENTRANT 1
11801 EOF
11802
11803         cat >> confdefs.h <<\EOF
11804 #define _REENTRANT 1
11805 EOF
11806
11807         cat >> confdefs.h <<\EOF
11808 #define THREAD_SAFE 1
11809 EOF
11810
11811         cat >> confdefs.h <<\EOF
11812 #define _THREAD_SAFE 1
11813 EOF
11814
11815         cat >> confdefs.h <<\EOF
11816 #define THREADSAFE 1
11817 EOF
11818
11819         cat >> confdefs.h <<\EOF
11820 #define _THREADSAFE 1
11821 EOF
11822
11823         cat >> confdefs.h <<\EOF
11824 #define _SGI_MP_SOURCE 1
11825 EOF
11826
11827
11828                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
11829 echo "configure:11830: checking for thread specific errno" >&5
11830 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
11831   echo $ac_n "(cached) $ac_c" 1>&6
11832 else
11833   
11834                 cat > conftest.$ac_ext <<EOF
11835 #line 11836 "configure"
11836 #include "confdefs.h"
11837 #include <errno.h>
11838 int main() {
11839 errno = 0;
11840 ; return 0; }
11841 EOF
11842 if { (eval echo configure:11843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11843   rm -rf conftest*
11844   ol_cv_errno_thread_specific=yes
11845 else
11846   echo "configure: failed program was:" >&5
11847   cat conftest.$ac_ext >&5
11848   rm -rf conftest*
11849   ol_cv_errno_thread_specific=no
11850 fi
11851 rm -f conftest*
11852         
11853 fi
11854
11855 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
11856
11857                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
11858 echo "configure:11859: checking for thread specific h_errno" >&5
11859 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
11860   echo $ac_n "(cached) $ac_c" 1>&6
11861 else
11862   
11863                 cat > conftest.$ac_ext <<EOF
11864 #line 11865 "configure"
11865 #include "confdefs.h"
11866 #include <netdb.h>
11867 int main() {
11868 h_errno = 0;
11869 ; return 0; }
11870 EOF
11871 if { (eval echo configure:11872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11872   rm -rf conftest*
11873   ol_cv_h_errno_thread_specific=yes
11874 else
11875   echo "configure: failed program was:" >&5
11876   cat conftest.$ac_ext >&5
11877   rm -rf conftest*
11878   ol_cv_h_errno_thread_specific=no
11879 fi
11880 rm -f conftest*
11881         
11882 fi
11883
11884 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
11885
11886         if test $ol_cv_errno_thread_specific != yes \
11887                 -o $ol_cv_h_errno_thread_specific != yes ; then
11888                 LIBS="$LTHREAD_LIBS $LIBS"
11889                 LTHREAD_LIBS=""
11890         fi
11891
11892 fi  
11893
11894 if test $ol_link_threads = no ; then
11895         if test $ol_with_threads = yes ; then
11896                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
11897         fi
11898
11899         if test $ol_with_threads = auto ; then
11900                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
11901                 ol_with_threads=no
11902         fi
11903
11904         cat >> confdefs.h <<\EOF
11905 #define NO_THREADS 1
11906 EOF
11907
11908         LTHREAD_LIBS=""
11909 fi
11910
11911 if test $ol_link_threads != no ; then
11912         cat >> confdefs.h <<\EOF
11913 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
11914 EOF
11915
11916 fi
11917
11918 ol_link_ldbm=no 
11919
11920 if test $ol_with_ldbm_api = auto \
11921         -o $ol_with_ldbm_api = berkeley \
11922         -o $ol_with_ldbm_api = bcompat ; then
11923
11924         if test $ol_with_ldbm_api = bcompat; then \
11925                 ol_cv_berkeley_db=no
11926 for ac_hdr in db_185.h db.h
11927 do
11928 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11929 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11930 echo "configure:11931: checking for $ac_hdr" >&5
11931 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11932   echo $ac_n "(cached) $ac_c" 1>&6
11933 else
11934   cat > conftest.$ac_ext <<EOF
11935 #line 11936 "configure"
11936 #include "confdefs.h"
11937 #include <$ac_hdr>
11938 EOF
11939 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11940 { (eval echo configure:11941: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11941 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11942 if test -z "$ac_err"; then
11943   rm -rf conftest*
11944   eval "ac_cv_header_$ac_safe=yes"
11945 else
11946   echo "$ac_err" >&5
11947   echo "configure: failed program was:" >&5
11948   cat conftest.$ac_ext >&5
11949   rm -rf conftest*
11950   eval "ac_cv_header_$ac_safe=no"
11951 fi
11952 rm -f conftest*
11953 fi
11954 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11955   echo "$ac_t""yes" 1>&6
11956     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11957   cat >> confdefs.h <<EOF
11958 #define $ac_tr_hdr 1
11959 EOF
11960  
11961 else
11962   echo "$ac_t""no" 1>&6
11963 fi
11964 done
11965
11966 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
11967         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
11968 echo "configure:11969: checking if Berkeley DB header compatibility" >&5
11969 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
11970   echo $ac_n "(cached) $ac_c" 1>&6
11971 else
11972   
11973                 cat > conftest.$ac_ext <<EOF
11974 #line 11975 "configure"
11975 #include "confdefs.h"
11976
11977 #if HAVE_DB_185_H
11978 #       include <db_185.h>
11979 #else
11980 #       include <db.h>
11981 #endif
11982
11983  /* this check could be improved */
11984 #ifndef DB_VERSION_MAJOR
11985 #       define DB_VERSION_MAJOR 1
11986 #endif
11987
11988 #if DB_VERSION_MAJOR == 1 
11989         __db_version_1
11990 #endif
11991
11992 EOF
11993 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11994   egrep "__db_version_1" >/dev/null 2>&1; then
11995   rm -rf conftest*
11996   ol_cv_header_db1=yes
11997 else
11998   rm -rf conftest*
11999   ol_cv_header_db1=no
12000 fi
12001 rm -f conftest*
12002
12003 fi
12004
12005 echo "$ac_t""$ol_cv_header_db1" 1>&6
12006
12007         if test ol_cv_header_db1=yes ; then
12008                 ol_cv_lib_db=no
12009 if test $ol_cv_lib_db = no ; then
12010         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
12011 echo "configure:12012: checking for Berkeley DB link (default)" >&5
12012 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
12013   echo $ac_n "(cached) $ac_c" 1>&6
12014 else
12015   
12016         ol_DB_LIB=
12017         ol_LIBS=$LIBS
12018         LIBS="$ol_DB_LIB $LIBS"
12019
12020         cat > conftest.$ac_ext <<EOF
12021 #line 12022 "configure"
12022 #include "confdefs.h"
12023
12024 #ifdef HAVE_DB_185_H
12025 # include <db_185.h>
12026 #else
12027 # include <db.h>
12028 #endif
12029
12030 #ifndef DB_VERSION_MAJOR
12031 # define DB_VERSION_MAJOR 1
12032 #endif
12033
12034 #ifndef NULL
12035 #define NULL ((void*)0)
12036 #endif
12037
12038 int main() {
12039
12040 #if DB_VERSION_MAJOR > 2
12041         db_env_create( NULL, 0 );
12042 #elif DB_VERSION_MAJOR > 1
12043         db_appexit( NULL );
12044 #else
12045         (void) dbopen( NULL, 0, 0, 0, NULL);
12046 #endif
12047
12048 ; return 0; }
12049 EOF
12050 if { (eval echo configure:12051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12051   rm -rf conftest*
12052   ol_cv_db_none=yes
12053 else
12054   echo "configure: failed program was:" >&5
12055   cat conftest.$ac_ext >&5
12056   rm -rf conftest*
12057   ol_cv_db_none=no
12058 fi
12059 rm -f conftest*
12060
12061         LIBS="$ol_LIBS"
12062
12063 fi
12064
12065 echo "$ac_t""$ol_cv_db_none" 1>&6
12066
12067         if test $ol_cv_db_none = yes ; then
12068                 ol_cv_lib_db=yes
12069         fi
12070 fi
12071
12072 if test $ol_cv_lib_db = no ; then
12073         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
12074 echo "configure:12075: checking for Berkeley DB link (-ldb)" >&5
12075 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
12076   echo $ac_n "(cached) $ac_c" 1>&6
12077 else
12078   
12079         ol_DB_LIB=-ldb
12080         ol_LIBS=$LIBS
12081         LIBS="$ol_DB_LIB $LIBS"
12082
12083         cat > conftest.$ac_ext <<EOF
12084 #line 12085 "configure"
12085 #include "confdefs.h"
12086
12087 #ifdef HAVE_DB_185_H
12088 # include <db_185.h>
12089 #else
12090 # include <db.h>
12091 #endif
12092
12093 #ifndef DB_VERSION_MAJOR
12094 # define DB_VERSION_MAJOR 1
12095 #endif
12096
12097 #ifndef NULL
12098 #define NULL ((void*)0)
12099 #endif
12100
12101 int main() {
12102
12103 #if DB_VERSION_MAJOR > 2
12104         db_env_create( NULL, 0 );
12105 #elif DB_VERSION_MAJOR > 1
12106         db_appexit( NULL );
12107 #else
12108         (void) dbopen( NULL, 0, 0, 0, NULL);
12109 #endif
12110
12111 ; return 0; }
12112 EOF
12113 if { (eval echo configure:12114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12114   rm -rf conftest*
12115   ol_cv_db_db=yes
12116 else
12117   echo "configure: failed program was:" >&5
12118   cat conftest.$ac_ext >&5
12119   rm -rf conftest*
12120   ol_cv_db_db=no
12121 fi
12122 rm -f conftest*
12123
12124         LIBS="$ol_LIBS"
12125
12126 fi
12127
12128 echo "$ac_t""$ol_cv_db_db" 1>&6
12129
12130         if test $ol_cv_db_db = yes ; then
12131                 ol_cv_lib_db=-ldb
12132         fi
12133 fi
12134
12135 if test $ol_cv_lib_db = no ; then
12136         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
12137 echo "configure:12138: checking for Berkeley DB link (-ldb3)" >&5
12138 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
12139   echo $ac_n "(cached) $ac_c" 1>&6
12140 else
12141   
12142         ol_DB_LIB=-ldb3
12143         ol_LIBS=$LIBS
12144         LIBS="$ol_DB_LIB $LIBS"
12145
12146         cat > conftest.$ac_ext <<EOF
12147 #line 12148 "configure"
12148 #include "confdefs.h"
12149
12150 #ifdef HAVE_DB_185_H
12151 # include <db_185.h>
12152 #else
12153 # include <db.h>
12154 #endif
12155
12156 #ifndef DB_VERSION_MAJOR
12157 # define DB_VERSION_MAJOR 1
12158 #endif
12159
12160 #ifndef NULL
12161 #define NULL ((void*)0)
12162 #endif
12163
12164 int main() {
12165
12166 #if DB_VERSION_MAJOR > 2
12167         db_env_create( NULL, 0 );
12168 #elif DB_VERSION_MAJOR > 1
12169         db_appexit( NULL );
12170 #else
12171         (void) dbopen( NULL, 0, 0, 0, NULL);
12172 #endif
12173
12174 ; return 0; }
12175 EOF
12176 if { (eval echo configure:12177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12177   rm -rf conftest*
12178   ol_cv_db_db3=yes
12179 else
12180   echo "configure: failed program was:" >&5
12181   cat conftest.$ac_ext >&5
12182   rm -rf conftest*
12183   ol_cv_db_db3=no
12184 fi
12185 rm -f conftest*
12186
12187         LIBS="$ol_LIBS"
12188
12189 fi
12190
12191 echo "$ac_t""$ol_cv_db_db3" 1>&6
12192
12193         if test $ol_cv_db_db3 = yes ; then
12194                 ol_cv_lib_db=-ldb3
12195         fi
12196 fi
12197
12198 if test $ol_cv_lib_db = no ; then
12199         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
12200 echo "configure:12201: checking for Berkeley DB link (-ldb2)" >&5
12201 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
12202   echo $ac_n "(cached) $ac_c" 1>&6
12203 else
12204   
12205         ol_DB_LIB=-ldb2
12206         ol_LIBS=$LIBS
12207         LIBS="$ol_DB_LIB $LIBS"
12208
12209         cat > conftest.$ac_ext <<EOF
12210 #line 12211 "configure"
12211 #include "confdefs.h"
12212
12213 #ifdef HAVE_DB_185_H
12214 # include <db_185.h>
12215 #else
12216 # include <db.h>
12217 #endif
12218
12219 #ifndef DB_VERSION_MAJOR
12220 # define DB_VERSION_MAJOR 1
12221 #endif
12222
12223 #ifndef NULL
12224 #define NULL ((void*)0)
12225 #endif
12226
12227 int main() {
12228
12229 #if DB_VERSION_MAJOR > 2
12230         db_env_create( NULL, 0 );
12231 #elif DB_VERSION_MAJOR > 1
12232         db_appexit( NULL );
12233 #else
12234         (void) dbopen( NULL, 0, 0, 0, NULL);
12235 #endif
12236
12237 ; return 0; }
12238 EOF
12239 if { (eval echo configure:12240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12240   rm -rf conftest*
12241   ol_cv_db_db2=yes
12242 else
12243   echo "configure: failed program was:" >&5
12244   cat conftest.$ac_ext >&5
12245   rm -rf conftest*
12246   ol_cv_db_db2=no
12247 fi
12248 rm -f conftest*
12249
12250         LIBS="$ol_LIBS"
12251
12252 fi
12253
12254 echo "$ac_t""$ol_cv_db_db2" 1>&6
12255
12256         if test $ol_cv_db_db2 = yes ; then
12257                 ol_cv_lib_db=-ldb2
12258         fi
12259 fi
12260
12261 if test $ol_cv_lib_db = no ; then
12262         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
12263 echo "configure:12264: checking for Berkeley DB link (-ldb1)" >&5
12264 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
12265   echo $ac_n "(cached) $ac_c" 1>&6
12266 else
12267   
12268         ol_DB_LIB=-ldb1
12269         ol_LIBS=$LIBS
12270         LIBS="$ol_DB_LIB $LIBS"
12271
12272         cat > conftest.$ac_ext <<EOF
12273 #line 12274 "configure"
12274 #include "confdefs.h"
12275
12276 #ifdef HAVE_DB_185_H
12277 # include <db_185.h>
12278 #else
12279 # include <db.h>
12280 #endif
12281
12282 #ifndef DB_VERSION_MAJOR
12283 # define DB_VERSION_MAJOR 1
12284 #endif
12285
12286 #ifndef NULL
12287 #define NULL ((void*)0)
12288 #endif
12289
12290 int main() {
12291
12292 #if DB_VERSION_MAJOR > 2
12293         db_env_create( NULL, 0 );
12294 #elif DB_VERSION_MAJOR > 1
12295         db_appexit( NULL );
12296 #else
12297         (void) dbopen( NULL, 0, 0, 0, NULL);
12298 #endif
12299
12300 ; return 0; }
12301 EOF
12302 if { (eval echo configure:12303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12303   rm -rf conftest*
12304   ol_cv_db_db1=yes
12305 else
12306   echo "configure: failed program was:" >&5
12307   cat conftest.$ac_ext >&5
12308   rm -rf conftest*
12309   ol_cv_db_db1=no
12310 fi
12311 rm -f conftest*
12312
12313         LIBS="$ol_LIBS"
12314
12315 fi
12316
12317 echo "$ac_t""$ol_cv_db_db1" 1>&6
12318
12319         if test $ol_cv_db_db1 = yes ; then
12320                 ol_cv_lib_db=-ldb1
12321         fi
12322 fi
12323
12324
12325                 if test "$ol_cv_lib_db" != no ; then
12326                         ol_cv_berkeley_db=yes
12327                 fi
12328         fi
12329 fi
12330
12331         else
12332                 ol_cv_berkeley_db=no
12333 for ac_hdr in db.h
12334 do
12335 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12336 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12337 echo "configure:12338: checking for $ac_hdr" >&5
12338 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12339   echo $ac_n "(cached) $ac_c" 1>&6
12340 else
12341   cat > conftest.$ac_ext <<EOF
12342 #line 12343 "configure"
12343 #include "confdefs.h"
12344 #include <$ac_hdr>
12345 EOF
12346 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12347 { (eval echo configure:12348: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12348 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12349 if test -z "$ac_err"; then
12350   rm -rf conftest*
12351   eval "ac_cv_header_$ac_safe=yes"
12352 else
12353   echo "$ac_err" >&5
12354   echo "configure: failed program was:" >&5
12355   cat conftest.$ac_ext >&5
12356   rm -rf conftest*
12357   eval "ac_cv_header_$ac_safe=no"
12358 fi
12359 rm -f conftest*
12360 fi
12361 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12362   echo "$ac_t""yes" 1>&6
12363     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12364   cat >> confdefs.h <<EOF
12365 #define $ac_tr_hdr 1
12366 EOF
12367  
12368 else
12369   echo "$ac_t""no" 1>&6
12370 fi
12371 done
12372
12373 if test $ac_cv_header_db_h = yes; then
12374         ol_cv_lib_db=no
12375 if test $ol_cv_lib_db = no ; then
12376         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
12377 echo "configure:12378: checking for Berkeley DB link (default)" >&5
12378 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
12379   echo $ac_n "(cached) $ac_c" 1>&6
12380 else
12381   
12382         ol_DB_LIB=
12383         ol_LIBS=$LIBS
12384         LIBS="$ol_DB_LIB $LIBS"
12385
12386         cat > conftest.$ac_ext <<EOF
12387 #line 12388 "configure"
12388 #include "confdefs.h"
12389
12390 #ifdef HAVE_DB_185_H
12391 # include <db_185.h>
12392 #else
12393 # include <db.h>
12394 #endif
12395
12396 #ifndef DB_VERSION_MAJOR
12397 # define DB_VERSION_MAJOR 1
12398 #endif
12399
12400 #ifndef NULL
12401 #define NULL ((void*)0)
12402 #endif
12403
12404 int main() {
12405
12406 #if DB_VERSION_MAJOR > 2
12407         db_env_create( NULL, 0 );
12408 #elif DB_VERSION_MAJOR > 1
12409         db_appexit( NULL );
12410 #else
12411         (void) dbopen( NULL, 0, 0, 0, NULL);
12412 #endif
12413
12414 ; return 0; }
12415 EOF
12416 if { (eval echo configure:12417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12417   rm -rf conftest*
12418   ol_cv_db_none=yes
12419 else
12420   echo "configure: failed program was:" >&5
12421   cat conftest.$ac_ext >&5
12422   rm -rf conftest*
12423   ol_cv_db_none=no
12424 fi
12425 rm -f conftest*
12426
12427         LIBS="$ol_LIBS"
12428
12429 fi
12430
12431 echo "$ac_t""$ol_cv_db_none" 1>&6
12432
12433         if test $ol_cv_db_none = yes ; then
12434                 ol_cv_lib_db=yes
12435         fi
12436 fi
12437
12438 if test $ol_cv_lib_db = no ; then
12439         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
12440 echo "configure:12441: checking for Berkeley DB link (-ldb)" >&5
12441 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
12442   echo $ac_n "(cached) $ac_c" 1>&6
12443 else
12444   
12445         ol_DB_LIB=-ldb
12446         ol_LIBS=$LIBS
12447         LIBS="$ol_DB_LIB $LIBS"
12448
12449         cat > conftest.$ac_ext <<EOF
12450 #line 12451 "configure"
12451 #include "confdefs.h"
12452
12453 #ifdef HAVE_DB_185_H
12454 # include <db_185.h>
12455 #else
12456 # include <db.h>
12457 #endif
12458
12459 #ifndef DB_VERSION_MAJOR
12460 # define DB_VERSION_MAJOR 1
12461 #endif
12462
12463 #ifndef NULL
12464 #define NULL ((void*)0)
12465 #endif
12466
12467 int main() {
12468
12469 #if DB_VERSION_MAJOR > 2
12470         db_env_create( NULL, 0 );
12471 #elif DB_VERSION_MAJOR > 1
12472         db_appexit( NULL );
12473 #else
12474         (void) dbopen( NULL, 0, 0, 0, NULL);
12475 #endif
12476
12477 ; return 0; }
12478 EOF
12479 if { (eval echo configure:12480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12480   rm -rf conftest*
12481   ol_cv_db_db=yes
12482 else
12483   echo "configure: failed program was:" >&5
12484   cat conftest.$ac_ext >&5
12485   rm -rf conftest*
12486   ol_cv_db_db=no
12487 fi
12488 rm -f conftest*
12489
12490         LIBS="$ol_LIBS"
12491
12492 fi
12493
12494 echo "$ac_t""$ol_cv_db_db" 1>&6
12495
12496         if test $ol_cv_db_db = yes ; then
12497                 ol_cv_lib_db=-ldb
12498         fi
12499 fi
12500
12501 if test $ol_cv_lib_db = no ; then
12502         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
12503 echo "configure:12504: checking for Berkeley DB link (-ldb3)" >&5
12504 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
12505   echo $ac_n "(cached) $ac_c" 1>&6
12506 else
12507   
12508         ol_DB_LIB=-ldb3
12509         ol_LIBS=$LIBS
12510         LIBS="$ol_DB_LIB $LIBS"
12511
12512         cat > conftest.$ac_ext <<EOF
12513 #line 12514 "configure"
12514 #include "confdefs.h"
12515
12516 #ifdef HAVE_DB_185_H
12517 # include <db_185.h>
12518 #else
12519 # include <db.h>
12520 #endif
12521
12522 #ifndef DB_VERSION_MAJOR
12523 # define DB_VERSION_MAJOR 1
12524 #endif
12525
12526 #ifndef NULL
12527 #define NULL ((void*)0)
12528 #endif
12529
12530 int main() {
12531
12532 #if DB_VERSION_MAJOR > 2
12533         db_env_create( NULL, 0 );
12534 #elif DB_VERSION_MAJOR > 1
12535         db_appexit( NULL );
12536 #else
12537         (void) dbopen( NULL, 0, 0, 0, NULL);
12538 #endif
12539
12540 ; return 0; }
12541 EOF
12542 if { (eval echo configure:12543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12543   rm -rf conftest*
12544   ol_cv_db_db3=yes
12545 else
12546   echo "configure: failed program was:" >&5
12547   cat conftest.$ac_ext >&5
12548   rm -rf conftest*
12549   ol_cv_db_db3=no
12550 fi
12551 rm -f conftest*
12552
12553         LIBS="$ol_LIBS"
12554
12555 fi
12556
12557 echo "$ac_t""$ol_cv_db_db3" 1>&6
12558
12559         if test $ol_cv_db_db3 = yes ; then
12560                 ol_cv_lib_db=-ldb3
12561         fi
12562 fi
12563
12564 if test $ol_cv_lib_db = no ; then
12565         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
12566 echo "configure:12567: checking for Berkeley DB link (-ldb2)" >&5
12567 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
12568   echo $ac_n "(cached) $ac_c" 1>&6
12569 else
12570   
12571         ol_DB_LIB=-ldb2
12572         ol_LIBS=$LIBS
12573         LIBS="$ol_DB_LIB $LIBS"
12574
12575         cat > conftest.$ac_ext <<EOF
12576 #line 12577 "configure"
12577 #include "confdefs.h"
12578
12579 #ifdef HAVE_DB_185_H
12580 # include <db_185.h>
12581 #else
12582 # include <db.h>
12583 #endif
12584
12585 #ifndef DB_VERSION_MAJOR
12586 # define DB_VERSION_MAJOR 1
12587 #endif
12588
12589 #ifndef NULL
12590 #define NULL ((void*)0)
12591 #endif
12592
12593 int main() {
12594
12595 #if DB_VERSION_MAJOR > 2
12596         db_env_create( NULL, 0 );
12597 #elif DB_VERSION_MAJOR > 1
12598         db_appexit( NULL );
12599 #else
12600         (void) dbopen( NULL, 0, 0, 0, NULL);
12601 #endif
12602
12603 ; return 0; }
12604 EOF
12605 if { (eval echo configure:12606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12606   rm -rf conftest*
12607   ol_cv_db_db2=yes
12608 else
12609   echo "configure: failed program was:" >&5
12610   cat conftest.$ac_ext >&5
12611   rm -rf conftest*
12612   ol_cv_db_db2=no
12613 fi
12614 rm -f conftest*
12615
12616         LIBS="$ol_LIBS"
12617
12618 fi
12619
12620 echo "$ac_t""$ol_cv_db_db2" 1>&6
12621
12622         if test $ol_cv_db_db2 = yes ; then
12623                 ol_cv_lib_db=-ldb2
12624         fi
12625 fi
12626
12627 if test $ol_cv_lib_db = no ; then
12628         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
12629 echo "configure:12630: checking for Berkeley DB link (-ldb1)" >&5
12630 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
12631   echo $ac_n "(cached) $ac_c" 1>&6
12632 else
12633   
12634         ol_DB_LIB=-ldb1
12635         ol_LIBS=$LIBS
12636         LIBS="$ol_DB_LIB $LIBS"
12637
12638         cat > conftest.$ac_ext <<EOF
12639 #line 12640 "configure"
12640 #include "confdefs.h"
12641
12642 #ifdef HAVE_DB_185_H
12643 # include <db_185.h>
12644 #else
12645 # include <db.h>
12646 #endif
12647
12648 #ifndef DB_VERSION_MAJOR
12649 # define DB_VERSION_MAJOR 1
12650 #endif
12651
12652 #ifndef NULL
12653 #define NULL ((void*)0)
12654 #endif
12655
12656 int main() {
12657
12658 #if DB_VERSION_MAJOR > 2
12659         db_env_create( NULL, 0 );
12660 #elif DB_VERSION_MAJOR > 1
12661         db_appexit( NULL );
12662 #else
12663         (void) dbopen( NULL, 0, 0, 0, NULL);
12664 #endif
12665
12666 ; return 0; }
12667 EOF
12668 if { (eval echo configure:12669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12669   rm -rf conftest*
12670   ol_cv_db_db1=yes
12671 else
12672   echo "configure: failed program was:" >&5
12673   cat conftest.$ac_ext >&5
12674   rm -rf conftest*
12675   ol_cv_db_db1=no
12676 fi
12677 rm -f conftest*
12678
12679         LIBS="$ol_LIBS"
12680
12681 fi
12682
12683 echo "$ac_t""$ol_cv_db_db1" 1>&6
12684
12685         if test $ol_cv_db_db1 = yes ; then
12686                 ol_cv_lib_db=-ldb1
12687         fi
12688 fi
12689
12690
12691         if test "$ol_cv_lib_db" != no ; then
12692                 ol_cv_berkeley_db=yes
12693                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
12694 echo "configure:12695: checking for Berkeley DB thread support" >&5
12695 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
12696   echo $ac_n "(cached) $ac_c" 1>&6
12697 else
12698   
12699         ol_LIBS="$LIBS"
12700         if test $ol_cv_lib_db != yes ; then
12701                 LIBS="$ol_cv_lib_db"
12702         fi
12703
12704         if test "$cross_compiling" = yes; then
12705   ol_cv_berkeley_db_thread=cross
12706 else
12707   cat > conftest.$ac_ext <<EOF
12708 #line 12709 "configure"
12709 #include "confdefs.h"
12710
12711 #ifdef HAVE_DB_185_H
12712         choke me;
12713 #else
12714 #include <db.h>
12715 #endif
12716 #ifndef NULL
12717 #define NULL ((void *)0)
12718 #endif
12719 main()
12720 {
12721         int rc;
12722         u_int32_t flags = DB_CREATE | DB_INIT_CDB | DB_INIT_MPOOL |
12723 #ifdef DB_PRIVATE
12724                 DB_PRIVATE |
12725 #endif
12726 #ifdef DB_MPOOL_PRIVATE
12727                 DB_MPOOL_PRIVATE |
12728 #endif
12729                 DB_THREAD;
12730
12731 #if DB_VERSION_MAJOR > 2
12732         DB_ENV *env = NULL;
12733
12734         rc = db_env_create( &env, 0 );
12735
12736         if( rc ) return rc;
12737
12738 #ifdef DB_CDB_ALLDB
12739         rc = env->set_flags( env, DB_CDB_ALLDB, 1 );
12740         if( rc ) goto done;
12741 #endif
12742
12743 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
12744         rc = env->open( env, NULL, flags, 0 );
12745 #else
12746         rc = env->open( env, NULL, NULL, flags, 0 );
12747 #endif
12748
12749 #ifdef DB_CDB_ALLDB
12750 done:
12751 #endif
12752 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
12753         env->remove( env, NULL, DB_FORCE);
12754 #else
12755         env->remove( env, NULL, NULL, DB_FORCE);
12756 #endif
12757
12758 #else
12759         DB_ENV env;
12760         memset( &env, '\0', sizeof(env) );
12761
12762         rc = db_appinit( NULL, NULL, &env, flags );
12763
12764         if( rc == 0 ) {
12765                 db_appexit( &env );
12766         }
12767
12768         unlink("__db_mpool.share");
12769         unlink("__db_lock.share");
12770 #endif
12771
12772         return rc;
12773 }
12774 EOF
12775 if { (eval echo configure:12776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12776 then
12777   ol_cv_berkeley_db_thread=yes
12778 else
12779   echo "configure: failed program was:" >&5
12780   cat conftest.$ac_ext >&5
12781   rm -fr conftest*
12782   ol_cv_berkeley_db_thread=no
12783 fi
12784 rm -fr conftest*
12785 fi
12786
12787
12788         LIBS="$ol_LIBS"
12789
12790         if test $ol_cv_berkeley_db_thread != no ; then
12791                 cat >> confdefs.h <<\EOF
12792 #define HAVE_BERKELEY_DB_THREAD 1
12793 EOF
12794
12795         fi
12796
12797 fi
12798
12799 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
12800         fi
12801 fi
12802
12803         fi
12804
12805         if test $ol_cv_berkeley_db != no ; then
12806                 cat >> confdefs.h <<\EOF
12807 #define HAVE_BERKELEY_DB 1
12808 EOF
12809
12810
12811                 ol_link_ldbm=berkeley
12812                 ol_with_ldbm_api=db
12813
12814                 if test $ol_with_ldbm_type = hash ; then
12815                         cat >> confdefs.h <<\EOF
12816 #define LDBM_USE_DBHASH 1
12817 EOF
12818
12819                 else
12820                         cat >> confdefs.h <<\EOF
12821 #define LDBM_USE_DBBTREE 1
12822 EOF
12823
12824                 fi
12825
12826                                                 if test $ol_cv_lib_db != yes ; then
12827                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
12828                 fi
12829         fi
12830 fi
12831
12832 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
12833         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
12834         ol_with_ldbm_api=none
12835 fi
12836
12837 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
12838         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
12839 echo "configure:12840: checking for MDBM library" >&5
12840 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
12841   echo $ac_n "(cached) $ac_c" 1>&6
12842 else
12843         ol_LIBS="$LIBS"
12844         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
12845 echo "configure:12846: checking for mdbm_set_chain" >&5
12846 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
12847   echo $ac_n "(cached) $ac_c" 1>&6
12848 else
12849   cat > conftest.$ac_ext <<EOF
12850 #line 12851 "configure"
12851 #include "confdefs.h"
12852 /* System header to define __stub macros and hopefully few prototypes,
12853     which can conflict with char mdbm_set_chain(); below.  */
12854 #include <assert.h>
12855 /* Override any gcc2 internal prototype to avoid an error.  */
12856 /* We use char because int might match the return type of a gcc2
12857     builtin and then its argument prototype would still apply.  */
12858 char mdbm_set_chain();
12859 char (*f)();
12860
12861 int main() {
12862
12863 /* The GNU C library defines this for functions which it implements
12864     to always fail with ENOSYS.  Some functions are actually named
12865     something starting with __ and the normal name is an alias.  */
12866 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
12867 choke me
12868 #else
12869 f = mdbm_set_chain;
12870 #endif
12871
12872 ; return 0; }
12873 EOF
12874 if { (eval echo configure:12875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12875   rm -rf conftest*
12876   eval "ac_cv_func_mdbm_set_chain=yes"
12877 else
12878   echo "configure: failed program was:" >&5
12879   cat conftest.$ac_ext >&5
12880   rm -rf conftest*
12881   eval "ac_cv_func_mdbm_set_chain=no"
12882 fi
12883 rm -f conftest*
12884 fi
12885
12886 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
12887   echo "$ac_t""yes" 1>&6
12888   ol_cv_lib_mdbm=yes
12889 else
12890   echo "$ac_t""no" 1>&6
12891
12892                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
12893 echo "configure:12894: checking for mdbm_set_chain in -lmdbm" >&5
12894 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
12895 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12896   echo $ac_n "(cached) $ac_c" 1>&6
12897 else
12898   ac_save_LIBS="$LIBS"
12899 LIBS="-lmdbm  $LIBS"
12900 cat > conftest.$ac_ext <<EOF
12901 #line 12902 "configure"
12902 #include "confdefs.h"
12903 /* Override any gcc2 internal prototype to avoid an error.  */
12904 /* We use char because int might match the return type of a gcc2
12905     builtin and then its argument prototype would still apply.  */
12906 char mdbm_set_chain();
12907
12908 int main() {
12909 mdbm_set_chain()
12910 ; return 0; }
12911 EOF
12912 if { (eval echo configure:12913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12913   rm -rf conftest*
12914   eval "ac_cv_lib_$ac_lib_var=yes"
12915 else
12916   echo "configure: failed program was:" >&5
12917   cat conftest.$ac_ext >&5
12918   rm -rf conftest*
12919   eval "ac_cv_lib_$ac_lib_var=no"
12920 fi
12921 rm -f conftest*
12922 LIBS="$ac_save_LIBS"
12923
12924 fi
12925 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12926   echo "$ac_t""yes" 1>&6
12927   ol_cv_lib_mdbm=-lmdbm
12928 else
12929   echo "$ac_t""no" 1>&6
12930 ol_cv_lib_mdbm=no
12931 fi
12932
12933         
12934 fi
12935
12936         LIBS="$ol_LIBS"
12937
12938 fi
12939
12940 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
12941
12942
12943  for ac_hdr in mdbm.h
12944 do
12945 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12946 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12947 echo "configure:12948: checking for $ac_hdr" >&5
12948 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12949   echo $ac_n "(cached) $ac_c" 1>&6
12950 else
12951   cat > conftest.$ac_ext <<EOF
12952 #line 12953 "configure"
12953 #include "confdefs.h"
12954 #include <$ac_hdr>
12955 EOF
12956 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12957 { (eval echo configure:12958: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12958 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12959 if test -z "$ac_err"; then
12960   rm -rf conftest*
12961   eval "ac_cv_header_$ac_safe=yes"
12962 else
12963   echo "$ac_err" >&5
12964   echo "configure: failed program was:" >&5
12965   cat conftest.$ac_ext >&5
12966   rm -rf conftest*
12967   eval "ac_cv_header_$ac_safe=no"
12968 fi
12969 rm -f conftest*
12970 fi
12971 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12972   echo "$ac_t""yes" 1>&6
12973     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12974   cat >> confdefs.h <<EOF
12975 #define $ac_tr_hdr 1
12976 EOF
12977  
12978 else
12979   echo "$ac_t""no" 1>&6
12980 fi
12981 done
12982
12983  echo $ac_n "checking for db""... $ac_c" 1>&6
12984 echo "configure:12985: checking for db" >&5
12985 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
12986   echo $ac_n "(cached) $ac_c" 1>&6
12987 else
12988   
12989         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
12990                 ol_cv_mdbm=no
12991         else
12992                 ol_cv_mdbm=yes
12993         fi
12994
12995 fi
12996
12997 echo "$ac_t""$ol_cv_mdbm" 1>&6
12998  if test $ol_cv_mdbm = yes ; then
12999         cat >> confdefs.h <<\EOF
13000 #define HAVE_MDBM 1
13001 EOF
13002
13003  fi
13004
13005
13006         if test $ol_cv_mdbm = yes ; then
13007                 ol_link_ldbm=mdbm
13008                 ol_with_ldbm_api=mdbm
13009                 if test $ol_cv_lib_mdbm != yes ; then
13010                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
13011                 fi
13012         fi
13013 fi
13014
13015 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
13016         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
13017 echo "configure:13018: checking for GDBM library" >&5
13018 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
13019   echo $ac_n "(cached) $ac_c" 1>&6
13020 else
13021         ol_LIBS="$LIBS"
13022         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
13023 echo "configure:13024: checking for gdbm_open" >&5
13024 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
13025   echo $ac_n "(cached) $ac_c" 1>&6
13026 else
13027   cat > conftest.$ac_ext <<EOF
13028 #line 13029 "configure"
13029 #include "confdefs.h"
13030 /* System header to define __stub macros and hopefully few prototypes,
13031     which can conflict with char gdbm_open(); below.  */
13032 #include <assert.h>
13033 /* Override any gcc2 internal prototype to avoid an error.  */
13034 /* We use char because int might match the return type of a gcc2
13035     builtin and then its argument prototype would still apply.  */
13036 char gdbm_open();
13037 char (*f)();
13038
13039 int main() {
13040
13041 /* The GNU C library defines this for functions which it implements
13042     to always fail with ENOSYS.  Some functions are actually named
13043     something starting with __ and the normal name is an alias.  */
13044 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
13045 choke me
13046 #else
13047 f = gdbm_open;
13048 #endif
13049
13050 ; return 0; }
13051 EOF
13052 if { (eval echo configure:13053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13053   rm -rf conftest*
13054   eval "ac_cv_func_gdbm_open=yes"
13055 else
13056   echo "configure: failed program was:" >&5
13057   cat conftest.$ac_ext >&5
13058   rm -rf conftest*
13059   eval "ac_cv_func_gdbm_open=no"
13060 fi
13061 rm -f conftest*
13062 fi
13063
13064 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
13065   echo "$ac_t""yes" 1>&6
13066   ol_cv_lib_gdbm=yes
13067 else
13068   echo "$ac_t""no" 1>&6
13069
13070                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
13071 echo "configure:13072: checking for gdbm_open in -lgdbm" >&5
13072 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
13073 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13074   echo $ac_n "(cached) $ac_c" 1>&6
13075 else
13076   ac_save_LIBS="$LIBS"
13077 LIBS="-lgdbm  $LIBS"
13078 cat > conftest.$ac_ext <<EOF
13079 #line 13080 "configure"
13080 #include "confdefs.h"
13081 /* Override any gcc2 internal prototype to avoid an error.  */
13082 /* We use char because int might match the return type of a gcc2
13083     builtin and then its argument prototype would still apply.  */
13084 char gdbm_open();
13085
13086 int main() {
13087 gdbm_open()
13088 ; return 0; }
13089 EOF
13090 if { (eval echo configure:13091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13091   rm -rf conftest*
13092   eval "ac_cv_lib_$ac_lib_var=yes"
13093 else
13094   echo "configure: failed program was:" >&5
13095   cat conftest.$ac_ext >&5
13096   rm -rf conftest*
13097   eval "ac_cv_lib_$ac_lib_var=no"
13098 fi
13099 rm -f conftest*
13100 LIBS="$ac_save_LIBS"
13101
13102 fi
13103 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13104   echo "$ac_t""yes" 1>&6
13105   ol_cv_lib_gdbm=-lgdbm
13106 else
13107   echo "$ac_t""no" 1>&6
13108 ol_cv_lib_gdbm=no
13109 fi
13110
13111         
13112 fi
13113
13114         LIBS="$ol_LIBS"
13115
13116 fi
13117
13118 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
13119
13120
13121  for ac_hdr in gdbm.h
13122 do
13123 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13124 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13125 echo "configure:13126: checking for $ac_hdr" >&5
13126 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13127   echo $ac_n "(cached) $ac_c" 1>&6
13128 else
13129   cat > conftest.$ac_ext <<EOF
13130 #line 13131 "configure"
13131 #include "confdefs.h"
13132 #include <$ac_hdr>
13133 EOF
13134 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13135 { (eval echo configure:13136: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13136 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13137 if test -z "$ac_err"; then
13138   rm -rf conftest*
13139   eval "ac_cv_header_$ac_safe=yes"
13140 else
13141   echo "$ac_err" >&5
13142   echo "configure: failed program was:" >&5
13143   cat conftest.$ac_ext >&5
13144   rm -rf conftest*
13145   eval "ac_cv_header_$ac_safe=no"
13146 fi
13147 rm -f conftest*
13148 fi
13149 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13150   echo "$ac_t""yes" 1>&6
13151     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13152   cat >> confdefs.h <<EOF
13153 #define $ac_tr_hdr 1
13154 EOF
13155  
13156 else
13157   echo "$ac_t""no" 1>&6
13158 fi
13159 done
13160
13161  echo $ac_n "checking for db""... $ac_c" 1>&6
13162 echo "configure:13163: checking for db" >&5
13163 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
13164   echo $ac_n "(cached) $ac_c" 1>&6
13165 else
13166   
13167         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
13168                 ol_cv_gdbm=no
13169         else
13170                 ol_cv_gdbm=yes
13171         fi
13172
13173 fi
13174
13175 echo "$ac_t""$ol_cv_gdbm" 1>&6
13176  if test $ol_cv_gdbm = yes ; then
13177         cat >> confdefs.h <<\EOF
13178 #define HAVE_GDBM 1
13179 EOF
13180
13181  fi
13182
13183
13184         if test $ol_cv_gdbm = yes ; then
13185                 ol_link_ldbm=gdbm
13186                 ol_with_ldbm_api=gdbm
13187
13188                 if test $ol_cv_lib_gdbm != yes ; then
13189                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
13190                 fi
13191         fi
13192 fi
13193
13194 if test $ol_with_ldbm_api = ndbm ; then
13195         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
13196 echo "configure:13197: checking for NDBM library" >&5
13197 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
13198   echo $ac_n "(cached) $ac_c" 1>&6
13199 else
13200         ol_LIBS="$LIBS"
13201         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
13202 echo "configure:13203: checking for dbm_open" >&5
13203 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
13204   echo $ac_n "(cached) $ac_c" 1>&6
13205 else
13206   cat > conftest.$ac_ext <<EOF
13207 #line 13208 "configure"
13208 #include "confdefs.h"
13209 /* System header to define __stub macros and hopefully few prototypes,
13210     which can conflict with char dbm_open(); below.  */
13211 #include <assert.h>
13212 /* Override any gcc2 internal prototype to avoid an error.  */
13213 /* We use char because int might match the return type of a gcc2
13214     builtin and then its argument prototype would still apply.  */
13215 char dbm_open();
13216 char (*f)();
13217
13218 int main() {
13219
13220 /* The GNU C library defines this for functions which it implements
13221     to always fail with ENOSYS.  Some functions are actually named
13222     something starting with __ and the normal name is an alias.  */
13223 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
13224 choke me
13225 #else
13226 f = dbm_open;
13227 #endif
13228
13229 ; return 0; }
13230 EOF
13231 if { (eval echo configure:13232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13232   rm -rf conftest*
13233   eval "ac_cv_func_dbm_open=yes"
13234 else
13235   echo "configure: failed program was:" >&5
13236   cat conftest.$ac_ext >&5
13237   rm -rf conftest*
13238   eval "ac_cv_func_dbm_open=no"
13239 fi
13240 rm -f conftest*
13241 fi
13242
13243 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
13244   echo "$ac_t""yes" 1>&6
13245   ol_cv_lib_ndbm=yes
13246 else
13247   echo "$ac_t""no" 1>&6
13248
13249                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
13250 echo "configure:13251: checking for dbm_open in -lndbm" >&5
13251 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
13252 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13253   echo $ac_n "(cached) $ac_c" 1>&6
13254 else
13255   ac_save_LIBS="$LIBS"
13256 LIBS="-lndbm  $LIBS"
13257 cat > conftest.$ac_ext <<EOF
13258 #line 13259 "configure"
13259 #include "confdefs.h"
13260 /* Override any gcc2 internal prototype to avoid an error.  */
13261 /* We use char because int might match the return type of a gcc2
13262     builtin and then its argument prototype would still apply.  */
13263 char dbm_open();
13264
13265 int main() {
13266 dbm_open()
13267 ; return 0; }
13268 EOF
13269 if { (eval echo configure:13270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13270   rm -rf conftest*
13271   eval "ac_cv_lib_$ac_lib_var=yes"
13272 else
13273   echo "configure: failed program was:" >&5
13274   cat conftest.$ac_ext >&5
13275   rm -rf conftest*
13276   eval "ac_cv_lib_$ac_lib_var=no"
13277 fi
13278 rm -f conftest*
13279 LIBS="$ac_save_LIBS"
13280
13281 fi
13282 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13283   echo "$ac_t""yes" 1>&6
13284   ol_cv_lib_ndbm=-lndbm
13285 else
13286   echo "$ac_t""no" 1>&6
13287
13288                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
13289 echo "configure:13290: checking for dbm_open in -ldbm" >&5
13290 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
13291 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13292   echo $ac_n "(cached) $ac_c" 1>&6
13293 else
13294   ac_save_LIBS="$LIBS"
13295 LIBS="-ldbm  $LIBS"
13296 cat > conftest.$ac_ext <<EOF
13297 #line 13298 "configure"
13298 #include "confdefs.h"
13299 /* Override any gcc2 internal prototype to avoid an error.  */
13300 /* We use char because int might match the return type of a gcc2
13301     builtin and then its argument prototype would still apply.  */
13302 char dbm_open();
13303
13304 int main() {
13305 dbm_open()
13306 ; return 0; }
13307 EOF
13308 if { (eval echo configure:13309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13309   rm -rf conftest*
13310   eval "ac_cv_lib_$ac_lib_var=yes"
13311 else
13312   echo "configure: failed program was:" >&5
13313   cat conftest.$ac_ext >&5
13314   rm -rf conftest*
13315   eval "ac_cv_lib_$ac_lib_var=no"
13316 fi
13317 rm -f conftest*
13318 LIBS="$ac_save_LIBS"
13319
13320 fi
13321 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13322   echo "$ac_t""yes" 1>&6
13323   ol_cv_lib_ndbm=-ldbm
13324 else
13325   echo "$ac_t""no" 1>&6
13326 ol_cv_lib_ndbm=no
13327 fi
13328                 
13329 fi
13330
13331         
13332 fi
13333
13334         LIBS="$ol_LIBS"
13335
13336 fi
13337
13338 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
13339
13340
13341  for ac_hdr in ndbm.h
13342 do
13343 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13344 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13345 echo "configure:13346: checking for $ac_hdr" >&5
13346 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13347   echo $ac_n "(cached) $ac_c" 1>&6
13348 else
13349   cat > conftest.$ac_ext <<EOF
13350 #line 13351 "configure"
13351 #include "confdefs.h"
13352 #include <$ac_hdr>
13353 EOF
13354 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13355 { (eval echo configure:13356: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13356 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13357 if test -z "$ac_err"; then
13358   rm -rf conftest*
13359   eval "ac_cv_header_$ac_safe=yes"
13360 else
13361   echo "$ac_err" >&5
13362   echo "configure: failed program was:" >&5
13363   cat conftest.$ac_ext >&5
13364   rm -rf conftest*
13365   eval "ac_cv_header_$ac_safe=no"
13366 fi
13367 rm -f conftest*
13368 fi
13369 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13370   echo "$ac_t""yes" 1>&6
13371     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13372   cat >> confdefs.h <<EOF
13373 #define $ac_tr_hdr 1
13374 EOF
13375  
13376 else
13377   echo "$ac_t""no" 1>&6
13378 fi
13379 done
13380
13381  echo $ac_n "checking for db""... $ac_c" 1>&6
13382 echo "configure:13383: checking for db" >&5
13383 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
13384   echo $ac_n "(cached) $ac_c" 1>&6
13385 else
13386   
13387         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
13388                 ol_cv_ndbm=no
13389         else
13390                 ol_cv_ndbm=yes
13391         fi
13392
13393 fi
13394
13395 echo "$ac_t""$ol_cv_ndbm" 1>&6
13396  if test $ol_cv_ndbm = yes ; then
13397         cat >> confdefs.h <<\EOF
13398 #define HAVE_NDBM 1
13399 EOF
13400
13401  fi
13402
13403
13404         if test $ol_cv_ndbm = yes ; then
13405                 ol_link_ldbm=ndbm
13406                 ol_with_ldbm_api=ndbm
13407
13408                 if test $ol_cv_lib_ndbm != yes ; then
13409                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
13410                 fi
13411         fi
13412 fi
13413
13414 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
13415         echo "configure: warning: could not find suitable LDBM backend" 1>&2
13416         if test $ol_enable_ldbm = yes ; then
13417                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
13418         fi
13419
13420         echo "configure: warning: disabling LDBM" 1>&2
13421         ol_enable_ldbm=no
13422 fi
13423
13424 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
13425         LINK_BINS_DYNAMIC="yes"
13426 else
13427         LINK_BINS_DYNAMIC="no"
13428 fi
13429
13430 if test $ol_enable_wrappers != no ; then
13431         for ac_hdr in tcpd.h
13432 do
13433 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13434 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13435 echo "configure:13436: checking for $ac_hdr" >&5
13436 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13437   echo $ac_n "(cached) $ac_c" 1>&6
13438 else
13439   cat > conftest.$ac_ext <<EOF
13440 #line 13441 "configure"
13441 #include "confdefs.h"
13442 #include <$ac_hdr>
13443 EOF
13444 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13445 { (eval echo configure:13446: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13446 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13447 if test -z "$ac_err"; then
13448   rm -rf conftest*
13449   eval "ac_cv_header_$ac_safe=yes"
13450 else
13451   echo "$ac_err" >&5
13452   echo "configure: failed program was:" >&5
13453   cat conftest.$ac_ext >&5
13454   rm -rf conftest*
13455   eval "ac_cv_header_$ac_safe=no"
13456 fi
13457 rm -f conftest*
13458 fi
13459 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13460   echo "$ac_t""yes" 1>&6
13461     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13462   cat >> confdefs.h <<EOF
13463 #define $ac_tr_hdr 1
13464 EOF
13465  
13466 else
13467   echo "$ac_t""no" 1>&6
13468 fi
13469 done
13470
13471
13472         if test $ac_cv_header_tcpd_h != yes ; then
13473                 have_wrappers=no
13474         else
13475                 cat > conftest.$ac_ext <<EOF
13476 #line 13477 "configure"
13477 #include "confdefs.h"
13478
13479 int allow_severity = 0;
13480 int deny_severity  = 0;
13481                 
13482 int main() {
13483 hosts_access()
13484 ; return 0; }
13485 EOF
13486 if { (eval echo configure:13487: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13487   rm -rf conftest*
13488   have_wrappers=yes
13489 else
13490   echo "configure: failed program was:" >&5
13491   cat conftest.$ac_ext >&5
13492   rm -rf conftest*
13493   have_wrappers=no
13494 fi
13495 rm -f conftest*
13496         fi
13497
13498         if test $have_wrappers = yes ; then
13499                 cat >> confdefs.h <<\EOF
13500 #define HAVE_TCPD 1
13501 EOF
13502
13503                 WRAP_LIBS="-lwrap"
13504
13505                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
13506 echo "configure:13507: checking for main in -lnsl" >&5
13507 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
13508 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13509   echo $ac_n "(cached) $ac_c" 1>&6
13510 else
13511   ac_save_LIBS="$LIBS"
13512 LIBS="-lnsl  $LIBS"
13513 cat > conftest.$ac_ext <<EOF
13514 #line 13515 "configure"
13515 #include "confdefs.h"
13516
13517 int main() {
13518 main()
13519 ; return 0; }
13520 EOF
13521 if { (eval echo configure:13522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13522   rm -rf conftest*
13523   eval "ac_cv_lib_$ac_lib_var=yes"
13524 else
13525   echo "configure: failed program was:" >&5
13526   cat conftest.$ac_ext >&5
13527   rm -rf conftest*
13528   eval "ac_cv_lib_$ac_lib_var=no"
13529 fi
13530 rm -f conftest*
13531 LIBS="$ac_save_LIBS"
13532
13533 fi
13534 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13535   echo "$ac_t""yes" 1>&6
13536     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
13537     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
13538   cat >> confdefs.h <<EOF
13539 #define $ac_tr_lib 1
13540 EOF
13541
13542   LIBS="-lnsl $LIBS"
13543
13544 else
13545   echo "$ac_t""no" 1>&6
13546 fi
13547
13548         else
13549                 echo "configure: warning: could not find -lwrap" 1>&2
13550                 if test $ol_enable_wrappers = yes ; then
13551                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
13552                 fi
13553
13554                 echo "configure: warning: disabling wrappers support" 1>&2
13555                 ol_enable_wrappers=no
13556                 WRAP_LIBS=""
13557         fi
13558 fi
13559
13560 if test $ol_enable_syslog != no ; then
13561         echo $ac_n "checking for openlog""... $ac_c" 1>&6
13562 echo "configure:13563: checking for openlog" >&5
13563 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
13564   echo $ac_n "(cached) $ac_c" 1>&6
13565 else
13566   cat > conftest.$ac_ext <<EOF
13567 #line 13568 "configure"
13568 #include "confdefs.h"
13569 /* System header to define __stub macros and hopefully few prototypes,
13570     which can conflict with char openlog(); below.  */
13571 #include <assert.h>
13572 /* Override any gcc2 internal prototype to avoid an error.  */
13573 /* We use char because int might match the return type of a gcc2
13574     builtin and then its argument prototype would still apply.  */
13575 char openlog();
13576 char (*f)();
13577
13578 int main() {
13579
13580 /* The GNU C library defines this for functions which it implements
13581     to always fail with ENOSYS.  Some functions are actually named
13582     something starting with __ and the normal name is an alias.  */
13583 #if defined (__stub_openlog) || defined (__stub___openlog)
13584 choke me
13585 #else
13586 f = openlog;
13587 #endif
13588
13589 ; return 0; }
13590 EOF
13591 if { (eval echo configure:13592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13592   rm -rf conftest*
13593   eval "ac_cv_func_openlog=yes"
13594 else
13595   echo "configure: failed program was:" >&5
13596   cat conftest.$ac_ext >&5
13597   rm -rf conftest*
13598   eval "ac_cv_func_openlog=no"
13599 fi
13600 rm -f conftest*
13601 fi
13602
13603 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
13604   echo "$ac_t""yes" 1>&6
13605   :
13606 else
13607   echo "$ac_t""no" 1>&6
13608 fi
13609
13610         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
13611                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
13612         fi
13613         ol_enable_syslog=$ac_cv_func_openlog
13614 fi
13615
13616
13617 ol_link_sql=no
13618 if test $ol_enable_sql != no ; then
13619         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
13620 echo "configure:13621: checking for SQLDriverConnect in -liodbc" >&5
13621 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
13622 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13623   echo $ac_n "(cached) $ac_c" 1>&6
13624 else
13625   ac_save_LIBS="$LIBS"
13626 LIBS="-liodbc  $LIBS"
13627 cat > conftest.$ac_ext <<EOF
13628 #line 13629 "configure"
13629 #include "confdefs.h"
13630 /* Override any gcc2 internal prototype to avoid an error.  */
13631 /* We use char because int might match the return type of a gcc2
13632     builtin and then its argument prototype would still apply.  */
13633 char SQLDriverConnect();
13634
13635 int main() {
13636 SQLDriverConnect()
13637 ; return 0; }
13638 EOF
13639 if { (eval echo configure:13640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13640   rm -rf conftest*
13641   eval "ac_cv_lib_$ac_lib_var=yes"
13642 else
13643   echo "configure: failed program was:" >&5
13644   cat conftest.$ac_ext >&5
13645   rm -rf conftest*
13646   eval "ac_cv_lib_$ac_lib_var=no"
13647 fi
13648 rm -f conftest*
13649 LIBS="$ac_save_LIBS"
13650
13651 fi
13652 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13653   echo "$ac_t""yes" 1>&6
13654   have_iodbc=yes
13655 else
13656   echo "$ac_t""no" 1>&6
13657 have_iodbc=no
13658 fi
13659
13660         if test $have_iodbc = yes ; then
13661                 ol_link_sql="-liodbc"
13662         else
13663                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
13664 echo "configure:13665: checking for SQLDriverConnect in -lodbc" >&5
13665 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
13666 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13667   echo $ac_n "(cached) $ac_c" 1>&6
13668 else
13669   ac_save_LIBS="$LIBS"
13670 LIBS="-lodbc  $LIBS"
13671 cat > conftest.$ac_ext <<EOF
13672 #line 13673 "configure"
13673 #include "confdefs.h"
13674 /* Override any gcc2 internal prototype to avoid an error.  */
13675 /* We use char because int might match the return type of a gcc2
13676     builtin and then its argument prototype would still apply.  */
13677 char SQLDriverConnect();
13678
13679 int main() {
13680 SQLDriverConnect()
13681 ; return 0; }
13682 EOF
13683 if { (eval echo configure:13684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13684   rm -rf conftest*
13685   eval "ac_cv_lib_$ac_lib_var=yes"
13686 else
13687   echo "configure: failed program was:" >&5
13688   cat conftest.$ac_ext >&5
13689   rm -rf conftest*
13690   eval "ac_cv_lib_$ac_lib_var=no"
13691 fi
13692 rm -f conftest*
13693 LIBS="$ac_save_LIBS"
13694
13695 fi
13696 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13697   echo "$ac_t""yes" 1>&6
13698   have_odbc=yes
13699 else
13700   echo "$ac_t""no" 1>&6
13701 have_odbc=no
13702 fi
13703
13704                 if test $have_odbc = yes ; then
13705                         ol_link_sql="-lodbc"
13706                 fi
13707         fi
13708
13709         if test $ol_link_sql != no ; then
13710                 SLAPD_SQL_LIBS="$ol_link_sql"
13711
13712         elif test $ol_enable_sql != auto ; then
13713                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
13714         fi
13715 fi
13716
13717 if test $ol_enable_tcl != no ; then
13718         for ac_hdr in tcl.h
13719 do
13720 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13721 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13722 echo "configure:13723: checking for $ac_hdr" >&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 <$ac_hdr>
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     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13749   cat >> confdefs.h <<EOF
13750 #define $ac_tr_hdr 1
13751 EOF
13752  
13753 else
13754   echo "$ac_t""no" 1>&6
13755 fi
13756 done
13757
13758
13759         if test $ac_cv_header_tcl_h != yes ; then
13760                 have_tcl=no
13761         else
13762                 for lib in tcl tcl7.6 tcl8.0 tcl8.2 ; do
13763                         echo $ac_n "checking for main in -l$lib""... $ac_c" 1>&6
13764 echo "configure:13765: checking for main in -l$lib" >&5
13765 ac_lib_var=`echo $lib'_'main | sed 'y%./+-:%__p__%'`
13766 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13767   echo $ac_n "(cached) $ac_c" 1>&6
13768 else
13769   ac_save_LIBS="$LIBS"
13770 LIBS="-l$lib  $LIBS"
13771 cat > conftest.$ac_ext <<EOF
13772 #line 13773 "configure"
13773 #include "confdefs.h"
13774
13775 int main() {
13776 main()
13777 ; return 0; }
13778 EOF
13779 if { (eval echo configure:13780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13780   rm -rf conftest*
13781   eval "ac_cv_lib_$ac_lib_var=yes"
13782 else
13783   echo "configure: failed program was:" >&5
13784   cat conftest.$ac_ext >&5
13785   rm -rf conftest*
13786   eval "ac_cv_lib_$ac_lib_var=no"
13787 fi
13788 rm -f conftest*
13789 LIBS="$ac_save_LIBS"
13790
13791 fi
13792 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13793   echo "$ac_t""yes" 1>&6
13794   have_tcl=yes
13795                            if test x"$ol_with_tcl_module" = "xstatic" ; then
13796                                SLAPD_LIBS="$SLAPD_LIBS -l${lib}"
13797                            else
13798                                MOD_TCL_LIB="-l${lib}"
13799                            fi;break
13800 else
13801   echo "$ac_t""no" 1>&6
13802 have_tcl=no
13803 fi
13804
13805                 done
13806         fi
13807
13808         if test $have_tcl != yes ; then
13809                 echo "configure: warning: could not find -ltcl" 1>&2
13810                 if test $ol_enable_tcl = yes ; then
13811                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
13812                 fi
13813
13814                 ol_enable_tcl=no
13815         fi
13816 fi
13817
13818 ol_link_termcap=no
13819 for ac_hdr in termcap.h ncurses.h
13820 do
13821 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13822 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13823 echo "configure:13824: checking for $ac_hdr" >&5
13824 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13825   echo $ac_n "(cached) $ac_c" 1>&6
13826 else
13827   cat > conftest.$ac_ext <<EOF
13828 #line 13829 "configure"
13829 #include "confdefs.h"
13830 #include <$ac_hdr>
13831 EOF
13832 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13833 { (eval echo configure:13834: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13834 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13835 if test -z "$ac_err"; then
13836   rm -rf conftest*
13837   eval "ac_cv_header_$ac_safe=yes"
13838 else
13839   echo "$ac_err" >&5
13840   echo "configure: failed program was:" >&5
13841   cat conftest.$ac_ext >&5
13842   rm -rf conftest*
13843   eval "ac_cv_header_$ac_safe=no"
13844 fi
13845 rm -f conftest*
13846 fi
13847 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13848   echo "$ac_t""yes" 1>&6
13849     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13850   cat >> confdefs.h <<EOF
13851 #define $ac_tr_hdr 1
13852 EOF
13853  
13854 else
13855   echo "$ac_t""no" 1>&6
13856 fi
13857 done
13858
13859
13860 if test $ol_link_termcap = no ; then
13861         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
13862 echo "configure:13863: checking for tputs in -ltermcap" >&5
13863 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
13864 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13865   echo $ac_n "(cached) $ac_c" 1>&6
13866 else
13867   ac_save_LIBS="$LIBS"
13868 LIBS="-ltermcap  $LIBS"
13869 cat > conftest.$ac_ext <<EOF
13870 #line 13871 "configure"
13871 #include "confdefs.h"
13872 /* Override any gcc2 internal prototype to avoid an error.  */
13873 /* We use char because int might match the return type of a gcc2
13874     builtin and then its argument prototype would still apply.  */
13875 char tputs();
13876
13877 int main() {
13878 tputs()
13879 ; return 0; }
13880 EOF
13881 if { (eval echo configure:13882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13882   rm -rf conftest*
13883   eval "ac_cv_lib_$ac_lib_var=yes"
13884 else
13885   echo "configure: failed program was:" >&5
13886   cat conftest.$ac_ext >&5
13887   rm -rf conftest*
13888   eval "ac_cv_lib_$ac_lib_var=no"
13889 fi
13890 rm -f conftest*
13891 LIBS="$ac_save_LIBS"
13892
13893 fi
13894 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13895   echo "$ac_t""yes" 1>&6
13896   have_termcap=yes
13897 else
13898   echo "$ac_t""no" 1>&6
13899 have_termcap=no
13900 fi
13901
13902         if test $have_termcap = yes ; then
13903                 cat >> confdefs.h <<\EOF
13904 #define HAVE_TERMCAP 1
13905 EOF
13906
13907                 ol_link_termcap=yes
13908                 TERMCAP_LIBS=-ltermcap
13909         fi
13910 fi
13911
13912 if test $ol_link_termcap = no ; then
13913         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
13914 echo "configure:13915: checking for initscr in -lncurses" >&5
13915 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
13916 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13917   echo $ac_n "(cached) $ac_c" 1>&6
13918 else
13919   ac_save_LIBS="$LIBS"
13920 LIBS="-lncurses  $LIBS"
13921 cat > conftest.$ac_ext <<EOF
13922 #line 13923 "configure"
13923 #include "confdefs.h"
13924 /* Override any gcc2 internal prototype to avoid an error.  */
13925 /* We use char because int might match the return type of a gcc2
13926     builtin and then its argument prototype would still apply.  */
13927 char initscr();
13928
13929 int main() {
13930 initscr()
13931 ; return 0; }
13932 EOF
13933 if { (eval echo configure:13934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13934   rm -rf conftest*
13935   eval "ac_cv_lib_$ac_lib_var=yes"
13936 else
13937   echo "configure: failed program was:" >&5
13938   cat conftest.$ac_ext >&5
13939   rm -rf conftest*
13940   eval "ac_cv_lib_$ac_lib_var=no"
13941 fi
13942 rm -f conftest*
13943 LIBS="$ac_save_LIBS"
13944
13945 fi
13946 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13947   echo "$ac_t""yes" 1>&6
13948   have_ncurses=yes
13949 else
13950   echo "$ac_t""no" 1>&6
13951 have_ncurses=no
13952 fi
13953
13954         if test $have_ncurses = yes ; then
13955                 cat >> confdefs.h <<\EOF
13956 #define HAVE_NCURSES 1
13957 EOF
13958
13959                 ol_link_termcap=yes
13960                 TERMCAP_LIBS=-lncurses
13961         fi
13962 fi
13963
13964 if test $ol_link_termcap = no ; then
13965         cat >> confdefs.h <<\EOF
13966 #define NO_TERMCAP 1
13967 EOF
13968
13969         TERMCAP_LIBS=
13970 fi
13971
13972 ol_link_sasl=no
13973 ol_link_spasswd=no
13974 if test $ol_with_cyrus_sasl != no ; then
13975         for ac_hdr in sasl.h
13976 do
13977 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13978 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13979 echo "configure:13980: checking for $ac_hdr" >&5
13980 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13981   echo $ac_n "(cached) $ac_c" 1>&6
13982 else
13983   cat > conftest.$ac_ext <<EOF
13984 #line 13985 "configure"
13985 #include "confdefs.h"
13986 #include <$ac_hdr>
13987 EOF
13988 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13989 { (eval echo configure:13990: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13990 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13991 if test -z "$ac_err"; then
13992   rm -rf conftest*
13993   eval "ac_cv_header_$ac_safe=yes"
13994 else
13995   echo "$ac_err" >&5
13996   echo "configure: failed program was:" >&5
13997   cat conftest.$ac_ext >&5
13998   rm -rf conftest*
13999   eval "ac_cv_header_$ac_safe=no"
14000 fi
14001 rm -f conftest*
14002 fi
14003 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14004   echo "$ac_t""yes" 1>&6
14005     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14006   cat >> confdefs.h <<EOF
14007 #define $ac_tr_hdr 1
14008 EOF
14009  
14010 else
14011   echo "$ac_t""no" 1>&6
14012 fi
14013 done
14014
14015
14016         if test $ac_cv_header_sasl_h = yes ; then
14017                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
14018 echo "configure:14019: checking for sasl_client_init in -lsasl" >&5
14019 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
14020 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14021   echo $ac_n "(cached) $ac_c" 1>&6
14022 else
14023   ac_save_LIBS="$LIBS"
14024 LIBS="-lsasl  $LIBS"
14025 cat > conftest.$ac_ext <<EOF
14026 #line 14027 "configure"
14027 #include "confdefs.h"
14028 /* Override any gcc2 internal prototype to avoid an error.  */
14029 /* We use char because int might match the return type of a gcc2
14030     builtin and then its argument prototype would still apply.  */
14031 char sasl_client_init();
14032
14033 int main() {
14034 sasl_client_init()
14035 ; return 0; }
14036 EOF
14037 if { (eval echo configure:14038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14038   rm -rf conftest*
14039   eval "ac_cv_lib_$ac_lib_var=yes"
14040 else
14041   echo "configure: failed program was:" >&5
14042   cat conftest.$ac_ext >&5
14043   rm -rf conftest*
14044   eval "ac_cv_lib_$ac_lib_var=no"
14045 fi
14046 rm -f conftest*
14047 LIBS="$ac_save_LIBS"
14048
14049 fi
14050 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14051   echo "$ac_t""yes" 1>&6
14052   have_cyrus_sasl=yes
14053 else
14054   echo "$ac_t""no" 1>&6
14055 have_cyrus_sasl=no
14056 fi
14057
14058
14059                 if test $have_cyrus_sasl != no ; then
14060                         SASL_LIBS="-lsasl"
14061                         cat >> confdefs.h <<\EOF
14062 #define HAVE_CYRUS_SASL 1
14063 EOF
14064
14065                         ol_link_sasl=yes
14066                 fi
14067         fi
14068
14069         if test $ol_link_sasl = no ; then
14070                 if test $ol_with_cyrus_sasl != auto ; then
14071                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
14072                 else
14073                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
14074                         echo "configure: warning: SASL authentication not supported!" 1>&2
14075                         if test $ol_link_tls = no ; then
14076                                 echo "configure: warning: Strong authentication not supported!" 1>&2
14077                         fi
14078                 fi
14079
14080         elif test $ol_enable_spasswd != no ; then
14081                 ol_link_spasswd=yes
14082         fi
14083
14084 else
14085         echo "configure: warning: SASL authentication not supported!" 1>&2
14086         if test $ol_link_tls = no ; then
14087                 echo "configure: warning: Strong authentication not supported!" 1>&2
14088         fi
14089 fi
14090
14091 if test $cross_compiling != yes ; then
14092         dev=no
14093         if test -r /dev/urandom ; then
14094                 dev="/dev/urandom";
14095         elif test -r /idev/urandom ; then
14096                 dev="/idev/urandom";
14097         elif test -r /dev/srandom ; then
14098                 dev="/dev/srandom";
14099         elif test -r /dev/random ; then
14100                 dev="/dev/random";
14101         elif test -r /idev/random ; then
14102                 dev="/idev/random";
14103         fi
14104
14105         if test $dev != no ; then
14106                 cat >> confdefs.h <<EOF
14107 #define URANDOM_DEVICE "$dev"
14108 EOF
14109
14110         fi
14111 fi
14112
14113 ol_link_fetch=no
14114 if test $ol_with_fetch != no ; then
14115         ol_LIBS=$LIBS
14116 LIBS="-lfetch -lcom_err $LIBS"
14117 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
14118 echo "configure:14119: checking fetch(3) library" >&5
14119 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
14120   echo $ac_n "(cached) $ac_c" 1>&6
14121 else
14122   
14123         cat > conftest.$ac_ext <<EOF
14124 #line 14125 "configure"
14125 #include "confdefs.h"
14126
14127 #include <sys/param.h>
14128 #include <stdio.h>
14129 #include <fetch.h>
14130 int main() {
14131 struct url *u = fetchParseURL("file:///"); 
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   ol_cv_lib_fetch=yes
14137 else
14138   echo "configure: failed program was:" >&5
14139   cat conftest.$ac_ext >&5
14140   rm -rf conftest*
14141   ol_cv_lib_fetch=no
14142 fi
14143 rm -f conftest*
14144 fi
14145
14146 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
14147 LIBS=$ol_LIBS
14148 if test $ol_cv_lib_fetch != no ; then
14149         ol_link_fetch="-lfetch -lcom_err"
14150         cat >> confdefs.h <<\EOF
14151 #define HAVE_FETCH 1
14152 EOF
14153
14154 fi
14155
14156
14157         if test $ol_cv_lib_fetch != no ; then
14158                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
14159                 ol_link_fetch=freebsd
14160
14161         elif test $ol_with_fetch != auto ; then
14162                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
14163         fi 
14164 fi
14165
14166 ol_link_readline=no
14167 if test $ol_with_readline != no ; then
14168         for ac_hdr in readline/readline.h readline/history.h
14169 do
14170 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14171 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14172 echo "configure:14173: checking for $ac_hdr" >&5
14173 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14174   echo $ac_n "(cached) $ac_c" 1>&6
14175 else
14176   cat > conftest.$ac_ext <<EOF
14177 #line 14178 "configure"
14178 #include "confdefs.h"
14179 #include <$ac_hdr>
14180 EOF
14181 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14182 { (eval echo configure:14183: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14183 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14184 if test -z "$ac_err"; then
14185   rm -rf conftest*
14186   eval "ac_cv_header_$ac_safe=yes"
14187 else
14188   echo "$ac_err" >&5
14189   echo "configure: failed program was:" >&5
14190   cat conftest.$ac_ext >&5
14191   rm -rf conftest*
14192   eval "ac_cv_header_$ac_safe=no"
14193 fi
14194 rm -f conftest*
14195 fi
14196 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14197   echo "$ac_t""yes" 1>&6
14198     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14199   cat >> confdefs.h <<EOF
14200 #define $ac_tr_hdr 1
14201 EOF
14202  
14203 else
14204   echo "$ac_t""no" 1>&6
14205 fi
14206 done
14207
14208
14209         if test $ac_cv_header_readline_readline_h = yes ; then
14210                 save_LIBS="$LIBS"
14211                 LIBS="$TERMCAP_LIBS $LIBS"
14212                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
14213 echo "configure:14214: checking for readline in -lreadline" >&5
14214 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
14215 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14216   echo $ac_n "(cached) $ac_c" 1>&6
14217 else
14218   ac_save_LIBS="$LIBS"
14219 LIBS="-lreadline  $LIBS"
14220 cat > conftest.$ac_ext <<EOF
14221 #line 14222 "configure"
14222 #include "confdefs.h"
14223 /* Override any gcc2 internal prototype to avoid an error.  */
14224 /* We use char because int might match the return type of a gcc2
14225     builtin and then its argument prototype would still apply.  */
14226 char readline();
14227
14228 int main() {
14229 readline()
14230 ; return 0; }
14231 EOF
14232 if { (eval echo configure:14233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14233   rm -rf conftest*
14234   eval "ac_cv_lib_$ac_lib_var=yes"
14235 else
14236   echo "configure: failed program was:" >&5
14237   cat conftest.$ac_ext >&5
14238   rm -rf conftest*
14239   eval "ac_cv_lib_$ac_lib_var=no"
14240 fi
14241 rm -f conftest*
14242 LIBS="$ac_save_LIBS"
14243
14244 fi
14245 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14246   echo "$ac_t""yes" 1>&6
14247   have_readline=yes
14248 else
14249   echo "$ac_t""no" 1>&6
14250 have_readline=no
14251 fi
14252
14253                 LIBS="$save_LIBS"
14254                         
14255                 if test $have_readline = yes ; then
14256                         ol_with_readline=found
14257                         ol_link_readline=yes
14258
14259                         READLINE_LIBS="-lreadline"
14260                 fi
14261         fi
14262 fi
14263
14264 if test $ol_link_readline = yes ; then
14265         cat >> confdefs.h <<\EOF
14266 #define HAVE_READLINE 1
14267 EOF
14268
14269 fi
14270
14271
14272 if test $ol_enable_crypt != no ; then
14273         echo $ac_n "checking for crypt""... $ac_c" 1>&6
14274 echo "configure:14275: checking for crypt" >&5
14275 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
14276   echo $ac_n "(cached) $ac_c" 1>&6
14277 else
14278   cat > conftest.$ac_ext <<EOF
14279 #line 14280 "configure"
14280 #include "confdefs.h"
14281 /* System header to define __stub macros and hopefully few prototypes,
14282     which can conflict with char crypt(); below.  */
14283 #include <assert.h>
14284 /* Override any gcc2 internal prototype to avoid an error.  */
14285 /* We use char because int might match the return type of a gcc2
14286     builtin and then its argument prototype would still apply.  */
14287 char crypt();
14288 char (*f)();
14289
14290 int main() {
14291
14292 /* The GNU C library defines this for functions which it implements
14293     to always fail with ENOSYS.  Some functions are actually named
14294     something starting with __ and the normal name is an alias.  */
14295 #if defined (__stub_crypt) || defined (__stub___crypt)
14296 choke me
14297 #else
14298 f = crypt;
14299 #endif
14300
14301 ; return 0; }
14302 EOF
14303 if { (eval echo configure:14304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14304   rm -rf conftest*
14305   eval "ac_cv_func_crypt=yes"
14306 else
14307   echo "configure: failed program was:" >&5
14308   cat conftest.$ac_ext >&5
14309   rm -rf conftest*
14310   eval "ac_cv_func_crypt=no"
14311 fi
14312 rm -f conftest*
14313 fi
14314
14315 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
14316   echo "$ac_t""yes" 1>&6
14317   have_crypt=yes
14318 else
14319   echo "$ac_t""no" 1>&6
14320
14321                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
14322 echo "configure:14323: checking for crypt in -lcrypt" >&5
14323 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
14324 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14325   echo $ac_n "(cached) $ac_c" 1>&6
14326 else
14327   ac_save_LIBS="$LIBS"
14328 LIBS="-lcrypt  $LIBS"
14329 cat > conftest.$ac_ext <<EOF
14330 #line 14331 "configure"
14331 #include "confdefs.h"
14332 /* Override any gcc2 internal prototype to avoid an error.  */
14333 /* We use char because int might match the return type of a gcc2
14334     builtin and then its argument prototype would still apply.  */
14335 char crypt();
14336
14337 int main() {
14338 crypt()
14339 ; return 0; }
14340 EOF
14341 if { (eval echo configure:14342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14342   rm -rf conftest*
14343   eval "ac_cv_lib_$ac_lib_var=yes"
14344 else
14345   echo "configure: failed program was:" >&5
14346   cat conftest.$ac_ext >&5
14347   rm -rf conftest*
14348   eval "ac_cv_lib_$ac_lib_var=no"
14349 fi
14350 rm -f conftest*
14351 LIBS="$ac_save_LIBS"
14352
14353 fi
14354 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14355   echo "$ac_t""yes" 1>&6
14356   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
14357                         have_crypt=yes
14358 else
14359   echo "$ac_t""no" 1>&6
14360 have_crypt=no
14361 fi
14362
14363 fi
14364
14365
14366         if test $have_crypt = yes ; then
14367                 cat >> confdefs.h <<\EOF
14368 #define HAVE_CRYPT 1
14369 EOF
14370
14371         else
14372                 echo "configure: warning: could not find crypt" 1>&2
14373                 if test $ol_enable_crypt = yes ; then
14374                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
14375                 fi
14376
14377                 echo "configure: warning: disabling crypt support" 1>&2
14378                 ol_enable_crypt=no
14379         fi
14380 fi
14381
14382 if test $ol_enable_proctitle != no ; then
14383         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
14384 echo "configure:14385: checking for setproctitle" >&5
14385 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
14386   echo $ac_n "(cached) $ac_c" 1>&6
14387 else
14388   cat > conftest.$ac_ext <<EOF
14389 #line 14390 "configure"
14390 #include "confdefs.h"
14391 /* System header to define __stub macros and hopefully few prototypes,
14392     which can conflict with char setproctitle(); below.  */
14393 #include <assert.h>
14394 /* Override any gcc2 internal prototype to avoid an error.  */
14395 /* We use char because int might match the return type of a gcc2
14396     builtin and then its argument prototype would still apply.  */
14397 char setproctitle();
14398 char (*f)();
14399
14400 int main() {
14401
14402 /* The GNU C library defines this for functions which it implements
14403     to always fail with ENOSYS.  Some functions are actually named
14404     something starting with __ and the normal name is an alias.  */
14405 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
14406 choke me
14407 #else
14408 f = setproctitle;
14409 #endif
14410
14411 ; return 0; }
14412 EOF
14413 if { (eval echo configure:14414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14414   rm -rf conftest*
14415   eval "ac_cv_func_setproctitle=yes"
14416 else
14417   echo "configure: failed program was:" >&5
14418   cat conftest.$ac_ext >&5
14419   rm -rf conftest*
14420   eval "ac_cv_func_setproctitle=no"
14421 fi
14422 rm -f conftest*
14423 fi
14424
14425 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
14426   echo "$ac_t""yes" 1>&6
14427   have_setproctitle=yes
14428 else
14429   echo "$ac_t""no" 1>&6
14430
14431                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
14432 echo "configure:14433: checking for setproctitle in -lutil" >&5
14433 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
14434 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14435   echo $ac_n "(cached) $ac_c" 1>&6
14436 else
14437   ac_save_LIBS="$LIBS"
14438 LIBS="-lutil  $LIBS"
14439 cat > conftest.$ac_ext <<EOF
14440 #line 14441 "configure"
14441 #include "confdefs.h"
14442 /* Override any gcc2 internal prototype to avoid an error.  */
14443 /* We use char because int might match the return type of a gcc2
14444     builtin and then its argument prototype would still apply.  */
14445 char setproctitle();
14446
14447 int main() {
14448 setproctitle()
14449 ; return 0; }
14450 EOF
14451 if { (eval echo configure:14452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14452   rm -rf conftest*
14453   eval "ac_cv_lib_$ac_lib_var=yes"
14454 else
14455   echo "configure: failed program was:" >&5
14456   cat conftest.$ac_ext >&5
14457   rm -rf conftest*
14458   eval "ac_cv_lib_$ac_lib_var=no"
14459 fi
14460 rm -f conftest*
14461 LIBS="$ac_save_LIBS"
14462
14463 fi
14464 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14465   echo "$ac_t""yes" 1>&6
14466   have_setproctitle=yes
14467                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
14468 else
14469   echo "$ac_t""no" 1>&6
14470 have_setproctitle=no
14471                         LIBOBJS="$LIBOBJS setproctitle.o"
14472                         LIBSRCS="$LIBSRCS setproctitle.c"
14473 fi
14474
14475 fi
14476
14477
14478         if test $have_setproctitle = yes ; then
14479                 cat >> confdefs.h <<\EOF
14480 #define HAVE_SETPROCTITLE 1
14481 EOF
14482
14483         fi
14484 fi
14485
14486 if test $ol_enable_slp != no ; then
14487         for ac_hdr in slp.h 
14488 do
14489 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14490 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14491 echo "configure:14492: checking for $ac_hdr" >&5
14492 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14493   echo $ac_n "(cached) $ac_c" 1>&6
14494 else
14495   cat > conftest.$ac_ext <<EOF
14496 #line 14497 "configure"
14497 #include "confdefs.h"
14498 #include <$ac_hdr>
14499 EOF
14500 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14501 { (eval echo configure:14502: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14502 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14503 if test -z "$ac_err"; then
14504   rm -rf conftest*
14505   eval "ac_cv_header_$ac_safe=yes"
14506 else
14507   echo "$ac_err" >&5
14508   echo "configure: failed program was:" >&5
14509   cat conftest.$ac_ext >&5
14510   rm -rf conftest*
14511   eval "ac_cv_header_$ac_safe=no"
14512 fi
14513 rm -f conftest*
14514 fi
14515 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14516   echo "$ac_t""yes" 1>&6
14517     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14518   cat >> confdefs.h <<EOF
14519 #define $ac_tr_hdr 1
14520 EOF
14521  
14522 else
14523   echo "$ac_t""no" 1>&6
14524 fi
14525 done
14526
14527
14528         if test $ac_cv_header_slp_h = yes ; then
14529                 echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
14530 echo "configure:14531: checking for SLPOpen in -lslp" >&5
14531 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'`
14532 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14533   echo $ac_n "(cached) $ac_c" 1>&6
14534 else
14535   ac_save_LIBS="$LIBS"
14536 LIBS="-lslp  $LIBS"
14537 cat > conftest.$ac_ext <<EOF
14538 #line 14539 "configure"
14539 #include "confdefs.h"
14540 /* Override any gcc2 internal prototype to avoid an error.  */
14541 /* We use char because int might match the return type of a gcc2
14542     builtin and then its argument prototype would still apply.  */
14543 char SLPOpen();
14544
14545 int main() {
14546 SLPOpen()
14547 ; return 0; }
14548 EOF
14549 if { (eval echo configure:14550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14550   rm -rf conftest*
14551   eval "ac_cv_lib_$ac_lib_var=yes"
14552 else
14553   echo "configure: failed program was:" >&5
14554   cat conftest.$ac_ext >&5
14555   rm -rf conftest*
14556   eval "ac_cv_lib_$ac_lib_var=no"
14557 fi
14558 rm -f conftest*
14559 LIBS="$ac_save_LIBS"
14560
14561 fi
14562 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14563   echo "$ac_t""yes" 1>&6
14564   have_slp=yes
14565 else
14566   echo "$ac_t""no" 1>&6
14567 have_slp=no
14568 fi
14569
14570                 if test $have_slp = yes ; then
14571                         cat >> confdefs.h <<\EOF
14572 #define HAVE_SLP 1
14573 EOF
14574
14575                         SLAPD_SLP_LIBS=-lslp
14576                 fi
14577
14578         elif test $ol_enable_slp = yes ; then
14579                 { echo "configure: error: SLP not found" 1>&2; exit 1; }
14580         fi
14581 fi
14582
14583 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
14584 echo "configure:14585: checking for ANSI C header files" >&5
14585 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
14586   echo $ac_n "(cached) $ac_c" 1>&6
14587 else
14588   cat > conftest.$ac_ext <<EOF
14589 #line 14590 "configure"
14590 #include "confdefs.h"
14591 #include <stdlib.h>
14592 #include <stdarg.h>
14593 #include <string.h>
14594 #include <float.h>
14595 EOF
14596 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14597 { (eval echo configure:14598: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14598 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14599 if test -z "$ac_err"; then
14600   rm -rf conftest*
14601   ac_cv_header_stdc=yes
14602 else
14603   echo "$ac_err" >&5
14604   echo "configure: failed program was:" >&5
14605   cat conftest.$ac_ext >&5
14606   rm -rf conftest*
14607   ac_cv_header_stdc=no
14608 fi
14609 rm -f conftest*
14610
14611 if test $ac_cv_header_stdc = yes; then
14612   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14613 cat > conftest.$ac_ext <<EOF
14614 #line 14615 "configure"
14615 #include "confdefs.h"
14616 #include <string.h>
14617 EOF
14618 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14619   egrep "memchr" >/dev/null 2>&1; then
14620   :
14621 else
14622   rm -rf conftest*
14623   ac_cv_header_stdc=no
14624 fi
14625 rm -f conftest*
14626
14627 fi
14628
14629 if test $ac_cv_header_stdc = yes; then
14630   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14631 cat > conftest.$ac_ext <<EOF
14632 #line 14633 "configure"
14633 #include "confdefs.h"
14634 #include <stdlib.h>
14635 EOF
14636 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14637   egrep "free" >/dev/null 2>&1; then
14638   :
14639 else
14640   rm -rf conftest*
14641   ac_cv_header_stdc=no
14642 fi
14643 rm -f conftest*
14644
14645 fi
14646
14647 if test $ac_cv_header_stdc = yes; then
14648   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14649 if test "$cross_compiling" = yes; then
14650   :
14651 else
14652   cat > conftest.$ac_ext <<EOF
14653 #line 14654 "configure"
14654 #include "confdefs.h"
14655 #include <ctype.h>
14656 #if ((' ' & 0x0FF) == 0x020)
14657 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14658 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14659 #else
14660 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14661  || ('j' <= (c) && (c) <= 'r') \
14662  || ('s' <= (c) && (c) <= 'z'))
14663 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14664 #endif
14665 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14666 int main () { int i; for (i = 0; i < 256; i++)
14667 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
14668 exit (0); }
14669
14670 EOF
14671 if { (eval echo configure:14672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14672 then
14673   :
14674 else
14675   echo "configure: failed program was:" >&5
14676   cat conftest.$ac_ext >&5
14677   rm -fr conftest*
14678   ac_cv_header_stdc=no
14679 fi
14680 rm -fr conftest*
14681 fi
14682
14683 fi
14684 fi
14685
14686 echo "$ac_t""$ac_cv_header_stdc" 1>&6
14687 if test $ac_cv_header_stdc = yes; then
14688   cat >> confdefs.h <<\EOF
14689 #define STDC_HEADERS 1
14690 EOF
14691
14692 fi
14693
14694 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
14695 echo "configure:14696: checking for mode_t" >&5
14696 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
14697   echo $ac_n "(cached) $ac_c" 1>&6
14698 else
14699   cat > conftest.$ac_ext <<EOF
14700 #line 14701 "configure"
14701 #include "confdefs.h"
14702 #include <sys/types.h>
14703 #if STDC_HEADERS
14704 #include <stdlib.h>
14705 #include <stddef.h>
14706 #endif
14707
14708 EOF
14709 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14710   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14711   rm -rf conftest*
14712   eval "ac_cv_type_mode_t=yes"
14713 else
14714   rm -rf conftest*
14715   eval "ac_cv_type_mode_t=no"
14716 fi
14717 rm -f conftest*
14718
14719 fi
14720 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
14721   echo "$ac_t""yes" 1>&6
14722 else
14723   echo "$ac_t""no" 1>&6
14724   cat >> confdefs.h <<EOF
14725 #define mode_t int
14726 EOF
14727
14728 fi
14729
14730 echo $ac_n "checking for off_t""... $ac_c" 1>&6
14731 echo "configure:14732: checking for off_t" >&5
14732 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
14733   echo $ac_n "(cached) $ac_c" 1>&6
14734 else
14735   cat > conftest.$ac_ext <<EOF
14736 #line 14737 "configure"
14737 #include "confdefs.h"
14738 #include <sys/types.h>
14739 #if STDC_HEADERS
14740 #include <stdlib.h>
14741 #include <stddef.h>
14742 #endif
14743
14744 EOF
14745 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14746   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14747   rm -rf conftest*
14748   eval "ac_cv_type_off_t=yes"
14749 else
14750   rm -rf conftest*
14751   eval "ac_cv_type_off_t=no"
14752 fi
14753 rm -f conftest*
14754
14755 fi
14756 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
14757   echo "$ac_t""yes" 1>&6
14758 else
14759   echo "$ac_t""no" 1>&6
14760   cat >> confdefs.h <<EOF
14761 #define off_t long
14762 EOF
14763
14764 fi
14765
14766 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
14767 echo "configure:14768: checking for pid_t" >&5
14768 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
14769   echo $ac_n "(cached) $ac_c" 1>&6
14770 else
14771   cat > conftest.$ac_ext <<EOF
14772 #line 14773 "configure"
14773 #include "confdefs.h"
14774 #include <sys/types.h>
14775 #if STDC_HEADERS
14776 #include <stdlib.h>
14777 #include <stddef.h>
14778 #endif
14779
14780 EOF
14781 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14782   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14783   rm -rf conftest*
14784   eval "ac_cv_type_pid_t=yes"
14785 else
14786   rm -rf conftest*
14787   eval "ac_cv_type_pid_t=no"
14788 fi
14789 rm -f conftest*
14790
14791 fi
14792 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
14793   echo "$ac_t""yes" 1>&6
14794 else
14795   echo "$ac_t""no" 1>&6
14796   cat >> confdefs.h <<EOF
14797 #define pid_t int
14798 EOF
14799
14800 fi
14801
14802 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
14803 echo "configure:14804: checking for ptrdiff_t" >&5
14804 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
14805   echo $ac_n "(cached) $ac_c" 1>&6
14806 else
14807   cat > conftest.$ac_ext <<EOF
14808 #line 14809 "configure"
14809 #include "confdefs.h"
14810 #include <stddef.h>
14811 int main() {
14812 ptrdiff_t p
14813 ; return 0; }
14814 EOF
14815 if { (eval echo configure:14816: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14816   rm -rf conftest*
14817   am_cv_type_ptrdiff_t=yes
14818 else
14819   echo "configure: failed program was:" >&5
14820   cat conftest.$ac_ext >&5
14821   rm -rf conftest*
14822   am_cv_type_ptrdiff_t=no
14823 fi
14824 rm -f conftest*
14825 fi
14826
14827 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
14828    if test $am_cv_type_ptrdiff_t = yes; then
14829      cat >> confdefs.h <<\EOF
14830 #define HAVE_PTRDIFF_T 1
14831 EOF
14832
14833    fi
14834
14835 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
14836 echo "configure:14837: checking return type of signal handlers" >&5
14837 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
14838   echo $ac_n "(cached) $ac_c" 1>&6
14839 else
14840   cat > conftest.$ac_ext <<EOF
14841 #line 14842 "configure"
14842 #include "confdefs.h"
14843 #include <sys/types.h>
14844 #include <signal.h>
14845 #ifdef signal
14846 #undef signal
14847 #endif
14848 #ifdef __cplusplus
14849 extern "C" void (*signal (int, void (*)(int)))(int);
14850 #else
14851 void (*signal ()) ();
14852 #endif
14853
14854 int main() {
14855 int i;
14856 ; return 0; }
14857 EOF
14858 if { (eval echo configure:14859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14859   rm -rf conftest*
14860   ac_cv_type_signal=void
14861 else
14862   echo "configure: failed program was:" >&5
14863   cat conftest.$ac_ext >&5
14864   rm -rf conftest*
14865   ac_cv_type_signal=int
14866 fi
14867 rm -f conftest*
14868 fi
14869
14870 echo "$ac_t""$ac_cv_type_signal" 1>&6
14871 cat >> confdefs.h <<EOF
14872 #define RETSIGTYPE $ac_cv_type_signal
14873 EOF
14874
14875
14876 echo $ac_n "checking for size_t""... $ac_c" 1>&6
14877 echo "configure:14878: checking for size_t" >&5
14878 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
14879   echo $ac_n "(cached) $ac_c" 1>&6
14880 else
14881   cat > conftest.$ac_ext <<EOF
14882 #line 14883 "configure"
14883 #include "confdefs.h"
14884 #include <sys/types.h>
14885 #if STDC_HEADERS
14886 #include <stdlib.h>
14887 #include <stddef.h>
14888 #endif
14889
14890 EOF
14891 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14892   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14893   rm -rf conftest*
14894   eval "ac_cv_type_size_t=yes"
14895 else
14896   rm -rf conftest*
14897   eval "ac_cv_type_size_t=no"
14898 fi
14899 rm -f conftest*
14900
14901 fi
14902 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
14903   echo "$ac_t""yes" 1>&6
14904 else
14905   echo "$ac_t""no" 1>&6
14906   cat >> confdefs.h <<EOF
14907 #define size_t unsigned
14908 EOF
14909
14910 fi
14911
14912
14913 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
14914 echo "configure:14915: checking for ssize_t" >&5
14915 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
14916   echo $ac_n "(cached) $ac_c" 1>&6
14917 else
14918   cat > conftest.$ac_ext <<EOF
14919 #line 14920 "configure"
14920 #include "confdefs.h"
14921 #include <sys/types.h>
14922 #if STDC_HEADERS
14923 #include <stdlib.h>
14924 #include <stddef.h>
14925 #endif
14926
14927 EOF
14928 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14929   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14930   rm -rf conftest*
14931   eval "ac_cv_type_ssize_t=yes"
14932 else
14933   rm -rf conftest*
14934   eval "ac_cv_type_ssize_t=no"
14935 fi
14936 rm -f conftest*
14937
14938 fi
14939 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
14940   echo "$ac_t""yes" 1>&6
14941 else
14942   echo "$ac_t""no" 1>&6
14943   cat >> confdefs.h <<EOF
14944 #define ssize_t signed int
14945 EOF
14946
14947 fi
14948
14949 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
14950 echo "configure:14951: checking for caddr_t" >&5
14951 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
14952   echo $ac_n "(cached) $ac_c" 1>&6
14953 else
14954   cat > conftest.$ac_ext <<EOF
14955 #line 14956 "configure"
14956 #include "confdefs.h"
14957 #include <sys/types.h>
14958 #if STDC_HEADERS
14959 #include <stdlib.h>
14960 #include <stddef.h>
14961 #endif
14962
14963 EOF
14964 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14965   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14966   rm -rf conftest*
14967   eval "ac_cv_type_caddr_t=yes"
14968 else
14969   rm -rf conftest*
14970   eval "ac_cv_type_caddr_t=no"
14971 fi
14972 rm -f conftest*
14973
14974 fi
14975 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
14976   echo "$ac_t""yes" 1>&6
14977 else
14978   echo "$ac_t""no" 1>&6
14979   cat >> confdefs.h <<EOF
14980 #define caddr_t char *
14981 EOF
14982
14983 fi
14984
14985
14986 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
14987 echo "configure:14988: checking for socklen_t" >&5
14988 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
14989   echo $ac_n "(cached) $ac_c" 1>&6
14990 else
14991   cat > conftest.$ac_ext <<EOF
14992 #line 14993 "configure"
14993 #include "confdefs.h"
14994
14995 #ifdef HAVE_SYS_TYPES_H
14996 #include <sys/types.h>
14997 #endif
14998 #ifdef HAVE_SYS_SOCKET_H
14999 #include <sys/socket.h>
15000 #endif
15001
15002 int main() {
15003 socklen_t len;
15004 ; return 0; }
15005 EOF
15006 if { (eval echo configure:15007: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15007   rm -rf conftest*
15008   ol_cv_type_socklen_t=yes
15009 else
15010   echo "configure: failed program was:" >&5
15011   cat conftest.$ac_ext >&5
15012   rm -rf conftest*
15013   ol_cv_type_socklen_t=no
15014 fi
15015 rm -f conftest*
15016 fi
15017
15018 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
15019   if test $ol_cv_type_socklen_t = no; then
15020     cat >> confdefs.h <<\EOF
15021 #define socklen_t int
15022 EOF
15023
15024   fi
15025  
15026 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
15027 echo "configure:15028: checking for member st_blksize in aggregate type struct stat" >&5
15028 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
15029   echo $ac_n "(cached) $ac_c" 1>&6
15030 else
15031   cat > conftest.$ac_ext <<EOF
15032 #line 15033 "configure"
15033 #include "confdefs.h"
15034 #include <sys/types.h>
15035 #include <sys/stat.h>
15036 int main() {
15037 struct stat foo; foo.st_blksize;
15038 ; return 0; }
15039 EOF
15040 if { (eval echo configure:15041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15041   rm -rf conftest*
15042   ac_cv_c_struct_member_st_blksize=yes
15043 else
15044   echo "configure: failed program was:" >&5
15045   cat conftest.$ac_ext >&5
15046   rm -rf conftest*
15047   ac_cv_c_struct_member_st_blksize=no
15048 fi
15049 rm -f conftest*
15050 fi
15051
15052 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
15053 st_blksize="$ac_cv_c_struct_member_st_blksize"
15054 if test $ac_cv_c_struct_member_st_blksize = yes; then
15055   cat >> confdefs.h <<\EOF
15056 #define HAVE_ST_BLKSIZE 1
15057 EOF
15058
15059 fi
15060
15061 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
15062 echo "configure:15063: checking whether time.h and sys/time.h may both be included" >&5
15063 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
15064   echo $ac_n "(cached) $ac_c" 1>&6
15065 else
15066   cat > conftest.$ac_ext <<EOF
15067 #line 15068 "configure"
15068 #include "confdefs.h"
15069 #include <sys/types.h>
15070 #include <sys/time.h>
15071 #include <time.h>
15072 int main() {
15073 struct tm *tp;
15074 ; return 0; }
15075 EOF
15076 if { (eval echo configure:15077: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15077   rm -rf conftest*
15078   ac_cv_header_time=yes
15079 else
15080   echo "configure: failed program was:" >&5
15081   cat conftest.$ac_ext >&5
15082   rm -rf conftest*
15083   ac_cv_header_time=no
15084 fi
15085 rm -f conftest*
15086 fi
15087
15088 echo "$ac_t""$ac_cv_header_time" 1>&6
15089 if test $ac_cv_header_time = yes; then
15090   cat >> confdefs.h <<\EOF
15091 #define TIME_WITH_SYS_TIME 1
15092 EOF
15093
15094 fi
15095
15096 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
15097 echo "configure:15098: checking whether struct tm is in sys/time.h or time.h" >&5
15098 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
15099   echo $ac_n "(cached) $ac_c" 1>&6
15100 else
15101   cat > conftest.$ac_ext <<EOF
15102 #line 15103 "configure"
15103 #include "confdefs.h"
15104 #include <sys/types.h>
15105 #include <time.h>
15106 int main() {
15107 struct tm *tp; tp->tm_sec;
15108 ; return 0; }
15109 EOF
15110 if { (eval echo configure:15111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15111   rm -rf conftest*
15112   ac_cv_struct_tm=time.h
15113 else
15114   echo "configure: failed program was:" >&5
15115   cat conftest.$ac_ext >&5
15116   rm -rf conftest*
15117   ac_cv_struct_tm=sys/time.h
15118 fi
15119 rm -f conftest*
15120 fi
15121
15122 echo "$ac_t""$ac_cv_struct_tm" 1>&6
15123 if test $ac_cv_struct_tm = sys/time.h; then
15124   cat >> confdefs.h <<\EOF
15125 #define TM_IN_SYS_TIME 1
15126 EOF
15127
15128 fi
15129
15130 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
15131 echo "configure:15132: checking for uid_t in sys/types.h" >&5
15132 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
15133   echo $ac_n "(cached) $ac_c" 1>&6
15134 else
15135   cat > conftest.$ac_ext <<EOF
15136 #line 15137 "configure"
15137 #include "confdefs.h"
15138 #include <sys/types.h>
15139 EOF
15140 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15141   egrep "uid_t" >/dev/null 2>&1; then
15142   rm -rf conftest*
15143   ac_cv_type_uid_t=yes
15144 else
15145   rm -rf conftest*
15146   ac_cv_type_uid_t=no
15147 fi
15148 rm -f conftest*
15149
15150 fi
15151
15152 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
15153 if test $ac_cv_type_uid_t = no; then
15154   cat >> confdefs.h <<\EOF
15155 #define uid_t int
15156 EOF
15157
15158   cat >> confdefs.h <<\EOF
15159 #define gid_t int
15160 EOF
15161
15162 fi
15163
15164 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
15165 echo "configure:15166: checking for sig_atomic_t" >&5
15166 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
15167   echo $ac_n "(cached) $ac_c" 1>&6
15168 else
15169   cat > conftest.$ac_ext <<EOF
15170 #line 15171 "configure"
15171 #include "confdefs.h"
15172 #include <signal.h>
15173 int main() {
15174 sig_atomic_t atomic;
15175 ; return 0; }
15176 EOF
15177 if { (eval echo configure:15178: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15178   rm -rf conftest*
15179   ol_cv_type_sig_atomic_t=yes
15180 else
15181   echo "configure: failed program was:" >&5
15182   cat conftest.$ac_ext >&5
15183   rm -rf conftest*
15184   ol_cv_type_sig_atomic_t=no
15185 fi
15186 rm -f conftest*
15187 fi
15188
15189 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
15190   if test $ol_cv_type_sig_atomic_t = no; then
15191     cat >> confdefs.h <<\EOF
15192 #define sig_atomic_t int
15193 EOF
15194
15195   fi
15196  
15197
15198
15199 # test for pw_gecos in struct passwd
15200 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
15201 echo "configure:15202: checking struct passwd for pw_gecos" >&5
15202 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
15203   echo $ac_n "(cached) $ac_c" 1>&6
15204 else
15205   
15206         cat > conftest.$ac_ext <<EOF
15207 #line 15208 "configure"
15208 #include "confdefs.h"
15209 #include <pwd.h>
15210 int main() {
15211
15212         struct passwd pwd;
15213         pwd.pw_gecos = pwd.pw_name;
15214
15215 ; return 0; }
15216 EOF
15217 if { (eval echo configure:15218: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15218   rm -rf conftest*
15219   ol_cv_struct_passwd_pw_gecos=yes
15220 else
15221   echo "configure: failed program was:" >&5
15222   cat conftest.$ac_ext >&5
15223   rm -rf conftest*
15224   ol_cv_struct_passwd_pw_gecos=no
15225 fi
15226 rm -f conftest*
15227 fi
15228
15229 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
15230 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
15231         cat >> confdefs.h <<\EOF
15232 #define HAVE_PW_GECOS 1
15233 EOF
15234
15235 fi
15236
15237 # test for pw_passwd in struct passwd
15238 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
15239 echo "configure:15240: checking struct passwd for pw_passwd" >&5
15240 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
15241   echo $ac_n "(cached) $ac_c" 1>&6
15242 else
15243   
15244         cat > conftest.$ac_ext <<EOF
15245 #line 15246 "configure"
15246 #include "confdefs.h"
15247 #include <pwd.h>
15248 int main() {
15249
15250         struct passwd pwd;
15251         pwd.pw_passwd = pwd.pw_name;
15252
15253 ; return 0; }
15254 EOF
15255 if { (eval echo configure:15256: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15256   rm -rf conftest*
15257   ol_cv_struct_passwd_pw_passwd=yes
15258 else
15259   echo "configure: failed program was:" >&5
15260   cat conftest.$ac_ext >&5
15261   rm -rf conftest*
15262   ol_cv_struct_passwd_pw_passwd=no
15263 fi
15264 rm -f conftest*
15265 fi
15266
15267 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
15268 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
15269         cat >> confdefs.h <<\EOF
15270 #define HAVE_PW_PASSWD 1
15271 EOF
15272
15273 fi
15274
15275
15276 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
15277 echo "configure:15278: checking if toupper() requires islower()" >&5
15278 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
15279   echo $ac_n "(cached) $ac_c" 1>&6
15280 else
15281   
15282         if test "$cross_compiling" = yes; then
15283   ol_cv_c_upper_lower=safe
15284 else
15285   cat > conftest.$ac_ext <<EOF
15286 #line 15287 "configure"
15287 #include "confdefs.h"
15288
15289 #include <ctype.h>
15290 main()
15291 {
15292         if ('C' == toupper('C'))
15293                 exit(0);
15294         else
15295                 exit(1);
15296 }
15297 EOF
15298 if { (eval echo configure:15299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15299 then
15300   ol_cv_c_upper_lower=no
15301 else
15302   echo "configure: failed program was:" >&5
15303   cat conftest.$ac_ext >&5
15304   rm -fr conftest*
15305   ol_cv_c_upper_lower=yes
15306 fi
15307 rm -fr conftest*
15308 fi
15309
15310 fi
15311
15312 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
15313 if test $ol_cv_c_upper_lower != no ; then
15314         cat >> confdefs.h <<\EOF
15315 #define C_UPPER_LOWER 1
15316 EOF
15317
15318 fi
15319
15320 echo $ac_n "checking for working const""... $ac_c" 1>&6
15321 echo "configure:15322: checking for working const" >&5
15322 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
15323   echo $ac_n "(cached) $ac_c" 1>&6
15324 else
15325   cat > conftest.$ac_ext <<EOF
15326 #line 15327 "configure"
15327 #include "confdefs.h"
15328
15329 int main() {
15330
15331 /* Ultrix mips cc rejects this.  */
15332 typedef int charset[2]; const charset x;
15333 /* SunOS 4.1.1 cc rejects this.  */
15334 char const *const *ccp;
15335 char **p;
15336 /* NEC SVR4.0.2 mips cc rejects this.  */
15337 struct point {int x, y;};
15338 static struct point const zero = {0,0};
15339 /* AIX XL C 1.02.0.0 rejects this.
15340    It does not let you subtract one const X* pointer from another in an arm
15341    of an if-expression whose if-part is not a constant expression */
15342 const char *g = "string";
15343 ccp = &g + (g ? g-g : 0);
15344 /* HPUX 7.0 cc rejects these. */
15345 ++ccp;
15346 p = (char**) ccp;
15347 ccp = (char const *const *) p;
15348 { /* SCO 3.2v4 cc rejects this.  */
15349   char *t;
15350   char const *s = 0 ? (char *) 0 : (char const *) 0;
15351
15352   *t++ = 0;
15353 }
15354 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
15355   int x[] = {25, 17};
15356   const int *foo = &x[0];
15357   ++foo;
15358 }
15359 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
15360   typedef const int *iptr;
15361   iptr p = 0;
15362   ++p;
15363 }
15364 { /* AIX XL C 1.02.0.0 rejects this saying
15365      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
15366   struct s { int j; const int *ap[3]; };
15367   struct s *b; b->j = 5;
15368 }
15369 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
15370   const int foo = 10;
15371 }
15372
15373 ; return 0; }
15374 EOF
15375 if { (eval echo configure:15376: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15376   rm -rf conftest*
15377   ac_cv_c_const=yes
15378 else
15379   echo "configure: failed program was:" >&5
15380   cat conftest.$ac_ext >&5
15381   rm -rf conftest*
15382   ac_cv_c_const=no
15383 fi
15384 rm -f conftest*
15385 fi
15386
15387 echo "$ac_t""$ac_cv_c_const" 1>&6
15388 if test $ac_cv_c_const = no; then
15389   cat >> confdefs.h <<\EOF
15390 #define const 
15391 EOF
15392
15393 fi
15394
15395 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
15396 echo "configure:15397: checking if compiler understands volatile" >&5
15397 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
15398   echo $ac_n "(cached) $ac_c" 1>&6
15399 else
15400   cat > conftest.$ac_ext <<EOF
15401 #line 15402 "configure"
15402 #include "confdefs.h"
15403 int x, y, z;
15404 int main() {
15405 volatile int a; int * volatile b = x ? &y : &z;
15406       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
15407       *b = 0;
15408 ; return 0; }
15409 EOF
15410 if { (eval echo configure:15411: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15411   rm -rf conftest*
15412   ol_cv_c_volatile=yes
15413 else
15414   echo "configure: failed program was:" >&5
15415   cat conftest.$ac_ext >&5
15416   rm -rf conftest*
15417   ol_cv_c_volatile=no
15418 fi
15419 rm -f conftest*
15420 fi
15421
15422 echo "$ac_t""$ol_cv_c_volatile" 1>&6
15423   if test $ol_cv_c_volatile = yes; then
15424     : 
15425   else
15426     cat >> confdefs.h <<\EOF
15427 #define volatile 
15428 EOF
15429
15430   fi
15431  
15432
15433 if test $cross_compiling = yes ; then
15434         cat >> confdefs.h <<\EOF
15435 #define CROSS_COMPILING 1
15436 EOF
15437
15438 else
15439         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
15440 echo "configure:15441: checking whether byte ordering is bigendian" >&5
15441 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
15442   echo $ac_n "(cached) $ac_c" 1>&6
15443 else
15444   ac_cv_c_bigendian=unknown
15445 # See if sys/param.h defines the BYTE_ORDER macro.
15446 cat > conftest.$ac_ext <<EOF
15447 #line 15448 "configure"
15448 #include "confdefs.h"
15449 #include <sys/types.h>
15450 #include <sys/param.h>
15451 int main() {
15452
15453 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
15454  bogus endian macros
15455 #endif
15456 ; return 0; }
15457 EOF
15458 if { (eval echo configure:15459: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15459   rm -rf conftest*
15460   # It does; now see whether it defined to BIG_ENDIAN or not.
15461 cat > conftest.$ac_ext <<EOF
15462 #line 15463 "configure"
15463 #include "confdefs.h"
15464 #include <sys/types.h>
15465 #include <sys/param.h>
15466 int main() {
15467
15468 #if BYTE_ORDER != BIG_ENDIAN
15469  not big endian
15470 #endif
15471 ; return 0; }
15472 EOF
15473 if { (eval echo configure:15474: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15474   rm -rf conftest*
15475   ac_cv_c_bigendian=yes
15476 else
15477   echo "configure: failed program was:" >&5
15478   cat conftest.$ac_ext >&5
15479   rm -rf conftest*
15480   ac_cv_c_bigendian=no
15481 fi
15482 rm -f conftest*
15483 else
15484   echo "configure: failed program was:" >&5
15485   cat conftest.$ac_ext >&5
15486 fi
15487 rm -f conftest*
15488 if test $ac_cv_c_bigendian = unknown; then
15489 if test "$cross_compiling" = yes; then
15490     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
15491 else
15492   cat > conftest.$ac_ext <<EOF
15493 #line 15494 "configure"
15494 #include "confdefs.h"
15495 main () {
15496   /* Are we little or big endian?  From Harbison&Steele.  */
15497   union
15498   {
15499     long l;
15500     char c[sizeof (long)];
15501   } u;
15502   u.l = 1;
15503   exit (u.c[sizeof (long) - 1] == 1);
15504 }
15505 EOF
15506 if { (eval echo configure:15507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15507 then
15508   ac_cv_c_bigendian=no
15509 else
15510   echo "configure: failed program was:" >&5
15511   cat conftest.$ac_ext >&5
15512   rm -fr conftest*
15513   ac_cv_c_bigendian=yes
15514 fi
15515 rm -fr conftest*
15516 fi
15517
15518 fi
15519 fi
15520
15521 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
15522 if test $ac_cv_c_bigendian = yes; then
15523   cat >> confdefs.h <<\EOF
15524 #define WORDS_BIGENDIAN 1
15525 EOF
15526
15527 fi
15528
15529 fi
15530
15531 echo $ac_n "checking size of short""... $ac_c" 1>&6
15532 echo "configure:15533: checking size of short" >&5 
15533 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
15534   echo $ac_n "(cached) $ac_c" 1>&6
15535 else
15536   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
15537   cat > conftest.$ac_ext <<EOF
15538 #line 15539 "configure"
15539 #include "confdefs.h"
15540 #include "confdefs.h" 
15541 #include <sys/types.h> 
15542  
15543
15544 int main() {
15545 switch (0) case 0: case (sizeof (short) == $ac_size):;
15546 ; return 0; }
15547 EOF
15548 if { (eval echo configure:15549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15549   rm -rf conftest*
15550   ac_cv_sizeof_short=$ac_size
15551 else
15552   echo "configure: failed program was:" >&5
15553   cat conftest.$ac_ext >&5
15554 fi
15555 rm -f conftest* 
15556   if test x$ac_cv_sizeof_short != x ; then break; fi 
15557 done 
15558
15559 fi
15560  
15561 if test x$ac_cv_sizeof_short = x ; then 
15562   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
15563 fi 
15564 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
15565 cat >> confdefs.h <<EOF
15566 #define SIZEOF_SHORT $ac_cv_sizeof_short
15567 EOF
15568  
15569  
15570 echo $ac_n "checking size of int""... $ac_c" 1>&6
15571 echo "configure:15572: checking size of int" >&5 
15572 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
15573   echo $ac_n "(cached) $ac_c" 1>&6
15574 else
15575   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
15576   cat > conftest.$ac_ext <<EOF
15577 #line 15578 "configure"
15578 #include "confdefs.h"
15579 #include "confdefs.h" 
15580 #include <sys/types.h> 
15581  
15582
15583 int main() {
15584 switch (0) case 0: case (sizeof (int) == $ac_size):;
15585 ; return 0; }
15586 EOF
15587 if { (eval echo configure:15588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15588   rm -rf conftest*
15589   ac_cv_sizeof_int=$ac_size
15590 else
15591   echo "configure: failed program was:" >&5
15592   cat conftest.$ac_ext >&5
15593 fi
15594 rm -f conftest* 
15595   if test x$ac_cv_sizeof_int != x ; then break; fi 
15596 done 
15597
15598 fi
15599  
15600 if test x$ac_cv_sizeof_int = x ; then 
15601   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
15602 fi 
15603 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
15604 cat >> confdefs.h <<EOF
15605 #define SIZEOF_INT $ac_cv_sizeof_int
15606 EOF
15607  
15608  
15609 echo $ac_n "checking size of long""... $ac_c" 1>&6
15610 echo "configure:15611: checking size of long" >&5 
15611 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
15612   echo $ac_n "(cached) $ac_c" 1>&6
15613 else
15614   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
15615   cat > conftest.$ac_ext <<EOF
15616 #line 15617 "configure"
15617 #include "confdefs.h"
15618 #include "confdefs.h" 
15619 #include <sys/types.h> 
15620  
15621
15622 int main() {
15623 switch (0) case 0: case (sizeof (long) == $ac_size):;
15624 ; return 0; }
15625 EOF
15626 if { (eval echo configure:15627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15627   rm -rf conftest*
15628   ac_cv_sizeof_long=$ac_size
15629 else
15630   echo "configure: failed program was:" >&5
15631   cat conftest.$ac_ext >&5
15632 fi
15633 rm -f conftest* 
15634   if test x$ac_cv_sizeof_long != x ; then break; fi 
15635 done 
15636
15637 fi
15638  
15639 if test x$ac_cv_sizeof_long = x ; then 
15640   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
15641 fi 
15642 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
15643 cat >> confdefs.h <<EOF
15644 #define SIZEOF_LONG $ac_cv_sizeof_long
15645 EOF
15646  
15647
15648
15649 if test "$ac_cv_sizeof_int" -lt 4 ; then
15650         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
15651
15652         cat >> confdefs.h <<\EOF
15653 #define LBER_INT_T long
15654 EOF
15655
15656 else
15657         cat >> confdefs.h <<\EOF
15658 #define LBER_INT_T int
15659 EOF
15660
15661 fi
15662
15663 cat >> confdefs.h <<\EOF
15664 #define LBER_LEN_T long
15665 EOF
15666
15667 cat >> confdefs.h <<\EOF
15668 #define LBER_SOCKET_T int
15669 EOF
15670
15671 cat >> confdefs.h <<\EOF
15672 #define LBER_TAG_T long
15673 EOF
15674
15675
15676 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
15677 echo "configure:15678: checking for 8-bit clean memcmp" >&5
15678 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
15679   echo $ac_n "(cached) $ac_c" 1>&6
15680 else
15681   if test "$cross_compiling" = yes; then
15682   ac_cv_func_memcmp_clean=no
15683 else
15684   cat > conftest.$ac_ext <<EOF
15685 #line 15686 "configure"
15686 #include "confdefs.h"
15687
15688 main()
15689 {
15690   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
15691   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
15692 }
15693
15694 EOF
15695 if { (eval echo configure:15696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15696 then
15697   ac_cv_func_memcmp_clean=yes
15698 else
15699   echo "configure: failed program was:" >&5
15700   cat conftest.$ac_ext >&5
15701   rm -fr conftest*
15702   ac_cv_func_memcmp_clean=no
15703 fi
15704 rm -fr conftest*
15705 fi
15706
15707 fi
15708
15709 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
15710 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
15711
15712 echo $ac_n "checking for strftime""... $ac_c" 1>&6
15713 echo "configure:15714: checking for strftime" >&5
15714 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
15715   echo $ac_n "(cached) $ac_c" 1>&6
15716 else
15717   cat > conftest.$ac_ext <<EOF
15718 #line 15719 "configure"
15719 #include "confdefs.h"
15720 /* System header to define __stub macros and hopefully few prototypes,
15721     which can conflict with char strftime(); below.  */
15722 #include <assert.h>
15723 /* Override any gcc2 internal prototype to avoid an error.  */
15724 /* We use char because int might match the return type of a gcc2
15725     builtin and then its argument prototype would still apply.  */
15726 char strftime();
15727 char (*f)();
15728
15729 int main() {
15730
15731 /* The GNU C library defines this for functions which it implements
15732     to always fail with ENOSYS.  Some functions are actually named
15733     something starting with __ and the normal name is an alias.  */
15734 #if defined (__stub_strftime) || defined (__stub___strftime)
15735 choke me
15736 #else
15737 f = strftime;
15738 #endif
15739
15740 ; return 0; }
15741 EOF
15742 if { (eval echo configure:15743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15743   rm -rf conftest*
15744   eval "ac_cv_func_strftime=yes"
15745 else
15746   echo "configure: failed program was:" >&5
15747   cat conftest.$ac_ext >&5
15748   rm -rf conftest*
15749   eval "ac_cv_func_strftime=no"
15750 fi
15751 rm -f conftest*
15752 fi
15753
15754 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
15755   echo "$ac_t""yes" 1>&6
15756   cat >> confdefs.h <<\EOF
15757 #define HAVE_STRFTIME 1
15758 EOF
15759
15760 else
15761   echo "$ac_t""no" 1>&6
15762 # strftime is in -lintl on SCO UNIX.
15763 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
15764 echo "configure:15765: checking for strftime in -lintl" >&5
15765 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
15766 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15767   echo $ac_n "(cached) $ac_c" 1>&6
15768 else
15769   ac_save_LIBS="$LIBS"
15770 LIBS="-lintl  $LIBS"
15771 cat > conftest.$ac_ext <<EOF
15772 #line 15773 "configure"
15773 #include "confdefs.h"
15774 /* Override any gcc2 internal prototype to avoid an error.  */
15775 /* We use char because int might match the return type of a gcc2
15776     builtin and then its argument prototype would still apply.  */
15777 char strftime();
15778
15779 int main() {
15780 strftime()
15781 ; return 0; }
15782 EOF
15783 if { (eval echo configure:15784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15784   rm -rf conftest*
15785   eval "ac_cv_lib_$ac_lib_var=yes"
15786 else
15787   echo "configure: failed program was:" >&5
15788   cat conftest.$ac_ext >&5
15789   rm -rf conftest*
15790   eval "ac_cv_lib_$ac_lib_var=no"
15791 fi
15792 rm -f conftest*
15793 LIBS="$ac_save_LIBS"
15794
15795 fi
15796 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15797   echo "$ac_t""yes" 1>&6
15798   cat >> confdefs.h <<\EOF
15799 #define HAVE_STRFTIME 1
15800 EOF
15801
15802 LIBS="-lintl $LIBS"
15803 else
15804   echo "$ac_t""no" 1>&6
15805 fi
15806
15807 fi
15808
15809
15810 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
15811 echo "configure:15812: checking for inet_aton()" >&5
15812 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
15813   echo $ac_n "(cached) $ac_c" 1>&6
15814 else
15815   cat > conftest.$ac_ext <<EOF
15816 #line 15817 "configure"
15817 #include "confdefs.h"
15818
15819 #ifdef HAVE_SYS_TYPES_H
15820 #       include <sys/types.h>
15821 #endif
15822 #ifdef HAVE_SYS_SOCKET_H
15823 #       include <sys/socket.h>
15824 #       ifdef HAVE_SYS_SELECT_H
15825 #               include <sys/select.h>
15826 #       endif
15827 #       include <netinet/in.h>
15828 #       ifdef HAVE_ARPA_INET_H
15829 #               include <arpa/inet.h>
15830 #       endif
15831 #endif
15832
15833 int main() {
15834 struct in_addr in;
15835 int rc = inet_aton( "255.255.255.255", &in );
15836 ; return 0; }
15837 EOF
15838 if { (eval echo configure:15839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15839   rm -rf conftest*
15840   ol_cv_func_inet_aton=yes
15841 else
15842   echo "configure: failed program was:" >&5
15843   cat conftest.$ac_ext >&5
15844   rm -rf conftest*
15845   ol_cv_func_inet_aton=no
15846 fi
15847 rm -f conftest*
15848 fi
15849
15850 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
15851   if test $ol_cv_func_inet_aton != no; then
15852     cat >> confdefs.h <<\EOF
15853 #define HAVE_INET_ATON 1
15854 EOF
15855
15856   fi
15857  
15858
15859 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
15860 echo "configure:15861: checking for _spawnlp" >&5
15861 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
15862   echo $ac_n "(cached) $ac_c" 1>&6
15863 else
15864   cat > conftest.$ac_ext <<EOF
15865 #line 15866 "configure"
15866 #include "confdefs.h"
15867 /* System header to define __stub macros and hopefully few prototypes,
15868     which can conflict with char _spawnlp(); below.  */
15869 #include <assert.h>
15870 /* Override any gcc2 internal prototype to avoid an error.  */
15871 /* We use char because int might match the return type of a gcc2
15872     builtin and then its argument prototype would still apply.  */
15873 char _spawnlp();
15874 char (*f)();
15875
15876 int main() {
15877
15878 /* The GNU C library defines this for functions which it implements
15879     to always fail with ENOSYS.  Some functions are actually named
15880     something starting with __ and the normal name is an alias.  */
15881 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
15882 choke me
15883 #else
15884 f = _spawnlp;
15885 #endif
15886
15887 ; return 0; }
15888 EOF
15889 if { (eval echo configure:15890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15890   rm -rf conftest*
15891   eval "ac_cv_func__spawnlp=yes"
15892 else
15893   echo "configure: failed program was:" >&5
15894   cat conftest.$ac_ext >&5
15895   rm -rf conftest*
15896   eval "ac_cv_func__spawnlp=no"
15897 fi
15898 rm -f conftest*
15899 fi
15900
15901 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
15902   echo "$ac_t""yes" 1>&6
15903   cat >> confdefs.h <<\EOF
15904 #define HAVE_SPAWNLP 1
15905 EOF
15906
15907 else
15908   echo "$ac_t""no" 1>&6
15909 fi
15910
15911
15912 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
15913 echo "configure:15914: checking for _snprintf" >&5
15914 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
15915   echo $ac_n "(cached) $ac_c" 1>&6
15916 else
15917   cat > conftest.$ac_ext <<EOF
15918 #line 15919 "configure"
15919 #include "confdefs.h"
15920 /* System header to define __stub macros and hopefully few prototypes,
15921     which can conflict with char _snprintf(); below.  */
15922 #include <assert.h>
15923 /* Override any gcc2 internal prototype to avoid an error.  */
15924 /* We use char because int might match the return type of a gcc2
15925     builtin and then its argument prototype would still apply.  */
15926 char _snprintf();
15927 char (*f)();
15928
15929 int main() {
15930
15931 /* The GNU C library defines this for functions which it implements
15932     to always fail with ENOSYS.  Some functions are actually named
15933     something starting with __ and the normal name is an alias.  */
15934 #if defined (__stub__snprintf) || defined (__stub____snprintf)
15935 choke me
15936 #else
15937 f = _snprintf;
15938 #endif
15939
15940 ; return 0; }
15941 EOF
15942 if { (eval echo configure:15943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15943   rm -rf conftest*
15944   eval "ac_cv_func__snprintf=yes"
15945 else
15946   echo "configure: failed program was:" >&5
15947   cat conftest.$ac_ext >&5
15948   rm -rf conftest*
15949   eval "ac_cv_func__snprintf=no"
15950 fi
15951 rm -f conftest*
15952 fi
15953
15954 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
15955   echo "$ac_t""yes" 1>&6
15956   ac_cv_func_snprintf=yes
15957         cat >> confdefs.h <<\EOF
15958 #define snprintf _snprintf
15959 EOF
15960
15961
15962 else
15963   echo "$ac_t""no" 1>&6
15964 fi
15965
15966
15967 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
15968 echo "configure:15969: checking for _vsnprintf" >&5
15969 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
15970   echo $ac_n "(cached) $ac_c" 1>&6
15971 else
15972   cat > conftest.$ac_ext <<EOF
15973 #line 15974 "configure"
15974 #include "confdefs.h"
15975 /* System header to define __stub macros and hopefully few prototypes,
15976     which can conflict with char _vsnprintf(); below.  */
15977 #include <assert.h>
15978 /* Override any gcc2 internal prototype to avoid an error.  */
15979 /* We use char because int might match the return type of a gcc2
15980     builtin and then its argument prototype would still apply.  */
15981 char _vsnprintf();
15982 char (*f)();
15983
15984 int main() {
15985
15986 /* The GNU C library defines this for functions which it implements
15987     to always fail with ENOSYS.  Some functions are actually named
15988     something starting with __ and the normal name is an alias.  */
15989 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
15990 choke me
15991 #else
15992 f = _vsnprintf;
15993 #endif
15994
15995 ; return 0; }
15996 EOF
15997 if { (eval echo configure:15998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15998   rm -rf conftest*
15999   eval "ac_cv_func__vsnprintf=yes"
16000 else
16001   echo "configure: failed program was:" >&5
16002   cat conftest.$ac_ext >&5
16003   rm -rf conftest*
16004   eval "ac_cv_func__vsnprintf=no"
16005 fi
16006 rm -f conftest*
16007 fi
16008
16009 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
16010   echo "$ac_t""yes" 1>&6
16011   ac_cv_func_vsnprintf=yes
16012         cat >> confdefs.h <<\EOF
16013 #define vsnprintf _vsnprintf
16014 EOF
16015
16016
16017 else
16018   echo "$ac_t""no" 1>&6
16019 fi
16020
16021
16022 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
16023 echo "configure:16024: checking for vprintf" >&5
16024 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
16025   echo $ac_n "(cached) $ac_c" 1>&6
16026 else
16027   cat > conftest.$ac_ext <<EOF
16028 #line 16029 "configure"
16029 #include "confdefs.h"
16030 /* System header to define __stub macros and hopefully few prototypes,
16031     which can conflict with char vprintf(); below.  */
16032 #include <assert.h>
16033 /* Override any gcc2 internal prototype to avoid an error.  */
16034 /* We use char because int might match the return type of a gcc2
16035     builtin and then its argument prototype would still apply.  */
16036 char vprintf();
16037 char (*f)();
16038
16039 int main() {
16040
16041 /* The GNU C library defines this for functions which it implements
16042     to always fail with ENOSYS.  Some functions are actually named
16043     something starting with __ and the normal name is an alias.  */
16044 #if defined (__stub_vprintf) || defined (__stub___vprintf)
16045 choke me
16046 #else
16047 f = vprintf;
16048 #endif
16049
16050 ; return 0; }
16051 EOF
16052 if { (eval echo configure:16053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16053   rm -rf conftest*
16054   eval "ac_cv_func_vprintf=yes"
16055 else
16056   echo "configure: failed program was:" >&5
16057   cat conftest.$ac_ext >&5
16058   rm -rf conftest*
16059   eval "ac_cv_func_vprintf=no"
16060 fi
16061 rm -f conftest*
16062 fi
16063
16064 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
16065   echo "$ac_t""yes" 1>&6
16066   cat >> confdefs.h <<\EOF
16067 #define HAVE_VPRINTF 1
16068 EOF
16069
16070 else
16071   echo "$ac_t""no" 1>&6
16072 fi
16073
16074 if test "$ac_cv_func_vprintf" != yes; then
16075 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
16076 echo "configure:16077: checking for _doprnt" >&5
16077 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
16078   echo $ac_n "(cached) $ac_c" 1>&6
16079 else
16080   cat > conftest.$ac_ext <<EOF
16081 #line 16082 "configure"
16082 #include "confdefs.h"
16083 /* System header to define __stub macros and hopefully few prototypes,
16084     which can conflict with char _doprnt(); below.  */
16085 #include <assert.h>
16086 /* Override any gcc2 internal prototype to avoid an error.  */
16087 /* We use char because int might match the return type of a gcc2
16088     builtin and then its argument prototype would still apply.  */
16089 char _doprnt();
16090 char (*f)();
16091
16092 int main() {
16093
16094 /* The GNU C library defines this for functions which it implements
16095     to always fail with ENOSYS.  Some functions are actually named
16096     something starting with __ and the normal name is an alias.  */
16097 #if defined (__stub__doprnt) || defined (__stub____doprnt)
16098 choke me
16099 #else
16100 f = _doprnt;
16101 #endif
16102
16103 ; return 0; }
16104 EOF
16105 if { (eval echo configure:16106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16106   rm -rf conftest*
16107   eval "ac_cv_func__doprnt=yes"
16108 else
16109   echo "configure: failed program was:" >&5
16110   cat conftest.$ac_ext >&5
16111   rm -rf conftest*
16112   eval "ac_cv_func__doprnt=no"
16113 fi
16114 rm -f conftest*
16115 fi
16116
16117 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
16118   echo "$ac_t""yes" 1>&6
16119   cat >> confdefs.h <<\EOF
16120 #define HAVE_DOPRNT 1
16121 EOF
16122
16123 else
16124   echo "$ac_t""no" 1>&6
16125 fi
16126
16127 fi
16128
16129
16130 if test $ac_cv_func_vprintf = yes ; then
16131                 for ac_func in vsnprintf vsprintf
16132 do
16133 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16134 echo "configure:16135: checking for $ac_func" >&5
16135 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16136   echo $ac_n "(cached) $ac_c" 1>&6
16137 else
16138   cat > conftest.$ac_ext <<EOF
16139 #line 16140 "configure"
16140 #include "confdefs.h"
16141 /* System header to define __stub macros and hopefully few prototypes,
16142     which can conflict with char $ac_func(); below.  */
16143 #include <assert.h>
16144 /* Override any gcc2 internal prototype to avoid an error.  */
16145 /* We use char because int might match the return type of a gcc2
16146     builtin and then its argument prototype would still apply.  */
16147 char $ac_func();
16148 char (*f)();
16149
16150 int main() {
16151
16152 /* The GNU C library defines this for functions which it implements
16153     to always fail with ENOSYS.  Some functions are actually named
16154     something starting with __ and the normal name is an alias.  */
16155 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16156 choke me
16157 #else
16158 f = $ac_func;
16159 #endif
16160
16161 ; return 0; }
16162 EOF
16163 if { (eval echo configure:16164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16164   rm -rf conftest*
16165   eval "ac_cv_func_$ac_func=yes"
16166 else
16167   echo "configure: failed program was:" >&5
16168   cat conftest.$ac_ext >&5
16169   rm -rf conftest*
16170   eval "ac_cv_func_$ac_func=no"
16171 fi
16172 rm -f conftest*
16173 fi
16174
16175 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16176   echo "$ac_t""yes" 1>&6
16177     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16178   cat >> confdefs.h <<EOF
16179 #define $ac_tr_func 1
16180 EOF
16181  
16182 else
16183   echo "$ac_t""no" 1>&6
16184 fi
16185 done
16186
16187 fi
16188
16189 for ac_func in \
16190         bcopy                   \
16191         closesocket             \
16192         chroot                  \
16193         endgrent                \
16194         endpwent                \
16195         fcntl                   \
16196         flock                   \
16197         getdtablesize   \
16198         getgrgid                \
16199         gethostname             \
16200         getpass                 \
16201         getpassphrase   \
16202         getpwuid                \
16203         getpwnam                \
16204         getspnam                \
16205         gettimeofday    \
16206         initgroups              \
16207         lockf                   \
16208         memcpy                  \
16209         memmove                 \
16210         mkstemp                 \
16211         pipe                    \
16212         read                    \
16213         recv                    \
16214         recvfrom                \
16215         setpwfile               \
16216         setgid                  \
16217         setegid                 \
16218         setsid                  \
16219         setuid                  \
16220         seteuid                 \
16221         sigaction               \
16222         signal                  \
16223         sigset                  \
16224         snprintf                \
16225         strdup                  \
16226         strerror                \
16227         strpbrk                 \
16228         strrchr                 \
16229         strsep                  \
16230         strstr                  \
16231         strtol                  \
16232         strtoul                 \
16233         strspn                  \
16234         sysconf                 \
16235         waitpid                 \
16236         wait4                   \
16237         write                   \
16238         send                    \
16239         sendto                  \
16240
16241 do
16242 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16243 echo "configure:16244: checking for $ac_func" >&5
16244 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16245   echo $ac_n "(cached) $ac_c" 1>&6
16246 else
16247   cat > conftest.$ac_ext <<EOF
16248 #line 16249 "configure"
16249 #include "confdefs.h"
16250 /* System header to define __stub macros and hopefully few prototypes,
16251     which can conflict with char $ac_func(); below.  */
16252 #include <assert.h>
16253 /* Override any gcc2 internal prototype to avoid an error.  */
16254 /* We use char because int might match the return type of a gcc2
16255     builtin and then its argument prototype would still apply.  */
16256 char $ac_func();
16257 char (*f)();
16258
16259 int main() {
16260
16261 /* The GNU C library defines this for functions which it implements
16262     to always fail with ENOSYS.  Some functions are actually named
16263     something starting with __ and the normal name is an alias.  */
16264 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16265 choke me
16266 #else
16267 f = $ac_func;
16268 #endif
16269
16270 ; return 0; }
16271 EOF
16272 if { (eval echo configure:16273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16273   rm -rf conftest*
16274   eval "ac_cv_func_$ac_func=yes"
16275 else
16276   echo "configure: failed program was:" >&5
16277   cat conftest.$ac_ext >&5
16278   rm -rf conftest*
16279   eval "ac_cv_func_$ac_func=no"
16280 fi
16281 rm -f conftest*
16282 fi
16283
16284 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16285   echo "$ac_t""yes" 1>&6
16286     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16287   cat >> confdefs.h <<EOF
16288 #define $ac_tr_func 1
16289 EOF
16290  
16291 else
16292   echo "$ac_t""no" 1>&6
16293 fi
16294 done
16295
16296
16297 for ac_func in getopt tempnam
16298 do
16299 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16300 echo "configure:16301: checking for $ac_func" >&5
16301 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16302   echo $ac_n "(cached) $ac_c" 1>&6
16303 else
16304   cat > conftest.$ac_ext <<EOF
16305 #line 16306 "configure"
16306 #include "confdefs.h"
16307 /* System header to define __stub macros and hopefully few prototypes,
16308     which can conflict with char $ac_func(); below.  */
16309 #include <assert.h>
16310 /* Override any gcc2 internal prototype to avoid an error.  */
16311 /* We use char because int might match the return type of a gcc2
16312     builtin and then its argument prototype would still apply.  */
16313 char $ac_func();
16314 char (*f)();
16315
16316 int main() {
16317
16318 /* The GNU C library defines this for functions which it implements
16319     to always fail with ENOSYS.  Some functions are actually named
16320     something starting with __ and the normal name is an alias.  */
16321 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16322 choke me
16323 #else
16324 f = $ac_func;
16325 #endif
16326
16327 ; return 0; }
16328 EOF
16329 if { (eval echo configure:16330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16330   rm -rf conftest*
16331   eval "ac_cv_func_$ac_func=yes"
16332 else
16333   echo "configure: failed program was:" >&5
16334   cat conftest.$ac_ext >&5
16335   rm -rf conftest*
16336   eval "ac_cv_func_$ac_func=no"
16337 fi
16338 rm -f conftest*
16339 fi
16340
16341 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16342   echo "$ac_t""yes" 1>&6
16343     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16344   cat >> confdefs.h <<EOF
16345 #define $ac_tr_func 1
16346 EOF
16347  
16348 else
16349   echo "$ac_t""no" 1>&6
16350 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
16351 fi
16352 done
16353
16354
16355
16356 if test "$ac_cv_func_getopt" != yes; then
16357     LIBSRCS="$LIBSRCS getopt.c"
16358 fi
16359
16360 if test "$ac_cv_func_tempnam" != yes; then
16361     LIBSRCS="$LIBSRCS tempnam.c"
16362 fi
16363
16364 # Check Configuration
16365 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
16366 echo "configure:16367: checking declaration of sys_errlist" >&5
16367 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
16368   echo $ac_n "(cached) $ac_c" 1>&6
16369 else
16370   
16371         cat > conftest.$ac_ext <<EOF
16372 #line 16373 "configure"
16373 #include "confdefs.h"
16374
16375 #include <stdio.h>
16376 #include <sys/types.h>
16377 #include <errno.h>
16378 #ifdef WINNT
16379 #include <stdlib.h>
16380 #endif 
16381 int main() {
16382 char *c = (char *) *sys_errlist
16383 ; return 0; }
16384 EOF
16385 if { (eval echo configure:16386: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16386   rm -rf conftest*
16387   ol_cv_dcl_sys_errlist=yes
16388         ol_cv_have_sys_errlist=yes
16389 else
16390   echo "configure: failed program was:" >&5
16391   cat conftest.$ac_ext >&5
16392   rm -rf conftest*
16393   ol_cv_dcl_sys_errlist=no
16394 fi
16395 rm -f conftest*
16396 fi
16397
16398 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
16399 #
16400 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
16401 if test $ol_cv_dcl_sys_errlist = no ; then
16402         cat >> confdefs.h <<\EOF
16403 #define DECL_SYS_ERRLIST 1
16404 EOF
16405
16406
16407         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
16408 echo "configure:16409: checking existence of sys_errlist" >&5
16409 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
16410   echo $ac_n "(cached) $ac_c" 1>&6
16411 else
16412   
16413                 cat > conftest.$ac_ext <<EOF
16414 #line 16415 "configure"
16415 #include "confdefs.h"
16416 #include <errno.h>
16417 int main() {
16418 char *c = (char *) *sys_errlist
16419 ; return 0; }
16420 EOF
16421 if { (eval echo configure:16422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16422   rm -rf conftest*
16423   ol_cv_have_sys_errlist=yes
16424 else
16425   echo "configure: failed program was:" >&5
16426   cat conftest.$ac_ext >&5
16427   rm -rf conftest*
16428   ol_cv_have_sys_errlist=no
16429 fi
16430 rm -f conftest*
16431 fi
16432
16433 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
16434 fi
16435 if test $ol_cv_have_sys_errlist = yes ; then
16436         cat >> confdefs.h <<\EOF
16437 #define HAVE_SYS_ERRLIST 1
16438 EOF
16439
16440 fi
16441
16442
16443
16444 if test "$ol_enable_debug" != no ; then
16445         cat >> confdefs.h <<\EOF
16446 #define LDAP_DEBUG 1
16447 EOF
16448
16449 fi
16450 if test "$ol_enable_syslog" = yes ; then
16451         cat >> confdefs.h <<\EOF
16452 #define LDAP_SYSLOG 1
16453 EOF
16454
16455 fi
16456 if test "$ol_enable_cache" = no ; then
16457         cat >> confdefs.h <<\EOF
16458 #define LDAP_NOCACHE 1
16459 EOF
16460
16461 fi
16462 if test "$ol_link_kbind" != no ; then
16463         cat >> confdefs.h <<\EOF
16464 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
16465 EOF
16466
16467 fi
16468 if test "$ol_enable_proctitle" != no ; then
16469         cat >> confdefs.h <<\EOF
16470 #define LDAP_PROCTITLE 1
16471 EOF
16472
16473 fi
16474 if test "$ol_enable_referrals" != no ; then
16475         cat >> confdefs.h <<\EOF
16476 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
16477 EOF
16478
16479 fi
16480 if test "$ol_enable_local" != no; then
16481         cat >> confdefs.h <<\EOF
16482 #define LDAP_PF_LOCAL 1
16483 EOF
16484
16485 fi
16486 if test "$ol_link_ipv6" != no; then
16487         cat >> confdefs.h <<\EOF
16488 #define LDAP_PF_INET6 1
16489 EOF
16490
16491 fi
16492 if test "$ol_enable_cleartext" != no ; then
16493         cat >> confdefs.h <<\EOF
16494 #define SLAPD_CLEARTEXT 1
16495 EOF
16496
16497 fi
16498 if test "$ol_enable_crypt" != no ; then
16499         cat >> confdefs.h <<\EOF
16500 #define SLAPD_CRYPT 1
16501 EOF
16502
16503 fi
16504 if test "$ol_link_kpasswd" != no ; then
16505         cat >> confdefs.h <<\EOF
16506 #define SLAPD_KPASSWD 1
16507 EOF
16508
16509 fi
16510 if test "$ol_link_spasswd" != no ; then
16511         cat >> confdefs.h <<\EOF
16512 #define SLAPD_SPASSWD 1
16513 EOF
16514
16515 fi
16516 if test "$ol_enable_phonetic" != no ; then
16517         cat >> confdefs.h <<\EOF
16518 #define SLAPD_PHONETIC 1
16519 EOF
16520
16521 fi
16522 if test "$ol_enable_rlookups" != no ; then
16523         cat >> confdefs.h <<\EOF
16524 #define SLAPD_RLOOKUPS 1
16525 EOF
16526
16527 fi
16528 if test "$ol_enable_aci" != no ; then
16529         cat >> confdefs.h <<\EOF
16530 #define SLAPD_ACI_ENABLED 1
16531 EOF
16532
16533 fi
16534
16535 if test "$ol_link_modules" != no ; then
16536         cat >> confdefs.h <<\EOF
16537 #define SLAPD_MODULES 1
16538 EOF
16539
16540         BUILD_SLAPD=yes
16541         SLAPD_MODULES_LDFLAGS="-dlopen self"
16542 fi
16543
16544 if test "$ol_enable_bdb" != no ; then
16545         cat >> confdefs.h <<\EOF
16546 #define SLAPD_BDB 1
16547 EOF
16548
16549         BUILD_SLAPD=yes
16550         BUILD_BDB=yes
16551         if test "$ol_with_bdb_module" != static ; then
16552                 cat >> confdefs.h <<\EOF
16553 #define SLAPD_BDB_DYNAMIC 1
16554 EOF
16555
16556                 BUILD_BDB=mod
16557                 BUILD_BDB_DYNAMIC=shared
16558                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-bdb/back_bdb.la"
16559         fi
16560 fi
16561
16562 if test "$ol_link_dnssrv" != no ; then
16563         cat >> confdefs.h <<\EOF
16564 #define SLAPD_DNSSRV 1
16565 EOF
16566
16567         BUILD_SLAPD=yes
16568         BUILD_DNSSRV=yes
16569         if test "$ol_with_dnssrv_module" != static ; then
16570                 cat >> confdefs.h <<\EOF
16571 #define SLAPD_DNSSRV_DYNAMIC 1
16572 EOF
16573
16574                 BUILD_DNSSRV=mod
16575                 BUILD_DNSSRV_DYNAMIC=shared
16576                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
16577         fi
16578 fi
16579
16580 if test "$ol_enable_ldap" != no ; then
16581         cat >> confdefs.h <<\EOF
16582 #define SLAPD_LDAP 1
16583 EOF
16584
16585         BUILD_SLAPD=yes
16586         BUILD_LDAP=yes
16587         if test "$ol_with_ldap_module" != static ; then
16588                 cat >> confdefs.h <<\EOF
16589 #define SLAPD_LDAP_DYNAMIC 1
16590 EOF
16591
16592                 BUILD_LDAP=mod
16593                 BUILD_LDAP_DYNAMIC=shared
16594                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
16595         fi
16596 fi
16597
16598 if test "$ol_link_ldbm" != no ; then
16599         cat >> confdefs.h <<\EOF
16600 #define SLAPD_LDBM 1
16601 EOF
16602
16603         BUILD_SLAPD=yes
16604         BUILD_LDBM=yes
16605         if test "$ol_with_ldbm_module" != static ; then
16606                 cat >> confdefs.h <<\EOF
16607 #define SLAPD_LDBM_DYNAMIC 1
16608 EOF
16609
16610                 BUILD_LDBM=mod
16611                 BUILD_LDBM_DYNAMIC=shared
16612                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
16613         fi
16614 fi
16615
16616 if test "$ol_enable_meta" != no ; then
16617         if test "$ol_enable_ldap" = no ; then
16618                 { echo "configure: error: need --enable-ldap to use --enable-meta" 1>&2; exit 1; }
16619         fi
16620         if test "$ol_enable_rewrite" = no ; then
16621                 { echo "configure: error: need --enable-rewrite to use --enable-meta" 1>&2; exit 1; }
16622         fi
16623         cat >> confdefs.h <<\EOF
16624 #define SLAPD_META 1
16625 EOF
16626
16627         BUILD_SLAPD=yes
16628         BUILD_META=yes
16629         if test "$ol_with_meta_module" != static ; then
16630                 cat >> confdefs.h <<\EOF
16631 #define SLAPD_META_DYNAMIC 1
16632 EOF
16633
16634                 BUILD_META=mod
16635                 BUILD_META_DYNAMIC=shared
16636                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-meta/back_meta.la"
16637         fi
16638 fi
16639
16640 if test "$ol_enable_passwd" != no ; then
16641         cat >> confdefs.h <<\EOF
16642 #define SLAPD_PASSWD 1
16643 EOF
16644
16645         BUILD_SLAPD=yes
16646         BUILD_PASSWD=yes
16647         if test "$ol_with_passwd_module" != static ; then
16648                 cat >> confdefs.h <<\EOF
16649 #define SLAPD_PASSWD_DYNAMIC 1
16650 EOF
16651
16652                 BUILD_PASSWD=mod
16653                 BUILD_PASSWD_DYNAMIC=shared
16654                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
16655         fi
16656 fi
16657
16658 if test "$ol_link_perl" != no ; then
16659         cat >> confdefs.h <<\EOF
16660 #define SLAPD_PERL 1
16661 EOF
16662
16663         BUILD_SLAPD=yes
16664         BUILD_PERL=yes
16665         if test "$ol_with_perl_module" != static ; then
16666                 cat >> confdefs.h <<\EOF
16667 #define SLAPD_PERL_DYNAMIC 1
16668 EOF
16669
16670                 BUILD_PERL=mod
16671                 BUILD_PERL_DYNAMIC=shared
16672                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-perl/back_perl.la"
16673         fi
16674 fi
16675
16676 if test "$ol_enable_shell" != no ; then
16677         cat >> confdefs.h <<\EOF
16678 #define SLAPD_SHELL 1
16679 EOF
16680
16681         BUILD_SLAPD=yes
16682         BUILD_SHELL=yes
16683         if test "$ol_with_shell_module" != static ; then
16684                 cat >> confdefs.h <<\EOF
16685 #define SLAPD_SHELL_DYNAMIC 1
16686 EOF
16687
16688                 BUILD_SHELL=mod
16689                 BUILD_SHELL_DYNAMIC=shared
16690                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
16691         fi
16692 fi
16693
16694 if test "$ol_enable_tcl" != no ; then
16695         cat >> confdefs.h <<\EOF
16696 #define SLAPD_TCL 1
16697 EOF
16698
16699         BUILD_SLAPD=yes
16700         BUILD_TCL=yes
16701         if test "$ol_with_tcl_module" != static; then
16702                 cat >> confdefs.h <<\EOF
16703 #define SLAPD_TCL_DYNAMIC 1
16704 EOF
16705
16706                 BUILD_TCL=mod
16707                 BUILD_TCL_DYNAMIC=shared
16708                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-tcl/back_tcl.la"
16709         fi
16710 fi
16711
16712 if test "$ol_link_sql" != no ; then
16713         cat >> confdefs.h <<\EOF
16714 #define SLAPD_SQL 1
16715 EOF
16716
16717         BUILD_SLAPD=yes
16718         BUILD_SQL=yes
16719         if test "$ol_with_sql_module" != static; then
16720                 cat >> confdefs.h <<\EOF
16721 #define SLAPD_SQL_DYNAMIC 1
16722 EOF
16723
16724                 BUILD_SQL=mod
16725                 BUILD_SQL_DYNAMIC=shared
16726                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
16727         fi
16728 fi
16729
16730 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
16731         $BUILD_SLAPD = yes ; then
16732         BUILD_SLURPD=yes
16733 fi
16734
16735 if test "$ol_enable_rewrite" != no ; then
16736         cat >> confdefs.h <<\EOF
16737 #define ENABLE_REWRITE 1
16738 EOF
16739
16740         BUILD_REWRITE=yes
16741         SLAPD_LIBS="$SLAPD_LIBS -lrewrite"
16742 fi
16743
16744
16745 if test "$LINK_BINS_DYNAMIC" = yes; then
16746     LIB_LINKAGE=DYN
16747     LT_LIB_LINKAGE=shared
16748 else
16749     LIB_LINKAGE=STAT
16750     LT_LIB_LINKAGE=static
16751 fi
16752
16753 if test "$ac_cv_mingw32" = yes ; then
16754     PLAT=NT
16755     DYN_EXT=dll
16756 else
16757     PLAT=UNIX
16758     DYN_EXT=so
16759 fi
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769   
16770   
16771   
16772   
16773   
16774   
16775   
16776   
16777   
16778   
16779   
16780   
16781   
16782   
16783   
16784   
16785   
16786   
16787   
16788   
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826 trap '' 1 2 15
16827
16828 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
16829
16830 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16831 # Let make expand exec_prefix.
16832 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
16833
16834 # Any assignment to VPATH causes Sun make to only execute
16835 # the first set of double-colon rules, so remove it if not needed.
16836 # If there is a colon in the path, we need to keep it.
16837 if test "x$srcdir" = x.; then
16838   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
16839 fi
16840
16841 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
16842
16843 DEFS=-DHAVE_CONFIG_H
16844
16845 # Without the "./", some shells look in PATH for config.status.
16846 : ${CONFIG_STATUS=./config.status}
16847
16848 echo creating $CONFIG_STATUS
16849 rm -f $CONFIG_STATUS
16850 cat > $CONFIG_STATUS <<EOF
16851 #! /bin/sh
16852 # Generated automatically by configure.
16853 # Run this file to recreate the current configuration.
16854 # This directory was configured as follows,
16855 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
16856 #
16857 # $0 $ac_configure_args
16858 #
16859 # Compiler output produced by configure, useful for debugging
16860 # configure, is in ./config.log if it exists.
16861
16862 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
16863 for ac_option
16864 do
16865   case "\$ac_option" in
16866   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16867     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
16868     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
16869   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
16870     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
16871     exit 0 ;;
16872   -help | --help | --hel | --he | --h)
16873     echo "\$ac_cs_usage"; exit 0 ;;
16874   *) echo "\$ac_cs_usage"; exit 1 ;;
16875   esac
16876 done
16877
16878 ac_given_srcdir=$srcdir
16879 ac_given_INSTALL="$INSTALL"
16880
16881 trap 'rm -fr `echo "\
16882 Makefile:build/top.mk:Makefile.in:build/dir.mk \
16883 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
16884 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
16885 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
16886 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
16887 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
16888 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
16889 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
16890 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
16891 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
16892 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
16893 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
16894 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
16895 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
16896 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
16897 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
16898 include/Makefile:build/top.mk:include/Makefile.in \
16899 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
16900 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
16901 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
16902 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
16903 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
16904 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
16905 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
16906 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
16907 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
16908 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk    \
16909 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
16910 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
16911 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
16912 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
16913 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
16914 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
16915 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
16916 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
16917 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
16918 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
16919 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
16920 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
16921 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
16922 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
16923 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
16924 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
16925 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
16926 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
16927 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
16928 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
16929  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
16930 EOF
16931 cat >> $CONFIG_STATUS <<EOF
16932
16933 # Protect against being on the right side of a sed subst in config.status.
16934 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
16935  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
16936 $ac_vpsub
16937 $extrasub
16938 s%@SHELL@%$SHELL%g
16939 s%@CFLAGS@%$CFLAGS%g
16940 s%@CPPFLAGS@%$CPPFLAGS%g
16941 s%@CXXFLAGS@%$CXXFLAGS%g
16942 s%@FFLAGS@%$FFLAGS%g
16943 s%@DEFS@%$DEFS%g
16944 s%@LDFLAGS@%$LDFLAGS%g
16945 s%@LIBS@%$LIBS%g
16946 s%@exec_prefix@%$exec_prefix%g
16947 s%@prefix@%$prefix%g
16948 s%@program_transform_name@%$program_transform_name%g
16949 s%@bindir@%$bindir%g
16950 s%@sbindir@%$sbindir%g
16951 s%@libexecdir@%$libexecdir%g
16952 s%@datadir@%$datadir%g
16953 s%@sysconfdir@%$sysconfdir%g
16954 s%@sharedstatedir@%$sharedstatedir%g
16955 s%@localstatedir@%$localstatedir%g
16956 s%@libdir@%$libdir%g
16957 s%@includedir@%$includedir%g
16958 s%@oldincludedir@%$oldincludedir%g
16959 s%@infodir@%$infodir%g
16960 s%@mandir@%$mandir%g
16961 s%@host@%$host%g
16962 s%@host_alias@%$host_alias%g
16963 s%@host_cpu@%$host_cpu%g
16964 s%@host_vendor@%$host_vendor%g
16965 s%@host_os@%$host_os%g
16966 s%@target@%$target%g
16967 s%@target_alias@%$target_alias%g
16968 s%@target_cpu@%$target_cpu%g
16969 s%@target_vendor@%$target_vendor%g
16970 s%@target_os@%$target_os%g
16971 s%@build@%$build%g
16972 s%@build_alias@%$build_alias%g
16973 s%@build_cpu@%$build_cpu%g
16974 s%@build_vendor@%$build_vendor%g
16975 s%@build_os@%$build_os%g
16976 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
16977 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
16978 s%@INSTALL_DATA@%$INSTALL_DATA%g
16979 s%@PACKAGE@%$PACKAGE%g
16980 s%@VERSION@%$VERSION%g
16981 s%@ACLOCAL@%$ACLOCAL%g
16982 s%@AUTOCONF@%$AUTOCONF%g
16983 s%@AUTOMAKE@%$AUTOMAKE%g
16984 s%@AUTOHEADER@%$AUTOHEADER%g
16985 s%@MAKEINFO@%$MAKEINFO%g
16986 s%@install_sh@%$install_sh%g
16987 s%@AMTAR@%$AMTAR%g
16988 s%@AWK@%$AWK%g
16989 s%@AMTARFLAGS@%$AMTARFLAGS%g
16990 s%@SET_MAKE@%$SET_MAKE%g
16991 s%@OPENLDAP_LIBVERSION@%$OPENLDAP_LIBVERSION%g
16992 s%@top_builddir@%$top_builddir%g
16993 s%@ldap_subdir@%$ldap_subdir%g
16994 s%@CC@%$CC%g
16995 s%@RANLIB@%$RANLIB%g
16996 s%@LN_S@%$LN_S%g
16997 s%@DLLTOOL@%$DLLTOOL%g
16998 s%@AS@%$AS%g
16999 s%@OBJDUMP@%$OBJDUMP%g
17000 s%@LIBTOOL@%$LIBTOOL%g
17001 s%@LN_H@%$LN_H%g
17002 s%@SENDMAIL@%$SENDMAIL%g
17003 s%@EDITOR@%$EDITOR%g
17004 s%@FINGER@%$FINGER%g
17005 s%@PERLBIN@%$PERLBIN%g
17006 s%@CPP@%$CPP%g
17007 s%@EXEEXT@%$EXEEXT%g
17008 s%@OBJEXT@%$OBJEXT%g
17009 s%@OL_MKDEP@%$OL_MKDEP%g
17010 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
17011 s%@LIBOBJS@%$LIBOBJS%g
17012 s%@LIBSRCS@%$LIBSRCS%g
17013 s%@PLAT@%$PLAT%g
17014 s%@LIB_LINKAGE@%$LIB_LINKAGE%g
17015 s%@LT_LIB_LINKAGE@%$LT_LIB_LINKAGE%g
17016 s%@DYN_EXT@%$DYN_EXT%g
17017 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
17018 s%@BUILD_BDB@%$BUILD_BDB%g
17019 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
17020 s%@BUILD_LDAP@%$BUILD_LDAP%g
17021 s%@BUILD_LDBM@%$BUILD_LDBM%g
17022 s%@BUILD_META@%$BUILD_META%g
17023 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
17024 s%@BUILD_PERL@%$BUILD_PERL%g
17025 s%@BUILD_SHELL@%$BUILD_SHELL%g
17026 s%@BUILD_SQL@%$BUILD_SQL%g
17027 s%@BUILD_TCL@%$BUILD_TCL%g
17028 s%@BUILD_BDB_DYNAMIC@%$BUILD_BDB_DYNAMIC%g
17029 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
17030 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
17031 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
17032 s%@BUILD_META_DYNAMIC@%$BUILD_META_DYNAMIC%g
17033 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
17034 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
17035 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
17036 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
17037 s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
17038 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
17039 s%@LDAP_LIBS@%$LDAP_LIBS%g
17040 s%@LDIF_LIBS@%$LDIF_LIBS%g
17041 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
17042 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
17043 s%@LDBM_LIBS@%$LDBM_LIBS%g
17044 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
17045 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
17046 s%@WRAP_LIBS@%$WRAP_LIBS%g
17047 s%@MOD_TCL_LIB@%$MOD_TCL_LIB%g
17048 s%@LINK_BINS_DYNAMIC@%$LINK_BINS_DYNAMIC%g
17049 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
17050 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
17051 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
17052 s%@PERL_CPPFLAGS@%$PERL_CPPFLAGS%g
17053 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
17054 s%@MOD_PERL_LDFLAGS@%$MOD_PERL_LDFLAGS%g
17055 s%@KRB4_LIBS@%$KRB4_LIBS%g
17056 s%@KRB5_LIBS@%$KRB5_LIBS%g
17057 s%@READLINE_LIBS@%$READLINE_LIBS%g
17058 s%@SASL_LIBS@%$SASL_LIBS%g
17059 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
17060 s%@TLS_LIBS@%$TLS_LIBS%g
17061 s%@MODULES_LIBS@%$MODULES_LIBS%g
17062 s%@AUTH_LIBS@%$AUTH_LIBS%g
17063 s%@SLAPD_SLP_LIBS@%$SLAPD_SLP_LIBS%g
17064 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
17065 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
17066 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
17067
17068 CEOF
17069 EOF
17070
17071 cat >> $CONFIG_STATUS <<\EOF
17072
17073 # Split the substitutions into bite-sized pieces for seds with
17074 # small command number limits, like on Digital OSF/1 and HP-UX.
17075 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
17076 ac_file=1 # Number of current file.
17077 ac_beg=1 # First line for current file.
17078 ac_end=$ac_max_sed_cmds # Line after last line for current file.
17079 ac_more_lines=:
17080 ac_sed_cmds=""
17081 while $ac_more_lines; do
17082   if test $ac_beg -gt 1; then
17083     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
17084   else
17085     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
17086   fi
17087   if test ! -s conftest.s$ac_file; then
17088     ac_more_lines=false
17089     rm -f conftest.s$ac_file
17090   else
17091     if test -z "$ac_sed_cmds"; then
17092       ac_sed_cmds="sed -f conftest.s$ac_file"
17093     else
17094       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
17095     fi
17096     ac_file=`expr $ac_file + 1`
17097     ac_beg=$ac_end
17098     ac_end=`expr $ac_end + $ac_max_sed_cmds`
17099   fi
17100 done
17101 if test -z "$ac_sed_cmds"; then
17102   ac_sed_cmds=cat
17103 fi
17104 EOF
17105
17106 cat >> $CONFIG_STATUS <<EOF
17107
17108 CONFIG_FILES=\${CONFIG_FILES-"\
17109 Makefile:build/top.mk:Makefile.in:build/dir.mk \
17110 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
17111 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
17112 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
17113 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
17114 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
17115 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
17116 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
17117 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
17118 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
17119 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
17120 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
17121 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
17122 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
17123 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
17124 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
17125 include/Makefile:build/top.mk:include/Makefile.in \
17126 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
17127 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
17128 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17129 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17130 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
17131 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
17132 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
17133 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
17134 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
17135 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk    \
17136 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
17137 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
17138 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
17139 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
17140 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
17141 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
17142 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
17143 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
17144 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
17145 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
17146 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
17147 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
17148 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
17149 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
17150 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
17151 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
17152 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
17153 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
17154 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
17155 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
17156 "}
17157 EOF
17158 cat >> $CONFIG_STATUS <<\EOF
17159 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
17160   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17161   case "$ac_file" in
17162   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
17163        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
17164   *) ac_file_in="${ac_file}.in" ;;
17165   esac
17166
17167   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
17168
17169   # Remove last slash and all that follows it.  Not all systems have dirname.
17170   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
17171   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17172     # The file is in a subdirectory.
17173     test ! -d "$ac_dir" && mkdir "$ac_dir"
17174     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
17175     # A "../" for each directory in $ac_dir_suffix.
17176     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
17177   else
17178     ac_dir_suffix= ac_dots=
17179   fi
17180
17181   case "$ac_given_srcdir" in
17182   .)  srcdir=.
17183       if test -z "$ac_dots"; then top_srcdir=.
17184       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
17185   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
17186   *) # Relative path.
17187     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
17188     top_srcdir="$ac_dots$ac_given_srcdir" ;;
17189   esac
17190
17191   case "$ac_given_INSTALL" in
17192   [/$]*) INSTALL="$ac_given_INSTALL" ;;
17193   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
17194   esac
17195
17196   echo creating "$ac_file"
17197   rm -f "$ac_file"
17198   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
17199   case "$ac_file" in
17200   *[Mm]akefile*) ac_comsub="1i\\
17201 # $configure_input" ;;
17202   *) ac_comsub= ;;
17203   esac
17204
17205   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
17206   sed -e "$ac_comsub
17207 s%@configure_input@%$configure_input%g
17208 s%@srcdir@%$srcdir%g
17209 s%@top_srcdir@%$top_srcdir%g
17210 s%@INSTALL@%$INSTALL%g
17211 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
17212 fi; done
17213 rm -f conftest.s*
17214
17215 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
17216 # NAME is the cpp macro being defined and VALUE is the value it is being given.
17217 #
17218 # ac_d sets the value in "#define NAME VALUE" lines.
17219 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
17220 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
17221 ac_dC='\3'
17222 ac_dD='%g'
17223 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
17224 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17225 ac_uB='\([      ]\)%\1#\2define\3'
17226 ac_uC=' '
17227 ac_uD='\4%g'
17228 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
17229 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17230 ac_eB='$%\1#\2define\3'
17231 ac_eC=' '
17232 ac_eD='%g'
17233
17234 if test "${CONFIG_HEADERS+set}" != set; then
17235 EOF
17236 cat >> $CONFIG_STATUS <<EOF
17237   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
17238 EOF
17239 cat >> $CONFIG_STATUS <<\EOF
17240 fi
17241 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
17242   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17243   case "$ac_file" in
17244   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
17245        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
17246   *) ac_file_in="${ac_file}.in" ;;
17247   esac
17248
17249   echo creating $ac_file
17250
17251   rm -f conftest.frag conftest.in conftest.out
17252   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
17253   cat $ac_file_inputs > conftest.in
17254
17255 EOF
17256
17257 # Transform confdefs.h into a sed script conftest.vals that substitutes
17258 # the proper values into config.h.in to produce config.h.  And first:
17259 # Protect against being on the right side of a sed subst in config.status.
17260 # Protect against being in an unquoted here document in config.status.
17261 rm -f conftest.vals
17262 cat > conftest.hdr <<\EOF
17263 s/[\\&%]/\\&/g
17264 s%[\\$`]%\\&%g
17265 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
17266 s%ac_d%ac_u%gp
17267 s%ac_u%ac_e%gp
17268 EOF
17269 sed -n -f conftest.hdr confdefs.h > conftest.vals
17270 rm -f conftest.hdr
17271
17272 # This sed command replaces #undef with comments.  This is necessary, for
17273 # example, in the case of _POSIX_SOURCE, which is predefined and required
17274 # on some systems where configure will not decide to define it.
17275 cat >> conftest.vals <<\EOF
17276 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
17277 EOF
17278
17279 # Break up conftest.vals because some shells have a limit on
17280 # the size of here documents, and old seds have small limits too.
17281
17282 rm -f conftest.tail
17283 while :
17284 do
17285   ac_lines=`grep -c . conftest.vals`
17286   # grep -c gives empty output for an empty file on some AIX systems.
17287   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
17288   # Write a limited-size here document to conftest.frag.
17289   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
17290   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
17291   echo 'CEOF
17292   sed -f conftest.frag conftest.in > conftest.out
17293   rm -f conftest.in
17294   mv conftest.out conftest.in
17295 ' >> $CONFIG_STATUS
17296   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
17297   rm -f conftest.vals
17298   mv conftest.tail conftest.vals
17299 done
17300 rm -f conftest.vals
17301
17302 cat >> $CONFIG_STATUS <<\EOF
17303   rm -f conftest.frag conftest.h
17304   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
17305   cat conftest.in >> conftest.h
17306   rm -f conftest.in
17307   if cmp -s $ac_file conftest.h 2>/dev/null; then
17308     echo "$ac_file is unchanged"
17309     rm -f conftest.h
17310   else
17311     # Remove last slash and all that follows it.  Not all systems have dirname.
17312       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
17313       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17314       # The file is in a subdirectory.
17315       test ! -d "$ac_dir" && mkdir "$ac_dir"
17316     fi
17317     rm -f $ac_file
17318     mv conftest.h $ac_file
17319   fi
17320 fi; done
17321
17322 EOF
17323 cat >> $CONFIG_STATUS <<EOF
17324
17325 EOF
17326 cat >> $CONFIG_STATUS <<\EOF
17327
17328 date > stamp-h
17329 echo Please \"make depend\" to build dependencies
17330
17331 exit 0
17332 EOF
17333 chmod +x $CONFIG_STATUS
17334 rm -fr confdefs* $ac_clean_files
17335 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
17336