]> git.sur5r.net Git - openldap/blob - configure
03ef783875eaafca0e555ad65f28a79548bc6f32
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP 
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
13 # Guess values for system-dependent variables and create Makefiles.
14 # Generated automatically using autoconf version 2.13.1 
15 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
16 #
17 # This configure script is free software; the Free Software Foundation
18 # gives unlimited permission to copy, distribute and modify it.
19
20 # Defaults:
21 ac_help=
22 ac_default_prefix=/usr/local
23 # Any additions from configure.in:
24 ac_default_prefix=/usr/local
25 ac_help="$ac_help
26   --with-subdir=DIR change default subdirectory used for installs"
27 ac_help="$ac_help
28   --enable-debug        enable debugging (yes)"
29 ac_help="$ac_help
30   --enable-syslog       enable syslog support (auto)"
31 ac_help="$ac_help
32   --enable-proctitle    enable proctitle support (yes)"
33 ac_help="$ac_help
34   --enable-cache        enable caching (yes)"
35 ac_help="$ac_help
36   --enable-dns          enable V2 DX Referrals extension (no)"
37 ac_help="$ac_help
38   --enable-referrals    enable V2 Referrals extension (yes)"
39 ac_help="$ac_help
40   --enable-cldap        enable connectionless ldap (no)"
41 ac_help="$ac_help
42   --enable-x-compile    enable cross compiling (no)"
43 ac_help="$ac_help
44   --enable-dmalloc      enable debug malloc support (no)"
45 ac_help="$ac_help
46   --with-cyrus-sasl     with Cyrus SASL support (auto)"
47 ac_help="$ac_help
48   --with-fetch          with fetch URL support (auto)"
49 ac_help="$ac_help
50   --with-kerberos       with Kerberos support (auto)"
51 ac_help="$ac_help
52   --with-readline       with readline support (auto)"
53 ac_help="$ac_help
54   --with-threads        use threads (auto)"
55 ac_help="$ac_help
56   --with-tls            with TLS/SSL support (auto)"
57 ac_help="$ac_help
58   --with-yielding-select        with implicitly yielding select (auto)"
59 ac_help="$ac_help
60 LDAPD (X.500-to-LDAP Gateway) Options:"
61 ac_help="$ac_help
62   --enable-ldapd        enable building ldapd (no)"
63 ac_help="$ac_help
64 SLAPD (Standalone LDAP Daemon) Options:"
65 ac_help="$ac_help
66   --enable-slapd        enable building slapd (yes)"
67 ac_help="$ac_help
68     --enable-cleartext  enable cleartext passwords (yes)"
69 ac_help="$ac_help
70     --enable-crypt      enable crypt(3) passwords (auto)"
71 ac_help="$ac_help
72     --enable-modules    enable dynamic module support (no)"
73 ac_help="$ac_help
74     --enable-multimaster        enable multimaster replication (no)"
75 ac_help="$ac_help
76     --enable-phonetic   enable phonetic/soundex (no)"
77 ac_help="$ac_help
78     --enable-quipu      build quipu migration tools (no)"
79 ac_help="$ac_help
80     --enable-rlookups   enable reverse lookups (auto)"
81 ac_help="$ac_help
82     --enable-aci        enable per-object ACIs (no)"
83 ac_help="$ac_help
84     --enable-discreteaci        enable discrete rights in ACIs (no)"
85 ac_help="$ac_help
86     --enable-wrappers   enable tcp wrapper support (no)"
87 ac_help="$ac_help
88     --enable-bdb2       enable bdb2 backend (no)"
89 ac_help="$ac_help
90       --with-bdb2-module        module type (static)"
91 ac_help="$ac_help
92     --enable-ldap       enable ldap backend (no)"
93 ac_help="$ac_help
94       --with-ldap-module        module type (static)"
95 ac_help="$ac_help
96     --enable-ldbm       enable ldbm backend (yes)"
97 ac_help="$ac_help
98       --with-ldbm-api   use LDBM API (auto)"
99 ac_help="$ac_help
100       --with-ldbm-module        module type (static)"
101 ac_help="$ac_help
102       --with-ldbm-type  use LDBM type (auto)"
103 ac_help="$ac_help
104     --enable-passwd     enable passwd backend (no)"
105 ac_help="$ac_help
106       --with-passwd-module      module type (static)"
107 ac_help="$ac_help
108     --enable-perl       enable perl backend (no)"
109 ac_help="$ac_help
110       --with-perl-module        module type (static)"
111 ac_help="$ac_help
112     --enable-shell      enable shell backend (no)"
113 ac_help="$ac_help
114       --with-shell-module       module type (static)"
115 ac_help="$ac_help
116     --enable-tcl        enable tcl backend (no)"
117 ac_help="$ac_help
118       --with-tcl-module module type (static)"
119 ac_help="$ac_help
120 SLURPD (Replication Daemon) Options:"
121 ac_help="$ac_help
122   --enable-slurpd       enable building slurpd (auto)"
123 ac_help="$ac_help
124 Library Generation & Linking Options"
125 ac_help="$ac_help
126   --enable-static[=PKGS]  build static libraries [default=yes]"
127 ac_help="$ac_help
128   --enable-shared[=PKGS]  build shared libraries [default=yes]"
129 ac_help="$ac_help
130   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
131 ac_help="$ac_help
132   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
133 ac_help="$ac_help
134   --disable-libtool-lock  avoid locking (might break parallel builds)"
135
136 # Initialize some variables set by options.
137 # The variables have the same names as the options, with
138 # dashes changed to underlines.
139 build=NONE
140 cache_file=./config.cache
141 exec_prefix=NONE
142 host=NONE
143 no_create=
144 nonopt=NONE
145 no_recursion=
146 prefix=NONE
147 program_prefix=NONE
148 program_suffix=NONE
149 program_transform_name=s,x,x,
150 silent=
151 site=
152 srcdir=
153 target=NONE
154 verbose=
155 x_includes=NONE
156 x_libraries=NONE
157 bindir='${exec_prefix}/bin'
158 sbindir='${exec_prefix}/sbin'
159 libexecdir='${exec_prefix}/libexec'
160 datadir='${prefix}/share'
161 sysconfdir='${prefix}/etc'
162 sharedstatedir='${prefix}/com'
163 localstatedir='${prefix}/var'
164 libdir='${exec_prefix}/lib'
165 includedir='${prefix}/include'
166 oldincludedir='/usr/include'
167 infodir='${prefix}/info'
168 mandir='${prefix}/man'
169
170 # Initialize some other variables.
171 subdirs=
172 MFLAGS= MAKEFLAGS=
173 SHELL=${CONFIG_SHELL-/bin/sh}
174 # Maximum number of lines to put in a shell here document.
175 ac_max_here_lines=12
176
177 ac_prev=
178 for ac_option
179 do
180
181   # If the previous option needs an argument, assign it.
182   if test -n "$ac_prev"; then
183     eval "$ac_prev=\$ac_option"
184     ac_prev=
185     continue
186   fi
187
188   case "$ac_option" in
189   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
190   *) ac_optarg= ;;
191   esac
192
193   # Accept the important Cygnus configure options, so we can diagnose typos.
194
195   case "$ac_option" in
196
197   -bindir | --bindir | --bindi | --bind | --bin | --bi)
198     ac_prev=bindir ;;
199   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
200     bindir="$ac_optarg" ;;
201
202   -build | --build | --buil | --bui | --bu)
203     ac_prev=build ;;
204   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
205     build="$ac_optarg" ;;
206
207   -cache-file | --cache-file | --cache-fil | --cache-fi \
208   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
209     ac_prev=cache_file ;;
210   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
211   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
212     cache_file="$ac_optarg" ;;
213
214   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
215     ac_prev=datadir ;;
216   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
217   | --da=*)
218     datadir="$ac_optarg" ;;
219
220   -disable-* | --disable-*)
221     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
222     # Reject names that are not valid shell variable names.
223     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
224       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
225     fi
226     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
227     eval "enable_${ac_feature}=no" ;;
228
229   -enable-* | --enable-*)
230     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
231     # Reject names that are not valid shell variable names.
232     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
233       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
234     fi
235     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
236     case "$ac_option" in
237       *=*) ;;
238       *) ac_optarg=yes ;;
239     esac
240     eval "enable_${ac_feature}='$ac_optarg'" ;;
241
242   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
243   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
244   | --exec | --exe | --ex)
245     ac_prev=exec_prefix ;;
246   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
247   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
248   | --exec=* | --exe=* | --ex=*)
249     exec_prefix="$ac_optarg" ;;
250
251   -gas | --gas | --ga | --g)
252     # Obsolete; use --with-gas.
253     with_gas=yes ;;
254
255   -help | --help | --hel | --he)
256     # Omit some internal or obsolete options to make the list less imposing.
257     # This message is too long to be a string in the A/UX 3.1 sh.
258     cat << EOF
259 Usage: configure [options] [host]
260 Options: [defaults in brackets after descriptions]
261 Configuration:
262   --cache-file=FILE       cache test results in FILE
263   --help                  print this message
264   --no-create             do not create output files
265   --quiet, --silent       do not print \`checking...' messages
266   --version               print the version of autoconf that created configure
267 Directory and file names:
268   --prefix=PREFIX         install architecture-independent files in PREFIX
269                           [$ac_default_prefix]
270   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
271                           [same as prefix]
272   --bindir=DIR            user executables in DIR [EPREFIX/bin]
273   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
274   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
275   --datadir=DIR           read-only architecture-independent data in DIR
276                           [PREFIX/share]
277   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
278   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
279                           [PREFIX/com]
280   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
281   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
282   --includedir=DIR        C header files in DIR [PREFIX/include]
283   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
284   --infodir=DIR           info documentation in DIR [PREFIX/info]
285   --mandir=DIR            man documentation in DIR [PREFIX/man]
286   --srcdir=DIR            find the sources in DIR [configure dir or ..]
287   --program-prefix=PREFIX prepend PREFIX to installed program names
288   --program-suffix=SUFFIX append SUFFIX to installed program names
289   --program-transform-name=PROGRAM
290                           run sed PROGRAM on installed program names
291 EOF
292     cat << EOF
293 Host type:
294   --build=BUILD           configure for building on BUILD [BUILD=HOST]
295   --host=HOST             configure for HOST [guessed]
296   --target=TARGET         configure for TARGET [TARGET=HOST]
297 Features and packages:
298   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
299   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
300   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
301   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
302   --x-includes=DIR        X include files are in DIR
303   --x-libraries=DIR       X library files are in DIR
304 EOF
305     if test -n "$ac_help"; then
306       echo "--enable and --with options recognized:$ac_help"
307     fi
308     exit 0 ;;
309
310   -host | --host | --hos | --ho)
311     ac_prev=host ;;
312   -host=* | --host=* | --hos=* | --ho=*)
313     host="$ac_optarg" ;;
314
315   -includedir | --includedir | --includedi | --included | --include \
316   | --includ | --inclu | --incl | --inc)
317     ac_prev=includedir ;;
318   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
319   | --includ=* | --inclu=* | --incl=* | --inc=*)
320     includedir="$ac_optarg" ;;
321
322   -infodir | --infodir | --infodi | --infod | --info | --inf)
323     ac_prev=infodir ;;
324   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
325     infodir="$ac_optarg" ;;
326
327   -libdir | --libdir | --libdi | --libd)
328     ac_prev=libdir ;;
329   -libdir=* | --libdir=* | --libdi=* | --libd=*)
330     libdir="$ac_optarg" ;;
331
332   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
333   | --libexe | --libex | --libe)
334     ac_prev=libexecdir ;;
335   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
336   | --libexe=* | --libex=* | --libe=*)
337     libexecdir="$ac_optarg" ;;
338
339   -localstatedir | --localstatedir | --localstatedi | --localstated \
340   | --localstate | --localstat | --localsta | --localst \
341   | --locals | --local | --loca | --loc | --lo)
342     ac_prev=localstatedir ;;
343   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
344   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
345   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
346     localstatedir="$ac_optarg" ;;
347
348   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
349     ac_prev=mandir ;;
350   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
351     mandir="$ac_optarg" ;;
352
353   -nfp | --nfp | --nf)
354     # Obsolete; use --without-fp.
355     with_fp=no ;;
356
357   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
358   | --no-cr | --no-c)
359     no_create=yes ;;
360
361   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
362   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
363     no_recursion=yes ;;
364
365   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
366   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
367   | --oldin | --oldi | --old | --ol | --o)
368     ac_prev=oldincludedir ;;
369   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
370   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
371   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
372     oldincludedir="$ac_optarg" ;;
373
374   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
375     ac_prev=prefix ;;
376   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
377     prefix="$ac_optarg" ;;
378
379   -program-prefix | --program-prefix | --program-prefi | --program-pref \
380   | --program-pre | --program-pr | --program-p)
381     ac_prev=program_prefix ;;
382   -program-prefix=* | --program-prefix=* | --program-prefi=* \
383   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
384     program_prefix="$ac_optarg" ;;
385
386   -program-suffix | --program-suffix | --program-suffi | --program-suff \
387   | --program-suf | --program-su | --program-s)
388     ac_prev=program_suffix ;;
389   -program-suffix=* | --program-suffix=* | --program-suffi=* \
390   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
391     program_suffix="$ac_optarg" ;;
392
393   -program-transform-name | --program-transform-name \
394   | --program-transform-nam | --program-transform-na \
395   | --program-transform-n | --program-transform- \
396   | --program-transform | --program-transfor \
397   | --program-transfo | --program-transf \
398   | --program-trans | --program-tran \
399   | --progr-tra | --program-tr | --program-t)
400     ac_prev=program_transform_name ;;
401   -program-transform-name=* | --program-transform-name=* \
402   | --program-transform-nam=* | --program-transform-na=* \
403   | --program-transform-n=* | --program-transform-=* \
404   | --program-transform=* | --program-transfor=* \
405   | --program-transfo=* | --program-transf=* \
406   | --program-trans=* | --program-tran=* \
407   | --progr-tra=* | --program-tr=* | --program-t=*)
408     program_transform_name="$ac_optarg" ;;
409
410   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
411   | -silent | --silent | --silen | --sile | --sil)
412     silent=yes ;;
413
414   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
415     ac_prev=sbindir ;;
416   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
417   | --sbi=* | --sb=*)
418     sbindir="$ac_optarg" ;;
419
420   -sharedstatedir | --sharedstatedir | --sharedstatedi \
421   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
422   | --sharedst | --shareds | --shared | --share | --shar \
423   | --sha | --sh)
424     ac_prev=sharedstatedir ;;
425   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
426   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
427   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
428   | --sha=* | --sh=*)
429     sharedstatedir="$ac_optarg" ;;
430
431   -site | --site | --sit)
432     ac_prev=site ;;
433   -site=* | --site=* | --sit=*)
434     site="$ac_optarg" ;;
435
436   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
437     ac_prev=srcdir ;;
438   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
439     srcdir="$ac_optarg" ;;
440
441   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
442   | --syscon | --sysco | --sysc | --sys | --sy)
443     ac_prev=sysconfdir ;;
444   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
445   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
446     sysconfdir="$ac_optarg" ;;
447
448   -target | --target | --targe | --targ | --tar | --ta | --t)
449     ac_prev=target ;;
450   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
451     target="$ac_optarg" ;;
452
453   -v | -verbose | --verbose | --verbos | --verbo | --verb)
454     verbose=yes ;;
455
456   -version | --version | --versio | --versi | --vers)
457     echo "configure generated by autoconf version 2.13.1"
458     exit 0 ;;
459
460   -with-* | --with-*)
461     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
462     # Reject names that are not valid shell variable names.
463     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
464       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
465     fi
466     ac_package=`echo $ac_package| sed 's/-/_/g'`
467     case "$ac_option" in
468       *=*) ;;
469       *) ac_optarg=yes ;;
470     esac
471     eval "with_${ac_package}='$ac_optarg'" ;;
472
473   -without-* | --without-*)
474     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
475     # Reject names that are not valid shell variable names.
476     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
477       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
478     fi
479     ac_package=`echo $ac_package| sed 's/-/_/g'`
480     eval "with_${ac_package}=no" ;;
481
482   --x)
483     # Obsolete; use --with-x.
484     with_x=yes ;;
485
486   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
487   | --x-incl | --x-inc | --x-in | --x-i)
488     ac_prev=x_includes ;;
489   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
490   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
491     x_includes="$ac_optarg" ;;
492
493   -x-libraries | --x-libraries | --x-librarie | --x-librari \
494   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
495     ac_prev=x_libraries ;;
496   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
497   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
498     x_libraries="$ac_optarg" ;;
499
500   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
501     ;;
502
503   *)
504     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
505       echo "configure: warning: $ac_option: invalid host type" 1>&2
506     fi
507     if test "x$nonopt" != xNONE; then
508       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
509     fi
510     nonopt="$ac_option"
511     ;;
512
513   esac
514 done
515
516 if test -n "$ac_prev"; then
517   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
518 fi
519
520 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
521
522 # File descriptor usage:
523 # 0 standard input
524 # 1 file creation
525 # 2 errors and warnings
526 # 3 some systems may open it to /dev/tty
527 # 4 used on the Kubota Titan
528 # 6 checking for... messages and results
529 # 5 compiler messages saved in config.log
530 if test "$silent" = yes; then
531   exec 6>/dev/null
532 else
533   exec 6>&1
534 fi
535 exec 5>./config.log
536
537 echo "\
538 This file contains any messages produced by compilers while
539 running configure, to aid debugging if configure makes a mistake.
540 " 1>&5
541
542 # Strip out --no-create and --no-recursion so they do not pile up.
543 # Also quote any args containing shell metacharacters.
544 ac_configure_args=
545 for ac_arg
546 do
547   case "$ac_arg" in
548   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
549   | --no-cr | --no-c) ;;
550   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
551   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
552   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
553   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
554   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
555   esac
556 done
557
558 # NLS nuisances.
559 # Only set these to C if already set.  These must not be set unconditionally
560 # because not all systems understand e.g. LANG=C (notably SCO).
561 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
562 # Non-C LC_CTYPE values break the ctype check.
563 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
564 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
565 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
566 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
567
568 # confdefs.h avoids OS command line length limits that DEFS can exceed.
569 rm -rf conftest* confdefs.h
570 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
571 echo > confdefs.h
572
573 # A filename unique to this package, relative to the directory that
574 # configure is in, which we can look for to find out if srcdir is correct.
575 ac_unique_file=build/version
576
577 # Find the source files, if location was not specified.
578 if test -z "$srcdir"; then
579   ac_srcdir_defaulted=yes
580   # Try the directory containing this script, then its parent.
581   ac_prog=$0
582   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
583   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
584   srcdir=$ac_confdir
585   if test ! -r $srcdir/$ac_unique_file; then
586     srcdir=..
587   fi
588 else
589   ac_srcdir_defaulted=no
590 fi
591 if test ! -r $srcdir/$ac_unique_file; then
592   if test "$ac_srcdir_defaulted" = yes; then
593     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
594   else
595     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
596   fi
597 fi
598 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
599
600 # Prefer explicitly selected file to automatically selected ones.
601 if test -z "$CONFIG_SITE"; then
602   if test "x$prefix" != xNONE; then
603     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
604   else
605     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
606   fi
607 fi
608 for ac_site_file in $CONFIG_SITE; do
609   if test -r "$ac_site_file"; then
610     echo "loading site script $ac_site_file"
611     . "$ac_site_file"
612   fi
613 done
614
615
616 ac_ext=c
617 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
618 ac_cpp='$CPP $CPPFLAGS'
619 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
620 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
621 cross_compiling=$ac_cv_prog_cc_cross
622
623 ac_exeext=
624 ac_objext=o
625 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
626   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
627   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
628     ac_n= ac_c='
629 ' ac_t='        '
630   else
631     ac_n=-n ac_c= ac_t=
632   fi
633 else
634   ac_n= ac_c='\c' ac_t=
635 fi
636
637 ac_aux_dir=
638 for ac_dir in build $srcdir/build; do
639   if test -f $ac_dir/install-sh; then
640     ac_aux_dir=$ac_dir
641     ac_install_sh="$ac_aux_dir/install-sh -c"
642     break
643   elif test -f $ac_dir/install.sh; then
644     ac_aux_dir=$ac_dir
645     ac_install_sh="$ac_aux_dir/install.sh -c"
646     break
647   fi
648 done
649 if test -z "$ac_aux_dir"; then
650   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
651 fi
652 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
653 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
654 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
655
656 OL_VERSION=`cat $ac_aux_dir/version`
657 if test -z "$OL_VERSION"; then
658         { echo "configure: error: could not determine version" 1>&2; exit 1; }
659 fi
660
661
662 echo $ac_n "checking host system type""... $ac_c" 1>&6
663 echo "configure:664: checking host system type" >&5
664 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
665
666 # Make sure we can run config.sub.
667   if $ac_config_sub sun4 >/dev/null 2>&1; then :
668     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
669   fi
670
671   ac_cv_host_alias=$host
672   case "$ac_cv_host_alias" in
673   NONE)
674     case $nonopt in
675     NONE)
676       if ac_cv_host_alias=`$ac_config_guess`; then :
677       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
678       fi ;;
679     *) ac_cv_host_alias=$nonopt ;;
680     esac ;;
681   esac
682
683   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
684   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
685   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
686   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
687 else
688   echo $ac_n "(cached) $ac_c" 1>&6
689 fi
690
691 echo "$ac_t""$ac_cv_host" 1>&6
692
693 host=$ac_cv_host
694 host_alias=$ac_cv_host_alias
695 host_cpu=$ac_cv_host_cpu
696 host_vendor=$ac_cv_host_vendor
697 host_os=$ac_cv_host_os
698
699
700
701
702
703 echo $ac_n "checking target system type""... $ac_c" 1>&6
704 echo "configure:705: checking target system type" >&5
705 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
706
707 # Make sure we can run config.sub.
708   if $ac_config_sub sun4 >/dev/null 2>&1; then :
709     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
710   fi
711
712   ac_cv_target_alias=$target
713   case "$ac_cv_target_alias" in
714   NONE)
715     case $nonopt in
716     NONE)
717       ac_cv_target_alias=$host_alias ;;
718
719     *) ac_cv_target_alias=$nonopt ;;
720     esac ;;
721   esac
722
723   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
724   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
725   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
726   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
727 else
728   echo $ac_n "(cached) $ac_c" 1>&6
729 fi
730
731 echo "$ac_t""$ac_cv_target" 1>&6
732
733 target=$ac_cv_target
734 target_alias=$ac_cv_target_alias
735 target_cpu=$ac_cv_target_cpu
736 target_vendor=$ac_cv_target_vendor
737 target_os=$ac_cv_target_os
738
739
740
741
742
743 echo $ac_n "checking build system type""... $ac_c" 1>&6
744 echo "configure:745: checking build system type" >&5
745 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
746
747 # Make sure we can run config.sub.
748   if $ac_config_sub sun4 >/dev/null 2>&1; then :
749     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
750   fi
751
752   ac_cv_build_alias=$build
753   case "$ac_cv_build_alias" in
754   NONE)
755     case $nonopt in
756     NONE)
757       ac_cv_build_alias=$host_alias ;;
758
759     *) ac_cv_build_alias=$nonopt ;;
760     esac ;;
761   esac
762
763   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
764   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
765   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
766   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
767 else
768   echo $ac_n "(cached) $ac_c" 1>&6
769 fi
770
771 echo "$ac_t""$ac_cv_build" 1>&6
772
773 build=$ac_cv_build
774 build_alias=$ac_cv_build_alias
775 build_cpu=$ac_cv_build_cpu
776 build_vendor=$ac_cv_build_vendor
777 build_os=$ac_cv_build_os
778
779
780
781
782
783 # Do some error checking and defaulting for the host and target type.
784 # The inputs are:
785 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
786 #
787 # The rules are:
788 # 1. You are not allowed to specify --host, --target, and nonopt at the
789 #    same time.
790 # 2. Host defaults to nonopt.
791 # 3. If nonopt is not specified, then host defaults to the current host,
792 #    as determined by config.guess.
793 # 4. Target and build default to nonopt.
794 # 5. If nonopt is not specified, then target and build default to host.
795
796 # The aliases save the names the user supplied, while $host etc.
797 # will get canonicalized.
798 case $host---$target---$nonopt in
799 NONE---*---* | *---NONE---* | *---*---NONE) ;;
800 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
801 esac
802
803 test "$host_alias" != "$target_alias" &&
804   test "$program_prefix$program_suffix$program_transform_name" = \
805     NONENONEs,x,x, &&
806   program_prefix=${target_alias}-
807
808
809 # Find a good install program.  We prefer a C program (faster),
810 # so one script is as good as another.  But avoid the broken or
811 # incompatible versions:
812 # SysV /etc/install, /usr/sbin/install
813 # SunOS /usr/etc/install
814 # IRIX /sbin/install
815 # AIX /bin/install
816 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
817 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
818 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
819 # ./install, which can be erroneously created by make from ./install.sh.
820 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
821 echo "configure:822: checking for a BSD compatible install" >&5
822 if test -z "$INSTALL"; then
823 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
824   echo $ac_n "(cached) $ac_c" 1>&6
825 else
826     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
827   for ac_dir in $PATH; do
828     # Account for people who put trailing slashes in PATH elements.
829     case "$ac_dir/" in
830     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
831     *)
832       # OSF1 and SCO ODT 3.0 have their own names for install.
833       # Don't use installbsd from OSF since it installs stuff as root
834       # by default.
835       for ac_prog in ginstall scoinst install; do
836         if test -f $ac_dir/$ac_prog; then
837           if test $ac_prog = install &&
838             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
839             # AIX install.  It has an incompatible calling convention.
840             :
841           elif test $ac_prog = install &&
842             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
843             # program-specific install script used by HP pwplus--don't use.
844             :
845           else
846             ac_cv_path_install="$ac_dir/$ac_prog -c"
847             break 2
848           fi
849         fi
850       done
851       ;;
852     esac
853   done
854   IFS="$ac_save_IFS"
855
856 fi
857   if test "${ac_cv_path_install+set}" = set; then
858     INSTALL="$ac_cv_path_install"
859   else
860     # As a last resort, use the slow shell script.  We don't cache a
861     # path for INSTALL within a source directory, because that will
862     # break other packages using the cache if that directory is
863     # removed, or if the path is relative.
864     INSTALL="$ac_install_sh"
865   fi
866 fi
867 echo "$ac_t""$INSTALL" 1>&6
868
869 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
870 # It thinks the first close brace ends the variable substitution.
871 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
872
873 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
874
875 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
876
877 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
878 echo "configure:879: checking whether build environment is sane" >&5
879 # Just in case
880 sleep 1
881 echo timestamp > conftestfile
882 # Do `set' in a subshell so we don't clobber the current shell's
883 # arguments.  Must try -L first in case configure is actually a
884 # symlink; some systems play weird games with the mod time of symlinks
885 # (eg FreeBSD returns the mod time of the symlink's containing
886 # directory).
887 if (
888    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
889    if test "$*" = "X"; then
890       # -L didn't work.
891       set X `ls -t $srcdir/configure conftestfile`
892    fi
893    if test "$*" != "X $srcdir/configure conftestfile" \
894       && test "$*" != "X conftestfile $srcdir/configure"; then
895
896       # If neither matched, then we have a broken ls.  This can happen
897       # if, for instance, CONFIG_SHELL is bash and it inherits a
898       # broken ls alias from the environment.  This has actually
899       # happened.  Such a system could not be considered "sane".
900       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
901 alias in your environment" 1>&2; exit 1; }
902    fi
903
904    test "$2" = conftestfile
905    )
906 then
907    # Ok.
908    :
909 else
910    { echo "configure: error: newly created file is older than distributed files!
911 Check your system clock" 1>&2; exit 1; }
912 fi
913 rm -f conftest*
914 echo "$ac_t""yes" 1>&6
915 if test "$program_transform_name" = s,x,x,; then
916   program_transform_name=
917 else
918   # Double any \ or $.  echo might interpret backslashes.
919   cat <<\EOF_SED > conftestsed
920 s,\\,\\\\,g; s,\$,$$,g
921 EOF_SED
922   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
923   rm -f conftestsed
924 fi
925 test "$program_prefix" != NONE &&
926   program_transform_name="s,^,${program_prefix},;$program_transform_name"
927 # Use a double $ so make ignores it.
928 test "$program_suffix" != NONE &&
929   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
930
931 # sed with no file args requires a program.
932 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
933
934 for ac_prog in mawk gawk nawk awk
935 do
936 # Extract the first word of "$ac_prog", so it can be a program name with args.
937 set dummy $ac_prog; ac_word=$2
938 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
939 echo "configure:940: checking for $ac_word" >&5
940 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
941   echo $ac_n "(cached) $ac_c" 1>&6
942 else
943   if test -n "$AWK"; then
944   ac_cv_prog_AWK="$AWK" # Let the user override the test.
945 else
946   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
947   ac_dummy="$PATH"
948   for ac_dir in $ac_dummy; do
949     test -z "$ac_dir" && ac_dir=.
950     if test -f $ac_dir/$ac_word; then
951       ac_cv_prog_AWK="$ac_prog"
952       break
953     fi
954   done
955   IFS="$ac_save_ifs"
956 fi
957 fi
958 AWK="$ac_cv_prog_AWK"
959 if test -n "$AWK"; then
960   echo "$ac_t""$AWK" 1>&6
961 else
962   echo "$ac_t""no" 1>&6
963 fi
964
965 test -n "$AWK" && break
966 done
967
968 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
969 echo "configure:970: checking whether ${MAKE-make} sets \${MAKE}" >&5
970 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
971 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
972   echo $ac_n "(cached) $ac_c" 1>&6
973 else
974   cat > conftestmake <<\EOF
975 all:
976         @echo 'ac_maketemp="${MAKE}"'
977 EOF
978 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
979 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
980 if test -n "$ac_maketemp"; then
981   eval ac_cv_prog_make_${ac_make}_set=yes
982 else
983   eval ac_cv_prog_make_${ac_make}_set=no
984 fi
985 rm -f conftestmake
986 fi
987 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
988   echo "$ac_t""yes" 1>&6
989   SET_MAKE=
990 else
991   echo "$ac_t""no" 1>&6
992   SET_MAKE="MAKE=${MAKE-make}"
993 fi
994
995
996
997 PACKAGE=OpenLDAP
998
999 VERSION=$OL_VERSION
1000
1001 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1002   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1003 fi
1004
1005
1006
1007 missing_dir=`cd $ac_aux_dir && pwd`
1008 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1009 echo "configure:1010: checking for working aclocal" >&5
1010 # Run test in a subshell; some versions of sh will print an error if
1011 # an executable is not found, even if stderr is redirected.
1012 # Redirect stdin to placate older versions of autoconf.  Sigh.
1013 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1014    ACLOCAL=aclocal
1015    echo "$ac_t""found" 1>&6
1016 else
1017    ACLOCAL="$missing_dir/missing aclocal"
1018    echo "$ac_t""missing" 1>&6
1019 fi
1020
1021 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1022 echo "configure:1023: checking for working autoconf" >&5
1023 # Run test in a subshell; some versions of sh will print an error if
1024 # an executable is not found, even if stderr is redirected.
1025 # Redirect stdin to placate older versions of autoconf.  Sigh.
1026 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1027    AUTOCONF=autoconf
1028    echo "$ac_t""found" 1>&6
1029 else
1030    AUTOCONF="$missing_dir/missing autoconf"
1031    echo "$ac_t""missing" 1>&6
1032 fi
1033
1034 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1035 echo "configure:1036: checking for working automake" >&5
1036 # Run test in a subshell; some versions of sh will print an error if
1037 # an executable is not found, even if stderr is redirected.
1038 # Redirect stdin to placate older versions of autoconf.  Sigh.
1039 if (automake --version) < /dev/null > /dev/null 2>&1; then
1040    AUTOMAKE=automake
1041    echo "$ac_t""found" 1>&6
1042 else
1043    AUTOMAKE="$missing_dir/missing automake"
1044    echo "$ac_t""missing" 1>&6
1045 fi
1046
1047 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1048 echo "configure:1049: checking for working autoheader" >&5
1049 # Run test in a subshell; some versions of sh will print an error if
1050 # an executable is not found, even if stderr is redirected.
1051 # Redirect stdin to placate older versions of autoconf.  Sigh.
1052 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1053    AUTOHEADER=autoheader
1054    echo "$ac_t""found" 1>&6
1055 else
1056    AUTOHEADER="$missing_dir/missing autoheader"
1057    echo "$ac_t""missing" 1>&6
1058 fi
1059
1060 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1061 echo "configure:1062: checking for working makeinfo" >&5
1062 # Run test in a subshell; some versions of sh will print an error if
1063 # an executable is not found, even if stderr is redirected.
1064 # Redirect stdin to placate older versions of autoconf.  Sigh.
1065 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1066    MAKEINFO=makeinfo
1067    echo "$ac_t""found" 1>&6
1068 else
1069    MAKEINFO="$missing_dir/missing makeinfo"
1070    echo "$ac_t""missing" 1>&6
1071 fi
1072
1073 install_sh="$missing_dir/install-sh"
1074 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1075
1076 for ac_prog in gnutar gtar tar
1077 do
1078 # Extract the first word of "$ac_prog", so it can be a program name with args.
1079 set dummy $ac_prog; ac_word=$2
1080 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1081 echo "configure:1082: checking for $ac_word" >&5
1082 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1083   echo $ac_n "(cached) $ac_c" 1>&6
1084 else
1085   if test -n "$AMTAR"; then
1086   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1087 else
1088   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1089   ac_dummy="$PATH"
1090   for ac_dir in $ac_dummy; do
1091     test -z "$ac_dir" && ac_dir=.
1092     if test -f $ac_dir/$ac_word; then
1093       ac_cv_prog_AMTAR="$ac_prog"
1094       break
1095     fi
1096   done
1097   IFS="$ac_save_ifs"
1098 fi
1099 fi
1100 AMTAR="$ac_cv_prog_AMTAR"
1101 if test -n "$AMTAR"; then
1102   echo "$ac_t""$AMTAR" 1>&6
1103 else
1104   echo "$ac_t""no" 1>&6
1105 fi
1106
1107 test -n "$AMTAR" && break
1108 done
1109
1110
1111 AMTARFLAGS=
1112 if test -n "$AMTAR"; then
1113   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1114         AMTARFLAGS=o
1115   fi
1116 fi
1117
1118
1119
1120 cat >> confdefs.h <<EOF
1121 #define OPENLDAP_PACKAGE "$PACKAGE"
1122 EOF
1123
1124 cat >> confdefs.h <<EOF
1125 #define OPENLDAP_VERSION "$VERSION"
1126 EOF
1127
1128
1129
1130
1131 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1132 echo "configure:1133: checking configure arguments" >&5
1133
1134
1135 top_builddir=`pwd`
1136
1137 ldap_subdir="/openldap"
1138
1139 # Check whether --with-subdir or --without-subdir was given.
1140 if test "${with_subdir+set}" = set; then
1141   withval="$with_subdir"
1142   case "$withval" in
1143         no) ldap_subdir=""
1144                 ;;
1145         yes)
1146                 ;;
1147         /*|\\*)
1148                 ldap_subdir="$withval"
1149                 ;;
1150         *)
1151                 ldap_subdir="/$withval"
1152                 ;;
1153 esac
1154
1155 fi
1156
1157
1158 # OpenLDAP --enable-debug
1159         # Check whether --enable-debug or --disable-debug was given.
1160 if test "${enable_debug+set}" = set; then
1161   enableval="$enable_debug"
1162   
1163         ol_arg=invalid
1164         for ol_val in auto yes no ; do
1165                 if test "$enableval" = "$ol_val" ; then
1166                         ol_arg="$ol_val"
1167                 fi
1168         done
1169         if test "$ol_arg" = "invalid" ; then
1170                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1171         fi
1172         ol_enable_debug="$ol_arg"
1173
1174 else
1175         ol_enable_debug="yes"
1176 fi
1177 # end --enable-debug
1178 # OpenLDAP --enable-syslog
1179         # Check whether --enable-syslog or --disable-syslog was given.
1180 if test "${enable_syslog+set}" = set; then
1181   enableval="$enable_syslog"
1182   
1183         ol_arg=invalid
1184         for ol_val in auto yes no ; do
1185                 if test "$enableval" = "$ol_val" ; then
1186                         ol_arg="$ol_val"
1187                 fi
1188         done
1189         if test "$ol_arg" = "invalid" ; then
1190                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1191         fi
1192         ol_enable_syslog="$ol_arg"
1193
1194 else
1195         ol_enable_syslog="auto"
1196 fi
1197 # end --enable-syslog
1198 # OpenLDAP --enable-proctitle
1199         # Check whether --enable-proctitle or --disable-proctitle was given.
1200 if test "${enable_proctitle+set}" = set; then
1201   enableval="$enable_proctitle"
1202   
1203         ol_arg=invalid
1204         for ol_val in auto yes no ; do
1205                 if test "$enableval" = "$ol_val" ; then
1206                         ol_arg="$ol_val"
1207                 fi
1208         done
1209         if test "$ol_arg" = "invalid" ; then
1210                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1211         fi
1212         ol_enable_proctitle="$ol_arg"
1213
1214 else
1215         ol_enable_proctitle="yes"
1216 fi
1217 # end --enable-proctitle
1218 # OpenLDAP --enable-cache
1219         # Check whether --enable-cache or --disable-cache was given.
1220 if test "${enable_cache+set}" = set; then
1221   enableval="$enable_cache"
1222   
1223         ol_arg=invalid
1224         for ol_val in auto yes no ; do
1225                 if test "$enableval" = "$ol_val" ; then
1226                         ol_arg="$ol_val"
1227                 fi
1228         done
1229         if test "$ol_arg" = "invalid" ; then
1230                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
1231         fi
1232         ol_enable_cache="$ol_arg"
1233
1234 else
1235         ol_enable_cache="yes"
1236 fi
1237 # end --enable-cache
1238 # OpenLDAP --enable-dns
1239         # Check whether --enable-dns or --disable-dns was given.
1240 if test "${enable_dns+set}" = set; then
1241   enableval="$enable_dns"
1242   
1243         ol_arg=invalid
1244         for ol_val in auto yes no ; do
1245                 if test "$enableval" = "$ol_val" ; then
1246                         ol_arg="$ol_val"
1247                 fi
1248         done
1249         if test "$ol_arg" = "invalid" ; then
1250                 { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; }
1251         fi
1252         ol_enable_dns="$ol_arg"
1253
1254 else
1255         ol_enable_dns="no"
1256 fi
1257 # end --enable-dns
1258 # OpenLDAP --enable-referrals
1259         # Check whether --enable-referrals or --disable-referrals was given.
1260 if test "${enable_referrals+set}" = set; then
1261   enableval="$enable_referrals"
1262   
1263         ol_arg=invalid
1264         for ol_val in auto yes no ; do
1265                 if test "$enableval" = "$ol_val" ; then
1266                         ol_arg="$ol_val"
1267                 fi
1268         done
1269         if test "$ol_arg" = "invalid" ; then
1270                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1271         fi
1272         ol_enable_referrals="$ol_arg"
1273
1274 else
1275         ol_enable_referrals="yes"
1276 fi
1277 # end --enable-referrals
1278 # OpenLDAP --enable-cldap
1279         # Check whether --enable-cldap or --disable-cldap was given.
1280 if test "${enable_cldap+set}" = set; then
1281   enableval="$enable_cldap"
1282   
1283         ol_arg=invalid
1284         for ol_val in auto yes no ; do
1285                 if test "$enableval" = "$ol_val" ; then
1286                         ol_arg="$ol_val"
1287                 fi
1288         done
1289         if test "$ol_arg" = "invalid" ; then
1290                 { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; }
1291         fi
1292         ol_enable_cldap="$ol_arg"
1293
1294 else
1295         ol_enable_cldap="no"
1296 fi
1297 # end --enable-cldap
1298 # OpenLDAP --enable-x_compile
1299         # Check whether --enable-x_compile or --disable-x_compile was given.
1300 if test "${enable_x_compile+set}" = set; then
1301   enableval="$enable_x_compile"
1302   
1303         ol_arg=invalid
1304         for ol_val in yes no ; do
1305                 if test "$enableval" = "$ol_val" ; then
1306                         ol_arg="$ol_val"
1307                 fi
1308         done
1309         if test "$ol_arg" = "invalid" ; then
1310                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1311         fi
1312         ol_enable_x_compile="$ol_arg"
1313
1314 else
1315         ol_enable_x_compile="no"
1316 fi
1317 # end --enable-x_compile
1318
1319 # OpenLDAP --enable-dmalloc
1320         # Check whether --enable-dmalloc or --disable-dmalloc was given.
1321 if test "${enable_dmalloc+set}" = set; then
1322   enableval="$enable_dmalloc"
1323   
1324         ol_arg=invalid
1325         for ol_val in auto yes no ; do
1326                 if test "$enableval" = "$ol_val" ; then
1327                         ol_arg="$ol_val"
1328                 fi
1329         done
1330         if test "$ol_arg" = "invalid" ; then
1331                 { echo "configure: error: bad value $enableval for --enable-dmalloc" 1>&2; exit 1; }
1332         fi
1333         ol_enable_dmalloc="$ol_arg"
1334
1335 else
1336         ol_enable_dmalloc="no"
1337 fi
1338 # end --enable-dmalloc
1339
1340 # OpenLDAP --with-cyrus_sasl
1341         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1342 if test "${with_cyrus_sasl+set}" = set; then
1343   withval="$with_cyrus_sasl"
1344   
1345         ol_arg=invalid
1346         for ol_val in auto yes no  ; do
1347                 if test "$withval" = "$ol_val" ; then
1348                         ol_arg="$ol_val"
1349                 fi
1350         done
1351         if test "$ol_arg" = "invalid" ; then
1352                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1353         fi
1354         ol_with_cyrus_sasl="$ol_arg"
1355
1356 else
1357         ol_with_cyrus_sasl="auto"
1358 fi
1359 # end --with-cyrus_sasl
1360
1361 # OpenLDAP --with-fetch
1362         # Check whether --with-fetch or --without-fetch was given.
1363 if test "${with_fetch+set}" = set; then
1364   withval="$with_fetch"
1365   
1366         ol_arg=invalid
1367         for ol_val in auto yes no  ; do
1368                 if test "$withval" = "$ol_val" ; then
1369                         ol_arg="$ol_val"
1370                 fi
1371         done
1372         if test "$ol_arg" = "invalid" ; then
1373                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1374         fi
1375         ol_with_fetch="$ol_arg"
1376
1377 else
1378         ol_with_fetch="auto"
1379 fi
1380 # end --with-fetch
1381
1382 # OpenLDAP --with-kerberos
1383         # Check whether --with-kerberos or --without-kerberos was given.
1384 if test "${with_kerberos+set}" = set; then
1385   withval="$with_kerberos"
1386   
1387         ol_arg=invalid
1388         for ol_val in auto k5 k4 afs yes no ; do
1389                 if test "$withval" = "$ol_val" ; then
1390                         ol_arg="$ol_val"
1391                 fi
1392         done
1393         if test "$ol_arg" = "invalid" ; then
1394                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1395         fi
1396         ol_with_kerberos="$ol_arg"
1397
1398 else
1399         ol_with_kerberos="auto"
1400 fi
1401 # end --with-kerberos
1402
1403 # OpenLDAP --with-readline
1404         # Check whether --with-readline or --without-readline was given.
1405 if test "${with_readline+set}" = set; then
1406   withval="$with_readline"
1407   
1408         ol_arg=invalid
1409         for ol_val in auto yes no  ; do
1410                 if test "$withval" = "$ol_val" ; then
1411                         ol_arg="$ol_val"
1412                 fi
1413         done
1414         if test "$ol_arg" = "invalid" ; then
1415                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1416         fi
1417         ol_with_readline="$ol_arg"
1418
1419 else
1420         ol_with_readline="auto"
1421 fi
1422 # end --with-readline
1423
1424 # OpenLDAP --with-threads
1425         # Check whether --with-threads or --without-threads was given.
1426 if test "${with_threads+set}" = set; then
1427   withval="$with_threads"
1428   
1429         ol_arg=invalid
1430         for ol_val in auto posix mach pth lwp yes no manual  ; do
1431                 if test "$withval" = "$ol_val" ; then
1432                         ol_arg="$ol_val"
1433                 fi
1434         done
1435         if test "$ol_arg" = "invalid" ; then
1436                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1437         fi
1438         ol_with_threads="$ol_arg"
1439
1440 else
1441         ol_with_threads="auto"
1442 fi
1443 # end --with-threads
1444
1445 # OpenLDAP --with-tls
1446         # Check whether --with-tls or --without-tls was given.
1447 if test "${with_tls+set}" = set; then
1448   withval="$with_tls"
1449   
1450         ol_arg=invalid
1451         for ol_val in auto ssleay openssl yes no  ; do
1452                 if test "$withval" = "$ol_val" ; then
1453                         ol_arg="$ol_val"
1454                 fi
1455         done
1456         if test "$ol_arg" = "invalid" ; then
1457                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1458         fi
1459         ol_with_tls="$ol_arg"
1460
1461 else
1462         ol_with_tls="auto"
1463 fi
1464 # end --with-tls
1465
1466 # OpenLDAP --with-yielding_select
1467         # Check whether --with-yielding_select or --without-yielding_select was given.
1468 if test "${with_yielding_select+set}" = set; then
1469   withval="$with_yielding_select"
1470   
1471         ol_arg=invalid
1472         for ol_val in auto yes no manual  ; do
1473                 if test "$withval" = "$ol_val" ; then
1474                         ol_arg="$ol_val"
1475                 fi
1476         done
1477         if test "$ol_arg" = "invalid" ; then
1478                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1479         fi
1480         ol_with_yielding_select="$ol_arg"
1481
1482 else
1483         ol_with_yielding_select="auto"
1484 fi
1485 # end --with-yielding_select
1486
1487
1488
1489 # Check whether --with-xxldapdoptions or --without-xxldapdoptions was given.
1490 if test "${with_xxldapdoptions+set}" = set; then
1491   withval="$with_xxldapdoptions"
1492   :
1493 fi
1494
1495 # OpenLDAP --enable-ldapd
1496         # Check whether --enable-ldapd or --disable-ldapd was given.
1497 if test "${enable_ldapd+set}" = set; then
1498   enableval="$enable_ldapd"
1499   
1500         ol_arg=invalid
1501         for ol_val in auto yes no ; do
1502                 if test "$enableval" = "$ol_val" ; then
1503                         ol_arg="$ol_val"
1504                 fi
1505         done
1506         if test "$ol_arg" = "invalid" ; then
1507                 { echo "configure: error: bad value $enableval for --enable-ldapd" 1>&2; exit 1; }
1508         fi
1509         ol_enable_ldapd="$ol_arg"
1510
1511 else
1512         ol_enable_ldapd="no"
1513 fi
1514 # end --enable-ldapd
1515
1516 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1517 if test "${with_xxslapdoptions+set}" = set; then
1518   withval="$with_xxslapdoptions"
1519   :
1520 fi
1521
1522 # OpenLDAP --enable-slapd
1523         # Check whether --enable-slapd or --disable-slapd was given.
1524 if test "${enable_slapd+set}" = set; then
1525   enableval="$enable_slapd"
1526   
1527         ol_arg=invalid
1528         for ol_val in auto yes no ; do
1529                 if test "$enableval" = "$ol_val" ; then
1530                         ol_arg="$ol_val"
1531                 fi
1532         done
1533         if test "$ol_arg" = "invalid" ; then
1534                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1535         fi
1536         ol_enable_slapd="$ol_arg"
1537
1538 else
1539         ol_enable_slapd="yes"
1540 fi
1541 # end --enable-slapd
1542 # OpenLDAP --enable-cleartext
1543         # Check whether --enable-cleartext or --disable-cleartext was given.
1544 if test "${enable_cleartext+set}" = set; then
1545   enableval="$enable_cleartext"
1546   
1547         ol_arg=invalid
1548         for ol_val in auto yes no ; do
1549                 if test "$enableval" = "$ol_val" ; then
1550                         ol_arg="$ol_val"
1551                 fi
1552         done
1553         if test "$ol_arg" = "invalid" ; then
1554                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1555         fi
1556         ol_enable_cleartext="$ol_arg"
1557
1558 else
1559         ol_enable_cleartext="yes"
1560 fi
1561 # end --enable-cleartext
1562 # OpenLDAP --enable-crypt
1563         # Check whether --enable-crypt or --disable-crypt was given.
1564 if test "${enable_crypt+set}" = set; then
1565   enableval="$enable_crypt"
1566   
1567         ol_arg=invalid
1568         for ol_val in auto yes no ; do
1569                 if test "$enableval" = "$ol_val" ; then
1570                         ol_arg="$ol_val"
1571                 fi
1572         done
1573         if test "$ol_arg" = "invalid" ; then
1574                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1575         fi
1576         ol_enable_crypt="$ol_arg"
1577
1578 else
1579         ol_enable_crypt="auto"
1580 fi
1581 # end --enable-crypt
1582 # OpenLDAP --enable-modules
1583         # Check whether --enable-modules or --disable-modules was given.
1584 if test "${enable_modules+set}" = set; then
1585   enableval="$enable_modules"
1586   
1587         ol_arg=invalid
1588         for ol_val in auto yes no ; do
1589                 if test "$enableval" = "$ol_val" ; then
1590                         ol_arg="$ol_val"
1591                 fi
1592         done
1593         if test "$ol_arg" = "invalid" ; then
1594                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1595         fi
1596         ol_enable_modules="$ol_arg"
1597
1598 else
1599         ol_enable_modules="no"
1600 fi
1601 # end --enable-modules
1602 # OpenLDAP --enable-multimaster
1603         # Check whether --enable-multimaster or --disable-multimaster was given.
1604 if test "${enable_multimaster+set}" = set; then
1605   enableval="$enable_multimaster"
1606   
1607         ol_arg=invalid
1608         for ol_val in auto yes no ; do
1609                 if test "$enableval" = "$ol_val" ; then
1610                         ol_arg="$ol_val"
1611                 fi
1612         done
1613         if test "$ol_arg" = "invalid" ; then
1614                 { echo "configure: error: bad value $enableval for --enable-multimaster" 1>&2; exit 1; }
1615         fi
1616         ol_enable_multimaster="$ol_arg"
1617
1618 else
1619         ol_enable_multimaster="no"
1620 fi
1621 # end --enable-multimaster
1622 # OpenLDAP --enable-phonetic
1623         # Check whether --enable-phonetic or --disable-phonetic was given.
1624 if test "${enable_phonetic+set}" = set; then
1625   enableval="$enable_phonetic"
1626   
1627         ol_arg=invalid
1628         for ol_val in auto yes no ; do
1629                 if test "$enableval" = "$ol_val" ; then
1630                         ol_arg="$ol_val"
1631                 fi
1632         done
1633         if test "$ol_arg" = "invalid" ; then
1634                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1635         fi
1636         ol_enable_phonetic="$ol_arg"
1637
1638 else
1639         ol_enable_phonetic="no"
1640 fi
1641 # end --enable-phonetic
1642 # OpenLDAP --enable-quipu
1643         # Check whether --enable-quipu or --disable-quipu was given.
1644 if test "${enable_quipu+set}" = set; then
1645   enableval="$enable_quipu"
1646   
1647         ol_arg=invalid
1648         for ol_val in auto yes no ; do
1649                 if test "$enableval" = "$ol_val" ; then
1650                         ol_arg="$ol_val"
1651                 fi
1652         done
1653         if test "$ol_arg" = "invalid" ; then
1654                 { echo "configure: error: bad value $enableval for --enable-quipu" 1>&2; exit 1; }
1655         fi
1656         ol_enable_quipu="$ol_arg"
1657
1658 else
1659         ol_enable_quipu="no"
1660 fi
1661 # end --enable-quipu
1662 # OpenLDAP --enable-rlookups
1663         # Check whether --enable-rlookups or --disable-rlookups was given.
1664 if test "${enable_rlookups+set}" = set; then
1665   enableval="$enable_rlookups"
1666   
1667         ol_arg=invalid
1668         for ol_val in auto yes no ; do
1669                 if test "$enableval" = "$ol_val" ; then
1670                         ol_arg="$ol_val"
1671                 fi
1672         done
1673         if test "$ol_arg" = "invalid" ; then
1674                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1675         fi
1676         ol_enable_rlookups="$ol_arg"
1677
1678 else
1679         ol_enable_rlookups="auto"
1680 fi
1681 # end --enable-rlookups
1682 # OpenLDAP --enable-aci
1683         # Check whether --enable-aci or --disable-aci was given.
1684 if test "${enable_aci+set}" = set; then
1685   enableval="$enable_aci"
1686   
1687         ol_arg=invalid
1688         for ol_val in auto yes no ; do
1689                 if test "$enableval" = "$ol_val" ; then
1690                         ol_arg="$ol_val"
1691                 fi
1692         done
1693         if test "$ol_arg" = "invalid" ; then
1694                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1695         fi
1696         ol_enable_aci="$ol_arg"
1697
1698 else
1699         ol_enable_aci="no"
1700 fi
1701 # end --enable-aci
1702 # OpenLDAP --enable-discreteaci
1703         # Check whether --enable-discreteaci or --disable-discreteaci was given.
1704 if test "${enable_discreteaci+set}" = set; then
1705   enableval="$enable_discreteaci"
1706   
1707         ol_arg=invalid
1708         for ol_val in auto yes no ; do
1709                 if test "$enableval" = "$ol_val" ; then
1710                         ol_arg="$ol_val"
1711                 fi
1712         done
1713         if test "$ol_arg" = "invalid" ; then
1714                 { echo "configure: error: bad value $enableval for --enable-discreteaci" 1>&2; exit 1; }
1715         fi
1716         ol_enable_discreteaci="$ol_arg"
1717
1718 else
1719         ol_enable_discreteaci="no"
1720 fi
1721 # end --enable-discreteaci
1722 # OpenLDAP --enable-wrappers
1723         # Check whether --enable-wrappers or --disable-wrappers was given.
1724 if test "${enable_wrappers+set}" = set; then
1725   enableval="$enable_wrappers"
1726   
1727         ol_arg=invalid
1728         for ol_val in auto yes no ; do
1729                 if test "$enableval" = "$ol_val" ; then
1730                         ol_arg="$ol_val"
1731                 fi
1732         done
1733         if test "$ol_arg" = "invalid" ; then
1734                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1735         fi
1736         ol_enable_wrappers="$ol_arg"
1737
1738 else
1739         ol_enable_wrappers="no"
1740 fi
1741 # end --enable-wrappers
1742
1743 # OpenLDAP --enable-bdb2
1744         # Check whether --enable-bdb2 or --disable-bdb2 was given.
1745 if test "${enable_bdb2+set}" = set; then
1746   enableval="$enable_bdb2"
1747   
1748         ol_arg=invalid
1749         for ol_val in auto yes no ; do
1750                 if test "$enableval" = "$ol_val" ; then
1751                         ol_arg="$ol_val"
1752                 fi
1753         done
1754         if test "$ol_arg" = "invalid" ; then
1755                 { echo "configure: error: bad value $enableval for --enable-bdb2" 1>&2; exit 1; }
1756         fi
1757         ol_enable_bdb2="$ol_arg"
1758
1759 else
1760         ol_enable_bdb2="no"
1761 fi
1762 # end --enable-bdb2
1763 # OpenLDAP --with-bdb2_module
1764         # Check whether --with-bdb2_module or --without-bdb2_module was given.
1765 if test "${with_bdb2_module+set}" = set; then
1766   withval="$with_bdb2_module"
1767   
1768         ol_arg=invalid
1769         for ol_val in static dynamic ; do
1770                 if test "$withval" = "$ol_val" ; then
1771                         ol_arg="$ol_val"
1772                 fi
1773         done
1774         if test "$ol_arg" = "invalid" ; then
1775                 { echo "configure: error: bad value $withval for --with-bdb2_module" 1>&2; exit 1; }
1776         fi
1777         ol_with_bdb2_module="$ol_arg"
1778
1779 else
1780         ol_with_bdb2_module="static"
1781 fi
1782 # end --with-bdb2_module
1783
1784 # OpenLDAP --enable-ldap
1785         # Check whether --enable-ldap or --disable-ldap was given.
1786 if test "${enable_ldap+set}" = set; then
1787   enableval="$enable_ldap"
1788   
1789         ol_arg=invalid
1790         for ol_val in auto yes no ; do
1791                 if test "$enableval" = "$ol_val" ; then
1792                         ol_arg="$ol_val"
1793                 fi
1794         done
1795         if test "$ol_arg" = "invalid" ; then
1796                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1797         fi
1798         ol_enable_ldap="$ol_arg"
1799
1800 else
1801         ol_enable_ldap="no"
1802 fi
1803 # end --enable-ldap
1804 # OpenLDAP --with-ldap_module
1805         # Check whether --with-ldap_module or --without-ldap_module was given.
1806 if test "${with_ldap_module+set}" = set; then
1807   withval="$with_ldap_module"
1808   
1809         ol_arg=invalid
1810         for ol_val in static dynamic ; do
1811                 if test "$withval" = "$ol_val" ; then
1812                         ol_arg="$ol_val"
1813                 fi
1814         done
1815         if test "$ol_arg" = "invalid" ; then
1816                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
1817         fi
1818         ol_with_ldap_module="$ol_arg"
1819
1820 else
1821         ol_with_ldap_module="static"
1822 fi
1823 # end --with-ldap_module
1824
1825 # OpenLDAP --enable-ldbm
1826         # Check whether --enable-ldbm or --disable-ldbm was given.
1827 if test "${enable_ldbm+set}" = set; then
1828   enableval="$enable_ldbm"
1829   
1830         ol_arg=invalid
1831         for ol_val in auto yes no ; do
1832                 if test "$enableval" = "$ol_val" ; then
1833                         ol_arg="$ol_val"
1834                 fi
1835         done
1836         if test "$ol_arg" = "invalid" ; then
1837                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1838         fi
1839         ol_enable_ldbm="$ol_arg"
1840
1841 else
1842         ol_enable_ldbm="yes"
1843 fi
1844 # end --enable-ldbm
1845 # OpenLDAP --with-ldbm_api
1846         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1847 if test "${with_ldbm_api+set}" = set; then
1848   withval="$with_ldbm_api"
1849   
1850         ol_arg=invalid
1851         for ol_val in auto db2 db mdbm gdbm ndbm manual ; do
1852                 if test "$withval" = "$ol_val" ; then
1853                         ol_arg="$ol_val"
1854                 fi
1855         done
1856         if test "$ol_arg" = "invalid" ; then
1857                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1858         fi
1859         ol_with_ldbm_api="$ol_arg"
1860
1861 else
1862         ol_with_ldbm_api="auto"
1863 fi
1864 # end --with-ldbm_api
1865
1866 # OpenLDAP --with-ldbm_module
1867         # Check whether --with-ldbm_module or --without-ldbm_module was given.
1868 if test "${with_ldbm_module+set}" = set; then
1869   withval="$with_ldbm_module"
1870   
1871         ol_arg=invalid
1872         for ol_val in static dynamic ; do
1873                 if test "$withval" = "$ol_val" ; then
1874                         ol_arg="$ol_val"
1875                 fi
1876         done
1877         if test "$ol_arg" = "invalid" ; then
1878                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
1879         fi
1880         ol_with_ldbm_module="$ol_arg"
1881
1882 else
1883         ol_with_ldbm_module="static"
1884 fi
1885 # end --with-ldbm_module
1886
1887 # OpenLDAP --with-ldbm_type
1888         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1889 if test "${with_ldbm_type+set}" = set; then
1890   withval="$with_ldbm_type"
1891   
1892         ol_arg=invalid
1893         for ol_val in auto btree hash ; do
1894                 if test "$withval" = "$ol_val" ; then
1895                         ol_arg="$ol_val"
1896                 fi
1897         done
1898         if test "$ol_arg" = "invalid" ; then
1899                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1900         fi
1901         ol_with_ldbm_type="$ol_arg"
1902
1903 else
1904         ol_with_ldbm_type="auto"
1905 fi
1906 # end --with-ldbm_type
1907
1908
1909 # OpenLDAP --enable-passwd
1910         # Check whether --enable-passwd or --disable-passwd was given.
1911 if test "${enable_passwd+set}" = set; then
1912   enableval="$enable_passwd"
1913   
1914         ol_arg=invalid
1915         for ol_val in auto yes no ; do
1916                 if test "$enableval" = "$ol_val" ; then
1917                         ol_arg="$ol_val"
1918                 fi
1919         done
1920         if test "$ol_arg" = "invalid" ; then
1921                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1922         fi
1923         ol_enable_passwd="$ol_arg"
1924
1925 else
1926         ol_enable_passwd="no"
1927 fi
1928 # end --enable-passwd
1929 # OpenLDAP --with-passwd_module
1930         # Check whether --with-passwd_module or --without-passwd_module was given.
1931 if test "${with_passwd_module+set}" = set; then
1932   withval="$with_passwd_module"
1933   
1934         ol_arg=invalid
1935         for ol_val in static dynamic ; do
1936                 if test "$withval" = "$ol_val" ; then
1937                         ol_arg="$ol_val"
1938                 fi
1939         done
1940         if test "$ol_arg" = "invalid" ; then
1941                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
1942         fi
1943         ol_with_passwd_module="$ol_arg"
1944
1945 else
1946         ol_with_passwd_module="static"
1947 fi
1948 # end --with-passwd_module
1949
1950 # OpenLDAP --enable-perl
1951         # Check whether --enable-perl or --disable-perl was given.
1952 if test "${enable_perl+set}" = set; then
1953   enableval="$enable_perl"
1954   
1955         ol_arg=invalid
1956         for ol_val in auto yes no ; do
1957                 if test "$enableval" = "$ol_val" ; then
1958                         ol_arg="$ol_val"
1959                 fi
1960         done
1961         if test "$ol_arg" = "invalid" ; then
1962                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
1963         fi
1964         ol_enable_perl="$ol_arg"
1965
1966 else
1967         ol_enable_perl="no"
1968 fi
1969 # end --enable-perl
1970 # OpenLDAP --with-perl_module
1971         # Check whether --with-perl_module or --without-perl_module was given.
1972 if test "${with_perl_module+set}" = set; then
1973   withval="$with_perl_module"
1974   
1975         ol_arg=invalid
1976         for ol_val in static dynamic ; do
1977                 if test "$withval" = "$ol_val" ; then
1978                         ol_arg="$ol_val"
1979                 fi
1980         done
1981         if test "$ol_arg" = "invalid" ; then
1982                 { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; }
1983         fi
1984         ol_with_perl_module="$ol_arg"
1985
1986 else
1987         ol_with_perl_module="static"
1988 fi
1989 # end --with-perl_module
1990
1991 # OpenLDAP --enable-shell
1992         # Check whether --enable-shell or --disable-shell was given.
1993 if test "${enable_shell+set}" = set; then
1994   enableval="$enable_shell"
1995   
1996         ol_arg=invalid
1997         for ol_val in auto yes no ; do
1998                 if test "$enableval" = "$ol_val" ; then
1999                         ol_arg="$ol_val"
2000                 fi
2001         done
2002         if test "$ol_arg" = "invalid" ; then
2003                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
2004         fi
2005         ol_enable_shell="$ol_arg"
2006
2007 else
2008         ol_enable_shell="no"
2009 fi
2010 # end --enable-shell
2011 # OpenLDAP --with-shell_module
2012         # Check whether --with-shell_module or --without-shell_module was given.
2013 if test "${with_shell_module+set}" = set; then
2014   withval="$with_shell_module"
2015   
2016         ol_arg=invalid
2017         for ol_val in static dynamic ; do
2018                 if test "$withval" = "$ol_val" ; then
2019                         ol_arg="$ol_val"
2020                 fi
2021         done
2022         if test "$ol_arg" = "invalid" ; then
2023                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
2024         fi
2025         ol_with_shell_module="$ol_arg"
2026
2027 else
2028         ol_with_shell_module="static"
2029 fi
2030 # end --with-shell_module
2031
2032 # OpenLDAP --enable-tcl
2033         # Check whether --enable-tcl or --disable-tcl was given.
2034 if test "${enable_tcl+set}" = set; then
2035   enableval="$enable_tcl"
2036   
2037         ol_arg=invalid
2038         for ol_val in auto yes no ; do
2039                 if test "$enableval" = "$ol_val" ; then
2040                         ol_arg="$ol_val"
2041                 fi
2042         done
2043         if test "$ol_arg" = "invalid" ; then
2044                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
2045         fi
2046         ol_enable_tcl="$ol_arg"
2047
2048 else
2049         ol_enable_tcl="no"
2050 fi
2051 # end --enable-tcl
2052 # OpenLDAP --with-tcl_module
2053         # Check whether --with-tcl_module or --without-tcl_module was given.
2054 if test "${with_tcl_module+set}" = set; then
2055   withval="$with_tcl_module"
2056   
2057         ol_arg=invalid
2058         for ol_val in static dynamic ; do
2059                 if test "$withval" = "$ol_val" ; then
2060                         ol_arg="$ol_val"
2061                 fi
2062         done
2063         if test "$ol_arg" = "invalid" ; then
2064                 { echo "configure: error: bad value $withval for --with-tcl_module" 1>&2; exit 1; }
2065         fi
2066         ol_with_tcl_module="$ol_arg"
2067
2068 else
2069         ol_with_tcl_module="static"
2070 fi
2071 # end --with-tcl_module
2072
2073
2074 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2075 if test "${with_xxslurpdoptions+set}" = set; then
2076   withval="$with_xxslurpdoptions"
2077   :
2078 fi
2079
2080 # OpenLDAP --enable-slurpd
2081         # Check whether --enable-slurpd or --disable-slurpd was given.
2082 if test "${enable_slurpd+set}" = set; then
2083   enableval="$enable_slurpd"
2084   
2085         ol_arg=invalid
2086         for ol_val in auto yes no ; do
2087                 if test "$enableval" = "$ol_val" ; then
2088                         ol_arg="$ol_val"
2089                 fi
2090         done
2091         if test "$ol_arg" = "invalid" ; then
2092                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2093         fi
2094         ol_enable_slurpd="$ol_arg"
2095
2096 else
2097         ol_enable_slurpd="auto"
2098 fi
2099 # end --enable-slurpd
2100
2101 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2102 if test "${with_xxliboptions+set}" = set; then
2103   withval="$with_xxliboptions"
2104   :
2105 fi
2106
2107 # Check whether --enable-static or --disable-static was given.
2108 if test "${enable_static+set}" = set; then
2109   enableval="$enable_static"
2110   p=${PACKAGE-default}
2111 case "$enableval" in
2112 yes) enable_static=yes ;;
2113 no) enable_static=no ;;
2114 *)
2115   enable_static=no
2116   # Look at the argument we got.  We use all the common list separators.
2117   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2118   for pkg in $enableval; do
2119     if test "X$pkg" = "X$p"; then
2120       enable_static=yes
2121     fi
2122   done
2123   IFS="$ac_save_ifs"
2124   ;;
2125 esac
2126 else
2127   enable_static=yes
2128 fi
2129
2130 # Check whether --enable-shared or --disable-shared was given.
2131 if test "${enable_shared+set}" = set; then
2132   enableval="$enable_shared"
2133   p=${PACKAGE-default}
2134 case "$enableval" in
2135 yes) enable_shared=yes ;;
2136 no) enable_shared=no ;;
2137 *)
2138   enable_shared=no
2139   # Look at the argument we got.  We use all the common list separators.
2140   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2141   for pkg in $enableval; do
2142     if test "X$pkg" = "X$p"; then
2143       enable_shared=yes
2144     fi
2145   done
2146   IFS="$ac_save_ifs"
2147   ;;
2148 esac
2149 else
2150   enable_shared=yes
2151 fi
2152
2153
2154 # validate options
2155 if test $ol_enable_dns = yes ; then
2156         if test $ol_enable_referrals = no ; then
2157                 { echo "configure: error: DNS requires --enable-referrals" 1>&2; exit 1; }
2158         fi
2159         if test $ol_enable_referrals = auto ; then
2160                 echo "configure: warning: DNS requires referrals, adding --enable-referrals" 1>&2
2161                 ol_enable_referrals=yes
2162         fi
2163 fi
2164
2165 if test $ol_enable_slapd = no ; then
2166                 if test $ol_enable_bdb2 = yes ; then
2167                 echo "configure: warning: slapd disabled, ignoring --enable-bdb2 argument" 1>&2
2168         fi
2169         if test $ol_enable_ldap = yes ; then
2170                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2171         fi
2172         if test $ol_enable_ldbm = yes ; then
2173                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2174         fi
2175         if test $ol_enable_passwd = yes ; then
2176                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2177         fi
2178         if test $ol_enable_perl = yes ; then
2179                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
2180         fi
2181         if test $ol_enable_shell = yes ; then
2182                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2183         fi
2184         if test $ol_enable_tcl = yes ; then
2185                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
2186         fi
2187         if test $ol_enable_modules = yes ; then
2188                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2189         fi
2190         if test $ol_enable_multimaster = yes ; then
2191                 echo "configure: warning: slapd disabled, ignoring --enable-multimaster argument" 1>&2
2192         fi
2193         if test $ol_enable_wrappers = yes ; then
2194                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2195         fi
2196         if test $ol_enable_phonetic = yes ; then
2197                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2198         fi
2199         if test $ol_enable_quipu = yes ; then
2200                 echo "configure: warning: slapd disabled, ignoring --enable-quipu argument" 1>&2
2201         fi
2202         if test $ol_enable_rlookups = yes ; then
2203                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2204         fi
2205         if test $ol_enable_aci = yes ; then
2206                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2207         fi
2208         if test $ol_enable_discreteaci = yes ; then
2209                 echo "configure: warning: slapd disabled, ignoring --enable-discreteaci argument" 1>&2
2210         fi
2211         if test $ol_with_ldbm_api != auto ; then
2212                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2213         fi
2214         if test $ol_with_ldbm_type != auto ; then
2215                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2216         fi
2217         if test $ol_with_bdb2_module != static ; then
2218                 echo "configure: warning: slapd disabled, ignoring --with-bdb2-module argument" 1>&2
2219         fi
2220         if test $ol_with_ldap_module != static ; then
2221                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2222         fi
2223         if test $ol_with_ldbm_module != static ; then
2224                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2225         fi
2226         if test $ol_with_passwd_module != static ; then
2227                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2228         fi
2229         if test $ol_with_perl_module != static ; then
2230                 echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
2231         fi
2232         if test $ol_with_shell_module != static ; then
2233                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2234         fi
2235         if test $ol_with_tcl_module != static ; then
2236                 echo "configure: warning: slapd disabled, ignoring --with-tcl-module argument" 1>&2
2237         fi
2238         if test $ol_enable_slurpd = yes ; then
2239                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2240         fi
2241
2242         # force settings to no
2243         ol_enable_bdb2=no
2244         ol_enable_ldap=no
2245         ol_enable_ldbm=no
2246         ol_enable_passwd=no
2247         ol_enable_perl=no
2248         ol_enable_shell=no
2249         ol_enable_tcl=no
2250
2251         ol_enable_modules=no
2252         ol_enable_multimaster=no
2253         ol_enable_phonetic=no
2254         ol_enable_quipu=no
2255         ol_enable_rlookups=no
2256         ol_enable_aci=no
2257         ol_enable_discreteaci=no
2258         ol_enable_wrappers=no
2259
2260         ol_with_ldbm_api=no
2261         ol_with_ldbm_type=no
2262
2263         ol_with_bdb2_module=static
2264         ol_with_ldap_module=static
2265         ol_with_ldbm_module=static
2266         ol_with_passwd_module=static
2267         ol_with_perl_module=static
2268         ol_with_shell_module=static
2269         ol_with_tcl_module=static
2270
2271         ol_enable_slurpd=no
2272
2273 elif test $ol_enable_ldbm = no ; then
2274         
2275         if test $ol_with_ldbm_api != auto ; then
2276                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2277         fi
2278
2279         if test $ol_with_ldbm_type != auto ; then
2280                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2281         fi
2282
2283         if test $ol_with_ldbm_module != static ; then
2284                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2285         fi
2286
2287         if test $ol_enable_bdb2 = yes ; then
2288                 { echo "configure: error: BDB2 requires --enable-ldbm" 1>&2; exit 1; }
2289         fi
2290
2291         if test $ol_enable_modules != yes -a \
2292                 $ol_enable_ldap = no -a \
2293                 $ol_enable_passwd = no -a \
2294                 $ol_enable_perl = no -a \
2295                 $ol_enable_shell = no -a \
2296                 $ol_enable_tcl = no ; then
2297                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2298         fi
2299
2300         ol_with_ldbm_api=no
2301         ol_with_ldbm_type=no
2302         ol_with_ldbm_module=static
2303
2304 elif test $ol_enable_bdb2 = yes ; then
2305         
2306         if test $ol_with_ldbm_api != auto -a \
2307                 $ol_with_ldbm_api != db2 ; then
2308                 { echo "configure: error: BDB2 requires LDBM API DB2" 1>&2; exit 1; }
2309         fi
2310
2311         ol_with_ldbm_api=db2
2312
2313 else
2314         
2315         if test $ol_enable_bdb2 != no ; then
2316                 if test $ol_with_ldbm_api != auto -a \
2317                         $ol_with_ldbm_api != db2 ; then
2318                         echo "configure: warning: BDB2 requires LDBM api db2 or auto" 1>&2
2319                         ol_enable_bdb2=no
2320                 fi
2321         fi
2322
2323         if test $ol_with_ldbm_api = gdbm -a \
2324                 $ol_with_ldbm_type = btree ; then
2325                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2326         fi
2327         if test $ol_with_ldbm_api = mdbm -a \
2328                 $ol_with_ldbm_type = btree ; then
2329                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2330         fi
2331         if test $ol_with_ldbm_api = ndbm -a \
2332                 $ol_with_ldbm_type = btree ; then
2333                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2334         fi
2335 fi
2336
2337 if test $ol_enable_slurpd = yes ; then
2338                 if test $ol_with_threads = no ; then
2339                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2340         fi
2341 fi
2342
2343 echo "$ac_t""done" 1>&6
2344
2345 ## Initialize vars
2346 LDAP_LIBS=
2347 LDIF_LIBS=
2348 LDBM_LIBS=
2349 LTHREAD_LIBS=
2350 LUTIL_LIBS=
2351
2352 LDAPD_LIBS=
2353 SLAPD_LIBS=
2354 SLURPD_LIBS=
2355
2356 BUILD_LDAPD=no
2357 BUILD_SLAPD=no
2358 BUILD_SLURPD=no
2359
2360 BUILD_BDB2=no
2361 BUILD_LDAP=no
2362 BUILD_LDBM=no
2363 BUILD_PASSWD=no
2364 BUILD_PERL=no
2365 BUILD_QUIPU=no
2366 BUILD_SHELL=no
2367 BUILD_TCL=no
2368 BUILD_THREAD=no
2369
2370 BUILD_BDB2_DYNAMIC=static
2371 BUILD_LDAP_DYNAMIC=static
2372 BUILD_LDBM_DYNAMIC=static
2373 BUILD_PASSWD_DYNAMIC=static
2374 BUILD_PERL_DYNAMIC=static
2375 BUILD_SHELL_DYNAMIC=static
2376 BUILD_TCL_DYNAMIC=static
2377
2378 SLAPD_MODULES_LDFLAGS=
2379 SLAPD_MODULES_CPPFLAGS=
2380 SLAPD_MODULES_LIST=
2381
2382 SLAPD_PERL_LDFLAGS=
2383 SLAPD_PERL_CPPFLAGS=
2384
2385 KRB_LIBS=
2386 READLINE_LIBS=
2387 SASL_LIBS=
2388 TERMCAP_LIBS=
2389 TLS_LIBS=
2390 MODULES_LIBS=
2391
2392
2393
2394 cat >> confdefs.h <<\EOF
2395 #define HAVE_MKVERSION 1
2396 EOF
2397
2398
2399
2400
2401 ol_aix_threads=no
2402 case "$target" in
2403 *-*-aix*)       if test -z "$CC" ; then
2404                 case "$ol_with_threads" in
2405                 auto | yes |  posix) ol_aix_threads=yes ;;
2406                 esac
2407         fi
2408 ;;
2409 esac
2410
2411 if test $ol_aix_threads = yes ; then
2412         if test -z "${CC}" ; then
2413                 for ac_prog in cc_r xlc_r cc
2414 do
2415 # Extract the first word of "$ac_prog", so it can be a program name with args.
2416 set dummy $ac_prog; ac_word=$2
2417 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2418 echo "configure:2419: checking for $ac_word" >&5
2419 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2420   echo $ac_n "(cached) $ac_c" 1>&6
2421 else
2422   if test -n "$CC"; then
2423   ac_cv_prog_CC="$CC" # Let the user override the test.
2424 else
2425   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2426   ac_dummy="$PATH"
2427   for ac_dir in $ac_dummy; do
2428     test -z "$ac_dir" && ac_dir=.
2429     if test -f $ac_dir/$ac_word; then
2430       ac_cv_prog_CC="$ac_prog"
2431       break
2432     fi
2433   done
2434   IFS="$ac_save_ifs"
2435 fi
2436 fi
2437 CC="$ac_cv_prog_CC"
2438 if test -n "$CC"; then
2439   echo "$ac_t""$CC" 1>&6
2440 else
2441   echo "$ac_t""no" 1>&6
2442 fi
2443
2444 test -n "$CC" && break
2445 done
2446
2447
2448                 if test "$CC" = cc ; then
2449                                                 if test $ol_with_threads != auto ; then
2450                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2451                         else
2452                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2453                         fi
2454                         ol_with_threads=no
2455                 fi
2456         fi
2457
2458         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2459                 ol_with_threads=posix
2460                 ol_cv_pthread_create=yes
2461         fi
2462 fi
2463
2464 if test -z "${CC}"; then
2465         for ac_prog in cc
2466 do
2467 # Extract the first word of "$ac_prog", so it can be a program name with args.
2468 set dummy $ac_prog; ac_word=$2
2469 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2470 echo "configure:2471: checking for $ac_word" >&5
2471 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2472   echo $ac_n "(cached) $ac_c" 1>&6
2473 else
2474   if test -n "$CC"; then
2475   ac_cv_prog_CC="$CC" # Let the user override the test.
2476 else
2477   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2478   ac_dummy="$PATH"
2479   for ac_dir in $ac_dummy; do
2480     test -z "$ac_dir" && ac_dir=.
2481     if test -f $ac_dir/$ac_word; then
2482       ac_cv_prog_CC="$ac_prog"
2483       break
2484     fi
2485   done
2486   IFS="$ac_save_ifs"
2487 fi
2488 fi
2489 CC="$ac_cv_prog_CC"
2490 if test -n "$CC"; then
2491   echo "$ac_t""$CC" 1>&6
2492 else
2493   echo "$ac_t""no" 1>&6
2494 fi
2495
2496 test -n "$CC" && break
2497 done
2498
2499 fi
2500
2501
2502
2503 # Check whether --enable-fast-install or --disable-fast-install was given.
2504 if test "${enable_fast_install+set}" = set; then
2505   enableval="$enable_fast_install"
2506   p=${PACKAGE-default}
2507 case "$enableval" in
2508 yes) enable_fast_install=yes ;;
2509 no) enable_fast_install=no ;;
2510 *)
2511   enable_fast_install=no
2512   # Look at the argument we got.  We use all the common list separators.
2513   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2514   for pkg in $enableval; do
2515     if test "X$pkg" = "X$p"; then
2516       enable_fast_install=yes
2517     fi
2518   done
2519   IFS="$ac_save_ifs"
2520   ;;
2521 esac
2522 else
2523   enable_fast_install=yes
2524 fi
2525
2526 # Extract the first word of "ranlib", so it can be a program name with args.
2527 set dummy ranlib; ac_word=$2
2528 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2529 echo "configure:2530: checking for $ac_word" >&5
2530 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
2531   echo $ac_n "(cached) $ac_c" 1>&6
2532 else
2533   if test -n "$RANLIB"; then
2534   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2535 else
2536   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2537   ac_dummy="$PATH"
2538   for ac_dir in $ac_dummy; do
2539     test -z "$ac_dir" && ac_dir=.
2540     if test -f $ac_dir/$ac_word; then
2541       ac_cv_prog_RANLIB="ranlib"
2542       break
2543     fi
2544   done
2545   IFS="$ac_save_ifs"
2546   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2547 fi
2548 fi
2549 RANLIB="$ac_cv_prog_RANLIB"
2550 if test -n "$RANLIB"; then
2551   echo "$ac_t""$RANLIB" 1>&6
2552 else
2553   echo "$ac_t""no" 1>&6
2554 fi
2555
2556 # Extract the first word of "gcc", so it can be a program name with args.
2557 set dummy gcc; ac_word=$2
2558 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2559 echo "configure:2560: checking for $ac_word" >&5
2560 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2561   echo $ac_n "(cached) $ac_c" 1>&6
2562 else
2563   if test -n "$CC"; then
2564   ac_cv_prog_CC="$CC" # Let the user override the test.
2565 else
2566   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2567   ac_dummy="$PATH"
2568   for ac_dir in $ac_dummy; do
2569     test -z "$ac_dir" && ac_dir=.
2570     if test -f $ac_dir/$ac_word; then
2571       ac_cv_prog_CC="gcc"
2572       break
2573     fi
2574   done
2575   IFS="$ac_save_ifs"
2576 fi
2577 fi
2578 CC="$ac_cv_prog_CC"
2579 if test -n "$CC"; then
2580   echo "$ac_t""$CC" 1>&6
2581 else
2582   echo "$ac_t""no" 1>&6
2583 fi
2584
2585 if test -z "$CC"; then
2586   # Extract the first word of "cc", so it can be a program name with args.
2587 set dummy cc; ac_word=$2
2588 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2589 echo "configure:2590: checking for $ac_word" >&5
2590 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2591   echo $ac_n "(cached) $ac_c" 1>&6
2592 else
2593   if test -n "$CC"; then
2594   ac_cv_prog_CC="$CC" # Let the user override the test.
2595 else
2596   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2597   ac_prog_rejected=no
2598   ac_dummy="$PATH"
2599   for ac_dir in $ac_dummy; do
2600     test -z "$ac_dir" && ac_dir=.
2601     if test -f $ac_dir/$ac_word; then
2602       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2603         ac_prog_rejected=yes
2604         continue
2605       fi
2606       ac_cv_prog_CC="cc"
2607       break
2608     fi
2609   done
2610   IFS="$ac_save_ifs"
2611 if test $ac_prog_rejected = yes; then
2612   # We found a bogon in the path, so make sure we never use it.
2613   set dummy $ac_cv_prog_CC
2614   shift
2615   if test $# -gt 0; then
2616     # We chose a different compiler from the bogus one.
2617     # However, it has the same basename, so the bogon will be chosen
2618     # first if we set CC to just the basename; use the full file name.
2619     shift
2620     set dummy "$ac_dir/$ac_word" "$@"
2621     shift
2622     ac_cv_prog_CC="$@"
2623   fi
2624 fi
2625 fi
2626 fi
2627 CC="$ac_cv_prog_CC"
2628 if test -n "$CC"; then
2629   echo "$ac_t""$CC" 1>&6
2630 else
2631   echo "$ac_t""no" 1>&6
2632 fi
2633
2634   if test -z "$CC"; then
2635     case "`uname -s`" in
2636     *win32* | *WIN32* | *CYGWIN*)
2637       # Extract the first word of "cl", so it can be a program name with args.
2638 set dummy cl; ac_word=$2
2639 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2640 echo "configure:2641: checking for $ac_word" >&5
2641 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2642   echo $ac_n "(cached) $ac_c" 1>&6
2643 else
2644   if test -n "$CC"; then
2645   ac_cv_prog_CC="$CC" # Let the user override the test.
2646 else
2647   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2648   ac_dummy="$PATH"
2649   for ac_dir in $ac_dummy; do
2650     test -z "$ac_dir" && ac_dir=.
2651     if test -f $ac_dir/$ac_word; then
2652       ac_cv_prog_CC="cl"
2653       break
2654     fi
2655   done
2656   IFS="$ac_save_ifs"
2657 fi
2658 fi
2659 CC="$ac_cv_prog_CC"
2660 if test -n "$CC"; then
2661   echo "$ac_t""$CC" 1>&6
2662 else
2663   echo "$ac_t""no" 1>&6
2664 fi
2665  ;;
2666     esac
2667   fi
2668   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2669 fi
2670
2671 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2672 echo "configure:2673: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
2673
2674 ac_ext=c
2675 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2676 ac_cpp='$CPP $CPPFLAGS'
2677 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2678 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2679 cross_compiling=$ac_cv_prog_cc_cross
2680
2681 cat > conftest.$ac_ext << EOF
2682
2683 #line 2684 "configure"
2684 #include "confdefs.h"
2685
2686 main(){return(0);}
2687 EOF
2688 if { (eval echo configure:2689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2689   ac_cv_prog_cc_works=yes
2690   # If we can't run a trivial program, we are probably using a cross compiler.
2691   if (./conftest; exit) 2>/dev/null; then
2692     ac_cv_prog_cc_cross=no
2693   else
2694     ac_cv_prog_cc_cross=yes
2695   fi
2696 else
2697   echo "configure: failed program was:" >&5
2698   cat conftest.$ac_ext >&5
2699   ac_cv_prog_cc_works=no
2700 fi
2701 rm -fr conftest*
2702 ac_ext=c
2703 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2704 ac_cpp='$CPP $CPPFLAGS'
2705 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2706 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2707 cross_compiling=$ac_cv_prog_cc_cross
2708
2709 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2710 if test $ac_cv_prog_cc_works = no; then
2711   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2712 fi
2713 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2714 echo "configure:2715: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
2715 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2716 cross_compiling=$ac_cv_prog_cc_cross
2717
2718 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2719 echo "configure:2720: checking whether we are using GNU C" >&5
2720 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
2721   echo $ac_n "(cached) $ac_c" 1>&6
2722 else
2723   cat > conftest.c <<EOF
2724 #ifdef __GNUC__
2725   yes;
2726 #endif
2727 EOF
2728 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2729: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2729   ac_cv_prog_gcc=yes
2730 else
2731   ac_cv_prog_gcc=no
2732 fi
2733 fi
2734
2735 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2736
2737 if test $ac_cv_prog_gcc = yes; then
2738   GCC=yes
2739 else
2740   GCC=
2741 fi
2742
2743 ac_test_CFLAGS="${CFLAGS+set}"
2744 ac_save_CFLAGS="$CFLAGS"
2745 CFLAGS=
2746 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2747 echo "configure:2748: checking whether ${CC-cc} accepts -g" >&5
2748 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
2749   echo $ac_n "(cached) $ac_c" 1>&6
2750 else
2751   echo 'void f(){}' > conftest.c
2752 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2753   ac_cv_prog_cc_g=yes
2754 else
2755   ac_cv_prog_cc_g=no
2756 fi
2757 rm -f conftest*
2758
2759 fi
2760
2761 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2762 if test "$ac_test_CFLAGS" = set; then
2763   CFLAGS="$ac_save_CFLAGS"
2764 elif test $ac_cv_prog_cc_g = yes; then
2765   if test "$GCC" = yes; then
2766     CFLAGS="-g -O2"
2767   else
2768     CFLAGS="-g"
2769   fi
2770 else
2771   if test "$GCC" = yes; then
2772     CFLAGS="-O2"
2773   else
2774     CFLAGS=
2775   fi
2776 fi
2777
2778 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2779 if test "${with_gnu_ld+set}" = set; then
2780   withval="$with_gnu_ld"
2781   test "$withval" = no || with_gnu_ld=yes
2782 else
2783   with_gnu_ld=no
2784 fi
2785
2786 ac_prog=ld
2787 if test "$ac_cv_prog_gcc" = yes; then
2788   # Check if gcc -print-prog-name=ld gives a path.
2789   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2790 echo "configure:2791: checking for ld used by GCC" >&5
2791   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2792   case "$ac_prog" in
2793     # Accept absolute paths.
2794     [\\/]* | [A-Za-z]:[\\/]*)
2795       re_direlt='/[^/][^/]*/\.\./'
2796       # Canonicalize the path of ld
2797       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2798       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2799         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2800       done
2801       test -z "$LD" && LD="$ac_prog"
2802       ;;
2803   "")
2804     # If it fails, then pretend we aren't using GCC.
2805     ac_prog=ld
2806     ;;
2807   *)
2808     # If it is relative, then search for the first ld in PATH.
2809     with_gnu_ld=unknown
2810     ;;
2811   esac
2812 elif test "$with_gnu_ld" = yes; then
2813   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2814 echo "configure:2815: checking for GNU ld" >&5
2815 else
2816   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2817 echo "configure:2818: checking for non-GNU ld" >&5
2818 fi
2819 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
2820   echo $ac_n "(cached) $ac_c" 1>&6
2821 else
2822   if test -z "$LD"; then
2823   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2824   for ac_dir in $PATH; do
2825     test -z "$ac_dir" && ac_dir=.
2826     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2827       ac_cv_path_LD="$ac_dir/$ac_prog"
2828       # Check to see if the program is GNU ld.  I'd rather use --version,
2829       # but apparently some GNU ld's only accept -v.
2830       # Break only if it was the GNU/non-GNU ld that we prefer.
2831       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2832         test "$with_gnu_ld" != no && break
2833       else
2834         test "$with_gnu_ld" != yes && break
2835       fi
2836     fi
2837   done
2838   IFS="$ac_save_ifs"
2839 else
2840   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2841 fi
2842 fi
2843
2844 LD="$ac_cv_path_LD"
2845 if test -n "$LD"; then
2846   echo "$ac_t""$LD" 1>&6
2847 else
2848   echo "$ac_t""no" 1>&6
2849 fi
2850 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2851
2852 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2853 echo "configure:2854: checking if the linker ($LD) is GNU ld" >&5
2854 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
2855   echo $ac_n "(cached) $ac_c" 1>&6
2856 else
2857   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2858 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2859   ac_cv_prog_gnu_ld=yes
2860 else
2861   ac_cv_prog_gnu_ld=no
2862 fi
2863 fi
2864
2865 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2866
2867
2868 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2869 echo "configure:2870: checking for BSD-compatible nm" >&5
2870 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
2871   echo $ac_n "(cached) $ac_c" 1>&6
2872 else
2873   if test -n "$NM"; then
2874   # Let the user override the test.
2875   ac_cv_path_NM="$NM"
2876 else
2877   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2878   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
2879     test -z "$ac_dir" && ac_dir=.
2880     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
2881       # Check to see if the nm accepts a BSD-compat flag.
2882       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2883       #   nm: unknown option "B" ignored
2884       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2885         ac_cv_path_NM="$ac_dir/nm -B"
2886         break
2887       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2888         ac_cv_path_NM="$ac_dir/nm -p"
2889         break
2890       else
2891         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
2892         continue # so that we can try to find one that supports BSD flags
2893       fi
2894     fi
2895   done
2896   IFS="$ac_save_ifs"
2897   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2898 fi
2899 fi
2900
2901 NM="$ac_cv_path_NM"
2902 echo "$ac_t""$NM" 1>&6
2903
2904
2905 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2906 echo "configure:2907: checking whether ln -s works" >&5
2907 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
2908   echo $ac_n "(cached) $ac_c" 1>&6
2909 else
2910   rm -f conftestdata
2911 if ln -s X conftestdata 2>/dev/null
2912 then
2913   rm -f conftestdata
2914   ac_cv_prog_LN_S="ln -s"
2915 else
2916   ac_cv_prog_LN_S=ln
2917 fi
2918 fi
2919 LN_S="$ac_cv_prog_LN_S"
2920 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2921   echo "$ac_t""yes" 1>&6
2922 else
2923   echo "$ac_t""no" 1>&6
2924 fi
2925
2926
2927 # Check for any special flags to pass to ltconfig.
2928 libtool_flags="--cache-file=$cache_file"
2929 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2930 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2931 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
2932 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2933 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2934 libtool_flags="$libtool_flags --enable-dlopen"
2935
2936 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
2937 if test "${enable_libtool_lock+set}" = set; then
2938   enableval="$enable_libtool_lock"
2939   :
2940 fi
2941
2942 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
2943 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
2944
2945 # Some flags need to be propagated to the compiler or linker for good
2946 # libtool support.
2947 case "$host" in
2948 *-*-irix6*)
2949   # Find out which ABI we are using.
2950   echo '#line 2951 "configure"' > conftest.$ac_ext
2951   if { (eval echo configure:2952: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2952     case "`/usr/bin/file conftest.o`" in
2953     *32-bit*)
2954       LD="${LD-ld} -32"
2955       ;;
2956     *N32*)
2957       LD="${LD-ld} -n32"
2958       ;;
2959     *64-bit*)
2960       LD="${LD-ld} -64"
2961       ;;
2962     esac
2963   fi
2964   rm -rf conftest*
2965   ;;
2966
2967 *-*-sco3.2v5*)
2968   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2969   SAVE_CFLAGS="$CFLAGS"
2970   CFLAGS="$CFLAGS -belf"
2971   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
2972 echo "configure:2973: checking whether the C compiler needs -belf" >&5
2973 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
2974   echo $ac_n "(cached) $ac_c" 1>&6
2975 else
2976   cat > conftest.$ac_ext <<EOF
2977 #line 2978 "configure"
2978 #include "confdefs.h"
2979
2980 int main() {
2981
2982 ; return 0; }
2983 EOF
2984 if { (eval echo configure:2985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2985   rm -rf conftest*
2986   lt_cv_cc_needs_belf=yes
2987 else
2988   echo "configure: failed program was:" >&5
2989   cat conftest.$ac_ext >&5
2990   rm -rf conftest*
2991   lt_cv_cc_needs_belf=no
2992 fi
2993 rm -f conftest*
2994 fi
2995
2996 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
2997   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2998     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2999     CFLAGS="$SAVE_CFLAGS"
3000   fi
3001   ;;
3002
3003
3004 esac
3005
3006
3007 # Save cache, so that ltconfig can load it
3008
3009
3010 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
3011 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
3012 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
3013 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
3014 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
3015 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
3016 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
3017 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
3018
3019 # Reload cache, that may have been modified by ltconfig
3020
3021
3022 # This can be used to rebuild libtool when needed
3023 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
3024
3025 # Always use our own libtool.
3026 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3027
3028 # Redirect the config.log output again, so that the ltconfig log is not
3029 # clobbered by the next message.
3030 exec 5>>./config.log
3031
3032
3033 for ac_prog in mawk gawk nawk awk
3034 do
3035 # Extract the first word of "$ac_prog", so it can be a program name with args.
3036 set dummy $ac_prog; ac_word=$2
3037 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3038 echo "configure:3039: checking for $ac_word" >&5
3039 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
3040   echo $ac_n "(cached) $ac_c" 1>&6
3041 else
3042   if test -n "$AWK"; then
3043   ac_cv_prog_AWK="$AWK" # Let the user override the test.
3044 else
3045   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3046   ac_dummy="$PATH"
3047   for ac_dir in $ac_dummy; do
3048     test -z "$ac_dir" && ac_dir=.
3049     if test -f $ac_dir/$ac_word; then
3050       ac_cv_prog_AWK="$ac_prog"
3051       break
3052     fi
3053   done
3054   IFS="$ac_save_ifs"
3055 fi
3056 fi
3057 AWK="$ac_cv_prog_AWK"
3058 if test -n "$AWK"; then
3059   echo "$ac_t""$AWK" 1>&6
3060 else
3061   echo "$ac_t""no" 1>&6
3062 fi
3063
3064 test -n "$AWK" && break
3065 done
3066
3067 # test for ln hardlink support
3068 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
3069 echo "configure:3070: checking whether ln works" >&5
3070 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
3071   echo $ac_n "(cached) $ac_c" 1>&6
3072 else
3073   rm -f conftest.src conftest.dst
3074 echo "conftest" > conftest.src
3075 if ln conftest.src conftest.dst 2>/dev/null
3076 then
3077   ol_cv_prog_LN_H="ln"
3078 else
3079   ol_cv_prog_LN_H="cp"
3080 fi
3081 rm -f conftest.src conftest.dst
3082
3083 fi
3084 LN_H="$ol_cv_prog_LN_H"
3085 if test "$ol_cv_prog_LN_H" = "ln"; then
3086         echo "$ac_t""yes" 1>&6
3087 else
3088         echo "$ac_t""no" 1>&6
3089 fi
3090
3091 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3092 echo "configure:3093: checking whether ln -s works" >&5
3093 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3094   echo $ac_n "(cached) $ac_c" 1>&6
3095 else
3096   rm -f conftestdata
3097 if ln -s X conftestdata 2>/dev/null
3098 then
3099   rm -f conftestdata
3100   ac_cv_prog_LN_S="ln -s"
3101 else
3102   ac_cv_prog_LN_S=ln
3103 fi
3104 fi
3105 LN_S="$ac_cv_prog_LN_S"
3106 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3107   echo "$ac_t""yes" 1>&6
3108 else
3109   echo "$ac_t""no" 1>&6
3110 fi
3111
3112
3113 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
3114         LN_S="$LN_H"
3115 fi
3116
3117 # Extract the first word of "sendmail", so it can be a program name with args.
3118 set dummy sendmail; ac_word=$2
3119 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3120 echo "configure:3121: checking for $ac_word" >&5
3121 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
3122   echo $ac_n "(cached) $ac_c" 1>&6
3123 else
3124   case "$SENDMAIL" in
3125   /*)
3126   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
3127   ;;
3128   ?:/*)                  
3129   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
3130   ;;
3131   *)
3132   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3133   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
3134   for ac_dir in $ac_dummy; do 
3135     test -z "$ac_dir" && ac_dir=.
3136     if test -f $ac_dir/$ac_word; then
3137       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
3138       break
3139     fi
3140   done
3141   IFS="$ac_save_ifs"
3142   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
3143   ;;
3144 esac
3145 fi
3146 SENDMAIL="$ac_cv_path_SENDMAIL"
3147 if test -n "$SENDMAIL"; then
3148   echo "$ac_t""$SENDMAIL" 1>&6
3149 else
3150   echo "$ac_t""no" 1>&6
3151 fi
3152
3153 # Extract the first word of "vi", so it can be a program name with args.
3154 set dummy vi; ac_word=$2
3155 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3156 echo "configure:3157: checking for $ac_word" >&5
3157 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
3158   echo $ac_n "(cached) $ac_c" 1>&6
3159 else
3160   case "$EDITOR" in
3161   /*)
3162   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
3163   ;;
3164   ?:/*)                  
3165   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
3166   ;;
3167   *)
3168   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3169   ac_dummy="$PATH:/usr/ucb"
3170   for ac_dir in $ac_dummy; do 
3171     test -z "$ac_dir" && ac_dir=.
3172     if test -f $ac_dir/$ac_word; then
3173       ac_cv_path_EDITOR="$ac_dir/$ac_word"
3174       break
3175     fi
3176   done
3177   IFS="$ac_save_ifs"
3178   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
3179   ;;
3180 esac
3181 fi
3182 EDITOR="$ac_cv_path_EDITOR"
3183 if test -n "$EDITOR"; then
3184   echo "$ac_t""$EDITOR" 1>&6
3185 else
3186   echo "$ac_t""no" 1>&6
3187 fi
3188
3189 # Extract the first word of "finger", so it can be a program name with args.
3190 set dummy finger; ac_word=$2
3191 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3192 echo "configure:3193: checking for $ac_word" >&5
3193 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
3194   echo $ac_n "(cached) $ac_c" 1>&6
3195 else
3196   case "$FINGER" in
3197   /*)
3198   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
3199   ;;
3200   ?:/*)                  
3201   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
3202   ;;
3203   *)
3204   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3205   ac_dummy="$PATH:/usr/ucb"
3206   for ac_dir in $ac_dummy; do 
3207     test -z "$ac_dir" && ac_dir=.
3208     if test -f $ac_dir/$ac_word; then
3209       ac_cv_path_FINGER="$ac_dir/$ac_word"
3210       break
3211     fi
3212   done
3213   IFS="$ac_save_ifs"
3214   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
3215   ;;
3216 esac
3217 fi
3218 FINGER="$ac_cv_path_FINGER"
3219 if test -n "$FINGER"; then
3220   echo "$ac_t""$FINGER" 1>&6
3221 else
3222   echo "$ac_t""no" 1>&6
3223 fi
3224
3225
3226 ol_link_perl=no
3227 if test $ol_enable_perl != no ; then
3228         # Extract the first word of "perl", so it can be a program name with args.
3229 set dummy perl; ac_word=$2
3230 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3231 echo "configure:3232: checking for $ac_word" >&5
3232 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
3233   echo $ac_n "(cached) $ac_c" 1>&6
3234 else
3235   case "$PERLBIN" in
3236   /*)
3237   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
3238   ;;
3239   ?:/*)                  
3240   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
3241   ;;
3242   *)
3243   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3244   ac_dummy="$PATH"
3245   for ac_dir in $ac_dummy; do 
3246     test -z "$ac_dir" && ac_dir=.
3247     if test -f $ac_dir/$ac_word; then
3248       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
3249       break
3250     fi
3251   done
3252   IFS="$ac_save_ifs"
3253   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
3254   ;;
3255 esac
3256 fi
3257 PERLBIN="$ac_cv_path_PERLBIN"
3258 if test -n "$PERLBIN"; then
3259   echo "$ac_t""$PERLBIN" 1>&6
3260 else
3261   echo "$ac_t""no" 1>&6
3262 fi
3263
3264
3265         if test "no$PERLBIN" = "no" ; then
3266                 if test $ol_enable_perl = yes ; then
3267                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
3268                 fi
3269
3270         else
3271                 SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3272                 SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
3273
3274                                 ol_link_perl=yes
3275         fi
3276 fi
3277
3278 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3279 echo "configure:3280: checking how to run the C preprocessor" >&5
3280 # On Suns, sometimes $CPP names a directory.
3281 if test -n "$CPP" && test -d "$CPP"; then
3282   CPP=
3283 fi
3284 if test -z "$CPP"; then
3285 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3286   echo $ac_n "(cached) $ac_c" 1>&6
3287 else
3288     # This must be in double quotes, not single quotes, because CPP may get
3289   # substituted into the Makefile and "${CC-cc}" will confuse make.
3290   CPP="${CC-cc} -E"
3291   # On the NeXT, cc -E runs the code through the compiler's parser,
3292   # not just through cpp.
3293   cat > conftest.$ac_ext <<EOF
3294 #line 3295 "configure"
3295 #include "confdefs.h"
3296 #include <assert.h>
3297 Syntax Error
3298 EOF
3299 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3300 { (eval echo configure:3301: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3301 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3302 if test -z "$ac_err"; then
3303   :
3304 else
3305   echo "$ac_err" >&5
3306   echo "configure: failed program was:" >&5
3307   cat conftest.$ac_ext >&5
3308   rm -rf conftest*
3309   CPP="${CC-cc} -E -traditional-cpp"
3310   cat > conftest.$ac_ext <<EOF
3311 #line 3312 "configure"
3312 #include "confdefs.h"
3313 #include <assert.h>
3314 Syntax Error
3315 EOF
3316 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3317 { (eval echo configure:3318: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3318 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3319 if test -z "$ac_err"; then
3320   :
3321 else
3322   echo "$ac_err" >&5
3323   echo "configure: failed program was:" >&5
3324   cat conftest.$ac_ext >&5
3325   rm -rf conftest*
3326   CPP="${CC-cc} -nologo -E"
3327   cat > conftest.$ac_ext <<EOF
3328 #line 3329 "configure"
3329 #include "confdefs.h"
3330 #include <assert.h>
3331 Syntax Error
3332 EOF
3333 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3334 { (eval echo configure:3335: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3335 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3336 if test -z "$ac_err"; then
3337   :
3338 else
3339   echo "$ac_err" >&5
3340   echo "configure: failed program was:" >&5
3341   cat conftest.$ac_ext >&5
3342   rm -rf conftest*
3343   CPP=/lib/cpp
3344 fi
3345 rm -f conftest*
3346 fi
3347 rm -f conftest*
3348 fi
3349 rm -f conftest*
3350   ac_cv_prog_CPP="$CPP"
3351 fi
3352   CPP="$ac_cv_prog_CPP"
3353 else
3354   ac_cv_prog_CPP="$CPP"
3355 fi
3356 echo "$ac_t""$CPP" 1>&6
3357
3358
3359 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3360         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3361
3362 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3363         echo "configure: warning: programs compiled here do run here..." 1>&2
3364         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3365
3366 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3367         echo "configure: warning: programs compiled here do not run here..." 1>&2
3368         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3369 fi
3370
3371 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3372 echo "configure:3373: checking for AIX" >&5
3373 cat > conftest.$ac_ext <<EOF
3374 #line 3375 "configure"
3375 #include "confdefs.h"
3376 #ifdef _AIX
3377   yes
3378 #endif
3379
3380 EOF
3381 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3382   egrep "yes" >/dev/null 2>&1; then
3383   rm -rf conftest*
3384   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3385 #define _ALL_SOURCE 1
3386 EOF
3387
3388 else
3389   rm -rf conftest*
3390   echo "$ac_t""no" 1>&6
3391 fi
3392 rm -f conftest*
3393
3394
3395 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3396 echo "configure:3397: checking for POSIXized ISC" >&5
3397 if test -d /etc/conf/kconfig.d &&
3398   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3399 then
3400   echo "$ac_t""yes" 1>&6
3401   ISC=yes # If later tests want to check for ISC.
3402   cat >> confdefs.h <<\EOF
3403 #define _POSIX_SOURCE 1
3404 EOF
3405
3406   if test "$GCC" = yes; then
3407     CC="$CC -posix"
3408   else
3409     CC="$CC -Xp"
3410   fi
3411 else
3412   echo "$ac_t""no" 1>&6
3413   ISC=
3414 fi
3415
3416 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3417 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3418 echo "configure:3419: checking for minix/config.h" >&5
3419 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3420   echo $ac_n "(cached) $ac_c" 1>&6
3421 else
3422   cat > conftest.$ac_ext <<EOF
3423 #line 3424 "configure"
3424 #include "confdefs.h"
3425 #include <minix/config.h>
3426 EOF
3427 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3428 { (eval echo configure:3429: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3429 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3430 if test -z "$ac_err"; then
3431   rm -rf conftest*
3432   eval "ac_cv_header_$ac_safe=yes"
3433 else
3434   echo "$ac_err" >&5
3435   echo "configure: failed program was:" >&5
3436   cat conftest.$ac_ext >&5
3437   rm -rf conftest*
3438   eval "ac_cv_header_$ac_safe=no"
3439 fi
3440 rm -f conftest*
3441 fi
3442 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3443   echo "$ac_t""yes" 1>&6
3444   MINIX=yes
3445 else
3446   echo "$ac_t""no" 1>&6
3447 MINIX=
3448 fi
3449
3450 if test "$MINIX" = yes; then
3451   cat >> confdefs.h <<\EOF
3452 #define _POSIX_SOURCE 1
3453 EOF
3454
3455   cat >> confdefs.h <<\EOF
3456 #define _POSIX_1_SOURCE 2
3457 EOF
3458
3459   cat >> confdefs.h <<\EOF
3460 #define _MINIX 1
3461 EOF
3462
3463 fi
3464
3465
3466 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3467 echo "configure:3468: checking for Cygwin environment" >&5
3468 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
3469   echo $ac_n "(cached) $ac_c" 1>&6
3470 else
3471   cat > conftest.$ac_ext <<EOF
3472 #line 3473 "configure"
3473 #include "confdefs.h"
3474
3475 int main() {
3476
3477 #ifndef __CYGWIN__
3478 #define __CYGWIN__ __CYGWIN32__
3479 #endif
3480 return __CYGWIN__;
3481 ; return 0; }
3482 EOF
3483 if { (eval echo configure:3484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3484   rm -rf conftest*
3485   ac_cv_cygwin=yes
3486 else
3487   echo "configure: failed program was:" >&5
3488   cat conftest.$ac_ext >&5
3489   rm -rf conftest*
3490   ac_cv_cygwin=no
3491 fi
3492 rm -f conftest*
3493 fi
3494
3495 echo "$ac_t""$ac_cv_cygwin" 1>&6
3496 CYGWIN=
3497 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3498 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3499 echo "configure:3500: checking for mingw32 environment" >&5
3500 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
3501   echo $ac_n "(cached) $ac_c" 1>&6
3502 else
3503   cat > conftest.$ac_ext <<EOF
3504 #line 3505 "configure"
3505 #include "confdefs.h"
3506
3507 int main() {
3508 return __MINGW32__;
3509 ; return 0; }
3510 EOF
3511 if { (eval echo configure:3512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3512   rm -rf conftest*
3513   ac_cv_mingw32=yes
3514 else
3515   echo "configure: failed program was:" >&5
3516   cat conftest.$ac_ext >&5
3517   rm -rf conftest*
3518   ac_cv_mingw32=no
3519 fi
3520 rm -f conftest*
3521 fi
3522
3523 echo "$ac_t""$ac_cv_mingw32" 1>&6
3524 MINGW32=
3525 test "$ac_cv_mingw32" = yes && MINGW32=yes
3526 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
3527 echo "configure:3528: checking for EMX OS/2 environment" >&5
3528 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
3529   echo $ac_n "(cached) $ac_c" 1>&6
3530 else
3531   cat > conftest.$ac_ext <<EOF
3532 #line 3533 "configure"
3533 #include "confdefs.h"
3534
3535 int main() {
3536 return __EMX__;
3537 ; return 0; }
3538 EOF
3539 if { (eval echo configure:3540: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3540   rm -rf conftest*
3541   ac_cv_emxos2=yes
3542 else
3543   echo "configure: failed program was:" >&5
3544   cat conftest.$ac_ext >&5
3545   rm -rf conftest*
3546   ac_cv_emxos2=no
3547 fi
3548 rm -f conftest*
3549 fi
3550
3551 echo "$ac_t""$ac_cv_emxos2" 1>&6
3552 EMXOS2=
3553 test "$ac_cv_emxos2" = yes && EMXOS2=yes
3554
3555
3556
3557 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
3558 echo "configure:3559: checking for executable suffix" >&5
3559 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
3560   echo $ac_n "(cached) $ac_c" 1>&6
3561 else
3562   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
3563   ac_cv_exeext=.exe
3564 else
3565   rm -f conftest*
3566   echo 'int main () { return 0; }' > conftest.$ac_ext
3567   ac_cv_exeext=
3568   if { (eval echo configure:3569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
3569     for file in conftest.*; do
3570       case $file in
3571       *.c | *.C | *.o | *.obj | *.xcoff) ;;
3572       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
3573       esac
3574     done
3575   else
3576     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
3577   fi
3578   rm -f conftest*
3579   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
3580 fi
3581 fi
3582
3583 EXEEXT=""
3584 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
3585 echo "$ac_t""${ac_cv_exeext}" 1>&6
3586 ac_exeext=$EXEEXT
3587
3588 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3589 echo "configure:3590: checking for object suffix" >&5
3590 if eval "test \"\${ac_cv_objext+set}\" = set"; then
3591   echo $ac_n "(cached) $ac_c" 1>&6
3592 else
3593   rm -f conftest*
3594 echo 'int i = 1;' > conftest.$ac_ext
3595 if { (eval echo configure:3596: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3596   for ac_file in conftest.*; do
3597     case $ac_file in
3598     *.c) ;;
3599     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
3600     esac
3601   done
3602 else
3603   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
3604 fi
3605 rm -f conftest*
3606 fi
3607
3608 echo "$ac_t""$ac_cv_objext" 1>&6
3609 OBJEXT=$ac_cv_objext
3610 ac_objext=$ac_cv_objext
3611
3612
3613 cat >> confdefs.h <<EOF
3614 #define EXEEXT "${EXEEXT}"
3615 EOF
3616
3617
3618 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
3619 echo "configure:3620: checking for be_app in -lbe" >&5
3620 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
3621 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3622   echo $ac_n "(cached) $ac_c" 1>&6
3623 else
3624   ac_save_LIBS="$LIBS"
3625 LIBS="-lbe -lroot -lnet $LIBS"
3626 cat > conftest.$ac_ext <<EOF
3627 #line 3628 "configure"
3628 #include "confdefs.h"
3629 /* Override any gcc2 internal prototype to avoid an error.  */
3630 /* We use char because int might match the return type of a gcc2
3631     builtin and then its argument prototype would still apply.  */
3632 char be_app();
3633
3634 int main() {
3635 be_app()
3636 ; return 0; }
3637 EOF
3638 if { (eval echo configure:3639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3639   rm -rf conftest*
3640   eval "ac_cv_lib_$ac_lib_var=yes"
3641 else
3642   echo "configure: failed program was:" >&5
3643   cat conftest.$ac_ext >&5
3644   rm -rf conftest*
3645   eval "ac_cv_lib_$ac_lib_var=no"
3646 fi
3647 rm -f conftest*
3648 LIBS="$ac_save_LIBS"
3649
3650 fi
3651 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3652   echo "$ac_t""yes" 1>&6
3653   LIBS="$LIBS -lbe -lroot -lnet"
3654 else
3655   echo "$ac_t""no" 1>&6
3656 :
3657 fi
3658
3659
3660
3661
3662
3663 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
3664 echo "configure:3665: checking for ${CC-cc} option to accept ANSI C" >&5
3665 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
3666   echo $ac_n "(cached) $ac_c" 1>&6
3667 else
3668   am_cv_prog_cc_stdc=no
3669 ac_save_CC="$CC"
3670 # Don't try gcc -ansi; that turns off useful extensions and
3671 # breaks some systems' header files.
3672 # AIX                   -qlanglvl=ansi
3673 # Ultrix and OSF/1      -std1
3674 # HP-UX 10.20 and later -Ae
3675 # HP-UX older versions  -Aa -D_HPUX_SOURCE
3676 # SVR4                  -Xc -D__EXTENSIONS__
3677 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3678 do
3679   CC="$ac_save_CC $ac_arg"
3680   cat > conftest.$ac_ext <<EOF
3681 #line 3682 "configure"
3682 #include "confdefs.h"
3683 #include <stdarg.h>
3684 #include <stdio.h>
3685 #include <sys/types.h>
3686 #include <sys/stat.h>
3687 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3688 struct buf { int x; };
3689 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3690 static char *e (p, i)
3691      char **p;
3692      int i;
3693 {
3694   return p[i];
3695 }
3696 static char *f (char * (*g) (char **, int), char **p, ...)
3697 {
3698   char *s;
3699   va_list v;
3700   va_start (v,p);
3701   s = g (p, va_arg (v,int));
3702   va_end (v);
3703   return s;
3704 }
3705 int test (int i, double x);
3706 struct s1 {int (*f) (int a);};
3707 struct s2 {int (*f) (double a);};
3708 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3709 int argc;
3710 char **argv;
3711
3712 int main() {
3713
3714 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3715
3716 ; return 0; }
3717 EOF
3718 if { (eval echo configure:3719: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3719   rm -rf conftest*
3720   am_cv_prog_cc_stdc="$ac_arg"; break
3721 else
3722   echo "configure: failed program was:" >&5
3723   cat conftest.$ac_ext >&5
3724 fi
3725 rm -f conftest*
3726 done
3727 CC="$ac_save_CC"
3728
3729 fi
3730
3731 if test -z "$am_cv_prog_cc_stdc"; then
3732   echo "$ac_t""none needed" 1>&6
3733 else
3734   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
3735 fi
3736 case "x$am_cv_prog_cc_stdc" in
3737   x|xno) ;;
3738   *) CC="$CC $am_cv_prog_cc_stdc" ;;
3739 esac
3740
3741 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
3742         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
3743 fi
3744
3745 # test for make depend flag
3746 OL_MKDEP=
3747 OL_MKDEP_FLAGS=
3748 if test -z "${MKDEP}"; then
3749         OL_MKDEP="${CC-cc}"
3750         if test -z "${MKDEP_FLAGS}"; then
3751                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
3752 echo "configure:3753: checking for ${OL_MKDEP} depend flag" >&5
3753 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
3754   echo $ac_n "(cached) $ac_c" 1>&6
3755 else
3756   
3757                         ol_cv_mkdep=no
3758                         for flag in "-M" "-xM"; do
3759                                 cat > conftest.c <<EOF
3760  noCode;
3761 EOF
3762                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3763: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
3763                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
3764                                 then
3765                                         if test ! -f conftest."${ac_object}" ; then
3766                                                 ol_cv_mkdep=$flag
3767                                                 OL_MKDEP_FLAGS="$flag"
3768                                                 break
3769                                         fi
3770                                 fi
3771                         done
3772                         rm -f conftest*
3773                 
3774 fi
3775
3776 echo "$ac_t""$ol_cv_mkdep" 1>&6
3777         else
3778                 cc_cv_mkdep=yes
3779                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3780         fi
3781 else
3782         cc_cv_mkdep=yes
3783         OL_MKDEP="${MKDEP}"
3784         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3785 fi
3786
3787
3788
3789 if test "${ol_cv_mkdep}" = no ; then
3790         # this will soon become an error
3791         echo "configure: warning: do not know how to generate dependencies" 1>&2
3792 fi
3793
3794 ol_link_modules=no
3795 if test $ol_enable_modules != no ; then
3796         for ac_hdr in ltdl.h
3797 do
3798 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3799 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3800 echo "configure:3801: checking for $ac_hdr" >&5
3801 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3802   echo $ac_n "(cached) $ac_c" 1>&6
3803 else
3804   cat > conftest.$ac_ext <<EOF
3805 #line 3806 "configure"
3806 #include "confdefs.h"
3807 #include <$ac_hdr>
3808 EOF
3809 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3810 { (eval echo configure:3811: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3811 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3812 if test -z "$ac_err"; then
3813   rm -rf conftest*
3814   eval "ac_cv_header_$ac_safe=yes"
3815 else
3816   echo "$ac_err" >&5
3817   echo "configure: failed program was:" >&5
3818   cat conftest.$ac_ext >&5
3819   rm -rf conftest*
3820   eval "ac_cv_header_$ac_safe=no"
3821 fi
3822 rm -f conftest*
3823 fi
3824 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3825   echo "$ac_t""yes" 1>&6
3826     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3827   cat >> confdefs.h <<EOF
3828 #define $ac_tr_hdr 1
3829 EOF
3830  
3831 else
3832   echo "$ac_t""no" 1>&6
3833 fi
3834 done
3835
3836
3837         if test $ac_cv_header_ltdl_h = no ; then
3838                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
3839
3840         fi
3841
3842         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
3843 echo "configure:3844: checking for lt_dlinit in -lltdl" >&5
3844 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
3845 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3846   echo $ac_n "(cached) $ac_c" 1>&6
3847 else
3848   ac_save_LIBS="$LIBS"
3849 LIBS="-lltdl  $LIBS"
3850 cat > conftest.$ac_ext <<EOF
3851 #line 3852 "configure"
3852 #include "confdefs.h"
3853 /* Override any gcc2 internal prototype to avoid an error.  */
3854 /* We use char because int might match the return type of a gcc2
3855     builtin and then its argument prototype would still apply.  */
3856 char lt_dlinit();
3857
3858 int main() {
3859 lt_dlinit()
3860 ; return 0; }
3861 EOF
3862 if { (eval echo configure:3863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3863   rm -rf conftest*
3864   eval "ac_cv_lib_$ac_lib_var=yes"
3865 else
3866   echo "configure: failed program was:" >&5
3867   cat conftest.$ac_ext >&5
3868   rm -rf conftest*
3869   eval "ac_cv_lib_$ac_lib_var=no"
3870 fi
3871 rm -f conftest*
3872 LIBS="$ac_save_LIBS"
3873
3874 fi
3875 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3876   echo "$ac_t""yes" 1>&6
3877     ac_tr_lib=HAVE_LIB`echo ltdl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3878     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3879   cat >> confdefs.h <<EOF
3880 #define $ac_tr_lib 1
3881 EOF
3882
3883   LIBS="-lltdl $LIBS"
3884
3885 else
3886   echo "$ac_t""no" 1>&6
3887 fi
3888
3889         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
3890                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
3891         fi
3892         ol_link_modules=yes
3893 else
3894         ol_with_bdb2_module=static
3895         ol_with_ldap_module=static
3896         ol_with_ldbm_module=static
3897         ol_with_passwd_module=static
3898         ol_with_perl_module=static
3899         ol_with_shell_module=static
3900         ol_with_tcl_module=static
3901 fi
3902
3903 # test for EBCDIC
3904 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
3905 echo "configure:3906: checking for EBCDIC" >&5
3906 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
3907   echo $ac_n "(cached) $ac_c" 1>&6
3908 else
3909   
3910         cat > conftest.$ac_ext <<EOF
3911 #line 3912 "configure"
3912 #include "confdefs.h"
3913
3914 #if !('M' == 0xd4)
3915 #include <__ASCII__/generate_error.h>
3916 #endif
3917
3918 EOF
3919 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3920 { (eval echo configure:3921: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3921 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3922 if test -z "$ac_err"; then
3923   rm -rf conftest*
3924   ol_cv_cpp_ebcdic=yes
3925 else
3926   echo "$ac_err" >&5
3927   echo "configure: failed program was:" >&5
3928   cat conftest.$ac_ext >&5
3929   rm -rf conftest*
3930   ol_cv_cpp_ebcdic=no
3931 fi
3932 rm -f conftest*
3933 fi
3934
3935 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
3936 if test $ol_cv_cpp_ebcdic = yes ; then
3937         cat >> confdefs.h <<\EOF
3938 #define HAVE_EBCDIC 1
3939 EOF
3940
3941 fi
3942
3943 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3944 echo "configure:3945: checking for ANSI C header files" >&5
3945 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
3946   echo $ac_n "(cached) $ac_c" 1>&6
3947 else
3948   cat > conftest.$ac_ext <<EOF
3949 #line 3950 "configure"
3950 #include "confdefs.h"
3951 #include <stdlib.h>
3952 #include <stdarg.h>
3953 #include <string.h>
3954 #include <float.h>
3955 EOF
3956 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3957 { (eval echo configure:3958: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3958 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3959 if test -z "$ac_err"; then
3960   rm -rf conftest*
3961   ol_cv_header_stdc=yes
3962 else
3963   echo "$ac_err" >&5
3964   echo "configure: failed program was:" >&5
3965   cat conftest.$ac_ext >&5
3966   rm -rf conftest*
3967   ol_cv_header_stdc=no
3968 fi
3969 rm -f conftest*
3970
3971 if test $ol_cv_header_stdc = yes; then
3972   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3973 cat > conftest.$ac_ext <<EOF
3974 #line 3975 "configure"
3975 #include "confdefs.h"
3976 #include <string.h>
3977 EOF
3978 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3979   egrep "memchr" >/dev/null 2>&1; then
3980   :
3981 else
3982   rm -rf conftest*
3983   ol_cv_header_stdc=no
3984 fi
3985 rm -f conftest*
3986
3987 fi
3988
3989 if test $ol_cv_header_stdc = yes; then
3990   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3991 cat > conftest.$ac_ext <<EOF
3992 #line 3993 "configure"
3993 #include "confdefs.h"
3994 #include <stdlib.h>
3995 EOF
3996 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3997   egrep "free" >/dev/null 2>&1; then
3998   :
3999 else
4000   rm -rf conftest*
4001   ol_cv_header_stdc=no
4002 fi
4003 rm -f conftest*
4004
4005 fi
4006
4007 if test $ol_cv_header_stdc = yes; then
4008   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4009 if test "$cross_compiling" = yes; then
4010   :
4011 else
4012   cat > conftest.$ac_ext <<EOF
4013 #line 4014 "configure"
4014 #include "confdefs.h"
4015 #include <ctype.h>
4016 #ifndef HAVE_EBCDIC
4017 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4018 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4019 #else
4020 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4021                 || ('j' <= (c) && (c) <= 'r') \
4022                 || ('s' <= (c) && (c) <= 'z'))
4023 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
4024 #endif
4025 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4026 int main () { int i; for (i = 0; i < 256; i++)
4027 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4028 exit (0); }
4029
4030 EOF
4031 if { (eval echo configure:4032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4032 then
4033   :
4034 else
4035   echo "configure: failed program was:" >&5
4036   cat conftest.$ac_ext >&5
4037   rm -fr conftest*
4038   ol_cv_header_stdc=no
4039 fi
4040 rm -fr conftest*
4041 fi
4042
4043 fi
4044 fi
4045
4046 echo "$ac_t""$ol_cv_header_stdc" 1>&6
4047 if test $ol_cv_header_stdc = yes; then
4048   cat >> confdefs.h <<\EOF
4049 #define STDC_HEADERS 1
4050 EOF
4051
4052 fi
4053 ac_cv_header_stdc=disable
4054
4055
4056 if test $ol_cv_header_stdc != yes; then
4057         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
4058 fi
4059
4060 ac_header_dirent=no
4061 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4062 do
4063 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4064 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4065 echo "configure:4066: checking for $ac_hdr that defines DIR" >&5
4066 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
4067   echo $ac_n "(cached) $ac_c" 1>&6
4068 else
4069   cat > conftest.$ac_ext <<EOF
4070 #line 4071 "configure"
4071 #include "confdefs.h"
4072 #include <sys/types.h>
4073 #include <$ac_hdr>
4074 int main() {
4075 DIR *dirp = 0;
4076 ; return 0; }
4077 EOF
4078 if { (eval echo configure:4079: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4079   rm -rf conftest*
4080   eval "ac_cv_header_dirent_$ac_safe=yes"
4081 else
4082   echo "configure: failed program was:" >&5
4083   cat conftest.$ac_ext >&5
4084   rm -rf conftest*
4085   eval "ac_cv_header_dirent_$ac_safe=no"
4086 fi
4087 rm -f conftest*
4088 fi
4089 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4090   echo "$ac_t""yes" 1>&6
4091     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4092   cat >> confdefs.h <<EOF
4093 #define $ac_tr_hdr 1
4094 EOF
4095  ac_header_dirent=$ac_hdr; break
4096 else
4097   echo "$ac_t""no" 1>&6
4098 fi
4099 done
4100 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4101 if test $ac_header_dirent = dirent.h; then
4102 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4103 echo "configure:4104: checking for opendir in -ldir" >&5
4104 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
4105 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4106   echo $ac_n "(cached) $ac_c" 1>&6
4107 else
4108   ac_save_LIBS="$LIBS"
4109 LIBS="-ldir  $LIBS"
4110 cat > conftest.$ac_ext <<EOF
4111 #line 4112 "configure"
4112 #include "confdefs.h"
4113 /* Override any gcc2 internal prototype to avoid an error.  */
4114 /* We use char because int might match the return type of a gcc2
4115     builtin and then its argument prototype would still apply.  */
4116 char opendir();
4117
4118 int main() {
4119 opendir()
4120 ; return 0; }
4121 EOF
4122 if { (eval echo configure:4123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4123   rm -rf conftest*
4124   eval "ac_cv_lib_$ac_lib_var=yes"
4125 else
4126   echo "configure: failed program was:" >&5
4127   cat conftest.$ac_ext >&5
4128   rm -rf conftest*
4129   eval "ac_cv_lib_$ac_lib_var=no"
4130 fi
4131 rm -f conftest*
4132 LIBS="$ac_save_LIBS"
4133
4134 fi
4135 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4136   echo "$ac_t""yes" 1>&6
4137   LIBS="$LIBS -ldir"
4138 else
4139   echo "$ac_t""no" 1>&6
4140 fi
4141
4142 else
4143 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4144 echo "configure:4145: checking for opendir in -lx" >&5
4145 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
4146 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4147   echo $ac_n "(cached) $ac_c" 1>&6
4148 else
4149   ac_save_LIBS="$LIBS"
4150 LIBS="-lx  $LIBS"
4151 cat > conftest.$ac_ext <<EOF
4152 #line 4153 "configure"
4153 #include "confdefs.h"
4154 /* Override any gcc2 internal prototype to avoid an error.  */
4155 /* We use char because int might match the return type of a gcc2
4156     builtin and then its argument prototype would still apply.  */
4157 char opendir();
4158
4159 int main() {
4160 opendir()
4161 ; return 0; }
4162 EOF
4163 if { (eval echo configure:4164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4164   rm -rf conftest*
4165   eval "ac_cv_lib_$ac_lib_var=yes"
4166 else
4167   echo "configure: failed program was:" >&5
4168   cat conftest.$ac_ext >&5
4169   rm -rf conftest*
4170   eval "ac_cv_lib_$ac_lib_var=no"
4171 fi
4172 rm -f conftest*
4173 LIBS="$ac_save_LIBS"
4174
4175 fi
4176 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4177   echo "$ac_t""yes" 1>&6
4178   LIBS="$LIBS -lx"
4179 else
4180   echo "$ac_t""no" 1>&6
4181 fi
4182
4183 fi
4184
4185 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4186 echo "configure:4187: checking for sys/wait.h that is POSIX.1 compatible" >&5
4187 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
4188   echo $ac_n "(cached) $ac_c" 1>&6
4189 else
4190   cat > conftest.$ac_ext <<EOF
4191 #line 4192 "configure"
4192 #include "confdefs.h"
4193 #include <sys/types.h>
4194 #include <sys/wait.h>
4195 #ifndef WEXITSTATUS
4196 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4197 #endif
4198 #ifndef WIFEXITED
4199 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4200 #endif
4201 int main() {
4202 int s;
4203 wait (&s);
4204 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4205 ; return 0; }
4206 EOF
4207 if { (eval echo configure:4208: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4208   rm -rf conftest*
4209   ac_cv_header_sys_wait_h=yes
4210 else
4211   echo "configure: failed program was:" >&5
4212   cat conftest.$ac_ext >&5
4213   rm -rf conftest*
4214   ac_cv_header_sys_wait_h=no
4215 fi
4216 rm -f conftest*
4217 fi
4218
4219 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4220 if test $ac_cv_header_sys_wait_h = yes; then
4221   cat >> confdefs.h <<\EOF
4222 #define HAVE_SYS_WAIT_H 1
4223 EOF
4224
4225 fi
4226
4227 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4228 echo "configure:4229: checking POSIX termios" >&5
4229 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
4230   echo $ac_n "(cached) $ac_c" 1>&6
4231 else
4232   cat > conftest.$ac_ext <<EOF
4233 #line 4234 "configure"
4234 #include "confdefs.h"
4235 #include <sys/types.h>
4236 #include <unistd.h>
4237 #include <termios.h>
4238 int main() {
4239 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4240    tcgetattr(0, 0);
4241 ; return 0; }
4242 EOF
4243 if { (eval echo configure:4244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4244   rm -rf conftest*
4245   am_cv_sys_posix_termios=yes
4246 else
4247   echo "configure: failed program was:" >&5
4248   cat conftest.$ac_ext >&5
4249   rm -rf conftest*
4250   am_cv_sys_posix_termios=no
4251 fi
4252 rm -f conftest*
4253 fi
4254
4255 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4256
4257
4258  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4259 echo "configure:4260: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4260 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
4261   echo $ac_n "(cached) $ac_c" 1>&6
4262 else
4263   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4264
4265   gwinsz_in_termios_h=no
4266   if test $am_cv_sys_posix_termios = yes; then
4267     cat > conftest.$ac_ext <<EOF
4268 #line 4269 "configure"
4269 #include "confdefs.h"
4270 #include <sys/types.h>
4271 #     include <termios.h>
4272 #     ifdef TIOCGWINSZ
4273         yes
4274 #     endif
4275     
4276 EOF
4277 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4278   egrep "yes" >/dev/null 2>&1; then
4279   rm -rf conftest*
4280   gwinsz_in_termios_h=yes
4281 fi
4282 rm -f conftest*
4283
4284   fi
4285
4286   if test $gwinsz_in_termios_h = no; then
4287     cat > conftest.$ac_ext <<EOF
4288 #line 4289 "configure"
4289 #include "confdefs.h"
4290 #include <sys/types.h>
4291 #     include <sys/ioctl.h>
4292 #     ifdef TIOCGWINSZ
4293         yes
4294 #     endif
4295     
4296 EOF
4297 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4298   egrep "yes" >/dev/null 2>&1; then
4299   rm -rf conftest*
4300   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4301 fi
4302 rm -f conftest*
4303
4304   fi
4305   
4306 fi
4307
4308 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4309   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4310     cat >> confdefs.h <<\EOF
4311 #define GWINSZ_IN_SYS_IOCTL 1
4312 EOF
4313
4314   fi
4315
4316 if test $am_cv_sys_posix_termios = yes ; then
4317         cat >> confdefs.h <<\EOF
4318 #define HAVE_POSIX_TERMIOS 1
4319 EOF
4320
4321 fi
4322
4323 for ac_hdr in \
4324         arpa/inet.h             \
4325         arpa/nameser.h  \
4326         assert.h                \
4327         crypt.h                 \
4328         errno.h                 \
4329         fcntl.h                 \
4330         filio.h                 \
4331         getopt.h                \
4332         grp.h                   \
4333         libutil.h               \
4334         limits.h                \
4335         locale.h                \
4336         netinet/tcp.h   \
4337         malloc.h                \
4338         memory.h                \
4339         psap.h                  \
4340         pwd.h                   \
4341         resolv.h                \
4342         sgtty.h                 \
4343         shadow.h                \
4344         stddef.h                \
4345         string.h                \
4346         strings.h               \
4347         sysexits.h              \
4348         sys/file.h              \
4349         sys/filio.h             \
4350         sys/errno.h             \
4351         sys/ioctl.h             \
4352         sys/param.h             \
4353         sys/resource.h  \
4354         sys/select.h    \
4355         sys/socket.h    \
4356         sys/syslog.h    \
4357         sys/time.h              \
4358         sys/types.h             \
4359         syslog.h                \
4360         termios.h               \
4361         unistd.h                \
4362
4363 do
4364 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4365 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4366 echo "configure:4367: checking for $ac_hdr" >&5
4367 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4368   echo $ac_n "(cached) $ac_c" 1>&6
4369 else
4370   cat > conftest.$ac_ext <<EOF
4371 #line 4372 "configure"
4372 #include "confdefs.h"
4373 #include <$ac_hdr>
4374 EOF
4375 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4376 { (eval echo configure:4377: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4377 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4378 if test -z "$ac_err"; then
4379   rm -rf conftest*
4380   eval "ac_cv_header_$ac_safe=yes"
4381 else
4382   echo "$ac_err" >&5
4383   echo "configure: failed program was:" >&5
4384   cat conftest.$ac_ext >&5
4385   rm -rf conftest*
4386   eval "ac_cv_header_$ac_safe=no"
4387 fi
4388 rm -f conftest*
4389 fi
4390 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4391   echo "$ac_t""yes" 1>&6
4392     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4393   cat >> confdefs.h <<EOF
4394 #define $ac_tr_hdr 1
4395 EOF
4396  
4397 else
4398   echo "$ac_t""no" 1>&6
4399 fi
4400 done
4401
4402
4403
4404
4405 echo $ac_n "checking for socket""... $ac_c" 1>&6
4406 echo "configure:4407: checking for socket" >&5
4407 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
4408   echo $ac_n "(cached) $ac_c" 1>&6
4409 else
4410   cat > conftest.$ac_ext <<EOF
4411 #line 4412 "configure"
4412 #include "confdefs.h"
4413 /* System header to define __stub macros and hopefully few prototypes,
4414     which can conflict with char socket(); below.  */
4415 #include <assert.h>
4416 /* Override any gcc2 internal prototype to avoid an error.  */
4417 /* We use char because int might match the return type of a gcc2
4418     builtin and then its argument prototype would still apply.  */
4419 char socket();
4420 char (*f)();
4421
4422 int main() {
4423
4424 /* The GNU C library defines this for functions which it implements
4425     to always fail with ENOSYS.  Some functions are actually named
4426     something starting with __ and the normal name is an alias.  */
4427 #if defined (__stub_socket) || defined (__stub___socket)
4428 choke me
4429 #else
4430 f = socket;
4431 #endif
4432
4433 ; return 0; }
4434 EOF
4435 if { (eval echo configure:4436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4436   rm -rf conftest*
4437   eval "ac_cv_func_socket=yes"
4438 else
4439   echo "configure: failed program was:" >&5
4440   cat conftest.$ac_ext >&5
4441   rm -rf conftest*
4442   eval "ac_cv_func_socket=no"
4443 fi
4444 rm -f conftest*
4445 fi
4446
4447 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
4448   echo "$ac_t""yes" 1>&6
4449   :
4450 else
4451   echo "$ac_t""no" 1>&6
4452         
4453         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
4454 echo "configure:4455: checking for main in -lsocket" >&5
4455 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
4456 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4457   echo $ac_n "(cached) $ac_c" 1>&6
4458 else
4459   ac_save_LIBS="$LIBS"
4460 LIBS="-lsocket  $LIBS"
4461 cat > conftest.$ac_ext <<EOF
4462 #line 4463 "configure"
4463 #include "confdefs.h"
4464
4465 int main() {
4466 main()
4467 ; return 0; }
4468 EOF
4469 if { (eval echo configure:4470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4470   rm -rf conftest*
4471   eval "ac_cv_lib_$ac_lib_var=yes"
4472 else
4473   echo "configure: failed program was:" >&5
4474   cat conftest.$ac_ext >&5
4475   rm -rf conftest*
4476   eval "ac_cv_lib_$ac_lib_var=no"
4477 fi
4478 rm -f conftest*
4479 LIBS="$ac_save_LIBS"
4480
4481 fi
4482 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4483   echo "$ac_t""yes" 1>&6
4484     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4485     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4486   cat >> confdefs.h <<EOF
4487 #define $ac_tr_lib 1
4488 EOF
4489
4490   LIBS="-lsocket $LIBS"
4491
4492 else
4493   echo "$ac_t""no" 1>&6
4494 fi
4495
4496         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
4497 echo "configure:4498: checking for main in -lnet" >&5
4498 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
4499 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4500   echo $ac_n "(cached) $ac_c" 1>&6
4501 else
4502   ac_save_LIBS="$LIBS"
4503 LIBS="-lnet  $LIBS"
4504 cat > conftest.$ac_ext <<EOF
4505 #line 4506 "configure"
4506 #include "confdefs.h"
4507
4508 int main() {
4509 main()
4510 ; return 0; }
4511 EOF
4512 if { (eval echo configure:4513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4513   rm -rf conftest*
4514   eval "ac_cv_lib_$ac_lib_var=yes"
4515 else
4516   echo "configure: failed program was:" >&5
4517   cat conftest.$ac_ext >&5
4518   rm -rf conftest*
4519   eval "ac_cv_lib_$ac_lib_var=no"
4520 fi
4521 rm -f conftest*
4522 LIBS="$ac_save_LIBS"
4523
4524 fi
4525 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4526   echo "$ac_t""yes" 1>&6
4527     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4528     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4529   cat >> confdefs.h <<EOF
4530 #define $ac_tr_lib 1
4531 EOF
4532
4533   LIBS="-lnet $LIBS"
4534
4535 else
4536   echo "$ac_t""no" 1>&6
4537 fi
4538
4539         echo $ac_n "checking for socket in -lnet""... $ac_c" 1>&6
4540 echo "configure:4541: checking for socket in -lnet" >&5
4541 ac_lib_var=`echo net'_'socket | sed 'y%./+-:%__p__%'`
4542 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4543   echo $ac_n "(cached) $ac_c" 1>&6
4544 else
4545   ac_save_LIBS="$LIBS"
4546 LIBS="-lnet  $LIBS"
4547 cat > conftest.$ac_ext <<EOF
4548 #line 4549 "configure"
4549 #include "confdefs.h"
4550 /* Override any gcc2 internal prototype to avoid an error.  */
4551 /* We use char because int might match the return type of a gcc2
4552     builtin and then its argument prototype would still apply.  */
4553 char socket();
4554
4555 int main() {
4556 socket()
4557 ; return 0; }
4558 EOF
4559 if { (eval echo configure:4560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4560   rm -rf conftest*
4561   eval "ac_cv_lib_$ac_lib_var=yes"
4562 else
4563   echo "configure: failed program was:" >&5
4564   cat conftest.$ac_ext >&5
4565   rm -rf conftest*
4566   eval "ac_cv_lib_$ac_lib_var=no"
4567 fi
4568 rm -f conftest*
4569 LIBS="$ac_save_LIBS"
4570
4571 fi
4572 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4573   echo "$ac_t""yes" 1>&6
4574     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4575     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4576   cat >> confdefs.h <<EOF
4577 #define $ac_tr_lib 1
4578 EOF
4579
4580   LIBS="-lnet $LIBS"
4581
4582 else
4583   echo "$ac_t""no" 1>&6
4584 fi
4585
4586         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
4587 echo "configure:4588: checking for main in -lnsl_s" >&5
4588 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
4589 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4590   echo $ac_n "(cached) $ac_c" 1>&6
4591 else
4592   ac_save_LIBS="$LIBS"
4593 LIBS="-lnsl_s  $LIBS"
4594 cat > conftest.$ac_ext <<EOF
4595 #line 4596 "configure"
4596 #include "confdefs.h"
4597
4598 int main() {
4599 main()
4600 ; return 0; }
4601 EOF
4602 if { (eval echo configure:4603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4603   rm -rf conftest*
4604   eval "ac_cv_lib_$ac_lib_var=yes"
4605 else
4606   echo "configure: failed program was:" >&5
4607   cat conftest.$ac_ext >&5
4608   rm -rf conftest*
4609   eval "ac_cv_lib_$ac_lib_var=no"
4610 fi
4611 rm -f conftest*
4612 LIBS="$ac_save_LIBS"
4613
4614 fi
4615 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4616   echo "$ac_t""yes" 1>&6
4617     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4618     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4619   cat >> confdefs.h <<EOF
4620 #define $ac_tr_lib 1
4621 EOF
4622
4623   LIBS="-lnsl_s $LIBS"
4624
4625 else
4626   echo "$ac_t""no" 1>&6
4627 fi
4628
4629         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
4630 echo "configure:4631: checking for main in -lnsl" >&5
4631 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
4632 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4633   echo $ac_n "(cached) $ac_c" 1>&6
4634 else
4635   ac_save_LIBS="$LIBS"
4636 LIBS="-lnsl  $LIBS"
4637 cat > conftest.$ac_ext <<EOF
4638 #line 4639 "configure"
4639 #include "confdefs.h"
4640
4641 int main() {
4642 main()
4643 ; return 0; }
4644 EOF
4645 if { (eval echo configure:4646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4646   rm -rf conftest*
4647   eval "ac_cv_lib_$ac_lib_var=yes"
4648 else
4649   echo "configure: failed program was:" >&5
4650   cat conftest.$ac_ext >&5
4651   rm -rf conftest*
4652   eval "ac_cv_lib_$ac_lib_var=no"
4653 fi
4654 rm -f conftest*
4655 LIBS="$ac_save_LIBS"
4656
4657 fi
4658 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4659   echo "$ac_t""yes" 1>&6
4660     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4661     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4662   cat >> confdefs.h <<EOF
4663 #define $ac_tr_lib 1
4664 EOF
4665
4666   LIBS="-lnsl $LIBS"
4667
4668 else
4669   echo "$ac_t""no" 1>&6
4670 fi
4671
4672         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
4673 echo "configure:4674: checking for socket in -linet" >&5
4674 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
4675 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4676   echo $ac_n "(cached) $ac_c" 1>&6
4677 else
4678   ac_save_LIBS="$LIBS"
4679 LIBS="-linet  $LIBS"
4680 cat > conftest.$ac_ext <<EOF
4681 #line 4682 "configure"
4682 #include "confdefs.h"
4683 /* Override any gcc2 internal prototype to avoid an error.  */
4684 /* We use char because int might match the return type of a gcc2
4685     builtin and then its argument prototype would still apply.  */
4686 char socket();
4687
4688 int main() {
4689 socket()
4690 ; return 0; }
4691 EOF
4692 if { (eval echo configure:4693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4693   rm -rf conftest*
4694   eval "ac_cv_lib_$ac_lib_var=yes"
4695 else
4696   echo "configure: failed program was:" >&5
4697   cat conftest.$ac_ext >&5
4698   rm -rf conftest*
4699   eval "ac_cv_lib_$ac_lib_var=no"
4700 fi
4701 rm -f conftest*
4702 LIBS="$ac_save_LIBS"
4703
4704 fi
4705 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4706   echo "$ac_t""yes" 1>&6
4707     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4708     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4709   cat >> confdefs.h <<EOF
4710 #define $ac_tr_lib 1
4711 EOF
4712
4713   LIBS="-linet $LIBS"
4714
4715 else
4716   echo "$ac_t""no" 1>&6
4717 fi
4718
4719         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
4720 echo "configure:4721: checking for main in -lgen" >&5
4721 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
4722 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4723   echo $ac_n "(cached) $ac_c" 1>&6
4724 else
4725   ac_save_LIBS="$LIBS"
4726 LIBS="-lgen  $LIBS"
4727 cat > conftest.$ac_ext <<EOF
4728 #line 4729 "configure"
4729 #include "confdefs.h"
4730
4731 int main() {
4732 main()
4733 ; return 0; }
4734 EOF
4735 if { (eval echo configure:4736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4736   rm -rf conftest*
4737   eval "ac_cv_lib_$ac_lib_var=yes"
4738 else
4739   echo "configure: failed program was:" >&5
4740   cat conftest.$ac_ext >&5
4741   rm -rf conftest*
4742   eval "ac_cv_lib_$ac_lib_var=no"
4743 fi
4744 rm -f conftest*
4745 LIBS="$ac_save_LIBS"
4746
4747 fi
4748 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4749   echo "$ac_t""yes" 1>&6
4750     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4751     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4752   cat >> confdefs.h <<EOF
4753 #define $ac_tr_lib 1
4754 EOF
4755
4756   LIBS="-lgen $LIBS"
4757
4758 else
4759   echo "$ac_t""no" 1>&6
4760 fi
4761
4762
4763 fi
4764
4765
4766 echo $ac_n "checking for select""... $ac_c" 1>&6
4767 echo "configure:4768: checking for select" >&5
4768 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
4769   echo $ac_n "(cached) $ac_c" 1>&6
4770 else
4771   cat > conftest.$ac_ext <<EOF
4772 #line 4773 "configure"
4773 #include "confdefs.h"
4774 /* System header to define __stub macros and hopefully few prototypes,
4775     which can conflict with char select(); below.  */
4776 #include <assert.h>
4777 /* Override any gcc2 internal prototype to avoid an error.  */
4778 /* We use char because int might match the return type of a gcc2
4779     builtin and then its argument prototype would still apply.  */
4780 char select();
4781 char (*f)();
4782
4783 int main() {
4784
4785 /* The GNU C library defines this for functions which it implements
4786     to always fail with ENOSYS.  Some functions are actually named
4787     something starting with __ and the normal name is an alias.  */
4788 #if defined (__stub_select) || defined (__stub___select)
4789 choke me
4790 #else
4791 f = select;
4792 #endif
4793
4794 ; return 0; }
4795 EOF
4796 if { (eval echo configure:4797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4797   rm -rf conftest*
4798   eval "ac_cv_func_select=yes"
4799 else
4800   echo "configure: failed program was:" >&5
4801   cat conftest.$ac_ext >&5
4802   rm -rf conftest*
4803   eval "ac_cv_func_select=no"
4804 fi
4805 rm -f conftest*
4806 fi
4807
4808 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
4809   echo "$ac_t""yes" 1>&6
4810   :
4811 else
4812   echo "$ac_t""no" 1>&6
4813 { echo "configure: error: select() required." 1>&2; exit 1; }
4814 fi
4815
4816
4817 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
4818 echo "configure:4819: checking types of arguments for select()" >&5
4819  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
4820   echo $ac_n "(cached) $ac_c" 1>&6
4821 else
4822    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
4823   echo $ac_n "(cached) $ac_c" 1>&6
4824 else
4825     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
4826   echo $ac_n "(cached) $ac_c" 1>&6
4827 else
4828      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
4829      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
4830       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
4831        cat > conftest.$ac_ext <<EOF
4832 #line 4833 "configure"
4833 #include "confdefs.h"
4834 #ifdef HAVE_SYS_TYPES_H
4835 #include <sys/types.h>
4836 #endif
4837 #ifdef HAVE_SYS_TIME_H
4838 #include <sys/time.h>
4839 #endif
4840 #ifdef HAVE_SYS_SELECT_H
4841 #include <sys/select.h>
4842 #endif
4843 #ifdef HAVE_SYS_SOCKET_H
4844 #include <sys/socket.h>
4845 #endif
4846 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);
4847 int main() {
4848
4849 ; return 0; }
4850 EOF
4851 if { (eval echo configure:4852: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4852   rm -rf conftest*
4853           ac_not_found=no ; break 3
4854 else
4855   echo "configure: failed program was:" >&5
4856   cat conftest.$ac_ext >&5
4857   rm -rf conftest*
4858   ac_not_found=yes
4859 fi
4860 rm -f conftest*
4861       done
4862      done
4863     done
4864    
4865 fi
4866   
4867 fi
4868  
4869 fi
4870  if test "$ac_not_found" = yes; then
4871   ac_cv_func_select_arg1=int 
4872   ac_cv_func_select_arg234='int *' 
4873   ac_cv_func_select_arg5='struct timeval *'
4874  fi
4875  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
4876  cat >> confdefs.h <<EOF
4877 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
4878 EOF
4879
4880  cat >> confdefs.h <<EOF
4881 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
4882 EOF
4883
4884  cat >> confdefs.h <<EOF
4885 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
4886 EOF
4887
4888
4889
4890
4891 for ac_hdr in regex.h 
4892 do
4893 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4894 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4895 echo "configure:4896: checking for $ac_hdr" >&5
4896 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4897   echo $ac_n "(cached) $ac_c" 1>&6
4898 else
4899   cat > conftest.$ac_ext <<EOF
4900 #line 4901 "configure"
4901 #include "confdefs.h"
4902 #include <$ac_hdr>
4903 EOF
4904 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4905 { (eval echo configure:4906: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4906 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4907 if test -z "$ac_err"; then
4908   rm -rf conftest*
4909   eval "ac_cv_header_$ac_safe=yes"
4910 else
4911   echo "$ac_err" >&5
4912   echo "configure: failed program was:" >&5
4913   cat conftest.$ac_ext >&5
4914   rm -rf conftest*
4915   eval "ac_cv_header_$ac_safe=no"
4916 fi
4917 rm -f conftest*
4918 fi
4919 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4920   echo "$ac_t""yes" 1>&6
4921     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4922   cat >> confdefs.h <<EOF
4923 #define $ac_tr_hdr 1
4924 EOF
4925  
4926 else
4927   echo "$ac_t""no" 1>&6
4928 fi
4929 done
4930
4931 if test "$ac_cv_header_regex_h" != yes ; then
4932         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
4933 fi
4934 echo $ac_n "checking for regfree""... $ac_c" 1>&6
4935 echo "configure:4936: checking for regfree" >&5
4936 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
4937   echo $ac_n "(cached) $ac_c" 1>&6
4938 else
4939   cat > conftest.$ac_ext <<EOF
4940 #line 4941 "configure"
4941 #include "confdefs.h"
4942 /* System header to define __stub macros and hopefully few prototypes,
4943     which can conflict with char regfree(); below.  */
4944 #include <assert.h>
4945 /* Override any gcc2 internal prototype to avoid an error.  */
4946 /* We use char because int might match the return type of a gcc2
4947     builtin and then its argument prototype would still apply.  */
4948 char regfree();
4949 char (*f)();
4950
4951 int main() {
4952
4953 /* The GNU C library defines this for functions which it implements
4954     to always fail with ENOSYS.  Some functions are actually named
4955     something starting with __ and the normal name is an alias.  */
4956 #if defined (__stub_regfree) || defined (__stub___regfree)
4957 choke me
4958 #else
4959 f = regfree;
4960 #endif
4961
4962 ; return 0; }
4963 EOF
4964 if { (eval echo configure:4965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4965   rm -rf conftest*
4966   eval "ac_cv_func_regfree=yes"
4967 else
4968   echo "configure: failed program was:" >&5
4969   cat conftest.$ac_ext >&5
4970   rm -rf conftest*
4971   eval "ac_cv_func_regfree=no"
4972 fi
4973 rm -f conftest*
4974 fi
4975
4976 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
4977   echo "$ac_t""yes" 1>&6
4978   :
4979 else
4980   echo "$ac_t""no" 1>&6
4981 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
4982 fi
4983
4984
4985
4986 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
4987 echo "configure:4988: checking for compatible POSIX regex" >&5
4988 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
4989   echo $ac_n "(cached) $ac_c" 1>&6
4990 else
4991   
4992         if test "$cross_compiling" = yes; then
4993   ol_cv_c_posix_regex=cross
4994 else
4995   cat > conftest.$ac_ext <<EOF
4996 #line 4997 "configure"
4997 #include "confdefs.h"
4998
4999 #include <sys/types.h>
5000 #include <regex.h>
5001 static char *pattern, *string;
5002 main()
5003 {
5004         int rc;
5005         regex_t re;
5006
5007         pattern = "^A";
5008
5009         if(regcomp(&re, pattern, 0)) {
5010                 return -1;
5011         }
5012         
5013         string = "ALL MATCH";
5014         
5015         rc = regexec(&re, string, 0, (void*)0, 0);
5016
5017         regfree(&re);
5018
5019         return rc;
5020 }
5021 EOF
5022 if { (eval echo configure:5023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5023 then
5024   ol_cv_c_posix_regex=yes
5025 else
5026   echo "configure: failed program was:" >&5
5027   cat conftest.$ac_ext >&5
5028   rm -fr conftest*
5029   ol_cv_c_posix_regex=no
5030 fi
5031 rm -fr conftest*
5032 fi
5033
5034 fi
5035
5036 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5037
5038 if test "$ol_cv_c_posix_regex" = no ; then
5039         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5040 fi
5041
5042 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
5043 echo "configure:5044: checking for sigset in -lV3" >&5
5044 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
5045 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5046   echo $ac_n "(cached) $ac_c" 1>&6
5047 else
5048   ac_save_LIBS="$LIBS"
5049 LIBS="-lV3  $LIBS"
5050 cat > conftest.$ac_ext <<EOF
5051 #line 5052 "configure"
5052 #include "confdefs.h"
5053 /* Override any gcc2 internal prototype to avoid an error.  */
5054 /* We use char because int might match the return type of a gcc2
5055     builtin and then its argument prototype would still apply.  */
5056 char sigset();
5057
5058 int main() {
5059 sigset()
5060 ; return 0; }
5061 EOF
5062 if { (eval echo configure:5063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5063   rm -rf conftest*
5064   eval "ac_cv_lib_$ac_lib_var=yes"
5065 else
5066   echo "configure: failed program was:" >&5
5067   cat conftest.$ac_ext >&5
5068   rm -rf conftest*
5069   eval "ac_cv_lib_$ac_lib_var=no"
5070 fi
5071 rm -f conftest*
5072 LIBS="$ac_save_LIBS"
5073
5074 fi
5075 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5076   echo "$ac_t""yes" 1>&6
5077     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5078     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5079   cat >> confdefs.h <<EOF
5080 #define $ac_tr_lib 1
5081 EOF
5082
5083   LIBS="-lV3 $LIBS"
5084
5085 else
5086   echo "$ac_t""no" 1>&6
5087 fi
5088
5089
5090 echo $ac_n "checking for res_search""... $ac_c" 1>&6
5091 echo "configure:5092: checking for res_search" >&5
5092 if eval "test \"\${ac_cv_func_res_search+set}\" = set"; then
5093   echo $ac_n "(cached) $ac_c" 1>&6
5094 else
5095   cat > conftest.$ac_ext <<EOF
5096 #line 5097 "configure"
5097 #include "confdefs.h"
5098 /* System header to define __stub macros and hopefully few prototypes,
5099     which can conflict with char res_search(); below.  */
5100 #include <assert.h>
5101 /* Override any gcc2 internal prototype to avoid an error.  */
5102 /* We use char because int might match the return type of a gcc2
5103     builtin and then its argument prototype would still apply.  */
5104 char res_search();
5105 char (*f)();
5106
5107 int main() {
5108
5109 /* The GNU C library defines this for functions which it implements
5110     to always fail with ENOSYS.  Some functions are actually named
5111     something starting with __ and the normal name is an alias.  */
5112 #if defined (__stub_res_search) || defined (__stub___res_search)
5113 choke me
5114 #else
5115 f = res_search;
5116 #endif
5117
5118 ; return 0; }
5119 EOF
5120 if { (eval echo configure:5121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5121   rm -rf conftest*
5122   eval "ac_cv_func_res_search=yes"
5123 else
5124   echo "configure: failed program was:" >&5
5125   cat conftest.$ac_ext >&5
5126   rm -rf conftest*
5127   eval "ac_cv_func_res_search=no"
5128 fi
5129 rm -f conftest*
5130 fi
5131
5132 if eval "test \"`echo '$ac_cv_func_'res_search`\" = yes"; then
5133   echo "$ac_t""yes" 1>&6
5134   :
5135 else
5136   echo "$ac_t""no" 1>&6
5137 fi
5138
5139 if test $ac_cv_func_res_search = no ; then 
5140         echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
5141 echo "configure:5142: checking for res_search in -lbind" >&5
5142 ac_lib_var=`echo bind'_'res_search | sed 'y%./+-:%__p__%'`
5143 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5144   echo $ac_n "(cached) $ac_c" 1>&6
5145 else
5146   ac_save_LIBS="$LIBS"
5147 LIBS="-lbind  $LIBS"
5148 cat > conftest.$ac_ext <<EOF
5149 #line 5150 "configure"
5150 #include "confdefs.h"
5151 /* Override any gcc2 internal prototype to avoid an error.  */
5152 /* We use char because int might match the return type of a gcc2
5153     builtin and then its argument prototype would still apply.  */
5154 char res_search();
5155
5156 int main() {
5157 res_search()
5158 ; return 0; }
5159 EOF
5160 if { (eval echo configure:5161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5161   rm -rf conftest*
5162   eval "ac_cv_lib_$ac_lib_var=yes"
5163 else
5164   echo "configure: failed program was:" >&5
5165   cat conftest.$ac_ext >&5
5166   rm -rf conftest*
5167   eval "ac_cv_lib_$ac_lib_var=no"
5168 fi
5169 rm -f conftest*
5170 LIBS="$ac_save_LIBS"
5171
5172 fi
5173 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5174   echo "$ac_t""yes" 1>&6
5175     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5176     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5177   cat >> confdefs.h <<EOF
5178 #define $ac_tr_lib 1
5179 EOF
5180
5181   LIBS="-lbind $LIBS"
5182
5183 else
5184   echo "$ac_t""no" 1>&6
5185 fi
5186
5187         ac_cv_func_res_search=$ac_cv_lib_bind_res_search
5188 fi
5189
5190 if test $ac_cv_func_res_search = no ; then 
5191         echo $ac_n "checking for __res_search in -lbind""... $ac_c" 1>&6
5192 echo "configure:5193: checking for __res_search in -lbind" >&5
5193 ac_lib_var=`echo bind'_'__res_search | sed 'y%./+-:%__p__%'`
5194 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5195   echo $ac_n "(cached) $ac_c" 1>&6
5196 else
5197   ac_save_LIBS="$LIBS"
5198 LIBS="-lbind  $LIBS"
5199 cat > conftest.$ac_ext <<EOF
5200 #line 5201 "configure"
5201 #include "confdefs.h"
5202 /* Override any gcc2 internal prototype to avoid an error.  */
5203 /* We use char because int might match the return type of a gcc2
5204     builtin and then its argument prototype would still apply.  */
5205 char __res_search();
5206
5207 int main() {
5208 __res_search()
5209 ; return 0; }
5210 EOF
5211 if { (eval echo configure:5212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5212   rm -rf conftest*
5213   eval "ac_cv_lib_$ac_lib_var=yes"
5214 else
5215   echo "configure: failed program was:" >&5
5216   cat conftest.$ac_ext >&5
5217   rm -rf conftest*
5218   eval "ac_cv_lib_$ac_lib_var=no"
5219 fi
5220 rm -f conftest*
5221 LIBS="$ac_save_LIBS"
5222
5223 fi
5224 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5225   echo "$ac_t""yes" 1>&6
5226     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5227     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5228   cat >> confdefs.h <<EOF
5229 #define $ac_tr_lib 1
5230 EOF
5231
5232   LIBS="-lbind $LIBS"
5233
5234 else
5235   echo "$ac_t""no" 1>&6
5236 fi
5237
5238         ac_cv_func_res_search=$ac_cv_lib_bind___res_search
5239 fi
5240
5241 if test $ac_cv_func_res_search = no ; then 
5242         echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
5243 echo "configure:5244: checking for res_search in -lresolv" >&5
5244 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-:%__p__%'`
5245 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5246   echo $ac_n "(cached) $ac_c" 1>&6
5247 else
5248   ac_save_LIBS="$LIBS"
5249 LIBS="-lresolv  $LIBS"
5250 cat > conftest.$ac_ext <<EOF
5251 #line 5252 "configure"
5252 #include "confdefs.h"
5253 /* Override any gcc2 internal prototype to avoid an error.  */
5254 /* We use char because int might match the return type of a gcc2
5255     builtin and then its argument prototype would still apply.  */
5256 char res_search();
5257
5258 int main() {
5259 res_search()
5260 ; return 0; }
5261 EOF
5262 if { (eval echo configure:5263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5263   rm -rf conftest*
5264   eval "ac_cv_lib_$ac_lib_var=yes"
5265 else
5266   echo "configure: failed program was:" >&5
5267   cat conftest.$ac_ext >&5
5268   rm -rf conftest*
5269   eval "ac_cv_lib_$ac_lib_var=no"
5270 fi
5271 rm -f conftest*
5272 LIBS="$ac_save_LIBS"
5273
5274 fi
5275 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5276   echo "$ac_t""yes" 1>&6
5277     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5278     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5279   cat >> confdefs.h <<EOF
5280 #define $ac_tr_lib 1
5281 EOF
5282
5283   LIBS="-lresolv $LIBS"
5284
5285 else
5286   echo "$ac_t""no" 1>&6
5287 fi
5288
5289         ac_cv_func_res_search=$ac_cv_lib_resolv_res_search
5290 fi
5291
5292 if test "$ac_cv_func_res_search" = yes ; then
5293         cat >> confdefs.h <<\EOF
5294 #define HAVE_RES_SEARCH 1
5295 EOF
5296
5297 elif test $ol_enable_dns = yes ; then
5298         { echo "configure: error: --enable-dns requires res_search" 1>&2; exit 1; }
5299 elif test $ol_enable_dns != no ; then
5300         echo "configure: warning: no res_search, disabling DNS support" 1>&2
5301 fi
5302
5303
5304 # ISODE tests
5305 ol_link_isode=no
5306 if test $ol_enable_ldapd != no ; then
5307         echo "configure: warning: ldapd is not supported and may suffer from bit rot." 1>&2
5308
5309                 echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
5310 echo "configure:5311: checking for main in -lxtpp" >&5
5311 ac_lib_var=`echo xtpp'_'main | sed 'y%./+-:%__p__%'`
5312 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5313   echo $ac_n "(cached) $ac_c" 1>&6
5314 else
5315   ac_save_LIBS="$LIBS"
5316 LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
5317 cat > conftest.$ac_ext <<EOF
5318 #line 5319 "configure"
5319 #include "confdefs.h"
5320
5321 int main() {
5322 main()
5323 ; return 0; }
5324 EOF
5325 if { (eval echo configure:5326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5326   rm -rf conftest*
5327   eval "ac_cv_lib_$ac_lib_var=yes"
5328 else
5329   echo "configure: failed program was:" >&5
5330   cat conftest.$ac_ext >&5
5331   rm -rf conftest*
5332   eval "ac_cv_lib_$ac_lib_var=no"
5333 fi
5334 rm -f conftest*
5335 LIBS="$ac_save_LIBS"
5336
5337 fi
5338 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5339   echo "$ac_t""yes" 1>&6
5340   
5341                 ol_link_isode=yes
5342                 cat >> confdefs.h <<\EOF
5343 #define HAVE_XTPP 1
5344 EOF
5345
5346                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
5347                 
5348 else
5349   echo "$ac_t""no" 1>&6
5350 :
5351 fi
5352
5353         echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
5354 echo "configure:5355: checking for main in -ldsap" >&5
5355 ac_lib_var=`echo dsap'_'main | sed 'y%./+-:%__p__%'`
5356 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5357   echo $ac_n "(cached) $ac_c" 1>&6
5358 else
5359   ac_save_LIBS="$LIBS"
5360 LIBS="-ldsap -lisode $LIBS"
5361 cat > conftest.$ac_ext <<EOF
5362 #line 5363 "configure"
5363 #include "confdefs.h"
5364
5365 int main() {
5366 main()
5367 ; return 0; }
5368 EOF
5369 if { (eval echo configure:5370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5370   rm -rf conftest*
5371   eval "ac_cv_lib_$ac_lib_var=yes"
5372 else
5373   echo "configure: failed program was:" >&5
5374   cat conftest.$ac_ext >&5
5375   rm -rf conftest*
5376   eval "ac_cv_lib_$ac_lib_var=no"
5377 fi
5378 rm -f conftest*
5379 LIBS="$ac_save_LIBS"
5380
5381 fi
5382 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5383   echo "$ac_t""yes" 1>&6
5384   
5385                 ol_link_isode=yes
5386                 cat >> confdefs.h <<\EOF
5387 #define HAVE_DSAP 1
5388 EOF
5389
5390                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
5391                 
5392 else
5393   echo "$ac_t""no" 1>&6
5394 :
5395 fi
5396
5397         echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
5398 echo "configure:5399: checking for main in -lisode" >&5
5399 ac_lib_var=`echo isode'_'main | sed 'y%./+-:%__p__%'`
5400 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5401   echo $ac_n "(cached) $ac_c" 1>&6
5402 else
5403   ac_save_LIBS="$LIBS"
5404 LIBS="-lisode  $LIBS"
5405 cat > conftest.$ac_ext <<EOF
5406 #line 5407 "configure"
5407 #include "confdefs.h"
5408
5409 int main() {
5410 main()
5411 ; return 0; }
5412 EOF
5413 if { (eval echo configure:5414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5414   rm -rf conftest*
5415   eval "ac_cv_lib_$ac_lib_var=yes"
5416 else
5417   echo "configure: failed program was:" >&5
5418   cat conftest.$ac_ext >&5
5419   rm -rf conftest*
5420   eval "ac_cv_lib_$ac_lib_var=no"
5421 fi
5422 rm -f conftest*
5423 LIBS="$ac_save_LIBS"
5424
5425 fi
5426 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5427   echo "$ac_t""yes" 1>&6
5428   
5429                 ol_link_isode=yes
5430                 cat >> confdefs.h <<\EOF
5431 #define HAVE_ISODE 1
5432 EOF
5433
5434                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
5435                 
5436 else
5437   echo "$ac_t""no" 1>&6
5438 :
5439 fi
5440
5441 fi
5442
5443 if test $ol_link_isode != no; then
5444         echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
5445 echo "configure:5446: checking for main in -lpp" >&5
5446 ac_lib_var=`echo pp'_'main | sed 'y%./+-:%__p__%'`
5447 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5448   echo $ac_n "(cached) $ac_c" 1>&6
5449 else
5450   ac_save_LIBS="$LIBS"
5451 LIBS="-lpp  $LIBS"
5452 cat > conftest.$ac_ext <<EOF
5453 #line 5454 "configure"
5454 #include "confdefs.h"
5455
5456 int main() {
5457 main()
5458 ; return 0; }
5459 EOF
5460 if { (eval echo configure:5461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5461   rm -rf conftest*
5462   eval "ac_cv_lib_$ac_lib_var=yes"
5463 else
5464   echo "configure: failed program was:" >&5
5465   cat conftest.$ac_ext >&5
5466   rm -rf conftest*
5467   eval "ac_cv_lib_$ac_lib_var=no"
5468 fi
5469 rm -f conftest*
5470 LIBS="$ac_save_LIBS"
5471
5472 fi
5473 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5474   echo "$ac_t""yes" 1>&6
5475   
5476                 cat >> confdefs.h <<\EOF
5477 #define HAVE_PP 1
5478 EOF
5479
5480                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
5481                 
5482 else
5483   echo "$ac_t""no" 1>&6
5484 :
5485 fi
5486
5487
5488         # Extract the first word of "pepsy", so it can be a program name with args.
5489 set dummy pepsy; ac_word=$2
5490 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
5491 echo "configure:5492: checking for $ac_word" >&5
5492 if eval "test \"\${ac_cv_path_PEPSY+set}\" = set"; then
5493   echo $ac_n "(cached) $ac_c" 1>&6
5494 else
5495   case "$PEPSY" in
5496   /*)
5497   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a path.
5498   ;;
5499   ?:/*)                  
5500   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a dos path.
5501   ;;
5502   *)
5503   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
5504   ac_dummy="$PATH"
5505   for ac_dir in $ac_dummy; do 
5506     test -z "$ac_dir" && ac_dir=.
5507     if test -f $ac_dir/$ac_word; then
5508       ac_cv_path_PEPSY="$ac_dir/$ac_word"
5509       break
5510     fi
5511   done
5512   IFS="$ac_save_ifs"
5513   ;;
5514 esac
5515 fi
5516 PEPSY="$ac_cv_path_PEPSY"
5517 if test -n "$PEPSY"; then
5518   echo "$ac_t""$PEPSY" 1>&6
5519 else
5520   echo "$ac_t""no" 1>&6
5521 fi
5522
5523 fi
5524
5525 if test $ol_enable_quipu != no ; then
5526         for ac_hdr in quipu/commonarg.h
5527 do
5528 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5529 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5530 echo "configure:5531: checking for $ac_hdr" >&5
5531 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5532   echo $ac_n "(cached) $ac_c" 1>&6
5533 else
5534   cat > conftest.$ac_ext <<EOF
5535 #line 5536 "configure"
5536 #include "confdefs.h"
5537 #include <$ac_hdr>
5538 EOF
5539 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5540 { (eval echo configure:5541: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5541 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5542 if test -z "$ac_err"; then
5543   rm -rf conftest*
5544   eval "ac_cv_header_$ac_safe=yes"
5545 else
5546   echo "$ac_err" >&5
5547   echo "configure: failed program was:" >&5
5548   cat conftest.$ac_ext >&5
5549   rm -rf conftest*
5550   eval "ac_cv_header_$ac_safe=no"
5551 fi
5552 rm -f conftest*
5553 fi
5554 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5555   echo "$ac_t""yes" 1>&6
5556     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5557   cat >> confdefs.h <<EOF
5558 #define $ac_tr_hdr 1
5559 EOF
5560  
5561 else
5562   echo "$ac_t""no" 1>&6
5563 fi
5564 done
5565
5566
5567         if test $ac_cv_header_quipu_commonarg_h = yes ; then
5568                 BUILD_QUIPU=yes
5569         elif test $ol_enable_quipu = auto ; then
5570                 echo "configure: warning: no quipu for --enable-quipu=auto, disabling" 1>&2
5571         else
5572                 { echo "configure: error: no quipu for --enable-quipu=$ol_enable_quipu" 1>&2; exit 1; }
5573         fi
5574 fi
5575
5576 ol_link_kerberos=no
5577
5578 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
5579         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
5580 do
5581 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5582 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5583 echo "configure:5584: checking for $ac_hdr" >&5
5584 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5585   echo $ac_n "(cached) $ac_c" 1>&6
5586 else
5587   cat > conftest.$ac_ext <<EOF
5588 #line 5589 "configure"
5589 #include "confdefs.h"
5590 #include <$ac_hdr>
5591 EOF
5592 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5593 { (eval echo configure:5594: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5594 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5595 if test -z "$ac_err"; then
5596   rm -rf conftest*
5597   eval "ac_cv_header_$ac_safe=yes"
5598 else
5599   echo "$ac_err" >&5
5600   echo "configure: failed program was:" >&5
5601   cat conftest.$ac_ext >&5
5602   rm -rf conftest*
5603   eval "ac_cv_header_$ac_safe=no"
5604 fi
5605 rm -f conftest*
5606 fi
5607 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5608   echo "$ac_t""yes" 1>&6
5609     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5610   cat >> confdefs.h <<EOF
5611 #define $ac_tr_hdr 1
5612 EOF
5613  
5614 else
5615   echo "$ac_t""no" 1>&6
5616 fi
5617 done
5618
5619
5620         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
5621                 echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
5622 echo "configure:5623: checking for main in -lkrb4" >&5
5623 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
5624 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5625   echo $ac_n "(cached) $ac_c" 1>&6
5626 else
5627   ac_save_LIBS="$LIBS"
5628 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
5629 cat > conftest.$ac_ext <<EOF
5630 #line 5631 "configure"
5631 #include "confdefs.h"
5632
5633 int main() {
5634 main()
5635 ; return 0; }
5636 EOF
5637 if { (eval echo configure:5638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5638   rm -rf conftest*
5639   eval "ac_cv_lib_$ac_lib_var=yes"
5640 else
5641   echo "configure: failed program was:" >&5
5642   cat conftest.$ac_ext >&5
5643   rm -rf conftest*
5644   eval "ac_cv_lib_$ac_lib_var=no"
5645 fi
5646 rm -f conftest*
5647 LIBS="$ac_save_LIBS"
5648
5649 fi
5650 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5651   echo "$ac_t""yes" 1>&6
5652   have_k5=yes
5653 else
5654   echo "$ac_t""no" 1>&6
5655 have_k5=no
5656 fi
5657
5658
5659                 if test $have_k5 = yes ; then
5660                         ol_with_kerberos=found
5661                         ol_link_kerberos=yes
5662
5663                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
5664
5665                         LIBS="$KRB_LIBS $LIBS"
5666
5667                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
5668 echo "configure:5669: checking for des_debug in Kerberos libraries" >&5
5669 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
5670   echo $ac_n "(cached) $ac_c" 1>&6
5671 else
5672   
5673                                                                 save_LIBS="$LIBS"
5674                                 LIBS="$KRB_LIBS $LIBS"
5675                                 cat > conftest.$ac_ext <<EOF
5676 #line 5677 "configure"
5677 #include "confdefs.h"
5678
5679 #include <kerberosIV/krb.h>
5680 #include <kerberosIV/des.h>
5681 extern int des_debug;
5682
5683 int main() {
5684
5685 des_debug = 1;
5686
5687 ; return 0; }
5688 EOF
5689 if { (eval echo configure:5690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5690   rm -rf conftest*
5691   ol_cv_var_des_debug=yes
5692 else
5693   echo "configure: failed program was:" >&5
5694   cat conftest.$ac_ext >&5
5695   rm -rf conftest*
5696   ol_cv_var_des_debug=no
5697 fi
5698 rm -f conftest*
5699                                                                 LIBS="$save_LIBS"
5700                         
5701 fi
5702
5703 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
5704
5705                         if test $ol_cv_var_des_debug = yes ; then
5706                                 cat >> confdefs.h <<\EOF
5707 #define HAVE_DES_DEBUG 1
5708 EOF
5709
5710                         fi
5711
5712                         LIBS="$save_LIBS"
5713                 fi
5714         fi
5715 fi
5716
5717 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
5718         for ac_hdr in krb.h des.h
5719 do
5720 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5721 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5722 echo "configure:5723: checking for $ac_hdr" >&5
5723 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5724   echo $ac_n "(cached) $ac_c" 1>&6
5725 else
5726   cat > conftest.$ac_ext <<EOF
5727 #line 5728 "configure"
5728 #include "confdefs.h"
5729 #include <$ac_hdr>
5730 EOF
5731 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5732 { (eval echo configure:5733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5733 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5734 if test -z "$ac_err"; then
5735   rm -rf conftest*
5736   eval "ac_cv_header_$ac_safe=yes"
5737 else
5738   echo "$ac_err" >&5
5739   echo "configure: failed program was:" >&5
5740   cat conftest.$ac_ext >&5
5741   rm -rf conftest*
5742   eval "ac_cv_header_$ac_safe=no"
5743 fi
5744 rm -f conftest*
5745 fi
5746 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5747   echo "$ac_t""yes" 1>&6
5748     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5749   cat >> confdefs.h <<EOF
5750 #define $ac_tr_hdr 1
5751 EOF
5752  
5753 else
5754   echo "$ac_t""no" 1>&6
5755 fi
5756 done
5757
5758
5759         if test $ac_cv_header_krb_h = yes ; then
5760                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
5761 echo "configure:5762: checking for main in -lkrb" >&5
5762 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
5763 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5764   echo $ac_n "(cached) $ac_c" 1>&6
5765 else
5766   ac_save_LIBS="$LIBS"
5767 LIBS="-lkrb -ldes $LIBS"
5768 cat > conftest.$ac_ext <<EOF
5769 #line 5770 "configure"
5770 #include "confdefs.h"
5771
5772 int main() {
5773 main()
5774 ; return 0; }
5775 EOF
5776 if { (eval echo configure:5777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5777   rm -rf conftest*
5778   eval "ac_cv_lib_$ac_lib_var=yes"
5779 else
5780   echo "configure: failed program was:" >&5
5781   cat conftest.$ac_ext >&5
5782   rm -rf conftest*
5783   eval "ac_cv_lib_$ac_lib_var=no"
5784 fi
5785 rm -f conftest*
5786 LIBS="$ac_save_LIBS"
5787
5788 fi
5789 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5790   echo "$ac_t""yes" 1>&6
5791   have_k4=yes
5792 else
5793   echo "$ac_t""no" 1>&6
5794 have_k4=no
5795 fi
5796
5797
5798                 if test $have_k4 = yes ; then
5799                         ol_with_kerberos=found
5800                         ol_link_kerberos=yes
5801
5802                         KRB_LIBS="-lkrb -ldes"
5803                 fi
5804         fi
5805 fi
5806
5807 if test $ol_link_kerberos = yes ; then
5808         cat >> confdefs.h <<\EOF
5809 #define HAVE_KERBEROS 1
5810 EOF
5811
5812 fi
5813
5814 ol_link_tls=no
5815 if test $ol_with_tls != no ; then
5816         
5817         for ac_hdr in openssl/ssl.h ssl.h
5818 do
5819 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5820 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5821 echo "configure:5822: checking for $ac_hdr" >&5
5822 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5823   echo $ac_n "(cached) $ac_c" 1>&6
5824 else
5825   cat > conftest.$ac_ext <<EOF
5826 #line 5827 "configure"
5827 #include "confdefs.h"
5828 #include <$ac_hdr>
5829 EOF
5830 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5831 { (eval echo configure:5832: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5832 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5833 if test -z "$ac_err"; then
5834   rm -rf conftest*
5835   eval "ac_cv_header_$ac_safe=yes"
5836 else
5837   echo "$ac_err" >&5
5838   echo "configure: failed program was:" >&5
5839   cat conftest.$ac_ext >&5
5840   rm -rf conftest*
5841   eval "ac_cv_header_$ac_safe=no"
5842 fi
5843 rm -f conftest*
5844 fi
5845 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5846   echo "$ac_t""yes" 1>&6
5847     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5848   cat >> confdefs.h <<EOF
5849 #define $ac_tr_hdr 1
5850 EOF
5851  
5852 else
5853   echo "$ac_t""no" 1>&6
5854 fi
5855 done
5856
5857         
5858         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
5859                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
5860 echo "configure:5861: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
5861 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
5862 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5863   echo $ac_n "(cached) $ac_c" 1>&6
5864 else
5865   ac_save_LIBS="$LIBS"
5866 LIBS="-lssl -lcrypto $LIBS"
5867 cat > conftest.$ac_ext <<EOF
5868 #line 5869 "configure"
5869 #include "confdefs.h"
5870 /* Override any gcc2 internal prototype to avoid an error.  */
5871 /* We use char because int might match the return type of a gcc2
5872     builtin and then its argument prototype would still apply.  */
5873 char SSLeay_add_ssl_algorithms();
5874
5875 int main() {
5876 SSLeay_add_ssl_algorithms()
5877 ; return 0; }
5878 EOF
5879 if { (eval echo configure:5880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5880   rm -rf conftest*
5881   eval "ac_cv_lib_$ac_lib_var=yes"
5882 else
5883   echo "configure: failed program was:" >&5
5884   cat conftest.$ac_ext >&5
5885   rm -rf conftest*
5886   eval "ac_cv_lib_$ac_lib_var=no"
5887 fi
5888 rm -f conftest*
5889 LIBS="$ac_save_LIBS"
5890
5891 fi
5892 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5893   echo "$ac_t""yes" 1>&6
5894   have_ssleay=yes
5895                         need_rsaref=no
5896 else
5897   echo "$ac_t""no" 1>&6
5898 have_ssleay=no
5899 fi
5900
5901                         
5902                 if test $have_ssleay = no ; then
5903                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
5904 echo "configure:5905: checking for SSL_library_init in -lssl" >&5
5905 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
5906 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5907   echo $ac_n "(cached) $ac_c" 1>&6
5908 else
5909   ac_save_LIBS="$LIBS"
5910 LIBS="-lssl -lcrypto $LIBS"
5911 cat > conftest.$ac_ext <<EOF
5912 #line 5913 "configure"
5913 #include "confdefs.h"
5914 /* Override any gcc2 internal prototype to avoid an error.  */
5915 /* We use char because int might match the return type of a gcc2
5916     builtin and then its argument prototype would still apply.  */
5917 char SSL_library_init();
5918
5919 int main() {
5920 SSL_library_init()
5921 ; return 0; }
5922 EOF
5923 if { (eval echo configure:5924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5924   rm -rf conftest*
5925   eval "ac_cv_lib_$ac_lib_var=yes"
5926 else
5927   echo "configure: failed program was:" >&5
5928   cat conftest.$ac_ext >&5
5929   rm -rf conftest*
5930   eval "ac_cv_lib_$ac_lib_var=no"
5931 fi
5932 rm -f conftest*
5933 LIBS="$ac_save_LIBS"
5934
5935 fi
5936 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5937   echo "$ac_t""yes" 1>&6
5938   have_ssleay=yes
5939                                 need_rsaref=no
5940 else
5941   echo "$ac_t""no" 1>&6
5942 have_ssleay=no
5943 fi
5944
5945                 fi
5946
5947                 if test $have_ssleay = no ; then
5948                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
5949 echo "configure:5950: checking for ssl3_accept in -lssl" >&5
5950 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
5951 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5952   echo $ac_n "(cached) $ac_c" 1>&6
5953 else
5954   ac_save_LIBS="$LIBS"
5955 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
5956 cat > conftest.$ac_ext <<EOF
5957 #line 5958 "configure"
5958 #include "confdefs.h"
5959 /* Override any gcc2 internal prototype to avoid an error.  */
5960 /* We use char because int might match the return type of a gcc2
5961     builtin and then its argument prototype would still apply.  */
5962 char ssl3_accept();
5963
5964 int main() {
5965 ssl3_accept()
5966 ; return 0; }
5967 EOF
5968 if { (eval echo configure:5969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5969   rm -rf conftest*
5970   eval "ac_cv_lib_$ac_lib_var=yes"
5971 else
5972   echo "configure: failed program was:" >&5
5973   cat conftest.$ac_ext >&5
5974   rm -rf conftest*
5975   eval "ac_cv_lib_$ac_lib_var=no"
5976 fi
5977 rm -f conftest*
5978 LIBS="$ac_save_LIBS"
5979
5980 fi
5981 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5982   echo "$ac_t""yes" 1>&6
5983   have_ssleay=yes
5984                                 need_rsaref=yes
5985 else
5986   echo "$ac_t""no" 1>&6
5987 have_ssleay=no
5988 fi
5989
5990                 fi
5991
5992                 if test $have_ssleay = yes ; then
5993                         ol_with_tls=found
5994                         ol_link_tls=yes
5995
5996                         cat >> confdefs.h <<\EOF
5997 #define HAVE_SSLEAY 1
5998 EOF
5999
6000
6001                         if test $need_rsaref = yes; then
6002                                 cat >> confdefs.h <<\EOF
6003 #define HAVE_RSAREF 1
6004 EOF
6005
6006
6007                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
6008                         else
6009                                 TLS_LIBS="-lssl -lcrypto"
6010                         fi
6011                 fi
6012         fi
6013 fi
6014
6015 if test $ol_link_tls = yes ; then
6016         cat >> confdefs.h <<\EOF
6017 #define HAVE_TLS 1
6018 EOF
6019
6020 fi      
6021
6022 for ac_func in \
6023         ctime_r                 \
6024         gethostbyname_r gethostbyaddr_r \
6025
6026 do
6027 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6028 echo "configure:6029: checking for $ac_func" >&5
6029 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6030   echo $ac_n "(cached) $ac_c" 1>&6
6031 else
6032   cat > conftest.$ac_ext <<EOF
6033 #line 6034 "configure"
6034 #include "confdefs.h"
6035 /* System header to define __stub macros and hopefully few prototypes,
6036     which can conflict with char $ac_func(); below.  */
6037 #include <assert.h>
6038 /* Override any gcc2 internal prototype to avoid an error.  */
6039 /* We use char because int might match the return type of a gcc2
6040     builtin and then its argument prototype would still apply.  */
6041 char $ac_func();
6042 char (*f)();
6043
6044 int main() {
6045
6046 /* The GNU C library defines this for functions which it implements
6047     to always fail with ENOSYS.  Some functions are actually named
6048     something starting with __ and the normal name is an alias.  */
6049 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6050 choke me
6051 #else
6052 f = $ac_func;
6053 #endif
6054
6055 ; return 0; }
6056 EOF
6057 if { (eval echo configure:6058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6058   rm -rf conftest*
6059   eval "ac_cv_func_$ac_func=yes"
6060 else
6061   echo "configure: failed program was:" >&5
6062   cat conftest.$ac_ext >&5
6063   rm -rf conftest*
6064   eval "ac_cv_func_$ac_func=no"
6065 fi
6066 rm -f conftest*
6067 fi
6068
6069 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6070   echo "$ac_t""yes" 1>&6
6071     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6072   cat >> confdefs.h <<EOF
6073 #define $ac_tr_func 1
6074 EOF
6075  
6076 else
6077   echo "$ac_t""no" 1>&6
6078 fi
6079 done
6080
6081
6082 if test "$ac_cv_func_ctime_r" = no ; then
6083         ol_cv_func_ctime_r_nargs=0
6084 else
6085         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
6086 echo "configure:6087: checking number of arguments of ctime_r" >&5
6087 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
6088   echo $ac_n "(cached) $ac_c" 1>&6
6089 else
6090   cat > conftest.$ac_ext <<EOF
6091 #line 6092 "configure"
6092 #include "confdefs.h"
6093 #include <time.h>
6094 int main() {
6095 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
6096 ; return 0; }
6097 EOF
6098 if { (eval echo configure:6099: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6099   rm -rf conftest*
6100   ol_cv_func_ctime_r_nargs=3
6101 else
6102   echo "configure: failed program was:" >&5
6103   cat conftest.$ac_ext >&5
6104   rm -rf conftest*
6105   cat > conftest.$ac_ext <<EOF
6106 #line 6107 "configure"
6107 #include "confdefs.h"
6108 #include <time.h>
6109 int main() {
6110 time_t ti; char *buffer; ctime_r(&ti,buffer);
6111 ; return 0; }
6112 EOF
6113 if { (eval echo configure:6114: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6114   rm -rf conftest*
6115   ol_cv_func_ctime_r_nargs=2
6116 else
6117   echo "configure: failed program was:" >&5
6118   cat conftest.$ac_ext >&5
6119   rm -rf conftest*
6120   ol_cv_func_ctime_r_nargs=0
6121 fi
6122 rm -f conftest*
6123 fi
6124 rm -f conftest*
6125 fi
6126
6127 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
6128   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
6129     cat >> confdefs.h <<EOF
6130 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
6131 EOF
6132
6133   fi
6134
6135 fi
6136
6137 if test "$ac_cv_func_gethostbyname_r" = yes ; then
6138         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
6139 echo "configure:6140: checking number of arguments of gethostbyname_r" >&5
6140 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
6141   echo $ac_n "(cached) $ac_c" 1>&6
6142 else
6143   cat > conftest.$ac_ext <<EOF
6144 #line 6145 "configure"
6145 #include "confdefs.h"
6146 #include <sys/types.h>
6147 #include <sys/socket.h>
6148 #include <netinet/in.h>
6149 #include <netdb.h>
6150 #define BUFSIZE (sizeof(struct hostent)+10)
6151 int main() {
6152 struct hostent hent; char buffer[BUFSIZE];
6153                 int bufsize=BUFSIZE;int h_errno;
6154                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
6155                         buffer, bufsize, &h_errno);
6156 ; return 0; }
6157 EOF
6158 if { (eval echo configure:6159: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6159   rm -rf conftest*
6160   ol_cv_func_gethostbyname_r_nargs=5
6161 else
6162   echo "configure: failed program was:" >&5
6163   cat conftest.$ac_ext >&5
6164   rm -rf conftest*
6165   cat > conftest.$ac_ext <<EOF
6166 #line 6167 "configure"
6167 #include "confdefs.h"
6168 #include <sys/types.h>
6169 #include <sys/socket.h>
6170 #include <netinet/in.h>
6171 #include <netdb.h>
6172 #define BUFSIZE (sizeof(struct hostent)+10)
6173 int main() {
6174 struct hostent hent;struct hostent *rhent;
6175                         char buffer[BUFSIZE];
6176                         int bufsize=BUFSIZE;int h_errno;
6177                         (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
6178                                 &rhent, &h_errno);
6179 ; return 0; }
6180 EOF
6181 if { (eval echo configure:6182: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6182   rm -rf conftest*
6183   ol_cv_func_gethostbyname_r_nargs=6
6184 else
6185   echo "configure: failed program was:" >&5
6186   cat conftest.$ac_ext >&5
6187   rm -rf conftest*
6188   ol_cv_func_gethostbyname_r_nargs=0
6189 fi
6190 rm -f conftest*
6191 fi
6192 rm -f conftest*
6193 fi
6194
6195 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
6196   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
6197         cat >> confdefs.h <<EOF
6198 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
6199 EOF
6200
6201   fi
6202
6203 else
6204         ol_cv_func_gethostbyname_r_nargs=0
6205 fi
6206  
6207 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
6208         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
6209 echo "configure:6210: checking number of arguments of gethostbyaddr_r" >&5
6210 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
6211   echo $ac_n "(cached) $ac_c" 1>&6
6212 else
6213   cat > conftest.$ac_ext <<EOF
6214 #line 6215 "configure"
6215 #include "confdefs.h"
6216 #include <sys/types.h>
6217 #include <sys/socket.h>
6218 #include <netinet/in.h>
6219 #include <netdb.h>
6220 #define BUFSIZE (sizeof(struct hostent)+10)
6221 int main() {
6222 struct hostent hent; char buffer[BUFSIZE]; 
6223             struct in_addr add;
6224             size_t alen=sizeof(struct in_addr);
6225             int bufsize=BUFSIZE;int h_errno;
6226                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
6227                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
6228 ; return 0; }
6229 EOF
6230 if { (eval echo configure:6231: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6231   rm -rf conftest*
6232   ol_cv_func_gethostbyaddr_r_nargs=7
6233 else
6234   echo "configure: failed program was:" >&5
6235   cat conftest.$ac_ext >&5
6236   rm -rf conftest*
6237   cat > conftest.$ac_ext <<EOF
6238 #line 6239 "configure"
6239 #include "confdefs.h"
6240 #include <sys/types.h>
6241 #include <sys/socket.h>
6242 #include <netinet/in.h>
6243 #include <netdb.h>
6244 #define BUFSIZE (sizeof(struct hostent)+10)
6245 int main() {
6246 struct hostent hent;
6247                         struct hostent *rhent; char buffer[BUFSIZE]; 
6248                         struct in_addr add;
6249                         size_t alen=sizeof(struct in_addr);
6250                         int bufsize=BUFSIZE;int h_errno;
6251                         (void)gethostbyaddr_r( (void *)&(add.s_addr),
6252                                 alen, AF_INET, &hent, buffer, bufsize, 
6253                                 &rhent, &h_errno);
6254 ; return 0; }
6255 EOF
6256 if { (eval echo configure:6257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6257   rm -rf conftest*
6258   ol_cv_func_gethostbyaddr_r_nargs=8
6259 else
6260   echo "configure: failed program was:" >&5
6261   cat conftest.$ac_ext >&5
6262   rm -rf conftest*
6263   ol_cv_func_gethostbyaddr_r_nargs=0
6264 fi
6265 rm -f conftest*
6266 fi
6267 rm -f conftest*
6268 fi
6269
6270 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
6271   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
6272     cat >> confdefs.h <<EOF
6273 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
6274 EOF
6275
6276   fi
6277
6278 else
6279         ol_cv_func_gethostbyaddr_r_nargs=0
6280 fi
6281
6282 if test "$ac_cv_func_ctime_r" = yes \
6283         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
6284         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
6285         -a "$ac_cv_func_gethostbyname_r" = yes \
6286         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
6287         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
6288         -a "$ac_cv_func_gethostbyaddr_r" = yes \
6289         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
6290         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
6291         ; then
6292  
6293         cat >> confdefs.h <<\EOF
6294 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
6295 EOF
6296
6297 fi
6298
6299 ol_link_threads=no
6300 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6301         -o $ol_with_threads = posix ; then
6302
6303         for ac_hdr in pthread.h
6304 do
6305 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6306 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6307 echo "configure:6308: checking for $ac_hdr" >&5
6308 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6309   echo $ac_n "(cached) $ac_c" 1>&6
6310 else
6311   cat > conftest.$ac_ext <<EOF
6312 #line 6313 "configure"
6313 #include "confdefs.h"
6314 #include <$ac_hdr>
6315 EOF
6316 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6317 { (eval echo configure:6318: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6318 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6319 if test -z "$ac_err"; then
6320   rm -rf conftest*
6321   eval "ac_cv_header_$ac_safe=yes"
6322 else
6323   echo "$ac_err" >&5
6324   echo "configure: failed program was:" >&5
6325   cat conftest.$ac_ext >&5
6326   rm -rf conftest*
6327   eval "ac_cv_header_$ac_safe=no"
6328 fi
6329 rm -f conftest*
6330 fi
6331 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6332   echo "$ac_t""yes" 1>&6
6333     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6334   cat >> confdefs.h <<EOF
6335 #define $ac_tr_hdr 1
6336 EOF
6337  
6338 else
6339   echo "$ac_t""no" 1>&6
6340 fi
6341 done
6342
6343
6344         if test $ac_cv_header_pthread_h = yes ; then
6345                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
6346 echo "configure:6347: checking POSIX thread version" >&5
6347 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
6348   echo $ac_n "(cached) $ac_c" 1>&6
6349 else
6350   
6351         cat > conftest.$ac_ext <<EOF
6352 #line 6353 "configure"
6353 #include "confdefs.h"
6354
6355 #               include <pthread.h>
6356                 /* this check could be improved */
6357 #               ifdef PTHREAD_ONCE_INIT
6358                         pthread_version_final
6359 #               endif
6360         
6361 EOF
6362 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6363   egrep "pthread_version_final" >/dev/null 2>&1; then
6364   rm -rf conftest*
6365   ol_pthread_final=yes
6366 else
6367   rm -rf conftest*
6368   ol_pthread_final=no
6369 fi
6370 rm -f conftest*
6371
6372
6373         cat > conftest.$ac_ext <<EOF
6374 #line 6375 "configure"
6375 #include "confdefs.h"
6376
6377 #               include <pthread.h>
6378                 /* this check could be improved */
6379 #               ifdef pthread_once_init
6380                         pthread_version_draft4
6381 #               endif
6382         
6383 EOF
6384 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6385   egrep "pthread_version_draft4" >/dev/null 2>&1; then
6386   rm -rf conftest*
6387   ol_pthread_draft4=yes
6388 else
6389   rm -rf conftest*
6390   ol_pthread_draft4=no
6391 fi
6392 rm -f conftest*
6393
6394
6395         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
6396                 ol_cv_pthread_version=final
6397         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
6398                 ol_cv_pthread_version=draft4
6399         else
6400                 ol_cv_pthread_version=unknown
6401         fi
6402
6403 fi
6404
6405 echo "$ac_t""$ol_cv_pthread_version" 1>&6
6406
6407
6408                 if test $ol_cv_pthread_version = final ; then
6409                         cat >> confdefs.h <<\EOF
6410 #define HAVE_PTHREADS_FINAL 1
6411 EOF
6412
6413                 elif test $ol_cv_pthread_version = draft4 ; then
6414                         cat >> confdefs.h <<\EOF
6415 #define HAVE_PTHREADS_D4 1
6416 EOF
6417
6418                 else
6419                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
6420                 fi
6421
6422                 # consider threads found
6423                 ol_with_threads=found
6424
6425                 
6426         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
6427 echo "configure:6428: checking for LinuxThreads pthread.h" >&5
6428 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
6429   echo $ac_n "(cached) $ac_c" 1>&6
6430 else
6431   cat > conftest.$ac_ext <<EOF
6432 #line 6433 "configure"
6433 #include "confdefs.h"
6434 #include <pthread.h>
6435 EOF
6436 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6437   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
6438   rm -rf conftest*
6439   ol_cv_header_linux_threads=yes
6440 else
6441   rm -rf conftest*
6442   ol_cv_header_linux_threads=no
6443 fi
6444 rm -f conftest*
6445
6446                 
6447 fi
6448
6449 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
6450         if test $ol_cv_header_linux_threads = yes; then
6451                 cat >> confdefs.h <<\EOF
6452 #define HAVE_LINUX_THREADS 1
6453 EOF
6454
6455         fi
6456
6457                 
6458         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
6459 echo "configure:6460: checking for GNU Pth pthread.h" >&5
6460 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
6461   echo $ac_n "(cached) $ac_c" 1>&6
6462 else
6463   cat > conftest.$ac_ext <<EOF
6464 #line 6465 "configure"
6465 #include "confdefs.h"
6466 #include <pthread.h>
6467 #ifdef _POSIX_THREAD_IS_GNU_PTH
6468         __gnu_pth__
6469 #endif
6470
6471 EOF
6472 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6473   egrep "__gnu_pth__" >/dev/null 2>&1; then
6474   rm -rf conftest*
6475   ol_cv_header_gnu_pth_pthread_h=yes
6476 else
6477   rm -rf conftest*
6478   ol_cv_header_gnu_pth_pthread_h=no
6479 fi
6480 rm -f conftest*
6481
6482                 
6483 fi
6484
6485 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
6486
6487
6488                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
6489                         for ac_hdr in sched.h
6490 do
6491 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6492 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6493 echo "configure:6494: checking for $ac_hdr" >&5
6494 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6495   echo $ac_n "(cached) $ac_c" 1>&6
6496 else
6497   cat > conftest.$ac_ext <<EOF
6498 #line 6499 "configure"
6499 #include "confdefs.h"
6500 #include <$ac_hdr>
6501 EOF
6502 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6503 { (eval echo configure:6504: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6504 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6505 if test -z "$ac_err"; then
6506   rm -rf conftest*
6507   eval "ac_cv_header_$ac_safe=yes"
6508 else
6509   echo "$ac_err" >&5
6510   echo "configure: failed program was:" >&5
6511   cat conftest.$ac_ext >&5
6512   rm -rf conftest*
6513   eval "ac_cv_header_$ac_safe=no"
6514 fi
6515 rm -f conftest*
6516 fi
6517 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6518   echo "$ac_t""yes" 1>&6
6519     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6520   cat >> confdefs.h <<EOF
6521 #define $ac_tr_hdr 1
6522 EOF
6523  
6524 else
6525   echo "$ac_t""no" 1>&6
6526 fi
6527 done
6528
6529                 fi
6530
6531                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
6532                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
6533 echo "configure:6534: checking for pthread_create in default libraries" >&5
6534 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
6535   echo $ac_n "(cached) $ac_c" 1>&6
6536 else
6537   
6538                 if test "$cross_compiling" = yes; then
6539   cat > conftest.$ac_ext <<EOF
6540 #line 6541 "configure"
6541 #include "confdefs.h"
6542 /* pthread test headers */
6543 #include <pthread.h>
6544 #ifndef NULL
6545 #define NULL (void*)0
6546 #endif
6547
6548 static void *task(p)
6549         void *p;
6550 {
6551         return (void *) (p == NULL);
6552 }
6553
6554 int main() {
6555
6556         /* pthread test function */
6557         pthread_t t;
6558         int status;
6559
6560         /* make sure pthread_create() isn't just a stub */
6561 #if HAVE_PTHREADS_D4
6562         status = pthread_create(&t, pthread_attr_default, task, NULL);
6563 #else
6564         status = pthread_create(&t, NULL, task, NULL);
6565 #endif
6566
6567         if( status ) exit( status );
6568
6569         /* make sure pthread_detach() isn't just a stub */
6570 #if HAVE_PTHREADS_D4
6571         status = pthread_detach( &t );
6572 #else
6573         status = pthread_detach( t );
6574 #endif
6575
6576 #ifdef HAVE_LINUX_THREADS
6577         pthread_kill_other_threads_np();
6578 #endif
6579
6580         exit( status );
6581
6582 ; return 0; }
6583 EOF
6584 if { (eval echo configure:6585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6585   rm -rf conftest*
6586   ol_cv_pthread_create=yes
6587 else
6588   echo "configure: failed program was:" >&5
6589   cat conftest.$ac_ext >&5
6590   rm -rf conftest*
6591   ol_cv_pthread_create=no
6592 fi
6593 rm -f conftest*
6594 else
6595   cat > conftest.$ac_ext <<EOF
6596 #line 6597 "configure"
6597 #include "confdefs.h"
6598 /* pthread test headers */
6599 #include <pthread.h>
6600 #ifndef NULL
6601 #define NULL (void*)0
6602 #endif
6603
6604 static void *task(p)
6605         void *p;
6606 {
6607         return (void *) (p == NULL);
6608 }
6609
6610
6611 int main(argc, argv)
6612         int argc;
6613         char **argv;
6614 {
6615
6616         /* pthread test function */
6617         pthread_t t;
6618         int status;
6619
6620         /* make sure pthread_create() isn't just a stub */
6621 #if HAVE_PTHREADS_D4
6622         status = pthread_create(&t, pthread_attr_default, task, NULL);
6623 #else
6624         status = pthread_create(&t, NULL, task, NULL);
6625 #endif
6626
6627         if( status ) exit( status );
6628
6629         /* make sure pthread_detach() isn't just a stub */
6630 #if HAVE_PTHREADS_D4
6631         status = pthread_detach( &t );
6632 #else
6633         status = pthread_detach( t );
6634 #endif
6635
6636 #ifdef HAVE_LINUX_THREADS
6637         pthread_kill_other_threads_np();
6638 #endif
6639
6640         exit( status );
6641
6642 }
6643
6644 EOF
6645 if { (eval echo configure:6646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6646 then
6647   ol_cv_pthread_create=yes
6648 else
6649   echo "configure: failed program was:" >&5
6650   cat conftest.$ac_ext >&5
6651   rm -fr conftest*
6652   ol_cv_pthread_create=no
6653 fi
6654 rm -fr conftest*
6655 fi
6656
6657 fi
6658
6659 echo "$ac_t""$ol_cv_pthread_create" 1>&6
6660
6661                 if test $ol_cv_pthread_create != no ; then
6662                         ol_link_threads=posix
6663                         ol_link_pthreads=""
6664                 fi
6665                 
6666                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
6667 if test "$ol_link_threads" = no ; then
6668         # try -kthread
6669         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
6670 echo "configure:6671: checking for pthread link with -kthread" >&5
6671 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
6672   echo $ac_n "(cached) $ac_c" 1>&6
6673 else
6674   
6675                 # save the flags
6676                 ol_LIBS="$LIBS"
6677                 LIBS="-kthread $LIBS"
6678
6679                 if test "$cross_compiling" = yes; then
6680   cat > conftest.$ac_ext <<EOF
6681 #line 6682 "configure"
6682 #include "confdefs.h"
6683 /* pthread test headers */
6684 #include <pthread.h>
6685 #ifndef NULL
6686 #define NULL (void*)0
6687 #endif
6688
6689 static void *task(p)
6690         void *p;
6691 {
6692         return (void *) (p == NULL);
6693 }
6694
6695 int main() {
6696
6697         /* pthread test function */
6698         pthread_t t;
6699         int status;
6700
6701         /* make sure pthread_create() isn't just a stub */
6702 #if HAVE_PTHREADS_D4
6703         status = pthread_create(&t, pthread_attr_default, task, NULL);
6704 #else
6705         status = pthread_create(&t, NULL, task, NULL);
6706 #endif
6707
6708         if( status ) exit( status );
6709
6710         /* make sure pthread_detach() isn't just a stub */
6711 #if HAVE_PTHREADS_D4
6712         status = pthread_detach( &t );
6713 #else
6714         status = pthread_detach( t );
6715 #endif
6716
6717 #ifdef HAVE_LINUX_THREADS
6718         pthread_kill_other_threads_np();
6719 #endif
6720
6721         exit( status );
6722
6723 ; return 0; }
6724 EOF
6725 if { (eval echo configure:6726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6726   rm -rf conftest*
6727   ol_cv_pthread_kthread=yes
6728 else
6729   echo "configure: failed program was:" >&5
6730   cat conftest.$ac_ext >&5
6731   rm -rf conftest*
6732   ol_cv_pthread_kthread=no
6733 fi
6734 rm -f conftest*
6735 else
6736   cat > conftest.$ac_ext <<EOF
6737 #line 6738 "configure"
6738 #include "confdefs.h"
6739 /* pthread test headers */
6740 #include <pthread.h>
6741 #ifndef NULL
6742 #define NULL (void*)0
6743 #endif
6744
6745 static void *task(p)
6746         void *p;
6747 {
6748         return (void *) (p == NULL);
6749 }
6750
6751
6752 int main(argc, argv)
6753         int argc;
6754         char **argv;
6755 {
6756
6757         /* pthread test function */
6758         pthread_t t;
6759         int status;
6760
6761         /* make sure pthread_create() isn't just a stub */
6762 #if HAVE_PTHREADS_D4
6763         status = pthread_create(&t, pthread_attr_default, task, NULL);
6764 #else
6765         status = pthread_create(&t, NULL, task, NULL);
6766 #endif
6767
6768         if( status ) exit( status );
6769
6770         /* make sure pthread_detach() isn't just a stub */
6771 #if HAVE_PTHREADS_D4
6772         status = pthread_detach( &t );
6773 #else
6774         status = pthread_detach( t );
6775 #endif
6776
6777 #ifdef HAVE_LINUX_THREADS
6778         pthread_kill_other_threads_np();
6779 #endif
6780
6781         exit( status );
6782
6783 }
6784
6785 EOF
6786 if { (eval echo configure:6787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6787 then
6788   ol_cv_pthread_kthread=yes
6789 else
6790   echo "configure: failed program was:" >&5
6791   cat conftest.$ac_ext >&5
6792   rm -fr conftest*
6793   ol_cv_pthread_kthread=no
6794 fi
6795 rm -fr conftest*
6796 fi
6797
6798
6799                 # restore the LIBS
6800                 LIBS="$ol_LIBS"
6801         
6802 fi
6803
6804 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
6805
6806         if test $ol_cv_pthread_kthread = yes ; then
6807                 ol_link_pthreads="-kthread"
6808                 ol_link_threads=posix
6809         fi
6810 fi
6811
6812                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
6813 if test "$ol_link_threads" = no ; then
6814         # try -pthread
6815         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
6816 echo "configure:6817: checking for pthread link with -pthread" >&5
6817 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
6818   echo $ac_n "(cached) $ac_c" 1>&6
6819 else
6820   
6821                 # save the flags
6822                 ol_LIBS="$LIBS"
6823                 LIBS="-pthread $LIBS"
6824
6825                 if test "$cross_compiling" = yes; then
6826   cat > conftest.$ac_ext <<EOF
6827 #line 6828 "configure"
6828 #include "confdefs.h"
6829 /* pthread test headers */
6830 #include <pthread.h>
6831 #ifndef NULL
6832 #define NULL (void*)0
6833 #endif
6834
6835 static void *task(p)
6836         void *p;
6837 {
6838         return (void *) (p == NULL);
6839 }
6840
6841 int main() {
6842
6843         /* pthread test function */
6844         pthread_t t;
6845         int status;
6846
6847         /* make sure pthread_create() isn't just a stub */
6848 #if HAVE_PTHREADS_D4
6849         status = pthread_create(&t, pthread_attr_default, task, NULL);
6850 #else
6851         status = pthread_create(&t, NULL, task, NULL);
6852 #endif
6853
6854         if( status ) exit( status );
6855
6856         /* make sure pthread_detach() isn't just a stub */
6857 #if HAVE_PTHREADS_D4
6858         status = pthread_detach( &t );
6859 #else
6860         status = pthread_detach( t );
6861 #endif
6862
6863 #ifdef HAVE_LINUX_THREADS
6864         pthread_kill_other_threads_np();
6865 #endif
6866
6867         exit( status );
6868
6869 ; return 0; }
6870 EOF
6871 if { (eval echo configure:6872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6872   rm -rf conftest*
6873   ol_cv_pthread_pthread=yes
6874 else
6875   echo "configure: failed program was:" >&5
6876   cat conftest.$ac_ext >&5
6877   rm -rf conftest*
6878   ol_cv_pthread_pthread=no
6879 fi
6880 rm -f conftest*
6881 else
6882   cat > conftest.$ac_ext <<EOF
6883 #line 6884 "configure"
6884 #include "confdefs.h"
6885 /* pthread test headers */
6886 #include <pthread.h>
6887 #ifndef NULL
6888 #define NULL (void*)0
6889 #endif
6890
6891 static void *task(p)
6892         void *p;
6893 {
6894         return (void *) (p == NULL);
6895 }
6896
6897
6898 int main(argc, argv)
6899         int argc;
6900         char **argv;
6901 {
6902
6903         /* pthread test function */
6904         pthread_t t;
6905         int status;
6906
6907         /* make sure pthread_create() isn't just a stub */
6908 #if HAVE_PTHREADS_D4
6909         status = pthread_create(&t, pthread_attr_default, task, NULL);
6910 #else
6911         status = pthread_create(&t, NULL, task, NULL);
6912 #endif
6913
6914         if( status ) exit( status );
6915
6916         /* make sure pthread_detach() isn't just a stub */
6917 #if HAVE_PTHREADS_D4
6918         status = pthread_detach( &t );
6919 #else
6920         status = pthread_detach( t );
6921 #endif
6922
6923 #ifdef HAVE_LINUX_THREADS
6924         pthread_kill_other_threads_np();
6925 #endif
6926
6927         exit( status );
6928
6929 }
6930
6931 EOF
6932 if { (eval echo configure:6933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6933 then
6934   ol_cv_pthread_pthread=yes
6935 else
6936   echo "configure: failed program was:" >&5
6937   cat conftest.$ac_ext >&5
6938   rm -fr conftest*
6939   ol_cv_pthread_pthread=no
6940 fi
6941 rm -fr conftest*
6942 fi
6943
6944
6945                 # restore the LIBS
6946                 LIBS="$ol_LIBS"
6947         
6948 fi
6949
6950 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
6951
6952         if test $ol_cv_pthread_pthread = yes ; then
6953                 ol_link_pthreads="-pthread"
6954                 ol_link_threads=posix
6955         fi
6956 fi
6957
6958                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
6959 if test "$ol_link_threads" = no ; then
6960         # try -pthreads
6961         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
6962 echo "configure:6963: checking for pthread link with -pthreads" >&5
6963 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
6964   echo $ac_n "(cached) $ac_c" 1>&6
6965 else
6966   
6967                 # save the flags
6968                 ol_LIBS="$LIBS"
6969                 LIBS="-pthreads $LIBS"
6970
6971                 if test "$cross_compiling" = yes; then
6972   cat > conftest.$ac_ext <<EOF
6973 #line 6974 "configure"
6974 #include "confdefs.h"
6975 /* pthread test headers */
6976 #include <pthread.h>
6977 #ifndef NULL
6978 #define NULL (void*)0
6979 #endif
6980
6981 static void *task(p)
6982         void *p;
6983 {
6984         return (void *) (p == NULL);
6985 }
6986
6987 int main() {
6988
6989         /* pthread test function */
6990         pthread_t t;
6991         int status;
6992
6993         /* make sure pthread_create() isn't just a stub */
6994 #if HAVE_PTHREADS_D4
6995         status = pthread_create(&t, pthread_attr_default, task, NULL);
6996 #else
6997         status = pthread_create(&t, NULL, task, NULL);
6998 #endif
6999
7000         if( status ) exit( status );
7001
7002         /* make sure pthread_detach() isn't just a stub */
7003 #if HAVE_PTHREADS_D4
7004         status = pthread_detach( &t );
7005 #else
7006         status = pthread_detach( t );
7007 #endif
7008
7009 #ifdef HAVE_LINUX_THREADS
7010         pthread_kill_other_threads_np();
7011 #endif
7012
7013         exit( status );
7014
7015 ; return 0; }
7016 EOF
7017 if { (eval echo configure:7018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7018   rm -rf conftest*
7019   ol_cv_pthread_pthreads=yes
7020 else
7021   echo "configure: failed program was:" >&5
7022   cat conftest.$ac_ext >&5
7023   rm -rf conftest*
7024   ol_cv_pthread_pthreads=no
7025 fi
7026 rm -f conftest*
7027 else
7028   cat > conftest.$ac_ext <<EOF
7029 #line 7030 "configure"
7030 #include "confdefs.h"
7031 /* pthread test headers */
7032 #include <pthread.h>
7033 #ifndef NULL
7034 #define NULL (void*)0
7035 #endif
7036
7037 static void *task(p)
7038         void *p;
7039 {
7040         return (void *) (p == NULL);
7041 }
7042
7043
7044 int main(argc, argv)
7045         int argc;
7046         char **argv;
7047 {
7048
7049         /* pthread test function */
7050         pthread_t t;
7051         int status;
7052
7053         /* make sure pthread_create() isn't just a stub */
7054 #if HAVE_PTHREADS_D4
7055         status = pthread_create(&t, pthread_attr_default, task, NULL);
7056 #else
7057         status = pthread_create(&t, NULL, task, NULL);
7058 #endif
7059
7060         if( status ) exit( status );
7061
7062         /* make sure pthread_detach() isn't just a stub */
7063 #if HAVE_PTHREADS_D4
7064         status = pthread_detach( &t );
7065 #else
7066         status = pthread_detach( t );
7067 #endif
7068
7069 #ifdef HAVE_LINUX_THREADS
7070         pthread_kill_other_threads_np();
7071 #endif
7072
7073         exit( status );
7074
7075 }
7076
7077 EOF
7078 if { (eval echo configure:7079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7079 then
7080   ol_cv_pthread_pthreads=yes
7081 else
7082   echo "configure: failed program was:" >&5
7083   cat conftest.$ac_ext >&5
7084   rm -fr conftest*
7085   ol_cv_pthread_pthreads=no
7086 fi
7087 rm -fr conftest*
7088 fi
7089
7090
7091                 # restore the LIBS
7092                 LIBS="$ol_LIBS"
7093         
7094 fi
7095
7096 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
7097
7098         if test $ol_cv_pthread_pthreads = yes ; then
7099                 ol_link_pthreads="-pthreads"
7100                 ol_link_threads=posix
7101         fi
7102 fi
7103
7104                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
7105 if test "$ol_link_threads" = no ; then
7106         # try -mthreads
7107         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
7108 echo "configure:7109: checking for pthread link with -mthreads" >&5
7109 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
7110   echo $ac_n "(cached) $ac_c" 1>&6
7111 else
7112   
7113                 # save the flags
7114                 ol_LIBS="$LIBS"
7115                 LIBS="-mthreads $LIBS"
7116
7117                 if test "$cross_compiling" = yes; then
7118   cat > conftest.$ac_ext <<EOF
7119 #line 7120 "configure"
7120 #include "confdefs.h"
7121 /* pthread test headers */
7122 #include <pthread.h>
7123 #ifndef NULL
7124 #define NULL (void*)0
7125 #endif
7126
7127 static void *task(p)
7128         void *p;
7129 {
7130         return (void *) (p == NULL);
7131 }
7132
7133 int main() {
7134
7135         /* pthread test function */
7136         pthread_t t;
7137         int status;
7138
7139         /* make sure pthread_create() isn't just a stub */
7140 #if HAVE_PTHREADS_D4
7141         status = pthread_create(&t, pthread_attr_default, task, NULL);
7142 #else
7143         status = pthread_create(&t, NULL, task, NULL);
7144 #endif
7145
7146         if( status ) exit( status );
7147
7148         /* make sure pthread_detach() isn't just a stub */
7149 #if HAVE_PTHREADS_D4
7150         status = pthread_detach( &t );
7151 #else
7152         status = pthread_detach( t );
7153 #endif
7154
7155 #ifdef HAVE_LINUX_THREADS
7156         pthread_kill_other_threads_np();
7157 #endif
7158
7159         exit( status );
7160
7161 ; return 0; }
7162 EOF
7163 if { (eval echo configure:7164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7164   rm -rf conftest*
7165   ol_cv_pthread_mthreads=yes
7166 else
7167   echo "configure: failed program was:" >&5
7168   cat conftest.$ac_ext >&5
7169   rm -rf conftest*
7170   ol_cv_pthread_mthreads=no
7171 fi
7172 rm -f conftest*
7173 else
7174   cat > conftest.$ac_ext <<EOF
7175 #line 7176 "configure"
7176 #include "confdefs.h"
7177 /* pthread test headers */
7178 #include <pthread.h>
7179 #ifndef NULL
7180 #define NULL (void*)0
7181 #endif
7182
7183 static void *task(p)
7184         void *p;
7185 {
7186         return (void *) (p == NULL);
7187 }
7188
7189
7190 int main(argc, argv)
7191         int argc;
7192         char **argv;
7193 {
7194
7195         /* pthread test function */
7196         pthread_t t;
7197         int status;
7198
7199         /* make sure pthread_create() isn't just a stub */
7200 #if HAVE_PTHREADS_D4
7201         status = pthread_create(&t, pthread_attr_default, task, NULL);
7202 #else
7203         status = pthread_create(&t, NULL, task, NULL);
7204 #endif
7205
7206         if( status ) exit( status );
7207
7208         /* make sure pthread_detach() isn't just a stub */
7209 #if HAVE_PTHREADS_D4
7210         status = pthread_detach( &t );
7211 #else
7212         status = pthread_detach( t );
7213 #endif
7214
7215 #ifdef HAVE_LINUX_THREADS
7216         pthread_kill_other_threads_np();
7217 #endif
7218
7219         exit( status );
7220
7221 }
7222
7223 EOF
7224 if { (eval echo configure:7225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7225 then
7226   ol_cv_pthread_mthreads=yes
7227 else
7228   echo "configure: failed program was:" >&5
7229   cat conftest.$ac_ext >&5
7230   rm -fr conftest*
7231   ol_cv_pthread_mthreads=no
7232 fi
7233 rm -fr conftest*
7234 fi
7235
7236
7237                 # restore the LIBS
7238                 LIBS="$ol_LIBS"
7239         
7240 fi
7241
7242 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
7243
7244         if test $ol_cv_pthread_mthreads = yes ; then
7245                 ol_link_pthreads="-mthreads"
7246                 ol_link_threads=posix
7247         fi
7248 fi
7249
7250                 # Pthread try link: -thread (ol_cv_pthread_thread)
7251 if test "$ol_link_threads" = no ; then
7252         # try -thread
7253         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
7254 echo "configure:7255: checking for pthread link with -thread" >&5
7255 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
7256   echo $ac_n "(cached) $ac_c" 1>&6
7257 else
7258   
7259                 # save the flags
7260                 ol_LIBS="$LIBS"
7261                 LIBS="-thread $LIBS"
7262
7263                 if test "$cross_compiling" = yes; then
7264   cat > conftest.$ac_ext <<EOF
7265 #line 7266 "configure"
7266 #include "confdefs.h"
7267 /* pthread test headers */
7268 #include <pthread.h>
7269 #ifndef NULL
7270 #define NULL (void*)0
7271 #endif
7272
7273 static void *task(p)
7274         void *p;
7275 {
7276         return (void *) (p == NULL);
7277 }
7278
7279 int main() {
7280
7281         /* pthread test function */
7282         pthread_t t;
7283         int status;
7284
7285         /* make sure pthread_create() isn't just a stub */
7286 #if HAVE_PTHREADS_D4
7287         status = pthread_create(&t, pthread_attr_default, task, NULL);
7288 #else
7289         status = pthread_create(&t, NULL, task, NULL);
7290 #endif
7291
7292         if( status ) exit( status );
7293
7294         /* make sure pthread_detach() isn't just a stub */
7295 #if HAVE_PTHREADS_D4
7296         status = pthread_detach( &t );
7297 #else
7298         status = pthread_detach( t );
7299 #endif
7300
7301 #ifdef HAVE_LINUX_THREADS
7302         pthread_kill_other_threads_np();
7303 #endif
7304
7305         exit( status );
7306
7307 ; return 0; }
7308 EOF
7309 if { (eval echo configure:7310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7310   rm -rf conftest*
7311   ol_cv_pthread_thread=yes
7312 else
7313   echo "configure: failed program was:" >&5
7314   cat conftest.$ac_ext >&5
7315   rm -rf conftest*
7316   ol_cv_pthread_thread=no
7317 fi
7318 rm -f conftest*
7319 else
7320   cat > conftest.$ac_ext <<EOF
7321 #line 7322 "configure"
7322 #include "confdefs.h"
7323 /* pthread test headers */
7324 #include <pthread.h>
7325 #ifndef NULL
7326 #define NULL (void*)0
7327 #endif
7328
7329 static void *task(p)
7330         void *p;
7331 {
7332         return (void *) (p == NULL);
7333 }
7334
7335
7336 int main(argc, argv)
7337         int argc;
7338         char **argv;
7339 {
7340
7341         /* pthread test function */
7342         pthread_t t;
7343         int status;
7344
7345         /* make sure pthread_create() isn't just a stub */
7346 #if HAVE_PTHREADS_D4
7347         status = pthread_create(&t, pthread_attr_default, task, NULL);
7348 #else
7349         status = pthread_create(&t, NULL, task, NULL);
7350 #endif
7351
7352         if( status ) exit( status );
7353
7354         /* make sure pthread_detach() isn't just a stub */
7355 #if HAVE_PTHREADS_D4
7356         status = pthread_detach( &t );
7357 #else
7358         status = pthread_detach( t );
7359 #endif
7360
7361 #ifdef HAVE_LINUX_THREADS
7362         pthread_kill_other_threads_np();
7363 #endif
7364
7365         exit( status );
7366
7367 }
7368
7369 EOF
7370 if { (eval echo configure:7371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7371 then
7372   ol_cv_pthread_thread=yes
7373 else
7374   echo "configure: failed program was:" >&5
7375   cat conftest.$ac_ext >&5
7376   rm -fr conftest*
7377   ol_cv_pthread_thread=no
7378 fi
7379 rm -fr conftest*
7380 fi
7381
7382
7383                 # restore the LIBS
7384                 LIBS="$ol_LIBS"
7385         
7386 fi
7387
7388 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
7389
7390         if test $ol_cv_pthread_thread = yes ; then
7391                 ol_link_pthreads="-thread"
7392                 ol_link_threads=posix
7393         fi
7394 fi
7395
7396
7397                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
7398 if test "$ol_link_threads" = no ; then
7399         # try -lpthread -lmach -lexc -lc_r
7400         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
7401 echo "configure:7402: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
7402 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
7403   echo $ac_n "(cached) $ac_c" 1>&6
7404 else
7405   
7406                 # save the flags
7407                 ol_LIBS="$LIBS"
7408                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
7409
7410                 if test "$cross_compiling" = yes; then
7411   cat > conftest.$ac_ext <<EOF
7412 #line 7413 "configure"
7413 #include "confdefs.h"
7414 /* pthread test headers */
7415 #include <pthread.h>
7416 #ifndef NULL
7417 #define NULL (void*)0
7418 #endif
7419
7420 static void *task(p)
7421         void *p;
7422 {
7423         return (void *) (p == NULL);
7424 }
7425
7426 int main() {
7427
7428         /* pthread test function */
7429         pthread_t t;
7430         int status;
7431
7432         /* make sure pthread_create() isn't just a stub */
7433 #if HAVE_PTHREADS_D4
7434         status = pthread_create(&t, pthread_attr_default, task, NULL);
7435 #else
7436         status = pthread_create(&t, NULL, task, NULL);
7437 #endif
7438
7439         if( status ) exit( status );
7440
7441         /* make sure pthread_detach() isn't just a stub */
7442 #if HAVE_PTHREADS_D4
7443         status = pthread_detach( &t );
7444 #else
7445         status = pthread_detach( t );
7446 #endif
7447
7448 #ifdef HAVE_LINUX_THREADS
7449         pthread_kill_other_threads_np();
7450 #endif
7451
7452         exit( status );
7453
7454 ; return 0; }
7455 EOF
7456 if { (eval echo configure:7457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7457   rm -rf conftest*
7458   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
7459 else
7460   echo "configure: failed program was:" >&5
7461   cat conftest.$ac_ext >&5
7462   rm -rf conftest*
7463   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
7464 fi
7465 rm -f conftest*
7466 else
7467   cat > conftest.$ac_ext <<EOF
7468 #line 7469 "configure"
7469 #include "confdefs.h"
7470 /* pthread test headers */
7471 #include <pthread.h>
7472 #ifndef NULL
7473 #define NULL (void*)0
7474 #endif
7475
7476 static void *task(p)
7477         void *p;
7478 {
7479         return (void *) (p == NULL);
7480 }
7481
7482
7483 int main(argc, argv)
7484         int argc;
7485         char **argv;
7486 {
7487
7488         /* pthread test function */
7489         pthread_t t;
7490         int status;
7491
7492         /* make sure pthread_create() isn't just a stub */
7493 #if HAVE_PTHREADS_D4
7494         status = pthread_create(&t, pthread_attr_default, task, NULL);
7495 #else
7496         status = pthread_create(&t, NULL, task, NULL);
7497 #endif
7498
7499         if( status ) exit( status );
7500
7501         /* make sure pthread_detach() isn't just a stub */
7502 #if HAVE_PTHREADS_D4
7503         status = pthread_detach( &t );
7504 #else
7505         status = pthread_detach( t );
7506 #endif
7507
7508 #ifdef HAVE_LINUX_THREADS
7509         pthread_kill_other_threads_np();
7510 #endif
7511
7512         exit( status );
7513
7514 }
7515
7516 EOF
7517 if { (eval echo configure:7518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7518 then
7519   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
7520 else
7521   echo "configure: failed program was:" >&5
7522   cat conftest.$ac_ext >&5
7523   rm -fr conftest*
7524   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
7525 fi
7526 rm -fr conftest*
7527 fi
7528
7529
7530                 # restore the LIBS
7531                 LIBS="$ol_LIBS"
7532         
7533 fi
7534
7535 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
7536
7537         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
7538                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
7539                 ol_link_threads=posix
7540         fi
7541 fi
7542
7543                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
7544 if test "$ol_link_threads" = no ; then
7545         # try -lpthread -lmach -lexc
7546         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
7547 echo "configure:7548: checking for pthread link with -lpthread -lmach -lexc" >&5
7548 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
7549   echo $ac_n "(cached) $ac_c" 1>&6
7550 else
7551   
7552                 # save the flags
7553                 ol_LIBS="$LIBS"
7554                 LIBS="-lpthread -lmach -lexc $LIBS"
7555
7556                 if test "$cross_compiling" = yes; then
7557   cat > conftest.$ac_ext <<EOF
7558 #line 7559 "configure"
7559 #include "confdefs.h"
7560 /* pthread test headers */
7561 #include <pthread.h>
7562 #ifndef NULL
7563 #define NULL (void*)0
7564 #endif
7565
7566 static void *task(p)
7567         void *p;
7568 {
7569         return (void *) (p == NULL);
7570 }
7571
7572 int main() {
7573
7574         /* pthread test function */
7575         pthread_t t;
7576         int status;
7577
7578         /* make sure pthread_create() isn't just a stub */
7579 #if HAVE_PTHREADS_D4
7580         status = pthread_create(&t, pthread_attr_default, task, NULL);
7581 #else
7582         status = pthread_create(&t, NULL, task, NULL);
7583 #endif
7584
7585         if( status ) exit( status );
7586
7587         /* make sure pthread_detach() isn't just a stub */
7588 #if HAVE_PTHREADS_D4
7589         status = pthread_detach( &t );
7590 #else
7591         status = pthread_detach( t );
7592 #endif
7593
7594 #ifdef HAVE_LINUX_THREADS
7595         pthread_kill_other_threads_np();
7596 #endif
7597
7598         exit( status );
7599
7600 ; return 0; }
7601 EOF
7602 if { (eval echo configure:7603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7603   rm -rf conftest*
7604   ol_cv_pthread_lpthread_lmach_lexc=yes
7605 else
7606   echo "configure: failed program was:" >&5
7607   cat conftest.$ac_ext >&5
7608   rm -rf conftest*
7609   ol_cv_pthread_lpthread_lmach_lexc=no
7610 fi
7611 rm -f conftest*
7612 else
7613   cat > conftest.$ac_ext <<EOF
7614 #line 7615 "configure"
7615 #include "confdefs.h"
7616 /* pthread test headers */
7617 #include <pthread.h>
7618 #ifndef NULL
7619 #define NULL (void*)0
7620 #endif
7621
7622 static void *task(p)
7623         void *p;
7624 {
7625         return (void *) (p == NULL);
7626 }
7627
7628
7629 int main(argc, argv)
7630         int argc;
7631         char **argv;
7632 {
7633
7634         /* pthread test function */
7635         pthread_t t;
7636         int status;
7637
7638         /* make sure pthread_create() isn't just a stub */
7639 #if HAVE_PTHREADS_D4
7640         status = pthread_create(&t, pthread_attr_default, task, NULL);
7641 #else
7642         status = pthread_create(&t, NULL, task, NULL);
7643 #endif
7644
7645         if( status ) exit( status );
7646
7647         /* make sure pthread_detach() isn't just a stub */
7648 #if HAVE_PTHREADS_D4
7649         status = pthread_detach( &t );
7650 #else
7651         status = pthread_detach( t );
7652 #endif
7653
7654 #ifdef HAVE_LINUX_THREADS
7655         pthread_kill_other_threads_np();
7656 #endif
7657
7658         exit( status );
7659
7660 }
7661
7662 EOF
7663 if { (eval echo configure:7664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7664 then
7665   ol_cv_pthread_lpthread_lmach_lexc=yes
7666 else
7667   echo "configure: failed program was:" >&5
7668   cat conftest.$ac_ext >&5
7669   rm -fr conftest*
7670   ol_cv_pthread_lpthread_lmach_lexc=no
7671 fi
7672 rm -fr conftest*
7673 fi
7674
7675
7676                 # restore the LIBS
7677                 LIBS="$ol_LIBS"
7678         
7679 fi
7680
7681 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
7682
7683         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
7684                 ol_link_pthreads="-lpthread -lmach -lexc"
7685                 ol_link_threads=posix
7686         fi
7687 fi
7688
7689
7690                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
7691 if test "$ol_link_threads" = no ; then
7692         # try -lpthread -Wl,-woff,85
7693         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
7694 echo "configure:7695: checking for pthread link with -lpthread -Wl,-woff,85" >&5
7695 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
7696   echo $ac_n "(cached) $ac_c" 1>&6
7697 else
7698   
7699                 # save the flags
7700                 ol_LIBS="$LIBS"
7701                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
7702
7703                 if test "$cross_compiling" = yes; then
7704   cat > conftest.$ac_ext <<EOF
7705 #line 7706 "configure"
7706 #include "confdefs.h"
7707 /* pthread test headers */
7708 #include <pthread.h>
7709 #ifndef NULL
7710 #define NULL (void*)0
7711 #endif
7712
7713 static void *task(p)
7714         void *p;
7715 {
7716         return (void *) (p == NULL);
7717 }
7718
7719 int main() {
7720
7721         /* pthread test function */
7722         pthread_t t;
7723         int status;
7724
7725         /* make sure pthread_create() isn't just a stub */
7726 #if HAVE_PTHREADS_D4
7727         status = pthread_create(&t, pthread_attr_default, task, NULL);
7728 #else
7729         status = pthread_create(&t, NULL, task, NULL);
7730 #endif
7731
7732         if( status ) exit( status );
7733
7734         /* make sure pthread_detach() isn't just a stub */
7735 #if HAVE_PTHREADS_D4
7736         status = pthread_detach( &t );
7737 #else
7738         status = pthread_detach( t );
7739 #endif
7740
7741 #ifdef HAVE_LINUX_THREADS
7742         pthread_kill_other_threads_np();
7743 #endif
7744
7745         exit( status );
7746
7747 ; return 0; }
7748 EOF
7749 if { (eval echo configure:7750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7750   rm -rf conftest*
7751   ol_cv_pthread_lib_lpthread_woff=yes
7752 else
7753   echo "configure: failed program was:" >&5
7754   cat conftest.$ac_ext >&5
7755   rm -rf conftest*
7756   ol_cv_pthread_lib_lpthread_woff=no
7757 fi
7758 rm -f conftest*
7759 else
7760   cat > conftest.$ac_ext <<EOF
7761 #line 7762 "configure"
7762 #include "confdefs.h"
7763 /* pthread test headers */
7764 #include <pthread.h>
7765 #ifndef NULL
7766 #define NULL (void*)0
7767 #endif
7768
7769 static void *task(p)
7770         void *p;
7771 {
7772         return (void *) (p == NULL);
7773 }
7774
7775
7776 int main(argc, argv)
7777         int argc;
7778         char **argv;
7779 {
7780
7781         /* pthread test function */
7782         pthread_t t;
7783         int status;
7784
7785         /* make sure pthread_create() isn't just a stub */
7786 #if HAVE_PTHREADS_D4
7787         status = pthread_create(&t, pthread_attr_default, task, NULL);
7788 #else
7789         status = pthread_create(&t, NULL, task, NULL);
7790 #endif
7791
7792         if( status ) exit( status );
7793
7794         /* make sure pthread_detach() isn't just a stub */
7795 #if HAVE_PTHREADS_D4
7796         status = pthread_detach( &t );
7797 #else
7798         status = pthread_detach( t );
7799 #endif
7800
7801 #ifdef HAVE_LINUX_THREADS
7802         pthread_kill_other_threads_np();
7803 #endif
7804
7805         exit( status );
7806
7807 }
7808
7809 EOF
7810 if { (eval echo configure:7811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7811 then
7812   ol_cv_pthread_lib_lpthread_woff=yes
7813 else
7814   echo "configure: failed program was:" >&5
7815   cat conftest.$ac_ext >&5
7816   rm -fr conftest*
7817   ol_cv_pthread_lib_lpthread_woff=no
7818 fi
7819 rm -fr conftest*
7820 fi
7821
7822
7823                 # restore the LIBS
7824                 LIBS="$ol_LIBS"
7825         
7826 fi
7827
7828 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
7829
7830         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
7831                 ol_link_pthreads="-lpthread -Wl,-woff,85"
7832                 ol_link_threads=posix
7833         fi
7834 fi
7835
7836
7837                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
7838 if test "$ol_link_threads" = no ; then
7839         # try -lpthread
7840         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
7841 echo "configure:7842: checking for pthread link with -lpthread" >&5
7842 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
7843   echo $ac_n "(cached) $ac_c" 1>&6
7844 else
7845   
7846                 # save the flags
7847                 ol_LIBS="$LIBS"
7848                 LIBS="-lpthread $LIBS"
7849
7850                 if test "$cross_compiling" = yes; then
7851   cat > conftest.$ac_ext <<EOF
7852 #line 7853 "configure"
7853 #include "confdefs.h"
7854 /* pthread test headers */
7855 #include <pthread.h>
7856 #ifndef NULL
7857 #define NULL (void*)0
7858 #endif
7859
7860 static void *task(p)
7861         void *p;
7862 {
7863         return (void *) (p == NULL);
7864 }
7865
7866 int main() {
7867
7868         /* pthread test function */
7869         pthread_t t;
7870         int status;
7871
7872         /* make sure pthread_create() isn't just a stub */
7873 #if HAVE_PTHREADS_D4
7874         status = pthread_create(&t, pthread_attr_default, task, NULL);
7875 #else
7876         status = pthread_create(&t, NULL, task, NULL);
7877 #endif
7878
7879         if( status ) exit( status );
7880
7881         /* make sure pthread_detach() isn't just a stub */
7882 #if HAVE_PTHREADS_D4
7883         status = pthread_detach( &t );
7884 #else
7885         status = pthread_detach( t );
7886 #endif
7887
7888 #ifdef HAVE_LINUX_THREADS
7889         pthread_kill_other_threads_np();
7890 #endif
7891
7892         exit( status );
7893
7894 ; return 0; }
7895 EOF
7896 if { (eval echo configure:7897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7897   rm -rf conftest*
7898   ol_cv_pthread_lpthread=yes
7899 else
7900   echo "configure: failed program was:" >&5
7901   cat conftest.$ac_ext >&5
7902   rm -rf conftest*
7903   ol_cv_pthread_lpthread=no
7904 fi
7905 rm -f conftest*
7906 else
7907   cat > conftest.$ac_ext <<EOF
7908 #line 7909 "configure"
7909 #include "confdefs.h"
7910 /* pthread test headers */
7911 #include <pthread.h>
7912 #ifndef NULL
7913 #define NULL (void*)0
7914 #endif
7915
7916 static void *task(p)
7917         void *p;
7918 {
7919         return (void *) (p == NULL);
7920 }
7921
7922
7923 int main(argc, argv)
7924         int argc;
7925         char **argv;
7926 {
7927
7928         /* pthread test function */
7929         pthread_t t;
7930         int status;
7931
7932         /* make sure pthread_create() isn't just a stub */
7933 #if HAVE_PTHREADS_D4
7934         status = pthread_create(&t, pthread_attr_default, task, NULL);
7935 #else
7936         status = pthread_create(&t, NULL, task, NULL);
7937 #endif
7938
7939         if( status ) exit( status );
7940
7941         /* make sure pthread_detach() isn't just a stub */
7942 #if HAVE_PTHREADS_D4
7943         status = pthread_detach( &t );
7944 #else
7945         status = pthread_detach( t );
7946 #endif
7947
7948 #ifdef HAVE_LINUX_THREADS
7949         pthread_kill_other_threads_np();
7950 #endif
7951
7952         exit( status );
7953
7954 }
7955
7956 EOF
7957 if { (eval echo configure:7958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7958 then
7959   ol_cv_pthread_lpthread=yes
7960 else
7961   echo "configure: failed program was:" >&5
7962   cat conftest.$ac_ext >&5
7963   rm -fr conftest*
7964   ol_cv_pthread_lpthread=no
7965 fi
7966 rm -fr conftest*
7967 fi
7968
7969
7970                 # restore the LIBS
7971                 LIBS="$ol_LIBS"
7972         
7973 fi
7974
7975 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
7976
7977         if test $ol_cv_pthread_lpthread = yes ; then
7978                 ol_link_pthreads="-lpthread"
7979                 ol_link_threads=posix
7980         fi
7981 fi
7982
7983                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
7984 if test "$ol_link_threads" = no ; then
7985         # try -lc_r
7986         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
7987 echo "configure:7988: checking for pthread link with -lc_r" >&5
7988 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
7989   echo $ac_n "(cached) $ac_c" 1>&6
7990 else
7991   
7992                 # save the flags
7993                 ol_LIBS="$LIBS"
7994                 LIBS="-lc_r $LIBS"
7995
7996                 if test "$cross_compiling" = yes; then
7997   cat > conftest.$ac_ext <<EOF
7998 #line 7999 "configure"
7999 #include "confdefs.h"
8000 /* pthread test headers */
8001 #include <pthread.h>
8002 #ifndef NULL
8003 #define NULL (void*)0
8004 #endif
8005
8006 static void *task(p)
8007         void *p;
8008 {
8009         return (void *) (p == NULL);
8010 }
8011
8012 int main() {
8013
8014         /* pthread test function */
8015         pthread_t t;
8016         int status;
8017
8018         /* make sure pthread_create() isn't just a stub */
8019 #if HAVE_PTHREADS_D4
8020         status = pthread_create(&t, pthread_attr_default, task, NULL);
8021 #else
8022         status = pthread_create(&t, NULL, task, NULL);
8023 #endif
8024
8025         if( status ) exit( status );
8026
8027         /* make sure pthread_detach() isn't just a stub */
8028 #if HAVE_PTHREADS_D4
8029         status = pthread_detach( &t );
8030 #else
8031         status = pthread_detach( t );
8032 #endif
8033
8034 #ifdef HAVE_LINUX_THREADS
8035         pthread_kill_other_threads_np();
8036 #endif
8037
8038         exit( status );
8039
8040 ; return 0; }
8041 EOF
8042 if { (eval echo configure:8043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8043   rm -rf conftest*
8044   ol_cv_pthread_lc_r=yes
8045 else
8046   echo "configure: failed program was:" >&5
8047   cat conftest.$ac_ext >&5
8048   rm -rf conftest*
8049   ol_cv_pthread_lc_r=no
8050 fi
8051 rm -f conftest*
8052 else
8053   cat > conftest.$ac_ext <<EOF
8054 #line 8055 "configure"
8055 #include "confdefs.h"
8056 /* pthread test headers */
8057 #include <pthread.h>
8058 #ifndef NULL
8059 #define NULL (void*)0
8060 #endif
8061
8062 static void *task(p)
8063         void *p;
8064 {
8065         return (void *) (p == NULL);
8066 }
8067
8068
8069 int main(argc, argv)
8070         int argc;
8071         char **argv;
8072 {
8073
8074         /* pthread test function */
8075         pthread_t t;
8076         int status;
8077
8078         /* make sure pthread_create() isn't just a stub */
8079 #if HAVE_PTHREADS_D4
8080         status = pthread_create(&t, pthread_attr_default, task, NULL);
8081 #else
8082         status = pthread_create(&t, NULL, task, NULL);
8083 #endif
8084
8085         if( status ) exit( status );
8086
8087         /* make sure pthread_detach() isn't just a stub */
8088 #if HAVE_PTHREADS_D4
8089         status = pthread_detach( &t );
8090 #else
8091         status = pthread_detach( t );
8092 #endif
8093
8094 #ifdef HAVE_LINUX_THREADS
8095         pthread_kill_other_threads_np();
8096 #endif
8097
8098         exit( status );
8099
8100 }
8101
8102 EOF
8103 if { (eval echo configure:8104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8104 then
8105   ol_cv_pthread_lc_r=yes
8106 else
8107   echo "configure: failed program was:" >&5
8108   cat conftest.$ac_ext >&5
8109   rm -fr conftest*
8110   ol_cv_pthread_lc_r=no
8111 fi
8112 rm -fr conftest*
8113 fi
8114
8115
8116                 # restore the LIBS
8117                 LIBS="$ol_LIBS"
8118         
8119 fi
8120
8121 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
8122
8123         if test $ol_cv_pthread_lc_r = yes ; then
8124                 ol_link_pthreads="-lc_r"
8125                 ol_link_threads=posix
8126         fi
8127 fi
8128
8129
8130                 # Pthread try link: -threads (ol_cv_pthread_threads)
8131 if test "$ol_link_threads" = no ; then
8132         # try -threads
8133         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
8134 echo "configure:8135: checking for pthread link with -threads" >&5
8135 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
8136   echo $ac_n "(cached) $ac_c" 1>&6
8137 else
8138   
8139                 # save the flags
8140                 ol_LIBS="$LIBS"
8141                 LIBS="-threads $LIBS"
8142
8143                 if test "$cross_compiling" = yes; then
8144   cat > conftest.$ac_ext <<EOF
8145 #line 8146 "configure"
8146 #include "confdefs.h"
8147 /* pthread test headers */
8148 #include <pthread.h>
8149 #ifndef NULL
8150 #define NULL (void*)0
8151 #endif
8152
8153 static void *task(p)
8154         void *p;
8155 {
8156         return (void *) (p == NULL);
8157 }
8158
8159 int main() {
8160
8161         /* pthread test function */
8162         pthread_t t;
8163         int status;
8164
8165         /* make sure pthread_create() isn't just a stub */
8166 #if HAVE_PTHREADS_D4
8167         status = pthread_create(&t, pthread_attr_default, task, NULL);
8168 #else
8169         status = pthread_create(&t, NULL, task, NULL);
8170 #endif
8171
8172         if( status ) exit( status );
8173
8174         /* make sure pthread_detach() isn't just a stub */
8175 #if HAVE_PTHREADS_D4
8176         status = pthread_detach( &t );
8177 #else
8178         status = pthread_detach( t );
8179 #endif
8180
8181 #ifdef HAVE_LINUX_THREADS
8182         pthread_kill_other_threads_np();
8183 #endif
8184
8185         exit( status );
8186
8187 ; return 0; }
8188 EOF
8189 if { (eval echo configure:8190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8190   rm -rf conftest*
8191   ol_cv_pthread_threads=yes
8192 else
8193   echo "configure: failed program was:" >&5
8194   cat conftest.$ac_ext >&5
8195   rm -rf conftest*
8196   ol_cv_pthread_threads=no
8197 fi
8198 rm -f conftest*
8199 else
8200   cat > conftest.$ac_ext <<EOF
8201 #line 8202 "configure"
8202 #include "confdefs.h"
8203 /* pthread test headers */
8204 #include <pthread.h>
8205 #ifndef NULL
8206 #define NULL (void*)0
8207 #endif
8208
8209 static void *task(p)
8210         void *p;
8211 {
8212         return (void *) (p == NULL);
8213 }
8214
8215
8216 int main(argc, argv)
8217         int argc;
8218         char **argv;
8219 {
8220
8221         /* pthread test function */
8222         pthread_t t;
8223         int status;
8224
8225         /* make sure pthread_create() isn't just a stub */
8226 #if HAVE_PTHREADS_D4
8227         status = pthread_create(&t, pthread_attr_default, task, NULL);
8228 #else
8229         status = pthread_create(&t, NULL, task, NULL);
8230 #endif
8231
8232         if( status ) exit( status );
8233
8234         /* make sure pthread_detach() isn't just a stub */
8235 #if HAVE_PTHREADS_D4
8236         status = pthread_detach( &t );
8237 #else
8238         status = pthread_detach( t );
8239 #endif
8240
8241 #ifdef HAVE_LINUX_THREADS
8242         pthread_kill_other_threads_np();
8243 #endif
8244
8245         exit( status );
8246
8247 }
8248
8249 EOF
8250 if { (eval echo configure:8251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8251 then
8252   ol_cv_pthread_threads=yes
8253 else
8254   echo "configure: failed program was:" >&5
8255   cat conftest.$ac_ext >&5
8256   rm -fr conftest*
8257   ol_cv_pthread_threads=no
8258 fi
8259 rm -fr conftest*
8260 fi
8261
8262
8263                 # restore the LIBS
8264                 LIBS="$ol_LIBS"
8265         
8266 fi
8267
8268 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
8269
8270         if test $ol_cv_pthread_threads = yes ; then
8271                 ol_link_pthreads="-threads"
8272                 ol_link_threads=posix
8273         fi
8274 fi
8275
8276
8277                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
8278 if test "$ol_link_threads" = no ; then
8279         # try -lpthreads -lmach -lexc -lc_r
8280         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
8281 echo "configure:8282: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
8282 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
8283   echo $ac_n "(cached) $ac_c" 1>&6
8284 else
8285   
8286                 # save the flags
8287                 ol_LIBS="$LIBS"
8288                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
8289
8290                 if test "$cross_compiling" = yes; then
8291   cat > conftest.$ac_ext <<EOF
8292 #line 8293 "configure"
8293 #include "confdefs.h"
8294 /* pthread test headers */
8295 #include <pthread.h>
8296 #ifndef NULL
8297 #define NULL (void*)0
8298 #endif
8299
8300 static void *task(p)
8301         void *p;
8302 {
8303         return (void *) (p == NULL);
8304 }
8305
8306 int main() {
8307
8308         /* pthread test function */
8309         pthread_t t;
8310         int status;
8311
8312         /* make sure pthread_create() isn't just a stub */
8313 #if HAVE_PTHREADS_D4
8314         status = pthread_create(&t, pthread_attr_default, task, NULL);
8315 #else
8316         status = pthread_create(&t, NULL, task, NULL);
8317 #endif
8318
8319         if( status ) exit( status );
8320
8321         /* make sure pthread_detach() isn't just a stub */
8322 #if HAVE_PTHREADS_D4
8323         status = pthread_detach( &t );
8324 #else
8325         status = pthread_detach( t );
8326 #endif
8327
8328 #ifdef HAVE_LINUX_THREADS
8329         pthread_kill_other_threads_np();
8330 #endif
8331
8332         exit( status );
8333
8334 ; return 0; }
8335 EOF
8336 if { (eval echo configure:8337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8337   rm -rf conftest*
8338   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
8339 else
8340   echo "configure: failed program was:" >&5
8341   cat conftest.$ac_ext >&5
8342   rm -rf conftest*
8343   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
8344 fi
8345 rm -f conftest*
8346 else
8347   cat > conftest.$ac_ext <<EOF
8348 #line 8349 "configure"
8349 #include "confdefs.h"
8350 /* pthread test headers */
8351 #include <pthread.h>
8352 #ifndef NULL
8353 #define NULL (void*)0
8354 #endif
8355
8356 static void *task(p)
8357         void *p;
8358 {
8359         return (void *) (p == NULL);
8360 }
8361
8362
8363 int main(argc, argv)
8364         int argc;
8365         char **argv;
8366 {
8367
8368         /* pthread test function */
8369         pthread_t t;
8370         int status;
8371
8372         /* make sure pthread_create() isn't just a stub */
8373 #if HAVE_PTHREADS_D4
8374         status = pthread_create(&t, pthread_attr_default, task, NULL);
8375 #else
8376         status = pthread_create(&t, NULL, task, NULL);
8377 #endif
8378
8379         if( status ) exit( status );
8380
8381         /* make sure pthread_detach() isn't just a stub */
8382 #if HAVE_PTHREADS_D4
8383         status = pthread_detach( &t );
8384 #else
8385         status = pthread_detach( t );
8386 #endif
8387
8388 #ifdef HAVE_LINUX_THREADS
8389         pthread_kill_other_threads_np();
8390 #endif
8391
8392         exit( status );
8393
8394 }
8395
8396 EOF
8397 if { (eval echo configure:8398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8398 then
8399   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
8400 else
8401   echo "configure: failed program was:" >&5
8402   cat conftest.$ac_ext >&5
8403   rm -fr conftest*
8404   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
8405 fi
8406 rm -fr conftest*
8407 fi
8408
8409
8410                 # restore the LIBS
8411                 LIBS="$ol_LIBS"
8412         
8413 fi
8414
8415 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
8416
8417         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
8418                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
8419                 ol_link_threads=posix
8420         fi
8421 fi
8422
8423                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
8424 if test "$ol_link_threads" = no ; then
8425         # try -lpthreads -lmach -lexc
8426         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
8427 echo "configure:8428: checking for pthread link with -lpthreads -lmach -lexc" >&5
8428 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
8429   echo $ac_n "(cached) $ac_c" 1>&6
8430 else
8431   
8432                 # save the flags
8433                 ol_LIBS="$LIBS"
8434                 LIBS="-lpthreads -lmach -lexc $LIBS"
8435
8436                 if test "$cross_compiling" = yes; then
8437   cat > conftest.$ac_ext <<EOF
8438 #line 8439 "configure"
8439 #include "confdefs.h"
8440 /* pthread test headers */
8441 #include <pthread.h>
8442 #ifndef NULL
8443 #define NULL (void*)0
8444 #endif
8445
8446 static void *task(p)
8447         void *p;
8448 {
8449         return (void *) (p == NULL);
8450 }
8451
8452 int main() {
8453
8454         /* pthread test function */
8455         pthread_t t;
8456         int status;
8457
8458         /* make sure pthread_create() isn't just a stub */
8459 #if HAVE_PTHREADS_D4
8460         status = pthread_create(&t, pthread_attr_default, task, NULL);
8461 #else
8462         status = pthread_create(&t, NULL, task, NULL);
8463 #endif
8464
8465         if( status ) exit( status );
8466
8467         /* make sure pthread_detach() isn't just a stub */
8468 #if HAVE_PTHREADS_D4
8469         status = pthread_detach( &t );
8470 #else
8471         status = pthread_detach( t );
8472 #endif
8473
8474 #ifdef HAVE_LINUX_THREADS
8475         pthread_kill_other_threads_np();
8476 #endif
8477
8478         exit( status );
8479
8480 ; return 0; }
8481 EOF
8482 if { (eval echo configure:8483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8483   rm -rf conftest*
8484   ol_cv_pthread_lpthreads_lmach_lexc=yes
8485 else
8486   echo "configure: failed program was:" >&5
8487   cat conftest.$ac_ext >&5
8488   rm -rf conftest*
8489   ol_cv_pthread_lpthreads_lmach_lexc=no
8490 fi
8491 rm -f conftest*
8492 else
8493   cat > conftest.$ac_ext <<EOF
8494 #line 8495 "configure"
8495 #include "confdefs.h"
8496 /* pthread test headers */
8497 #include <pthread.h>
8498 #ifndef NULL
8499 #define NULL (void*)0
8500 #endif
8501
8502 static void *task(p)
8503         void *p;
8504 {
8505         return (void *) (p == NULL);
8506 }
8507
8508
8509 int main(argc, argv)
8510         int argc;
8511         char **argv;
8512 {
8513
8514         /* pthread test function */
8515         pthread_t t;
8516         int status;
8517
8518         /* make sure pthread_create() isn't just a stub */
8519 #if HAVE_PTHREADS_D4
8520         status = pthread_create(&t, pthread_attr_default, task, NULL);
8521 #else
8522         status = pthread_create(&t, NULL, task, NULL);
8523 #endif
8524
8525         if( status ) exit( status );
8526
8527         /* make sure pthread_detach() isn't just a stub */
8528 #if HAVE_PTHREADS_D4
8529         status = pthread_detach( &t );
8530 #else
8531         status = pthread_detach( t );
8532 #endif
8533
8534 #ifdef HAVE_LINUX_THREADS
8535         pthread_kill_other_threads_np();
8536 #endif
8537
8538         exit( status );
8539
8540 }
8541
8542 EOF
8543 if { (eval echo configure:8544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8544 then
8545   ol_cv_pthread_lpthreads_lmach_lexc=yes
8546 else
8547   echo "configure: failed program was:" >&5
8548   cat conftest.$ac_ext >&5
8549   rm -fr conftest*
8550   ol_cv_pthread_lpthreads_lmach_lexc=no
8551 fi
8552 rm -fr conftest*
8553 fi
8554
8555
8556                 # restore the LIBS
8557                 LIBS="$ol_LIBS"
8558         
8559 fi
8560
8561 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
8562
8563         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
8564                 ol_link_pthreads="-lpthreads -lmach -lexc"
8565                 ol_link_threads=posix
8566         fi
8567 fi
8568
8569                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
8570 if test "$ol_link_threads" = no ; then
8571         # try -lpthreads -lexc
8572         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
8573 echo "configure:8574: checking for pthread link with -lpthreads -lexc" >&5
8574 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
8575   echo $ac_n "(cached) $ac_c" 1>&6
8576 else
8577   
8578                 # save the flags
8579                 ol_LIBS="$LIBS"
8580                 LIBS="-lpthreads -lexc $LIBS"
8581
8582                 if test "$cross_compiling" = yes; then
8583   cat > conftest.$ac_ext <<EOF
8584 #line 8585 "configure"
8585 #include "confdefs.h"
8586 /* pthread test headers */
8587 #include <pthread.h>
8588 #ifndef NULL
8589 #define NULL (void*)0
8590 #endif
8591
8592 static void *task(p)
8593         void *p;
8594 {
8595         return (void *) (p == NULL);
8596 }
8597
8598 int main() {
8599
8600         /* pthread test function */
8601         pthread_t t;
8602         int status;
8603
8604         /* make sure pthread_create() isn't just a stub */
8605 #if HAVE_PTHREADS_D4
8606         status = pthread_create(&t, pthread_attr_default, task, NULL);
8607 #else
8608         status = pthread_create(&t, NULL, task, NULL);
8609 #endif
8610
8611         if( status ) exit( status );
8612
8613         /* make sure pthread_detach() isn't just a stub */
8614 #if HAVE_PTHREADS_D4
8615         status = pthread_detach( &t );
8616 #else
8617         status = pthread_detach( t );
8618 #endif
8619
8620 #ifdef HAVE_LINUX_THREADS
8621         pthread_kill_other_threads_np();
8622 #endif
8623
8624         exit( status );
8625
8626 ; return 0; }
8627 EOF
8628 if { (eval echo configure:8629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8629   rm -rf conftest*
8630   ol_cv_pthread_lpthreads_lexc=yes
8631 else
8632   echo "configure: failed program was:" >&5
8633   cat conftest.$ac_ext >&5
8634   rm -rf conftest*
8635   ol_cv_pthread_lpthreads_lexc=no
8636 fi
8637 rm -f conftest*
8638 else
8639   cat > conftest.$ac_ext <<EOF
8640 #line 8641 "configure"
8641 #include "confdefs.h"
8642 /* pthread test headers */
8643 #include <pthread.h>
8644 #ifndef NULL
8645 #define NULL (void*)0
8646 #endif
8647
8648 static void *task(p)
8649         void *p;
8650 {
8651         return (void *) (p == NULL);
8652 }
8653
8654
8655 int main(argc, argv)
8656         int argc;
8657         char **argv;
8658 {
8659
8660         /* pthread test function */
8661         pthread_t t;
8662         int status;
8663
8664         /* make sure pthread_create() isn't just a stub */
8665 #if HAVE_PTHREADS_D4
8666         status = pthread_create(&t, pthread_attr_default, task, NULL);
8667 #else
8668         status = pthread_create(&t, NULL, task, NULL);
8669 #endif
8670
8671         if( status ) exit( status );
8672
8673         /* make sure pthread_detach() isn't just a stub */
8674 #if HAVE_PTHREADS_D4
8675         status = pthread_detach( &t );
8676 #else
8677         status = pthread_detach( t );
8678 #endif
8679
8680 #ifdef HAVE_LINUX_THREADS
8681         pthread_kill_other_threads_np();
8682 #endif
8683
8684         exit( status );
8685
8686 }
8687
8688 EOF
8689 if { (eval echo configure:8690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8690 then
8691   ol_cv_pthread_lpthreads_lexc=yes
8692 else
8693   echo "configure: failed program was:" >&5
8694   cat conftest.$ac_ext >&5
8695   rm -fr conftest*
8696   ol_cv_pthread_lpthreads_lexc=no
8697 fi
8698 rm -fr conftest*
8699 fi
8700
8701
8702                 # restore the LIBS
8703                 LIBS="$ol_LIBS"
8704         
8705 fi
8706
8707 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
8708
8709         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
8710                 ol_link_pthreads="-lpthreads -lexc"
8711                 ol_link_threads=posix
8712         fi
8713 fi
8714
8715
8716                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
8717 if test "$ol_link_threads" = no ; then
8718         # try -lpthreads
8719         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
8720 echo "configure:8721: checking for pthread link with -lpthreads" >&5
8721 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
8722   echo $ac_n "(cached) $ac_c" 1>&6
8723 else
8724   
8725                 # save the flags
8726                 ol_LIBS="$LIBS"
8727                 LIBS="-lpthreads $LIBS"
8728
8729                 if test "$cross_compiling" = yes; then
8730   cat > conftest.$ac_ext <<EOF
8731 #line 8732 "configure"
8732 #include "confdefs.h"
8733 /* pthread test headers */
8734 #include <pthread.h>
8735 #ifndef NULL
8736 #define NULL (void*)0
8737 #endif
8738
8739 static void *task(p)
8740         void *p;
8741 {
8742         return (void *) (p == NULL);
8743 }
8744
8745 int main() {
8746
8747         /* pthread test function */
8748         pthread_t t;
8749         int status;
8750
8751         /* make sure pthread_create() isn't just a stub */
8752 #if HAVE_PTHREADS_D4
8753         status = pthread_create(&t, pthread_attr_default, task, NULL);
8754 #else
8755         status = pthread_create(&t, NULL, task, NULL);
8756 #endif
8757
8758         if( status ) exit( status );
8759
8760         /* make sure pthread_detach() isn't just a stub */
8761 #if HAVE_PTHREADS_D4
8762         status = pthread_detach( &t );
8763 #else
8764         status = pthread_detach( t );
8765 #endif
8766
8767 #ifdef HAVE_LINUX_THREADS
8768         pthread_kill_other_threads_np();
8769 #endif
8770
8771         exit( status );
8772
8773 ; return 0; }
8774 EOF
8775 if { (eval echo configure:8776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8776   rm -rf conftest*
8777   ol_cv_pthread_lib_lpthreads=yes
8778 else
8779   echo "configure: failed program was:" >&5
8780   cat conftest.$ac_ext >&5
8781   rm -rf conftest*
8782   ol_cv_pthread_lib_lpthreads=no
8783 fi
8784 rm -f conftest*
8785 else
8786   cat > conftest.$ac_ext <<EOF
8787 #line 8788 "configure"
8788 #include "confdefs.h"
8789 /* pthread test headers */
8790 #include <pthread.h>
8791 #ifndef NULL
8792 #define NULL (void*)0
8793 #endif
8794
8795 static void *task(p)
8796         void *p;
8797 {
8798         return (void *) (p == NULL);
8799 }
8800
8801
8802 int main(argc, argv)
8803         int argc;
8804         char **argv;
8805 {
8806
8807         /* pthread test function */
8808         pthread_t t;
8809         int status;
8810
8811         /* make sure pthread_create() isn't just a stub */
8812 #if HAVE_PTHREADS_D4
8813         status = pthread_create(&t, pthread_attr_default, task, NULL);
8814 #else
8815         status = pthread_create(&t, NULL, task, NULL);
8816 #endif
8817
8818         if( status ) exit( status );
8819
8820         /* make sure pthread_detach() isn't just a stub */
8821 #if HAVE_PTHREADS_D4
8822         status = pthread_detach( &t );
8823 #else
8824         status = pthread_detach( t );
8825 #endif
8826
8827 #ifdef HAVE_LINUX_THREADS
8828         pthread_kill_other_threads_np();
8829 #endif
8830
8831         exit( status );
8832
8833 }
8834
8835 EOF
8836 if { (eval echo configure:8837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8837 then
8838   ol_cv_pthread_lib_lpthreads=yes
8839 else
8840   echo "configure: failed program was:" >&5
8841   cat conftest.$ac_ext >&5
8842   rm -fr conftest*
8843   ol_cv_pthread_lib_lpthreads=no
8844 fi
8845 rm -fr conftest*
8846 fi
8847
8848
8849                 # restore the LIBS
8850                 LIBS="$ol_LIBS"
8851         
8852 fi
8853
8854 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
8855
8856         if test $ol_cv_pthread_lib_lpthreads = yes ; then
8857                 ol_link_pthreads="-lpthreads"
8858                 ol_link_threads=posix
8859         fi
8860 fi
8861
8862
8863                 if test $ol_link_threads != no ; then
8864                         cat >> confdefs.h <<\EOF
8865 #define HAVE_PTHREADS 1
8866 EOF
8867
8868
8869                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
8870
8871                                                 save_CPPFLAGS="$CPPFLAGS"
8872                         save_LIBS="$LIBS"
8873                         LIBS="$LTHREAD_LIBS $LIBS"
8874
8875                                                                                                 for ac_func in sched_yield pthread_yield
8876 do
8877 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8878 echo "configure:8879: checking for $ac_func" >&5
8879 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
8880   echo $ac_n "(cached) $ac_c" 1>&6
8881 else
8882   cat > conftest.$ac_ext <<EOF
8883 #line 8884 "configure"
8884 #include "confdefs.h"
8885 /* System header to define __stub macros and hopefully few prototypes,
8886     which can conflict with char $ac_func(); below.  */
8887 #include <assert.h>
8888 /* Override any gcc2 internal prototype to avoid an error.  */
8889 /* We use char because int might match the return type of a gcc2
8890     builtin and then its argument prototype would still apply.  */
8891 char $ac_func();
8892 char (*f)();
8893
8894 int main() {
8895
8896 /* The GNU C library defines this for functions which it implements
8897     to always fail with ENOSYS.  Some functions are actually named
8898     something starting with __ and the normal name is an alias.  */
8899 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8900 choke me
8901 #else
8902 f = $ac_func;
8903 #endif
8904
8905 ; return 0; }
8906 EOF
8907 if { (eval echo configure:8908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8908   rm -rf conftest*
8909   eval "ac_cv_func_$ac_func=yes"
8910 else
8911   echo "configure: failed program was:" >&5
8912   cat conftest.$ac_ext >&5
8913   rm -rf conftest*
8914   eval "ac_cv_func_$ac_func=no"
8915 fi
8916 rm -f conftest*
8917 fi
8918
8919 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8920   echo "$ac_t""yes" 1>&6
8921     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8922   cat >> confdefs.h <<EOF
8923 #define $ac_tr_func 1
8924 EOF
8925  
8926 else
8927   echo "$ac_t""no" 1>&6
8928 fi
8929 done
8930
8931
8932                         if test $ac_cv_func_sched_yield = no -a \
8933                                 $ac_cv_func_pthread_yield = no ; then
8934                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
8935 echo "configure:8936: checking for sched_yield in -lrt" >&5
8936 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
8937 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8938   echo $ac_n "(cached) $ac_c" 1>&6
8939 else
8940   ac_save_LIBS="$LIBS"
8941 LIBS="-lrt  $LIBS"
8942 cat > conftest.$ac_ext <<EOF
8943 #line 8944 "configure"
8944 #include "confdefs.h"
8945 /* Override any gcc2 internal prototype to avoid an error.  */
8946 /* We use char because int might match the return type of a gcc2
8947     builtin and then its argument prototype would still apply.  */
8948 char sched_yield();
8949
8950 int main() {
8951 sched_yield()
8952 ; return 0; }
8953 EOF
8954 if { (eval echo configure:8955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8955   rm -rf conftest*
8956   eval "ac_cv_lib_$ac_lib_var=yes"
8957 else
8958   echo "configure: failed program was:" >&5
8959   cat conftest.$ac_ext >&5
8960   rm -rf conftest*
8961   eval "ac_cv_lib_$ac_lib_var=no"
8962 fi
8963 rm -f conftest*
8964 LIBS="$ac_save_LIBS"
8965
8966 fi
8967 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8968   echo "$ac_t""yes" 1>&6
8969   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
8970                                         cat >> confdefs.h <<\EOF
8971 #define HAVE_SCHED_YIELD 1
8972 EOF
8973
8974                                         ac_cv_func_sched_yield=yes
8975 else
8976   echo "$ac_t""no" 1>&6
8977 ac_cv_func_sched_yield=no
8978 fi
8979
8980                         fi
8981                         if test $ac_cv_func_sched_yield = no -a \
8982                                 $ac_cv_func_pthread_yield = no ; then
8983                                                                                                 for ac_func in thr_yield
8984 do
8985 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8986 echo "configure:8987: checking for $ac_func" >&5
8987 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
8988   echo $ac_n "(cached) $ac_c" 1>&6
8989 else
8990   cat > conftest.$ac_ext <<EOF
8991 #line 8992 "configure"
8992 #include "confdefs.h"
8993 /* System header to define __stub macros and hopefully few prototypes,
8994     which can conflict with char $ac_func(); below.  */
8995 #include <assert.h>
8996 /* Override any gcc2 internal prototype to avoid an error.  */
8997 /* We use char because int might match the return type of a gcc2
8998     builtin and then its argument prototype would still apply.  */
8999 char $ac_func();
9000 char (*f)();
9001
9002 int main() {
9003
9004 /* The GNU C library defines this for functions which it implements
9005     to always fail with ENOSYS.  Some functions are actually named
9006     something starting with __ and the normal name is an alias.  */
9007 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9008 choke me
9009 #else
9010 f = $ac_func;
9011 #endif
9012
9013 ; return 0; }
9014 EOF
9015 if { (eval echo configure:9016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9016   rm -rf conftest*
9017   eval "ac_cv_func_$ac_func=yes"
9018 else
9019   echo "configure: failed program was:" >&5
9020   cat conftest.$ac_ext >&5
9021   rm -rf conftest*
9022   eval "ac_cv_func_$ac_func=no"
9023 fi
9024 rm -f conftest*
9025 fi
9026
9027 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9028   echo "$ac_t""yes" 1>&6
9029     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9030   cat >> confdefs.h <<EOF
9031 #define $ac_tr_func 1
9032 EOF
9033  
9034 else
9035   echo "$ac_t""no" 1>&6
9036 fi
9037 done
9038
9039                         fi
9040                         if test $ac_cv_func_sched_yield = no -a \
9041                                 $ac_cv_func_pthread_yield = no -a \
9042                                 "$ac_cv_func_thr_yield" = no ; then
9043                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
9044                         fi
9045
9046                                                 for ac_func in pthread_kill
9047 do
9048 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9049 echo "configure:9050: checking for $ac_func" >&5
9050 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9051   echo $ac_n "(cached) $ac_c" 1>&6
9052 else
9053   cat > conftest.$ac_ext <<EOF
9054 #line 9055 "configure"
9055 #include "confdefs.h"
9056 /* System header to define __stub macros and hopefully few prototypes,
9057     which can conflict with char $ac_func(); below.  */
9058 #include <assert.h>
9059 /* Override any gcc2 internal prototype to avoid an error.  */
9060 /* We use char because int might match the return type of a gcc2
9061     builtin and then its argument prototype would still apply.  */
9062 char $ac_func();
9063 char (*f)();
9064
9065 int main() {
9066
9067 /* The GNU C library defines this for functions which it implements
9068     to always fail with ENOSYS.  Some functions are actually named
9069     something starting with __ and the normal name is an alias.  */
9070 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9071 choke me
9072 #else
9073 f = $ac_func;
9074 #endif
9075
9076 ; return 0; }
9077 EOF
9078 if { (eval echo configure:9079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9079   rm -rf conftest*
9080   eval "ac_cv_func_$ac_func=yes"
9081 else
9082   echo "configure: failed program was:" >&5
9083   cat conftest.$ac_ext >&5
9084   rm -rf conftest*
9085   eval "ac_cv_func_$ac_func=no"
9086 fi
9087 rm -f conftest*
9088 fi
9089
9090 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9091   echo "$ac_t""yes" 1>&6
9092     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9093   cat >> confdefs.h <<EOF
9094 #define $ac_tr_func 1
9095 EOF
9096  
9097 else
9098   echo "$ac_t""no" 1>&6
9099 fi
9100 done
9101
9102
9103                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
9104 echo "configure:9105: checking for pthread_detach with <pthread.h>" >&5
9105 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
9106   echo $ac_n "(cached) $ac_c" 1>&6
9107 else
9108   
9109                                                                 cat > conftest.$ac_ext <<EOF
9110 #line 9111 "configure"
9111 #include "confdefs.h"
9112
9113 #include <pthread.h>
9114 #ifndef NULL
9115 #define NULL (void*)0
9116 #endif
9117
9118 int main() {
9119 pthread_detach(NULL);
9120 ; return 0; }
9121 EOF
9122 if { (eval echo configure:9123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9123   rm -rf conftest*
9124   ol_cv_func_pthread_detach=yes
9125 else
9126   echo "configure: failed program was:" >&5
9127   cat conftest.$ac_ext >&5
9128   rm -rf conftest*
9129   ol_cv_func_pthread_detach=no
9130 fi
9131 rm -f conftest*
9132                         
9133 fi
9134
9135 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
9136
9137                         if test $ol_cv_func_pthread_detach = no ; then
9138                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
9139                         fi
9140
9141                         cat >> confdefs.h <<\EOF
9142 #define HAVE_PTHREAD_DETACH 1
9143 EOF
9144
9145
9146                                                 for ac_func in \
9147                                 pthread_setconcurrency \
9148                                 pthread_getconcurrency \
9149                                 thr_setconcurrency \
9150                                 thr_getconcurrency \
9151                         
9152 do
9153 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9154 echo "configure:9155: checking for $ac_func" >&5
9155 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9156   echo $ac_n "(cached) $ac_c" 1>&6
9157 else
9158   cat > conftest.$ac_ext <<EOF
9159 #line 9160 "configure"
9160 #include "confdefs.h"
9161 /* System header to define __stub macros and hopefully few prototypes,
9162     which can conflict with char $ac_func(); below.  */
9163 #include <assert.h>
9164 /* Override any gcc2 internal prototype to avoid an error.  */
9165 /* We use char because int might match the return type of a gcc2
9166     builtin and then its argument prototype would still apply.  */
9167 char $ac_func();
9168 char (*f)();
9169
9170 int main() {
9171
9172 /* The GNU C library defines this for functions which it implements
9173     to always fail with ENOSYS.  Some functions are actually named
9174     something starting with __ and the normal name is an alias.  */
9175 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9176 choke me
9177 #else
9178 f = $ac_func;
9179 #endif
9180
9181 ; return 0; }
9182 EOF
9183 if { (eval echo configure:9184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9184   rm -rf conftest*
9185   eval "ac_cv_func_$ac_func=yes"
9186 else
9187   echo "configure: failed program was:" >&5
9188   cat conftest.$ac_ext >&5
9189   rm -rf conftest*
9190   eval "ac_cv_func_$ac_func=no"
9191 fi
9192 rm -f conftest*
9193 fi
9194
9195 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9196   echo "$ac_t""yes" 1>&6
9197     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9198   cat >> confdefs.h <<EOF
9199 #define $ac_tr_func 1
9200 EOF
9201  
9202 else
9203   echo "$ac_t""no" 1>&6
9204 fi
9205 done
9206
9207
9208                         
9209         echo $ac_n "checking for pthread_kill_other_threads_np""... $ac_c" 1>&6
9210 echo "configure:9211: checking for pthread_kill_other_threads_np" >&5
9211 if eval "test \"\${ac_cv_func_pthread_kill_other_threads_np+set}\" = set"; then
9212   echo $ac_n "(cached) $ac_c" 1>&6
9213 else
9214   cat > conftest.$ac_ext <<EOF
9215 #line 9216 "configure"
9216 #include "confdefs.h"
9217 /* System header to define __stub macros and hopefully few prototypes,
9218     which can conflict with char pthread_kill_other_threads_np(); below.  */
9219 #include <assert.h>
9220 /* Override any gcc2 internal prototype to avoid an error.  */
9221 /* We use char because int might match the return type of a gcc2
9222     builtin and then its argument prototype would still apply.  */
9223 char pthread_kill_other_threads_np();
9224 char (*f)();
9225
9226 int main() {
9227
9228 /* The GNU C library defines this for functions which it implements
9229     to always fail with ENOSYS.  Some functions are actually named
9230     something starting with __ and the normal name is an alias.  */
9231 #if defined (__stub_pthread_kill_other_threads_np) || defined (__stub___pthread_kill_other_threads_np)
9232 choke me
9233 #else
9234 f = pthread_kill_other_threads_np;
9235 #endif
9236
9237 ; return 0; }
9238 EOF
9239 if { (eval echo configure:9240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9240   rm -rf conftest*
9241   eval "ac_cv_func_pthread_kill_other_threads_np=yes"
9242 else
9243   echo "configure: failed program was:" >&5
9244   cat conftest.$ac_ext >&5
9245   rm -rf conftest*
9246   eval "ac_cv_func_pthread_kill_other_threads_np=no"
9247 fi
9248 rm -f conftest*
9249 fi
9250
9251 if eval "test \"`echo '$ac_cv_func_'pthread_kill_other_threads_np`\" = yes"; then
9252   echo "$ac_t""yes" 1>&6
9253   :
9254 else
9255   echo "$ac_t""no" 1>&6
9256 fi
9257
9258         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
9259 echo "configure:9260: checking for LinuxThreads implementation" >&5
9260 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
9261   echo $ac_n "(cached) $ac_c" 1>&6
9262 else
9263   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
9264 fi
9265
9266 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
9267
9268                         
9269         
9270         
9271         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
9272 echo "configure:9273: checking for LinuxThreads consistency" >&5
9273 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
9274   echo $ac_n "(cached) $ac_c" 1>&6
9275 else
9276   
9277                 if test $ol_cv_header_linux_threads = yes -a \
9278                         $ol_cv_sys_linux_threads = yes; then
9279                         ol_cv_linux_threads=yes
9280                 elif test $ol_cv_header_linux_threads = no -a \
9281                         $ol_cv_sys_linux_threads = no; then
9282                         ol_cv_linux_threads=no
9283                 else
9284                         ol_cv_linux_threads=error
9285                 fi
9286         
9287 fi
9288
9289 echo "$ac_t""$ol_cv_linux_threads" 1>&6
9290
9291
9292                         if test $ol_cv_linux_threads = error; then
9293                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
9294                         fi
9295
9296                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
9297 echo "configure:9298: checking if pthread_create() works" >&5
9298 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
9299   echo $ac_n "(cached) $ac_c" 1>&6
9300 else
9301   
9302                         if test "$cross_compiling" = yes; then
9303                                 ol_cv_pthread_create_works=yes
9304 else
9305   cat > conftest.$ac_ext <<EOF
9306 #line 9307 "configure"
9307 #include "confdefs.h"
9308 /* pthread test headers */
9309 #include <pthread.h>
9310 #ifndef NULL
9311 #define NULL (void*)0
9312 #endif
9313
9314 static void *task(p)
9315         void *p;
9316 {
9317         return (void *) (p == NULL);
9318 }
9319
9320
9321 int main(argc, argv)
9322         int argc;
9323         char **argv;
9324 {
9325
9326         /* pthread test function */
9327         pthread_t t;
9328         int status;
9329
9330         /* make sure pthread_create() isn't just a stub */
9331 #if HAVE_PTHREADS_D4
9332         status = pthread_create(&t, pthread_attr_default, task, NULL);
9333 #else
9334         status = pthread_create(&t, NULL, task, NULL);
9335 #endif
9336
9337         if( status ) exit( status );
9338
9339         /* make sure pthread_detach() isn't just a stub */
9340 #if HAVE_PTHREADS_D4
9341         status = pthread_detach( &t );
9342 #else
9343         status = pthread_detach( t );
9344 #endif
9345
9346 #ifdef HAVE_LINUX_THREADS
9347         pthread_kill_other_threads_np();
9348 #endif
9349
9350         exit( status );
9351
9352 }
9353
9354 EOF
9355 if { (eval echo configure:9356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9356 then
9357   ol_cv_pthread_create_works=yes
9358 else
9359   echo "configure: failed program was:" >&5
9360   cat conftest.$ac_ext >&5
9361   rm -fr conftest*
9362   ol_cv_pthread_create_works=no
9363 fi
9364 rm -fr conftest*
9365 fi
9366
9367 fi
9368
9369 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
9370
9371                         if test $ol_cv_pthread_create_works = no ; then
9372                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
9373                         fi
9374
9375                                                 if test $ol_with_yielding_select = auto ; then
9376                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
9377 echo "configure:9378: checking if select yields when using pthreads" >&5
9378 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
9379   echo $ac_n "(cached) $ac_c" 1>&6
9380 else
9381   
9382                                 if test "$cross_compiling" = yes; then
9383   ol_cv_pthread_select_yields=cross
9384 else
9385   cat > conftest.$ac_ext <<EOF
9386 #line 9387 "configure"
9387 #include "confdefs.h"
9388
9389 #include <sys/types.h>
9390 #include <sys/time.h>
9391 #include <unistd.h>
9392 #include <pthread.h>
9393 #ifndef NULL
9394 #define NULL (void*) 0
9395 #endif
9396
9397 static int fildes[2];
9398
9399 static void *task(p)
9400         void *p;
9401 {
9402         int i;
9403         struct timeval tv;
9404
9405         fd_set rfds;
9406
9407         tv.tv_sec=10;
9408         tv.tv_usec=0;
9409
9410         FD_ZERO(&rfds);
9411         FD_SET(fildes[0], &rfds);
9412
9413         /* we're not interested in any fds */
9414         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
9415
9416         if(i < 0) {
9417                 perror("select");
9418                 exit(10);
9419         }
9420
9421         exit(0); /* if we exit here, the select blocked the whole process */
9422 }
9423
9424 int main(argc, argv)
9425         int argc;
9426         char **argv;
9427 {
9428         pthread_t t;
9429
9430         /* create a pipe to select */
9431         if(pipe(&fildes[0])) {
9432                 perror("select");
9433                 exit(1);
9434         }
9435
9436 #ifdef HAVE_PTHREAD_SETCONCURRENCY
9437         (void) pthread_setconcurrency(2);
9438 #else
9439 #ifdef HAVE_THR_SETCONCURRENCY
9440         /* Set Solaris LWP concurrency to 2 */
9441         thr_setconcurrency(2);
9442 #endif
9443 #endif
9444
9445 #if HAVE_PTHREADS_D4
9446         pthread_create(&t, pthread_attr_default, task, NULL);
9447 #else
9448         pthread_create(&t, NULL, task, NULL);
9449 #endif
9450
9451 #if HAVE_SCHED_YIELD
9452         sched_yield();  /* make sure task runs first */
9453 #else
9454 #ifdef HAVE_PTHREAD_YIELD
9455         pthread_yield();        /* make sure task runs first */
9456 #endif
9457 #endif
9458
9459         exit(2);
9460 }
9461 EOF
9462 if { (eval echo configure:9463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9463 then
9464   ol_cv_pthread_select_yields=no
9465 else
9466   echo "configure: failed program was:" >&5
9467   cat conftest.$ac_ext >&5
9468   rm -fr conftest*
9469   ol_cv_pthread_select_yields=yes
9470 fi
9471 rm -fr conftest*
9472 fi
9473
9474 fi
9475
9476 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
9477
9478                                 if test $ol_cv_pthread_select_yields = cross ; then
9479                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
9480                                 fi
9481
9482                                 if test $ol_cv_pthread_select_yields = yes ; then
9483                                         ol_with_yielding_select=yes
9484                                 fi
9485                         fi
9486
9487                                                 CPPFLAGS="$save_CPPFLAGS"
9488                         LIBS="$save_LIBS"
9489                 else
9490                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
9491                 fi
9492         fi
9493
9494         if test $ol_with_threads = posix ; then
9495                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
9496         fi
9497 fi
9498
9499 if test $ol_with_threads = auto -o $ol_with_threads = yes \
9500         -o $ol_with_threads = mach ; then
9501
9502                 for ac_hdr in mach/cthreads.h
9503 do
9504 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9505 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9506 echo "configure:9507: checking for $ac_hdr" >&5
9507 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9508   echo $ac_n "(cached) $ac_c" 1>&6
9509 else
9510   cat > conftest.$ac_ext <<EOF
9511 #line 9512 "configure"
9512 #include "confdefs.h"
9513 #include <$ac_hdr>
9514 EOF
9515 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9516 { (eval echo configure:9517: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9517 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9518 if test -z "$ac_err"; then
9519   rm -rf conftest*
9520   eval "ac_cv_header_$ac_safe=yes"
9521 else
9522   echo "$ac_err" >&5
9523   echo "configure: failed program was:" >&5
9524   cat conftest.$ac_ext >&5
9525   rm -rf conftest*
9526   eval "ac_cv_header_$ac_safe=no"
9527 fi
9528 rm -f conftest*
9529 fi
9530 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9531   echo "$ac_t""yes" 1>&6
9532     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9533   cat >> confdefs.h <<EOF
9534 #define $ac_tr_hdr 1
9535 EOF
9536  
9537 else
9538   echo "$ac_t""no" 1>&6
9539 fi
9540 done
9541
9542         if test $ac_cv_header_mach_cthreads_h = yes ; then
9543                 ol_with_threads=found
9544
9545                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
9546 echo "configure:9547: checking for cthread_fork" >&5
9547 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
9548   echo $ac_n "(cached) $ac_c" 1>&6
9549 else
9550   cat > conftest.$ac_ext <<EOF
9551 #line 9552 "configure"
9552 #include "confdefs.h"
9553 /* System header to define __stub macros and hopefully few prototypes,
9554     which can conflict with char cthread_fork(); below.  */
9555 #include <assert.h>
9556 /* Override any gcc2 internal prototype to avoid an error.  */
9557 /* We use char because int might match the return type of a gcc2
9558     builtin and then its argument prototype would still apply.  */
9559 char cthread_fork();
9560 char (*f)();
9561
9562 int main() {
9563
9564 /* The GNU C library defines this for functions which it implements
9565     to always fail with ENOSYS.  Some functions are actually named
9566     something starting with __ and the normal name is an alias.  */
9567 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
9568 choke me
9569 #else
9570 f = cthread_fork;
9571 #endif
9572
9573 ; return 0; }
9574 EOF
9575 if { (eval echo configure:9576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9576   rm -rf conftest*
9577   eval "ac_cv_func_cthread_fork=yes"
9578 else
9579   echo "configure: failed program was:" >&5
9580   cat conftest.$ac_ext >&5
9581   rm -rf conftest*
9582   eval "ac_cv_func_cthread_fork=no"
9583 fi
9584 rm -f conftest*
9585 fi
9586
9587 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
9588   echo "$ac_t""yes" 1>&6
9589   ol_link_threads=yes
9590 else
9591   echo "$ac_t""no" 1>&6
9592 fi
9593
9594
9595                 if test $ol_link_threads = no ; then
9596                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
9597 echo "configure:9598: checking for cthread_fork with -all_load" >&5
9598 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
9599   echo $ac_n "(cached) $ac_c" 1>&6
9600 else
9601   
9602                                                                 save_LIBS="$LIBS"
9603                                 LIBS="-all_load $LIBS"
9604                                 cat > conftest.$ac_ext <<EOF
9605 #line 9606 "configure"
9606 #include "confdefs.h"
9607 #include <mach/cthreads.h>
9608 int main() {
9609
9610                                         cthread_fork((void *)0, (void *)0);
9611                                         
9612 ; return 0; }
9613 EOF
9614 if { (eval echo configure:9615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9615   rm -rf conftest*
9616   ol_cv_cthread_all_load=yes
9617 else
9618   echo "configure: failed program was:" >&5
9619   cat conftest.$ac_ext >&5
9620   rm -rf conftest*
9621   ol_cv_cthread_all_load=no
9622 fi
9623 rm -f conftest*
9624                                                                 LIBS="$save_LIBS"
9625                         
9626 fi
9627
9628 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
9629
9630                         if test $ol_cv_cthread_all_load = yes ; then
9631                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
9632                                 ol_link_threads=mach
9633                         fi
9634                 fi
9635
9636                 if test $ol_link_threads != no ; then
9637                         : check for cthread specific functionality here
9638                         cat >> confdefs.h <<\EOF
9639 #define HAVE_MACH_CTHREADS 1
9640 EOF
9641
9642                 else
9643                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
9644                 fi
9645         fi
9646
9647         if test $ol_with_threads = mach ; then
9648                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
9649         fi
9650 fi
9651
9652 if test $ol_with_threads = auto -o $ol_with_threads = yes \
9653         -o $ol_with_threads = pth ; then
9654
9655         for ac_hdr in pth.h
9656 do
9657 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9658 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9659 echo "configure:9660: checking for $ac_hdr" >&5
9660 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9661   echo $ac_n "(cached) $ac_c" 1>&6
9662 else
9663   cat > conftest.$ac_ext <<EOF
9664 #line 9665 "configure"
9665 #include "confdefs.h"
9666 #include <$ac_hdr>
9667 EOF
9668 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9669 { (eval echo configure:9670: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9670 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9671 if test -z "$ac_err"; then
9672   rm -rf conftest*
9673   eval "ac_cv_header_$ac_safe=yes"
9674 else
9675   echo "$ac_err" >&5
9676   echo "configure: failed program was:" >&5
9677   cat conftest.$ac_ext >&5
9678   rm -rf conftest*
9679   eval "ac_cv_header_$ac_safe=no"
9680 fi
9681 rm -f conftest*
9682 fi
9683 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9684   echo "$ac_t""yes" 1>&6
9685     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9686   cat >> confdefs.h <<EOF
9687 #define $ac_tr_hdr 1
9688 EOF
9689  
9690 else
9691   echo "$ac_t""no" 1>&6
9692 fi
9693 done
9694
9695
9696         if test $ac_cv_header_pth_h = yes ; then
9697                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
9698 echo "configure:9699: checking for pth_version in -lpth" >&5
9699 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
9700 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9701   echo $ac_n "(cached) $ac_c" 1>&6
9702 else
9703   ac_save_LIBS="$LIBS"
9704 LIBS="-lpth  $LIBS"
9705 cat > conftest.$ac_ext <<EOF
9706 #line 9707 "configure"
9707 #include "confdefs.h"
9708 /* Override any gcc2 internal prototype to avoid an error.  */
9709 /* We use char because int might match the return type of a gcc2
9710     builtin and then its argument prototype would still apply.  */
9711 char pth_version();
9712
9713 int main() {
9714 pth_version()
9715 ; return 0; }
9716 EOF
9717 if { (eval echo configure:9718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9718   rm -rf conftest*
9719   eval "ac_cv_lib_$ac_lib_var=yes"
9720 else
9721   echo "configure: failed program was:" >&5
9722   cat conftest.$ac_ext >&5
9723   rm -rf conftest*
9724   eval "ac_cv_lib_$ac_lib_var=no"
9725 fi
9726 rm -f conftest*
9727 LIBS="$ac_save_LIBS"
9728
9729 fi
9730 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9731   echo "$ac_t""yes" 1>&6
9732   have_pth=yes
9733 else
9734   echo "$ac_t""no" 1>&6
9735 have_pth=no
9736 fi
9737
9738
9739                 if test $have_pth = yes ; then
9740                         cat >> confdefs.h <<\EOF
9741 #define HAVE_GNU_PTH 1
9742 EOF
9743
9744                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
9745                         ol_link_threads=pth
9746
9747                         if test $ol_with_yielding_select = auto ; then
9748                                 ol_with_yielding_select=yes
9749                         fi
9750                 fi
9751         fi
9752 fi
9753
9754 if test $ol_with_threads = auto -o $ol_with_threads = yes \
9755         -o $ol_with_threads = lwp ; then
9756
9757                 for ac_hdr in thread.h synch.h
9758 do
9759 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9760 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9761 echo "configure:9762: checking for $ac_hdr" >&5
9762 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9763   echo $ac_n "(cached) $ac_c" 1>&6
9764 else
9765   cat > conftest.$ac_ext <<EOF
9766 #line 9767 "configure"
9767 #include "confdefs.h"
9768 #include <$ac_hdr>
9769 EOF
9770 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9771 { (eval echo configure:9772: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9772 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9773 if test -z "$ac_err"; then
9774   rm -rf conftest*
9775   eval "ac_cv_header_$ac_safe=yes"
9776 else
9777   echo "$ac_err" >&5
9778   echo "configure: failed program was:" >&5
9779   cat conftest.$ac_ext >&5
9780   rm -rf conftest*
9781   eval "ac_cv_header_$ac_safe=no"
9782 fi
9783 rm -f conftest*
9784 fi
9785 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9786   echo "$ac_t""yes" 1>&6
9787     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9788   cat >> confdefs.h <<EOF
9789 #define $ac_tr_hdr 1
9790 EOF
9791  
9792 else
9793   echo "$ac_t""no" 1>&6
9794 fi
9795 done
9796
9797         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
9798                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
9799 echo "configure:9800: checking for thr_create in -lthread" >&5
9800 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
9801 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9802   echo $ac_n "(cached) $ac_c" 1>&6
9803 else
9804   ac_save_LIBS="$LIBS"
9805 LIBS="-lthread  $LIBS"
9806 cat > conftest.$ac_ext <<EOF
9807 #line 9808 "configure"
9808 #include "confdefs.h"
9809 /* Override any gcc2 internal prototype to avoid an error.  */
9810 /* We use char because int might match the return type of a gcc2
9811     builtin and then its argument prototype would still apply.  */
9812 char thr_create();
9813
9814 int main() {
9815 thr_create()
9816 ; return 0; }
9817 EOF
9818 if { (eval echo configure:9819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9819   rm -rf conftest*
9820   eval "ac_cv_lib_$ac_lib_var=yes"
9821 else
9822   echo "configure: failed program was:" >&5
9823   cat conftest.$ac_ext >&5
9824   rm -rf conftest*
9825   eval "ac_cv_lib_$ac_lib_var=no"
9826 fi
9827 rm -f conftest*
9828 LIBS="$ac_save_LIBS"
9829
9830 fi
9831 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9832   echo "$ac_t""yes" 1>&6
9833   have_thr=yes
9834 else
9835   echo "$ac_t""no" 1>&6
9836 have_thr=no
9837 fi
9838
9839
9840                 if test $have_thr = yes ; then
9841                         cat >> confdefs.h <<\EOF
9842 #define HAVE_THR 1
9843 EOF
9844
9845                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
9846                         ol_link_threads=thr
9847
9848                         if test $ol_with_yielding_select = auto ; then
9849                                 ol_with_yielding_select=yes
9850                         fi
9851
9852                                                 for ac_func in \
9853                                 thr_setconcurrency \
9854                                 thr_getconcurrency \
9855                         
9856 do
9857 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9858 echo "configure:9859: checking for $ac_func" >&5
9859 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9860   echo $ac_n "(cached) $ac_c" 1>&6
9861 else
9862   cat > conftest.$ac_ext <<EOF
9863 #line 9864 "configure"
9864 #include "confdefs.h"
9865 /* System header to define __stub macros and hopefully few prototypes,
9866     which can conflict with char $ac_func(); below.  */
9867 #include <assert.h>
9868 /* Override any gcc2 internal prototype to avoid an error.  */
9869 /* We use char because int might match the return type of a gcc2
9870     builtin and then its argument prototype would still apply.  */
9871 char $ac_func();
9872 char (*f)();
9873
9874 int main() {
9875
9876 /* The GNU C library defines this for functions which it implements
9877     to always fail with ENOSYS.  Some functions are actually named
9878     something starting with __ and the normal name is an alias.  */
9879 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9880 choke me
9881 #else
9882 f = $ac_func;
9883 #endif
9884
9885 ; return 0; }
9886 EOF
9887 if { (eval echo configure:9888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9888   rm -rf conftest*
9889   eval "ac_cv_func_$ac_func=yes"
9890 else
9891   echo "configure: failed program was:" >&5
9892   cat conftest.$ac_ext >&5
9893   rm -rf conftest*
9894   eval "ac_cv_func_$ac_func=no"
9895 fi
9896 rm -f conftest*
9897 fi
9898
9899 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9900   echo "$ac_t""yes" 1>&6
9901     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9902   cat >> confdefs.h <<EOF
9903 #define $ac_tr_func 1
9904 EOF
9905  
9906 else
9907   echo "$ac_t""no" 1>&6
9908 fi
9909 done
9910
9911                 fi
9912         fi
9913
9914                 for ac_hdr in lwp/lwp.h
9915 do
9916 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9917 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9918 echo "configure:9919: checking for $ac_hdr" >&5
9919 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9920   echo $ac_n "(cached) $ac_c" 1>&6
9921 else
9922   cat > conftest.$ac_ext <<EOF
9923 #line 9924 "configure"
9924 #include "confdefs.h"
9925 #include <$ac_hdr>
9926 EOF
9927 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9928 { (eval echo configure:9929: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9929 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9930 if test -z "$ac_err"; then
9931   rm -rf conftest*
9932   eval "ac_cv_header_$ac_safe=yes"
9933 else
9934   echo "$ac_err" >&5
9935   echo "configure: failed program was:" >&5
9936   cat conftest.$ac_ext >&5
9937   rm -rf conftest*
9938   eval "ac_cv_header_$ac_safe=no"
9939 fi
9940 rm -f conftest*
9941 fi
9942 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9943   echo "$ac_t""yes" 1>&6
9944     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9945   cat >> confdefs.h <<EOF
9946 #define $ac_tr_hdr 1
9947 EOF
9948  
9949 else
9950   echo "$ac_t""no" 1>&6
9951 fi
9952 done
9953
9954         if test $ac_cv_header_lwp_lwp_h = yes ; then
9955                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
9956 echo "configure:9957: checking for lwp_create in -llwp" >&5
9957 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
9958 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9959   echo $ac_n "(cached) $ac_c" 1>&6
9960 else
9961   ac_save_LIBS="$LIBS"
9962 LIBS="-llwp  $LIBS"
9963 cat > conftest.$ac_ext <<EOF
9964 #line 9965 "configure"
9965 #include "confdefs.h"
9966 /* Override any gcc2 internal prototype to avoid an error.  */
9967 /* We use char because int might match the return type of a gcc2
9968     builtin and then its argument prototype would still apply.  */
9969 char lwp_create();
9970
9971 int main() {
9972 lwp_create()
9973 ; return 0; }
9974 EOF
9975 if { (eval echo configure:9976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9976   rm -rf conftest*
9977   eval "ac_cv_lib_$ac_lib_var=yes"
9978 else
9979   echo "configure: failed program was:" >&5
9980   cat conftest.$ac_ext >&5
9981   rm -rf conftest*
9982   eval "ac_cv_lib_$ac_lib_var=no"
9983 fi
9984 rm -f conftest*
9985 LIBS="$ac_save_LIBS"
9986
9987 fi
9988 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9989   echo "$ac_t""yes" 1>&6
9990   have_lwp=yes
9991 else
9992   echo "$ac_t""no" 1>&6
9993 have_lwp=no
9994 fi
9995
9996
9997                 if test $have_lwp = yes ; then
9998                         cat >> confdefs.h <<\EOF
9999 #define HAVE_LWP 1
10000 EOF
10001
10002                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
10003                         ol_link_threads=lwp
10004
10005                         if test $ol_with_yielding_select = auto ; then
10006                                 ol_with_yielding_select=no
10007                         fi
10008                 fi
10009         fi
10010 fi
10011
10012 if test $ol_with_yielding_select = yes ; then
10013         cat >> confdefs.h <<\EOF
10014 #define HAVE_YIELDING_SELECT 1
10015 EOF
10016
10017 fi
10018
10019 if test $ol_with_threads = manual ; then
10020                 ol_link_threads=yes
10021
10022         echo "configure: warning: thread defines and link options must be set manually" 1>&2
10023
10024         for ac_hdr in pthread.h sched.h
10025 do
10026 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10027 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10028 echo "configure:10029: checking for $ac_hdr" >&5
10029 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10030   echo $ac_n "(cached) $ac_c" 1>&6
10031 else
10032   cat > conftest.$ac_ext <<EOF
10033 #line 10034 "configure"
10034 #include "confdefs.h"
10035 #include <$ac_hdr>
10036 EOF
10037 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10038 { (eval echo configure:10039: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10039 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10040 if test -z "$ac_err"; then
10041   rm -rf conftest*
10042   eval "ac_cv_header_$ac_safe=yes"
10043 else
10044   echo "$ac_err" >&5
10045   echo "configure: failed program was:" >&5
10046   cat conftest.$ac_ext >&5
10047   rm -rf conftest*
10048   eval "ac_cv_header_$ac_safe=no"
10049 fi
10050 rm -f conftest*
10051 fi
10052 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10053   echo "$ac_t""yes" 1>&6
10054     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10055   cat >> confdefs.h <<EOF
10056 #define $ac_tr_hdr 1
10057 EOF
10058  
10059 else
10060   echo "$ac_t""no" 1>&6
10061 fi
10062 done
10063
10064         for ac_func in sched_yield pthread_yield
10065 do
10066 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10067 echo "configure:10068: checking for $ac_func" >&5
10068 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10069   echo $ac_n "(cached) $ac_c" 1>&6
10070 else
10071   cat > conftest.$ac_ext <<EOF
10072 #line 10073 "configure"
10073 #include "confdefs.h"
10074 /* System header to define __stub macros and hopefully few prototypes,
10075     which can conflict with char $ac_func(); below.  */
10076 #include <assert.h>
10077 /* Override any gcc2 internal prototype to avoid an error.  */
10078 /* We use char because int might match the return type of a gcc2
10079     builtin and then its argument prototype would still apply.  */
10080 char $ac_func();
10081 char (*f)();
10082
10083 int main() {
10084
10085 /* The GNU C library defines this for functions which it implements
10086     to always fail with ENOSYS.  Some functions are actually named
10087     something starting with __ and the normal name is an alias.  */
10088 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10089 choke me
10090 #else
10091 f = $ac_func;
10092 #endif
10093
10094 ; return 0; }
10095 EOF
10096 if { (eval echo configure:10097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10097   rm -rf conftest*
10098   eval "ac_cv_func_$ac_func=yes"
10099 else
10100   echo "configure: failed program was:" >&5
10101   cat conftest.$ac_ext >&5
10102   rm -rf conftest*
10103   eval "ac_cv_func_$ac_func=no"
10104 fi
10105 rm -f conftest*
10106 fi
10107
10108 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10109   echo "$ac_t""yes" 1>&6
10110     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10111   cat >> confdefs.h <<EOF
10112 #define $ac_tr_func 1
10113 EOF
10114  
10115 else
10116   echo "$ac_t""no" 1>&6
10117 fi
10118 done
10119
10120         
10121         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
10122 echo "configure:10123: checking for LinuxThreads pthread.h" >&5
10123 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
10124   echo $ac_n "(cached) $ac_c" 1>&6
10125 else
10126   cat > conftest.$ac_ext <<EOF
10127 #line 10128 "configure"
10128 #include "confdefs.h"
10129 #include <pthread.h>
10130 EOF
10131 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10132   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
10133   rm -rf conftest*
10134   ol_cv_header_linux_threads=yes
10135 else
10136   rm -rf conftest*
10137   ol_cv_header_linux_threads=no
10138 fi
10139 rm -f conftest*
10140
10141                 
10142 fi
10143
10144 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
10145         if test $ol_cv_header_linux_threads = yes; then
10146                 cat >> confdefs.h <<\EOF
10147 #define HAVE_LINUX_THREADS 1
10148 EOF
10149
10150         fi
10151
10152
10153         for ac_hdr in mach/cthreads.h
10154 do
10155 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10156 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10157 echo "configure:10158: checking for $ac_hdr" >&5
10158 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10159   echo $ac_n "(cached) $ac_c" 1>&6
10160 else
10161   cat > conftest.$ac_ext <<EOF
10162 #line 10163 "configure"
10163 #include "confdefs.h"
10164 #include <$ac_hdr>
10165 EOF
10166 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10167 { (eval echo configure:10168: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10168 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10169 if test -z "$ac_err"; then
10170   rm -rf conftest*
10171   eval "ac_cv_header_$ac_safe=yes"
10172 else
10173   echo "$ac_err" >&5
10174   echo "configure: failed program was:" >&5
10175   cat conftest.$ac_ext >&5
10176   rm -rf conftest*
10177   eval "ac_cv_header_$ac_safe=no"
10178 fi
10179 rm -f conftest*
10180 fi
10181 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10182   echo "$ac_t""yes" 1>&6
10183     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10184   cat >> confdefs.h <<EOF
10185 #define $ac_tr_hdr 1
10186 EOF
10187  
10188 else
10189   echo "$ac_t""no" 1>&6
10190 fi
10191 done
10192
10193         for ac_hdr in lwp/lwp.h
10194 do
10195 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10196 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10197 echo "configure:10198: checking for $ac_hdr" >&5
10198 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10199   echo $ac_n "(cached) $ac_c" 1>&6
10200 else
10201   cat > conftest.$ac_ext <<EOF
10202 #line 10203 "configure"
10203 #include "confdefs.h"
10204 #include <$ac_hdr>
10205 EOF
10206 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10207 { (eval echo configure:10208: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10208 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10209 if test -z "$ac_err"; then
10210   rm -rf conftest*
10211   eval "ac_cv_header_$ac_safe=yes"
10212 else
10213   echo "$ac_err" >&5
10214   echo "configure: failed program was:" >&5
10215   cat conftest.$ac_ext >&5
10216   rm -rf conftest*
10217   eval "ac_cv_header_$ac_safe=no"
10218 fi
10219 rm -f conftest*
10220 fi
10221 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10222   echo "$ac_t""yes" 1>&6
10223     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10224   cat >> confdefs.h <<EOF
10225 #define $ac_tr_hdr 1
10226 EOF
10227  
10228 else
10229   echo "$ac_t""no" 1>&6
10230 fi
10231 done
10232
10233         for ac_hdr in thread.h synch.h
10234 do
10235 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10236 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10237 echo "configure:10238: checking for $ac_hdr" >&5
10238 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10239   echo $ac_n "(cached) $ac_c" 1>&6
10240 else
10241   cat > conftest.$ac_ext <<EOF
10242 #line 10243 "configure"
10243 #include "confdefs.h"
10244 #include <$ac_hdr>
10245 EOF
10246 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10247 { (eval echo configure:10248: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10248 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10249 if test -z "$ac_err"; then
10250   rm -rf conftest*
10251   eval "ac_cv_header_$ac_safe=yes"
10252 else
10253   echo "$ac_err" >&5
10254   echo "configure: failed program was:" >&5
10255   cat conftest.$ac_ext >&5
10256   rm -rf conftest*
10257   eval "ac_cv_header_$ac_safe=no"
10258 fi
10259 rm -f conftest*
10260 fi
10261 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10262   echo "$ac_t""yes" 1>&6
10263     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10264   cat >> confdefs.h <<EOF
10265 #define $ac_tr_hdr 1
10266 EOF
10267  
10268 else
10269   echo "$ac_t""no" 1>&6
10270 fi
10271 done
10272
10273 fi
10274
10275 if test $ol_link_threads != no ; then  
10276                         cat >> confdefs.h <<\EOF
10277 #define REENTRANT 1
10278 EOF
10279
10280         cat >> confdefs.h <<\EOF
10281 #define _REENTRANT 1
10282 EOF
10283
10284         cat >> confdefs.h <<\EOF
10285 #define THREAD_SAFE 1
10286 EOF
10287
10288         cat >> confdefs.h <<\EOF
10289 #define _THREAD_SAFE 1
10290 EOF
10291
10292         cat >> confdefs.h <<\EOF
10293 #define THREADSAFE 1
10294 EOF
10295
10296         cat >> confdefs.h <<\EOF
10297 #define _THREADSAFE 1
10298 EOF
10299
10300         cat >> confdefs.h <<\EOF
10301 #define _SGI_MP_SOURCE 1
10302 EOF
10303
10304
10305                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
10306 echo "configure:10307: checking for thread specific errno" >&5
10307 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
10308   echo $ac_n "(cached) $ac_c" 1>&6
10309 else
10310   
10311                 cat > conftest.$ac_ext <<EOF
10312 #line 10313 "configure"
10313 #include "confdefs.h"
10314 #include <errno.h>
10315 int main() {
10316 errno = 0;
10317 ; return 0; }
10318 EOF
10319 if { (eval echo configure:10320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10320   rm -rf conftest*
10321   ol_cv_errno_thread_specific=yes
10322 else
10323   echo "configure: failed program was:" >&5
10324   cat conftest.$ac_ext >&5
10325   rm -rf conftest*
10326   ol_cv_errno_thread_specific=no
10327 fi
10328 rm -f conftest*
10329         
10330 fi
10331
10332 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
10333
10334                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
10335 echo "configure:10336: checking for thread specific h_errno" >&5
10336 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
10337   echo $ac_n "(cached) $ac_c" 1>&6
10338 else
10339   
10340                 cat > conftest.$ac_ext <<EOF
10341 #line 10342 "configure"
10342 #include "confdefs.h"
10343 #include <netdb.h>
10344 int main() {
10345 h_errno = 0;
10346 ; return 0; }
10347 EOF
10348 if { (eval echo configure:10349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10349   rm -rf conftest*
10350   ol_cv_h_errno_thread_specific=yes
10351 else
10352   echo "configure: failed program was:" >&5
10353   cat conftest.$ac_ext >&5
10354   rm -rf conftest*
10355   ol_cv_h_errno_thread_specific=no
10356 fi
10357 rm -f conftest*
10358         
10359 fi
10360
10361 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
10362
10363         if test $ol_cv_errno_thread_specific != yes \
10364                 -o $ol_cv_h_errno_thread_specific != yes ; then
10365                 LIBS="$LTHREAD_LIBS $LIBS"
10366                 LTHREAD_LIBS=""
10367         fi
10368
10369 fi  
10370
10371 if test $ol_link_threads = no ; then
10372         if test $ol_with_threads = yes ; then
10373                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
10374         fi
10375
10376         if test $ol_with_threads = auto ; then
10377                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
10378                 ol_with_threads=no
10379         fi
10380
10381         cat >> confdefs.h <<\EOF
10382 #define NO_THREADS 1
10383 EOF
10384
10385         LTHREAD_LIBS=""
10386 fi
10387
10388 if test $ol_link_threads != no ; then
10389         cat >> confdefs.h <<\EOF
10390 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
10391 EOF
10392
10393 fi
10394
10395
10396 ol_link_ldbm=no 
10397 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
10398         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
10399 echo "configure:10400: checking for DB2 library" >&5
10400 if eval "test \"\${ol_cv_lib_db2+set}\" = set"; then
10401   echo $ac_n "(cached) $ac_c" 1>&6
10402 else
10403         ol_LIBS="$LIBS"
10404         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
10405 echo "configure:10406: checking for db_open in -ldb" >&5
10406 ac_lib_var=`echo db'_'db_open | sed 'y%./+-:%__p__%'`
10407 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10408   echo $ac_n "(cached) $ac_c" 1>&6
10409 else
10410   ac_save_LIBS="$LIBS"
10411 LIBS="-ldb  $LIBS"
10412 cat > conftest.$ac_ext <<EOF
10413 #line 10414 "configure"
10414 #include "confdefs.h"
10415 /* Override any gcc2 internal prototype to avoid an error.  */
10416 /* We use char because int might match the return type of a gcc2
10417     builtin and then its argument prototype would still apply.  */
10418 char db_open();
10419
10420 int main() {
10421 db_open()
10422 ; return 0; }
10423 EOF
10424 if { (eval echo configure:10425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10425   rm -rf conftest*
10426   eval "ac_cv_lib_$ac_lib_var=yes"
10427 else
10428   echo "configure: failed program was:" >&5
10429   cat conftest.$ac_ext >&5
10430   rm -rf conftest*
10431   eval "ac_cv_lib_$ac_lib_var=no"
10432 fi
10433 rm -f conftest*
10434 LIBS="$ac_save_LIBS"
10435
10436 fi
10437 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10438   echo "$ac_t""yes" 1>&6
10439   ol_cv_lib_db2=-ldb
10440 else
10441   echo "$ac_t""no" 1>&6
10442 ol_cv_lib_db2=no
10443 fi
10444
10445         LIBS="$ol_LIBS"
10446
10447 fi
10448
10449 echo "$ac_t""$ol_cv_lib_db2" 1>&6
10450
10451 for ac_hdr in db.h
10452 do
10453 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10454 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10455 echo "configure:10456: checking for $ac_hdr" >&5
10456 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10457   echo $ac_n "(cached) $ac_c" 1>&6
10458 else
10459   cat > conftest.$ac_ext <<EOF
10460 #line 10461 "configure"
10461 #include "confdefs.h"
10462 #include <$ac_hdr>
10463 EOF
10464 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10465 { (eval echo configure:10466: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10466 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10467 if test -z "$ac_err"; then
10468   rm -rf conftest*
10469   eval "ac_cv_header_$ac_safe=yes"
10470 else
10471   echo "$ac_err" >&5
10472   echo "configure: failed program was:" >&5
10473   cat conftest.$ac_ext >&5
10474   rm -rf conftest*
10475   eval "ac_cv_header_$ac_safe=no"
10476 fi
10477 rm -f conftest*
10478 fi
10479 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10480   echo "$ac_t""yes" 1>&6
10481     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10482   cat >> confdefs.h <<EOF
10483 #define $ac_tr_hdr 1
10484 EOF
10485  
10486 else
10487   echo "$ac_t""no" 1>&6
10488 fi
10489 done
10490
10491 if test $ac_cv_header_db_h = yes ; then
10492         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
10493 echo "configure:10494: checking if db.h is DB2" >&5
10494 if eval "test \"\${ol_cv_header_db2+set}\" = set"; then
10495   echo $ac_n "(cached) $ac_c" 1>&6
10496 else
10497   
10498                 cat > conftest.$ac_ext <<EOF
10499 #line 10500 "configure"
10500 #include "confdefs.h"
10501
10502 #                       include <db.h>
10503                         /* this check could be improved */
10504 #                       ifdef DB_VERSION_MAJOR
10505 #                               if DB_VERSION_MAJOR == 2
10506                                         __db_version_2
10507 #                               endif
10508 #                       endif
10509                 
10510 EOF
10511 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10512   egrep "__db_version_2" >/dev/null 2>&1; then
10513   rm -rf conftest*
10514   ol_cv_header_db2=yes
10515 else
10516   rm -rf conftest*
10517   ol_cv_header_db2=no
10518 fi
10519 rm -f conftest*
10520
10521 fi
10522
10523 echo "$ac_t""$ol_cv_header_db2" 1>&6
10524 else
10525         ol_cv_header_db2=no
10526 fi
10527
10528
10529  
10530  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
10531 echo "configure:10532: checking for Berkeley DB2" >&5
10532 if eval "test \"\${ol_cv_berkeley_db2+set}\" = set"; then
10533   echo $ac_n "(cached) $ac_c" 1>&6
10534 else
10535   
10536         if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then
10537                 ol_cv_berkeley_db2=no
10538         else
10539                 ol_cv_berkeley_db2=yes
10540         fi
10541
10542 fi
10543
10544 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
10545  if test $ol_cv_berkeley_db2 = yes ; then
10546         cat >> confdefs.h <<\EOF
10547 #define HAVE_BERKELEY_DB2 1
10548 EOF
10549
10550  fi
10551
10552
10553         if test $ol_cv_berkeley_db2 = yes ; then
10554                 ol_link_ldbm=db2
10555                 ol_with_ldbm_api=db2
10556
10557                 if test $ol_with_ldbm_type = hash ; then
10558                         cat >> confdefs.h <<\EOF
10559 #define LDBM_USE_DBHASH 1
10560 EOF
10561
10562                 else
10563                         cat >> confdefs.h <<\EOF
10564 #define LDBM_USE_DBBTREE 1
10565 EOF
10566
10567                 fi
10568
10569                                                 if test $ol_cv_lib_db2 != yes ; then
10570                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
10571                 fi
10572         fi
10573 fi
10574
10575 ol_link_bdb2=no
10576 if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
10577         ol_link_bdb2=yes
10578 fi
10579
10580 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
10581         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
10582 echo "configure:10583: checking for Berkeley DB library" >&5
10583 if eval "test \"\${ol_cv_lib_db+set}\" = set"; then
10584   echo $ac_n "(cached) $ac_c" 1>&6
10585 else
10586   
10587         for ac_hdr in db1/db.h
10588 do
10589 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10590 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10591 echo "configure:10592: checking for $ac_hdr" >&5
10592 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10593   echo $ac_n "(cached) $ac_c" 1>&6
10594 else
10595   cat > conftest.$ac_ext <<EOF
10596 #line 10597 "configure"
10597 #include "confdefs.h"
10598 #include <$ac_hdr>
10599 EOF
10600 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10601 { (eval echo configure:10602: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10602 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10603 if test -z "$ac_err"; then
10604   rm -rf conftest*
10605   eval "ac_cv_header_$ac_safe=yes"
10606 else
10607   echo "$ac_err" >&5
10608   echo "configure: failed program was:" >&5
10609   cat conftest.$ac_ext >&5
10610   rm -rf conftest*
10611   eval "ac_cv_header_$ac_safe=no"
10612 fi
10613 rm -f conftest*
10614 fi
10615 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10616   echo "$ac_t""yes" 1>&6
10617     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10618   cat >> confdefs.h <<EOF
10619 #define $ac_tr_hdr 1
10620 EOF
10621  
10622 else
10623   echo "$ac_t""no" 1>&6
10624 fi
10625 done
10626
10627         ol_LIBS="$LIBS"
10628         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
10629 echo "configure:10630: checking for dbopen" >&5
10630 if eval "test \"\${ac_cv_func_dbopen+set}\" = set"; then
10631   echo $ac_n "(cached) $ac_c" 1>&6
10632 else
10633   cat > conftest.$ac_ext <<EOF
10634 #line 10635 "configure"
10635 #include "confdefs.h"
10636 /* System header to define __stub macros and hopefully few prototypes,
10637     which can conflict with char dbopen(); below.  */
10638 #include <assert.h>
10639 /* Override any gcc2 internal prototype to avoid an error.  */
10640 /* We use char because int might match the return type of a gcc2
10641     builtin and then its argument prototype would still apply.  */
10642 char dbopen();
10643 char (*f)();
10644
10645 int main() {
10646
10647 /* The GNU C library defines this for functions which it implements
10648     to always fail with ENOSYS.  Some functions are actually named
10649     something starting with __ and the normal name is an alias.  */
10650 #if defined (__stub_dbopen) || defined (__stub___dbopen)
10651 choke me
10652 #else
10653 f = dbopen;
10654 #endif
10655
10656 ; return 0; }
10657 EOF
10658 if { (eval echo configure:10659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10659   rm -rf conftest*
10660   eval "ac_cv_func_dbopen=yes"
10661 else
10662   echo "configure: failed program was:" >&5
10663   cat conftest.$ac_ext >&5
10664   rm -rf conftest*
10665   eval "ac_cv_func_dbopen=no"
10666 fi
10667 rm -f conftest*
10668 fi
10669
10670 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
10671   echo "$ac_t""yes" 1>&6
10672   ol_cv_lib_db=yes
10673 else
10674   echo "$ac_t""no" 1>&6
10675
10676                 echo $ac_n "checking for dbopen in -ldb1""... $ac_c" 1>&6
10677 echo "configure:10678: checking for dbopen in -ldb1" >&5
10678 ac_lib_var=`echo db1'_'dbopen | sed 'y%./+-:%__p__%'`
10679 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10680   echo $ac_n "(cached) $ac_c" 1>&6
10681 else
10682   ac_save_LIBS="$LIBS"
10683 LIBS="-ldb1  $LIBS"
10684 cat > conftest.$ac_ext <<EOF
10685 #line 10686 "configure"
10686 #include "confdefs.h"
10687 /* Override any gcc2 internal prototype to avoid an error.  */
10688 /* We use char because int might match the return type of a gcc2
10689     builtin and then its argument prototype would still apply.  */
10690 char dbopen();
10691
10692 int main() {
10693 dbopen()
10694 ; return 0; }
10695 EOF
10696 if { (eval echo configure:10697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10697   rm -rf conftest*
10698   eval "ac_cv_lib_$ac_lib_var=yes"
10699 else
10700   echo "configure: failed program was:" >&5
10701   cat conftest.$ac_ext >&5
10702   rm -rf conftest*
10703   eval "ac_cv_lib_$ac_lib_var=no"
10704 fi
10705 rm -f conftest*
10706 LIBS="$ac_save_LIBS"
10707
10708 fi
10709 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10710   echo "$ac_t""yes" 1>&6
10711   ol_cv_lib_db=-ldb1
10712 else
10713   echo "$ac_t""no" 1>&6
10714
10715                         echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
10716 echo "configure:10717: checking for dbopen in -ldb" >&5
10717 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-:%__p__%'`
10718 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10719   echo $ac_n "(cached) $ac_c" 1>&6
10720 else
10721   ac_save_LIBS="$LIBS"
10722 LIBS="-ldb  $LIBS"
10723 cat > conftest.$ac_ext <<EOF
10724 #line 10725 "configure"
10725 #include "confdefs.h"
10726 /* Override any gcc2 internal prototype to avoid an error.  */
10727 /* We use char because int might match the return type of a gcc2
10728     builtin and then its argument prototype would still apply.  */
10729 char dbopen();
10730
10731 int main() {
10732 dbopen()
10733 ; return 0; }
10734 EOF
10735 if { (eval echo configure:10736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10736   rm -rf conftest*
10737   eval "ac_cv_lib_$ac_lib_var=yes"
10738 else
10739   echo "configure: failed program was:" >&5
10740   cat conftest.$ac_ext >&5
10741   rm -rf conftest*
10742   eval "ac_cv_lib_$ac_lib_var=no"
10743 fi
10744 rm -f conftest*
10745 LIBS="$ac_save_LIBS"
10746
10747 fi
10748 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10749   echo "$ac_t""yes" 1>&6
10750   ol_cv_lib_db=-ldb
10751 else
10752   echo "$ac_t""no" 1>&6
10753 ol_cv_lib_db=no
10754 fi
10755
10756                 
10757 fi
10758
10759         
10760 fi
10761
10762         LIBS="$ol_LIBS"
10763
10764 fi
10765
10766 echo "$ac_t""$ol_cv_lib_db" 1>&6
10767
10768
10769 for ac_hdr in db_185.h
10770 do
10771 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10772 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10773 echo "configure:10774: checking for $ac_hdr" >&5
10774 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10775   echo $ac_n "(cached) $ac_c" 1>&6
10776 else
10777   cat > conftest.$ac_ext <<EOF
10778 #line 10779 "configure"
10779 #include "confdefs.h"
10780 #include <$ac_hdr>
10781 EOF
10782 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10783 { (eval echo configure:10784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10784 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10785 if test -z "$ac_err"; then
10786   rm -rf conftest*
10787   eval "ac_cv_header_$ac_safe=yes"
10788 else
10789   echo "$ac_err" >&5
10790   echo "configure: failed program was:" >&5
10791   cat conftest.$ac_ext >&5
10792   rm -rf conftest*
10793   eval "ac_cv_header_$ac_safe=no"
10794 fi
10795 rm -f conftest*
10796 fi
10797 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10798   echo "$ac_t""yes" 1>&6
10799     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10800   cat >> confdefs.h <<EOF
10801 #define $ac_tr_hdr 1
10802 EOF
10803  
10804 else
10805   echo "$ac_t""no" 1>&6
10806 fi
10807 done
10808
10809 if test "$ol_cv_header_db2" = yes ; then
10810         
10811         ol_cv_header_db=$ac_cv_header_db_185_h
10812 else
10813         ol_cv_header_db=$ac_cv_header_db_h
10814 fi
10815
10816
10817  
10818  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
10819 echo "configure:10820: checking for Berkeley DB" >&5
10820 if eval "test \"\${ol_cv_berkeley_db+set}\" = set"; then
10821   echo $ac_n "(cached) $ac_c" 1>&6
10822 else
10823   
10824         if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then
10825                 ol_cv_berkeley_db=no
10826         else
10827                 ol_cv_berkeley_db=yes
10828         fi
10829
10830 fi
10831
10832 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
10833  if test $ol_cv_berkeley_db = yes ; then
10834         cat >> confdefs.h <<\EOF
10835 #define HAVE_BERKELEY_DB 1
10836 EOF
10837
10838  fi
10839
10840
10841         if test $ol_cv_berkeley_db = yes ; then
10842                 ol_link_ldbm=db
10843                 ol_with_ldbm_api=db
10844
10845                 if test $ol_with_ldbm_type = hash ; then
10846                         cat >> confdefs.h <<\EOF
10847 #define LDBM_USE_DBHASH 1
10848 EOF
10849
10850                 else
10851                         cat >> confdefs.h <<\EOF
10852 #define LDBM_USE_DBBTREE 1
10853 EOF
10854
10855                 fi
10856
10857                                                 if test $ol_cv_lib_db != yes ; then
10858                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
10859                 fi
10860         fi
10861 fi
10862
10863 if test $ol_with_ldbm_api = manual ; then
10864                 ol_link_ldbm=yes
10865
10866         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
10867
10868         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
10869 do
10870 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10871 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10872 echo "configure:10873: checking for $ac_hdr" >&5
10873 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10874   echo $ac_n "(cached) $ac_c" 1>&6
10875 else
10876   cat > conftest.$ac_ext <<EOF
10877 #line 10878 "configure"
10878 #include "confdefs.h"
10879 #include <$ac_hdr>
10880 EOF
10881 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10882 { (eval echo configure:10883: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10883 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10884 if test -z "$ac_err"; then
10885   rm -rf conftest*
10886   eval "ac_cv_header_$ac_safe=yes"
10887 else
10888   echo "$ac_err" >&5
10889   echo "configure: failed program was:" >&5
10890   cat conftest.$ac_ext >&5
10891   rm -rf conftest*
10892   eval "ac_cv_header_$ac_safe=no"
10893 fi
10894 rm -f conftest*
10895 fi
10896 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10897   echo "$ac_t""yes" 1>&6
10898     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10899   cat >> confdefs.h <<EOF
10900 #define $ac_tr_hdr 1
10901 EOF
10902  
10903 else
10904   echo "$ac_t""no" 1>&6
10905 fi
10906 done
10907
10908 fi
10909
10910 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
10911         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
10912         ol_with_ldbm_api=none
10913 fi
10914
10915 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
10916         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
10917 echo "configure:10918: checking for MDBM library" >&5
10918 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
10919   echo $ac_n "(cached) $ac_c" 1>&6
10920 else
10921         ol_LIBS="$LIBS"
10922         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
10923 echo "configure:10924: checking for mdbm_set_chain" >&5
10924 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
10925   echo $ac_n "(cached) $ac_c" 1>&6
10926 else
10927   cat > conftest.$ac_ext <<EOF
10928 #line 10929 "configure"
10929 #include "confdefs.h"
10930 /* System header to define __stub macros and hopefully few prototypes,
10931     which can conflict with char mdbm_set_chain(); below.  */
10932 #include <assert.h>
10933 /* Override any gcc2 internal prototype to avoid an error.  */
10934 /* We use char because int might match the return type of a gcc2
10935     builtin and then its argument prototype would still apply.  */
10936 char mdbm_set_chain();
10937 char (*f)();
10938
10939 int main() {
10940
10941 /* The GNU C library defines this for functions which it implements
10942     to always fail with ENOSYS.  Some functions are actually named
10943     something starting with __ and the normal name is an alias.  */
10944 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
10945 choke me
10946 #else
10947 f = mdbm_set_chain;
10948 #endif
10949
10950 ; return 0; }
10951 EOF
10952 if { (eval echo configure:10953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10953   rm -rf conftest*
10954   eval "ac_cv_func_mdbm_set_chain=yes"
10955 else
10956   echo "configure: failed program was:" >&5
10957   cat conftest.$ac_ext >&5
10958   rm -rf conftest*
10959   eval "ac_cv_func_mdbm_set_chain=no"
10960 fi
10961 rm -f conftest*
10962 fi
10963
10964 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
10965   echo "$ac_t""yes" 1>&6
10966   ol_cv_lib_mdbm=yes
10967 else
10968   echo "$ac_t""no" 1>&6
10969
10970                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
10971 echo "configure:10972: checking for mdbm_set_chain in -lmdbm" >&5
10972 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
10973 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10974   echo $ac_n "(cached) $ac_c" 1>&6
10975 else
10976   ac_save_LIBS="$LIBS"
10977 LIBS="-lmdbm  $LIBS"
10978 cat > conftest.$ac_ext <<EOF
10979 #line 10980 "configure"
10980 #include "confdefs.h"
10981 /* Override any gcc2 internal prototype to avoid an error.  */
10982 /* We use char because int might match the return type of a gcc2
10983     builtin and then its argument prototype would still apply.  */
10984 char mdbm_set_chain();
10985
10986 int main() {
10987 mdbm_set_chain()
10988 ; return 0; }
10989 EOF
10990 if { (eval echo configure:10991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10991   rm -rf conftest*
10992   eval "ac_cv_lib_$ac_lib_var=yes"
10993 else
10994   echo "configure: failed program was:" >&5
10995   cat conftest.$ac_ext >&5
10996   rm -rf conftest*
10997   eval "ac_cv_lib_$ac_lib_var=no"
10998 fi
10999 rm -f conftest*
11000 LIBS="$ac_save_LIBS"
11001
11002 fi
11003 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11004   echo "$ac_t""yes" 1>&6
11005   ol_cv_lib_mdbm=-lmdbm
11006 else
11007   echo "$ac_t""no" 1>&6
11008 ol_cv_lib_mdbm=no
11009 fi
11010
11011         
11012 fi
11013
11014         LIBS="$ol_LIBS"
11015
11016 fi
11017
11018 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
11019
11020
11021  for ac_hdr in mdbm.h
11022 do
11023 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11024 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11025 echo "configure:11026: checking for $ac_hdr" >&5
11026 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11027   echo $ac_n "(cached) $ac_c" 1>&6
11028 else
11029   cat > conftest.$ac_ext <<EOF
11030 #line 11031 "configure"
11031 #include "confdefs.h"
11032 #include <$ac_hdr>
11033 EOF
11034 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11035 { (eval echo configure:11036: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11036 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11037 if test -z "$ac_err"; then
11038   rm -rf conftest*
11039   eval "ac_cv_header_$ac_safe=yes"
11040 else
11041   echo "$ac_err" >&5
11042   echo "configure: failed program was:" >&5
11043   cat conftest.$ac_ext >&5
11044   rm -rf conftest*
11045   eval "ac_cv_header_$ac_safe=no"
11046 fi
11047 rm -f conftest*
11048 fi
11049 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11050   echo "$ac_t""yes" 1>&6
11051     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11052   cat >> confdefs.h <<EOF
11053 #define $ac_tr_hdr 1
11054 EOF
11055  
11056 else
11057   echo "$ac_t""no" 1>&6
11058 fi
11059 done
11060
11061  echo $ac_n "checking for db""... $ac_c" 1>&6
11062 echo "configure:11063: checking for db" >&5
11063 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
11064   echo $ac_n "(cached) $ac_c" 1>&6
11065 else
11066   
11067         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
11068                 ol_cv_mdbm=no
11069         else
11070                 ol_cv_mdbm=yes
11071         fi
11072
11073 fi
11074
11075 echo "$ac_t""$ol_cv_mdbm" 1>&6
11076  if test $ol_cv_mdbm = yes ; then
11077         cat >> confdefs.h <<\EOF
11078 #define HAVE_MDBM 1
11079 EOF
11080
11081  fi
11082
11083
11084         if test $ol_cv_mdbm = yes ; then
11085                 ol_link_ldbm=mdbm
11086                 ol_with_ldbm_api=mdbm
11087                 if test $ol_cv_lib_mdbm != yes ; then
11088                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
11089                 fi
11090         fi
11091 fi
11092
11093 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
11094         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
11095 echo "configure:11096: checking for GDBM library" >&5
11096 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
11097   echo $ac_n "(cached) $ac_c" 1>&6
11098 else
11099         ol_LIBS="$LIBS"
11100         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
11101 echo "configure:11102: checking for gdbm_open" >&5
11102 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
11103   echo $ac_n "(cached) $ac_c" 1>&6
11104 else
11105   cat > conftest.$ac_ext <<EOF
11106 #line 11107 "configure"
11107 #include "confdefs.h"
11108 /* System header to define __stub macros and hopefully few prototypes,
11109     which can conflict with char gdbm_open(); below.  */
11110 #include <assert.h>
11111 /* Override any gcc2 internal prototype to avoid an error.  */
11112 /* We use char because int might match the return type of a gcc2
11113     builtin and then its argument prototype would still apply.  */
11114 char gdbm_open();
11115 char (*f)();
11116
11117 int main() {
11118
11119 /* The GNU C library defines this for functions which it implements
11120     to always fail with ENOSYS.  Some functions are actually named
11121     something starting with __ and the normal name is an alias.  */
11122 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
11123 choke me
11124 #else
11125 f = gdbm_open;
11126 #endif
11127
11128 ; return 0; }
11129 EOF
11130 if { (eval echo configure:11131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11131   rm -rf conftest*
11132   eval "ac_cv_func_gdbm_open=yes"
11133 else
11134   echo "configure: failed program was:" >&5
11135   cat conftest.$ac_ext >&5
11136   rm -rf conftest*
11137   eval "ac_cv_func_gdbm_open=no"
11138 fi
11139 rm -f conftest*
11140 fi
11141
11142 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
11143   echo "$ac_t""yes" 1>&6
11144   ol_cv_lib_gdbm=yes
11145 else
11146   echo "$ac_t""no" 1>&6
11147
11148                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
11149 echo "configure:11150: checking for gdbm_open in -lgdbm" >&5
11150 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
11151 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11152   echo $ac_n "(cached) $ac_c" 1>&6
11153 else
11154   ac_save_LIBS="$LIBS"
11155 LIBS="-lgdbm  $LIBS"
11156 cat > conftest.$ac_ext <<EOF
11157 #line 11158 "configure"
11158 #include "confdefs.h"
11159 /* Override any gcc2 internal prototype to avoid an error.  */
11160 /* We use char because int might match the return type of a gcc2
11161     builtin and then its argument prototype would still apply.  */
11162 char gdbm_open();
11163
11164 int main() {
11165 gdbm_open()
11166 ; return 0; }
11167 EOF
11168 if { (eval echo configure:11169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11169   rm -rf conftest*
11170   eval "ac_cv_lib_$ac_lib_var=yes"
11171 else
11172   echo "configure: failed program was:" >&5
11173   cat conftest.$ac_ext >&5
11174   rm -rf conftest*
11175   eval "ac_cv_lib_$ac_lib_var=no"
11176 fi
11177 rm -f conftest*
11178 LIBS="$ac_save_LIBS"
11179
11180 fi
11181 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11182   echo "$ac_t""yes" 1>&6
11183   ol_cv_lib_gdbm=-lgdbm
11184 else
11185   echo "$ac_t""no" 1>&6
11186 ol_cv_lib_gdbm=no
11187 fi
11188
11189         
11190 fi
11191
11192         LIBS="$ol_LIBS"
11193
11194 fi
11195
11196 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
11197
11198
11199  for ac_hdr in gdbm.h
11200 do
11201 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11202 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11203 echo "configure:11204: checking for $ac_hdr" >&5
11204 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11205   echo $ac_n "(cached) $ac_c" 1>&6
11206 else
11207   cat > conftest.$ac_ext <<EOF
11208 #line 11209 "configure"
11209 #include "confdefs.h"
11210 #include <$ac_hdr>
11211 EOF
11212 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11213 { (eval echo configure:11214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11214 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11215 if test -z "$ac_err"; then
11216   rm -rf conftest*
11217   eval "ac_cv_header_$ac_safe=yes"
11218 else
11219   echo "$ac_err" >&5
11220   echo "configure: failed program was:" >&5
11221   cat conftest.$ac_ext >&5
11222   rm -rf conftest*
11223   eval "ac_cv_header_$ac_safe=no"
11224 fi
11225 rm -f conftest*
11226 fi
11227 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11228   echo "$ac_t""yes" 1>&6
11229     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11230   cat >> confdefs.h <<EOF
11231 #define $ac_tr_hdr 1
11232 EOF
11233  
11234 else
11235   echo "$ac_t""no" 1>&6
11236 fi
11237 done
11238
11239  echo $ac_n "checking for db""... $ac_c" 1>&6
11240 echo "configure:11241: checking for db" >&5
11241 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
11242   echo $ac_n "(cached) $ac_c" 1>&6
11243 else
11244   
11245         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
11246                 ol_cv_gdbm=no
11247         else
11248                 ol_cv_gdbm=yes
11249         fi
11250
11251 fi
11252
11253 echo "$ac_t""$ol_cv_gdbm" 1>&6
11254  if test $ol_cv_gdbm = yes ; then
11255         cat >> confdefs.h <<\EOF
11256 #define HAVE_GDBM 1
11257 EOF
11258
11259  fi
11260
11261
11262         if test $ol_cv_gdbm = yes ; then
11263                 ol_link_ldbm=gdbm
11264                 ol_with_ldbm_api=gdbm
11265
11266                 if test $ol_cv_lib_gdbm != yes ; then
11267                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
11268                 fi
11269         fi
11270 fi
11271
11272 if test $ol_with_ldbm_api = auto ; then
11273         echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
11274 elif test $ol_with_ldbm_api = ndbm ; then
11275         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
11276 echo "configure:11277: checking for NDBM library" >&5
11277 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
11278   echo $ac_n "(cached) $ac_c" 1>&6
11279 else
11280         ol_LIBS="$LIBS"
11281         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
11282 echo "configure:11283: checking for dbm_open" >&5
11283 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
11284   echo $ac_n "(cached) $ac_c" 1>&6
11285 else
11286   cat > conftest.$ac_ext <<EOF
11287 #line 11288 "configure"
11288 #include "confdefs.h"
11289 /* System header to define __stub macros and hopefully few prototypes,
11290     which can conflict with char dbm_open(); below.  */
11291 #include <assert.h>
11292 /* Override any gcc2 internal prototype to avoid an error.  */
11293 /* We use char because int might match the return type of a gcc2
11294     builtin and then its argument prototype would still apply.  */
11295 char dbm_open();
11296 char (*f)();
11297
11298 int main() {
11299
11300 /* The GNU C library defines this for functions which it implements
11301     to always fail with ENOSYS.  Some functions are actually named
11302     something starting with __ and the normal name is an alias.  */
11303 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
11304 choke me
11305 #else
11306 f = dbm_open;
11307 #endif
11308
11309 ; return 0; }
11310 EOF
11311 if { (eval echo configure:11312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11312   rm -rf conftest*
11313   eval "ac_cv_func_dbm_open=yes"
11314 else
11315   echo "configure: failed program was:" >&5
11316   cat conftest.$ac_ext >&5
11317   rm -rf conftest*
11318   eval "ac_cv_func_dbm_open=no"
11319 fi
11320 rm -f conftest*
11321 fi
11322
11323 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
11324   echo "$ac_t""yes" 1>&6
11325   ol_cv_lib_ndbm=yes
11326 else
11327   echo "$ac_t""no" 1>&6
11328
11329                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
11330 echo "configure:11331: checking for dbm_open in -lndbm" >&5
11331 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
11332 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11333   echo $ac_n "(cached) $ac_c" 1>&6
11334 else
11335   ac_save_LIBS="$LIBS"
11336 LIBS="-lndbm  $LIBS"
11337 cat > conftest.$ac_ext <<EOF
11338 #line 11339 "configure"
11339 #include "confdefs.h"
11340 /* Override any gcc2 internal prototype to avoid an error.  */
11341 /* We use char because int might match the return type of a gcc2
11342     builtin and then its argument prototype would still apply.  */
11343 char dbm_open();
11344
11345 int main() {
11346 dbm_open()
11347 ; return 0; }
11348 EOF
11349 if { (eval echo configure:11350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11350   rm -rf conftest*
11351   eval "ac_cv_lib_$ac_lib_var=yes"
11352 else
11353   echo "configure: failed program was:" >&5
11354   cat conftest.$ac_ext >&5
11355   rm -rf conftest*
11356   eval "ac_cv_lib_$ac_lib_var=no"
11357 fi
11358 rm -f conftest*
11359 LIBS="$ac_save_LIBS"
11360
11361 fi
11362 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11363   echo "$ac_t""yes" 1>&6
11364   ol_cv_lib_ndbm=-lndbm
11365 else
11366   echo "$ac_t""no" 1>&6
11367
11368                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
11369 echo "configure:11370: checking for dbm_open in -ldbm" >&5
11370 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
11371 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11372   echo $ac_n "(cached) $ac_c" 1>&6
11373 else
11374   ac_save_LIBS="$LIBS"
11375 LIBS="-ldbm  $LIBS"
11376 cat > conftest.$ac_ext <<EOF
11377 #line 11378 "configure"
11378 #include "confdefs.h"
11379 /* Override any gcc2 internal prototype to avoid an error.  */
11380 /* We use char because int might match the return type of a gcc2
11381     builtin and then its argument prototype would still apply.  */
11382 char dbm_open();
11383
11384 int main() {
11385 dbm_open()
11386 ; return 0; }
11387 EOF
11388 if { (eval echo configure:11389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11389   rm -rf conftest*
11390   eval "ac_cv_lib_$ac_lib_var=yes"
11391 else
11392   echo "configure: failed program was:" >&5
11393   cat conftest.$ac_ext >&5
11394   rm -rf conftest*
11395   eval "ac_cv_lib_$ac_lib_var=no"
11396 fi
11397 rm -f conftest*
11398 LIBS="$ac_save_LIBS"
11399
11400 fi
11401 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11402   echo "$ac_t""yes" 1>&6
11403   ol_cv_lib_ndbm=-ldbm
11404 else
11405   echo "$ac_t""no" 1>&6
11406 ol_cv_lib_ndbm=no
11407 fi
11408                 
11409 fi
11410
11411         
11412 fi
11413
11414         LIBS="$ol_LIBS"
11415
11416 fi
11417
11418 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
11419
11420
11421  for ac_hdr in ndbm.h
11422 do
11423 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11424 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11425 echo "configure:11426: checking for $ac_hdr" >&5
11426 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11427   echo $ac_n "(cached) $ac_c" 1>&6
11428 else
11429   cat > conftest.$ac_ext <<EOF
11430 #line 11431 "configure"
11431 #include "confdefs.h"
11432 #include <$ac_hdr>
11433 EOF
11434 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11435 { (eval echo configure:11436: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11436 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11437 if test -z "$ac_err"; then
11438   rm -rf conftest*
11439   eval "ac_cv_header_$ac_safe=yes"
11440 else
11441   echo "$ac_err" >&5
11442   echo "configure: failed program was:" >&5
11443   cat conftest.$ac_ext >&5
11444   rm -rf conftest*
11445   eval "ac_cv_header_$ac_safe=no"
11446 fi
11447 rm -f conftest*
11448 fi
11449 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11450   echo "$ac_t""yes" 1>&6
11451     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11452   cat >> confdefs.h <<EOF
11453 #define $ac_tr_hdr 1
11454 EOF
11455  
11456 else
11457   echo "$ac_t""no" 1>&6
11458 fi
11459 done
11460
11461  echo $ac_n "checking for db""... $ac_c" 1>&6
11462 echo "configure:11463: checking for db" >&5
11463 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
11464   echo $ac_n "(cached) $ac_c" 1>&6
11465 else
11466   
11467         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
11468                 ol_cv_ndbm=no
11469         else
11470                 ol_cv_ndbm=yes
11471         fi
11472
11473 fi
11474
11475 echo "$ac_t""$ol_cv_ndbm" 1>&6
11476  if test $ol_cv_ndbm = yes ; then
11477         cat >> confdefs.h <<\EOF
11478 #define HAVE_NDBM 1
11479 EOF
11480
11481  fi
11482
11483
11484         if test $ol_cv_ndbm = yes ; then
11485                 ol_link_ldbm=ndbm
11486                 ol_with_ldbm_api=ndbm
11487
11488                 if test $ol_cv_lib_ndbm != yes ; then
11489                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
11490                 fi
11491         fi
11492 fi
11493
11494 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
11495         echo "configure: warning: could not find suitable LDBM backend" 1>&2
11496         if test $ol_enable_ldbm = yes ; then
11497                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
11498         fi
11499
11500         echo "configure: warning: disabling LDBM" 1>&2
11501         ol_enable_ldbm=no
11502 fi
11503
11504 if test $ol_enable_wrappers != no ; then
11505         for ac_hdr in tcpd.h
11506 do
11507 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11508 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11509 echo "configure:11510: checking for $ac_hdr" >&5
11510 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11511   echo $ac_n "(cached) $ac_c" 1>&6
11512 else
11513   cat > conftest.$ac_ext <<EOF
11514 #line 11515 "configure"
11515 #include "confdefs.h"
11516 #include <$ac_hdr>
11517 EOF
11518 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11519 { (eval echo configure:11520: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11520 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11521 if test -z "$ac_err"; then
11522   rm -rf conftest*
11523   eval "ac_cv_header_$ac_safe=yes"
11524 else
11525   echo "$ac_err" >&5
11526   echo "configure: failed program was:" >&5
11527   cat conftest.$ac_ext >&5
11528   rm -rf conftest*
11529   eval "ac_cv_header_$ac_safe=no"
11530 fi
11531 rm -f conftest*
11532 fi
11533 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11534   echo "$ac_t""yes" 1>&6
11535     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11536   cat >> confdefs.h <<EOF
11537 #define $ac_tr_hdr 1
11538 EOF
11539  
11540 else
11541   echo "$ac_t""no" 1>&6
11542 fi
11543 done
11544
11545
11546         if test $ac_cv_header_tcpd_h != yes ; then
11547                 have_wrappers=no
11548         else
11549                 echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
11550 echo "configure:11551: checking for main in -lwrap" >&5
11551 ac_lib_var=`echo wrap'_'main | sed 'y%./+-:%__p__%'`
11552 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11553   echo $ac_n "(cached) $ac_c" 1>&6
11554 else
11555   ac_save_LIBS="$LIBS"
11556 LIBS="-lwrap  $LIBS"
11557 cat > conftest.$ac_ext <<EOF
11558 #line 11559 "configure"
11559 #include "confdefs.h"
11560
11561 int main() {
11562 main()
11563 ; return 0; }
11564 EOF
11565 if { (eval echo configure:11566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11566   rm -rf conftest*
11567   eval "ac_cv_lib_$ac_lib_var=yes"
11568 else
11569   echo "configure: failed program was:" >&5
11570   cat conftest.$ac_ext >&5
11571   rm -rf conftest*
11572   eval "ac_cv_lib_$ac_lib_var=no"
11573 fi
11574 rm -f conftest*
11575 LIBS="$ac_save_LIBS"
11576
11577 fi
11578 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11579   echo "$ac_t""yes" 1>&6
11580   have_wrappers=yes
11581 else
11582   echo "$ac_t""no" 1>&6
11583 have_wrappers=no
11584 fi
11585
11586         fi
11587
11588         if test $have_wrappers = yes ; then
11589                 cat >> confdefs.h <<\EOF
11590 #define HAVE_TCPD 1
11591 EOF
11592
11593                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
11594
11595                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
11596 echo "configure:11597: checking for main in -lnsl" >&5
11597 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
11598 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11599   echo $ac_n "(cached) $ac_c" 1>&6
11600 else
11601   ac_save_LIBS="$LIBS"
11602 LIBS="-lnsl  $LIBS"
11603 cat > conftest.$ac_ext <<EOF
11604 #line 11605 "configure"
11605 #include "confdefs.h"
11606
11607 int main() {
11608 main()
11609 ; return 0; }
11610 EOF
11611 if { (eval echo configure:11612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11612   rm -rf conftest*
11613   eval "ac_cv_lib_$ac_lib_var=yes"
11614 else
11615   echo "configure: failed program was:" >&5
11616   cat conftest.$ac_ext >&5
11617   rm -rf conftest*
11618   eval "ac_cv_lib_$ac_lib_var=no"
11619 fi
11620 rm -f conftest*
11621 LIBS="$ac_save_LIBS"
11622
11623 fi
11624 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11625   echo "$ac_t""yes" 1>&6
11626     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
11627     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
11628   cat >> confdefs.h <<EOF
11629 #define $ac_tr_lib 1
11630 EOF
11631
11632   LIBS="-lnsl $LIBS"
11633
11634 else
11635   echo "$ac_t""no" 1>&6
11636 fi
11637
11638         else
11639                 echo "configure: warning: could not find -lwrap" 1>&2
11640                 if test $ol_enable_wrappers = yes ; then
11641                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
11642                 fi
11643
11644                 echo "configure: warning: disabling wrappers support" 1>&2
11645                 ol_enable_wrappers=no
11646         fi
11647 fi
11648
11649 if test $ol_enable_syslog != no ; then
11650         echo $ac_n "checking for openlog""... $ac_c" 1>&6
11651 echo "configure:11652: checking for openlog" >&5
11652 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
11653   echo $ac_n "(cached) $ac_c" 1>&6
11654 else
11655   cat > conftest.$ac_ext <<EOF
11656 #line 11657 "configure"
11657 #include "confdefs.h"
11658 /* System header to define __stub macros and hopefully few prototypes,
11659     which can conflict with char openlog(); below.  */
11660 #include <assert.h>
11661 /* Override any gcc2 internal prototype to avoid an error.  */
11662 /* We use char because int might match the return type of a gcc2
11663     builtin and then its argument prototype would still apply.  */
11664 char openlog();
11665 char (*f)();
11666
11667 int main() {
11668
11669 /* The GNU C library defines this for functions which it implements
11670     to always fail with ENOSYS.  Some functions are actually named
11671     something starting with __ and the normal name is an alias.  */
11672 #if defined (__stub_openlog) || defined (__stub___openlog)
11673 choke me
11674 #else
11675 f = openlog;
11676 #endif
11677
11678 ; return 0; }
11679 EOF
11680 if { (eval echo configure:11681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11681   rm -rf conftest*
11682   eval "ac_cv_func_openlog=yes"
11683 else
11684   echo "configure: failed program was:" >&5
11685   cat conftest.$ac_ext >&5
11686   rm -rf conftest*
11687   eval "ac_cv_func_openlog=no"
11688 fi
11689 rm -f conftest*
11690 fi
11691
11692 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
11693   echo "$ac_t""yes" 1>&6
11694   :
11695 else
11696   echo "$ac_t""no" 1>&6
11697 fi
11698
11699         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
11700                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
11701         fi
11702         ol_enable_syslog=$ac_cv_func_openlog
11703 fi
11704
11705 if test $ol_enable_dmalloc != no ; then
11706         for ac_hdr in dmalloc.h
11707 do
11708 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11709 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11710 echo "configure:11711: checking for $ac_hdr" >&5
11711 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11712   echo $ac_n "(cached) $ac_c" 1>&6
11713 else
11714   cat > conftest.$ac_ext <<EOF
11715 #line 11716 "configure"
11716 #include "confdefs.h"
11717 #include <$ac_hdr>
11718 EOF
11719 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11720 { (eval echo configure:11721: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11721 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11722 if test -z "$ac_err"; then
11723   rm -rf conftest*
11724   eval "ac_cv_header_$ac_safe=yes"
11725 else
11726   echo "$ac_err" >&5
11727   echo "configure: failed program was:" >&5
11728   cat conftest.$ac_ext >&5
11729   rm -rf conftest*
11730   eval "ac_cv_header_$ac_safe=no"
11731 fi
11732 rm -f conftest*
11733 fi
11734 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11735   echo "$ac_t""yes" 1>&6
11736     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11737   cat >> confdefs.h <<EOF
11738 #define $ac_tr_hdr 1
11739 EOF
11740  
11741 else
11742   echo "$ac_t""no" 1>&6
11743 fi
11744 done
11745
11746         echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
11747 echo "configure:11748: checking for dmalloc_shutdown in -ldmalloc" >&5
11748 ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-:%__p__%'`
11749 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11750   echo $ac_n "(cached) $ac_c" 1>&6
11751 else
11752   ac_save_LIBS="$LIBS"
11753 LIBS="-ldmalloc  $LIBS"
11754 cat > conftest.$ac_ext <<EOF
11755 #line 11756 "configure"
11756 #include "confdefs.h"
11757 /* Override any gcc2 internal prototype to avoid an error.  */
11758 /* We use char because int might match the return type of a gcc2
11759     builtin and then its argument prototype would still apply.  */
11760 char dmalloc_shutdown();
11761
11762 int main() {
11763 dmalloc_shutdown()
11764 ; return 0; }
11765 EOF
11766 if { (eval echo configure:11767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11767   rm -rf conftest*
11768   eval "ac_cv_lib_$ac_lib_var=yes"
11769 else
11770   echo "configure: failed program was:" >&5
11771   cat conftest.$ac_ext >&5
11772   rm -rf conftest*
11773   eval "ac_cv_lib_$ac_lib_var=no"
11774 fi
11775 rm -f conftest*
11776 LIBS="$ac_save_LIBS"
11777
11778 fi
11779 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11780   echo "$ac_t""yes" 1>&6
11781     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
11782     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
11783   cat >> confdefs.h <<EOF
11784 #define $ac_tr_lib 1
11785 EOF
11786
11787   LIBS="-ldmalloc $LIBS"
11788
11789 else
11790   echo "$ac_t""no" 1>&6
11791 fi
11792
11793 fi
11794
11795 if test $ol_enable_tcl != no ; then
11796         for ac_hdr in tcl.h
11797 do
11798 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11799 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11800 echo "configure:11801: checking for $ac_hdr" >&5
11801 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11802   echo $ac_n "(cached) $ac_c" 1>&6
11803 else
11804   cat > conftest.$ac_ext <<EOF
11805 #line 11806 "configure"
11806 #include "confdefs.h"
11807 #include <$ac_hdr>
11808 EOF
11809 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11810 { (eval echo configure:11811: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11811 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11812 if test -z "$ac_err"; then
11813   rm -rf conftest*
11814   eval "ac_cv_header_$ac_safe=yes"
11815 else
11816   echo "$ac_err" >&5
11817   echo "configure: failed program was:" >&5
11818   cat conftest.$ac_ext >&5
11819   rm -rf conftest*
11820   eval "ac_cv_header_$ac_safe=no"
11821 fi
11822 rm -f conftest*
11823 fi
11824 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11825   echo "$ac_t""yes" 1>&6
11826     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11827   cat >> confdefs.h <<EOF
11828 #define $ac_tr_hdr 1
11829 EOF
11830  
11831 else
11832   echo "$ac_t""no" 1>&6
11833 fi
11834 done
11835
11836
11837         if test $ac_cv_header_tcl_h != yes ; then
11838                 have_tcl=no
11839         else
11840                 echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6
11841 echo "configure:11842: checking for main in -ltcl" >&5
11842 ac_lib_var=`echo tcl'_'main | sed 'y%./+-:%__p__%'`
11843 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11844   echo $ac_n "(cached) $ac_c" 1>&6
11845 else
11846   ac_save_LIBS="$LIBS"
11847 LIBS="-ltcl  $LIBS"
11848 cat > conftest.$ac_ext <<EOF
11849 #line 11850 "configure"
11850 #include "confdefs.h"
11851
11852 int main() {
11853 main()
11854 ; return 0; }
11855 EOF
11856 if { (eval echo configure:11857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11857   rm -rf conftest*
11858   eval "ac_cv_lib_$ac_lib_var=yes"
11859 else
11860   echo "configure: failed program was:" >&5
11861   cat conftest.$ac_ext >&5
11862   rm -rf conftest*
11863   eval "ac_cv_lib_$ac_lib_var=no"
11864 fi
11865 rm -f conftest*
11866 LIBS="$ac_save_LIBS"
11867
11868 fi
11869 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11870   echo "$ac_t""yes" 1>&6
11871   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"
11872 else
11873   echo "$ac_t""no" 1>&6
11874 have_tcl=no
11875 fi
11876
11877
11878                 if test $have_tcl != yes; then
11879                         echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6
11880 echo "configure:11881: checking for main in -ltcl7.6" >&5
11881 ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-:%__p__%'`
11882 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11883   echo $ac_n "(cached) $ac_c" 1>&6
11884 else
11885   ac_save_LIBS="$LIBS"
11886 LIBS="-ltcl7.6  $LIBS"
11887 cat > conftest.$ac_ext <<EOF
11888 #line 11889 "configure"
11889 #include "confdefs.h"
11890
11891 int main() {
11892 main()
11893 ; return 0; }
11894 EOF
11895 if { (eval echo configure:11896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11896   rm -rf conftest*
11897   eval "ac_cv_lib_$ac_lib_var=yes"
11898 else
11899   echo "configure: failed program was:" >&5
11900   cat conftest.$ac_ext >&5
11901   rm -rf conftest*
11902   eval "ac_cv_lib_$ac_lib_var=no"
11903 fi
11904 rm -f conftest*
11905 LIBS="$ac_save_LIBS"
11906
11907 fi
11908 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11909   echo "$ac_t""yes" 1>&6
11910   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"
11911 else
11912   echo "$ac_t""no" 1>&6
11913 have_tcl=no
11914 fi
11915
11916                 fi
11917
11918                 if test $have_tcl != yes; then
11919                         echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6
11920 echo "configure:11921: checking for main in -ltcl8.0" >&5
11921 ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-:%__p__%'`
11922 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11923   echo $ac_n "(cached) $ac_c" 1>&6
11924 else
11925   ac_save_LIBS="$LIBS"
11926 LIBS="-ltcl8.0  $LIBS"
11927 cat > conftest.$ac_ext <<EOF
11928 #line 11929 "configure"
11929 #include "confdefs.h"
11930
11931 int main() {
11932 main()
11933 ; return 0; }
11934 EOF
11935 if { (eval echo configure:11936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11936   rm -rf conftest*
11937   eval "ac_cv_lib_$ac_lib_var=yes"
11938 else
11939   echo "configure: failed program was:" >&5
11940   cat conftest.$ac_ext >&5
11941   rm -rf conftest*
11942   eval "ac_cv_lib_$ac_lib_var=no"
11943 fi
11944 rm -f conftest*
11945 LIBS="$ac_save_LIBS"
11946
11947 fi
11948 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11949   echo "$ac_t""yes" 1>&6
11950   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"
11951 else
11952   echo "$ac_t""no" 1>&6
11953 have_tcl=no
11954 fi
11955
11956                 fi
11957         fi
11958
11959         if test $have_tcl != yes ; then
11960                 echo "configure: warning: could not find -ltcl" 1>&2
11961                 if test $ol_enable_tcl = yes ; then
11962                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
11963                 fi
11964
11965                 ol_enable_tcl=no
11966         fi
11967 fi
11968
11969 # ud needs termcap (should insert check here)
11970 ol_link_termcap=no
11971 for ac_hdr in termcap.h ncurses.h
11972 do
11973 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11974 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11975 echo "configure:11976: checking for $ac_hdr" >&5
11976 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11977   echo $ac_n "(cached) $ac_c" 1>&6
11978 else
11979   cat > conftest.$ac_ext <<EOF
11980 #line 11981 "configure"
11981 #include "confdefs.h"
11982 #include <$ac_hdr>
11983 EOF
11984 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11985 { (eval echo configure:11986: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11986 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11987 if test -z "$ac_err"; then
11988   rm -rf conftest*
11989   eval "ac_cv_header_$ac_safe=yes"
11990 else
11991   echo "$ac_err" >&5
11992   echo "configure: failed program was:" >&5
11993   cat conftest.$ac_ext >&5
11994   rm -rf conftest*
11995   eval "ac_cv_header_$ac_safe=no"
11996 fi
11997 rm -f conftest*
11998 fi
11999 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12000   echo "$ac_t""yes" 1>&6
12001     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12002   cat >> confdefs.h <<EOF
12003 #define $ac_tr_hdr 1
12004 EOF
12005  
12006 else
12007   echo "$ac_t""no" 1>&6
12008 fi
12009 done
12010
12011
12012 if test $ol_link_termcap = no ; then
12013         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
12014 echo "configure:12015: checking for tputs in -ltermcap" >&5
12015 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
12016 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12017   echo $ac_n "(cached) $ac_c" 1>&6
12018 else
12019   ac_save_LIBS="$LIBS"
12020 LIBS="-ltermcap  $LIBS"
12021 cat > conftest.$ac_ext <<EOF
12022 #line 12023 "configure"
12023 #include "confdefs.h"
12024 /* Override any gcc2 internal prototype to avoid an error.  */
12025 /* We use char because int might match the return type of a gcc2
12026     builtin and then its argument prototype would still apply.  */
12027 char tputs();
12028
12029 int main() {
12030 tputs()
12031 ; return 0; }
12032 EOF
12033 if { (eval echo configure:12034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12034   rm -rf conftest*
12035   eval "ac_cv_lib_$ac_lib_var=yes"
12036 else
12037   echo "configure: failed program was:" >&5
12038   cat conftest.$ac_ext >&5
12039   rm -rf conftest*
12040   eval "ac_cv_lib_$ac_lib_var=no"
12041 fi
12042 rm -f conftest*
12043 LIBS="$ac_save_LIBS"
12044
12045 fi
12046 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12047   echo "$ac_t""yes" 1>&6
12048   have_termcap=yes
12049 else
12050   echo "$ac_t""no" 1>&6
12051 have_termcap=no
12052 fi
12053
12054         if test $have_termcap = yes ; then
12055                 cat >> confdefs.h <<\EOF
12056 #define HAVE_TERMCAP 1
12057 EOF
12058
12059                 ol_link_termcap=yes
12060                 TERMCAP_LIBS=-ltermcap
12061         fi
12062 fi
12063
12064 if test $ol_link_termcap = no ; then
12065         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
12066 echo "configure:12067: checking for initscr in -lncurses" >&5
12067 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
12068 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12069   echo $ac_n "(cached) $ac_c" 1>&6
12070 else
12071   ac_save_LIBS="$LIBS"
12072 LIBS="-lncurses  $LIBS"
12073 cat > conftest.$ac_ext <<EOF
12074 #line 12075 "configure"
12075 #include "confdefs.h"
12076 /* Override any gcc2 internal prototype to avoid an error.  */
12077 /* We use char because int might match the return type of a gcc2
12078     builtin and then its argument prototype would still apply.  */
12079 char initscr();
12080
12081 int main() {
12082 initscr()
12083 ; return 0; }
12084 EOF
12085 if { (eval echo configure:12086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12086   rm -rf conftest*
12087   eval "ac_cv_lib_$ac_lib_var=yes"
12088 else
12089   echo "configure: failed program was:" >&5
12090   cat conftest.$ac_ext >&5
12091   rm -rf conftest*
12092   eval "ac_cv_lib_$ac_lib_var=no"
12093 fi
12094 rm -f conftest*
12095 LIBS="$ac_save_LIBS"
12096
12097 fi
12098 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12099   echo "$ac_t""yes" 1>&6
12100   have_ncurses=yes
12101 else
12102   echo "$ac_t""no" 1>&6
12103 have_ncurses=no
12104 fi
12105
12106         if test $have_ncurses = yes ; then
12107                 cat >> confdefs.h <<\EOF
12108 #define HAVE_NCURSES 1
12109 EOF
12110
12111                 ol_link_termcap=yes
12112                 TERMCAP_LIBS=-lncurses
12113         fi
12114 fi
12115
12116 if test $ol_link_termcap = no ; then
12117         cat >> confdefs.h <<\EOF
12118 #define NO_TERMCAP 1
12119 EOF
12120
12121         TERMCAP_LIBS=
12122 fi
12123
12124 ol_link_sasl=no
12125 if test $ol_with_cyrus_sasl != no ; then
12126         ac_safe=`echo "sasl.h" | sed 'y%./+-%__p_%'`
12127 echo $ac_n "checking for sasl.h""... $ac_c" 1>&6
12128 echo "configure:12129: checking for sasl.h" >&5
12129 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12130   echo $ac_n "(cached) $ac_c" 1>&6
12131 else
12132   cat > conftest.$ac_ext <<EOF
12133 #line 12134 "configure"
12134 #include "confdefs.h"
12135 #include <sasl.h>
12136 EOF
12137 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12138 { (eval echo configure:12139: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12139 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12140 if test -z "$ac_err"; then
12141   rm -rf conftest*
12142   eval "ac_cv_header_$ac_safe=yes"
12143 else
12144   echo "$ac_err" >&5
12145   echo "configure: failed program was:" >&5
12146   cat conftest.$ac_ext >&5
12147   rm -rf conftest*
12148   eval "ac_cv_header_$ac_safe=no"
12149 fi
12150 rm -f conftest*
12151 fi
12152 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12153   echo "$ac_t""yes" 1>&6
12154   :
12155 else
12156   echo "$ac_t""no" 1>&6
12157 fi
12158
12159
12160         if test $ac_cv_header_sasl_h = yes ; then
12161                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
12162 echo "configure:12163: checking for sasl_client_init in -lsasl" >&5
12163 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
12164 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12165   echo $ac_n "(cached) $ac_c" 1>&6
12166 else
12167   ac_save_LIBS="$LIBS"
12168 LIBS="-lsasl  $LIBS"
12169 cat > conftest.$ac_ext <<EOF
12170 #line 12171 "configure"
12171 #include "confdefs.h"
12172 /* Override any gcc2 internal prototype to avoid an error.  */
12173 /* We use char because int might match the return type of a gcc2
12174     builtin and then its argument prototype would still apply.  */
12175 char sasl_client_init();
12176
12177 int main() {
12178 sasl_client_init()
12179 ; return 0; }
12180 EOF
12181 if { (eval echo configure:12182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12182   rm -rf conftest*
12183   eval "ac_cv_lib_$ac_lib_var=yes"
12184 else
12185   echo "configure: failed program was:" >&5
12186   cat conftest.$ac_ext >&5
12187   rm -rf conftest*
12188   eval "ac_cv_lib_$ac_lib_var=no"
12189 fi
12190 rm -f conftest*
12191 LIBS="$ac_save_LIBS"
12192
12193 fi
12194 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12195   echo "$ac_t""yes" 1>&6
12196   have_cyrus_sasl=yes
12197 else
12198   echo "$ac_t""no" 1>&6
12199 have_cyrus_sasl=no
12200 fi
12201
12202
12203                 if test $have_cyrus_sasl != no ; then
12204                         SASL_LIBS="-lsasl"
12205                         cat >> confdefs.h <<\EOF
12206 #define HAVE_CYRUS_SASL 1
12207 EOF
12208
12209                         ol_link_sasl=yes
12210                 fi
12211         fi
12212
12213         if test $ol_link_sasl = no -a $ol_with_cyrus_sasl = yes ; then
12214                 { echo "configure: error: no suitable API for --with-cyrus-sasl=$ol_with_cyrus_sasl" 1>&2; exit 1; }
12215         fi
12216 fi
12217
12218 ol_link_fetch=no
12219 if test $ol_with_fetch != no ; then
12220         ol=$LIBS
12221 LIBS="-lfetch -lcom_err $LIBS"
12222 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
12223 echo "configure:12224: checking fetch(3) library" >&5
12224 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
12225   echo $ac_n "(cached) $ac_c" 1>&6
12226 else
12227   
12228         cat > conftest.$ac_ext <<EOF
12229 #line 12230 "configure"
12230 #include "confdefs.h"
12231
12232 #include <sys/param.h>
12233 #include <stdio.h>
12234 #include <fetch.h>
12235 int main() {
12236 struct url *u = fetchParseURL("file:///"); 
12237 ; return 0; }
12238 EOF
12239 if { (eval echo configure:12240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12240   rm -rf conftest*
12241   ol_cv_lib_fetch=yes
12242 else
12243   echo "configure: failed program was:" >&5
12244   cat conftest.$ac_ext >&5
12245   rm -rf conftest*
12246   ol_cv_lib_fetch=no
12247 fi
12248 rm -f conftest*
12249 fi
12250
12251 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
12252 LIBS=$ol_LIBS
12253 if test $ol_cv_lib_fetch != no ; then
12254         ol_link_fetch="-lfetch -lcom_err"
12255         cat >> confdefs.h <<\EOF
12256 #define HAVE_FETCH 1
12257 EOF
12258
12259 fi
12260
12261
12262         if test $ol_cv_lib_fetch != no ; then
12263                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
12264                 ol_link_fetch=freebsd
12265
12266         elif test $ol_with_fetch != auto ; then
12267                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
12268         fi 
12269 fi
12270
12271 ol_link_readline=no
12272 if test $ol_with_readline != no ; then
12273         for ac_hdr in readline/readline.h readline/history.h
12274 do
12275 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12276 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12277 echo "configure:12278: checking for $ac_hdr" >&5
12278 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12279   echo $ac_n "(cached) $ac_c" 1>&6
12280 else
12281   cat > conftest.$ac_ext <<EOF
12282 #line 12283 "configure"
12283 #include "confdefs.h"
12284 #include <$ac_hdr>
12285 EOF
12286 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12287 { (eval echo configure:12288: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12288 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12289 if test -z "$ac_err"; then
12290   rm -rf conftest*
12291   eval "ac_cv_header_$ac_safe=yes"
12292 else
12293   echo "$ac_err" >&5
12294   echo "configure: failed program was:" >&5
12295   cat conftest.$ac_ext >&5
12296   rm -rf conftest*
12297   eval "ac_cv_header_$ac_safe=no"
12298 fi
12299 rm -f conftest*
12300 fi
12301 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12302   echo "$ac_t""yes" 1>&6
12303     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12304   cat >> confdefs.h <<EOF
12305 #define $ac_tr_hdr 1
12306 EOF
12307  
12308 else
12309   echo "$ac_t""no" 1>&6
12310 fi
12311 done
12312
12313
12314         if test $ac_cv_header_readline_readline_h = yes ; then
12315                 save_LIBS="$LIBS"
12316                 LIBS="$TERMCAP_LIBS $LIBS"
12317                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
12318 echo "configure:12319: checking for readline in -lreadline" >&5
12319 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
12320 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12321   echo $ac_n "(cached) $ac_c" 1>&6
12322 else
12323   ac_save_LIBS="$LIBS"
12324 LIBS="-lreadline  $LIBS"
12325 cat > conftest.$ac_ext <<EOF
12326 #line 12327 "configure"
12327 #include "confdefs.h"
12328 /* Override any gcc2 internal prototype to avoid an error.  */
12329 /* We use char because int might match the return type of a gcc2
12330     builtin and then its argument prototype would still apply.  */
12331 char readline();
12332
12333 int main() {
12334 readline()
12335 ; return 0; }
12336 EOF
12337 if { (eval echo configure:12338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12338   rm -rf conftest*
12339   eval "ac_cv_lib_$ac_lib_var=yes"
12340 else
12341   echo "configure: failed program was:" >&5
12342   cat conftest.$ac_ext >&5
12343   rm -rf conftest*
12344   eval "ac_cv_lib_$ac_lib_var=no"
12345 fi
12346 rm -f conftest*
12347 LIBS="$ac_save_LIBS"
12348
12349 fi
12350 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12351   echo "$ac_t""yes" 1>&6
12352   have_readline=yes
12353 else
12354   echo "$ac_t""no" 1>&6
12355 have_readline=no
12356 fi
12357
12358                 LIBS="$save_LIBS"
12359                         
12360                 if test $have_readline = yes ; then
12361                         ol_with_readline=found
12362                         ol_link_readline=yes
12363
12364                         READLINE_LIBS="-lreadline"
12365                 fi
12366         fi
12367 fi
12368
12369 if test $ol_link_readline = yes ; then
12370         cat >> confdefs.h <<\EOF
12371 #define HAVE_READLINE 1
12372 EOF
12373
12374 fi
12375
12376
12377 # FreeBSD (and others) have crypt(3) in -lcrypt
12378 if test $ol_enable_crypt != no ; then
12379         echo $ac_n "checking for crypt""... $ac_c" 1>&6
12380 echo "configure:12381: checking for crypt" >&5
12381 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
12382   echo $ac_n "(cached) $ac_c" 1>&6
12383 else
12384   cat > conftest.$ac_ext <<EOF
12385 #line 12386 "configure"
12386 #include "confdefs.h"
12387 /* System header to define __stub macros and hopefully few prototypes,
12388     which can conflict with char crypt(); below.  */
12389 #include <assert.h>
12390 /* Override any gcc2 internal prototype to avoid an error.  */
12391 /* We use char because int might match the return type of a gcc2
12392     builtin and then its argument prototype would still apply.  */
12393 char crypt();
12394 char (*f)();
12395
12396 int main() {
12397
12398 /* The GNU C library defines this for functions which it implements
12399     to always fail with ENOSYS.  Some functions are actually named
12400     something starting with __ and the normal name is an alias.  */
12401 #if defined (__stub_crypt) || defined (__stub___crypt)
12402 choke me
12403 #else
12404 f = crypt;
12405 #endif
12406
12407 ; return 0; }
12408 EOF
12409 if { (eval echo configure:12410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12410   rm -rf conftest*
12411   eval "ac_cv_func_crypt=yes"
12412 else
12413   echo "configure: failed program was:" >&5
12414   cat conftest.$ac_ext >&5
12415   rm -rf conftest*
12416   eval "ac_cv_func_crypt=no"
12417 fi
12418 rm -f conftest*
12419 fi
12420
12421 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
12422   echo "$ac_t""yes" 1>&6
12423   have_crypt=yes
12424 else
12425   echo "$ac_t""no" 1>&6
12426
12427                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
12428 echo "configure:12429: checking for crypt in -lcrypt" >&5
12429 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
12430 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12431   echo $ac_n "(cached) $ac_c" 1>&6
12432 else
12433   ac_save_LIBS="$LIBS"
12434 LIBS="-lcrypt  $LIBS"
12435 cat > conftest.$ac_ext <<EOF
12436 #line 12437 "configure"
12437 #include "confdefs.h"
12438 /* Override any gcc2 internal prototype to avoid an error.  */
12439 /* We use char because int might match the return type of a gcc2
12440     builtin and then its argument prototype would still apply.  */
12441 char crypt();
12442
12443 int main() {
12444 crypt()
12445 ; return 0; }
12446 EOF
12447 if { (eval echo configure:12448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12448   rm -rf conftest*
12449   eval "ac_cv_lib_$ac_lib_var=yes"
12450 else
12451   echo "configure: failed program was:" >&5
12452   cat conftest.$ac_ext >&5
12453   rm -rf conftest*
12454   eval "ac_cv_lib_$ac_lib_var=no"
12455 fi
12456 rm -f conftest*
12457 LIBS="$ac_save_LIBS"
12458
12459 fi
12460 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12461   echo "$ac_t""yes" 1>&6
12462   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
12463                         have_crypt=yes
12464 else
12465   echo "$ac_t""no" 1>&6
12466 have_crypt=no
12467 fi
12468
12469 fi
12470
12471
12472         if test $have_crypt = yes ; then
12473                 cat >> confdefs.h <<\EOF
12474 #define HAVE_CRYPT 1
12475 EOF
12476
12477         else
12478                 echo "configure: warning: could not find crypt" 1>&2
12479                 if test $ol_enable_crypt = yes ; then
12480                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
12481                 fi
12482
12483                 echo "configure: warning: disabling crypt support" 1>&2
12484                 ol_enable_crypt=no
12485         fi
12486 fi
12487
12488 # FreeBSD (and others) have setproctitle(3) in -lutil
12489 if test $ol_enable_proctitle != no ; then
12490         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
12491 echo "configure:12492: checking for setproctitle" >&5
12492 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
12493   echo $ac_n "(cached) $ac_c" 1>&6
12494 else
12495   cat > conftest.$ac_ext <<EOF
12496 #line 12497 "configure"
12497 #include "confdefs.h"
12498 /* System header to define __stub macros and hopefully few prototypes,
12499     which can conflict with char setproctitle(); below.  */
12500 #include <assert.h>
12501 /* Override any gcc2 internal prototype to avoid an error.  */
12502 /* We use char because int might match the return type of a gcc2
12503     builtin and then its argument prototype would still apply.  */
12504 char setproctitle();
12505 char (*f)();
12506
12507 int main() {
12508
12509 /* The GNU C library defines this for functions which it implements
12510     to always fail with ENOSYS.  Some functions are actually named
12511     something starting with __ and the normal name is an alias.  */
12512 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
12513 choke me
12514 #else
12515 f = setproctitle;
12516 #endif
12517
12518 ; return 0; }
12519 EOF
12520 if { (eval echo configure:12521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12521   rm -rf conftest*
12522   eval "ac_cv_func_setproctitle=yes"
12523 else
12524   echo "configure: failed program was:" >&5
12525   cat conftest.$ac_ext >&5
12526   rm -rf conftest*
12527   eval "ac_cv_func_setproctitle=no"
12528 fi
12529 rm -f conftest*
12530 fi
12531
12532 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
12533   echo "$ac_t""yes" 1>&6
12534   have_setproctitle=yes
12535 else
12536   echo "$ac_t""no" 1>&6
12537
12538                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
12539 echo "configure:12540: checking for setproctitle in -lutil" >&5
12540 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
12541 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12542   echo $ac_n "(cached) $ac_c" 1>&6
12543 else
12544   ac_save_LIBS="$LIBS"
12545 LIBS="-lutil  $LIBS"
12546 cat > conftest.$ac_ext <<EOF
12547 #line 12548 "configure"
12548 #include "confdefs.h"
12549 /* Override any gcc2 internal prototype to avoid an error.  */
12550 /* We use char because int might match the return type of a gcc2
12551     builtin and then its argument prototype would still apply.  */
12552 char setproctitle();
12553
12554 int main() {
12555 setproctitle()
12556 ; return 0; }
12557 EOF
12558 if { (eval echo configure:12559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12559   rm -rf conftest*
12560   eval "ac_cv_lib_$ac_lib_var=yes"
12561 else
12562   echo "configure: failed program was:" >&5
12563   cat conftest.$ac_ext >&5
12564   rm -rf conftest*
12565   eval "ac_cv_lib_$ac_lib_var=no"
12566 fi
12567 rm -f conftest*
12568 LIBS="$ac_save_LIBS"
12569
12570 fi
12571 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12572   echo "$ac_t""yes" 1>&6
12573   have_setproctitle=yes
12574                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
12575 else
12576   echo "$ac_t""no" 1>&6
12577 have_setproctitle=no
12578                         LIBOBJS="$LIBOBJS setproctitle.o"
12579 fi
12580
12581 fi
12582
12583
12584         if test $have_setproctitle = yes ; then
12585                 cat >> confdefs.h <<\EOF
12586 #define HAVE_SETPROCTITLE 1
12587 EOF
12588
12589         fi
12590 fi
12591
12592 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
12593 echo "configure:12594: checking for uid_t in sys/types.h" >&5
12594 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
12595   echo $ac_n "(cached) $ac_c" 1>&6
12596 else
12597   cat > conftest.$ac_ext <<EOF
12598 #line 12599 "configure"
12599 #include "confdefs.h"
12600 #include <sys/types.h>
12601 EOF
12602 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12603   egrep "uid_t" >/dev/null 2>&1; then
12604   rm -rf conftest*
12605   ac_cv_type_uid_t=yes
12606 else
12607   rm -rf conftest*
12608   ac_cv_type_uid_t=no
12609 fi
12610 rm -f conftest*
12611
12612 fi
12613
12614 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
12615 if test $ac_cv_type_uid_t = no; then
12616   cat >> confdefs.h <<\EOF
12617 #define uid_t int
12618 EOF
12619
12620   cat >> confdefs.h <<\EOF
12621 #define gid_t int
12622 EOF
12623
12624 fi
12625
12626 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
12627 echo "configure:12628: checking type of array argument to getgroups" >&5
12628 if eval "test \"\${ac_cv_type_getgroups+set}\" = set"; then
12629   echo $ac_n "(cached) $ac_c" 1>&6
12630 else
12631   if test "$cross_compiling" = yes; then
12632   ac_cv_type_getgroups=cross
12633 else
12634   cat > conftest.$ac_ext <<EOF
12635 #line 12636 "configure"
12636 #include "confdefs.h"
12637
12638 /* Thanks to Mike Rendell for this test.  */
12639 #include <sys/types.h>
12640 #define NGID 256
12641 #undef MAX
12642 #define MAX(x, y) ((x) > (y) ? (x) : (y))
12643 main()
12644 {
12645   gid_t gidset[NGID];
12646   int i, n;
12647   union { gid_t gval; long lval; }  val;
12648
12649   val.lval = -1;
12650   for (i = 0; i < NGID; i++)
12651     gidset[i] = val.gval;
12652   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
12653                  gidset);
12654   /* Exit non-zero if getgroups seems to require an array of ints.  This
12655      happens when gid_t is short but getgroups modifies an array of ints.  */
12656   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
12657 }
12658
12659 EOF
12660 if { (eval echo configure:12661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12661 then
12662     ac_cv_type_getgroups=gid_t
12663 else
12664   echo "configure: failed program was:" >&5
12665   cat conftest.$ac_ext >&5
12666   rm -fr conftest*
12667   ac_cv_type_getgroups=int
12668 fi
12669 rm -fr conftest*
12670 fi
12671
12672 if test $ac_cv_type_getgroups = cross; then
12673         cat > conftest.$ac_ext <<EOF
12674 #line 12675 "configure"
12675 #include "confdefs.h"
12676 #include <unistd.h>
12677 EOF
12678 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12679   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
12680   rm -rf conftest*
12681   ac_cv_type_getgroups=gid_t
12682 else
12683   rm -rf conftest*
12684   ac_cv_type_getgroups=int
12685 fi
12686 rm -f conftest*
12687
12688 fi
12689 fi
12690
12691 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
12692 cat >> confdefs.h <<EOF
12693 #define GETGROUPS_T $ac_cv_type_getgroups
12694 EOF
12695
12696  echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
12697 echo "configure:12698: checking for ANSI C header files" >&5
12698 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
12699   echo $ac_n "(cached) $ac_c" 1>&6
12700 else
12701   cat > conftest.$ac_ext <<EOF
12702 #line 12703 "configure"
12703 #include "confdefs.h"
12704 #include <stdlib.h>
12705 #include <stdarg.h>
12706 #include <string.h>
12707 #include <float.h>
12708 EOF
12709 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12710 { (eval echo configure:12711: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12711 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12712 if test -z "$ac_err"; then
12713   rm -rf conftest*
12714   ac_cv_header_stdc=yes
12715 else
12716   echo "$ac_err" >&5
12717   echo "configure: failed program was:" >&5
12718   cat conftest.$ac_ext >&5
12719   rm -rf conftest*
12720   ac_cv_header_stdc=no
12721 fi
12722 rm -f conftest*
12723
12724 if test $ac_cv_header_stdc = yes; then
12725   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
12726 cat > conftest.$ac_ext <<EOF
12727 #line 12728 "configure"
12728 #include "confdefs.h"
12729 #include <string.h>
12730 EOF
12731 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12732   egrep "memchr" >/dev/null 2>&1; then
12733   :
12734 else
12735   rm -rf conftest*
12736   ac_cv_header_stdc=no
12737 fi
12738 rm -f conftest*
12739
12740 fi
12741
12742 if test $ac_cv_header_stdc = yes; then
12743   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
12744 cat > conftest.$ac_ext <<EOF
12745 #line 12746 "configure"
12746 #include "confdefs.h"
12747 #include <stdlib.h>
12748 EOF
12749 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12750   egrep "free" >/dev/null 2>&1; then
12751   :
12752 else
12753   rm -rf conftest*
12754   ac_cv_header_stdc=no
12755 fi
12756 rm -f conftest*
12757
12758 fi
12759
12760 if test $ac_cv_header_stdc = yes; then
12761   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
12762 if test "$cross_compiling" = yes; then
12763   :
12764 else
12765   cat > conftest.$ac_ext <<EOF
12766 #line 12767 "configure"
12767 #include "confdefs.h"
12768 #include <ctype.h>
12769 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
12770 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
12771 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
12772 int main () { int i; for (i = 0; i < 256; i++)
12773 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
12774 exit (0); }
12775
12776 EOF
12777 if { (eval echo configure:12778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12778 then
12779   :
12780 else
12781   echo "configure: failed program was:" >&5
12782   cat conftest.$ac_ext >&5
12783   rm -fr conftest*
12784   ac_cv_header_stdc=no
12785 fi
12786 rm -fr conftest*
12787 fi
12788
12789 fi
12790 fi
12791
12792 echo "$ac_t""$ac_cv_header_stdc" 1>&6
12793 if test $ac_cv_header_stdc = yes; then
12794   cat >> confdefs.h <<\EOF
12795 #define STDC_HEADERS 1
12796 EOF
12797
12798 fi
12799
12800 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
12801 echo "configure:12802: checking for mode_t" >&5
12802 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
12803   echo $ac_n "(cached) $ac_c" 1>&6
12804 else
12805   cat > conftest.$ac_ext <<EOF
12806 #line 12807 "configure"
12807 #include "confdefs.h"
12808 #include <sys/types.h>
12809 #if STDC_HEADERS
12810 #include <stdlib.h>
12811 #include <stddef.h>
12812 #endif
12813 EOF
12814 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12815   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
12816   rm -rf conftest*
12817   eval "ac_cv_type_mode_t=yes"
12818 else
12819   rm -rf conftest*
12820   eval "ac_cv_type_mode_t=no"
12821 fi
12822 rm -f conftest*
12823
12824 fi
12825 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
12826   echo "$ac_t""yes" 1>&6
12827 else
12828   echo "$ac_t""no" 1>&6
12829   cat >> confdefs.h <<EOF
12830 #define mode_t int
12831 EOF
12832
12833 fi
12834
12835 echo $ac_n "checking for off_t""... $ac_c" 1>&6
12836 echo "configure:12837: checking for off_t" >&5
12837 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
12838   echo $ac_n "(cached) $ac_c" 1>&6
12839 else
12840   cat > conftest.$ac_ext <<EOF
12841 #line 12842 "configure"
12842 #include "confdefs.h"
12843 #include <sys/types.h>
12844 #if STDC_HEADERS
12845 #include <stdlib.h>
12846 #include <stddef.h>
12847 #endif
12848 EOF
12849 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12850   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
12851   rm -rf conftest*
12852   eval "ac_cv_type_off_t=yes"
12853 else
12854   rm -rf conftest*
12855   eval "ac_cv_type_off_t=no"
12856 fi
12857 rm -f conftest*
12858
12859 fi
12860 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
12861   echo "$ac_t""yes" 1>&6
12862 else
12863   echo "$ac_t""no" 1>&6
12864   cat >> confdefs.h <<EOF
12865 #define off_t long
12866 EOF
12867
12868 fi
12869
12870 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
12871 echo "configure:12872: checking for pid_t" >&5
12872 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
12873   echo $ac_n "(cached) $ac_c" 1>&6
12874 else
12875   cat > conftest.$ac_ext <<EOF
12876 #line 12877 "configure"
12877 #include "confdefs.h"
12878 #include <sys/types.h>
12879 #if STDC_HEADERS
12880 #include <stdlib.h>
12881 #include <stddef.h>
12882 #endif
12883 EOF
12884 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12885   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
12886   rm -rf conftest*
12887   eval "ac_cv_type_pid_t=yes"
12888 else
12889   rm -rf conftest*
12890   eval "ac_cv_type_pid_t=no"
12891 fi
12892 rm -f conftest*
12893
12894 fi
12895 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
12896   echo "$ac_t""yes" 1>&6
12897 else
12898   echo "$ac_t""no" 1>&6
12899   cat >> confdefs.h <<EOF
12900 #define pid_t int
12901 EOF
12902
12903 fi
12904
12905 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
12906 echo "configure:12907: checking for ptrdiff_t" >&5
12907 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
12908   echo $ac_n "(cached) $ac_c" 1>&6
12909 else
12910   cat > conftest.$ac_ext <<EOF
12911 #line 12912 "configure"
12912 #include "confdefs.h"
12913 #include <stddef.h>
12914 int main() {
12915 ptrdiff_t p
12916 ; return 0; }
12917 EOF
12918 if { (eval echo configure:12919: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12919   rm -rf conftest*
12920   am_cv_type_ptrdiff_t=yes
12921 else
12922   echo "configure: failed program was:" >&5
12923   cat conftest.$ac_ext >&5
12924   rm -rf conftest*
12925   am_cv_type_ptrdiff_t=no
12926 fi
12927 rm -f conftest*
12928 fi
12929
12930 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
12931    if test $am_cv_type_ptrdiff_t = yes; then
12932      cat >> confdefs.h <<\EOF
12933 #define HAVE_PTRDIFF_T 1
12934 EOF
12935
12936    fi
12937
12938 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
12939 echo "configure:12940: checking return type of signal handlers" >&5
12940 if eval "test \"\${ac_cv_type_signal+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 #include <signal.h>
12948 #ifdef signal
12949 #undef signal
12950 #endif
12951 #ifdef __cplusplus
12952 extern "C" void (*signal (int, void (*)(int)))(int);
12953 #else
12954 void (*signal ()) ();
12955 #endif
12956
12957 int main() {
12958 int i;
12959 ; return 0; }
12960 EOF
12961 if { (eval echo configure:12962: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12962   rm -rf conftest*
12963   ac_cv_type_signal=void
12964 else
12965   echo "configure: failed program was:" >&5
12966   cat conftest.$ac_ext >&5
12967   rm -rf conftest*
12968   ac_cv_type_signal=int
12969 fi
12970 rm -f conftest*
12971 fi
12972
12973 echo "$ac_t""$ac_cv_type_signal" 1>&6
12974 cat >> confdefs.h <<EOF
12975 #define RETSIGTYPE $ac_cv_type_signal
12976 EOF
12977
12978
12979 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
12980 echo "configure:12981: checking for sig_atomic_t" >&5
12981 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
12982   echo $ac_n "(cached) $ac_c" 1>&6
12983 else
12984   cat > conftest.$ac_ext <<EOF
12985 #line 12986 "configure"
12986 #include "confdefs.h"
12987 #include <signal.h>
12988 int main() {
12989 sig_atomic_t atomic;
12990 ; return 0; }
12991 EOF
12992 if { (eval echo configure:12993: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12993   rm -rf conftest*
12994   ol_cv_type_sig_atomic_t=yes
12995 else
12996   echo "configure: failed program was:" >&5
12997   cat conftest.$ac_ext >&5
12998   rm -rf conftest*
12999   ol_cv_type_sig_atomic_t=no
13000 fi
13001 rm -f conftest*
13002 fi
13003
13004 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
13005   if test $ol_cv_type_sig_atomic_t = no; then
13006     cat >> confdefs.h <<\EOF
13007 #define sig_atomic_t int
13008 EOF
13009
13010   fi
13011  
13012 echo $ac_n "checking for size_t""... $ac_c" 1>&6
13013 echo "configure:13014: checking for size_t" >&5
13014 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
13015   echo $ac_n "(cached) $ac_c" 1>&6
13016 else
13017   cat > conftest.$ac_ext <<EOF
13018 #line 13019 "configure"
13019 #include "confdefs.h"
13020 #include <sys/types.h>
13021 #if STDC_HEADERS
13022 #include <stdlib.h>
13023 #include <stddef.h>
13024 #endif
13025 EOF
13026 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13027   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
13028   rm -rf conftest*
13029   eval "ac_cv_type_size_t=yes"
13030 else
13031   rm -rf conftest*
13032   eval "ac_cv_type_size_t=no"
13033 fi
13034 rm -f conftest*
13035
13036 fi
13037 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
13038   echo "$ac_t""yes" 1>&6
13039 else
13040   echo "$ac_t""no" 1>&6
13041   cat >> confdefs.h <<EOF
13042 #define size_t unsigned
13043 EOF
13044
13045 fi
13046
13047 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
13048 echo "configure:13049: checking for socklen_t" >&5
13049 if eval "test \"\${ol_cv_type_socklen_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
13056 #ifdef HAVE_SYS_TYPES_H
13057 #include <sys/types.h>
13058 #endif
13059 #ifdef HAVE_SYS_SOCKET_H
13060 #include <sys/socket.h>
13061 #endif
13062
13063 int main() {
13064 socklen_t len;
13065 ; return 0; }
13066 EOF
13067 if { (eval echo configure:13068: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13068   rm -rf conftest*
13069   ol_cv_type_socklen_t=yes
13070 else
13071   echo "configure: failed program was:" >&5
13072   cat conftest.$ac_ext >&5
13073   rm -rf conftest*
13074   ol_cv_type_socklen_t=no
13075 fi
13076 rm -f conftest*
13077 fi
13078
13079 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
13080   if test $ol_cv_type_socklen_t = no; then
13081     cat >> confdefs.h <<\EOF
13082 #define socklen_t int
13083 EOF
13084
13085   fi
13086  
13087 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
13088 echo "configure:13089: checking for member st_blksize in aggregate type struct stat" >&5
13089 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
13090   echo $ac_n "(cached) $ac_c" 1>&6
13091 else
13092   cat > conftest.$ac_ext <<EOF
13093 #line 13094 "configure"
13094 #include "confdefs.h"
13095 #include <sys/types.h>
13096 #include <sys/stat.h>
13097 int main() {
13098 struct stat foo; foo.st_blksize;
13099 ; return 0; }
13100 EOF
13101 if { (eval echo configure:13102: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13102   rm -rf conftest*
13103   ac_cv_c_struct_member_st_blksize=yes
13104 else
13105   echo "configure: failed program was:" >&5
13106   cat conftest.$ac_ext >&5
13107   rm -rf conftest*
13108   ac_cv_c_struct_member_st_blksize=no
13109 fi
13110 rm -f conftest*
13111 fi
13112
13113 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
13114 st_blksize="$ac_cv_c_struct_member_st_blksize"
13115 if test $ac_cv_c_struct_member_st_blksize = yes; then
13116   cat >> confdefs.h <<\EOF
13117 #define HAVE_ST_BLKSIZE 1
13118 EOF
13119
13120 fi
13121
13122 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
13123 echo "configure:13124: checking whether time.h and sys/time.h may both be included" >&5
13124 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
13125   echo $ac_n "(cached) $ac_c" 1>&6
13126 else
13127   cat > conftest.$ac_ext <<EOF
13128 #line 13129 "configure"
13129 #include "confdefs.h"
13130 #include <sys/types.h>
13131 #include <sys/time.h>
13132 #include <time.h>
13133 int main() {
13134 struct tm *tp;
13135 ; return 0; }
13136 EOF
13137 if { (eval echo configure:13138: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13138   rm -rf conftest*
13139   ac_cv_header_time=yes
13140 else
13141   echo "configure: failed program was:" >&5
13142   cat conftest.$ac_ext >&5
13143   rm -rf conftest*
13144   ac_cv_header_time=no
13145 fi
13146 rm -f conftest*
13147 fi
13148
13149 echo "$ac_t""$ac_cv_header_time" 1>&6
13150 if test $ac_cv_header_time = yes; then
13151   cat >> confdefs.h <<\EOF
13152 #define TIME_WITH_SYS_TIME 1
13153 EOF
13154
13155 fi
13156
13157 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
13158 echo "configure:13159: checking whether struct tm is in sys/time.h or time.h" >&5
13159 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
13160   echo $ac_n "(cached) $ac_c" 1>&6
13161 else
13162   cat > conftest.$ac_ext <<EOF
13163 #line 13164 "configure"
13164 #include "confdefs.h"
13165 #include <sys/types.h>
13166 #include <time.h>
13167 int main() {
13168 struct tm *tp; tp->tm_sec;
13169 ; return 0; }
13170 EOF
13171 if { (eval echo configure:13172: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13172   rm -rf conftest*
13173   ac_cv_struct_tm=time.h
13174 else
13175   echo "configure: failed program was:" >&5
13176   cat conftest.$ac_ext >&5
13177   rm -rf conftest*
13178   ac_cv_struct_tm=sys/time.h
13179 fi
13180 rm -f conftest*
13181 fi
13182
13183 echo "$ac_t""$ac_cv_struct_tm" 1>&6
13184 if test $ac_cv_struct_tm = sys/time.h; then
13185   cat >> confdefs.h <<\EOF
13186 #define TM_IN_SYS_TIME 1
13187 EOF
13188
13189 fi
13190
13191 # test for pw_gecos in struct passwd
13192 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
13193 echo "configure:13194: checking struct passwd for pw_gecos" >&5
13194 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
13195   echo $ac_n "(cached) $ac_c" 1>&6
13196 else
13197   
13198         cat > conftest.$ac_ext <<EOF
13199 #line 13200 "configure"
13200 #include "confdefs.h"
13201 #include <pwd.h>
13202 int main() {
13203
13204         struct passwd pwd;
13205         pwd.pw_gecos = pwd.pw_name;
13206
13207 ; return 0; }
13208 EOF
13209 if { (eval echo configure:13210: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13210   rm -rf conftest*
13211   ol_cv_struct_passwd_pw_gecos=yes
13212 else
13213   echo "configure: failed program was:" >&5
13214   cat conftest.$ac_ext >&5
13215   rm -rf conftest*
13216   ol_cv_struct_passwd_pw_gecos=no
13217 fi
13218 rm -f conftest*
13219 fi
13220
13221 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
13222 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
13223         cat >> confdefs.h <<\EOF
13224 #define HAVE_PW_GECOS 1
13225 EOF
13226
13227 fi
13228
13229 # test for pw_passwd in struct passwd
13230 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
13231 echo "configure:13232: checking struct passwd for pw_passwd" >&5
13232 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
13233   echo $ac_n "(cached) $ac_c" 1>&6
13234 else
13235   
13236         cat > conftest.$ac_ext <<EOF
13237 #line 13238 "configure"
13238 #include "confdefs.h"
13239 #include <pwd.h>
13240 int main() {
13241
13242         struct passwd pwd;
13243         pwd.pw_passwd = pwd.pw_name;
13244
13245 ; return 0; }
13246 EOF
13247 if { (eval echo configure:13248: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13248   rm -rf conftest*
13249   ol_cv_struct_passwd_pw_passwd=yes
13250 else
13251   echo "configure: failed program was:" >&5
13252   cat conftest.$ac_ext >&5
13253   rm -rf conftest*
13254   ol_cv_struct_passwd_pw_passwd=no
13255 fi
13256 rm -f conftest*
13257 fi
13258
13259 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
13260 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
13261         cat >> confdefs.h <<\EOF
13262 #define HAVE_PW_PASSWD 1
13263 EOF
13264
13265 fi
13266
13267
13268 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
13269 echo "configure:13270: checking if toupper() requires islower()" >&5
13270 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
13271   echo $ac_n "(cached) $ac_c" 1>&6
13272 else
13273   
13274         if test "$cross_compiling" = yes; then
13275   ol_cv_c_upper_lower=safe
13276 else
13277   cat > conftest.$ac_ext <<EOF
13278 #line 13279 "configure"
13279 #include "confdefs.h"
13280
13281 #include <ctype.h>
13282 main()
13283 {
13284         if ('C' == toupper('C'))
13285                 exit(0);
13286         else
13287                 exit(1);
13288 }
13289 EOF
13290 if { (eval echo configure:13291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13291 then
13292   ol_cv_c_upper_lower=no
13293 else
13294   echo "configure: failed program was:" >&5
13295   cat conftest.$ac_ext >&5
13296   rm -fr conftest*
13297   ol_cv_c_upper_lower=yes
13298 fi
13299 rm -fr conftest*
13300 fi
13301
13302 fi
13303
13304 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
13305 if test $ol_cv_c_upper_lower != no ; then
13306         cat >> confdefs.h <<\EOF
13307 #define C_UPPER_LOWER 1
13308 EOF
13309
13310 fi
13311
13312 echo $ac_n "checking for working const""... $ac_c" 1>&6
13313 echo "configure:13314: checking for working const" >&5
13314 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
13315   echo $ac_n "(cached) $ac_c" 1>&6
13316 else
13317   cat > conftest.$ac_ext <<EOF
13318 #line 13319 "configure"
13319 #include "confdefs.h"
13320
13321 int main() {
13322
13323 /* Ultrix mips cc rejects this.  */
13324 typedef int charset[2]; const charset x;
13325 /* SunOS 4.1.1 cc rejects this.  */
13326 char const *const *ccp;
13327 char **p;
13328 /* NEC SVR4.0.2 mips cc rejects this.  */
13329 struct point {int x, y;};
13330 static struct point const zero = {0,0};
13331 /* AIX XL C 1.02.0.0 rejects this.
13332    It does not let you subtract one const X* pointer from another in an arm
13333    of an if-expression whose if-part is not a constant expression */
13334 const char *g = "string";
13335 ccp = &g + (g ? g-g : 0);
13336 /* HPUX 7.0 cc rejects these. */
13337 ++ccp;
13338 p = (char**) ccp;
13339 ccp = (char const *const *) p;
13340 { /* SCO 3.2v4 cc rejects this.  */
13341   char *t;
13342   char const *s = 0 ? (char *) 0 : (char const *) 0;
13343
13344   *t++ = 0;
13345 }
13346 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
13347   int x[] = {25, 17};
13348   const int *foo = &x[0];
13349   ++foo;
13350 }
13351 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
13352   typedef const int *iptr;
13353   iptr p = 0;
13354   ++p;
13355 }
13356 { /* AIX XL C 1.02.0.0 rejects this saying
13357      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
13358   struct s { int j; const int *ap[3]; };
13359   struct s *b; b->j = 5;
13360 }
13361 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
13362   const int foo = 10;
13363 }
13364
13365 ; return 0; }
13366 EOF
13367 if { (eval echo configure:13368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13368   rm -rf conftest*
13369   ac_cv_c_const=yes
13370 else
13371   echo "configure: failed program was:" >&5
13372   cat conftest.$ac_ext >&5
13373   rm -rf conftest*
13374   ac_cv_c_const=no
13375 fi
13376 rm -f conftest*
13377 fi
13378
13379 echo "$ac_t""$ac_cv_c_const" 1>&6
13380 if test $ac_cv_c_const = no; then
13381   cat >> confdefs.h <<\EOF
13382 #define const 
13383 EOF
13384
13385 fi
13386
13387 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
13388 echo "configure:13389: checking if compiler understands volatile" >&5
13389 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
13390   echo $ac_n "(cached) $ac_c" 1>&6
13391 else
13392   cat > conftest.$ac_ext <<EOF
13393 #line 13394 "configure"
13394 #include "confdefs.h"
13395 int x, y, z;
13396 int main() {
13397 volatile int a; int * volatile b = x ? &y : &z;
13398       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
13399       *b = 0;
13400 ; return 0; }
13401 EOF
13402 if { (eval echo configure:13403: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13403   rm -rf conftest*
13404   ol_cv_c_volatile=yes
13405 else
13406   echo "configure: failed program was:" >&5
13407   cat conftest.$ac_ext >&5
13408   rm -rf conftest*
13409   ol_cv_c_volatile=no
13410 fi
13411 rm -f conftest*
13412 fi
13413
13414 echo "$ac_t""$ol_cv_c_volatile" 1>&6
13415   if test $ol_cv_c_volatile = yes; then
13416     : 
13417   else
13418     cat >> confdefs.h <<\EOF
13419 #define volatile 
13420 EOF
13421
13422   fi
13423  
13424
13425 if test $cross_compiling = yes ; then
13426         cat >> confdefs.h <<\EOF
13427 #define CROSS_COMPILING 1
13428 EOF
13429
13430
13431         cat >> confdefs.h <<\EOF
13432 #define LBER_INT_T long
13433 EOF
13434
13435         cat >> confdefs.h <<\EOF
13436 #define LBER_TAG_T long
13437 EOF
13438
13439         cat >> confdefs.h <<\EOF
13440 #define LBER_SOCKET_T int
13441 EOF
13442
13443
13444 else
13445         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
13446 echo "configure:13447: checking whether byte ordering is bigendian" >&5
13447 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
13448   echo $ac_n "(cached) $ac_c" 1>&6
13449 else
13450   ac_cv_c_bigendian=unknown
13451 # See if sys/param.h defines the BYTE_ORDER macro.
13452 cat > conftest.$ac_ext <<EOF
13453 #line 13454 "configure"
13454 #include "confdefs.h"
13455 #include <sys/types.h>
13456 #include <sys/param.h>
13457 int main() {
13458
13459 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
13460  bogus endian macros
13461 #endif
13462 ; return 0; }
13463 EOF
13464 if { (eval echo configure:13465: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13465   rm -rf conftest*
13466   # It does; now see whether it defined to BIG_ENDIAN or not.
13467 cat > conftest.$ac_ext <<EOF
13468 #line 13469 "configure"
13469 #include "confdefs.h"
13470 #include <sys/types.h>
13471 #include <sys/param.h>
13472 int main() {
13473
13474 #if BYTE_ORDER != BIG_ENDIAN
13475  not big endian
13476 #endif
13477 ; return 0; }
13478 EOF
13479 if { (eval echo configure:13480: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13480   rm -rf conftest*
13481   ac_cv_c_bigendian=yes
13482 else
13483   echo "configure: failed program was:" >&5
13484   cat conftest.$ac_ext >&5
13485   rm -rf conftest*
13486   ac_cv_c_bigendian=no
13487 fi
13488 rm -f conftest*
13489 else
13490   echo "configure: failed program was:" >&5
13491   cat conftest.$ac_ext >&5
13492 fi
13493 rm -f conftest*
13494 if test $ac_cv_c_bigendian = unknown; then
13495 if test "$cross_compiling" = yes; then
13496     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
13497 else
13498   cat > conftest.$ac_ext <<EOF
13499 #line 13500 "configure"
13500 #include "confdefs.h"
13501 main () {
13502   /* Are we little or big endian?  From Harbison&Steele.  */
13503   union
13504   {
13505     long l;
13506     char c[sizeof (long)];
13507   } u;
13508   u.l = 1;
13509   exit (u.c[sizeof (long) - 1] == 1);
13510 }
13511 EOF
13512 if { (eval echo configure:13513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13513 then
13514   ac_cv_c_bigendian=no
13515 else
13516   echo "configure: failed program was:" >&5
13517   cat conftest.$ac_ext >&5
13518   rm -fr conftest*
13519   ac_cv_c_bigendian=yes
13520 fi
13521 rm -fr conftest*
13522 fi
13523
13524 fi
13525 fi
13526
13527 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
13528 if test $ac_cv_c_bigendian = yes; then
13529   cat >> confdefs.h <<\EOF
13530 #define WORDS_BIGENDIAN 1
13531 EOF
13532
13533 fi
13534
13535         echo $ac_n "checking size of short""... $ac_c" 1>&6
13536 echo "configure:13537: checking size of short" >&5
13537 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
13538   echo $ac_n "(cached) $ac_c" 1>&6
13539 else
13540   if test "$cross_compiling" = yes; then
13541     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
13542 else
13543   cat > conftest.$ac_ext <<EOF
13544 #line 13545 "configure"
13545 #include "confdefs.h"
13546 #include <stdio.h>
13547 main()
13548 {
13549   FILE *f=fopen("conftestval", "w");
13550   if (!f) exit(1);
13551   fprintf(f, "%d\n", sizeof(short));
13552   exit(0);
13553 }
13554 EOF
13555 if { (eval echo configure:13556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13556 then
13557   ac_cv_sizeof_short=`cat conftestval`
13558 else
13559   echo "configure: failed program was:" >&5
13560   cat conftest.$ac_ext >&5
13561   rm -fr conftest*
13562   ac_cv_sizeof_short=0
13563 fi
13564 rm -fr conftest*
13565 fi
13566
13567 fi
13568 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
13569 cat >> confdefs.h <<EOF
13570 #define SIZEOF_SHORT $ac_cv_sizeof_short
13571 EOF
13572
13573  
13574         echo $ac_n "checking size of int""... $ac_c" 1>&6
13575 echo "configure:13576: checking size of int" >&5
13576 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
13577   echo $ac_n "(cached) $ac_c" 1>&6
13578 else
13579   if test "$cross_compiling" = yes; then
13580     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
13581 else
13582   cat > conftest.$ac_ext <<EOF
13583 #line 13584 "configure"
13584 #include "confdefs.h"
13585 #include <stdio.h>
13586 main()
13587 {
13588   FILE *f=fopen("conftestval", "w");
13589   if (!f) exit(1);
13590   fprintf(f, "%d\n", sizeof(int));
13591   exit(0);
13592 }
13593 EOF
13594 if { (eval echo configure:13595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13595 then
13596   ac_cv_sizeof_int=`cat conftestval`
13597 else
13598   echo "configure: failed program was:" >&5
13599   cat conftest.$ac_ext >&5
13600   rm -fr conftest*
13601   ac_cv_sizeof_int=0
13602 fi
13603 rm -fr conftest*
13604 fi
13605
13606 fi
13607 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
13608 cat >> confdefs.h <<EOF
13609 #define SIZEOF_INT $ac_cv_sizeof_int
13610 EOF
13611
13612  
13613         echo $ac_n "checking size of long""... $ac_c" 1>&6
13614 echo "configure:13615: checking size of long" >&5
13615 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
13616   echo $ac_n "(cached) $ac_c" 1>&6
13617 else
13618   if test "$cross_compiling" = yes; then
13619     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
13620 else
13621   cat > conftest.$ac_ext <<EOF
13622 #line 13623 "configure"
13623 #include "confdefs.h"
13624 #include <stdio.h>
13625 main()
13626 {
13627   FILE *f=fopen("conftestval", "w");
13628   if (!f) exit(1);
13629   fprintf(f, "%d\n", sizeof(long));
13630   exit(0);
13631 }
13632 EOF
13633 if { (eval echo configure:13634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13634 then
13635   ac_cv_sizeof_long=`cat conftestval`
13636 else
13637   echo "configure: failed program was:" >&5
13638   cat conftest.$ac_ext >&5
13639   rm -fr conftest*
13640   ac_cv_sizeof_long=0
13641 fi
13642 rm -fr conftest*
13643 fi
13644
13645 fi
13646 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
13647 cat >> confdefs.h <<EOF
13648 #define SIZEOF_LONG $ac_cv_sizeof_long
13649 EOF
13650
13651
13652
13653         if test "$ac_cv_sizeof_int" -lt 4 ; then
13654                 echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
13655
13656                 cat >> confdefs.h <<\EOF
13657 #define LBER_INT_T long
13658 EOF
13659
13660                 cat >> confdefs.h <<\EOF
13661 #define LBER_TAG_T long
13662 EOF
13663
13664                 cat >> confdefs.h <<\EOF
13665 #define LBER_SOCKET_T int
13666 EOF
13667
13668         else
13669                 cat >> confdefs.h <<\EOF
13670 #define LBER_INT_T int
13671 EOF
13672
13673                 cat >> confdefs.h <<\EOF
13674 #define LBER_TAG_T long
13675 EOF
13676
13677                 cat >> confdefs.h <<\EOF
13678 #define LBER_SOCKET_T int
13679 EOF
13680
13681         fi
13682 fi
13683
13684 cat >> confdefs.h <<\EOF
13685 #define LBER_LEN_T long
13686 EOF
13687
13688
13689 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
13690 echo "configure:13691: checking for 8-bit clean memcmp" >&5
13691 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
13692   echo $ac_n "(cached) $ac_c" 1>&6
13693 else
13694   if test "$cross_compiling" = yes; then
13695   ac_cv_func_memcmp_clean=no
13696 else
13697   cat > conftest.$ac_ext <<EOF
13698 #line 13699 "configure"
13699 #include "confdefs.h"
13700
13701 main()
13702 {
13703   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
13704   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
13705 }
13706
13707 EOF
13708 if { (eval echo configure:13709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13709 then
13710   ac_cv_func_memcmp_clean=yes
13711 else
13712   echo "configure: failed program was:" >&5
13713   cat conftest.$ac_ext >&5
13714   rm -fr conftest*
13715   ac_cv_func_memcmp_clean=no
13716 fi
13717 rm -fr conftest*
13718 fi
13719
13720 fi
13721
13722 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
13723 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
13724
13725 echo $ac_n "checking for strftime""... $ac_c" 1>&6
13726 echo "configure:13727: checking for strftime" >&5
13727 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
13728   echo $ac_n "(cached) $ac_c" 1>&6
13729 else
13730   cat > conftest.$ac_ext <<EOF
13731 #line 13732 "configure"
13732 #include "confdefs.h"
13733 /* System header to define __stub macros and hopefully few prototypes,
13734     which can conflict with char strftime(); below.  */
13735 #include <assert.h>
13736 /* Override any gcc2 internal prototype to avoid an error.  */
13737 /* We use char because int might match the return type of a gcc2
13738     builtin and then its argument prototype would still apply.  */
13739 char strftime();
13740 char (*f)();
13741
13742 int main() {
13743
13744 /* The GNU C library defines this for functions which it implements
13745     to always fail with ENOSYS.  Some functions are actually named
13746     something starting with __ and the normal name is an alias.  */
13747 #if defined (__stub_strftime) || defined (__stub___strftime)
13748 choke me
13749 #else
13750 f = strftime;
13751 #endif
13752
13753 ; return 0; }
13754 EOF
13755 if { (eval echo configure:13756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13756   rm -rf conftest*
13757   eval "ac_cv_func_strftime=yes"
13758 else
13759   echo "configure: failed program was:" >&5
13760   cat conftest.$ac_ext >&5
13761   rm -rf conftest*
13762   eval "ac_cv_func_strftime=no"
13763 fi
13764 rm -f conftest*
13765 fi
13766
13767 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
13768   echo "$ac_t""yes" 1>&6
13769   cat >> confdefs.h <<\EOF
13770 #define HAVE_STRFTIME 1
13771 EOF
13772
13773 else
13774   echo "$ac_t""no" 1>&6
13775 # strftime is in -lintl on SCO UNIX.
13776 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
13777 echo "configure:13778: checking for strftime in -lintl" >&5
13778 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
13779 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13780   echo $ac_n "(cached) $ac_c" 1>&6
13781 else
13782   ac_save_LIBS="$LIBS"
13783 LIBS="-lintl  $LIBS"
13784 cat > conftest.$ac_ext <<EOF
13785 #line 13786 "configure"
13786 #include "confdefs.h"
13787 /* Override any gcc2 internal prototype to avoid an error.  */
13788 /* We use char because int might match the return type of a gcc2
13789     builtin and then its argument prototype would still apply.  */
13790 char strftime();
13791
13792 int main() {
13793 strftime()
13794 ; return 0; }
13795 EOF
13796 if { (eval echo configure:13797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13797   rm -rf conftest*
13798   eval "ac_cv_lib_$ac_lib_var=yes"
13799 else
13800   echo "configure: failed program was:" >&5
13801   cat conftest.$ac_ext >&5
13802   rm -rf conftest*
13803   eval "ac_cv_lib_$ac_lib_var=no"
13804 fi
13805 rm -f conftest*
13806 LIBS="$ac_save_LIBS"
13807
13808 fi
13809 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13810   echo "$ac_t""yes" 1>&6
13811   cat >> confdefs.h <<\EOF
13812 #define HAVE_STRFTIME 1
13813 EOF
13814
13815 LIBS="-lintl $LIBS"
13816 else
13817   echo "$ac_t""no" 1>&6
13818 fi
13819
13820 fi
13821
13822
13823 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
13824 echo "configure:13825: checking for inet_aton()" >&5
13825 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
13826   echo $ac_n "(cached) $ac_c" 1>&6
13827 else
13828   cat > conftest.$ac_ext <<EOF
13829 #line 13830 "configure"
13830 #include "confdefs.h"
13831
13832 #ifdef HAVE_SYS_TYPES_H
13833 #       include <sys/types.h>
13834 #endif
13835 #ifdef HAVE_SYS_SOCKET_H
13836 #       include <sys/socket.h>
13837 #       ifdef HAVE_SYS_SELECT_H
13838 #               include <sys/select.h>
13839 #       endif
13840 #       include <netinet/in.h>
13841 #       ifdef HAVE_ARPA_INET_H
13842 #               include <arpa/inet.h>
13843 #       endif
13844 #endif
13845
13846 int main() {
13847 struct in_addr in;
13848 int rc = inet_aton( "255.255.255.255", &in );
13849 ; return 0; }
13850 EOF
13851 if { (eval echo configure:13852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13852   rm -rf conftest*
13853   ol_cv_func_inet_aton=yes
13854 else
13855   echo "configure: failed program was:" >&5
13856   cat conftest.$ac_ext >&5
13857   rm -rf conftest*
13858   ol_cv_func_inet_aton=no
13859 fi
13860 rm -f conftest*
13861 fi
13862
13863 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
13864   if test $ol_cv_func_inet_aton != no; then
13865     cat >> confdefs.h <<\EOF
13866 #define HAVE_INET_ATON 1
13867 EOF
13868
13869   fi
13870  
13871
13872 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
13873 echo "configure:13874: checking for vprintf" >&5
13874 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
13875   echo $ac_n "(cached) $ac_c" 1>&6
13876 else
13877   cat > conftest.$ac_ext <<EOF
13878 #line 13879 "configure"
13879 #include "confdefs.h"
13880 /* System header to define __stub macros and hopefully few prototypes,
13881     which can conflict with char vprintf(); below.  */
13882 #include <assert.h>
13883 /* Override any gcc2 internal prototype to avoid an error.  */
13884 /* We use char because int might match the return type of a gcc2
13885     builtin and then its argument prototype would still apply.  */
13886 char vprintf();
13887 char (*f)();
13888
13889 int main() {
13890
13891 /* The GNU C library defines this for functions which it implements
13892     to always fail with ENOSYS.  Some functions are actually named
13893     something starting with __ and the normal name is an alias.  */
13894 #if defined (__stub_vprintf) || defined (__stub___vprintf)
13895 choke me
13896 #else
13897 f = vprintf;
13898 #endif
13899
13900 ; return 0; }
13901 EOF
13902 if { (eval echo configure:13903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13903   rm -rf conftest*
13904   eval "ac_cv_func_vprintf=yes"
13905 else
13906   echo "configure: failed program was:" >&5
13907   cat conftest.$ac_ext >&5
13908   rm -rf conftest*
13909   eval "ac_cv_func_vprintf=no"
13910 fi
13911 rm -f conftest*
13912 fi
13913
13914 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
13915   echo "$ac_t""yes" 1>&6
13916   cat >> confdefs.h <<\EOF
13917 #define HAVE_VPRINTF 1
13918 EOF
13919
13920 else
13921   echo "$ac_t""no" 1>&6
13922 fi
13923
13924 if test "$ac_cv_func_vprintf" != yes; then
13925 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
13926 echo "configure:13927: checking for _doprnt" >&5
13927 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
13928   echo $ac_n "(cached) $ac_c" 1>&6
13929 else
13930   cat > conftest.$ac_ext <<EOF
13931 #line 13932 "configure"
13932 #include "confdefs.h"
13933 /* System header to define __stub macros and hopefully few prototypes,
13934     which can conflict with char _doprnt(); below.  */
13935 #include <assert.h>
13936 /* Override any gcc2 internal prototype to avoid an error.  */
13937 /* We use char because int might match the return type of a gcc2
13938     builtin and then its argument prototype would still apply.  */
13939 char _doprnt();
13940 char (*f)();
13941
13942 int main() {
13943
13944 /* The GNU C library defines this for functions which it implements
13945     to always fail with ENOSYS.  Some functions are actually named
13946     something starting with __ and the normal name is an alias.  */
13947 #if defined (__stub__doprnt) || defined (__stub____doprnt)
13948 choke me
13949 #else
13950 f = _doprnt;
13951 #endif
13952
13953 ; return 0; }
13954 EOF
13955 if { (eval echo configure:13956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13956   rm -rf conftest*
13957   eval "ac_cv_func__doprnt=yes"
13958 else
13959   echo "configure: failed program was:" >&5
13960   cat conftest.$ac_ext >&5
13961   rm -rf conftest*
13962   eval "ac_cv_func__doprnt=no"
13963 fi
13964 rm -f conftest*
13965 fi
13966
13967 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
13968   echo "$ac_t""yes" 1>&6
13969   cat >> confdefs.h <<\EOF
13970 #define HAVE_DOPRNT 1
13971 EOF
13972
13973 else
13974   echo "$ac_t""no" 1>&6
13975 fi
13976
13977 fi
13978
13979
13980 if test $ac_cv_func_vprintf = yes ; then
13981                 for ac_func in vsnprintf vsprintf
13982 do
13983 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
13984 echo "configure:13985: checking for $ac_func" >&5
13985 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
13986   echo $ac_n "(cached) $ac_c" 1>&6
13987 else
13988   cat > conftest.$ac_ext <<EOF
13989 #line 13990 "configure"
13990 #include "confdefs.h"
13991 /* System header to define __stub macros and hopefully few prototypes,
13992     which can conflict with char $ac_func(); below.  */
13993 #include <assert.h>
13994 /* Override any gcc2 internal prototype to avoid an error.  */
13995 /* We use char because int might match the return type of a gcc2
13996     builtin and then its argument prototype would still apply.  */
13997 char $ac_func();
13998 char (*f)();
13999
14000 int main() {
14001
14002 /* The GNU C library defines this for functions which it implements
14003     to always fail with ENOSYS.  Some functions are actually named
14004     something starting with __ and the normal name is an alias.  */
14005 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14006 choke me
14007 #else
14008 f = $ac_func;
14009 #endif
14010
14011 ; return 0; }
14012 EOF
14013 if { (eval echo configure:14014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14014   rm -rf conftest*
14015   eval "ac_cv_func_$ac_func=yes"
14016 else
14017   echo "configure: failed program was:" >&5
14018   cat conftest.$ac_ext >&5
14019   rm -rf conftest*
14020   eval "ac_cv_func_$ac_func=no"
14021 fi
14022 rm -f conftest*
14023 fi
14024
14025 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14026   echo "$ac_t""yes" 1>&6
14027     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14028   cat >> confdefs.h <<EOF
14029 #define $ac_tr_func 1
14030 EOF
14031  
14032 else
14033   echo "$ac_t""no" 1>&6
14034 fi
14035 done
14036
14037 fi
14038
14039 for ac_func in \
14040         bcopy                   \
14041         closesocket             \
14042         endgrent                \
14043         endpwent                \
14044         flock                   \
14045         getdtablesize   \
14046         getgrgid                \
14047         gethostname             \
14048         getpass                 \
14049         getpwuid                \
14050         getpwnam                \
14051         getspnam                \
14052         gettimeofday    \
14053         initgroups              \
14054         lockf                   \
14055         memcpy                  \
14056         memmove                 \
14057         mkstemp                 \
14058         pipe                    \
14059         read                    \
14060         recv                    \
14061         recvfrom                \
14062         setpwfile               \
14063         setgid                  \
14064         setegid                 \
14065         setsid                  \
14066         setuid                  \
14067         seteuid                 \
14068         sigaction               \
14069         signal                  \
14070         sigset                  \
14071         snprintf                \
14072         strdup                  \
14073         strerror                \
14074         strpbrk                 \
14075         strrchr                 \
14076         strsep                  \
14077         strstr                  \
14078         strtol                  \
14079         strtoul                 \
14080         strspn                  \
14081         sysconf                 \
14082         waitpid                 \
14083         wait4                   \
14084         write                   \
14085         send                    \
14086         sendto                  \
14087
14088 do
14089 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14090 echo "configure:14091: checking for $ac_func" >&5
14091 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14092   echo $ac_n "(cached) $ac_c" 1>&6
14093 else
14094   cat > conftest.$ac_ext <<EOF
14095 #line 14096 "configure"
14096 #include "confdefs.h"
14097 /* System header to define __stub macros and hopefully few prototypes,
14098     which can conflict with char $ac_func(); below.  */
14099 #include <assert.h>
14100 /* Override any gcc2 internal prototype to avoid an error.  */
14101 /* We use char because int might match the return type of a gcc2
14102     builtin and then its argument prototype would still apply.  */
14103 char $ac_func();
14104 char (*f)();
14105
14106 int main() {
14107
14108 /* The GNU C library defines this for functions which it implements
14109     to always fail with ENOSYS.  Some functions are actually named
14110     something starting with __ and the normal name is an alias.  */
14111 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14112 choke me
14113 #else
14114 f = $ac_func;
14115 #endif
14116
14117 ; return 0; }
14118 EOF
14119 if { (eval echo configure:14120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14120   rm -rf conftest*
14121   eval "ac_cv_func_$ac_func=yes"
14122 else
14123   echo "configure: failed program was:" >&5
14124   cat conftest.$ac_ext >&5
14125   rm -rf conftest*
14126   eval "ac_cv_func_$ac_func=no"
14127 fi
14128 rm -f conftest*
14129 fi
14130
14131 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14132   echo "$ac_t""yes" 1>&6
14133     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14134   cat >> confdefs.h <<EOF
14135 #define $ac_tr_func 1
14136 EOF
14137  
14138 else
14139   echo "$ac_t""no" 1>&6
14140 fi
14141 done
14142
14143
14144 for ac_func in getopt tempnam
14145 do
14146 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14147 echo "configure:14148: checking for $ac_func" >&5
14148 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14149   echo $ac_n "(cached) $ac_c" 1>&6
14150 else
14151   cat > conftest.$ac_ext <<EOF
14152 #line 14153 "configure"
14153 #include "confdefs.h"
14154 /* System header to define __stub macros and hopefully few prototypes,
14155     which can conflict with char $ac_func(); below.  */
14156 #include <assert.h>
14157 /* Override any gcc2 internal prototype to avoid an error.  */
14158 /* We use char because int might match the return type of a gcc2
14159     builtin and then its argument prototype would still apply.  */
14160 char $ac_func();
14161 char (*f)();
14162
14163 int main() {
14164
14165 /* The GNU C library defines this for functions which it implements
14166     to always fail with ENOSYS.  Some functions are actually named
14167     something starting with __ and the normal name is an alias.  */
14168 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14169 choke me
14170 #else
14171 f = $ac_func;
14172 #endif
14173
14174 ; return 0; }
14175 EOF
14176 if { (eval echo configure:14177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14177   rm -rf conftest*
14178   eval "ac_cv_func_$ac_func=yes"
14179 else
14180   echo "configure: failed program was:" >&5
14181   cat conftest.$ac_ext >&5
14182   rm -rf conftest*
14183   eval "ac_cv_func_$ac_func=no"
14184 fi
14185 rm -f conftest*
14186 fi
14187
14188 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14189   echo "$ac_t""yes" 1>&6
14190     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14191   cat >> confdefs.h <<EOF
14192 #define $ac_tr_func 1
14193 EOF
14194  
14195 else
14196   echo "$ac_t""no" 1>&6
14197 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
14198 fi
14199 done
14200
14201
14202
14203 # Check Configuration
14204 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
14205 echo "configure:14206: checking declaration of sys_errlist" >&5
14206 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
14207   echo $ac_n "(cached) $ac_c" 1>&6
14208 else
14209   
14210         cat > conftest.$ac_ext <<EOF
14211 #line 14212 "configure"
14212 #include "confdefs.h"
14213
14214 #include <stdio.h>
14215 #include <sys/types.h>
14216 #include <errno.h> 
14217 int main() {
14218 char *c = (char *) *sys_errlist
14219 ; return 0; }
14220 EOF
14221 if { (eval echo configure:14222: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14222   rm -rf conftest*
14223   ol_cv_dcl_sys_errlist=yes
14224         ol_cv_have_sys_errlist=yes
14225 else
14226   echo "configure: failed program was:" >&5
14227   cat conftest.$ac_ext >&5
14228   rm -rf conftest*
14229   ol_cv_dcl_sys_errlist=no
14230 fi
14231 rm -f conftest*
14232 fi
14233
14234 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
14235 #
14236 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
14237 if test $ol_cv_dcl_sys_errlist = no ; then
14238         cat >> confdefs.h <<\EOF
14239 #define DECL_SYS_ERRLIST 1
14240 EOF
14241
14242
14243         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
14244 echo "configure:14245: checking existence of sys_errlist" >&5
14245 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
14246   echo $ac_n "(cached) $ac_c" 1>&6
14247 else
14248   
14249                 cat > conftest.$ac_ext <<EOF
14250 #line 14251 "configure"
14251 #include "confdefs.h"
14252 #include <errno.h>
14253 int main() {
14254 char *c = (char *) *sys_errlist
14255 ; return 0; }
14256 EOF
14257 if { (eval echo configure:14258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14258   rm -rf conftest*
14259   ol_cv_have_sys_errlist=yes
14260 else
14261   echo "configure: failed program was:" >&5
14262   cat conftest.$ac_ext >&5
14263   rm -rf conftest*
14264   ol_cv_have_sys_errlist=no
14265 fi
14266 rm -f conftest*
14267 fi
14268
14269 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
14270 fi
14271 if test $ol_cv_have_sys_errlist = yes ; then
14272         cat >> confdefs.h <<\EOF
14273 #define HAVE_SYS_ERRLIST 1
14274 EOF
14275
14276 fi
14277
14278
14279
14280 if test "$ol_enable_debug" != no ; then
14281         cat >> confdefs.h <<\EOF
14282 #define LDAP_DEBUG 1
14283 EOF
14284
14285 fi
14286 if test "$ol_enable_syslog" = yes ; then
14287         cat >> confdefs.h <<\EOF
14288 #define LDAP_SYSLOG 1
14289 EOF
14290
14291 fi
14292 if test "$ol_enable_libui" = yes ; then
14293         cat >> confdefs.h <<\EOF
14294 #define LDAP_LIBUI 1
14295 EOF
14296
14297 fi
14298 if test "$ol_enable_cache" = no ; then
14299         cat >> confdefs.h <<\EOF
14300 #define LDAP_NOCACHE 1
14301 EOF
14302
14303 fi
14304 if test "$ol_enable_dns" != no ; then
14305         cat >> confdefs.h <<\EOF
14306 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS LDAP_VENDOR_VERSION
14307 EOF
14308
14309 fi
14310 if test "$ol_enable_proctitle" != no ; then
14311         cat >> confdefs.h <<\EOF
14312 #define LDAP_PROCTITLE 1
14313 EOF
14314
14315 fi
14316 if test "$ol_enable_referrals" != no ; then
14317         cat >> confdefs.h <<\EOF
14318 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
14319 EOF
14320
14321 fi
14322 if test "$ol_enable_cldap" != no ; then
14323         cat >> confdefs.h <<\EOF
14324 #define LDAP_CONNECTIONLESS 1
14325 EOF
14326
14327 fi
14328
14329 if test "$ol_enable_crypt" != no ; then
14330         cat >> confdefs.h <<\EOF
14331 #define SLAPD_CRYPT 1
14332 EOF
14333
14334 fi
14335 if test "$ol_enable_cleartext" != no ; then
14336         cat >> confdefs.h <<\EOF
14337 #define SLAPD_CLEARTEXT 1
14338 EOF
14339
14340 fi
14341 if test "$ol_enable_multimaster" != no ; then
14342         cat >> confdefs.h <<\EOF
14343 #define SLAPD_MULTIMASTER 1
14344 EOF
14345
14346 fi
14347 if test "$ol_enable_phonetic" != no ; then
14348         cat >> confdefs.h <<\EOF
14349 #define SLAPD_PHONETIC 1
14350 EOF
14351
14352 fi
14353 if test "$ol_enable_rlookups" != no ; then
14354         cat >> confdefs.h <<\EOF
14355 #define SLAPD_RLOOKUPS 1
14356 EOF
14357
14358 fi
14359 if test "$ol_enable_aci" != no ; then
14360         cat >> confdefs.h <<\EOF
14361 #define SLAPD_ACI_ENABLED 1
14362 EOF
14363
14364 fi
14365 if test "$ol_enable_discreteaci" != no ; then
14366         cat >> confdefs.h <<\EOF
14367 #define SLAPD_ACI_DISCRETE_RIGHTS 1
14368 EOF
14369
14370 fi
14371
14372 if test "$ol_link_modules" != no ; then
14373         cat >> confdefs.h <<\EOF
14374 #define SLAPD_MODULES 1
14375 EOF
14376
14377         BUILD_SLAPD=yes
14378         MODULES_LIBS=-lltdl
14379         SLAPD_MODULES_LDFLAGS="-dlopen self"
14380 fi
14381
14382 if test "$ol_link_bdb2" != no ; then
14383         cat >> confdefs.h <<\EOF
14384 #define SLAPD_BDB2 1
14385 EOF
14386
14387         BUILD_SLAPD=yes
14388         BUILD_BDB2=yes
14389         if test "$ol_with_bdb2_module" != static ; then
14390                 cat >> confdefs.h <<\EOF
14391 #define SLAPD_BDB2_DYNAMIC 1
14392 EOF
14393
14394                 BUILD_BDB2=mod
14395                 BUILD_BDB2_DYNAMIC=shared
14396                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-bdb2/back_bdb2.la"
14397         fi
14398 fi
14399
14400 if test "$ol_enable_ldap" != no ; then
14401         cat >> confdefs.h <<\EOF
14402 #define SLAPD_LDAP 1
14403 EOF
14404
14405         BUILD_SLAPD=yes
14406         BUILD_LDAP=yes
14407         if test "$ol_with_ldap_module" != static ; then
14408                 cat >> confdefs.h <<\EOF
14409 #define SLAPD_LDAP_DYNAMIC 1
14410 EOF
14411
14412                 BUILD_LDAP=mod
14413                 BUILD_LDAP_DYNAMIC=shared
14414                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
14415         fi
14416 fi
14417
14418 if test "$ol_link_ldbm" != no ; then
14419         cat >> confdefs.h <<\EOF
14420 #define SLAPD_LDBM 1
14421 EOF
14422
14423         BUILD_SLAPD=yes
14424         BUILD_LDBM=yes
14425         if test "$ol_with_ldbm_module" != static ; then
14426                 cat >> confdefs.h <<\EOF
14427 #define SLAPD_LDBM_DYNAMIC 1
14428 EOF
14429
14430                 BUILD_LDBM=mod
14431                 BUILD_LDBM_DYNAMIC=shared
14432                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
14433         fi
14434 fi
14435
14436 if test "$ol_enable_passwd" != no ; then
14437         cat >> confdefs.h <<\EOF
14438 #define SLAPD_PASSWD 1
14439 EOF
14440
14441         BUILD_SLAPD=yes
14442         BUILD_PASSWD=yes
14443         if test "$ol_with_passwd_module" != static ; then
14444                 cat >> confdefs.h <<\EOF
14445 #define SLAPD_PASSWD_DYNAMIC 1
14446 EOF
14447
14448                 BUILD_PASSWD=mod
14449                 BUILD_PASSWD_DYNAMIC=shared
14450                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
14451         fi
14452 fi
14453
14454 if test "$ol_link_perl" != no ; then
14455         cat >> confdefs.h <<\EOF
14456 #define SLAPD_PERL 1
14457 EOF
14458
14459         BUILD_SLAPD=yes
14460         BUILD_PERL=yes
14461         if test "$ol_with_perl_module" != static ; then
14462                 cat >> confdefs.h <<\EOF
14463 #define SLAPD_PERL_DYNAMIC 1
14464 EOF
14465
14466                 BUILD_PERL=mod
14467                 BUILD_PERL_DYNAMIC=shared
14468                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-perl/back_perl.la"
14469         fi
14470 fi
14471
14472 if test "$ol_enable_shell" != no ; then
14473         cat >> confdefs.h <<\EOF
14474 #define SLAPD_SHELL 1
14475 EOF
14476
14477         BUILD_SLAPD=yes
14478         BUILD_SHELL=yes
14479         if test "$ol_with_shell_module" != static ; then
14480                 cat >> confdefs.h <<\EOF
14481 #define SLAPD_SHELL_DYNAMIC 1
14482 EOF
14483
14484                 BUILD_SHELL=mod
14485                 BUILD_SHELL_DYNAMIC=shared
14486                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
14487         fi
14488 fi
14489
14490 if test "$ol_enable_tcl" != no ; then
14491         cat >> confdefs.h <<\EOF
14492 #define SLAPD_TCL 1
14493 EOF
14494
14495         BUILD_SLAPD=yes
14496         BUILD_TCL=yes
14497         if test "$ol_with_tcl_module" != static; then
14498                 cat >> confdefs.h <<\EOF
14499 #define SLAPD_TCL_DYNAMIC 1
14500 EOF
14501
14502                 BUILD_TCL=mod
14503                 BUILD_TCL_DYNAMIC=shared
14504                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-tcl/back_tcl.la"
14505         fi
14506 fi
14507
14508 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
14509         $BUILD_SLAPD = yes ; then
14510         BUILD_SLURPD=yes
14511 fi
14512
14513 if test "$ol_link_isode" != no ; then
14514         BUILD_LDAPD=yes
14515 fi
14516
14517
14518
14519
14520   
14521   
14522   
14523   
14524   
14525   
14526   
14527   
14528   
14529   
14530   
14531   
14532   
14533   
14534   
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561 trap '' 1 2 15
14562
14563 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
14564
14565 test "x$prefix" = xNONE && prefix=$ac_default_prefix
14566 # Let make expand exec_prefix.
14567 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
14568
14569 # Any assignment to VPATH causes Sun make to only execute
14570 # the first set of double-colon rules, so remove it if not needed.
14571 # If there is a colon in the path, we need to keep it.
14572 if test "x$srcdir" = x.; then
14573   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
14574 fi
14575
14576 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
14577
14578 DEFS=-DHAVE_CONFIG_H
14579
14580 # Without the "./", some shells look in PATH for config.status.
14581 : ${CONFIG_STATUS=./config.status}
14582
14583 echo creating $CONFIG_STATUS
14584 rm -f $CONFIG_STATUS
14585 cat > $CONFIG_STATUS <<EOF
14586 #! /bin/sh
14587 # Generated automatically by configure.
14588 # Run this file to recreate the current configuration.
14589 # This directory was configured as follows,
14590 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
14591 #
14592 # $0 $ac_configure_args
14593 #
14594 # Compiler output produced by configure, useful for debugging
14595 # configure, is in ./config.log if it exists.
14596
14597 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
14598 for ac_option
14599 do
14600   case "\$ac_option" in
14601   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
14602     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
14603     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
14604   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
14605     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
14606     exit 0 ;;
14607   -help | --help | --hel | --he | --h)
14608     echo "\$ac_cs_usage"; exit 0 ;;
14609   *) echo "\$ac_cs_usage"; exit 1 ;;
14610   esac
14611 done
14612
14613 ac_given_srcdir=$srcdir
14614 ac_given_INSTALL="$INSTALL"
14615
14616 trap 'rm -fr `echo "\
14617 Makefile:build/top.mk:Makefile.in:build/dir.mk \
14618 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
14619 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
14620 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
14621 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
14622 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
14623 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
14624 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
14625 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
14626 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
14627 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
14628 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
14629 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
14630 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
14631 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
14632 include/Makefile:build/top.mk:include/Makefile.in \
14633 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
14634 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
14635 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
14636 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
14637 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
14638 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
14639 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
14640 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
14641 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
14642 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
14643 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
14644 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/mod.mk \
14645 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
14646 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
14647 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
14648 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
14649 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
14650 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
14651 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
14652 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
14653 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
14654 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
14655 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
14656 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
14657 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
14658 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
14659  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
14660 EOF
14661 cat >> $CONFIG_STATUS <<EOF
14662
14663 # Protect against being on the right side of a sed subst in config.status.
14664 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
14665  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
14666 $ac_vpsub
14667 $extrasub
14668 s%@SHELL@%$SHELL%g
14669 s%@CFLAGS@%$CFLAGS%g
14670 s%@CPPFLAGS@%$CPPFLAGS%g
14671 s%@CXXFLAGS@%$CXXFLAGS%g
14672 s%@FFLAGS@%$FFLAGS%g
14673 s%@DEFS@%$DEFS%g
14674 s%@LDFLAGS@%$LDFLAGS%g
14675 s%@LIBS@%$LIBS%g
14676 s%@exec_prefix@%$exec_prefix%g
14677 s%@prefix@%$prefix%g
14678 s%@program_transform_name@%$program_transform_name%g
14679 s%@bindir@%$bindir%g
14680 s%@sbindir@%$sbindir%g
14681 s%@libexecdir@%$libexecdir%g
14682 s%@datadir@%$datadir%g
14683 s%@sysconfdir@%$sysconfdir%g
14684 s%@sharedstatedir@%$sharedstatedir%g
14685 s%@localstatedir@%$localstatedir%g
14686 s%@libdir@%$libdir%g
14687 s%@includedir@%$includedir%g
14688 s%@oldincludedir@%$oldincludedir%g
14689 s%@infodir@%$infodir%g
14690 s%@mandir@%$mandir%g
14691 s%@host@%$host%g
14692 s%@host_alias@%$host_alias%g
14693 s%@host_cpu@%$host_cpu%g
14694 s%@host_vendor@%$host_vendor%g
14695 s%@host_os@%$host_os%g
14696 s%@target@%$target%g
14697 s%@target_alias@%$target_alias%g
14698 s%@target_cpu@%$target_cpu%g
14699 s%@target_vendor@%$target_vendor%g
14700 s%@target_os@%$target_os%g
14701 s%@build@%$build%g
14702 s%@build_alias@%$build_alias%g
14703 s%@build_cpu@%$build_cpu%g
14704 s%@build_vendor@%$build_vendor%g
14705 s%@build_os@%$build_os%g
14706 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
14707 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
14708 s%@INSTALL_DATA@%$INSTALL_DATA%g
14709 s%@PACKAGE@%$PACKAGE%g
14710 s%@VERSION@%$VERSION%g
14711 s%@ACLOCAL@%$ACLOCAL%g
14712 s%@AUTOCONF@%$AUTOCONF%g
14713 s%@AUTOMAKE@%$AUTOMAKE%g
14714 s%@AUTOHEADER@%$AUTOHEADER%g
14715 s%@MAKEINFO@%$MAKEINFO%g
14716 s%@install_sh@%$install_sh%g
14717 s%@AMTAR@%$AMTAR%g
14718 s%@AWK@%$AWK%g
14719 s%@AMTARFLAGS@%$AMTARFLAGS%g
14720 s%@SET_MAKE@%$SET_MAKE%g
14721 s%@top_builddir@%$top_builddir%g
14722 s%@ldap_subdir@%$ldap_subdir%g
14723 s%@CC@%$CC%g
14724 s%@RANLIB@%$RANLIB%g
14725 s%@LD@%$LD%g
14726 s%@NM@%$NM%g
14727 s%@LN_S@%$LN_S%g
14728 s%@LIBTOOL@%$LIBTOOL%g
14729 s%@LN_H@%$LN_H%g
14730 s%@SENDMAIL@%$SENDMAIL%g
14731 s%@EDITOR@%$EDITOR%g
14732 s%@FINGER@%$FINGER%g
14733 s%@PERLBIN@%$PERLBIN%g
14734 s%@CPP@%$CPP%g
14735 s%@EXEEXT@%$EXEEXT%g
14736 s%@OBJEXT@%$OBJEXT%g
14737 s%@OL_MKDEP@%$OL_MKDEP%g
14738 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
14739 s%@PEPSY@%$PEPSY%g
14740 s%@LIBOBJS@%$LIBOBJS%g
14741 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
14742 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
14743 s%@BUILD_BDB2@%$BUILD_BDB2%g
14744 s%@BUILD_LDAP@%$BUILD_LDAP%g
14745 s%@BUILD_LDBM@%$BUILD_LDBM%g
14746 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
14747 s%@BUILD_PERL@%$BUILD_PERL%g
14748 s%@BUILD_QUIPU@%$BUILD_QUIPU%g
14749 s%@BUILD_SHELL@%$BUILD_SHELL%g
14750 s%@BUILD_TCL@%$BUILD_TCL%g
14751 s%@BUILD_BDB2_DYNAMIC@%$BUILD_BDB2_DYNAMIC%g
14752 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
14753 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
14754 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
14755 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
14756 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
14757 s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
14758 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
14759 s%@LDAP_LIBS@%$LDAP_LIBS%g
14760 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
14761 s%@LDIF_LIBS@%$LDIF_LIBS%g
14762 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
14763 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
14764 s%@LDBM_LIBS@%$LDBM_LIBS%g
14765 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
14766 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
14767 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
14768 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
14769 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
14770 s%@SLAPD_PERL_CPPFLAGS@%$SLAPD_PERL_CPPFLAGS%g
14771 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
14772 s%@KRB_LIBS@%$KRB_LIBS%g
14773 s%@READLINE_LIBS@%$READLINE_LIBS%g
14774 s%@SASL_LIBS@%$SASL_LIBS%g
14775 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
14776 s%@TLS_LIBS@%$TLS_LIBS%g
14777 s%@MODULES_LIBS@%$MODULES_LIBS%g
14778
14779 CEOF
14780 EOF
14781
14782 cat >> $CONFIG_STATUS <<\EOF
14783
14784 # Split the substitutions into bite-sized pieces for seds with
14785 # small command number limits, like on Digital OSF/1 and HP-UX.
14786 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
14787 ac_file=1 # Number of current file.
14788 ac_beg=1 # First line for current file.
14789 ac_end=$ac_max_sed_cmds # Line after last line for current file.
14790 ac_more_lines=:
14791 ac_sed_cmds=""
14792 while $ac_more_lines; do
14793   if test $ac_beg -gt 1; then
14794     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
14795   else
14796     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
14797   fi
14798   if test ! -s conftest.s$ac_file; then
14799     ac_more_lines=false
14800     rm -f conftest.s$ac_file
14801   else
14802     if test -z "$ac_sed_cmds"; then
14803       ac_sed_cmds="sed -f conftest.s$ac_file"
14804     else
14805       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
14806     fi
14807     ac_file=`expr $ac_file + 1`
14808     ac_beg=$ac_end
14809     ac_end=`expr $ac_end + $ac_max_sed_cmds`
14810   fi
14811 done
14812 if test -z "$ac_sed_cmds"; then
14813   ac_sed_cmds=cat
14814 fi
14815 EOF
14816
14817 cat >> $CONFIG_STATUS <<EOF
14818
14819 CONFIG_FILES=\${CONFIG_FILES-"\
14820 Makefile:build/top.mk:Makefile.in:build/dir.mk \
14821 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
14822 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
14823 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
14824 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
14825 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
14826 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
14827 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
14828 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
14829 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
14830 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
14831 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
14832 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
14833 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
14834 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
14835 include/Makefile:build/top.mk:include/Makefile.in \
14836 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
14837 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
14838 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
14839 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
14840 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
14841 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
14842 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
14843 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
14844 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
14845 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
14846 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
14847 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/mod.mk \
14848 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
14849 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
14850 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
14851 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
14852 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
14853 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
14854 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
14855 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
14856 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
14857 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
14858 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
14859 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
14860 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
14861 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
14862 "}
14863 EOF
14864 cat >> $CONFIG_STATUS <<\EOF
14865 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
14866   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
14867   case "$ac_file" in
14868   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
14869        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
14870   *) ac_file_in="${ac_file}.in" ;;
14871   esac
14872
14873   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
14874
14875   # Remove last slash and all that follows it.  Not all systems have dirname.
14876   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
14877   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
14878     # The file is in a subdirectory.
14879     test ! -d "$ac_dir" && mkdir "$ac_dir"
14880     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
14881     # A "../" for each directory in $ac_dir_suffix.
14882     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
14883   else
14884     ac_dir_suffix= ac_dots=
14885   fi
14886
14887   case "$ac_given_srcdir" in
14888   .)  srcdir=.
14889       if test -z "$ac_dots"; then top_srcdir=.
14890       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
14891   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
14892   *) # Relative path.
14893     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
14894     top_srcdir="$ac_dots$ac_given_srcdir" ;;
14895   esac
14896
14897   case "$ac_given_INSTALL" in
14898   [/$]*) INSTALL="$ac_given_INSTALL" ;;
14899   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
14900   esac
14901
14902   echo creating "$ac_file"
14903   rm -f "$ac_file"
14904   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
14905   case "$ac_file" in
14906   *Makefile*) ac_comsub="1i\\
14907 # $configure_input" ;;
14908   *) ac_comsub= ;;
14909   esac
14910
14911   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
14912   sed -e "$ac_comsub
14913 s%@configure_input@%$configure_input%g
14914 s%@srcdir@%$srcdir%g
14915 s%@top_srcdir@%$top_srcdir%g
14916 s%@INSTALL@%$INSTALL%g
14917 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
14918 fi; done
14919 rm -f conftest.s*
14920
14921 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
14922 # NAME is the cpp macro being defined and VALUE is the value it is being given.
14923 #
14924 # ac_d sets the value in "#define NAME VALUE" lines.
14925 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
14926 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
14927 ac_dC='\3'
14928 ac_dD='%g'
14929 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
14930 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
14931 ac_uB='\([      ]\)%\1#\2define\3'
14932 ac_uC=' '
14933 ac_uD='\4%g'
14934 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
14935 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
14936 ac_eB='$%\1#\2define\3'
14937 ac_eC=' '
14938 ac_eD='%g'
14939
14940 if test "${CONFIG_HEADERS+set}" != set; then
14941 EOF
14942 cat >> $CONFIG_STATUS <<EOF
14943   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
14944 EOF
14945 cat >> $CONFIG_STATUS <<\EOF
14946 fi
14947 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
14948   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
14949   case "$ac_file" in
14950   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
14951        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
14952   *) ac_file_in="${ac_file}.in" ;;
14953   esac
14954
14955   echo creating $ac_file
14956
14957   rm -f conftest.frag conftest.in conftest.out
14958   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
14959   cat $ac_file_inputs > conftest.in
14960
14961 EOF
14962
14963 # Transform confdefs.h into a sed script conftest.vals that substitutes
14964 # the proper values into config.h.in to produce config.h.  And first:
14965 # Protect against being on the right side of a sed subst in config.status.
14966 # Protect against being in an unquoted here document in config.status.
14967 rm -f conftest.vals
14968 cat > conftest.hdr <<\EOF
14969 s/[\\&%]/\\&/g
14970 s%[\\$`]%\\&%g
14971 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
14972 s%ac_d%ac_u%gp
14973 s%ac_u%ac_e%gp
14974 EOF
14975 sed -n -f conftest.hdr confdefs.h > conftest.vals
14976 rm -f conftest.hdr
14977
14978 # This sed command replaces #undef with comments.  This is necessary, for
14979 # example, in the case of _POSIX_SOURCE, which is predefined and required
14980 # on some systems where configure will not decide to define it.
14981 cat >> conftest.vals <<\EOF
14982 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
14983 EOF
14984
14985 # Break up conftest.vals because some shells have a limit on
14986 # the size of here documents, and old seds have small limits too.
14987
14988 rm -f conftest.tail
14989 while :
14990 do
14991   ac_lines=`grep -c . conftest.vals`
14992   # grep -c gives empty output for an empty file on some AIX systems.
14993   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
14994   # Write a limited-size here document to conftest.frag.
14995   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
14996   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
14997   echo 'CEOF
14998   sed -f conftest.frag conftest.in > conftest.out
14999   rm -f conftest.in
15000   mv conftest.out conftest.in
15001 ' >> $CONFIG_STATUS
15002   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
15003   rm -f conftest.vals
15004   mv conftest.tail conftest.vals
15005 done
15006 rm -f conftest.vals
15007
15008 cat >> $CONFIG_STATUS <<\EOF
15009   rm -f conftest.frag conftest.h
15010   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
15011   cat conftest.in >> conftest.h
15012   rm -f conftest.in
15013   if cmp -s $ac_file conftest.h 2>/dev/null; then
15014     echo "$ac_file is unchanged"
15015     rm -f conftest.h
15016   else
15017     # Remove last slash and all that follows it.  Not all systems have dirname.
15018       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
15019       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15020       # The file is in a subdirectory.
15021       test ! -d "$ac_dir" && mkdir "$ac_dir"
15022     fi
15023     rm -f $ac_file
15024     mv conftest.h $ac_file
15025   fi
15026 fi; done
15027
15028 EOF
15029 cat >> $CONFIG_STATUS <<EOF
15030
15031 EOF
15032 cat >> $CONFIG_STATUS <<\EOF
15033
15034 date > stamp-h
15035 echo Please \"make depend\" to build dependencies
15036
15037 exit 0
15038 EOF
15039 chmod +x $CONFIG_STATUS
15040 rm -fr confdefs* $ac_clean_files
15041 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
15042