]> git.sur5r.net Git - openldap/blob - configure
Add experimental detection of BerkeleyDB2 DB_THREAD.
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.258 1999/09/13 16:31:39 kdz Exp  
4
5 # Copyright 1998,1999 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-1999 The OpenLDAP Foundation,  All Rights Reserved."
13 echo "Copying restrictions apply, see COPYRIGHT file."
14
15 # Guess values for system-dependent variables and create Makefiles.
16 # Generated automatically using autoconf version 2.13.1 
17 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
18 #
19 # This configure script is free software; the Free Software Foundation
20 # gives unlimited permission to copy, distribute and modify it.
21
22 # Defaults:
23 ac_help=
24 ac_default_prefix=/usr/local
25 # Any additions from configure.in:
26 ac_default_prefix=/usr/local
27 ac_help="$ac_help
28   --with-subdir=DIR change default subdirectory used for installs"
29 ac_help="$ac_help
30   --enable-debug        enable debugging (yes)"
31 ac_help="$ac_help
32   --enable-syslog       enable syslog support (auto)"
33 ac_help="$ac_help
34   --enable-proctitle    enable proctitle support (yes)"
35 ac_help="$ac_help
36   --enable-cache        enable caching (yes)"
37 ac_help="$ac_help
38   --enable-dns          enable V2 DX Referrals extension (no)"
39 ac_help="$ac_help
40   --enable-referrals    enable V2 Referrals extension (yes)"
41 ac_help="$ac_help
42   --enable-cldap        enable connectionless ldap (no)"
43 ac_help="$ac_help
44   --enable-x-compile    enable cross compiling (no)"
45 ac_help="$ac_help
46   --enable-dmalloc      enable debug malloc support (no)"
47 ac_help="$ac_help
48   --with-cyrus-sasl     with Cyrus SASL support (auto)"
49 ac_help="$ac_help
50   --with-fetch          with fetch URL support (auto)"
51 ac_help="$ac_help
52   --with-kerberos       with Kerberos support (auto)"
53 ac_help="$ac_help
54   --with-readline       with readline support (auto)"
55 ac_help="$ac_help
56   --with-threads        use threads (auto)"
57 ac_help="$ac_help
58   --with-tls            with TLS/SSL support (auto)"
59 ac_help="$ac_help
60   --with-yielding-select        with implicitly yielding select (auto)"
61 ac_help="$ac_help
62 LDAPD (X.500-to-LDAP Gateway) Options:"
63 ac_help="$ac_help
64   --enable-ldapd        enable building ldapd (no)"
65 ac_help="$ac_help
66 SLAPD (Standalone LDAP Daemon) Options:"
67 ac_help="$ac_help
68   --enable-slapd        enable building slapd (yes)"
69 ac_help="$ac_help
70     --enable-cleartext  enable cleartext passwords (yes)"
71 ac_help="$ac_help
72     --enable-crypt      enable crypt(3) passwords (auto)"
73 ac_help="$ac_help
74     --enable-modules    enable dynamic module support (no)"
75 ac_help="$ac_help
76     --enable-multimaster        enable multimaster replication (no)"
77 ac_help="$ac_help
78     --enable-phonetic   enable phonetic/soundex (no)"
79 ac_help="$ac_help
80     --enable-quipu      build quipu migration tools (no)"
81 ac_help="$ac_help
82     --enable-rlookups   enable reverse lookups (auto)"
83 ac_help="$ac_help
84     --enable-aci        enable per-object ACIs (no)"
85 ac_help="$ac_help
86     --enable-discreteaci        enable discrete rights in ACIs (no)"
87 ac_help="$ac_help
88     --enable-wrappers   enable tcp wrapper support (no)"
89 ac_help="$ac_help
90     --enable-bdb2       enable bdb2 backend (no)"
91 ac_help="$ac_help
92       --with-bdb2-module        module type (static)"
93 ac_help="$ac_help
94     --enable-ldap       enable ldap backend (no)"
95 ac_help="$ac_help
96       --with-ldap-module        module type (static)"
97 ac_help="$ac_help
98     --enable-ldbm       enable ldbm backend (yes)"
99 ac_help="$ac_help
100       --with-ldbm-api   use LDBM API (auto)"
101 ac_help="$ac_help
102       --with-ldbm-module        module type (static)"
103 ac_help="$ac_help
104       --with-ldbm-type  use LDBM type (auto)"
105 ac_help="$ac_help
106     --enable-passwd     enable passwd backend (no)"
107 ac_help="$ac_help
108       --with-passwd-module      module type (static)"
109 ac_help="$ac_help
110     --enable-perl       enable perl backend (no)"
111 ac_help="$ac_help
112       --with-perl-module        module type (static)"
113 ac_help="$ac_help
114     --enable-shell      enable shell backend (no)"
115 ac_help="$ac_help
116       --with-shell-module       module type (static)"
117 ac_help="$ac_help
118     --enable-tcl        enable tcl backend (no)"
119 ac_help="$ac_help
120       --with-tcl-module module type (static)"
121 ac_help="$ac_help
122 SLURPD (Replication Daemon) Options:"
123 ac_help="$ac_help
124   --enable-slurpd       enable building slurpd (auto)"
125 ac_help="$ac_help
126 Library Generation & Linking Options"
127 ac_help="$ac_help
128   --enable-static[=PKGS]  build static libraries [default=yes]"
129 ac_help="$ac_help
130   --enable-shared[=PKGS]  build shared libraries [default=yes]"
131 ac_help="$ac_help
132   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
133 ac_help="$ac_help
134   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
135 ac_help="$ac_help
136   --disable-libtool-lock  avoid locking (might break parallel builds)"
137
138 # Initialize some variables set by options.
139 # The variables have the same names as the options, with
140 # dashes changed to underlines.
141 build=NONE
142 cache_file=./config.cache
143 exec_prefix=NONE
144 host=NONE
145 no_create=
146 nonopt=NONE
147 no_recursion=
148 prefix=NONE
149 program_prefix=NONE
150 program_suffix=NONE
151 program_transform_name=s,x,x,
152 silent=
153 site=
154 srcdir=
155 target=NONE
156 verbose=
157 x_includes=NONE
158 x_libraries=NONE
159 bindir='${exec_prefix}/bin'
160 sbindir='${exec_prefix}/sbin'
161 libexecdir='${exec_prefix}/libexec'
162 datadir='${prefix}/share'
163 sysconfdir='${prefix}/etc'
164 sharedstatedir='${prefix}/com'
165 localstatedir='${prefix}/var'
166 libdir='${exec_prefix}/lib'
167 includedir='${prefix}/include'
168 oldincludedir='/usr/include'
169 infodir='${prefix}/info'
170 mandir='${prefix}/man'
171
172 # Initialize some other variables.
173 subdirs=
174 MFLAGS= MAKEFLAGS=
175 SHELL=${CONFIG_SHELL-/bin/sh}
176 # Maximum number of lines to put in a shell here document.
177 ac_max_here_lines=12
178
179 ac_prev=
180 for ac_option
181 do
182
183   # If the previous option needs an argument, assign it.
184   if test -n "$ac_prev"; then
185     eval "$ac_prev=\$ac_option"
186     ac_prev=
187     continue
188   fi
189
190   case "$ac_option" in
191   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
192   *) ac_optarg= ;;
193   esac
194
195   # Accept the important Cygnus configure options, so we can diagnose typos.
196
197   case "$ac_option" in
198
199   -bindir | --bindir | --bindi | --bind | --bin | --bi)
200     ac_prev=bindir ;;
201   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
202     bindir="$ac_optarg" ;;
203
204   -build | --build | --buil | --bui | --bu)
205     ac_prev=build ;;
206   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
207     build="$ac_optarg" ;;
208
209   -cache-file | --cache-file | --cache-fil | --cache-fi \
210   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
211     ac_prev=cache_file ;;
212   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
213   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
214     cache_file="$ac_optarg" ;;
215
216   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
217     ac_prev=datadir ;;
218   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
219   | --da=*)
220     datadir="$ac_optarg" ;;
221
222   -disable-* | --disable-*)
223     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
224     # Reject names that are not valid shell variable names.
225     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
226       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
227     fi
228     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
229     eval "enable_${ac_feature}=no" ;;
230
231   -enable-* | --enable-*)
232     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
233     # Reject names that are not valid shell variable names.
234     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
235       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
236     fi
237     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
238     case "$ac_option" in
239       *=*) ;;
240       *) ac_optarg=yes ;;
241     esac
242     eval "enable_${ac_feature}='$ac_optarg'" ;;
243
244   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
245   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
246   | --exec | --exe | --ex)
247     ac_prev=exec_prefix ;;
248   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
249   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
250   | --exec=* | --exe=* | --ex=*)
251     exec_prefix="$ac_optarg" ;;
252
253   -gas | --gas | --ga | --g)
254     # Obsolete; use --with-gas.
255     with_gas=yes ;;
256
257   -help | --help | --hel | --he)
258     # Omit some internal or obsolete options to make the list less imposing.
259     # This message is too long to be a string in the A/UX 3.1 sh.
260     cat << EOF
261 Usage: configure [options] [host]
262 Options: [defaults in brackets after descriptions]
263 Configuration:
264   --cache-file=FILE       cache test results in FILE
265   --help                  print this message
266   --no-create             do not create output files
267   --quiet, --silent       do not print \`checking...' messages
268   --version               print the version of autoconf that created configure
269 Directory and file names:
270   --prefix=PREFIX         install architecture-independent files in PREFIX
271                           [$ac_default_prefix]
272   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
273                           [same as prefix]
274   --bindir=DIR            user executables in DIR [EPREFIX/bin]
275   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
276   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
277   --datadir=DIR           read-only architecture-independent data in DIR
278                           [PREFIX/share]
279   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
280   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
281                           [PREFIX/com]
282   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
283   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
284   --includedir=DIR        C header files in DIR [PREFIX/include]
285   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
286   --infodir=DIR           info documentation in DIR [PREFIX/info]
287   --mandir=DIR            man documentation in DIR [PREFIX/man]
288   --srcdir=DIR            find the sources in DIR [configure dir or ..]
289   --program-prefix=PREFIX prepend PREFIX to installed program names
290   --program-suffix=SUFFIX append SUFFIX to installed program names
291   --program-transform-name=PROGRAM
292                           run sed PROGRAM on installed program names
293 EOF
294     cat << EOF
295 Host type:
296   --build=BUILD           configure for building on BUILD [BUILD=HOST]
297   --host=HOST             configure for HOST [guessed]
298   --target=TARGET         configure for TARGET [TARGET=HOST]
299 Features and packages:
300   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
301   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
302   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
303   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
304   --x-includes=DIR        X include files are in DIR
305   --x-libraries=DIR       X library files are in DIR
306 EOF
307     if test -n "$ac_help"; then
308       echo "--enable and --with options recognized:$ac_help"
309     fi
310     exit 0 ;;
311
312   -host | --host | --hos | --ho)
313     ac_prev=host ;;
314   -host=* | --host=* | --hos=* | --ho=*)
315     host="$ac_optarg" ;;
316
317   -includedir | --includedir | --includedi | --included | --include \
318   | --includ | --inclu | --incl | --inc)
319     ac_prev=includedir ;;
320   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
321   | --includ=* | --inclu=* | --incl=* | --inc=*)
322     includedir="$ac_optarg" ;;
323
324   -infodir | --infodir | --infodi | --infod | --info | --inf)
325     ac_prev=infodir ;;
326   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
327     infodir="$ac_optarg" ;;
328
329   -libdir | --libdir | --libdi | --libd)
330     ac_prev=libdir ;;
331   -libdir=* | --libdir=* | --libdi=* | --libd=*)
332     libdir="$ac_optarg" ;;
333
334   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
335   | --libexe | --libex | --libe)
336     ac_prev=libexecdir ;;
337   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
338   | --libexe=* | --libex=* | --libe=*)
339     libexecdir="$ac_optarg" ;;
340
341   -localstatedir | --localstatedir | --localstatedi | --localstated \
342   | --localstate | --localstat | --localsta | --localst \
343   | --locals | --local | --loca | --loc | --lo)
344     ac_prev=localstatedir ;;
345   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
346   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
347   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
348     localstatedir="$ac_optarg" ;;
349
350   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
351     ac_prev=mandir ;;
352   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
353     mandir="$ac_optarg" ;;
354
355   -nfp | --nfp | --nf)
356     # Obsolete; use --without-fp.
357     with_fp=no ;;
358
359   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
360   | --no-cr | --no-c)
361     no_create=yes ;;
362
363   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
364   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
365     no_recursion=yes ;;
366
367   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
368   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
369   | --oldin | --oldi | --old | --ol | --o)
370     ac_prev=oldincludedir ;;
371   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
372   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
373   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
374     oldincludedir="$ac_optarg" ;;
375
376   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
377     ac_prev=prefix ;;
378   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
379     prefix="$ac_optarg" ;;
380
381   -program-prefix | --program-prefix | --program-prefi | --program-pref \
382   | --program-pre | --program-pr | --program-p)
383     ac_prev=program_prefix ;;
384   -program-prefix=* | --program-prefix=* | --program-prefi=* \
385   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
386     program_prefix="$ac_optarg" ;;
387
388   -program-suffix | --program-suffix | --program-suffi | --program-suff \
389   | --program-suf | --program-su | --program-s)
390     ac_prev=program_suffix ;;
391   -program-suffix=* | --program-suffix=* | --program-suffi=* \
392   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
393     program_suffix="$ac_optarg" ;;
394
395   -program-transform-name | --program-transform-name \
396   | --program-transform-nam | --program-transform-na \
397   | --program-transform-n | --program-transform- \
398   | --program-transform | --program-transfor \
399   | --program-transfo | --program-transf \
400   | --program-trans | --program-tran \
401   | --progr-tra | --program-tr | --program-t)
402     ac_prev=program_transform_name ;;
403   -program-transform-name=* | --program-transform-name=* \
404   | --program-transform-nam=* | --program-transform-na=* \
405   | --program-transform-n=* | --program-transform-=* \
406   | --program-transform=* | --program-transfor=* \
407   | --program-transfo=* | --program-transf=* \
408   | --program-trans=* | --program-tran=* \
409   | --progr-tra=* | --program-tr=* | --program-t=*)
410     program_transform_name="$ac_optarg" ;;
411
412   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
413   | -silent | --silent | --silen | --sile | --sil)
414     silent=yes ;;
415
416   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
417     ac_prev=sbindir ;;
418   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
419   | --sbi=* | --sb=*)
420     sbindir="$ac_optarg" ;;
421
422   -sharedstatedir | --sharedstatedir | --sharedstatedi \
423   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
424   | --sharedst | --shareds | --shared | --share | --shar \
425   | --sha | --sh)
426     ac_prev=sharedstatedir ;;
427   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
428   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
429   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
430   | --sha=* | --sh=*)
431     sharedstatedir="$ac_optarg" ;;
432
433   -site | --site | --sit)
434     ac_prev=site ;;
435   -site=* | --site=* | --sit=*)
436     site="$ac_optarg" ;;
437
438   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
439     ac_prev=srcdir ;;
440   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
441     srcdir="$ac_optarg" ;;
442
443   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
444   | --syscon | --sysco | --sysc | --sys | --sy)
445     ac_prev=sysconfdir ;;
446   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
447   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
448     sysconfdir="$ac_optarg" ;;
449
450   -target | --target | --targe | --targ | --tar | --ta | --t)
451     ac_prev=target ;;
452   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
453     target="$ac_optarg" ;;
454
455   -v | -verbose | --verbose | --verbos | --verbo | --verb)
456     verbose=yes ;;
457
458   -version | --version | --versio | --versi | --vers)
459     echo "configure generated by autoconf version 2.13.1"
460     exit 0 ;;
461
462   -with-* | --with-*)
463     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
464     # Reject names that are not valid shell variable names.
465     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
466       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
467     fi
468     ac_package=`echo $ac_package| sed 's/-/_/g'`
469     case "$ac_option" in
470       *=*) ;;
471       *) ac_optarg=yes ;;
472     esac
473     eval "with_${ac_package}='$ac_optarg'" ;;
474
475   -without-* | --without-*)
476     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
477     # Reject names that are not valid shell variable names.
478     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
479       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
480     fi
481     ac_package=`echo $ac_package| sed 's/-/_/g'`
482     eval "with_${ac_package}=no" ;;
483
484   --x)
485     # Obsolete; use --with-x.
486     with_x=yes ;;
487
488   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
489   | --x-incl | --x-inc | --x-in | --x-i)
490     ac_prev=x_includes ;;
491   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
492   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
493     x_includes="$ac_optarg" ;;
494
495   -x-libraries | --x-libraries | --x-librarie | --x-librari \
496   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
497     ac_prev=x_libraries ;;
498   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
499   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
500     x_libraries="$ac_optarg" ;;
501
502   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
503     ;;
504
505   *)
506     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
507       echo "configure: warning: $ac_option: invalid host type" 1>&2
508     fi
509     if test "x$nonopt" != xNONE; then
510       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
511     fi
512     nonopt="$ac_option"
513     ;;
514
515   esac
516 done
517
518 if test -n "$ac_prev"; then
519   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
520 fi
521
522 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
523
524 # File descriptor usage:
525 # 0 standard input
526 # 1 file creation
527 # 2 errors and warnings
528 # 3 some systems may open it to /dev/tty
529 # 4 used on the Kubota Titan
530 # 6 checking for... messages and results
531 # 5 compiler messages saved in config.log
532 if test "$silent" = yes; then
533   exec 6>/dev/null
534 else
535   exec 6>&1
536 fi
537 exec 5>./config.log
538
539 echo "\
540 This file contains any messages produced by compilers while
541 running configure, to aid debugging if configure makes a mistake.
542 " 1>&5
543
544 # Strip out --no-create and --no-recursion so they do not pile up.
545 # Also quote any args containing shell metacharacters.
546 ac_configure_args=
547 for ac_arg
548 do
549   case "$ac_arg" in
550   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
551   | --no-cr | --no-c) ;;
552   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
553   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
554   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
555   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
556   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
557   esac
558 done
559
560 # NLS nuisances.
561 # Only set these to C if already set.  These must not be set unconditionally
562 # because not all systems understand e.g. LANG=C (notably SCO).
563 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
564 # Non-C LC_CTYPE values break the ctype check.
565 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
566 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
567 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
568 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
569
570 # confdefs.h avoids OS command line length limits that DEFS can exceed.
571 rm -rf conftest* confdefs.h
572 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
573 echo > confdefs.h
574
575 # A filename unique to this package, relative to the directory that
576 # configure is in, which we can look for to find out if srcdir is correct.
577 ac_unique_file=build/version
578
579 # Find the source files, if location was not specified.
580 if test -z "$srcdir"; then
581   ac_srcdir_defaulted=yes
582   # Try the directory containing this script, then its parent.
583   ac_prog=$0
584   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
585   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
586   srcdir=$ac_confdir
587   if test ! -r $srcdir/$ac_unique_file; then
588     srcdir=..
589   fi
590 else
591   ac_srcdir_defaulted=no
592 fi
593 if test ! -r $srcdir/$ac_unique_file; then
594   if test "$ac_srcdir_defaulted" = yes; then
595     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
596   else
597     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
598   fi
599 fi
600 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
601
602 # Prefer explicitly selected file to automatically selected ones.
603 if test -z "$CONFIG_SITE"; then
604   if test "x$prefix" != xNONE; then
605     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
606   else
607     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
608   fi
609 fi
610 for ac_site_file in $CONFIG_SITE; do
611   if test -r "$ac_site_file"; then
612     echo "loading site script $ac_site_file"
613     . "$ac_site_file"
614   fi
615 done
616
617
618 ac_ext=c
619 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
620 ac_cpp='$CPP $CPPFLAGS'
621 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
622 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
623 cross_compiling=$ac_cv_prog_cc_cross
624
625 ac_exeext=
626 ac_objext=o
627 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
628   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
629   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
630     ac_n= ac_c='
631 ' ac_t='        '
632   else
633     ac_n=-n ac_c= ac_t=
634   fi
635 else
636   ac_n= ac_c='\c' ac_t=
637 fi
638
639 ac_aux_dir=
640 for ac_dir in build $srcdir/build; do
641   if test -f $ac_dir/install-sh; then
642     ac_aux_dir=$ac_dir
643     ac_install_sh="$ac_aux_dir/install-sh -c"
644     break
645   elif test -f $ac_dir/install.sh; then
646     ac_aux_dir=$ac_dir
647     ac_install_sh="$ac_aux_dir/install.sh -c"
648     break
649   fi
650 done
651 if test -z "$ac_aux_dir"; then
652   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
653 fi
654 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
655 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
656 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
657
658 OL_VERSION=`cat $ac_aux_dir/version`
659 if test -z "$OL_VERSION"; then
660         { echo "configure: error: could not determine version" 1>&2; exit 1; }
661 fi
662
663 echo "Configuring OpenLDAP $OL_VERSION ..."
664
665
666 echo $ac_n "checking host system type""... $ac_c" 1>&6
667 echo "configure:668: checking host system type" >&5
668 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
669
670 # Make sure we can run config.sub.
671   if $ac_config_sub sun4 >/dev/null 2>&1; then :
672     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
673   fi
674
675   ac_cv_host_alias=$host
676   case "$ac_cv_host_alias" in
677   NONE)
678     case $nonopt in
679     NONE)
680       if ac_cv_host_alias=`$ac_config_guess`; then :
681       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
682       fi ;;
683     *) ac_cv_host_alias=$nonopt ;;
684     esac ;;
685   esac
686
687   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
688   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
689   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
690   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
691 else
692   echo $ac_n "(cached) $ac_c" 1>&6
693 fi
694
695 echo "$ac_t""$ac_cv_host" 1>&6
696
697 host=$ac_cv_host
698 host_alias=$ac_cv_host_alias
699 host_cpu=$ac_cv_host_cpu
700 host_vendor=$ac_cv_host_vendor
701 host_os=$ac_cv_host_os
702
703
704
705
706
707 echo $ac_n "checking target system type""... $ac_c" 1>&6
708 echo "configure:709: checking target system type" >&5
709 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
710
711 # Make sure we can run config.sub.
712   if $ac_config_sub sun4 >/dev/null 2>&1; then :
713     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
714   fi
715
716   ac_cv_target_alias=$target
717   case "$ac_cv_target_alias" in
718   NONE)
719     case $nonopt in
720     NONE)
721       ac_cv_target_alias=$host_alias ;;
722
723     *) ac_cv_target_alias=$nonopt ;;
724     esac ;;
725   esac
726
727   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
728   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
729   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
730   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
731 else
732   echo $ac_n "(cached) $ac_c" 1>&6
733 fi
734
735 echo "$ac_t""$ac_cv_target" 1>&6
736
737 target=$ac_cv_target
738 target_alias=$ac_cv_target_alias
739 target_cpu=$ac_cv_target_cpu
740 target_vendor=$ac_cv_target_vendor
741 target_os=$ac_cv_target_os
742
743
744
745
746
747 echo $ac_n "checking build system type""... $ac_c" 1>&6
748 echo "configure:749: checking build system type" >&5
749 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
750
751 # Make sure we can run config.sub.
752   if $ac_config_sub sun4 >/dev/null 2>&1; then :
753     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
754   fi
755
756   ac_cv_build_alias=$build
757   case "$ac_cv_build_alias" in
758   NONE)
759     case $nonopt in
760     NONE)
761       ac_cv_build_alias=$host_alias ;;
762
763     *) ac_cv_build_alias=$nonopt ;;
764     esac ;;
765   esac
766
767   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
768   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
769   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
770   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
771 else
772   echo $ac_n "(cached) $ac_c" 1>&6
773 fi
774
775 echo "$ac_t""$ac_cv_build" 1>&6
776
777 build=$ac_cv_build
778 build_alias=$ac_cv_build_alias
779 build_cpu=$ac_cv_build_cpu
780 build_vendor=$ac_cv_build_vendor
781 build_os=$ac_cv_build_os
782
783
784
785
786
787 # Do some error checking and defaulting for the host and target type.
788 # The inputs are:
789 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
790 #
791 # The rules are:
792 # 1. You are not allowed to specify --host, --target, and nonopt at the
793 #    same time.
794 # 2. Host defaults to nonopt.
795 # 3. If nonopt is not specified, then host defaults to the current host,
796 #    as determined by config.guess.
797 # 4. Target and build default to nonopt.
798 # 5. If nonopt is not specified, then target and build default to host.
799
800 # The aliases save the names the user supplied, while $host etc.
801 # will get canonicalized.
802 case $host---$target---$nonopt in
803 NONE---*---* | *---NONE---* | *---*---NONE) ;;
804 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
805 esac
806
807 test "$host_alias" != "$target_alias" &&
808   test "$program_prefix$program_suffix$program_transform_name" = \
809     NONENONEs,x,x, &&
810   program_prefix=${target_alias}-
811
812
813 # Find a good install program.  We prefer a C program (faster),
814 # so one script is as good as another.  But avoid the broken or
815 # incompatible versions:
816 # SysV /etc/install, /usr/sbin/install
817 # SunOS /usr/etc/install
818 # IRIX /sbin/install
819 # AIX /bin/install
820 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
821 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
822 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
823 # ./install, which can be erroneously created by make from ./install.sh.
824 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
825 echo "configure:826: checking for a BSD compatible install" >&5
826 if test -z "$INSTALL"; then
827 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
828   echo $ac_n "(cached) $ac_c" 1>&6
829 else
830     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
831   for ac_dir in $PATH; do
832     # Account for people who put trailing slashes in PATH elements.
833     case "$ac_dir/" in
834     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
835     *)
836       # OSF1 and SCO ODT 3.0 have their own names for install.
837       # Don't use installbsd from OSF since it installs stuff as root
838       # by default.
839       for ac_prog in ginstall scoinst install; do
840         if test -f $ac_dir/$ac_prog; then
841           if test $ac_prog = install &&
842             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
843             # AIX install.  It has an incompatible calling convention.
844             :
845           elif test $ac_prog = install &&
846             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
847             # program-specific install script used by HP pwplus--don't use.
848             :
849           else
850             ac_cv_path_install="$ac_dir/$ac_prog -c"
851             break 2
852           fi
853         fi
854       done
855       ;;
856     esac
857   done
858   IFS="$ac_save_IFS"
859
860 fi
861   if test "${ac_cv_path_install+set}" = set; then
862     INSTALL="$ac_cv_path_install"
863   else
864     # As a last resort, use the slow shell script.  We don't cache a
865     # path for INSTALL within a source directory, because that will
866     # break other packages using the cache if that directory is
867     # removed, or if the path is relative.
868     INSTALL="$ac_install_sh"
869   fi
870 fi
871 echo "$ac_t""$INSTALL" 1>&6
872
873 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
874 # It thinks the first close brace ends the variable substitution.
875 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
876
877 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
878
879 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
880
881 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
882 echo "configure:883: checking whether build environment is sane" >&5
883 # Just in case
884 sleep 1
885 echo timestamp > conftestfile
886 # Do `set' in a subshell so we don't clobber the current shell's
887 # arguments.  Must try -L first in case configure is actually a
888 # symlink; some systems play weird games with the mod time of symlinks
889 # (eg FreeBSD returns the mod time of the symlink's containing
890 # directory).
891 if (
892    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
893    if test "$*" = "X"; then
894       # -L didn't work.
895       set X `ls -t $srcdir/configure conftestfile`
896    fi
897    if test "$*" != "X $srcdir/configure conftestfile" \
898       && test "$*" != "X conftestfile $srcdir/configure"; then
899
900       # If neither matched, then we have a broken ls.  This can happen
901       # if, for instance, CONFIG_SHELL is bash and it inherits a
902       # broken ls alias from the environment.  This has actually
903       # happened.  Such a system could not be considered "sane".
904       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
905 alias in your environment" 1>&2; exit 1; }
906    fi
907
908    test "$2" = conftestfile
909    )
910 then
911    # Ok.
912    :
913 else
914    { echo "configure: error: newly created file is older than distributed files!
915 Check your system clock" 1>&2; exit 1; }
916 fi
917 rm -f conftest*
918 echo "$ac_t""yes" 1>&6
919 if test "$program_transform_name" = s,x,x,; then
920   program_transform_name=
921 else
922   # Double any \ or $.  echo might interpret backslashes.
923   cat <<\EOF_SED > conftestsed
924 s,\\,\\\\,g; s,\$,$$,g
925 EOF_SED
926   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
927   rm -f conftestsed
928 fi
929 test "$program_prefix" != NONE &&
930   program_transform_name="s,^,${program_prefix},;$program_transform_name"
931 # Use a double $ so make ignores it.
932 test "$program_suffix" != NONE &&
933   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
934
935 # sed with no file args requires a program.
936 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
937
938 for ac_prog in mawk gawk nawk awk
939 do
940 # Extract the first word of "$ac_prog", so it can be a program name with args.
941 set dummy $ac_prog; ac_word=$2
942 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
943 echo "configure:944: checking for $ac_word" >&5
944 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
945   echo $ac_n "(cached) $ac_c" 1>&6
946 else
947   if test -n "$AWK"; then
948   ac_cv_prog_AWK="$AWK" # Let the user override the test.
949 else
950   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
951   ac_dummy="$PATH"
952   for ac_dir in $ac_dummy; do
953     test -z "$ac_dir" && ac_dir=.
954     if test -f $ac_dir/$ac_word; then
955       ac_cv_prog_AWK="$ac_prog"
956       break
957     fi
958   done
959   IFS="$ac_save_ifs"
960 fi
961 fi
962 AWK="$ac_cv_prog_AWK"
963 if test -n "$AWK"; then
964   echo "$ac_t""$AWK" 1>&6
965 else
966   echo "$ac_t""no" 1>&6
967 fi
968
969 test -n "$AWK" && break
970 done
971
972 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
973 echo "configure:974: checking whether ${MAKE-make} sets \${MAKE}" >&5
974 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
975 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
976   echo $ac_n "(cached) $ac_c" 1>&6
977 else
978   cat > conftestmake <<\EOF
979 all:
980         @echo 'ac_maketemp="${MAKE}"'
981 EOF
982 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
983 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
984 if test -n "$ac_maketemp"; then
985   eval ac_cv_prog_make_${ac_make}_set=yes
986 else
987   eval ac_cv_prog_make_${ac_make}_set=no
988 fi
989 rm -f conftestmake
990 fi
991 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
992   echo "$ac_t""yes" 1>&6
993   SET_MAKE=
994 else
995   echo "$ac_t""no" 1>&6
996   SET_MAKE="MAKE=${MAKE-make}"
997 fi
998
999
1000
1001 PACKAGE=OpenLDAP
1002
1003 VERSION=$OL_VERSION
1004
1005 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1006   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1007 fi
1008
1009
1010
1011 missing_dir=`cd $ac_aux_dir && pwd`
1012 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1013 echo "configure:1014: checking for working aclocal" >&5
1014 # Run test in a subshell; some versions of sh will print an error if
1015 # an executable is not found, even if stderr is redirected.
1016 # Redirect stdin to placate older versions of autoconf.  Sigh.
1017 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1018    ACLOCAL=aclocal
1019    echo "$ac_t""found" 1>&6
1020 else
1021    ACLOCAL="$missing_dir/missing aclocal"
1022    echo "$ac_t""missing" 1>&6
1023 fi
1024
1025 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1026 echo "configure:1027: checking for working autoconf" >&5
1027 # Run test in a subshell; some versions of sh will print an error if
1028 # an executable is not found, even if stderr is redirected.
1029 # Redirect stdin to placate older versions of autoconf.  Sigh.
1030 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1031    AUTOCONF=autoconf
1032    echo "$ac_t""found" 1>&6
1033 else
1034    AUTOCONF="$missing_dir/missing autoconf"
1035    echo "$ac_t""missing" 1>&6
1036 fi
1037
1038 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1039 echo "configure:1040: checking for working automake" >&5
1040 # Run test in a subshell; some versions of sh will print an error if
1041 # an executable is not found, even if stderr is redirected.
1042 # Redirect stdin to placate older versions of autoconf.  Sigh.
1043 if (automake --version) < /dev/null > /dev/null 2>&1; then
1044    AUTOMAKE=automake
1045    echo "$ac_t""found" 1>&6
1046 else
1047    AUTOMAKE="$missing_dir/missing automake"
1048    echo "$ac_t""missing" 1>&6
1049 fi
1050
1051 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1052 echo "configure:1053: checking for working autoheader" >&5
1053 # Run test in a subshell; some versions of sh will print an error if
1054 # an executable is not found, even if stderr is redirected.
1055 # Redirect stdin to placate older versions of autoconf.  Sigh.
1056 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1057    AUTOHEADER=autoheader
1058    echo "$ac_t""found" 1>&6
1059 else
1060    AUTOHEADER="$missing_dir/missing autoheader"
1061    echo "$ac_t""missing" 1>&6
1062 fi
1063
1064 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1065 echo "configure:1066: checking for working makeinfo" >&5
1066 # Run test in a subshell; some versions of sh will print an error if
1067 # an executable is not found, even if stderr is redirected.
1068 # Redirect stdin to placate older versions of autoconf.  Sigh.
1069 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1070    MAKEINFO=makeinfo
1071    echo "$ac_t""found" 1>&6
1072 else
1073    MAKEINFO="$missing_dir/missing makeinfo"
1074    echo "$ac_t""missing" 1>&6
1075 fi
1076
1077 install_sh="$missing_dir/install-sh"
1078 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1079
1080 for ac_prog in gnutar gtar tar
1081 do
1082 # Extract the first word of "$ac_prog", so it can be a program name with args.
1083 set dummy $ac_prog; ac_word=$2
1084 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1085 echo "configure:1086: checking for $ac_word" >&5
1086 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1087   echo $ac_n "(cached) $ac_c" 1>&6
1088 else
1089   if test -n "$AMTAR"; then
1090   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1091 else
1092   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1093   ac_dummy="$PATH"
1094   for ac_dir in $ac_dummy; do
1095     test -z "$ac_dir" && ac_dir=.
1096     if test -f $ac_dir/$ac_word; then
1097       ac_cv_prog_AMTAR="$ac_prog"
1098       break
1099     fi
1100   done
1101   IFS="$ac_save_ifs"
1102 fi
1103 fi
1104 AMTAR="$ac_cv_prog_AMTAR"
1105 if test -n "$AMTAR"; then
1106   echo "$ac_t""$AMTAR" 1>&6
1107 else
1108   echo "$ac_t""no" 1>&6
1109 fi
1110
1111 test -n "$AMTAR" && break
1112 done
1113
1114
1115 AMTARFLAGS=
1116 if test -n "$AMTAR"; then
1117   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1118         AMTARFLAGS=o
1119   fi
1120 fi
1121
1122
1123
1124 cat >> confdefs.h <<EOF
1125 #define OPENLDAP_PACKAGE "$PACKAGE"
1126 EOF
1127
1128 cat >> confdefs.h <<EOF
1129 #define OPENLDAP_VERSION "$VERSION"
1130 EOF
1131
1132
1133
1134
1135 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1136 echo "configure:1137: checking configure arguments" >&5
1137
1138
1139 top_builddir=`pwd`
1140
1141 ldap_subdir="/openldap"
1142
1143 # Check whether --with-subdir or --without-subdir was given.
1144 if test "${with_subdir+set}" = set; then
1145   withval="$with_subdir"
1146   case "$withval" in
1147         no) ldap_subdir=""
1148                 ;;
1149         yes)
1150                 ;;
1151         /*|\\*)
1152                 ldap_subdir="$withval"
1153                 ;;
1154         *)
1155                 ldap_subdir="/$withval"
1156                 ;;
1157 esac
1158
1159 fi
1160
1161
1162 # OpenLDAP --enable-debug
1163         # Check whether --enable-debug or --disable-debug was given.
1164 if test "${enable_debug+set}" = set; then
1165   enableval="$enable_debug"
1166   
1167         ol_arg=invalid
1168         for ol_val in auto yes no ; do
1169                 if test "$enableval" = "$ol_val" ; then
1170                         ol_arg="$ol_val"
1171                 fi
1172         done
1173         if test "$ol_arg" = "invalid" ; then
1174                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1175         fi
1176         ol_enable_debug="$ol_arg"
1177
1178 else
1179         ol_enable_debug="yes"
1180 fi
1181 # end --enable-debug
1182 # OpenLDAP --enable-syslog
1183         # Check whether --enable-syslog or --disable-syslog was given.
1184 if test "${enable_syslog+set}" = set; then
1185   enableval="$enable_syslog"
1186   
1187         ol_arg=invalid
1188         for ol_val in auto yes no ; do
1189                 if test "$enableval" = "$ol_val" ; then
1190                         ol_arg="$ol_val"
1191                 fi
1192         done
1193         if test "$ol_arg" = "invalid" ; then
1194                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1195         fi
1196         ol_enable_syslog="$ol_arg"
1197
1198 else
1199         ol_enable_syslog="auto"
1200 fi
1201 # end --enable-syslog
1202 # OpenLDAP --enable-proctitle
1203         # Check whether --enable-proctitle or --disable-proctitle was given.
1204 if test "${enable_proctitle+set}" = set; then
1205   enableval="$enable_proctitle"
1206   
1207         ol_arg=invalid
1208         for ol_val in auto yes no ; do
1209                 if test "$enableval" = "$ol_val" ; then
1210                         ol_arg="$ol_val"
1211                 fi
1212         done
1213         if test "$ol_arg" = "invalid" ; then
1214                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1215         fi
1216         ol_enable_proctitle="$ol_arg"
1217
1218 else
1219         ol_enable_proctitle="yes"
1220 fi
1221 # end --enable-proctitle
1222 # OpenLDAP --enable-cache
1223         # Check whether --enable-cache or --disable-cache was given.
1224 if test "${enable_cache+set}" = set; then
1225   enableval="$enable_cache"
1226   
1227         ol_arg=invalid
1228         for ol_val in auto yes no ; do
1229                 if test "$enableval" = "$ol_val" ; then
1230                         ol_arg="$ol_val"
1231                 fi
1232         done
1233         if test "$ol_arg" = "invalid" ; then
1234                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
1235         fi
1236         ol_enable_cache="$ol_arg"
1237
1238 else
1239         ol_enable_cache="yes"
1240 fi
1241 # end --enable-cache
1242 # OpenLDAP --enable-dns
1243         # Check whether --enable-dns or --disable-dns was given.
1244 if test "${enable_dns+set}" = set; then
1245   enableval="$enable_dns"
1246   
1247         ol_arg=invalid
1248         for ol_val in auto yes no ; do
1249                 if test "$enableval" = "$ol_val" ; then
1250                         ol_arg="$ol_val"
1251                 fi
1252         done
1253         if test "$ol_arg" = "invalid" ; then
1254                 { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; }
1255         fi
1256         ol_enable_dns="$ol_arg"
1257
1258 else
1259         ol_enable_dns="no"
1260 fi
1261 # end --enable-dns
1262 # OpenLDAP --enable-referrals
1263         # Check whether --enable-referrals or --disable-referrals was given.
1264 if test "${enable_referrals+set}" = set; then
1265   enableval="$enable_referrals"
1266   
1267         ol_arg=invalid
1268         for ol_val in auto yes no ; do
1269                 if test "$enableval" = "$ol_val" ; then
1270                         ol_arg="$ol_val"
1271                 fi
1272         done
1273         if test "$ol_arg" = "invalid" ; then
1274                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1275         fi
1276         ol_enable_referrals="$ol_arg"
1277
1278 else
1279         ol_enable_referrals="yes"
1280 fi
1281 # end --enable-referrals
1282 # OpenLDAP --enable-cldap
1283         # Check whether --enable-cldap or --disable-cldap was given.
1284 if test "${enable_cldap+set}" = set; then
1285   enableval="$enable_cldap"
1286   
1287         ol_arg=invalid
1288         for ol_val in auto yes no ; do
1289                 if test "$enableval" = "$ol_val" ; then
1290                         ol_arg="$ol_val"
1291                 fi
1292         done
1293         if test "$ol_arg" = "invalid" ; then
1294                 { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; }
1295         fi
1296         ol_enable_cldap="$ol_arg"
1297
1298 else
1299         ol_enable_cldap="no"
1300 fi
1301 # end --enable-cldap
1302 # OpenLDAP --enable-x_compile
1303         # Check whether --enable-x_compile or --disable-x_compile was given.
1304 if test "${enable_x_compile+set}" = set; then
1305   enableval="$enable_x_compile"
1306   
1307         ol_arg=invalid
1308         for ol_val in yes no ; do
1309                 if test "$enableval" = "$ol_val" ; then
1310                         ol_arg="$ol_val"
1311                 fi
1312         done
1313         if test "$ol_arg" = "invalid" ; then
1314                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1315         fi
1316         ol_enable_x_compile="$ol_arg"
1317
1318 else
1319         ol_enable_x_compile="no"
1320 fi
1321 # end --enable-x_compile
1322
1323 # OpenLDAP --enable-dmalloc
1324         # Check whether --enable-dmalloc or --disable-dmalloc was given.
1325 if test "${enable_dmalloc+set}" = set; then
1326   enableval="$enable_dmalloc"
1327   
1328         ol_arg=invalid
1329         for ol_val in auto yes no ; do
1330                 if test "$enableval" = "$ol_val" ; then
1331                         ol_arg="$ol_val"
1332                 fi
1333         done
1334         if test "$ol_arg" = "invalid" ; then
1335                 { echo "configure: error: bad value $enableval for --enable-dmalloc" 1>&2; exit 1; }
1336         fi
1337         ol_enable_dmalloc="$ol_arg"
1338
1339 else
1340         ol_enable_dmalloc="no"
1341 fi
1342 # end --enable-dmalloc
1343
1344 # OpenLDAP --with-cyrus_sasl
1345         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1346 if test "${with_cyrus_sasl+set}" = set; then
1347   withval="$with_cyrus_sasl"
1348   
1349         ol_arg=invalid
1350         for ol_val in auto yes no  ; do
1351                 if test "$withval" = "$ol_val" ; then
1352                         ol_arg="$ol_val"
1353                 fi
1354         done
1355         if test "$ol_arg" = "invalid" ; then
1356                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1357         fi
1358         ol_with_cyrus_sasl="$ol_arg"
1359
1360 else
1361         ol_with_cyrus_sasl="auto"
1362 fi
1363 # end --with-cyrus_sasl
1364
1365 # OpenLDAP --with-fetch
1366         # Check whether --with-fetch or --without-fetch was given.
1367 if test "${with_fetch+set}" = set; then
1368   withval="$with_fetch"
1369   
1370         ol_arg=invalid
1371         for ol_val in auto yes no  ; do
1372                 if test "$withval" = "$ol_val" ; then
1373                         ol_arg="$ol_val"
1374                 fi
1375         done
1376         if test "$ol_arg" = "invalid" ; then
1377                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1378         fi
1379         ol_with_fetch="$ol_arg"
1380
1381 else
1382         ol_with_fetch="auto"
1383 fi
1384 # end --with-fetch
1385
1386 # OpenLDAP --with-kerberos
1387         # Check whether --with-kerberos or --without-kerberos was given.
1388 if test "${with_kerberos+set}" = set; then
1389   withval="$with_kerberos"
1390   
1391         ol_arg=invalid
1392         for ol_val in auto k5 k4 afs yes no ; do
1393                 if test "$withval" = "$ol_val" ; then
1394                         ol_arg="$ol_val"
1395                 fi
1396         done
1397         if test "$ol_arg" = "invalid" ; then
1398                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1399         fi
1400         ol_with_kerberos="$ol_arg"
1401
1402 else
1403         ol_with_kerberos="auto"
1404 fi
1405 # end --with-kerberos
1406
1407 # OpenLDAP --with-readline
1408         # Check whether --with-readline or --without-readline was given.
1409 if test "${with_readline+set}" = set; then
1410   withval="$with_readline"
1411   
1412         ol_arg=invalid
1413         for ol_val in auto yes no  ; do
1414                 if test "$withval" = "$ol_val" ; then
1415                         ol_arg="$ol_val"
1416                 fi
1417         done
1418         if test "$ol_arg" = "invalid" ; then
1419                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1420         fi
1421         ol_with_readline="$ol_arg"
1422
1423 else
1424         ol_with_readline="auto"
1425 fi
1426 # end --with-readline
1427
1428 # OpenLDAP --with-threads
1429         # Check whether --with-threads or --without-threads was given.
1430 if test "${with_threads+set}" = set; then
1431   withval="$with_threads"
1432   
1433         ol_arg=invalid
1434         for ol_val in auto posix mach pth lwp yes no manual  ; do
1435                 if test "$withval" = "$ol_val" ; then
1436                         ol_arg="$ol_val"
1437                 fi
1438         done
1439         if test "$ol_arg" = "invalid" ; then
1440                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1441         fi
1442         ol_with_threads="$ol_arg"
1443
1444 else
1445         ol_with_threads="auto"
1446 fi
1447 # end --with-threads
1448
1449 # OpenLDAP --with-tls
1450         # Check whether --with-tls or --without-tls was given.
1451 if test "${with_tls+set}" = set; then
1452   withval="$with_tls"
1453   
1454         ol_arg=invalid
1455         for ol_val in auto ssleay openssl yes no  ; do
1456                 if test "$withval" = "$ol_val" ; then
1457                         ol_arg="$ol_val"
1458                 fi
1459         done
1460         if test "$ol_arg" = "invalid" ; then
1461                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1462         fi
1463         ol_with_tls="$ol_arg"
1464
1465 else
1466         ol_with_tls="auto"
1467 fi
1468 # end --with-tls
1469
1470 # OpenLDAP --with-yielding_select
1471         # Check whether --with-yielding_select or --without-yielding_select was given.
1472 if test "${with_yielding_select+set}" = set; then
1473   withval="$with_yielding_select"
1474   
1475         ol_arg=invalid
1476         for ol_val in auto yes no manual  ; do
1477                 if test "$withval" = "$ol_val" ; then
1478                         ol_arg="$ol_val"
1479                 fi
1480         done
1481         if test "$ol_arg" = "invalid" ; then
1482                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1483         fi
1484         ol_with_yielding_select="$ol_arg"
1485
1486 else
1487         ol_with_yielding_select="auto"
1488 fi
1489 # end --with-yielding_select
1490
1491
1492 # Check whether --with-xxldapdoptions or --without-xxldapdoptions was given.
1493 if test "${with_xxldapdoptions+set}" = set; then
1494   withval="$with_xxldapdoptions"
1495   :
1496 fi
1497
1498 # OpenLDAP --enable-ldapd
1499         # Check whether --enable-ldapd or --disable-ldapd was given.
1500 if test "${enable_ldapd+set}" = set; then
1501   enableval="$enable_ldapd"
1502   
1503         ol_arg=invalid
1504         for ol_val in auto yes no ; do
1505                 if test "$enableval" = "$ol_val" ; then
1506                         ol_arg="$ol_val"
1507                 fi
1508         done
1509         if test "$ol_arg" = "invalid" ; then
1510                 { echo "configure: error: bad value $enableval for --enable-ldapd" 1>&2; exit 1; }
1511         fi
1512         ol_enable_ldapd="$ol_arg"
1513
1514 else
1515         ol_enable_ldapd="no"
1516 fi
1517 # end --enable-ldapd
1518
1519 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1520 if test "${with_xxslapdoptions+set}" = set; then
1521   withval="$with_xxslapdoptions"
1522   :
1523 fi
1524
1525 # OpenLDAP --enable-slapd
1526         # Check whether --enable-slapd or --disable-slapd was given.
1527 if test "${enable_slapd+set}" = set; then
1528   enableval="$enable_slapd"
1529   
1530         ol_arg=invalid
1531         for ol_val in auto yes no ; do
1532                 if test "$enableval" = "$ol_val" ; then
1533                         ol_arg="$ol_val"
1534                 fi
1535         done
1536         if test "$ol_arg" = "invalid" ; then
1537                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1538         fi
1539         ol_enable_slapd="$ol_arg"
1540
1541 else
1542         ol_enable_slapd="yes"
1543 fi
1544 # end --enable-slapd
1545 # OpenLDAP --enable-cleartext
1546         # Check whether --enable-cleartext or --disable-cleartext was given.
1547 if test "${enable_cleartext+set}" = set; then
1548   enableval="$enable_cleartext"
1549   
1550         ol_arg=invalid
1551         for ol_val in auto yes no ; do
1552                 if test "$enableval" = "$ol_val" ; then
1553                         ol_arg="$ol_val"
1554                 fi
1555         done
1556         if test "$ol_arg" = "invalid" ; then
1557                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1558         fi
1559         ol_enable_cleartext="$ol_arg"
1560
1561 else
1562         ol_enable_cleartext="yes"
1563 fi
1564 # end --enable-cleartext
1565 # OpenLDAP --enable-crypt
1566         # Check whether --enable-crypt or --disable-crypt was given.
1567 if test "${enable_crypt+set}" = set; then
1568   enableval="$enable_crypt"
1569   
1570         ol_arg=invalid
1571         for ol_val in auto yes no ; do
1572                 if test "$enableval" = "$ol_val" ; then
1573                         ol_arg="$ol_val"
1574                 fi
1575         done
1576         if test "$ol_arg" = "invalid" ; then
1577                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1578         fi
1579         ol_enable_crypt="$ol_arg"
1580
1581 else
1582         ol_enable_crypt="auto"
1583 fi
1584 # end --enable-crypt
1585 # OpenLDAP --enable-modules
1586         # Check whether --enable-modules or --disable-modules was given.
1587 if test "${enable_modules+set}" = set; then
1588   enableval="$enable_modules"
1589   
1590         ol_arg=invalid
1591         for ol_val in auto yes no ; do
1592                 if test "$enableval" = "$ol_val" ; then
1593                         ol_arg="$ol_val"
1594                 fi
1595         done
1596         if test "$ol_arg" = "invalid" ; then
1597                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1598         fi
1599         ol_enable_modules="$ol_arg"
1600
1601 else
1602         ol_enable_modules="no"
1603 fi
1604 # end --enable-modules
1605 # OpenLDAP --enable-multimaster
1606         # Check whether --enable-multimaster or --disable-multimaster was given.
1607 if test "${enable_multimaster+set}" = set; then
1608   enableval="$enable_multimaster"
1609   
1610         ol_arg=invalid
1611         for ol_val in auto yes no ; do
1612                 if test "$enableval" = "$ol_val" ; then
1613                         ol_arg="$ol_val"
1614                 fi
1615         done
1616         if test "$ol_arg" = "invalid" ; then
1617                 { echo "configure: error: bad value $enableval for --enable-multimaster" 1>&2; exit 1; }
1618         fi
1619         ol_enable_multimaster="$ol_arg"
1620
1621 else
1622         ol_enable_multimaster="no"
1623 fi
1624 # end --enable-multimaster
1625 # OpenLDAP --enable-phonetic
1626         # Check whether --enable-phonetic or --disable-phonetic was given.
1627 if test "${enable_phonetic+set}" = set; then
1628   enableval="$enable_phonetic"
1629   
1630         ol_arg=invalid
1631         for ol_val in auto yes no ; do
1632                 if test "$enableval" = "$ol_val" ; then
1633                         ol_arg="$ol_val"
1634                 fi
1635         done
1636         if test "$ol_arg" = "invalid" ; then
1637                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1638         fi
1639         ol_enable_phonetic="$ol_arg"
1640
1641 else
1642         ol_enable_phonetic="no"
1643 fi
1644 # end --enable-phonetic
1645 # OpenLDAP --enable-quipu
1646         # Check whether --enable-quipu or --disable-quipu was given.
1647 if test "${enable_quipu+set}" = set; then
1648   enableval="$enable_quipu"
1649   
1650         ol_arg=invalid
1651         for ol_val in auto yes no ; do
1652                 if test "$enableval" = "$ol_val" ; then
1653                         ol_arg="$ol_val"
1654                 fi
1655         done
1656         if test "$ol_arg" = "invalid" ; then
1657                 { echo "configure: error: bad value $enableval for --enable-quipu" 1>&2; exit 1; }
1658         fi
1659         ol_enable_quipu="$ol_arg"
1660
1661 else
1662         ol_enable_quipu="no"
1663 fi
1664 # end --enable-quipu
1665 # OpenLDAP --enable-rlookups
1666         # Check whether --enable-rlookups or --disable-rlookups was given.
1667 if test "${enable_rlookups+set}" = set; then
1668   enableval="$enable_rlookups"
1669   
1670         ol_arg=invalid
1671         for ol_val in auto yes no ; do
1672                 if test "$enableval" = "$ol_val" ; then
1673                         ol_arg="$ol_val"
1674                 fi
1675         done
1676         if test "$ol_arg" = "invalid" ; then
1677                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1678         fi
1679         ol_enable_rlookups="$ol_arg"
1680
1681 else
1682         ol_enable_rlookups="auto"
1683 fi
1684 # end --enable-rlookups
1685 # OpenLDAP --enable-aci
1686         # Check whether --enable-aci or --disable-aci was given.
1687 if test "${enable_aci+set}" = set; then
1688   enableval="$enable_aci"
1689   
1690         ol_arg=invalid
1691         for ol_val in auto yes no ; do
1692                 if test "$enableval" = "$ol_val" ; then
1693                         ol_arg="$ol_val"
1694                 fi
1695         done
1696         if test "$ol_arg" = "invalid" ; then
1697                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1698         fi
1699         ol_enable_aci="$ol_arg"
1700
1701 else
1702         ol_enable_aci="no"
1703 fi
1704 # end --enable-aci
1705 # OpenLDAP --enable-discreteaci
1706         # Check whether --enable-discreteaci or --disable-discreteaci was given.
1707 if test "${enable_discreteaci+set}" = set; then
1708   enableval="$enable_discreteaci"
1709   
1710         ol_arg=invalid
1711         for ol_val in auto yes no ; do
1712                 if test "$enableval" = "$ol_val" ; then
1713                         ol_arg="$ol_val"
1714                 fi
1715         done
1716         if test "$ol_arg" = "invalid" ; then
1717                 { echo "configure: error: bad value $enableval for --enable-discreteaci" 1>&2; exit 1; }
1718         fi
1719         ol_enable_discreteaci="$ol_arg"
1720
1721 else
1722         ol_enable_discreteaci="no"
1723 fi
1724 # end --enable-discreteaci
1725 # OpenLDAP --enable-wrappers
1726         # Check whether --enable-wrappers or --disable-wrappers was given.
1727 if test "${enable_wrappers+set}" = set; then
1728   enableval="$enable_wrappers"
1729   
1730         ol_arg=invalid
1731         for ol_val in auto yes no ; do
1732                 if test "$enableval" = "$ol_val" ; then
1733                         ol_arg="$ol_val"
1734                 fi
1735         done
1736         if test "$ol_arg" = "invalid" ; then
1737                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1738         fi
1739         ol_enable_wrappers="$ol_arg"
1740
1741 else
1742         ol_enable_wrappers="no"
1743 fi
1744 # end --enable-wrappers
1745
1746 # OpenLDAP --enable-bdb2
1747         # Check whether --enable-bdb2 or --disable-bdb2 was given.
1748 if test "${enable_bdb2+set}" = set; then
1749   enableval="$enable_bdb2"
1750   
1751         ol_arg=invalid
1752         for ol_val in auto yes no ; do
1753                 if test "$enableval" = "$ol_val" ; then
1754                         ol_arg="$ol_val"
1755                 fi
1756         done
1757         if test "$ol_arg" = "invalid" ; then
1758                 { echo "configure: error: bad value $enableval for --enable-bdb2" 1>&2; exit 1; }
1759         fi
1760         ol_enable_bdb2="$ol_arg"
1761
1762 else
1763         ol_enable_bdb2="no"
1764 fi
1765 # end --enable-bdb2
1766 # OpenLDAP --with-bdb2_module
1767         # Check whether --with-bdb2_module or --without-bdb2_module was given.
1768 if test "${with_bdb2_module+set}" = set; then
1769   withval="$with_bdb2_module"
1770   
1771         ol_arg=invalid
1772         for ol_val in static dynamic ; do
1773                 if test "$withval" = "$ol_val" ; then
1774                         ol_arg="$ol_val"
1775                 fi
1776         done
1777         if test "$ol_arg" = "invalid" ; then
1778                 { echo "configure: error: bad value $withval for --with-bdb2_module" 1>&2; exit 1; }
1779         fi
1780         ol_with_bdb2_module="$ol_arg"
1781
1782 else
1783         ol_with_bdb2_module="static"
1784 fi
1785 # end --with-bdb2_module
1786
1787 # OpenLDAP --enable-ldap
1788         # Check whether --enable-ldap or --disable-ldap was given.
1789 if test "${enable_ldap+set}" = set; then
1790   enableval="$enable_ldap"
1791   
1792         ol_arg=invalid
1793         for ol_val in auto yes no ; do
1794                 if test "$enableval" = "$ol_val" ; then
1795                         ol_arg="$ol_val"
1796                 fi
1797         done
1798         if test "$ol_arg" = "invalid" ; then
1799                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1800         fi
1801         ol_enable_ldap="$ol_arg"
1802
1803 else
1804         ol_enable_ldap="no"
1805 fi
1806 # end --enable-ldap
1807 # OpenLDAP --with-ldap_module
1808         # Check whether --with-ldap_module or --without-ldap_module was given.
1809 if test "${with_ldap_module+set}" = set; then
1810   withval="$with_ldap_module"
1811   
1812         ol_arg=invalid
1813         for ol_val in static dynamic ; do
1814                 if test "$withval" = "$ol_val" ; then
1815                         ol_arg="$ol_val"
1816                 fi
1817         done
1818         if test "$ol_arg" = "invalid" ; then
1819                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
1820         fi
1821         ol_with_ldap_module="$ol_arg"
1822
1823 else
1824         ol_with_ldap_module="static"
1825 fi
1826 # end --with-ldap_module
1827
1828 # OpenLDAP --enable-ldbm
1829         # Check whether --enable-ldbm or --disable-ldbm was given.
1830 if test "${enable_ldbm+set}" = set; then
1831   enableval="$enable_ldbm"
1832   
1833         ol_arg=invalid
1834         for ol_val in auto yes no ; do
1835                 if test "$enableval" = "$ol_val" ; then
1836                         ol_arg="$ol_val"
1837                 fi
1838         done
1839         if test "$ol_arg" = "invalid" ; then
1840                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1841         fi
1842         ol_enable_ldbm="$ol_arg"
1843
1844 else
1845         ol_enable_ldbm="yes"
1846 fi
1847 # end --enable-ldbm
1848 # OpenLDAP --with-ldbm_api
1849         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1850 if test "${with_ldbm_api+set}" = set; then
1851   withval="$with_ldbm_api"
1852   
1853         ol_arg=invalid
1854         for ol_val in auto db2 db mdbm gdbm ndbm manual ; do
1855                 if test "$withval" = "$ol_val" ; then
1856                         ol_arg="$ol_val"
1857                 fi
1858         done
1859         if test "$ol_arg" = "invalid" ; then
1860                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1861         fi
1862         ol_with_ldbm_api="$ol_arg"
1863
1864 else
1865         ol_with_ldbm_api="auto"
1866 fi
1867 # end --with-ldbm_api
1868
1869 # OpenLDAP --with-ldbm_module
1870         # Check whether --with-ldbm_module or --without-ldbm_module was given.
1871 if test "${with_ldbm_module+set}" = set; then
1872   withval="$with_ldbm_module"
1873   
1874         ol_arg=invalid
1875         for ol_val in static dynamic ; do
1876                 if test "$withval" = "$ol_val" ; then
1877                         ol_arg="$ol_val"
1878                 fi
1879         done
1880         if test "$ol_arg" = "invalid" ; then
1881                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
1882         fi
1883         ol_with_ldbm_module="$ol_arg"
1884
1885 else
1886         ol_with_ldbm_module="static"
1887 fi
1888 # end --with-ldbm_module
1889
1890 # OpenLDAP --with-ldbm_type
1891         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1892 if test "${with_ldbm_type+set}" = set; then
1893   withval="$with_ldbm_type"
1894   
1895         ol_arg=invalid
1896         for ol_val in auto btree hash ; do
1897                 if test "$withval" = "$ol_val" ; then
1898                         ol_arg="$ol_val"
1899                 fi
1900         done
1901         if test "$ol_arg" = "invalid" ; then
1902                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1903         fi
1904         ol_with_ldbm_type="$ol_arg"
1905
1906 else
1907         ol_with_ldbm_type="auto"
1908 fi
1909 # end --with-ldbm_type
1910
1911
1912 # OpenLDAP --enable-passwd
1913         # Check whether --enable-passwd or --disable-passwd was given.
1914 if test "${enable_passwd+set}" = set; then
1915   enableval="$enable_passwd"
1916   
1917         ol_arg=invalid
1918         for ol_val in auto yes no ; do
1919                 if test "$enableval" = "$ol_val" ; then
1920                         ol_arg="$ol_val"
1921                 fi
1922         done
1923         if test "$ol_arg" = "invalid" ; then
1924                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1925         fi
1926         ol_enable_passwd="$ol_arg"
1927
1928 else
1929         ol_enable_passwd="no"
1930 fi
1931 # end --enable-passwd
1932 # OpenLDAP --with-passwd_module
1933         # Check whether --with-passwd_module or --without-passwd_module was given.
1934 if test "${with_passwd_module+set}" = set; then
1935   withval="$with_passwd_module"
1936   
1937         ol_arg=invalid
1938         for ol_val in static dynamic ; do
1939                 if test "$withval" = "$ol_val" ; then
1940                         ol_arg="$ol_val"
1941                 fi
1942         done
1943         if test "$ol_arg" = "invalid" ; then
1944                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
1945         fi
1946         ol_with_passwd_module="$ol_arg"
1947
1948 else
1949         ol_with_passwd_module="static"
1950 fi
1951 # end --with-passwd_module
1952
1953 # OpenLDAP --enable-perl
1954         # Check whether --enable-perl or --disable-perl was given.
1955 if test "${enable_perl+set}" = set; then
1956   enableval="$enable_perl"
1957   
1958         ol_arg=invalid
1959         for ol_val in auto yes no ; do
1960                 if test "$enableval" = "$ol_val" ; then
1961                         ol_arg="$ol_val"
1962                 fi
1963         done
1964         if test "$ol_arg" = "invalid" ; then
1965                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
1966         fi
1967         ol_enable_perl="$ol_arg"
1968
1969 else
1970         ol_enable_perl="no"
1971 fi
1972 # end --enable-perl
1973 # OpenLDAP --with-perl_module
1974         # Check whether --with-perl_module or --without-perl_module was given.
1975 if test "${with_perl_module+set}" = set; then
1976   withval="$with_perl_module"
1977   
1978         ol_arg=invalid
1979         for ol_val in static dynamic ; do
1980                 if test "$withval" = "$ol_val" ; then
1981                         ol_arg="$ol_val"
1982                 fi
1983         done
1984         if test "$ol_arg" = "invalid" ; then
1985                 { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; }
1986         fi
1987         ol_with_perl_module="$ol_arg"
1988
1989 else
1990         ol_with_perl_module="static"
1991 fi
1992 # end --with-perl_module
1993
1994 # OpenLDAP --enable-shell
1995         # Check whether --enable-shell or --disable-shell was given.
1996 if test "${enable_shell+set}" = set; then
1997   enableval="$enable_shell"
1998   
1999         ol_arg=invalid
2000         for ol_val in auto yes no ; do
2001                 if test "$enableval" = "$ol_val" ; then
2002                         ol_arg="$ol_val"
2003                 fi
2004         done
2005         if test "$ol_arg" = "invalid" ; then
2006                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
2007         fi
2008         ol_enable_shell="$ol_arg"
2009
2010 else
2011         ol_enable_shell="no"
2012 fi
2013 # end --enable-shell
2014 # OpenLDAP --with-shell_module
2015         # Check whether --with-shell_module or --without-shell_module was given.
2016 if test "${with_shell_module+set}" = set; then
2017   withval="$with_shell_module"
2018   
2019         ol_arg=invalid
2020         for ol_val in static dynamic ; do
2021                 if test "$withval" = "$ol_val" ; then
2022                         ol_arg="$ol_val"
2023                 fi
2024         done
2025         if test "$ol_arg" = "invalid" ; then
2026                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
2027         fi
2028         ol_with_shell_module="$ol_arg"
2029
2030 else
2031         ol_with_shell_module="static"
2032 fi
2033 # end --with-shell_module
2034
2035 # OpenLDAP --enable-tcl
2036         # Check whether --enable-tcl or --disable-tcl was given.
2037 if test "${enable_tcl+set}" = set; then
2038   enableval="$enable_tcl"
2039   
2040         ol_arg=invalid
2041         for ol_val in auto yes no ; do
2042                 if test "$enableval" = "$ol_val" ; then
2043                         ol_arg="$ol_val"
2044                 fi
2045         done
2046         if test "$ol_arg" = "invalid" ; then
2047                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
2048         fi
2049         ol_enable_tcl="$ol_arg"
2050
2051 else
2052         ol_enable_tcl="no"
2053 fi
2054 # end --enable-tcl
2055 # OpenLDAP --with-tcl_module
2056         # Check whether --with-tcl_module or --without-tcl_module was given.
2057 if test "${with_tcl_module+set}" = set; then
2058   withval="$with_tcl_module"
2059   
2060         ol_arg=invalid
2061         for ol_val in static dynamic ; do
2062                 if test "$withval" = "$ol_val" ; then
2063                         ol_arg="$ol_val"
2064                 fi
2065         done
2066         if test "$ol_arg" = "invalid" ; then
2067                 { echo "configure: error: bad value $withval for --with-tcl_module" 1>&2; exit 1; }
2068         fi
2069         ol_with_tcl_module="$ol_arg"
2070
2071 else
2072         ol_with_tcl_module="static"
2073 fi
2074 # end --with-tcl_module
2075
2076
2077 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2078 if test "${with_xxslurpdoptions+set}" = set; then
2079   withval="$with_xxslurpdoptions"
2080   :
2081 fi
2082
2083 # OpenLDAP --enable-slurpd
2084         # Check whether --enable-slurpd or --disable-slurpd was given.
2085 if test "${enable_slurpd+set}" = set; then
2086   enableval="$enable_slurpd"
2087   
2088         ol_arg=invalid
2089         for ol_val in auto yes no ; do
2090                 if test "$enableval" = "$ol_val" ; then
2091                         ol_arg="$ol_val"
2092                 fi
2093         done
2094         if test "$ol_arg" = "invalid" ; then
2095                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2096         fi
2097         ol_enable_slurpd="$ol_arg"
2098
2099 else
2100         ol_enable_slurpd="auto"
2101 fi
2102 # end --enable-slurpd
2103
2104 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2105 if test "${with_xxliboptions+set}" = set; then
2106   withval="$with_xxliboptions"
2107   :
2108 fi
2109
2110 # Check whether --enable-static or --disable-static was given.
2111 if test "${enable_static+set}" = set; then
2112   enableval="$enable_static"
2113   p=${PACKAGE-default}
2114 case "$enableval" in
2115 yes) enable_static=yes ;;
2116 no) enable_static=no ;;
2117 *)
2118   enable_static=no
2119   # Look at the argument we got.  We use all the common list separators.
2120   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2121   for pkg in $enableval; do
2122     if test "X$pkg" = "X$p"; then
2123       enable_static=yes
2124     fi
2125   done
2126   IFS="$ac_save_ifs"
2127   ;;
2128 esac
2129 else
2130   enable_static=yes
2131 fi
2132
2133 # Check whether --enable-shared or --disable-shared was given.
2134 if test "${enable_shared+set}" = set; then
2135   enableval="$enable_shared"
2136   p=${PACKAGE-default}
2137 case "$enableval" in
2138 yes) enable_shared=yes ;;
2139 no) enable_shared=no ;;
2140 *)
2141   enable_shared=no
2142   # Look at the argument we got.  We use all the common list separators.
2143   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2144   for pkg in $enableval; do
2145     if test "X$pkg" = "X$p"; then
2146       enable_shared=yes
2147     fi
2148   done
2149   IFS="$ac_save_ifs"
2150   ;;
2151 esac
2152 else
2153   enable_shared=yes
2154 fi
2155
2156
2157
2158 # validate options
2159 if test $ol_enable_dns = yes ; then
2160         if test $ol_enable_referrals = no ; then
2161                 { echo "configure: error: DNS requires --enable-referrals" 1>&2; exit 1; }
2162         fi
2163         if test $ol_enable_referrals = auto ; then
2164                 echo "configure: warning: DNS requires referrals, adding --enable-referrals" 1>&2
2165                 ol_enable_referrals=yes
2166         fi
2167 fi
2168
2169 if test $ol_enable_slapd = no ; then
2170                 if test $ol_enable_bdb2 = yes ; then
2171                 echo "configure: warning: slapd disabled, ignoring --enable-bdb2 argument" 1>&2
2172         fi
2173         if test $ol_enable_ldap = yes ; then
2174                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2175         fi
2176         if test $ol_enable_ldbm = yes ; then
2177                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2178         fi
2179         if test $ol_enable_passwd = yes ; then
2180                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2181         fi
2182         if test $ol_enable_perl = yes ; then
2183                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
2184         fi
2185         if test $ol_enable_shell = yes ; then
2186                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2187         fi
2188         if test $ol_enable_tcl = yes ; then
2189                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
2190         fi
2191         if test $ol_enable_modules = yes ; then
2192                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2193         fi
2194         if test $ol_enable_multimaster = yes ; then
2195                 echo "configure: warning: slapd disabled, ignoring --enable-multimaster argument" 1>&2
2196         fi
2197         if test $ol_enable_wrappers = yes ; then
2198                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2199         fi
2200         if test $ol_enable_phonetic = yes ; then
2201                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2202         fi
2203         if test $ol_enable_quipu = yes ; then
2204                 echo "configure: warning: slapd disabled, ignoring --enable-quipu argument" 1>&2
2205         fi
2206         if test $ol_enable_rlookups = yes ; then
2207                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2208         fi
2209         if test $ol_enable_aci = yes ; then
2210                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2211         fi
2212         if test $ol_enable_discreteaci = yes ; then
2213                 echo "configure: warning: slapd disabled, ignoring --enable-discreteaci argument" 1>&2
2214         fi
2215         if test $ol_with_ldbm_api != auto ; then
2216                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2217         fi
2218         if test $ol_with_ldbm_type != auto ; then
2219                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2220         fi
2221         if test $ol_with_bdb2_module != static ; then
2222                 echo "configure: warning: slapd disabled, ignoring --with-bdb2-module argument" 1>&2
2223         fi
2224         if test $ol_with_ldap_module != static ; then
2225                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2226         fi
2227         if test $ol_with_ldbm_module != static ; then
2228                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2229         fi
2230         if test $ol_with_passwd_module != static ; then
2231                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2232         fi
2233         if test $ol_with_perl_module != static ; then
2234                 echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
2235         fi
2236         if test $ol_with_shell_module != static ; then
2237                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2238         fi
2239         if test $ol_with_tcl_module != static ; then
2240                 echo "configure: warning: slapd disabled, ignoring --with-tcl-module argument" 1>&2
2241         fi
2242         if test $ol_enable_slurpd = yes ; then
2243                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2244         fi
2245
2246         # force settings to no
2247         ol_enable_bdb2=no
2248         ol_enable_ldap=no
2249         ol_enable_ldbm=no
2250         ol_enable_passwd=no
2251         ol_enable_perl=no
2252         ol_enable_shell=no
2253         ol_enable_tcl=no
2254
2255         ol_enable_modules=no
2256         ol_enable_multimaster=no
2257         ol_enable_phonetic=no
2258         ol_enable_quipu=no
2259         ol_enable_rlookups=no
2260         ol_enable_aci=no
2261         ol_enable_discreteaci=no
2262         ol_enable_wrappers=no
2263
2264         ol_with_ldbm_api=no
2265         ol_with_ldbm_type=no
2266
2267         ol_with_bdb2_module=static
2268         ol_with_ldap_module=static
2269         ol_with_ldbm_module=static
2270         ol_with_passwd_module=static
2271         ol_with_perl_module=static
2272         ol_with_shell_module=static
2273         ol_with_tcl_module=static
2274
2275         ol_enable_slurpd=no
2276
2277 elif test $ol_enable_ldbm = no ; then
2278         
2279         if test $ol_with_ldbm_api != auto ; then
2280                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2281         fi
2282
2283         if test $ol_with_ldbm_type != auto ; then
2284                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2285         fi
2286
2287         if test $ol_with_ldbm_module != static ; then
2288                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2289         fi
2290
2291         if test $ol_enable_bdb2 = yes ; then
2292                 { echo "configure: error: BDB2 requires --enable-ldbm" 1>&2; exit 1; }
2293         fi
2294
2295         if test $ol_enable_modules != yes -a \
2296                 $ol_enable_ldap = no -a \
2297                 $ol_enable_passwd = no -a \
2298                 $ol_enable_perl = no -a \
2299                 $ol_enable_shell = no -a \
2300                 $ol_enable_tcl = no ; then
2301                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2302         fi
2303
2304         ol_with_ldbm_api=no
2305         ol_with_ldbm_type=no
2306         ol_with_ldbm_module=static
2307
2308 elif test $ol_enable_bdb2 = yes ; then
2309         
2310         if test $ol_with_ldbm_api != auto -a \
2311                 $ol_with_ldbm_api != db2 ; then
2312                 { echo "configure: error: BDB2 requires LDBM API DB2" 1>&2; exit 1; }
2313         fi
2314
2315         ol_with_ldbm_api=db2
2316
2317 else
2318         
2319         if test $ol_enable_bdb2 != no ; then
2320                 if test $ol_with_ldbm_api != auto -a \
2321                         $ol_with_ldbm_api != db2 ; then
2322                         echo "configure: warning: BDB2 requires LDBM api db2 or auto" 1>&2
2323                         ol_enable_bdb2=no
2324                 fi
2325         fi
2326
2327         if test $ol_with_ldbm_api = gdbm -a \
2328                 $ol_with_ldbm_type = btree ; then
2329                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2330         fi
2331         if test $ol_with_ldbm_api = mdbm -a \
2332                 $ol_with_ldbm_type = btree ; then
2333                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2334         fi
2335         if test $ol_with_ldbm_api = ndbm -a \
2336                 $ol_with_ldbm_type = btree ; then
2337                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2338         fi
2339 fi
2340
2341 if test $ol_enable_slurpd = yes ; then
2342                 if test $ol_with_threads = no ; then
2343                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2344         fi
2345 fi
2346
2347 echo "$ac_t""done" 1>&6
2348
2349 LDAP_LIBS=
2350 LDIF_LIBS=
2351 LDBM_LIBS=
2352 LTHREAD_LIBS=
2353 LUTIL_LIBS=
2354
2355 LDAPD_LIBS=
2356 SLAPD_LIBS=
2357 SLURPD_LIBS=
2358
2359 BUILD_LDAPD=no
2360 BUILD_SLAPD=no
2361 BUILD_SLURPD=no
2362
2363 BUILD_BDB2=no
2364 BUILD_LDAP=no
2365 BUILD_LDBM=no
2366 BUILD_PASSWD=no
2367 BUILD_PERL=no
2368 BUILD_QUIPU=no
2369 BUILD_SHELL=no
2370 BUILD_TCL=no
2371 BUILD_THREAD=no
2372
2373 BUILD_BDB2_DYNAMIC=static
2374 BUILD_LDAP_DYNAMIC=static
2375 BUILD_LDBM_DYNAMIC=static
2376 BUILD_PASSWD_DYNAMIC=static
2377 BUILD_PERL_DYNAMIC=static
2378 BUILD_SHELL_DYNAMIC=static
2379 BUILD_TCL_DYNAMIC=static
2380
2381 SLAPD_MODULES_LDFLAGS=
2382 SLAPD_MODULES_CPPFLAGS=
2383 SLAPD_MODULES_LIST=
2384
2385 SLAPD_PERL_LDFLAGS=
2386 SLAPD_PERL_CPPFLAGS=
2387
2388 KRB_LIBS=
2389 READLINE_LIBS=
2390 SASL_LIBS=
2391 TERMCAP_LIBS=
2392 TLS_LIBS=
2393 MODULES_LIBS=
2394
2395
2396
2397 cat >> confdefs.h <<\EOF
2398 #define HAVE_MKVERSION 1
2399 EOF
2400
2401
2402
2403
2404 ol_aix_threads=no
2405 case "$target" in
2406 *-*-aix*)       if test -z "$CC" ; then
2407                 case "$ol_with_threads" in
2408                 auto | yes |  posix) ol_aix_threads=yes ;;
2409                 esac
2410         fi
2411 ;;
2412 esac
2413
2414 if test $ol_aix_threads = yes ; then
2415         if test -z "${CC}" ; then
2416                 for ac_prog in cc_r xlc_r cc
2417 do
2418 # Extract the first word of "$ac_prog", so it can be a program name with args.
2419 set dummy $ac_prog; ac_word=$2
2420 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2421 echo "configure:2422: checking for $ac_word" >&5
2422 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2423   echo $ac_n "(cached) $ac_c" 1>&6
2424 else
2425   if test -n "$CC"; then
2426   ac_cv_prog_CC="$CC" # Let the user override the test.
2427 else
2428   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2429   ac_dummy="$PATH"
2430   for ac_dir in $ac_dummy; do
2431     test -z "$ac_dir" && ac_dir=.
2432     if test -f $ac_dir/$ac_word; then
2433       ac_cv_prog_CC="$ac_prog"
2434       break
2435     fi
2436   done
2437   IFS="$ac_save_ifs"
2438 fi
2439 fi
2440 CC="$ac_cv_prog_CC"
2441 if test -n "$CC"; then
2442   echo "$ac_t""$CC" 1>&6
2443 else
2444   echo "$ac_t""no" 1>&6
2445 fi
2446
2447 test -n "$CC" && break
2448 done
2449
2450
2451                 if test "$CC" = cc ; then
2452                                                 if test $ol_with_threads != auto ; then
2453                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2454                         else
2455                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2456                         fi
2457                         ol_with_threads=no
2458                 fi
2459         fi
2460
2461         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2462                 ol_with_threads=posix
2463                 ol_cv_pthread_create=yes
2464         fi
2465 fi
2466
2467 if test -z "${CC}"; then
2468         for ac_prog in cc
2469 do
2470 # Extract the first word of "$ac_prog", so it can be a program name with args.
2471 set dummy $ac_prog; ac_word=$2
2472 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2473 echo "configure:2474: checking for $ac_word" >&5
2474 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2475   echo $ac_n "(cached) $ac_c" 1>&6
2476 else
2477   if test -n "$CC"; then
2478   ac_cv_prog_CC="$CC" # Let the user override the test.
2479 else
2480   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2481   ac_dummy="$PATH"
2482   for ac_dir in $ac_dummy; do
2483     test -z "$ac_dir" && ac_dir=.
2484     if test -f $ac_dir/$ac_word; then
2485       ac_cv_prog_CC="$ac_prog"
2486       break
2487     fi
2488   done
2489   IFS="$ac_save_ifs"
2490 fi
2491 fi
2492 CC="$ac_cv_prog_CC"
2493 if test -n "$CC"; then
2494   echo "$ac_t""$CC" 1>&6
2495 else
2496   echo "$ac_t""no" 1>&6
2497 fi
2498
2499 test -n "$CC" && break
2500 done
2501
2502 fi
2503
2504
2505
2506 # Check whether --enable-fast-install or --disable-fast-install was given.
2507 if test "${enable_fast_install+set}" = set; then
2508   enableval="$enable_fast_install"
2509   p=${PACKAGE-default}
2510 case "$enableval" in
2511 yes) enable_fast_install=yes ;;
2512 no) enable_fast_install=no ;;
2513 *)
2514   enable_fast_install=no
2515   # Look at the argument we got.  We use all the common list separators.
2516   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2517   for pkg in $enableval; do
2518     if test "X$pkg" = "X$p"; then
2519       enable_fast_install=yes
2520     fi
2521   done
2522   IFS="$ac_save_ifs"
2523   ;;
2524 esac
2525 else
2526   enable_fast_install=yes
2527 fi
2528
2529 # Extract the first word of "ranlib", so it can be a program name with args.
2530 set dummy ranlib; ac_word=$2
2531 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2532 echo "configure:2533: checking for $ac_word" >&5
2533 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
2534   echo $ac_n "(cached) $ac_c" 1>&6
2535 else
2536   if test -n "$RANLIB"; then
2537   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2538 else
2539   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2540   ac_dummy="$PATH"
2541   for ac_dir in $ac_dummy; do
2542     test -z "$ac_dir" && ac_dir=.
2543     if test -f $ac_dir/$ac_word; then
2544       ac_cv_prog_RANLIB="ranlib"
2545       break
2546     fi
2547   done
2548   IFS="$ac_save_ifs"
2549   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2550 fi
2551 fi
2552 RANLIB="$ac_cv_prog_RANLIB"
2553 if test -n "$RANLIB"; then
2554   echo "$ac_t""$RANLIB" 1>&6
2555 else
2556   echo "$ac_t""no" 1>&6
2557 fi
2558
2559 # Extract the first word of "gcc", so it can be a program name with args.
2560 set dummy gcc; ac_word=$2
2561 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2562 echo "configure:2563: checking for $ac_word" >&5
2563 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2564   echo $ac_n "(cached) $ac_c" 1>&6
2565 else
2566   if test -n "$CC"; then
2567   ac_cv_prog_CC="$CC" # Let the user override the test.
2568 else
2569   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2570   ac_dummy="$PATH"
2571   for ac_dir in $ac_dummy; do
2572     test -z "$ac_dir" && ac_dir=.
2573     if test -f $ac_dir/$ac_word; then
2574       ac_cv_prog_CC="gcc"
2575       break
2576     fi
2577   done
2578   IFS="$ac_save_ifs"
2579 fi
2580 fi
2581 CC="$ac_cv_prog_CC"
2582 if test -n "$CC"; then
2583   echo "$ac_t""$CC" 1>&6
2584 else
2585   echo "$ac_t""no" 1>&6
2586 fi
2587
2588 if test -z "$CC"; then
2589   # Extract the first word of "cc", so it can be a program name with args.
2590 set dummy cc; ac_word=$2
2591 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2592 echo "configure:2593: checking for $ac_word" >&5
2593 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2594   echo $ac_n "(cached) $ac_c" 1>&6
2595 else
2596   if test -n "$CC"; then
2597   ac_cv_prog_CC="$CC" # Let the user override the test.
2598 else
2599   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2600   ac_prog_rejected=no
2601   ac_dummy="$PATH"
2602   for ac_dir in $ac_dummy; do
2603     test -z "$ac_dir" && ac_dir=.
2604     if test -f $ac_dir/$ac_word; then
2605       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2606         ac_prog_rejected=yes
2607         continue
2608       fi
2609       ac_cv_prog_CC="cc"
2610       break
2611     fi
2612   done
2613   IFS="$ac_save_ifs"
2614 if test $ac_prog_rejected = yes; then
2615   # We found a bogon in the path, so make sure we never use it.
2616   set dummy $ac_cv_prog_CC
2617   shift
2618   if test $# -gt 0; then
2619     # We chose a different compiler from the bogus one.
2620     # However, it has the same basename, so the bogon will be chosen
2621     # first if we set CC to just the basename; use the full file name.
2622     shift
2623     set dummy "$ac_dir/$ac_word" "$@"
2624     shift
2625     ac_cv_prog_CC="$@"
2626   fi
2627 fi
2628 fi
2629 fi
2630 CC="$ac_cv_prog_CC"
2631 if test -n "$CC"; then
2632   echo "$ac_t""$CC" 1>&6
2633 else
2634   echo "$ac_t""no" 1>&6
2635 fi
2636
2637   if test -z "$CC"; then
2638     case "`uname -s`" in
2639     *win32* | *WIN32* | *CYGWIN*)
2640       # Extract the first word of "cl", so it can be a program name with args.
2641 set dummy cl; ac_word=$2
2642 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2643 echo "configure:2644: checking for $ac_word" >&5
2644 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2645   echo $ac_n "(cached) $ac_c" 1>&6
2646 else
2647   if test -n "$CC"; then
2648   ac_cv_prog_CC="$CC" # Let the user override the test.
2649 else
2650   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2651   ac_dummy="$PATH"
2652   for ac_dir in $ac_dummy; do
2653     test -z "$ac_dir" && ac_dir=.
2654     if test -f $ac_dir/$ac_word; then
2655       ac_cv_prog_CC="cl"
2656       break
2657     fi
2658   done
2659   IFS="$ac_save_ifs"
2660 fi
2661 fi
2662 CC="$ac_cv_prog_CC"
2663 if test -n "$CC"; then
2664   echo "$ac_t""$CC" 1>&6
2665 else
2666   echo "$ac_t""no" 1>&6
2667 fi
2668  ;;
2669     esac
2670   fi
2671   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2672 fi
2673
2674 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2675 echo "configure:2676: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
2676
2677 ac_ext=c
2678 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2679 ac_cpp='$CPP $CPPFLAGS'
2680 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2681 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2682 cross_compiling=$ac_cv_prog_cc_cross
2683
2684 cat > conftest.$ac_ext << EOF
2685
2686 #line 2687 "configure"
2687 #include "confdefs.h"
2688
2689 main(){return(0);}
2690 EOF
2691 if { (eval echo configure:2692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2692   ac_cv_prog_cc_works=yes
2693   # If we can't run a trivial program, we are probably using a cross compiler.
2694   if (./conftest; exit) 2>/dev/null; then
2695     ac_cv_prog_cc_cross=no
2696   else
2697     ac_cv_prog_cc_cross=yes
2698   fi
2699 else
2700   echo "configure: failed program was:" >&5
2701   cat conftest.$ac_ext >&5
2702   ac_cv_prog_cc_works=no
2703 fi
2704 rm -fr conftest*
2705 ac_ext=c
2706 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2707 ac_cpp='$CPP $CPPFLAGS'
2708 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2709 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2710 cross_compiling=$ac_cv_prog_cc_cross
2711
2712 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2713 if test $ac_cv_prog_cc_works = no; then
2714   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2715 fi
2716 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2717 echo "configure:2718: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
2718 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2719 cross_compiling=$ac_cv_prog_cc_cross
2720
2721 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2722 echo "configure:2723: checking whether we are using GNU C" >&5
2723 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
2724   echo $ac_n "(cached) $ac_c" 1>&6
2725 else
2726   cat > conftest.c <<EOF
2727 #ifdef __GNUC__
2728   yes;
2729 #endif
2730 EOF
2731 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2732   ac_cv_prog_gcc=yes
2733 else
2734   ac_cv_prog_gcc=no
2735 fi
2736 fi
2737
2738 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2739
2740 if test $ac_cv_prog_gcc = yes; then
2741   GCC=yes
2742 else
2743   GCC=
2744 fi
2745
2746 ac_test_CFLAGS="${CFLAGS+set}"
2747 ac_save_CFLAGS="$CFLAGS"
2748 CFLAGS=
2749 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2750 echo "configure:2751: checking whether ${CC-cc} accepts -g" >&5
2751 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
2752   echo $ac_n "(cached) $ac_c" 1>&6
2753 else
2754   echo 'void f(){}' > conftest.c
2755 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2756   ac_cv_prog_cc_g=yes
2757 else
2758   ac_cv_prog_cc_g=no
2759 fi
2760 rm -f conftest*
2761
2762 fi
2763
2764 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2765 if test "$ac_test_CFLAGS" = set; then
2766   CFLAGS="$ac_save_CFLAGS"
2767 elif test $ac_cv_prog_cc_g = yes; then
2768   if test "$GCC" = yes; then
2769     CFLAGS="-g -O2"
2770   else
2771     CFLAGS="-g"
2772   fi
2773 else
2774   if test "$GCC" = yes; then
2775     CFLAGS="-O2"
2776   else
2777     CFLAGS=
2778   fi
2779 fi
2780
2781 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2782 if test "${with_gnu_ld+set}" = set; then
2783   withval="$with_gnu_ld"
2784   test "$withval" = no || with_gnu_ld=yes
2785 else
2786   with_gnu_ld=no
2787 fi
2788
2789 ac_prog=ld
2790 if test "$ac_cv_prog_gcc" = yes; then
2791   # Check if gcc -print-prog-name=ld gives a path.
2792   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2793 echo "configure:2794: checking for ld used by GCC" >&5
2794   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2795   case "$ac_prog" in
2796     # Accept absolute paths.
2797     [\\/]* | [A-Za-z]:[\\/]*)
2798       re_direlt='/[^/][^/]*/\.\./'
2799       # Canonicalize the path of ld
2800       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2801       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2802         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2803       done
2804       test -z "$LD" && LD="$ac_prog"
2805       ;;
2806   "")
2807     # If it fails, then pretend we aren't using GCC.
2808     ac_prog=ld
2809     ;;
2810   *)
2811     # If it is relative, then search for the first ld in PATH.
2812     with_gnu_ld=unknown
2813     ;;
2814   esac
2815 elif test "$with_gnu_ld" = yes; then
2816   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2817 echo "configure:2818: checking for GNU ld" >&5
2818 else
2819   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2820 echo "configure:2821: checking for non-GNU ld" >&5
2821 fi
2822 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
2823   echo $ac_n "(cached) $ac_c" 1>&6
2824 else
2825   if test -z "$LD"; then
2826   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2827   for ac_dir in $PATH; do
2828     test -z "$ac_dir" && ac_dir=.
2829     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2830       ac_cv_path_LD="$ac_dir/$ac_prog"
2831       # Check to see if the program is GNU ld.  I'd rather use --version,
2832       # but apparently some GNU ld's only accept -v.
2833       # Break only if it was the GNU/non-GNU ld that we prefer.
2834       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2835         test "$with_gnu_ld" != no && break
2836       else
2837         test "$with_gnu_ld" != yes && break
2838       fi
2839     fi
2840   done
2841   IFS="$ac_save_ifs"
2842 else
2843   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2844 fi
2845 fi
2846
2847 LD="$ac_cv_path_LD"
2848 if test -n "$LD"; then
2849   echo "$ac_t""$LD" 1>&6
2850 else
2851   echo "$ac_t""no" 1>&6
2852 fi
2853 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2854
2855 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2856 echo "configure:2857: checking if the linker ($LD) is GNU ld" >&5
2857 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
2858   echo $ac_n "(cached) $ac_c" 1>&6
2859 else
2860   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2861 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2862   ac_cv_prog_gnu_ld=yes
2863 else
2864   ac_cv_prog_gnu_ld=no
2865 fi
2866 fi
2867
2868 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2869
2870
2871 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2872 echo "configure:2873: checking for BSD-compatible nm" >&5
2873 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
2874   echo $ac_n "(cached) $ac_c" 1>&6
2875 else
2876   if test -n "$NM"; then
2877   # Let the user override the test.
2878   ac_cv_path_NM="$NM"
2879 else
2880   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2881   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
2882     test -z "$ac_dir" && ac_dir=.
2883     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
2884       # Check to see if the nm accepts a BSD-compat flag.
2885       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2886       #   nm: unknown option "B" ignored
2887       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2888         ac_cv_path_NM="$ac_dir/nm -B"
2889         break
2890       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2891         ac_cv_path_NM="$ac_dir/nm -p"
2892         break
2893       else
2894         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
2895         continue # so that we can try to find one that supports BSD flags
2896       fi
2897     fi
2898   done
2899   IFS="$ac_save_ifs"
2900   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2901 fi
2902 fi
2903
2904 NM="$ac_cv_path_NM"
2905 echo "$ac_t""$NM" 1>&6
2906
2907
2908 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2909 echo "configure:2910: checking whether ln -s works" >&5
2910 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
2911   echo $ac_n "(cached) $ac_c" 1>&6
2912 else
2913   rm -f conftestdata
2914 if ln -s X conftestdata 2>/dev/null
2915 then
2916   rm -f conftestdata
2917   ac_cv_prog_LN_S="ln -s"
2918 else
2919   ac_cv_prog_LN_S=ln
2920 fi
2921 fi
2922 LN_S="$ac_cv_prog_LN_S"
2923 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2924   echo "$ac_t""yes" 1>&6
2925 else
2926   echo "$ac_t""no" 1>&6
2927 fi
2928
2929
2930 # Check for any special flags to pass to ltconfig.
2931 libtool_flags="--cache-file=$cache_file"
2932 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2933 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2934 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
2935 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2936 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2937 libtool_flags="$libtool_flags --enable-dlopen"
2938
2939 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
2940 if test "${enable_libtool_lock+set}" = set; then
2941   enableval="$enable_libtool_lock"
2942   :
2943 fi
2944
2945 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
2946 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
2947
2948 # Some flags need to be propagated to the compiler or linker for good
2949 # libtool support.
2950 case "$host" in
2951 *-*-irix6*)
2952   # Find out which ABI we are using.
2953   echo '#line 2954 "configure"' > conftest.$ac_ext
2954   if { (eval echo configure:2955: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2955     case "`/usr/bin/file conftest.o`" in
2956     *32-bit*)
2957       LD="${LD-ld} -32"
2958       ;;
2959     *N32*)
2960       LD="${LD-ld} -n32"
2961       ;;
2962     *64-bit*)
2963       LD="${LD-ld} -64"
2964       ;;
2965     esac
2966   fi
2967   rm -rf conftest*
2968   ;;
2969
2970 *-*-sco3.2v5*)
2971   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2972   SAVE_CFLAGS="$CFLAGS"
2973   CFLAGS="$CFLAGS -belf"
2974   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
2975 echo "configure:2976: checking whether the C compiler needs -belf" >&5
2976 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
2977   echo $ac_n "(cached) $ac_c" 1>&6
2978 else
2979   cat > conftest.$ac_ext <<EOF
2980 #line 2981 "configure"
2981 #include "confdefs.h"
2982
2983 int main() {
2984
2985 ; return 0; }
2986 EOF
2987 if { (eval echo configure:2988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2988   rm -rf conftest*
2989   lt_cv_cc_needs_belf=yes
2990 else
2991   echo "configure: failed program was:" >&5
2992   cat conftest.$ac_ext >&5
2993   rm -rf conftest*
2994   lt_cv_cc_needs_belf=no
2995 fi
2996 rm -f conftest*
2997 fi
2998
2999 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
3000   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
3001     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
3002     CFLAGS="$SAVE_CFLAGS"
3003   fi
3004   ;;
3005
3006
3007 esac
3008
3009
3010 # Save cache, so that ltconfig can load it
3011
3012
3013 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
3014 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
3015 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
3016 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
3017 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
3018 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
3019 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
3020 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
3021
3022 # Reload cache, that may have been modified by ltconfig
3023
3024
3025 # This can be used to rebuild libtool when needed
3026 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
3027
3028 # Always use our own libtool.
3029 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3030
3031 # Redirect the config.log output again, so that the ltconfig log is not
3032 # clobbered by the next message.
3033 exec 5>>./config.log
3034
3035
3036 for ac_prog in mawk gawk nawk awk
3037 do
3038 # Extract the first word of "$ac_prog", so it can be a program name with args.
3039 set dummy $ac_prog; ac_word=$2
3040 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3041 echo "configure:3042: checking for $ac_word" >&5
3042 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
3043   echo $ac_n "(cached) $ac_c" 1>&6
3044 else
3045   if test -n "$AWK"; then
3046   ac_cv_prog_AWK="$AWK" # Let the user override the test.
3047 else
3048   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3049   ac_dummy="$PATH"
3050   for ac_dir in $ac_dummy; do
3051     test -z "$ac_dir" && ac_dir=.
3052     if test -f $ac_dir/$ac_word; then
3053       ac_cv_prog_AWK="$ac_prog"
3054       break
3055     fi
3056   done
3057   IFS="$ac_save_ifs"
3058 fi
3059 fi
3060 AWK="$ac_cv_prog_AWK"
3061 if test -n "$AWK"; then
3062   echo "$ac_t""$AWK" 1>&6
3063 else
3064   echo "$ac_t""no" 1>&6
3065 fi
3066
3067 test -n "$AWK" && break
3068 done
3069
3070 # test for ln hardlink support
3071 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
3072 echo "configure:3073: checking whether ln works" >&5
3073 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
3074   echo $ac_n "(cached) $ac_c" 1>&6
3075 else
3076   rm -f conftest.src conftest.dst
3077 echo "conftest" > conftest.src
3078 if ln conftest.src conftest.dst 2>/dev/null
3079 then
3080   ol_cv_prog_LN_H="ln"
3081 else
3082   ol_cv_prog_LN_H="cp"
3083 fi
3084 rm -f conftest.src conftest.dst
3085
3086 fi
3087 LN_H="$ol_cv_prog_LN_H"
3088 if test "$ol_cv_prog_LN_H" = "ln"; then
3089         echo "$ac_t""yes" 1>&6
3090 else
3091         echo "$ac_t""no" 1>&6
3092 fi
3093
3094 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3095 echo "configure:3096: checking whether ln -s works" >&5
3096 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3097   echo $ac_n "(cached) $ac_c" 1>&6
3098 else
3099   rm -f conftestdata
3100 if ln -s X conftestdata 2>/dev/null
3101 then
3102   rm -f conftestdata
3103   ac_cv_prog_LN_S="ln -s"
3104 else
3105   ac_cv_prog_LN_S=ln
3106 fi
3107 fi
3108 LN_S="$ac_cv_prog_LN_S"
3109 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3110   echo "$ac_t""yes" 1>&6
3111 else
3112   echo "$ac_t""no" 1>&6
3113 fi
3114
3115
3116 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
3117         LN_S="$LN_H"
3118 fi
3119
3120 # Extract the first word of "sendmail", so it can be a program name with args.
3121 set dummy sendmail; ac_word=$2
3122 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3123 echo "configure:3124: checking for $ac_word" >&5
3124 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
3125   echo $ac_n "(cached) $ac_c" 1>&6
3126 else
3127   case "$SENDMAIL" in
3128   /*)
3129   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
3130   ;;
3131   ?:/*)                  
3132   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
3133   ;;
3134   *)
3135   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3136   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
3137   for ac_dir in $ac_dummy; do 
3138     test -z "$ac_dir" && ac_dir=.
3139     if test -f $ac_dir/$ac_word; then
3140       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
3141       break
3142     fi
3143   done
3144   IFS="$ac_save_ifs"
3145   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
3146   ;;
3147 esac
3148 fi
3149 SENDMAIL="$ac_cv_path_SENDMAIL"
3150 if test -n "$SENDMAIL"; then
3151   echo "$ac_t""$SENDMAIL" 1>&6
3152 else
3153   echo "$ac_t""no" 1>&6
3154 fi
3155
3156 # Extract the first word of "vi", so it can be a program name with args.
3157 set dummy vi; ac_word=$2
3158 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3159 echo "configure:3160: checking for $ac_word" >&5
3160 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
3161   echo $ac_n "(cached) $ac_c" 1>&6
3162 else
3163   case "$EDITOR" in
3164   /*)
3165   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
3166   ;;
3167   ?:/*)                  
3168   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
3169   ;;
3170   *)
3171   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3172   ac_dummy="$PATH:/usr/ucb"
3173   for ac_dir in $ac_dummy; do 
3174     test -z "$ac_dir" && ac_dir=.
3175     if test -f $ac_dir/$ac_word; then
3176       ac_cv_path_EDITOR="$ac_dir/$ac_word"
3177       break
3178     fi
3179   done
3180   IFS="$ac_save_ifs"
3181   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
3182   ;;
3183 esac
3184 fi
3185 EDITOR="$ac_cv_path_EDITOR"
3186 if test -n "$EDITOR"; then
3187   echo "$ac_t""$EDITOR" 1>&6
3188 else
3189   echo "$ac_t""no" 1>&6
3190 fi
3191
3192 # Extract the first word of "finger", so it can be a program name with args.
3193 set dummy finger; ac_word=$2
3194 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3195 echo "configure:3196: checking for $ac_word" >&5
3196 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
3197   echo $ac_n "(cached) $ac_c" 1>&6
3198 else
3199   case "$FINGER" in
3200   /*)
3201   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
3202   ;;
3203   ?:/*)                  
3204   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
3205   ;;
3206   *)
3207   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3208   ac_dummy="$PATH:/usr/ucb"
3209   for ac_dir in $ac_dummy; do 
3210     test -z "$ac_dir" && ac_dir=.
3211     if test -f $ac_dir/$ac_word; then
3212       ac_cv_path_FINGER="$ac_dir/$ac_word"
3213       break
3214     fi
3215   done
3216   IFS="$ac_save_ifs"
3217   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
3218   ;;
3219 esac
3220 fi
3221 FINGER="$ac_cv_path_FINGER"
3222 if test -n "$FINGER"; then
3223   echo "$ac_t""$FINGER" 1>&6
3224 else
3225   echo "$ac_t""no" 1>&6
3226 fi
3227
3228
3229 ol_link_perl=no
3230 if test $ol_enable_perl != no ; then
3231         # Extract the first word of "perl", so it can be a program name with args.
3232 set dummy perl; ac_word=$2
3233 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3234 echo "configure:3235: checking for $ac_word" >&5
3235 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
3236   echo $ac_n "(cached) $ac_c" 1>&6
3237 else
3238   case "$PERLBIN" in
3239   /*)
3240   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
3241   ;;
3242   ?:/*)                  
3243   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
3244   ;;
3245   *)
3246   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3247   ac_dummy="$PATH"
3248   for ac_dir in $ac_dummy; do 
3249     test -z "$ac_dir" && ac_dir=.
3250     if test -f $ac_dir/$ac_word; then
3251       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
3252       break
3253     fi
3254   done
3255   IFS="$ac_save_ifs"
3256   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
3257   ;;
3258 esac
3259 fi
3260 PERLBIN="$ac_cv_path_PERLBIN"
3261 if test -n "$PERLBIN"; then
3262   echo "$ac_t""$PERLBIN" 1>&6
3263 else
3264   echo "$ac_t""no" 1>&6
3265 fi
3266
3267
3268         if test "no$PERLBIN" = "no" ; then
3269                 if test $ol_enable_perl = yes ; then
3270                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
3271                 fi
3272
3273         else
3274                 SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3275                 SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
3276
3277                                 ol_link_perl=yes
3278         fi
3279 fi
3280
3281 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3282 echo "configure:3283: checking how to run the C preprocessor" >&5
3283 # On Suns, sometimes $CPP names a directory.
3284 if test -n "$CPP" && test -d "$CPP"; then
3285   CPP=
3286 fi
3287 if test -z "$CPP"; then
3288 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3289   echo $ac_n "(cached) $ac_c" 1>&6
3290 else
3291     # This must be in double quotes, not single quotes, because CPP may get
3292   # substituted into the Makefile and "${CC-cc}" will confuse make.
3293   CPP="${CC-cc} -E"
3294   # On the NeXT, cc -E runs the code through the compiler's parser,
3295   # not just through cpp.
3296   cat > conftest.$ac_ext <<EOF
3297 #line 3298 "configure"
3298 #include "confdefs.h"
3299 #include <assert.h>
3300 Syntax Error
3301 EOF
3302 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3303 { (eval echo configure:3304: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3304 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3305 if test -z "$ac_err"; then
3306   :
3307 else
3308   echo "$ac_err" >&5
3309   echo "configure: failed program was:" >&5
3310   cat conftest.$ac_ext >&5
3311   rm -rf conftest*
3312   CPP="${CC-cc} -E -traditional-cpp"
3313   cat > conftest.$ac_ext <<EOF
3314 #line 3315 "configure"
3315 #include "confdefs.h"
3316 #include <assert.h>
3317 Syntax Error
3318 EOF
3319 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3320 { (eval echo configure:3321: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3321 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3322 if test -z "$ac_err"; then
3323   :
3324 else
3325   echo "$ac_err" >&5
3326   echo "configure: failed program was:" >&5
3327   cat conftest.$ac_ext >&5
3328   rm -rf conftest*
3329   CPP="${CC-cc} -nologo -E"
3330   cat > conftest.$ac_ext <<EOF
3331 #line 3332 "configure"
3332 #include "confdefs.h"
3333 #include <assert.h>
3334 Syntax Error
3335 EOF
3336 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3337 { (eval echo configure:3338: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3338 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3339 if test -z "$ac_err"; then
3340   :
3341 else
3342   echo "$ac_err" >&5
3343   echo "configure: failed program was:" >&5
3344   cat conftest.$ac_ext >&5
3345   rm -rf conftest*
3346   CPP=/lib/cpp
3347 fi
3348 rm -f conftest*
3349 fi
3350 rm -f conftest*
3351 fi
3352 rm -f conftest*
3353   ac_cv_prog_CPP="$CPP"
3354 fi
3355   CPP="$ac_cv_prog_CPP"
3356 else
3357   ac_cv_prog_CPP="$CPP"
3358 fi
3359 echo "$ac_t""$CPP" 1>&6
3360
3361
3362 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3363         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3364
3365 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3366         echo "configure: warning: programs compiled here do run here..." 1>&2
3367         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3368
3369 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3370         echo "configure: warning: programs compiled here do not run here..." 1>&2
3371         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3372 fi
3373
3374 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3375 echo "configure:3376: checking for AIX" >&5
3376 cat > conftest.$ac_ext <<EOF
3377 #line 3378 "configure"
3378 #include "confdefs.h"
3379 #ifdef _AIX
3380   yes
3381 #endif
3382
3383 EOF
3384 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3385   egrep "yes" >/dev/null 2>&1; then
3386   rm -rf conftest*
3387   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3388 #define _ALL_SOURCE 1
3389 EOF
3390
3391 else
3392   rm -rf conftest*
3393   echo "$ac_t""no" 1>&6
3394 fi
3395 rm -f conftest*
3396
3397
3398 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3399 echo "configure:3400: checking for POSIXized ISC" >&5
3400 if test -d /etc/conf/kconfig.d &&
3401   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3402 then
3403   echo "$ac_t""yes" 1>&6
3404   ISC=yes # If later tests want to check for ISC.
3405   cat >> confdefs.h <<\EOF
3406 #define _POSIX_SOURCE 1
3407 EOF
3408
3409   if test "$GCC" = yes; then
3410     CC="$CC -posix"
3411   else
3412     CC="$CC -Xp"
3413   fi
3414 else
3415   echo "$ac_t""no" 1>&6
3416   ISC=
3417 fi
3418
3419 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3420 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3421 echo "configure:3422: checking for minix/config.h" >&5
3422 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3423   echo $ac_n "(cached) $ac_c" 1>&6
3424 else
3425   cat > conftest.$ac_ext <<EOF
3426 #line 3427 "configure"
3427 #include "confdefs.h"
3428 #include <minix/config.h>
3429 EOF
3430 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3431 { (eval echo configure:3432: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3432 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3433 if test -z "$ac_err"; then
3434   rm -rf conftest*
3435   eval "ac_cv_header_$ac_safe=yes"
3436 else
3437   echo "$ac_err" >&5
3438   echo "configure: failed program was:" >&5
3439   cat conftest.$ac_ext >&5
3440   rm -rf conftest*
3441   eval "ac_cv_header_$ac_safe=no"
3442 fi
3443 rm -f conftest*
3444 fi
3445 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3446   echo "$ac_t""yes" 1>&6
3447   MINIX=yes
3448 else
3449   echo "$ac_t""no" 1>&6
3450 MINIX=
3451 fi
3452
3453 if test "$MINIX" = yes; then
3454   cat >> confdefs.h <<\EOF
3455 #define _POSIX_SOURCE 1
3456 EOF
3457
3458   cat >> confdefs.h <<\EOF
3459 #define _POSIX_1_SOURCE 2
3460 EOF
3461
3462   cat >> confdefs.h <<\EOF
3463 #define _MINIX 1
3464 EOF
3465
3466 fi
3467
3468
3469 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3470 echo "configure:3471: checking for Cygwin environment" >&5
3471 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
3472   echo $ac_n "(cached) $ac_c" 1>&6
3473 else
3474   cat > conftest.$ac_ext <<EOF
3475 #line 3476 "configure"
3476 #include "confdefs.h"
3477
3478 int main() {
3479
3480 #ifndef __CYGWIN__
3481 #define __CYGWIN__ __CYGWIN32__
3482 #endif
3483 return __CYGWIN__;
3484 ; return 0; }
3485 EOF
3486 if { (eval echo configure:3487: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3487   rm -rf conftest*
3488   ac_cv_cygwin=yes
3489 else
3490   echo "configure: failed program was:" >&5
3491   cat conftest.$ac_ext >&5
3492   rm -rf conftest*
3493   ac_cv_cygwin=no
3494 fi
3495 rm -f conftest*
3496 fi
3497
3498 echo "$ac_t""$ac_cv_cygwin" 1>&6
3499 CYGWIN=
3500 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3501 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3502 echo "configure:3503: checking for mingw32 environment" >&5
3503 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
3504   echo $ac_n "(cached) $ac_c" 1>&6
3505 else
3506   cat > conftest.$ac_ext <<EOF
3507 #line 3508 "configure"
3508 #include "confdefs.h"
3509
3510 int main() {
3511 return __MINGW32__;
3512 ; return 0; }
3513 EOF
3514 if { (eval echo configure:3515: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3515   rm -rf conftest*
3516   ac_cv_mingw32=yes
3517 else
3518   echo "configure: failed program was:" >&5
3519   cat conftest.$ac_ext >&5
3520   rm -rf conftest*
3521   ac_cv_mingw32=no
3522 fi
3523 rm -f conftest*
3524 fi
3525
3526 echo "$ac_t""$ac_cv_mingw32" 1>&6
3527 MINGW32=
3528 test "$ac_cv_mingw32" = yes && MINGW32=yes
3529 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
3530 echo "configure:3531: checking for EMX OS/2 environment" >&5
3531 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
3532   echo $ac_n "(cached) $ac_c" 1>&6
3533 else
3534   cat > conftest.$ac_ext <<EOF
3535 #line 3536 "configure"
3536 #include "confdefs.h"
3537
3538 int main() {
3539 return __EMX__;
3540 ; return 0; }
3541 EOF
3542 if { (eval echo configure:3543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3543   rm -rf conftest*
3544   ac_cv_emxos2=yes
3545 else
3546   echo "configure: failed program was:" >&5
3547   cat conftest.$ac_ext >&5
3548   rm -rf conftest*
3549   ac_cv_emxos2=no
3550 fi
3551 rm -f conftest*
3552 fi
3553
3554 echo "$ac_t""$ac_cv_emxos2" 1>&6
3555 EMXOS2=
3556 test "$ac_cv_emxos2" = yes && EMXOS2=yes
3557
3558
3559
3560 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
3561 echo "configure:3562: checking for executable suffix" >&5
3562 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
3563   echo $ac_n "(cached) $ac_c" 1>&6
3564 else
3565   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
3566   ac_cv_exeext=.exe
3567 else
3568   rm -f conftest*
3569   echo 'int main () { return 0; }' > conftest.$ac_ext
3570   ac_cv_exeext=
3571   if { (eval echo configure:3572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
3572     for file in conftest.*; do
3573       case $file in
3574       *.c | *.C | *.o | *.obj | *.xcoff) ;;
3575       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
3576       esac
3577     done
3578   else
3579     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
3580   fi
3581   rm -f conftest*
3582   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
3583 fi
3584 fi
3585
3586 EXEEXT=""
3587 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
3588 echo "$ac_t""${ac_cv_exeext}" 1>&6
3589 ac_exeext=$EXEEXT
3590
3591 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3592 echo "configure:3593: checking for object suffix" >&5
3593 if eval "test \"\${ac_cv_objext+set}\" = set"; then
3594   echo $ac_n "(cached) $ac_c" 1>&6
3595 else
3596   rm -f conftest*
3597 echo 'int i = 1;' > conftest.$ac_ext
3598 if { (eval echo configure:3599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3599   for ac_file in conftest.*; do
3600     case $ac_file in
3601     *.c) ;;
3602     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
3603     esac
3604   done
3605 else
3606   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
3607 fi
3608 rm -f conftest*
3609 fi
3610
3611 echo "$ac_t""$ac_cv_objext" 1>&6
3612 OBJEXT=$ac_cv_objext
3613 ac_objext=$ac_cv_objext
3614
3615
3616 cat >> confdefs.h <<EOF
3617 #define EXEEXT "${EXEEXT}"
3618 EOF
3619
3620
3621 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
3622 echo "configure:3623: checking for be_app in -lbe" >&5
3623 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
3624 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3625   echo $ac_n "(cached) $ac_c" 1>&6
3626 else
3627   ac_save_LIBS="$LIBS"
3628 LIBS="-lbe -lroot -lnet $LIBS"
3629 cat > conftest.$ac_ext <<EOF
3630 #line 3631 "configure"
3631 #include "confdefs.h"
3632 /* Override any gcc2 internal prototype to avoid an error.  */
3633 /* We use char because int might match the return type of a gcc2
3634     builtin and then its argument prototype would still apply.  */
3635 char be_app();
3636
3637 int main() {
3638 be_app()
3639 ; return 0; }
3640 EOF
3641 if { (eval echo configure:3642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3642   rm -rf conftest*
3643   eval "ac_cv_lib_$ac_lib_var=yes"
3644 else
3645   echo "configure: failed program was:" >&5
3646   cat conftest.$ac_ext >&5
3647   rm -rf conftest*
3648   eval "ac_cv_lib_$ac_lib_var=no"
3649 fi
3650 rm -f conftest*
3651 LIBS="$ac_save_LIBS"
3652
3653 fi
3654 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3655   echo "$ac_t""yes" 1>&6
3656   LIBS="$LIBS -lbe -lroot -lnet"
3657 else
3658   echo "$ac_t""no" 1>&6
3659 :
3660 fi
3661
3662
3663
3664
3665
3666 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
3667 echo "configure:3668: checking for ${CC-cc} option to accept ANSI C" >&5
3668 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
3669   echo $ac_n "(cached) $ac_c" 1>&6
3670 else
3671   am_cv_prog_cc_stdc=no
3672 ac_save_CC="$CC"
3673 # Don't try gcc -ansi; that turns off useful extensions and
3674 # breaks some systems' header files.
3675 # AIX                   -qlanglvl=ansi
3676 # Ultrix and OSF/1      -std1
3677 # HP-UX 10.20 and later -Ae
3678 # HP-UX older versions  -Aa -D_HPUX_SOURCE
3679 # SVR4                  -Xc -D__EXTENSIONS__
3680 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3681 do
3682   CC="$ac_save_CC $ac_arg"
3683   cat > conftest.$ac_ext <<EOF
3684 #line 3685 "configure"
3685 #include "confdefs.h"
3686 #include <stdarg.h>
3687 #include <stdio.h>
3688 #include <sys/types.h>
3689 #include <sys/stat.h>
3690 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3691 struct buf { int x; };
3692 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3693 static char *e (p, i)
3694      char **p;
3695      int i;
3696 {
3697   return p[i];
3698 }
3699 static char *f (char * (*g) (char **, int), char **p, ...)
3700 {
3701   char *s;
3702   va_list v;
3703   va_start (v,p);
3704   s = g (p, va_arg (v,int));
3705   va_end (v);
3706   return s;
3707 }
3708 int test (int i, double x);
3709 struct s1 {int (*f) (int a);};
3710 struct s2 {int (*f) (double a);};
3711 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3712 int argc;
3713 char **argv;
3714
3715 int main() {
3716
3717 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3718
3719 ; return 0; }
3720 EOF
3721 if { (eval echo configure:3722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3722   rm -rf conftest*
3723   am_cv_prog_cc_stdc="$ac_arg"; break
3724 else
3725   echo "configure: failed program was:" >&5
3726   cat conftest.$ac_ext >&5
3727 fi
3728 rm -f conftest*
3729 done
3730 CC="$ac_save_CC"
3731
3732 fi
3733
3734 if test -z "$am_cv_prog_cc_stdc"; then
3735   echo "$ac_t""none needed" 1>&6
3736 else
3737   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
3738 fi
3739 case "x$am_cv_prog_cc_stdc" in
3740   x|xno) ;;
3741   *) CC="$CC $am_cv_prog_cc_stdc" ;;
3742 esac
3743
3744 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
3745         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
3746 fi
3747
3748 # test for make depend flag
3749 OL_MKDEP=
3750 OL_MKDEP_FLAGS=
3751 if test -z "${MKDEP}"; then
3752         OL_MKDEP="${CC-cc}"
3753         if test -z "${MKDEP_FLAGS}"; then
3754                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
3755 echo "configure:3756: checking for ${OL_MKDEP} depend flag" >&5
3756 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
3757   echo $ac_n "(cached) $ac_c" 1>&6
3758 else
3759   
3760                         ol_cv_mkdep=no
3761                         for flag in "-M" "-xM"; do
3762                                 cat > conftest.c <<EOF
3763  noCode;
3764 EOF
3765                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3766: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
3766                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
3767                                 then
3768                                         if test ! -f conftest."${ac_object}" ; then
3769                                                 ol_cv_mkdep=$flag
3770                                                 OL_MKDEP_FLAGS="$flag"
3771                                                 break
3772                                         fi
3773                                 fi
3774                         done
3775                         rm -f conftest*
3776                 
3777 fi
3778
3779 echo "$ac_t""$ol_cv_mkdep" 1>&6
3780         else
3781                 cc_cv_mkdep=yes
3782                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3783         fi
3784 else
3785         cc_cv_mkdep=yes
3786         OL_MKDEP="${MKDEP}"
3787         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3788 fi
3789
3790
3791
3792 if test "${ol_cv_mkdep}" = no ; then
3793         # this will soon become an error
3794         echo "configure: warning: do not know how to generate dependencies" 1>&2
3795 fi
3796
3797 ol_link_modules=no
3798 if test $ol_enable_modules != no ; then
3799         for ac_hdr in ltdl.h
3800 do
3801 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3802 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3803 echo "configure:3804: checking for $ac_hdr" >&5
3804 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3805   echo $ac_n "(cached) $ac_c" 1>&6
3806 else
3807   cat > conftest.$ac_ext <<EOF
3808 #line 3809 "configure"
3809 #include "confdefs.h"
3810 #include <$ac_hdr>
3811 EOF
3812 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3813 { (eval echo configure:3814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3814 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3815 if test -z "$ac_err"; then
3816   rm -rf conftest*
3817   eval "ac_cv_header_$ac_safe=yes"
3818 else
3819   echo "$ac_err" >&5
3820   echo "configure: failed program was:" >&5
3821   cat conftest.$ac_ext >&5
3822   rm -rf conftest*
3823   eval "ac_cv_header_$ac_safe=no"
3824 fi
3825 rm -f conftest*
3826 fi
3827 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3828   echo "$ac_t""yes" 1>&6
3829     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3830   cat >> confdefs.h <<EOF
3831 #define $ac_tr_hdr 1
3832 EOF
3833  
3834 else
3835   echo "$ac_t""no" 1>&6
3836 fi
3837 done
3838
3839
3840         if test $ac_cv_header_ltdl_h = no ; then
3841                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
3842         fi
3843
3844         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
3845 echo "configure:3846: checking for lt_dlinit in -lltdl" >&5
3846 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
3847 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3848   echo $ac_n "(cached) $ac_c" 1>&6
3849 else
3850   ac_save_LIBS="$LIBS"
3851 LIBS="-lltdl  $LIBS"
3852 cat > conftest.$ac_ext <<EOF
3853 #line 3854 "configure"
3854 #include "confdefs.h"
3855 /* Override any gcc2 internal prototype to avoid an error.  */
3856 /* We use char because int might match the return type of a gcc2
3857     builtin and then its argument prototype would still apply.  */
3858 char lt_dlinit();
3859
3860 int main() {
3861 lt_dlinit()
3862 ; return 0; }
3863 EOF
3864 if { (eval echo configure:3865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3865   rm -rf conftest*
3866   eval "ac_cv_lib_$ac_lib_var=yes"
3867 else
3868   echo "configure: failed program was:" >&5
3869   cat conftest.$ac_ext >&5
3870   rm -rf conftest*
3871   eval "ac_cv_lib_$ac_lib_var=no"
3872 fi
3873 rm -f conftest*
3874 LIBS="$ac_save_LIBS"
3875
3876 fi
3877 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3878   echo "$ac_t""yes" 1>&6
3879     ac_tr_lib=HAVE_LIB`echo ltdl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3880     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3881   cat >> confdefs.h <<EOF
3882 #define $ac_tr_lib 1
3883 EOF
3884
3885   LIBS="-lltdl $LIBS"
3886
3887 else
3888   echo "$ac_t""no" 1>&6
3889 fi
3890
3891         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
3892                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
3893         fi
3894         ol_link_modules=yes
3895
3896 else
3897         ol_with_bdb2_module=static
3898         ol_with_ldap_module=static
3899         ol_with_ldbm_module=static
3900         ol_with_passwd_module=static
3901         ol_with_perl_module=static
3902         ol_with_shell_module=static
3903         ol_with_tcl_module=static
3904 fi
3905
3906 # test for EBCDIC
3907 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
3908 echo "configure:3909: checking for EBCDIC" >&5
3909 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
3910   echo $ac_n "(cached) $ac_c" 1>&6
3911 else
3912   
3913         cat > conftest.$ac_ext <<EOF
3914 #line 3915 "configure"
3915 #include "confdefs.h"
3916
3917 #if !('M' == 0xd4)
3918 #include <__ASCII__/generate_error.h>
3919 #endif
3920
3921 EOF
3922 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3923 { (eval echo configure:3924: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3924 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3925 if test -z "$ac_err"; then
3926   rm -rf conftest*
3927   ol_cv_cpp_ebcdic=yes
3928 else
3929   echo "$ac_err" >&5
3930   echo "configure: failed program was:" >&5
3931   cat conftest.$ac_ext >&5
3932   rm -rf conftest*
3933   ol_cv_cpp_ebcdic=no
3934 fi
3935 rm -f conftest*
3936 fi
3937
3938 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
3939 if test $ol_cv_cpp_ebcdic = yes ; then
3940         cat >> confdefs.h <<\EOF
3941 #define HAVE_EBCDIC 1
3942 EOF
3943
3944 fi
3945
3946 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3947 echo "configure:3948: checking for ANSI C header files" >&5
3948 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
3949   echo $ac_n "(cached) $ac_c" 1>&6
3950 else
3951   cat > conftest.$ac_ext <<EOF
3952 #line 3953 "configure"
3953 #include "confdefs.h"
3954 #include <stdlib.h>
3955 #include <stdarg.h>
3956 #include <string.h>
3957 #include <float.h>
3958 EOF
3959 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3960 { (eval echo configure:3961: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3961 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3962 if test -z "$ac_err"; then
3963   rm -rf conftest*
3964   ol_cv_header_stdc=yes
3965 else
3966   echo "$ac_err" >&5
3967   echo "configure: failed program was:" >&5
3968   cat conftest.$ac_ext >&5
3969   rm -rf conftest*
3970   ol_cv_header_stdc=no
3971 fi
3972 rm -f conftest*
3973
3974 if test $ol_cv_header_stdc = yes; then
3975   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3976 cat > conftest.$ac_ext <<EOF
3977 #line 3978 "configure"
3978 #include "confdefs.h"
3979 #include <string.h>
3980 EOF
3981 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3982   egrep "memchr" >/dev/null 2>&1; then
3983   :
3984 else
3985   rm -rf conftest*
3986   ol_cv_header_stdc=no
3987 fi
3988 rm -f conftest*
3989
3990 fi
3991
3992 if test $ol_cv_header_stdc = yes; then
3993   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3994 cat > conftest.$ac_ext <<EOF
3995 #line 3996 "configure"
3996 #include "confdefs.h"
3997 #include <stdlib.h>
3998 EOF
3999 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4000   egrep "free" >/dev/null 2>&1; then
4001   :
4002 else
4003   rm -rf conftest*
4004   ol_cv_header_stdc=no
4005 fi
4006 rm -f conftest*
4007
4008 fi
4009
4010 if test $ol_cv_header_stdc = yes; then
4011   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4012 if test "$cross_compiling" = yes; then
4013   :
4014 else
4015   cat > conftest.$ac_ext <<EOF
4016 #line 4017 "configure"
4017 #include "confdefs.h"
4018 #include <ctype.h>
4019 #ifndef HAVE_EBCDIC
4020 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4021 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4022 #else
4023 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4024                 || ('j' <= (c) && (c) <= 'r') \
4025                 || ('s' <= (c) && (c) <= 'z'))
4026 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
4027 #endif
4028 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4029 int main () { int i; for (i = 0; i < 256; i++)
4030 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4031 exit (0); }
4032
4033 EOF
4034 if { (eval echo configure:4035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4035 then
4036   :
4037 else
4038   echo "configure: failed program was:" >&5
4039   cat conftest.$ac_ext >&5
4040   rm -fr conftest*
4041   ol_cv_header_stdc=no
4042 fi
4043 rm -fr conftest*
4044 fi
4045
4046 fi
4047 fi
4048
4049 echo "$ac_t""$ol_cv_header_stdc" 1>&6
4050 if test $ol_cv_header_stdc = yes; then
4051   cat >> confdefs.h <<\EOF
4052 #define STDC_HEADERS 1
4053 EOF
4054
4055 fi
4056 ac_cv_header_stdc=disable
4057
4058
4059 if test $ol_cv_header_stdc != yes; then
4060         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
4061 fi
4062
4063 ac_header_dirent=no
4064 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4065 do
4066 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4067 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4068 echo "configure:4069: checking for $ac_hdr that defines DIR" >&5
4069 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
4070   echo $ac_n "(cached) $ac_c" 1>&6
4071 else
4072   cat > conftest.$ac_ext <<EOF
4073 #line 4074 "configure"
4074 #include "confdefs.h"
4075 #include <sys/types.h>
4076 #include <$ac_hdr>
4077 int main() {
4078 DIR *dirp = 0;
4079 ; return 0; }
4080 EOF
4081 if { (eval echo configure:4082: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4082   rm -rf conftest*
4083   eval "ac_cv_header_dirent_$ac_safe=yes"
4084 else
4085   echo "configure: failed program was:" >&5
4086   cat conftest.$ac_ext >&5
4087   rm -rf conftest*
4088   eval "ac_cv_header_dirent_$ac_safe=no"
4089 fi
4090 rm -f conftest*
4091 fi
4092 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4093   echo "$ac_t""yes" 1>&6
4094     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4095   cat >> confdefs.h <<EOF
4096 #define $ac_tr_hdr 1
4097 EOF
4098  ac_header_dirent=$ac_hdr; break
4099 else
4100   echo "$ac_t""no" 1>&6
4101 fi
4102 done
4103 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4104 if test $ac_header_dirent = dirent.h; then
4105 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4106 echo "configure:4107: checking for opendir in -ldir" >&5
4107 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
4108 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4109   echo $ac_n "(cached) $ac_c" 1>&6
4110 else
4111   ac_save_LIBS="$LIBS"
4112 LIBS="-ldir  $LIBS"
4113 cat > conftest.$ac_ext <<EOF
4114 #line 4115 "configure"
4115 #include "confdefs.h"
4116 /* Override any gcc2 internal prototype to avoid an error.  */
4117 /* We use char because int might match the return type of a gcc2
4118     builtin and then its argument prototype would still apply.  */
4119 char opendir();
4120
4121 int main() {
4122 opendir()
4123 ; return 0; }
4124 EOF
4125 if { (eval echo configure:4126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4126   rm -rf conftest*
4127   eval "ac_cv_lib_$ac_lib_var=yes"
4128 else
4129   echo "configure: failed program was:" >&5
4130   cat conftest.$ac_ext >&5
4131   rm -rf conftest*
4132   eval "ac_cv_lib_$ac_lib_var=no"
4133 fi
4134 rm -f conftest*
4135 LIBS="$ac_save_LIBS"
4136
4137 fi
4138 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4139   echo "$ac_t""yes" 1>&6
4140   LIBS="$LIBS -ldir"
4141 else
4142   echo "$ac_t""no" 1>&6
4143 fi
4144
4145 else
4146 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4147 echo "configure:4148: checking for opendir in -lx" >&5
4148 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
4149 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4150   echo $ac_n "(cached) $ac_c" 1>&6
4151 else
4152   ac_save_LIBS="$LIBS"
4153 LIBS="-lx  $LIBS"
4154 cat > conftest.$ac_ext <<EOF
4155 #line 4156 "configure"
4156 #include "confdefs.h"
4157 /* Override any gcc2 internal prototype to avoid an error.  */
4158 /* We use char because int might match the return type of a gcc2
4159     builtin and then its argument prototype would still apply.  */
4160 char opendir();
4161
4162 int main() {
4163 opendir()
4164 ; return 0; }
4165 EOF
4166 if { (eval echo configure:4167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4167   rm -rf conftest*
4168   eval "ac_cv_lib_$ac_lib_var=yes"
4169 else
4170   echo "configure: failed program was:" >&5
4171   cat conftest.$ac_ext >&5
4172   rm -rf conftest*
4173   eval "ac_cv_lib_$ac_lib_var=no"
4174 fi
4175 rm -f conftest*
4176 LIBS="$ac_save_LIBS"
4177
4178 fi
4179 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4180   echo "$ac_t""yes" 1>&6
4181   LIBS="$LIBS -lx"
4182 else
4183   echo "$ac_t""no" 1>&6
4184 fi
4185
4186 fi
4187
4188 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4189 echo "configure:4190: checking for sys/wait.h that is POSIX.1 compatible" >&5
4190 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
4191   echo $ac_n "(cached) $ac_c" 1>&6
4192 else
4193   cat > conftest.$ac_ext <<EOF
4194 #line 4195 "configure"
4195 #include "confdefs.h"
4196 #include <sys/types.h>
4197 #include <sys/wait.h>
4198 #ifndef WEXITSTATUS
4199 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4200 #endif
4201 #ifndef WIFEXITED
4202 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4203 #endif
4204 int main() {
4205 int s;
4206 wait (&s);
4207 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4208 ; return 0; }
4209 EOF
4210 if { (eval echo configure:4211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4211   rm -rf conftest*
4212   ac_cv_header_sys_wait_h=yes
4213 else
4214   echo "configure: failed program was:" >&5
4215   cat conftest.$ac_ext >&5
4216   rm -rf conftest*
4217   ac_cv_header_sys_wait_h=no
4218 fi
4219 rm -f conftest*
4220 fi
4221
4222 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4223 if test $ac_cv_header_sys_wait_h = yes; then
4224   cat >> confdefs.h <<\EOF
4225 #define HAVE_SYS_WAIT_H 1
4226 EOF
4227
4228 fi
4229
4230 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4231 echo "configure:4232: checking POSIX termios" >&5
4232 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
4233   echo $ac_n "(cached) $ac_c" 1>&6
4234 else
4235   cat > conftest.$ac_ext <<EOF
4236 #line 4237 "configure"
4237 #include "confdefs.h"
4238 #include <sys/types.h>
4239 #include <unistd.h>
4240 #include <termios.h>
4241 int main() {
4242 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4243    tcgetattr(0, 0);
4244 ; return 0; }
4245 EOF
4246 if { (eval echo configure:4247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4247   rm -rf conftest*
4248   am_cv_sys_posix_termios=yes
4249 else
4250   echo "configure: failed program was:" >&5
4251   cat conftest.$ac_ext >&5
4252   rm -rf conftest*
4253   am_cv_sys_posix_termios=no
4254 fi
4255 rm -f conftest*
4256 fi
4257
4258 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4259
4260
4261  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4262 echo "configure:4263: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4263 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
4264   echo $ac_n "(cached) $ac_c" 1>&6
4265 else
4266   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4267
4268   gwinsz_in_termios_h=no
4269   if test $am_cv_sys_posix_termios = yes; then
4270     cat > conftest.$ac_ext <<EOF
4271 #line 4272 "configure"
4272 #include "confdefs.h"
4273 #include <sys/types.h>
4274 #     include <termios.h>
4275 #     ifdef TIOCGWINSZ
4276         yes
4277 #     endif
4278     
4279 EOF
4280 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4281   egrep "yes" >/dev/null 2>&1; then
4282   rm -rf conftest*
4283   gwinsz_in_termios_h=yes
4284 fi
4285 rm -f conftest*
4286
4287   fi
4288
4289   if test $gwinsz_in_termios_h = no; then
4290     cat > conftest.$ac_ext <<EOF
4291 #line 4292 "configure"
4292 #include "confdefs.h"
4293 #include <sys/types.h>
4294 #     include <sys/ioctl.h>
4295 #     ifdef TIOCGWINSZ
4296         yes
4297 #     endif
4298     
4299 EOF
4300 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4301   egrep "yes" >/dev/null 2>&1; then
4302   rm -rf conftest*
4303   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4304 fi
4305 rm -f conftest*
4306
4307   fi
4308   
4309 fi
4310
4311 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4312   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4313     cat >> confdefs.h <<\EOF
4314 #define GWINSZ_IN_SYS_IOCTL 1
4315 EOF
4316
4317   fi
4318
4319 if test $am_cv_sys_posix_termios = yes ; then
4320         cat >> confdefs.h <<\EOF
4321 #define HAVE_POSIX_TERMIOS 1
4322 EOF
4323
4324 fi
4325
4326 for ac_hdr in \
4327         arpa/inet.h             \
4328         arpa/nameser.h  \
4329         assert.h                \
4330         crypt.h                 \
4331         errno.h                 \
4332         fcntl.h                 \
4333         filio.h                 \
4334         getopt.h                \
4335         grp.h                   \
4336         libutil.h               \
4337         limits.h                \
4338         locale.h                \
4339         netinet/tcp.h   \
4340         malloc.h                \
4341         memory.h                \
4342         psap.h                  \
4343         pwd.h                   \
4344         resolv.h                \
4345         sgtty.h                 \
4346         shadow.h                \
4347         stddef.h                \
4348         string.h                \
4349         strings.h               \
4350         sysexits.h              \
4351         sys/file.h              \
4352         sys/filio.h             \
4353         sys/errno.h             \
4354         sys/ioctl.h             \
4355         sys/param.h             \
4356         sys/resource.h  \
4357         sys/select.h    \
4358         sys/socket.h    \
4359         sys/syslog.h    \
4360         sys/time.h              \
4361         sys/types.h             \
4362         syslog.h                \
4363         termios.h               \
4364         unistd.h                \
4365
4366 do
4367 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4368 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4369 echo "configure:4370: checking for $ac_hdr" >&5
4370 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4371   echo $ac_n "(cached) $ac_c" 1>&6
4372 else
4373   cat > conftest.$ac_ext <<EOF
4374 #line 4375 "configure"
4375 #include "confdefs.h"
4376 #include <$ac_hdr>
4377 EOF
4378 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4379 { (eval echo configure:4380: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4380 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4381 if test -z "$ac_err"; then
4382   rm -rf conftest*
4383   eval "ac_cv_header_$ac_safe=yes"
4384 else
4385   echo "$ac_err" >&5
4386   echo "configure: failed program was:" >&5
4387   cat conftest.$ac_ext >&5
4388   rm -rf conftest*
4389   eval "ac_cv_header_$ac_safe=no"
4390 fi
4391 rm -f conftest*
4392 fi
4393 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4394   echo "$ac_t""yes" 1>&6
4395     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4396   cat >> confdefs.h <<EOF
4397 #define $ac_tr_hdr 1
4398 EOF
4399  
4400 else
4401   echo "$ac_t""no" 1>&6
4402 fi
4403 done
4404
4405
4406
4407 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
4408 echo "configure:4409: checking for sigset in -lV3" >&5
4409 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
4410 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4411   echo $ac_n "(cached) $ac_c" 1>&6
4412 else
4413   ac_save_LIBS="$LIBS"
4414 LIBS="-lV3  $LIBS"
4415 cat > conftest.$ac_ext <<EOF
4416 #line 4417 "configure"
4417 #include "confdefs.h"
4418 /* Override any gcc2 internal prototype to avoid an error.  */
4419 /* We use char because int might match the return type of a gcc2
4420     builtin and then its argument prototype would still apply.  */
4421 char sigset();
4422
4423 int main() {
4424 sigset()
4425 ; return 0; }
4426 EOF
4427 if { (eval echo configure:4428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4428   rm -rf conftest*
4429   eval "ac_cv_lib_$ac_lib_var=yes"
4430 else
4431   echo "configure: failed program was:" >&5
4432   cat conftest.$ac_ext >&5
4433   rm -rf conftest*
4434   eval "ac_cv_lib_$ac_lib_var=no"
4435 fi
4436 rm -f conftest*
4437 LIBS="$ac_save_LIBS"
4438
4439 fi
4440 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4441   echo "$ac_t""yes" 1>&6
4442     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4443     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4444   cat >> confdefs.h <<EOF
4445 #define $ac_tr_lib 1
4446 EOF
4447
4448   LIBS="-lV3 $LIBS"
4449
4450 else
4451   echo "$ac_t""no" 1>&6
4452 fi
4453
4454
4455
4456 echo $ac_n "checking for socket""... $ac_c" 1>&6
4457 echo "configure:4458: checking for socket" >&5
4458 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
4459   echo $ac_n "(cached) $ac_c" 1>&6
4460 else
4461   cat > conftest.$ac_ext <<EOF
4462 #line 4463 "configure"
4463 #include "confdefs.h"
4464 /* System header to define __stub macros and hopefully few prototypes,
4465     which can conflict with char socket(); below.  */
4466 #include <assert.h>
4467 /* Override any gcc2 internal prototype to avoid an error.  */
4468 /* We use char because int might match the return type of a gcc2
4469     builtin and then its argument prototype would still apply.  */
4470 char socket();
4471 char (*f)();
4472
4473 int main() {
4474
4475 /* The GNU C library defines this for functions which it implements
4476     to always fail with ENOSYS.  Some functions are actually named
4477     something starting with __ and the normal name is an alias.  */
4478 #if defined (__stub_socket) || defined (__stub___socket)
4479 choke me
4480 #else
4481 f = socket;
4482 #endif
4483
4484 ; return 0; }
4485 EOF
4486 if { (eval echo configure:4487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4487   rm -rf conftest*
4488   eval "ac_cv_func_socket=yes"
4489 else
4490   echo "configure: failed program was:" >&5
4491   cat conftest.$ac_ext >&5
4492   rm -rf conftest*
4493   eval "ac_cv_func_socket=no"
4494 fi
4495 rm -f conftest*
4496 fi
4497
4498 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
4499   echo "$ac_t""yes" 1>&6
4500   :
4501 else
4502   echo "$ac_t""no" 1>&6
4503         
4504         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
4505 echo "configure:4506: checking for main in -lsocket" >&5
4506 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
4507 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4508   echo $ac_n "(cached) $ac_c" 1>&6
4509 else
4510   ac_save_LIBS="$LIBS"
4511 LIBS="-lsocket  $LIBS"
4512 cat > conftest.$ac_ext <<EOF
4513 #line 4514 "configure"
4514 #include "confdefs.h"
4515
4516 int main() {
4517 main()
4518 ; return 0; }
4519 EOF
4520 if { (eval echo configure:4521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4521   rm -rf conftest*
4522   eval "ac_cv_lib_$ac_lib_var=yes"
4523 else
4524   echo "configure: failed program was:" >&5
4525   cat conftest.$ac_ext >&5
4526   rm -rf conftest*
4527   eval "ac_cv_lib_$ac_lib_var=no"
4528 fi
4529 rm -f conftest*
4530 LIBS="$ac_save_LIBS"
4531
4532 fi
4533 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4534   echo "$ac_t""yes" 1>&6
4535     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4536     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4537   cat >> confdefs.h <<EOF
4538 #define $ac_tr_lib 1
4539 EOF
4540
4541   LIBS="-lsocket $LIBS"
4542
4543 else
4544   echo "$ac_t""no" 1>&6
4545 fi
4546
4547         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
4548 echo "configure:4549: checking for main in -lnet" >&5
4549 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
4550 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4551   echo $ac_n "(cached) $ac_c" 1>&6
4552 else
4553   ac_save_LIBS="$LIBS"
4554 LIBS="-lnet  $LIBS"
4555 cat > conftest.$ac_ext <<EOF
4556 #line 4557 "configure"
4557 #include "confdefs.h"
4558
4559 int main() {
4560 main()
4561 ; return 0; }
4562 EOF
4563 if { (eval echo configure:4564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4564   rm -rf conftest*
4565   eval "ac_cv_lib_$ac_lib_var=yes"
4566 else
4567   echo "configure: failed program was:" >&5
4568   cat conftest.$ac_ext >&5
4569   rm -rf conftest*
4570   eval "ac_cv_lib_$ac_lib_var=no"
4571 fi
4572 rm -f conftest*
4573 LIBS="$ac_save_LIBS"
4574
4575 fi
4576 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4577   echo "$ac_t""yes" 1>&6
4578     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4579     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4580   cat >> confdefs.h <<EOF
4581 #define $ac_tr_lib 1
4582 EOF
4583
4584   LIBS="-lnet $LIBS"
4585
4586 else
4587   echo "$ac_t""no" 1>&6
4588 fi
4589
4590         echo $ac_n "checking for socket in -lnet""... $ac_c" 1>&6
4591 echo "configure:4592: checking for socket in -lnet" >&5
4592 ac_lib_var=`echo net'_'socket | sed 'y%./+-:%__p__%'`
4593 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4594   echo $ac_n "(cached) $ac_c" 1>&6
4595 else
4596   ac_save_LIBS="$LIBS"
4597 LIBS="-lnet  $LIBS"
4598 cat > conftest.$ac_ext <<EOF
4599 #line 4600 "configure"
4600 #include "confdefs.h"
4601 /* Override any gcc2 internal prototype to avoid an error.  */
4602 /* We use char because int might match the return type of a gcc2
4603     builtin and then its argument prototype would still apply.  */
4604 char socket();
4605
4606 int main() {
4607 socket()
4608 ; return 0; }
4609 EOF
4610 if { (eval echo configure:4611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4611   rm -rf conftest*
4612   eval "ac_cv_lib_$ac_lib_var=yes"
4613 else
4614   echo "configure: failed program was:" >&5
4615   cat conftest.$ac_ext >&5
4616   rm -rf conftest*
4617   eval "ac_cv_lib_$ac_lib_var=no"
4618 fi
4619 rm -f conftest*
4620 LIBS="$ac_save_LIBS"
4621
4622 fi
4623 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4624   echo "$ac_t""yes" 1>&6
4625     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4626     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4627   cat >> confdefs.h <<EOF
4628 #define $ac_tr_lib 1
4629 EOF
4630
4631   LIBS="-lnet $LIBS"
4632
4633 else
4634   echo "$ac_t""no" 1>&6
4635 fi
4636
4637         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
4638 echo "configure:4639: checking for main in -lnsl_s" >&5
4639 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
4640 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4641   echo $ac_n "(cached) $ac_c" 1>&6
4642 else
4643   ac_save_LIBS="$LIBS"
4644 LIBS="-lnsl_s  $LIBS"
4645 cat > conftest.$ac_ext <<EOF
4646 #line 4647 "configure"
4647 #include "confdefs.h"
4648
4649 int main() {
4650 main()
4651 ; return 0; }
4652 EOF
4653 if { (eval echo configure:4654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4654   rm -rf conftest*
4655   eval "ac_cv_lib_$ac_lib_var=yes"
4656 else
4657   echo "configure: failed program was:" >&5
4658   cat conftest.$ac_ext >&5
4659   rm -rf conftest*
4660   eval "ac_cv_lib_$ac_lib_var=no"
4661 fi
4662 rm -f conftest*
4663 LIBS="$ac_save_LIBS"
4664
4665 fi
4666 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4667   echo "$ac_t""yes" 1>&6
4668     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4669     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4670   cat >> confdefs.h <<EOF
4671 #define $ac_tr_lib 1
4672 EOF
4673
4674   LIBS="-lnsl_s $LIBS"
4675
4676 else
4677   echo "$ac_t""no" 1>&6
4678 fi
4679
4680         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
4681 echo "configure:4682: checking for main in -lnsl" >&5
4682 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
4683 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4684   echo $ac_n "(cached) $ac_c" 1>&6
4685 else
4686   ac_save_LIBS="$LIBS"
4687 LIBS="-lnsl  $LIBS"
4688 cat > conftest.$ac_ext <<EOF
4689 #line 4690 "configure"
4690 #include "confdefs.h"
4691
4692 int main() {
4693 main()
4694 ; return 0; }
4695 EOF
4696 if { (eval echo configure:4697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4697   rm -rf conftest*
4698   eval "ac_cv_lib_$ac_lib_var=yes"
4699 else
4700   echo "configure: failed program was:" >&5
4701   cat conftest.$ac_ext >&5
4702   rm -rf conftest*
4703   eval "ac_cv_lib_$ac_lib_var=no"
4704 fi
4705 rm -f conftest*
4706 LIBS="$ac_save_LIBS"
4707
4708 fi
4709 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4710   echo "$ac_t""yes" 1>&6
4711     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4712     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4713   cat >> confdefs.h <<EOF
4714 #define $ac_tr_lib 1
4715 EOF
4716
4717   LIBS="-lnsl $LIBS"
4718
4719 else
4720   echo "$ac_t""no" 1>&6
4721 fi
4722
4723         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
4724 echo "configure:4725: checking for socket in -linet" >&5
4725 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
4726 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4727   echo $ac_n "(cached) $ac_c" 1>&6
4728 else
4729   ac_save_LIBS="$LIBS"
4730 LIBS="-linet  $LIBS"
4731 cat > conftest.$ac_ext <<EOF
4732 #line 4733 "configure"
4733 #include "confdefs.h"
4734 /* Override any gcc2 internal prototype to avoid an error.  */
4735 /* We use char because int might match the return type of a gcc2
4736     builtin and then its argument prototype would still apply.  */
4737 char socket();
4738
4739 int main() {
4740 socket()
4741 ; return 0; }
4742 EOF
4743 if { (eval echo configure:4744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4744   rm -rf conftest*
4745   eval "ac_cv_lib_$ac_lib_var=yes"
4746 else
4747   echo "configure: failed program was:" >&5
4748   cat conftest.$ac_ext >&5
4749   rm -rf conftest*
4750   eval "ac_cv_lib_$ac_lib_var=no"
4751 fi
4752 rm -f conftest*
4753 LIBS="$ac_save_LIBS"
4754
4755 fi
4756 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4757   echo "$ac_t""yes" 1>&6
4758     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4759     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4760   cat >> confdefs.h <<EOF
4761 #define $ac_tr_lib 1
4762 EOF
4763
4764   LIBS="-linet $LIBS"
4765
4766 else
4767   echo "$ac_t""no" 1>&6
4768 fi
4769
4770         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
4771 echo "configure:4772: checking for main in -lgen" >&5
4772 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
4773 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4774   echo $ac_n "(cached) $ac_c" 1>&6
4775 else
4776   ac_save_LIBS="$LIBS"
4777 LIBS="-lgen  $LIBS"
4778 cat > conftest.$ac_ext <<EOF
4779 #line 4780 "configure"
4780 #include "confdefs.h"
4781
4782 int main() {
4783 main()
4784 ; return 0; }
4785 EOF
4786 if { (eval echo configure:4787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4787   rm -rf conftest*
4788   eval "ac_cv_lib_$ac_lib_var=yes"
4789 else
4790   echo "configure: failed program was:" >&5
4791   cat conftest.$ac_ext >&5
4792   rm -rf conftest*
4793   eval "ac_cv_lib_$ac_lib_var=no"
4794 fi
4795 rm -f conftest*
4796 LIBS="$ac_save_LIBS"
4797
4798 fi
4799 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4800   echo "$ac_t""yes" 1>&6
4801     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4802     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4803   cat >> confdefs.h <<EOF
4804 #define $ac_tr_lib 1
4805 EOF
4806
4807   LIBS="-lgen $LIBS"
4808
4809 else
4810   echo "$ac_t""no" 1>&6
4811 fi
4812
4813
4814 fi
4815
4816
4817 echo $ac_n "checking for select""... $ac_c" 1>&6
4818 echo "configure:4819: checking for select" >&5
4819 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
4820   echo $ac_n "(cached) $ac_c" 1>&6
4821 else
4822   cat > conftest.$ac_ext <<EOF
4823 #line 4824 "configure"
4824 #include "confdefs.h"
4825 /* System header to define __stub macros and hopefully few prototypes,
4826     which can conflict with char select(); below.  */
4827 #include <assert.h>
4828 /* Override any gcc2 internal prototype to avoid an error.  */
4829 /* We use char because int might match the return type of a gcc2
4830     builtin and then its argument prototype would still apply.  */
4831 char select();
4832 char (*f)();
4833
4834 int main() {
4835
4836 /* The GNU C library defines this for functions which it implements
4837     to always fail with ENOSYS.  Some functions are actually named
4838     something starting with __ and the normal name is an alias.  */
4839 #if defined (__stub_select) || defined (__stub___select)
4840 choke me
4841 #else
4842 f = select;
4843 #endif
4844
4845 ; return 0; }
4846 EOF
4847 if { (eval echo configure:4848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4848   rm -rf conftest*
4849   eval "ac_cv_func_select=yes"
4850 else
4851   echo "configure: failed program was:" >&5
4852   cat conftest.$ac_ext >&5
4853   rm -rf conftest*
4854   eval "ac_cv_func_select=no"
4855 fi
4856 rm -f conftest*
4857 fi
4858
4859 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
4860   echo "$ac_t""yes" 1>&6
4861   :
4862 else
4863   echo "$ac_t""no" 1>&6
4864 { echo "configure: error: select() required." 1>&2; exit 1; }
4865 fi
4866
4867
4868 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
4869 echo "configure:4870: checking types of arguments for select()" >&5
4870  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
4871   echo $ac_n "(cached) $ac_c" 1>&6
4872 else
4873    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
4874   echo $ac_n "(cached) $ac_c" 1>&6
4875 else
4876     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
4877   echo $ac_n "(cached) $ac_c" 1>&6
4878 else
4879      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
4880      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
4881       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
4882        cat > conftest.$ac_ext <<EOF
4883 #line 4884 "configure"
4884 #include "confdefs.h"
4885 #ifdef HAVE_SYS_TYPES_H
4886 #include <sys/types.h>
4887 #endif
4888 #ifdef HAVE_SYS_TIME_H
4889 #include <sys/time.h>
4890 #endif
4891 #ifdef HAVE_SYS_SELECT_H
4892 #include <sys/select.h>
4893 #endif
4894 #ifdef HAVE_SYS_SOCKET_H
4895 #include <sys/socket.h>
4896 #endif
4897 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);
4898 int main() {
4899
4900 ; return 0; }
4901 EOF
4902 if { (eval echo configure:4903: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4903   rm -rf conftest*
4904           ac_not_found=no ; break 3
4905 else
4906   echo "configure: failed program was:" >&5
4907   cat conftest.$ac_ext >&5
4908   rm -rf conftest*
4909   ac_not_found=yes
4910 fi
4911 rm -f conftest*
4912       done
4913      done
4914     done
4915    
4916 fi
4917   
4918 fi
4919  
4920 fi
4921  if test "$ac_not_found" = yes; then
4922   ac_cv_func_select_arg1=int 
4923   ac_cv_func_select_arg234='int *' 
4924   ac_cv_func_select_arg5='struct timeval *'
4925  fi
4926  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
4927  cat >> confdefs.h <<EOF
4928 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
4929 EOF
4930
4931  cat >> confdefs.h <<EOF
4932 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
4933 EOF
4934
4935  cat >> confdefs.h <<EOF
4936 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
4937 EOF
4938
4939
4940
4941
4942 for ac_hdr in regex.h 
4943 do
4944 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4945 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4946 echo "configure:4947: checking for $ac_hdr" >&5
4947 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4948   echo $ac_n "(cached) $ac_c" 1>&6
4949 else
4950   cat > conftest.$ac_ext <<EOF
4951 #line 4952 "configure"
4952 #include "confdefs.h"
4953 #include <$ac_hdr>
4954 EOF
4955 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4956 { (eval echo configure:4957: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4957 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4958 if test -z "$ac_err"; then
4959   rm -rf conftest*
4960   eval "ac_cv_header_$ac_safe=yes"
4961 else
4962   echo "$ac_err" >&5
4963   echo "configure: failed program was:" >&5
4964   cat conftest.$ac_ext >&5
4965   rm -rf conftest*
4966   eval "ac_cv_header_$ac_safe=no"
4967 fi
4968 rm -f conftest*
4969 fi
4970 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4971   echo "$ac_t""yes" 1>&6
4972     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4973   cat >> confdefs.h <<EOF
4974 #define $ac_tr_hdr 1
4975 EOF
4976  
4977 else
4978   echo "$ac_t""no" 1>&6
4979 fi
4980 done
4981
4982 if test "$ac_cv_header_regex_h" != yes ; then
4983         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
4984 fi
4985 echo $ac_n "checking for regfree""... $ac_c" 1>&6
4986 echo "configure:4987: checking for regfree" >&5
4987 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
4988   echo $ac_n "(cached) $ac_c" 1>&6
4989 else
4990   cat > conftest.$ac_ext <<EOF
4991 #line 4992 "configure"
4992 #include "confdefs.h"
4993 /* System header to define __stub macros and hopefully few prototypes,
4994     which can conflict with char regfree(); below.  */
4995 #include <assert.h>
4996 /* Override any gcc2 internal prototype to avoid an error.  */
4997 /* We use char because int might match the return type of a gcc2
4998     builtin and then its argument prototype would still apply.  */
4999 char regfree();
5000 char (*f)();
5001
5002 int main() {
5003
5004 /* The GNU C library defines this for functions which it implements
5005     to always fail with ENOSYS.  Some functions are actually named
5006     something starting with __ and the normal name is an alias.  */
5007 #if defined (__stub_regfree) || defined (__stub___regfree)
5008 choke me
5009 #else
5010 f = regfree;
5011 #endif
5012
5013 ; return 0; }
5014 EOF
5015 if { (eval echo configure:5016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5016   rm -rf conftest*
5017   eval "ac_cv_func_regfree=yes"
5018 else
5019   echo "configure: failed program was:" >&5
5020   cat conftest.$ac_ext >&5
5021   rm -rf conftest*
5022   eval "ac_cv_func_regfree=no"
5023 fi
5024 rm -f conftest*
5025 fi
5026
5027 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
5028   echo "$ac_t""yes" 1>&6
5029   :
5030 else
5031   echo "$ac_t""no" 1>&6
5032 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
5033 fi
5034
5035
5036
5037 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
5038 echo "configure:5039: checking for compatible POSIX regex" >&5
5039 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
5040   echo $ac_n "(cached) $ac_c" 1>&6
5041 else
5042   
5043         if test "$cross_compiling" = yes; then
5044   ol_cv_c_posix_regex=cross
5045 else
5046   cat > conftest.$ac_ext <<EOF
5047 #line 5048 "configure"
5048 #include "confdefs.h"
5049
5050 #include <sys/types.h>
5051 #include <regex.h>
5052 static char *pattern, *string;
5053 main()
5054 {
5055         int rc;
5056         regex_t re;
5057
5058         pattern = "^A";
5059
5060         if(regcomp(&re, pattern, 0)) {
5061                 return -1;
5062         }
5063         
5064         string = "ALL MATCH";
5065         
5066         rc = regexec(&re, string, 0, (void*)0, 0);
5067
5068         regfree(&re);
5069
5070         return rc;
5071 }
5072 EOF
5073 if { (eval echo configure:5074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5074 then
5075   ol_cv_c_posix_regex=yes
5076 else
5077   echo "configure: failed program was:" >&5
5078   cat conftest.$ac_ext >&5
5079   rm -fr conftest*
5080   ol_cv_c_posix_regex=no
5081 fi
5082 rm -fr conftest*
5083 fi
5084
5085 fi
5086
5087 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5088
5089 if test "$ol_cv_c_posix_regex" = no ; then
5090         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5091 fi
5092
5093 echo $ac_n "checking for res_search""... $ac_c" 1>&6
5094 echo "configure:5095: checking for res_search" >&5
5095 if eval "test \"\${ac_cv_func_res_search+set}\" = set"; then
5096   echo $ac_n "(cached) $ac_c" 1>&6
5097 else
5098   cat > conftest.$ac_ext <<EOF
5099 #line 5100 "configure"
5100 #include "confdefs.h"
5101 /* System header to define __stub macros and hopefully few prototypes,
5102     which can conflict with char res_search(); below.  */
5103 #include <assert.h>
5104 /* Override any gcc2 internal prototype to avoid an error.  */
5105 /* We use char because int might match the return type of a gcc2
5106     builtin and then its argument prototype would still apply.  */
5107 char res_search();
5108 char (*f)();
5109
5110 int main() {
5111
5112 /* The GNU C library defines this for functions which it implements
5113     to always fail with ENOSYS.  Some functions are actually named
5114     something starting with __ and the normal name is an alias.  */
5115 #if defined (__stub_res_search) || defined (__stub___res_search)
5116 choke me
5117 #else
5118 f = res_search;
5119 #endif
5120
5121 ; return 0; }
5122 EOF
5123 if { (eval echo configure:5124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5124   rm -rf conftest*
5125   eval "ac_cv_func_res_search=yes"
5126 else
5127   echo "configure: failed program was:" >&5
5128   cat conftest.$ac_ext >&5
5129   rm -rf conftest*
5130   eval "ac_cv_func_res_search=no"
5131 fi
5132 rm -f conftest*
5133 fi
5134
5135 if eval "test \"`echo '$ac_cv_func_'res_search`\" = yes"; then
5136   echo "$ac_t""yes" 1>&6
5137   :
5138 else
5139   echo "$ac_t""no" 1>&6
5140 fi
5141
5142 if test $ac_cv_func_res_search = no ; then 
5143         echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
5144 echo "configure:5145: checking for res_search in -lbind" >&5
5145 ac_lib_var=`echo bind'_'res_search | sed 'y%./+-:%__p__%'`
5146 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5147   echo $ac_n "(cached) $ac_c" 1>&6
5148 else
5149   ac_save_LIBS="$LIBS"
5150 LIBS="-lbind  $LIBS"
5151 cat > conftest.$ac_ext <<EOF
5152 #line 5153 "configure"
5153 #include "confdefs.h"
5154 /* Override any gcc2 internal prototype to avoid an error.  */
5155 /* We use char because int might match the return type of a gcc2
5156     builtin and then its argument prototype would still apply.  */
5157 char res_search();
5158
5159 int main() {
5160 res_search()
5161 ; return 0; }
5162 EOF
5163 if { (eval echo configure:5164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5164   rm -rf conftest*
5165   eval "ac_cv_lib_$ac_lib_var=yes"
5166 else
5167   echo "configure: failed program was:" >&5
5168   cat conftest.$ac_ext >&5
5169   rm -rf conftest*
5170   eval "ac_cv_lib_$ac_lib_var=no"
5171 fi
5172 rm -f conftest*
5173 LIBS="$ac_save_LIBS"
5174
5175 fi
5176 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5177   echo "$ac_t""yes" 1>&6
5178     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5179     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5180   cat >> confdefs.h <<EOF
5181 #define $ac_tr_lib 1
5182 EOF
5183
5184   LIBS="-lbind $LIBS"
5185
5186 else
5187   echo "$ac_t""no" 1>&6
5188 fi
5189
5190         ac_cv_func_res_search=$ac_cv_lib_bind_res_search
5191 fi
5192
5193 if test $ac_cv_func_res_search = no ; then 
5194         echo $ac_n "checking for __res_search in -lbind""... $ac_c" 1>&6
5195 echo "configure:5196: checking for __res_search in -lbind" >&5
5196 ac_lib_var=`echo bind'_'__res_search | sed 'y%./+-:%__p__%'`
5197 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5198   echo $ac_n "(cached) $ac_c" 1>&6
5199 else
5200   ac_save_LIBS="$LIBS"
5201 LIBS="-lbind  $LIBS"
5202 cat > conftest.$ac_ext <<EOF
5203 #line 5204 "configure"
5204 #include "confdefs.h"
5205 /* Override any gcc2 internal prototype to avoid an error.  */
5206 /* We use char because int might match the return type of a gcc2
5207     builtin and then its argument prototype would still apply.  */
5208 char __res_search();
5209
5210 int main() {
5211 __res_search()
5212 ; return 0; }
5213 EOF
5214 if { (eval echo configure:5215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5215   rm -rf conftest*
5216   eval "ac_cv_lib_$ac_lib_var=yes"
5217 else
5218   echo "configure: failed program was:" >&5
5219   cat conftest.$ac_ext >&5
5220   rm -rf conftest*
5221   eval "ac_cv_lib_$ac_lib_var=no"
5222 fi
5223 rm -f conftest*
5224 LIBS="$ac_save_LIBS"
5225
5226 fi
5227 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5228   echo "$ac_t""yes" 1>&6
5229     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5230     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5231   cat >> confdefs.h <<EOF
5232 #define $ac_tr_lib 1
5233 EOF
5234
5235   LIBS="-lbind $LIBS"
5236
5237 else
5238   echo "$ac_t""no" 1>&6
5239 fi
5240
5241         ac_cv_func_res_search=$ac_cv_lib_bind___res_search
5242 fi
5243
5244 if test $ac_cv_func_res_search = no ; then 
5245         echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
5246 echo "configure:5247: checking for res_search in -lresolv" >&5
5247 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-:%__p__%'`
5248 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5249   echo $ac_n "(cached) $ac_c" 1>&6
5250 else
5251   ac_save_LIBS="$LIBS"
5252 LIBS="-lresolv  $LIBS"
5253 cat > conftest.$ac_ext <<EOF
5254 #line 5255 "configure"
5255 #include "confdefs.h"
5256 /* Override any gcc2 internal prototype to avoid an error.  */
5257 /* We use char because int might match the return type of a gcc2
5258     builtin and then its argument prototype would still apply.  */
5259 char res_search();
5260
5261 int main() {
5262 res_search()
5263 ; return 0; }
5264 EOF
5265 if { (eval echo configure:5266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5266   rm -rf conftest*
5267   eval "ac_cv_lib_$ac_lib_var=yes"
5268 else
5269   echo "configure: failed program was:" >&5
5270   cat conftest.$ac_ext >&5
5271   rm -rf conftest*
5272   eval "ac_cv_lib_$ac_lib_var=no"
5273 fi
5274 rm -f conftest*
5275 LIBS="$ac_save_LIBS"
5276
5277 fi
5278 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5279   echo "$ac_t""yes" 1>&6
5280     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5281     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5282   cat >> confdefs.h <<EOF
5283 #define $ac_tr_lib 1
5284 EOF
5285
5286   LIBS="-lresolv $LIBS"
5287
5288 else
5289   echo "$ac_t""no" 1>&6
5290 fi
5291
5292         ac_cv_func_res_search=$ac_cv_lib_resolv_res_search
5293 fi
5294
5295 if test "$ac_cv_func_res_search" = yes ; then
5296         cat >> confdefs.h <<\EOF
5297 #define HAVE_RES_SEARCH 1
5298 EOF
5299
5300 elif test $ol_enable_dns = yes ; then
5301         { echo "configure: error: --enable-dns requires res_search" 1>&2; exit 1; }
5302 elif test $ol_enable_dns != no ; then
5303         echo "configure: warning: no res_search, disabling DNS support" 1>&2
5304 fi
5305
5306
5307 ol_link_isode=no
5308 if test $ol_enable_ldapd != no ; then
5309         echo "configure: warning: ldapd is not supported and may suffer from bit rot." 1>&2
5310
5311                 echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
5312 echo "configure:5313: checking for main in -lxtpp" >&5
5313 ac_lib_var=`echo xtpp'_'main | sed 'y%./+-:%__p__%'`
5314 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5315   echo $ac_n "(cached) $ac_c" 1>&6
5316 else
5317   ac_save_LIBS="$LIBS"
5318 LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
5319 cat > conftest.$ac_ext <<EOF
5320 #line 5321 "configure"
5321 #include "confdefs.h"
5322
5323 int main() {
5324 main()
5325 ; return 0; }
5326 EOF
5327 if { (eval echo configure:5328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5328   rm -rf conftest*
5329   eval "ac_cv_lib_$ac_lib_var=yes"
5330 else
5331   echo "configure: failed program was:" >&5
5332   cat conftest.$ac_ext >&5
5333   rm -rf conftest*
5334   eval "ac_cv_lib_$ac_lib_var=no"
5335 fi
5336 rm -f conftest*
5337 LIBS="$ac_save_LIBS"
5338
5339 fi
5340 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5341   echo "$ac_t""yes" 1>&6
5342   
5343                 ol_link_isode=yes
5344                 cat >> confdefs.h <<\EOF
5345 #define HAVE_XTPP 1
5346 EOF
5347
5348                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
5349                 
5350 else
5351   echo "$ac_t""no" 1>&6
5352 :
5353 fi
5354
5355         echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
5356 echo "configure:5357: checking for main in -ldsap" >&5
5357 ac_lib_var=`echo dsap'_'main | sed 'y%./+-:%__p__%'`
5358 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5359   echo $ac_n "(cached) $ac_c" 1>&6
5360 else
5361   ac_save_LIBS="$LIBS"
5362 LIBS="-ldsap -lisode $LIBS"
5363 cat > conftest.$ac_ext <<EOF
5364 #line 5365 "configure"
5365 #include "confdefs.h"
5366
5367 int main() {
5368 main()
5369 ; return 0; }
5370 EOF
5371 if { (eval echo configure:5372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5372   rm -rf conftest*
5373   eval "ac_cv_lib_$ac_lib_var=yes"
5374 else
5375   echo "configure: failed program was:" >&5
5376   cat conftest.$ac_ext >&5
5377   rm -rf conftest*
5378   eval "ac_cv_lib_$ac_lib_var=no"
5379 fi
5380 rm -f conftest*
5381 LIBS="$ac_save_LIBS"
5382
5383 fi
5384 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5385   echo "$ac_t""yes" 1>&6
5386   
5387                 ol_link_isode=yes
5388                 cat >> confdefs.h <<\EOF
5389 #define HAVE_DSAP 1
5390 EOF
5391
5392                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
5393                 
5394 else
5395   echo "$ac_t""no" 1>&6
5396 :
5397 fi
5398
5399         echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
5400 echo "configure:5401: checking for main in -lisode" >&5
5401 ac_lib_var=`echo isode'_'main | sed 'y%./+-:%__p__%'`
5402 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5403   echo $ac_n "(cached) $ac_c" 1>&6
5404 else
5405   ac_save_LIBS="$LIBS"
5406 LIBS="-lisode  $LIBS"
5407 cat > conftest.$ac_ext <<EOF
5408 #line 5409 "configure"
5409 #include "confdefs.h"
5410
5411 int main() {
5412 main()
5413 ; return 0; }
5414 EOF
5415 if { (eval echo configure:5416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5416   rm -rf conftest*
5417   eval "ac_cv_lib_$ac_lib_var=yes"
5418 else
5419   echo "configure: failed program was:" >&5
5420   cat conftest.$ac_ext >&5
5421   rm -rf conftest*
5422   eval "ac_cv_lib_$ac_lib_var=no"
5423 fi
5424 rm -f conftest*
5425 LIBS="$ac_save_LIBS"
5426
5427 fi
5428 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5429   echo "$ac_t""yes" 1>&6
5430   
5431                 ol_link_isode=yes
5432                 cat >> confdefs.h <<\EOF
5433 #define HAVE_ISODE 1
5434 EOF
5435
5436                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
5437                 
5438 else
5439   echo "$ac_t""no" 1>&6
5440 :
5441 fi
5442
5443 fi
5444
5445 if test $ol_link_isode != no; then
5446         echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
5447 echo "configure:5448: checking for main in -lpp" >&5
5448 ac_lib_var=`echo pp'_'main | sed 'y%./+-:%__p__%'`
5449 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5450   echo $ac_n "(cached) $ac_c" 1>&6
5451 else
5452   ac_save_LIBS="$LIBS"
5453 LIBS="-lpp  $LIBS"
5454 cat > conftest.$ac_ext <<EOF
5455 #line 5456 "configure"
5456 #include "confdefs.h"
5457
5458 int main() {
5459 main()
5460 ; return 0; }
5461 EOF
5462 if { (eval echo configure:5463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5463   rm -rf conftest*
5464   eval "ac_cv_lib_$ac_lib_var=yes"
5465 else
5466   echo "configure: failed program was:" >&5
5467   cat conftest.$ac_ext >&5
5468   rm -rf conftest*
5469   eval "ac_cv_lib_$ac_lib_var=no"
5470 fi
5471 rm -f conftest*
5472 LIBS="$ac_save_LIBS"
5473
5474 fi
5475 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5476   echo "$ac_t""yes" 1>&6
5477   
5478                 cat >> confdefs.h <<\EOF
5479 #define HAVE_PP 1
5480 EOF
5481
5482                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
5483                 
5484 else
5485   echo "$ac_t""no" 1>&6
5486 :
5487 fi
5488
5489
5490         # Extract the first word of "pepsy", so it can be a program name with args.
5491 set dummy pepsy; ac_word=$2
5492 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
5493 echo "configure:5494: checking for $ac_word" >&5
5494 if eval "test \"\${ac_cv_path_PEPSY+set}\" = set"; then
5495   echo $ac_n "(cached) $ac_c" 1>&6
5496 else
5497   case "$PEPSY" in
5498   /*)
5499   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a path.
5500   ;;
5501   ?:/*)                  
5502   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a dos path.
5503   ;;
5504   *)
5505   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
5506   ac_dummy="$PATH"
5507   for ac_dir in $ac_dummy; do 
5508     test -z "$ac_dir" && ac_dir=.
5509     if test -f $ac_dir/$ac_word; then
5510       ac_cv_path_PEPSY="$ac_dir/$ac_word"
5511       break
5512     fi
5513   done
5514   IFS="$ac_save_ifs"
5515   ;;
5516 esac
5517 fi
5518 PEPSY="$ac_cv_path_PEPSY"
5519 if test -n "$PEPSY"; then
5520   echo "$ac_t""$PEPSY" 1>&6
5521 else
5522   echo "$ac_t""no" 1>&6
5523 fi
5524
5525 fi
5526
5527 if test $ol_enable_quipu != no ; then
5528         for ac_hdr in quipu/commonarg.h
5529 do
5530 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5531 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5532 echo "configure:5533: checking for $ac_hdr" >&5
5533 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5534   echo $ac_n "(cached) $ac_c" 1>&6
5535 else
5536   cat > conftest.$ac_ext <<EOF
5537 #line 5538 "configure"
5538 #include "confdefs.h"
5539 #include <$ac_hdr>
5540 EOF
5541 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5542 { (eval echo configure:5543: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5543 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5544 if test -z "$ac_err"; then
5545   rm -rf conftest*
5546   eval "ac_cv_header_$ac_safe=yes"
5547 else
5548   echo "$ac_err" >&5
5549   echo "configure: failed program was:" >&5
5550   cat conftest.$ac_ext >&5
5551   rm -rf conftest*
5552   eval "ac_cv_header_$ac_safe=no"
5553 fi
5554 rm -f conftest*
5555 fi
5556 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5557   echo "$ac_t""yes" 1>&6
5558     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5559   cat >> confdefs.h <<EOF
5560 #define $ac_tr_hdr 1
5561 EOF
5562  
5563 else
5564   echo "$ac_t""no" 1>&6
5565 fi
5566 done
5567
5568
5569         if test $ac_cv_header_quipu_commonarg_h = yes ; then
5570                 BUILD_QUIPU=yes
5571         elif test $ol_enable_quipu = auto ; then
5572                 echo "configure: warning: no quipu for --enable-quipu=auto, disabling" 1>&2
5573         else
5574                 { echo "configure: error: no quipu for --enable-quipu=$ol_enable_quipu" 1>&2; exit 1; }
5575         fi
5576 fi
5577
5578 ol_link_kerberos=no
5579
5580 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
5581         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
5582 do
5583 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5584 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5585 echo "configure:5586: checking for $ac_hdr" >&5
5586 if eval "test \"\${ac_cv_header_$ac_safe+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 #include <$ac_hdr>
5593 EOF
5594 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5595 { (eval echo configure:5596: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5596 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5597 if test -z "$ac_err"; then
5598   rm -rf conftest*
5599   eval "ac_cv_header_$ac_safe=yes"
5600 else
5601   echo "$ac_err" >&5
5602   echo "configure: failed program was:" >&5
5603   cat conftest.$ac_ext >&5
5604   rm -rf conftest*
5605   eval "ac_cv_header_$ac_safe=no"
5606 fi
5607 rm -f conftest*
5608 fi
5609 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5610   echo "$ac_t""yes" 1>&6
5611     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5612   cat >> confdefs.h <<EOF
5613 #define $ac_tr_hdr 1
5614 EOF
5615  
5616 else
5617   echo "$ac_t""no" 1>&6
5618 fi
5619 done
5620
5621
5622         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
5623                 echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
5624 echo "configure:5625: checking for main in -lkrb4" >&5
5625 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
5626 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5627   echo $ac_n "(cached) $ac_c" 1>&6
5628 else
5629   ac_save_LIBS="$LIBS"
5630 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
5631 cat > conftest.$ac_ext <<EOF
5632 #line 5633 "configure"
5633 #include "confdefs.h"
5634
5635 int main() {
5636 main()
5637 ; return 0; }
5638 EOF
5639 if { (eval echo configure:5640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5640   rm -rf conftest*
5641   eval "ac_cv_lib_$ac_lib_var=yes"
5642 else
5643   echo "configure: failed program was:" >&5
5644   cat conftest.$ac_ext >&5
5645   rm -rf conftest*
5646   eval "ac_cv_lib_$ac_lib_var=no"
5647 fi
5648 rm -f conftest*
5649 LIBS="$ac_save_LIBS"
5650
5651 fi
5652 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5653   echo "$ac_t""yes" 1>&6
5654   have_k5=yes
5655 else
5656   echo "$ac_t""no" 1>&6
5657 have_k5=no
5658 fi
5659
5660
5661                 if test $have_k5 = yes ; then
5662                         ol_with_kerberos=found
5663                         ol_link_kerberos=yes
5664
5665                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
5666
5667                         LIBS="$KRB_LIBS $LIBS"
5668
5669                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
5670 echo "configure:5671: checking for des_debug in Kerberos libraries" >&5
5671 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
5672   echo $ac_n "(cached) $ac_c" 1>&6
5673 else
5674   
5675                                                                 save_LIBS="$LIBS"
5676                                 LIBS="$KRB_LIBS $LIBS"
5677                                 cat > conftest.$ac_ext <<EOF
5678 #line 5679 "configure"
5679 #include "confdefs.h"
5680
5681 #include <kerberosIV/krb.h>
5682 #include <kerberosIV/des.h>
5683 extern int des_debug;
5684
5685 int main() {
5686
5687 des_debug = 1;
5688
5689 ; return 0; }
5690 EOF
5691 if { (eval echo configure:5692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5692   rm -rf conftest*
5693   ol_cv_var_des_debug=yes
5694 else
5695   echo "configure: failed program was:" >&5
5696   cat conftest.$ac_ext >&5
5697   rm -rf conftest*
5698   ol_cv_var_des_debug=no
5699 fi
5700 rm -f conftest*
5701                                                                 LIBS="$save_LIBS"
5702                         
5703 fi
5704
5705 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
5706
5707                         if test $ol_cv_var_des_debug = yes ; then
5708                                 cat >> confdefs.h <<\EOF
5709 #define HAVE_DES_DEBUG 1
5710 EOF
5711
5712                         fi
5713
5714                         LIBS="$save_LIBS"
5715                 fi
5716         fi
5717 fi
5718
5719 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
5720         for ac_hdr in krb.h des.h
5721 do
5722 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5723 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5724 echo "configure:5725: checking for $ac_hdr" >&5
5725 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5726   echo $ac_n "(cached) $ac_c" 1>&6
5727 else
5728   cat > conftest.$ac_ext <<EOF
5729 #line 5730 "configure"
5730 #include "confdefs.h"
5731 #include <$ac_hdr>
5732 EOF
5733 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5734 { (eval echo configure:5735: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5735 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5736 if test -z "$ac_err"; then
5737   rm -rf conftest*
5738   eval "ac_cv_header_$ac_safe=yes"
5739 else
5740   echo "$ac_err" >&5
5741   echo "configure: failed program was:" >&5
5742   cat conftest.$ac_ext >&5
5743   rm -rf conftest*
5744   eval "ac_cv_header_$ac_safe=no"
5745 fi
5746 rm -f conftest*
5747 fi
5748 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5749   echo "$ac_t""yes" 1>&6
5750     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5751   cat >> confdefs.h <<EOF
5752 #define $ac_tr_hdr 1
5753 EOF
5754  
5755 else
5756   echo "$ac_t""no" 1>&6
5757 fi
5758 done
5759
5760
5761         if test $ac_cv_header_krb_h = yes ; then
5762                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
5763 echo "configure:5764: checking for main in -lkrb" >&5
5764 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
5765 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5766   echo $ac_n "(cached) $ac_c" 1>&6
5767 else
5768   ac_save_LIBS="$LIBS"
5769 LIBS="-lkrb -ldes $LIBS"
5770 cat > conftest.$ac_ext <<EOF
5771 #line 5772 "configure"
5772 #include "confdefs.h"
5773
5774 int main() {
5775 main()
5776 ; return 0; }
5777 EOF
5778 if { (eval echo configure:5779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5779   rm -rf conftest*
5780   eval "ac_cv_lib_$ac_lib_var=yes"
5781 else
5782   echo "configure: failed program was:" >&5
5783   cat conftest.$ac_ext >&5
5784   rm -rf conftest*
5785   eval "ac_cv_lib_$ac_lib_var=no"
5786 fi
5787 rm -f conftest*
5788 LIBS="$ac_save_LIBS"
5789
5790 fi
5791 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5792   echo "$ac_t""yes" 1>&6
5793   have_k4=yes
5794 else
5795   echo "$ac_t""no" 1>&6
5796 have_k4=no
5797 fi
5798
5799
5800                 if test $have_k4 = yes ; then
5801                         ol_with_kerberos=found
5802                         ol_link_kerberos=yes
5803
5804                         KRB_LIBS="-lkrb -ldes"
5805                 fi
5806         fi
5807 fi
5808
5809 if test $ol_link_kerberos = yes ; then
5810         cat >> confdefs.h <<\EOF
5811 #define HAVE_KERBEROS 1
5812 EOF
5813
5814 fi
5815
5816 ol_link_tls=no
5817 if test $ol_with_tls != no ; then
5818         
5819         for ac_hdr in openssl/ssl.h ssl.h
5820 do
5821 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5822 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5823 echo "configure:5824: checking for $ac_hdr" >&5
5824 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5825   echo $ac_n "(cached) $ac_c" 1>&6
5826 else
5827   cat > conftest.$ac_ext <<EOF
5828 #line 5829 "configure"
5829 #include "confdefs.h"
5830 #include <$ac_hdr>
5831 EOF
5832 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5833 { (eval echo configure:5834: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5834 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5835 if test -z "$ac_err"; then
5836   rm -rf conftest*
5837   eval "ac_cv_header_$ac_safe=yes"
5838 else
5839   echo "$ac_err" >&5
5840   echo "configure: failed program was:" >&5
5841   cat conftest.$ac_ext >&5
5842   rm -rf conftest*
5843   eval "ac_cv_header_$ac_safe=no"
5844 fi
5845 rm -f conftest*
5846 fi
5847 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5848   echo "$ac_t""yes" 1>&6
5849     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5850   cat >> confdefs.h <<EOF
5851 #define $ac_tr_hdr 1
5852 EOF
5853  
5854 else
5855   echo "$ac_t""no" 1>&6
5856 fi
5857 done
5858
5859         
5860         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
5861                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
5862 echo "configure:5863: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
5863 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
5864 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5865   echo $ac_n "(cached) $ac_c" 1>&6
5866 else
5867   ac_save_LIBS="$LIBS"
5868 LIBS="-lssl -lcrypto $LIBS"
5869 cat > conftest.$ac_ext <<EOF
5870 #line 5871 "configure"
5871 #include "confdefs.h"
5872 /* Override any gcc2 internal prototype to avoid an error.  */
5873 /* We use char because int might match the return type of a gcc2
5874     builtin and then its argument prototype would still apply.  */
5875 char SSLeay_add_ssl_algorithms();
5876
5877 int main() {
5878 SSLeay_add_ssl_algorithms()
5879 ; return 0; }
5880 EOF
5881 if { (eval echo configure:5882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5882   rm -rf conftest*
5883   eval "ac_cv_lib_$ac_lib_var=yes"
5884 else
5885   echo "configure: failed program was:" >&5
5886   cat conftest.$ac_ext >&5
5887   rm -rf conftest*
5888   eval "ac_cv_lib_$ac_lib_var=no"
5889 fi
5890 rm -f conftest*
5891 LIBS="$ac_save_LIBS"
5892
5893 fi
5894 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5895   echo "$ac_t""yes" 1>&6
5896   have_ssleay=yes
5897                         need_rsaref=no
5898 else
5899   echo "$ac_t""no" 1>&6
5900 have_ssleay=no
5901 fi
5902
5903                         
5904                 if test $have_ssleay = no ; then
5905                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
5906 echo "configure:5907: checking for SSL_library_init in -lssl" >&5
5907 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
5908 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5909   echo $ac_n "(cached) $ac_c" 1>&6
5910 else
5911   ac_save_LIBS="$LIBS"
5912 LIBS="-lssl -lcrypto $LIBS"
5913 cat > conftest.$ac_ext <<EOF
5914 #line 5915 "configure"
5915 #include "confdefs.h"
5916 /* Override any gcc2 internal prototype to avoid an error.  */
5917 /* We use char because int might match the return type of a gcc2
5918     builtin and then its argument prototype would still apply.  */
5919 char SSL_library_init();
5920
5921 int main() {
5922 SSL_library_init()
5923 ; return 0; }
5924 EOF
5925 if { (eval echo configure:5926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5926   rm -rf conftest*
5927   eval "ac_cv_lib_$ac_lib_var=yes"
5928 else
5929   echo "configure: failed program was:" >&5
5930   cat conftest.$ac_ext >&5
5931   rm -rf conftest*
5932   eval "ac_cv_lib_$ac_lib_var=no"
5933 fi
5934 rm -f conftest*
5935 LIBS="$ac_save_LIBS"
5936
5937 fi
5938 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5939   echo "$ac_t""yes" 1>&6
5940   have_ssleay=yes
5941                                 need_rsaref=no
5942 else
5943   echo "$ac_t""no" 1>&6
5944 have_ssleay=no
5945 fi
5946
5947                 fi
5948
5949                 if test $have_ssleay = no ; then
5950                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
5951 echo "configure:5952: checking for ssl3_accept in -lssl" >&5
5952 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
5953 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5954   echo $ac_n "(cached) $ac_c" 1>&6
5955 else
5956   ac_save_LIBS="$LIBS"
5957 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
5958 cat > conftest.$ac_ext <<EOF
5959 #line 5960 "configure"
5960 #include "confdefs.h"
5961 /* Override any gcc2 internal prototype to avoid an error.  */
5962 /* We use char because int might match the return type of a gcc2
5963     builtin and then its argument prototype would still apply.  */
5964 char ssl3_accept();
5965
5966 int main() {
5967 ssl3_accept()
5968 ; return 0; }
5969 EOF
5970 if { (eval echo configure:5971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5971   rm -rf conftest*
5972   eval "ac_cv_lib_$ac_lib_var=yes"
5973 else
5974   echo "configure: failed program was:" >&5
5975   cat conftest.$ac_ext >&5
5976   rm -rf conftest*
5977   eval "ac_cv_lib_$ac_lib_var=no"
5978 fi
5979 rm -f conftest*
5980 LIBS="$ac_save_LIBS"
5981
5982 fi
5983 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5984   echo "$ac_t""yes" 1>&6
5985   have_ssleay=yes
5986                                 need_rsaref=yes
5987 else
5988   echo "$ac_t""no" 1>&6
5989 have_ssleay=no
5990 fi
5991
5992                 fi
5993
5994                 if test $have_ssleay = yes ; then
5995                         ol_with_tls=found
5996                         ol_link_tls=yes
5997
5998                         cat >> confdefs.h <<\EOF
5999 #define HAVE_SSLEAY 1
6000 EOF
6001
6002
6003                         if test $need_rsaref = yes; then
6004                                 cat >> confdefs.h <<\EOF
6005 #define HAVE_RSAREF 1
6006 EOF
6007
6008
6009                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
6010                         else
6011                                 TLS_LIBS="-lssl -lcrypto"
6012                         fi
6013                 fi
6014         fi
6015 fi
6016
6017 if test $ol_link_tls = yes ; then
6018         cat >> confdefs.h <<\EOF
6019 #define HAVE_TLS 1
6020 EOF
6021
6022 fi      
6023
6024 for ac_func in \
6025         ctime_r                 \
6026         gethostbyname_r gethostbyaddr_r \
6027
6028 do
6029 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6030 echo "configure:6031: checking for $ac_func" >&5
6031 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6032   echo $ac_n "(cached) $ac_c" 1>&6
6033 else
6034   cat > conftest.$ac_ext <<EOF
6035 #line 6036 "configure"
6036 #include "confdefs.h"
6037 /* System header to define __stub macros and hopefully few prototypes,
6038     which can conflict with char $ac_func(); below.  */
6039 #include <assert.h>
6040 /* Override any gcc2 internal prototype to avoid an error.  */
6041 /* We use char because int might match the return type of a gcc2
6042     builtin and then its argument prototype would still apply.  */
6043 char $ac_func();
6044 char (*f)();
6045
6046 int main() {
6047
6048 /* The GNU C library defines this for functions which it implements
6049     to always fail with ENOSYS.  Some functions are actually named
6050     something starting with __ and the normal name is an alias.  */
6051 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6052 choke me
6053 #else
6054 f = $ac_func;
6055 #endif
6056
6057 ; return 0; }
6058 EOF
6059 if { (eval echo configure:6060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6060   rm -rf conftest*
6061   eval "ac_cv_func_$ac_func=yes"
6062 else
6063   echo "configure: failed program was:" >&5
6064   cat conftest.$ac_ext >&5
6065   rm -rf conftest*
6066   eval "ac_cv_func_$ac_func=no"
6067 fi
6068 rm -f conftest*
6069 fi
6070
6071 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6072   echo "$ac_t""yes" 1>&6
6073     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6074   cat >> confdefs.h <<EOF
6075 #define $ac_tr_func 1
6076 EOF
6077  
6078 else
6079   echo "$ac_t""no" 1>&6
6080 fi
6081 done
6082
6083
6084 if test "$ac_cv_func_ctime_r" = no ; then
6085         ol_cv_func_ctime_r_nargs=0
6086 else
6087         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
6088 echo "configure:6089: checking number of arguments of ctime_r" >&5
6089 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
6090   echo $ac_n "(cached) $ac_c" 1>&6
6091 else
6092   cat > conftest.$ac_ext <<EOF
6093 #line 6094 "configure"
6094 #include "confdefs.h"
6095 #include <time.h>
6096 int main() {
6097 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
6098 ; return 0; }
6099 EOF
6100 if { (eval echo configure:6101: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6101   rm -rf conftest*
6102   ol_cv_func_ctime_r_nargs=3
6103 else
6104   echo "configure: failed program was:" >&5
6105   cat conftest.$ac_ext >&5
6106   rm -rf conftest*
6107   cat > conftest.$ac_ext <<EOF
6108 #line 6109 "configure"
6109 #include "confdefs.h"
6110 #include <time.h>
6111 int main() {
6112 time_t ti; char *buffer; ctime_r(&ti,buffer);
6113 ; return 0; }
6114 EOF
6115 if { (eval echo configure:6116: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6116   rm -rf conftest*
6117   ol_cv_func_ctime_r_nargs=2
6118 else
6119   echo "configure: failed program was:" >&5
6120   cat conftest.$ac_ext >&5
6121   rm -rf conftest*
6122   ol_cv_func_ctime_r_nargs=0
6123 fi
6124 rm -f conftest*
6125 fi
6126 rm -f conftest*
6127 fi
6128
6129 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
6130   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
6131     cat >> confdefs.h <<EOF
6132 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
6133 EOF
6134
6135   fi
6136
6137 fi
6138
6139 if test "$ac_cv_func_gethostbyname_r" = yes ; then
6140         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
6141 echo "configure:6142: checking number of arguments of gethostbyname_r" >&5
6142 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
6143   echo $ac_n "(cached) $ac_c" 1>&6
6144 else
6145   cat > conftest.$ac_ext <<EOF
6146 #line 6147 "configure"
6147 #include "confdefs.h"
6148 #include <sys/types.h>
6149 #include <sys/socket.h>
6150 #include <netinet/in.h>
6151 #include <netdb.h>
6152 #define BUFSIZE (sizeof(struct hostent)+10)
6153 int main() {
6154 struct hostent hent; char buffer[BUFSIZE];
6155                 int bufsize=BUFSIZE;int h_errno;
6156                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
6157                         buffer, bufsize, &h_errno);
6158 ; return 0; }
6159 EOF
6160 if { (eval echo configure:6161: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6161   rm -rf conftest*
6162   ol_cv_func_gethostbyname_r_nargs=5
6163 else
6164   echo "configure: failed program was:" >&5
6165   cat conftest.$ac_ext >&5
6166   rm -rf conftest*
6167   cat > conftest.$ac_ext <<EOF
6168 #line 6169 "configure"
6169 #include "confdefs.h"
6170 #include <sys/types.h>
6171 #include <sys/socket.h>
6172 #include <netinet/in.h>
6173 #include <netdb.h>
6174 #define BUFSIZE (sizeof(struct hostent)+10)
6175 int main() {
6176 struct hostent hent;struct hostent *rhent;
6177                         char buffer[BUFSIZE];
6178                         int bufsize=BUFSIZE;int h_errno;
6179                         (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
6180                                 &rhent, &h_errno);
6181 ; return 0; }
6182 EOF
6183 if { (eval echo configure:6184: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6184   rm -rf conftest*
6185   ol_cv_func_gethostbyname_r_nargs=6
6186 else
6187   echo "configure: failed program was:" >&5
6188   cat conftest.$ac_ext >&5
6189   rm -rf conftest*
6190   ol_cv_func_gethostbyname_r_nargs=0
6191 fi
6192 rm -f conftest*
6193 fi
6194 rm -f conftest*
6195 fi
6196
6197 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
6198   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
6199         cat >> confdefs.h <<EOF
6200 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
6201 EOF
6202
6203   fi
6204
6205 else
6206         ol_cv_func_gethostbyname_r_nargs=0
6207 fi
6208  
6209 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
6210         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
6211 echo "configure:6212: checking number of arguments of gethostbyaddr_r" >&5
6212 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
6213   echo $ac_n "(cached) $ac_c" 1>&6
6214 else
6215   cat > conftest.$ac_ext <<EOF
6216 #line 6217 "configure"
6217 #include "confdefs.h"
6218 #include <sys/types.h>
6219 #include <sys/socket.h>
6220 #include <netinet/in.h>
6221 #include <netdb.h>
6222 #define BUFSIZE (sizeof(struct hostent)+10)
6223 int main() {
6224 struct hostent hent; char buffer[BUFSIZE]; 
6225             struct in_addr add;
6226             size_t alen=sizeof(struct in_addr);
6227             int bufsize=BUFSIZE;int h_errno;
6228                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
6229                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
6230 ; return 0; }
6231 EOF
6232 if { (eval echo configure:6233: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6233   rm -rf conftest*
6234   ol_cv_func_gethostbyaddr_r_nargs=7
6235 else
6236   echo "configure: failed program was:" >&5
6237   cat conftest.$ac_ext >&5
6238   rm -rf conftest*
6239   cat > conftest.$ac_ext <<EOF
6240 #line 6241 "configure"
6241 #include "confdefs.h"
6242 #include <sys/types.h>
6243 #include <sys/socket.h>
6244 #include <netinet/in.h>
6245 #include <netdb.h>
6246 #define BUFSIZE (sizeof(struct hostent)+10)
6247 int main() {
6248 struct hostent hent;
6249                         struct hostent *rhent; char buffer[BUFSIZE]; 
6250                         struct in_addr add;
6251                         size_t alen=sizeof(struct in_addr);
6252                         int bufsize=BUFSIZE;int h_errno;
6253                         (void)gethostbyaddr_r( (void *)&(add.s_addr),
6254                                 alen, AF_INET, &hent, buffer, bufsize, 
6255                                 &rhent, &h_errno);
6256 ; return 0; }
6257 EOF
6258 if { (eval echo configure:6259: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6259   rm -rf conftest*
6260   ol_cv_func_gethostbyaddr_r_nargs=8
6261 else
6262   echo "configure: failed program was:" >&5
6263   cat conftest.$ac_ext >&5
6264   rm -rf conftest*
6265   ol_cv_func_gethostbyaddr_r_nargs=0
6266 fi
6267 rm -f conftest*
6268 fi
6269 rm -f conftest*
6270 fi
6271
6272 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
6273   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
6274     cat >> confdefs.h <<EOF
6275 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
6276 EOF
6277
6278   fi
6279
6280 else
6281         ol_cv_func_gethostbyaddr_r_nargs=0
6282 fi
6283
6284 if test "$ac_cv_func_ctime_r" = yes \
6285         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
6286         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
6287         -a "$ac_cv_func_gethostbyname_r" = yes \
6288         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
6289         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
6290         -a "$ac_cv_func_gethostbyaddr_r" = yes \
6291         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
6292         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
6293         ; then
6294  
6295         cat >> confdefs.h <<\EOF
6296 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
6297 EOF
6298
6299 fi
6300
6301 ol_link_threads=no
6302 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6303         -o $ol_with_threads = posix ; then
6304
6305         for ac_hdr in pthread.h
6306 do
6307 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6308 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6309 echo "configure:6310: checking for $ac_hdr" >&5
6310 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6311   echo $ac_n "(cached) $ac_c" 1>&6
6312 else
6313   cat > conftest.$ac_ext <<EOF
6314 #line 6315 "configure"
6315 #include "confdefs.h"
6316 #include <$ac_hdr>
6317 EOF
6318 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6319 { (eval echo configure:6320: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6320 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6321 if test -z "$ac_err"; then
6322   rm -rf conftest*
6323   eval "ac_cv_header_$ac_safe=yes"
6324 else
6325   echo "$ac_err" >&5
6326   echo "configure: failed program was:" >&5
6327   cat conftest.$ac_ext >&5
6328   rm -rf conftest*
6329   eval "ac_cv_header_$ac_safe=no"
6330 fi
6331 rm -f conftest*
6332 fi
6333 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6334   echo "$ac_t""yes" 1>&6
6335     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6336   cat >> confdefs.h <<EOF
6337 #define $ac_tr_hdr 1
6338 EOF
6339  
6340 else
6341   echo "$ac_t""no" 1>&6
6342 fi
6343 done
6344
6345
6346         if test $ac_cv_header_pthread_h = yes ; then
6347                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
6348 echo "configure:6349: checking POSIX thread version" >&5
6349 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
6350   echo $ac_n "(cached) $ac_c" 1>&6
6351 else
6352   
6353         cat > conftest.$ac_ext <<EOF
6354 #line 6355 "configure"
6355 #include "confdefs.h"
6356
6357 #               include <pthread.h>
6358                 /* this check could be improved */
6359 #               ifdef PTHREAD_ONCE_INIT
6360                         pthread_version_final;
6361 #               endif
6362         
6363 EOF
6364 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6365   egrep "pthread_version_final" >/dev/null 2>&1; then
6366   rm -rf conftest*
6367   ol_pthread_final=yes
6368 else
6369   rm -rf conftest*
6370   ol_pthread_final=no
6371 fi
6372 rm -f conftest*
6373
6374
6375         cat > conftest.$ac_ext <<EOF
6376 #line 6377 "configure"
6377 #include "confdefs.h"
6378
6379 #               include <pthread.h>
6380                 /* this check could be improved */
6381 #               ifdef pthread_once_init
6382                         pthread_version_draft4;
6383 #               endif
6384         
6385 EOF
6386 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6387   egrep "pthread_version_draft4" >/dev/null 2>&1; then
6388   rm -rf conftest*
6389   ol_pthread_draft4=yes
6390 else
6391   rm -rf conftest*
6392   ol_pthread_draft4=no
6393 fi
6394 rm -f conftest*
6395
6396
6397         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
6398                 ol_cv_pthread_version=final
6399         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
6400                 ol_cv_pthread_version=draft4
6401         else
6402                 ol_cv_pthread_version=unknown
6403         fi
6404
6405 fi
6406
6407 echo "$ac_t""$ol_cv_pthread_version" 1>&6
6408
6409
6410                 if test $ol_cv_pthread_version = final ; then
6411                         cat >> confdefs.h <<\EOF
6412 #define HAVE_PTHREADS_FINAL 1
6413 EOF
6414
6415                 elif test $ol_cv_pthread_version = draft4 ; then
6416                         cat >> confdefs.h <<\EOF
6417 #define HAVE_PTHREADS_D4 1
6418 EOF
6419
6420                 else
6421                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
6422                 fi
6423
6424                 # consider threads found
6425                 ol_with_threads=found
6426
6427                 
6428         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
6429 echo "configure:6430: checking for LinuxThreads pthread.h" >&5
6430 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
6431   echo $ac_n "(cached) $ac_c" 1>&6
6432 else
6433   cat > conftest.$ac_ext <<EOF
6434 #line 6435 "configure"
6435 #include "confdefs.h"
6436 #include <pthread.h>
6437 EOF
6438 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6439   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
6440   rm -rf conftest*
6441   ol_cv_header_linux_threads=yes
6442 else
6443   rm -rf conftest*
6444   ol_cv_header_linux_threads=no
6445 fi
6446 rm -f conftest*
6447
6448                 
6449 fi
6450
6451 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
6452         if test $ol_cv_header_linux_threads = yes; then
6453                 cat >> confdefs.h <<\EOF
6454 #define HAVE_LINUX_THREADS 1
6455 EOF
6456
6457         fi
6458
6459                 
6460         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
6461 echo "configure:6462: checking for GNU Pth pthread.h" >&5
6462 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
6463   echo $ac_n "(cached) $ac_c" 1>&6
6464 else
6465   cat > conftest.$ac_ext <<EOF
6466 #line 6467 "configure"
6467 #include "confdefs.h"
6468 #include <pthread.h>
6469 #ifdef _POSIX_THREAD_IS_GNU_PTH
6470         __gnu_pth__;
6471 #endif
6472
6473 EOF
6474 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6475   egrep "__gnu_pth__" >/dev/null 2>&1; then
6476   rm -rf conftest*
6477   ol_cv_header_gnu_pth_pthread_h=yes
6478 else
6479   rm -rf conftest*
6480   ol_cv_header_gnu_pth_pthread_h=no
6481 fi
6482 rm -f conftest*
6483
6484                 
6485 fi
6486
6487 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
6488
6489
6490                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
6491                         for ac_hdr in sched.h
6492 do
6493 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6494 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6495 echo "configure:6496: checking for $ac_hdr" >&5
6496 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6497   echo $ac_n "(cached) $ac_c" 1>&6
6498 else
6499   cat > conftest.$ac_ext <<EOF
6500 #line 6501 "configure"
6501 #include "confdefs.h"
6502 #include <$ac_hdr>
6503 EOF
6504 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6505 { (eval echo configure:6506: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6506 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6507 if test -z "$ac_err"; then
6508   rm -rf conftest*
6509   eval "ac_cv_header_$ac_safe=yes"
6510 else
6511   echo "$ac_err" >&5
6512   echo "configure: failed program was:" >&5
6513   cat conftest.$ac_ext >&5
6514   rm -rf conftest*
6515   eval "ac_cv_header_$ac_safe=no"
6516 fi
6517 rm -f conftest*
6518 fi
6519 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6520   echo "$ac_t""yes" 1>&6
6521     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6522   cat >> confdefs.h <<EOF
6523 #define $ac_tr_hdr 1
6524 EOF
6525  
6526 else
6527   echo "$ac_t""no" 1>&6
6528 fi
6529 done
6530
6531                 fi
6532
6533                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
6534                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
6535 echo "configure:6536: checking for pthread_create in default libraries" >&5
6536 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
6537   echo $ac_n "(cached) $ac_c" 1>&6
6538 else
6539   
6540                 if test "$cross_compiling" = yes; then
6541   cat > conftest.$ac_ext <<EOF
6542 #line 6543 "configure"
6543 #include "confdefs.h"
6544 /* pthread test headers */
6545 #include <pthread.h>
6546 #ifndef NULL
6547 #define NULL (void*)0
6548 #endif
6549
6550 static void *task(p)
6551         void *p;
6552 {
6553         return (void *) (p == NULL);
6554 }
6555
6556 int main() {
6557
6558         /* pthread test function */
6559         pthread_t t;
6560         int status;
6561
6562         /* make sure pthread_create() isn't just a stub */
6563 #if HAVE_PTHREADS_D4
6564         status = pthread_create(&t, pthread_attr_default, task, NULL);
6565 #else
6566         status = pthread_create(&t, NULL, task, NULL);
6567 #endif
6568
6569         if( status ) exit( status );
6570
6571         /* make sure pthread_detach() isn't just a stub */
6572 #if HAVE_PTHREADS_D4
6573         status = pthread_detach( &t );
6574 #else
6575         status = pthread_detach( t );
6576 #endif
6577
6578 #ifdef HAVE_LINUX_THREADS
6579         pthread_kill_other_threads_np();
6580 #endif
6581
6582         exit( status );
6583
6584 ; return 0; }
6585 EOF
6586 if { (eval echo configure:6587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6587   rm -rf conftest*
6588   ol_cv_pthread_create=yes
6589 else
6590   echo "configure: failed program was:" >&5
6591   cat conftest.$ac_ext >&5
6592   rm -rf conftest*
6593   ol_cv_pthread_create=no
6594 fi
6595 rm -f conftest*
6596 else
6597   cat > conftest.$ac_ext <<EOF
6598 #line 6599 "configure"
6599 #include "confdefs.h"
6600 /* pthread test headers */
6601 #include <pthread.h>
6602 #ifndef NULL
6603 #define NULL (void*)0
6604 #endif
6605
6606 static void *task(p)
6607         void *p;
6608 {
6609         return (void *) (p == NULL);
6610 }
6611
6612
6613 int main(argc, argv)
6614         int argc;
6615         char **argv;
6616 {
6617
6618         /* pthread test function */
6619         pthread_t t;
6620         int status;
6621
6622         /* make sure pthread_create() isn't just a stub */
6623 #if HAVE_PTHREADS_D4
6624         status = pthread_create(&t, pthread_attr_default, task, NULL);
6625 #else
6626         status = pthread_create(&t, NULL, task, NULL);
6627 #endif
6628
6629         if( status ) exit( status );
6630
6631         /* make sure pthread_detach() isn't just a stub */
6632 #if HAVE_PTHREADS_D4
6633         status = pthread_detach( &t );
6634 #else
6635         status = pthread_detach( t );
6636 #endif
6637
6638 #ifdef HAVE_LINUX_THREADS
6639         pthread_kill_other_threads_np();
6640 #endif
6641
6642         exit( status );
6643
6644 }
6645
6646 EOF
6647 if { (eval echo configure:6648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6648 then
6649   ol_cv_pthread_create=yes
6650 else
6651   echo "configure: failed program was:" >&5
6652   cat conftest.$ac_ext >&5
6653   rm -fr conftest*
6654   ol_cv_pthread_create=no
6655 fi
6656 rm -fr conftest*
6657 fi
6658
6659 fi
6660
6661 echo "$ac_t""$ol_cv_pthread_create" 1>&6
6662
6663                 if test $ol_cv_pthread_create != no ; then
6664                         ol_link_threads=posix
6665                         ol_link_pthreads=""
6666                 fi
6667                 
6668                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
6669 if test "$ol_link_threads" = no ; then
6670         # try -kthread
6671         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
6672 echo "configure:6673: checking for pthread link with -kthread" >&5
6673 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
6674   echo $ac_n "(cached) $ac_c" 1>&6
6675 else
6676   
6677                 # save the flags
6678                 ol_LIBS="$LIBS"
6679                 LIBS="-kthread $LIBS"
6680
6681                 if test "$cross_compiling" = yes; then
6682   cat > conftest.$ac_ext <<EOF
6683 #line 6684 "configure"
6684 #include "confdefs.h"
6685 /* pthread test headers */
6686 #include <pthread.h>
6687 #ifndef NULL
6688 #define NULL (void*)0
6689 #endif
6690
6691 static void *task(p)
6692         void *p;
6693 {
6694         return (void *) (p == NULL);
6695 }
6696
6697 int main() {
6698
6699         /* pthread test function */
6700         pthread_t t;
6701         int status;
6702
6703         /* make sure pthread_create() isn't just a stub */
6704 #if HAVE_PTHREADS_D4
6705         status = pthread_create(&t, pthread_attr_default, task, NULL);
6706 #else
6707         status = pthread_create(&t, NULL, task, NULL);
6708 #endif
6709
6710         if( status ) exit( status );
6711
6712         /* make sure pthread_detach() isn't just a stub */
6713 #if HAVE_PTHREADS_D4
6714         status = pthread_detach( &t );
6715 #else
6716         status = pthread_detach( t );
6717 #endif
6718
6719 #ifdef HAVE_LINUX_THREADS
6720         pthread_kill_other_threads_np();
6721 #endif
6722
6723         exit( status );
6724
6725 ; return 0; }
6726 EOF
6727 if { (eval echo configure:6728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6728   rm -rf conftest*
6729   ol_cv_pthread_kthread=yes
6730 else
6731   echo "configure: failed program was:" >&5
6732   cat conftest.$ac_ext >&5
6733   rm -rf conftest*
6734   ol_cv_pthread_kthread=no
6735 fi
6736 rm -f conftest*
6737 else
6738   cat > conftest.$ac_ext <<EOF
6739 #line 6740 "configure"
6740 #include "confdefs.h"
6741 /* pthread test headers */
6742 #include <pthread.h>
6743 #ifndef NULL
6744 #define NULL (void*)0
6745 #endif
6746
6747 static void *task(p)
6748         void *p;
6749 {
6750         return (void *) (p == NULL);
6751 }
6752
6753
6754 int main(argc, argv)
6755         int argc;
6756         char **argv;
6757 {
6758
6759         /* pthread test function */
6760         pthread_t t;
6761         int status;
6762
6763         /* make sure pthread_create() isn't just a stub */
6764 #if HAVE_PTHREADS_D4
6765         status = pthread_create(&t, pthread_attr_default, task, NULL);
6766 #else
6767         status = pthread_create(&t, NULL, task, NULL);
6768 #endif
6769
6770         if( status ) exit( status );
6771
6772         /* make sure pthread_detach() isn't just a stub */
6773 #if HAVE_PTHREADS_D4
6774         status = pthread_detach( &t );
6775 #else
6776         status = pthread_detach( t );
6777 #endif
6778
6779 #ifdef HAVE_LINUX_THREADS
6780         pthread_kill_other_threads_np();
6781 #endif
6782
6783         exit( status );
6784
6785 }
6786
6787 EOF
6788 if { (eval echo configure:6789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6789 then
6790   ol_cv_pthread_kthread=yes
6791 else
6792   echo "configure: failed program was:" >&5
6793   cat conftest.$ac_ext >&5
6794   rm -fr conftest*
6795   ol_cv_pthread_kthread=no
6796 fi
6797 rm -fr conftest*
6798 fi
6799
6800
6801                 # restore the LIBS
6802                 LIBS="$ol_LIBS"
6803         
6804 fi
6805
6806 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
6807
6808         if test $ol_cv_pthread_kthread = yes ; then
6809                 ol_link_pthreads="-kthread"
6810                 ol_link_threads=posix
6811         fi
6812 fi
6813
6814                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
6815 if test "$ol_link_threads" = no ; then
6816         # try -pthread
6817         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
6818 echo "configure:6819: checking for pthread link with -pthread" >&5
6819 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
6820   echo $ac_n "(cached) $ac_c" 1>&6
6821 else
6822   
6823                 # save the flags
6824                 ol_LIBS="$LIBS"
6825                 LIBS="-pthread $LIBS"
6826
6827                 if test "$cross_compiling" = yes; then
6828   cat > conftest.$ac_ext <<EOF
6829 #line 6830 "configure"
6830 #include "confdefs.h"
6831 /* pthread test headers */
6832 #include <pthread.h>
6833 #ifndef NULL
6834 #define NULL (void*)0
6835 #endif
6836
6837 static void *task(p)
6838         void *p;
6839 {
6840         return (void *) (p == NULL);
6841 }
6842
6843 int main() {
6844
6845         /* pthread test function */
6846         pthread_t t;
6847         int status;
6848
6849         /* make sure pthread_create() isn't just a stub */
6850 #if HAVE_PTHREADS_D4
6851         status = pthread_create(&t, pthread_attr_default, task, NULL);
6852 #else
6853         status = pthread_create(&t, NULL, task, NULL);
6854 #endif
6855
6856         if( status ) exit( status );
6857
6858         /* make sure pthread_detach() isn't just a stub */
6859 #if HAVE_PTHREADS_D4
6860         status = pthread_detach( &t );
6861 #else
6862         status = pthread_detach( t );
6863 #endif
6864
6865 #ifdef HAVE_LINUX_THREADS
6866         pthread_kill_other_threads_np();
6867 #endif
6868
6869         exit( status );
6870
6871 ; return 0; }
6872 EOF
6873 if { (eval echo configure:6874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6874   rm -rf conftest*
6875   ol_cv_pthread_pthread=yes
6876 else
6877   echo "configure: failed program was:" >&5
6878   cat conftest.$ac_ext >&5
6879   rm -rf conftest*
6880   ol_cv_pthread_pthread=no
6881 fi
6882 rm -f conftest*
6883 else
6884   cat > conftest.$ac_ext <<EOF
6885 #line 6886 "configure"
6886 #include "confdefs.h"
6887 /* pthread test headers */
6888 #include <pthread.h>
6889 #ifndef NULL
6890 #define NULL (void*)0
6891 #endif
6892
6893 static void *task(p)
6894         void *p;
6895 {
6896         return (void *) (p == NULL);
6897 }
6898
6899
6900 int main(argc, argv)
6901         int argc;
6902         char **argv;
6903 {
6904
6905         /* pthread test function */
6906         pthread_t t;
6907         int status;
6908
6909         /* make sure pthread_create() isn't just a stub */
6910 #if HAVE_PTHREADS_D4
6911         status = pthread_create(&t, pthread_attr_default, task, NULL);
6912 #else
6913         status = pthread_create(&t, NULL, task, NULL);
6914 #endif
6915
6916         if( status ) exit( status );
6917
6918         /* make sure pthread_detach() isn't just a stub */
6919 #if HAVE_PTHREADS_D4
6920         status = pthread_detach( &t );
6921 #else
6922         status = pthread_detach( t );
6923 #endif
6924
6925 #ifdef HAVE_LINUX_THREADS
6926         pthread_kill_other_threads_np();
6927 #endif
6928
6929         exit( status );
6930
6931 }
6932
6933 EOF
6934 if { (eval echo configure:6935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6935 then
6936   ol_cv_pthread_pthread=yes
6937 else
6938   echo "configure: failed program was:" >&5
6939   cat conftest.$ac_ext >&5
6940   rm -fr conftest*
6941   ol_cv_pthread_pthread=no
6942 fi
6943 rm -fr conftest*
6944 fi
6945
6946
6947                 # restore the LIBS
6948                 LIBS="$ol_LIBS"
6949         
6950 fi
6951
6952 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
6953
6954         if test $ol_cv_pthread_pthread = yes ; then
6955                 ol_link_pthreads="-pthread"
6956                 ol_link_threads=posix
6957         fi
6958 fi
6959
6960                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
6961 if test "$ol_link_threads" = no ; then
6962         # try -pthreads
6963         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
6964 echo "configure:6965: checking for pthread link with -pthreads" >&5
6965 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
6966   echo $ac_n "(cached) $ac_c" 1>&6
6967 else
6968   
6969                 # save the flags
6970                 ol_LIBS="$LIBS"
6971                 LIBS="-pthreads $LIBS"
6972
6973                 if test "$cross_compiling" = yes; then
6974   cat > conftest.$ac_ext <<EOF
6975 #line 6976 "configure"
6976 #include "confdefs.h"
6977 /* pthread test headers */
6978 #include <pthread.h>
6979 #ifndef NULL
6980 #define NULL (void*)0
6981 #endif
6982
6983 static void *task(p)
6984         void *p;
6985 {
6986         return (void *) (p == NULL);
6987 }
6988
6989 int main() {
6990
6991         /* pthread test function */
6992         pthread_t t;
6993         int status;
6994
6995         /* make sure pthread_create() isn't just a stub */
6996 #if HAVE_PTHREADS_D4
6997         status = pthread_create(&t, pthread_attr_default, task, NULL);
6998 #else
6999         status = pthread_create(&t, NULL, task, NULL);
7000 #endif
7001
7002         if( status ) exit( status );
7003
7004         /* make sure pthread_detach() isn't just a stub */
7005 #if HAVE_PTHREADS_D4
7006         status = pthread_detach( &t );
7007 #else
7008         status = pthread_detach( t );
7009 #endif
7010
7011 #ifdef HAVE_LINUX_THREADS
7012         pthread_kill_other_threads_np();
7013 #endif
7014
7015         exit( status );
7016
7017 ; return 0; }
7018 EOF
7019 if { (eval echo configure:7020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7020   rm -rf conftest*
7021   ol_cv_pthread_pthreads=yes
7022 else
7023   echo "configure: failed program was:" >&5
7024   cat conftest.$ac_ext >&5
7025   rm -rf conftest*
7026   ol_cv_pthread_pthreads=no
7027 fi
7028 rm -f conftest*
7029 else
7030   cat > conftest.$ac_ext <<EOF
7031 #line 7032 "configure"
7032 #include "confdefs.h"
7033 /* pthread test headers */
7034 #include <pthread.h>
7035 #ifndef NULL
7036 #define NULL (void*)0
7037 #endif
7038
7039 static void *task(p)
7040         void *p;
7041 {
7042         return (void *) (p == NULL);
7043 }
7044
7045
7046 int main(argc, argv)
7047         int argc;
7048         char **argv;
7049 {
7050
7051         /* pthread test function */
7052         pthread_t t;
7053         int status;
7054
7055         /* make sure pthread_create() isn't just a stub */
7056 #if HAVE_PTHREADS_D4
7057         status = pthread_create(&t, pthread_attr_default, task, NULL);
7058 #else
7059         status = pthread_create(&t, NULL, task, NULL);
7060 #endif
7061
7062         if( status ) exit( status );
7063
7064         /* make sure pthread_detach() isn't just a stub */
7065 #if HAVE_PTHREADS_D4
7066         status = pthread_detach( &t );
7067 #else
7068         status = pthread_detach( t );
7069 #endif
7070
7071 #ifdef HAVE_LINUX_THREADS
7072         pthread_kill_other_threads_np();
7073 #endif
7074
7075         exit( status );
7076
7077 }
7078
7079 EOF
7080 if { (eval echo configure:7081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7081 then
7082   ol_cv_pthread_pthreads=yes
7083 else
7084   echo "configure: failed program was:" >&5
7085   cat conftest.$ac_ext >&5
7086   rm -fr conftest*
7087   ol_cv_pthread_pthreads=no
7088 fi
7089 rm -fr conftest*
7090 fi
7091
7092
7093                 # restore the LIBS
7094                 LIBS="$ol_LIBS"
7095         
7096 fi
7097
7098 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
7099
7100         if test $ol_cv_pthread_pthreads = yes ; then
7101                 ol_link_pthreads="-pthreads"
7102                 ol_link_threads=posix
7103         fi
7104 fi
7105
7106                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
7107 if test "$ol_link_threads" = no ; then
7108         # try -mthreads
7109         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
7110 echo "configure:7111: checking for pthread link with -mthreads" >&5
7111 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
7112   echo $ac_n "(cached) $ac_c" 1>&6
7113 else
7114   
7115                 # save the flags
7116                 ol_LIBS="$LIBS"
7117                 LIBS="-mthreads $LIBS"
7118
7119                 if test "$cross_compiling" = yes; then
7120   cat > conftest.$ac_ext <<EOF
7121 #line 7122 "configure"
7122 #include "confdefs.h"
7123 /* pthread test headers */
7124 #include <pthread.h>
7125 #ifndef NULL
7126 #define NULL (void*)0
7127 #endif
7128
7129 static void *task(p)
7130         void *p;
7131 {
7132         return (void *) (p == NULL);
7133 }
7134
7135 int main() {
7136
7137         /* pthread test function */
7138         pthread_t t;
7139         int status;
7140
7141         /* make sure pthread_create() isn't just a stub */
7142 #if HAVE_PTHREADS_D4
7143         status = pthread_create(&t, pthread_attr_default, task, NULL);
7144 #else
7145         status = pthread_create(&t, NULL, task, NULL);
7146 #endif
7147
7148         if( status ) exit( status );
7149
7150         /* make sure pthread_detach() isn't just a stub */
7151 #if HAVE_PTHREADS_D4
7152         status = pthread_detach( &t );
7153 #else
7154         status = pthread_detach( t );
7155 #endif
7156
7157 #ifdef HAVE_LINUX_THREADS
7158         pthread_kill_other_threads_np();
7159 #endif
7160
7161         exit( status );
7162
7163 ; return 0; }
7164 EOF
7165 if { (eval echo configure:7166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7166   rm -rf conftest*
7167   ol_cv_pthread_mthreads=yes
7168 else
7169   echo "configure: failed program was:" >&5
7170   cat conftest.$ac_ext >&5
7171   rm -rf conftest*
7172   ol_cv_pthread_mthreads=no
7173 fi
7174 rm -f conftest*
7175 else
7176   cat > conftest.$ac_ext <<EOF
7177 #line 7178 "configure"
7178 #include "confdefs.h"
7179 /* pthread test headers */
7180 #include <pthread.h>
7181 #ifndef NULL
7182 #define NULL (void*)0
7183 #endif
7184
7185 static void *task(p)
7186         void *p;
7187 {
7188         return (void *) (p == NULL);
7189 }
7190
7191
7192 int main(argc, argv)
7193         int argc;
7194         char **argv;
7195 {
7196
7197         /* pthread test function */
7198         pthread_t t;
7199         int status;
7200
7201         /* make sure pthread_create() isn't just a stub */
7202 #if HAVE_PTHREADS_D4
7203         status = pthread_create(&t, pthread_attr_default, task, NULL);
7204 #else
7205         status = pthread_create(&t, NULL, task, NULL);
7206 #endif
7207
7208         if( status ) exit( status );
7209
7210         /* make sure pthread_detach() isn't just a stub */
7211 #if HAVE_PTHREADS_D4
7212         status = pthread_detach( &t );
7213 #else
7214         status = pthread_detach( t );
7215 #endif
7216
7217 #ifdef HAVE_LINUX_THREADS
7218         pthread_kill_other_threads_np();
7219 #endif
7220
7221         exit( status );
7222
7223 }
7224
7225 EOF
7226 if { (eval echo configure:7227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7227 then
7228   ol_cv_pthread_mthreads=yes
7229 else
7230   echo "configure: failed program was:" >&5
7231   cat conftest.$ac_ext >&5
7232   rm -fr conftest*
7233   ol_cv_pthread_mthreads=no
7234 fi
7235 rm -fr conftest*
7236 fi
7237
7238
7239                 # restore the LIBS
7240                 LIBS="$ol_LIBS"
7241         
7242 fi
7243
7244 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
7245
7246         if test $ol_cv_pthread_mthreads = yes ; then
7247                 ol_link_pthreads="-mthreads"
7248                 ol_link_threads=posix
7249         fi
7250 fi
7251
7252                 # Pthread try link: -thread (ol_cv_pthread_thread)
7253 if test "$ol_link_threads" = no ; then
7254         # try -thread
7255         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
7256 echo "configure:7257: checking for pthread link with -thread" >&5
7257 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
7258   echo $ac_n "(cached) $ac_c" 1>&6
7259 else
7260   
7261                 # save the flags
7262                 ol_LIBS="$LIBS"
7263                 LIBS="-thread $LIBS"
7264
7265                 if test "$cross_compiling" = yes; then
7266   cat > conftest.$ac_ext <<EOF
7267 #line 7268 "configure"
7268 #include "confdefs.h"
7269 /* pthread test headers */
7270 #include <pthread.h>
7271 #ifndef NULL
7272 #define NULL (void*)0
7273 #endif
7274
7275 static void *task(p)
7276         void *p;
7277 {
7278         return (void *) (p == NULL);
7279 }
7280
7281 int main() {
7282
7283         /* pthread test function */
7284         pthread_t t;
7285         int status;
7286
7287         /* make sure pthread_create() isn't just a stub */
7288 #if HAVE_PTHREADS_D4
7289         status = pthread_create(&t, pthread_attr_default, task, NULL);
7290 #else
7291         status = pthread_create(&t, NULL, task, NULL);
7292 #endif
7293
7294         if( status ) exit( status );
7295
7296         /* make sure pthread_detach() isn't just a stub */
7297 #if HAVE_PTHREADS_D4
7298         status = pthread_detach( &t );
7299 #else
7300         status = pthread_detach( t );
7301 #endif
7302
7303 #ifdef HAVE_LINUX_THREADS
7304         pthread_kill_other_threads_np();
7305 #endif
7306
7307         exit( status );
7308
7309 ; return 0; }
7310 EOF
7311 if { (eval echo configure:7312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7312   rm -rf conftest*
7313   ol_cv_pthread_thread=yes
7314 else
7315   echo "configure: failed program was:" >&5
7316   cat conftest.$ac_ext >&5
7317   rm -rf conftest*
7318   ol_cv_pthread_thread=no
7319 fi
7320 rm -f conftest*
7321 else
7322   cat > conftest.$ac_ext <<EOF
7323 #line 7324 "configure"
7324 #include "confdefs.h"
7325 /* pthread test headers */
7326 #include <pthread.h>
7327 #ifndef NULL
7328 #define NULL (void*)0
7329 #endif
7330
7331 static void *task(p)
7332         void *p;
7333 {
7334         return (void *) (p == NULL);
7335 }
7336
7337
7338 int main(argc, argv)
7339         int argc;
7340         char **argv;
7341 {
7342
7343         /* pthread test function */
7344         pthread_t t;
7345         int status;
7346
7347         /* make sure pthread_create() isn't just a stub */
7348 #if HAVE_PTHREADS_D4
7349         status = pthread_create(&t, pthread_attr_default, task, NULL);
7350 #else
7351         status = pthread_create(&t, NULL, task, NULL);
7352 #endif
7353
7354         if( status ) exit( status );
7355
7356         /* make sure pthread_detach() isn't just a stub */
7357 #if HAVE_PTHREADS_D4
7358         status = pthread_detach( &t );
7359 #else
7360         status = pthread_detach( t );
7361 #endif
7362
7363 #ifdef HAVE_LINUX_THREADS
7364         pthread_kill_other_threads_np();
7365 #endif
7366
7367         exit( status );
7368
7369 }
7370
7371 EOF
7372 if { (eval echo configure:7373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7373 then
7374   ol_cv_pthread_thread=yes
7375 else
7376   echo "configure: failed program was:" >&5
7377   cat conftest.$ac_ext >&5
7378   rm -fr conftest*
7379   ol_cv_pthread_thread=no
7380 fi
7381 rm -fr conftest*
7382 fi
7383
7384
7385                 # restore the LIBS
7386                 LIBS="$ol_LIBS"
7387         
7388 fi
7389
7390 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
7391
7392         if test $ol_cv_pthread_thread = yes ; then
7393                 ol_link_pthreads="-thread"
7394                 ol_link_threads=posix
7395         fi
7396 fi
7397
7398
7399                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
7400 if test "$ol_link_threads" = no ; then
7401         # try -lpthread -lmach -lexc -lc_r
7402         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
7403 echo "configure:7404: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
7404 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
7405   echo $ac_n "(cached) $ac_c" 1>&6
7406 else
7407   
7408                 # save the flags
7409                 ol_LIBS="$LIBS"
7410                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
7411
7412                 if test "$cross_compiling" = yes; then
7413   cat > conftest.$ac_ext <<EOF
7414 #line 7415 "configure"
7415 #include "confdefs.h"
7416 /* pthread test headers */
7417 #include <pthread.h>
7418 #ifndef NULL
7419 #define NULL (void*)0
7420 #endif
7421
7422 static void *task(p)
7423         void *p;
7424 {
7425         return (void *) (p == NULL);
7426 }
7427
7428 int main() {
7429
7430         /* pthread test function */
7431         pthread_t t;
7432         int status;
7433
7434         /* make sure pthread_create() isn't just a stub */
7435 #if HAVE_PTHREADS_D4
7436         status = pthread_create(&t, pthread_attr_default, task, NULL);
7437 #else
7438         status = pthread_create(&t, NULL, task, NULL);
7439 #endif
7440
7441         if( status ) exit( status );
7442
7443         /* make sure pthread_detach() isn't just a stub */
7444 #if HAVE_PTHREADS_D4
7445         status = pthread_detach( &t );
7446 #else
7447         status = pthread_detach( t );
7448 #endif
7449
7450 #ifdef HAVE_LINUX_THREADS
7451         pthread_kill_other_threads_np();
7452 #endif
7453
7454         exit( status );
7455
7456 ; return 0; }
7457 EOF
7458 if { (eval echo configure:7459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7459   rm -rf conftest*
7460   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
7461 else
7462   echo "configure: failed program was:" >&5
7463   cat conftest.$ac_ext >&5
7464   rm -rf conftest*
7465   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
7466 fi
7467 rm -f conftest*
7468 else
7469   cat > conftest.$ac_ext <<EOF
7470 #line 7471 "configure"
7471 #include "confdefs.h"
7472 /* pthread test headers */
7473 #include <pthread.h>
7474 #ifndef NULL
7475 #define NULL (void*)0
7476 #endif
7477
7478 static void *task(p)
7479         void *p;
7480 {
7481         return (void *) (p == NULL);
7482 }
7483
7484
7485 int main(argc, argv)
7486         int argc;
7487         char **argv;
7488 {
7489
7490         /* pthread test function */
7491         pthread_t t;
7492         int status;
7493
7494         /* make sure pthread_create() isn't just a stub */
7495 #if HAVE_PTHREADS_D4
7496         status = pthread_create(&t, pthread_attr_default, task, NULL);
7497 #else
7498         status = pthread_create(&t, NULL, task, NULL);
7499 #endif
7500
7501         if( status ) exit( status );
7502
7503         /* make sure pthread_detach() isn't just a stub */
7504 #if HAVE_PTHREADS_D4
7505         status = pthread_detach( &t );
7506 #else
7507         status = pthread_detach( t );
7508 #endif
7509
7510 #ifdef HAVE_LINUX_THREADS
7511         pthread_kill_other_threads_np();
7512 #endif
7513
7514         exit( status );
7515
7516 }
7517
7518 EOF
7519 if { (eval echo configure:7520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7520 then
7521   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
7522 else
7523   echo "configure: failed program was:" >&5
7524   cat conftest.$ac_ext >&5
7525   rm -fr conftest*
7526   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
7527 fi
7528 rm -fr conftest*
7529 fi
7530
7531
7532                 # restore the LIBS
7533                 LIBS="$ol_LIBS"
7534         
7535 fi
7536
7537 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
7538
7539         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
7540                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
7541                 ol_link_threads=posix
7542         fi
7543 fi
7544
7545                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
7546 if test "$ol_link_threads" = no ; then
7547         # try -lpthread -lmach -lexc
7548         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
7549 echo "configure:7550: checking for pthread link with -lpthread -lmach -lexc" >&5
7550 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
7551   echo $ac_n "(cached) $ac_c" 1>&6
7552 else
7553   
7554                 # save the flags
7555                 ol_LIBS="$LIBS"
7556                 LIBS="-lpthread -lmach -lexc $LIBS"
7557
7558                 if test "$cross_compiling" = yes; then
7559   cat > conftest.$ac_ext <<EOF
7560 #line 7561 "configure"
7561 #include "confdefs.h"
7562 /* pthread test headers */
7563 #include <pthread.h>
7564 #ifndef NULL
7565 #define NULL (void*)0
7566 #endif
7567
7568 static void *task(p)
7569         void *p;
7570 {
7571         return (void *) (p == NULL);
7572 }
7573
7574 int main() {
7575
7576         /* pthread test function */
7577         pthread_t t;
7578         int status;
7579
7580         /* make sure pthread_create() isn't just a stub */
7581 #if HAVE_PTHREADS_D4
7582         status = pthread_create(&t, pthread_attr_default, task, NULL);
7583 #else
7584         status = pthread_create(&t, NULL, task, NULL);
7585 #endif
7586
7587         if( status ) exit( status );
7588
7589         /* make sure pthread_detach() isn't just a stub */
7590 #if HAVE_PTHREADS_D4
7591         status = pthread_detach( &t );
7592 #else
7593         status = pthread_detach( t );
7594 #endif
7595
7596 #ifdef HAVE_LINUX_THREADS
7597         pthread_kill_other_threads_np();
7598 #endif
7599
7600         exit( status );
7601
7602 ; return 0; }
7603 EOF
7604 if { (eval echo configure:7605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7605   rm -rf conftest*
7606   ol_cv_pthread_lpthread_lmach_lexc=yes
7607 else
7608   echo "configure: failed program was:" >&5
7609   cat conftest.$ac_ext >&5
7610   rm -rf conftest*
7611   ol_cv_pthread_lpthread_lmach_lexc=no
7612 fi
7613 rm -f conftest*
7614 else
7615   cat > conftest.$ac_ext <<EOF
7616 #line 7617 "configure"
7617 #include "confdefs.h"
7618 /* pthread test headers */
7619 #include <pthread.h>
7620 #ifndef NULL
7621 #define NULL (void*)0
7622 #endif
7623
7624 static void *task(p)
7625         void *p;
7626 {
7627         return (void *) (p == NULL);
7628 }
7629
7630
7631 int main(argc, argv)
7632         int argc;
7633         char **argv;
7634 {
7635
7636         /* pthread test function */
7637         pthread_t t;
7638         int status;
7639
7640         /* make sure pthread_create() isn't just a stub */
7641 #if HAVE_PTHREADS_D4
7642         status = pthread_create(&t, pthread_attr_default, task, NULL);
7643 #else
7644         status = pthread_create(&t, NULL, task, NULL);
7645 #endif
7646
7647         if( status ) exit( status );
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_lpthread_lmach_lexc=yes
7668 else
7669   echo "configure: failed program was:" >&5
7670   cat conftest.$ac_ext >&5
7671   rm -fr conftest*
7672   ol_cv_pthread_lpthread_lmach_lexc=no
7673 fi
7674 rm -fr conftest*
7675 fi
7676
7677
7678                 # restore the LIBS
7679                 LIBS="$ol_LIBS"
7680         
7681 fi
7682
7683 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
7684
7685         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
7686                 ol_link_pthreads="-lpthread -lmach -lexc"
7687                 ol_link_threads=posix
7688         fi
7689 fi
7690
7691
7692                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
7693 if test "$ol_link_threads" = no ; then
7694         # try -lpthread -Wl,-woff,85
7695         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
7696 echo "configure:7697: checking for pthread link with -lpthread -Wl,-woff,85" >&5
7697 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
7698   echo $ac_n "(cached) $ac_c" 1>&6
7699 else
7700   
7701                 # save the flags
7702                 ol_LIBS="$LIBS"
7703                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
7704
7705                 if test "$cross_compiling" = yes; then
7706   cat > conftest.$ac_ext <<EOF
7707 #line 7708 "configure"
7708 #include "confdefs.h"
7709 /* pthread test headers */
7710 #include <pthread.h>
7711 #ifndef NULL
7712 #define NULL (void*)0
7713 #endif
7714
7715 static void *task(p)
7716         void *p;
7717 {
7718         return (void *) (p == NULL);
7719 }
7720
7721 int main() {
7722
7723         /* pthread test function */
7724         pthread_t t;
7725         int status;
7726
7727         /* make sure pthread_create() isn't just a stub */
7728 #if HAVE_PTHREADS_D4
7729         status = pthread_create(&t, pthread_attr_default, task, NULL);
7730 #else
7731         status = pthread_create(&t, NULL, task, NULL);
7732 #endif
7733
7734         if( status ) exit( status );
7735
7736         /* make sure pthread_detach() isn't just a stub */
7737 #if HAVE_PTHREADS_D4
7738         status = pthread_detach( &t );
7739 #else
7740         status = pthread_detach( t );
7741 #endif
7742
7743 #ifdef HAVE_LINUX_THREADS
7744         pthread_kill_other_threads_np();
7745 #endif
7746
7747         exit( status );
7748
7749 ; return 0; }
7750 EOF
7751 if { (eval echo configure:7752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7752   rm -rf conftest*
7753   ol_cv_pthread_lib_lpthread_woff=yes
7754 else
7755   echo "configure: failed program was:" >&5
7756   cat conftest.$ac_ext >&5
7757   rm -rf conftest*
7758   ol_cv_pthread_lib_lpthread_woff=no
7759 fi
7760 rm -f conftest*
7761 else
7762   cat > conftest.$ac_ext <<EOF
7763 #line 7764 "configure"
7764 #include "confdefs.h"
7765 /* pthread test headers */
7766 #include <pthread.h>
7767 #ifndef NULL
7768 #define NULL (void*)0
7769 #endif
7770
7771 static void *task(p)
7772         void *p;
7773 {
7774         return (void *) (p == NULL);
7775 }
7776
7777
7778 int main(argc, argv)
7779         int argc;
7780         char **argv;
7781 {
7782
7783         /* pthread test function */
7784         pthread_t t;
7785         int status;
7786
7787         /* make sure pthread_create() isn't just a stub */
7788 #if HAVE_PTHREADS_D4
7789         status = pthread_create(&t, pthread_attr_default, task, NULL);
7790 #else
7791         status = pthread_create(&t, NULL, task, NULL);
7792 #endif
7793
7794         if( status ) exit( status );
7795
7796         /* make sure pthread_detach() isn't just a stub */
7797 #if HAVE_PTHREADS_D4
7798         status = pthread_detach( &t );
7799 #else
7800         status = pthread_detach( t );
7801 #endif
7802
7803 #ifdef HAVE_LINUX_THREADS
7804         pthread_kill_other_threads_np();
7805 #endif
7806
7807         exit( status );
7808
7809 }
7810
7811 EOF
7812 if { (eval echo configure:7813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7813 then
7814   ol_cv_pthread_lib_lpthread_woff=yes
7815 else
7816   echo "configure: failed program was:" >&5
7817   cat conftest.$ac_ext >&5
7818   rm -fr conftest*
7819   ol_cv_pthread_lib_lpthread_woff=no
7820 fi
7821 rm -fr conftest*
7822 fi
7823
7824
7825                 # restore the LIBS
7826                 LIBS="$ol_LIBS"
7827         
7828 fi
7829
7830 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
7831
7832         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
7833                 ol_link_pthreads="-lpthread -Wl,-woff,85"
7834                 ol_link_threads=posix
7835         fi
7836 fi
7837
7838
7839                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
7840 if test "$ol_link_threads" = no ; then
7841         # try -lpthread
7842         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
7843 echo "configure:7844: checking for pthread link with -lpthread" >&5
7844 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
7845   echo $ac_n "(cached) $ac_c" 1>&6
7846 else
7847   
7848                 # save the flags
7849                 ol_LIBS="$LIBS"
7850                 LIBS="-lpthread $LIBS"
7851
7852                 if test "$cross_compiling" = yes; then
7853   cat > conftest.$ac_ext <<EOF
7854 #line 7855 "configure"
7855 #include "confdefs.h"
7856 /* pthread test headers */
7857 #include <pthread.h>
7858 #ifndef NULL
7859 #define NULL (void*)0
7860 #endif
7861
7862 static void *task(p)
7863         void *p;
7864 {
7865         return (void *) (p == NULL);
7866 }
7867
7868 int main() {
7869
7870         /* pthread test function */
7871         pthread_t t;
7872         int status;
7873
7874         /* make sure pthread_create() isn't just a stub */
7875 #if HAVE_PTHREADS_D4
7876         status = pthread_create(&t, pthread_attr_default, task, NULL);
7877 #else
7878         status = pthread_create(&t, NULL, task, NULL);
7879 #endif
7880
7881         if( status ) exit( status );
7882
7883         /* make sure pthread_detach() isn't just a stub */
7884 #if HAVE_PTHREADS_D4
7885         status = pthread_detach( &t );
7886 #else
7887         status = pthread_detach( t );
7888 #endif
7889
7890 #ifdef HAVE_LINUX_THREADS
7891         pthread_kill_other_threads_np();
7892 #endif
7893
7894         exit( status );
7895
7896 ; return 0; }
7897 EOF
7898 if { (eval echo configure:7899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7899   rm -rf conftest*
7900   ol_cv_pthread_lpthread=yes
7901 else
7902   echo "configure: failed program was:" >&5
7903   cat conftest.$ac_ext >&5
7904   rm -rf conftest*
7905   ol_cv_pthread_lpthread=no
7906 fi
7907 rm -f conftest*
7908 else
7909   cat > conftest.$ac_ext <<EOF
7910 #line 7911 "configure"
7911 #include "confdefs.h"
7912 /* pthread test headers */
7913 #include <pthread.h>
7914 #ifndef NULL
7915 #define NULL (void*)0
7916 #endif
7917
7918 static void *task(p)
7919         void *p;
7920 {
7921         return (void *) (p == NULL);
7922 }
7923
7924
7925 int main(argc, argv)
7926         int argc;
7927         char **argv;
7928 {
7929
7930         /* pthread test function */
7931         pthread_t t;
7932         int status;
7933
7934         /* make sure pthread_create() isn't just a stub */
7935 #if HAVE_PTHREADS_D4
7936         status = pthread_create(&t, pthread_attr_default, task, NULL);
7937 #else
7938         status = pthread_create(&t, NULL, task, NULL);
7939 #endif
7940
7941         if( status ) exit( status );
7942
7943         /* make sure pthread_detach() isn't just a stub */
7944 #if HAVE_PTHREADS_D4
7945         status = pthread_detach( &t );
7946 #else
7947         status = pthread_detach( t );
7948 #endif
7949
7950 #ifdef HAVE_LINUX_THREADS
7951         pthread_kill_other_threads_np();
7952 #endif
7953
7954         exit( status );
7955
7956 }
7957
7958 EOF
7959 if { (eval echo configure:7960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7960 then
7961   ol_cv_pthread_lpthread=yes
7962 else
7963   echo "configure: failed program was:" >&5
7964   cat conftest.$ac_ext >&5
7965   rm -fr conftest*
7966   ol_cv_pthread_lpthread=no
7967 fi
7968 rm -fr conftest*
7969 fi
7970
7971
7972                 # restore the LIBS
7973                 LIBS="$ol_LIBS"
7974         
7975 fi
7976
7977 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
7978
7979         if test $ol_cv_pthread_lpthread = yes ; then
7980                 ol_link_pthreads="-lpthread"
7981                 ol_link_threads=posix
7982         fi
7983 fi
7984
7985                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
7986 if test "$ol_link_threads" = no ; then
7987         # try -lc_r
7988         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
7989 echo "configure:7990: checking for pthread link with -lc_r" >&5
7990 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
7991   echo $ac_n "(cached) $ac_c" 1>&6
7992 else
7993   
7994                 # save the flags
7995                 ol_LIBS="$LIBS"
7996                 LIBS="-lc_r $LIBS"
7997
7998                 if test "$cross_compiling" = yes; then
7999   cat > conftest.$ac_ext <<EOF
8000 #line 8001 "configure"
8001 #include "confdefs.h"
8002 /* pthread test headers */
8003 #include <pthread.h>
8004 #ifndef NULL
8005 #define NULL (void*)0
8006 #endif
8007
8008 static void *task(p)
8009         void *p;
8010 {
8011         return (void *) (p == NULL);
8012 }
8013
8014 int main() {
8015
8016         /* pthread test function */
8017         pthread_t t;
8018         int status;
8019
8020         /* make sure pthread_create() isn't just a stub */
8021 #if HAVE_PTHREADS_D4
8022         status = pthread_create(&t, pthread_attr_default, task, NULL);
8023 #else
8024         status = pthread_create(&t, NULL, task, NULL);
8025 #endif
8026
8027         if( status ) exit( status );
8028
8029         /* make sure pthread_detach() isn't just a stub */
8030 #if HAVE_PTHREADS_D4
8031         status = pthread_detach( &t );
8032 #else
8033         status = pthread_detach( t );
8034 #endif
8035
8036 #ifdef HAVE_LINUX_THREADS
8037         pthread_kill_other_threads_np();
8038 #endif
8039
8040         exit( status );
8041
8042 ; return 0; }
8043 EOF
8044 if { (eval echo configure:8045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8045   rm -rf conftest*
8046   ol_cv_pthread_lc_r=yes
8047 else
8048   echo "configure: failed program was:" >&5
8049   cat conftest.$ac_ext >&5
8050   rm -rf conftest*
8051   ol_cv_pthread_lc_r=no
8052 fi
8053 rm -f conftest*
8054 else
8055   cat > conftest.$ac_ext <<EOF
8056 #line 8057 "configure"
8057 #include "confdefs.h"
8058 /* pthread test headers */
8059 #include <pthread.h>
8060 #ifndef NULL
8061 #define NULL (void*)0
8062 #endif
8063
8064 static void *task(p)
8065         void *p;
8066 {
8067         return (void *) (p == NULL);
8068 }
8069
8070
8071 int main(argc, argv)
8072         int argc;
8073         char **argv;
8074 {
8075
8076         /* pthread test function */
8077         pthread_t t;
8078         int status;
8079
8080         /* make sure pthread_create() isn't just a stub */
8081 #if HAVE_PTHREADS_D4
8082         status = pthread_create(&t, pthread_attr_default, task, NULL);
8083 #else
8084         status = pthread_create(&t, NULL, task, NULL);
8085 #endif
8086
8087         if( status ) exit( status );
8088
8089         /* make sure pthread_detach() isn't just a stub */
8090 #if HAVE_PTHREADS_D4
8091         status = pthread_detach( &t );
8092 #else
8093         status = pthread_detach( t );
8094 #endif
8095
8096 #ifdef HAVE_LINUX_THREADS
8097         pthread_kill_other_threads_np();
8098 #endif
8099
8100         exit( status );
8101
8102 }
8103
8104 EOF
8105 if { (eval echo configure:8106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8106 then
8107   ol_cv_pthread_lc_r=yes
8108 else
8109   echo "configure: failed program was:" >&5
8110   cat conftest.$ac_ext >&5
8111   rm -fr conftest*
8112   ol_cv_pthread_lc_r=no
8113 fi
8114 rm -fr conftest*
8115 fi
8116
8117
8118                 # restore the LIBS
8119                 LIBS="$ol_LIBS"
8120         
8121 fi
8122
8123 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
8124
8125         if test $ol_cv_pthread_lc_r = yes ; then
8126                 ol_link_pthreads="-lc_r"
8127                 ol_link_threads=posix
8128         fi
8129 fi
8130
8131
8132                 # Pthread try link: -threads (ol_cv_pthread_threads)
8133 if test "$ol_link_threads" = no ; then
8134         # try -threads
8135         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
8136 echo "configure:8137: checking for pthread link with -threads" >&5
8137 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
8138   echo $ac_n "(cached) $ac_c" 1>&6
8139 else
8140   
8141                 # save the flags
8142                 ol_LIBS="$LIBS"
8143                 LIBS="-threads $LIBS"
8144
8145                 if test "$cross_compiling" = yes; then
8146   cat > conftest.$ac_ext <<EOF
8147 #line 8148 "configure"
8148 #include "confdefs.h"
8149 /* pthread test headers */
8150 #include <pthread.h>
8151 #ifndef NULL
8152 #define NULL (void*)0
8153 #endif
8154
8155 static void *task(p)
8156         void *p;
8157 {
8158         return (void *) (p == NULL);
8159 }
8160
8161 int main() {
8162
8163         /* pthread test function */
8164         pthread_t t;
8165         int status;
8166
8167         /* make sure pthread_create() isn't just a stub */
8168 #if HAVE_PTHREADS_D4
8169         status = pthread_create(&t, pthread_attr_default, task, NULL);
8170 #else
8171         status = pthread_create(&t, NULL, task, NULL);
8172 #endif
8173
8174         if( status ) exit( status );
8175
8176         /* make sure pthread_detach() isn't just a stub */
8177 #if HAVE_PTHREADS_D4
8178         status = pthread_detach( &t );
8179 #else
8180         status = pthread_detach( t );
8181 #endif
8182
8183 #ifdef HAVE_LINUX_THREADS
8184         pthread_kill_other_threads_np();
8185 #endif
8186
8187         exit( status );
8188
8189 ; return 0; }
8190 EOF
8191 if { (eval echo configure:8192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8192   rm -rf conftest*
8193   ol_cv_pthread_threads=yes
8194 else
8195   echo "configure: failed program was:" >&5
8196   cat conftest.$ac_ext >&5
8197   rm -rf conftest*
8198   ol_cv_pthread_threads=no
8199 fi
8200 rm -f conftest*
8201 else
8202   cat > conftest.$ac_ext <<EOF
8203 #line 8204 "configure"
8204 #include "confdefs.h"
8205 /* pthread test headers */
8206 #include <pthread.h>
8207 #ifndef NULL
8208 #define NULL (void*)0
8209 #endif
8210
8211 static void *task(p)
8212         void *p;
8213 {
8214         return (void *) (p == NULL);
8215 }
8216
8217
8218 int main(argc, argv)
8219         int argc;
8220         char **argv;
8221 {
8222
8223         /* pthread test function */
8224         pthread_t t;
8225         int status;
8226
8227         /* make sure pthread_create() isn't just a stub */
8228 #if HAVE_PTHREADS_D4
8229         status = pthread_create(&t, pthread_attr_default, task, NULL);
8230 #else
8231         status = pthread_create(&t, NULL, task, NULL);
8232 #endif
8233
8234         if( status ) exit( status );
8235
8236         /* make sure pthread_detach() isn't just a stub */
8237 #if HAVE_PTHREADS_D4
8238         status = pthread_detach( &t );
8239 #else
8240         status = pthread_detach( t );
8241 #endif
8242
8243 #ifdef HAVE_LINUX_THREADS
8244         pthread_kill_other_threads_np();
8245 #endif
8246
8247         exit( status );
8248
8249 }
8250
8251 EOF
8252 if { (eval echo configure:8253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8253 then
8254   ol_cv_pthread_threads=yes
8255 else
8256   echo "configure: failed program was:" >&5
8257   cat conftest.$ac_ext >&5
8258   rm -fr conftest*
8259   ol_cv_pthread_threads=no
8260 fi
8261 rm -fr conftest*
8262 fi
8263
8264
8265                 # restore the LIBS
8266                 LIBS="$ol_LIBS"
8267         
8268 fi
8269
8270 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
8271
8272         if test $ol_cv_pthread_threads = yes ; then
8273                 ol_link_pthreads="-threads"
8274                 ol_link_threads=posix
8275         fi
8276 fi
8277
8278
8279                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
8280 if test "$ol_link_threads" = no ; then
8281         # try -lpthreads -lmach -lexc -lc_r
8282         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
8283 echo "configure:8284: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
8284 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
8285   echo $ac_n "(cached) $ac_c" 1>&6
8286 else
8287   
8288                 # save the flags
8289                 ol_LIBS="$LIBS"
8290                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
8291
8292                 if test "$cross_compiling" = yes; then
8293   cat > conftest.$ac_ext <<EOF
8294 #line 8295 "configure"
8295 #include "confdefs.h"
8296 /* pthread test headers */
8297 #include <pthread.h>
8298 #ifndef NULL
8299 #define NULL (void*)0
8300 #endif
8301
8302 static void *task(p)
8303         void *p;
8304 {
8305         return (void *) (p == NULL);
8306 }
8307
8308 int main() {
8309
8310         /* pthread test function */
8311         pthread_t t;
8312         int status;
8313
8314         /* make sure pthread_create() isn't just a stub */
8315 #if HAVE_PTHREADS_D4
8316         status = pthread_create(&t, pthread_attr_default, task, NULL);
8317 #else
8318         status = pthread_create(&t, NULL, task, NULL);
8319 #endif
8320
8321         if( status ) exit( status );
8322
8323         /* make sure pthread_detach() isn't just a stub */
8324 #if HAVE_PTHREADS_D4
8325         status = pthread_detach( &t );
8326 #else
8327         status = pthread_detach( t );
8328 #endif
8329
8330 #ifdef HAVE_LINUX_THREADS
8331         pthread_kill_other_threads_np();
8332 #endif
8333
8334         exit( status );
8335
8336 ; return 0; }
8337 EOF
8338 if { (eval echo configure:8339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8339   rm -rf conftest*
8340   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
8341 else
8342   echo "configure: failed program was:" >&5
8343   cat conftest.$ac_ext >&5
8344   rm -rf conftest*
8345   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
8346 fi
8347 rm -f conftest*
8348 else
8349   cat > conftest.$ac_ext <<EOF
8350 #line 8351 "configure"
8351 #include "confdefs.h"
8352 /* pthread test headers */
8353 #include <pthread.h>
8354 #ifndef NULL
8355 #define NULL (void*)0
8356 #endif
8357
8358 static void *task(p)
8359         void *p;
8360 {
8361         return (void *) (p == NULL);
8362 }
8363
8364
8365 int main(argc, argv)
8366         int argc;
8367         char **argv;
8368 {
8369
8370         /* pthread test function */
8371         pthread_t t;
8372         int status;
8373
8374         /* make sure pthread_create() isn't just a stub */
8375 #if HAVE_PTHREADS_D4
8376         status = pthread_create(&t, pthread_attr_default, task, NULL);
8377 #else
8378         status = pthread_create(&t, NULL, task, NULL);
8379 #endif
8380
8381         if( status ) exit( status );
8382
8383         /* make sure pthread_detach() isn't just a stub */
8384 #if HAVE_PTHREADS_D4
8385         status = pthread_detach( &t );
8386 #else
8387         status = pthread_detach( t );
8388 #endif
8389
8390 #ifdef HAVE_LINUX_THREADS
8391         pthread_kill_other_threads_np();
8392 #endif
8393
8394         exit( status );
8395
8396 }
8397
8398 EOF
8399 if { (eval echo configure:8400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8400 then
8401   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
8402 else
8403   echo "configure: failed program was:" >&5
8404   cat conftest.$ac_ext >&5
8405   rm -fr conftest*
8406   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
8407 fi
8408 rm -fr conftest*
8409 fi
8410
8411
8412                 # restore the LIBS
8413                 LIBS="$ol_LIBS"
8414         
8415 fi
8416
8417 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
8418
8419         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
8420                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
8421                 ol_link_threads=posix
8422         fi
8423 fi
8424
8425                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
8426 if test "$ol_link_threads" = no ; then
8427         # try -lpthreads -lmach -lexc
8428         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
8429 echo "configure:8430: checking for pthread link with -lpthreads -lmach -lexc" >&5
8430 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
8431   echo $ac_n "(cached) $ac_c" 1>&6
8432 else
8433   
8434                 # save the flags
8435                 ol_LIBS="$LIBS"
8436                 LIBS="-lpthreads -lmach -lexc $LIBS"
8437
8438                 if test "$cross_compiling" = yes; then
8439   cat > conftest.$ac_ext <<EOF
8440 #line 8441 "configure"
8441 #include "confdefs.h"
8442 /* pthread test headers */
8443 #include <pthread.h>
8444 #ifndef NULL
8445 #define NULL (void*)0
8446 #endif
8447
8448 static void *task(p)
8449         void *p;
8450 {
8451         return (void *) (p == NULL);
8452 }
8453
8454 int main() {
8455
8456         /* pthread test function */
8457         pthread_t t;
8458         int status;
8459
8460         /* make sure pthread_create() isn't just a stub */
8461 #if HAVE_PTHREADS_D4
8462         status = pthread_create(&t, pthread_attr_default, task, NULL);
8463 #else
8464         status = pthread_create(&t, NULL, task, NULL);
8465 #endif
8466
8467         if( status ) exit( status );
8468
8469         /* make sure pthread_detach() isn't just a stub */
8470 #if HAVE_PTHREADS_D4
8471         status = pthread_detach( &t );
8472 #else
8473         status = pthread_detach( t );
8474 #endif
8475
8476 #ifdef HAVE_LINUX_THREADS
8477         pthread_kill_other_threads_np();
8478 #endif
8479
8480         exit( status );
8481
8482 ; return 0; }
8483 EOF
8484 if { (eval echo configure:8485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8485   rm -rf conftest*
8486   ol_cv_pthread_lpthreads_lmach_lexc=yes
8487 else
8488   echo "configure: failed program was:" >&5
8489   cat conftest.$ac_ext >&5
8490   rm -rf conftest*
8491   ol_cv_pthread_lpthreads_lmach_lexc=no
8492 fi
8493 rm -f conftest*
8494 else
8495   cat > conftest.$ac_ext <<EOF
8496 #line 8497 "configure"
8497 #include "confdefs.h"
8498 /* pthread test headers */
8499 #include <pthread.h>
8500 #ifndef NULL
8501 #define NULL (void*)0
8502 #endif
8503
8504 static void *task(p)
8505         void *p;
8506 {
8507         return (void *) (p == NULL);
8508 }
8509
8510
8511 int main(argc, argv)
8512         int argc;
8513         char **argv;
8514 {
8515
8516         /* pthread test function */
8517         pthread_t t;
8518         int status;
8519
8520         /* make sure pthread_create() isn't just a stub */
8521 #if HAVE_PTHREADS_D4
8522         status = pthread_create(&t, pthread_attr_default, task, NULL);
8523 #else
8524         status = pthread_create(&t, NULL, task, NULL);
8525 #endif
8526
8527         if( status ) exit( status );
8528
8529         /* make sure pthread_detach() isn't just a stub */
8530 #if HAVE_PTHREADS_D4
8531         status = pthread_detach( &t );
8532 #else
8533         status = pthread_detach( t );
8534 #endif
8535
8536 #ifdef HAVE_LINUX_THREADS
8537         pthread_kill_other_threads_np();
8538 #endif
8539
8540         exit( status );
8541
8542 }
8543
8544 EOF
8545 if { (eval echo configure:8546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8546 then
8547   ol_cv_pthread_lpthreads_lmach_lexc=yes
8548 else
8549   echo "configure: failed program was:" >&5
8550   cat conftest.$ac_ext >&5
8551   rm -fr conftest*
8552   ol_cv_pthread_lpthreads_lmach_lexc=no
8553 fi
8554 rm -fr conftest*
8555 fi
8556
8557
8558                 # restore the LIBS
8559                 LIBS="$ol_LIBS"
8560         
8561 fi
8562
8563 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
8564
8565         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
8566                 ol_link_pthreads="-lpthreads -lmach -lexc"
8567                 ol_link_threads=posix
8568         fi
8569 fi
8570
8571                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
8572 if test "$ol_link_threads" = no ; then
8573         # try -lpthreads -lexc
8574         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
8575 echo "configure:8576: checking for pthread link with -lpthreads -lexc" >&5
8576 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
8577   echo $ac_n "(cached) $ac_c" 1>&6
8578 else
8579   
8580                 # save the flags
8581                 ol_LIBS="$LIBS"
8582                 LIBS="-lpthreads -lexc $LIBS"
8583
8584                 if test "$cross_compiling" = yes; then
8585   cat > conftest.$ac_ext <<EOF
8586 #line 8587 "configure"
8587 #include "confdefs.h"
8588 /* pthread test headers */
8589 #include <pthread.h>
8590 #ifndef NULL
8591 #define NULL (void*)0
8592 #endif
8593
8594 static void *task(p)
8595         void *p;
8596 {
8597         return (void *) (p == NULL);
8598 }
8599
8600 int main() {
8601
8602         /* pthread test function */
8603         pthread_t t;
8604         int status;
8605
8606         /* make sure pthread_create() isn't just a stub */
8607 #if HAVE_PTHREADS_D4
8608         status = pthread_create(&t, pthread_attr_default, task, NULL);
8609 #else
8610         status = pthread_create(&t, NULL, task, NULL);
8611 #endif
8612
8613         if( status ) exit( status );
8614
8615         /* make sure pthread_detach() isn't just a stub */
8616 #if HAVE_PTHREADS_D4
8617         status = pthread_detach( &t );
8618 #else
8619         status = pthread_detach( t );
8620 #endif
8621
8622 #ifdef HAVE_LINUX_THREADS
8623         pthread_kill_other_threads_np();
8624 #endif
8625
8626         exit( status );
8627
8628 ; return 0; }
8629 EOF
8630 if { (eval echo configure:8631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8631   rm -rf conftest*
8632   ol_cv_pthread_lpthreads_lexc=yes
8633 else
8634   echo "configure: failed program was:" >&5
8635   cat conftest.$ac_ext >&5
8636   rm -rf conftest*
8637   ol_cv_pthread_lpthreads_lexc=no
8638 fi
8639 rm -f conftest*
8640 else
8641   cat > conftest.$ac_ext <<EOF
8642 #line 8643 "configure"
8643 #include "confdefs.h"
8644 /* pthread test headers */
8645 #include <pthread.h>
8646 #ifndef NULL
8647 #define NULL (void*)0
8648 #endif
8649
8650 static void *task(p)
8651         void *p;
8652 {
8653         return (void *) (p == NULL);
8654 }
8655
8656
8657 int main(argc, argv)
8658         int argc;
8659         char **argv;
8660 {
8661
8662         /* pthread test function */
8663         pthread_t t;
8664         int status;
8665
8666         /* make sure pthread_create() isn't just a stub */
8667 #if HAVE_PTHREADS_D4
8668         status = pthread_create(&t, pthread_attr_default, task, NULL);
8669 #else
8670         status = pthread_create(&t, NULL, task, NULL);
8671 #endif
8672
8673         if( status ) exit( status );
8674
8675         /* make sure pthread_detach() isn't just a stub */
8676 #if HAVE_PTHREADS_D4
8677         status = pthread_detach( &t );
8678 #else
8679         status = pthread_detach( t );
8680 #endif
8681
8682 #ifdef HAVE_LINUX_THREADS
8683         pthread_kill_other_threads_np();
8684 #endif
8685
8686         exit( status );
8687
8688 }
8689
8690 EOF
8691 if { (eval echo configure:8692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8692 then
8693   ol_cv_pthread_lpthreads_lexc=yes
8694 else
8695   echo "configure: failed program was:" >&5
8696   cat conftest.$ac_ext >&5
8697   rm -fr conftest*
8698   ol_cv_pthread_lpthreads_lexc=no
8699 fi
8700 rm -fr conftest*
8701 fi
8702
8703
8704                 # restore the LIBS
8705                 LIBS="$ol_LIBS"
8706         
8707 fi
8708
8709 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
8710
8711         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
8712                 ol_link_pthreads="-lpthreads -lexc"
8713                 ol_link_threads=posix
8714         fi
8715 fi
8716
8717
8718                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
8719 if test "$ol_link_threads" = no ; then
8720         # try -lpthreads
8721         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
8722 echo "configure:8723: checking for pthread link with -lpthreads" >&5
8723 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
8724   echo $ac_n "(cached) $ac_c" 1>&6
8725 else
8726   
8727                 # save the flags
8728                 ol_LIBS="$LIBS"
8729                 LIBS="-lpthreads $LIBS"
8730
8731                 if test "$cross_compiling" = yes; then
8732   cat > conftest.$ac_ext <<EOF
8733 #line 8734 "configure"
8734 #include "confdefs.h"
8735 /* pthread test headers */
8736 #include <pthread.h>
8737 #ifndef NULL
8738 #define NULL (void*)0
8739 #endif
8740
8741 static void *task(p)
8742         void *p;
8743 {
8744         return (void *) (p == NULL);
8745 }
8746
8747 int main() {
8748
8749         /* pthread test function */
8750         pthread_t t;
8751         int status;
8752
8753         /* make sure pthread_create() isn't just a stub */
8754 #if HAVE_PTHREADS_D4
8755         status = pthread_create(&t, pthread_attr_default, task, NULL);
8756 #else
8757         status = pthread_create(&t, NULL, task, NULL);
8758 #endif
8759
8760         if( status ) exit( status );
8761
8762         /* make sure pthread_detach() isn't just a stub */
8763 #if HAVE_PTHREADS_D4
8764         status = pthread_detach( &t );
8765 #else
8766         status = pthread_detach( t );
8767 #endif
8768
8769 #ifdef HAVE_LINUX_THREADS
8770         pthread_kill_other_threads_np();
8771 #endif
8772
8773         exit( status );
8774
8775 ; return 0; }
8776 EOF
8777 if { (eval echo configure:8778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8778   rm -rf conftest*
8779   ol_cv_pthread_lib_lpthreads=yes
8780 else
8781   echo "configure: failed program was:" >&5
8782   cat conftest.$ac_ext >&5
8783   rm -rf conftest*
8784   ol_cv_pthread_lib_lpthreads=no
8785 fi
8786 rm -f conftest*
8787 else
8788   cat > conftest.$ac_ext <<EOF
8789 #line 8790 "configure"
8790 #include "confdefs.h"
8791 /* pthread test headers */
8792 #include <pthread.h>
8793 #ifndef NULL
8794 #define NULL (void*)0
8795 #endif
8796
8797 static void *task(p)
8798         void *p;
8799 {
8800         return (void *) (p == NULL);
8801 }
8802
8803
8804 int main(argc, argv)
8805         int argc;
8806         char **argv;
8807 {
8808
8809         /* pthread test function */
8810         pthread_t t;
8811         int status;
8812
8813         /* make sure pthread_create() isn't just a stub */
8814 #if HAVE_PTHREADS_D4
8815         status = pthread_create(&t, pthread_attr_default, task, NULL);
8816 #else
8817         status = pthread_create(&t, NULL, task, NULL);
8818 #endif
8819
8820         if( status ) exit( status );
8821
8822         /* make sure pthread_detach() isn't just a stub */
8823 #if HAVE_PTHREADS_D4
8824         status = pthread_detach( &t );
8825 #else
8826         status = pthread_detach( t );
8827 #endif
8828
8829 #ifdef HAVE_LINUX_THREADS
8830         pthread_kill_other_threads_np();
8831 #endif
8832
8833         exit( status );
8834
8835 }
8836
8837 EOF
8838 if { (eval echo configure:8839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8839 then
8840   ol_cv_pthread_lib_lpthreads=yes
8841 else
8842   echo "configure: failed program was:" >&5
8843   cat conftest.$ac_ext >&5
8844   rm -fr conftest*
8845   ol_cv_pthread_lib_lpthreads=no
8846 fi
8847 rm -fr conftest*
8848 fi
8849
8850
8851                 # restore the LIBS
8852                 LIBS="$ol_LIBS"
8853         
8854 fi
8855
8856 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
8857
8858         if test $ol_cv_pthread_lib_lpthreads = yes ; then
8859                 ol_link_pthreads="-lpthreads"
8860                 ol_link_threads=posix
8861         fi
8862 fi
8863
8864
8865                 if test $ol_link_threads != no ; then
8866                         cat >> confdefs.h <<\EOF
8867 #define HAVE_PTHREADS 1
8868 EOF
8869
8870
8871                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
8872
8873                                                 save_CPPFLAGS="$CPPFLAGS"
8874                         save_LIBS="$LIBS"
8875                         LIBS="$LTHREAD_LIBS $LIBS"
8876
8877                                                                                                 for ac_func in sched_yield pthread_yield
8878 do
8879 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8880 echo "configure:8881: checking for $ac_func" >&5
8881 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
8882   echo $ac_n "(cached) $ac_c" 1>&6
8883 else
8884   cat > conftest.$ac_ext <<EOF
8885 #line 8886 "configure"
8886 #include "confdefs.h"
8887 /* System header to define __stub macros and hopefully few prototypes,
8888     which can conflict with char $ac_func(); below.  */
8889 #include <assert.h>
8890 /* Override any gcc2 internal prototype to avoid an error.  */
8891 /* We use char because int might match the return type of a gcc2
8892     builtin and then its argument prototype would still apply.  */
8893 char $ac_func();
8894 char (*f)();
8895
8896 int main() {
8897
8898 /* The GNU C library defines this for functions which it implements
8899     to always fail with ENOSYS.  Some functions are actually named
8900     something starting with __ and the normal name is an alias.  */
8901 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8902 choke me
8903 #else
8904 f = $ac_func;
8905 #endif
8906
8907 ; return 0; }
8908 EOF
8909 if { (eval echo configure:8910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8910   rm -rf conftest*
8911   eval "ac_cv_func_$ac_func=yes"
8912 else
8913   echo "configure: failed program was:" >&5
8914   cat conftest.$ac_ext >&5
8915   rm -rf conftest*
8916   eval "ac_cv_func_$ac_func=no"
8917 fi
8918 rm -f conftest*
8919 fi
8920
8921 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8922   echo "$ac_t""yes" 1>&6
8923     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8924   cat >> confdefs.h <<EOF
8925 #define $ac_tr_func 1
8926 EOF
8927  
8928 else
8929   echo "$ac_t""no" 1>&6
8930 fi
8931 done
8932
8933
8934                         if test $ac_cv_func_sched_yield = no -a \
8935                                 $ac_cv_func_pthread_yield = no ; then
8936                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
8937 echo "configure:8938: checking for sched_yield in -lrt" >&5
8938 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
8939 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8940   echo $ac_n "(cached) $ac_c" 1>&6
8941 else
8942   ac_save_LIBS="$LIBS"
8943 LIBS="-lrt  $LIBS"
8944 cat > conftest.$ac_ext <<EOF
8945 #line 8946 "configure"
8946 #include "confdefs.h"
8947 /* Override any gcc2 internal prototype to avoid an error.  */
8948 /* We use char because int might match the return type of a gcc2
8949     builtin and then its argument prototype would still apply.  */
8950 char sched_yield();
8951
8952 int main() {
8953 sched_yield()
8954 ; return 0; }
8955 EOF
8956 if { (eval echo configure:8957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8957   rm -rf conftest*
8958   eval "ac_cv_lib_$ac_lib_var=yes"
8959 else
8960   echo "configure: failed program was:" >&5
8961   cat conftest.$ac_ext >&5
8962   rm -rf conftest*
8963   eval "ac_cv_lib_$ac_lib_var=no"
8964 fi
8965 rm -f conftest*
8966 LIBS="$ac_save_LIBS"
8967
8968 fi
8969 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8970   echo "$ac_t""yes" 1>&6
8971   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
8972                                         cat >> confdefs.h <<\EOF
8973 #define HAVE_SCHED_YIELD 1
8974 EOF
8975
8976                                         ac_cv_func_sched_yield=yes
8977 else
8978   echo "$ac_t""no" 1>&6
8979 ac_cv_func_sched_yield=no
8980 fi
8981
8982                         fi
8983                         if test $ac_cv_func_sched_yield = no -a \
8984                                 $ac_cv_func_pthread_yield = no ; then
8985                                                                                                 for ac_func in thr_yield
8986 do
8987 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8988 echo "configure:8989: checking for $ac_func" >&5
8989 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
8990   echo $ac_n "(cached) $ac_c" 1>&6
8991 else
8992   cat > conftest.$ac_ext <<EOF
8993 #line 8994 "configure"
8994 #include "confdefs.h"
8995 /* System header to define __stub macros and hopefully few prototypes,
8996     which can conflict with char $ac_func(); below.  */
8997 #include <assert.h>
8998 /* Override any gcc2 internal prototype to avoid an error.  */
8999 /* We use char because int might match the return type of a gcc2
9000     builtin and then its argument prototype would still apply.  */
9001 char $ac_func();
9002 char (*f)();
9003
9004 int main() {
9005
9006 /* The GNU C library defines this for functions which it implements
9007     to always fail with ENOSYS.  Some functions are actually named
9008     something starting with __ and the normal name is an alias.  */
9009 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9010 choke me
9011 #else
9012 f = $ac_func;
9013 #endif
9014
9015 ; return 0; }
9016 EOF
9017 if { (eval echo configure:9018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9018   rm -rf conftest*
9019   eval "ac_cv_func_$ac_func=yes"
9020 else
9021   echo "configure: failed program was:" >&5
9022   cat conftest.$ac_ext >&5
9023   rm -rf conftest*
9024   eval "ac_cv_func_$ac_func=no"
9025 fi
9026 rm -f conftest*
9027 fi
9028
9029 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9030   echo "$ac_t""yes" 1>&6
9031     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9032   cat >> confdefs.h <<EOF
9033 #define $ac_tr_func 1
9034 EOF
9035  
9036 else
9037   echo "$ac_t""no" 1>&6
9038 fi
9039 done
9040
9041                         fi
9042                         if test $ac_cv_func_sched_yield = no -a \
9043                                 $ac_cv_func_pthread_yield = no -a \
9044                                 "$ac_cv_func_thr_yield" = no ; then
9045                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
9046                         fi
9047
9048                                                 for ac_func in pthread_kill
9049 do
9050 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9051 echo "configure:9052: checking for $ac_func" >&5
9052 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9053   echo $ac_n "(cached) $ac_c" 1>&6
9054 else
9055   cat > conftest.$ac_ext <<EOF
9056 #line 9057 "configure"
9057 #include "confdefs.h"
9058 /* System header to define __stub macros and hopefully few prototypes,
9059     which can conflict with char $ac_func(); below.  */
9060 #include <assert.h>
9061 /* Override any gcc2 internal prototype to avoid an error.  */
9062 /* We use char because int might match the return type of a gcc2
9063     builtin and then its argument prototype would still apply.  */
9064 char $ac_func();
9065 char (*f)();
9066
9067 int main() {
9068
9069 /* The GNU C library defines this for functions which it implements
9070     to always fail with ENOSYS.  Some functions are actually named
9071     something starting with __ and the normal name is an alias.  */
9072 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9073 choke me
9074 #else
9075 f = $ac_func;
9076 #endif
9077
9078 ; return 0; }
9079 EOF
9080 if { (eval echo configure:9081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9081   rm -rf conftest*
9082   eval "ac_cv_func_$ac_func=yes"
9083 else
9084   echo "configure: failed program was:" >&5
9085   cat conftest.$ac_ext >&5
9086   rm -rf conftest*
9087   eval "ac_cv_func_$ac_func=no"
9088 fi
9089 rm -f conftest*
9090 fi
9091
9092 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9093   echo "$ac_t""yes" 1>&6
9094     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9095   cat >> confdefs.h <<EOF
9096 #define $ac_tr_func 1
9097 EOF
9098  
9099 else
9100   echo "$ac_t""no" 1>&6
9101 fi
9102 done
9103
9104
9105                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
9106 echo "configure:9107: checking for pthread_detach with <pthread.h>" >&5
9107 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
9108   echo $ac_n "(cached) $ac_c" 1>&6
9109 else
9110   
9111                                                                 cat > conftest.$ac_ext <<EOF
9112 #line 9113 "configure"
9113 #include "confdefs.h"
9114
9115 #include <pthread.h>
9116 #ifndef NULL
9117 #define NULL (void*)0
9118 #endif
9119
9120 int main() {
9121 pthread_detach(NULL);
9122 ; return 0; }
9123 EOF
9124 if { (eval echo configure:9125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9125   rm -rf conftest*
9126   ol_cv_func_pthread_detach=yes
9127 else
9128   echo "configure: failed program was:" >&5
9129   cat conftest.$ac_ext >&5
9130   rm -rf conftest*
9131   ol_cv_func_pthread_detach=no
9132 fi
9133 rm -f conftest*
9134                         
9135 fi
9136
9137 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
9138
9139                         if test $ol_cv_func_pthread_detach = no ; then
9140                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
9141                         fi
9142
9143                         cat >> confdefs.h <<\EOF
9144 #define HAVE_PTHREAD_DETACH 1
9145 EOF
9146
9147
9148                                                 for ac_func in \
9149                                 pthread_setconcurrency \
9150                                 pthread_getconcurrency \
9151                                 thr_setconcurrency \
9152                                 thr_getconcurrency \
9153                         
9154 do
9155 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9156 echo "configure:9157: checking for $ac_func" >&5
9157 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9158   echo $ac_n "(cached) $ac_c" 1>&6
9159 else
9160   cat > conftest.$ac_ext <<EOF
9161 #line 9162 "configure"
9162 #include "confdefs.h"
9163 /* System header to define __stub macros and hopefully few prototypes,
9164     which can conflict with char $ac_func(); below.  */
9165 #include <assert.h>
9166 /* Override any gcc2 internal prototype to avoid an error.  */
9167 /* We use char because int might match the return type of a gcc2
9168     builtin and then its argument prototype would still apply.  */
9169 char $ac_func();
9170 char (*f)();
9171
9172 int main() {
9173
9174 /* The GNU C library defines this for functions which it implements
9175     to always fail with ENOSYS.  Some functions are actually named
9176     something starting with __ and the normal name is an alias.  */
9177 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9178 choke me
9179 #else
9180 f = $ac_func;
9181 #endif
9182
9183 ; return 0; }
9184 EOF
9185 if { (eval echo configure:9186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9186   rm -rf conftest*
9187   eval "ac_cv_func_$ac_func=yes"
9188 else
9189   echo "configure: failed program was:" >&5
9190   cat conftest.$ac_ext >&5
9191   rm -rf conftest*
9192   eval "ac_cv_func_$ac_func=no"
9193 fi
9194 rm -f conftest*
9195 fi
9196
9197 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9198   echo "$ac_t""yes" 1>&6
9199     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9200   cat >> confdefs.h <<EOF
9201 #define $ac_tr_func 1
9202 EOF
9203  
9204 else
9205   echo "$ac_t""no" 1>&6
9206 fi
9207 done
9208
9209
9210                         
9211         echo $ac_n "checking for pthread_kill_other_threads_np""... $ac_c" 1>&6
9212 echo "configure:9213: checking for pthread_kill_other_threads_np" >&5
9213 if eval "test \"\${ac_cv_func_pthread_kill_other_threads_np+set}\" = set"; then
9214   echo $ac_n "(cached) $ac_c" 1>&6
9215 else
9216   cat > conftest.$ac_ext <<EOF
9217 #line 9218 "configure"
9218 #include "confdefs.h"
9219 /* System header to define __stub macros and hopefully few prototypes,
9220     which can conflict with char pthread_kill_other_threads_np(); below.  */
9221 #include <assert.h>
9222 /* Override any gcc2 internal prototype to avoid an error.  */
9223 /* We use char because int might match the return type of a gcc2
9224     builtin and then its argument prototype would still apply.  */
9225 char pthread_kill_other_threads_np();
9226 char (*f)();
9227
9228 int main() {
9229
9230 /* The GNU C library defines this for functions which it implements
9231     to always fail with ENOSYS.  Some functions are actually named
9232     something starting with __ and the normal name is an alias.  */
9233 #if defined (__stub_pthread_kill_other_threads_np) || defined (__stub___pthread_kill_other_threads_np)
9234 choke me
9235 #else
9236 f = pthread_kill_other_threads_np;
9237 #endif
9238
9239 ; return 0; }
9240 EOF
9241 if { (eval echo configure:9242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9242   rm -rf conftest*
9243   eval "ac_cv_func_pthread_kill_other_threads_np=yes"
9244 else
9245   echo "configure: failed program was:" >&5
9246   cat conftest.$ac_ext >&5
9247   rm -rf conftest*
9248   eval "ac_cv_func_pthread_kill_other_threads_np=no"
9249 fi
9250 rm -f conftest*
9251 fi
9252
9253 if eval "test \"`echo '$ac_cv_func_'pthread_kill_other_threads_np`\" = yes"; then
9254   echo "$ac_t""yes" 1>&6
9255   :
9256 else
9257   echo "$ac_t""no" 1>&6
9258 fi
9259
9260         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
9261 echo "configure:9262: checking for LinuxThreads implementation" >&5
9262 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
9263   echo $ac_n "(cached) $ac_c" 1>&6
9264 else
9265   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
9266 fi
9267
9268 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
9269
9270                         
9271         
9272         
9273         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
9274 echo "configure:9275: checking for LinuxThreads consistency" >&5
9275 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
9276   echo $ac_n "(cached) $ac_c" 1>&6
9277 else
9278   
9279                 if test $ol_cv_header_linux_threads = yes -a \
9280                         $ol_cv_sys_linux_threads = yes; then
9281                         ol_cv_linux_threads=yes
9282                 elif test $ol_cv_header_linux_threads = no -a \
9283                         $ol_cv_sys_linux_threads = no; then
9284                         ol_cv_linux_threads=no
9285                 else
9286                         ol_cv_linux_threads=error
9287                 fi
9288         
9289 fi
9290
9291 echo "$ac_t""$ol_cv_linux_threads" 1>&6
9292
9293
9294                         if test $ol_cv_linux_threads = error; then
9295                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
9296                         fi
9297
9298                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
9299 echo "configure:9300: checking if pthread_create() works" >&5
9300 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
9301   echo $ac_n "(cached) $ac_c" 1>&6
9302 else
9303   
9304                         if test "$cross_compiling" = yes; then
9305                                 ol_cv_pthread_create_works=yes
9306 else
9307   cat > conftest.$ac_ext <<EOF
9308 #line 9309 "configure"
9309 #include "confdefs.h"
9310 /* pthread test headers */
9311 #include <pthread.h>
9312 #ifndef NULL
9313 #define NULL (void*)0
9314 #endif
9315
9316 static void *task(p)
9317         void *p;
9318 {
9319         return (void *) (p == NULL);
9320 }
9321
9322
9323 int main(argc, argv)
9324         int argc;
9325         char **argv;
9326 {
9327
9328         /* pthread test function */
9329         pthread_t t;
9330         int status;
9331
9332         /* make sure pthread_create() isn't just a stub */
9333 #if HAVE_PTHREADS_D4
9334         status = pthread_create(&t, pthread_attr_default, task, NULL);
9335 #else
9336         status = pthread_create(&t, NULL, task, NULL);
9337 #endif
9338
9339         if( status ) exit( status );
9340
9341         /* make sure pthread_detach() isn't just a stub */
9342 #if HAVE_PTHREADS_D4
9343         status = pthread_detach( &t );
9344 #else
9345         status = pthread_detach( t );
9346 #endif
9347
9348 #ifdef HAVE_LINUX_THREADS
9349         pthread_kill_other_threads_np();
9350 #endif
9351
9352         exit( status );
9353
9354 }
9355
9356 EOF
9357 if { (eval echo configure:9358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9358 then
9359   ol_cv_pthread_create_works=yes
9360 else
9361   echo "configure: failed program was:" >&5
9362   cat conftest.$ac_ext >&5
9363   rm -fr conftest*
9364   ol_cv_pthread_create_works=no
9365 fi
9366 rm -fr conftest*
9367 fi
9368
9369 fi
9370
9371 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
9372
9373                         if test $ol_cv_pthread_create_works = no ; then
9374                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
9375                         fi
9376
9377                                                 if test $ol_with_yielding_select = auto ; then
9378                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
9379 echo "configure:9380: checking if select yields when using pthreads" >&5
9380 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
9381   echo $ac_n "(cached) $ac_c" 1>&6
9382 else
9383   
9384                                 if test "$cross_compiling" = yes; then
9385   ol_cv_pthread_select_yields=cross
9386 else
9387   cat > conftest.$ac_ext <<EOF
9388 #line 9389 "configure"
9389 #include "confdefs.h"
9390
9391 #include <sys/types.h>
9392 #include <sys/time.h>
9393 #include <unistd.h>
9394 #include <pthread.h>
9395 #ifndef NULL
9396 #define NULL (void*) 0
9397 #endif
9398
9399 static int fildes[2];
9400
9401 static void *task(p)
9402         void *p;
9403 {
9404         int i;
9405         struct timeval tv;
9406
9407         fd_set rfds;
9408
9409         tv.tv_sec=10;
9410         tv.tv_usec=0;
9411
9412         FD_ZERO(&rfds);
9413         FD_SET(fildes[0], &rfds);
9414
9415         /* we're not interested in any fds */
9416         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
9417
9418         if(i < 0) {
9419                 perror("select");
9420                 exit(10);
9421         }
9422
9423         exit(0); /* if we exit here, the select blocked the whole process */
9424 }
9425
9426 int main(argc, argv)
9427         int argc;
9428         char **argv;
9429 {
9430         pthread_t t;
9431
9432         /* create a pipe to select */
9433         if(pipe(&fildes[0])) {
9434                 perror("select");
9435                 exit(1);
9436         }
9437
9438 #ifdef HAVE_PTHREAD_SETCONCURRENCY
9439         (void) pthread_setconcurrency(2);
9440 #else
9441 #ifdef HAVE_THR_SETCONCURRENCY
9442         /* Set Solaris LWP concurrency to 2 */
9443         thr_setconcurrency(2);
9444 #endif
9445 #endif
9446
9447 #if HAVE_PTHREADS_D4
9448         pthread_create(&t, pthread_attr_default, task, NULL);
9449 #else
9450         pthread_create(&t, NULL, task, NULL);
9451 #endif
9452
9453 #if HAVE_SCHED_YIELD
9454         sched_yield();  /* make sure task runs first */
9455 #else
9456 #ifdef HAVE_PTHREAD_YIELD
9457         pthread_yield();        /* make sure task runs first */
9458 #endif
9459 #endif
9460
9461         exit(2);
9462 }
9463 EOF
9464 if { (eval echo configure:9465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9465 then
9466   ol_cv_pthread_select_yields=no
9467 else
9468   echo "configure: failed program was:" >&5
9469   cat conftest.$ac_ext >&5
9470   rm -fr conftest*
9471   ol_cv_pthread_select_yields=yes
9472 fi
9473 rm -fr conftest*
9474 fi
9475
9476 fi
9477
9478 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
9479
9480                                 if test $ol_cv_pthread_select_yields = cross ; then
9481                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
9482                                 fi
9483
9484                                 if test $ol_cv_pthread_select_yields = yes ; then
9485                                         ol_with_yielding_select=yes
9486                                 fi
9487                         fi
9488
9489                                                 CPPFLAGS="$save_CPPFLAGS"
9490                         LIBS="$save_LIBS"
9491                 else
9492                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
9493                 fi
9494         fi
9495
9496         if test $ol_with_threads = posix ; then
9497                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
9498         fi
9499 fi
9500
9501 if test $ol_with_threads = auto -o $ol_with_threads = yes \
9502         -o $ol_with_threads = mach ; then
9503
9504                 for ac_hdr in mach/cthreads.h
9505 do
9506 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9507 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9508 echo "configure:9509: checking for $ac_hdr" >&5
9509 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9510   echo $ac_n "(cached) $ac_c" 1>&6
9511 else
9512   cat > conftest.$ac_ext <<EOF
9513 #line 9514 "configure"
9514 #include "confdefs.h"
9515 #include <$ac_hdr>
9516 EOF
9517 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9518 { (eval echo configure:9519: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9519 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9520 if test -z "$ac_err"; then
9521   rm -rf conftest*
9522   eval "ac_cv_header_$ac_safe=yes"
9523 else
9524   echo "$ac_err" >&5
9525   echo "configure: failed program was:" >&5
9526   cat conftest.$ac_ext >&5
9527   rm -rf conftest*
9528   eval "ac_cv_header_$ac_safe=no"
9529 fi
9530 rm -f conftest*
9531 fi
9532 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9533   echo "$ac_t""yes" 1>&6
9534     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9535   cat >> confdefs.h <<EOF
9536 #define $ac_tr_hdr 1
9537 EOF
9538  
9539 else
9540   echo "$ac_t""no" 1>&6
9541 fi
9542 done
9543
9544         if test $ac_cv_header_mach_cthreads_h = yes ; then
9545                 ol_with_threads=found
9546
9547                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
9548 echo "configure:9549: checking for cthread_fork" >&5
9549 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
9550   echo $ac_n "(cached) $ac_c" 1>&6
9551 else
9552   cat > conftest.$ac_ext <<EOF
9553 #line 9554 "configure"
9554 #include "confdefs.h"
9555 /* System header to define __stub macros and hopefully few prototypes,
9556     which can conflict with char cthread_fork(); below.  */
9557 #include <assert.h>
9558 /* Override any gcc2 internal prototype to avoid an error.  */
9559 /* We use char because int might match the return type of a gcc2
9560     builtin and then its argument prototype would still apply.  */
9561 char cthread_fork();
9562 char (*f)();
9563
9564 int main() {
9565
9566 /* The GNU C library defines this for functions which it implements
9567     to always fail with ENOSYS.  Some functions are actually named
9568     something starting with __ and the normal name is an alias.  */
9569 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
9570 choke me
9571 #else
9572 f = cthread_fork;
9573 #endif
9574
9575 ; return 0; }
9576 EOF
9577 if { (eval echo configure:9578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9578   rm -rf conftest*
9579   eval "ac_cv_func_cthread_fork=yes"
9580 else
9581   echo "configure: failed program was:" >&5
9582   cat conftest.$ac_ext >&5
9583   rm -rf conftest*
9584   eval "ac_cv_func_cthread_fork=no"
9585 fi
9586 rm -f conftest*
9587 fi
9588
9589 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
9590   echo "$ac_t""yes" 1>&6
9591   ol_link_threads=yes
9592 else
9593   echo "$ac_t""no" 1>&6
9594 fi
9595
9596
9597                 if test $ol_link_threads = no ; then
9598                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
9599 echo "configure:9600: checking for cthread_fork with -all_load" >&5
9600 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
9601   echo $ac_n "(cached) $ac_c" 1>&6
9602 else
9603   
9604                                                                 save_LIBS="$LIBS"
9605                                 LIBS="-all_load $LIBS"
9606                                 cat > conftest.$ac_ext <<EOF
9607 #line 9608 "configure"
9608 #include "confdefs.h"
9609 #include <mach/cthreads.h>
9610 int main() {
9611
9612                                         cthread_fork((void *)0, (void *)0);
9613                                         
9614 ; return 0; }
9615 EOF
9616 if { (eval echo configure:9617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9617   rm -rf conftest*
9618   ol_cv_cthread_all_load=yes
9619 else
9620   echo "configure: failed program was:" >&5
9621   cat conftest.$ac_ext >&5
9622   rm -rf conftest*
9623   ol_cv_cthread_all_load=no
9624 fi
9625 rm -f conftest*
9626                                                                 LIBS="$save_LIBS"
9627                         
9628 fi
9629
9630 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
9631
9632                         if test $ol_cv_cthread_all_load = yes ; then
9633                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
9634                                 ol_link_threads=mach
9635                         fi
9636                 fi
9637
9638                 if test $ol_link_threads != no ; then
9639                         : check for cthread specific functionality here
9640                         cat >> confdefs.h <<\EOF
9641 #define HAVE_MACH_CTHREADS 1
9642 EOF
9643
9644                 else
9645                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
9646                 fi
9647         fi
9648
9649         if test $ol_with_threads = mach ; then
9650                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
9651         fi
9652 fi
9653
9654 if test $ol_with_threads = auto -o $ol_with_threads = yes \
9655         -o $ol_with_threads = pth ; then
9656
9657         for ac_hdr in pth.h
9658 do
9659 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9660 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9661 echo "configure:9662: checking for $ac_hdr" >&5
9662 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9663   echo $ac_n "(cached) $ac_c" 1>&6
9664 else
9665   cat > conftest.$ac_ext <<EOF
9666 #line 9667 "configure"
9667 #include "confdefs.h"
9668 #include <$ac_hdr>
9669 EOF
9670 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9671 { (eval echo configure:9672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9672 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9673 if test -z "$ac_err"; then
9674   rm -rf conftest*
9675   eval "ac_cv_header_$ac_safe=yes"
9676 else
9677   echo "$ac_err" >&5
9678   echo "configure: failed program was:" >&5
9679   cat conftest.$ac_ext >&5
9680   rm -rf conftest*
9681   eval "ac_cv_header_$ac_safe=no"
9682 fi
9683 rm -f conftest*
9684 fi
9685 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9686   echo "$ac_t""yes" 1>&6
9687     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9688   cat >> confdefs.h <<EOF
9689 #define $ac_tr_hdr 1
9690 EOF
9691  
9692 else
9693   echo "$ac_t""no" 1>&6
9694 fi
9695 done
9696
9697
9698         if test $ac_cv_header_pth_h = yes ; then
9699                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
9700 echo "configure:9701: checking for pth_version in -lpth" >&5
9701 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
9702 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9703   echo $ac_n "(cached) $ac_c" 1>&6
9704 else
9705   ac_save_LIBS="$LIBS"
9706 LIBS="-lpth  $LIBS"
9707 cat > conftest.$ac_ext <<EOF
9708 #line 9709 "configure"
9709 #include "confdefs.h"
9710 /* Override any gcc2 internal prototype to avoid an error.  */
9711 /* We use char because int might match the return type of a gcc2
9712     builtin and then its argument prototype would still apply.  */
9713 char pth_version();
9714
9715 int main() {
9716 pth_version()
9717 ; return 0; }
9718 EOF
9719 if { (eval echo configure:9720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9720   rm -rf conftest*
9721   eval "ac_cv_lib_$ac_lib_var=yes"
9722 else
9723   echo "configure: failed program was:" >&5
9724   cat conftest.$ac_ext >&5
9725   rm -rf conftest*
9726   eval "ac_cv_lib_$ac_lib_var=no"
9727 fi
9728 rm -f conftest*
9729 LIBS="$ac_save_LIBS"
9730
9731 fi
9732 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9733   echo "$ac_t""yes" 1>&6
9734   have_pth=yes
9735 else
9736   echo "$ac_t""no" 1>&6
9737 have_pth=no
9738 fi
9739
9740
9741                 if test $have_pth = yes ; then
9742                         cat >> confdefs.h <<\EOF
9743 #define HAVE_GNU_PTH 1
9744 EOF
9745
9746                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
9747                         ol_link_threads=pth
9748
9749                         if test $ol_with_yielding_select = auto ; then
9750                                 ol_with_yielding_select=yes
9751                         fi
9752                 fi
9753         fi
9754 fi
9755
9756 if test $ol_with_threads = auto -o $ol_with_threads = yes \
9757         -o $ol_with_threads = lwp ; then
9758
9759                 for ac_hdr in thread.h synch.h
9760 do
9761 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9762 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9763 echo "configure:9764: checking for $ac_hdr" >&5
9764 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9765   echo $ac_n "(cached) $ac_c" 1>&6
9766 else
9767   cat > conftest.$ac_ext <<EOF
9768 #line 9769 "configure"
9769 #include "confdefs.h"
9770 #include <$ac_hdr>
9771 EOF
9772 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9773 { (eval echo configure:9774: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9774 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9775 if test -z "$ac_err"; then
9776   rm -rf conftest*
9777   eval "ac_cv_header_$ac_safe=yes"
9778 else
9779   echo "$ac_err" >&5
9780   echo "configure: failed program was:" >&5
9781   cat conftest.$ac_ext >&5
9782   rm -rf conftest*
9783   eval "ac_cv_header_$ac_safe=no"
9784 fi
9785 rm -f conftest*
9786 fi
9787 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9788   echo "$ac_t""yes" 1>&6
9789     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9790   cat >> confdefs.h <<EOF
9791 #define $ac_tr_hdr 1
9792 EOF
9793  
9794 else
9795   echo "$ac_t""no" 1>&6
9796 fi
9797 done
9798
9799         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
9800                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
9801 echo "configure:9802: checking for thr_create in -lthread" >&5
9802 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
9803 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9804   echo $ac_n "(cached) $ac_c" 1>&6
9805 else
9806   ac_save_LIBS="$LIBS"
9807 LIBS="-lthread  $LIBS"
9808 cat > conftest.$ac_ext <<EOF
9809 #line 9810 "configure"
9810 #include "confdefs.h"
9811 /* Override any gcc2 internal prototype to avoid an error.  */
9812 /* We use char because int might match the return type of a gcc2
9813     builtin and then its argument prototype would still apply.  */
9814 char thr_create();
9815
9816 int main() {
9817 thr_create()
9818 ; return 0; }
9819 EOF
9820 if { (eval echo configure:9821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9821   rm -rf conftest*
9822   eval "ac_cv_lib_$ac_lib_var=yes"
9823 else
9824   echo "configure: failed program was:" >&5
9825   cat conftest.$ac_ext >&5
9826   rm -rf conftest*
9827   eval "ac_cv_lib_$ac_lib_var=no"
9828 fi
9829 rm -f conftest*
9830 LIBS="$ac_save_LIBS"
9831
9832 fi
9833 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9834   echo "$ac_t""yes" 1>&6
9835   have_thr=yes
9836 else
9837   echo "$ac_t""no" 1>&6
9838 have_thr=no
9839 fi
9840
9841
9842                 if test $have_thr = yes ; then
9843                         cat >> confdefs.h <<\EOF
9844 #define HAVE_THR 1
9845 EOF
9846
9847                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
9848                         ol_link_threads=thr
9849
9850                         if test $ol_with_yielding_select = auto ; then
9851                                 ol_with_yielding_select=yes
9852                         fi
9853
9854                                                 for ac_func in \
9855                                 thr_setconcurrency \
9856                                 thr_getconcurrency \
9857                         
9858 do
9859 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9860 echo "configure:9861: checking for $ac_func" >&5
9861 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9862   echo $ac_n "(cached) $ac_c" 1>&6
9863 else
9864   cat > conftest.$ac_ext <<EOF
9865 #line 9866 "configure"
9866 #include "confdefs.h"
9867 /* System header to define __stub macros and hopefully few prototypes,
9868     which can conflict with char $ac_func(); below.  */
9869 #include <assert.h>
9870 /* Override any gcc2 internal prototype to avoid an error.  */
9871 /* We use char because int might match the return type of a gcc2
9872     builtin and then its argument prototype would still apply.  */
9873 char $ac_func();
9874 char (*f)();
9875
9876 int main() {
9877
9878 /* The GNU C library defines this for functions which it implements
9879     to always fail with ENOSYS.  Some functions are actually named
9880     something starting with __ and the normal name is an alias.  */
9881 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9882 choke me
9883 #else
9884 f = $ac_func;
9885 #endif
9886
9887 ; return 0; }
9888 EOF
9889 if { (eval echo configure:9890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9890   rm -rf conftest*
9891   eval "ac_cv_func_$ac_func=yes"
9892 else
9893   echo "configure: failed program was:" >&5
9894   cat conftest.$ac_ext >&5
9895   rm -rf conftest*
9896   eval "ac_cv_func_$ac_func=no"
9897 fi
9898 rm -f conftest*
9899 fi
9900
9901 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9902   echo "$ac_t""yes" 1>&6
9903     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9904   cat >> confdefs.h <<EOF
9905 #define $ac_tr_func 1
9906 EOF
9907  
9908 else
9909   echo "$ac_t""no" 1>&6
9910 fi
9911 done
9912
9913                 fi
9914         fi
9915
9916                 for ac_hdr in lwp/lwp.h
9917 do
9918 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9919 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9920 echo "configure:9921: checking for $ac_hdr" >&5
9921 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9922   echo $ac_n "(cached) $ac_c" 1>&6
9923 else
9924   cat > conftest.$ac_ext <<EOF
9925 #line 9926 "configure"
9926 #include "confdefs.h"
9927 #include <$ac_hdr>
9928 EOF
9929 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9930 { (eval echo configure:9931: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9931 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9932 if test -z "$ac_err"; then
9933   rm -rf conftest*
9934   eval "ac_cv_header_$ac_safe=yes"
9935 else
9936   echo "$ac_err" >&5
9937   echo "configure: failed program was:" >&5
9938   cat conftest.$ac_ext >&5
9939   rm -rf conftest*
9940   eval "ac_cv_header_$ac_safe=no"
9941 fi
9942 rm -f conftest*
9943 fi
9944 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9945   echo "$ac_t""yes" 1>&6
9946     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9947   cat >> confdefs.h <<EOF
9948 #define $ac_tr_hdr 1
9949 EOF
9950  
9951 else
9952   echo "$ac_t""no" 1>&6
9953 fi
9954 done
9955
9956         if test $ac_cv_header_lwp_lwp_h = yes ; then
9957                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
9958 echo "configure:9959: checking for lwp_create in -llwp" >&5
9959 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
9960 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9961   echo $ac_n "(cached) $ac_c" 1>&6
9962 else
9963   ac_save_LIBS="$LIBS"
9964 LIBS="-llwp  $LIBS"
9965 cat > conftest.$ac_ext <<EOF
9966 #line 9967 "configure"
9967 #include "confdefs.h"
9968 /* Override any gcc2 internal prototype to avoid an error.  */
9969 /* We use char because int might match the return type of a gcc2
9970     builtin and then its argument prototype would still apply.  */
9971 char lwp_create();
9972
9973 int main() {
9974 lwp_create()
9975 ; return 0; }
9976 EOF
9977 if { (eval echo configure:9978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9978   rm -rf conftest*
9979   eval "ac_cv_lib_$ac_lib_var=yes"
9980 else
9981   echo "configure: failed program was:" >&5
9982   cat conftest.$ac_ext >&5
9983   rm -rf conftest*
9984   eval "ac_cv_lib_$ac_lib_var=no"
9985 fi
9986 rm -f conftest*
9987 LIBS="$ac_save_LIBS"
9988
9989 fi
9990 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9991   echo "$ac_t""yes" 1>&6
9992   have_lwp=yes
9993 else
9994   echo "$ac_t""no" 1>&6
9995 have_lwp=no
9996 fi
9997
9998
9999                 if test $have_lwp = yes ; then
10000                         cat >> confdefs.h <<\EOF
10001 #define HAVE_LWP 1
10002 EOF
10003
10004                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
10005                         ol_link_threads=lwp
10006
10007                         if test $ol_with_yielding_select = auto ; then
10008                                 ol_with_yielding_select=no
10009                         fi
10010                 fi
10011         fi
10012 fi
10013
10014 if test $ol_with_yielding_select = yes ; then
10015         cat >> confdefs.h <<\EOF
10016 #define HAVE_YIELDING_SELECT 1
10017 EOF
10018
10019 fi
10020
10021 if test $ol_with_threads = manual ; then
10022                 ol_link_threads=yes
10023
10024         echo "configure: warning: thread defines and link options must be set manually" 1>&2
10025
10026         for ac_hdr in pthread.h sched.h
10027 do
10028 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10029 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10030 echo "configure:10031: checking for $ac_hdr" >&5
10031 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10032   echo $ac_n "(cached) $ac_c" 1>&6
10033 else
10034   cat > conftest.$ac_ext <<EOF
10035 #line 10036 "configure"
10036 #include "confdefs.h"
10037 #include <$ac_hdr>
10038 EOF
10039 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10040 { (eval echo configure:10041: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10041 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10042 if test -z "$ac_err"; then
10043   rm -rf conftest*
10044   eval "ac_cv_header_$ac_safe=yes"
10045 else
10046   echo "$ac_err" >&5
10047   echo "configure: failed program was:" >&5
10048   cat conftest.$ac_ext >&5
10049   rm -rf conftest*
10050   eval "ac_cv_header_$ac_safe=no"
10051 fi
10052 rm -f conftest*
10053 fi
10054 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10055   echo "$ac_t""yes" 1>&6
10056     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10057   cat >> confdefs.h <<EOF
10058 #define $ac_tr_hdr 1
10059 EOF
10060  
10061 else
10062   echo "$ac_t""no" 1>&6
10063 fi
10064 done
10065
10066         for ac_func in sched_yield pthread_yield
10067 do
10068 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10069 echo "configure:10070: checking for $ac_func" >&5
10070 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10071   echo $ac_n "(cached) $ac_c" 1>&6
10072 else
10073   cat > conftest.$ac_ext <<EOF
10074 #line 10075 "configure"
10075 #include "confdefs.h"
10076 /* System header to define __stub macros and hopefully few prototypes,
10077     which can conflict with char $ac_func(); below.  */
10078 #include <assert.h>
10079 /* Override any gcc2 internal prototype to avoid an error.  */
10080 /* We use char because int might match the return type of a gcc2
10081     builtin and then its argument prototype would still apply.  */
10082 char $ac_func();
10083 char (*f)();
10084
10085 int main() {
10086
10087 /* The GNU C library defines this for functions which it implements
10088     to always fail with ENOSYS.  Some functions are actually named
10089     something starting with __ and the normal name is an alias.  */
10090 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10091 choke me
10092 #else
10093 f = $ac_func;
10094 #endif
10095
10096 ; return 0; }
10097 EOF
10098 if { (eval echo configure:10099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10099   rm -rf conftest*
10100   eval "ac_cv_func_$ac_func=yes"
10101 else
10102   echo "configure: failed program was:" >&5
10103   cat conftest.$ac_ext >&5
10104   rm -rf conftest*
10105   eval "ac_cv_func_$ac_func=no"
10106 fi
10107 rm -f conftest*
10108 fi
10109
10110 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10111   echo "$ac_t""yes" 1>&6
10112     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10113   cat >> confdefs.h <<EOF
10114 #define $ac_tr_func 1
10115 EOF
10116  
10117 else
10118   echo "$ac_t""no" 1>&6
10119 fi
10120 done
10121
10122         
10123         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
10124 echo "configure:10125: checking for LinuxThreads pthread.h" >&5
10125 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
10126   echo $ac_n "(cached) $ac_c" 1>&6
10127 else
10128   cat > conftest.$ac_ext <<EOF
10129 #line 10130 "configure"
10130 #include "confdefs.h"
10131 #include <pthread.h>
10132 EOF
10133 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10134   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
10135   rm -rf conftest*
10136   ol_cv_header_linux_threads=yes
10137 else
10138   rm -rf conftest*
10139   ol_cv_header_linux_threads=no
10140 fi
10141 rm -f conftest*
10142
10143                 
10144 fi
10145
10146 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
10147         if test $ol_cv_header_linux_threads = yes; then
10148                 cat >> confdefs.h <<\EOF
10149 #define HAVE_LINUX_THREADS 1
10150 EOF
10151
10152         fi
10153
10154
10155         for ac_hdr in mach/cthreads.h
10156 do
10157 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10158 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10159 echo "configure:10160: checking for $ac_hdr" >&5
10160 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10161   echo $ac_n "(cached) $ac_c" 1>&6
10162 else
10163   cat > conftest.$ac_ext <<EOF
10164 #line 10165 "configure"
10165 #include "confdefs.h"
10166 #include <$ac_hdr>
10167 EOF
10168 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10169 { (eval echo configure:10170: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10170 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10171 if test -z "$ac_err"; then
10172   rm -rf conftest*
10173   eval "ac_cv_header_$ac_safe=yes"
10174 else
10175   echo "$ac_err" >&5
10176   echo "configure: failed program was:" >&5
10177   cat conftest.$ac_ext >&5
10178   rm -rf conftest*
10179   eval "ac_cv_header_$ac_safe=no"
10180 fi
10181 rm -f conftest*
10182 fi
10183 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10184   echo "$ac_t""yes" 1>&6
10185     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10186   cat >> confdefs.h <<EOF
10187 #define $ac_tr_hdr 1
10188 EOF
10189  
10190 else
10191   echo "$ac_t""no" 1>&6
10192 fi
10193 done
10194
10195         for ac_hdr in lwp/lwp.h
10196 do
10197 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10198 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10199 echo "configure:10200: checking for $ac_hdr" >&5
10200 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10201   echo $ac_n "(cached) $ac_c" 1>&6
10202 else
10203   cat > conftest.$ac_ext <<EOF
10204 #line 10205 "configure"
10205 #include "confdefs.h"
10206 #include <$ac_hdr>
10207 EOF
10208 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10209 { (eval echo configure:10210: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10210 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10211 if test -z "$ac_err"; then
10212   rm -rf conftest*
10213   eval "ac_cv_header_$ac_safe=yes"
10214 else
10215   echo "$ac_err" >&5
10216   echo "configure: failed program was:" >&5
10217   cat conftest.$ac_ext >&5
10218   rm -rf conftest*
10219   eval "ac_cv_header_$ac_safe=no"
10220 fi
10221 rm -f conftest*
10222 fi
10223 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10224   echo "$ac_t""yes" 1>&6
10225     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10226   cat >> confdefs.h <<EOF
10227 #define $ac_tr_hdr 1
10228 EOF
10229  
10230 else
10231   echo "$ac_t""no" 1>&6
10232 fi
10233 done
10234
10235         for ac_hdr in thread.h synch.h
10236 do
10237 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10238 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10239 echo "configure:10240: checking for $ac_hdr" >&5
10240 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10241   echo $ac_n "(cached) $ac_c" 1>&6
10242 else
10243   cat > conftest.$ac_ext <<EOF
10244 #line 10245 "configure"
10245 #include "confdefs.h"
10246 #include <$ac_hdr>
10247 EOF
10248 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10249 { (eval echo configure:10250: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10250 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10251 if test -z "$ac_err"; then
10252   rm -rf conftest*
10253   eval "ac_cv_header_$ac_safe=yes"
10254 else
10255   echo "$ac_err" >&5
10256   echo "configure: failed program was:" >&5
10257   cat conftest.$ac_ext >&5
10258   rm -rf conftest*
10259   eval "ac_cv_header_$ac_safe=no"
10260 fi
10261 rm -f conftest*
10262 fi
10263 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10264   echo "$ac_t""yes" 1>&6
10265     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10266   cat >> confdefs.h <<EOF
10267 #define $ac_tr_hdr 1
10268 EOF
10269  
10270 else
10271   echo "$ac_t""no" 1>&6
10272 fi
10273 done
10274
10275 fi
10276
10277 if test $ol_link_threads != no ; then  
10278                         cat >> confdefs.h <<\EOF
10279 #define REENTRANT 1
10280 EOF
10281
10282         cat >> confdefs.h <<\EOF
10283 #define _REENTRANT 1
10284 EOF
10285
10286         cat >> confdefs.h <<\EOF
10287 #define THREAD_SAFE 1
10288 EOF
10289
10290         cat >> confdefs.h <<\EOF
10291 #define _THREAD_SAFE 1
10292 EOF
10293
10294         cat >> confdefs.h <<\EOF
10295 #define THREADSAFE 1
10296 EOF
10297
10298         cat >> confdefs.h <<\EOF
10299 #define _THREADSAFE 1
10300 EOF
10301
10302         cat >> confdefs.h <<\EOF
10303 #define _SGI_MP_SOURCE 1
10304 EOF
10305
10306
10307                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
10308 echo "configure:10309: checking for thread specific errno" >&5
10309 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
10310   echo $ac_n "(cached) $ac_c" 1>&6
10311 else
10312   
10313                 cat > conftest.$ac_ext <<EOF
10314 #line 10315 "configure"
10315 #include "confdefs.h"
10316 #include <errno.h>
10317 int main() {
10318 errno = 0;
10319 ; return 0; }
10320 EOF
10321 if { (eval echo configure:10322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10322   rm -rf conftest*
10323   ol_cv_errno_thread_specific=yes
10324 else
10325   echo "configure: failed program was:" >&5
10326   cat conftest.$ac_ext >&5
10327   rm -rf conftest*
10328   ol_cv_errno_thread_specific=no
10329 fi
10330 rm -f conftest*
10331         
10332 fi
10333
10334 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
10335
10336                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
10337 echo "configure:10338: checking for thread specific h_errno" >&5
10338 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
10339   echo $ac_n "(cached) $ac_c" 1>&6
10340 else
10341   
10342                 cat > conftest.$ac_ext <<EOF
10343 #line 10344 "configure"
10344 #include "confdefs.h"
10345 #include <netdb.h>
10346 int main() {
10347 h_errno = 0;
10348 ; return 0; }
10349 EOF
10350 if { (eval echo configure:10351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10351   rm -rf conftest*
10352   ol_cv_h_errno_thread_specific=yes
10353 else
10354   echo "configure: failed program was:" >&5
10355   cat conftest.$ac_ext >&5
10356   rm -rf conftest*
10357   ol_cv_h_errno_thread_specific=no
10358 fi
10359 rm -f conftest*
10360         
10361 fi
10362
10363 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
10364
10365         if test $ol_cv_errno_thread_specific != yes \
10366                 -o $ol_cv_h_errno_thread_specific != yes ; then
10367                 LIBS="$LTHREAD_LIBS $LIBS"
10368                 LTHREAD_LIBS=""
10369         fi
10370
10371 fi  
10372
10373 if test $ol_link_threads = no ; then
10374         if test $ol_with_threads = yes ; then
10375                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
10376         fi
10377
10378         if test $ol_with_threads = auto ; then
10379                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
10380                 ol_with_threads=no
10381         fi
10382
10383         cat >> confdefs.h <<\EOF
10384 #define NO_THREADS 1
10385 EOF
10386
10387         LTHREAD_LIBS=""
10388 fi
10389
10390 if test $ol_link_threads != no ; then
10391         cat >> confdefs.h <<\EOF
10392 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
10393 EOF
10394
10395 fi
10396
10397
10398 ol_link_ldbm=no 
10399 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
10400         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
10401 echo "configure:10402: checking for DB2 library" >&5
10402 if eval "test \"\${ol_cv_lib_db2+set}\" = set"; then
10403   echo $ac_n "(cached) $ac_c" 1>&6
10404 else
10405         ol_LIBS="$LIBS"
10406         echo $ac_n "checking for db_appexit in -ldb""... $ac_c" 1>&6
10407 echo "configure:10408: checking for db_appexit in -ldb" >&5
10408 ac_lib_var=`echo db'_'db_appexit | sed 'y%./+-:%__p__%'`
10409 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10410   echo $ac_n "(cached) $ac_c" 1>&6
10411 else
10412   ac_save_LIBS="$LIBS"
10413 LIBS="-ldb  $LIBS"
10414 cat > conftest.$ac_ext <<EOF
10415 #line 10416 "configure"
10416 #include "confdefs.h"
10417 /* Override any gcc2 internal prototype to avoid an error.  */
10418 /* We use char because int might match the return type of a gcc2
10419     builtin and then its argument prototype would still apply.  */
10420 char db_appexit();
10421
10422 int main() {
10423 db_appexit()
10424 ; return 0; }
10425 EOF
10426 if { (eval echo configure:10427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10427   rm -rf conftest*
10428   eval "ac_cv_lib_$ac_lib_var=yes"
10429 else
10430   echo "configure: failed program was:" >&5
10431   cat conftest.$ac_ext >&5
10432   rm -rf conftest*
10433   eval "ac_cv_lib_$ac_lib_var=no"
10434 fi
10435 rm -f conftest*
10436 LIBS="$ac_save_LIBS"
10437
10438 fi
10439 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10440   echo "$ac_t""yes" 1>&6
10441   ol_cv_lib_db2=-ldb
10442 else
10443   echo "$ac_t""no" 1>&6
10444 ol_cv_lib_db2=no
10445 fi
10446
10447         LIBS="$ol_LIBS"
10448
10449 fi
10450
10451 echo "$ac_t""$ol_cv_lib_db2" 1>&6
10452
10453 for ac_hdr in db.h
10454 do
10455 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10456 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10457 echo "configure:10458: checking for $ac_hdr" >&5
10458 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10459   echo $ac_n "(cached) $ac_c" 1>&6
10460 else
10461   cat > conftest.$ac_ext <<EOF
10462 #line 10463 "configure"
10463 #include "confdefs.h"
10464 #include <$ac_hdr>
10465 EOF
10466 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10467 { (eval echo configure:10468: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10468 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10469 if test -z "$ac_err"; then
10470   rm -rf conftest*
10471   eval "ac_cv_header_$ac_safe=yes"
10472 else
10473   echo "$ac_err" >&5
10474   echo "configure: failed program was:" >&5
10475   cat conftest.$ac_ext >&5
10476   rm -rf conftest*
10477   eval "ac_cv_header_$ac_safe=no"
10478 fi
10479 rm -f conftest*
10480 fi
10481 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10482   echo "$ac_t""yes" 1>&6
10483     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10484   cat >> confdefs.h <<EOF
10485 #define $ac_tr_hdr 1
10486 EOF
10487  
10488 else
10489   echo "$ac_t""no" 1>&6
10490 fi
10491 done
10492
10493 if test $ac_cv_header_db_h = yes ; then
10494         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
10495 echo "configure:10496: checking if db.h is DB2" >&5
10496 if eval "test \"\${ol_cv_header_db2+set}\" = set"; then
10497   echo $ac_n "(cached) $ac_c" 1>&6
10498 else
10499   
10500                 cat > conftest.$ac_ext <<EOF
10501 #line 10502 "configure"
10502 #include "confdefs.h"
10503
10504 #                       include <db.h>
10505                         /* this check could be improved */
10506 #                       ifdef DB_VERSION_MAJOR
10507 #                               if DB_VERSION_MAJOR == 2
10508                                         __db_version_2;
10509 #                               endif
10510 #                       endif
10511                 
10512 EOF
10513 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10514   egrep "__db_version_2" >/dev/null 2>&1; then
10515   rm -rf conftest*
10516   ol_cv_header_db2=yes
10517 else
10518   rm -rf conftest*
10519   ol_cv_header_db2=no
10520 fi
10521 rm -f conftest*
10522
10523 fi
10524
10525 echo "$ac_t""$ol_cv_header_db2" 1>&6
10526 else
10527         ol_cv_header_db2=no
10528 fi
10529
10530
10531  
10532  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
10533 echo "configure:10534: checking for Berkeley DB2" >&5
10534 if eval "test \"\${ol_cv_berkeley_db2+set}\" = set"; then
10535   echo $ac_n "(cached) $ac_c" 1>&6
10536 else
10537   
10538         if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then
10539                 ol_cv_berkeley_db2=no
10540         else
10541                 ol_cv_berkeley_db2=yes
10542         fi
10543
10544 fi
10545
10546 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
10547  if test $ol_cv_berkeley_db2 = yes ; then
10548         cat >> confdefs.h <<\EOF
10549 #define HAVE_BERKELEY_DB2 1
10550 EOF
10551
10552  fi
10553
10554
10555         if test $ol_cv_berkeley_db2 = yes ; then
10556                 ol_link_ldbm=db2
10557                 ol_with_ldbm_api=db2
10558
10559                 if test $ol_with_ldbm_type = hash ; then
10560                         cat >> confdefs.h <<\EOF
10561 #define LDBM_USE_DBHASH 1
10562 EOF
10563
10564                 else
10565                         cat >> confdefs.h <<\EOF
10566 #define LDBM_USE_DBBTREE 1
10567 EOF
10568
10569                 fi
10570
10571                 echo $ac_n "checking for DB_THREAD support""... $ac_c" 1>&6
10572 echo "configure:10573: checking for DB_THREAD support" >&5
10573 if eval "test \"\${ol_cv_berkeley_db2_db_thread+set}\" = set"; then
10574   echo $ac_n "(cached) $ac_c" 1>&6
10575 else
10576   
10577         ol_LIBS="$LIBS"
10578         if test $ol_cv_lib_db2 != yes ; then
10579                 LIBS="$ol_cv_lib_db2"
10580         fi
10581
10582         if test "$cross_compiling" = yes; then
10583   ol_cv_berkeley_db2_db_thread=cross
10584 else
10585   cat > conftest.$ac_ext <<EOF
10586 #line 10587 "configure"
10587 #include "confdefs.h"
10588
10589 #include <db.h>
10590 #ifndef NULL
10591 #define NULL ((void *)0)
10592 #endif
10593 main()
10594 {
10595         int rc;
10596         DB_ENV env;
10597         u_int32_t flags = DB_CREATE | DB_THREAD;
10598
10599         memset( &env, '\0', sizeof(env) );
10600
10601         rc = db_appinit( NULL, NULL, &env, flags );
10602
10603         if( rc == 0 ) {
10604                 db_appexit( &env );
10605         }
10606
10607         return rc;
10608 }
10609 EOF
10610 if { (eval echo configure:10611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10611 then
10612   ol_cv_berkeley_db2_db_thread=yes
10613 else
10614   echo "configure: failed program was:" >&5
10615   cat conftest.$ac_ext >&5
10616   rm -fr conftest*
10617   ol_cv_berkeley_db2_db_thread=no
10618 fi
10619 rm -fr conftest*
10620 fi
10621
10622
10623         LIBS="$ol_LIBS"
10624
10625         if test $ol_cv_berkeley_db2_db_thread != no ; then
10626                 cat >> confdefs.h <<\EOF
10627 #define HAVE_BERKELEY_DB2_DB_THREAD 1
10628 EOF
10629
10630         fi
10631
10632 fi
10633
10634 echo "$ac_t""$ol_cv_berkeley_db2_db_thread" 1>&6
10635
10636                                                 if test $ol_cv_lib_db2 != yes ; then
10637                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
10638                 fi
10639         fi
10640 fi
10641
10642 ol_link_bdb2=no
10643 if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
10644         if test $ol_cv_berkeley_db2_db_thread != no ; then
10645                 ol_link_bdb2=yes
10646         else
10647                 echo "configure: warning: Installed BerkeleyDB does not provide DB_THREAD support." 1>&2
10648         fi
10649 fi
10650
10651 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
10652         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
10653 echo "configure:10654: checking for Berkeley DB library" >&5
10654 if eval "test \"\${ol_cv_lib_db+set}\" = set"; then
10655   echo $ac_n "(cached) $ac_c" 1>&6
10656 else
10657   
10658         for ac_hdr in db1/db.h
10659 do
10660 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10661 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10662 echo "configure:10663: checking for $ac_hdr" >&5
10663 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10664   echo $ac_n "(cached) $ac_c" 1>&6
10665 else
10666   cat > conftest.$ac_ext <<EOF
10667 #line 10668 "configure"
10668 #include "confdefs.h"
10669 #include <$ac_hdr>
10670 EOF
10671 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10672 { (eval echo configure:10673: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10673 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10674 if test -z "$ac_err"; then
10675   rm -rf conftest*
10676   eval "ac_cv_header_$ac_safe=yes"
10677 else
10678   echo "$ac_err" >&5
10679   echo "configure: failed program was:" >&5
10680   cat conftest.$ac_ext >&5
10681   rm -rf conftest*
10682   eval "ac_cv_header_$ac_safe=no"
10683 fi
10684 rm -f conftest*
10685 fi
10686 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10687   echo "$ac_t""yes" 1>&6
10688     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10689   cat >> confdefs.h <<EOF
10690 #define $ac_tr_hdr 1
10691 EOF
10692  
10693 else
10694   echo "$ac_t""no" 1>&6
10695 fi
10696 done
10697
10698         ol_LIBS="$LIBS"
10699         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
10700 echo "configure:10701: checking for dbopen" >&5
10701 if eval "test \"\${ac_cv_func_dbopen+set}\" = set"; then
10702   echo $ac_n "(cached) $ac_c" 1>&6
10703 else
10704   cat > conftest.$ac_ext <<EOF
10705 #line 10706 "configure"
10706 #include "confdefs.h"
10707 /* System header to define __stub macros and hopefully few prototypes,
10708     which can conflict with char dbopen(); below.  */
10709 #include <assert.h>
10710 /* Override any gcc2 internal prototype to avoid an error.  */
10711 /* We use char because int might match the return type of a gcc2
10712     builtin and then its argument prototype would still apply.  */
10713 char dbopen();
10714 char (*f)();
10715
10716 int main() {
10717
10718 /* The GNU C library defines this for functions which it implements
10719     to always fail with ENOSYS.  Some functions are actually named
10720     something starting with __ and the normal name is an alias.  */
10721 #if defined (__stub_dbopen) || defined (__stub___dbopen)
10722 choke me
10723 #else
10724 f = dbopen;
10725 #endif
10726
10727 ; return 0; }
10728 EOF
10729 if { (eval echo configure:10730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10730   rm -rf conftest*
10731   eval "ac_cv_func_dbopen=yes"
10732 else
10733   echo "configure: failed program was:" >&5
10734   cat conftest.$ac_ext >&5
10735   rm -rf conftest*
10736   eval "ac_cv_func_dbopen=no"
10737 fi
10738 rm -f conftest*
10739 fi
10740
10741 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
10742   echo "$ac_t""yes" 1>&6
10743   ol_cv_lib_db=yes
10744 else
10745   echo "$ac_t""no" 1>&6
10746
10747                 echo $ac_n "checking for dbopen in -ldb1""... $ac_c" 1>&6
10748 echo "configure:10749: checking for dbopen in -ldb1" >&5
10749 ac_lib_var=`echo db1'_'dbopen | sed 'y%./+-:%__p__%'`
10750 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10751   echo $ac_n "(cached) $ac_c" 1>&6
10752 else
10753   ac_save_LIBS="$LIBS"
10754 LIBS="-ldb1  $LIBS"
10755 cat > conftest.$ac_ext <<EOF
10756 #line 10757 "configure"
10757 #include "confdefs.h"
10758 /* Override any gcc2 internal prototype to avoid an error.  */
10759 /* We use char because int might match the return type of a gcc2
10760     builtin and then its argument prototype would still apply.  */
10761 char dbopen();
10762
10763 int main() {
10764 dbopen()
10765 ; return 0; }
10766 EOF
10767 if { (eval echo configure:10768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10768   rm -rf conftest*
10769   eval "ac_cv_lib_$ac_lib_var=yes"
10770 else
10771   echo "configure: failed program was:" >&5
10772   cat conftest.$ac_ext >&5
10773   rm -rf conftest*
10774   eval "ac_cv_lib_$ac_lib_var=no"
10775 fi
10776 rm -f conftest*
10777 LIBS="$ac_save_LIBS"
10778
10779 fi
10780 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10781   echo "$ac_t""yes" 1>&6
10782   ol_cv_lib_db=-ldb1
10783 else
10784   echo "$ac_t""no" 1>&6
10785
10786                         echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
10787 echo "configure:10788: checking for dbopen in -ldb" >&5
10788 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-:%__p__%'`
10789 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10790   echo $ac_n "(cached) $ac_c" 1>&6
10791 else
10792   ac_save_LIBS="$LIBS"
10793 LIBS="-ldb  $LIBS"
10794 cat > conftest.$ac_ext <<EOF
10795 #line 10796 "configure"
10796 #include "confdefs.h"
10797 /* Override any gcc2 internal prototype to avoid an error.  */
10798 /* We use char because int might match the return type of a gcc2
10799     builtin and then its argument prototype would still apply.  */
10800 char dbopen();
10801
10802 int main() {
10803 dbopen()
10804 ; return 0; }
10805 EOF
10806 if { (eval echo configure:10807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10807   rm -rf conftest*
10808   eval "ac_cv_lib_$ac_lib_var=yes"
10809 else
10810   echo "configure: failed program was:" >&5
10811   cat conftest.$ac_ext >&5
10812   rm -rf conftest*
10813   eval "ac_cv_lib_$ac_lib_var=no"
10814 fi
10815 rm -f conftest*
10816 LIBS="$ac_save_LIBS"
10817
10818 fi
10819 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10820   echo "$ac_t""yes" 1>&6
10821   ol_cv_lib_db=-ldb
10822 else
10823   echo "$ac_t""no" 1>&6
10824 ol_cv_lib_db=no
10825 fi
10826
10827                 
10828 fi
10829
10830         
10831 fi
10832
10833         LIBS="$ol_LIBS"
10834
10835 fi
10836
10837 echo "$ac_t""$ol_cv_lib_db" 1>&6
10838
10839
10840 for ac_hdr in db_185.h
10841 do
10842 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10843 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10844 echo "configure:10845: checking for $ac_hdr" >&5
10845 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10846   echo $ac_n "(cached) $ac_c" 1>&6
10847 else
10848   cat > conftest.$ac_ext <<EOF
10849 #line 10850 "configure"
10850 #include "confdefs.h"
10851 #include <$ac_hdr>
10852 EOF
10853 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10854 { (eval echo configure:10855: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10855 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10856 if test -z "$ac_err"; then
10857   rm -rf conftest*
10858   eval "ac_cv_header_$ac_safe=yes"
10859 else
10860   echo "$ac_err" >&5
10861   echo "configure: failed program was:" >&5
10862   cat conftest.$ac_ext >&5
10863   rm -rf conftest*
10864   eval "ac_cv_header_$ac_safe=no"
10865 fi
10866 rm -f conftest*
10867 fi
10868 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10869   echo "$ac_t""yes" 1>&6
10870     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10871   cat >> confdefs.h <<EOF
10872 #define $ac_tr_hdr 1
10873 EOF
10874  
10875 else
10876   echo "$ac_t""no" 1>&6
10877 fi
10878 done
10879
10880 if test "$ol_cv_header_db2" = yes ; then
10881         
10882         ol_cv_header_db=$ac_cv_header_db_185_h
10883 else
10884         ol_cv_header_db=$ac_cv_header_db_h
10885 fi
10886
10887
10888  
10889  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
10890 echo "configure:10891: checking for Berkeley DB" >&5
10891 if eval "test \"\${ol_cv_berkeley_db+set}\" = set"; then
10892   echo $ac_n "(cached) $ac_c" 1>&6
10893 else
10894   
10895         if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then
10896                 ol_cv_berkeley_db=no
10897         else
10898                 ol_cv_berkeley_db=yes
10899         fi
10900
10901 fi
10902
10903 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
10904  if test $ol_cv_berkeley_db = yes ; then
10905         cat >> confdefs.h <<\EOF
10906 #define HAVE_BERKELEY_DB 1
10907 EOF
10908
10909  fi
10910
10911
10912         if test $ol_cv_berkeley_db = yes ; then
10913                 ol_link_ldbm=db
10914                 ol_with_ldbm_api=db
10915
10916                 if test $ol_with_ldbm_type = hash ; then
10917                         cat >> confdefs.h <<\EOF
10918 #define LDBM_USE_DBHASH 1
10919 EOF
10920
10921                 else
10922                         cat >> confdefs.h <<\EOF
10923 #define LDBM_USE_DBBTREE 1
10924 EOF
10925
10926                 fi
10927
10928                                                 if test $ol_cv_lib_db != yes ; then
10929                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
10930                 fi
10931         fi
10932 fi
10933
10934 if test $ol_with_ldbm_api = manual ; then
10935                 ol_link_ldbm=yes
10936
10937         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
10938
10939         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
10940 do
10941 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10942 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10943 echo "configure:10944: checking for $ac_hdr" >&5
10944 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10945   echo $ac_n "(cached) $ac_c" 1>&6
10946 else
10947   cat > conftest.$ac_ext <<EOF
10948 #line 10949 "configure"
10949 #include "confdefs.h"
10950 #include <$ac_hdr>
10951 EOF
10952 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10953 { (eval echo configure:10954: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10954 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10955 if test -z "$ac_err"; then
10956   rm -rf conftest*
10957   eval "ac_cv_header_$ac_safe=yes"
10958 else
10959   echo "$ac_err" >&5
10960   echo "configure: failed program was:" >&5
10961   cat conftest.$ac_ext >&5
10962   rm -rf conftest*
10963   eval "ac_cv_header_$ac_safe=no"
10964 fi
10965 rm -f conftest*
10966 fi
10967 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10968   echo "$ac_t""yes" 1>&6
10969     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10970   cat >> confdefs.h <<EOF
10971 #define $ac_tr_hdr 1
10972 EOF
10973  
10974 else
10975   echo "$ac_t""no" 1>&6
10976 fi
10977 done
10978
10979 fi
10980
10981 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
10982         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
10983         ol_with_ldbm_api=none
10984 fi
10985
10986 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
10987         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
10988 echo "configure:10989: checking for MDBM library" >&5
10989 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
10990   echo $ac_n "(cached) $ac_c" 1>&6
10991 else
10992         ol_LIBS="$LIBS"
10993         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
10994 echo "configure:10995: checking for mdbm_set_chain" >&5
10995 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
10996   echo $ac_n "(cached) $ac_c" 1>&6
10997 else
10998   cat > conftest.$ac_ext <<EOF
10999 #line 11000 "configure"
11000 #include "confdefs.h"
11001 /* System header to define __stub macros and hopefully few prototypes,
11002     which can conflict with char mdbm_set_chain(); below.  */
11003 #include <assert.h>
11004 /* Override any gcc2 internal prototype to avoid an error.  */
11005 /* We use char because int might match the return type of a gcc2
11006     builtin and then its argument prototype would still apply.  */
11007 char mdbm_set_chain();
11008 char (*f)();
11009
11010 int main() {
11011
11012 /* The GNU C library defines this for functions which it implements
11013     to always fail with ENOSYS.  Some functions are actually named
11014     something starting with __ and the normal name is an alias.  */
11015 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
11016 choke me
11017 #else
11018 f = mdbm_set_chain;
11019 #endif
11020
11021 ; return 0; }
11022 EOF
11023 if { (eval echo configure:11024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11024   rm -rf conftest*
11025   eval "ac_cv_func_mdbm_set_chain=yes"
11026 else
11027   echo "configure: failed program was:" >&5
11028   cat conftest.$ac_ext >&5
11029   rm -rf conftest*
11030   eval "ac_cv_func_mdbm_set_chain=no"
11031 fi
11032 rm -f conftest*
11033 fi
11034
11035 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
11036   echo "$ac_t""yes" 1>&6
11037   ol_cv_lib_mdbm=yes
11038 else
11039   echo "$ac_t""no" 1>&6
11040
11041                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
11042 echo "configure:11043: checking for mdbm_set_chain in -lmdbm" >&5
11043 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
11044 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11045   echo $ac_n "(cached) $ac_c" 1>&6
11046 else
11047   ac_save_LIBS="$LIBS"
11048 LIBS="-lmdbm  $LIBS"
11049 cat > conftest.$ac_ext <<EOF
11050 #line 11051 "configure"
11051 #include "confdefs.h"
11052 /* Override any gcc2 internal prototype to avoid an error.  */
11053 /* We use char because int might match the return type of a gcc2
11054     builtin and then its argument prototype would still apply.  */
11055 char mdbm_set_chain();
11056
11057 int main() {
11058 mdbm_set_chain()
11059 ; return 0; }
11060 EOF
11061 if { (eval echo configure:11062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11062   rm -rf conftest*
11063   eval "ac_cv_lib_$ac_lib_var=yes"
11064 else
11065   echo "configure: failed program was:" >&5
11066   cat conftest.$ac_ext >&5
11067   rm -rf conftest*
11068   eval "ac_cv_lib_$ac_lib_var=no"
11069 fi
11070 rm -f conftest*
11071 LIBS="$ac_save_LIBS"
11072
11073 fi
11074 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11075   echo "$ac_t""yes" 1>&6
11076   ol_cv_lib_mdbm=-lmdbm
11077 else
11078   echo "$ac_t""no" 1>&6
11079 ol_cv_lib_mdbm=no
11080 fi
11081
11082         
11083 fi
11084
11085         LIBS="$ol_LIBS"
11086
11087 fi
11088
11089 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
11090
11091
11092  for ac_hdr in mdbm.h
11093 do
11094 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11095 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11096 echo "configure:11097: checking for $ac_hdr" >&5
11097 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11098   echo $ac_n "(cached) $ac_c" 1>&6
11099 else
11100   cat > conftest.$ac_ext <<EOF
11101 #line 11102 "configure"
11102 #include "confdefs.h"
11103 #include <$ac_hdr>
11104 EOF
11105 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11106 { (eval echo configure:11107: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11107 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11108 if test -z "$ac_err"; then
11109   rm -rf conftest*
11110   eval "ac_cv_header_$ac_safe=yes"
11111 else
11112   echo "$ac_err" >&5
11113   echo "configure: failed program was:" >&5
11114   cat conftest.$ac_ext >&5
11115   rm -rf conftest*
11116   eval "ac_cv_header_$ac_safe=no"
11117 fi
11118 rm -f conftest*
11119 fi
11120 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11121   echo "$ac_t""yes" 1>&6
11122     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11123   cat >> confdefs.h <<EOF
11124 #define $ac_tr_hdr 1
11125 EOF
11126  
11127 else
11128   echo "$ac_t""no" 1>&6
11129 fi
11130 done
11131
11132  echo $ac_n "checking for db""... $ac_c" 1>&6
11133 echo "configure:11134: checking for db" >&5
11134 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
11135   echo $ac_n "(cached) $ac_c" 1>&6
11136 else
11137   
11138         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
11139                 ol_cv_mdbm=no
11140         else
11141                 ol_cv_mdbm=yes
11142         fi
11143
11144 fi
11145
11146 echo "$ac_t""$ol_cv_mdbm" 1>&6
11147  if test $ol_cv_mdbm = yes ; then
11148         cat >> confdefs.h <<\EOF
11149 #define HAVE_MDBM 1
11150 EOF
11151
11152  fi
11153
11154
11155         if test $ol_cv_mdbm = yes ; then
11156                 ol_link_ldbm=mdbm
11157                 ol_with_ldbm_api=mdbm
11158                 if test $ol_cv_lib_mdbm != yes ; then
11159                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
11160                 fi
11161         fi
11162 fi
11163
11164 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
11165         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
11166 echo "configure:11167: checking for GDBM library" >&5
11167 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
11168   echo $ac_n "(cached) $ac_c" 1>&6
11169 else
11170         ol_LIBS="$LIBS"
11171         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
11172 echo "configure:11173: checking for gdbm_open" >&5
11173 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
11174   echo $ac_n "(cached) $ac_c" 1>&6
11175 else
11176   cat > conftest.$ac_ext <<EOF
11177 #line 11178 "configure"
11178 #include "confdefs.h"
11179 /* System header to define __stub macros and hopefully few prototypes,
11180     which can conflict with char gdbm_open(); below.  */
11181 #include <assert.h>
11182 /* Override any gcc2 internal prototype to avoid an error.  */
11183 /* We use char because int might match the return type of a gcc2
11184     builtin and then its argument prototype would still apply.  */
11185 char gdbm_open();
11186 char (*f)();
11187
11188 int main() {
11189
11190 /* The GNU C library defines this for functions which it implements
11191     to always fail with ENOSYS.  Some functions are actually named
11192     something starting with __ and the normal name is an alias.  */
11193 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
11194 choke me
11195 #else
11196 f = gdbm_open;
11197 #endif
11198
11199 ; return 0; }
11200 EOF
11201 if { (eval echo configure:11202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11202   rm -rf conftest*
11203   eval "ac_cv_func_gdbm_open=yes"
11204 else
11205   echo "configure: failed program was:" >&5
11206   cat conftest.$ac_ext >&5
11207   rm -rf conftest*
11208   eval "ac_cv_func_gdbm_open=no"
11209 fi
11210 rm -f conftest*
11211 fi
11212
11213 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
11214   echo "$ac_t""yes" 1>&6
11215   ol_cv_lib_gdbm=yes
11216 else
11217   echo "$ac_t""no" 1>&6
11218
11219                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
11220 echo "configure:11221: checking for gdbm_open in -lgdbm" >&5
11221 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
11222 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11223   echo $ac_n "(cached) $ac_c" 1>&6
11224 else
11225   ac_save_LIBS="$LIBS"
11226 LIBS="-lgdbm  $LIBS"
11227 cat > conftest.$ac_ext <<EOF
11228 #line 11229 "configure"
11229 #include "confdefs.h"
11230 /* Override any gcc2 internal prototype to avoid an error.  */
11231 /* We use char because int might match the return type of a gcc2
11232     builtin and then its argument prototype would still apply.  */
11233 char gdbm_open();
11234
11235 int main() {
11236 gdbm_open()
11237 ; return 0; }
11238 EOF
11239 if { (eval echo configure:11240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11240   rm -rf conftest*
11241   eval "ac_cv_lib_$ac_lib_var=yes"
11242 else
11243   echo "configure: failed program was:" >&5
11244   cat conftest.$ac_ext >&5
11245   rm -rf conftest*
11246   eval "ac_cv_lib_$ac_lib_var=no"
11247 fi
11248 rm -f conftest*
11249 LIBS="$ac_save_LIBS"
11250
11251 fi
11252 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11253   echo "$ac_t""yes" 1>&6
11254   ol_cv_lib_gdbm=-lgdbm
11255 else
11256   echo "$ac_t""no" 1>&6
11257 ol_cv_lib_gdbm=no
11258 fi
11259
11260         
11261 fi
11262
11263         LIBS="$ol_LIBS"
11264
11265 fi
11266
11267 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
11268
11269
11270  for ac_hdr in gdbm.h
11271 do
11272 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11273 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11274 echo "configure:11275: checking for $ac_hdr" >&5
11275 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11276   echo $ac_n "(cached) $ac_c" 1>&6
11277 else
11278   cat > conftest.$ac_ext <<EOF
11279 #line 11280 "configure"
11280 #include "confdefs.h"
11281 #include <$ac_hdr>
11282 EOF
11283 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11284 { (eval echo configure:11285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11285 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11286 if test -z "$ac_err"; then
11287   rm -rf conftest*
11288   eval "ac_cv_header_$ac_safe=yes"
11289 else
11290   echo "$ac_err" >&5
11291   echo "configure: failed program was:" >&5
11292   cat conftest.$ac_ext >&5
11293   rm -rf conftest*
11294   eval "ac_cv_header_$ac_safe=no"
11295 fi
11296 rm -f conftest*
11297 fi
11298 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11299   echo "$ac_t""yes" 1>&6
11300     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11301   cat >> confdefs.h <<EOF
11302 #define $ac_tr_hdr 1
11303 EOF
11304  
11305 else
11306   echo "$ac_t""no" 1>&6
11307 fi
11308 done
11309
11310  echo $ac_n "checking for db""... $ac_c" 1>&6
11311 echo "configure:11312: checking for db" >&5
11312 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
11313   echo $ac_n "(cached) $ac_c" 1>&6
11314 else
11315   
11316         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
11317                 ol_cv_gdbm=no
11318         else
11319                 ol_cv_gdbm=yes
11320         fi
11321
11322 fi
11323
11324 echo "$ac_t""$ol_cv_gdbm" 1>&6
11325  if test $ol_cv_gdbm = yes ; then
11326         cat >> confdefs.h <<\EOF
11327 #define HAVE_GDBM 1
11328 EOF
11329
11330  fi
11331
11332
11333         if test $ol_cv_gdbm = yes ; then
11334                 ol_link_ldbm=gdbm
11335                 ol_with_ldbm_api=gdbm
11336
11337                 if test $ol_cv_lib_gdbm != yes ; then
11338                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
11339                 fi
11340         fi
11341 fi
11342
11343 if test $ol_with_ldbm_api = auto ; then
11344         echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
11345 elif test $ol_with_ldbm_api = ndbm ; then
11346         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
11347 echo "configure:11348: checking for NDBM library" >&5
11348 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
11349   echo $ac_n "(cached) $ac_c" 1>&6
11350 else
11351         ol_LIBS="$LIBS"
11352         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
11353 echo "configure:11354: checking for dbm_open" >&5
11354 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
11355   echo $ac_n "(cached) $ac_c" 1>&6
11356 else
11357   cat > conftest.$ac_ext <<EOF
11358 #line 11359 "configure"
11359 #include "confdefs.h"
11360 /* System header to define __stub macros and hopefully few prototypes,
11361     which can conflict with char dbm_open(); below.  */
11362 #include <assert.h>
11363 /* Override any gcc2 internal prototype to avoid an error.  */
11364 /* We use char because int might match the return type of a gcc2
11365     builtin and then its argument prototype would still apply.  */
11366 char dbm_open();
11367 char (*f)();
11368
11369 int main() {
11370
11371 /* The GNU C library defines this for functions which it implements
11372     to always fail with ENOSYS.  Some functions are actually named
11373     something starting with __ and the normal name is an alias.  */
11374 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
11375 choke me
11376 #else
11377 f = dbm_open;
11378 #endif
11379
11380 ; return 0; }
11381 EOF
11382 if { (eval echo configure:11383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11383   rm -rf conftest*
11384   eval "ac_cv_func_dbm_open=yes"
11385 else
11386   echo "configure: failed program was:" >&5
11387   cat conftest.$ac_ext >&5
11388   rm -rf conftest*
11389   eval "ac_cv_func_dbm_open=no"
11390 fi
11391 rm -f conftest*
11392 fi
11393
11394 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
11395   echo "$ac_t""yes" 1>&6
11396   ol_cv_lib_ndbm=yes
11397 else
11398   echo "$ac_t""no" 1>&6
11399
11400                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
11401 echo "configure:11402: checking for dbm_open in -lndbm" >&5
11402 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
11403 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11404   echo $ac_n "(cached) $ac_c" 1>&6
11405 else
11406   ac_save_LIBS="$LIBS"
11407 LIBS="-lndbm  $LIBS"
11408 cat > conftest.$ac_ext <<EOF
11409 #line 11410 "configure"
11410 #include "confdefs.h"
11411 /* Override any gcc2 internal prototype to avoid an error.  */
11412 /* We use char because int might match the return type of a gcc2
11413     builtin and then its argument prototype would still apply.  */
11414 char dbm_open();
11415
11416 int main() {
11417 dbm_open()
11418 ; return 0; }
11419 EOF
11420 if { (eval echo configure:11421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11421   rm -rf conftest*
11422   eval "ac_cv_lib_$ac_lib_var=yes"
11423 else
11424   echo "configure: failed program was:" >&5
11425   cat conftest.$ac_ext >&5
11426   rm -rf conftest*
11427   eval "ac_cv_lib_$ac_lib_var=no"
11428 fi
11429 rm -f conftest*
11430 LIBS="$ac_save_LIBS"
11431
11432 fi
11433 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11434   echo "$ac_t""yes" 1>&6
11435   ol_cv_lib_ndbm=-lndbm
11436 else
11437   echo "$ac_t""no" 1>&6
11438
11439                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
11440 echo "configure:11441: checking for dbm_open in -ldbm" >&5
11441 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
11442 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11443   echo $ac_n "(cached) $ac_c" 1>&6
11444 else
11445   ac_save_LIBS="$LIBS"
11446 LIBS="-ldbm  $LIBS"
11447 cat > conftest.$ac_ext <<EOF
11448 #line 11449 "configure"
11449 #include "confdefs.h"
11450 /* Override any gcc2 internal prototype to avoid an error.  */
11451 /* We use char because int might match the return type of a gcc2
11452     builtin and then its argument prototype would still apply.  */
11453 char dbm_open();
11454
11455 int main() {
11456 dbm_open()
11457 ; return 0; }
11458 EOF
11459 if { (eval echo configure:11460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11460   rm -rf conftest*
11461   eval "ac_cv_lib_$ac_lib_var=yes"
11462 else
11463   echo "configure: failed program was:" >&5
11464   cat conftest.$ac_ext >&5
11465   rm -rf conftest*
11466   eval "ac_cv_lib_$ac_lib_var=no"
11467 fi
11468 rm -f conftest*
11469 LIBS="$ac_save_LIBS"
11470
11471 fi
11472 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11473   echo "$ac_t""yes" 1>&6
11474   ol_cv_lib_ndbm=-ldbm
11475 else
11476   echo "$ac_t""no" 1>&6
11477 ol_cv_lib_ndbm=no
11478 fi
11479                 
11480 fi
11481
11482         
11483 fi
11484
11485         LIBS="$ol_LIBS"
11486
11487 fi
11488
11489 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
11490
11491
11492  for ac_hdr in ndbm.h
11493 do
11494 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11495 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11496 echo "configure:11497: checking for $ac_hdr" >&5
11497 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11498   echo $ac_n "(cached) $ac_c" 1>&6
11499 else
11500   cat > conftest.$ac_ext <<EOF
11501 #line 11502 "configure"
11502 #include "confdefs.h"
11503 #include <$ac_hdr>
11504 EOF
11505 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11506 { (eval echo configure:11507: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11507 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11508 if test -z "$ac_err"; then
11509   rm -rf conftest*
11510   eval "ac_cv_header_$ac_safe=yes"
11511 else
11512   echo "$ac_err" >&5
11513   echo "configure: failed program was:" >&5
11514   cat conftest.$ac_ext >&5
11515   rm -rf conftest*
11516   eval "ac_cv_header_$ac_safe=no"
11517 fi
11518 rm -f conftest*
11519 fi
11520 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11521   echo "$ac_t""yes" 1>&6
11522     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11523   cat >> confdefs.h <<EOF
11524 #define $ac_tr_hdr 1
11525 EOF
11526  
11527 else
11528   echo "$ac_t""no" 1>&6
11529 fi
11530 done
11531
11532  echo $ac_n "checking for db""... $ac_c" 1>&6
11533 echo "configure:11534: checking for db" >&5
11534 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
11535   echo $ac_n "(cached) $ac_c" 1>&6
11536 else
11537   
11538         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
11539                 ol_cv_ndbm=no
11540         else
11541                 ol_cv_ndbm=yes
11542         fi
11543
11544 fi
11545
11546 echo "$ac_t""$ol_cv_ndbm" 1>&6
11547  if test $ol_cv_ndbm = yes ; then
11548         cat >> confdefs.h <<\EOF
11549 #define HAVE_NDBM 1
11550 EOF
11551
11552  fi
11553
11554
11555         if test $ol_cv_ndbm = yes ; then
11556                 ol_link_ldbm=ndbm
11557                 ol_with_ldbm_api=ndbm
11558
11559                 if test $ol_cv_lib_ndbm != yes ; then
11560                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
11561                 fi
11562         fi
11563 fi
11564
11565 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
11566         echo "configure: warning: could not find suitable LDBM backend" 1>&2
11567         if test $ol_enable_ldbm = yes ; then
11568                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
11569         fi
11570
11571         echo "configure: warning: disabling LDBM" 1>&2
11572         ol_enable_ldbm=no
11573 fi
11574
11575 if test $ol_enable_wrappers != no ; then
11576         for ac_hdr in tcpd.h
11577 do
11578 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11579 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11580 echo "configure:11581: checking for $ac_hdr" >&5
11581 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11582   echo $ac_n "(cached) $ac_c" 1>&6
11583 else
11584   cat > conftest.$ac_ext <<EOF
11585 #line 11586 "configure"
11586 #include "confdefs.h"
11587 #include <$ac_hdr>
11588 EOF
11589 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11590 { (eval echo configure:11591: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11591 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11592 if test -z "$ac_err"; then
11593   rm -rf conftest*
11594   eval "ac_cv_header_$ac_safe=yes"
11595 else
11596   echo "$ac_err" >&5
11597   echo "configure: failed program was:" >&5
11598   cat conftest.$ac_ext >&5
11599   rm -rf conftest*
11600   eval "ac_cv_header_$ac_safe=no"
11601 fi
11602 rm -f conftest*
11603 fi
11604 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11605   echo "$ac_t""yes" 1>&6
11606     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11607   cat >> confdefs.h <<EOF
11608 #define $ac_tr_hdr 1
11609 EOF
11610  
11611 else
11612   echo "$ac_t""no" 1>&6
11613 fi
11614 done
11615
11616
11617         if test $ac_cv_header_tcpd_h != yes ; then
11618                 have_wrappers=no
11619         else
11620                 echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
11621 echo "configure:11622: checking for main in -lwrap" >&5
11622 ac_lib_var=`echo wrap'_'main | sed 'y%./+-:%__p__%'`
11623 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11624   echo $ac_n "(cached) $ac_c" 1>&6
11625 else
11626   ac_save_LIBS="$LIBS"
11627 LIBS="-lwrap  $LIBS"
11628 cat > conftest.$ac_ext <<EOF
11629 #line 11630 "configure"
11630 #include "confdefs.h"
11631
11632 int main() {
11633 main()
11634 ; return 0; }
11635 EOF
11636 if { (eval echo configure:11637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11637   rm -rf conftest*
11638   eval "ac_cv_lib_$ac_lib_var=yes"
11639 else
11640   echo "configure: failed program was:" >&5
11641   cat conftest.$ac_ext >&5
11642   rm -rf conftest*
11643   eval "ac_cv_lib_$ac_lib_var=no"
11644 fi
11645 rm -f conftest*
11646 LIBS="$ac_save_LIBS"
11647
11648 fi
11649 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11650   echo "$ac_t""yes" 1>&6
11651   have_wrappers=yes
11652 else
11653   echo "$ac_t""no" 1>&6
11654 have_wrappers=no
11655 fi
11656
11657         fi
11658
11659         if test $have_wrappers = yes ; then
11660                 cat >> confdefs.h <<\EOF
11661 #define HAVE_TCPD 1
11662 EOF
11663
11664                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
11665
11666                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
11667 echo "configure:11668: checking for main in -lnsl" >&5
11668 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
11669 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11670   echo $ac_n "(cached) $ac_c" 1>&6
11671 else
11672   ac_save_LIBS="$LIBS"
11673 LIBS="-lnsl  $LIBS"
11674 cat > conftest.$ac_ext <<EOF
11675 #line 11676 "configure"
11676 #include "confdefs.h"
11677
11678 int main() {
11679 main()
11680 ; return 0; }
11681 EOF
11682 if { (eval echo configure:11683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11683   rm -rf conftest*
11684   eval "ac_cv_lib_$ac_lib_var=yes"
11685 else
11686   echo "configure: failed program was:" >&5
11687   cat conftest.$ac_ext >&5
11688   rm -rf conftest*
11689   eval "ac_cv_lib_$ac_lib_var=no"
11690 fi
11691 rm -f conftest*
11692 LIBS="$ac_save_LIBS"
11693
11694 fi
11695 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11696   echo "$ac_t""yes" 1>&6
11697     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
11698     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
11699   cat >> confdefs.h <<EOF
11700 #define $ac_tr_lib 1
11701 EOF
11702
11703   LIBS="-lnsl $LIBS"
11704
11705 else
11706   echo "$ac_t""no" 1>&6
11707 fi
11708
11709         else
11710                 echo "configure: warning: could not find -lwrap" 1>&2
11711                 if test $ol_enable_wrappers = yes ; then
11712                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
11713                 fi
11714
11715                 echo "configure: warning: disabling wrappers support" 1>&2
11716                 ol_enable_wrappers=no
11717         fi
11718 fi
11719
11720 if test $ol_enable_syslog != no ; then
11721         echo $ac_n "checking for openlog""... $ac_c" 1>&6
11722 echo "configure:11723: checking for openlog" >&5
11723 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
11724   echo $ac_n "(cached) $ac_c" 1>&6
11725 else
11726   cat > conftest.$ac_ext <<EOF
11727 #line 11728 "configure"
11728 #include "confdefs.h"
11729 /* System header to define __stub macros and hopefully few prototypes,
11730     which can conflict with char openlog(); below.  */
11731 #include <assert.h>
11732 /* Override any gcc2 internal prototype to avoid an error.  */
11733 /* We use char because int might match the return type of a gcc2
11734     builtin and then its argument prototype would still apply.  */
11735 char openlog();
11736 char (*f)();
11737
11738 int main() {
11739
11740 /* The GNU C library defines this for functions which it implements
11741     to always fail with ENOSYS.  Some functions are actually named
11742     something starting with __ and the normal name is an alias.  */
11743 #if defined (__stub_openlog) || defined (__stub___openlog)
11744 choke me
11745 #else
11746 f = openlog;
11747 #endif
11748
11749 ; return 0; }
11750 EOF
11751 if { (eval echo configure:11752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11752   rm -rf conftest*
11753   eval "ac_cv_func_openlog=yes"
11754 else
11755   echo "configure: failed program was:" >&5
11756   cat conftest.$ac_ext >&5
11757   rm -rf conftest*
11758   eval "ac_cv_func_openlog=no"
11759 fi
11760 rm -f conftest*
11761 fi
11762
11763 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
11764   echo "$ac_t""yes" 1>&6
11765   :
11766 else
11767   echo "$ac_t""no" 1>&6
11768 fi
11769
11770         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
11771                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
11772         fi
11773         ol_enable_syslog=$ac_cv_func_openlog
11774 fi
11775
11776 if test $ol_enable_dmalloc != no ; then
11777         for ac_hdr in dmalloc.h
11778 do
11779 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11780 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11781 echo "configure:11782: checking for $ac_hdr" >&5
11782 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11783   echo $ac_n "(cached) $ac_c" 1>&6
11784 else
11785   cat > conftest.$ac_ext <<EOF
11786 #line 11787 "configure"
11787 #include "confdefs.h"
11788 #include <$ac_hdr>
11789 EOF
11790 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11791 { (eval echo configure:11792: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11792 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11793 if test -z "$ac_err"; then
11794   rm -rf conftest*
11795   eval "ac_cv_header_$ac_safe=yes"
11796 else
11797   echo "$ac_err" >&5
11798   echo "configure: failed program was:" >&5
11799   cat conftest.$ac_ext >&5
11800   rm -rf conftest*
11801   eval "ac_cv_header_$ac_safe=no"
11802 fi
11803 rm -f conftest*
11804 fi
11805 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11806   echo "$ac_t""yes" 1>&6
11807     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11808   cat >> confdefs.h <<EOF
11809 #define $ac_tr_hdr 1
11810 EOF
11811  
11812 else
11813   echo "$ac_t""no" 1>&6
11814 fi
11815 done
11816
11817         echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
11818 echo "configure:11819: checking for dmalloc_shutdown in -ldmalloc" >&5
11819 ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-:%__p__%'`
11820 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11821   echo $ac_n "(cached) $ac_c" 1>&6
11822 else
11823   ac_save_LIBS="$LIBS"
11824 LIBS="-ldmalloc  $LIBS"
11825 cat > conftest.$ac_ext <<EOF
11826 #line 11827 "configure"
11827 #include "confdefs.h"
11828 /* Override any gcc2 internal prototype to avoid an error.  */
11829 /* We use char because int might match the return type of a gcc2
11830     builtin and then its argument prototype would still apply.  */
11831 char dmalloc_shutdown();
11832
11833 int main() {
11834 dmalloc_shutdown()
11835 ; return 0; }
11836 EOF
11837 if { (eval echo configure:11838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11838   rm -rf conftest*
11839   eval "ac_cv_lib_$ac_lib_var=yes"
11840 else
11841   echo "configure: failed program was:" >&5
11842   cat conftest.$ac_ext >&5
11843   rm -rf conftest*
11844   eval "ac_cv_lib_$ac_lib_var=no"
11845 fi
11846 rm -f conftest*
11847 LIBS="$ac_save_LIBS"
11848
11849 fi
11850 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11851   echo "$ac_t""yes" 1>&6
11852     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
11853     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
11854   cat >> confdefs.h <<EOF
11855 #define $ac_tr_lib 1
11856 EOF
11857
11858   LIBS="-ldmalloc $LIBS"
11859
11860 else
11861   echo "$ac_t""no" 1>&6
11862 fi
11863
11864 fi
11865
11866 if test $ol_enable_tcl != no ; then
11867         for ac_hdr in tcl.h
11868 do
11869 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11870 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11871 echo "configure:11872: checking for $ac_hdr" >&5
11872 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11873   echo $ac_n "(cached) $ac_c" 1>&6
11874 else
11875   cat > conftest.$ac_ext <<EOF
11876 #line 11877 "configure"
11877 #include "confdefs.h"
11878 #include <$ac_hdr>
11879 EOF
11880 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11881 { (eval echo configure:11882: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11882 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11883 if test -z "$ac_err"; then
11884   rm -rf conftest*
11885   eval "ac_cv_header_$ac_safe=yes"
11886 else
11887   echo "$ac_err" >&5
11888   echo "configure: failed program was:" >&5
11889   cat conftest.$ac_ext >&5
11890   rm -rf conftest*
11891   eval "ac_cv_header_$ac_safe=no"
11892 fi
11893 rm -f conftest*
11894 fi
11895 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11896   echo "$ac_t""yes" 1>&6
11897     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11898   cat >> confdefs.h <<EOF
11899 #define $ac_tr_hdr 1
11900 EOF
11901  
11902 else
11903   echo "$ac_t""no" 1>&6
11904 fi
11905 done
11906
11907
11908         if test $ac_cv_header_tcl_h != yes ; then
11909                 have_tcl=no
11910         else
11911                 echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6
11912 echo "configure:11913: checking for main in -ltcl" >&5
11913 ac_lib_var=`echo tcl'_'main | sed 'y%./+-:%__p__%'`
11914 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11915   echo $ac_n "(cached) $ac_c" 1>&6
11916 else
11917   ac_save_LIBS="$LIBS"
11918 LIBS="-ltcl  $LIBS"
11919 cat > conftest.$ac_ext <<EOF
11920 #line 11921 "configure"
11921 #include "confdefs.h"
11922
11923 int main() {
11924 main()
11925 ; return 0; }
11926 EOF
11927 if { (eval echo configure:11928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11928   rm -rf conftest*
11929   eval "ac_cv_lib_$ac_lib_var=yes"
11930 else
11931   echo "configure: failed program was:" >&5
11932   cat conftest.$ac_ext >&5
11933   rm -rf conftest*
11934   eval "ac_cv_lib_$ac_lib_var=no"
11935 fi
11936 rm -f conftest*
11937 LIBS="$ac_save_LIBS"
11938
11939 fi
11940 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11941   echo "$ac_t""yes" 1>&6
11942   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"
11943 else
11944   echo "$ac_t""no" 1>&6
11945 have_tcl=no
11946 fi
11947
11948
11949                 if test $have_tcl != yes; then
11950                         echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6
11951 echo "configure:11952: checking for main in -ltcl7.6" >&5
11952 ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-:%__p__%'`
11953 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11954   echo $ac_n "(cached) $ac_c" 1>&6
11955 else
11956   ac_save_LIBS="$LIBS"
11957 LIBS="-ltcl7.6  $LIBS"
11958 cat > conftest.$ac_ext <<EOF
11959 #line 11960 "configure"
11960 #include "confdefs.h"
11961
11962 int main() {
11963 main()
11964 ; return 0; }
11965 EOF
11966 if { (eval echo configure:11967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11967   rm -rf conftest*
11968   eval "ac_cv_lib_$ac_lib_var=yes"
11969 else
11970   echo "configure: failed program was:" >&5
11971   cat conftest.$ac_ext >&5
11972   rm -rf conftest*
11973   eval "ac_cv_lib_$ac_lib_var=no"
11974 fi
11975 rm -f conftest*
11976 LIBS="$ac_save_LIBS"
11977
11978 fi
11979 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11980   echo "$ac_t""yes" 1>&6
11981   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"
11982 else
11983   echo "$ac_t""no" 1>&6
11984 have_tcl=no
11985 fi
11986
11987                 fi
11988
11989                 if test $have_tcl != yes; then
11990                         echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6
11991 echo "configure:11992: checking for main in -ltcl8.0" >&5
11992 ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-:%__p__%'`
11993 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11994   echo $ac_n "(cached) $ac_c" 1>&6
11995 else
11996   ac_save_LIBS="$LIBS"
11997 LIBS="-ltcl8.0  $LIBS"
11998 cat > conftest.$ac_ext <<EOF
11999 #line 12000 "configure"
12000 #include "confdefs.h"
12001
12002 int main() {
12003 main()
12004 ; return 0; }
12005 EOF
12006 if { (eval echo configure:12007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12007   rm -rf conftest*
12008   eval "ac_cv_lib_$ac_lib_var=yes"
12009 else
12010   echo "configure: failed program was:" >&5
12011   cat conftest.$ac_ext >&5
12012   rm -rf conftest*
12013   eval "ac_cv_lib_$ac_lib_var=no"
12014 fi
12015 rm -f conftest*
12016 LIBS="$ac_save_LIBS"
12017
12018 fi
12019 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12020   echo "$ac_t""yes" 1>&6
12021   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"
12022 else
12023   echo "$ac_t""no" 1>&6
12024 have_tcl=no
12025 fi
12026
12027                 fi
12028         fi
12029
12030         if test $have_tcl != yes ; then
12031                 echo "configure: warning: could not find -ltcl" 1>&2
12032                 if test $ol_enable_tcl = yes ; then
12033                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
12034                 fi
12035
12036                 ol_enable_tcl=no
12037         fi
12038 fi
12039
12040 ol_link_termcap=no
12041 for ac_hdr in termcap.h ncurses.h
12042 do
12043 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12044 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12045 echo "configure:12046: checking for $ac_hdr" >&5
12046 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12047   echo $ac_n "(cached) $ac_c" 1>&6
12048 else
12049   cat > conftest.$ac_ext <<EOF
12050 #line 12051 "configure"
12051 #include "confdefs.h"
12052 #include <$ac_hdr>
12053 EOF
12054 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12055 { (eval echo configure:12056: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12056 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12057 if test -z "$ac_err"; then
12058   rm -rf conftest*
12059   eval "ac_cv_header_$ac_safe=yes"
12060 else
12061   echo "$ac_err" >&5
12062   echo "configure: failed program was:" >&5
12063   cat conftest.$ac_ext >&5
12064   rm -rf conftest*
12065   eval "ac_cv_header_$ac_safe=no"
12066 fi
12067 rm -f conftest*
12068 fi
12069 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12070   echo "$ac_t""yes" 1>&6
12071     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12072   cat >> confdefs.h <<EOF
12073 #define $ac_tr_hdr 1
12074 EOF
12075  
12076 else
12077   echo "$ac_t""no" 1>&6
12078 fi
12079 done
12080
12081
12082 if test $ol_link_termcap = no ; then
12083         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
12084 echo "configure:12085: checking for tputs in -ltermcap" >&5
12085 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
12086 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12087   echo $ac_n "(cached) $ac_c" 1>&6
12088 else
12089   ac_save_LIBS="$LIBS"
12090 LIBS="-ltermcap  $LIBS"
12091 cat > conftest.$ac_ext <<EOF
12092 #line 12093 "configure"
12093 #include "confdefs.h"
12094 /* Override any gcc2 internal prototype to avoid an error.  */
12095 /* We use char because int might match the return type of a gcc2
12096     builtin and then its argument prototype would still apply.  */
12097 char tputs();
12098
12099 int main() {
12100 tputs()
12101 ; return 0; }
12102 EOF
12103 if { (eval echo configure:12104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12104   rm -rf conftest*
12105   eval "ac_cv_lib_$ac_lib_var=yes"
12106 else
12107   echo "configure: failed program was:" >&5
12108   cat conftest.$ac_ext >&5
12109   rm -rf conftest*
12110   eval "ac_cv_lib_$ac_lib_var=no"
12111 fi
12112 rm -f conftest*
12113 LIBS="$ac_save_LIBS"
12114
12115 fi
12116 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12117   echo "$ac_t""yes" 1>&6
12118   have_termcap=yes
12119 else
12120   echo "$ac_t""no" 1>&6
12121 have_termcap=no
12122 fi
12123
12124         if test $have_termcap = yes ; then
12125                 cat >> confdefs.h <<\EOF
12126 #define HAVE_TERMCAP 1
12127 EOF
12128
12129                 ol_link_termcap=yes
12130                 TERMCAP_LIBS=-ltermcap
12131         fi
12132 fi
12133
12134 if test $ol_link_termcap = no ; then
12135         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
12136 echo "configure:12137: checking for initscr in -lncurses" >&5
12137 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
12138 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12139   echo $ac_n "(cached) $ac_c" 1>&6
12140 else
12141   ac_save_LIBS="$LIBS"
12142 LIBS="-lncurses  $LIBS"
12143 cat > conftest.$ac_ext <<EOF
12144 #line 12145 "configure"
12145 #include "confdefs.h"
12146 /* Override any gcc2 internal prototype to avoid an error.  */
12147 /* We use char because int might match the return type of a gcc2
12148     builtin and then its argument prototype would still apply.  */
12149 char initscr();
12150
12151 int main() {
12152 initscr()
12153 ; return 0; }
12154 EOF
12155 if { (eval echo configure:12156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12156   rm -rf conftest*
12157   eval "ac_cv_lib_$ac_lib_var=yes"
12158 else
12159   echo "configure: failed program was:" >&5
12160   cat conftest.$ac_ext >&5
12161   rm -rf conftest*
12162   eval "ac_cv_lib_$ac_lib_var=no"
12163 fi
12164 rm -f conftest*
12165 LIBS="$ac_save_LIBS"
12166
12167 fi
12168 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12169   echo "$ac_t""yes" 1>&6
12170   have_ncurses=yes
12171 else
12172   echo "$ac_t""no" 1>&6
12173 have_ncurses=no
12174 fi
12175
12176         if test $have_ncurses = yes ; then
12177                 cat >> confdefs.h <<\EOF
12178 #define HAVE_NCURSES 1
12179 EOF
12180
12181                 ol_link_termcap=yes
12182                 TERMCAP_LIBS=-lncurses
12183         fi
12184 fi
12185
12186 if test $ol_link_termcap = no ; then
12187         cat >> confdefs.h <<\EOF
12188 #define NO_TERMCAP 1
12189 EOF
12190
12191         TERMCAP_LIBS=
12192 fi
12193
12194 ol_link_sasl=no
12195 if test $ol_with_cyrus_sasl != no ; then
12196         ac_safe=`echo "sasl.h" | sed 'y%./+-%__p_%'`
12197 echo $ac_n "checking for sasl.h""... $ac_c" 1>&6
12198 echo "configure:12199: checking for sasl.h" >&5
12199 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12200   echo $ac_n "(cached) $ac_c" 1>&6
12201 else
12202   cat > conftest.$ac_ext <<EOF
12203 #line 12204 "configure"
12204 #include "confdefs.h"
12205 #include <sasl.h>
12206 EOF
12207 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12208 { (eval echo configure:12209: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12209 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12210 if test -z "$ac_err"; then
12211   rm -rf conftest*
12212   eval "ac_cv_header_$ac_safe=yes"
12213 else
12214   echo "$ac_err" >&5
12215   echo "configure: failed program was:" >&5
12216   cat conftest.$ac_ext >&5
12217   rm -rf conftest*
12218   eval "ac_cv_header_$ac_safe=no"
12219 fi
12220 rm -f conftest*
12221 fi
12222 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12223   echo "$ac_t""yes" 1>&6
12224   :
12225 else
12226   echo "$ac_t""no" 1>&6
12227 fi
12228
12229
12230         if test $ac_cv_header_sasl_h = yes ; then
12231                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
12232 echo "configure:12233: checking for sasl_client_init in -lsasl" >&5
12233 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
12234 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12235   echo $ac_n "(cached) $ac_c" 1>&6
12236 else
12237   ac_save_LIBS="$LIBS"
12238 LIBS="-lsasl  $LIBS"
12239 cat > conftest.$ac_ext <<EOF
12240 #line 12241 "configure"
12241 #include "confdefs.h"
12242 /* Override any gcc2 internal prototype to avoid an error.  */
12243 /* We use char because int might match the return type of a gcc2
12244     builtin and then its argument prototype would still apply.  */
12245 char sasl_client_init();
12246
12247 int main() {
12248 sasl_client_init()
12249 ; return 0; }
12250 EOF
12251 if { (eval echo configure:12252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12252   rm -rf conftest*
12253   eval "ac_cv_lib_$ac_lib_var=yes"
12254 else
12255   echo "configure: failed program was:" >&5
12256   cat conftest.$ac_ext >&5
12257   rm -rf conftest*
12258   eval "ac_cv_lib_$ac_lib_var=no"
12259 fi
12260 rm -f conftest*
12261 LIBS="$ac_save_LIBS"
12262
12263 fi
12264 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12265   echo "$ac_t""yes" 1>&6
12266   have_cyrus_sasl=yes
12267 else
12268   echo "$ac_t""no" 1>&6
12269 have_cyrus_sasl=no
12270 fi
12271
12272
12273                 if test $have_cyrus_sasl != no ; then
12274                         SASL_LIBS="-lsasl"
12275                         cat >> confdefs.h <<\EOF
12276 #define HAVE_CYRUS_SASL 1
12277 EOF
12278
12279                         ol_link_sasl=yes
12280                 fi
12281         fi
12282
12283         if test $ol_link_sasl = no -a $ol_with_cyrus_sasl = yes ; then
12284                 { echo "configure: error: no suitable API for --with-cyrus-sasl=$ol_with_cyrus_sasl" 1>&2; exit 1; }
12285         fi
12286 fi
12287
12288 ol_link_fetch=no
12289 if test $ol_with_fetch != no ; then
12290         ol=$LIBS
12291 LIBS="-lfetch -lcom_err $LIBS"
12292 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
12293 echo "configure:12294: checking fetch(3) library" >&5
12294 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
12295   echo $ac_n "(cached) $ac_c" 1>&6
12296 else
12297   
12298         cat > conftest.$ac_ext <<EOF
12299 #line 12300 "configure"
12300 #include "confdefs.h"
12301
12302 #include <sys/param.h>
12303 #include <stdio.h>
12304 #include <fetch.h>
12305 int main() {
12306 struct url *u = fetchParseURL("file:///"); 
12307 ; return 0; }
12308 EOF
12309 if { (eval echo configure:12310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12310   rm -rf conftest*
12311   ol_cv_lib_fetch=yes
12312 else
12313   echo "configure: failed program was:" >&5
12314   cat conftest.$ac_ext >&5
12315   rm -rf conftest*
12316   ol_cv_lib_fetch=no
12317 fi
12318 rm -f conftest*
12319 fi
12320
12321 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
12322 LIBS=$ol_LIBS
12323 if test $ol_cv_lib_fetch != no ; then
12324         ol_link_fetch="-lfetch -lcom_err"
12325         cat >> confdefs.h <<\EOF
12326 #define HAVE_FETCH 1
12327 EOF
12328
12329 fi
12330
12331
12332         if test $ol_cv_lib_fetch != no ; then
12333                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
12334                 ol_link_fetch=freebsd
12335
12336         elif test $ol_with_fetch != auto ; then
12337                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
12338         fi 
12339 fi
12340
12341 ol_link_readline=no
12342 if test $ol_with_readline != no ; then
12343         for ac_hdr in readline/readline.h readline/history.h
12344 do
12345 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12346 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12347 echo "configure:12348: checking for $ac_hdr" >&5
12348 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12349   echo $ac_n "(cached) $ac_c" 1>&6
12350 else
12351   cat > conftest.$ac_ext <<EOF
12352 #line 12353 "configure"
12353 #include "confdefs.h"
12354 #include <$ac_hdr>
12355 EOF
12356 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12357 { (eval echo configure:12358: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12358 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12359 if test -z "$ac_err"; then
12360   rm -rf conftest*
12361   eval "ac_cv_header_$ac_safe=yes"
12362 else
12363   echo "$ac_err" >&5
12364   echo "configure: failed program was:" >&5
12365   cat conftest.$ac_ext >&5
12366   rm -rf conftest*
12367   eval "ac_cv_header_$ac_safe=no"
12368 fi
12369 rm -f conftest*
12370 fi
12371 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12372   echo "$ac_t""yes" 1>&6
12373     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12374   cat >> confdefs.h <<EOF
12375 #define $ac_tr_hdr 1
12376 EOF
12377  
12378 else
12379   echo "$ac_t""no" 1>&6
12380 fi
12381 done
12382
12383
12384         if test $ac_cv_header_readline_readline_h = yes ; then
12385                 save_LIBS="$LIBS"
12386                 LIBS="$TERMCAP_LIBS $LIBS"
12387                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
12388 echo "configure:12389: checking for readline in -lreadline" >&5
12389 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
12390 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12391   echo $ac_n "(cached) $ac_c" 1>&6
12392 else
12393   ac_save_LIBS="$LIBS"
12394 LIBS="-lreadline  $LIBS"
12395 cat > conftest.$ac_ext <<EOF
12396 #line 12397 "configure"
12397 #include "confdefs.h"
12398 /* Override any gcc2 internal prototype to avoid an error.  */
12399 /* We use char because int might match the return type of a gcc2
12400     builtin and then its argument prototype would still apply.  */
12401 char readline();
12402
12403 int main() {
12404 readline()
12405 ; return 0; }
12406 EOF
12407 if { (eval echo configure:12408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12408   rm -rf conftest*
12409   eval "ac_cv_lib_$ac_lib_var=yes"
12410 else
12411   echo "configure: failed program was:" >&5
12412   cat conftest.$ac_ext >&5
12413   rm -rf conftest*
12414   eval "ac_cv_lib_$ac_lib_var=no"
12415 fi
12416 rm -f conftest*
12417 LIBS="$ac_save_LIBS"
12418
12419 fi
12420 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12421   echo "$ac_t""yes" 1>&6
12422   have_readline=yes
12423 else
12424   echo "$ac_t""no" 1>&6
12425 have_readline=no
12426 fi
12427
12428                 LIBS="$save_LIBS"
12429                         
12430                 if test $have_readline = yes ; then
12431                         ol_with_readline=found
12432                         ol_link_readline=yes
12433
12434                         READLINE_LIBS="-lreadline"
12435                 fi
12436         fi
12437 fi
12438
12439 if test $ol_link_readline = yes ; then
12440         cat >> confdefs.h <<\EOF
12441 #define HAVE_READLINE 1
12442 EOF
12443
12444 fi
12445
12446
12447 if test $ol_enable_crypt != no ; then
12448         echo $ac_n "checking for crypt""... $ac_c" 1>&6
12449 echo "configure:12450: checking for crypt" >&5
12450 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
12451   echo $ac_n "(cached) $ac_c" 1>&6
12452 else
12453   cat > conftest.$ac_ext <<EOF
12454 #line 12455 "configure"
12455 #include "confdefs.h"
12456 /* System header to define __stub macros and hopefully few prototypes,
12457     which can conflict with char crypt(); below.  */
12458 #include <assert.h>
12459 /* Override any gcc2 internal prototype to avoid an error.  */
12460 /* We use char because int might match the return type of a gcc2
12461     builtin and then its argument prototype would still apply.  */
12462 char crypt();
12463 char (*f)();
12464
12465 int main() {
12466
12467 /* The GNU C library defines this for functions which it implements
12468     to always fail with ENOSYS.  Some functions are actually named
12469     something starting with __ and the normal name is an alias.  */
12470 #if defined (__stub_crypt) || defined (__stub___crypt)
12471 choke me
12472 #else
12473 f = crypt;
12474 #endif
12475
12476 ; return 0; }
12477 EOF
12478 if { (eval echo configure:12479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12479   rm -rf conftest*
12480   eval "ac_cv_func_crypt=yes"
12481 else
12482   echo "configure: failed program was:" >&5
12483   cat conftest.$ac_ext >&5
12484   rm -rf conftest*
12485   eval "ac_cv_func_crypt=no"
12486 fi
12487 rm -f conftest*
12488 fi
12489
12490 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
12491   echo "$ac_t""yes" 1>&6
12492   have_crypt=yes
12493 else
12494   echo "$ac_t""no" 1>&6
12495
12496                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
12497 echo "configure:12498: checking for crypt in -lcrypt" >&5
12498 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
12499 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12500   echo $ac_n "(cached) $ac_c" 1>&6
12501 else
12502   ac_save_LIBS="$LIBS"
12503 LIBS="-lcrypt  $LIBS"
12504 cat > conftest.$ac_ext <<EOF
12505 #line 12506 "configure"
12506 #include "confdefs.h"
12507 /* Override any gcc2 internal prototype to avoid an error.  */
12508 /* We use char because int might match the return type of a gcc2
12509     builtin and then its argument prototype would still apply.  */
12510 char crypt();
12511
12512 int main() {
12513 crypt()
12514 ; return 0; }
12515 EOF
12516 if { (eval echo configure:12517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12517   rm -rf conftest*
12518   eval "ac_cv_lib_$ac_lib_var=yes"
12519 else
12520   echo "configure: failed program was:" >&5
12521   cat conftest.$ac_ext >&5
12522   rm -rf conftest*
12523   eval "ac_cv_lib_$ac_lib_var=no"
12524 fi
12525 rm -f conftest*
12526 LIBS="$ac_save_LIBS"
12527
12528 fi
12529 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12530   echo "$ac_t""yes" 1>&6
12531   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
12532                         have_crypt=yes
12533 else
12534   echo "$ac_t""no" 1>&6
12535 have_crypt=no
12536 fi
12537
12538 fi
12539
12540
12541         if test $have_crypt = yes ; then
12542                 cat >> confdefs.h <<\EOF
12543 #define HAVE_CRYPT 1
12544 EOF
12545
12546         else
12547                 echo "configure: warning: could not find crypt" 1>&2
12548                 if test $ol_enable_crypt = yes ; then
12549                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
12550                 fi
12551
12552                 echo "configure: warning: disabling crypt support" 1>&2
12553                 ol_enable_crypt=no
12554         fi
12555 fi
12556
12557 if test $ol_enable_proctitle != no ; then
12558         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
12559 echo "configure:12560: checking for setproctitle" >&5
12560 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
12561   echo $ac_n "(cached) $ac_c" 1>&6
12562 else
12563   cat > conftest.$ac_ext <<EOF
12564 #line 12565 "configure"
12565 #include "confdefs.h"
12566 /* System header to define __stub macros and hopefully few prototypes,
12567     which can conflict with char setproctitle(); below.  */
12568 #include <assert.h>
12569 /* Override any gcc2 internal prototype to avoid an error.  */
12570 /* We use char because int might match the return type of a gcc2
12571     builtin and then its argument prototype would still apply.  */
12572 char setproctitle();
12573 char (*f)();
12574
12575 int main() {
12576
12577 /* The GNU C library defines this for functions which it implements
12578     to always fail with ENOSYS.  Some functions are actually named
12579     something starting with __ and the normal name is an alias.  */
12580 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
12581 choke me
12582 #else
12583 f = setproctitle;
12584 #endif
12585
12586 ; return 0; }
12587 EOF
12588 if { (eval echo configure:12589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12589   rm -rf conftest*
12590   eval "ac_cv_func_setproctitle=yes"
12591 else
12592   echo "configure: failed program was:" >&5
12593   cat conftest.$ac_ext >&5
12594   rm -rf conftest*
12595   eval "ac_cv_func_setproctitle=no"
12596 fi
12597 rm -f conftest*
12598 fi
12599
12600 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
12601   echo "$ac_t""yes" 1>&6
12602   have_setproctitle=yes
12603 else
12604   echo "$ac_t""no" 1>&6
12605
12606                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
12607 echo "configure:12608: checking for setproctitle in -lutil" >&5
12608 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
12609 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12610   echo $ac_n "(cached) $ac_c" 1>&6
12611 else
12612   ac_save_LIBS="$LIBS"
12613 LIBS="-lutil  $LIBS"
12614 cat > conftest.$ac_ext <<EOF
12615 #line 12616 "configure"
12616 #include "confdefs.h"
12617 /* Override any gcc2 internal prototype to avoid an error.  */
12618 /* We use char because int might match the return type of a gcc2
12619     builtin and then its argument prototype would still apply.  */
12620 char setproctitle();
12621
12622 int main() {
12623 setproctitle()
12624 ; return 0; }
12625 EOF
12626 if { (eval echo configure:12627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12627   rm -rf conftest*
12628   eval "ac_cv_lib_$ac_lib_var=yes"
12629 else
12630   echo "configure: failed program was:" >&5
12631   cat conftest.$ac_ext >&5
12632   rm -rf conftest*
12633   eval "ac_cv_lib_$ac_lib_var=no"
12634 fi
12635 rm -f conftest*
12636 LIBS="$ac_save_LIBS"
12637
12638 fi
12639 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12640   echo "$ac_t""yes" 1>&6
12641   have_setproctitle=yes
12642                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
12643 else
12644   echo "$ac_t""no" 1>&6
12645 have_setproctitle=no
12646                         LIBOBJS="$LIBOBJS setproctitle.o"
12647 fi
12648
12649 fi
12650
12651
12652         if test $have_setproctitle = yes ; then
12653                 cat >> confdefs.h <<\EOF
12654 #define HAVE_SETPROCTITLE 1
12655 EOF
12656
12657         fi
12658 fi
12659
12660 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
12661 echo "configure:12662: checking for uid_t in sys/types.h" >&5
12662 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
12663   echo $ac_n "(cached) $ac_c" 1>&6
12664 else
12665   cat > conftest.$ac_ext <<EOF
12666 #line 12667 "configure"
12667 #include "confdefs.h"
12668 #include <sys/types.h>
12669 EOF
12670 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12671   egrep "uid_t" >/dev/null 2>&1; then
12672   rm -rf conftest*
12673   ac_cv_type_uid_t=yes
12674 else
12675   rm -rf conftest*
12676   ac_cv_type_uid_t=no
12677 fi
12678 rm -f conftest*
12679
12680 fi
12681
12682 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
12683 if test $ac_cv_type_uid_t = no; then
12684   cat >> confdefs.h <<\EOF
12685 #define uid_t int
12686 EOF
12687
12688   cat >> confdefs.h <<\EOF
12689 #define gid_t int
12690 EOF
12691
12692 fi
12693
12694 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
12695 echo "configure:12696: checking type of array argument to getgroups" >&5
12696 if eval "test \"\${ac_cv_type_getgroups+set}\" = set"; then
12697   echo $ac_n "(cached) $ac_c" 1>&6
12698 else
12699   if test "$cross_compiling" = yes; then
12700   ac_cv_type_getgroups=cross
12701 else
12702   cat > conftest.$ac_ext <<EOF
12703 #line 12704 "configure"
12704 #include "confdefs.h"
12705
12706 /* Thanks to Mike Rendell for this test.  */
12707 #include <sys/types.h>
12708 #define NGID 256
12709 #undef MAX
12710 #define MAX(x, y) ((x) > (y) ? (x) : (y))
12711 main()
12712 {
12713   gid_t gidset[NGID];
12714   int i, n;
12715   union { gid_t gval; long lval; }  val;
12716
12717   val.lval = -1;
12718   for (i = 0; i < NGID; i++)
12719     gidset[i] = val.gval;
12720   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
12721                  gidset);
12722   /* Exit non-zero if getgroups seems to require an array of ints.  This
12723      happens when gid_t is short but getgroups modifies an array of ints.  */
12724   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
12725 }
12726
12727 EOF
12728 if { (eval echo configure:12729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12729 then
12730     ac_cv_type_getgroups=gid_t
12731 else
12732   echo "configure: failed program was:" >&5
12733   cat conftest.$ac_ext >&5
12734   rm -fr conftest*
12735   ac_cv_type_getgroups=int
12736 fi
12737 rm -fr conftest*
12738 fi
12739
12740 if test $ac_cv_type_getgroups = cross; then
12741         cat > conftest.$ac_ext <<EOF
12742 #line 12743 "configure"
12743 #include "confdefs.h"
12744 #include <unistd.h>
12745 EOF
12746 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12747   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
12748   rm -rf conftest*
12749   ac_cv_type_getgroups=gid_t
12750 else
12751   rm -rf conftest*
12752   ac_cv_type_getgroups=int
12753 fi
12754 rm -f conftest*
12755
12756 fi
12757 fi
12758
12759 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
12760 cat >> confdefs.h <<EOF
12761 #define GETGROUPS_T $ac_cv_type_getgroups
12762 EOF
12763
12764  echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
12765 echo "configure:12766: checking for ANSI C header files" >&5
12766 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
12767   echo $ac_n "(cached) $ac_c" 1>&6
12768 else
12769   cat > conftest.$ac_ext <<EOF
12770 #line 12771 "configure"
12771 #include "confdefs.h"
12772 #include <stdlib.h>
12773 #include <stdarg.h>
12774 #include <string.h>
12775 #include <float.h>
12776 EOF
12777 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12778 { (eval echo configure:12779: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12779 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12780 if test -z "$ac_err"; then
12781   rm -rf conftest*
12782   ac_cv_header_stdc=yes
12783 else
12784   echo "$ac_err" >&5
12785   echo "configure: failed program was:" >&5
12786   cat conftest.$ac_ext >&5
12787   rm -rf conftest*
12788   ac_cv_header_stdc=no
12789 fi
12790 rm -f conftest*
12791
12792 if test $ac_cv_header_stdc = yes; then
12793   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
12794 cat > conftest.$ac_ext <<EOF
12795 #line 12796 "configure"
12796 #include "confdefs.h"
12797 #include <string.h>
12798 EOF
12799 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12800   egrep "memchr" >/dev/null 2>&1; then
12801   :
12802 else
12803   rm -rf conftest*
12804   ac_cv_header_stdc=no
12805 fi
12806 rm -f conftest*
12807
12808 fi
12809
12810 if test $ac_cv_header_stdc = yes; then
12811   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
12812 cat > conftest.$ac_ext <<EOF
12813 #line 12814 "configure"
12814 #include "confdefs.h"
12815 #include <stdlib.h>
12816 EOF
12817 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12818   egrep "free" >/dev/null 2>&1; then
12819   :
12820 else
12821   rm -rf conftest*
12822   ac_cv_header_stdc=no
12823 fi
12824 rm -f conftest*
12825
12826 fi
12827
12828 if test $ac_cv_header_stdc = yes; then
12829   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
12830 if test "$cross_compiling" = yes; then
12831   :
12832 else
12833   cat > conftest.$ac_ext <<EOF
12834 #line 12835 "configure"
12835 #include "confdefs.h"
12836 #include <ctype.h>
12837 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
12838 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
12839 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
12840 int main () { int i; for (i = 0; i < 256; i++)
12841 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
12842 exit (0); }
12843
12844 EOF
12845 if { (eval echo configure:12846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12846 then
12847   :
12848 else
12849   echo "configure: failed program was:" >&5
12850   cat conftest.$ac_ext >&5
12851   rm -fr conftest*
12852   ac_cv_header_stdc=no
12853 fi
12854 rm -fr conftest*
12855 fi
12856
12857 fi
12858 fi
12859
12860 echo "$ac_t""$ac_cv_header_stdc" 1>&6
12861 if test $ac_cv_header_stdc = yes; then
12862   cat >> confdefs.h <<\EOF
12863 #define STDC_HEADERS 1
12864 EOF
12865
12866 fi
12867
12868 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
12869 echo "configure:12870: checking for mode_t" >&5
12870 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
12871   echo $ac_n "(cached) $ac_c" 1>&6
12872 else
12873   cat > conftest.$ac_ext <<EOF
12874 #line 12875 "configure"
12875 #include "confdefs.h"
12876 #include <sys/types.h>
12877 #if STDC_HEADERS
12878 #include <stdlib.h>
12879 #include <stddef.h>
12880 #endif
12881 EOF
12882 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12883   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
12884   rm -rf conftest*
12885   eval "ac_cv_type_mode_t=yes"
12886 else
12887   rm -rf conftest*
12888   eval "ac_cv_type_mode_t=no"
12889 fi
12890 rm -f conftest*
12891
12892 fi
12893 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
12894   echo "$ac_t""yes" 1>&6
12895 else
12896   echo "$ac_t""no" 1>&6
12897   cat >> confdefs.h <<EOF
12898 #define mode_t int
12899 EOF
12900
12901 fi
12902
12903 echo $ac_n "checking for off_t""... $ac_c" 1>&6
12904 echo "configure:12905: checking for off_t" >&5
12905 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
12906   echo $ac_n "(cached) $ac_c" 1>&6
12907 else
12908   cat > conftest.$ac_ext <<EOF
12909 #line 12910 "configure"
12910 #include "confdefs.h"
12911 #include <sys/types.h>
12912 #if STDC_HEADERS
12913 #include <stdlib.h>
12914 #include <stddef.h>
12915 #endif
12916 EOF
12917 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12918   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
12919   rm -rf conftest*
12920   eval "ac_cv_type_off_t=yes"
12921 else
12922   rm -rf conftest*
12923   eval "ac_cv_type_off_t=no"
12924 fi
12925 rm -f conftest*
12926
12927 fi
12928 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
12929   echo "$ac_t""yes" 1>&6
12930 else
12931   echo "$ac_t""no" 1>&6
12932   cat >> confdefs.h <<EOF
12933 #define off_t long
12934 EOF
12935
12936 fi
12937
12938 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
12939 echo "configure:12940: checking for pid_t" >&5
12940 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
12941   echo $ac_n "(cached) $ac_c" 1>&6
12942 else
12943   cat > conftest.$ac_ext <<EOF
12944 #line 12945 "configure"
12945 #include "confdefs.h"
12946 #include <sys/types.h>
12947 #if STDC_HEADERS
12948 #include <stdlib.h>
12949 #include <stddef.h>
12950 #endif
12951 EOF
12952 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12953   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
12954   rm -rf conftest*
12955   eval "ac_cv_type_pid_t=yes"
12956 else
12957   rm -rf conftest*
12958   eval "ac_cv_type_pid_t=no"
12959 fi
12960 rm -f conftest*
12961
12962 fi
12963 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
12964   echo "$ac_t""yes" 1>&6
12965 else
12966   echo "$ac_t""no" 1>&6
12967   cat >> confdefs.h <<EOF
12968 #define pid_t int
12969 EOF
12970
12971 fi
12972
12973 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
12974 echo "configure:12975: checking for ptrdiff_t" >&5
12975 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
12976   echo $ac_n "(cached) $ac_c" 1>&6
12977 else
12978   cat > conftest.$ac_ext <<EOF
12979 #line 12980 "configure"
12980 #include "confdefs.h"
12981 #include <stddef.h>
12982 int main() {
12983 ptrdiff_t p
12984 ; return 0; }
12985 EOF
12986 if { (eval echo configure:12987: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12987   rm -rf conftest*
12988   am_cv_type_ptrdiff_t=yes
12989 else
12990   echo "configure: failed program was:" >&5
12991   cat conftest.$ac_ext >&5
12992   rm -rf conftest*
12993   am_cv_type_ptrdiff_t=no
12994 fi
12995 rm -f conftest*
12996 fi
12997
12998 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
12999    if test $am_cv_type_ptrdiff_t = yes; then
13000      cat >> confdefs.h <<\EOF
13001 #define HAVE_PTRDIFF_T 1
13002 EOF
13003
13004    fi
13005
13006 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
13007 echo "configure:13008: checking return type of signal handlers" >&5
13008 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
13009   echo $ac_n "(cached) $ac_c" 1>&6
13010 else
13011   cat > conftest.$ac_ext <<EOF
13012 #line 13013 "configure"
13013 #include "confdefs.h"
13014 #include <sys/types.h>
13015 #include <signal.h>
13016 #ifdef signal
13017 #undef signal
13018 #endif
13019 #ifdef __cplusplus
13020 extern "C" void (*signal (int, void (*)(int)))(int);
13021 #else
13022 void (*signal ()) ();
13023 #endif
13024
13025 int main() {
13026 int i;
13027 ; return 0; }
13028 EOF
13029 if { (eval echo configure:13030: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13030   rm -rf conftest*
13031   ac_cv_type_signal=void
13032 else
13033   echo "configure: failed program was:" >&5
13034   cat conftest.$ac_ext >&5
13035   rm -rf conftest*
13036   ac_cv_type_signal=int
13037 fi
13038 rm -f conftest*
13039 fi
13040
13041 echo "$ac_t""$ac_cv_type_signal" 1>&6
13042 cat >> confdefs.h <<EOF
13043 #define RETSIGTYPE $ac_cv_type_signal
13044 EOF
13045
13046
13047 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
13048 echo "configure:13049: checking for sig_atomic_t" >&5
13049 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
13050   echo $ac_n "(cached) $ac_c" 1>&6
13051 else
13052   cat > conftest.$ac_ext <<EOF
13053 #line 13054 "configure"
13054 #include "confdefs.h"
13055 #include <signal.h>
13056 int main() {
13057 sig_atomic_t atomic;
13058 ; return 0; }
13059 EOF
13060 if { (eval echo configure:13061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13061   rm -rf conftest*
13062   ol_cv_type_sig_atomic_t=yes
13063 else
13064   echo "configure: failed program was:" >&5
13065   cat conftest.$ac_ext >&5
13066   rm -rf conftest*
13067   ol_cv_type_sig_atomic_t=no
13068 fi
13069 rm -f conftest*
13070 fi
13071
13072 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
13073   if test $ol_cv_type_sig_atomic_t = no; then
13074     cat >> confdefs.h <<\EOF
13075 #define sig_atomic_t int
13076 EOF
13077
13078   fi
13079  
13080 echo $ac_n "checking for size_t""... $ac_c" 1>&6
13081 echo "configure:13082: checking for size_t" >&5
13082 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
13083   echo $ac_n "(cached) $ac_c" 1>&6
13084 else
13085   cat > conftest.$ac_ext <<EOF
13086 #line 13087 "configure"
13087 #include "confdefs.h"
13088 #include <sys/types.h>
13089 #if STDC_HEADERS
13090 #include <stdlib.h>
13091 #include <stddef.h>
13092 #endif
13093 EOF
13094 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13095   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
13096   rm -rf conftest*
13097   eval "ac_cv_type_size_t=yes"
13098 else
13099   rm -rf conftest*
13100   eval "ac_cv_type_size_t=no"
13101 fi
13102 rm -f conftest*
13103
13104 fi
13105 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
13106   echo "$ac_t""yes" 1>&6
13107 else
13108   echo "$ac_t""no" 1>&6
13109   cat >> confdefs.h <<EOF
13110 #define size_t unsigned
13111 EOF
13112
13113 fi
13114
13115 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
13116 echo "configure:13117: checking for socklen_t" >&5
13117 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
13118   echo $ac_n "(cached) $ac_c" 1>&6
13119 else
13120   cat > conftest.$ac_ext <<EOF
13121 #line 13122 "configure"
13122 #include "confdefs.h"
13123
13124 #ifdef HAVE_SYS_TYPES_H
13125 #include <sys/types.h>
13126 #endif
13127 #ifdef HAVE_SYS_SOCKET_H
13128 #include <sys/socket.h>
13129 #endif
13130
13131 int main() {
13132 socklen_t len;
13133 ; return 0; }
13134 EOF
13135 if { (eval echo configure:13136: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13136   rm -rf conftest*
13137   ol_cv_type_socklen_t=yes
13138 else
13139   echo "configure: failed program was:" >&5
13140   cat conftest.$ac_ext >&5
13141   rm -rf conftest*
13142   ol_cv_type_socklen_t=no
13143 fi
13144 rm -f conftest*
13145 fi
13146
13147 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
13148   if test $ol_cv_type_socklen_t = no; then
13149     cat >> confdefs.h <<\EOF
13150 #define socklen_t int
13151 EOF
13152
13153   fi
13154  
13155 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
13156 echo "configure:13157: checking for member st_blksize in aggregate type struct stat" >&5
13157 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
13158   echo $ac_n "(cached) $ac_c" 1>&6
13159 else
13160   cat > conftest.$ac_ext <<EOF
13161 #line 13162 "configure"
13162 #include "confdefs.h"
13163 #include <sys/types.h>
13164 #include <sys/stat.h>
13165 int main() {
13166 struct stat foo; foo.st_blksize;
13167 ; return 0; }
13168 EOF
13169 if { (eval echo configure:13170: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13170   rm -rf conftest*
13171   ac_cv_c_struct_member_st_blksize=yes
13172 else
13173   echo "configure: failed program was:" >&5
13174   cat conftest.$ac_ext >&5
13175   rm -rf conftest*
13176   ac_cv_c_struct_member_st_blksize=no
13177 fi
13178 rm -f conftest*
13179 fi
13180
13181 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
13182 st_blksize="$ac_cv_c_struct_member_st_blksize"
13183 if test $ac_cv_c_struct_member_st_blksize = yes; then
13184   cat >> confdefs.h <<\EOF
13185 #define HAVE_ST_BLKSIZE 1
13186 EOF
13187
13188 fi
13189
13190 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
13191 echo "configure:13192: checking whether time.h and sys/time.h may both be included" >&5
13192 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
13193   echo $ac_n "(cached) $ac_c" 1>&6
13194 else
13195   cat > conftest.$ac_ext <<EOF
13196 #line 13197 "configure"
13197 #include "confdefs.h"
13198 #include <sys/types.h>
13199 #include <sys/time.h>
13200 #include <time.h>
13201 int main() {
13202 struct tm *tp;
13203 ; return 0; }
13204 EOF
13205 if { (eval echo configure:13206: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13206   rm -rf conftest*
13207   ac_cv_header_time=yes
13208 else
13209   echo "configure: failed program was:" >&5
13210   cat conftest.$ac_ext >&5
13211   rm -rf conftest*
13212   ac_cv_header_time=no
13213 fi
13214 rm -f conftest*
13215 fi
13216
13217 echo "$ac_t""$ac_cv_header_time" 1>&6
13218 if test $ac_cv_header_time = yes; then
13219   cat >> confdefs.h <<\EOF
13220 #define TIME_WITH_SYS_TIME 1
13221 EOF
13222
13223 fi
13224
13225 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
13226 echo "configure:13227: checking whether struct tm is in sys/time.h or time.h" >&5
13227 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
13228   echo $ac_n "(cached) $ac_c" 1>&6
13229 else
13230   cat > conftest.$ac_ext <<EOF
13231 #line 13232 "configure"
13232 #include "confdefs.h"
13233 #include <sys/types.h>
13234 #include <time.h>
13235 int main() {
13236 struct tm *tp; tp->tm_sec;
13237 ; return 0; }
13238 EOF
13239 if { (eval echo configure:13240: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13240   rm -rf conftest*
13241   ac_cv_struct_tm=time.h
13242 else
13243   echo "configure: failed program was:" >&5
13244   cat conftest.$ac_ext >&5
13245   rm -rf conftest*
13246   ac_cv_struct_tm=sys/time.h
13247 fi
13248 rm -f conftest*
13249 fi
13250
13251 echo "$ac_t""$ac_cv_struct_tm" 1>&6
13252 if test $ac_cv_struct_tm = sys/time.h; then
13253   cat >> confdefs.h <<\EOF
13254 #define TM_IN_SYS_TIME 1
13255 EOF
13256
13257 fi
13258
13259 # test for pw_gecos in struct passwd
13260 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
13261 echo "configure:13262: checking struct passwd for pw_gecos" >&5
13262 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
13263   echo $ac_n "(cached) $ac_c" 1>&6
13264 else
13265   
13266         cat > conftest.$ac_ext <<EOF
13267 #line 13268 "configure"
13268 #include "confdefs.h"
13269 #include <pwd.h>
13270 int main() {
13271
13272         struct passwd pwd;
13273         pwd.pw_gecos = pwd.pw_name;
13274
13275 ; return 0; }
13276 EOF
13277 if { (eval echo configure:13278: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13278   rm -rf conftest*
13279   ol_cv_struct_passwd_pw_gecos=yes
13280 else
13281   echo "configure: failed program was:" >&5
13282   cat conftest.$ac_ext >&5
13283   rm -rf conftest*
13284   ol_cv_struct_passwd_pw_gecos=no
13285 fi
13286 rm -f conftest*
13287 fi
13288
13289 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
13290 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
13291         cat >> confdefs.h <<\EOF
13292 #define HAVE_PW_GECOS 1
13293 EOF
13294
13295 fi
13296
13297 # test for pw_passwd in struct passwd
13298 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
13299 echo "configure:13300: checking struct passwd for pw_passwd" >&5
13300 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
13301   echo $ac_n "(cached) $ac_c" 1>&6
13302 else
13303   
13304         cat > conftest.$ac_ext <<EOF
13305 #line 13306 "configure"
13306 #include "confdefs.h"
13307 #include <pwd.h>
13308 int main() {
13309
13310         struct passwd pwd;
13311         pwd.pw_passwd = pwd.pw_name;
13312
13313 ; return 0; }
13314 EOF
13315 if { (eval echo configure:13316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13316   rm -rf conftest*
13317   ol_cv_struct_passwd_pw_passwd=yes
13318 else
13319   echo "configure: failed program was:" >&5
13320   cat conftest.$ac_ext >&5
13321   rm -rf conftest*
13322   ol_cv_struct_passwd_pw_passwd=no
13323 fi
13324 rm -f conftest*
13325 fi
13326
13327 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
13328 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
13329         cat >> confdefs.h <<\EOF
13330 #define HAVE_PW_PASSWD 1
13331 EOF
13332
13333 fi
13334
13335
13336 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
13337 echo "configure:13338: checking if toupper() requires islower()" >&5
13338 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
13339   echo $ac_n "(cached) $ac_c" 1>&6
13340 else
13341   
13342         if test "$cross_compiling" = yes; then
13343   ol_cv_c_upper_lower=safe
13344 else
13345   cat > conftest.$ac_ext <<EOF
13346 #line 13347 "configure"
13347 #include "confdefs.h"
13348
13349 #include <ctype.h>
13350 main()
13351 {
13352         if ('C' == toupper('C'))
13353                 exit(0);
13354         else
13355                 exit(1);
13356 }
13357 EOF
13358 if { (eval echo configure:13359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13359 then
13360   ol_cv_c_upper_lower=no
13361 else
13362   echo "configure: failed program was:" >&5
13363   cat conftest.$ac_ext >&5
13364   rm -fr conftest*
13365   ol_cv_c_upper_lower=yes
13366 fi
13367 rm -fr conftest*
13368 fi
13369
13370 fi
13371
13372 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
13373 if test $ol_cv_c_upper_lower != no ; then
13374         cat >> confdefs.h <<\EOF
13375 #define C_UPPER_LOWER 1
13376 EOF
13377
13378 fi
13379
13380 echo $ac_n "checking for working const""... $ac_c" 1>&6
13381 echo "configure:13382: checking for working const" >&5
13382 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
13383   echo $ac_n "(cached) $ac_c" 1>&6
13384 else
13385   cat > conftest.$ac_ext <<EOF
13386 #line 13387 "configure"
13387 #include "confdefs.h"
13388
13389 int main() {
13390
13391 /* Ultrix mips cc rejects this.  */
13392 typedef int charset[2]; const charset x;
13393 /* SunOS 4.1.1 cc rejects this.  */
13394 char const *const *ccp;
13395 char **p;
13396 /* NEC SVR4.0.2 mips cc rejects this.  */
13397 struct point {int x, y;};
13398 static struct point const zero = {0,0};
13399 /* AIX XL C 1.02.0.0 rejects this.
13400    It does not let you subtract one const X* pointer from another in an arm
13401    of an if-expression whose if-part is not a constant expression */
13402 const char *g = "string";
13403 ccp = &g + (g ? g-g : 0);
13404 /* HPUX 7.0 cc rejects these. */
13405 ++ccp;
13406 p = (char**) ccp;
13407 ccp = (char const *const *) p;
13408 { /* SCO 3.2v4 cc rejects this.  */
13409   char *t;
13410   char const *s = 0 ? (char *) 0 : (char const *) 0;
13411
13412   *t++ = 0;
13413 }
13414 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
13415   int x[] = {25, 17};
13416   const int *foo = &x[0];
13417   ++foo;
13418 }
13419 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
13420   typedef const int *iptr;
13421   iptr p = 0;
13422   ++p;
13423 }
13424 { /* AIX XL C 1.02.0.0 rejects this saying
13425      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
13426   struct s { int j; const int *ap[3]; };
13427   struct s *b; b->j = 5;
13428 }
13429 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
13430   const int foo = 10;
13431 }
13432
13433 ; return 0; }
13434 EOF
13435 if { (eval echo configure:13436: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13436   rm -rf conftest*
13437   ac_cv_c_const=yes
13438 else
13439   echo "configure: failed program was:" >&5
13440   cat conftest.$ac_ext >&5
13441   rm -rf conftest*
13442   ac_cv_c_const=no
13443 fi
13444 rm -f conftest*
13445 fi
13446
13447 echo "$ac_t""$ac_cv_c_const" 1>&6
13448 if test $ac_cv_c_const = no; then
13449   cat >> confdefs.h <<\EOF
13450 #define const 
13451 EOF
13452
13453 fi
13454
13455 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
13456 echo "configure:13457: checking if compiler understands volatile" >&5
13457 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
13458   echo $ac_n "(cached) $ac_c" 1>&6
13459 else
13460   cat > conftest.$ac_ext <<EOF
13461 #line 13462 "configure"
13462 #include "confdefs.h"
13463 int x, y, z;
13464 int main() {
13465 volatile int a; int * volatile b = x ? &y : &z;
13466       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
13467       *b = 0;
13468 ; return 0; }
13469 EOF
13470 if { (eval echo configure:13471: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13471   rm -rf conftest*
13472   ol_cv_c_volatile=yes
13473 else
13474   echo "configure: failed program was:" >&5
13475   cat conftest.$ac_ext >&5
13476   rm -rf conftest*
13477   ol_cv_c_volatile=no
13478 fi
13479 rm -f conftest*
13480 fi
13481
13482 echo "$ac_t""$ol_cv_c_volatile" 1>&6
13483   if test $ol_cv_c_volatile = yes; then
13484     : 
13485   else
13486     cat >> confdefs.h <<\EOF
13487 #define volatile 
13488 EOF
13489
13490   fi
13491  
13492
13493 if test $cross_compiling = yes ; then
13494         cat >> confdefs.h <<\EOF
13495 #define CROSS_COMPILING 1
13496 EOF
13497
13498
13499         cat >> confdefs.h <<\EOF
13500 #define LBER_INT_T long
13501 EOF
13502
13503         cat >> confdefs.h <<\EOF
13504 #define LBER_TAG_T long
13505 EOF
13506
13507         cat >> confdefs.h <<\EOF
13508 #define LBER_SOCKET_T int
13509 EOF
13510
13511
13512 else
13513         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
13514 echo "configure:13515: checking whether byte ordering is bigendian" >&5
13515 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
13516   echo $ac_n "(cached) $ac_c" 1>&6
13517 else
13518   ac_cv_c_bigendian=unknown
13519 # See if sys/param.h defines the BYTE_ORDER macro.
13520 cat > conftest.$ac_ext <<EOF
13521 #line 13522 "configure"
13522 #include "confdefs.h"
13523 #include <sys/types.h>
13524 #include <sys/param.h>
13525 int main() {
13526
13527 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
13528  bogus endian macros
13529 #endif
13530 ; return 0; }
13531 EOF
13532 if { (eval echo configure:13533: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13533   rm -rf conftest*
13534   # It does; now see whether it defined to BIG_ENDIAN or not.
13535 cat > conftest.$ac_ext <<EOF
13536 #line 13537 "configure"
13537 #include "confdefs.h"
13538 #include <sys/types.h>
13539 #include <sys/param.h>
13540 int main() {
13541
13542 #if BYTE_ORDER != BIG_ENDIAN
13543  not big endian
13544 #endif
13545 ; return 0; }
13546 EOF
13547 if { (eval echo configure:13548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13548   rm -rf conftest*
13549   ac_cv_c_bigendian=yes
13550 else
13551   echo "configure: failed program was:" >&5
13552   cat conftest.$ac_ext >&5
13553   rm -rf conftest*
13554   ac_cv_c_bigendian=no
13555 fi
13556 rm -f conftest*
13557 else
13558   echo "configure: failed program was:" >&5
13559   cat conftest.$ac_ext >&5
13560 fi
13561 rm -f conftest*
13562 if test $ac_cv_c_bigendian = unknown; then
13563 if test "$cross_compiling" = yes; then
13564     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
13565 else
13566   cat > conftest.$ac_ext <<EOF
13567 #line 13568 "configure"
13568 #include "confdefs.h"
13569 main () {
13570   /* Are we little or big endian?  From Harbison&Steele.  */
13571   union
13572   {
13573     long l;
13574     char c[sizeof (long)];
13575   } u;
13576   u.l = 1;
13577   exit (u.c[sizeof (long) - 1] == 1);
13578 }
13579 EOF
13580 if { (eval echo configure:13581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13581 then
13582   ac_cv_c_bigendian=no
13583 else
13584   echo "configure: failed program was:" >&5
13585   cat conftest.$ac_ext >&5
13586   rm -fr conftest*
13587   ac_cv_c_bigendian=yes
13588 fi
13589 rm -fr conftest*
13590 fi
13591
13592 fi
13593 fi
13594
13595 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
13596 if test $ac_cv_c_bigendian = yes; then
13597   cat >> confdefs.h <<\EOF
13598 #define WORDS_BIGENDIAN 1
13599 EOF
13600
13601 fi
13602
13603         echo $ac_n "checking size of short""... $ac_c" 1>&6
13604 echo "configure:13605: checking size of short" >&5
13605 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
13606   echo $ac_n "(cached) $ac_c" 1>&6
13607 else
13608   if test "$cross_compiling" = yes; then
13609     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
13610 else
13611   cat > conftest.$ac_ext <<EOF
13612 #line 13613 "configure"
13613 #include "confdefs.h"
13614 #include <stdio.h>
13615 main()
13616 {
13617   FILE *f=fopen("conftestval", "w");
13618   if (!f) exit(1);
13619   fprintf(f, "%d\n", sizeof(short));
13620   exit(0);
13621 }
13622 EOF
13623 if { (eval echo configure:13624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13624 then
13625   ac_cv_sizeof_short=`cat conftestval`
13626 else
13627   echo "configure: failed program was:" >&5
13628   cat conftest.$ac_ext >&5
13629   rm -fr conftest*
13630   ac_cv_sizeof_short=0
13631 fi
13632 rm -fr conftest*
13633 fi
13634
13635 fi
13636 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
13637 cat >> confdefs.h <<EOF
13638 #define SIZEOF_SHORT $ac_cv_sizeof_short
13639 EOF
13640
13641  
13642         echo $ac_n "checking size of int""... $ac_c" 1>&6
13643 echo "configure:13644: checking size of int" >&5
13644 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
13645   echo $ac_n "(cached) $ac_c" 1>&6
13646 else
13647   if test "$cross_compiling" = yes; then
13648     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
13649 else
13650   cat > conftest.$ac_ext <<EOF
13651 #line 13652 "configure"
13652 #include "confdefs.h"
13653 #include <stdio.h>
13654 main()
13655 {
13656   FILE *f=fopen("conftestval", "w");
13657   if (!f) exit(1);
13658   fprintf(f, "%d\n", sizeof(int));
13659   exit(0);
13660 }
13661 EOF
13662 if { (eval echo configure:13663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13663 then
13664   ac_cv_sizeof_int=`cat conftestval`
13665 else
13666   echo "configure: failed program was:" >&5
13667   cat conftest.$ac_ext >&5
13668   rm -fr conftest*
13669   ac_cv_sizeof_int=0
13670 fi
13671 rm -fr conftest*
13672 fi
13673
13674 fi
13675 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
13676 cat >> confdefs.h <<EOF
13677 #define SIZEOF_INT $ac_cv_sizeof_int
13678 EOF
13679
13680  
13681         echo $ac_n "checking size of long""... $ac_c" 1>&6
13682 echo "configure:13683: checking size of long" >&5
13683 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
13684   echo $ac_n "(cached) $ac_c" 1>&6
13685 else
13686   if test "$cross_compiling" = yes; then
13687     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
13688 else
13689   cat > conftest.$ac_ext <<EOF
13690 #line 13691 "configure"
13691 #include "confdefs.h"
13692 #include <stdio.h>
13693 main()
13694 {
13695   FILE *f=fopen("conftestval", "w");
13696   if (!f) exit(1);
13697   fprintf(f, "%d\n", sizeof(long));
13698   exit(0);
13699 }
13700 EOF
13701 if { (eval echo configure:13702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13702 then
13703   ac_cv_sizeof_long=`cat conftestval`
13704 else
13705   echo "configure: failed program was:" >&5
13706   cat conftest.$ac_ext >&5
13707   rm -fr conftest*
13708   ac_cv_sizeof_long=0
13709 fi
13710 rm -fr conftest*
13711 fi
13712
13713 fi
13714 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
13715 cat >> confdefs.h <<EOF
13716 #define SIZEOF_LONG $ac_cv_sizeof_long
13717 EOF
13718
13719
13720
13721         if test "$ac_cv_sizeof_int" -lt 4 ; then
13722                 echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
13723
13724                 cat >> confdefs.h <<\EOF
13725 #define LBER_INT_T long
13726 EOF
13727
13728                 cat >> confdefs.h <<\EOF
13729 #define LBER_TAG_T long
13730 EOF
13731
13732                 cat >> confdefs.h <<\EOF
13733 #define LBER_SOCKET_T int
13734 EOF
13735
13736         else
13737                 cat >> confdefs.h <<\EOF
13738 #define LBER_INT_T int
13739 EOF
13740
13741                 cat >> confdefs.h <<\EOF
13742 #define LBER_TAG_T long
13743 EOF
13744
13745                 cat >> confdefs.h <<\EOF
13746 #define LBER_SOCKET_T int
13747 EOF
13748
13749         fi
13750 fi
13751
13752 cat >> confdefs.h <<\EOF
13753 #define LBER_LEN_T long
13754 EOF
13755
13756
13757 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
13758 echo "configure:13759: checking for 8-bit clean memcmp" >&5
13759 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
13760   echo $ac_n "(cached) $ac_c" 1>&6
13761 else
13762   if test "$cross_compiling" = yes; then
13763   ac_cv_func_memcmp_clean=no
13764 else
13765   cat > conftest.$ac_ext <<EOF
13766 #line 13767 "configure"
13767 #include "confdefs.h"
13768
13769 main()
13770 {
13771   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
13772   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
13773 }
13774
13775 EOF
13776 if { (eval echo configure:13777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13777 then
13778   ac_cv_func_memcmp_clean=yes
13779 else
13780   echo "configure: failed program was:" >&5
13781   cat conftest.$ac_ext >&5
13782   rm -fr conftest*
13783   ac_cv_func_memcmp_clean=no
13784 fi
13785 rm -fr conftest*
13786 fi
13787
13788 fi
13789
13790 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
13791 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
13792
13793 echo $ac_n "checking for strftime""... $ac_c" 1>&6
13794 echo "configure:13795: checking for strftime" >&5
13795 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
13796   echo $ac_n "(cached) $ac_c" 1>&6
13797 else
13798   cat > conftest.$ac_ext <<EOF
13799 #line 13800 "configure"
13800 #include "confdefs.h"
13801 /* System header to define __stub macros and hopefully few prototypes,
13802     which can conflict with char strftime(); below.  */
13803 #include <assert.h>
13804 /* Override any gcc2 internal prototype to avoid an error.  */
13805 /* We use char because int might match the return type of a gcc2
13806     builtin and then its argument prototype would still apply.  */
13807 char strftime();
13808 char (*f)();
13809
13810 int main() {
13811
13812 /* The GNU C library defines this for functions which it implements
13813     to always fail with ENOSYS.  Some functions are actually named
13814     something starting with __ and the normal name is an alias.  */
13815 #if defined (__stub_strftime) || defined (__stub___strftime)
13816 choke me
13817 #else
13818 f = strftime;
13819 #endif
13820
13821 ; return 0; }
13822 EOF
13823 if { (eval echo configure:13824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13824   rm -rf conftest*
13825   eval "ac_cv_func_strftime=yes"
13826 else
13827   echo "configure: failed program was:" >&5
13828   cat conftest.$ac_ext >&5
13829   rm -rf conftest*
13830   eval "ac_cv_func_strftime=no"
13831 fi
13832 rm -f conftest*
13833 fi
13834
13835 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
13836   echo "$ac_t""yes" 1>&6
13837   cat >> confdefs.h <<\EOF
13838 #define HAVE_STRFTIME 1
13839 EOF
13840
13841 else
13842   echo "$ac_t""no" 1>&6
13843 # strftime is in -lintl on SCO UNIX.
13844 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
13845 echo "configure:13846: checking for strftime in -lintl" >&5
13846 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
13847 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13848   echo $ac_n "(cached) $ac_c" 1>&6
13849 else
13850   ac_save_LIBS="$LIBS"
13851 LIBS="-lintl  $LIBS"
13852 cat > conftest.$ac_ext <<EOF
13853 #line 13854 "configure"
13854 #include "confdefs.h"
13855 /* Override any gcc2 internal prototype to avoid an error.  */
13856 /* We use char because int might match the return type of a gcc2
13857     builtin and then its argument prototype would still apply.  */
13858 char strftime();
13859
13860 int main() {
13861 strftime()
13862 ; return 0; }
13863 EOF
13864 if { (eval echo configure:13865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13865   rm -rf conftest*
13866   eval "ac_cv_lib_$ac_lib_var=yes"
13867 else
13868   echo "configure: failed program was:" >&5
13869   cat conftest.$ac_ext >&5
13870   rm -rf conftest*
13871   eval "ac_cv_lib_$ac_lib_var=no"
13872 fi
13873 rm -f conftest*
13874 LIBS="$ac_save_LIBS"
13875
13876 fi
13877 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13878   echo "$ac_t""yes" 1>&6
13879   cat >> confdefs.h <<\EOF
13880 #define HAVE_STRFTIME 1
13881 EOF
13882
13883 LIBS="-lintl $LIBS"
13884 else
13885   echo "$ac_t""no" 1>&6
13886 fi
13887
13888 fi
13889
13890
13891 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
13892 echo "configure:13893: checking for inet_aton()" >&5
13893 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
13894   echo $ac_n "(cached) $ac_c" 1>&6
13895 else
13896   cat > conftest.$ac_ext <<EOF
13897 #line 13898 "configure"
13898 #include "confdefs.h"
13899
13900 #ifdef HAVE_SYS_TYPES_H
13901 #       include <sys/types.h>
13902 #endif
13903 #ifdef HAVE_SYS_SOCKET_H
13904 #       include <sys/socket.h>
13905 #       ifdef HAVE_SYS_SELECT_H
13906 #               include <sys/select.h>
13907 #       endif
13908 #       include <netinet/in.h>
13909 #       ifdef HAVE_ARPA_INET_H
13910 #               include <arpa/inet.h>
13911 #       endif
13912 #endif
13913
13914 int main() {
13915 struct in_addr in;
13916 int rc = inet_aton( "255.255.255.255", &in );
13917 ; return 0; }
13918 EOF
13919 if { (eval echo configure:13920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13920   rm -rf conftest*
13921   ol_cv_func_inet_aton=yes
13922 else
13923   echo "configure: failed program was:" >&5
13924   cat conftest.$ac_ext >&5
13925   rm -rf conftest*
13926   ol_cv_func_inet_aton=no
13927 fi
13928 rm -f conftest*
13929 fi
13930
13931 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
13932   if test $ol_cv_func_inet_aton != no; then
13933     cat >> confdefs.h <<\EOF
13934 #define HAVE_INET_ATON 1
13935 EOF
13936
13937   fi
13938  
13939
13940 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
13941 echo "configure:13942: checking for vprintf" >&5
13942 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
13943   echo $ac_n "(cached) $ac_c" 1>&6
13944 else
13945   cat > conftest.$ac_ext <<EOF
13946 #line 13947 "configure"
13947 #include "confdefs.h"
13948 /* System header to define __stub macros and hopefully few prototypes,
13949     which can conflict with char vprintf(); below.  */
13950 #include <assert.h>
13951 /* Override any gcc2 internal prototype to avoid an error.  */
13952 /* We use char because int might match the return type of a gcc2
13953     builtin and then its argument prototype would still apply.  */
13954 char vprintf();
13955 char (*f)();
13956
13957 int main() {
13958
13959 /* The GNU C library defines this for functions which it implements
13960     to always fail with ENOSYS.  Some functions are actually named
13961     something starting with __ and the normal name is an alias.  */
13962 #if defined (__stub_vprintf) || defined (__stub___vprintf)
13963 choke me
13964 #else
13965 f = vprintf;
13966 #endif
13967
13968 ; return 0; }
13969 EOF
13970 if { (eval echo configure:13971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13971   rm -rf conftest*
13972   eval "ac_cv_func_vprintf=yes"
13973 else
13974   echo "configure: failed program was:" >&5
13975   cat conftest.$ac_ext >&5
13976   rm -rf conftest*
13977   eval "ac_cv_func_vprintf=no"
13978 fi
13979 rm -f conftest*
13980 fi
13981
13982 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
13983   echo "$ac_t""yes" 1>&6
13984   cat >> confdefs.h <<\EOF
13985 #define HAVE_VPRINTF 1
13986 EOF
13987
13988 else
13989   echo "$ac_t""no" 1>&6
13990 fi
13991
13992 if test "$ac_cv_func_vprintf" != yes; then
13993 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
13994 echo "configure:13995: checking for _doprnt" >&5
13995 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
13996   echo $ac_n "(cached) $ac_c" 1>&6
13997 else
13998   cat > conftest.$ac_ext <<EOF
13999 #line 14000 "configure"
14000 #include "confdefs.h"
14001 /* System header to define __stub macros and hopefully few prototypes,
14002     which can conflict with char _doprnt(); below.  */
14003 #include <assert.h>
14004 /* Override any gcc2 internal prototype to avoid an error.  */
14005 /* We use char because int might match the return type of a gcc2
14006     builtin and then its argument prototype would still apply.  */
14007 char _doprnt();
14008 char (*f)();
14009
14010 int main() {
14011
14012 /* The GNU C library defines this for functions which it implements
14013     to always fail with ENOSYS.  Some functions are actually named
14014     something starting with __ and the normal name is an alias.  */
14015 #if defined (__stub__doprnt) || defined (__stub____doprnt)
14016 choke me
14017 #else
14018 f = _doprnt;
14019 #endif
14020
14021 ; return 0; }
14022 EOF
14023 if { (eval echo configure:14024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14024   rm -rf conftest*
14025   eval "ac_cv_func__doprnt=yes"
14026 else
14027   echo "configure: failed program was:" >&5
14028   cat conftest.$ac_ext >&5
14029   rm -rf conftest*
14030   eval "ac_cv_func__doprnt=no"
14031 fi
14032 rm -f conftest*
14033 fi
14034
14035 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
14036   echo "$ac_t""yes" 1>&6
14037   cat >> confdefs.h <<\EOF
14038 #define HAVE_DOPRNT 1
14039 EOF
14040
14041 else
14042   echo "$ac_t""no" 1>&6
14043 fi
14044
14045 fi
14046
14047
14048 if test $ac_cv_func_vprintf = yes ; then
14049                 for ac_func in vsnprintf vsprintf
14050 do
14051 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14052 echo "configure:14053: checking for $ac_func" >&5
14053 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14054   echo $ac_n "(cached) $ac_c" 1>&6
14055 else
14056   cat > conftest.$ac_ext <<EOF
14057 #line 14058 "configure"
14058 #include "confdefs.h"
14059 /* System header to define __stub macros and hopefully few prototypes,
14060     which can conflict with char $ac_func(); below.  */
14061 #include <assert.h>
14062 /* Override any gcc2 internal prototype to avoid an error.  */
14063 /* We use char because int might match the return type of a gcc2
14064     builtin and then its argument prototype would still apply.  */
14065 char $ac_func();
14066 char (*f)();
14067
14068 int main() {
14069
14070 /* The GNU C library defines this for functions which it implements
14071     to always fail with ENOSYS.  Some functions are actually named
14072     something starting with __ and the normal name is an alias.  */
14073 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14074 choke me
14075 #else
14076 f = $ac_func;
14077 #endif
14078
14079 ; return 0; }
14080 EOF
14081 if { (eval echo configure:14082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14082   rm -rf conftest*
14083   eval "ac_cv_func_$ac_func=yes"
14084 else
14085   echo "configure: failed program was:" >&5
14086   cat conftest.$ac_ext >&5
14087   rm -rf conftest*
14088   eval "ac_cv_func_$ac_func=no"
14089 fi
14090 rm -f conftest*
14091 fi
14092
14093 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14094   echo "$ac_t""yes" 1>&6
14095     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14096   cat >> confdefs.h <<EOF
14097 #define $ac_tr_func 1
14098 EOF
14099  
14100 else
14101   echo "$ac_t""no" 1>&6
14102 fi
14103 done
14104
14105 fi
14106
14107 for ac_func in \
14108         bcopy                   \
14109         closesocket             \
14110         endgrent                \
14111         endpwent                \
14112         flock                   \
14113         getdtablesize   \
14114         getgrgid                \
14115         gethostname             \
14116         getpass                 \
14117         getpwuid                \
14118         getpwnam                \
14119         getspnam                \
14120         gettimeofday    \
14121         initgroups              \
14122         lockf                   \
14123         memcpy                  \
14124         memmove                 \
14125         mkstemp                 \
14126         pipe                    \
14127         read                    \
14128         recv                    \
14129         recvfrom                \
14130         setpwfile               \
14131         setgid                  \
14132         setegid                 \
14133         setsid                  \
14134         setuid                  \
14135         seteuid                 \
14136         sigaction               \
14137         signal                  \
14138         sigset                  \
14139         snprintf                \
14140         strdup                  \
14141         strerror                \
14142         strpbrk                 \
14143         strrchr                 \
14144         strsep                  \
14145         strstr                  \
14146         strtol                  \
14147         strtoul                 \
14148         strspn                  \
14149         sysconf                 \
14150         waitpid                 \
14151         wait4                   \
14152         write                   \
14153         send                    \
14154         sendto                  \
14155
14156 do
14157 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14158 echo "configure:14159: checking for $ac_func" >&5
14159 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14160   echo $ac_n "(cached) $ac_c" 1>&6
14161 else
14162   cat > conftest.$ac_ext <<EOF
14163 #line 14164 "configure"
14164 #include "confdefs.h"
14165 /* System header to define __stub macros and hopefully few prototypes,
14166     which can conflict with char $ac_func(); below.  */
14167 #include <assert.h>
14168 /* Override any gcc2 internal prototype to avoid an error.  */
14169 /* We use char because int might match the return type of a gcc2
14170     builtin and then its argument prototype would still apply.  */
14171 char $ac_func();
14172 char (*f)();
14173
14174 int main() {
14175
14176 /* The GNU C library defines this for functions which it implements
14177     to always fail with ENOSYS.  Some functions are actually named
14178     something starting with __ and the normal name is an alias.  */
14179 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14180 choke me
14181 #else
14182 f = $ac_func;
14183 #endif
14184
14185 ; return 0; }
14186 EOF
14187 if { (eval echo configure:14188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14188   rm -rf conftest*
14189   eval "ac_cv_func_$ac_func=yes"
14190 else
14191   echo "configure: failed program was:" >&5
14192   cat conftest.$ac_ext >&5
14193   rm -rf conftest*
14194   eval "ac_cv_func_$ac_func=no"
14195 fi
14196 rm -f conftest*
14197 fi
14198
14199 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14200   echo "$ac_t""yes" 1>&6
14201     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14202   cat >> confdefs.h <<EOF
14203 #define $ac_tr_func 1
14204 EOF
14205  
14206 else
14207   echo "$ac_t""no" 1>&6
14208 fi
14209 done
14210
14211
14212 for ac_func in getopt tempnam
14213 do
14214 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14215 echo "configure:14216: checking for $ac_func" >&5
14216 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14217   echo $ac_n "(cached) $ac_c" 1>&6
14218 else
14219   cat > conftest.$ac_ext <<EOF
14220 #line 14221 "configure"
14221 #include "confdefs.h"
14222 /* System header to define __stub macros and hopefully few prototypes,
14223     which can conflict with char $ac_func(); below.  */
14224 #include <assert.h>
14225 /* Override any gcc2 internal prototype to avoid an error.  */
14226 /* We use char because int might match the return type of a gcc2
14227     builtin and then its argument prototype would still apply.  */
14228 char $ac_func();
14229 char (*f)();
14230
14231 int main() {
14232
14233 /* The GNU C library defines this for functions which it implements
14234     to always fail with ENOSYS.  Some functions are actually named
14235     something starting with __ and the normal name is an alias.  */
14236 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14237 choke me
14238 #else
14239 f = $ac_func;
14240 #endif
14241
14242 ; return 0; }
14243 EOF
14244 if { (eval echo configure:14245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14245   rm -rf conftest*
14246   eval "ac_cv_func_$ac_func=yes"
14247 else
14248   echo "configure: failed program was:" >&5
14249   cat conftest.$ac_ext >&5
14250   rm -rf conftest*
14251   eval "ac_cv_func_$ac_func=no"
14252 fi
14253 rm -f conftest*
14254 fi
14255
14256 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14257   echo "$ac_t""yes" 1>&6
14258     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14259   cat >> confdefs.h <<EOF
14260 #define $ac_tr_func 1
14261 EOF
14262  
14263 else
14264   echo "$ac_t""no" 1>&6
14265 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
14266 fi
14267 done
14268
14269
14270
14271 # Check Configuration
14272 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
14273 echo "configure:14274: checking declaration of sys_errlist" >&5
14274 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
14275   echo $ac_n "(cached) $ac_c" 1>&6
14276 else
14277   
14278         cat > conftest.$ac_ext <<EOF
14279 #line 14280 "configure"
14280 #include "confdefs.h"
14281
14282 #include <stdio.h>
14283 #include <sys/types.h>
14284 #include <errno.h> 
14285 int main() {
14286 char *c = (char *) *sys_errlist
14287 ; return 0; }
14288 EOF
14289 if { (eval echo configure:14290: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14290   rm -rf conftest*
14291   ol_cv_dcl_sys_errlist=yes
14292         ol_cv_have_sys_errlist=yes
14293 else
14294   echo "configure: failed program was:" >&5
14295   cat conftest.$ac_ext >&5
14296   rm -rf conftest*
14297   ol_cv_dcl_sys_errlist=no
14298 fi
14299 rm -f conftest*
14300 fi
14301
14302 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
14303 #
14304 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
14305 if test $ol_cv_dcl_sys_errlist = no ; then
14306         cat >> confdefs.h <<\EOF
14307 #define DECL_SYS_ERRLIST 1
14308 EOF
14309
14310
14311         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
14312 echo "configure:14313: checking existence of sys_errlist" >&5
14313 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
14314   echo $ac_n "(cached) $ac_c" 1>&6
14315 else
14316   
14317                 cat > conftest.$ac_ext <<EOF
14318 #line 14319 "configure"
14319 #include "confdefs.h"
14320 #include <errno.h>
14321 int main() {
14322 char *c = (char *) *sys_errlist
14323 ; return 0; }
14324 EOF
14325 if { (eval echo configure:14326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14326   rm -rf conftest*
14327   ol_cv_have_sys_errlist=yes
14328 else
14329   echo "configure: failed program was:" >&5
14330   cat conftest.$ac_ext >&5
14331   rm -rf conftest*
14332   ol_cv_have_sys_errlist=no
14333 fi
14334 rm -f conftest*
14335 fi
14336
14337 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
14338 fi
14339 if test $ol_cv_have_sys_errlist = yes ; then
14340         cat >> confdefs.h <<\EOF
14341 #define HAVE_SYS_ERRLIST 1
14342 EOF
14343
14344 fi
14345
14346
14347
14348 if test "$ol_enable_debug" != no ; then
14349         cat >> confdefs.h <<\EOF
14350 #define LDAP_DEBUG 1
14351 EOF
14352
14353 fi
14354 if test "$ol_enable_syslog" = yes ; then
14355         cat >> confdefs.h <<\EOF
14356 #define LDAP_SYSLOG 1
14357 EOF
14358
14359 fi
14360 if test "$ol_enable_libui" = yes ; then
14361         cat >> confdefs.h <<\EOF
14362 #define LDAP_LIBUI 1
14363 EOF
14364
14365 fi
14366 if test "$ol_enable_cache" = no ; then
14367         cat >> confdefs.h <<\EOF
14368 #define LDAP_NOCACHE 1
14369 EOF
14370
14371 fi
14372 if test "$ol_enable_dns" != no ; then
14373         cat >> confdefs.h <<\EOF
14374 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS LDAP_VENDOR_VERSION
14375 EOF
14376
14377 fi
14378 if test "$ol_enable_proctitle" != no ; then
14379         cat >> confdefs.h <<\EOF
14380 #define LDAP_PROCTITLE 1
14381 EOF
14382
14383 fi
14384 if test "$ol_enable_referrals" != no ; then
14385         cat >> confdefs.h <<\EOF
14386 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
14387 EOF
14388
14389 fi
14390 if test "$ol_enable_cldap" != no ; then
14391         cat >> confdefs.h <<\EOF
14392 #define LDAP_CONNECTIONLESS 1
14393 EOF
14394
14395 fi
14396
14397 if test "$ol_enable_crypt" != no ; then
14398         cat >> confdefs.h <<\EOF
14399 #define SLAPD_CRYPT 1
14400 EOF
14401
14402 fi
14403 if test "$ol_enable_cleartext" != no ; then
14404         cat >> confdefs.h <<\EOF
14405 #define SLAPD_CLEARTEXT 1
14406 EOF
14407
14408 fi
14409 if test "$ol_enable_multimaster" != no ; then
14410         cat >> confdefs.h <<\EOF
14411 #define SLAPD_MULTIMASTER 1
14412 EOF
14413
14414 fi
14415 if test "$ol_enable_phonetic" != no ; then
14416         cat >> confdefs.h <<\EOF
14417 #define SLAPD_PHONETIC 1
14418 EOF
14419
14420 fi
14421 if test "$ol_enable_rlookups" != no ; then
14422         cat >> confdefs.h <<\EOF
14423 #define SLAPD_RLOOKUPS 1
14424 EOF
14425
14426 fi
14427 if test "$ol_enable_aci" != no ; then
14428         cat >> confdefs.h <<\EOF
14429 #define SLAPD_ACI_ENABLED 1
14430 EOF
14431
14432 fi
14433 if test "$ol_enable_discreteaci" != no ; then
14434         cat >> confdefs.h <<\EOF
14435 #define SLAPD_ACI_DISCRETE_RIGHTS 1
14436 EOF
14437
14438 fi
14439
14440 if test "$ol_link_modules" != no ; then
14441         cat >> confdefs.h <<\EOF
14442 #define SLAPD_MODULES 1
14443 EOF
14444
14445         BUILD_SLAPD=yes
14446         MODULES_LIBS=-lltdl
14447         SLAPD_MODULES_LDFLAGS="-dlopen self"
14448 fi
14449
14450 if test "$ol_link_bdb2" != no ; then
14451         cat >> confdefs.h <<\EOF
14452 #define SLAPD_BDB2 1
14453 EOF
14454
14455         BUILD_SLAPD=yes
14456         BUILD_BDB2=yes
14457         if test "$ol_with_bdb2_module" != static ; then
14458                 cat >> confdefs.h <<\EOF
14459 #define SLAPD_BDB2_DYNAMIC 1
14460 EOF
14461
14462                 BUILD_BDB2=mod
14463                 BUILD_BDB2_DYNAMIC=shared
14464                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-bdb2/back_bdb2.la"
14465         fi
14466 fi
14467
14468 if test "$ol_enable_ldap" != no ; then
14469         cat >> confdefs.h <<\EOF
14470 #define SLAPD_LDAP 1
14471 EOF
14472
14473         BUILD_SLAPD=yes
14474         BUILD_LDAP=yes
14475         if test "$ol_with_ldap_module" != static ; then
14476                 cat >> confdefs.h <<\EOF
14477 #define SLAPD_LDAP_DYNAMIC 1
14478 EOF
14479
14480                 BUILD_LDAP=mod
14481                 BUILD_LDAP_DYNAMIC=shared
14482                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
14483         fi
14484 fi
14485
14486 if test "$ol_link_ldbm" != no ; then
14487         cat >> confdefs.h <<\EOF
14488 #define SLAPD_LDBM 1
14489 EOF
14490
14491         BUILD_SLAPD=yes
14492         BUILD_LDBM=yes
14493         if test "$ol_with_ldbm_module" != static ; then
14494                 cat >> confdefs.h <<\EOF
14495 #define SLAPD_LDBM_DYNAMIC 1
14496 EOF
14497
14498                 BUILD_LDBM=mod
14499                 BUILD_LDBM_DYNAMIC=shared
14500                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
14501         fi
14502 fi
14503
14504 if test "$ol_enable_passwd" != no ; then
14505         cat >> confdefs.h <<\EOF
14506 #define SLAPD_PASSWD 1
14507 EOF
14508
14509         BUILD_SLAPD=yes
14510         BUILD_PASSWD=yes
14511         if test "$ol_with_passwd_module" != static ; then
14512                 cat >> confdefs.h <<\EOF
14513 #define SLAPD_PASSWD_DYNAMIC 1
14514 EOF
14515
14516                 BUILD_PASSWD=mod
14517                 BUILD_PASSWD_DYNAMIC=shared
14518                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
14519         fi
14520 fi
14521
14522 if test "$ol_link_perl" != no ; then
14523         cat >> confdefs.h <<\EOF
14524 #define SLAPD_PERL 1
14525 EOF
14526
14527         BUILD_SLAPD=yes
14528         BUILD_PERL=yes
14529         if test "$ol_with_perl_module" != static ; then
14530                 cat >> confdefs.h <<\EOF
14531 #define SLAPD_PERL_DYNAMIC 1
14532 EOF
14533
14534                 BUILD_PERL=mod
14535                 BUILD_PERL_DYNAMIC=shared
14536                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-perl/back_perl.la"
14537         fi
14538 fi
14539
14540 if test "$ol_enable_shell" != no ; then
14541         cat >> confdefs.h <<\EOF
14542 #define SLAPD_SHELL 1
14543 EOF
14544
14545         BUILD_SLAPD=yes
14546         BUILD_SHELL=yes
14547         if test "$ol_with_shell_module" != static ; then
14548                 cat >> confdefs.h <<\EOF
14549 #define SLAPD_SHELL_DYNAMIC 1
14550 EOF
14551
14552                 BUILD_SHELL=mod
14553                 BUILD_SHELL_DYNAMIC=shared
14554                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
14555         fi
14556 fi
14557
14558 if test "$ol_enable_tcl" != no ; then
14559         cat >> confdefs.h <<\EOF
14560 #define SLAPD_TCL 1
14561 EOF
14562
14563         BUILD_SLAPD=yes
14564         BUILD_TCL=yes
14565         if test "$ol_with_tcl_module" != static; then
14566                 cat >> confdefs.h <<\EOF
14567 #define SLAPD_TCL_DYNAMIC 1
14568 EOF
14569
14570                 BUILD_TCL=mod
14571                 BUILD_TCL_DYNAMIC=shared
14572                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-tcl/back_tcl.la"
14573         fi
14574 fi
14575
14576 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
14577         $BUILD_SLAPD = yes ; then
14578         BUILD_SLURPD=yes
14579 fi
14580
14581 if test "$ol_link_isode" != no ; then
14582         BUILD_LDAPD=yes
14583 fi
14584
14585
14586
14587
14588   
14589   
14590   
14591   
14592   
14593   
14594   
14595   
14596   
14597   
14598   
14599   
14600   
14601   
14602   
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629 trap '' 1 2 15
14630
14631 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
14632
14633 test "x$prefix" = xNONE && prefix=$ac_default_prefix
14634 # Let make expand exec_prefix.
14635 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
14636
14637 # Any assignment to VPATH causes Sun make to only execute
14638 # the first set of double-colon rules, so remove it if not needed.
14639 # If there is a colon in the path, we need to keep it.
14640 if test "x$srcdir" = x.; then
14641   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
14642 fi
14643
14644 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
14645
14646 DEFS=-DHAVE_CONFIG_H
14647
14648 # Without the "./", some shells look in PATH for config.status.
14649 : ${CONFIG_STATUS=./config.status}
14650
14651 echo creating $CONFIG_STATUS
14652 rm -f $CONFIG_STATUS
14653 cat > $CONFIG_STATUS <<EOF
14654 #! /bin/sh
14655 # Generated automatically by configure.
14656 # Run this file to recreate the current configuration.
14657 # This directory was configured as follows,
14658 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
14659 #
14660 # $0 $ac_configure_args
14661 #
14662 # Compiler output produced by configure, useful for debugging
14663 # configure, is in ./config.log if it exists.
14664
14665 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
14666 for ac_option
14667 do
14668   case "\$ac_option" in
14669   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
14670     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
14671     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
14672   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
14673     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
14674     exit 0 ;;
14675   -help | --help | --hel | --he | --h)
14676     echo "\$ac_cs_usage"; exit 0 ;;
14677   *) echo "\$ac_cs_usage"; exit 1 ;;
14678   esac
14679 done
14680
14681 ac_given_srcdir=$srcdir
14682 ac_given_INSTALL="$INSTALL"
14683
14684 trap 'rm -fr `echo "\
14685 Makefile:build/top.mk:Makefile.in:build/dir.mk \
14686 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
14687 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
14688 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
14689 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
14690 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
14691 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
14692 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
14693 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
14694 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
14695 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
14696 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
14697 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
14698 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
14699 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
14700 include/Makefile:build/top.mk:include/Makefile.in \
14701 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
14702 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
14703 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
14704 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
14705 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
14706 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
14707 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
14708 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
14709 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
14710 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
14711 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
14712 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/mod.mk \
14713 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
14714 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
14715 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
14716 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
14717 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
14718 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
14719 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
14720 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
14721 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
14722 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
14723 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
14724 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
14725 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
14726 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
14727  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
14728 EOF
14729 cat >> $CONFIG_STATUS <<EOF
14730
14731 # Protect against being on the right side of a sed subst in config.status.
14732 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
14733  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
14734 $ac_vpsub
14735 $extrasub
14736 s%@SHELL@%$SHELL%g
14737 s%@CFLAGS@%$CFLAGS%g
14738 s%@CPPFLAGS@%$CPPFLAGS%g
14739 s%@CXXFLAGS@%$CXXFLAGS%g
14740 s%@FFLAGS@%$FFLAGS%g
14741 s%@DEFS@%$DEFS%g
14742 s%@LDFLAGS@%$LDFLAGS%g
14743 s%@LIBS@%$LIBS%g
14744 s%@exec_prefix@%$exec_prefix%g
14745 s%@prefix@%$prefix%g
14746 s%@program_transform_name@%$program_transform_name%g
14747 s%@bindir@%$bindir%g
14748 s%@sbindir@%$sbindir%g
14749 s%@libexecdir@%$libexecdir%g
14750 s%@datadir@%$datadir%g
14751 s%@sysconfdir@%$sysconfdir%g
14752 s%@sharedstatedir@%$sharedstatedir%g
14753 s%@localstatedir@%$localstatedir%g
14754 s%@libdir@%$libdir%g
14755 s%@includedir@%$includedir%g
14756 s%@oldincludedir@%$oldincludedir%g
14757 s%@infodir@%$infodir%g
14758 s%@mandir@%$mandir%g
14759 s%@host@%$host%g
14760 s%@host_alias@%$host_alias%g
14761 s%@host_cpu@%$host_cpu%g
14762 s%@host_vendor@%$host_vendor%g
14763 s%@host_os@%$host_os%g
14764 s%@target@%$target%g
14765 s%@target_alias@%$target_alias%g
14766 s%@target_cpu@%$target_cpu%g
14767 s%@target_vendor@%$target_vendor%g
14768 s%@target_os@%$target_os%g
14769 s%@build@%$build%g
14770 s%@build_alias@%$build_alias%g
14771 s%@build_cpu@%$build_cpu%g
14772 s%@build_vendor@%$build_vendor%g
14773 s%@build_os@%$build_os%g
14774 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
14775 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
14776 s%@INSTALL_DATA@%$INSTALL_DATA%g
14777 s%@PACKAGE@%$PACKAGE%g
14778 s%@VERSION@%$VERSION%g
14779 s%@ACLOCAL@%$ACLOCAL%g
14780 s%@AUTOCONF@%$AUTOCONF%g
14781 s%@AUTOMAKE@%$AUTOMAKE%g
14782 s%@AUTOHEADER@%$AUTOHEADER%g
14783 s%@MAKEINFO@%$MAKEINFO%g
14784 s%@install_sh@%$install_sh%g
14785 s%@AMTAR@%$AMTAR%g
14786 s%@AWK@%$AWK%g
14787 s%@AMTARFLAGS@%$AMTARFLAGS%g
14788 s%@SET_MAKE@%$SET_MAKE%g
14789 s%@top_builddir@%$top_builddir%g
14790 s%@ldap_subdir@%$ldap_subdir%g
14791 s%@CC@%$CC%g
14792 s%@RANLIB@%$RANLIB%g
14793 s%@LD@%$LD%g
14794 s%@NM@%$NM%g
14795 s%@LN_S@%$LN_S%g
14796 s%@LIBTOOL@%$LIBTOOL%g
14797 s%@LN_H@%$LN_H%g
14798 s%@SENDMAIL@%$SENDMAIL%g
14799 s%@EDITOR@%$EDITOR%g
14800 s%@FINGER@%$FINGER%g
14801 s%@PERLBIN@%$PERLBIN%g
14802 s%@CPP@%$CPP%g
14803 s%@EXEEXT@%$EXEEXT%g
14804 s%@OBJEXT@%$OBJEXT%g
14805 s%@OL_MKDEP@%$OL_MKDEP%g
14806 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
14807 s%@PEPSY@%$PEPSY%g
14808 s%@LIBOBJS@%$LIBOBJS%g
14809 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
14810 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
14811 s%@BUILD_BDB2@%$BUILD_BDB2%g
14812 s%@BUILD_LDAP@%$BUILD_LDAP%g
14813 s%@BUILD_LDBM@%$BUILD_LDBM%g
14814 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
14815 s%@BUILD_PERL@%$BUILD_PERL%g
14816 s%@BUILD_QUIPU@%$BUILD_QUIPU%g
14817 s%@BUILD_SHELL@%$BUILD_SHELL%g
14818 s%@BUILD_TCL@%$BUILD_TCL%g
14819 s%@BUILD_BDB2_DYNAMIC@%$BUILD_BDB2_DYNAMIC%g
14820 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
14821 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
14822 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
14823 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
14824 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
14825 s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
14826 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
14827 s%@LDAP_LIBS@%$LDAP_LIBS%g
14828 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
14829 s%@LDIF_LIBS@%$LDIF_LIBS%g
14830 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
14831 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
14832 s%@LDBM_LIBS@%$LDBM_LIBS%g
14833 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
14834 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
14835 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
14836 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
14837 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
14838 s%@SLAPD_PERL_CPPFLAGS@%$SLAPD_PERL_CPPFLAGS%g
14839 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
14840 s%@KRB_LIBS@%$KRB_LIBS%g
14841 s%@READLINE_LIBS@%$READLINE_LIBS%g
14842 s%@SASL_LIBS@%$SASL_LIBS%g
14843 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
14844 s%@TLS_LIBS@%$TLS_LIBS%g
14845 s%@MODULES_LIBS@%$MODULES_LIBS%g
14846
14847 CEOF
14848 EOF
14849
14850 cat >> $CONFIG_STATUS <<\EOF
14851
14852 # Split the substitutions into bite-sized pieces for seds with
14853 # small command number limits, like on Digital OSF/1 and HP-UX.
14854 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
14855 ac_file=1 # Number of current file.
14856 ac_beg=1 # First line for current file.
14857 ac_end=$ac_max_sed_cmds # Line after last line for current file.
14858 ac_more_lines=:
14859 ac_sed_cmds=""
14860 while $ac_more_lines; do
14861   if test $ac_beg -gt 1; then
14862     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
14863   else
14864     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
14865   fi
14866   if test ! -s conftest.s$ac_file; then
14867     ac_more_lines=false
14868     rm -f conftest.s$ac_file
14869   else
14870     if test -z "$ac_sed_cmds"; then
14871       ac_sed_cmds="sed -f conftest.s$ac_file"
14872     else
14873       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
14874     fi
14875     ac_file=`expr $ac_file + 1`
14876     ac_beg=$ac_end
14877     ac_end=`expr $ac_end + $ac_max_sed_cmds`
14878   fi
14879 done
14880 if test -z "$ac_sed_cmds"; then
14881   ac_sed_cmds=cat
14882 fi
14883 EOF
14884
14885 cat >> $CONFIG_STATUS <<EOF
14886
14887 CONFIG_FILES=\${CONFIG_FILES-"\
14888 Makefile:build/top.mk:Makefile.in:build/dir.mk \
14889 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
14890 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
14891 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
14892 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
14893 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
14894 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
14895 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
14896 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
14897 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
14898 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
14899 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
14900 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
14901 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
14902 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
14903 include/Makefile:build/top.mk:include/Makefile.in \
14904 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
14905 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
14906 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
14907 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
14908 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
14909 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
14910 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
14911 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
14912 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
14913 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
14914 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
14915 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/mod.mk \
14916 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
14917 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
14918 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
14919 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
14920 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
14921 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
14922 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
14923 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
14924 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
14925 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
14926 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
14927 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
14928 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
14929 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
14930 "}
14931 EOF
14932 cat >> $CONFIG_STATUS <<\EOF
14933 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
14934   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
14935   case "$ac_file" in
14936   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
14937        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
14938   *) ac_file_in="${ac_file}.in" ;;
14939   esac
14940
14941   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
14942
14943   # Remove last slash and all that follows it.  Not all systems have dirname.
14944   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
14945   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
14946     # The file is in a subdirectory.
14947     test ! -d "$ac_dir" && mkdir "$ac_dir"
14948     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
14949     # A "../" for each directory in $ac_dir_suffix.
14950     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
14951   else
14952     ac_dir_suffix= ac_dots=
14953   fi
14954
14955   case "$ac_given_srcdir" in
14956   .)  srcdir=.
14957       if test -z "$ac_dots"; then top_srcdir=.
14958       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
14959   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
14960   *) # Relative path.
14961     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
14962     top_srcdir="$ac_dots$ac_given_srcdir" ;;
14963   esac
14964
14965   case "$ac_given_INSTALL" in
14966   [/$]*) INSTALL="$ac_given_INSTALL" ;;
14967   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
14968   esac
14969
14970   echo creating "$ac_file"
14971   rm -f "$ac_file"
14972   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
14973   case "$ac_file" in
14974   *Makefile*) ac_comsub="1i\\
14975 # $configure_input" ;;
14976   *) ac_comsub= ;;
14977   esac
14978
14979   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
14980   sed -e "$ac_comsub
14981 s%@configure_input@%$configure_input%g
14982 s%@srcdir@%$srcdir%g
14983 s%@top_srcdir@%$top_srcdir%g
14984 s%@INSTALL@%$INSTALL%g
14985 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
14986 fi; done
14987 rm -f conftest.s*
14988
14989 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
14990 # NAME is the cpp macro being defined and VALUE is the value it is being given.
14991 #
14992 # ac_d sets the value in "#define NAME VALUE" lines.
14993 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
14994 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
14995 ac_dC='\3'
14996 ac_dD='%g'
14997 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
14998 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
14999 ac_uB='\([      ]\)%\1#\2define\3'
15000 ac_uC=' '
15001 ac_uD='\4%g'
15002 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
15003 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15004 ac_eB='$%\1#\2define\3'
15005 ac_eC=' '
15006 ac_eD='%g'
15007
15008 if test "${CONFIG_HEADERS+set}" != set; then
15009 EOF
15010 cat >> $CONFIG_STATUS <<EOF
15011   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
15012 EOF
15013 cat >> $CONFIG_STATUS <<\EOF
15014 fi
15015 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
15016   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15017   case "$ac_file" in
15018   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
15019        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
15020   *) ac_file_in="${ac_file}.in" ;;
15021   esac
15022
15023   echo creating $ac_file
15024
15025   rm -f conftest.frag conftest.in conftest.out
15026   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
15027   cat $ac_file_inputs > conftest.in
15028
15029 EOF
15030
15031 # Transform confdefs.h into a sed script conftest.vals that substitutes
15032 # the proper values into config.h.in to produce config.h.  And first:
15033 # Protect against being on the right side of a sed subst in config.status.
15034 # Protect against being in an unquoted here document in config.status.
15035 rm -f conftest.vals
15036 cat > conftest.hdr <<\EOF
15037 s/[\\&%]/\\&/g
15038 s%[\\$`]%\\&%g
15039 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
15040 s%ac_d%ac_u%gp
15041 s%ac_u%ac_e%gp
15042 EOF
15043 sed -n -f conftest.hdr confdefs.h > conftest.vals
15044 rm -f conftest.hdr
15045
15046 # This sed command replaces #undef with comments.  This is necessary, for
15047 # example, in the case of _POSIX_SOURCE, which is predefined and required
15048 # on some systems where configure will not decide to define it.
15049 cat >> conftest.vals <<\EOF
15050 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
15051 EOF
15052
15053 # Break up conftest.vals because some shells have a limit on
15054 # the size of here documents, and old seds have small limits too.
15055
15056 rm -f conftest.tail
15057 while :
15058 do
15059   ac_lines=`grep -c . conftest.vals`
15060   # grep -c gives empty output for an empty file on some AIX systems.
15061   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
15062   # Write a limited-size here document to conftest.frag.
15063   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
15064   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
15065   echo 'CEOF
15066   sed -f conftest.frag conftest.in > conftest.out
15067   rm -f conftest.in
15068   mv conftest.out conftest.in
15069 ' >> $CONFIG_STATUS
15070   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
15071   rm -f conftest.vals
15072   mv conftest.tail conftest.vals
15073 done
15074 rm -f conftest.vals
15075
15076 cat >> $CONFIG_STATUS <<\EOF
15077   rm -f conftest.frag conftest.h
15078   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
15079   cat conftest.in >> conftest.h
15080   rm -f conftest.in
15081   if cmp -s $ac_file conftest.h 2>/dev/null; then
15082     echo "$ac_file is unchanged"
15083     rm -f conftest.h
15084   else
15085     # Remove last slash and all that follows it.  Not all systems have dirname.
15086       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
15087       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15088       # The file is in a subdirectory.
15089       test ! -d "$ac_dir" && mkdir "$ac_dir"
15090     fi
15091     rm -f $ac_file
15092     mv conftest.h $ac_file
15093   fi
15094 fi; done
15095
15096 EOF
15097 cat >> $CONFIG_STATUS <<EOF
15098
15099 EOF
15100 cat >> $CONFIG_STATUS <<\EOF
15101
15102 date > stamp-h
15103 echo Please \"make depend\" to build dependencies
15104
15105 exit 0
15106 EOF
15107 chmod +x $CONFIG_STATUS
15108 rm -fr confdefs* $ac_clean_files
15109 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
15110