]> git.sur5r.net Git - openldap/blob - configure
Shouldn't need to restall signal handler outside of handler.
[openldap] / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13.1 
5 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
6 #
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Defaults:
11 ac_help=
12 ac_default_prefix=/usr/local
13 # Any additions from configure.in:
14 ac_default_prefix=/usr/local
15 ac_help="$ac_help
16   --with-subdir=DIR change default subdirectory used for installs"
17 ac_help="$ac_help
18   --enable-debug        enable debugging (yes)"
19 ac_help="$ac_help
20   --enable-syslog       enable syslog support (auto)"
21 ac_help="$ac_help
22   --enable-proctitle    enable proctitle support (yes)"
23 ac_help="$ac_help
24   --enable-cache        enable caching (yes)"
25 ac_help="$ac_help
26   --enable-dns          enable V2 DX Referrals extension (no)"
27 ac_help="$ac_help
28   --enable-referrals    enable V2 Referrals extension (yes)"
29 ac_help="$ac_help
30   --enable-cldap        enable connectionless ldap (no)"
31 ac_help="$ac_help
32   --enable-x-compile    enable cross compiling (no)"
33 ac_help="$ac_help
34   --enable-dmalloc      enable debug malloc support (no)"
35 ac_help="$ac_help
36   --with-cyrus-sasl     with Cyrus SASL support (auto)"
37 ac_help="$ac_help
38   --with-fetch          with fetch URL support (auto)"
39 ac_help="$ac_help
40   --with-kerberos       with Kerberos support (auto)"
41 ac_help="$ac_help
42   --with-readline       with readline support (auto)"
43 ac_help="$ac_help
44   --with-threads        use threads (auto)"
45 ac_help="$ac_help
46   --with-tls            with TLS/SSL support (auto)"
47 ac_help="$ac_help
48   --with-yielding-select        with implicitly yielding select (auto)"
49 ac_help="$ac_help
50 LDAPD (X.500-to-LDAP Gateway) Options:"
51 ac_help="$ac_help
52   --enable-ldapd        enable building ldapd (no)"
53 ac_help="$ac_help
54 SLAPD (Standalone LDAP Daemon) Options:"
55 ac_help="$ac_help
56   --enable-slapd        enable building slapd (yes)"
57 ac_help="$ac_help
58     --enable-cleartext  enable cleartext passwords (yes)"
59 ac_help="$ac_help
60     --enable-crypt      enable crypt(3) passwords (auto)"
61 ac_help="$ac_help
62     --enable-modules    enable dynamic module support (no)"
63 ac_help="$ac_help
64     --enable-multimaster        enable multimaster replication (no)"
65 ac_help="$ac_help
66     --enable-phonetic   enable phonetic/soundex (no)"
67 ac_help="$ac_help
68     --enable-quipu      build quipu migration tools (no)"
69 ac_help="$ac_help
70     --enable-rlookups   enable reverse lookups (auto)"
71 ac_help="$ac_help
72     --enable-aci        enable per-object ACIs (no)"
73 ac_help="$ac_help
74     --enable-discreteaci        enable discrete rights in ACIs (no)"
75 ac_help="$ac_help
76     --enable-wrappers   enable tcp wrapper support (no)"
77 ac_help="$ac_help
78     --enable-bdb2       enable bdb2 backend (no)"
79 ac_help="$ac_help
80       --with-bdb2-module        module type (static)"
81 ac_help="$ac_help
82     --enable-ldap       enable ldap backend (no)"
83 ac_help="$ac_help
84       --with-ldap-module        module type (static)"
85 ac_help="$ac_help
86     --enable-ldbm       enable ldbm backend (yes)"
87 ac_help="$ac_help
88       --with-ldbm-api   use LDBM API (auto)"
89 ac_help="$ac_help
90       --with-ldbm-module        module type (static)"
91 ac_help="$ac_help
92       --with-ldbm-type  use LDBM type (auto)"
93 ac_help="$ac_help
94     --enable-passwd     enable passwd backend (no)"
95 ac_help="$ac_help
96       --with-passwd-module      module type (static)"
97 ac_help="$ac_help
98     --enable-perl       enable perl backend (no)"
99 ac_help="$ac_help
100       --with-perl-module        module type (static)"
101 ac_help="$ac_help
102     --enable-shell      enable shell backend (no)"
103 ac_help="$ac_help
104       --with-shell-module       module type (static)"
105 ac_help="$ac_help
106     --enable-tcl        enable tcl backend (no)"
107 ac_help="$ac_help
108       --with-tcl-module module type (static)"
109 ac_help="$ac_help
110 SLURPD (Replication Daemon) Options:"
111 ac_help="$ac_help
112   --enable-slurpd       enable building slurpd (auto)"
113 ac_help="$ac_help
114 Library Generation & Linking Options"
115 ac_help="$ac_help
116   --enable-static[=PKGS]  build static libraries [default=yes]"
117 ac_help="$ac_help
118   --enable-shared[=PKGS]  build shared libraries [default=yes]"
119 ac_help="$ac_help
120   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
121 ac_help="$ac_help
122   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
123 ac_help="$ac_help
124   --disable-libtool-lock  avoid locking (might break parallel builds)"
125
126 # Initialize some variables set by options.
127 # The variables have the same names as the options, with
128 # dashes changed to underlines.
129 build=NONE
130 cache_file=./config.cache
131 exec_prefix=NONE
132 host=NONE
133 no_create=
134 nonopt=NONE
135 no_recursion=
136 prefix=NONE
137 program_prefix=NONE
138 program_suffix=NONE
139 program_transform_name=s,x,x,
140 silent=
141 site=
142 srcdir=
143 target=NONE
144 verbose=
145 x_includes=NONE
146 x_libraries=NONE
147 bindir='${exec_prefix}/bin'
148 sbindir='${exec_prefix}/sbin'
149 libexecdir='${exec_prefix}/libexec'
150 datadir='${prefix}/share'
151 sysconfdir='${prefix}/etc'
152 sharedstatedir='${prefix}/com'
153 localstatedir='${prefix}/var'
154 libdir='${exec_prefix}/lib'
155 includedir='${prefix}/include'
156 oldincludedir='/usr/include'
157 infodir='${prefix}/info'
158 mandir='${prefix}/man'
159
160 # Initialize some other variables.
161 subdirs=
162 MFLAGS= MAKEFLAGS=
163 SHELL=${CONFIG_SHELL-/bin/sh}
164 # Maximum number of lines to put in a shell here document.
165 ac_max_here_lines=12
166
167 ac_prev=
168 for ac_option
169 do
170
171   # If the previous option needs an argument, assign it.
172   if test -n "$ac_prev"; then
173     eval "$ac_prev=\$ac_option"
174     ac_prev=
175     continue
176   fi
177
178   case "$ac_option" in
179   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
180   *) ac_optarg= ;;
181   esac
182
183   # Accept the important Cygnus configure options, so we can diagnose typos.
184
185   case "$ac_option" in
186
187   -bindir | --bindir | --bindi | --bind | --bin | --bi)
188     ac_prev=bindir ;;
189   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
190     bindir="$ac_optarg" ;;
191
192   -build | --build | --buil | --bui | --bu)
193     ac_prev=build ;;
194   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
195     build="$ac_optarg" ;;
196
197   -cache-file | --cache-file | --cache-fil | --cache-fi \
198   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
199     ac_prev=cache_file ;;
200   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
201   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
202     cache_file="$ac_optarg" ;;
203
204   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
205     ac_prev=datadir ;;
206   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
207   | --da=*)
208     datadir="$ac_optarg" ;;
209
210   -disable-* | --disable-*)
211     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
212     # Reject names that are not valid shell variable names.
213     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
214       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
215     fi
216     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
217     eval "enable_${ac_feature}=no" ;;
218
219   -enable-* | --enable-*)
220     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
221     # Reject names that are not valid shell variable names.
222     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
223       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
224     fi
225     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
226     case "$ac_option" in
227       *=*) ;;
228       *) ac_optarg=yes ;;
229     esac
230     eval "enable_${ac_feature}='$ac_optarg'" ;;
231
232   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
233   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
234   | --exec | --exe | --ex)
235     ac_prev=exec_prefix ;;
236   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
237   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
238   | --exec=* | --exe=* | --ex=*)
239     exec_prefix="$ac_optarg" ;;
240
241   -gas | --gas | --ga | --g)
242     # Obsolete; use --with-gas.
243     with_gas=yes ;;
244
245   -help | --help | --hel | --he)
246     # Omit some internal or obsolete options to make the list less imposing.
247     # This message is too long to be a string in the A/UX 3.1 sh.
248     cat << EOF
249 Usage: configure [options] [host]
250 Options: [defaults in brackets after descriptions]
251 Configuration:
252   --cache-file=FILE       cache test results in FILE
253   --help                  print this message
254   --no-create             do not create output files
255   --quiet, --silent       do not print \`checking...' messages
256   --version               print the version of autoconf that created configure
257 Directory and file names:
258   --prefix=PREFIX         install architecture-independent files in PREFIX
259                           [$ac_default_prefix]
260   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
261                           [same as prefix]
262   --bindir=DIR            user executables in DIR [EPREFIX/bin]
263   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
264   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
265   --datadir=DIR           read-only architecture-independent data in DIR
266                           [PREFIX/share]
267   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
268   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
269                           [PREFIX/com]
270   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
271   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
272   --includedir=DIR        C header files in DIR [PREFIX/include]
273   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
274   --infodir=DIR           info documentation in DIR [PREFIX/info]
275   --mandir=DIR            man documentation in DIR [PREFIX/man]
276   --srcdir=DIR            find the sources in DIR [configure dir or ..]
277   --program-prefix=PREFIX prepend PREFIX to installed program names
278   --program-suffix=SUFFIX append SUFFIX to installed program names
279   --program-transform-name=PROGRAM
280                           run sed PROGRAM on installed program names
281 EOF
282     cat << EOF
283 Host type:
284   --build=BUILD           configure for building on BUILD [BUILD=HOST]
285   --host=HOST             configure for HOST [guessed]
286   --target=TARGET         configure for TARGET [TARGET=HOST]
287 Features and packages:
288   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
289   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
290   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
291   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
292   --x-includes=DIR        X include files are in DIR
293   --x-libraries=DIR       X library files are in DIR
294 EOF
295     if test -n "$ac_help"; then
296       echo "--enable and --with options recognized:$ac_help"
297     fi
298     exit 0 ;;
299
300   -host | --host | --hos | --ho)
301     ac_prev=host ;;
302   -host=* | --host=* | --hos=* | --ho=*)
303     host="$ac_optarg" ;;
304
305   -includedir | --includedir | --includedi | --included | --include \
306   | --includ | --inclu | --incl | --inc)
307     ac_prev=includedir ;;
308   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
309   | --includ=* | --inclu=* | --incl=* | --inc=*)
310     includedir="$ac_optarg" ;;
311
312   -infodir | --infodir | --infodi | --infod | --info | --inf)
313     ac_prev=infodir ;;
314   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
315     infodir="$ac_optarg" ;;
316
317   -libdir | --libdir | --libdi | --libd)
318     ac_prev=libdir ;;
319   -libdir=* | --libdir=* | --libdi=* | --libd=*)
320     libdir="$ac_optarg" ;;
321
322   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
323   | --libexe | --libex | --libe)
324     ac_prev=libexecdir ;;
325   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
326   | --libexe=* | --libex=* | --libe=*)
327     libexecdir="$ac_optarg" ;;
328
329   -localstatedir | --localstatedir | --localstatedi | --localstated \
330   | --localstate | --localstat | --localsta | --localst \
331   | --locals | --local | --loca | --loc | --lo)
332     ac_prev=localstatedir ;;
333   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
334   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
335   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
336     localstatedir="$ac_optarg" ;;
337
338   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
339     ac_prev=mandir ;;
340   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
341     mandir="$ac_optarg" ;;
342
343   -nfp | --nfp | --nf)
344     # Obsolete; use --without-fp.
345     with_fp=no ;;
346
347   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
348   | --no-cr | --no-c)
349     no_create=yes ;;
350
351   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
352   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
353     no_recursion=yes ;;
354
355   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
356   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
357   | --oldin | --oldi | --old | --ol | --o)
358     ac_prev=oldincludedir ;;
359   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
360   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
361   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
362     oldincludedir="$ac_optarg" ;;
363
364   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
365     ac_prev=prefix ;;
366   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
367     prefix="$ac_optarg" ;;
368
369   -program-prefix | --program-prefix | --program-prefi | --program-pref \
370   | --program-pre | --program-pr | --program-p)
371     ac_prev=program_prefix ;;
372   -program-prefix=* | --program-prefix=* | --program-prefi=* \
373   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
374     program_prefix="$ac_optarg" ;;
375
376   -program-suffix | --program-suffix | --program-suffi | --program-suff \
377   | --program-suf | --program-su | --program-s)
378     ac_prev=program_suffix ;;
379   -program-suffix=* | --program-suffix=* | --program-suffi=* \
380   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
381     program_suffix="$ac_optarg" ;;
382
383   -program-transform-name | --program-transform-name \
384   | --program-transform-nam | --program-transform-na \
385   | --program-transform-n | --program-transform- \
386   | --program-transform | --program-transfor \
387   | --program-transfo | --program-transf \
388   | --program-trans | --program-tran \
389   | --progr-tra | --program-tr | --program-t)
390     ac_prev=program_transform_name ;;
391   -program-transform-name=* | --program-transform-name=* \
392   | --program-transform-nam=* | --program-transform-na=* \
393   | --program-transform-n=* | --program-transform-=* \
394   | --program-transform=* | --program-transfor=* \
395   | --program-transfo=* | --program-transf=* \
396   | --program-trans=* | --program-tran=* \
397   | --progr-tra=* | --program-tr=* | --program-t=*)
398     program_transform_name="$ac_optarg" ;;
399
400   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
401   | -silent | --silent | --silen | --sile | --sil)
402     silent=yes ;;
403
404   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
405     ac_prev=sbindir ;;
406   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
407   | --sbi=* | --sb=*)
408     sbindir="$ac_optarg" ;;
409
410   -sharedstatedir | --sharedstatedir | --sharedstatedi \
411   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
412   | --sharedst | --shareds | --shared | --share | --shar \
413   | --sha | --sh)
414     ac_prev=sharedstatedir ;;
415   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
416   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
417   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
418   | --sha=* | --sh=*)
419     sharedstatedir="$ac_optarg" ;;
420
421   -site | --site | --sit)
422     ac_prev=site ;;
423   -site=* | --site=* | --sit=*)
424     site="$ac_optarg" ;;
425
426   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
427     ac_prev=srcdir ;;
428   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
429     srcdir="$ac_optarg" ;;
430
431   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
432   | --syscon | --sysco | --sysc | --sys | --sy)
433     ac_prev=sysconfdir ;;
434   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
435   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
436     sysconfdir="$ac_optarg" ;;
437
438   -target | --target | --targe | --targ | --tar | --ta | --t)
439     ac_prev=target ;;
440   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
441     target="$ac_optarg" ;;
442
443   -v | -verbose | --verbose | --verbos | --verbo | --verb)
444     verbose=yes ;;
445
446   -version | --version | --versio | --versi | --vers)
447     echo "configure generated by autoconf version 2.13.1"
448     exit 0 ;;
449
450   -with-* | --with-*)
451     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
452     # Reject names that are not valid shell variable names.
453     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
454       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
455     fi
456     ac_package=`echo $ac_package| sed 's/-/_/g'`
457     case "$ac_option" in
458       *=*) ;;
459       *) ac_optarg=yes ;;
460     esac
461     eval "with_${ac_package}='$ac_optarg'" ;;
462
463   -without-* | --without-*)
464     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
465     # Reject names that are not valid shell variable names.
466     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
467       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
468     fi
469     ac_package=`echo $ac_package| sed 's/-/_/g'`
470     eval "with_${ac_package}=no" ;;
471
472   --x)
473     # Obsolete; use --with-x.
474     with_x=yes ;;
475
476   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
477   | --x-incl | --x-inc | --x-in | --x-i)
478     ac_prev=x_includes ;;
479   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
480   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
481     x_includes="$ac_optarg" ;;
482
483   -x-libraries | --x-libraries | --x-librarie | --x-librari \
484   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
485     ac_prev=x_libraries ;;
486   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
487   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
488     x_libraries="$ac_optarg" ;;
489
490   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
491     ;;
492
493   *)
494     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
495       echo "configure: warning: $ac_option: invalid host type" 1>&2
496     fi
497     if test "x$nonopt" != xNONE; then
498       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
499     fi
500     nonopt="$ac_option"
501     ;;
502
503   esac
504 done
505
506 if test -n "$ac_prev"; then
507   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
508 fi
509
510 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
511
512 # File descriptor usage:
513 # 0 standard input
514 # 1 file creation
515 # 2 errors and warnings
516 # 3 some systems may open it to /dev/tty
517 # 4 used on the Kubota Titan
518 # 6 checking for... messages and results
519 # 5 compiler messages saved in config.log
520 if test "$silent" = yes; then
521   exec 6>/dev/null
522 else
523   exec 6>&1
524 fi
525 exec 5>./config.log
526
527 echo "\
528 This file contains any messages produced by compilers while
529 running configure, to aid debugging if configure makes a mistake.
530 " 1>&5
531
532 # Strip out --no-create and --no-recursion so they do not pile up.
533 # Also quote any args containing shell metacharacters.
534 ac_configure_args=
535 for ac_arg
536 do
537   case "$ac_arg" in
538   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
539   | --no-cr | --no-c) ;;
540   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
541   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
542   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
543   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
544   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
545   esac
546 done
547
548 # NLS nuisances.
549 # Only set these to C if already set.  These must not be set unconditionally
550 # because not all systems understand e.g. LANG=C (notably SCO).
551 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
552 # Non-C LC_CTYPE values break the ctype check.
553 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
554 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
555 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
556 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
557
558 # confdefs.h avoids OS command line length limits that DEFS can exceed.
559 rm -rf conftest* confdefs.h
560 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
561 echo > confdefs.h
562
563 # A filename unique to this package, relative to the directory that
564 # configure is in, which we can look for to find out if srcdir is correct.
565 ac_unique_file=build/version
566
567 # Find the source files, if location was not specified.
568 if test -z "$srcdir"; then
569   ac_srcdir_defaulted=yes
570   # Try the directory containing this script, then its parent.
571   ac_prog=$0
572   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
573   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
574   srcdir=$ac_confdir
575   if test ! -r $srcdir/$ac_unique_file; then
576     srcdir=..
577   fi
578 else
579   ac_srcdir_defaulted=no
580 fi
581 if test ! -r $srcdir/$ac_unique_file; then
582   if test "$ac_srcdir_defaulted" = yes; then
583     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
584   else
585     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
586   fi
587 fi
588 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
589
590 # Prefer explicitly selected file to automatically selected ones.
591 if test -z "$CONFIG_SITE"; then
592   if test "x$prefix" != xNONE; then
593     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
594   else
595     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
596   fi
597 fi
598 for ac_site_file in $CONFIG_SITE; do
599   if test -r "$ac_site_file"; then
600     echo "loading site script $ac_site_file"
601     . "$ac_site_file"
602   fi
603 done
604
605
606 ac_ext=c
607 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
608 ac_cpp='$CPP $CPPFLAGS'
609 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
610 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
611 cross_compiling=$ac_cv_prog_cc_cross
612
613 ac_exeext=
614 ac_objext=o
615 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
616   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
617   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
618     ac_n= ac_c='
619 ' ac_t='        '
620   else
621     ac_n=-n ac_c= ac_t=
622   fi
623 else
624   ac_n= ac_c='\c' ac_t=
625 fi
626
627 ac_aux_dir=
628 for ac_dir in build $srcdir/build; do
629   if test -f $ac_dir/install-sh; then
630     ac_aux_dir=$ac_dir
631     ac_install_sh="$ac_aux_dir/install-sh -c"
632     break
633   elif test -f $ac_dir/install.sh; then
634     ac_aux_dir=$ac_dir
635     ac_install_sh="$ac_aux_dir/install.sh -c"
636     break
637   fi
638 done
639 if test -z "$ac_aux_dir"; then
640   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
641 fi
642 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
643 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
644 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
645
646 OL_VERSION=`cat $ac_aux_dir/version`
647 if test -z "$OL_VERSION"; then
648         { echo "configure: error: could not determine version" 1>&2; exit 1; }
649 fi
650
651
652 echo $ac_n "checking host system type""... $ac_c" 1>&6
653 echo "configure:654: checking host system type" >&5
654 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
655
656 # Make sure we can run config.sub.
657   if $ac_config_sub sun4 >/dev/null 2>&1; then :
658     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
659   fi
660
661   ac_cv_host_alias=$host
662   case "$ac_cv_host_alias" in
663   NONE)
664     case $nonopt in
665     NONE)
666       if ac_cv_host_alias=`$ac_config_guess`; then :
667       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
668       fi ;;
669     *) ac_cv_host_alias=$nonopt ;;
670     esac ;;
671   esac
672
673   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
674   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
675   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
676   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
677 else
678   echo $ac_n "(cached) $ac_c" 1>&6
679 fi
680
681 echo "$ac_t""$ac_cv_host" 1>&6
682
683 host=$ac_cv_host
684 host_alias=$ac_cv_host_alias
685 host_cpu=$ac_cv_host_cpu
686 host_vendor=$ac_cv_host_vendor
687 host_os=$ac_cv_host_os
688
689
690
691
692
693 echo $ac_n "checking target system type""... $ac_c" 1>&6
694 echo "configure:695: checking target system type" >&5
695 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
696
697 # Make sure we can run config.sub.
698   if $ac_config_sub sun4 >/dev/null 2>&1; then :
699     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
700   fi
701
702   ac_cv_target_alias=$target
703   case "$ac_cv_target_alias" in
704   NONE)
705     case $nonopt in
706     NONE)
707       ac_cv_target_alias=$host_alias ;;
708
709     *) ac_cv_target_alias=$nonopt ;;
710     esac ;;
711   esac
712
713   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
714   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
715   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
716   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
717 else
718   echo $ac_n "(cached) $ac_c" 1>&6
719 fi
720
721 echo "$ac_t""$ac_cv_target" 1>&6
722
723 target=$ac_cv_target
724 target_alias=$ac_cv_target_alias
725 target_cpu=$ac_cv_target_cpu
726 target_vendor=$ac_cv_target_vendor
727 target_os=$ac_cv_target_os
728
729
730
731
732
733 echo $ac_n "checking build system type""... $ac_c" 1>&6
734 echo "configure:735: checking build system type" >&5
735 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
736
737 # Make sure we can run config.sub.
738   if $ac_config_sub sun4 >/dev/null 2>&1; then :
739     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
740   fi
741
742   ac_cv_build_alias=$build
743   case "$ac_cv_build_alias" in
744   NONE)
745     case $nonopt in
746     NONE)
747       ac_cv_build_alias=$host_alias ;;
748
749     *) ac_cv_build_alias=$nonopt ;;
750     esac ;;
751   esac
752
753   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
754   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
755   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
756   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
757 else
758   echo $ac_n "(cached) $ac_c" 1>&6
759 fi
760
761 echo "$ac_t""$ac_cv_build" 1>&6
762
763 build=$ac_cv_build
764 build_alias=$ac_cv_build_alias
765 build_cpu=$ac_cv_build_cpu
766 build_vendor=$ac_cv_build_vendor
767 build_os=$ac_cv_build_os
768
769
770
771
772
773 # Do some error checking and defaulting for the host and target type.
774 # The inputs are:
775 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
776 #
777 # The rules are:
778 # 1. You are not allowed to specify --host, --target, and nonopt at the
779 #    same time.
780 # 2. Host defaults to nonopt.
781 # 3. If nonopt is not specified, then host defaults to the current host,
782 #    as determined by config.guess.
783 # 4. Target and build default to nonopt.
784 # 5. If nonopt is not specified, then target and build default to host.
785
786 # The aliases save the names the user supplied, while $host etc.
787 # will get canonicalized.
788 case $host---$target---$nonopt in
789 NONE---*---* | *---NONE---* | *---*---NONE) ;;
790 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
791 esac
792
793 test "$host_alias" != "$target_alias" &&
794   test "$program_prefix$program_suffix$program_transform_name" = \
795     NONENONEs,x,x, &&
796   program_prefix=${target_alias}-
797
798
799 # Find a good install program.  We prefer a C program (faster),
800 # so one script is as good as another.  But avoid the broken or
801 # incompatible versions:
802 # SysV /etc/install, /usr/sbin/install
803 # SunOS /usr/etc/install
804 # IRIX /sbin/install
805 # AIX /bin/install
806 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
807 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
808 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
809 # ./install, which can be erroneously created by make from ./install.sh.
810 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
811 echo "configure:812: checking for a BSD compatible install" >&5
812 if test -z "$INSTALL"; then
813 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
814   echo $ac_n "(cached) $ac_c" 1>&6
815 else
816     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
817   for ac_dir in $PATH; do
818     # Account for people who put trailing slashes in PATH elements.
819     case "$ac_dir/" in
820     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
821     *)
822       # OSF1 and SCO ODT 3.0 have their own names for install.
823       # Don't use installbsd from OSF since it installs stuff as root
824       # by default.
825       for ac_prog in ginstall scoinst install; do
826         if test -f $ac_dir/$ac_prog; then
827           if test $ac_prog = install &&
828             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
829             # AIX install.  It has an incompatible calling convention.
830             :
831           elif test $ac_prog = install &&
832             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
833             # program-specific install script used by HP pwplus--don't use.
834             :
835           else
836             ac_cv_path_install="$ac_dir/$ac_prog -c"
837             break 2
838           fi
839         fi
840       done
841       ;;
842     esac
843   done
844   IFS="$ac_save_IFS"
845
846 fi
847   if test "${ac_cv_path_install+set}" = set; then
848     INSTALL="$ac_cv_path_install"
849   else
850     # As a last resort, use the slow shell script.  We don't cache a
851     # path for INSTALL within a source directory, because that will
852     # break other packages using the cache if that directory is
853     # removed, or if the path is relative.
854     INSTALL="$ac_install_sh"
855   fi
856 fi
857 echo "$ac_t""$INSTALL" 1>&6
858
859 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
860 # It thinks the first close brace ends the variable substitution.
861 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
862
863 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
864
865 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
866
867 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
868 echo "configure:869: checking whether build environment is sane" >&5
869 # Just in case
870 sleep 1
871 echo timestamp > conftestfile
872 # Do `set' in a subshell so we don't clobber the current shell's
873 # arguments.  Must try -L first in case configure is actually a
874 # symlink; some systems play weird games with the mod time of symlinks
875 # (eg FreeBSD returns the mod time of the symlink's containing
876 # directory).
877 if (
878    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
879    if test "$*" = "X"; then
880       # -L didn't work.
881       set X `ls -t $srcdir/configure conftestfile`
882    fi
883    if test "$*" != "X $srcdir/configure conftestfile" \
884       && test "$*" != "X conftestfile $srcdir/configure"; then
885
886       # If neither matched, then we have a broken ls.  This can happen
887       # if, for instance, CONFIG_SHELL is bash and it inherits a
888       # broken ls alias from the environment.  This has actually
889       # happened.  Such a system could not be considered "sane".
890       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
891 alias in your environment" 1>&2; exit 1; }
892    fi
893
894    test "$2" = conftestfile
895    )
896 then
897    # Ok.
898    :
899 else
900    { echo "configure: error: newly created file is older than distributed files!
901 Check your system clock" 1>&2; exit 1; }
902 fi
903 rm -f conftest*
904 echo "$ac_t""yes" 1>&6
905 if test "$program_transform_name" = s,x,x,; then
906   program_transform_name=
907 else
908   # Double any \ or $.  echo might interpret backslashes.
909   cat <<\EOF_SED > conftestsed
910 s,\\,\\\\,g; s,\$,$$,g
911 EOF_SED
912   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
913   rm -f conftestsed
914 fi
915 test "$program_prefix" != NONE &&
916   program_transform_name="s,^,${program_prefix},;$program_transform_name"
917 # Use a double $ so make ignores it.
918 test "$program_suffix" != NONE &&
919   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
920
921 # sed with no file args requires a program.
922 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
923
924 for ac_prog in mawk gawk nawk awk
925 do
926 # Extract the first word of "$ac_prog", so it can be a program name with args.
927 set dummy $ac_prog; ac_word=$2
928 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
929 echo "configure:930: checking for $ac_word" >&5
930 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
931   echo $ac_n "(cached) $ac_c" 1>&6
932 else
933   if test -n "$AWK"; then
934   ac_cv_prog_AWK="$AWK" # Let the user override the test.
935 else
936   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
937   ac_dummy="$PATH"
938   for ac_dir in $ac_dummy; do
939     test -z "$ac_dir" && ac_dir=.
940     if test -f $ac_dir/$ac_word; then
941       ac_cv_prog_AWK="$ac_prog"
942       break
943     fi
944   done
945   IFS="$ac_save_ifs"
946 fi
947 fi
948 AWK="$ac_cv_prog_AWK"
949 if test -n "$AWK"; then
950   echo "$ac_t""$AWK" 1>&6
951 else
952   echo "$ac_t""no" 1>&6
953 fi
954
955 test -n "$AWK" && break
956 done
957
958 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
959 echo "configure:960: checking whether ${MAKE-make} sets \${MAKE}" >&5
960 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
961 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
962   echo $ac_n "(cached) $ac_c" 1>&6
963 else
964   cat > conftestmake <<\EOF
965 all:
966         @echo 'ac_maketemp="${MAKE}"'
967 EOF
968 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
969 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
970 if test -n "$ac_maketemp"; then
971   eval ac_cv_prog_make_${ac_make}_set=yes
972 else
973   eval ac_cv_prog_make_${ac_make}_set=no
974 fi
975 rm -f conftestmake
976 fi
977 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
978   echo "$ac_t""yes" 1>&6
979   SET_MAKE=
980 else
981   echo "$ac_t""no" 1>&6
982   SET_MAKE="MAKE=${MAKE-make}"
983 fi
984
985
986
987 PACKAGE=OpenLDAP
988
989 VERSION=$OL_VERSION
990
991 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
992   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
993 fi
994
995
996
997 missing_dir=`cd $ac_aux_dir && pwd`
998 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
999 echo "configure:1000: checking for working aclocal" >&5
1000 # Run test in a subshell; some versions of sh will print an error if
1001 # an executable is not found, even if stderr is redirected.
1002 # Redirect stdin to placate older versions of autoconf.  Sigh.
1003 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1004    ACLOCAL=aclocal
1005    echo "$ac_t""found" 1>&6
1006 else
1007    ACLOCAL="$missing_dir/missing aclocal"
1008    echo "$ac_t""missing" 1>&6
1009 fi
1010
1011 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1012 echo "configure:1013: checking for working autoconf" >&5
1013 # Run test in a subshell; some versions of sh will print an error if
1014 # an executable is not found, even if stderr is redirected.
1015 # Redirect stdin to placate older versions of autoconf.  Sigh.
1016 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1017    AUTOCONF=autoconf
1018    echo "$ac_t""found" 1>&6
1019 else
1020    AUTOCONF="$missing_dir/missing autoconf"
1021    echo "$ac_t""missing" 1>&6
1022 fi
1023
1024 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1025 echo "configure:1026: checking for working automake" >&5
1026 # Run test in a subshell; some versions of sh will print an error if
1027 # an executable is not found, even if stderr is redirected.
1028 # Redirect stdin to placate older versions of autoconf.  Sigh.
1029 if (automake --version) < /dev/null > /dev/null 2>&1; then
1030    AUTOMAKE=automake
1031    echo "$ac_t""found" 1>&6
1032 else
1033    AUTOMAKE="$missing_dir/missing automake"
1034    echo "$ac_t""missing" 1>&6
1035 fi
1036
1037 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1038 echo "configure:1039: checking for working autoheader" >&5
1039 # Run test in a subshell; some versions of sh will print an error if
1040 # an executable is not found, even if stderr is redirected.
1041 # Redirect stdin to placate older versions of autoconf.  Sigh.
1042 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1043    AUTOHEADER=autoheader
1044    echo "$ac_t""found" 1>&6
1045 else
1046    AUTOHEADER="$missing_dir/missing autoheader"
1047    echo "$ac_t""missing" 1>&6
1048 fi
1049
1050 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1051 echo "configure:1052: checking for working makeinfo" >&5
1052 # Run test in a subshell; some versions of sh will print an error if
1053 # an executable is not found, even if stderr is redirected.
1054 # Redirect stdin to placate older versions of autoconf.  Sigh.
1055 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1056    MAKEINFO=makeinfo
1057    echo "$ac_t""found" 1>&6
1058 else
1059    MAKEINFO="$missing_dir/missing makeinfo"
1060    echo "$ac_t""missing" 1>&6
1061 fi
1062
1063 install_sh="$missing_dir/install-sh"
1064 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1065
1066 for ac_prog in gnutar gtar tar
1067 do
1068 # Extract the first word of "$ac_prog", so it can be a program name with args.
1069 set dummy $ac_prog; ac_word=$2
1070 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1071 echo "configure:1072: checking for $ac_word" >&5
1072 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1073   echo $ac_n "(cached) $ac_c" 1>&6
1074 else
1075   if test -n "$AMTAR"; then
1076   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1077 else
1078   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1079   ac_dummy="$PATH"
1080   for ac_dir in $ac_dummy; do
1081     test -z "$ac_dir" && ac_dir=.
1082     if test -f $ac_dir/$ac_word; then
1083       ac_cv_prog_AMTAR="$ac_prog"
1084       break
1085     fi
1086   done
1087   IFS="$ac_save_ifs"
1088 fi
1089 fi
1090 AMTAR="$ac_cv_prog_AMTAR"
1091 if test -n "$AMTAR"; then
1092   echo "$ac_t""$AMTAR" 1>&6
1093 else
1094   echo "$ac_t""no" 1>&6
1095 fi
1096
1097 test -n "$AMTAR" && break
1098 done
1099
1100
1101 AMTARFLAGS=
1102 if test -n "$AMTAR"; then
1103   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1104         AMTARFLAGS=o
1105   fi
1106 fi
1107
1108
1109
1110 cat >> confdefs.h <<EOF
1111 #define OPENLDAP_PACKAGE "$PACKAGE"
1112 EOF
1113
1114 cat >> confdefs.h <<EOF
1115 #define OPENLDAP_VERSION "$VERSION"
1116 EOF
1117
1118
1119
1120
1121 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1122 echo "configure:1123: checking configure arguments" >&5
1123
1124
1125 top_builddir=`pwd`
1126
1127 ldap_subdir="/openldap"
1128
1129 # Check whether --with-subdir or --without-subdir was given.
1130 if test "${with_subdir+set}" = set; then
1131   withval="$with_subdir"
1132   case "$withval" in
1133         no) ldap_subdir=""
1134                 ;;
1135         yes)
1136                 ;;
1137         /*|\\*)
1138                 ldap_subdir="$withval"
1139                 ;;
1140         *)
1141                 ldap_subdir="/$withval"
1142                 ;;
1143 esac
1144
1145 fi
1146
1147
1148 # OpenLDAP --enable-debug
1149         # Check whether --enable-debug or --disable-debug was given.
1150 if test "${enable_debug+set}" = set; then
1151   enableval="$enable_debug"
1152   
1153         ol_arg=invalid
1154         for ol_val in auto yes no ; do
1155                 if test "$enableval" = "$ol_val" ; then
1156                         ol_arg="$ol_val"
1157                 fi
1158         done
1159         if test "$ol_arg" = "invalid" ; then
1160                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1161         fi
1162         ol_enable_debug="$ol_arg"
1163
1164 else
1165         ol_enable_debug="yes"
1166 fi
1167 # end --enable-debug
1168 # OpenLDAP --enable-syslog
1169         # Check whether --enable-syslog or --disable-syslog was given.
1170 if test "${enable_syslog+set}" = set; then
1171   enableval="$enable_syslog"
1172   
1173         ol_arg=invalid
1174         for ol_val in auto yes no ; do
1175                 if test "$enableval" = "$ol_val" ; then
1176                         ol_arg="$ol_val"
1177                 fi
1178         done
1179         if test "$ol_arg" = "invalid" ; then
1180                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1181         fi
1182         ol_enable_syslog="$ol_arg"
1183
1184 else
1185         ol_enable_syslog="auto"
1186 fi
1187 # end --enable-syslog
1188 # OpenLDAP --enable-proctitle
1189         # Check whether --enable-proctitle or --disable-proctitle was given.
1190 if test "${enable_proctitle+set}" = set; then
1191   enableval="$enable_proctitle"
1192   
1193         ol_arg=invalid
1194         for ol_val in auto yes no ; do
1195                 if test "$enableval" = "$ol_val" ; then
1196                         ol_arg="$ol_val"
1197                 fi
1198         done
1199         if test "$ol_arg" = "invalid" ; then
1200                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1201         fi
1202         ol_enable_proctitle="$ol_arg"
1203
1204 else
1205         ol_enable_proctitle="yes"
1206 fi
1207 # end --enable-proctitle
1208 # OpenLDAP --enable-cache
1209         # Check whether --enable-cache or --disable-cache was given.
1210 if test "${enable_cache+set}" = set; then
1211   enableval="$enable_cache"
1212   
1213         ol_arg=invalid
1214         for ol_val in auto yes no ; do
1215                 if test "$enableval" = "$ol_val" ; then
1216                         ol_arg="$ol_val"
1217                 fi
1218         done
1219         if test "$ol_arg" = "invalid" ; then
1220                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
1221         fi
1222         ol_enable_cache="$ol_arg"
1223
1224 else
1225         ol_enable_cache="yes"
1226 fi
1227 # end --enable-cache
1228 # OpenLDAP --enable-dns
1229         # Check whether --enable-dns or --disable-dns was given.
1230 if test "${enable_dns+set}" = set; then
1231   enableval="$enable_dns"
1232   
1233         ol_arg=invalid
1234         for ol_val in auto yes no ; do
1235                 if test "$enableval" = "$ol_val" ; then
1236                         ol_arg="$ol_val"
1237                 fi
1238         done
1239         if test "$ol_arg" = "invalid" ; then
1240                 { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; }
1241         fi
1242         ol_enable_dns="$ol_arg"
1243
1244 else
1245         ol_enable_dns="no"
1246 fi
1247 # end --enable-dns
1248 # OpenLDAP --enable-referrals
1249         # Check whether --enable-referrals or --disable-referrals was given.
1250 if test "${enable_referrals+set}" = set; then
1251   enableval="$enable_referrals"
1252   
1253         ol_arg=invalid
1254         for ol_val in auto yes no ; do
1255                 if test "$enableval" = "$ol_val" ; then
1256                         ol_arg="$ol_val"
1257                 fi
1258         done
1259         if test "$ol_arg" = "invalid" ; then
1260                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1261         fi
1262         ol_enable_referrals="$ol_arg"
1263
1264 else
1265         ol_enable_referrals="yes"
1266 fi
1267 # end --enable-referrals
1268 # OpenLDAP --enable-cldap
1269         # Check whether --enable-cldap or --disable-cldap was given.
1270 if test "${enable_cldap+set}" = set; then
1271   enableval="$enable_cldap"
1272   
1273         ol_arg=invalid
1274         for ol_val in auto yes no ; do
1275                 if test "$enableval" = "$ol_val" ; then
1276                         ol_arg="$ol_val"
1277                 fi
1278         done
1279         if test "$ol_arg" = "invalid" ; then
1280                 { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; }
1281         fi
1282         ol_enable_cldap="$ol_arg"
1283
1284 else
1285         ol_enable_cldap="no"
1286 fi
1287 # end --enable-cldap
1288 # OpenLDAP --enable-x_compile
1289         # Check whether --enable-x_compile or --disable-x_compile was given.
1290 if test "${enable_x_compile+set}" = set; then
1291   enableval="$enable_x_compile"
1292   
1293         ol_arg=invalid
1294         for ol_val in yes no ; do
1295                 if test "$enableval" = "$ol_val" ; then
1296                         ol_arg="$ol_val"
1297                 fi
1298         done
1299         if test "$ol_arg" = "invalid" ; then
1300                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1301         fi
1302         ol_enable_x_compile="$ol_arg"
1303
1304 else
1305         ol_enable_x_compile="no"
1306 fi
1307 # end --enable-x_compile
1308
1309 # OpenLDAP --enable-dmalloc
1310         # Check whether --enable-dmalloc or --disable-dmalloc was given.
1311 if test "${enable_dmalloc+set}" = set; then
1312   enableval="$enable_dmalloc"
1313   
1314         ol_arg=invalid
1315         for ol_val in auto yes no ; do
1316                 if test "$enableval" = "$ol_val" ; then
1317                         ol_arg="$ol_val"
1318                 fi
1319         done
1320         if test "$ol_arg" = "invalid" ; then
1321                 { echo "configure: error: bad value $enableval for --enable-dmalloc" 1>&2; exit 1; }
1322         fi
1323         ol_enable_dmalloc="$ol_arg"
1324
1325 else
1326         ol_enable_dmalloc="no"
1327 fi
1328 # end --enable-dmalloc
1329
1330 # OpenLDAP --with-cyrus_sasl
1331         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1332 if test "${with_cyrus_sasl+set}" = set; then
1333   withval="$with_cyrus_sasl"
1334   
1335         ol_arg=invalid
1336         for ol_val in auto yes no  ; do
1337                 if test "$withval" = "$ol_val" ; then
1338                         ol_arg="$ol_val"
1339                 fi
1340         done
1341         if test "$ol_arg" = "invalid" ; then
1342                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1343         fi
1344         ol_with_cyrus_sasl="$ol_arg"
1345
1346 else
1347         ol_with_cyrus_sasl="auto"
1348 fi
1349 # end --with-cyrus_sasl
1350
1351 # OpenLDAP --with-fetch
1352         # Check whether --with-fetch or --without-fetch was given.
1353 if test "${with_fetch+set}" = set; then
1354   withval="$with_fetch"
1355   
1356         ol_arg=invalid
1357         for ol_val in auto yes no  ; do
1358                 if test "$withval" = "$ol_val" ; then
1359                         ol_arg="$ol_val"
1360                 fi
1361         done
1362         if test "$ol_arg" = "invalid" ; then
1363                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1364         fi
1365         ol_with_fetch="$ol_arg"
1366
1367 else
1368         ol_with_fetch="auto"
1369 fi
1370 # end --with-fetch
1371
1372 # OpenLDAP --with-kerberos
1373         # Check whether --with-kerberos or --without-kerberos was given.
1374 if test "${with_kerberos+set}" = set; then
1375   withval="$with_kerberos"
1376   
1377         ol_arg=invalid
1378         for ol_val in auto k5 k4 afs yes no ; do
1379                 if test "$withval" = "$ol_val" ; then
1380                         ol_arg="$ol_val"
1381                 fi
1382         done
1383         if test "$ol_arg" = "invalid" ; then
1384                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1385         fi
1386         ol_with_kerberos="$ol_arg"
1387
1388 else
1389         ol_with_kerberos="auto"
1390 fi
1391 # end --with-kerberos
1392
1393 # OpenLDAP --with-readline
1394         # Check whether --with-readline or --without-readline was given.
1395 if test "${with_readline+set}" = set; then
1396   withval="$with_readline"
1397   
1398         ol_arg=invalid
1399         for ol_val in auto yes no  ; do
1400                 if test "$withval" = "$ol_val" ; then
1401                         ol_arg="$ol_val"
1402                 fi
1403         done
1404         if test "$ol_arg" = "invalid" ; then
1405                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1406         fi
1407         ol_with_readline="$ol_arg"
1408
1409 else
1410         ol_with_readline="auto"
1411 fi
1412 # end --with-readline
1413
1414 # OpenLDAP --with-threads
1415         # Check whether --with-threads or --without-threads was given.
1416 if test "${with_threads+set}" = set; then
1417   withval="$with_threads"
1418   
1419         ol_arg=invalid
1420         for ol_val in auto posix mach pth lwp yes no manual  ; do
1421                 if test "$withval" = "$ol_val" ; then
1422                         ol_arg="$ol_val"
1423                 fi
1424         done
1425         if test "$ol_arg" = "invalid" ; then
1426                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1427         fi
1428         ol_with_threads="$ol_arg"
1429
1430 else
1431         ol_with_threads="auto"
1432 fi
1433 # end --with-threads
1434
1435 # OpenLDAP --with-tls
1436         # Check whether --with-tls or --without-tls was given.
1437 if test "${with_tls+set}" = set; then
1438   withval="$with_tls"
1439   
1440         ol_arg=invalid
1441         for ol_val in auto ssleay openssl yes no  ; do
1442                 if test "$withval" = "$ol_val" ; then
1443                         ol_arg="$ol_val"
1444                 fi
1445         done
1446         if test "$ol_arg" = "invalid" ; then
1447                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1448         fi
1449         ol_with_tls="$ol_arg"
1450
1451 else
1452         ol_with_tls="auto"
1453 fi
1454 # end --with-tls
1455
1456 # OpenLDAP --with-yielding_select
1457         # Check whether --with-yielding_select or --without-yielding_select was given.
1458 if test "${with_yielding_select+set}" = set; then
1459   withval="$with_yielding_select"
1460   
1461         ol_arg=invalid
1462         for ol_val in auto yes no manual  ; do
1463                 if test "$withval" = "$ol_val" ; then
1464                         ol_arg="$ol_val"
1465                 fi
1466         done
1467         if test "$ol_arg" = "invalid" ; then
1468                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1469         fi
1470         ol_with_yielding_select="$ol_arg"
1471
1472 else
1473         ol_with_yielding_select="auto"
1474 fi
1475 # end --with-yielding_select
1476
1477
1478
1479 # Check whether --with-xxldapdoptions or --without-xxldapdoptions was given.
1480 if test "${with_xxldapdoptions+set}" = set; then
1481   withval="$with_xxldapdoptions"
1482   :
1483 fi
1484
1485 # OpenLDAP --enable-ldapd
1486         # Check whether --enable-ldapd or --disable-ldapd was given.
1487 if test "${enable_ldapd+set}" = set; then
1488   enableval="$enable_ldapd"
1489   
1490         ol_arg=invalid
1491         for ol_val in auto yes no ; do
1492                 if test "$enableval" = "$ol_val" ; then
1493                         ol_arg="$ol_val"
1494                 fi
1495         done
1496         if test "$ol_arg" = "invalid" ; then
1497                 { echo "configure: error: bad value $enableval for --enable-ldapd" 1>&2; exit 1; }
1498         fi
1499         ol_enable_ldapd="$ol_arg"
1500
1501 else
1502         ol_enable_ldapd="no"
1503 fi
1504 # end --enable-ldapd
1505
1506 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1507 if test "${with_xxslapdoptions+set}" = set; then
1508   withval="$with_xxslapdoptions"
1509   :
1510 fi
1511
1512 # OpenLDAP --enable-slapd
1513         # Check whether --enable-slapd or --disable-slapd was given.
1514 if test "${enable_slapd+set}" = set; then
1515   enableval="$enable_slapd"
1516   
1517         ol_arg=invalid
1518         for ol_val in auto yes no ; do
1519                 if test "$enableval" = "$ol_val" ; then
1520                         ol_arg="$ol_val"
1521                 fi
1522         done
1523         if test "$ol_arg" = "invalid" ; then
1524                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1525         fi
1526         ol_enable_slapd="$ol_arg"
1527
1528 else
1529         ol_enable_slapd="yes"
1530 fi
1531 # end --enable-slapd
1532 # OpenLDAP --enable-cleartext
1533         # Check whether --enable-cleartext or --disable-cleartext was given.
1534 if test "${enable_cleartext+set}" = set; then
1535   enableval="$enable_cleartext"
1536   
1537         ol_arg=invalid
1538         for ol_val in auto yes no ; do
1539                 if test "$enableval" = "$ol_val" ; then
1540                         ol_arg="$ol_val"
1541                 fi
1542         done
1543         if test "$ol_arg" = "invalid" ; then
1544                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1545         fi
1546         ol_enable_cleartext="$ol_arg"
1547
1548 else
1549         ol_enable_cleartext="yes"
1550 fi
1551 # end --enable-cleartext
1552 # OpenLDAP --enable-crypt
1553         # Check whether --enable-crypt or --disable-crypt was given.
1554 if test "${enable_crypt+set}" = set; then
1555   enableval="$enable_crypt"
1556   
1557         ol_arg=invalid
1558         for ol_val in auto yes no ; do
1559                 if test "$enableval" = "$ol_val" ; then
1560                         ol_arg="$ol_val"
1561                 fi
1562         done
1563         if test "$ol_arg" = "invalid" ; then
1564                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1565         fi
1566         ol_enable_crypt="$ol_arg"
1567
1568 else
1569         ol_enable_crypt="auto"
1570 fi
1571 # end --enable-crypt
1572 # OpenLDAP --enable-modules
1573         # Check whether --enable-modules or --disable-modules was given.
1574 if test "${enable_modules+set}" = set; then
1575   enableval="$enable_modules"
1576   
1577         ol_arg=invalid
1578         for ol_val in auto yes no ; do
1579                 if test "$enableval" = "$ol_val" ; then
1580                         ol_arg="$ol_val"
1581                 fi
1582         done
1583         if test "$ol_arg" = "invalid" ; then
1584                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1585         fi
1586         ol_enable_modules="$ol_arg"
1587
1588 else
1589         ol_enable_modules="no"
1590 fi
1591 # end --enable-modules
1592 # OpenLDAP --enable-multimaster
1593         # Check whether --enable-multimaster or --disable-multimaster was given.
1594 if test "${enable_multimaster+set}" = set; then
1595   enableval="$enable_multimaster"
1596   
1597         ol_arg=invalid
1598         for ol_val in auto yes no ; do
1599                 if test "$enableval" = "$ol_val" ; then
1600                         ol_arg="$ol_val"
1601                 fi
1602         done
1603         if test "$ol_arg" = "invalid" ; then
1604                 { echo "configure: error: bad value $enableval for --enable-multimaster" 1>&2; exit 1; }
1605         fi
1606         ol_enable_multimaster="$ol_arg"
1607
1608 else
1609         ol_enable_multimaster="no"
1610 fi
1611 # end --enable-multimaster
1612 # OpenLDAP --enable-phonetic
1613         # Check whether --enable-phonetic or --disable-phonetic was given.
1614 if test "${enable_phonetic+set}" = set; then
1615   enableval="$enable_phonetic"
1616   
1617         ol_arg=invalid
1618         for ol_val in auto yes no ; do
1619                 if test "$enableval" = "$ol_val" ; then
1620                         ol_arg="$ol_val"
1621                 fi
1622         done
1623         if test "$ol_arg" = "invalid" ; then
1624                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1625         fi
1626         ol_enable_phonetic="$ol_arg"
1627
1628 else
1629         ol_enable_phonetic="no"
1630 fi
1631 # end --enable-phonetic
1632 # OpenLDAP --enable-quipu
1633         # Check whether --enable-quipu or --disable-quipu was given.
1634 if test "${enable_quipu+set}" = set; then
1635   enableval="$enable_quipu"
1636   
1637         ol_arg=invalid
1638         for ol_val in auto yes no ; do
1639                 if test "$enableval" = "$ol_val" ; then
1640                         ol_arg="$ol_val"
1641                 fi
1642         done
1643         if test "$ol_arg" = "invalid" ; then
1644                 { echo "configure: error: bad value $enableval for --enable-quipu" 1>&2; exit 1; }
1645         fi
1646         ol_enable_quipu="$ol_arg"
1647
1648 else
1649         ol_enable_quipu="no"
1650 fi
1651 # end --enable-quipu
1652 # OpenLDAP --enable-rlookups
1653         # Check whether --enable-rlookups or --disable-rlookups was given.
1654 if test "${enable_rlookups+set}" = set; then
1655   enableval="$enable_rlookups"
1656   
1657         ol_arg=invalid
1658         for ol_val in auto yes no ; do
1659                 if test "$enableval" = "$ol_val" ; then
1660                         ol_arg="$ol_val"
1661                 fi
1662         done
1663         if test "$ol_arg" = "invalid" ; then
1664                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1665         fi
1666         ol_enable_rlookups="$ol_arg"
1667
1668 else
1669         ol_enable_rlookups="auto"
1670 fi
1671 # end --enable-rlookups
1672 # OpenLDAP --enable-aci
1673         # Check whether --enable-aci or --disable-aci was given.
1674 if test "${enable_aci+set}" = set; then
1675   enableval="$enable_aci"
1676   
1677         ol_arg=invalid
1678         for ol_val in auto yes no ; do
1679                 if test "$enableval" = "$ol_val" ; then
1680                         ol_arg="$ol_val"
1681                 fi
1682         done
1683         if test "$ol_arg" = "invalid" ; then
1684                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1685         fi
1686         ol_enable_aci="$ol_arg"
1687
1688 else
1689         ol_enable_aci="no"
1690 fi
1691 # end --enable-aci
1692 # OpenLDAP --enable-discreteaci
1693         # Check whether --enable-discreteaci or --disable-discreteaci was given.
1694 if test "${enable_discreteaci+set}" = set; then
1695   enableval="$enable_discreteaci"
1696   
1697         ol_arg=invalid
1698         for ol_val in auto yes no ; do
1699                 if test "$enableval" = "$ol_val" ; then
1700                         ol_arg="$ol_val"
1701                 fi
1702         done
1703         if test "$ol_arg" = "invalid" ; then
1704                 { echo "configure: error: bad value $enableval for --enable-discreteaci" 1>&2; exit 1; }
1705         fi
1706         ol_enable_discreteaci="$ol_arg"
1707
1708 else
1709         ol_enable_discreteaci="no"
1710 fi
1711 # end --enable-discreteaci
1712 # OpenLDAP --enable-wrappers
1713         # Check whether --enable-wrappers or --disable-wrappers was given.
1714 if test "${enable_wrappers+set}" = set; then
1715   enableval="$enable_wrappers"
1716   
1717         ol_arg=invalid
1718         for ol_val in auto yes no ; do
1719                 if test "$enableval" = "$ol_val" ; then
1720                         ol_arg="$ol_val"
1721                 fi
1722         done
1723         if test "$ol_arg" = "invalid" ; then
1724                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1725         fi
1726         ol_enable_wrappers="$ol_arg"
1727
1728 else
1729         ol_enable_wrappers="no"
1730 fi
1731 # end --enable-wrappers
1732
1733 # OpenLDAP --enable-bdb2
1734         # Check whether --enable-bdb2 or --disable-bdb2 was given.
1735 if test "${enable_bdb2+set}" = set; then
1736   enableval="$enable_bdb2"
1737   
1738         ol_arg=invalid
1739         for ol_val in auto yes no ; do
1740                 if test "$enableval" = "$ol_val" ; then
1741                         ol_arg="$ol_val"
1742                 fi
1743         done
1744         if test "$ol_arg" = "invalid" ; then
1745                 { echo "configure: error: bad value $enableval for --enable-bdb2" 1>&2; exit 1; }
1746         fi
1747         ol_enable_bdb2="$ol_arg"
1748
1749 else
1750         ol_enable_bdb2="no"
1751 fi
1752 # end --enable-bdb2
1753 # OpenLDAP --with-bdb2_module
1754         # Check whether --with-bdb2_module or --without-bdb2_module was given.
1755 if test "${with_bdb2_module+set}" = set; then
1756   withval="$with_bdb2_module"
1757   
1758         ol_arg=invalid
1759         for ol_val in static dynamic ; do
1760                 if test "$withval" = "$ol_val" ; then
1761                         ol_arg="$ol_val"
1762                 fi
1763         done
1764         if test "$ol_arg" = "invalid" ; then
1765                 { echo "configure: error: bad value $withval for --with-bdb2_module" 1>&2; exit 1; }
1766         fi
1767         ol_with_bdb2_module="$ol_arg"
1768
1769 else
1770         ol_with_bdb2_module="static"
1771 fi
1772 # end --with-bdb2_module
1773
1774 # OpenLDAP --enable-ldap
1775         # Check whether --enable-ldap or --disable-ldap was given.
1776 if test "${enable_ldap+set}" = set; then
1777   enableval="$enable_ldap"
1778   
1779         ol_arg=invalid
1780         for ol_val in auto yes no ; do
1781                 if test "$enableval" = "$ol_val" ; then
1782                         ol_arg="$ol_val"
1783                 fi
1784         done
1785         if test "$ol_arg" = "invalid" ; then
1786                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1787         fi
1788         ol_enable_ldap="$ol_arg"
1789
1790 else
1791         ol_enable_ldap="no"
1792 fi
1793 # end --enable-ldap
1794 # OpenLDAP --with-ldap_module
1795         # Check whether --with-ldap_module or --without-ldap_module was given.
1796 if test "${with_ldap_module+set}" = set; then
1797   withval="$with_ldap_module"
1798   
1799         ol_arg=invalid
1800         for ol_val in static dynamic ; do
1801                 if test "$withval" = "$ol_val" ; then
1802                         ol_arg="$ol_val"
1803                 fi
1804         done
1805         if test "$ol_arg" = "invalid" ; then
1806                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
1807         fi
1808         ol_with_ldap_module="$ol_arg"
1809
1810 else
1811         ol_with_ldap_module="static"
1812 fi
1813 # end --with-ldap_module
1814
1815 # OpenLDAP --enable-ldbm
1816         # Check whether --enable-ldbm or --disable-ldbm was given.
1817 if test "${enable_ldbm+set}" = set; then
1818   enableval="$enable_ldbm"
1819   
1820         ol_arg=invalid
1821         for ol_val in auto yes no ; do
1822                 if test "$enableval" = "$ol_val" ; then
1823                         ol_arg="$ol_val"
1824                 fi
1825         done
1826         if test "$ol_arg" = "invalid" ; then
1827                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1828         fi
1829         ol_enable_ldbm="$ol_arg"
1830
1831 else
1832         ol_enable_ldbm="yes"
1833 fi
1834 # end --enable-ldbm
1835 # OpenLDAP --with-ldbm_api
1836         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1837 if test "${with_ldbm_api+set}" = set; then
1838   withval="$with_ldbm_api"
1839   
1840         ol_arg=invalid
1841         for ol_val in auto db2 db mdbm gdbm ndbm manual ; do
1842                 if test "$withval" = "$ol_val" ; then
1843                         ol_arg="$ol_val"
1844                 fi
1845         done
1846         if test "$ol_arg" = "invalid" ; then
1847                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1848         fi
1849         ol_with_ldbm_api="$ol_arg"
1850
1851 else
1852         ol_with_ldbm_api="auto"
1853 fi
1854 # end --with-ldbm_api
1855
1856 # OpenLDAP --with-ldbm_module
1857         # Check whether --with-ldbm_module or --without-ldbm_module was given.
1858 if test "${with_ldbm_module+set}" = set; then
1859   withval="$with_ldbm_module"
1860   
1861         ol_arg=invalid
1862         for ol_val in static dynamic ; do
1863                 if test "$withval" = "$ol_val" ; then
1864                         ol_arg="$ol_val"
1865                 fi
1866         done
1867         if test "$ol_arg" = "invalid" ; then
1868                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
1869         fi
1870         ol_with_ldbm_module="$ol_arg"
1871
1872 else
1873         ol_with_ldbm_module="static"
1874 fi
1875 # end --with-ldbm_module
1876
1877 # OpenLDAP --with-ldbm_type
1878         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1879 if test "${with_ldbm_type+set}" = set; then
1880   withval="$with_ldbm_type"
1881   
1882         ol_arg=invalid
1883         for ol_val in auto btree hash ; do
1884                 if test "$withval" = "$ol_val" ; then
1885                         ol_arg="$ol_val"
1886                 fi
1887         done
1888         if test "$ol_arg" = "invalid" ; then
1889                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1890         fi
1891         ol_with_ldbm_type="$ol_arg"
1892
1893 else
1894         ol_with_ldbm_type="auto"
1895 fi
1896 # end --with-ldbm_type
1897
1898
1899 # OpenLDAP --enable-passwd
1900         # Check whether --enable-passwd or --disable-passwd was given.
1901 if test "${enable_passwd+set}" = set; then
1902   enableval="$enable_passwd"
1903   
1904         ol_arg=invalid
1905         for ol_val in auto yes no ; do
1906                 if test "$enableval" = "$ol_val" ; then
1907                         ol_arg="$ol_val"
1908                 fi
1909         done
1910         if test "$ol_arg" = "invalid" ; then
1911                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1912         fi
1913         ol_enable_passwd="$ol_arg"
1914
1915 else
1916         ol_enable_passwd="no"
1917 fi
1918 # end --enable-passwd
1919 # OpenLDAP --with-passwd_module
1920         # Check whether --with-passwd_module or --without-passwd_module was given.
1921 if test "${with_passwd_module+set}" = set; then
1922   withval="$with_passwd_module"
1923   
1924         ol_arg=invalid
1925         for ol_val in static dynamic ; do
1926                 if test "$withval" = "$ol_val" ; then
1927                         ol_arg="$ol_val"
1928                 fi
1929         done
1930         if test "$ol_arg" = "invalid" ; then
1931                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
1932         fi
1933         ol_with_passwd_module="$ol_arg"
1934
1935 else
1936         ol_with_passwd_module="static"
1937 fi
1938 # end --with-passwd_module
1939
1940 # OpenLDAP --enable-perl
1941         # Check whether --enable-perl or --disable-perl was given.
1942 if test "${enable_perl+set}" = set; then
1943   enableval="$enable_perl"
1944   
1945         ol_arg=invalid
1946         for ol_val in auto yes no ; do
1947                 if test "$enableval" = "$ol_val" ; then
1948                         ol_arg="$ol_val"
1949                 fi
1950         done
1951         if test "$ol_arg" = "invalid" ; then
1952                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
1953         fi
1954         ol_enable_perl="$ol_arg"
1955
1956 else
1957         ol_enable_perl="no"
1958 fi
1959 # end --enable-perl
1960 # OpenLDAP --with-perl_module
1961         # Check whether --with-perl_module or --without-perl_module was given.
1962 if test "${with_perl_module+set}" = set; then
1963   withval="$with_perl_module"
1964   
1965         ol_arg=invalid
1966         for ol_val in static dynamic ; do
1967                 if test "$withval" = "$ol_val" ; then
1968                         ol_arg="$ol_val"
1969                 fi
1970         done
1971         if test "$ol_arg" = "invalid" ; then
1972                 { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; }
1973         fi
1974         ol_with_perl_module="$ol_arg"
1975
1976 else
1977         ol_with_perl_module="static"
1978 fi
1979 # end --with-perl_module
1980
1981 # OpenLDAP --enable-shell
1982         # Check whether --enable-shell or --disable-shell was given.
1983 if test "${enable_shell+set}" = set; then
1984   enableval="$enable_shell"
1985   
1986         ol_arg=invalid
1987         for ol_val in auto yes no ; do
1988                 if test "$enableval" = "$ol_val" ; then
1989                         ol_arg="$ol_val"
1990                 fi
1991         done
1992         if test "$ol_arg" = "invalid" ; then
1993                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
1994         fi
1995         ol_enable_shell="$ol_arg"
1996
1997 else
1998         ol_enable_shell="no"
1999 fi
2000 # end --enable-shell
2001 # OpenLDAP --with-shell_module
2002         # Check whether --with-shell_module or --without-shell_module was given.
2003 if test "${with_shell_module+set}" = set; then
2004   withval="$with_shell_module"
2005   
2006         ol_arg=invalid
2007         for ol_val in static dynamic ; do
2008                 if test "$withval" = "$ol_val" ; then
2009                         ol_arg="$ol_val"
2010                 fi
2011         done
2012         if test "$ol_arg" = "invalid" ; then
2013                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
2014         fi
2015         ol_with_shell_module="$ol_arg"
2016
2017 else
2018         ol_with_shell_module="static"
2019 fi
2020 # end --with-shell_module
2021
2022 # OpenLDAP --enable-tcl
2023         # Check whether --enable-tcl or --disable-tcl was given.
2024 if test "${enable_tcl+set}" = set; then
2025   enableval="$enable_tcl"
2026   
2027         ol_arg=invalid
2028         for ol_val in auto yes no ; do
2029                 if test "$enableval" = "$ol_val" ; then
2030                         ol_arg="$ol_val"
2031                 fi
2032         done
2033         if test "$ol_arg" = "invalid" ; then
2034                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
2035         fi
2036         ol_enable_tcl="$ol_arg"
2037
2038 else
2039         ol_enable_tcl="no"
2040 fi
2041 # end --enable-tcl
2042 # OpenLDAP --with-tcl_module
2043         # Check whether --with-tcl_module or --without-tcl_module was given.
2044 if test "${with_tcl_module+set}" = set; then
2045   withval="$with_tcl_module"
2046   
2047         ol_arg=invalid
2048         for ol_val in static dynamic ; do
2049                 if test "$withval" = "$ol_val" ; then
2050                         ol_arg="$ol_val"
2051                 fi
2052         done
2053         if test "$ol_arg" = "invalid" ; then
2054                 { echo "configure: error: bad value $withval for --with-tcl_module" 1>&2; exit 1; }
2055         fi
2056         ol_with_tcl_module="$ol_arg"
2057
2058 else
2059         ol_with_tcl_module="static"
2060 fi
2061 # end --with-tcl_module
2062
2063
2064 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2065 if test "${with_xxslurpdoptions+set}" = set; then
2066   withval="$with_xxslurpdoptions"
2067   :
2068 fi
2069
2070 # OpenLDAP --enable-slurpd
2071         # Check whether --enable-slurpd or --disable-slurpd was given.
2072 if test "${enable_slurpd+set}" = set; then
2073   enableval="$enable_slurpd"
2074   
2075         ol_arg=invalid
2076         for ol_val in auto yes no ; do
2077                 if test "$enableval" = "$ol_val" ; then
2078                         ol_arg="$ol_val"
2079                 fi
2080         done
2081         if test "$ol_arg" = "invalid" ; then
2082                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2083         fi
2084         ol_enable_slurpd="$ol_arg"
2085
2086 else
2087         ol_enable_slurpd="auto"
2088 fi
2089 # end --enable-slurpd
2090
2091 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2092 if test "${with_xxliboptions+set}" = set; then
2093   withval="$with_xxliboptions"
2094   :
2095 fi
2096
2097 # Check whether --enable-static or --disable-static was given.
2098 if test "${enable_static+set}" = set; then
2099   enableval="$enable_static"
2100   p=${PACKAGE-default}
2101 case "$enableval" in
2102 yes) enable_static=yes ;;
2103 no) enable_static=no ;;
2104 *)
2105   enable_static=no
2106   # Look at the argument we got.  We use all the common list separators.
2107   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2108   for pkg in $enableval; do
2109     if test "X$pkg" = "X$p"; then
2110       enable_static=yes
2111     fi
2112   done
2113   IFS="$ac_save_ifs"
2114   ;;
2115 esac
2116 else
2117   enable_static=yes
2118 fi
2119
2120 # Check whether --enable-shared or --disable-shared was given.
2121 if test "${enable_shared+set}" = set; then
2122   enableval="$enable_shared"
2123   p=${PACKAGE-default}
2124 case "$enableval" in
2125 yes) enable_shared=yes ;;
2126 no) enable_shared=no ;;
2127 *)
2128   enable_shared=no
2129   # Look at the argument we got.  We use all the common list separators.
2130   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2131   for pkg in $enableval; do
2132     if test "X$pkg" = "X$p"; then
2133       enable_shared=yes
2134     fi
2135   done
2136   IFS="$ac_save_ifs"
2137   ;;
2138 esac
2139 else
2140   enable_shared=yes
2141 fi
2142
2143
2144 # validate options
2145 if test $ol_enable_dns = yes ; then
2146         if test $ol_enable_referrals = no ; then
2147                 { echo "configure: error: DNS requires --enable-referrals" 1>&2; exit 1; }
2148         fi
2149         if test $ol_enable_referrals = auto ; then
2150                 echo "configure: warning: DNS requires referrals, adding --enable-referrals" 1>&2
2151                 ol_enable_referrals=yes
2152         fi
2153 fi
2154
2155 if test $ol_enable_slapd = no ; then
2156                 if test $ol_enable_bdb2 = yes ; then
2157                 echo "configure: warning: slapd disabled, ignoring --enable-bdb2 argument" 1>&2
2158         fi
2159         if test $ol_enable_ldap = yes ; then
2160                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2161         fi
2162         if test $ol_enable_ldbm = yes ; then
2163                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2164         fi
2165         if test $ol_enable_passwd = yes ; then
2166                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2167         fi
2168         if test $ol_enable_perl = yes ; then
2169                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
2170         fi
2171         if test $ol_enable_shell = yes ; then
2172                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2173         fi
2174         if test $ol_enable_tcl = yes ; then
2175                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
2176         fi
2177         if test $ol_enable_modules = yes ; then
2178                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2179         fi
2180         if test $ol_enable_multimaster = yes ; then
2181                 echo "configure: warning: slapd disabled, ignoring --enable-multimaster argument" 1>&2
2182         fi
2183         if test $ol_enable_wrappers = yes ; then
2184                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2185         fi
2186         if test $ol_enable_phonetic = yes ; then
2187                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2188         fi
2189         if test $ol_enable_quipu = yes ; then
2190                 echo "configure: warning: slapd disabled, ignoring --enable-quipu argument" 1>&2
2191         fi
2192         if test $ol_enable_rlookups = yes ; then
2193                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2194         fi
2195         if test $ol_enable_aci = yes ; then
2196                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2197         fi
2198         if test $ol_enable_discreteaci = yes ; then
2199                 echo "configure: warning: slapd disabled, ignoring --enable-discreteaci argument" 1>&2
2200         fi
2201         if test $ol_with_ldbm_api != auto ; then
2202                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2203         fi
2204         if test $ol_with_ldbm_type != auto ; then
2205                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2206         fi
2207         if test $ol_with_bdb2_module != static ; then
2208                 echo "configure: warning: slapd disabled, ignoring --with-bdb2-module argument" 1>&2
2209         fi
2210         if test $ol_with_ldap_module != static ; then
2211                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2212         fi
2213         if test $ol_with_ldbm_module != static ; then
2214                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2215         fi
2216         if test $ol_with_passwd_module != static ; then
2217                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2218         fi
2219         if test $ol_with_perl_module != static ; then
2220                 echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
2221         fi
2222         if test $ol_with_shell_module != static ; then
2223                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2224         fi
2225         if test $ol_with_tcl_module != static ; then
2226                 echo "configure: warning: slapd disabled, ignoring --with-tcl-module argument" 1>&2
2227         fi
2228         if test $ol_enable_slurpd = yes ; then
2229                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2230         fi
2231
2232         # force settings to no
2233         ol_enable_bdb2=no
2234         ol_enable_ldap=no
2235         ol_enable_ldbm=no
2236         ol_enable_passwd=no
2237         ol_enable_perl=no
2238         ol_enable_shell=no
2239         ol_enable_tcl=no
2240
2241         ol_enable_modules=no
2242         ol_enable_multimaster=no
2243         ol_enable_phonetic=no
2244         ol_enable_quipu=no
2245         ol_enable_rlookups=no
2246         ol_enable_aci=no
2247         ol_enable_discreteaci=no
2248         ol_enable_wrappers=no
2249
2250         ol_with_ldbm_api=no
2251         ol_with_ldbm_type=no
2252
2253         ol_with_bdb2_module=static
2254         ol_with_ldap_module=static
2255         ol_with_ldbm_module=static
2256         ol_with_passwd_module=static
2257         ol_with_perl_module=static
2258         ol_with_shell_module=static
2259         ol_with_tcl_module=static
2260
2261         ol_enable_slurpd=no
2262
2263 elif test $ol_enable_ldbm = no ; then
2264         
2265         if test $ol_with_ldbm_api != auto ; then
2266                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2267         fi
2268
2269         if test $ol_with_ldbm_type != auto ; then
2270                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2271         fi
2272
2273         if test $ol_with_ldbm_module != static ; then
2274                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2275         fi
2276
2277         if test $ol_enable_bdb2 = yes ; then
2278                 { echo "configure: error: BDB2 requires --enable-ldbm" 1>&2; exit 1; }
2279         fi
2280
2281         if test $ol_enable_modules != yes -a \
2282                 $ol_enable_ldap = no -a \
2283                 $ol_enable_passwd = no -a \
2284                 $ol_enable_perl = no -a \
2285                 $ol_enable_shell = no -a \
2286                 $ol_enable_tcl = no ; then
2287                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2288         fi
2289
2290         ol_with_ldbm_api=no
2291         ol_with_ldbm_type=no
2292         ol_with_ldbm_module=static
2293
2294 elif test $ol_enable_bdb2 = yes ; then
2295         
2296         if test $ol_with_ldbm_api != auto -a \
2297                 $ol_with_ldbm_api != db2 ; then
2298                 { echo "configure: error: BDB2 requires LDBM API DB2" 1>&2; exit 1; }
2299         fi
2300
2301         ol_with_ldbm_api=db2
2302
2303 else
2304         
2305         if test $ol_enable_bdb2 != no ; then
2306                 if test $ol_with_ldbm_api != auto -a \
2307                         $ol_with_ldbm_api != db2 ; then
2308                         echo "configure: warning: BDB2 requires LDBM api db2 or auto" 1>&2
2309                         ol_enable_bdb2=no
2310                 fi
2311         fi
2312
2313         if test $ol_with_ldbm_api = gdbm -a \
2314                 $ol_with_ldbm_type = btree ; then
2315                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2316         fi
2317         if test $ol_with_ldbm_api = mdbm -a \
2318                 $ol_with_ldbm_type = btree ; then
2319                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2320         fi
2321         if test $ol_with_ldbm_api = ndbm -a \
2322                 $ol_with_ldbm_type = btree ; then
2323                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2324         fi
2325 fi
2326
2327 if test $ol_enable_slurpd = yes ; then
2328                 if test $ol_with_threads = no ; then
2329                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2330         fi
2331 fi
2332
2333 echo "$ac_t""done" 1>&6
2334
2335 ## Initialize vars
2336 LDAP_LIBS=
2337 LDIF_LIBS=
2338 LDBM_LIBS=
2339 LTHREAD_LIBS=
2340 LUTIL_LIBS=
2341
2342 LDAPD_LIBS=
2343 SLAPD_LIBS=
2344 SLURPD_LIBS=
2345
2346 BUILD_LDAPD=no
2347 BUILD_SLAPD=no
2348 BUILD_SLURPD=no
2349
2350 BUILD_BDB2=no
2351 BUILD_LDAP=no
2352 BUILD_LDBM=no
2353 BUILD_PASSWD=no
2354 BUILD_PERL=no
2355 BUILD_QUIPU=no
2356 BUILD_SHELL=no
2357 BUILD_TCL=no
2358 BUILD_THREAD=no
2359
2360 BUILD_BDB2_DYNAMIC=static
2361 BUILD_LDAP_DYNAMIC=static
2362 BUILD_LDBM_DYNAMIC=static
2363 BUILD_PASSWD_DYNAMIC=static
2364 BUILD_PERL_DYNAMIC=static
2365 BUILD_SHELL_DYNAMIC=static
2366 BUILD_TCL_DYNAMIC=static
2367
2368 SLAPD_MODULES_LDFLAGS=
2369 SLAPD_MODULES_CPPFLAGS=
2370 SLAPD_MODULES_LIST=
2371
2372 SLAPD_PERL_LDFLAGS=
2373 SLAPD_PERL_CPPFLAGS=
2374
2375 KRB_LIBS=
2376 READLINE_LIBS=
2377 SASL_LIBS=
2378 TERMCAP_LIBS=
2379 TLS_LIBS=
2380 MODULES_LIBS=
2381
2382
2383
2384 cat >> confdefs.h <<\EOF
2385 #define HAVE_MKVERSION 1
2386 EOF
2387
2388
2389
2390
2391 ol_aix_threads=no
2392 case "$target" in
2393 *-*-aix*)       if test -z "$CC" ; then
2394                 case "$ol_with_threads" in
2395                 auto | yes |  posix) ol_aix_threads=yes ;;
2396                 esac
2397         fi
2398 ;;
2399 esac
2400
2401 if test $ol_aix_threads = yes ; then
2402         if test -z "${CC}" ; then
2403                 for ac_prog in cc_r xlc_r cc
2404 do
2405 # Extract the first word of "$ac_prog", so it can be a program name with args.
2406 set dummy $ac_prog; ac_word=$2
2407 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2408 echo "configure:2409: checking for $ac_word" >&5
2409 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2410   echo $ac_n "(cached) $ac_c" 1>&6
2411 else
2412   if test -n "$CC"; then
2413   ac_cv_prog_CC="$CC" # Let the user override the test.
2414 else
2415   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2416   ac_dummy="$PATH"
2417   for ac_dir in $ac_dummy; do
2418     test -z "$ac_dir" && ac_dir=.
2419     if test -f $ac_dir/$ac_word; then
2420       ac_cv_prog_CC="$ac_prog"
2421       break
2422     fi
2423   done
2424   IFS="$ac_save_ifs"
2425 fi
2426 fi
2427 CC="$ac_cv_prog_CC"
2428 if test -n "$CC"; then
2429   echo "$ac_t""$CC" 1>&6
2430 else
2431   echo "$ac_t""no" 1>&6
2432 fi
2433
2434 test -n "$CC" && break
2435 done
2436
2437
2438                 if test "$CC" = cc ; then
2439                                                 if test $ol_with_threads != auto ; then
2440                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2441                         else
2442                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2443                         fi
2444                         ol_with_threads=no
2445                 fi
2446         fi
2447
2448         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2449                 ol_with_threads=posix
2450                 ol_cv_pthread_create=yes
2451         fi
2452 fi
2453
2454 if test -z "${CC}"; then
2455         for ac_prog in cc
2456 do
2457 # Extract the first word of "$ac_prog", so it can be a program name with args.
2458 set dummy $ac_prog; ac_word=$2
2459 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2460 echo "configure:2461: checking for $ac_word" >&5
2461 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2462   echo $ac_n "(cached) $ac_c" 1>&6
2463 else
2464   if test -n "$CC"; then
2465   ac_cv_prog_CC="$CC" # Let the user override the test.
2466 else
2467   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2468   ac_dummy="$PATH"
2469   for ac_dir in $ac_dummy; do
2470     test -z "$ac_dir" && ac_dir=.
2471     if test -f $ac_dir/$ac_word; then
2472       ac_cv_prog_CC="$ac_prog"
2473       break
2474     fi
2475   done
2476   IFS="$ac_save_ifs"
2477 fi
2478 fi
2479 CC="$ac_cv_prog_CC"
2480 if test -n "$CC"; then
2481   echo "$ac_t""$CC" 1>&6
2482 else
2483   echo "$ac_t""no" 1>&6
2484 fi
2485
2486 test -n "$CC" && break
2487 done
2488
2489 fi
2490
2491
2492
2493 # Check whether --enable-fast-install or --disable-fast-install was given.
2494 if test "${enable_fast_install+set}" = set; then
2495   enableval="$enable_fast_install"
2496   p=${PACKAGE-default}
2497 case "$enableval" in
2498 yes) enable_fast_install=yes ;;
2499 no) enable_fast_install=no ;;
2500 *)
2501   enable_fast_install=no
2502   # Look at the argument we got.  We use all the common list separators.
2503   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2504   for pkg in $enableval; do
2505     if test "X$pkg" = "X$p"; then
2506       enable_fast_install=yes
2507     fi
2508   done
2509   IFS="$ac_save_ifs"
2510   ;;
2511 esac
2512 else
2513   enable_fast_install=yes
2514 fi
2515
2516 # Extract the first word of "ranlib", so it can be a program name with args.
2517 set dummy ranlib; ac_word=$2
2518 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2519 echo "configure:2520: checking for $ac_word" >&5
2520 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
2521   echo $ac_n "(cached) $ac_c" 1>&6
2522 else
2523   if test -n "$RANLIB"; then
2524   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2525 else
2526   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2527   ac_dummy="$PATH"
2528   for ac_dir in $ac_dummy; do
2529     test -z "$ac_dir" && ac_dir=.
2530     if test -f $ac_dir/$ac_word; then
2531       ac_cv_prog_RANLIB="ranlib"
2532       break
2533     fi
2534   done
2535   IFS="$ac_save_ifs"
2536   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2537 fi
2538 fi
2539 RANLIB="$ac_cv_prog_RANLIB"
2540 if test -n "$RANLIB"; then
2541   echo "$ac_t""$RANLIB" 1>&6
2542 else
2543   echo "$ac_t""no" 1>&6
2544 fi
2545
2546 # Extract the first word of "gcc", so it can be a program name with args.
2547 set dummy gcc; ac_word=$2
2548 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2549 echo "configure:2550: checking for $ac_word" >&5
2550 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2551   echo $ac_n "(cached) $ac_c" 1>&6
2552 else
2553   if test -n "$CC"; then
2554   ac_cv_prog_CC="$CC" # Let the user override the test.
2555 else
2556   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2557   ac_dummy="$PATH"
2558   for ac_dir in $ac_dummy; do
2559     test -z "$ac_dir" && ac_dir=.
2560     if test -f $ac_dir/$ac_word; then
2561       ac_cv_prog_CC="gcc"
2562       break
2563     fi
2564   done
2565   IFS="$ac_save_ifs"
2566 fi
2567 fi
2568 CC="$ac_cv_prog_CC"
2569 if test -n "$CC"; then
2570   echo "$ac_t""$CC" 1>&6
2571 else
2572   echo "$ac_t""no" 1>&6
2573 fi
2574
2575 if test -z "$CC"; then
2576   # Extract the first word of "cc", so it can be a program name with args.
2577 set dummy cc; ac_word=$2
2578 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2579 echo "configure:2580: checking for $ac_word" >&5
2580 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2581   echo $ac_n "(cached) $ac_c" 1>&6
2582 else
2583   if test -n "$CC"; then
2584   ac_cv_prog_CC="$CC" # Let the user override the test.
2585 else
2586   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2587   ac_prog_rejected=no
2588   ac_dummy="$PATH"
2589   for ac_dir in $ac_dummy; do
2590     test -z "$ac_dir" && ac_dir=.
2591     if test -f $ac_dir/$ac_word; then
2592       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2593         ac_prog_rejected=yes
2594         continue
2595       fi
2596       ac_cv_prog_CC="cc"
2597       break
2598     fi
2599   done
2600   IFS="$ac_save_ifs"
2601 if test $ac_prog_rejected = yes; then
2602   # We found a bogon in the path, so make sure we never use it.
2603   set dummy $ac_cv_prog_CC
2604   shift
2605   if test $# -gt 0; then
2606     # We chose a different compiler from the bogus one.
2607     # However, it has the same basename, so the bogon will be chosen
2608     # first if we set CC to just the basename; use the full file name.
2609     shift
2610     set dummy "$ac_dir/$ac_word" "$@"
2611     shift
2612     ac_cv_prog_CC="$@"
2613   fi
2614 fi
2615 fi
2616 fi
2617 CC="$ac_cv_prog_CC"
2618 if test -n "$CC"; then
2619   echo "$ac_t""$CC" 1>&6
2620 else
2621   echo "$ac_t""no" 1>&6
2622 fi
2623
2624   if test -z "$CC"; then
2625     case "`uname -s`" in
2626     *win32* | *WIN32* | *CYGWIN*)
2627       # Extract the first word of "cl", so it can be a program name with args.
2628 set dummy cl; ac_word=$2
2629 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2630 echo "configure:2631: checking for $ac_word" >&5
2631 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2632   echo $ac_n "(cached) $ac_c" 1>&6
2633 else
2634   if test -n "$CC"; then
2635   ac_cv_prog_CC="$CC" # Let the user override the test.
2636 else
2637   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2638   ac_dummy="$PATH"
2639   for ac_dir in $ac_dummy; do
2640     test -z "$ac_dir" && ac_dir=.
2641     if test -f $ac_dir/$ac_word; then
2642       ac_cv_prog_CC="cl"
2643       break
2644     fi
2645   done
2646   IFS="$ac_save_ifs"
2647 fi
2648 fi
2649 CC="$ac_cv_prog_CC"
2650 if test -n "$CC"; then
2651   echo "$ac_t""$CC" 1>&6
2652 else
2653   echo "$ac_t""no" 1>&6
2654 fi
2655  ;;
2656     esac
2657   fi
2658   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2659 fi
2660
2661 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2662 echo "configure:2663: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
2663
2664 ac_ext=c
2665 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2666 ac_cpp='$CPP $CPPFLAGS'
2667 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2668 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2669 cross_compiling=$ac_cv_prog_cc_cross
2670
2671 cat > conftest.$ac_ext << EOF
2672
2673 #line 2674 "configure"
2674 #include "confdefs.h"
2675
2676 main(){return(0);}
2677 EOF
2678 if { (eval echo configure:2679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2679   ac_cv_prog_cc_works=yes
2680   # If we can't run a trivial program, we are probably using a cross compiler.
2681   if (./conftest; exit) 2>/dev/null; then
2682     ac_cv_prog_cc_cross=no
2683   else
2684     ac_cv_prog_cc_cross=yes
2685   fi
2686 else
2687   echo "configure: failed program was:" >&5
2688   cat conftest.$ac_ext >&5
2689   ac_cv_prog_cc_works=no
2690 fi
2691 rm -fr conftest*
2692 ac_ext=c
2693 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2694 ac_cpp='$CPP $CPPFLAGS'
2695 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2696 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2697 cross_compiling=$ac_cv_prog_cc_cross
2698
2699 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2700 if test $ac_cv_prog_cc_works = no; then
2701   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2702 fi
2703 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2704 echo "configure:2705: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
2705 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2706 cross_compiling=$ac_cv_prog_cc_cross
2707
2708 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2709 echo "configure:2710: checking whether we are using GNU C" >&5
2710 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
2711   echo $ac_n "(cached) $ac_c" 1>&6
2712 else
2713   cat > conftest.c <<EOF
2714 #ifdef __GNUC__
2715   yes;
2716 #endif
2717 EOF
2718 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2719: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2719   ac_cv_prog_gcc=yes
2720 else
2721   ac_cv_prog_gcc=no
2722 fi
2723 fi
2724
2725 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2726
2727 if test $ac_cv_prog_gcc = yes; then
2728   GCC=yes
2729 else
2730   GCC=
2731 fi
2732
2733 ac_test_CFLAGS="${CFLAGS+set}"
2734 ac_save_CFLAGS="$CFLAGS"
2735 CFLAGS=
2736 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2737 echo "configure:2738: checking whether ${CC-cc} accepts -g" >&5
2738 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
2739   echo $ac_n "(cached) $ac_c" 1>&6
2740 else
2741   echo 'void f(){}' > conftest.c
2742 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2743   ac_cv_prog_cc_g=yes
2744 else
2745   ac_cv_prog_cc_g=no
2746 fi
2747 rm -f conftest*
2748
2749 fi
2750
2751 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2752 if test "$ac_test_CFLAGS" = set; then
2753   CFLAGS="$ac_save_CFLAGS"
2754 elif test $ac_cv_prog_cc_g = yes; then
2755   if test "$GCC" = yes; then
2756     CFLAGS="-g -O2"
2757   else
2758     CFLAGS="-g"
2759   fi
2760 else
2761   if test "$GCC" = yes; then
2762     CFLAGS="-O2"
2763   else
2764     CFLAGS=
2765   fi
2766 fi
2767
2768 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2769 if test "${with_gnu_ld+set}" = set; then
2770   withval="$with_gnu_ld"
2771   test "$withval" = no || with_gnu_ld=yes
2772 else
2773   with_gnu_ld=no
2774 fi
2775
2776 ac_prog=ld
2777 if test "$ac_cv_prog_gcc" = yes; then
2778   # Check if gcc -print-prog-name=ld gives a path.
2779   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2780 echo "configure:2781: checking for ld used by GCC" >&5
2781   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2782   case "$ac_prog" in
2783     # Accept absolute paths.
2784     [\\/]* | [A-Za-z]:[\\/]*)
2785       re_direlt='/[^/][^/]*/\.\./'
2786       # Canonicalize the path of ld
2787       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2788       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2789         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2790       done
2791       test -z "$LD" && LD="$ac_prog"
2792       ;;
2793   "")
2794     # If it fails, then pretend we aren't using GCC.
2795     ac_prog=ld
2796     ;;
2797   *)
2798     # If it is relative, then search for the first ld in PATH.
2799     with_gnu_ld=unknown
2800     ;;
2801   esac
2802 elif test "$with_gnu_ld" = yes; then
2803   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2804 echo "configure:2805: checking for GNU ld" >&5
2805 else
2806   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2807 echo "configure:2808: checking for non-GNU ld" >&5
2808 fi
2809 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
2810   echo $ac_n "(cached) $ac_c" 1>&6
2811 else
2812   if test -z "$LD"; then
2813   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2814   for ac_dir in $PATH; do
2815     test -z "$ac_dir" && ac_dir=.
2816     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2817       ac_cv_path_LD="$ac_dir/$ac_prog"
2818       # Check to see if the program is GNU ld.  I'd rather use --version,
2819       # but apparently some GNU ld's only accept -v.
2820       # Break only if it was the GNU/non-GNU ld that we prefer.
2821       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2822         test "$with_gnu_ld" != no && break
2823       else
2824         test "$with_gnu_ld" != yes && break
2825       fi
2826     fi
2827   done
2828   IFS="$ac_save_ifs"
2829 else
2830   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2831 fi
2832 fi
2833
2834 LD="$ac_cv_path_LD"
2835 if test -n "$LD"; then
2836   echo "$ac_t""$LD" 1>&6
2837 else
2838   echo "$ac_t""no" 1>&6
2839 fi
2840 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2841
2842 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2843 echo "configure:2844: checking if the linker ($LD) is GNU ld" >&5
2844 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
2845   echo $ac_n "(cached) $ac_c" 1>&6
2846 else
2847   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2848 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2849   ac_cv_prog_gnu_ld=yes
2850 else
2851   ac_cv_prog_gnu_ld=no
2852 fi
2853 fi
2854
2855 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2856
2857
2858 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2859 echo "configure:2860: checking for BSD-compatible nm" >&5
2860 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
2861   echo $ac_n "(cached) $ac_c" 1>&6
2862 else
2863   if test -n "$NM"; then
2864   # Let the user override the test.
2865   ac_cv_path_NM="$NM"
2866 else
2867   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2868   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
2869     test -z "$ac_dir" && ac_dir=.
2870     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
2871       # Check to see if the nm accepts a BSD-compat flag.
2872       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2873       #   nm: unknown option "B" ignored
2874       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2875         ac_cv_path_NM="$ac_dir/nm -B"
2876         break
2877       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2878         ac_cv_path_NM="$ac_dir/nm -p"
2879         break
2880       else
2881         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
2882         continue # so that we can try to find one that supports BSD flags
2883       fi
2884     fi
2885   done
2886   IFS="$ac_save_ifs"
2887   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2888 fi
2889 fi
2890
2891 NM="$ac_cv_path_NM"
2892 echo "$ac_t""$NM" 1>&6
2893
2894
2895 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2896 echo "configure:2897: checking whether ln -s works" >&5
2897 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
2898   echo $ac_n "(cached) $ac_c" 1>&6
2899 else
2900   rm -f conftestdata
2901 if ln -s X conftestdata 2>/dev/null
2902 then
2903   rm -f conftestdata
2904   ac_cv_prog_LN_S="ln -s"
2905 else
2906   ac_cv_prog_LN_S=ln
2907 fi
2908 fi
2909 LN_S="$ac_cv_prog_LN_S"
2910 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2911   echo "$ac_t""yes" 1>&6
2912 else
2913   echo "$ac_t""no" 1>&6
2914 fi
2915
2916
2917 # Check for any special flags to pass to ltconfig.
2918 libtool_flags="--cache-file=$cache_file"
2919 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2920 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2921 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
2922 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2923 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2924 libtool_flags="$libtool_flags --enable-dlopen"
2925
2926 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
2927 if test "${enable_libtool_lock+set}" = set; then
2928   enableval="$enable_libtool_lock"
2929   :
2930 fi
2931
2932 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
2933 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
2934
2935 # Some flags need to be propagated to the compiler or linker for good
2936 # libtool support.
2937 case "$host" in
2938 *-*-irix6*)
2939   # Find out which ABI we are using.
2940   echo '#line 2941 "configure"' > conftest.$ac_ext
2941   if { (eval echo configure:2942: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2942     case "`/usr/bin/file conftest.o`" in
2943     *32-bit*)
2944       LD="${LD-ld} -32"
2945       ;;
2946     *N32*)
2947       LD="${LD-ld} -n32"
2948       ;;
2949     *64-bit*)
2950       LD="${LD-ld} -64"
2951       ;;
2952     esac
2953   fi
2954   rm -rf conftest*
2955   ;;
2956
2957 *-*-sco3.2v5*)
2958   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2959   SAVE_CFLAGS="$CFLAGS"
2960   CFLAGS="$CFLAGS -belf"
2961   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
2962 echo "configure:2963: checking whether the C compiler needs -belf" >&5
2963 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
2964   echo $ac_n "(cached) $ac_c" 1>&6
2965 else
2966   cat > conftest.$ac_ext <<EOF
2967 #line 2968 "configure"
2968 #include "confdefs.h"
2969
2970 int main() {
2971
2972 ; return 0; }
2973 EOF
2974 if { (eval echo configure:2975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2975   rm -rf conftest*
2976   lt_cv_cc_needs_belf=yes
2977 else
2978   echo "configure: failed program was:" >&5
2979   cat conftest.$ac_ext >&5
2980   rm -rf conftest*
2981   lt_cv_cc_needs_belf=no
2982 fi
2983 rm -f conftest*
2984 fi
2985
2986 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
2987   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2988     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2989     CFLAGS="$SAVE_CFLAGS"
2990   fi
2991   ;;
2992
2993
2994 esac
2995
2996
2997 # Save cache, so that ltconfig can load it
2998
2999
3000 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
3001 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
3002 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
3003 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
3004 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
3005 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
3006 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
3007 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
3008
3009 # Reload cache, that may have been modified by ltconfig
3010
3011
3012 # This can be used to rebuild libtool when needed
3013 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
3014
3015 # Always use our own libtool.
3016 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3017
3018 # Redirect the config.log output again, so that the ltconfig log is not
3019 # clobbered by the next message.
3020 exec 5>>./config.log
3021
3022
3023 for ac_prog in mawk gawk nawk awk
3024 do
3025 # Extract the first word of "$ac_prog", so it can be a program name with args.
3026 set dummy $ac_prog; ac_word=$2
3027 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3028 echo "configure:3029: checking for $ac_word" >&5
3029 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
3030   echo $ac_n "(cached) $ac_c" 1>&6
3031 else
3032   if test -n "$AWK"; then
3033   ac_cv_prog_AWK="$AWK" # Let the user override the test.
3034 else
3035   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3036   ac_dummy="$PATH"
3037   for ac_dir in $ac_dummy; do
3038     test -z "$ac_dir" && ac_dir=.
3039     if test -f $ac_dir/$ac_word; then
3040       ac_cv_prog_AWK="$ac_prog"
3041       break
3042     fi
3043   done
3044   IFS="$ac_save_ifs"
3045 fi
3046 fi
3047 AWK="$ac_cv_prog_AWK"
3048 if test -n "$AWK"; then
3049   echo "$ac_t""$AWK" 1>&6
3050 else
3051   echo "$ac_t""no" 1>&6
3052 fi
3053
3054 test -n "$AWK" && break
3055 done
3056
3057 # test for ln hardlink support
3058 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
3059 echo "configure:3060: checking whether ln works" >&5
3060 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
3061   echo $ac_n "(cached) $ac_c" 1>&6
3062 else
3063   rm -f conftest.src conftest.dst
3064 echo "conftest" > conftest.src
3065 if ln conftest.src conftest.dst 2>/dev/null
3066 then
3067   ol_cv_prog_LN_H="ln"
3068 else
3069   ol_cv_prog_LN_H="cp"
3070 fi
3071 rm -f conftest.src conftest.dst
3072
3073 fi
3074 LN_H="$ol_cv_prog_LN_H"
3075 if test "$ol_cv_prog_LN_H" = "ln"; then
3076         echo "$ac_t""yes" 1>&6
3077 else
3078         echo "$ac_t""no" 1>&6
3079 fi
3080
3081 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3082 echo "configure:3083: checking whether ln -s works" >&5
3083 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3084   echo $ac_n "(cached) $ac_c" 1>&6
3085 else
3086   rm -f conftestdata
3087 if ln -s X conftestdata 2>/dev/null
3088 then
3089   rm -f conftestdata
3090   ac_cv_prog_LN_S="ln -s"
3091 else
3092   ac_cv_prog_LN_S=ln
3093 fi
3094 fi
3095 LN_S="$ac_cv_prog_LN_S"
3096 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3097   echo "$ac_t""yes" 1>&6
3098 else
3099   echo "$ac_t""no" 1>&6
3100 fi
3101
3102
3103 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
3104         LN_S="$LN_H"
3105 fi
3106
3107 # Extract the first word of "sendmail", so it can be a program name with args.
3108 set dummy sendmail; ac_word=$2
3109 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3110 echo "configure:3111: checking for $ac_word" >&5
3111 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
3112   echo $ac_n "(cached) $ac_c" 1>&6
3113 else
3114   case "$SENDMAIL" in
3115   /*)
3116   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
3117   ;;
3118   ?:/*)                  
3119   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
3120   ;;
3121   *)
3122   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3123   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
3124   for ac_dir in $ac_dummy; do 
3125     test -z "$ac_dir" && ac_dir=.
3126     if test -f $ac_dir/$ac_word; then
3127       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
3128       break
3129     fi
3130   done
3131   IFS="$ac_save_ifs"
3132   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
3133   ;;
3134 esac
3135 fi
3136 SENDMAIL="$ac_cv_path_SENDMAIL"
3137 if test -n "$SENDMAIL"; then
3138   echo "$ac_t""$SENDMAIL" 1>&6
3139 else
3140   echo "$ac_t""no" 1>&6
3141 fi
3142
3143 # Extract the first word of "vi", so it can be a program name with args.
3144 set dummy vi; ac_word=$2
3145 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3146 echo "configure:3147: checking for $ac_word" >&5
3147 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
3148   echo $ac_n "(cached) $ac_c" 1>&6
3149 else
3150   case "$EDITOR" in
3151   /*)
3152   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
3153   ;;
3154   ?:/*)                  
3155   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
3156   ;;
3157   *)
3158   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3159   ac_dummy="$PATH:/usr/ucb"
3160   for ac_dir in $ac_dummy; do 
3161     test -z "$ac_dir" && ac_dir=.
3162     if test -f $ac_dir/$ac_word; then
3163       ac_cv_path_EDITOR="$ac_dir/$ac_word"
3164       break
3165     fi
3166   done
3167   IFS="$ac_save_ifs"
3168   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
3169   ;;
3170 esac
3171 fi
3172 EDITOR="$ac_cv_path_EDITOR"
3173 if test -n "$EDITOR"; then
3174   echo "$ac_t""$EDITOR" 1>&6
3175 else
3176   echo "$ac_t""no" 1>&6
3177 fi
3178
3179 # Extract the first word of "finger", so it can be a program name with args.
3180 set dummy finger; ac_word=$2
3181 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3182 echo "configure:3183: checking for $ac_word" >&5
3183 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
3184   echo $ac_n "(cached) $ac_c" 1>&6
3185 else
3186   case "$FINGER" in
3187   /*)
3188   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
3189   ;;
3190   ?:/*)                  
3191   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
3192   ;;
3193   *)
3194   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3195   ac_dummy="$PATH:/usr/ucb"
3196   for ac_dir in $ac_dummy; do 
3197     test -z "$ac_dir" && ac_dir=.
3198     if test -f $ac_dir/$ac_word; then
3199       ac_cv_path_FINGER="$ac_dir/$ac_word"
3200       break
3201     fi
3202   done
3203   IFS="$ac_save_ifs"
3204   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
3205   ;;
3206 esac
3207 fi
3208 FINGER="$ac_cv_path_FINGER"
3209 if test -n "$FINGER"; then
3210   echo "$ac_t""$FINGER" 1>&6
3211 else
3212   echo "$ac_t""no" 1>&6
3213 fi
3214
3215
3216 ol_link_perl=no
3217 if test $ol_enable_perl != no ; then
3218         # Extract the first word of "perl", so it can be a program name with args.
3219 set dummy perl; ac_word=$2
3220 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3221 echo "configure:3222: checking for $ac_word" >&5
3222 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
3223   echo $ac_n "(cached) $ac_c" 1>&6
3224 else
3225   case "$PERLBIN" in
3226   /*)
3227   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
3228   ;;
3229   ?:/*)                  
3230   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
3231   ;;
3232   *)
3233   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3234   ac_dummy="$PATH"
3235   for ac_dir in $ac_dummy; do 
3236     test -z "$ac_dir" && ac_dir=.
3237     if test -f $ac_dir/$ac_word; then
3238       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
3239       break
3240     fi
3241   done
3242   IFS="$ac_save_ifs"
3243   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
3244   ;;
3245 esac
3246 fi
3247 PERLBIN="$ac_cv_path_PERLBIN"
3248 if test -n "$PERLBIN"; then
3249   echo "$ac_t""$PERLBIN" 1>&6
3250 else
3251   echo "$ac_t""no" 1>&6
3252 fi
3253
3254
3255         if test "no$PERLBIN" = "no" ; then
3256                 if test $ol_enable_perl = yes ; then
3257                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
3258                 fi
3259
3260         else
3261                 SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3262                 SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
3263
3264                                 ol_link_perl=yes
3265         fi
3266 fi
3267
3268 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3269 echo "configure:3270: checking how to run the C preprocessor" >&5
3270 # On Suns, sometimes $CPP names a directory.
3271 if test -n "$CPP" && test -d "$CPP"; then
3272   CPP=
3273 fi
3274 if test -z "$CPP"; then
3275 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3276   echo $ac_n "(cached) $ac_c" 1>&6
3277 else
3278     # This must be in double quotes, not single quotes, because CPP may get
3279   # substituted into the Makefile and "${CC-cc}" will confuse make.
3280   CPP="${CC-cc} -E"
3281   # On the NeXT, cc -E runs the code through the compiler's parser,
3282   # not just through cpp.
3283   cat > conftest.$ac_ext <<EOF
3284 #line 3285 "configure"
3285 #include "confdefs.h"
3286 #include <assert.h>
3287 Syntax Error
3288 EOF
3289 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3290 { (eval echo configure:3291: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3291 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3292 if test -z "$ac_err"; then
3293   :
3294 else
3295   echo "$ac_err" >&5
3296   echo "configure: failed program was:" >&5
3297   cat conftest.$ac_ext >&5
3298   rm -rf conftest*
3299   CPP="${CC-cc} -E -traditional-cpp"
3300   cat > conftest.$ac_ext <<EOF
3301 #line 3302 "configure"
3302 #include "confdefs.h"
3303 #include <assert.h>
3304 Syntax Error
3305 EOF
3306 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3307 { (eval echo configure:3308: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3308 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3309 if test -z "$ac_err"; then
3310   :
3311 else
3312   echo "$ac_err" >&5
3313   echo "configure: failed program was:" >&5
3314   cat conftest.$ac_ext >&5
3315   rm -rf conftest*
3316   CPP="${CC-cc} -nologo -E"
3317   cat > conftest.$ac_ext <<EOF
3318 #line 3319 "configure"
3319 #include "confdefs.h"
3320 #include <assert.h>
3321 Syntax Error
3322 EOF
3323 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3324 { (eval echo configure:3325: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3325 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3326 if test -z "$ac_err"; then
3327   :
3328 else
3329   echo "$ac_err" >&5
3330   echo "configure: failed program was:" >&5
3331   cat conftest.$ac_ext >&5
3332   rm -rf conftest*
3333   CPP=/lib/cpp
3334 fi
3335 rm -f conftest*
3336 fi
3337 rm -f conftest*
3338 fi
3339 rm -f conftest*
3340   ac_cv_prog_CPP="$CPP"
3341 fi
3342   CPP="$ac_cv_prog_CPP"
3343 else
3344   ac_cv_prog_CPP="$CPP"
3345 fi
3346 echo "$ac_t""$CPP" 1>&6
3347
3348
3349 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3350         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3351
3352 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3353         echo "configure: warning: programs compiled here do run here..." 1>&2
3354         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3355
3356 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3357         echo "configure: warning: programs compiled here do not run here..." 1>&2
3358         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3359 fi
3360
3361 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3362 echo "configure:3363: checking for AIX" >&5
3363 cat > conftest.$ac_ext <<EOF
3364 #line 3365 "configure"
3365 #include "confdefs.h"
3366 #ifdef _AIX
3367   yes
3368 #endif
3369
3370 EOF
3371 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3372   egrep "yes" >/dev/null 2>&1; then
3373   rm -rf conftest*
3374   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3375 #define _ALL_SOURCE 1
3376 EOF
3377
3378 else
3379   rm -rf conftest*
3380   echo "$ac_t""no" 1>&6
3381 fi
3382 rm -f conftest*
3383
3384
3385 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3386 echo "configure:3387: checking for POSIXized ISC" >&5
3387 if test -d /etc/conf/kconfig.d &&
3388   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3389 then
3390   echo "$ac_t""yes" 1>&6
3391   ISC=yes # If later tests want to check for ISC.
3392   cat >> confdefs.h <<\EOF
3393 #define _POSIX_SOURCE 1
3394 EOF
3395
3396   if test "$GCC" = yes; then
3397     CC="$CC -posix"
3398   else
3399     CC="$CC -Xp"
3400   fi
3401 else
3402   echo "$ac_t""no" 1>&6
3403   ISC=
3404 fi
3405
3406 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3407 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3408 echo "configure:3409: checking for minix/config.h" >&5
3409 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3410   echo $ac_n "(cached) $ac_c" 1>&6
3411 else
3412   cat > conftest.$ac_ext <<EOF
3413 #line 3414 "configure"
3414 #include "confdefs.h"
3415 #include <minix/config.h>
3416 EOF
3417 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3418 { (eval echo configure:3419: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3419 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3420 if test -z "$ac_err"; then
3421   rm -rf conftest*
3422   eval "ac_cv_header_$ac_safe=yes"
3423 else
3424   echo "$ac_err" >&5
3425   echo "configure: failed program was:" >&5
3426   cat conftest.$ac_ext >&5
3427   rm -rf conftest*
3428   eval "ac_cv_header_$ac_safe=no"
3429 fi
3430 rm -f conftest*
3431 fi
3432 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3433   echo "$ac_t""yes" 1>&6
3434   MINIX=yes
3435 else
3436   echo "$ac_t""no" 1>&6
3437 MINIX=
3438 fi
3439
3440 if test "$MINIX" = yes; then
3441   cat >> confdefs.h <<\EOF
3442 #define _POSIX_SOURCE 1
3443 EOF
3444
3445   cat >> confdefs.h <<\EOF
3446 #define _POSIX_1_SOURCE 2
3447 EOF
3448
3449   cat >> confdefs.h <<\EOF
3450 #define _MINIX 1
3451 EOF
3452
3453 fi
3454
3455
3456 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3457 echo "configure:3458: checking for Cygwin environment" >&5
3458 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
3459   echo $ac_n "(cached) $ac_c" 1>&6
3460 else
3461   cat > conftest.$ac_ext <<EOF
3462 #line 3463 "configure"
3463 #include "confdefs.h"
3464
3465 int main() {
3466
3467 #ifndef __CYGWIN__
3468 #define __CYGWIN__ __CYGWIN32__
3469 #endif
3470 return __CYGWIN__;
3471 ; return 0; }
3472 EOF
3473 if { (eval echo configure:3474: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3474   rm -rf conftest*
3475   ac_cv_cygwin=yes
3476 else
3477   echo "configure: failed program was:" >&5
3478   cat conftest.$ac_ext >&5
3479   rm -rf conftest*
3480   ac_cv_cygwin=no
3481 fi
3482 rm -f conftest*
3483 fi
3484
3485 echo "$ac_t""$ac_cv_cygwin" 1>&6
3486 CYGWIN=
3487 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3488 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3489 echo "configure:3490: checking for mingw32 environment" >&5
3490 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
3491   echo $ac_n "(cached) $ac_c" 1>&6
3492 else
3493   cat > conftest.$ac_ext <<EOF
3494 #line 3495 "configure"
3495 #include "confdefs.h"
3496
3497 int main() {
3498 return __MINGW32__;
3499 ; return 0; }
3500 EOF
3501 if { (eval echo configure:3502: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3502   rm -rf conftest*
3503   ac_cv_mingw32=yes
3504 else
3505   echo "configure: failed program was:" >&5
3506   cat conftest.$ac_ext >&5
3507   rm -rf conftest*
3508   ac_cv_mingw32=no
3509 fi
3510 rm -f conftest*
3511 fi
3512
3513 echo "$ac_t""$ac_cv_mingw32" 1>&6
3514 MINGW32=
3515 test "$ac_cv_mingw32" = yes && MINGW32=yes
3516 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
3517 echo "configure:3518: checking for EMX OS/2 environment" >&5
3518 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
3519   echo $ac_n "(cached) $ac_c" 1>&6
3520 else
3521   cat > conftest.$ac_ext <<EOF
3522 #line 3523 "configure"
3523 #include "confdefs.h"
3524
3525 int main() {
3526 return __EMX__;
3527 ; return 0; }
3528 EOF
3529 if { (eval echo configure:3530: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3530   rm -rf conftest*
3531   ac_cv_emxos2=yes
3532 else
3533   echo "configure: failed program was:" >&5
3534   cat conftest.$ac_ext >&5
3535   rm -rf conftest*
3536   ac_cv_emxos2=no
3537 fi
3538 rm -f conftest*
3539 fi
3540
3541 echo "$ac_t""$ac_cv_emxos2" 1>&6
3542 EMXOS2=
3543 test "$ac_cv_emxos2" = yes && EMXOS2=yes
3544
3545
3546
3547 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
3548 echo "configure:3549: checking for executable suffix" >&5
3549 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
3550   echo $ac_n "(cached) $ac_c" 1>&6
3551 else
3552   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
3553   ac_cv_exeext=.exe
3554 else
3555   rm -f conftest*
3556   echo 'int main () { return 0; }' > conftest.$ac_ext
3557   ac_cv_exeext=
3558   if { (eval echo configure:3559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
3559     for file in conftest.*; do
3560       case $file in
3561       *.c | *.C | *.o | *.obj | *.xcoff) ;;
3562       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
3563       esac
3564     done
3565   else
3566     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
3567   fi
3568   rm -f conftest*
3569   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
3570 fi
3571 fi
3572
3573 EXEEXT=""
3574 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
3575 echo "$ac_t""${ac_cv_exeext}" 1>&6
3576 ac_exeext=$EXEEXT
3577
3578 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3579 echo "configure:3580: checking for object suffix" >&5
3580 if eval "test \"\${ac_cv_objext+set}\" = set"; then
3581   echo $ac_n "(cached) $ac_c" 1>&6
3582 else
3583   rm -f conftest*
3584 echo 'int i = 1;' > conftest.$ac_ext
3585 if { (eval echo configure:3586: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3586   for ac_file in conftest.*; do
3587     case $ac_file in
3588     *.c) ;;
3589     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
3590     esac
3591   done
3592 else
3593   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
3594 fi
3595 rm -f conftest*
3596 fi
3597
3598 echo "$ac_t""$ac_cv_objext" 1>&6
3599 OBJEXT=$ac_cv_objext
3600 ac_objext=$ac_cv_objext
3601
3602
3603 cat >> confdefs.h <<EOF
3604 #define EXEEXT "${EXEEXT}"
3605 EOF
3606
3607
3608 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
3609 echo "configure:3610: checking for be_app in -lbe" >&5
3610 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
3611 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3612   echo $ac_n "(cached) $ac_c" 1>&6
3613 else
3614   ac_save_LIBS="$LIBS"
3615 LIBS="-lbe -lroot -lnet $LIBS"
3616 cat > conftest.$ac_ext <<EOF
3617 #line 3618 "configure"
3618 #include "confdefs.h"
3619 /* Override any gcc2 internal prototype to avoid an error.  */
3620 /* We use char because int might match the return type of a gcc2
3621     builtin and then its argument prototype would still apply.  */
3622 char be_app();
3623
3624 int main() {
3625 be_app()
3626 ; return 0; }
3627 EOF
3628 if { (eval echo configure:3629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3629   rm -rf conftest*
3630   eval "ac_cv_lib_$ac_lib_var=yes"
3631 else
3632   echo "configure: failed program was:" >&5
3633   cat conftest.$ac_ext >&5
3634   rm -rf conftest*
3635   eval "ac_cv_lib_$ac_lib_var=no"
3636 fi
3637 rm -f conftest*
3638 LIBS="$ac_save_LIBS"
3639
3640 fi
3641 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3642   echo "$ac_t""yes" 1>&6
3643   LIBS="$LIBS -lbe -lroot -lnet"
3644 else
3645   echo "$ac_t""no" 1>&6
3646 :
3647 fi
3648
3649
3650
3651
3652
3653 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
3654 echo "configure:3655: checking for ${CC-cc} option to accept ANSI C" >&5
3655 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
3656   echo $ac_n "(cached) $ac_c" 1>&6
3657 else
3658   am_cv_prog_cc_stdc=no
3659 ac_save_CC="$CC"
3660 # Don't try gcc -ansi; that turns off useful extensions and
3661 # breaks some systems' header files.
3662 # AIX                   -qlanglvl=ansi
3663 # Ultrix and OSF/1      -std1
3664 # HP-UX 10.20 and later -Ae
3665 # HP-UX older versions  -Aa -D_HPUX_SOURCE
3666 # SVR4                  -Xc -D__EXTENSIONS__
3667 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3668 do
3669   CC="$ac_save_CC $ac_arg"
3670   cat > conftest.$ac_ext <<EOF
3671 #line 3672 "configure"
3672 #include "confdefs.h"
3673 #include <stdarg.h>
3674 #include <stdio.h>
3675 #include <sys/types.h>
3676 #include <sys/stat.h>
3677 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3678 struct buf { int x; };
3679 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3680 static char *e (p, i)
3681      char **p;
3682      int i;
3683 {
3684   return p[i];
3685 }
3686 static char *f (char * (*g) (char **, int), char **p, ...)
3687 {
3688   char *s;
3689   va_list v;
3690   va_start (v,p);
3691   s = g (p, va_arg (v,int));
3692   va_end (v);
3693   return s;
3694 }
3695 int test (int i, double x);
3696 struct s1 {int (*f) (int a);};
3697 struct s2 {int (*f) (double a);};
3698 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3699 int argc;
3700 char **argv;
3701
3702 int main() {
3703
3704 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3705
3706 ; return 0; }
3707 EOF
3708 if { (eval echo configure:3709: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3709   rm -rf conftest*
3710   am_cv_prog_cc_stdc="$ac_arg"; break
3711 else
3712   echo "configure: failed program was:" >&5
3713   cat conftest.$ac_ext >&5
3714 fi
3715 rm -f conftest*
3716 done
3717 CC="$ac_save_CC"
3718
3719 fi
3720
3721 if test -z "$am_cv_prog_cc_stdc"; then
3722   echo "$ac_t""none needed" 1>&6
3723 else
3724   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
3725 fi
3726 case "x$am_cv_prog_cc_stdc" in
3727   x|xno) ;;
3728   *) CC="$CC $am_cv_prog_cc_stdc" ;;
3729 esac
3730
3731 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
3732         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
3733 fi
3734
3735 # test for make depend flag
3736 OL_MKDEP=
3737 OL_MKDEP_FLAGS=
3738 if test -z "${MKDEP}"; then
3739         OL_MKDEP="${CC-cc}"
3740         if test -z "${MKDEP_FLAGS}"; then
3741                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
3742 echo "configure:3743: checking for ${OL_MKDEP} depend flag" >&5
3743 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
3744   echo $ac_n "(cached) $ac_c" 1>&6
3745 else
3746   
3747                         ol_cv_mkdep=no
3748                         for flag in "-M" "-xM"; do
3749                                 cat > conftest.c <<EOF
3750  noCode;
3751 EOF
3752                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3753: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
3753                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
3754                                 then
3755                                         if test ! -f conftest."${ac_object}" ; then
3756                                                 ol_cv_mkdep=$flag
3757                                                 OL_MKDEP_FLAGS="$flag"
3758                                                 break
3759                                         fi
3760                                 fi
3761                         done
3762                         rm -f conftest*
3763                 
3764 fi
3765
3766 echo "$ac_t""$ol_cv_mkdep" 1>&6
3767         else
3768                 cc_cv_mkdep=yes
3769                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3770         fi
3771 else
3772         cc_cv_mkdep=yes
3773         OL_MKDEP="${MKDEP}"
3774         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3775 fi
3776
3777
3778
3779 if test "${ol_cv_mkdep}" = no ; then
3780         # this will soon become an error
3781         echo "configure: warning: do not know how to generate dependencies" 1>&2
3782 fi
3783
3784 ol_link_modules=no
3785 if test $ol_enable_modules != no ; then
3786         for ac_hdr in ltdl.h
3787 do
3788 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3789 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3790 echo "configure:3791: checking for $ac_hdr" >&5
3791 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3792   echo $ac_n "(cached) $ac_c" 1>&6
3793 else
3794   cat > conftest.$ac_ext <<EOF
3795 #line 3796 "configure"
3796 #include "confdefs.h"
3797 #include <$ac_hdr>
3798 EOF
3799 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3800 { (eval echo configure:3801: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3801 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3802 if test -z "$ac_err"; then
3803   rm -rf conftest*
3804   eval "ac_cv_header_$ac_safe=yes"
3805 else
3806   echo "$ac_err" >&5
3807   echo "configure: failed program was:" >&5
3808   cat conftest.$ac_ext >&5
3809   rm -rf conftest*
3810   eval "ac_cv_header_$ac_safe=no"
3811 fi
3812 rm -f conftest*
3813 fi
3814 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3815   echo "$ac_t""yes" 1>&6
3816     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3817   cat >> confdefs.h <<EOF
3818 #define $ac_tr_hdr 1
3819 EOF
3820  
3821 else
3822   echo "$ac_t""no" 1>&6
3823 fi
3824 done
3825
3826
3827         if test $ac_cv_header_ltdl_h = no ; then
3828                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
3829
3830         fi
3831
3832         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
3833 echo "configure:3834: checking for lt_dlinit in -lltdl" >&5
3834 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
3835 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3836   echo $ac_n "(cached) $ac_c" 1>&6
3837 else
3838   ac_save_LIBS="$LIBS"
3839 LIBS="-lltdl  $LIBS"
3840 cat > conftest.$ac_ext <<EOF
3841 #line 3842 "configure"
3842 #include "confdefs.h"
3843 /* Override any gcc2 internal prototype to avoid an error.  */
3844 /* We use char because int might match the return type of a gcc2
3845     builtin and then its argument prototype would still apply.  */
3846 char lt_dlinit();
3847
3848 int main() {
3849 lt_dlinit()
3850 ; return 0; }
3851 EOF
3852 if { (eval echo configure:3853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3853   rm -rf conftest*
3854   eval "ac_cv_lib_$ac_lib_var=yes"
3855 else
3856   echo "configure: failed program was:" >&5
3857   cat conftest.$ac_ext >&5
3858   rm -rf conftest*
3859   eval "ac_cv_lib_$ac_lib_var=no"
3860 fi
3861 rm -f conftest*
3862 LIBS="$ac_save_LIBS"
3863
3864 fi
3865 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3866   echo "$ac_t""yes" 1>&6
3867     ac_tr_lib=HAVE_LIB`echo ltdl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3868     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3869   cat >> confdefs.h <<EOF
3870 #define $ac_tr_lib 1
3871 EOF
3872
3873   LIBS="-lltdl $LIBS"
3874
3875 else
3876   echo "$ac_t""no" 1>&6
3877 fi
3878
3879         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
3880                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
3881         fi
3882         ol_link_modules=yes
3883 else
3884         ol_with_bdb2_module=static
3885         ol_with_ldap_module=static
3886         ol_with_ldbm_module=static
3887         ol_with_passwd_module=static
3888         ol_with_perl_module=static
3889         ol_with_shell_module=static
3890         ol_with_tcl_module=static
3891 fi
3892
3893 # test for EBCDIC
3894 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
3895 echo "configure:3896: checking for EBCDIC" >&5
3896 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
3897   echo $ac_n "(cached) $ac_c" 1>&6
3898 else
3899   
3900         cat > conftest.$ac_ext <<EOF
3901 #line 3902 "configure"
3902 #include "confdefs.h"
3903
3904 #if !('M' == 0xd4)
3905 #include <__ASCII__/generate_error.h>
3906 #endif
3907
3908 EOF
3909 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3910 { (eval echo configure:3911: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3911 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3912 if test -z "$ac_err"; then
3913   rm -rf conftest*
3914   ol_cv_cpp_ebcdic=yes
3915 else
3916   echo "$ac_err" >&5
3917   echo "configure: failed program was:" >&5
3918   cat conftest.$ac_ext >&5
3919   rm -rf conftest*
3920   ol_cv_cpp_ebcdic=no
3921 fi
3922 rm -f conftest*
3923 fi
3924
3925 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
3926 if test $ol_cv_cpp_ebcdic = yes ; then
3927         cat >> confdefs.h <<\EOF
3928 #define HAVE_EBCDIC 1
3929 EOF
3930
3931 fi
3932
3933 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3934 echo "configure:3935: checking for ANSI C header files" >&5
3935 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
3936   echo $ac_n "(cached) $ac_c" 1>&6
3937 else
3938   cat > conftest.$ac_ext <<EOF
3939 #line 3940 "configure"
3940 #include "confdefs.h"
3941 #include <stdlib.h>
3942 #include <stdarg.h>
3943 #include <string.h>
3944 #include <float.h>
3945 EOF
3946 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3947 { (eval echo configure:3948: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3948 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3949 if test -z "$ac_err"; then
3950   rm -rf conftest*
3951   ol_cv_header_stdc=yes
3952 else
3953   echo "$ac_err" >&5
3954   echo "configure: failed program was:" >&5
3955   cat conftest.$ac_ext >&5
3956   rm -rf conftest*
3957   ol_cv_header_stdc=no
3958 fi
3959 rm -f conftest*
3960
3961 if test $ol_cv_header_stdc = yes; then
3962   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3963 cat > conftest.$ac_ext <<EOF
3964 #line 3965 "configure"
3965 #include "confdefs.h"
3966 #include <string.h>
3967 EOF
3968 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3969   egrep "memchr" >/dev/null 2>&1; then
3970   :
3971 else
3972   rm -rf conftest*
3973   ol_cv_header_stdc=no
3974 fi
3975 rm -f conftest*
3976
3977 fi
3978
3979 if test $ol_cv_header_stdc = yes; then
3980   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3981 cat > conftest.$ac_ext <<EOF
3982 #line 3983 "configure"
3983 #include "confdefs.h"
3984 #include <stdlib.h>
3985 EOF
3986 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3987   egrep "free" >/dev/null 2>&1; then
3988   :
3989 else
3990   rm -rf conftest*
3991   ol_cv_header_stdc=no
3992 fi
3993 rm -f conftest*
3994
3995 fi
3996
3997 if test $ol_cv_header_stdc = yes; then
3998   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3999 if test "$cross_compiling" = yes; then
4000   :
4001 else
4002   cat > conftest.$ac_ext <<EOF
4003 #line 4004 "configure"
4004 #include "confdefs.h"
4005 #include <ctype.h>
4006 #ifndef HAVE_EBCDIC
4007 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4008 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4009 #else
4010 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4011                 || ('j' <= (c) && (c) <= 'r') \
4012                 || ('s' <= (c) && (c) <= 'z'))
4013 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
4014 #endif
4015 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4016 int main () { int i; for (i = 0; i < 256; i++)
4017 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4018 exit (0); }
4019
4020 EOF
4021 if { (eval echo configure:4022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4022 then
4023   :
4024 else
4025   echo "configure: failed program was:" >&5
4026   cat conftest.$ac_ext >&5
4027   rm -fr conftest*
4028   ol_cv_header_stdc=no
4029 fi
4030 rm -fr conftest*
4031 fi
4032
4033 fi
4034 fi
4035
4036 echo "$ac_t""$ol_cv_header_stdc" 1>&6
4037 if test $ol_cv_header_stdc = yes; then
4038   cat >> confdefs.h <<\EOF
4039 #define STDC_HEADERS 1
4040 EOF
4041
4042 fi
4043 ac_cv_header_stdc=disable
4044
4045
4046 if test $ol_cv_header_stdc != yes; then
4047         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
4048 fi
4049
4050 ac_header_dirent=no
4051 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4052 do
4053 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4054 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4055 echo "configure:4056: checking for $ac_hdr that defines DIR" >&5
4056 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
4057   echo $ac_n "(cached) $ac_c" 1>&6
4058 else
4059   cat > conftest.$ac_ext <<EOF
4060 #line 4061 "configure"
4061 #include "confdefs.h"
4062 #include <sys/types.h>
4063 #include <$ac_hdr>
4064 int main() {
4065 DIR *dirp = 0;
4066 ; return 0; }
4067 EOF
4068 if { (eval echo configure:4069: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4069   rm -rf conftest*
4070   eval "ac_cv_header_dirent_$ac_safe=yes"
4071 else
4072   echo "configure: failed program was:" >&5
4073   cat conftest.$ac_ext >&5
4074   rm -rf conftest*
4075   eval "ac_cv_header_dirent_$ac_safe=no"
4076 fi
4077 rm -f conftest*
4078 fi
4079 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4080   echo "$ac_t""yes" 1>&6
4081     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4082   cat >> confdefs.h <<EOF
4083 #define $ac_tr_hdr 1
4084 EOF
4085  ac_header_dirent=$ac_hdr; break
4086 else
4087   echo "$ac_t""no" 1>&6
4088 fi
4089 done
4090 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4091 if test $ac_header_dirent = dirent.h; then
4092 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4093 echo "configure:4094: checking for opendir in -ldir" >&5
4094 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
4095 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4096   echo $ac_n "(cached) $ac_c" 1>&6
4097 else
4098   ac_save_LIBS="$LIBS"
4099 LIBS="-ldir  $LIBS"
4100 cat > conftest.$ac_ext <<EOF
4101 #line 4102 "configure"
4102 #include "confdefs.h"
4103 /* Override any gcc2 internal prototype to avoid an error.  */
4104 /* We use char because int might match the return type of a gcc2
4105     builtin and then its argument prototype would still apply.  */
4106 char opendir();
4107
4108 int main() {
4109 opendir()
4110 ; return 0; }
4111 EOF
4112 if { (eval echo configure:4113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4113   rm -rf conftest*
4114   eval "ac_cv_lib_$ac_lib_var=yes"
4115 else
4116   echo "configure: failed program was:" >&5
4117   cat conftest.$ac_ext >&5
4118   rm -rf conftest*
4119   eval "ac_cv_lib_$ac_lib_var=no"
4120 fi
4121 rm -f conftest*
4122 LIBS="$ac_save_LIBS"
4123
4124 fi
4125 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4126   echo "$ac_t""yes" 1>&6
4127   LIBS="$LIBS -ldir"
4128 else
4129   echo "$ac_t""no" 1>&6
4130 fi
4131
4132 else
4133 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4134 echo "configure:4135: checking for opendir in -lx" >&5
4135 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
4136 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4137   echo $ac_n "(cached) $ac_c" 1>&6
4138 else
4139   ac_save_LIBS="$LIBS"
4140 LIBS="-lx  $LIBS"
4141 cat > conftest.$ac_ext <<EOF
4142 #line 4143 "configure"
4143 #include "confdefs.h"
4144 /* Override any gcc2 internal prototype to avoid an error.  */
4145 /* We use char because int might match the return type of a gcc2
4146     builtin and then its argument prototype would still apply.  */
4147 char opendir();
4148
4149 int main() {
4150 opendir()
4151 ; return 0; }
4152 EOF
4153 if { (eval echo configure:4154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4154   rm -rf conftest*
4155   eval "ac_cv_lib_$ac_lib_var=yes"
4156 else
4157   echo "configure: failed program was:" >&5
4158   cat conftest.$ac_ext >&5
4159   rm -rf conftest*
4160   eval "ac_cv_lib_$ac_lib_var=no"
4161 fi
4162 rm -f conftest*
4163 LIBS="$ac_save_LIBS"
4164
4165 fi
4166 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4167   echo "$ac_t""yes" 1>&6
4168   LIBS="$LIBS -lx"
4169 else
4170   echo "$ac_t""no" 1>&6
4171 fi
4172
4173 fi
4174
4175 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4176 echo "configure:4177: checking for sys/wait.h that is POSIX.1 compatible" >&5
4177 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
4178   echo $ac_n "(cached) $ac_c" 1>&6
4179 else
4180   cat > conftest.$ac_ext <<EOF
4181 #line 4182 "configure"
4182 #include "confdefs.h"
4183 #include <sys/types.h>
4184 #include <sys/wait.h>
4185 #ifndef WEXITSTATUS
4186 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4187 #endif
4188 #ifndef WIFEXITED
4189 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4190 #endif
4191 int main() {
4192 int s;
4193 wait (&s);
4194 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4195 ; return 0; }
4196 EOF
4197 if { (eval echo configure:4198: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4198   rm -rf conftest*
4199   ac_cv_header_sys_wait_h=yes
4200 else
4201   echo "configure: failed program was:" >&5
4202   cat conftest.$ac_ext >&5
4203   rm -rf conftest*
4204   ac_cv_header_sys_wait_h=no
4205 fi
4206 rm -f conftest*
4207 fi
4208
4209 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4210 if test $ac_cv_header_sys_wait_h = yes; then
4211   cat >> confdefs.h <<\EOF
4212 #define HAVE_SYS_WAIT_H 1
4213 EOF
4214
4215 fi
4216
4217 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4218 echo "configure:4219: checking POSIX termios" >&5
4219 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
4220   echo $ac_n "(cached) $ac_c" 1>&6
4221 else
4222   cat > conftest.$ac_ext <<EOF
4223 #line 4224 "configure"
4224 #include "confdefs.h"
4225 #include <sys/types.h>
4226 #include <unistd.h>
4227 #include <termios.h>
4228 int main() {
4229 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4230    tcgetattr(0, 0);
4231 ; return 0; }
4232 EOF
4233 if { (eval echo configure:4234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4234   rm -rf conftest*
4235   am_cv_sys_posix_termios=yes
4236 else
4237   echo "configure: failed program was:" >&5
4238   cat conftest.$ac_ext >&5
4239   rm -rf conftest*
4240   am_cv_sys_posix_termios=no
4241 fi
4242 rm -f conftest*
4243 fi
4244
4245 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4246
4247
4248  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4249 echo "configure:4250: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4250 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
4251   echo $ac_n "(cached) $ac_c" 1>&6
4252 else
4253   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4254
4255   gwinsz_in_termios_h=no
4256   if test $am_cv_sys_posix_termios = yes; then
4257     cat > conftest.$ac_ext <<EOF
4258 #line 4259 "configure"
4259 #include "confdefs.h"
4260 #include <sys/types.h>
4261 #     include <termios.h>
4262 #     ifdef TIOCGWINSZ
4263         yes
4264 #     endif
4265     
4266 EOF
4267 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4268   egrep "yes" >/dev/null 2>&1; then
4269   rm -rf conftest*
4270   gwinsz_in_termios_h=yes
4271 fi
4272 rm -f conftest*
4273
4274   fi
4275
4276   if test $gwinsz_in_termios_h = no; then
4277     cat > conftest.$ac_ext <<EOF
4278 #line 4279 "configure"
4279 #include "confdefs.h"
4280 #include <sys/types.h>
4281 #     include <sys/ioctl.h>
4282 #     ifdef TIOCGWINSZ
4283         yes
4284 #     endif
4285     
4286 EOF
4287 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4288   egrep "yes" >/dev/null 2>&1; then
4289   rm -rf conftest*
4290   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4291 fi
4292 rm -f conftest*
4293
4294   fi
4295   
4296 fi
4297
4298 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4299   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4300     cat >> confdefs.h <<\EOF
4301 #define GWINSZ_IN_SYS_IOCTL 1
4302 EOF
4303
4304   fi
4305
4306 if test $am_cv_sys_posix_termios = yes ; then
4307         cat >> confdefs.h <<\EOF
4308 #define HAVE_POSIX_TERMIOS 1
4309 EOF
4310
4311 fi
4312
4313 for ac_hdr in \
4314         arpa/inet.h             \
4315         arpa/nameser.h  \
4316         assert.h                \
4317         crypt.h                 \
4318         errno.h                 \
4319         fcntl.h                 \
4320         filio.h                 \
4321         getopt.h                \
4322         grp.h                   \
4323         libutil.h               \
4324         limits.h                \
4325         locale.h                \
4326         netinet/tcp.h   \
4327         malloc.h                \
4328         memory.h                \
4329         psap.h                  \
4330         pwd.h                   \
4331         resolv.h                \
4332         sgtty.h                 \
4333         shadow.h                \
4334         stddef.h                \
4335         string.h                \
4336         strings.h               \
4337         sysexits.h              \
4338         sys/file.h              \
4339         sys/filio.h             \
4340         sys/errno.h             \
4341         sys/ioctl.h             \
4342         sys/param.h             \
4343         sys/resource.h  \
4344         sys/select.h    \
4345         sys/socket.h    \
4346         sys/syslog.h    \
4347         sys/time.h              \
4348         sys/types.h             \
4349         syslog.h                \
4350         termios.h               \
4351         unistd.h                \
4352
4353 do
4354 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4355 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4356 echo "configure:4357: checking for $ac_hdr" >&5
4357 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4358   echo $ac_n "(cached) $ac_c" 1>&6
4359 else
4360   cat > conftest.$ac_ext <<EOF
4361 #line 4362 "configure"
4362 #include "confdefs.h"
4363 #include <$ac_hdr>
4364 EOF
4365 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4366 { (eval echo configure:4367: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4367 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4368 if test -z "$ac_err"; then
4369   rm -rf conftest*
4370   eval "ac_cv_header_$ac_safe=yes"
4371 else
4372   echo "$ac_err" >&5
4373   echo "configure: failed program was:" >&5
4374   cat conftest.$ac_ext >&5
4375   rm -rf conftest*
4376   eval "ac_cv_header_$ac_safe=no"
4377 fi
4378 rm -f conftest*
4379 fi
4380 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4381   echo "$ac_t""yes" 1>&6
4382     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4383   cat >> confdefs.h <<EOF
4384 #define $ac_tr_hdr 1
4385 EOF
4386  
4387 else
4388   echo "$ac_t""no" 1>&6
4389 fi
4390 done
4391
4392
4393
4394
4395 echo $ac_n "checking for socket""... $ac_c" 1>&6
4396 echo "configure:4397: checking for socket" >&5
4397 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
4398   echo $ac_n "(cached) $ac_c" 1>&6
4399 else
4400   cat > conftest.$ac_ext <<EOF
4401 #line 4402 "configure"
4402 #include "confdefs.h"
4403 /* System header to define __stub macros and hopefully few prototypes,
4404     which can conflict with char socket(); below.  */
4405 #include <assert.h>
4406 /* Override any gcc2 internal prototype to avoid an error.  */
4407 /* We use char because int might match the return type of a gcc2
4408     builtin and then its argument prototype would still apply.  */
4409 char socket();
4410 char (*f)();
4411
4412 int main() {
4413
4414 /* The GNU C library defines this for functions which it implements
4415     to always fail with ENOSYS.  Some functions are actually named
4416     something starting with __ and the normal name is an alias.  */
4417 #if defined (__stub_socket) || defined (__stub___socket)
4418 choke me
4419 #else
4420 f = socket;
4421 #endif
4422
4423 ; return 0; }
4424 EOF
4425 if { (eval echo configure:4426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4426   rm -rf conftest*
4427   eval "ac_cv_func_socket=yes"
4428 else
4429   echo "configure: failed program was:" >&5
4430   cat conftest.$ac_ext >&5
4431   rm -rf conftest*
4432   eval "ac_cv_func_socket=no"
4433 fi
4434 rm -f conftest*
4435 fi
4436
4437 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
4438   echo "$ac_t""yes" 1>&6
4439   :
4440 else
4441   echo "$ac_t""no" 1>&6
4442         
4443         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
4444 echo "configure:4445: checking for main in -lsocket" >&5
4445 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
4446 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4447   echo $ac_n "(cached) $ac_c" 1>&6
4448 else
4449   ac_save_LIBS="$LIBS"
4450 LIBS="-lsocket  $LIBS"
4451 cat > conftest.$ac_ext <<EOF
4452 #line 4453 "configure"
4453 #include "confdefs.h"
4454
4455 int main() {
4456 main()
4457 ; return 0; }
4458 EOF
4459 if { (eval echo configure:4460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4460   rm -rf conftest*
4461   eval "ac_cv_lib_$ac_lib_var=yes"
4462 else
4463   echo "configure: failed program was:" >&5
4464   cat conftest.$ac_ext >&5
4465   rm -rf conftest*
4466   eval "ac_cv_lib_$ac_lib_var=no"
4467 fi
4468 rm -f conftest*
4469 LIBS="$ac_save_LIBS"
4470
4471 fi
4472 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4473   echo "$ac_t""yes" 1>&6
4474     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4475     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4476   cat >> confdefs.h <<EOF
4477 #define $ac_tr_lib 1
4478 EOF
4479
4480   LIBS="-lsocket $LIBS"
4481
4482 else
4483   echo "$ac_t""no" 1>&6
4484 fi
4485
4486         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
4487 echo "configure:4488: checking for main in -lnet" >&5
4488 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
4489 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4490   echo $ac_n "(cached) $ac_c" 1>&6
4491 else
4492   ac_save_LIBS="$LIBS"
4493 LIBS="-lnet  $LIBS"
4494 cat > conftest.$ac_ext <<EOF
4495 #line 4496 "configure"
4496 #include "confdefs.h"
4497
4498 int main() {
4499 main()
4500 ; return 0; }
4501 EOF
4502 if { (eval echo configure:4503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4503   rm -rf conftest*
4504   eval "ac_cv_lib_$ac_lib_var=yes"
4505 else
4506   echo "configure: failed program was:" >&5
4507   cat conftest.$ac_ext >&5
4508   rm -rf conftest*
4509   eval "ac_cv_lib_$ac_lib_var=no"
4510 fi
4511 rm -f conftest*
4512 LIBS="$ac_save_LIBS"
4513
4514 fi
4515 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4516   echo "$ac_t""yes" 1>&6
4517     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4518     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4519   cat >> confdefs.h <<EOF
4520 #define $ac_tr_lib 1
4521 EOF
4522
4523   LIBS="-lnet $LIBS"
4524
4525 else
4526   echo "$ac_t""no" 1>&6
4527 fi
4528
4529         echo $ac_n "checking for socket in -lnet""... $ac_c" 1>&6
4530 echo "configure:4531: checking for socket in -lnet" >&5
4531 ac_lib_var=`echo net'_'socket | sed 'y%./+-:%__p__%'`
4532 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4533   echo $ac_n "(cached) $ac_c" 1>&6
4534 else
4535   ac_save_LIBS="$LIBS"
4536 LIBS="-lnet  $LIBS"
4537 cat > conftest.$ac_ext <<EOF
4538 #line 4539 "configure"
4539 #include "confdefs.h"
4540 /* Override any gcc2 internal prototype to avoid an error.  */
4541 /* We use char because int might match the return type of a gcc2
4542     builtin and then its argument prototype would still apply.  */
4543 char socket();
4544
4545 int main() {
4546 socket()
4547 ; return 0; }
4548 EOF
4549 if { (eval echo configure:4550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4550   rm -rf conftest*
4551   eval "ac_cv_lib_$ac_lib_var=yes"
4552 else
4553   echo "configure: failed program was:" >&5
4554   cat conftest.$ac_ext >&5
4555   rm -rf conftest*
4556   eval "ac_cv_lib_$ac_lib_var=no"
4557 fi
4558 rm -f conftest*
4559 LIBS="$ac_save_LIBS"
4560
4561 fi
4562 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4563   echo "$ac_t""yes" 1>&6
4564     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4565     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4566   cat >> confdefs.h <<EOF
4567 #define $ac_tr_lib 1
4568 EOF
4569
4570   LIBS="-lnet $LIBS"
4571
4572 else
4573   echo "$ac_t""no" 1>&6
4574 fi
4575
4576         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
4577 echo "configure:4578: checking for main in -lnsl_s" >&5
4578 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
4579 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4580   echo $ac_n "(cached) $ac_c" 1>&6
4581 else
4582   ac_save_LIBS="$LIBS"
4583 LIBS="-lnsl_s  $LIBS"
4584 cat > conftest.$ac_ext <<EOF
4585 #line 4586 "configure"
4586 #include "confdefs.h"
4587
4588 int main() {
4589 main()
4590 ; return 0; }
4591 EOF
4592 if { (eval echo configure:4593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4593   rm -rf conftest*
4594   eval "ac_cv_lib_$ac_lib_var=yes"
4595 else
4596   echo "configure: failed program was:" >&5
4597   cat conftest.$ac_ext >&5
4598   rm -rf conftest*
4599   eval "ac_cv_lib_$ac_lib_var=no"
4600 fi
4601 rm -f conftest*
4602 LIBS="$ac_save_LIBS"
4603
4604 fi
4605 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4606   echo "$ac_t""yes" 1>&6
4607     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4608     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4609   cat >> confdefs.h <<EOF
4610 #define $ac_tr_lib 1
4611 EOF
4612
4613   LIBS="-lnsl_s $LIBS"
4614
4615 else
4616   echo "$ac_t""no" 1>&6
4617 fi
4618
4619         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
4620 echo "configure:4621: checking for main in -lnsl" >&5
4621 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
4622 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4623   echo $ac_n "(cached) $ac_c" 1>&6
4624 else
4625   ac_save_LIBS="$LIBS"
4626 LIBS="-lnsl  $LIBS"
4627 cat > conftest.$ac_ext <<EOF
4628 #line 4629 "configure"
4629 #include "confdefs.h"
4630
4631 int main() {
4632 main()
4633 ; return 0; }
4634 EOF
4635 if { (eval echo configure:4636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4636   rm -rf conftest*
4637   eval "ac_cv_lib_$ac_lib_var=yes"
4638 else
4639   echo "configure: failed program was:" >&5
4640   cat conftest.$ac_ext >&5
4641   rm -rf conftest*
4642   eval "ac_cv_lib_$ac_lib_var=no"
4643 fi
4644 rm -f conftest*
4645 LIBS="$ac_save_LIBS"
4646
4647 fi
4648 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4649   echo "$ac_t""yes" 1>&6
4650     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4651     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4652   cat >> confdefs.h <<EOF
4653 #define $ac_tr_lib 1
4654 EOF
4655
4656   LIBS="-lnsl $LIBS"
4657
4658 else
4659   echo "$ac_t""no" 1>&6
4660 fi
4661
4662         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
4663 echo "configure:4664: checking for socket in -linet" >&5
4664 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
4665 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4666   echo $ac_n "(cached) $ac_c" 1>&6
4667 else
4668   ac_save_LIBS="$LIBS"
4669 LIBS="-linet  $LIBS"
4670 cat > conftest.$ac_ext <<EOF
4671 #line 4672 "configure"
4672 #include "confdefs.h"
4673 /* Override any gcc2 internal prototype to avoid an error.  */
4674 /* We use char because int might match the return type of a gcc2
4675     builtin and then its argument prototype would still apply.  */
4676 char socket();
4677
4678 int main() {
4679 socket()
4680 ; return 0; }
4681 EOF
4682 if { (eval echo configure:4683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4683   rm -rf conftest*
4684   eval "ac_cv_lib_$ac_lib_var=yes"
4685 else
4686   echo "configure: failed program was:" >&5
4687   cat conftest.$ac_ext >&5
4688   rm -rf conftest*
4689   eval "ac_cv_lib_$ac_lib_var=no"
4690 fi
4691 rm -f conftest*
4692 LIBS="$ac_save_LIBS"
4693
4694 fi
4695 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4696   echo "$ac_t""yes" 1>&6
4697     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4698     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4699   cat >> confdefs.h <<EOF
4700 #define $ac_tr_lib 1
4701 EOF
4702
4703   LIBS="-linet $LIBS"
4704
4705 else
4706   echo "$ac_t""no" 1>&6
4707 fi
4708
4709         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
4710 echo "configure:4711: checking for main in -lgen" >&5
4711 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
4712 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4713   echo $ac_n "(cached) $ac_c" 1>&6
4714 else
4715   ac_save_LIBS="$LIBS"
4716 LIBS="-lgen  $LIBS"
4717 cat > conftest.$ac_ext <<EOF
4718 #line 4719 "configure"
4719 #include "confdefs.h"
4720
4721 int main() {
4722 main()
4723 ; return 0; }
4724 EOF
4725 if { (eval echo configure:4726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4726   rm -rf conftest*
4727   eval "ac_cv_lib_$ac_lib_var=yes"
4728 else
4729   echo "configure: failed program was:" >&5
4730   cat conftest.$ac_ext >&5
4731   rm -rf conftest*
4732   eval "ac_cv_lib_$ac_lib_var=no"
4733 fi
4734 rm -f conftest*
4735 LIBS="$ac_save_LIBS"
4736
4737 fi
4738 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4739   echo "$ac_t""yes" 1>&6
4740     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4741     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4742   cat >> confdefs.h <<EOF
4743 #define $ac_tr_lib 1
4744 EOF
4745
4746   LIBS="-lgen $LIBS"
4747
4748 else
4749   echo "$ac_t""no" 1>&6
4750 fi
4751
4752
4753 fi
4754
4755
4756 echo $ac_n "checking for select""... $ac_c" 1>&6
4757 echo "configure:4758: checking for select" >&5
4758 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
4759   echo $ac_n "(cached) $ac_c" 1>&6
4760 else
4761   cat > conftest.$ac_ext <<EOF
4762 #line 4763 "configure"
4763 #include "confdefs.h"
4764 /* System header to define __stub macros and hopefully few prototypes,
4765     which can conflict with char select(); below.  */
4766 #include <assert.h>
4767 /* Override any gcc2 internal prototype to avoid an error.  */
4768 /* We use char because int might match the return type of a gcc2
4769     builtin and then its argument prototype would still apply.  */
4770 char select();
4771 char (*f)();
4772
4773 int main() {
4774
4775 /* The GNU C library defines this for functions which it implements
4776     to always fail with ENOSYS.  Some functions are actually named
4777     something starting with __ and the normal name is an alias.  */
4778 #if defined (__stub_select) || defined (__stub___select)
4779 choke me
4780 #else
4781 f = select;
4782 #endif
4783
4784 ; return 0; }
4785 EOF
4786 if { (eval echo configure:4787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4787   rm -rf conftest*
4788   eval "ac_cv_func_select=yes"
4789 else
4790   echo "configure: failed program was:" >&5
4791   cat conftest.$ac_ext >&5
4792   rm -rf conftest*
4793   eval "ac_cv_func_select=no"
4794 fi
4795 rm -f conftest*
4796 fi
4797
4798 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
4799   echo "$ac_t""yes" 1>&6
4800   :
4801 else
4802   echo "$ac_t""no" 1>&6
4803 { echo "configure: error: select() required." 1>&2; exit 1; }
4804 fi
4805
4806 for ac_func in socketpair
4807 do
4808 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4809 echo "configure:4810: checking for $ac_func" >&5
4810 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
4811   echo $ac_n "(cached) $ac_c" 1>&6
4812 else
4813   cat > conftest.$ac_ext <<EOF
4814 #line 4815 "configure"
4815 #include "confdefs.h"
4816 /* System header to define __stub macros and hopefully few prototypes,
4817     which can conflict with char $ac_func(); below.  */
4818 #include <assert.h>
4819 /* Override any gcc2 internal prototype to avoid an error.  */
4820 /* We use char because int might match the return type of a gcc2
4821     builtin and then its argument prototype would still apply.  */
4822 char $ac_func();
4823 char (*f)();
4824
4825 int main() {
4826
4827 /* The GNU C library defines this for functions which it implements
4828     to always fail with ENOSYS.  Some functions are actually named
4829     something starting with __ and the normal name is an alias.  */
4830 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4831 choke me
4832 #else
4833 f = $ac_func;
4834 #endif
4835
4836 ; return 0; }
4837 EOF
4838 if { (eval echo configure:4839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4839   rm -rf conftest*
4840   eval "ac_cv_func_$ac_func=yes"
4841 else
4842   echo "configure: failed program was:" >&5
4843   cat conftest.$ac_ext >&5
4844   rm -rf conftest*
4845   eval "ac_cv_func_$ac_func=no"
4846 fi
4847 rm -f conftest*
4848 fi
4849
4850 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4851   echo "$ac_t""yes" 1>&6
4852     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4853   cat >> confdefs.h <<EOF
4854 #define $ac_tr_func 1
4855 EOF
4856  
4857 else
4858   echo "$ac_t""no" 1>&6
4859 fi
4860 done
4861
4862
4863 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
4864 echo "configure:4865: checking types of arguments for select()" >&5
4865  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
4866   echo $ac_n "(cached) $ac_c" 1>&6
4867 else
4868    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
4869   echo $ac_n "(cached) $ac_c" 1>&6
4870 else
4871     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
4872   echo $ac_n "(cached) $ac_c" 1>&6
4873 else
4874      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
4875      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
4876       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
4877        cat > conftest.$ac_ext <<EOF
4878 #line 4879 "configure"
4879 #include "confdefs.h"
4880 #ifdef HAVE_SYS_TYPES_H
4881 #include <sys/types.h>
4882 #endif
4883 #ifdef HAVE_SYS_TIME_H
4884 #include <sys/time.h>
4885 #endif
4886 #ifdef HAVE_SYS_SELECT_H
4887 #include <sys/select.h>
4888 #endif
4889 #ifdef HAVE_SYS_SOCKET_H
4890 #include <sys/socket.h>
4891 #endif
4892 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);
4893 int main() {
4894
4895 ; return 0; }
4896 EOF
4897 if { (eval echo configure:4898: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4898   rm -rf conftest*
4899           ac_not_found=no ; break 3
4900 else
4901   echo "configure: failed program was:" >&5
4902   cat conftest.$ac_ext >&5
4903   rm -rf conftest*
4904   ac_not_found=yes
4905 fi
4906 rm -f conftest*
4907       done
4908      done
4909     done
4910    
4911 fi
4912   
4913 fi
4914  
4915 fi
4916  if test "$ac_not_found" = yes; then
4917   ac_cv_func_select_arg1=int 
4918   ac_cv_func_select_arg234='int *' 
4919   ac_cv_func_select_arg5='struct timeval *'
4920  fi
4921  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
4922  cat >> confdefs.h <<EOF
4923 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
4924 EOF
4925
4926  cat >> confdefs.h <<EOF
4927 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
4928 EOF
4929
4930  cat >> confdefs.h <<EOF
4931 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
4932 EOF
4933
4934
4935
4936 echo $ac_n "checking for restartable system calls""... $ac_c" 1>&6
4937 echo "configure:4938: checking for restartable system calls" >&5
4938 if eval "test \"\${ac_cv_sys_restartable_syscalls+set}\" = set"; then
4939   echo $ac_n "(cached) $ac_c" 1>&6
4940 else
4941   if test "$cross_compiling" = yes; then
4942     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
4943 else
4944   cat > conftest.$ac_ext <<EOF
4945 #line 4946 "configure"
4946 #include "confdefs.h"
4947 /* Exit 0 (true) if wait returns something other than -1,
4948    i.e. the pid of the child, which means that wait was restarted
4949    after getting the signal.  */
4950 #include <sys/types.h>
4951 #include <signal.h>
4952 ucatch (isig) { }
4953 main () {
4954   int i = fork (), status;
4955   if (i == 0) { sleep (3); kill (getppid (), SIGINT); sleep (3); exit (0); }
4956   signal (SIGINT, ucatch);
4957   status = wait(&i);
4958   if (status == -1) wait(&i);
4959   exit (status == -1);
4960 }
4961
4962 EOF
4963 if { (eval echo configure:4964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4964 then
4965   ac_cv_sys_restartable_syscalls=yes
4966 else
4967   echo "configure: failed program was:" >&5
4968   cat conftest.$ac_ext >&5
4969   rm -fr conftest*
4970   ac_cv_sys_restartable_syscalls=no
4971 fi
4972 rm -fr conftest*
4973 fi
4974
4975 fi
4976
4977 echo "$ac_t""$ac_cv_sys_restartable_syscalls" 1>&6
4978 if test $ac_cv_sys_restartable_syscalls = yes; then
4979   cat >> confdefs.h <<\EOF
4980 #define HAVE_RESTARTABLE_SYSCALLS 1
4981 EOF
4982
4983 fi
4984
4985
4986 for ac_hdr in regex.h 
4987 do
4988 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4989 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4990 echo "configure:4991: checking for $ac_hdr" >&5
4991 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4992   echo $ac_n "(cached) $ac_c" 1>&6
4993 else
4994   cat > conftest.$ac_ext <<EOF
4995 #line 4996 "configure"
4996 #include "confdefs.h"
4997 #include <$ac_hdr>
4998 EOF
4999 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5000 { (eval echo configure:5001: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5001 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5002 if test -z "$ac_err"; then
5003   rm -rf conftest*
5004   eval "ac_cv_header_$ac_safe=yes"
5005 else
5006   echo "$ac_err" >&5
5007   echo "configure: failed program was:" >&5
5008   cat conftest.$ac_ext >&5
5009   rm -rf conftest*
5010   eval "ac_cv_header_$ac_safe=no"
5011 fi
5012 rm -f conftest*
5013 fi
5014 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5015   echo "$ac_t""yes" 1>&6
5016     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5017   cat >> confdefs.h <<EOF
5018 #define $ac_tr_hdr 1
5019 EOF
5020  
5021 else
5022   echo "$ac_t""no" 1>&6
5023 fi
5024 done
5025
5026 if test "$ac_cv_header_regex_h" != yes ; then
5027         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
5028 fi
5029 echo $ac_n "checking for regfree""... $ac_c" 1>&6
5030 echo "configure:5031: checking for regfree" >&5
5031 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
5032   echo $ac_n "(cached) $ac_c" 1>&6
5033 else
5034   cat > conftest.$ac_ext <<EOF
5035 #line 5036 "configure"
5036 #include "confdefs.h"
5037 /* System header to define __stub macros and hopefully few prototypes,
5038     which can conflict with char regfree(); below.  */
5039 #include <assert.h>
5040 /* Override any gcc2 internal prototype to avoid an error.  */
5041 /* We use char because int might match the return type of a gcc2
5042     builtin and then its argument prototype would still apply.  */
5043 char regfree();
5044 char (*f)();
5045
5046 int main() {
5047
5048 /* The GNU C library defines this for functions which it implements
5049     to always fail with ENOSYS.  Some functions are actually named
5050     something starting with __ and the normal name is an alias.  */
5051 #if defined (__stub_regfree) || defined (__stub___regfree)
5052 choke me
5053 #else
5054 f = regfree;
5055 #endif
5056
5057 ; return 0; }
5058 EOF
5059 if { (eval echo configure:5060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5060   rm -rf conftest*
5061   eval "ac_cv_func_regfree=yes"
5062 else
5063   echo "configure: failed program was:" >&5
5064   cat conftest.$ac_ext >&5
5065   rm -rf conftest*
5066   eval "ac_cv_func_regfree=no"
5067 fi
5068 rm -f conftest*
5069 fi
5070
5071 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
5072   echo "$ac_t""yes" 1>&6
5073   :
5074 else
5075   echo "$ac_t""no" 1>&6
5076 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
5077 fi
5078
5079
5080
5081 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
5082 echo "configure:5083: checking for compatible POSIX regex" >&5
5083 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
5084   echo $ac_n "(cached) $ac_c" 1>&6
5085 else
5086   
5087         if test "$cross_compiling" = yes; then
5088   ol_cv_c_posix_regex=cross
5089 else
5090   cat > conftest.$ac_ext <<EOF
5091 #line 5092 "configure"
5092 #include "confdefs.h"
5093
5094 #include <sys/types.h>
5095 #include <regex.h>
5096 static char *pattern, *string;
5097 main()
5098 {
5099         int rc;
5100         regex_t re;
5101
5102         pattern = "^A";
5103
5104         if(regcomp(&re, pattern, 0)) {
5105                 return -1;
5106         }
5107         
5108         string = "ALL MATCH";
5109         
5110         rc = regexec(&re, string, 0, (void*)0, 0);
5111
5112         regfree(&re);
5113
5114         return rc;
5115 }
5116 EOF
5117 if { (eval echo configure:5118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5118 then
5119   ol_cv_c_posix_regex=yes
5120 else
5121   echo "configure: failed program was:" >&5
5122   cat conftest.$ac_ext >&5
5123   rm -fr conftest*
5124   ol_cv_c_posix_regex=no
5125 fi
5126 rm -fr conftest*
5127 fi
5128
5129 fi
5130
5131 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5132
5133 if test "$ol_cv_c_posix_regex" = no ; then
5134         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5135 fi
5136
5137 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
5138 echo "configure:5139: checking for sigset in -lV3" >&5
5139 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
5140 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5141   echo $ac_n "(cached) $ac_c" 1>&6
5142 else
5143   ac_save_LIBS="$LIBS"
5144 LIBS="-lV3  $LIBS"
5145 cat > conftest.$ac_ext <<EOF
5146 #line 5147 "configure"
5147 #include "confdefs.h"
5148 /* Override any gcc2 internal prototype to avoid an error.  */
5149 /* We use char because int might match the return type of a gcc2
5150     builtin and then its argument prototype would still apply.  */
5151 char sigset();
5152
5153 int main() {
5154 sigset()
5155 ; return 0; }
5156 EOF
5157 if { (eval echo configure:5158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5158   rm -rf conftest*
5159   eval "ac_cv_lib_$ac_lib_var=yes"
5160 else
5161   echo "configure: failed program was:" >&5
5162   cat conftest.$ac_ext >&5
5163   rm -rf conftest*
5164   eval "ac_cv_lib_$ac_lib_var=no"
5165 fi
5166 rm -f conftest*
5167 LIBS="$ac_save_LIBS"
5168
5169 fi
5170 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5171   echo "$ac_t""yes" 1>&6
5172     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5173     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5174   cat >> confdefs.h <<EOF
5175 #define $ac_tr_lib 1
5176 EOF
5177
5178   LIBS="-lV3 $LIBS"
5179
5180 else
5181   echo "$ac_t""no" 1>&6
5182 fi
5183
5184
5185 echo $ac_n "checking for res_search""... $ac_c" 1>&6
5186 echo "configure:5187: checking for res_search" >&5
5187 if eval "test \"\${ac_cv_func_res_search+set}\" = set"; then
5188   echo $ac_n "(cached) $ac_c" 1>&6
5189 else
5190   cat > conftest.$ac_ext <<EOF
5191 #line 5192 "configure"
5192 #include "confdefs.h"
5193 /* System header to define __stub macros and hopefully few prototypes,
5194     which can conflict with char res_search(); below.  */
5195 #include <assert.h>
5196 /* Override any gcc2 internal prototype to avoid an error.  */
5197 /* We use char because int might match the return type of a gcc2
5198     builtin and then its argument prototype would still apply.  */
5199 char res_search();
5200 char (*f)();
5201
5202 int main() {
5203
5204 /* The GNU C library defines this for functions which it implements
5205     to always fail with ENOSYS.  Some functions are actually named
5206     something starting with __ and the normal name is an alias.  */
5207 #if defined (__stub_res_search) || defined (__stub___res_search)
5208 choke me
5209 #else
5210 f = res_search;
5211 #endif
5212
5213 ; return 0; }
5214 EOF
5215 if { (eval echo configure:5216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5216   rm -rf conftest*
5217   eval "ac_cv_func_res_search=yes"
5218 else
5219   echo "configure: failed program was:" >&5
5220   cat conftest.$ac_ext >&5
5221   rm -rf conftest*
5222   eval "ac_cv_func_res_search=no"
5223 fi
5224 rm -f conftest*
5225 fi
5226
5227 if eval "test \"`echo '$ac_cv_func_'res_search`\" = yes"; then
5228   echo "$ac_t""yes" 1>&6
5229   :
5230 else
5231   echo "$ac_t""no" 1>&6
5232 fi
5233
5234 if test $ac_cv_func_res_search = no ; then 
5235         echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
5236 echo "configure:5237: checking for res_search in -lbind" >&5
5237 ac_lib_var=`echo bind'_'res_search | sed 'y%./+-:%__p__%'`
5238 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5239   echo $ac_n "(cached) $ac_c" 1>&6
5240 else
5241   ac_save_LIBS="$LIBS"
5242 LIBS="-lbind  $LIBS"
5243 cat > conftest.$ac_ext <<EOF
5244 #line 5245 "configure"
5245 #include "confdefs.h"
5246 /* Override any gcc2 internal prototype to avoid an error.  */
5247 /* We use char because int might match the return type of a gcc2
5248     builtin and then its argument prototype would still apply.  */
5249 char res_search();
5250
5251 int main() {
5252 res_search()
5253 ; return 0; }
5254 EOF
5255 if { (eval echo configure:5256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5256   rm -rf conftest*
5257   eval "ac_cv_lib_$ac_lib_var=yes"
5258 else
5259   echo "configure: failed program was:" >&5
5260   cat conftest.$ac_ext >&5
5261   rm -rf conftest*
5262   eval "ac_cv_lib_$ac_lib_var=no"
5263 fi
5264 rm -f conftest*
5265 LIBS="$ac_save_LIBS"
5266
5267 fi
5268 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5269   echo "$ac_t""yes" 1>&6
5270     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5271     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5272   cat >> confdefs.h <<EOF
5273 #define $ac_tr_lib 1
5274 EOF
5275
5276   LIBS="-lbind $LIBS"
5277
5278 else
5279   echo "$ac_t""no" 1>&6
5280 fi
5281
5282         ac_cv_func_res_search=$ac_cv_lib_bind_res_search
5283 fi
5284
5285 if test $ac_cv_func_res_search = no ; then 
5286         echo $ac_n "checking for __res_search in -lbind""... $ac_c" 1>&6
5287 echo "configure:5288: checking for __res_search in -lbind" >&5
5288 ac_lib_var=`echo bind'_'__res_search | sed 'y%./+-:%__p__%'`
5289 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5290   echo $ac_n "(cached) $ac_c" 1>&6
5291 else
5292   ac_save_LIBS="$LIBS"
5293 LIBS="-lbind  $LIBS"
5294 cat > conftest.$ac_ext <<EOF
5295 #line 5296 "configure"
5296 #include "confdefs.h"
5297 /* Override any gcc2 internal prototype to avoid an error.  */
5298 /* We use char because int might match the return type of a gcc2
5299     builtin and then its argument prototype would still apply.  */
5300 char __res_search();
5301
5302 int main() {
5303 __res_search()
5304 ; return 0; }
5305 EOF
5306 if { (eval echo configure:5307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5307   rm -rf conftest*
5308   eval "ac_cv_lib_$ac_lib_var=yes"
5309 else
5310   echo "configure: failed program was:" >&5
5311   cat conftest.$ac_ext >&5
5312   rm -rf conftest*
5313   eval "ac_cv_lib_$ac_lib_var=no"
5314 fi
5315 rm -f conftest*
5316 LIBS="$ac_save_LIBS"
5317
5318 fi
5319 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5320   echo "$ac_t""yes" 1>&6
5321     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5322     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5323   cat >> confdefs.h <<EOF
5324 #define $ac_tr_lib 1
5325 EOF
5326
5327   LIBS="-lbind $LIBS"
5328
5329 else
5330   echo "$ac_t""no" 1>&6
5331 fi
5332
5333         ac_cv_func_res_search=$ac_cv_lib_bind___res_search
5334 fi
5335
5336 if test $ac_cv_func_res_search = no ; then 
5337         echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
5338 echo "configure:5339: checking for res_search in -lresolv" >&5
5339 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-:%__p__%'`
5340 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5341   echo $ac_n "(cached) $ac_c" 1>&6
5342 else
5343   ac_save_LIBS="$LIBS"
5344 LIBS="-lresolv  $LIBS"
5345 cat > conftest.$ac_ext <<EOF
5346 #line 5347 "configure"
5347 #include "confdefs.h"
5348 /* Override any gcc2 internal prototype to avoid an error.  */
5349 /* We use char because int might match the return type of a gcc2
5350     builtin and then its argument prototype would still apply.  */
5351 char res_search();
5352
5353 int main() {
5354 res_search()
5355 ; return 0; }
5356 EOF
5357 if { (eval echo configure:5358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5358   rm -rf conftest*
5359   eval "ac_cv_lib_$ac_lib_var=yes"
5360 else
5361   echo "configure: failed program was:" >&5
5362   cat conftest.$ac_ext >&5
5363   rm -rf conftest*
5364   eval "ac_cv_lib_$ac_lib_var=no"
5365 fi
5366 rm -f conftest*
5367 LIBS="$ac_save_LIBS"
5368
5369 fi
5370 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5371   echo "$ac_t""yes" 1>&6
5372     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5373     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5374   cat >> confdefs.h <<EOF
5375 #define $ac_tr_lib 1
5376 EOF
5377
5378   LIBS="-lresolv $LIBS"
5379
5380 else
5381   echo "$ac_t""no" 1>&6
5382 fi
5383
5384         ac_cv_func_res_search=$ac_cv_lib_resolv_res_search
5385 fi
5386
5387 if test "$ac_cv_func_res_search" = yes ; then
5388         cat >> confdefs.h <<\EOF
5389 #define HAVE_RES_SEARCH 1
5390 EOF
5391
5392 elif test $ol_enable_dns = yes ; then
5393         { echo "configure: error: --enable-dns requires res_search" 1>&2; exit 1; }
5394 elif test $ol_enable_dns != no ; then
5395         echo "configure: warning: no res_search, disabling DNS support" 1>&2
5396 fi
5397
5398
5399 # ISODE tests
5400 ol_link_isode=no
5401 if test $ol_enable_ldapd != no ; then
5402         echo "configure: warning: ldapd is not supported and may suffer from bit rot." 1>&2
5403
5404                 echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
5405 echo "configure:5406: checking for main in -lxtpp" >&5
5406 ac_lib_var=`echo xtpp'_'main | sed 'y%./+-:%__p__%'`
5407 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5408   echo $ac_n "(cached) $ac_c" 1>&6
5409 else
5410   ac_save_LIBS="$LIBS"
5411 LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
5412 cat > conftest.$ac_ext <<EOF
5413 #line 5414 "configure"
5414 #include "confdefs.h"
5415
5416 int main() {
5417 main()
5418 ; return 0; }
5419 EOF
5420 if { (eval echo configure:5421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5421   rm -rf conftest*
5422   eval "ac_cv_lib_$ac_lib_var=yes"
5423 else
5424   echo "configure: failed program was:" >&5
5425   cat conftest.$ac_ext >&5
5426   rm -rf conftest*
5427   eval "ac_cv_lib_$ac_lib_var=no"
5428 fi
5429 rm -f conftest*
5430 LIBS="$ac_save_LIBS"
5431
5432 fi
5433 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5434   echo "$ac_t""yes" 1>&6
5435   
5436                 ol_link_isode=yes
5437                 cat >> confdefs.h <<\EOF
5438 #define HAVE_XTPP 1
5439 EOF
5440
5441                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
5442                 
5443 else
5444   echo "$ac_t""no" 1>&6
5445 :
5446 fi
5447
5448         echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
5449 echo "configure:5450: checking for main in -ldsap" >&5
5450 ac_lib_var=`echo dsap'_'main | sed 'y%./+-:%__p__%'`
5451 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5452   echo $ac_n "(cached) $ac_c" 1>&6
5453 else
5454   ac_save_LIBS="$LIBS"
5455 LIBS="-ldsap -lisode $LIBS"
5456 cat > conftest.$ac_ext <<EOF
5457 #line 5458 "configure"
5458 #include "confdefs.h"
5459
5460 int main() {
5461 main()
5462 ; return 0; }
5463 EOF
5464 if { (eval echo configure:5465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5465   rm -rf conftest*
5466   eval "ac_cv_lib_$ac_lib_var=yes"
5467 else
5468   echo "configure: failed program was:" >&5
5469   cat conftest.$ac_ext >&5
5470   rm -rf conftest*
5471   eval "ac_cv_lib_$ac_lib_var=no"
5472 fi
5473 rm -f conftest*
5474 LIBS="$ac_save_LIBS"
5475
5476 fi
5477 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5478   echo "$ac_t""yes" 1>&6
5479   
5480                 ol_link_isode=yes
5481                 cat >> confdefs.h <<\EOF
5482 #define HAVE_DSAP 1
5483 EOF
5484
5485                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
5486                 
5487 else
5488   echo "$ac_t""no" 1>&6
5489 :
5490 fi
5491
5492         echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
5493 echo "configure:5494: checking for main in -lisode" >&5
5494 ac_lib_var=`echo isode'_'main | sed 'y%./+-:%__p__%'`
5495 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5496   echo $ac_n "(cached) $ac_c" 1>&6
5497 else
5498   ac_save_LIBS="$LIBS"
5499 LIBS="-lisode  $LIBS"
5500 cat > conftest.$ac_ext <<EOF
5501 #line 5502 "configure"
5502 #include "confdefs.h"
5503
5504 int main() {
5505 main()
5506 ; return 0; }
5507 EOF
5508 if { (eval echo configure:5509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5509   rm -rf conftest*
5510   eval "ac_cv_lib_$ac_lib_var=yes"
5511 else
5512   echo "configure: failed program was:" >&5
5513   cat conftest.$ac_ext >&5
5514   rm -rf conftest*
5515   eval "ac_cv_lib_$ac_lib_var=no"
5516 fi
5517 rm -f conftest*
5518 LIBS="$ac_save_LIBS"
5519
5520 fi
5521 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5522   echo "$ac_t""yes" 1>&6
5523   
5524                 ol_link_isode=yes
5525                 cat >> confdefs.h <<\EOF
5526 #define HAVE_ISODE 1
5527 EOF
5528
5529                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
5530                 
5531 else
5532   echo "$ac_t""no" 1>&6
5533 :
5534 fi
5535
5536 fi
5537
5538 if test $ol_link_isode != no; then
5539         echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
5540 echo "configure:5541: checking for main in -lpp" >&5
5541 ac_lib_var=`echo pp'_'main | sed 'y%./+-:%__p__%'`
5542 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5543   echo $ac_n "(cached) $ac_c" 1>&6
5544 else
5545   ac_save_LIBS="$LIBS"
5546 LIBS="-lpp  $LIBS"
5547 cat > conftest.$ac_ext <<EOF
5548 #line 5549 "configure"
5549 #include "confdefs.h"
5550
5551 int main() {
5552 main()
5553 ; return 0; }
5554 EOF
5555 if { (eval echo configure:5556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5556   rm -rf conftest*
5557   eval "ac_cv_lib_$ac_lib_var=yes"
5558 else
5559   echo "configure: failed program was:" >&5
5560   cat conftest.$ac_ext >&5
5561   rm -rf conftest*
5562   eval "ac_cv_lib_$ac_lib_var=no"
5563 fi
5564 rm -f conftest*
5565 LIBS="$ac_save_LIBS"
5566
5567 fi
5568 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5569   echo "$ac_t""yes" 1>&6
5570   
5571                 cat >> confdefs.h <<\EOF
5572 #define HAVE_PP 1
5573 EOF
5574
5575                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
5576                 
5577 else
5578   echo "$ac_t""no" 1>&6
5579 :
5580 fi
5581
5582
5583         # Extract the first word of "pepsy", so it can be a program name with args.
5584 set dummy pepsy; ac_word=$2
5585 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
5586 echo "configure:5587: checking for $ac_word" >&5
5587 if eval "test \"\${ac_cv_path_PEPSY+set}\" = set"; then
5588   echo $ac_n "(cached) $ac_c" 1>&6
5589 else
5590   case "$PEPSY" in
5591   /*)
5592   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a path.
5593   ;;
5594   ?:/*)                  
5595   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a dos path.
5596   ;;
5597   *)
5598   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
5599   ac_dummy="$PATH"
5600   for ac_dir in $ac_dummy; do 
5601     test -z "$ac_dir" && ac_dir=.
5602     if test -f $ac_dir/$ac_word; then
5603       ac_cv_path_PEPSY="$ac_dir/$ac_word"
5604       break
5605     fi
5606   done
5607   IFS="$ac_save_ifs"
5608   ;;
5609 esac
5610 fi
5611 PEPSY="$ac_cv_path_PEPSY"
5612 if test -n "$PEPSY"; then
5613   echo "$ac_t""$PEPSY" 1>&6
5614 else
5615   echo "$ac_t""no" 1>&6
5616 fi
5617
5618 fi
5619
5620 if test $ol_enable_quipu != no ; then
5621         for ac_hdr in quipu/commonarg.h
5622 do
5623 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5624 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5625 echo "configure:5626: checking for $ac_hdr" >&5
5626 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5627   echo $ac_n "(cached) $ac_c" 1>&6
5628 else
5629   cat > conftest.$ac_ext <<EOF
5630 #line 5631 "configure"
5631 #include "confdefs.h"
5632 #include <$ac_hdr>
5633 EOF
5634 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5635 { (eval echo configure:5636: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5636 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5637 if test -z "$ac_err"; then
5638   rm -rf conftest*
5639   eval "ac_cv_header_$ac_safe=yes"
5640 else
5641   echo "$ac_err" >&5
5642   echo "configure: failed program was:" >&5
5643   cat conftest.$ac_ext >&5
5644   rm -rf conftest*
5645   eval "ac_cv_header_$ac_safe=no"
5646 fi
5647 rm -f conftest*
5648 fi
5649 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5650   echo "$ac_t""yes" 1>&6
5651     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5652   cat >> confdefs.h <<EOF
5653 #define $ac_tr_hdr 1
5654 EOF
5655  
5656 else
5657   echo "$ac_t""no" 1>&6
5658 fi
5659 done
5660
5661
5662         if test $ac_cv_header_quipu_commonarg_h = yes ; then
5663                 BUILD_QUIPU=yes
5664         elif test $ol_enable_quipu = auto ; then
5665                 echo "configure: warning: no quipu for --enable-quipu=auto, disabling" 1>&2
5666         else
5667                 { echo "configure: error: no quipu for --enable-quipu=$ol_enable_quipu" 1>&2; exit 1; }
5668         fi
5669 fi
5670
5671 ol_link_kerberos=no
5672
5673 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
5674         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
5675 do
5676 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5677 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5678 echo "configure:5679: checking for $ac_hdr" >&5
5679 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5680   echo $ac_n "(cached) $ac_c" 1>&6
5681 else
5682   cat > conftest.$ac_ext <<EOF
5683 #line 5684 "configure"
5684 #include "confdefs.h"
5685 #include <$ac_hdr>
5686 EOF
5687 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5688 { (eval echo configure:5689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5689 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5690 if test -z "$ac_err"; then
5691   rm -rf conftest*
5692   eval "ac_cv_header_$ac_safe=yes"
5693 else
5694   echo "$ac_err" >&5
5695   echo "configure: failed program was:" >&5
5696   cat conftest.$ac_ext >&5
5697   rm -rf conftest*
5698   eval "ac_cv_header_$ac_safe=no"
5699 fi
5700 rm -f conftest*
5701 fi
5702 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5703   echo "$ac_t""yes" 1>&6
5704     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5705   cat >> confdefs.h <<EOF
5706 #define $ac_tr_hdr 1
5707 EOF
5708  
5709 else
5710   echo "$ac_t""no" 1>&6
5711 fi
5712 done
5713
5714
5715         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
5716                 echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
5717 echo "configure:5718: checking for main in -lkrb4" >&5
5718 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
5719 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5720   echo $ac_n "(cached) $ac_c" 1>&6
5721 else
5722   ac_save_LIBS="$LIBS"
5723 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
5724 cat > conftest.$ac_ext <<EOF
5725 #line 5726 "configure"
5726 #include "confdefs.h"
5727
5728 int main() {
5729 main()
5730 ; return 0; }
5731 EOF
5732 if { (eval echo configure:5733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5733   rm -rf conftest*
5734   eval "ac_cv_lib_$ac_lib_var=yes"
5735 else
5736   echo "configure: failed program was:" >&5
5737   cat conftest.$ac_ext >&5
5738   rm -rf conftest*
5739   eval "ac_cv_lib_$ac_lib_var=no"
5740 fi
5741 rm -f conftest*
5742 LIBS="$ac_save_LIBS"
5743
5744 fi
5745 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5746   echo "$ac_t""yes" 1>&6
5747   have_k5=yes
5748 else
5749   echo "$ac_t""no" 1>&6
5750 have_k5=no
5751 fi
5752
5753
5754                 if test $have_k5 = yes ; then
5755                         ol_with_kerberos=found
5756                         ol_link_kerberos=yes
5757
5758                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
5759
5760                         LIBS="$KRB_LIBS $LIBS"
5761
5762                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
5763 echo "configure:5764: checking for des_debug in Kerberos libraries" >&5
5764 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
5765   echo $ac_n "(cached) $ac_c" 1>&6
5766 else
5767   
5768                                                                 save_LIBS="$LIBS"
5769                                 LIBS="$KRB_LIBS $LIBS"
5770                                 cat > conftest.$ac_ext <<EOF
5771 #line 5772 "configure"
5772 #include "confdefs.h"
5773
5774 #include <kerberosIV/krb.h>
5775 #include <kerberosIV/des.h>
5776 extern int des_debug;
5777
5778 int main() {
5779
5780 des_debug = 1;
5781
5782 ; return 0; }
5783 EOF
5784 if { (eval echo configure:5785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5785   rm -rf conftest*
5786   ol_cv_var_des_debug=yes
5787 else
5788   echo "configure: failed program was:" >&5
5789   cat conftest.$ac_ext >&5
5790   rm -rf conftest*
5791   ol_cv_var_des_debug=no
5792 fi
5793 rm -f conftest*
5794                                                                 LIBS="$save_LIBS"
5795                         
5796 fi
5797
5798 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
5799
5800                         if test $ol_cv_var_des_debug = yes ; then
5801                                 cat >> confdefs.h <<\EOF
5802 #define HAVE_DES_DEBUG 1
5803 EOF
5804
5805                         fi
5806
5807                         LIBS="$save_LIBS"
5808                 fi
5809         fi
5810 fi
5811
5812 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
5813         for ac_hdr in krb.h des.h
5814 do
5815 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5816 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5817 echo "configure:5818: checking for $ac_hdr" >&5
5818 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5819   echo $ac_n "(cached) $ac_c" 1>&6
5820 else
5821   cat > conftest.$ac_ext <<EOF
5822 #line 5823 "configure"
5823 #include "confdefs.h"
5824 #include <$ac_hdr>
5825 EOF
5826 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5827 { (eval echo configure:5828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5828 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5829 if test -z "$ac_err"; then
5830   rm -rf conftest*
5831   eval "ac_cv_header_$ac_safe=yes"
5832 else
5833   echo "$ac_err" >&5
5834   echo "configure: failed program was:" >&5
5835   cat conftest.$ac_ext >&5
5836   rm -rf conftest*
5837   eval "ac_cv_header_$ac_safe=no"
5838 fi
5839 rm -f conftest*
5840 fi
5841 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5842   echo "$ac_t""yes" 1>&6
5843     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5844   cat >> confdefs.h <<EOF
5845 #define $ac_tr_hdr 1
5846 EOF
5847  
5848 else
5849   echo "$ac_t""no" 1>&6
5850 fi
5851 done
5852
5853
5854         if test $ac_cv_header_krb_h = yes ; then
5855                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
5856 echo "configure:5857: checking for main in -lkrb" >&5
5857 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
5858 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5859   echo $ac_n "(cached) $ac_c" 1>&6
5860 else
5861   ac_save_LIBS="$LIBS"
5862 LIBS="-lkrb -ldes $LIBS"
5863 cat > conftest.$ac_ext <<EOF
5864 #line 5865 "configure"
5865 #include "confdefs.h"
5866
5867 int main() {
5868 main()
5869 ; return 0; }
5870 EOF
5871 if { (eval echo configure:5872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5872   rm -rf conftest*
5873   eval "ac_cv_lib_$ac_lib_var=yes"
5874 else
5875   echo "configure: failed program was:" >&5
5876   cat conftest.$ac_ext >&5
5877   rm -rf conftest*
5878   eval "ac_cv_lib_$ac_lib_var=no"
5879 fi
5880 rm -f conftest*
5881 LIBS="$ac_save_LIBS"
5882
5883 fi
5884 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5885   echo "$ac_t""yes" 1>&6
5886   have_k4=yes
5887 else
5888   echo "$ac_t""no" 1>&6
5889 have_k4=no
5890 fi
5891
5892
5893                 if test $have_k4 = yes ; then
5894                         ol_with_kerberos=found
5895                         ol_link_kerberos=yes
5896
5897                         KRB_LIBS="-lkrb -ldes"
5898                 fi
5899         fi
5900 fi
5901
5902 if test $ol_link_kerberos = yes ; then
5903         cat >> confdefs.h <<\EOF
5904 #define HAVE_KERBEROS 1
5905 EOF
5906
5907 fi
5908
5909 ol_link_tls=no
5910 if test $ol_with_tls != no ; then
5911         
5912         for ac_hdr in openssl/ssl.h ssl.h
5913 do
5914 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5915 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5916 echo "configure:5917: checking for $ac_hdr" >&5
5917 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5918   echo $ac_n "(cached) $ac_c" 1>&6
5919 else
5920   cat > conftest.$ac_ext <<EOF
5921 #line 5922 "configure"
5922 #include "confdefs.h"
5923 #include <$ac_hdr>
5924 EOF
5925 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5926 { (eval echo configure:5927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5927 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5928 if test -z "$ac_err"; then
5929   rm -rf conftest*
5930   eval "ac_cv_header_$ac_safe=yes"
5931 else
5932   echo "$ac_err" >&5
5933   echo "configure: failed program was:" >&5
5934   cat conftest.$ac_ext >&5
5935   rm -rf conftest*
5936   eval "ac_cv_header_$ac_safe=no"
5937 fi
5938 rm -f conftest*
5939 fi
5940 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5941   echo "$ac_t""yes" 1>&6
5942     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5943   cat >> confdefs.h <<EOF
5944 #define $ac_tr_hdr 1
5945 EOF
5946  
5947 else
5948   echo "$ac_t""no" 1>&6
5949 fi
5950 done
5951
5952         
5953         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
5954                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
5955 echo "configure:5956: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
5956 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
5957 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5958   echo $ac_n "(cached) $ac_c" 1>&6
5959 else
5960   ac_save_LIBS="$LIBS"
5961 LIBS="-lssl -lcrypto $LIBS"
5962 cat > conftest.$ac_ext <<EOF
5963 #line 5964 "configure"
5964 #include "confdefs.h"
5965 /* Override any gcc2 internal prototype to avoid an error.  */
5966 /* We use char because int might match the return type of a gcc2
5967     builtin and then its argument prototype would still apply.  */
5968 char SSLeay_add_ssl_algorithms();
5969
5970 int main() {
5971 SSLeay_add_ssl_algorithms()
5972 ; return 0; }
5973 EOF
5974 if { (eval echo configure:5975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5975   rm -rf conftest*
5976   eval "ac_cv_lib_$ac_lib_var=yes"
5977 else
5978   echo "configure: failed program was:" >&5
5979   cat conftest.$ac_ext >&5
5980   rm -rf conftest*
5981   eval "ac_cv_lib_$ac_lib_var=no"
5982 fi
5983 rm -f conftest*
5984 LIBS="$ac_save_LIBS"
5985
5986 fi
5987 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5988   echo "$ac_t""yes" 1>&6
5989   have_ssleay=yes
5990                         need_rsaref=no
5991 else
5992   echo "$ac_t""no" 1>&6
5993 have_ssleay=no
5994 fi
5995
5996                         
5997                 if test $have_ssleay = no ; then
5998                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
5999 echo "configure:6000: checking for SSL_library_init in -lssl" >&5
6000 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
6001 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6002   echo $ac_n "(cached) $ac_c" 1>&6
6003 else
6004   ac_save_LIBS="$LIBS"
6005 LIBS="-lssl -lcrypto $LIBS"
6006 cat > conftest.$ac_ext <<EOF
6007 #line 6008 "configure"
6008 #include "confdefs.h"
6009 /* Override any gcc2 internal prototype to avoid an error.  */
6010 /* We use char because int might match the return type of a gcc2
6011     builtin and then its argument prototype would still apply.  */
6012 char SSL_library_init();
6013
6014 int main() {
6015 SSL_library_init()
6016 ; return 0; }
6017 EOF
6018 if { (eval echo configure:6019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6019   rm -rf conftest*
6020   eval "ac_cv_lib_$ac_lib_var=yes"
6021 else
6022   echo "configure: failed program was:" >&5
6023   cat conftest.$ac_ext >&5
6024   rm -rf conftest*
6025   eval "ac_cv_lib_$ac_lib_var=no"
6026 fi
6027 rm -f conftest*
6028 LIBS="$ac_save_LIBS"
6029
6030 fi
6031 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6032   echo "$ac_t""yes" 1>&6
6033   have_ssleay=yes
6034                                 need_rsaref=no
6035 else
6036   echo "$ac_t""no" 1>&6
6037 have_ssleay=no
6038 fi
6039
6040                 fi
6041
6042                 if test $have_ssleay = no ; then
6043                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
6044 echo "configure:6045: checking for ssl3_accept in -lssl" >&5
6045 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
6046 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6047   echo $ac_n "(cached) $ac_c" 1>&6
6048 else
6049   ac_save_LIBS="$LIBS"
6050 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
6051 cat > conftest.$ac_ext <<EOF
6052 #line 6053 "configure"
6053 #include "confdefs.h"
6054 /* Override any gcc2 internal prototype to avoid an error.  */
6055 /* We use char because int might match the return type of a gcc2
6056     builtin and then its argument prototype would still apply.  */
6057 char ssl3_accept();
6058
6059 int main() {
6060 ssl3_accept()
6061 ; return 0; }
6062 EOF
6063 if { (eval echo configure:6064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6064   rm -rf conftest*
6065   eval "ac_cv_lib_$ac_lib_var=yes"
6066 else
6067   echo "configure: failed program was:" >&5
6068   cat conftest.$ac_ext >&5
6069   rm -rf conftest*
6070   eval "ac_cv_lib_$ac_lib_var=no"
6071 fi
6072 rm -f conftest*
6073 LIBS="$ac_save_LIBS"
6074
6075 fi
6076 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6077   echo "$ac_t""yes" 1>&6
6078   have_ssleay=yes
6079                                 need_rsaref=yes
6080 else
6081   echo "$ac_t""no" 1>&6
6082 have_ssleay=no
6083 fi
6084
6085                 fi
6086
6087                 if test $have_ssleay = yes ; then
6088                         ol_with_tls=found
6089                         ol_link_tls=yes
6090
6091                         cat >> confdefs.h <<\EOF
6092 #define HAVE_SSLEAY 1
6093 EOF
6094
6095
6096                         if test $need_rsaref = yes; then
6097                                 cat >> confdefs.h <<\EOF
6098 #define HAVE_RSAREF 1
6099 EOF
6100
6101
6102                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
6103                         else
6104                                 TLS_LIBS="-lssl -lcrypto"
6105                         fi
6106                 fi
6107         fi
6108 fi
6109
6110 if test $ol_link_tls = yes ; then
6111         cat >> confdefs.h <<\EOF
6112 #define HAVE_TLS 1
6113 EOF
6114
6115 fi      
6116
6117 for ac_func in \
6118         ctime_r                 \
6119         gethostbyname_r gethostbyaddr_r \
6120
6121 do
6122 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6123 echo "configure:6124: checking for $ac_func" >&5
6124 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6125   echo $ac_n "(cached) $ac_c" 1>&6
6126 else
6127   cat > conftest.$ac_ext <<EOF
6128 #line 6129 "configure"
6129 #include "confdefs.h"
6130 /* System header to define __stub macros and hopefully few prototypes,
6131     which can conflict with char $ac_func(); below.  */
6132 #include <assert.h>
6133 /* Override any gcc2 internal prototype to avoid an error.  */
6134 /* We use char because int might match the return type of a gcc2
6135     builtin and then its argument prototype would still apply.  */
6136 char $ac_func();
6137 char (*f)();
6138
6139 int main() {
6140
6141 /* The GNU C library defines this for functions which it implements
6142     to always fail with ENOSYS.  Some functions are actually named
6143     something starting with __ and the normal name is an alias.  */
6144 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6145 choke me
6146 #else
6147 f = $ac_func;
6148 #endif
6149
6150 ; return 0; }
6151 EOF
6152 if { (eval echo configure:6153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6153   rm -rf conftest*
6154   eval "ac_cv_func_$ac_func=yes"
6155 else
6156   echo "configure: failed program was:" >&5
6157   cat conftest.$ac_ext >&5
6158   rm -rf conftest*
6159   eval "ac_cv_func_$ac_func=no"
6160 fi
6161 rm -f conftest*
6162 fi
6163
6164 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6165   echo "$ac_t""yes" 1>&6
6166     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6167   cat >> confdefs.h <<EOF
6168 #define $ac_tr_func 1
6169 EOF
6170  
6171 else
6172   echo "$ac_t""no" 1>&6
6173 fi
6174 done
6175
6176
6177 if test "$ac_cv_func_ctime_r" = no ; then
6178         ol_cv_func_ctime_r_nargs=0
6179 else
6180         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
6181 echo "configure:6182: checking number of arguments of ctime_r" >&5
6182 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
6183   echo $ac_n "(cached) $ac_c" 1>&6
6184 else
6185   cat > conftest.$ac_ext <<EOF
6186 #line 6187 "configure"
6187 #include "confdefs.h"
6188 #include <time.h>
6189 int main() {
6190 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
6191 ; return 0; }
6192 EOF
6193 if { (eval echo configure:6194: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6194   rm -rf conftest*
6195   ol_cv_func_ctime_r_nargs=3
6196 else
6197   echo "configure: failed program was:" >&5
6198   cat conftest.$ac_ext >&5
6199   rm -rf conftest*
6200   cat > conftest.$ac_ext <<EOF
6201 #line 6202 "configure"
6202 #include "confdefs.h"
6203 #include <time.h>
6204 int main() {
6205 time_t ti; char *buffer; ctime_r(&ti,buffer);
6206 ; return 0; }
6207 EOF
6208 if { (eval echo configure:6209: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6209   rm -rf conftest*
6210   ol_cv_func_ctime_r_nargs=2
6211 else
6212   echo "configure: failed program was:" >&5
6213   cat conftest.$ac_ext >&5
6214   rm -rf conftest*
6215   ol_cv_func_ctime_r_nargs=0
6216 fi
6217 rm -f conftest*
6218 fi
6219 rm -f conftest*
6220 fi
6221
6222 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
6223   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
6224     cat >> confdefs.h <<EOF
6225 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
6226 EOF
6227
6228   fi
6229
6230 fi
6231
6232 if test "$ac_cv_func_gethostbyname_r" = yes ; then
6233         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
6234 echo "configure:6235: checking number of arguments of gethostbyname_r" >&5
6235 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
6236   echo $ac_n "(cached) $ac_c" 1>&6
6237 else
6238   cat > conftest.$ac_ext <<EOF
6239 #line 6240 "configure"
6240 #include "confdefs.h"
6241 #include <sys/types.h>
6242 #include <sys/socket.h>
6243 #include <netinet/in.h>
6244 #include <netdb.h>
6245 #define BUFSIZE (sizeof(struct hostent)+10)
6246 int main() {
6247 struct hostent hent; char buffer[BUFSIZE];
6248                 int bufsize=BUFSIZE;int h_errno;
6249                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
6250                         buffer, bufsize, &h_errno);
6251 ; return 0; }
6252 EOF
6253 if { (eval echo configure:6254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6254   rm -rf conftest*
6255   ol_cv_func_gethostbyname_r_nargs=5
6256 else
6257   echo "configure: failed program was:" >&5
6258   cat conftest.$ac_ext >&5
6259   rm -rf conftest*
6260   cat > conftest.$ac_ext <<EOF
6261 #line 6262 "configure"
6262 #include "confdefs.h"
6263 #include <sys/types.h>
6264 #include <sys/socket.h>
6265 #include <netinet/in.h>
6266 #include <netdb.h>
6267 #define BUFSIZE (sizeof(struct hostent)+10)
6268 int main() {
6269 struct hostent hent;struct hostent *rhent;
6270                         char buffer[BUFSIZE];
6271                         int bufsize=BUFSIZE;int h_errno;
6272                         (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
6273                                 &rhent, &h_errno);
6274 ; return 0; }
6275 EOF
6276 if { (eval echo configure:6277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6277   rm -rf conftest*
6278   ol_cv_func_gethostbyname_r_nargs=6
6279 else
6280   echo "configure: failed program was:" >&5
6281   cat conftest.$ac_ext >&5
6282   rm -rf conftest*
6283   ol_cv_func_gethostbyname_r_nargs=0
6284 fi
6285 rm -f conftest*
6286 fi
6287 rm -f conftest*
6288 fi
6289
6290 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
6291   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
6292         cat >> confdefs.h <<EOF
6293 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
6294 EOF
6295
6296   fi
6297
6298 else
6299         ol_cv_func_gethostbyname_r_nargs=0
6300 fi
6301  
6302 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
6303         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
6304 echo "configure:6305: checking number of arguments of gethostbyaddr_r" >&5
6305 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
6306   echo $ac_n "(cached) $ac_c" 1>&6
6307 else
6308   cat > conftest.$ac_ext <<EOF
6309 #line 6310 "configure"
6310 #include "confdefs.h"
6311 #include <sys/types.h>
6312 #include <sys/socket.h>
6313 #include <netinet/in.h>
6314 #include <netdb.h>
6315 #define BUFSIZE (sizeof(struct hostent)+10)
6316 int main() {
6317 struct hostent hent; char buffer[BUFSIZE]; 
6318             struct in_addr add;
6319             size_t alen=sizeof(struct in_addr);
6320             int bufsize=BUFSIZE;int h_errno;
6321                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
6322                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
6323 ; return 0; }
6324 EOF
6325 if { (eval echo configure:6326: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6326   rm -rf conftest*
6327   ol_cv_func_gethostbyaddr_r_nargs=7
6328 else
6329   echo "configure: failed program was:" >&5
6330   cat conftest.$ac_ext >&5
6331   rm -rf conftest*
6332   cat > conftest.$ac_ext <<EOF
6333 #line 6334 "configure"
6334 #include "confdefs.h"
6335 #include <sys/types.h>
6336 #include <sys/socket.h>
6337 #include <netinet/in.h>
6338 #include <netdb.h>
6339 #define BUFSIZE (sizeof(struct hostent)+10)
6340 int main() {
6341 struct hostent hent;
6342                         struct hostent *rhent; char buffer[BUFSIZE]; 
6343                         struct in_addr add;
6344                         size_t alen=sizeof(struct in_addr);
6345                         int bufsize=BUFSIZE;int h_errno;
6346                         (void)gethostbyaddr_r( (void *)&(add.s_addr),
6347                                 alen, AF_INET, &hent, buffer, bufsize, 
6348                                 &rhent, &h_errno);
6349 ; return 0; }
6350 EOF
6351 if { (eval echo configure:6352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6352   rm -rf conftest*
6353   ol_cv_func_gethostbyaddr_r_nargs=8
6354 else
6355   echo "configure: failed program was:" >&5
6356   cat conftest.$ac_ext >&5
6357   rm -rf conftest*
6358   ol_cv_func_gethostbyaddr_r_nargs=0
6359 fi
6360 rm -f conftest*
6361 fi
6362 rm -f conftest*
6363 fi
6364
6365 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
6366   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
6367     cat >> confdefs.h <<EOF
6368 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
6369 EOF
6370
6371   fi
6372
6373 else
6374         ol_cv_func_gethostbyaddr_r_nargs=0
6375 fi
6376
6377 if test "$ac_cv_func_ctime_r" = yes \
6378         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
6379         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
6380         -a "$ac_cv_func_gethostbyname_r" = yes \
6381         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
6382         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
6383         -a "$ac_cv_func_gethostbyaddr_r" = yes \
6384         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
6385         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
6386         ; then
6387  
6388         cat >> confdefs.h <<\EOF
6389 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
6390 EOF
6391
6392 fi
6393
6394 ol_link_threads=no
6395 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6396         -o $ol_with_threads = posix ; then
6397
6398         for ac_hdr in pthread.h
6399 do
6400 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6401 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6402 echo "configure:6403: checking for $ac_hdr" >&5
6403 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6404   echo $ac_n "(cached) $ac_c" 1>&6
6405 else
6406   cat > conftest.$ac_ext <<EOF
6407 #line 6408 "configure"
6408 #include "confdefs.h"
6409 #include <$ac_hdr>
6410 EOF
6411 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6412 { (eval echo configure:6413: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6413 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6414 if test -z "$ac_err"; then
6415   rm -rf conftest*
6416   eval "ac_cv_header_$ac_safe=yes"
6417 else
6418   echo "$ac_err" >&5
6419   echo "configure: failed program was:" >&5
6420   cat conftest.$ac_ext >&5
6421   rm -rf conftest*
6422   eval "ac_cv_header_$ac_safe=no"
6423 fi
6424 rm -f conftest*
6425 fi
6426 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6427   echo "$ac_t""yes" 1>&6
6428     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6429   cat >> confdefs.h <<EOF
6430 #define $ac_tr_hdr 1
6431 EOF
6432  
6433 else
6434   echo "$ac_t""no" 1>&6
6435 fi
6436 done
6437
6438
6439         if test $ac_cv_header_pthread_h = yes ; then
6440                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
6441 echo "configure:6442: checking POSIX thread version" >&5
6442 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
6443   echo $ac_n "(cached) $ac_c" 1>&6
6444 else
6445   
6446         cat > conftest.$ac_ext <<EOF
6447 #line 6448 "configure"
6448 #include "confdefs.h"
6449
6450 #               include <pthread.h>
6451                 /* this check could be improved */
6452 #               ifdef PTHREAD_ONCE_INIT
6453                         pthread_version_final
6454 #               endif
6455         
6456 EOF
6457 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6458   egrep "pthread_version_final" >/dev/null 2>&1; then
6459   rm -rf conftest*
6460   ol_pthread_final=yes
6461 else
6462   rm -rf conftest*
6463   ol_pthread_final=no
6464 fi
6465 rm -f conftest*
6466
6467
6468         cat > conftest.$ac_ext <<EOF
6469 #line 6470 "configure"
6470 #include "confdefs.h"
6471
6472 #               include <pthread.h>
6473                 /* this check could be improved */
6474 #               ifdef pthread_once_init
6475                         pthread_version_draft4
6476 #               endif
6477         
6478 EOF
6479 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6480   egrep "pthread_version_draft4" >/dev/null 2>&1; then
6481   rm -rf conftest*
6482   ol_pthread_draft4=yes
6483 else
6484   rm -rf conftest*
6485   ol_pthread_draft4=no
6486 fi
6487 rm -f conftest*
6488
6489
6490         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
6491                 ol_cv_pthread_version=final
6492         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
6493                 ol_cv_pthread_version=draft4
6494         else
6495                 ol_cv_pthread_version=unknown
6496         fi
6497
6498 fi
6499
6500 echo "$ac_t""$ol_cv_pthread_version" 1>&6
6501
6502
6503                 if test $ol_cv_pthread_version = final ; then
6504                         cat >> confdefs.h <<\EOF
6505 #define HAVE_PTHREADS_FINAL 1
6506 EOF
6507
6508                 elif test $ol_cv_pthread_version = draft4 ; then
6509                         cat >> confdefs.h <<\EOF
6510 #define HAVE_PTHREADS_D4 1
6511 EOF
6512
6513                 else
6514                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
6515                 fi
6516
6517                 # consider threads found
6518                 ol_with_threads=found
6519
6520                 
6521         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
6522 echo "configure:6523: checking for LinuxThreads pthread.h" >&5
6523 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
6524   echo $ac_n "(cached) $ac_c" 1>&6
6525 else
6526   cat > conftest.$ac_ext <<EOF
6527 #line 6528 "configure"
6528 #include "confdefs.h"
6529 #include <pthread.h>
6530 EOF
6531 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6532   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
6533   rm -rf conftest*
6534   ol_cv_header_linux_threads=yes
6535 else
6536   rm -rf conftest*
6537   ol_cv_header_linux_threads=no
6538 fi
6539 rm -f conftest*
6540
6541                 
6542 fi
6543
6544 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
6545         if test $ol_cv_header_linux_threads = yes; then
6546                 cat >> confdefs.h <<\EOF
6547 #define HAVE_LINUX_THREADS 1
6548 EOF
6549
6550         fi
6551
6552                 
6553         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
6554 echo "configure:6555: checking for GNU Pth pthread.h" >&5
6555 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
6556   echo $ac_n "(cached) $ac_c" 1>&6
6557 else
6558   cat > conftest.$ac_ext <<EOF
6559 #line 6560 "configure"
6560 #include "confdefs.h"
6561 #include <pthread.h>
6562 #ifdef _POSIX_THREAD_IS_GNU_PTH
6563         __gnu_pth__
6564 #endif
6565
6566 EOF
6567 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6568   egrep "__gnu_pth__" >/dev/null 2>&1; then
6569   rm -rf conftest*
6570   ol_cv_header_gnu_pth_pthread_h=yes
6571 else
6572   rm -rf conftest*
6573   ol_cv_header_gnu_pth_pthread_h=no
6574 fi
6575 rm -f conftest*
6576
6577                 
6578 fi
6579
6580 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
6581
6582
6583                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
6584                         for ac_hdr in sched.h
6585 do
6586 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6587 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6588 echo "configure:6589: checking for $ac_hdr" >&5
6589 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6590   echo $ac_n "(cached) $ac_c" 1>&6
6591 else
6592   cat > conftest.$ac_ext <<EOF
6593 #line 6594 "configure"
6594 #include "confdefs.h"
6595 #include <$ac_hdr>
6596 EOF
6597 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6598 { (eval echo configure:6599: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6599 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6600 if test -z "$ac_err"; then
6601   rm -rf conftest*
6602   eval "ac_cv_header_$ac_safe=yes"
6603 else
6604   echo "$ac_err" >&5
6605   echo "configure: failed program was:" >&5
6606   cat conftest.$ac_ext >&5
6607   rm -rf conftest*
6608   eval "ac_cv_header_$ac_safe=no"
6609 fi
6610 rm -f conftest*
6611 fi
6612 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6613   echo "$ac_t""yes" 1>&6
6614     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6615   cat >> confdefs.h <<EOF
6616 #define $ac_tr_hdr 1
6617 EOF
6618  
6619 else
6620   echo "$ac_t""no" 1>&6
6621 fi
6622 done
6623
6624                 fi
6625
6626                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
6627                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
6628 echo "configure:6629: checking for pthread_create in default libraries" >&5
6629 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
6630   echo $ac_n "(cached) $ac_c" 1>&6
6631 else
6632   
6633                 if test "$cross_compiling" = yes; then
6634   cat > conftest.$ac_ext <<EOF
6635 #line 6636 "configure"
6636 #include "confdefs.h"
6637 /* pthread test headers */
6638 #include <pthread.h>
6639 #ifndef NULL
6640 #define NULL (void*)0
6641 #endif
6642
6643 static void *task(p)
6644         void *p;
6645 {
6646         return (void *) (p == NULL);
6647 }
6648
6649 int main() {
6650
6651         /* pthread test function */
6652         pthread_t t;
6653         int status;
6654
6655         /* make sure pthread_create() isn't just a stub */
6656 #if HAVE_PTHREADS_D4
6657         status = pthread_create(&t, pthread_attr_default, task, NULL);
6658 #else
6659         status = pthread_create(&t, NULL, task, NULL);
6660 #endif
6661
6662         if( status ) exit( status );
6663
6664         /* make sure pthread_detach() isn't just a stub */
6665 #if HAVE_PTHREADS_D4
6666         status = pthread_detach( &t );
6667 #else
6668         status = pthread_detach( t );
6669 #endif
6670
6671 #ifdef HAVE_LINUX_THREADS
6672         pthread_kill_other_threads_np();
6673 #endif
6674
6675         exit( status );
6676
6677 ; return 0; }
6678 EOF
6679 if { (eval echo configure:6680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6680   rm -rf conftest*
6681   ol_cv_pthread_create=yes
6682 else
6683   echo "configure: failed program was:" >&5
6684   cat conftest.$ac_ext >&5
6685   rm -rf conftest*
6686   ol_cv_pthread_create=no
6687 fi
6688 rm -f conftest*
6689 else
6690   cat > conftest.$ac_ext <<EOF
6691 #line 6692 "configure"
6692 #include "confdefs.h"
6693 /* pthread test headers */
6694 #include <pthread.h>
6695 #ifndef NULL
6696 #define NULL (void*)0
6697 #endif
6698
6699 static void *task(p)
6700         void *p;
6701 {
6702         return (void *) (p == NULL);
6703 }
6704
6705
6706 int main(argc, argv)
6707         int argc;
6708         char **argv;
6709 {
6710
6711         /* pthread test function */
6712         pthread_t t;
6713         int status;
6714
6715         /* make sure pthread_create() isn't just a stub */
6716 #if HAVE_PTHREADS_D4
6717         status = pthread_create(&t, pthread_attr_default, task, NULL);
6718 #else
6719         status = pthread_create(&t, NULL, task, NULL);
6720 #endif
6721
6722         if( status ) exit( status );
6723
6724         /* make sure pthread_detach() isn't just a stub */
6725 #if HAVE_PTHREADS_D4
6726         status = pthread_detach( &t );
6727 #else
6728         status = pthread_detach( t );
6729 #endif
6730
6731 #ifdef HAVE_LINUX_THREADS
6732         pthread_kill_other_threads_np();
6733 #endif
6734
6735         exit( status );
6736
6737 }
6738
6739 EOF
6740 if { (eval echo configure:6741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6741 then
6742   ol_cv_pthread_create=yes
6743 else
6744   echo "configure: failed program was:" >&5
6745   cat conftest.$ac_ext >&5
6746   rm -fr conftest*
6747   ol_cv_pthread_create=no
6748 fi
6749 rm -fr conftest*
6750 fi
6751
6752 fi
6753
6754 echo "$ac_t""$ol_cv_pthread_create" 1>&6
6755
6756                 if test $ol_cv_pthread_create != no ; then
6757                         ol_link_threads=posix
6758                         ol_link_pthreads=""
6759                 fi
6760                 
6761                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
6762 if test "$ol_link_threads" = no ; then
6763         # try -kthread
6764         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
6765 echo "configure:6766: checking for pthread link with -kthread" >&5
6766 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
6767   echo $ac_n "(cached) $ac_c" 1>&6
6768 else
6769   
6770                 # save the flags
6771                 ol_LIBS="$LIBS"
6772                 LIBS="-kthread $LIBS"
6773
6774                 if test "$cross_compiling" = yes; then
6775   cat > conftest.$ac_ext <<EOF
6776 #line 6777 "configure"
6777 #include "confdefs.h"
6778 /* pthread test headers */
6779 #include <pthread.h>
6780 #ifndef NULL
6781 #define NULL (void*)0
6782 #endif
6783
6784 static void *task(p)
6785         void *p;
6786 {
6787         return (void *) (p == NULL);
6788 }
6789
6790 int main() {
6791
6792         /* pthread test function */
6793         pthread_t t;
6794         int status;
6795
6796         /* make sure pthread_create() isn't just a stub */
6797 #if HAVE_PTHREADS_D4
6798         status = pthread_create(&t, pthread_attr_default, task, NULL);
6799 #else
6800         status = pthread_create(&t, NULL, task, NULL);
6801 #endif
6802
6803         if( status ) exit( status );
6804
6805         /* make sure pthread_detach() isn't just a stub */
6806 #if HAVE_PTHREADS_D4
6807         status = pthread_detach( &t );
6808 #else
6809         status = pthread_detach( t );
6810 #endif
6811
6812 #ifdef HAVE_LINUX_THREADS
6813         pthread_kill_other_threads_np();
6814 #endif
6815
6816         exit( status );
6817
6818 ; return 0; }
6819 EOF
6820 if { (eval echo configure:6821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6821   rm -rf conftest*
6822   ol_cv_pthread_kthread=yes
6823 else
6824   echo "configure: failed program was:" >&5
6825   cat conftest.$ac_ext >&5
6826   rm -rf conftest*
6827   ol_cv_pthread_kthread=no
6828 fi
6829 rm -f conftest*
6830 else
6831   cat > conftest.$ac_ext <<EOF
6832 #line 6833 "configure"
6833 #include "confdefs.h"
6834 /* pthread test headers */
6835 #include <pthread.h>
6836 #ifndef NULL
6837 #define NULL (void*)0
6838 #endif
6839
6840 static void *task(p)
6841         void *p;
6842 {
6843         return (void *) (p == NULL);
6844 }
6845
6846
6847 int main(argc, argv)
6848         int argc;
6849         char **argv;
6850 {
6851
6852         /* pthread test function */
6853         pthread_t t;
6854         int status;
6855
6856         /* make sure pthread_create() isn't just a stub */
6857 #if HAVE_PTHREADS_D4
6858         status = pthread_create(&t, pthread_attr_default, task, NULL);
6859 #else
6860         status = pthread_create(&t, NULL, task, NULL);
6861 #endif
6862
6863         if( status ) exit( status );
6864
6865         /* make sure pthread_detach() isn't just a stub */
6866 #if HAVE_PTHREADS_D4
6867         status = pthread_detach( &t );
6868 #else
6869         status = pthread_detach( t );
6870 #endif
6871
6872 #ifdef HAVE_LINUX_THREADS
6873         pthread_kill_other_threads_np();
6874 #endif
6875
6876         exit( status );
6877
6878 }
6879
6880 EOF
6881 if { (eval echo configure:6882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6882 then
6883   ol_cv_pthread_kthread=yes
6884 else
6885   echo "configure: failed program was:" >&5
6886   cat conftest.$ac_ext >&5
6887   rm -fr conftest*
6888   ol_cv_pthread_kthread=no
6889 fi
6890 rm -fr conftest*
6891 fi
6892
6893
6894                 # restore the LIBS
6895                 LIBS="$ol_LIBS"
6896         
6897 fi
6898
6899 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
6900
6901         if test $ol_cv_pthread_kthread = yes ; then
6902                 ol_link_pthreads="-kthread"
6903                 ol_link_threads=posix
6904         fi
6905 fi
6906
6907                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
6908 if test "$ol_link_threads" = no ; then
6909         # try -pthread
6910         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
6911 echo "configure:6912: checking for pthread link with -pthread" >&5
6912 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
6913   echo $ac_n "(cached) $ac_c" 1>&6
6914 else
6915   
6916                 # save the flags
6917                 ol_LIBS="$LIBS"
6918                 LIBS="-pthread $LIBS"
6919
6920                 if test "$cross_compiling" = yes; then
6921   cat > conftest.$ac_ext <<EOF
6922 #line 6923 "configure"
6923 #include "confdefs.h"
6924 /* pthread test headers */
6925 #include <pthread.h>
6926 #ifndef NULL
6927 #define NULL (void*)0
6928 #endif
6929
6930 static void *task(p)
6931         void *p;
6932 {
6933         return (void *) (p == NULL);
6934 }
6935
6936 int main() {
6937
6938         /* pthread test function */
6939         pthread_t t;
6940         int status;
6941
6942         /* make sure pthread_create() isn't just a stub */
6943 #if HAVE_PTHREADS_D4
6944         status = pthread_create(&t, pthread_attr_default, task, NULL);
6945 #else
6946         status = pthread_create(&t, NULL, task, NULL);
6947 #endif
6948
6949         if( status ) exit( status );
6950
6951         /* make sure pthread_detach() isn't just a stub */
6952 #if HAVE_PTHREADS_D4
6953         status = pthread_detach( &t );
6954 #else
6955         status = pthread_detach( t );
6956 #endif
6957
6958 #ifdef HAVE_LINUX_THREADS
6959         pthread_kill_other_threads_np();
6960 #endif
6961
6962         exit( status );
6963
6964 ; return 0; }
6965 EOF
6966 if { (eval echo configure:6967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6967   rm -rf conftest*
6968   ol_cv_pthread_pthread=yes
6969 else
6970   echo "configure: failed program was:" >&5
6971   cat conftest.$ac_ext >&5
6972   rm -rf conftest*
6973   ol_cv_pthread_pthread=no
6974 fi
6975 rm -f conftest*
6976 else
6977   cat > conftest.$ac_ext <<EOF
6978 #line 6979 "configure"
6979 #include "confdefs.h"
6980 /* pthread test headers */
6981 #include <pthread.h>
6982 #ifndef NULL
6983 #define NULL (void*)0
6984 #endif
6985
6986 static void *task(p)
6987         void *p;
6988 {
6989         return (void *) (p == NULL);
6990 }
6991
6992
6993 int main(argc, argv)
6994         int argc;
6995         char **argv;
6996 {
6997
6998         /* pthread test function */
6999         pthread_t t;
7000         int status;
7001
7002         /* make sure pthread_create() isn't just a stub */
7003 #if HAVE_PTHREADS_D4
7004         status = pthread_create(&t, pthread_attr_default, task, NULL);
7005 #else
7006         status = pthread_create(&t, NULL, task, NULL);
7007 #endif
7008
7009         if( status ) exit( status );
7010
7011         /* make sure pthread_detach() isn't just a stub */
7012 #if HAVE_PTHREADS_D4
7013         status = pthread_detach( &t );
7014 #else
7015         status = pthread_detach( t );
7016 #endif
7017
7018 #ifdef HAVE_LINUX_THREADS
7019         pthread_kill_other_threads_np();
7020 #endif
7021
7022         exit( status );
7023
7024 }
7025
7026 EOF
7027 if { (eval echo configure:7028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7028 then
7029   ol_cv_pthread_pthread=yes
7030 else
7031   echo "configure: failed program was:" >&5
7032   cat conftest.$ac_ext >&5
7033   rm -fr conftest*
7034   ol_cv_pthread_pthread=no
7035 fi
7036 rm -fr conftest*
7037 fi
7038
7039
7040                 # restore the LIBS
7041                 LIBS="$ol_LIBS"
7042         
7043 fi
7044
7045 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
7046
7047         if test $ol_cv_pthread_pthread = yes ; then
7048                 ol_link_pthreads="-pthread"
7049                 ol_link_threads=posix
7050         fi
7051 fi
7052
7053                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
7054 if test "$ol_link_threads" = no ; then
7055         # try -pthreads
7056         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
7057 echo "configure:7058: checking for pthread link with -pthreads" >&5
7058 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
7059   echo $ac_n "(cached) $ac_c" 1>&6
7060 else
7061   
7062                 # save the flags
7063                 ol_LIBS="$LIBS"
7064                 LIBS="-pthreads $LIBS"
7065
7066                 if test "$cross_compiling" = yes; then
7067   cat > conftest.$ac_ext <<EOF
7068 #line 7069 "configure"
7069 #include "confdefs.h"
7070 /* pthread test headers */
7071 #include <pthread.h>
7072 #ifndef NULL
7073 #define NULL (void*)0
7074 #endif
7075
7076 static void *task(p)
7077         void *p;
7078 {
7079         return (void *) (p == NULL);
7080 }
7081
7082 int main() {
7083
7084         /* pthread test function */
7085         pthread_t t;
7086         int status;
7087
7088         /* make sure pthread_create() isn't just a stub */
7089 #if HAVE_PTHREADS_D4
7090         status = pthread_create(&t, pthread_attr_default, task, NULL);
7091 #else
7092         status = pthread_create(&t, NULL, task, NULL);
7093 #endif
7094
7095         if( status ) exit( status );
7096
7097         /* make sure pthread_detach() isn't just a stub */
7098 #if HAVE_PTHREADS_D4
7099         status = pthread_detach( &t );
7100 #else
7101         status = pthread_detach( t );
7102 #endif
7103
7104 #ifdef HAVE_LINUX_THREADS
7105         pthread_kill_other_threads_np();
7106 #endif
7107
7108         exit( status );
7109
7110 ; return 0; }
7111 EOF
7112 if { (eval echo configure:7113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7113   rm -rf conftest*
7114   ol_cv_pthread_pthreads=yes
7115 else
7116   echo "configure: failed program was:" >&5
7117   cat conftest.$ac_ext >&5
7118   rm -rf conftest*
7119   ol_cv_pthread_pthreads=no
7120 fi
7121 rm -f conftest*
7122 else
7123   cat > conftest.$ac_ext <<EOF
7124 #line 7125 "configure"
7125 #include "confdefs.h"
7126 /* pthread test headers */
7127 #include <pthread.h>
7128 #ifndef NULL
7129 #define NULL (void*)0
7130 #endif
7131
7132 static void *task(p)
7133         void *p;
7134 {
7135         return (void *) (p == NULL);
7136 }
7137
7138
7139 int main(argc, argv)
7140         int argc;
7141         char **argv;
7142 {
7143
7144         /* pthread test function */
7145         pthread_t t;
7146         int status;
7147
7148         /* make sure pthread_create() isn't just a stub */
7149 #if HAVE_PTHREADS_D4
7150         status = pthread_create(&t, pthread_attr_default, task, NULL);
7151 #else
7152         status = pthread_create(&t, NULL, task, NULL);
7153 #endif
7154
7155         if( status ) exit( status );
7156
7157         /* make sure pthread_detach() isn't just a stub */
7158 #if HAVE_PTHREADS_D4
7159         status = pthread_detach( &t );
7160 #else
7161         status = pthread_detach( t );
7162 #endif
7163
7164 #ifdef HAVE_LINUX_THREADS
7165         pthread_kill_other_threads_np();
7166 #endif
7167
7168         exit( status );
7169
7170 }
7171
7172 EOF
7173 if { (eval echo configure:7174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7174 then
7175   ol_cv_pthread_pthreads=yes
7176 else
7177   echo "configure: failed program was:" >&5
7178   cat conftest.$ac_ext >&5
7179   rm -fr conftest*
7180   ol_cv_pthread_pthreads=no
7181 fi
7182 rm -fr conftest*
7183 fi
7184
7185
7186                 # restore the LIBS
7187                 LIBS="$ol_LIBS"
7188         
7189 fi
7190
7191 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
7192
7193         if test $ol_cv_pthread_pthreads = yes ; then
7194                 ol_link_pthreads="-pthreads"
7195                 ol_link_threads=posix
7196         fi
7197 fi
7198
7199                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
7200 if test "$ol_link_threads" = no ; then
7201         # try -mthreads
7202         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
7203 echo "configure:7204: checking for pthread link with -mthreads" >&5
7204 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
7205   echo $ac_n "(cached) $ac_c" 1>&6
7206 else
7207   
7208                 # save the flags
7209                 ol_LIBS="$LIBS"
7210                 LIBS="-mthreads $LIBS"
7211
7212                 if test "$cross_compiling" = yes; then
7213   cat > conftest.$ac_ext <<EOF
7214 #line 7215 "configure"
7215 #include "confdefs.h"
7216 /* pthread test headers */
7217 #include <pthread.h>
7218 #ifndef NULL
7219 #define NULL (void*)0
7220 #endif
7221
7222 static void *task(p)
7223         void *p;
7224 {
7225         return (void *) (p == NULL);
7226 }
7227
7228 int main() {
7229
7230         /* pthread test function */
7231         pthread_t t;
7232         int status;
7233
7234         /* make sure pthread_create() isn't just a stub */
7235 #if HAVE_PTHREADS_D4
7236         status = pthread_create(&t, pthread_attr_default, task, NULL);
7237 #else
7238         status = pthread_create(&t, NULL, task, NULL);
7239 #endif
7240
7241         if( status ) exit( status );
7242
7243         /* make sure pthread_detach() isn't just a stub */
7244 #if HAVE_PTHREADS_D4
7245         status = pthread_detach( &t );
7246 #else
7247         status = pthread_detach( t );
7248 #endif
7249
7250 #ifdef HAVE_LINUX_THREADS
7251         pthread_kill_other_threads_np();
7252 #endif
7253
7254         exit( status );
7255
7256 ; return 0; }
7257 EOF
7258 if { (eval echo configure:7259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7259   rm -rf conftest*
7260   ol_cv_pthread_mthreads=yes
7261 else
7262   echo "configure: failed program was:" >&5
7263   cat conftest.$ac_ext >&5
7264   rm -rf conftest*
7265   ol_cv_pthread_mthreads=no
7266 fi
7267 rm -f conftest*
7268 else
7269   cat > conftest.$ac_ext <<EOF
7270 #line 7271 "configure"
7271 #include "confdefs.h"
7272 /* pthread test headers */
7273 #include <pthread.h>
7274 #ifndef NULL
7275 #define NULL (void*)0
7276 #endif
7277
7278 static void *task(p)
7279         void *p;
7280 {
7281         return (void *) (p == NULL);
7282 }
7283
7284
7285 int main(argc, argv)
7286         int argc;
7287         char **argv;
7288 {
7289
7290         /* pthread test function */
7291         pthread_t t;
7292         int status;
7293
7294         /* make sure pthread_create() isn't just a stub */
7295 #if HAVE_PTHREADS_D4
7296         status = pthread_create(&t, pthread_attr_default, task, NULL);
7297 #else
7298         status = pthread_create(&t, NULL, task, NULL);
7299 #endif
7300
7301         if( status ) exit( status );
7302
7303         /* make sure pthread_detach() isn't just a stub */
7304 #if HAVE_PTHREADS_D4
7305         status = pthread_detach( &t );
7306 #else
7307         status = pthread_detach( t );
7308 #endif
7309
7310 #ifdef HAVE_LINUX_THREADS
7311         pthread_kill_other_threads_np();
7312 #endif
7313
7314         exit( status );
7315
7316 }
7317
7318 EOF
7319 if { (eval echo configure:7320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7320 then
7321   ol_cv_pthread_mthreads=yes
7322 else
7323   echo "configure: failed program was:" >&5
7324   cat conftest.$ac_ext >&5
7325   rm -fr conftest*
7326   ol_cv_pthread_mthreads=no
7327 fi
7328 rm -fr conftest*
7329 fi
7330
7331
7332                 # restore the LIBS
7333                 LIBS="$ol_LIBS"
7334         
7335 fi
7336
7337 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
7338
7339         if test $ol_cv_pthread_mthreads = yes ; then
7340                 ol_link_pthreads="-mthreads"
7341                 ol_link_threads=posix
7342         fi
7343 fi
7344
7345                 # Pthread try link: -thread (ol_cv_pthread_thread)
7346 if test "$ol_link_threads" = no ; then
7347         # try -thread
7348         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
7349 echo "configure:7350: checking for pthread link with -thread" >&5
7350 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
7351   echo $ac_n "(cached) $ac_c" 1>&6
7352 else
7353   
7354                 # save the flags
7355                 ol_LIBS="$LIBS"
7356                 LIBS="-thread $LIBS"
7357
7358                 if test "$cross_compiling" = yes; then
7359   cat > conftest.$ac_ext <<EOF
7360 #line 7361 "configure"
7361 #include "confdefs.h"
7362 /* pthread test headers */
7363 #include <pthread.h>
7364 #ifndef NULL
7365 #define NULL (void*)0
7366 #endif
7367
7368 static void *task(p)
7369         void *p;
7370 {
7371         return (void *) (p == NULL);
7372 }
7373
7374 int main() {
7375
7376         /* pthread test function */
7377         pthread_t t;
7378         int status;
7379
7380         /* make sure pthread_create() isn't just a stub */
7381 #if HAVE_PTHREADS_D4
7382         status = pthread_create(&t, pthread_attr_default, task, NULL);
7383 #else
7384         status = pthread_create(&t, NULL, task, NULL);
7385 #endif
7386
7387         if( status ) exit( status );
7388
7389         /* make sure pthread_detach() isn't just a stub */
7390 #if HAVE_PTHREADS_D4
7391         status = pthread_detach( &t );
7392 #else
7393         status = pthread_detach( t );
7394 #endif
7395
7396 #ifdef HAVE_LINUX_THREADS
7397         pthread_kill_other_threads_np();
7398 #endif
7399
7400         exit( status );
7401
7402 ; return 0; }
7403 EOF
7404 if { (eval echo configure:7405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7405   rm -rf conftest*
7406   ol_cv_pthread_thread=yes
7407 else
7408   echo "configure: failed program was:" >&5
7409   cat conftest.$ac_ext >&5
7410   rm -rf conftest*
7411   ol_cv_pthread_thread=no
7412 fi
7413 rm -f conftest*
7414 else
7415   cat > conftest.$ac_ext <<EOF
7416 #line 7417 "configure"
7417 #include "confdefs.h"
7418 /* pthread test headers */
7419 #include <pthread.h>
7420 #ifndef NULL
7421 #define NULL (void*)0
7422 #endif
7423
7424 static void *task(p)
7425         void *p;
7426 {
7427         return (void *) (p == NULL);
7428 }
7429
7430
7431 int main(argc, argv)
7432         int argc;
7433         char **argv;
7434 {
7435
7436         /* pthread test function */
7437         pthread_t t;
7438         int status;
7439
7440         /* make sure pthread_create() isn't just a stub */
7441 #if HAVE_PTHREADS_D4
7442         status = pthread_create(&t, pthread_attr_default, task, NULL);
7443 #else
7444         status = pthread_create(&t, NULL, task, NULL);
7445 #endif
7446
7447         if( status ) exit( status );
7448
7449         /* make sure pthread_detach() isn't just a stub */
7450 #if HAVE_PTHREADS_D4
7451         status = pthread_detach( &t );
7452 #else
7453         status = pthread_detach( t );
7454 #endif
7455
7456 #ifdef HAVE_LINUX_THREADS
7457         pthread_kill_other_threads_np();
7458 #endif
7459
7460         exit( status );
7461
7462 }
7463
7464 EOF
7465 if { (eval echo configure:7466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7466 then
7467   ol_cv_pthread_thread=yes
7468 else
7469   echo "configure: failed program was:" >&5
7470   cat conftest.$ac_ext >&5
7471   rm -fr conftest*
7472   ol_cv_pthread_thread=no
7473 fi
7474 rm -fr conftest*
7475 fi
7476
7477
7478                 # restore the LIBS
7479                 LIBS="$ol_LIBS"
7480         
7481 fi
7482
7483 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
7484
7485         if test $ol_cv_pthread_thread = yes ; then
7486                 ol_link_pthreads="-thread"
7487                 ol_link_threads=posix
7488         fi
7489 fi
7490
7491
7492                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
7493 if test "$ol_link_threads" = no ; then
7494         # try -lpthread -lmach -lexc -lc_r
7495         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
7496 echo "configure:7497: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
7497 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
7498   echo $ac_n "(cached) $ac_c" 1>&6
7499 else
7500   
7501                 # save the flags
7502                 ol_LIBS="$LIBS"
7503                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
7504
7505                 if test "$cross_compiling" = yes; then
7506   cat > conftest.$ac_ext <<EOF
7507 #line 7508 "configure"
7508 #include "confdefs.h"
7509 /* pthread test headers */
7510 #include <pthread.h>
7511 #ifndef NULL
7512 #define NULL (void*)0
7513 #endif
7514
7515 static void *task(p)
7516         void *p;
7517 {
7518         return (void *) (p == NULL);
7519 }
7520
7521 int main() {
7522
7523         /* pthread test function */
7524         pthread_t t;
7525         int status;
7526
7527         /* make sure pthread_create() isn't just a stub */
7528 #if HAVE_PTHREADS_D4
7529         status = pthread_create(&t, pthread_attr_default, task, NULL);
7530 #else
7531         status = pthread_create(&t, NULL, task, NULL);
7532 #endif
7533
7534         if( status ) exit( status );
7535
7536         /* make sure pthread_detach() isn't just a stub */
7537 #if HAVE_PTHREADS_D4
7538         status = pthread_detach( &t );
7539 #else
7540         status = pthread_detach( t );
7541 #endif
7542
7543 #ifdef HAVE_LINUX_THREADS
7544         pthread_kill_other_threads_np();
7545 #endif
7546
7547         exit( status );
7548
7549 ; return 0; }
7550 EOF
7551 if { (eval echo configure:7552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7552   rm -rf conftest*
7553   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
7554 else
7555   echo "configure: failed program was:" >&5
7556   cat conftest.$ac_ext >&5
7557   rm -rf conftest*
7558   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
7559 fi
7560 rm -f conftest*
7561 else
7562   cat > conftest.$ac_ext <<EOF
7563 #line 7564 "configure"
7564 #include "confdefs.h"
7565 /* pthread test headers */
7566 #include <pthread.h>
7567 #ifndef NULL
7568 #define NULL (void*)0
7569 #endif
7570
7571 static void *task(p)
7572         void *p;
7573 {
7574         return (void *) (p == NULL);
7575 }
7576
7577
7578 int main(argc, argv)
7579         int argc;
7580         char **argv;
7581 {
7582
7583         /* pthread test function */
7584         pthread_t t;
7585         int status;
7586
7587         /* make sure pthread_create() isn't just a stub */
7588 #if HAVE_PTHREADS_D4
7589         status = pthread_create(&t, pthread_attr_default, task, NULL);
7590 #else
7591         status = pthread_create(&t, NULL, task, NULL);
7592 #endif
7593
7594         if( status ) exit( status );
7595
7596         /* make sure pthread_detach() isn't just a stub */
7597 #if HAVE_PTHREADS_D4
7598         status = pthread_detach( &t );
7599 #else
7600         status = pthread_detach( t );
7601 #endif
7602
7603 #ifdef HAVE_LINUX_THREADS
7604         pthread_kill_other_threads_np();
7605 #endif
7606
7607         exit( status );
7608
7609 }
7610
7611 EOF
7612 if { (eval echo configure:7613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7613 then
7614   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
7615 else
7616   echo "configure: failed program was:" >&5
7617   cat conftest.$ac_ext >&5
7618   rm -fr conftest*
7619   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
7620 fi
7621 rm -fr conftest*
7622 fi
7623
7624
7625                 # restore the LIBS
7626                 LIBS="$ol_LIBS"
7627         
7628 fi
7629
7630 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
7631
7632         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
7633                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
7634                 ol_link_threads=posix
7635         fi
7636 fi
7637
7638                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
7639 if test "$ol_link_threads" = no ; then
7640         # try -lpthread -lmach -lexc
7641         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
7642 echo "configure:7643: checking for pthread link with -lpthread -lmach -lexc" >&5
7643 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
7644   echo $ac_n "(cached) $ac_c" 1>&6
7645 else
7646   
7647                 # save the flags
7648                 ol_LIBS="$LIBS"
7649                 LIBS="-lpthread -lmach -lexc $LIBS"
7650
7651                 if test "$cross_compiling" = yes; then
7652   cat > conftest.$ac_ext <<EOF
7653 #line 7654 "configure"
7654 #include "confdefs.h"
7655 /* pthread test headers */
7656 #include <pthread.h>
7657 #ifndef NULL
7658 #define NULL (void*)0
7659 #endif
7660
7661 static void *task(p)
7662         void *p;
7663 {
7664         return (void *) (p == NULL);
7665 }
7666
7667 int main() {
7668
7669         /* pthread test function */
7670         pthread_t t;
7671         int status;
7672
7673         /* make sure pthread_create() isn't just a stub */
7674 #if HAVE_PTHREADS_D4
7675         status = pthread_create(&t, pthread_attr_default, task, NULL);
7676 #else
7677         status = pthread_create(&t, NULL, task, NULL);
7678 #endif
7679
7680         if( status ) exit( status );
7681
7682         /* make sure pthread_detach() isn't just a stub */
7683 #if HAVE_PTHREADS_D4
7684         status = pthread_detach( &t );
7685 #else
7686         status = pthread_detach( t );
7687 #endif
7688
7689 #ifdef HAVE_LINUX_THREADS
7690         pthread_kill_other_threads_np();
7691 #endif
7692
7693         exit( status );
7694
7695 ; return 0; }
7696 EOF
7697 if { (eval echo configure:7698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7698   rm -rf conftest*
7699   ol_cv_pthread_lpthread_lmach_lexc=yes
7700 else
7701   echo "configure: failed program was:" >&5
7702   cat conftest.$ac_ext >&5
7703   rm -rf conftest*
7704   ol_cv_pthread_lpthread_lmach_lexc=no
7705 fi
7706 rm -f conftest*
7707 else
7708   cat > conftest.$ac_ext <<EOF
7709 #line 7710 "configure"
7710 #include "confdefs.h"
7711 /* pthread test headers */
7712 #include <pthread.h>
7713 #ifndef NULL
7714 #define NULL (void*)0
7715 #endif
7716
7717 static void *task(p)
7718         void *p;
7719 {
7720         return (void *) (p == NULL);
7721 }
7722
7723
7724 int main(argc, argv)
7725         int argc;
7726         char **argv;
7727 {
7728
7729         /* pthread test function */
7730         pthread_t t;
7731         int status;
7732
7733         /* make sure pthread_create() isn't just a stub */
7734 #if HAVE_PTHREADS_D4
7735         status = pthread_create(&t, pthread_attr_default, task, NULL);
7736 #else
7737         status = pthread_create(&t, NULL, task, NULL);
7738 #endif
7739
7740         if( status ) exit( status );
7741
7742         /* make sure pthread_detach() isn't just a stub */
7743 #if HAVE_PTHREADS_D4
7744         status = pthread_detach( &t );
7745 #else
7746         status = pthread_detach( t );
7747 #endif
7748
7749 #ifdef HAVE_LINUX_THREADS
7750         pthread_kill_other_threads_np();
7751 #endif
7752
7753         exit( status );
7754
7755 }
7756
7757 EOF
7758 if { (eval echo configure:7759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7759 then
7760   ol_cv_pthread_lpthread_lmach_lexc=yes
7761 else
7762   echo "configure: failed program was:" >&5
7763   cat conftest.$ac_ext >&5
7764   rm -fr conftest*
7765   ol_cv_pthread_lpthread_lmach_lexc=no
7766 fi
7767 rm -fr conftest*
7768 fi
7769
7770
7771                 # restore the LIBS
7772                 LIBS="$ol_LIBS"
7773         
7774 fi
7775
7776 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
7777
7778         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
7779                 ol_link_pthreads="-lpthread -lmach -lexc"
7780                 ol_link_threads=posix
7781         fi
7782 fi
7783
7784
7785                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
7786 if test "$ol_link_threads" = no ; then
7787         # try -lpthread -Wl,-woff,85
7788         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
7789 echo "configure:7790: checking for pthread link with -lpthread -Wl,-woff,85" >&5
7790 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
7791   echo $ac_n "(cached) $ac_c" 1>&6
7792 else
7793   
7794                 # save the flags
7795                 ol_LIBS="$LIBS"
7796                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
7797
7798                 if test "$cross_compiling" = yes; then
7799   cat > conftest.$ac_ext <<EOF
7800 #line 7801 "configure"
7801 #include "confdefs.h"
7802 /* pthread test headers */
7803 #include <pthread.h>
7804 #ifndef NULL
7805 #define NULL (void*)0
7806 #endif
7807
7808 static void *task(p)
7809         void *p;
7810 {
7811         return (void *) (p == NULL);
7812 }
7813
7814 int main() {
7815
7816         /* pthread test function */
7817         pthread_t t;
7818         int status;
7819
7820         /* make sure pthread_create() isn't just a stub */
7821 #if HAVE_PTHREADS_D4
7822         status = pthread_create(&t, pthread_attr_default, task, NULL);
7823 #else
7824         status = pthread_create(&t, NULL, task, NULL);
7825 #endif
7826
7827         if( status ) exit( status );
7828
7829         /* make sure pthread_detach() isn't just a stub */
7830 #if HAVE_PTHREADS_D4
7831         status = pthread_detach( &t );
7832 #else
7833         status = pthread_detach( t );
7834 #endif
7835
7836 #ifdef HAVE_LINUX_THREADS
7837         pthread_kill_other_threads_np();
7838 #endif
7839
7840         exit( status );
7841
7842 ; return 0; }
7843 EOF
7844 if { (eval echo configure:7845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7845   rm -rf conftest*
7846   ol_cv_pthread_lib_lpthread_woff=yes
7847 else
7848   echo "configure: failed program was:" >&5
7849   cat conftest.$ac_ext >&5
7850   rm -rf conftest*
7851   ol_cv_pthread_lib_lpthread_woff=no
7852 fi
7853 rm -f conftest*
7854 else
7855   cat > conftest.$ac_ext <<EOF
7856 #line 7857 "configure"
7857 #include "confdefs.h"
7858 /* pthread test headers */
7859 #include <pthread.h>
7860 #ifndef NULL
7861 #define NULL (void*)0
7862 #endif
7863
7864 static void *task(p)
7865         void *p;
7866 {
7867         return (void *) (p == NULL);
7868 }
7869
7870
7871 int main(argc, argv)
7872         int argc;
7873         char **argv;
7874 {
7875
7876         /* pthread test function */
7877         pthread_t t;
7878         int status;
7879
7880         /* make sure pthread_create() isn't just a stub */
7881 #if HAVE_PTHREADS_D4
7882         status = pthread_create(&t, pthread_attr_default, task, NULL);
7883 #else
7884         status = pthread_create(&t, NULL, task, NULL);
7885 #endif
7886
7887         if( status ) exit( status );
7888
7889         /* make sure pthread_detach() isn't just a stub */
7890 #if HAVE_PTHREADS_D4
7891         status = pthread_detach( &t );
7892 #else
7893         status = pthread_detach( t );
7894 #endif
7895
7896 #ifdef HAVE_LINUX_THREADS
7897         pthread_kill_other_threads_np();
7898 #endif
7899
7900         exit( status );
7901
7902 }
7903
7904 EOF
7905 if { (eval echo configure:7906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7906 then
7907   ol_cv_pthread_lib_lpthread_woff=yes
7908 else
7909   echo "configure: failed program was:" >&5
7910   cat conftest.$ac_ext >&5
7911   rm -fr conftest*
7912   ol_cv_pthread_lib_lpthread_woff=no
7913 fi
7914 rm -fr conftest*
7915 fi
7916
7917
7918                 # restore the LIBS
7919                 LIBS="$ol_LIBS"
7920         
7921 fi
7922
7923 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
7924
7925         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
7926                 ol_link_pthreads="-lpthread -Wl,-woff,85"
7927                 ol_link_threads=posix
7928         fi
7929 fi
7930
7931
7932                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
7933 if test "$ol_link_threads" = no ; then
7934         # try -lpthread
7935         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
7936 echo "configure:7937: checking for pthread link with -lpthread" >&5
7937 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
7938   echo $ac_n "(cached) $ac_c" 1>&6
7939 else
7940   
7941                 # save the flags
7942                 ol_LIBS="$LIBS"
7943                 LIBS="-lpthread $LIBS"
7944
7945                 if test "$cross_compiling" = yes; then
7946   cat > conftest.$ac_ext <<EOF
7947 #line 7948 "configure"
7948 #include "confdefs.h"
7949 /* pthread test headers */
7950 #include <pthread.h>
7951 #ifndef NULL
7952 #define NULL (void*)0
7953 #endif
7954
7955 static void *task(p)
7956         void *p;
7957 {
7958         return (void *) (p == NULL);
7959 }
7960
7961 int main() {
7962
7963         /* pthread test function */
7964         pthread_t t;
7965         int status;
7966
7967         /* make sure pthread_create() isn't just a stub */
7968 #if HAVE_PTHREADS_D4
7969         status = pthread_create(&t, pthread_attr_default, task, NULL);
7970 #else
7971         status = pthread_create(&t, NULL, task, NULL);
7972 #endif
7973
7974         if( status ) exit( status );
7975
7976         /* make sure pthread_detach() isn't just a stub */
7977 #if HAVE_PTHREADS_D4
7978         status = pthread_detach( &t );
7979 #else
7980         status = pthread_detach( t );
7981 #endif
7982
7983 #ifdef HAVE_LINUX_THREADS
7984         pthread_kill_other_threads_np();
7985 #endif
7986
7987         exit( status );
7988
7989 ; return 0; }
7990 EOF
7991 if { (eval echo configure:7992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7992   rm -rf conftest*
7993   ol_cv_pthread_lpthread=yes
7994 else
7995   echo "configure: failed program was:" >&5
7996   cat conftest.$ac_ext >&5
7997   rm -rf conftest*
7998   ol_cv_pthread_lpthread=no
7999 fi
8000 rm -f conftest*
8001 else
8002   cat > conftest.$ac_ext <<EOF
8003 #line 8004 "configure"
8004 #include "confdefs.h"
8005 /* pthread test headers */
8006 #include <pthread.h>
8007 #ifndef NULL
8008 #define NULL (void*)0
8009 #endif
8010
8011 static void *task(p)
8012         void *p;
8013 {
8014         return (void *) (p == NULL);
8015 }
8016
8017
8018 int main(argc, argv)
8019         int argc;
8020         char **argv;
8021 {
8022
8023         /* pthread test function */
8024         pthread_t t;
8025         int status;
8026
8027         /* make sure pthread_create() isn't just a stub */
8028 #if HAVE_PTHREADS_D4
8029         status = pthread_create(&t, pthread_attr_default, task, NULL);
8030 #else
8031         status = pthread_create(&t, NULL, task, NULL);
8032 #endif
8033
8034         if( status ) exit( status );
8035
8036         /* make sure pthread_detach() isn't just a stub */
8037 #if HAVE_PTHREADS_D4
8038         status = pthread_detach( &t );
8039 #else
8040         status = pthread_detach( t );
8041 #endif
8042
8043 #ifdef HAVE_LINUX_THREADS
8044         pthread_kill_other_threads_np();
8045 #endif
8046
8047         exit( status );
8048
8049 }
8050
8051 EOF
8052 if { (eval echo configure:8053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8053 then
8054   ol_cv_pthread_lpthread=yes
8055 else
8056   echo "configure: failed program was:" >&5
8057   cat conftest.$ac_ext >&5
8058   rm -fr conftest*
8059   ol_cv_pthread_lpthread=no
8060 fi
8061 rm -fr conftest*
8062 fi
8063
8064
8065                 # restore the LIBS
8066                 LIBS="$ol_LIBS"
8067         
8068 fi
8069
8070 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
8071
8072         if test $ol_cv_pthread_lpthread = yes ; then
8073                 ol_link_pthreads="-lpthread"
8074                 ol_link_threads=posix
8075         fi
8076 fi
8077
8078                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
8079 if test "$ol_link_threads" = no ; then
8080         # try -lc_r
8081         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
8082 echo "configure:8083: checking for pthread link with -lc_r" >&5
8083 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
8084   echo $ac_n "(cached) $ac_c" 1>&6
8085 else
8086   
8087                 # save the flags
8088                 ol_LIBS="$LIBS"
8089                 LIBS="-lc_r $LIBS"
8090
8091                 if test "$cross_compiling" = yes; then
8092   cat > conftest.$ac_ext <<EOF
8093 #line 8094 "configure"
8094 #include "confdefs.h"
8095 /* pthread test headers */
8096 #include <pthread.h>
8097 #ifndef NULL
8098 #define NULL (void*)0
8099 #endif
8100
8101 static void *task(p)
8102         void *p;
8103 {
8104         return (void *) (p == NULL);
8105 }
8106
8107 int main() {
8108
8109         /* pthread test function */
8110         pthread_t t;
8111         int status;
8112
8113         /* make sure pthread_create() isn't just a stub */
8114 #if HAVE_PTHREADS_D4
8115         status = pthread_create(&t, pthread_attr_default, task, NULL);
8116 #else
8117         status = pthread_create(&t, NULL, task, NULL);
8118 #endif
8119
8120         if( status ) exit( status );
8121
8122         /* make sure pthread_detach() isn't just a stub */
8123 #if HAVE_PTHREADS_D4
8124         status = pthread_detach( &t );
8125 #else
8126         status = pthread_detach( t );
8127 #endif
8128
8129 #ifdef HAVE_LINUX_THREADS
8130         pthread_kill_other_threads_np();
8131 #endif
8132
8133         exit( status );
8134
8135 ; return 0; }
8136 EOF
8137 if { (eval echo configure:8138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8138   rm -rf conftest*
8139   ol_cv_pthread_lc_r=yes
8140 else
8141   echo "configure: failed program was:" >&5
8142   cat conftest.$ac_ext >&5
8143   rm -rf conftest*
8144   ol_cv_pthread_lc_r=no
8145 fi
8146 rm -f conftest*
8147 else
8148   cat > conftest.$ac_ext <<EOF
8149 #line 8150 "configure"
8150 #include "confdefs.h"
8151 /* pthread test headers */
8152 #include <pthread.h>
8153 #ifndef NULL
8154 #define NULL (void*)0
8155 #endif
8156
8157 static void *task(p)
8158         void *p;
8159 {
8160         return (void *) (p == NULL);
8161 }
8162
8163
8164 int main(argc, argv)
8165         int argc;
8166         char **argv;
8167 {
8168
8169         /* pthread test function */
8170         pthread_t t;
8171         int status;
8172
8173         /* make sure pthread_create() isn't just a stub */
8174 #if HAVE_PTHREADS_D4
8175         status = pthread_create(&t, pthread_attr_default, task, NULL);
8176 #else
8177         status = pthread_create(&t, NULL, task, NULL);
8178 #endif
8179
8180         if( status ) exit( status );
8181
8182         /* make sure pthread_detach() isn't just a stub */
8183 #if HAVE_PTHREADS_D4
8184         status = pthread_detach( &t );
8185 #else
8186         status = pthread_detach( t );
8187 #endif
8188
8189 #ifdef HAVE_LINUX_THREADS
8190         pthread_kill_other_threads_np();
8191 #endif
8192
8193         exit( status );
8194
8195 }
8196
8197 EOF
8198 if { (eval echo configure:8199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8199 then
8200   ol_cv_pthread_lc_r=yes
8201 else
8202   echo "configure: failed program was:" >&5
8203   cat conftest.$ac_ext >&5
8204   rm -fr conftest*
8205   ol_cv_pthread_lc_r=no
8206 fi
8207 rm -fr conftest*
8208 fi
8209
8210
8211                 # restore the LIBS
8212                 LIBS="$ol_LIBS"
8213         
8214 fi
8215
8216 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
8217
8218         if test $ol_cv_pthread_lc_r = yes ; then
8219                 ol_link_pthreads="-lc_r"
8220                 ol_link_threads=posix
8221         fi
8222 fi
8223
8224
8225                 # Pthread try link: -threads (ol_cv_pthread_threads)
8226 if test "$ol_link_threads" = no ; then
8227         # try -threads
8228         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
8229 echo "configure:8230: checking for pthread link with -threads" >&5
8230 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
8231   echo $ac_n "(cached) $ac_c" 1>&6
8232 else
8233   
8234                 # save the flags
8235                 ol_LIBS="$LIBS"
8236                 LIBS="-threads $LIBS"
8237
8238                 if test "$cross_compiling" = yes; then
8239   cat > conftest.$ac_ext <<EOF
8240 #line 8241 "configure"
8241 #include "confdefs.h"
8242 /* pthread test headers */
8243 #include <pthread.h>
8244 #ifndef NULL
8245 #define NULL (void*)0
8246 #endif
8247
8248 static void *task(p)
8249         void *p;
8250 {
8251         return (void *) (p == NULL);
8252 }
8253
8254 int main() {
8255
8256         /* pthread test function */
8257         pthread_t t;
8258         int status;
8259
8260         /* make sure pthread_create() isn't just a stub */
8261 #if HAVE_PTHREADS_D4
8262         status = pthread_create(&t, pthread_attr_default, task, NULL);
8263 #else
8264         status = pthread_create(&t, NULL, task, NULL);
8265 #endif
8266
8267         if( status ) exit( status );
8268
8269         /* make sure pthread_detach() isn't just a stub */
8270 #if HAVE_PTHREADS_D4
8271         status = pthread_detach( &t );
8272 #else
8273         status = pthread_detach( t );
8274 #endif
8275
8276 #ifdef HAVE_LINUX_THREADS
8277         pthread_kill_other_threads_np();
8278 #endif
8279
8280         exit( status );
8281
8282 ; return 0; }
8283 EOF
8284 if { (eval echo configure:8285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8285   rm -rf conftest*
8286   ol_cv_pthread_threads=yes
8287 else
8288   echo "configure: failed program was:" >&5
8289   cat conftest.$ac_ext >&5
8290   rm -rf conftest*
8291   ol_cv_pthread_threads=no
8292 fi
8293 rm -f conftest*
8294 else
8295   cat > conftest.$ac_ext <<EOF
8296 #line 8297 "configure"
8297 #include "confdefs.h"
8298 /* pthread test headers */
8299 #include <pthread.h>
8300 #ifndef NULL
8301 #define NULL (void*)0
8302 #endif
8303
8304 static void *task(p)
8305         void *p;
8306 {
8307         return (void *) (p == NULL);
8308 }
8309
8310
8311 int main(argc, argv)
8312         int argc;
8313         char **argv;
8314 {
8315
8316         /* pthread test function */
8317         pthread_t t;
8318         int status;
8319
8320         /* make sure pthread_create() isn't just a stub */
8321 #if HAVE_PTHREADS_D4
8322         status = pthread_create(&t, pthread_attr_default, task, NULL);
8323 #else
8324         status = pthread_create(&t, NULL, task, NULL);
8325 #endif
8326
8327         if( status ) exit( status );
8328
8329         /* make sure pthread_detach() isn't just a stub */
8330 #if HAVE_PTHREADS_D4
8331         status = pthread_detach( &t );
8332 #else
8333         status = pthread_detach( t );
8334 #endif
8335
8336 #ifdef HAVE_LINUX_THREADS
8337         pthread_kill_other_threads_np();
8338 #endif
8339
8340         exit( status );
8341
8342 }
8343
8344 EOF
8345 if { (eval echo configure:8346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8346 then
8347   ol_cv_pthread_threads=yes
8348 else
8349   echo "configure: failed program was:" >&5
8350   cat conftest.$ac_ext >&5
8351   rm -fr conftest*
8352   ol_cv_pthread_threads=no
8353 fi
8354 rm -fr conftest*
8355 fi
8356
8357
8358                 # restore the LIBS
8359                 LIBS="$ol_LIBS"
8360         
8361 fi
8362
8363 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
8364
8365         if test $ol_cv_pthread_threads = yes ; then
8366                 ol_link_pthreads="-threads"
8367                 ol_link_threads=posix
8368         fi
8369 fi
8370
8371
8372                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
8373 if test "$ol_link_threads" = no ; then
8374         # try -lpthreads -lmach -lexc -lc_r
8375         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
8376 echo "configure:8377: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
8377 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
8378   echo $ac_n "(cached) $ac_c" 1>&6
8379 else
8380   
8381                 # save the flags
8382                 ol_LIBS="$LIBS"
8383                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
8384
8385                 if test "$cross_compiling" = yes; then
8386   cat > conftest.$ac_ext <<EOF
8387 #line 8388 "configure"
8388 #include "confdefs.h"
8389 /* pthread test headers */
8390 #include <pthread.h>
8391 #ifndef NULL
8392 #define NULL (void*)0
8393 #endif
8394
8395 static void *task(p)
8396         void *p;
8397 {
8398         return (void *) (p == NULL);
8399 }
8400
8401 int main() {
8402
8403         /* pthread test function */
8404         pthread_t t;
8405         int status;
8406
8407         /* make sure pthread_create() isn't just a stub */
8408 #if HAVE_PTHREADS_D4
8409         status = pthread_create(&t, pthread_attr_default, task, NULL);
8410 #else
8411         status = pthread_create(&t, NULL, task, NULL);
8412 #endif
8413
8414         if( status ) exit( status );
8415
8416         /* make sure pthread_detach() isn't just a stub */
8417 #if HAVE_PTHREADS_D4
8418         status = pthread_detach( &t );
8419 #else
8420         status = pthread_detach( t );
8421 #endif
8422
8423 #ifdef HAVE_LINUX_THREADS
8424         pthread_kill_other_threads_np();
8425 #endif
8426
8427         exit( status );
8428
8429 ; return 0; }
8430 EOF
8431 if { (eval echo configure:8432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8432   rm -rf conftest*
8433   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
8434 else
8435   echo "configure: failed program was:" >&5
8436   cat conftest.$ac_ext >&5
8437   rm -rf conftest*
8438   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
8439 fi
8440 rm -f conftest*
8441 else
8442   cat > conftest.$ac_ext <<EOF
8443 #line 8444 "configure"
8444 #include "confdefs.h"
8445 /* pthread test headers */
8446 #include <pthread.h>
8447 #ifndef NULL
8448 #define NULL (void*)0
8449 #endif
8450
8451 static void *task(p)
8452         void *p;
8453 {
8454         return (void *) (p == NULL);
8455 }
8456
8457
8458 int main(argc, argv)
8459         int argc;
8460         char **argv;
8461 {
8462
8463         /* pthread test function */
8464         pthread_t t;
8465         int status;
8466
8467         /* make sure pthread_create() isn't just a stub */
8468 #if HAVE_PTHREADS_D4
8469         status = pthread_create(&t, pthread_attr_default, task, NULL);
8470 #else
8471         status = pthread_create(&t, NULL, task, NULL);
8472 #endif
8473
8474         if( status ) exit( status );
8475
8476         /* make sure pthread_detach() isn't just a stub */
8477 #if HAVE_PTHREADS_D4
8478         status = pthread_detach( &t );
8479 #else
8480         status = pthread_detach( t );
8481 #endif
8482
8483 #ifdef HAVE_LINUX_THREADS
8484         pthread_kill_other_threads_np();
8485 #endif
8486
8487         exit( status );
8488
8489 }
8490
8491 EOF
8492 if { (eval echo configure:8493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8493 then
8494   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
8495 else
8496   echo "configure: failed program was:" >&5
8497   cat conftest.$ac_ext >&5
8498   rm -fr conftest*
8499   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
8500 fi
8501 rm -fr conftest*
8502 fi
8503
8504
8505                 # restore the LIBS
8506                 LIBS="$ol_LIBS"
8507         
8508 fi
8509
8510 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
8511
8512         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
8513                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
8514                 ol_link_threads=posix
8515         fi
8516 fi
8517
8518                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
8519 if test "$ol_link_threads" = no ; then
8520         # try -lpthreads -lmach -lexc
8521         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
8522 echo "configure:8523: checking for pthread link with -lpthreads -lmach -lexc" >&5
8523 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
8524   echo $ac_n "(cached) $ac_c" 1>&6
8525 else
8526   
8527                 # save the flags
8528                 ol_LIBS="$LIBS"
8529                 LIBS="-lpthreads -lmach -lexc $LIBS"
8530
8531                 if test "$cross_compiling" = yes; then
8532   cat > conftest.$ac_ext <<EOF
8533 #line 8534 "configure"
8534 #include "confdefs.h"
8535 /* pthread test headers */
8536 #include <pthread.h>
8537 #ifndef NULL
8538 #define NULL (void*)0
8539 #endif
8540
8541 static void *task(p)
8542         void *p;
8543 {
8544         return (void *) (p == NULL);
8545 }
8546
8547 int main() {
8548
8549         /* pthread test function */
8550         pthread_t t;
8551         int status;
8552
8553         /* make sure pthread_create() isn't just a stub */
8554 #if HAVE_PTHREADS_D4
8555         status = pthread_create(&t, pthread_attr_default, task, NULL);
8556 #else
8557         status = pthread_create(&t, NULL, task, NULL);
8558 #endif
8559
8560         if( status ) exit( status );
8561
8562         /* make sure pthread_detach() isn't just a stub */
8563 #if HAVE_PTHREADS_D4
8564         status = pthread_detach( &t );
8565 #else
8566         status = pthread_detach( t );
8567 #endif
8568
8569 #ifdef HAVE_LINUX_THREADS
8570         pthread_kill_other_threads_np();
8571 #endif
8572
8573         exit( status );
8574
8575 ; return 0; }
8576 EOF
8577 if { (eval echo configure:8578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8578   rm -rf conftest*
8579   ol_cv_pthread_lpthreads_lmach_lexc=yes
8580 else
8581   echo "configure: failed program was:" >&5
8582   cat conftest.$ac_ext >&5
8583   rm -rf conftest*
8584   ol_cv_pthread_lpthreads_lmach_lexc=no
8585 fi
8586 rm -f conftest*
8587 else
8588   cat > conftest.$ac_ext <<EOF
8589 #line 8590 "configure"
8590 #include "confdefs.h"
8591 /* pthread test headers */
8592 #include <pthread.h>
8593 #ifndef NULL
8594 #define NULL (void*)0
8595 #endif
8596
8597 static void *task(p)
8598         void *p;
8599 {
8600         return (void *) (p == NULL);
8601 }
8602
8603
8604 int main(argc, argv)
8605         int argc;
8606         char **argv;
8607 {
8608
8609         /* pthread test function */
8610         pthread_t t;
8611         int status;
8612
8613         /* make sure pthread_create() isn't just a stub */
8614 #if HAVE_PTHREADS_D4
8615         status = pthread_create(&t, pthread_attr_default, task, NULL);
8616 #else
8617         status = pthread_create(&t, NULL, task, NULL);
8618 #endif
8619
8620         if( status ) exit( status );
8621
8622         /* make sure pthread_detach() isn't just a stub */
8623 #if HAVE_PTHREADS_D4
8624         status = pthread_detach( &t );
8625 #else
8626         status = pthread_detach( t );
8627 #endif
8628
8629 #ifdef HAVE_LINUX_THREADS
8630         pthread_kill_other_threads_np();
8631 #endif
8632
8633         exit( status );
8634
8635 }
8636
8637 EOF
8638 if { (eval echo configure:8639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8639 then
8640   ol_cv_pthread_lpthreads_lmach_lexc=yes
8641 else
8642   echo "configure: failed program was:" >&5
8643   cat conftest.$ac_ext >&5
8644   rm -fr conftest*
8645   ol_cv_pthread_lpthreads_lmach_lexc=no
8646 fi
8647 rm -fr conftest*
8648 fi
8649
8650
8651                 # restore the LIBS
8652                 LIBS="$ol_LIBS"
8653         
8654 fi
8655
8656 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
8657
8658         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
8659                 ol_link_pthreads="-lpthreads -lmach -lexc"
8660                 ol_link_threads=posix
8661         fi
8662 fi
8663
8664                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
8665 if test "$ol_link_threads" = no ; then
8666         # try -lpthreads -lexc
8667         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
8668 echo "configure:8669: checking for pthread link with -lpthreads -lexc" >&5
8669 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
8670   echo $ac_n "(cached) $ac_c" 1>&6
8671 else
8672   
8673                 # save the flags
8674                 ol_LIBS="$LIBS"
8675                 LIBS="-lpthreads -lexc $LIBS"
8676
8677                 if test "$cross_compiling" = yes; then
8678   cat > conftest.$ac_ext <<EOF
8679 #line 8680 "configure"
8680 #include "confdefs.h"
8681 /* pthread test headers */
8682 #include <pthread.h>
8683 #ifndef NULL
8684 #define NULL (void*)0
8685 #endif
8686
8687 static void *task(p)
8688         void *p;
8689 {
8690         return (void *) (p == NULL);
8691 }
8692
8693 int main() {
8694
8695         /* pthread test function */
8696         pthread_t t;
8697         int status;
8698
8699         /* make sure pthread_create() isn't just a stub */
8700 #if HAVE_PTHREADS_D4
8701         status = pthread_create(&t, pthread_attr_default, task, NULL);
8702 #else
8703         status = pthread_create(&t, NULL, task, NULL);
8704 #endif
8705
8706         if( status ) exit( status );
8707
8708         /* make sure pthread_detach() isn't just a stub */
8709 #if HAVE_PTHREADS_D4
8710         status = pthread_detach( &t );
8711 #else
8712         status = pthread_detach( t );
8713 #endif
8714
8715 #ifdef HAVE_LINUX_THREADS
8716         pthread_kill_other_threads_np();
8717 #endif
8718
8719         exit( status );
8720
8721 ; return 0; }
8722 EOF
8723 if { (eval echo configure:8724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8724   rm -rf conftest*
8725   ol_cv_pthread_lpthreads_lexc=yes
8726 else
8727   echo "configure: failed program was:" >&5
8728   cat conftest.$ac_ext >&5
8729   rm -rf conftest*
8730   ol_cv_pthread_lpthreads_lexc=no
8731 fi
8732 rm -f conftest*
8733 else
8734   cat > conftest.$ac_ext <<EOF
8735 #line 8736 "configure"
8736 #include "confdefs.h"
8737 /* pthread test headers */
8738 #include <pthread.h>
8739 #ifndef NULL
8740 #define NULL (void*)0
8741 #endif
8742
8743 static void *task(p)
8744         void *p;
8745 {
8746         return (void *) (p == NULL);
8747 }
8748
8749
8750 int main(argc, argv)
8751         int argc;
8752         char **argv;
8753 {
8754
8755         /* pthread test function */
8756         pthread_t t;
8757         int status;
8758
8759         /* make sure pthread_create() isn't just a stub */
8760 #if HAVE_PTHREADS_D4
8761         status = pthread_create(&t, pthread_attr_default, task, NULL);
8762 #else
8763         status = pthread_create(&t, NULL, task, NULL);
8764 #endif
8765
8766         if( status ) exit( status );
8767
8768         /* make sure pthread_detach() isn't just a stub */
8769 #if HAVE_PTHREADS_D4
8770         status = pthread_detach( &t );
8771 #else
8772         status = pthread_detach( t );
8773 #endif
8774
8775 #ifdef HAVE_LINUX_THREADS
8776         pthread_kill_other_threads_np();
8777 #endif
8778
8779         exit( status );
8780
8781 }
8782
8783 EOF
8784 if { (eval echo configure:8785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8785 then
8786   ol_cv_pthread_lpthreads_lexc=yes
8787 else
8788   echo "configure: failed program was:" >&5
8789   cat conftest.$ac_ext >&5
8790   rm -fr conftest*
8791   ol_cv_pthread_lpthreads_lexc=no
8792 fi
8793 rm -fr conftest*
8794 fi
8795
8796
8797                 # restore the LIBS
8798                 LIBS="$ol_LIBS"
8799         
8800 fi
8801
8802 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
8803
8804         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
8805                 ol_link_pthreads="-lpthreads -lexc"
8806                 ol_link_threads=posix
8807         fi
8808 fi
8809
8810
8811                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
8812 if test "$ol_link_threads" = no ; then
8813         # try -lpthreads
8814         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
8815 echo "configure:8816: checking for pthread link with -lpthreads" >&5
8816 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
8817   echo $ac_n "(cached) $ac_c" 1>&6
8818 else
8819   
8820                 # save the flags
8821                 ol_LIBS="$LIBS"
8822                 LIBS="-lpthreads $LIBS"
8823
8824                 if test "$cross_compiling" = yes; then
8825   cat > conftest.$ac_ext <<EOF
8826 #line 8827 "configure"
8827 #include "confdefs.h"
8828 /* pthread test headers */
8829 #include <pthread.h>
8830 #ifndef NULL
8831 #define NULL (void*)0
8832 #endif
8833
8834 static void *task(p)
8835         void *p;
8836 {
8837         return (void *) (p == NULL);
8838 }
8839
8840 int main() {
8841
8842         /* pthread test function */
8843         pthread_t t;
8844         int status;
8845
8846         /* make sure pthread_create() isn't just a stub */
8847 #if HAVE_PTHREADS_D4
8848         status = pthread_create(&t, pthread_attr_default, task, NULL);
8849 #else
8850         status = pthread_create(&t, NULL, task, NULL);
8851 #endif
8852
8853         if( status ) exit( status );
8854
8855         /* make sure pthread_detach() isn't just a stub */
8856 #if HAVE_PTHREADS_D4
8857         status = pthread_detach( &t );
8858 #else
8859         status = pthread_detach( t );
8860 #endif
8861
8862 #ifdef HAVE_LINUX_THREADS
8863         pthread_kill_other_threads_np();
8864 #endif
8865
8866         exit( status );
8867
8868 ; return 0; }
8869 EOF
8870 if { (eval echo configure:8871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8871   rm -rf conftest*
8872   ol_cv_pthread_lib_lpthreads=yes
8873 else
8874   echo "configure: failed program was:" >&5
8875   cat conftest.$ac_ext >&5
8876   rm -rf conftest*
8877   ol_cv_pthread_lib_lpthreads=no
8878 fi
8879 rm -f conftest*
8880 else
8881   cat > conftest.$ac_ext <<EOF
8882 #line 8883 "configure"
8883 #include "confdefs.h"
8884 /* pthread test headers */
8885 #include <pthread.h>
8886 #ifndef NULL
8887 #define NULL (void*)0
8888 #endif
8889
8890 static void *task(p)
8891         void *p;
8892 {
8893         return (void *) (p == NULL);
8894 }
8895
8896
8897 int main(argc, argv)
8898         int argc;
8899         char **argv;
8900 {
8901
8902         /* pthread test function */
8903         pthread_t t;
8904         int status;
8905
8906         /* make sure pthread_create() isn't just a stub */
8907 #if HAVE_PTHREADS_D4
8908         status = pthread_create(&t, pthread_attr_default, task, NULL);
8909 #else
8910         status = pthread_create(&t, NULL, task, NULL);
8911 #endif
8912
8913         if( status ) exit( status );
8914
8915         /* make sure pthread_detach() isn't just a stub */
8916 #if HAVE_PTHREADS_D4
8917         status = pthread_detach( &t );
8918 #else
8919         status = pthread_detach( t );
8920 #endif
8921
8922 #ifdef HAVE_LINUX_THREADS
8923         pthread_kill_other_threads_np();
8924 #endif
8925
8926         exit( status );
8927
8928 }
8929
8930 EOF
8931 if { (eval echo configure:8932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8932 then
8933   ol_cv_pthread_lib_lpthreads=yes
8934 else
8935   echo "configure: failed program was:" >&5
8936   cat conftest.$ac_ext >&5
8937   rm -fr conftest*
8938   ol_cv_pthread_lib_lpthreads=no
8939 fi
8940 rm -fr conftest*
8941 fi
8942
8943
8944                 # restore the LIBS
8945                 LIBS="$ol_LIBS"
8946         
8947 fi
8948
8949 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
8950
8951         if test $ol_cv_pthread_lib_lpthreads = yes ; then
8952                 ol_link_pthreads="-lpthreads"
8953                 ol_link_threads=posix
8954         fi
8955 fi
8956
8957
8958                 if test $ol_link_threads != no ; then
8959                         cat >> confdefs.h <<\EOF
8960 #define HAVE_PTHREADS 1
8961 EOF
8962
8963
8964                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
8965
8966                                                 save_CPPFLAGS="$CPPFLAGS"
8967                         save_LIBS="$LIBS"
8968                         LIBS="$LTHREAD_LIBS $LIBS"
8969
8970                                                                                                 for ac_func in sched_yield pthread_yield
8971 do
8972 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8973 echo "configure:8974: checking for $ac_func" >&5
8974 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
8975   echo $ac_n "(cached) $ac_c" 1>&6
8976 else
8977   cat > conftest.$ac_ext <<EOF
8978 #line 8979 "configure"
8979 #include "confdefs.h"
8980 /* System header to define __stub macros and hopefully few prototypes,
8981     which can conflict with char $ac_func(); below.  */
8982 #include <assert.h>
8983 /* Override any gcc2 internal prototype to avoid an error.  */
8984 /* We use char because int might match the return type of a gcc2
8985     builtin and then its argument prototype would still apply.  */
8986 char $ac_func();
8987 char (*f)();
8988
8989 int main() {
8990
8991 /* The GNU C library defines this for functions which it implements
8992     to always fail with ENOSYS.  Some functions are actually named
8993     something starting with __ and the normal name is an alias.  */
8994 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8995 choke me
8996 #else
8997 f = $ac_func;
8998 #endif
8999
9000 ; return 0; }
9001 EOF
9002 if { (eval echo configure:9003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9003   rm -rf conftest*
9004   eval "ac_cv_func_$ac_func=yes"
9005 else
9006   echo "configure: failed program was:" >&5
9007   cat conftest.$ac_ext >&5
9008   rm -rf conftest*
9009   eval "ac_cv_func_$ac_func=no"
9010 fi
9011 rm -f conftest*
9012 fi
9013
9014 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9015   echo "$ac_t""yes" 1>&6
9016     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9017   cat >> confdefs.h <<EOF
9018 #define $ac_tr_func 1
9019 EOF
9020  
9021 else
9022   echo "$ac_t""no" 1>&6
9023 fi
9024 done
9025
9026
9027                         if test $ac_cv_func_sched_yield = no -a \
9028                                 $ac_cv_func_pthread_yield = no ; then
9029                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
9030 echo "configure:9031: checking for sched_yield in -lrt" >&5
9031 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
9032 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9033   echo $ac_n "(cached) $ac_c" 1>&6
9034 else
9035   ac_save_LIBS="$LIBS"
9036 LIBS="-lrt  $LIBS"
9037 cat > conftest.$ac_ext <<EOF
9038 #line 9039 "configure"
9039 #include "confdefs.h"
9040 /* Override any gcc2 internal prototype to avoid an error.  */
9041 /* We use char because int might match the return type of a gcc2
9042     builtin and then its argument prototype would still apply.  */
9043 char sched_yield();
9044
9045 int main() {
9046 sched_yield()
9047 ; return 0; }
9048 EOF
9049 if { (eval echo configure:9050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9050   rm -rf conftest*
9051   eval "ac_cv_lib_$ac_lib_var=yes"
9052 else
9053   echo "configure: failed program was:" >&5
9054   cat conftest.$ac_ext >&5
9055   rm -rf conftest*
9056   eval "ac_cv_lib_$ac_lib_var=no"
9057 fi
9058 rm -f conftest*
9059 LIBS="$ac_save_LIBS"
9060
9061 fi
9062 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9063   echo "$ac_t""yes" 1>&6
9064   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
9065                                         cat >> confdefs.h <<\EOF
9066 #define HAVE_SCHED_YIELD 1
9067 EOF
9068
9069                                         ac_cv_func_sched_yield=yes
9070 else
9071   echo "$ac_t""no" 1>&6
9072 ac_cv_func_sched_yield=no
9073 fi
9074
9075                         fi
9076                         if test $ac_cv_func_sched_yield = no -a \
9077                                 $ac_cv_func_pthread_yield = no ; then
9078                                                                                                 for ac_func in thr_yield
9079 do
9080 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9081 echo "configure:9082: checking for $ac_func" >&5
9082 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9083   echo $ac_n "(cached) $ac_c" 1>&6
9084 else
9085   cat > conftest.$ac_ext <<EOF
9086 #line 9087 "configure"
9087 #include "confdefs.h"
9088 /* System header to define __stub macros and hopefully few prototypes,
9089     which can conflict with char $ac_func(); below.  */
9090 #include <assert.h>
9091 /* Override any gcc2 internal prototype to avoid an error.  */
9092 /* We use char because int might match the return type of a gcc2
9093     builtin and then its argument prototype would still apply.  */
9094 char $ac_func();
9095 char (*f)();
9096
9097 int main() {
9098
9099 /* The GNU C library defines this for functions which it implements
9100     to always fail with ENOSYS.  Some functions are actually named
9101     something starting with __ and the normal name is an alias.  */
9102 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9103 choke me
9104 #else
9105 f = $ac_func;
9106 #endif
9107
9108 ; return 0; }
9109 EOF
9110 if { (eval echo configure:9111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9111   rm -rf conftest*
9112   eval "ac_cv_func_$ac_func=yes"
9113 else
9114   echo "configure: failed program was:" >&5
9115   cat conftest.$ac_ext >&5
9116   rm -rf conftest*
9117   eval "ac_cv_func_$ac_func=no"
9118 fi
9119 rm -f conftest*
9120 fi
9121
9122 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9123   echo "$ac_t""yes" 1>&6
9124     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9125   cat >> confdefs.h <<EOF
9126 #define $ac_tr_func 1
9127 EOF
9128  
9129 else
9130   echo "$ac_t""no" 1>&6
9131 fi
9132 done
9133
9134                         fi
9135                         if test $ac_cv_func_sched_yield = no -a \
9136                                 $ac_cv_func_pthread_yield = no -a \
9137                                 "$ac_cv_func_thr_yield" = no ; then
9138                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
9139                         fi
9140
9141                                                 for ac_func in pthread_kill
9142 do
9143 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9144 echo "configure:9145: checking for $ac_func" >&5
9145 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9146   echo $ac_n "(cached) $ac_c" 1>&6
9147 else
9148   cat > conftest.$ac_ext <<EOF
9149 #line 9150 "configure"
9150 #include "confdefs.h"
9151 /* System header to define __stub macros and hopefully few prototypes,
9152     which can conflict with char $ac_func(); below.  */
9153 #include <assert.h>
9154 /* Override any gcc2 internal prototype to avoid an error.  */
9155 /* We use char because int might match the return type of a gcc2
9156     builtin and then its argument prototype would still apply.  */
9157 char $ac_func();
9158 char (*f)();
9159
9160 int main() {
9161
9162 /* The GNU C library defines this for functions which it implements
9163     to always fail with ENOSYS.  Some functions are actually named
9164     something starting with __ and the normal name is an alias.  */
9165 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9166 choke me
9167 #else
9168 f = $ac_func;
9169 #endif
9170
9171 ; return 0; }
9172 EOF
9173 if { (eval echo configure:9174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9174   rm -rf conftest*
9175   eval "ac_cv_func_$ac_func=yes"
9176 else
9177   echo "configure: failed program was:" >&5
9178   cat conftest.$ac_ext >&5
9179   rm -rf conftest*
9180   eval "ac_cv_func_$ac_func=no"
9181 fi
9182 rm -f conftest*
9183 fi
9184
9185 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9186   echo "$ac_t""yes" 1>&6
9187     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9188   cat >> confdefs.h <<EOF
9189 #define $ac_tr_func 1
9190 EOF
9191  
9192 else
9193   echo "$ac_t""no" 1>&6
9194 fi
9195 done
9196
9197
9198                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
9199 echo "configure:9200: checking for pthread_detach with <pthread.h>" >&5
9200 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
9201   echo $ac_n "(cached) $ac_c" 1>&6
9202 else
9203   
9204                                                                 cat > conftest.$ac_ext <<EOF
9205 #line 9206 "configure"
9206 #include "confdefs.h"
9207
9208 #include <pthread.h>
9209 #ifndef NULL
9210 #define NULL (void*)0
9211 #endif
9212
9213 int main() {
9214 pthread_detach(NULL);
9215 ; return 0; }
9216 EOF
9217 if { (eval echo configure:9218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9218   rm -rf conftest*
9219   ol_cv_func_pthread_detach=yes
9220 else
9221   echo "configure: failed program was:" >&5
9222   cat conftest.$ac_ext >&5
9223   rm -rf conftest*
9224   ol_cv_func_pthread_detach=no
9225 fi
9226 rm -f conftest*
9227                         
9228 fi
9229
9230 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
9231
9232                         if test $ol_cv_func_pthread_detach = no ; then
9233                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
9234                         fi
9235
9236                         cat >> confdefs.h <<\EOF
9237 #define HAVE_PTHREAD_DETACH 1
9238 EOF
9239
9240
9241                                                 for ac_func in \
9242                                 pthread_setconcurrency \
9243                                 pthread_getconcurrency \
9244                                 thr_setconcurrency \
9245                                 thr_getconcurrency \
9246                         
9247 do
9248 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9249 echo "configure:9250: checking for $ac_func" >&5
9250 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9251   echo $ac_n "(cached) $ac_c" 1>&6
9252 else
9253   cat > conftest.$ac_ext <<EOF
9254 #line 9255 "configure"
9255 #include "confdefs.h"
9256 /* System header to define __stub macros and hopefully few prototypes,
9257     which can conflict with char $ac_func(); below.  */
9258 #include <assert.h>
9259 /* Override any gcc2 internal prototype to avoid an error.  */
9260 /* We use char because int might match the return type of a gcc2
9261     builtin and then its argument prototype would still apply.  */
9262 char $ac_func();
9263 char (*f)();
9264
9265 int main() {
9266
9267 /* The GNU C library defines this for functions which it implements
9268     to always fail with ENOSYS.  Some functions are actually named
9269     something starting with __ and the normal name is an alias.  */
9270 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9271 choke me
9272 #else
9273 f = $ac_func;
9274 #endif
9275
9276 ; return 0; }
9277 EOF
9278 if { (eval echo configure:9279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9279   rm -rf conftest*
9280   eval "ac_cv_func_$ac_func=yes"
9281 else
9282   echo "configure: failed program was:" >&5
9283   cat conftest.$ac_ext >&5
9284   rm -rf conftest*
9285   eval "ac_cv_func_$ac_func=no"
9286 fi
9287 rm -f conftest*
9288 fi
9289
9290 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9291   echo "$ac_t""yes" 1>&6
9292     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9293   cat >> confdefs.h <<EOF
9294 #define $ac_tr_func 1
9295 EOF
9296  
9297 else
9298   echo "$ac_t""no" 1>&6
9299 fi
9300 done
9301
9302
9303                         
9304         echo $ac_n "checking for pthread_kill_other_threads_np""... $ac_c" 1>&6
9305 echo "configure:9306: checking for pthread_kill_other_threads_np" >&5
9306 if eval "test \"\${ac_cv_func_pthread_kill_other_threads_np+set}\" = set"; then
9307   echo $ac_n "(cached) $ac_c" 1>&6
9308 else
9309   cat > conftest.$ac_ext <<EOF
9310 #line 9311 "configure"
9311 #include "confdefs.h"
9312 /* System header to define __stub macros and hopefully few prototypes,
9313     which can conflict with char pthread_kill_other_threads_np(); below.  */
9314 #include <assert.h>
9315 /* Override any gcc2 internal prototype to avoid an error.  */
9316 /* We use char because int might match the return type of a gcc2
9317     builtin and then its argument prototype would still apply.  */
9318 char pthread_kill_other_threads_np();
9319 char (*f)();
9320
9321 int main() {
9322
9323 /* The GNU C library defines this for functions which it implements
9324     to always fail with ENOSYS.  Some functions are actually named
9325     something starting with __ and the normal name is an alias.  */
9326 #if defined (__stub_pthread_kill_other_threads_np) || defined (__stub___pthread_kill_other_threads_np)
9327 choke me
9328 #else
9329 f = pthread_kill_other_threads_np;
9330 #endif
9331
9332 ; return 0; }
9333 EOF
9334 if { (eval echo configure:9335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9335   rm -rf conftest*
9336   eval "ac_cv_func_pthread_kill_other_threads_np=yes"
9337 else
9338   echo "configure: failed program was:" >&5
9339   cat conftest.$ac_ext >&5
9340   rm -rf conftest*
9341   eval "ac_cv_func_pthread_kill_other_threads_np=no"
9342 fi
9343 rm -f conftest*
9344 fi
9345
9346 if eval "test \"`echo '$ac_cv_func_'pthread_kill_other_threads_np`\" = yes"; then
9347   echo "$ac_t""yes" 1>&6
9348   :
9349 else
9350   echo "$ac_t""no" 1>&6
9351 fi
9352
9353         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
9354 echo "configure:9355: checking for LinuxThreads implementation" >&5
9355 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
9356   echo $ac_n "(cached) $ac_c" 1>&6
9357 else
9358   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
9359 fi
9360
9361 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
9362
9363                         
9364         
9365         
9366         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
9367 echo "configure:9368: checking for LinuxThreads consistency" >&5
9368 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
9369   echo $ac_n "(cached) $ac_c" 1>&6
9370 else
9371   
9372                 if test $ol_cv_header_linux_threads = yes -a \
9373                         $ol_cv_sys_linux_threads = yes; then
9374                         ol_cv_linux_threads=yes
9375                 elif test $ol_cv_header_linux_threads = no -a \
9376                         $ol_cv_sys_linux_threads = no; then
9377                         ol_cv_linux_threads=no
9378                 else
9379                         ol_cv_linux_threads=error
9380                 fi
9381         
9382 fi
9383
9384 echo "$ac_t""$ol_cv_linux_threads" 1>&6
9385
9386
9387                         if test $ol_cv_linux_threads = error; then
9388                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
9389                         fi
9390
9391                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
9392 echo "configure:9393: checking if pthread_create() works" >&5
9393 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
9394   echo $ac_n "(cached) $ac_c" 1>&6
9395 else
9396   
9397                         if test "$cross_compiling" = yes; then
9398                                 ol_cv_pthread_create_works=yes
9399 else
9400   cat > conftest.$ac_ext <<EOF
9401 #line 9402 "configure"
9402 #include "confdefs.h"
9403 /* pthread test headers */
9404 #include <pthread.h>
9405 #ifndef NULL
9406 #define NULL (void*)0
9407 #endif
9408
9409 static void *task(p)
9410         void *p;
9411 {
9412         return (void *) (p == NULL);
9413 }
9414
9415
9416 int main(argc, argv)
9417         int argc;
9418         char **argv;
9419 {
9420
9421         /* pthread test function */
9422         pthread_t t;
9423         int status;
9424
9425         /* make sure pthread_create() isn't just a stub */
9426 #if HAVE_PTHREADS_D4
9427         status = pthread_create(&t, pthread_attr_default, task, NULL);
9428 #else
9429         status = pthread_create(&t, NULL, task, NULL);
9430 #endif
9431
9432         if( status ) exit( status );
9433
9434         /* make sure pthread_detach() isn't just a stub */
9435 #if HAVE_PTHREADS_D4
9436         status = pthread_detach( &t );
9437 #else
9438         status = pthread_detach( t );
9439 #endif
9440
9441 #ifdef HAVE_LINUX_THREADS
9442         pthread_kill_other_threads_np();
9443 #endif
9444
9445         exit( status );
9446
9447 }
9448
9449 EOF
9450 if { (eval echo configure:9451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9451 then
9452   ol_cv_pthread_create_works=yes
9453 else
9454   echo "configure: failed program was:" >&5
9455   cat conftest.$ac_ext >&5
9456   rm -fr conftest*
9457   ol_cv_pthread_create_works=no
9458 fi
9459 rm -fr conftest*
9460 fi
9461
9462 fi
9463
9464 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
9465
9466                         if test $ol_cv_pthread_create_works = no ; then
9467                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
9468                         fi
9469
9470                                                 if test $ol_with_yielding_select = auto ; then
9471                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
9472 echo "configure:9473: checking if select yields when using pthreads" >&5
9473 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
9474   echo $ac_n "(cached) $ac_c" 1>&6
9475 else
9476   
9477                                 if test "$cross_compiling" = yes; then
9478   ol_cv_pthread_select_yields=cross
9479 else
9480   cat > conftest.$ac_ext <<EOF
9481 #line 9482 "configure"
9482 #include "confdefs.h"
9483
9484 #include <sys/types.h>
9485 #include <sys/time.h>
9486 #include <unistd.h>
9487 #include <pthread.h>
9488 #ifndef NULL
9489 #define NULL (void*) 0
9490 #endif
9491
9492 static int fildes[2];
9493
9494 static void *task(p)
9495         void *p;
9496 {
9497         int i;
9498         struct timeval tv;
9499
9500         fd_set rfds;
9501
9502         tv.tv_sec=10;
9503         tv.tv_usec=0;
9504
9505         FD_ZERO(&rfds);
9506         FD_SET(fildes[0], &rfds);
9507
9508         /* we're not interested in any fds */
9509         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
9510
9511         if(i < 0) {
9512                 perror("select");
9513                 exit(10);
9514         }
9515
9516         exit(0); /* if we exit here, the select blocked the whole process */
9517 }
9518
9519 int main(argc, argv)
9520         int argc;
9521         char **argv;
9522 {
9523         pthread_t t;
9524
9525         /* create a pipe to select */
9526         if(pipe(&fildes[0])) {
9527                 perror("select");
9528                 exit(1);
9529         }
9530
9531 #ifdef HAVE_PTHREAD_SETCONCURRENCY
9532         (void) pthread_setconcurrency(2);
9533 #else
9534 #ifdef HAVE_THR_SETCONCURRENCY
9535         /* Set Solaris LWP concurrency to 2 */
9536         thr_setconcurrency(2);
9537 #endif
9538 #endif
9539
9540 #if HAVE_PTHREADS_D4
9541         pthread_create(&t, pthread_attr_default, task, NULL);
9542 #else
9543         pthread_create(&t, NULL, task, NULL);
9544 #endif
9545
9546 #if HAVE_SCHED_YIELD
9547         sched_yield();  /* make sure task runs first */
9548 #else
9549 #ifdef HAVE_PTHREAD_YIELD
9550         pthread_yield();        /* make sure task runs first */
9551 #endif
9552 #endif
9553
9554         exit(2);
9555 }
9556 EOF
9557 if { (eval echo configure:9558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9558 then
9559   ol_cv_pthread_select_yields=no
9560 else
9561   echo "configure: failed program was:" >&5
9562   cat conftest.$ac_ext >&5
9563   rm -fr conftest*
9564   ol_cv_pthread_select_yields=yes
9565 fi
9566 rm -fr conftest*
9567 fi
9568
9569 fi
9570
9571 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
9572
9573                                 if test $ol_cv_pthread_select_yields = cross ; then
9574                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
9575                                 fi
9576
9577                                 if test $ol_cv_pthread_select_yields = yes ; then
9578                                         ol_with_yielding_select=yes
9579                                 fi
9580                         fi
9581
9582                                                 CPPFLAGS="$save_CPPFLAGS"
9583                         LIBS="$save_LIBS"
9584                 else
9585                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
9586                 fi
9587         fi
9588
9589         if test $ol_with_threads = posix ; then
9590                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
9591         fi
9592 fi
9593
9594 if test $ol_with_threads = auto -o $ol_with_threads = yes \
9595         -o $ol_with_threads = mach ; then
9596
9597                 for ac_hdr in mach/cthreads.h
9598 do
9599 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9600 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9601 echo "configure:9602: checking for $ac_hdr" >&5
9602 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9603   echo $ac_n "(cached) $ac_c" 1>&6
9604 else
9605   cat > conftest.$ac_ext <<EOF
9606 #line 9607 "configure"
9607 #include "confdefs.h"
9608 #include <$ac_hdr>
9609 EOF
9610 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9611 { (eval echo configure:9612: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9612 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9613 if test -z "$ac_err"; then
9614   rm -rf conftest*
9615   eval "ac_cv_header_$ac_safe=yes"
9616 else
9617   echo "$ac_err" >&5
9618   echo "configure: failed program was:" >&5
9619   cat conftest.$ac_ext >&5
9620   rm -rf conftest*
9621   eval "ac_cv_header_$ac_safe=no"
9622 fi
9623 rm -f conftest*
9624 fi
9625 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9626   echo "$ac_t""yes" 1>&6
9627     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9628   cat >> confdefs.h <<EOF
9629 #define $ac_tr_hdr 1
9630 EOF
9631  
9632 else
9633   echo "$ac_t""no" 1>&6
9634 fi
9635 done
9636
9637         if test $ac_cv_header_mach_cthreads_h = yes ; then
9638                 ol_with_threads=found
9639
9640                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
9641 echo "configure:9642: checking for cthread_fork" >&5
9642 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
9643   echo $ac_n "(cached) $ac_c" 1>&6
9644 else
9645   cat > conftest.$ac_ext <<EOF
9646 #line 9647 "configure"
9647 #include "confdefs.h"
9648 /* System header to define __stub macros and hopefully few prototypes,
9649     which can conflict with char cthread_fork(); below.  */
9650 #include <assert.h>
9651 /* Override any gcc2 internal prototype to avoid an error.  */
9652 /* We use char because int might match the return type of a gcc2
9653     builtin and then its argument prototype would still apply.  */
9654 char cthread_fork();
9655 char (*f)();
9656
9657 int main() {
9658
9659 /* The GNU C library defines this for functions which it implements
9660     to always fail with ENOSYS.  Some functions are actually named
9661     something starting with __ and the normal name is an alias.  */
9662 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
9663 choke me
9664 #else
9665 f = cthread_fork;
9666 #endif
9667
9668 ; return 0; }
9669 EOF
9670 if { (eval echo configure:9671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9671   rm -rf conftest*
9672   eval "ac_cv_func_cthread_fork=yes"
9673 else
9674   echo "configure: failed program was:" >&5
9675   cat conftest.$ac_ext >&5
9676   rm -rf conftest*
9677   eval "ac_cv_func_cthread_fork=no"
9678 fi
9679 rm -f conftest*
9680 fi
9681
9682 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
9683   echo "$ac_t""yes" 1>&6
9684   ol_link_threads=yes
9685 else
9686   echo "$ac_t""no" 1>&6
9687 fi
9688
9689
9690                 if test $ol_link_threads = no ; then
9691                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
9692 echo "configure:9693: checking for cthread_fork with -all_load" >&5
9693 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
9694   echo $ac_n "(cached) $ac_c" 1>&6
9695 else
9696   
9697                                                                 save_LIBS="$LIBS"
9698                                 LIBS="-all_load $LIBS"
9699                                 cat > conftest.$ac_ext <<EOF
9700 #line 9701 "configure"
9701 #include "confdefs.h"
9702 #include <mach/cthreads.h>
9703 int main() {
9704
9705                                         cthread_fork((void *)0, (void *)0);
9706                                         
9707 ; return 0; }
9708 EOF
9709 if { (eval echo configure:9710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9710   rm -rf conftest*
9711   ol_cv_cthread_all_load=yes
9712 else
9713   echo "configure: failed program was:" >&5
9714   cat conftest.$ac_ext >&5
9715   rm -rf conftest*
9716   ol_cv_cthread_all_load=no
9717 fi
9718 rm -f conftest*
9719                                                                 LIBS="$save_LIBS"
9720                         
9721 fi
9722
9723 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
9724
9725                         if test $ol_cv_cthread_all_load = yes ; then
9726                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
9727                                 ol_link_threads=mach
9728                         fi
9729                 fi
9730
9731                 if test $ol_link_threads != no ; then
9732                         : check for cthread specific functionality here
9733                         cat >> confdefs.h <<\EOF
9734 #define HAVE_MACH_CTHREADS 1
9735 EOF
9736
9737                 else
9738                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
9739                 fi
9740         fi
9741
9742         if test $ol_with_threads = mach ; then
9743                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
9744         fi
9745 fi
9746
9747 if test $ol_with_threads = auto -o $ol_with_threads = yes \
9748         -o $ol_with_threads = pth ; then
9749
9750         for ac_hdr in pth.h
9751 do
9752 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9753 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9754 echo "configure:9755: checking for $ac_hdr" >&5
9755 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9756   echo $ac_n "(cached) $ac_c" 1>&6
9757 else
9758   cat > conftest.$ac_ext <<EOF
9759 #line 9760 "configure"
9760 #include "confdefs.h"
9761 #include <$ac_hdr>
9762 EOF
9763 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9764 { (eval echo configure:9765: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9765 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9766 if test -z "$ac_err"; then
9767   rm -rf conftest*
9768   eval "ac_cv_header_$ac_safe=yes"
9769 else
9770   echo "$ac_err" >&5
9771   echo "configure: failed program was:" >&5
9772   cat conftest.$ac_ext >&5
9773   rm -rf conftest*
9774   eval "ac_cv_header_$ac_safe=no"
9775 fi
9776 rm -f conftest*
9777 fi
9778 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9779   echo "$ac_t""yes" 1>&6
9780     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9781   cat >> confdefs.h <<EOF
9782 #define $ac_tr_hdr 1
9783 EOF
9784  
9785 else
9786   echo "$ac_t""no" 1>&6
9787 fi
9788 done
9789
9790
9791         if test $ac_cv_header_pth_h = yes ; then
9792                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
9793 echo "configure:9794: checking for pth_version in -lpth" >&5
9794 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
9795 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9796   echo $ac_n "(cached) $ac_c" 1>&6
9797 else
9798   ac_save_LIBS="$LIBS"
9799 LIBS="-lpth  $LIBS"
9800 cat > conftest.$ac_ext <<EOF
9801 #line 9802 "configure"
9802 #include "confdefs.h"
9803 /* Override any gcc2 internal prototype to avoid an error.  */
9804 /* We use char because int might match the return type of a gcc2
9805     builtin and then its argument prototype would still apply.  */
9806 char pth_version();
9807
9808 int main() {
9809 pth_version()
9810 ; return 0; }
9811 EOF
9812 if { (eval echo configure:9813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9813   rm -rf conftest*
9814   eval "ac_cv_lib_$ac_lib_var=yes"
9815 else
9816   echo "configure: failed program was:" >&5
9817   cat conftest.$ac_ext >&5
9818   rm -rf conftest*
9819   eval "ac_cv_lib_$ac_lib_var=no"
9820 fi
9821 rm -f conftest*
9822 LIBS="$ac_save_LIBS"
9823
9824 fi
9825 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9826   echo "$ac_t""yes" 1>&6
9827   have_pth=yes
9828 else
9829   echo "$ac_t""no" 1>&6
9830 have_pth=no
9831 fi
9832
9833
9834                 if test $have_pth = yes ; then
9835                         cat >> confdefs.h <<\EOF
9836 #define HAVE_GNU_PTH 1
9837 EOF
9838
9839                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
9840                         ol_link_threads=pth
9841
9842                         if test $ol_with_yielding_select = auto ; then
9843                                 ol_with_yielding_select=yes
9844                         fi
9845                 fi
9846         fi
9847 fi
9848
9849 if test $ol_with_threads = auto -o $ol_with_threads = yes \
9850         -o $ol_with_threads = lwp ; then
9851
9852                 for ac_hdr in thread.h synch.h
9853 do
9854 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9855 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9856 echo "configure:9857: checking for $ac_hdr" >&5
9857 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9858   echo $ac_n "(cached) $ac_c" 1>&6
9859 else
9860   cat > conftest.$ac_ext <<EOF
9861 #line 9862 "configure"
9862 #include "confdefs.h"
9863 #include <$ac_hdr>
9864 EOF
9865 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9866 { (eval echo configure:9867: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9867 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9868 if test -z "$ac_err"; then
9869   rm -rf conftest*
9870   eval "ac_cv_header_$ac_safe=yes"
9871 else
9872   echo "$ac_err" >&5
9873   echo "configure: failed program was:" >&5
9874   cat conftest.$ac_ext >&5
9875   rm -rf conftest*
9876   eval "ac_cv_header_$ac_safe=no"
9877 fi
9878 rm -f conftest*
9879 fi
9880 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9881   echo "$ac_t""yes" 1>&6
9882     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9883   cat >> confdefs.h <<EOF
9884 #define $ac_tr_hdr 1
9885 EOF
9886  
9887 else
9888   echo "$ac_t""no" 1>&6
9889 fi
9890 done
9891
9892         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
9893                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
9894 echo "configure:9895: checking for thr_create in -lthread" >&5
9895 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
9896 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9897   echo $ac_n "(cached) $ac_c" 1>&6
9898 else
9899   ac_save_LIBS="$LIBS"
9900 LIBS="-lthread  $LIBS"
9901 cat > conftest.$ac_ext <<EOF
9902 #line 9903 "configure"
9903 #include "confdefs.h"
9904 /* Override any gcc2 internal prototype to avoid an error.  */
9905 /* We use char because int might match the return type of a gcc2
9906     builtin and then its argument prototype would still apply.  */
9907 char thr_create();
9908
9909 int main() {
9910 thr_create()
9911 ; return 0; }
9912 EOF
9913 if { (eval echo configure:9914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9914   rm -rf conftest*
9915   eval "ac_cv_lib_$ac_lib_var=yes"
9916 else
9917   echo "configure: failed program was:" >&5
9918   cat conftest.$ac_ext >&5
9919   rm -rf conftest*
9920   eval "ac_cv_lib_$ac_lib_var=no"
9921 fi
9922 rm -f conftest*
9923 LIBS="$ac_save_LIBS"
9924
9925 fi
9926 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9927   echo "$ac_t""yes" 1>&6
9928   have_thr=yes
9929 else
9930   echo "$ac_t""no" 1>&6
9931 have_thr=no
9932 fi
9933
9934
9935                 if test $have_thr = yes ; then
9936                         cat >> confdefs.h <<\EOF
9937 #define HAVE_THR 1
9938 EOF
9939
9940                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
9941                         ol_link_threads=thr
9942
9943                         if test $ol_with_yielding_select = auto ; then
9944                                 ol_with_yielding_select=yes
9945                         fi
9946
9947                                                 for ac_func in \
9948                                 thr_setconcurrency \
9949                                 thr_getconcurrency \
9950                         
9951 do
9952 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9953 echo "configure:9954: checking for $ac_func" >&5
9954 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9955   echo $ac_n "(cached) $ac_c" 1>&6
9956 else
9957   cat > conftest.$ac_ext <<EOF
9958 #line 9959 "configure"
9959 #include "confdefs.h"
9960 /* System header to define __stub macros and hopefully few prototypes,
9961     which can conflict with char $ac_func(); below.  */
9962 #include <assert.h>
9963 /* Override any gcc2 internal prototype to avoid an error.  */
9964 /* We use char because int might match the return type of a gcc2
9965     builtin and then its argument prototype would still apply.  */
9966 char $ac_func();
9967 char (*f)();
9968
9969 int main() {
9970
9971 /* The GNU C library defines this for functions which it implements
9972     to always fail with ENOSYS.  Some functions are actually named
9973     something starting with __ and the normal name is an alias.  */
9974 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9975 choke me
9976 #else
9977 f = $ac_func;
9978 #endif
9979
9980 ; return 0; }
9981 EOF
9982 if { (eval echo configure:9983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9983   rm -rf conftest*
9984   eval "ac_cv_func_$ac_func=yes"
9985 else
9986   echo "configure: failed program was:" >&5
9987   cat conftest.$ac_ext >&5
9988   rm -rf conftest*
9989   eval "ac_cv_func_$ac_func=no"
9990 fi
9991 rm -f conftest*
9992 fi
9993
9994 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9995   echo "$ac_t""yes" 1>&6
9996     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9997   cat >> confdefs.h <<EOF
9998 #define $ac_tr_func 1
9999 EOF
10000  
10001 else
10002   echo "$ac_t""no" 1>&6
10003 fi
10004 done
10005
10006                 fi
10007         fi
10008
10009                 for ac_hdr in lwp/lwp.h
10010 do
10011 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10012 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10013 echo "configure:10014: checking for $ac_hdr" >&5
10014 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10015   echo $ac_n "(cached) $ac_c" 1>&6
10016 else
10017   cat > conftest.$ac_ext <<EOF
10018 #line 10019 "configure"
10019 #include "confdefs.h"
10020 #include <$ac_hdr>
10021 EOF
10022 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10023 { (eval echo configure:10024: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10024 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10025 if test -z "$ac_err"; then
10026   rm -rf conftest*
10027   eval "ac_cv_header_$ac_safe=yes"
10028 else
10029   echo "$ac_err" >&5
10030   echo "configure: failed program was:" >&5
10031   cat conftest.$ac_ext >&5
10032   rm -rf conftest*
10033   eval "ac_cv_header_$ac_safe=no"
10034 fi
10035 rm -f conftest*
10036 fi
10037 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10038   echo "$ac_t""yes" 1>&6
10039     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10040   cat >> confdefs.h <<EOF
10041 #define $ac_tr_hdr 1
10042 EOF
10043  
10044 else
10045   echo "$ac_t""no" 1>&6
10046 fi
10047 done
10048
10049         if test $ac_cv_header_lwp_lwp_h = yes ; then
10050                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
10051 echo "configure:10052: checking for lwp_create in -llwp" >&5
10052 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
10053 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10054   echo $ac_n "(cached) $ac_c" 1>&6
10055 else
10056   ac_save_LIBS="$LIBS"
10057 LIBS="-llwp  $LIBS"
10058 cat > conftest.$ac_ext <<EOF
10059 #line 10060 "configure"
10060 #include "confdefs.h"
10061 /* Override any gcc2 internal prototype to avoid an error.  */
10062 /* We use char because int might match the return type of a gcc2
10063     builtin and then its argument prototype would still apply.  */
10064 char lwp_create();
10065
10066 int main() {
10067 lwp_create()
10068 ; return 0; }
10069 EOF
10070 if { (eval echo configure:10071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10071   rm -rf conftest*
10072   eval "ac_cv_lib_$ac_lib_var=yes"
10073 else
10074   echo "configure: failed program was:" >&5
10075   cat conftest.$ac_ext >&5
10076   rm -rf conftest*
10077   eval "ac_cv_lib_$ac_lib_var=no"
10078 fi
10079 rm -f conftest*
10080 LIBS="$ac_save_LIBS"
10081
10082 fi
10083 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10084   echo "$ac_t""yes" 1>&6
10085   have_lwp=yes
10086 else
10087   echo "$ac_t""no" 1>&6
10088 have_lwp=no
10089 fi
10090
10091
10092                 if test $have_lwp = yes ; then
10093                         cat >> confdefs.h <<\EOF
10094 #define HAVE_LWP 1
10095 EOF
10096
10097                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
10098                         ol_link_threads=lwp
10099
10100                         if test $ol_with_yielding_select = auto ; then
10101                                 ol_with_yielding_select=no
10102                         fi
10103                 fi
10104         fi
10105 fi
10106
10107 if test $ol_with_yielding_select = yes ; then
10108         cat >> confdefs.h <<\EOF
10109 #define HAVE_YIELDING_SELECT 1
10110 EOF
10111
10112 fi
10113
10114 if test $ol_with_threads = manual ; then
10115                 ol_link_threads=yes
10116
10117         echo "configure: warning: thread defines and link options must be set manually" 1>&2
10118
10119         for ac_hdr in pthread.h sched.h
10120 do
10121 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10122 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10123 echo "configure:10124: checking for $ac_hdr" >&5
10124 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10125   echo $ac_n "(cached) $ac_c" 1>&6
10126 else
10127   cat > conftest.$ac_ext <<EOF
10128 #line 10129 "configure"
10129 #include "confdefs.h"
10130 #include <$ac_hdr>
10131 EOF
10132 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10133 { (eval echo configure:10134: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10134 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10135 if test -z "$ac_err"; then
10136   rm -rf conftest*
10137   eval "ac_cv_header_$ac_safe=yes"
10138 else
10139   echo "$ac_err" >&5
10140   echo "configure: failed program was:" >&5
10141   cat conftest.$ac_ext >&5
10142   rm -rf conftest*
10143   eval "ac_cv_header_$ac_safe=no"
10144 fi
10145 rm -f conftest*
10146 fi
10147 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10148   echo "$ac_t""yes" 1>&6
10149     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10150   cat >> confdefs.h <<EOF
10151 #define $ac_tr_hdr 1
10152 EOF
10153  
10154 else
10155   echo "$ac_t""no" 1>&6
10156 fi
10157 done
10158
10159         for ac_func in sched_yield pthread_yield
10160 do
10161 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10162 echo "configure:10163: checking for $ac_func" >&5
10163 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10164   echo $ac_n "(cached) $ac_c" 1>&6
10165 else
10166   cat > conftest.$ac_ext <<EOF
10167 #line 10168 "configure"
10168 #include "confdefs.h"
10169 /* System header to define __stub macros and hopefully few prototypes,
10170     which can conflict with char $ac_func(); below.  */
10171 #include <assert.h>
10172 /* Override any gcc2 internal prototype to avoid an error.  */
10173 /* We use char because int might match the return type of a gcc2
10174     builtin and then its argument prototype would still apply.  */
10175 char $ac_func();
10176 char (*f)();
10177
10178 int main() {
10179
10180 /* The GNU C library defines this for functions which it implements
10181     to always fail with ENOSYS.  Some functions are actually named
10182     something starting with __ and the normal name is an alias.  */
10183 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10184 choke me
10185 #else
10186 f = $ac_func;
10187 #endif
10188
10189 ; return 0; }
10190 EOF
10191 if { (eval echo configure:10192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10192   rm -rf conftest*
10193   eval "ac_cv_func_$ac_func=yes"
10194 else
10195   echo "configure: failed program was:" >&5
10196   cat conftest.$ac_ext >&5
10197   rm -rf conftest*
10198   eval "ac_cv_func_$ac_func=no"
10199 fi
10200 rm -f conftest*
10201 fi
10202
10203 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10204   echo "$ac_t""yes" 1>&6
10205     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10206   cat >> confdefs.h <<EOF
10207 #define $ac_tr_func 1
10208 EOF
10209  
10210 else
10211   echo "$ac_t""no" 1>&6
10212 fi
10213 done
10214
10215         
10216         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
10217 echo "configure:10218: checking for LinuxThreads pthread.h" >&5
10218 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
10219   echo $ac_n "(cached) $ac_c" 1>&6
10220 else
10221   cat > conftest.$ac_ext <<EOF
10222 #line 10223 "configure"
10223 #include "confdefs.h"
10224 #include <pthread.h>
10225 EOF
10226 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10227   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
10228   rm -rf conftest*
10229   ol_cv_header_linux_threads=yes
10230 else
10231   rm -rf conftest*
10232   ol_cv_header_linux_threads=no
10233 fi
10234 rm -f conftest*
10235
10236                 
10237 fi
10238
10239 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
10240         if test $ol_cv_header_linux_threads = yes; then
10241                 cat >> confdefs.h <<\EOF
10242 #define HAVE_LINUX_THREADS 1
10243 EOF
10244
10245         fi
10246
10247
10248         for ac_hdr in mach/cthreads.h
10249 do
10250 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10251 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10252 echo "configure:10253: checking for $ac_hdr" >&5
10253 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10254   echo $ac_n "(cached) $ac_c" 1>&6
10255 else
10256   cat > conftest.$ac_ext <<EOF
10257 #line 10258 "configure"
10258 #include "confdefs.h"
10259 #include <$ac_hdr>
10260 EOF
10261 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10262 { (eval echo configure:10263: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10263 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10264 if test -z "$ac_err"; then
10265   rm -rf conftest*
10266   eval "ac_cv_header_$ac_safe=yes"
10267 else
10268   echo "$ac_err" >&5
10269   echo "configure: failed program was:" >&5
10270   cat conftest.$ac_ext >&5
10271   rm -rf conftest*
10272   eval "ac_cv_header_$ac_safe=no"
10273 fi
10274 rm -f conftest*
10275 fi
10276 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10277   echo "$ac_t""yes" 1>&6
10278     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10279   cat >> confdefs.h <<EOF
10280 #define $ac_tr_hdr 1
10281 EOF
10282  
10283 else
10284   echo "$ac_t""no" 1>&6
10285 fi
10286 done
10287
10288         for ac_hdr in lwp/lwp.h
10289 do
10290 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10291 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10292 echo "configure:10293: checking for $ac_hdr" >&5
10293 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10294   echo $ac_n "(cached) $ac_c" 1>&6
10295 else
10296   cat > conftest.$ac_ext <<EOF
10297 #line 10298 "configure"
10298 #include "confdefs.h"
10299 #include <$ac_hdr>
10300 EOF
10301 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10302 { (eval echo configure:10303: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10303 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10304 if test -z "$ac_err"; then
10305   rm -rf conftest*
10306   eval "ac_cv_header_$ac_safe=yes"
10307 else
10308   echo "$ac_err" >&5
10309   echo "configure: failed program was:" >&5
10310   cat conftest.$ac_ext >&5
10311   rm -rf conftest*
10312   eval "ac_cv_header_$ac_safe=no"
10313 fi
10314 rm -f conftest*
10315 fi
10316 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10317   echo "$ac_t""yes" 1>&6
10318     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10319   cat >> confdefs.h <<EOF
10320 #define $ac_tr_hdr 1
10321 EOF
10322  
10323 else
10324   echo "$ac_t""no" 1>&6
10325 fi
10326 done
10327
10328         for ac_hdr in thread.h synch.h
10329 do
10330 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10331 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10332 echo "configure:10333: checking for $ac_hdr" >&5
10333 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10334   echo $ac_n "(cached) $ac_c" 1>&6
10335 else
10336   cat > conftest.$ac_ext <<EOF
10337 #line 10338 "configure"
10338 #include "confdefs.h"
10339 #include <$ac_hdr>
10340 EOF
10341 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10342 { (eval echo configure:10343: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10343 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10344 if test -z "$ac_err"; then
10345   rm -rf conftest*
10346   eval "ac_cv_header_$ac_safe=yes"
10347 else
10348   echo "$ac_err" >&5
10349   echo "configure: failed program was:" >&5
10350   cat conftest.$ac_ext >&5
10351   rm -rf conftest*
10352   eval "ac_cv_header_$ac_safe=no"
10353 fi
10354 rm -f conftest*
10355 fi
10356 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10357   echo "$ac_t""yes" 1>&6
10358     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10359   cat >> confdefs.h <<EOF
10360 #define $ac_tr_hdr 1
10361 EOF
10362  
10363 else
10364   echo "$ac_t""no" 1>&6
10365 fi
10366 done
10367
10368 fi
10369
10370 if test $ol_link_threads != no ; then  
10371                         cat >> confdefs.h <<\EOF
10372 #define REENTRANT 1
10373 EOF
10374
10375         cat >> confdefs.h <<\EOF
10376 #define _REENTRANT 1
10377 EOF
10378
10379         cat >> confdefs.h <<\EOF
10380 #define THREAD_SAFE 1
10381 EOF
10382
10383         cat >> confdefs.h <<\EOF
10384 #define _THREAD_SAFE 1
10385 EOF
10386
10387         cat >> confdefs.h <<\EOF
10388 #define THREADSAFE 1
10389 EOF
10390
10391         cat >> confdefs.h <<\EOF
10392 #define _THREADSAFE 1
10393 EOF
10394
10395         cat >> confdefs.h <<\EOF
10396 #define _SGI_MP_SOURCE 1
10397 EOF
10398
10399
10400                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
10401 echo "configure:10402: checking for thread specific errno" >&5
10402 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
10403   echo $ac_n "(cached) $ac_c" 1>&6
10404 else
10405   
10406                 cat > conftest.$ac_ext <<EOF
10407 #line 10408 "configure"
10408 #include "confdefs.h"
10409 #include <errno.h>
10410 int main() {
10411 errno = 0;
10412 ; return 0; }
10413 EOF
10414 if { (eval echo configure:10415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10415   rm -rf conftest*
10416   ol_cv_errno_thread_specific=yes
10417 else
10418   echo "configure: failed program was:" >&5
10419   cat conftest.$ac_ext >&5
10420   rm -rf conftest*
10421   ol_cv_errno_thread_specific=no
10422 fi
10423 rm -f conftest*
10424         
10425 fi
10426
10427 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
10428
10429                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
10430 echo "configure:10431: checking for thread specific h_errno" >&5
10431 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
10432   echo $ac_n "(cached) $ac_c" 1>&6
10433 else
10434   
10435                 cat > conftest.$ac_ext <<EOF
10436 #line 10437 "configure"
10437 #include "confdefs.h"
10438 #include <netdb.h>
10439 int main() {
10440 h_errno = 0;
10441 ; return 0; }
10442 EOF
10443 if { (eval echo configure:10444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10444   rm -rf conftest*
10445   ol_cv_h_errno_thread_specific=yes
10446 else
10447   echo "configure: failed program was:" >&5
10448   cat conftest.$ac_ext >&5
10449   rm -rf conftest*
10450   ol_cv_h_errno_thread_specific=no
10451 fi
10452 rm -f conftest*
10453         
10454 fi
10455
10456 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
10457
10458         if test $ol_cv_errno_thread_specific != yes \
10459                 -o $ol_cv_h_errno_thread_specific != yes ; then
10460                 LIBS="$LTHREAD_LIBS $LIBS"
10461                 LTHREAD_LIBS=""
10462         fi
10463
10464 fi  
10465
10466 if test $ol_link_threads = no ; then
10467         if test $ol_with_threads = yes ; then
10468                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
10469         fi
10470
10471         if test $ol_with_threads = auto ; then
10472                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
10473                 ol_with_threads=no
10474         fi
10475
10476         cat >> confdefs.h <<\EOF
10477 #define NO_THREADS 1
10478 EOF
10479
10480         LTHREAD_LIBS=""
10481 fi
10482
10483 if test $ol_link_threads != no ; then
10484         cat >> confdefs.h <<\EOF
10485 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
10486 EOF
10487
10488 fi
10489
10490
10491 ol_link_ldbm=no 
10492 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
10493         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
10494 echo "configure:10495: checking for DB2 library" >&5
10495 if eval "test \"\${ol_cv_lib_db2+set}\" = set"; then
10496   echo $ac_n "(cached) $ac_c" 1>&6
10497 else
10498         ol_LIBS="$LIBS"
10499         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
10500 echo "configure:10501: checking for db_open in -ldb" >&5
10501 ac_lib_var=`echo db'_'db_open | sed 'y%./+-:%__p__%'`
10502 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10503   echo $ac_n "(cached) $ac_c" 1>&6
10504 else
10505   ac_save_LIBS="$LIBS"
10506 LIBS="-ldb  $LIBS"
10507 cat > conftest.$ac_ext <<EOF
10508 #line 10509 "configure"
10509 #include "confdefs.h"
10510 /* Override any gcc2 internal prototype to avoid an error.  */
10511 /* We use char because int might match the return type of a gcc2
10512     builtin and then its argument prototype would still apply.  */
10513 char db_open();
10514
10515 int main() {
10516 db_open()
10517 ; return 0; }
10518 EOF
10519 if { (eval echo configure:10520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10520   rm -rf conftest*
10521   eval "ac_cv_lib_$ac_lib_var=yes"
10522 else
10523   echo "configure: failed program was:" >&5
10524   cat conftest.$ac_ext >&5
10525   rm -rf conftest*
10526   eval "ac_cv_lib_$ac_lib_var=no"
10527 fi
10528 rm -f conftest*
10529 LIBS="$ac_save_LIBS"
10530
10531 fi
10532 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10533   echo "$ac_t""yes" 1>&6
10534   ol_cv_lib_db2=-ldb
10535 else
10536   echo "$ac_t""no" 1>&6
10537 ol_cv_lib_db2=no
10538 fi
10539
10540         LIBS="$ol_LIBS"
10541
10542 fi
10543
10544 echo "$ac_t""$ol_cv_lib_db2" 1>&6
10545
10546 for ac_hdr in db.h
10547 do
10548 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10549 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10550 echo "configure:10551: checking for $ac_hdr" >&5
10551 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10552   echo $ac_n "(cached) $ac_c" 1>&6
10553 else
10554   cat > conftest.$ac_ext <<EOF
10555 #line 10556 "configure"
10556 #include "confdefs.h"
10557 #include <$ac_hdr>
10558 EOF
10559 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10560 { (eval echo configure:10561: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10561 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10562 if test -z "$ac_err"; then
10563   rm -rf conftest*
10564   eval "ac_cv_header_$ac_safe=yes"
10565 else
10566   echo "$ac_err" >&5
10567   echo "configure: failed program was:" >&5
10568   cat conftest.$ac_ext >&5
10569   rm -rf conftest*
10570   eval "ac_cv_header_$ac_safe=no"
10571 fi
10572 rm -f conftest*
10573 fi
10574 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10575   echo "$ac_t""yes" 1>&6
10576     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10577   cat >> confdefs.h <<EOF
10578 #define $ac_tr_hdr 1
10579 EOF
10580  
10581 else
10582   echo "$ac_t""no" 1>&6
10583 fi
10584 done
10585
10586 if test $ac_cv_header_db_h = yes ; then
10587         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
10588 echo "configure:10589: checking if db.h is DB2" >&5
10589 if eval "test \"\${ol_cv_header_db2+set}\" = set"; then
10590   echo $ac_n "(cached) $ac_c" 1>&6
10591 else
10592   
10593                 cat > conftest.$ac_ext <<EOF
10594 #line 10595 "configure"
10595 #include "confdefs.h"
10596
10597 #                       include <db.h>
10598                         /* this check could be improved */
10599 #                       ifdef DB_VERSION_MAJOR
10600 #                               if DB_VERSION_MAJOR == 2
10601                                         __db_version_2
10602 #                               endif
10603 #                       endif
10604                 
10605 EOF
10606 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10607   egrep "__db_version_2" >/dev/null 2>&1; then
10608   rm -rf conftest*
10609   ol_cv_header_db2=yes
10610 else
10611   rm -rf conftest*
10612   ol_cv_header_db2=no
10613 fi
10614 rm -f conftest*
10615
10616 fi
10617
10618 echo "$ac_t""$ol_cv_header_db2" 1>&6
10619 else
10620         ol_cv_header_db2=no
10621 fi
10622
10623
10624  
10625  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
10626 echo "configure:10627: checking for Berkeley DB2" >&5
10627 if eval "test \"\${ol_cv_berkeley_db2+set}\" = set"; then
10628   echo $ac_n "(cached) $ac_c" 1>&6
10629 else
10630   
10631         if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then
10632                 ol_cv_berkeley_db2=no
10633         else
10634                 ol_cv_berkeley_db2=yes
10635         fi
10636
10637 fi
10638
10639 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
10640  if test $ol_cv_berkeley_db2 = yes ; then
10641         cat >> confdefs.h <<\EOF
10642 #define HAVE_BERKELEY_DB2 1
10643 EOF
10644
10645  fi
10646
10647
10648         if test $ol_cv_berkeley_db2 = yes ; then
10649                 ol_link_ldbm=db2
10650                 ol_with_ldbm_api=db2
10651
10652                 if test $ol_with_ldbm_type = hash ; then
10653                         cat >> confdefs.h <<\EOF
10654 #define LDBM_USE_DBHASH 1
10655 EOF
10656
10657                 else
10658                         cat >> confdefs.h <<\EOF
10659 #define LDBM_USE_DBBTREE 1
10660 EOF
10661
10662                 fi
10663
10664                                                 if test $ol_cv_lib_db2 != yes ; then
10665                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
10666                 fi
10667         fi
10668 fi
10669
10670 ol_link_bdb2=no
10671 if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
10672         ol_link_bdb2=yes
10673 fi
10674
10675 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
10676         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
10677 echo "configure:10678: checking for Berkeley DB library" >&5
10678 if eval "test \"\${ol_cv_lib_db+set}\" = set"; then
10679   echo $ac_n "(cached) $ac_c" 1>&6
10680 else
10681   
10682         for ac_hdr in db1/db.h
10683 do
10684 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10685 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10686 echo "configure:10687: checking for $ac_hdr" >&5
10687 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10688   echo $ac_n "(cached) $ac_c" 1>&6
10689 else
10690   cat > conftest.$ac_ext <<EOF
10691 #line 10692 "configure"
10692 #include "confdefs.h"
10693 #include <$ac_hdr>
10694 EOF
10695 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10696 { (eval echo configure:10697: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10697 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10698 if test -z "$ac_err"; then
10699   rm -rf conftest*
10700   eval "ac_cv_header_$ac_safe=yes"
10701 else
10702   echo "$ac_err" >&5
10703   echo "configure: failed program was:" >&5
10704   cat conftest.$ac_ext >&5
10705   rm -rf conftest*
10706   eval "ac_cv_header_$ac_safe=no"
10707 fi
10708 rm -f conftest*
10709 fi
10710 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10711   echo "$ac_t""yes" 1>&6
10712     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10713   cat >> confdefs.h <<EOF
10714 #define $ac_tr_hdr 1
10715 EOF
10716  
10717 else
10718   echo "$ac_t""no" 1>&6
10719 fi
10720 done
10721
10722         ol_LIBS="$LIBS"
10723         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
10724 echo "configure:10725: checking for dbopen" >&5
10725 if eval "test \"\${ac_cv_func_dbopen+set}\" = set"; then
10726   echo $ac_n "(cached) $ac_c" 1>&6
10727 else
10728   cat > conftest.$ac_ext <<EOF
10729 #line 10730 "configure"
10730 #include "confdefs.h"
10731 /* System header to define __stub macros and hopefully few prototypes,
10732     which can conflict with char dbopen(); below.  */
10733 #include <assert.h>
10734 /* Override any gcc2 internal prototype to avoid an error.  */
10735 /* We use char because int might match the return type of a gcc2
10736     builtin and then its argument prototype would still apply.  */
10737 char dbopen();
10738 char (*f)();
10739
10740 int main() {
10741
10742 /* The GNU C library defines this for functions which it implements
10743     to always fail with ENOSYS.  Some functions are actually named
10744     something starting with __ and the normal name is an alias.  */
10745 #if defined (__stub_dbopen) || defined (__stub___dbopen)
10746 choke me
10747 #else
10748 f = dbopen;
10749 #endif
10750
10751 ; return 0; }
10752 EOF
10753 if { (eval echo configure:10754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10754   rm -rf conftest*
10755   eval "ac_cv_func_dbopen=yes"
10756 else
10757   echo "configure: failed program was:" >&5
10758   cat conftest.$ac_ext >&5
10759   rm -rf conftest*
10760   eval "ac_cv_func_dbopen=no"
10761 fi
10762 rm -f conftest*
10763 fi
10764
10765 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
10766   echo "$ac_t""yes" 1>&6
10767   ol_cv_lib_db=yes
10768 else
10769   echo "$ac_t""no" 1>&6
10770
10771                 echo $ac_n "checking for dbopen in -ldb1""... $ac_c" 1>&6
10772 echo "configure:10773: checking for dbopen in -ldb1" >&5
10773 ac_lib_var=`echo db1'_'dbopen | sed 'y%./+-:%__p__%'`
10774 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10775   echo $ac_n "(cached) $ac_c" 1>&6
10776 else
10777   ac_save_LIBS="$LIBS"
10778 LIBS="-ldb1  $LIBS"
10779 cat > conftest.$ac_ext <<EOF
10780 #line 10781 "configure"
10781 #include "confdefs.h"
10782 /* Override any gcc2 internal prototype to avoid an error.  */
10783 /* We use char because int might match the return type of a gcc2
10784     builtin and then its argument prototype would still apply.  */
10785 char dbopen();
10786
10787 int main() {
10788 dbopen()
10789 ; return 0; }
10790 EOF
10791 if { (eval echo configure:10792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10792   rm -rf conftest*
10793   eval "ac_cv_lib_$ac_lib_var=yes"
10794 else
10795   echo "configure: failed program was:" >&5
10796   cat conftest.$ac_ext >&5
10797   rm -rf conftest*
10798   eval "ac_cv_lib_$ac_lib_var=no"
10799 fi
10800 rm -f conftest*
10801 LIBS="$ac_save_LIBS"
10802
10803 fi
10804 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10805   echo "$ac_t""yes" 1>&6
10806   ol_cv_lib_db=-ldb1
10807 else
10808   echo "$ac_t""no" 1>&6
10809
10810                         echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
10811 echo "configure:10812: checking for dbopen in -ldb" >&5
10812 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-:%__p__%'`
10813 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10814   echo $ac_n "(cached) $ac_c" 1>&6
10815 else
10816   ac_save_LIBS="$LIBS"
10817 LIBS="-ldb  $LIBS"
10818 cat > conftest.$ac_ext <<EOF
10819 #line 10820 "configure"
10820 #include "confdefs.h"
10821 /* Override any gcc2 internal prototype to avoid an error.  */
10822 /* We use char because int might match the return type of a gcc2
10823     builtin and then its argument prototype would still apply.  */
10824 char dbopen();
10825
10826 int main() {
10827 dbopen()
10828 ; return 0; }
10829 EOF
10830 if { (eval echo configure:10831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10831   rm -rf conftest*
10832   eval "ac_cv_lib_$ac_lib_var=yes"
10833 else
10834   echo "configure: failed program was:" >&5
10835   cat conftest.$ac_ext >&5
10836   rm -rf conftest*
10837   eval "ac_cv_lib_$ac_lib_var=no"
10838 fi
10839 rm -f conftest*
10840 LIBS="$ac_save_LIBS"
10841
10842 fi
10843 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10844   echo "$ac_t""yes" 1>&6
10845   ol_cv_lib_db=-ldb
10846 else
10847   echo "$ac_t""no" 1>&6
10848 ol_cv_lib_db=no
10849 fi
10850
10851                 
10852 fi
10853
10854         
10855 fi
10856
10857         LIBS="$ol_LIBS"
10858
10859 fi
10860
10861 echo "$ac_t""$ol_cv_lib_db" 1>&6
10862
10863
10864 for ac_hdr in db_185.h
10865 do
10866 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10867 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10868 echo "configure:10869: checking for $ac_hdr" >&5
10869 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10870   echo $ac_n "(cached) $ac_c" 1>&6
10871 else
10872   cat > conftest.$ac_ext <<EOF
10873 #line 10874 "configure"
10874 #include "confdefs.h"
10875 #include <$ac_hdr>
10876 EOF
10877 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10878 { (eval echo configure:10879: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10879 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10880 if test -z "$ac_err"; then
10881   rm -rf conftest*
10882   eval "ac_cv_header_$ac_safe=yes"
10883 else
10884   echo "$ac_err" >&5
10885   echo "configure: failed program was:" >&5
10886   cat conftest.$ac_ext >&5
10887   rm -rf conftest*
10888   eval "ac_cv_header_$ac_safe=no"
10889 fi
10890 rm -f conftest*
10891 fi
10892 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10893   echo "$ac_t""yes" 1>&6
10894     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10895   cat >> confdefs.h <<EOF
10896 #define $ac_tr_hdr 1
10897 EOF
10898  
10899 else
10900   echo "$ac_t""no" 1>&6
10901 fi
10902 done
10903
10904 if test "$ol_cv_header_db2" = yes ; then
10905         
10906         ol_cv_header_db=$ac_cv_header_db_185_h
10907 else
10908         ol_cv_header_db=$ac_cv_header_db_h
10909 fi
10910
10911
10912  
10913  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
10914 echo "configure:10915: checking for Berkeley DB" >&5
10915 if eval "test \"\${ol_cv_berkeley_db+set}\" = set"; then
10916   echo $ac_n "(cached) $ac_c" 1>&6
10917 else
10918   
10919         if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then
10920                 ol_cv_berkeley_db=no
10921         else
10922                 ol_cv_berkeley_db=yes
10923         fi
10924
10925 fi
10926
10927 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
10928  if test $ol_cv_berkeley_db = yes ; then
10929         cat >> confdefs.h <<\EOF
10930 #define HAVE_BERKELEY_DB 1
10931 EOF
10932
10933  fi
10934
10935
10936         if test $ol_cv_berkeley_db = yes ; then
10937                 ol_link_ldbm=db
10938                 ol_with_ldbm_api=db
10939
10940                 if test $ol_with_ldbm_type = hash ; then
10941                         cat >> confdefs.h <<\EOF
10942 #define LDBM_USE_DBHASH 1
10943 EOF
10944
10945                 else
10946                         cat >> confdefs.h <<\EOF
10947 #define LDBM_USE_DBBTREE 1
10948 EOF
10949
10950                 fi
10951
10952                                                 if test $ol_cv_lib_db != yes ; then
10953                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
10954                 fi
10955         fi
10956 fi
10957
10958 if test $ol_with_ldbm_api = manual ; then
10959                 ol_link_ldbm=yes
10960
10961         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
10962
10963         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
10964 do
10965 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10966 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10967 echo "configure:10968: checking for $ac_hdr" >&5
10968 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10969   echo $ac_n "(cached) $ac_c" 1>&6
10970 else
10971   cat > conftest.$ac_ext <<EOF
10972 #line 10973 "configure"
10973 #include "confdefs.h"
10974 #include <$ac_hdr>
10975 EOF
10976 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10977 { (eval echo configure:10978: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10978 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10979 if test -z "$ac_err"; then
10980   rm -rf conftest*
10981   eval "ac_cv_header_$ac_safe=yes"
10982 else
10983   echo "$ac_err" >&5
10984   echo "configure: failed program was:" >&5
10985   cat conftest.$ac_ext >&5
10986   rm -rf conftest*
10987   eval "ac_cv_header_$ac_safe=no"
10988 fi
10989 rm -f conftest*
10990 fi
10991 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10992   echo "$ac_t""yes" 1>&6
10993     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10994   cat >> confdefs.h <<EOF
10995 #define $ac_tr_hdr 1
10996 EOF
10997  
10998 else
10999   echo "$ac_t""no" 1>&6
11000 fi
11001 done
11002
11003 fi
11004
11005 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
11006         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
11007         ol_with_ldbm_api=none
11008 fi
11009
11010 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
11011         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
11012 echo "configure:11013: checking for MDBM library" >&5
11013 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
11014   echo $ac_n "(cached) $ac_c" 1>&6
11015 else
11016         ol_LIBS="$LIBS"
11017         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
11018 echo "configure:11019: checking for mdbm_set_chain" >&5
11019 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
11020   echo $ac_n "(cached) $ac_c" 1>&6
11021 else
11022   cat > conftest.$ac_ext <<EOF
11023 #line 11024 "configure"
11024 #include "confdefs.h"
11025 /* System header to define __stub macros and hopefully few prototypes,
11026     which can conflict with char mdbm_set_chain(); below.  */
11027 #include <assert.h>
11028 /* Override any gcc2 internal prototype to avoid an error.  */
11029 /* We use char because int might match the return type of a gcc2
11030     builtin and then its argument prototype would still apply.  */
11031 char mdbm_set_chain();
11032 char (*f)();
11033
11034 int main() {
11035
11036 /* The GNU C library defines this for functions which it implements
11037     to always fail with ENOSYS.  Some functions are actually named
11038     something starting with __ and the normal name is an alias.  */
11039 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
11040 choke me
11041 #else
11042 f = mdbm_set_chain;
11043 #endif
11044
11045 ; return 0; }
11046 EOF
11047 if { (eval echo configure:11048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11048   rm -rf conftest*
11049   eval "ac_cv_func_mdbm_set_chain=yes"
11050 else
11051   echo "configure: failed program was:" >&5
11052   cat conftest.$ac_ext >&5
11053   rm -rf conftest*
11054   eval "ac_cv_func_mdbm_set_chain=no"
11055 fi
11056 rm -f conftest*
11057 fi
11058
11059 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
11060   echo "$ac_t""yes" 1>&6
11061   ol_cv_lib_mdbm=yes
11062 else
11063   echo "$ac_t""no" 1>&6
11064
11065                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
11066 echo "configure:11067: checking for mdbm_set_chain in -lmdbm" >&5
11067 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
11068 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11069   echo $ac_n "(cached) $ac_c" 1>&6
11070 else
11071   ac_save_LIBS="$LIBS"
11072 LIBS="-lmdbm  $LIBS"
11073 cat > conftest.$ac_ext <<EOF
11074 #line 11075 "configure"
11075 #include "confdefs.h"
11076 /* Override any gcc2 internal prototype to avoid an error.  */
11077 /* We use char because int might match the return type of a gcc2
11078     builtin and then its argument prototype would still apply.  */
11079 char mdbm_set_chain();
11080
11081 int main() {
11082 mdbm_set_chain()
11083 ; return 0; }
11084 EOF
11085 if { (eval echo configure:11086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11086   rm -rf conftest*
11087   eval "ac_cv_lib_$ac_lib_var=yes"
11088 else
11089   echo "configure: failed program was:" >&5
11090   cat conftest.$ac_ext >&5
11091   rm -rf conftest*
11092   eval "ac_cv_lib_$ac_lib_var=no"
11093 fi
11094 rm -f conftest*
11095 LIBS="$ac_save_LIBS"
11096
11097 fi
11098 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11099   echo "$ac_t""yes" 1>&6
11100   ol_cv_lib_mdbm=-lmdbm
11101 else
11102   echo "$ac_t""no" 1>&6
11103 ol_cv_lib_mdbm=no
11104 fi
11105
11106         
11107 fi
11108
11109         LIBS="$ol_LIBS"
11110
11111 fi
11112
11113 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
11114
11115
11116  for ac_hdr in mdbm.h
11117 do
11118 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11119 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11120 echo "configure:11121: checking for $ac_hdr" >&5
11121 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11122   echo $ac_n "(cached) $ac_c" 1>&6
11123 else
11124   cat > conftest.$ac_ext <<EOF
11125 #line 11126 "configure"
11126 #include "confdefs.h"
11127 #include <$ac_hdr>
11128 EOF
11129 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11130 { (eval echo configure:11131: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11131 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11132 if test -z "$ac_err"; then
11133   rm -rf conftest*
11134   eval "ac_cv_header_$ac_safe=yes"
11135 else
11136   echo "$ac_err" >&5
11137   echo "configure: failed program was:" >&5
11138   cat conftest.$ac_ext >&5
11139   rm -rf conftest*
11140   eval "ac_cv_header_$ac_safe=no"
11141 fi
11142 rm -f conftest*
11143 fi
11144 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11145   echo "$ac_t""yes" 1>&6
11146     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11147   cat >> confdefs.h <<EOF
11148 #define $ac_tr_hdr 1
11149 EOF
11150  
11151 else
11152   echo "$ac_t""no" 1>&6
11153 fi
11154 done
11155
11156  echo $ac_n "checking for db""... $ac_c" 1>&6
11157 echo "configure:11158: checking for db" >&5
11158 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
11159   echo $ac_n "(cached) $ac_c" 1>&6
11160 else
11161   
11162         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
11163                 ol_cv_mdbm=no
11164         else
11165                 ol_cv_mdbm=yes
11166         fi
11167
11168 fi
11169
11170 echo "$ac_t""$ol_cv_mdbm" 1>&6
11171  if test $ol_cv_mdbm = yes ; then
11172         cat >> confdefs.h <<\EOF
11173 #define HAVE_MDBM 1
11174 EOF
11175
11176  fi
11177
11178
11179         if test $ol_cv_mdbm = yes ; then
11180                 ol_link_ldbm=mdbm
11181                 ol_with_ldbm_api=mdbm
11182                 if test $ol_cv_lib_mdbm != yes ; then
11183                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
11184                 fi
11185         fi
11186 fi
11187
11188 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
11189         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
11190 echo "configure:11191: checking for GDBM library" >&5
11191 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
11192   echo $ac_n "(cached) $ac_c" 1>&6
11193 else
11194         ol_LIBS="$LIBS"
11195         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
11196 echo "configure:11197: checking for gdbm_open" >&5
11197 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
11198   echo $ac_n "(cached) $ac_c" 1>&6
11199 else
11200   cat > conftest.$ac_ext <<EOF
11201 #line 11202 "configure"
11202 #include "confdefs.h"
11203 /* System header to define __stub macros and hopefully few prototypes,
11204     which can conflict with char gdbm_open(); below.  */
11205 #include <assert.h>
11206 /* Override any gcc2 internal prototype to avoid an error.  */
11207 /* We use char because int might match the return type of a gcc2
11208     builtin and then its argument prototype would still apply.  */
11209 char gdbm_open();
11210 char (*f)();
11211
11212 int main() {
11213
11214 /* The GNU C library defines this for functions which it implements
11215     to always fail with ENOSYS.  Some functions are actually named
11216     something starting with __ and the normal name is an alias.  */
11217 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
11218 choke me
11219 #else
11220 f = gdbm_open;
11221 #endif
11222
11223 ; return 0; }
11224 EOF
11225 if { (eval echo configure:11226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11226   rm -rf conftest*
11227   eval "ac_cv_func_gdbm_open=yes"
11228 else
11229   echo "configure: failed program was:" >&5
11230   cat conftest.$ac_ext >&5
11231   rm -rf conftest*
11232   eval "ac_cv_func_gdbm_open=no"
11233 fi
11234 rm -f conftest*
11235 fi
11236
11237 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
11238   echo "$ac_t""yes" 1>&6
11239   ol_cv_lib_gdbm=yes
11240 else
11241   echo "$ac_t""no" 1>&6
11242
11243                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
11244 echo "configure:11245: checking for gdbm_open in -lgdbm" >&5
11245 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
11246 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11247   echo $ac_n "(cached) $ac_c" 1>&6
11248 else
11249   ac_save_LIBS="$LIBS"
11250 LIBS="-lgdbm  $LIBS"
11251 cat > conftest.$ac_ext <<EOF
11252 #line 11253 "configure"
11253 #include "confdefs.h"
11254 /* Override any gcc2 internal prototype to avoid an error.  */
11255 /* We use char because int might match the return type of a gcc2
11256     builtin and then its argument prototype would still apply.  */
11257 char gdbm_open();
11258
11259 int main() {
11260 gdbm_open()
11261 ; return 0; }
11262 EOF
11263 if { (eval echo configure:11264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11264   rm -rf conftest*
11265   eval "ac_cv_lib_$ac_lib_var=yes"
11266 else
11267   echo "configure: failed program was:" >&5
11268   cat conftest.$ac_ext >&5
11269   rm -rf conftest*
11270   eval "ac_cv_lib_$ac_lib_var=no"
11271 fi
11272 rm -f conftest*
11273 LIBS="$ac_save_LIBS"
11274
11275 fi
11276 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11277   echo "$ac_t""yes" 1>&6
11278   ol_cv_lib_gdbm=-lgdbm
11279 else
11280   echo "$ac_t""no" 1>&6
11281 ol_cv_lib_gdbm=no
11282 fi
11283
11284         
11285 fi
11286
11287         LIBS="$ol_LIBS"
11288
11289 fi
11290
11291 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
11292
11293
11294  for ac_hdr in gdbm.h
11295 do
11296 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11297 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11298 echo "configure:11299: checking for $ac_hdr" >&5
11299 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11300   echo $ac_n "(cached) $ac_c" 1>&6
11301 else
11302   cat > conftest.$ac_ext <<EOF
11303 #line 11304 "configure"
11304 #include "confdefs.h"
11305 #include <$ac_hdr>
11306 EOF
11307 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11308 { (eval echo configure:11309: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11309 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11310 if test -z "$ac_err"; then
11311   rm -rf conftest*
11312   eval "ac_cv_header_$ac_safe=yes"
11313 else
11314   echo "$ac_err" >&5
11315   echo "configure: failed program was:" >&5
11316   cat conftest.$ac_ext >&5
11317   rm -rf conftest*
11318   eval "ac_cv_header_$ac_safe=no"
11319 fi
11320 rm -f conftest*
11321 fi
11322 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11323   echo "$ac_t""yes" 1>&6
11324     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11325   cat >> confdefs.h <<EOF
11326 #define $ac_tr_hdr 1
11327 EOF
11328  
11329 else
11330   echo "$ac_t""no" 1>&6
11331 fi
11332 done
11333
11334  echo $ac_n "checking for db""... $ac_c" 1>&6
11335 echo "configure:11336: checking for db" >&5
11336 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
11337   echo $ac_n "(cached) $ac_c" 1>&6
11338 else
11339   
11340         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
11341                 ol_cv_gdbm=no
11342         else
11343                 ol_cv_gdbm=yes
11344         fi
11345
11346 fi
11347
11348 echo "$ac_t""$ol_cv_gdbm" 1>&6
11349  if test $ol_cv_gdbm = yes ; then
11350         cat >> confdefs.h <<\EOF
11351 #define HAVE_GDBM 1
11352 EOF
11353
11354  fi
11355
11356
11357         if test $ol_cv_gdbm = yes ; then
11358                 ol_link_ldbm=gdbm
11359                 ol_with_ldbm_api=gdbm
11360
11361                 if test $ol_cv_lib_gdbm != yes ; then
11362                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
11363                 fi
11364         fi
11365 fi
11366
11367 if test $ol_with_ldbm_api = auto ; then
11368         echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
11369 elif test $ol_with_ldbm_api = ndbm ; then
11370         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
11371 echo "configure:11372: checking for NDBM library" >&5
11372 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
11373   echo $ac_n "(cached) $ac_c" 1>&6
11374 else
11375         ol_LIBS="$LIBS"
11376         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
11377 echo "configure:11378: checking for dbm_open" >&5
11378 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
11379   echo $ac_n "(cached) $ac_c" 1>&6
11380 else
11381   cat > conftest.$ac_ext <<EOF
11382 #line 11383 "configure"
11383 #include "confdefs.h"
11384 /* System header to define __stub macros and hopefully few prototypes,
11385     which can conflict with char dbm_open(); below.  */
11386 #include <assert.h>
11387 /* Override any gcc2 internal prototype to avoid an error.  */
11388 /* We use char because int might match the return type of a gcc2
11389     builtin and then its argument prototype would still apply.  */
11390 char dbm_open();
11391 char (*f)();
11392
11393 int main() {
11394
11395 /* The GNU C library defines this for functions which it implements
11396     to always fail with ENOSYS.  Some functions are actually named
11397     something starting with __ and the normal name is an alias.  */
11398 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
11399 choke me
11400 #else
11401 f = dbm_open;
11402 #endif
11403
11404 ; return 0; }
11405 EOF
11406 if { (eval echo configure:11407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11407   rm -rf conftest*
11408   eval "ac_cv_func_dbm_open=yes"
11409 else
11410   echo "configure: failed program was:" >&5
11411   cat conftest.$ac_ext >&5
11412   rm -rf conftest*
11413   eval "ac_cv_func_dbm_open=no"
11414 fi
11415 rm -f conftest*
11416 fi
11417
11418 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
11419   echo "$ac_t""yes" 1>&6
11420   ol_cv_lib_ndbm=yes
11421 else
11422   echo "$ac_t""no" 1>&6
11423
11424                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
11425 echo "configure:11426: checking for dbm_open in -lndbm" >&5
11426 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
11427 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11428   echo $ac_n "(cached) $ac_c" 1>&6
11429 else
11430   ac_save_LIBS="$LIBS"
11431 LIBS="-lndbm  $LIBS"
11432 cat > conftest.$ac_ext <<EOF
11433 #line 11434 "configure"
11434 #include "confdefs.h"
11435 /* Override any gcc2 internal prototype to avoid an error.  */
11436 /* We use char because int might match the return type of a gcc2
11437     builtin and then its argument prototype would still apply.  */
11438 char dbm_open();
11439
11440 int main() {
11441 dbm_open()
11442 ; return 0; }
11443 EOF
11444 if { (eval echo configure:11445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11445   rm -rf conftest*
11446   eval "ac_cv_lib_$ac_lib_var=yes"
11447 else
11448   echo "configure: failed program was:" >&5
11449   cat conftest.$ac_ext >&5
11450   rm -rf conftest*
11451   eval "ac_cv_lib_$ac_lib_var=no"
11452 fi
11453 rm -f conftest*
11454 LIBS="$ac_save_LIBS"
11455
11456 fi
11457 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11458   echo "$ac_t""yes" 1>&6
11459   ol_cv_lib_ndbm=-lndbm
11460 else
11461   echo "$ac_t""no" 1>&6
11462
11463                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
11464 echo "configure:11465: checking for dbm_open in -ldbm" >&5
11465 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
11466 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11467   echo $ac_n "(cached) $ac_c" 1>&6
11468 else
11469   ac_save_LIBS="$LIBS"
11470 LIBS="-ldbm  $LIBS"
11471 cat > conftest.$ac_ext <<EOF
11472 #line 11473 "configure"
11473 #include "confdefs.h"
11474 /* Override any gcc2 internal prototype to avoid an error.  */
11475 /* We use char because int might match the return type of a gcc2
11476     builtin and then its argument prototype would still apply.  */
11477 char dbm_open();
11478
11479 int main() {
11480 dbm_open()
11481 ; return 0; }
11482 EOF
11483 if { (eval echo configure:11484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11484   rm -rf conftest*
11485   eval "ac_cv_lib_$ac_lib_var=yes"
11486 else
11487   echo "configure: failed program was:" >&5
11488   cat conftest.$ac_ext >&5
11489   rm -rf conftest*
11490   eval "ac_cv_lib_$ac_lib_var=no"
11491 fi
11492 rm -f conftest*
11493 LIBS="$ac_save_LIBS"
11494
11495 fi
11496 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11497   echo "$ac_t""yes" 1>&6
11498   ol_cv_lib_ndbm=-ldbm
11499 else
11500   echo "$ac_t""no" 1>&6
11501 ol_cv_lib_ndbm=no
11502 fi
11503                 
11504 fi
11505
11506         
11507 fi
11508
11509         LIBS="$ol_LIBS"
11510
11511 fi
11512
11513 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
11514
11515
11516  for ac_hdr in ndbm.h
11517 do
11518 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11519 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11520 echo "configure:11521: checking for $ac_hdr" >&5
11521 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11522   echo $ac_n "(cached) $ac_c" 1>&6
11523 else
11524   cat > conftest.$ac_ext <<EOF
11525 #line 11526 "configure"
11526 #include "confdefs.h"
11527 #include <$ac_hdr>
11528 EOF
11529 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11530 { (eval echo configure:11531: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11531 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11532 if test -z "$ac_err"; then
11533   rm -rf conftest*
11534   eval "ac_cv_header_$ac_safe=yes"
11535 else
11536   echo "$ac_err" >&5
11537   echo "configure: failed program was:" >&5
11538   cat conftest.$ac_ext >&5
11539   rm -rf conftest*
11540   eval "ac_cv_header_$ac_safe=no"
11541 fi
11542 rm -f conftest*
11543 fi
11544 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11545   echo "$ac_t""yes" 1>&6
11546     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11547   cat >> confdefs.h <<EOF
11548 #define $ac_tr_hdr 1
11549 EOF
11550  
11551 else
11552   echo "$ac_t""no" 1>&6
11553 fi
11554 done
11555
11556  echo $ac_n "checking for db""... $ac_c" 1>&6
11557 echo "configure:11558: checking for db" >&5
11558 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
11559   echo $ac_n "(cached) $ac_c" 1>&6
11560 else
11561   
11562         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
11563                 ol_cv_ndbm=no
11564         else
11565                 ol_cv_ndbm=yes
11566         fi
11567
11568 fi
11569
11570 echo "$ac_t""$ol_cv_ndbm" 1>&6
11571  if test $ol_cv_ndbm = yes ; then
11572         cat >> confdefs.h <<\EOF
11573 #define HAVE_NDBM 1
11574 EOF
11575
11576  fi
11577
11578
11579         if test $ol_cv_ndbm = yes ; then
11580                 ol_link_ldbm=ndbm
11581                 ol_with_ldbm_api=ndbm
11582
11583                 if test $ol_cv_lib_ndbm != yes ; then
11584                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
11585                 fi
11586         fi
11587 fi
11588
11589 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
11590         echo "configure: warning: could not find suitable LDBM backend" 1>&2
11591         if test $ol_enable_ldbm = yes ; then
11592                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
11593         fi
11594
11595         echo "configure: warning: disabling LDBM" 1>&2
11596         ol_enable_ldbm=no
11597 fi
11598
11599 if test $ol_enable_wrappers != no ; then
11600         for ac_hdr in tcpd.h
11601 do
11602 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11603 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11604 echo "configure:11605: checking for $ac_hdr" >&5
11605 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11606   echo $ac_n "(cached) $ac_c" 1>&6
11607 else
11608   cat > conftest.$ac_ext <<EOF
11609 #line 11610 "configure"
11610 #include "confdefs.h"
11611 #include <$ac_hdr>
11612 EOF
11613 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11614 { (eval echo configure:11615: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11615 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11616 if test -z "$ac_err"; then
11617   rm -rf conftest*
11618   eval "ac_cv_header_$ac_safe=yes"
11619 else
11620   echo "$ac_err" >&5
11621   echo "configure: failed program was:" >&5
11622   cat conftest.$ac_ext >&5
11623   rm -rf conftest*
11624   eval "ac_cv_header_$ac_safe=no"
11625 fi
11626 rm -f conftest*
11627 fi
11628 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11629   echo "$ac_t""yes" 1>&6
11630     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11631   cat >> confdefs.h <<EOF
11632 #define $ac_tr_hdr 1
11633 EOF
11634  
11635 else
11636   echo "$ac_t""no" 1>&6
11637 fi
11638 done
11639
11640
11641         if test $ac_cv_header_tcpd_h != yes ; then
11642                 have_wrappers=no
11643         else
11644                 echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
11645 echo "configure:11646: checking for main in -lwrap" >&5
11646 ac_lib_var=`echo wrap'_'main | sed 'y%./+-:%__p__%'`
11647 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11648   echo $ac_n "(cached) $ac_c" 1>&6
11649 else
11650   ac_save_LIBS="$LIBS"
11651 LIBS="-lwrap  $LIBS"
11652 cat > conftest.$ac_ext <<EOF
11653 #line 11654 "configure"
11654 #include "confdefs.h"
11655
11656 int main() {
11657 main()
11658 ; return 0; }
11659 EOF
11660 if { (eval echo configure:11661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11661   rm -rf conftest*
11662   eval "ac_cv_lib_$ac_lib_var=yes"
11663 else
11664   echo "configure: failed program was:" >&5
11665   cat conftest.$ac_ext >&5
11666   rm -rf conftest*
11667   eval "ac_cv_lib_$ac_lib_var=no"
11668 fi
11669 rm -f conftest*
11670 LIBS="$ac_save_LIBS"
11671
11672 fi
11673 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11674   echo "$ac_t""yes" 1>&6
11675   have_wrappers=yes
11676 else
11677   echo "$ac_t""no" 1>&6
11678 have_wrappers=no
11679 fi
11680
11681         fi
11682
11683         if test $have_wrappers = yes ; then
11684                 cat >> confdefs.h <<\EOF
11685 #define HAVE_TCPD 1
11686 EOF
11687
11688                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
11689
11690                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
11691 echo "configure:11692: checking for main in -lnsl" >&5
11692 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
11693 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11694   echo $ac_n "(cached) $ac_c" 1>&6
11695 else
11696   ac_save_LIBS="$LIBS"
11697 LIBS="-lnsl  $LIBS"
11698 cat > conftest.$ac_ext <<EOF
11699 #line 11700 "configure"
11700 #include "confdefs.h"
11701
11702 int main() {
11703 main()
11704 ; return 0; }
11705 EOF
11706 if { (eval echo configure:11707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11707   rm -rf conftest*
11708   eval "ac_cv_lib_$ac_lib_var=yes"
11709 else
11710   echo "configure: failed program was:" >&5
11711   cat conftest.$ac_ext >&5
11712   rm -rf conftest*
11713   eval "ac_cv_lib_$ac_lib_var=no"
11714 fi
11715 rm -f conftest*
11716 LIBS="$ac_save_LIBS"
11717
11718 fi
11719 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11720   echo "$ac_t""yes" 1>&6
11721     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
11722     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
11723   cat >> confdefs.h <<EOF
11724 #define $ac_tr_lib 1
11725 EOF
11726
11727   LIBS="-lnsl $LIBS"
11728
11729 else
11730   echo "$ac_t""no" 1>&6
11731 fi
11732
11733         else
11734                 echo "configure: warning: could not find -lwrap" 1>&2
11735                 if test $ol_enable_wrappers = yes ; then
11736                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
11737                 fi
11738
11739                 echo "configure: warning: disabling wrappers support" 1>&2
11740                 ol_enable_wrappers=no
11741         fi
11742 fi
11743
11744 if test $ol_enable_syslog != no ; then
11745         echo $ac_n "checking for openlog""... $ac_c" 1>&6
11746 echo "configure:11747: checking for openlog" >&5
11747 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
11748   echo $ac_n "(cached) $ac_c" 1>&6
11749 else
11750   cat > conftest.$ac_ext <<EOF
11751 #line 11752 "configure"
11752 #include "confdefs.h"
11753 /* System header to define __stub macros and hopefully few prototypes,
11754     which can conflict with char openlog(); below.  */
11755 #include <assert.h>
11756 /* Override any gcc2 internal prototype to avoid an error.  */
11757 /* We use char because int might match the return type of a gcc2
11758     builtin and then its argument prototype would still apply.  */
11759 char openlog();
11760 char (*f)();
11761
11762 int main() {
11763
11764 /* The GNU C library defines this for functions which it implements
11765     to always fail with ENOSYS.  Some functions are actually named
11766     something starting with __ and the normal name is an alias.  */
11767 #if defined (__stub_openlog) || defined (__stub___openlog)
11768 choke me
11769 #else
11770 f = openlog;
11771 #endif
11772
11773 ; return 0; }
11774 EOF
11775 if { (eval echo configure:11776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11776   rm -rf conftest*
11777   eval "ac_cv_func_openlog=yes"
11778 else
11779   echo "configure: failed program was:" >&5
11780   cat conftest.$ac_ext >&5
11781   rm -rf conftest*
11782   eval "ac_cv_func_openlog=no"
11783 fi
11784 rm -f conftest*
11785 fi
11786
11787 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
11788   echo "$ac_t""yes" 1>&6
11789   :
11790 else
11791   echo "$ac_t""no" 1>&6
11792 fi
11793
11794         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
11795                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
11796         fi
11797         ol_enable_syslog=$ac_cv_func_openlog
11798 fi
11799
11800 if test $ol_enable_dmalloc != no ; then
11801         for ac_hdr in dmalloc.h
11802 do
11803 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11804 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11805 echo "configure:11806: checking for $ac_hdr" >&5
11806 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11807   echo $ac_n "(cached) $ac_c" 1>&6
11808 else
11809   cat > conftest.$ac_ext <<EOF
11810 #line 11811 "configure"
11811 #include "confdefs.h"
11812 #include <$ac_hdr>
11813 EOF
11814 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11815 { (eval echo configure:11816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11816 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11817 if test -z "$ac_err"; then
11818   rm -rf conftest*
11819   eval "ac_cv_header_$ac_safe=yes"
11820 else
11821   echo "$ac_err" >&5
11822   echo "configure: failed program was:" >&5
11823   cat conftest.$ac_ext >&5
11824   rm -rf conftest*
11825   eval "ac_cv_header_$ac_safe=no"
11826 fi
11827 rm -f conftest*
11828 fi
11829 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11830   echo "$ac_t""yes" 1>&6
11831     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11832   cat >> confdefs.h <<EOF
11833 #define $ac_tr_hdr 1
11834 EOF
11835  
11836 else
11837   echo "$ac_t""no" 1>&6
11838 fi
11839 done
11840
11841         echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
11842 echo "configure:11843: checking for dmalloc_shutdown in -ldmalloc" >&5
11843 ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-:%__p__%'`
11844 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11845   echo $ac_n "(cached) $ac_c" 1>&6
11846 else
11847   ac_save_LIBS="$LIBS"
11848 LIBS="-ldmalloc  $LIBS"
11849 cat > conftest.$ac_ext <<EOF
11850 #line 11851 "configure"
11851 #include "confdefs.h"
11852 /* Override any gcc2 internal prototype to avoid an error.  */
11853 /* We use char because int might match the return type of a gcc2
11854     builtin and then its argument prototype would still apply.  */
11855 char dmalloc_shutdown();
11856
11857 int main() {
11858 dmalloc_shutdown()
11859 ; return 0; }
11860 EOF
11861 if { (eval echo configure:11862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11862   rm -rf conftest*
11863   eval "ac_cv_lib_$ac_lib_var=yes"
11864 else
11865   echo "configure: failed program was:" >&5
11866   cat conftest.$ac_ext >&5
11867   rm -rf conftest*
11868   eval "ac_cv_lib_$ac_lib_var=no"
11869 fi
11870 rm -f conftest*
11871 LIBS="$ac_save_LIBS"
11872
11873 fi
11874 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11875   echo "$ac_t""yes" 1>&6
11876     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
11877     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
11878   cat >> confdefs.h <<EOF
11879 #define $ac_tr_lib 1
11880 EOF
11881
11882   LIBS="-ldmalloc $LIBS"
11883
11884 else
11885   echo "$ac_t""no" 1>&6
11886 fi
11887
11888 fi
11889
11890 if test $ol_enable_tcl != no ; then
11891         for ac_hdr in tcl.h
11892 do
11893 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11894 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11895 echo "configure:11896: checking for $ac_hdr" >&5
11896 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11897   echo $ac_n "(cached) $ac_c" 1>&6
11898 else
11899   cat > conftest.$ac_ext <<EOF
11900 #line 11901 "configure"
11901 #include "confdefs.h"
11902 #include <$ac_hdr>
11903 EOF
11904 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11905 { (eval echo configure:11906: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11906 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11907 if test -z "$ac_err"; then
11908   rm -rf conftest*
11909   eval "ac_cv_header_$ac_safe=yes"
11910 else
11911   echo "$ac_err" >&5
11912   echo "configure: failed program was:" >&5
11913   cat conftest.$ac_ext >&5
11914   rm -rf conftest*
11915   eval "ac_cv_header_$ac_safe=no"
11916 fi
11917 rm -f conftest*
11918 fi
11919 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11920   echo "$ac_t""yes" 1>&6
11921     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11922   cat >> confdefs.h <<EOF
11923 #define $ac_tr_hdr 1
11924 EOF
11925  
11926 else
11927   echo "$ac_t""no" 1>&6
11928 fi
11929 done
11930
11931
11932         if test $ac_cv_header_tcl_h != yes ; then
11933                 have_tcl=no
11934         else
11935                 echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6
11936 echo "configure:11937: checking for main in -ltcl" >&5
11937 ac_lib_var=`echo tcl'_'main | sed 'y%./+-:%__p__%'`
11938 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11939   echo $ac_n "(cached) $ac_c" 1>&6
11940 else
11941   ac_save_LIBS="$LIBS"
11942 LIBS="-ltcl  $LIBS"
11943 cat > conftest.$ac_ext <<EOF
11944 #line 11945 "configure"
11945 #include "confdefs.h"
11946
11947 int main() {
11948 main()
11949 ; return 0; }
11950 EOF
11951 if { (eval echo configure:11952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11952   rm -rf conftest*
11953   eval "ac_cv_lib_$ac_lib_var=yes"
11954 else
11955   echo "configure: failed program was:" >&5
11956   cat conftest.$ac_ext >&5
11957   rm -rf conftest*
11958   eval "ac_cv_lib_$ac_lib_var=no"
11959 fi
11960 rm -f conftest*
11961 LIBS="$ac_save_LIBS"
11962
11963 fi
11964 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11965   echo "$ac_t""yes" 1>&6
11966   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"
11967 else
11968   echo "$ac_t""no" 1>&6
11969 have_tcl=no
11970 fi
11971
11972
11973                 if test $have_tcl != yes; then
11974                         echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6
11975 echo "configure:11976: checking for main in -ltcl7.6" >&5
11976 ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-:%__p__%'`
11977 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11978   echo $ac_n "(cached) $ac_c" 1>&6
11979 else
11980   ac_save_LIBS="$LIBS"
11981 LIBS="-ltcl7.6  $LIBS"
11982 cat > conftest.$ac_ext <<EOF
11983 #line 11984 "configure"
11984 #include "confdefs.h"
11985
11986 int main() {
11987 main()
11988 ; return 0; }
11989 EOF
11990 if { (eval echo configure:11991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11991   rm -rf conftest*
11992   eval "ac_cv_lib_$ac_lib_var=yes"
11993 else
11994   echo "configure: failed program was:" >&5
11995   cat conftest.$ac_ext >&5
11996   rm -rf conftest*
11997   eval "ac_cv_lib_$ac_lib_var=no"
11998 fi
11999 rm -f conftest*
12000 LIBS="$ac_save_LIBS"
12001
12002 fi
12003 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12004   echo "$ac_t""yes" 1>&6
12005   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"
12006 else
12007   echo "$ac_t""no" 1>&6
12008 have_tcl=no
12009 fi
12010
12011                 fi
12012
12013                 if test $have_tcl != yes; then
12014                         echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6
12015 echo "configure:12016: checking for main in -ltcl8.0" >&5
12016 ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-:%__p__%'`
12017 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12018   echo $ac_n "(cached) $ac_c" 1>&6
12019 else
12020   ac_save_LIBS="$LIBS"
12021 LIBS="-ltcl8.0  $LIBS"
12022 cat > conftest.$ac_ext <<EOF
12023 #line 12024 "configure"
12024 #include "confdefs.h"
12025
12026 int main() {
12027 main()
12028 ; return 0; }
12029 EOF
12030 if { (eval echo configure:12031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12031   rm -rf conftest*
12032   eval "ac_cv_lib_$ac_lib_var=yes"
12033 else
12034   echo "configure: failed program was:" >&5
12035   cat conftest.$ac_ext >&5
12036   rm -rf conftest*
12037   eval "ac_cv_lib_$ac_lib_var=no"
12038 fi
12039 rm -f conftest*
12040 LIBS="$ac_save_LIBS"
12041
12042 fi
12043 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12044   echo "$ac_t""yes" 1>&6
12045   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"
12046 else
12047   echo "$ac_t""no" 1>&6
12048 have_tcl=no
12049 fi
12050
12051                 fi
12052         fi
12053
12054         if test $have_tcl != yes ; then
12055                 echo "configure: warning: could not find -ltcl" 1>&2
12056                 if test $ol_enable_tcl = yes ; then
12057                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
12058                 fi
12059
12060                 ol_enable_tcl=no
12061         fi
12062 fi
12063
12064 # ud needs termcap (should insert check here)
12065 ol_link_termcap=no
12066 for ac_hdr in termcap.h ncurses.h
12067 do
12068 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12069 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12070 echo "configure:12071: checking for $ac_hdr" >&5
12071 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12072   echo $ac_n "(cached) $ac_c" 1>&6
12073 else
12074   cat > conftest.$ac_ext <<EOF
12075 #line 12076 "configure"
12076 #include "confdefs.h"
12077 #include <$ac_hdr>
12078 EOF
12079 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12080 { (eval echo configure:12081: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12081 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12082 if test -z "$ac_err"; then
12083   rm -rf conftest*
12084   eval "ac_cv_header_$ac_safe=yes"
12085 else
12086   echo "$ac_err" >&5
12087   echo "configure: failed program was:" >&5
12088   cat conftest.$ac_ext >&5
12089   rm -rf conftest*
12090   eval "ac_cv_header_$ac_safe=no"
12091 fi
12092 rm -f conftest*
12093 fi
12094 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12095   echo "$ac_t""yes" 1>&6
12096     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12097   cat >> confdefs.h <<EOF
12098 #define $ac_tr_hdr 1
12099 EOF
12100  
12101 else
12102   echo "$ac_t""no" 1>&6
12103 fi
12104 done
12105
12106
12107 if test $ol_link_termcap = no ; then
12108         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
12109 echo "configure:12110: checking for tputs in -ltermcap" >&5
12110 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
12111 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12112   echo $ac_n "(cached) $ac_c" 1>&6
12113 else
12114   ac_save_LIBS="$LIBS"
12115 LIBS="-ltermcap  $LIBS"
12116 cat > conftest.$ac_ext <<EOF
12117 #line 12118 "configure"
12118 #include "confdefs.h"
12119 /* Override any gcc2 internal prototype to avoid an error.  */
12120 /* We use char because int might match the return type of a gcc2
12121     builtin and then its argument prototype would still apply.  */
12122 char tputs();
12123
12124 int main() {
12125 tputs()
12126 ; return 0; }
12127 EOF
12128 if { (eval echo configure:12129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12129   rm -rf conftest*
12130   eval "ac_cv_lib_$ac_lib_var=yes"
12131 else
12132   echo "configure: failed program was:" >&5
12133   cat conftest.$ac_ext >&5
12134   rm -rf conftest*
12135   eval "ac_cv_lib_$ac_lib_var=no"
12136 fi
12137 rm -f conftest*
12138 LIBS="$ac_save_LIBS"
12139
12140 fi
12141 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12142   echo "$ac_t""yes" 1>&6
12143   have_termcap=yes
12144 else
12145   echo "$ac_t""no" 1>&6
12146 have_termcap=no
12147 fi
12148
12149         if test $have_termcap = yes ; then
12150                 cat >> confdefs.h <<\EOF
12151 #define HAVE_TERMCAP 1
12152 EOF
12153
12154                 ol_link_termcap=yes
12155                 TERMCAP_LIBS=-ltermcap
12156         fi
12157 fi
12158
12159 if test $ol_link_termcap = no ; then
12160         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
12161 echo "configure:12162: checking for initscr in -lncurses" >&5
12162 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
12163 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12164   echo $ac_n "(cached) $ac_c" 1>&6
12165 else
12166   ac_save_LIBS="$LIBS"
12167 LIBS="-lncurses  $LIBS"
12168 cat > conftest.$ac_ext <<EOF
12169 #line 12170 "configure"
12170 #include "confdefs.h"
12171 /* Override any gcc2 internal prototype to avoid an error.  */
12172 /* We use char because int might match the return type of a gcc2
12173     builtin and then its argument prototype would still apply.  */
12174 char initscr();
12175
12176 int main() {
12177 initscr()
12178 ; return 0; }
12179 EOF
12180 if { (eval echo configure:12181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12181   rm -rf conftest*
12182   eval "ac_cv_lib_$ac_lib_var=yes"
12183 else
12184   echo "configure: failed program was:" >&5
12185   cat conftest.$ac_ext >&5
12186   rm -rf conftest*
12187   eval "ac_cv_lib_$ac_lib_var=no"
12188 fi
12189 rm -f conftest*
12190 LIBS="$ac_save_LIBS"
12191
12192 fi
12193 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12194   echo "$ac_t""yes" 1>&6
12195   have_ncurses=yes
12196 else
12197   echo "$ac_t""no" 1>&6
12198 have_ncurses=no
12199 fi
12200
12201         if test $have_ncurses = yes ; then
12202                 cat >> confdefs.h <<\EOF
12203 #define HAVE_NCURSES 1
12204 EOF
12205
12206                 ol_link_termcap=yes
12207                 TERMCAP_LIBS=-lncurses
12208         fi
12209 fi
12210
12211 if test $ol_link_termcap = no ; then
12212         cat >> confdefs.h <<\EOF
12213 #define NO_TERMCAP 1
12214 EOF
12215
12216         TERMCAP_LIBS=
12217 fi
12218
12219 ol_link_sasl=no
12220 if test $ol_with_cyrus_sasl != no ; then
12221         ac_safe=`echo "sasl.h" | sed 'y%./+-%__p_%'`
12222 echo $ac_n "checking for sasl.h""... $ac_c" 1>&6
12223 echo "configure:12224: checking for sasl.h" >&5
12224 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12225   echo $ac_n "(cached) $ac_c" 1>&6
12226 else
12227   cat > conftest.$ac_ext <<EOF
12228 #line 12229 "configure"
12229 #include "confdefs.h"
12230 #include <sasl.h>
12231 EOF
12232 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12233 { (eval echo configure:12234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12234 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12235 if test -z "$ac_err"; then
12236   rm -rf conftest*
12237   eval "ac_cv_header_$ac_safe=yes"
12238 else
12239   echo "$ac_err" >&5
12240   echo "configure: failed program was:" >&5
12241   cat conftest.$ac_ext >&5
12242   rm -rf conftest*
12243   eval "ac_cv_header_$ac_safe=no"
12244 fi
12245 rm -f conftest*
12246 fi
12247 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12248   echo "$ac_t""yes" 1>&6
12249   :
12250 else
12251   echo "$ac_t""no" 1>&6
12252 fi
12253
12254
12255         if test $ac_cv_header_sasl_h = yes ; then
12256                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
12257 echo "configure:12258: checking for sasl_client_init in -lsasl" >&5
12258 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
12259 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12260   echo $ac_n "(cached) $ac_c" 1>&6
12261 else
12262   ac_save_LIBS="$LIBS"
12263 LIBS="-lsasl  $LIBS"
12264 cat > conftest.$ac_ext <<EOF
12265 #line 12266 "configure"
12266 #include "confdefs.h"
12267 /* Override any gcc2 internal prototype to avoid an error.  */
12268 /* We use char because int might match the return type of a gcc2
12269     builtin and then its argument prototype would still apply.  */
12270 char sasl_client_init();
12271
12272 int main() {
12273 sasl_client_init()
12274 ; return 0; }
12275 EOF
12276 if { (eval echo configure:12277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12277   rm -rf conftest*
12278   eval "ac_cv_lib_$ac_lib_var=yes"
12279 else
12280   echo "configure: failed program was:" >&5
12281   cat conftest.$ac_ext >&5
12282   rm -rf conftest*
12283   eval "ac_cv_lib_$ac_lib_var=no"
12284 fi
12285 rm -f conftest*
12286 LIBS="$ac_save_LIBS"
12287
12288 fi
12289 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12290   echo "$ac_t""yes" 1>&6
12291   have_cyrus_sasl=yes
12292 else
12293   echo "$ac_t""no" 1>&6
12294 have_cyrus_sasl=no
12295 fi
12296
12297
12298                 if test $have_cyrus_sasl != no ; then
12299                         SASL_LIBS="-lsasl"
12300                         cat >> confdefs.h <<\EOF
12301 #define HAVE_CYRUS_SASL 1
12302 EOF
12303
12304                         ol_link_sasl=yes
12305                 fi
12306         fi
12307
12308         if test $ol_link_sasl = no -a $ol_with_cyrus_sasl = yes ; then
12309                 { echo "configure: error: no suitable API for --with-cyrus-sasl=$ol_with_cyrus_sasl" 1>&2; exit 1; }
12310         fi
12311 fi
12312
12313 ol_link_fetch=no
12314 if test $ol_with_fetch != no ; then
12315         ol=$LIBS
12316 LIBS="-lfetch -lcom_err $LIBS"
12317 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
12318 echo "configure:12319: checking fetch(3) library" >&5
12319 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
12320   echo $ac_n "(cached) $ac_c" 1>&6
12321 else
12322   
12323         cat > conftest.$ac_ext <<EOF
12324 #line 12325 "configure"
12325 #include "confdefs.h"
12326
12327 #include <sys/param.h>
12328 #include <stdio.h>
12329 #include <fetch.h>
12330 int main() {
12331 struct url *u = fetchParseURL("file:///"); 
12332 ; return 0; }
12333 EOF
12334 if { (eval echo configure:12335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12335   rm -rf conftest*
12336   ol_cv_lib_fetch=yes
12337 else
12338   echo "configure: failed program was:" >&5
12339   cat conftest.$ac_ext >&5
12340   rm -rf conftest*
12341   ol_cv_lib_fetch=no
12342 fi
12343 rm -f conftest*
12344 fi
12345
12346 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
12347 LIBS=$ol_LIBS
12348 if test $ol_cv_lib_fetch != no ; then
12349         ol_link_fetch="-lfetch -lcom_err"
12350         cat >> confdefs.h <<\EOF
12351 #define HAVE_FETCH 1
12352 EOF
12353
12354 fi
12355
12356
12357         if test $ol_cv_lib_fetch != no ; then
12358                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
12359                 ol_link_fetch=freebsd
12360
12361         elif test $ol_with_fetch != auto ; then
12362                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
12363         fi 
12364 fi
12365
12366 ol_link_readline=no
12367 if test $ol_with_readline != no ; then
12368         for ac_hdr in readline/readline.h readline/history.h
12369 do
12370 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12371 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12372 echo "configure:12373: checking for $ac_hdr" >&5
12373 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12374   echo $ac_n "(cached) $ac_c" 1>&6
12375 else
12376   cat > conftest.$ac_ext <<EOF
12377 #line 12378 "configure"
12378 #include "confdefs.h"
12379 #include <$ac_hdr>
12380 EOF
12381 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12382 { (eval echo configure:12383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12383 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12384 if test -z "$ac_err"; then
12385   rm -rf conftest*
12386   eval "ac_cv_header_$ac_safe=yes"
12387 else
12388   echo "$ac_err" >&5
12389   echo "configure: failed program was:" >&5
12390   cat conftest.$ac_ext >&5
12391   rm -rf conftest*
12392   eval "ac_cv_header_$ac_safe=no"
12393 fi
12394 rm -f conftest*
12395 fi
12396 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12397   echo "$ac_t""yes" 1>&6
12398     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12399   cat >> confdefs.h <<EOF
12400 #define $ac_tr_hdr 1
12401 EOF
12402  
12403 else
12404   echo "$ac_t""no" 1>&6
12405 fi
12406 done
12407
12408
12409         if test $ac_cv_header_readline_readline_h = yes ; then
12410                 save_LIBS="$LIBS"
12411                 LIBS="$TERMCAP_LIBS $LIBS"
12412                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
12413 echo "configure:12414: checking for readline in -lreadline" >&5
12414 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
12415 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12416   echo $ac_n "(cached) $ac_c" 1>&6
12417 else
12418   ac_save_LIBS="$LIBS"
12419 LIBS="-lreadline  $LIBS"
12420 cat > conftest.$ac_ext <<EOF
12421 #line 12422 "configure"
12422 #include "confdefs.h"
12423 /* Override any gcc2 internal prototype to avoid an error.  */
12424 /* We use char because int might match the return type of a gcc2
12425     builtin and then its argument prototype would still apply.  */
12426 char readline();
12427
12428 int main() {
12429 readline()
12430 ; return 0; }
12431 EOF
12432 if { (eval echo configure:12433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12433   rm -rf conftest*
12434   eval "ac_cv_lib_$ac_lib_var=yes"
12435 else
12436   echo "configure: failed program was:" >&5
12437   cat conftest.$ac_ext >&5
12438   rm -rf conftest*
12439   eval "ac_cv_lib_$ac_lib_var=no"
12440 fi
12441 rm -f conftest*
12442 LIBS="$ac_save_LIBS"
12443
12444 fi
12445 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12446   echo "$ac_t""yes" 1>&6
12447   have_readline=yes
12448 else
12449   echo "$ac_t""no" 1>&6
12450 have_readline=no
12451 fi
12452
12453                 LIBS="$save_LIBS"
12454                         
12455                 if test $have_readline = yes ; then
12456                         ol_with_readline=found
12457                         ol_link_readline=yes
12458
12459                         READLINE_LIBS="-lreadline"
12460                 fi
12461         fi
12462 fi
12463
12464 if test $ol_link_readline = yes ; then
12465         cat >> confdefs.h <<\EOF
12466 #define HAVE_READLINE 1
12467 EOF
12468
12469 fi
12470
12471
12472 # FreeBSD (and others) have crypt(3) in -lcrypt
12473 if test $ol_enable_crypt != no ; then
12474         echo $ac_n "checking for crypt""... $ac_c" 1>&6
12475 echo "configure:12476: checking for crypt" >&5
12476 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
12477   echo $ac_n "(cached) $ac_c" 1>&6
12478 else
12479   cat > conftest.$ac_ext <<EOF
12480 #line 12481 "configure"
12481 #include "confdefs.h"
12482 /* System header to define __stub macros and hopefully few prototypes,
12483     which can conflict with char crypt(); below.  */
12484 #include <assert.h>
12485 /* Override any gcc2 internal prototype to avoid an error.  */
12486 /* We use char because int might match the return type of a gcc2
12487     builtin and then its argument prototype would still apply.  */
12488 char crypt();
12489 char (*f)();
12490
12491 int main() {
12492
12493 /* The GNU C library defines this for functions which it implements
12494     to always fail with ENOSYS.  Some functions are actually named
12495     something starting with __ and the normal name is an alias.  */
12496 #if defined (__stub_crypt) || defined (__stub___crypt)
12497 choke me
12498 #else
12499 f = crypt;
12500 #endif
12501
12502 ; return 0; }
12503 EOF
12504 if { (eval echo configure:12505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12505   rm -rf conftest*
12506   eval "ac_cv_func_crypt=yes"
12507 else
12508   echo "configure: failed program was:" >&5
12509   cat conftest.$ac_ext >&5
12510   rm -rf conftest*
12511   eval "ac_cv_func_crypt=no"
12512 fi
12513 rm -f conftest*
12514 fi
12515
12516 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
12517   echo "$ac_t""yes" 1>&6
12518   have_crypt=yes
12519 else
12520   echo "$ac_t""no" 1>&6
12521
12522                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
12523 echo "configure:12524: checking for crypt in -lcrypt" >&5
12524 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
12525 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12526   echo $ac_n "(cached) $ac_c" 1>&6
12527 else
12528   ac_save_LIBS="$LIBS"
12529 LIBS="-lcrypt  $LIBS"
12530 cat > conftest.$ac_ext <<EOF
12531 #line 12532 "configure"
12532 #include "confdefs.h"
12533 /* Override any gcc2 internal prototype to avoid an error.  */
12534 /* We use char because int might match the return type of a gcc2
12535     builtin and then its argument prototype would still apply.  */
12536 char crypt();
12537
12538 int main() {
12539 crypt()
12540 ; return 0; }
12541 EOF
12542 if { (eval echo configure:12543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12543   rm -rf conftest*
12544   eval "ac_cv_lib_$ac_lib_var=yes"
12545 else
12546   echo "configure: failed program was:" >&5
12547   cat conftest.$ac_ext >&5
12548   rm -rf conftest*
12549   eval "ac_cv_lib_$ac_lib_var=no"
12550 fi
12551 rm -f conftest*
12552 LIBS="$ac_save_LIBS"
12553
12554 fi
12555 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12556   echo "$ac_t""yes" 1>&6
12557   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
12558                         have_crypt=yes
12559 else
12560   echo "$ac_t""no" 1>&6
12561 have_crypt=no
12562 fi
12563
12564 fi
12565
12566
12567         if test $have_crypt = yes ; then
12568                 cat >> confdefs.h <<\EOF
12569 #define HAVE_CRYPT 1
12570 EOF
12571
12572         else
12573                 echo "configure: warning: could not find crypt" 1>&2
12574                 if test $ol_enable_crypt = yes ; then
12575                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
12576                 fi
12577
12578                 echo "configure: warning: disabling crypt support" 1>&2
12579                 ol_enable_crypt=no
12580         fi
12581 fi
12582
12583 # FreeBSD (and others) have setproctitle(3) in -lutil
12584 if test $ol_enable_proctitle != no ; then
12585         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
12586 echo "configure:12587: checking for setproctitle" >&5
12587 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
12588   echo $ac_n "(cached) $ac_c" 1>&6
12589 else
12590   cat > conftest.$ac_ext <<EOF
12591 #line 12592 "configure"
12592 #include "confdefs.h"
12593 /* System header to define __stub macros and hopefully few prototypes,
12594     which can conflict with char setproctitle(); below.  */
12595 #include <assert.h>
12596 /* Override any gcc2 internal prototype to avoid an error.  */
12597 /* We use char because int might match the return type of a gcc2
12598     builtin and then its argument prototype would still apply.  */
12599 char setproctitle();
12600 char (*f)();
12601
12602 int main() {
12603
12604 /* The GNU C library defines this for functions which it implements
12605     to always fail with ENOSYS.  Some functions are actually named
12606     something starting with __ and the normal name is an alias.  */
12607 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
12608 choke me
12609 #else
12610 f = setproctitle;
12611 #endif
12612
12613 ; return 0; }
12614 EOF
12615 if { (eval echo configure:12616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12616   rm -rf conftest*
12617   eval "ac_cv_func_setproctitle=yes"
12618 else
12619   echo "configure: failed program was:" >&5
12620   cat conftest.$ac_ext >&5
12621   rm -rf conftest*
12622   eval "ac_cv_func_setproctitle=no"
12623 fi
12624 rm -f conftest*
12625 fi
12626
12627 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
12628   echo "$ac_t""yes" 1>&6
12629   have_setproctitle=yes
12630 else
12631   echo "$ac_t""no" 1>&6
12632
12633                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
12634 echo "configure:12635: checking for setproctitle in -lutil" >&5
12635 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
12636 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12637   echo $ac_n "(cached) $ac_c" 1>&6
12638 else
12639   ac_save_LIBS="$LIBS"
12640 LIBS="-lutil  $LIBS"
12641 cat > conftest.$ac_ext <<EOF
12642 #line 12643 "configure"
12643 #include "confdefs.h"
12644 /* Override any gcc2 internal prototype to avoid an error.  */
12645 /* We use char because int might match the return type of a gcc2
12646     builtin and then its argument prototype would still apply.  */
12647 char setproctitle();
12648
12649 int main() {
12650 setproctitle()
12651 ; return 0; }
12652 EOF
12653 if { (eval echo configure:12654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12654   rm -rf conftest*
12655   eval "ac_cv_lib_$ac_lib_var=yes"
12656 else
12657   echo "configure: failed program was:" >&5
12658   cat conftest.$ac_ext >&5
12659   rm -rf conftest*
12660   eval "ac_cv_lib_$ac_lib_var=no"
12661 fi
12662 rm -f conftest*
12663 LIBS="$ac_save_LIBS"
12664
12665 fi
12666 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12667   echo "$ac_t""yes" 1>&6
12668   have_setproctitle=yes
12669                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
12670 else
12671   echo "$ac_t""no" 1>&6
12672 have_setproctitle=no
12673                         LIBOBJS="$LIBOBJS setproctitle.o"
12674 fi
12675
12676 fi
12677
12678
12679         if test $have_setproctitle = yes ; then
12680                 cat >> confdefs.h <<\EOF
12681 #define HAVE_SETPROCTITLE 1
12682 EOF
12683
12684         fi
12685 fi
12686
12687 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
12688 echo "configure:12689: checking for uid_t in sys/types.h" >&5
12689 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
12690   echo $ac_n "(cached) $ac_c" 1>&6
12691 else
12692   cat > conftest.$ac_ext <<EOF
12693 #line 12694 "configure"
12694 #include "confdefs.h"
12695 #include <sys/types.h>
12696 EOF
12697 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12698   egrep "uid_t" >/dev/null 2>&1; then
12699   rm -rf conftest*
12700   ac_cv_type_uid_t=yes
12701 else
12702   rm -rf conftest*
12703   ac_cv_type_uid_t=no
12704 fi
12705 rm -f conftest*
12706
12707 fi
12708
12709 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
12710 if test $ac_cv_type_uid_t = no; then
12711   cat >> confdefs.h <<\EOF
12712 #define uid_t int
12713 EOF
12714
12715   cat >> confdefs.h <<\EOF
12716 #define gid_t int
12717 EOF
12718
12719 fi
12720
12721 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
12722 echo "configure:12723: checking type of array argument to getgroups" >&5
12723 if eval "test \"\${ac_cv_type_getgroups+set}\" = set"; then
12724   echo $ac_n "(cached) $ac_c" 1>&6
12725 else
12726   if test "$cross_compiling" = yes; then
12727   ac_cv_type_getgroups=cross
12728 else
12729   cat > conftest.$ac_ext <<EOF
12730 #line 12731 "configure"
12731 #include "confdefs.h"
12732
12733 /* Thanks to Mike Rendell for this test.  */
12734 #include <sys/types.h>
12735 #define NGID 256
12736 #undef MAX
12737 #define MAX(x, y) ((x) > (y) ? (x) : (y))
12738 main()
12739 {
12740   gid_t gidset[NGID];
12741   int i, n;
12742   union { gid_t gval; long lval; }  val;
12743
12744   val.lval = -1;
12745   for (i = 0; i < NGID; i++)
12746     gidset[i] = val.gval;
12747   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
12748                  gidset);
12749   /* Exit non-zero if getgroups seems to require an array of ints.  This
12750      happens when gid_t is short but getgroups modifies an array of ints.  */
12751   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
12752 }
12753
12754 EOF
12755 if { (eval echo configure:12756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12756 then
12757     ac_cv_type_getgroups=gid_t
12758 else
12759   echo "configure: failed program was:" >&5
12760   cat conftest.$ac_ext >&5
12761   rm -fr conftest*
12762   ac_cv_type_getgroups=int
12763 fi
12764 rm -fr conftest*
12765 fi
12766
12767 if test $ac_cv_type_getgroups = cross; then
12768         cat > conftest.$ac_ext <<EOF
12769 #line 12770 "configure"
12770 #include "confdefs.h"
12771 #include <unistd.h>
12772 EOF
12773 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12774   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
12775   rm -rf conftest*
12776   ac_cv_type_getgroups=gid_t
12777 else
12778   rm -rf conftest*
12779   ac_cv_type_getgroups=int
12780 fi
12781 rm -f conftest*
12782
12783 fi
12784 fi
12785
12786 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
12787 cat >> confdefs.h <<EOF
12788 #define GETGROUPS_T $ac_cv_type_getgroups
12789 EOF
12790
12791  echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
12792 echo "configure:12793: checking for ANSI C header files" >&5
12793 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
12794   echo $ac_n "(cached) $ac_c" 1>&6
12795 else
12796   cat > conftest.$ac_ext <<EOF
12797 #line 12798 "configure"
12798 #include "confdefs.h"
12799 #include <stdlib.h>
12800 #include <stdarg.h>
12801 #include <string.h>
12802 #include <float.h>
12803 EOF
12804 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12805 { (eval echo configure:12806: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12806 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12807 if test -z "$ac_err"; then
12808   rm -rf conftest*
12809   ac_cv_header_stdc=yes
12810 else
12811   echo "$ac_err" >&5
12812   echo "configure: failed program was:" >&5
12813   cat conftest.$ac_ext >&5
12814   rm -rf conftest*
12815   ac_cv_header_stdc=no
12816 fi
12817 rm -f conftest*
12818
12819 if test $ac_cv_header_stdc = yes; then
12820   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
12821 cat > conftest.$ac_ext <<EOF
12822 #line 12823 "configure"
12823 #include "confdefs.h"
12824 #include <string.h>
12825 EOF
12826 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12827   egrep "memchr" >/dev/null 2>&1; then
12828   :
12829 else
12830   rm -rf conftest*
12831   ac_cv_header_stdc=no
12832 fi
12833 rm -f conftest*
12834
12835 fi
12836
12837 if test $ac_cv_header_stdc = yes; then
12838   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
12839 cat > conftest.$ac_ext <<EOF
12840 #line 12841 "configure"
12841 #include "confdefs.h"
12842 #include <stdlib.h>
12843 EOF
12844 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12845   egrep "free" >/dev/null 2>&1; then
12846   :
12847 else
12848   rm -rf conftest*
12849   ac_cv_header_stdc=no
12850 fi
12851 rm -f conftest*
12852
12853 fi
12854
12855 if test $ac_cv_header_stdc = yes; then
12856   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
12857 if test "$cross_compiling" = yes; then
12858   :
12859 else
12860   cat > conftest.$ac_ext <<EOF
12861 #line 12862 "configure"
12862 #include "confdefs.h"
12863 #include <ctype.h>
12864 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
12865 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
12866 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
12867 int main () { int i; for (i = 0; i < 256; i++)
12868 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
12869 exit (0); }
12870
12871 EOF
12872 if { (eval echo configure:12873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12873 then
12874   :
12875 else
12876   echo "configure: failed program was:" >&5
12877   cat conftest.$ac_ext >&5
12878   rm -fr conftest*
12879   ac_cv_header_stdc=no
12880 fi
12881 rm -fr conftest*
12882 fi
12883
12884 fi
12885 fi
12886
12887 echo "$ac_t""$ac_cv_header_stdc" 1>&6
12888 if test $ac_cv_header_stdc = yes; then
12889   cat >> confdefs.h <<\EOF
12890 #define STDC_HEADERS 1
12891 EOF
12892
12893 fi
12894
12895 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
12896 echo "configure:12897: checking for mode_t" >&5
12897 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
12898   echo $ac_n "(cached) $ac_c" 1>&6
12899 else
12900   cat > conftest.$ac_ext <<EOF
12901 #line 12902 "configure"
12902 #include "confdefs.h"
12903 #include <sys/types.h>
12904 #if STDC_HEADERS
12905 #include <stdlib.h>
12906 #include <stddef.h>
12907 #endif
12908 EOF
12909 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12910   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
12911   rm -rf conftest*
12912   eval "ac_cv_type_mode_t=yes"
12913 else
12914   rm -rf conftest*
12915   eval "ac_cv_type_mode_t=no"
12916 fi
12917 rm -f conftest*
12918
12919 fi
12920 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
12921   echo "$ac_t""yes" 1>&6
12922 else
12923   echo "$ac_t""no" 1>&6
12924   cat >> confdefs.h <<EOF
12925 #define mode_t int
12926 EOF
12927
12928 fi
12929
12930 echo $ac_n "checking for off_t""... $ac_c" 1>&6
12931 echo "configure:12932: checking for off_t" >&5
12932 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
12933   echo $ac_n "(cached) $ac_c" 1>&6
12934 else
12935   cat > conftest.$ac_ext <<EOF
12936 #line 12937 "configure"
12937 #include "confdefs.h"
12938 #include <sys/types.h>
12939 #if STDC_HEADERS
12940 #include <stdlib.h>
12941 #include <stddef.h>
12942 #endif
12943 EOF
12944 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12945   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
12946   rm -rf conftest*
12947   eval "ac_cv_type_off_t=yes"
12948 else
12949   rm -rf conftest*
12950   eval "ac_cv_type_off_t=no"
12951 fi
12952 rm -f conftest*
12953
12954 fi
12955 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
12956   echo "$ac_t""yes" 1>&6
12957 else
12958   echo "$ac_t""no" 1>&6
12959   cat >> confdefs.h <<EOF
12960 #define off_t long
12961 EOF
12962
12963 fi
12964
12965 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
12966 echo "configure:12967: checking for pid_t" >&5
12967 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
12968   echo $ac_n "(cached) $ac_c" 1>&6
12969 else
12970   cat > conftest.$ac_ext <<EOF
12971 #line 12972 "configure"
12972 #include "confdefs.h"
12973 #include <sys/types.h>
12974 #if STDC_HEADERS
12975 #include <stdlib.h>
12976 #include <stddef.h>
12977 #endif
12978 EOF
12979 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12980   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
12981   rm -rf conftest*
12982   eval "ac_cv_type_pid_t=yes"
12983 else
12984   rm -rf conftest*
12985   eval "ac_cv_type_pid_t=no"
12986 fi
12987 rm -f conftest*
12988
12989 fi
12990 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
12991   echo "$ac_t""yes" 1>&6
12992 else
12993   echo "$ac_t""no" 1>&6
12994   cat >> confdefs.h <<EOF
12995 #define pid_t int
12996 EOF
12997
12998 fi
12999
13000 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
13001 echo "configure:13002: checking for ptrdiff_t" >&5
13002 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
13003   echo $ac_n "(cached) $ac_c" 1>&6
13004 else
13005   cat > conftest.$ac_ext <<EOF
13006 #line 13007 "configure"
13007 #include "confdefs.h"
13008 #include <stddef.h>
13009 int main() {
13010 ptrdiff_t p
13011 ; return 0; }
13012 EOF
13013 if { (eval echo configure:13014: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13014   rm -rf conftest*
13015   am_cv_type_ptrdiff_t=yes
13016 else
13017   echo "configure: failed program was:" >&5
13018   cat conftest.$ac_ext >&5
13019   rm -rf conftest*
13020   am_cv_type_ptrdiff_t=no
13021 fi
13022 rm -f conftest*
13023 fi
13024
13025 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
13026    if test $am_cv_type_ptrdiff_t = yes; then
13027      cat >> confdefs.h <<\EOF
13028 #define HAVE_PTRDIFF_T 1
13029 EOF
13030
13031    fi
13032
13033 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
13034 echo "configure:13035: checking return type of signal handlers" >&5
13035 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
13036   echo $ac_n "(cached) $ac_c" 1>&6
13037 else
13038   cat > conftest.$ac_ext <<EOF
13039 #line 13040 "configure"
13040 #include "confdefs.h"
13041 #include <sys/types.h>
13042 #include <signal.h>
13043 #ifdef signal
13044 #undef signal
13045 #endif
13046 #ifdef __cplusplus
13047 extern "C" void (*signal (int, void (*)(int)))(int);
13048 #else
13049 void (*signal ()) ();
13050 #endif
13051
13052 int main() {
13053 int i;
13054 ; return 0; }
13055 EOF
13056 if { (eval echo configure:13057: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13057   rm -rf conftest*
13058   ac_cv_type_signal=void
13059 else
13060   echo "configure: failed program was:" >&5
13061   cat conftest.$ac_ext >&5
13062   rm -rf conftest*
13063   ac_cv_type_signal=int
13064 fi
13065 rm -f conftest*
13066 fi
13067
13068 echo "$ac_t""$ac_cv_type_signal" 1>&6
13069 cat >> confdefs.h <<EOF
13070 #define RETSIGTYPE $ac_cv_type_signal
13071 EOF
13072
13073
13074 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
13075 echo "configure:13076: checking for sig_atomic_t" >&5
13076 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
13077   echo $ac_n "(cached) $ac_c" 1>&6
13078 else
13079   cat > conftest.$ac_ext <<EOF
13080 #line 13081 "configure"
13081 #include "confdefs.h"
13082 #include <signal.h>
13083 int main() {
13084 sig_atomic_t atomic;
13085 ; return 0; }
13086 EOF
13087 if { (eval echo configure:13088: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13088   rm -rf conftest*
13089   ol_cv_type_sig_atomic_t=yes
13090 else
13091   echo "configure: failed program was:" >&5
13092   cat conftest.$ac_ext >&5
13093   rm -rf conftest*
13094   ol_cv_type_sig_atomic_t=no
13095 fi
13096 rm -f conftest*
13097 fi
13098
13099 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
13100   if test $ol_cv_type_sig_atomic_t = no; then
13101     cat >> confdefs.h <<\EOF
13102 #define sig_atomic_t int
13103 EOF
13104
13105   fi
13106  
13107 echo $ac_n "checking for size_t""... $ac_c" 1>&6
13108 echo "configure:13109: checking for size_t" >&5
13109 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
13110   echo $ac_n "(cached) $ac_c" 1>&6
13111 else
13112   cat > conftest.$ac_ext <<EOF
13113 #line 13114 "configure"
13114 #include "confdefs.h"
13115 #include <sys/types.h>
13116 #if STDC_HEADERS
13117 #include <stdlib.h>
13118 #include <stddef.h>
13119 #endif
13120 EOF
13121 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13122   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
13123   rm -rf conftest*
13124   eval "ac_cv_type_size_t=yes"
13125 else
13126   rm -rf conftest*
13127   eval "ac_cv_type_size_t=no"
13128 fi
13129 rm -f conftest*
13130
13131 fi
13132 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
13133   echo "$ac_t""yes" 1>&6
13134 else
13135   echo "$ac_t""no" 1>&6
13136   cat >> confdefs.h <<EOF
13137 #define size_t unsigned
13138 EOF
13139
13140 fi
13141
13142 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
13143 echo "configure:13144: checking for socklen_t" >&5
13144 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
13145   echo $ac_n "(cached) $ac_c" 1>&6
13146 else
13147   cat > conftest.$ac_ext <<EOF
13148 #line 13149 "configure"
13149 #include "confdefs.h"
13150
13151 #ifdef HAVE_SYS_TYPES_H
13152 #include <sys/types.h>
13153 #endif
13154 #ifdef HAVE_SYS_SOCKET_H
13155 #include <sys/socket.h>
13156 #endif
13157
13158 int main() {
13159 socklen_t len;
13160 ; return 0; }
13161 EOF
13162 if { (eval echo configure:13163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13163   rm -rf conftest*
13164   ol_cv_type_socklen_t=yes
13165 else
13166   echo "configure: failed program was:" >&5
13167   cat conftest.$ac_ext >&5
13168   rm -rf conftest*
13169   ol_cv_type_socklen_t=no
13170 fi
13171 rm -f conftest*
13172 fi
13173
13174 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
13175   if test $ol_cv_type_socklen_t = no; then
13176     cat >> confdefs.h <<\EOF
13177 #define socklen_t int
13178 EOF
13179
13180   fi
13181  
13182 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
13183 echo "configure:13184: checking for member st_blksize in aggregate type struct stat" >&5
13184 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
13185   echo $ac_n "(cached) $ac_c" 1>&6
13186 else
13187   cat > conftest.$ac_ext <<EOF
13188 #line 13189 "configure"
13189 #include "confdefs.h"
13190 #include <sys/types.h>
13191 #include <sys/stat.h>
13192 int main() {
13193 struct stat foo; foo.st_blksize;
13194 ; return 0; }
13195 EOF
13196 if { (eval echo configure:13197: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13197   rm -rf conftest*
13198   ac_cv_c_struct_member_st_blksize=yes
13199 else
13200   echo "configure: failed program was:" >&5
13201   cat conftest.$ac_ext >&5
13202   rm -rf conftest*
13203   ac_cv_c_struct_member_st_blksize=no
13204 fi
13205 rm -f conftest*
13206 fi
13207
13208 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
13209 st_blksize="$ac_cv_c_struct_member_st_blksize"
13210 if test $ac_cv_c_struct_member_st_blksize = yes; then
13211   cat >> confdefs.h <<\EOF
13212 #define HAVE_ST_BLKSIZE 1
13213 EOF
13214
13215 fi
13216
13217 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
13218 echo "configure:13219: checking whether time.h and sys/time.h may both be included" >&5
13219 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
13220   echo $ac_n "(cached) $ac_c" 1>&6
13221 else
13222   cat > conftest.$ac_ext <<EOF
13223 #line 13224 "configure"
13224 #include "confdefs.h"
13225 #include <sys/types.h>
13226 #include <sys/time.h>
13227 #include <time.h>
13228 int main() {
13229 struct tm *tp;
13230 ; return 0; }
13231 EOF
13232 if { (eval echo configure:13233: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13233   rm -rf conftest*
13234   ac_cv_header_time=yes
13235 else
13236   echo "configure: failed program was:" >&5
13237   cat conftest.$ac_ext >&5
13238   rm -rf conftest*
13239   ac_cv_header_time=no
13240 fi
13241 rm -f conftest*
13242 fi
13243
13244 echo "$ac_t""$ac_cv_header_time" 1>&6
13245 if test $ac_cv_header_time = yes; then
13246   cat >> confdefs.h <<\EOF
13247 #define TIME_WITH_SYS_TIME 1
13248 EOF
13249
13250 fi
13251
13252 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
13253 echo "configure:13254: checking whether struct tm is in sys/time.h or time.h" >&5
13254 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
13255   echo $ac_n "(cached) $ac_c" 1>&6
13256 else
13257   cat > conftest.$ac_ext <<EOF
13258 #line 13259 "configure"
13259 #include "confdefs.h"
13260 #include <sys/types.h>
13261 #include <time.h>
13262 int main() {
13263 struct tm *tp; tp->tm_sec;
13264 ; return 0; }
13265 EOF
13266 if { (eval echo configure:13267: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13267   rm -rf conftest*
13268   ac_cv_struct_tm=time.h
13269 else
13270   echo "configure: failed program was:" >&5
13271   cat conftest.$ac_ext >&5
13272   rm -rf conftest*
13273   ac_cv_struct_tm=sys/time.h
13274 fi
13275 rm -f conftest*
13276 fi
13277
13278 echo "$ac_t""$ac_cv_struct_tm" 1>&6
13279 if test $ac_cv_struct_tm = sys/time.h; then
13280   cat >> confdefs.h <<\EOF
13281 #define TM_IN_SYS_TIME 1
13282 EOF
13283
13284 fi
13285
13286 # test for pw_gecos in struct passwd
13287 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
13288 echo "configure:13289: checking struct passwd for pw_gecos" >&5
13289 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
13290   echo $ac_n "(cached) $ac_c" 1>&6
13291 else
13292   
13293         cat > conftest.$ac_ext <<EOF
13294 #line 13295 "configure"
13295 #include "confdefs.h"
13296 #include <pwd.h>
13297 int main() {
13298
13299         struct passwd pwd;
13300         pwd.pw_gecos = pwd.pw_name;
13301
13302 ; return 0; }
13303 EOF
13304 if { (eval echo configure:13305: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13305   rm -rf conftest*
13306   ol_cv_struct_passwd_pw_gecos=yes
13307 else
13308   echo "configure: failed program was:" >&5
13309   cat conftest.$ac_ext >&5
13310   rm -rf conftest*
13311   ol_cv_struct_passwd_pw_gecos=no
13312 fi
13313 rm -f conftest*
13314 fi
13315
13316 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
13317 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
13318         cat >> confdefs.h <<\EOF
13319 #define HAVE_PW_GECOS 1
13320 EOF
13321
13322 fi
13323
13324 # test for pw_passwd in struct passwd
13325 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
13326 echo "configure:13327: checking struct passwd for pw_passwd" >&5
13327 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
13328   echo $ac_n "(cached) $ac_c" 1>&6
13329 else
13330   
13331         cat > conftest.$ac_ext <<EOF
13332 #line 13333 "configure"
13333 #include "confdefs.h"
13334 #include <pwd.h>
13335 int main() {
13336
13337         struct passwd pwd;
13338         pwd.pw_passwd = pwd.pw_name;
13339
13340 ; return 0; }
13341 EOF
13342 if { (eval echo configure:13343: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13343   rm -rf conftest*
13344   ol_cv_struct_passwd_pw_passwd=yes
13345 else
13346   echo "configure: failed program was:" >&5
13347   cat conftest.$ac_ext >&5
13348   rm -rf conftest*
13349   ol_cv_struct_passwd_pw_passwd=no
13350 fi
13351 rm -f conftest*
13352 fi
13353
13354 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
13355 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
13356         cat >> confdefs.h <<\EOF
13357 #define HAVE_PW_PASSWD 1
13358 EOF
13359
13360 fi
13361
13362
13363 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
13364 echo "configure:13365: checking if toupper() requires islower()" >&5
13365 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
13366   echo $ac_n "(cached) $ac_c" 1>&6
13367 else
13368   
13369         if test "$cross_compiling" = yes; then
13370   ol_cv_c_upper_lower=safe
13371 else
13372   cat > conftest.$ac_ext <<EOF
13373 #line 13374 "configure"
13374 #include "confdefs.h"
13375
13376 #include <ctype.h>
13377 main()
13378 {
13379         if ('C' == toupper('C'))
13380                 exit(0);
13381         else
13382                 exit(1);
13383 }
13384 EOF
13385 if { (eval echo configure:13386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13386 then
13387   ol_cv_c_upper_lower=no
13388 else
13389   echo "configure: failed program was:" >&5
13390   cat conftest.$ac_ext >&5
13391   rm -fr conftest*
13392   ol_cv_c_upper_lower=yes
13393 fi
13394 rm -fr conftest*
13395 fi
13396
13397 fi
13398
13399 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
13400 if test $ol_cv_c_upper_lower != no ; then
13401         cat >> confdefs.h <<\EOF
13402 #define C_UPPER_LOWER 1
13403 EOF
13404
13405 fi
13406
13407 echo $ac_n "checking for working const""... $ac_c" 1>&6
13408 echo "configure:13409: checking for working const" >&5
13409 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
13410   echo $ac_n "(cached) $ac_c" 1>&6
13411 else
13412   cat > conftest.$ac_ext <<EOF
13413 #line 13414 "configure"
13414 #include "confdefs.h"
13415
13416 int main() {
13417
13418 /* Ultrix mips cc rejects this.  */
13419 typedef int charset[2]; const charset x;
13420 /* SunOS 4.1.1 cc rejects this.  */
13421 char const *const *ccp;
13422 char **p;
13423 /* NEC SVR4.0.2 mips cc rejects this.  */
13424 struct point {int x, y;};
13425 static struct point const zero = {0,0};
13426 /* AIX XL C 1.02.0.0 rejects this.
13427    It does not let you subtract one const X* pointer from another in an arm
13428    of an if-expression whose if-part is not a constant expression */
13429 const char *g = "string";
13430 ccp = &g + (g ? g-g : 0);
13431 /* HPUX 7.0 cc rejects these. */
13432 ++ccp;
13433 p = (char**) ccp;
13434 ccp = (char const *const *) p;
13435 { /* SCO 3.2v4 cc rejects this.  */
13436   char *t;
13437   char const *s = 0 ? (char *) 0 : (char const *) 0;
13438
13439   *t++ = 0;
13440 }
13441 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
13442   int x[] = {25, 17};
13443   const int *foo = &x[0];
13444   ++foo;
13445 }
13446 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
13447   typedef const int *iptr;
13448   iptr p = 0;
13449   ++p;
13450 }
13451 { /* AIX XL C 1.02.0.0 rejects this saying
13452      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
13453   struct s { int j; const int *ap[3]; };
13454   struct s *b; b->j = 5;
13455 }
13456 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
13457   const int foo = 10;
13458 }
13459
13460 ; return 0; }
13461 EOF
13462 if { (eval echo configure:13463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13463   rm -rf conftest*
13464   ac_cv_c_const=yes
13465 else
13466   echo "configure: failed program was:" >&5
13467   cat conftest.$ac_ext >&5
13468   rm -rf conftest*
13469   ac_cv_c_const=no
13470 fi
13471 rm -f conftest*
13472 fi
13473
13474 echo "$ac_t""$ac_cv_c_const" 1>&6
13475 if test $ac_cv_c_const = no; then
13476   cat >> confdefs.h <<\EOF
13477 #define const 
13478 EOF
13479
13480 fi
13481
13482 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
13483 echo "configure:13484: checking if compiler understands volatile" >&5
13484 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
13485   echo $ac_n "(cached) $ac_c" 1>&6
13486 else
13487   cat > conftest.$ac_ext <<EOF
13488 #line 13489 "configure"
13489 #include "confdefs.h"
13490 int x, y, z;
13491 int main() {
13492 volatile int a; int * volatile b = x ? &y : &z;
13493       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
13494       *b = 0;
13495 ; return 0; }
13496 EOF
13497 if { (eval echo configure:13498: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13498   rm -rf conftest*
13499   ol_cv_c_volatile=yes
13500 else
13501   echo "configure: failed program was:" >&5
13502   cat conftest.$ac_ext >&5
13503   rm -rf conftest*
13504   ol_cv_c_volatile=no
13505 fi
13506 rm -f conftest*
13507 fi
13508
13509 echo "$ac_t""$ol_cv_c_volatile" 1>&6
13510   if test $ol_cv_c_volatile = yes; then
13511     : 
13512   else
13513     cat >> confdefs.h <<\EOF
13514 #define volatile 
13515 EOF
13516
13517   fi
13518  
13519
13520 if test $cross_compiling = yes ; then
13521         cat >> confdefs.h <<\EOF
13522 #define CROSS_COMPILING 1
13523 EOF
13524
13525
13526         cat >> confdefs.h <<\EOF
13527 #define LBER_INT_T long
13528 EOF
13529
13530         cat >> confdefs.h <<\EOF
13531 #define LBER_TAG_T long
13532 EOF
13533
13534         cat >> confdefs.h <<\EOF
13535 #define LBER_SOCKET_T int
13536 EOF
13537
13538
13539 else
13540         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
13541 echo "configure:13542: checking whether byte ordering is bigendian" >&5
13542 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
13543   echo $ac_n "(cached) $ac_c" 1>&6
13544 else
13545   ac_cv_c_bigendian=unknown
13546 # See if sys/param.h defines the BYTE_ORDER macro.
13547 cat > conftest.$ac_ext <<EOF
13548 #line 13549 "configure"
13549 #include "confdefs.h"
13550 #include <sys/types.h>
13551 #include <sys/param.h>
13552 int main() {
13553
13554 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
13555  bogus endian macros
13556 #endif
13557 ; return 0; }
13558 EOF
13559 if { (eval echo configure:13560: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13560   rm -rf conftest*
13561   # It does; now see whether it defined to BIG_ENDIAN or not.
13562 cat > conftest.$ac_ext <<EOF
13563 #line 13564 "configure"
13564 #include "confdefs.h"
13565 #include <sys/types.h>
13566 #include <sys/param.h>
13567 int main() {
13568
13569 #if BYTE_ORDER != BIG_ENDIAN
13570  not big endian
13571 #endif
13572 ; return 0; }
13573 EOF
13574 if { (eval echo configure:13575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13575   rm -rf conftest*
13576   ac_cv_c_bigendian=yes
13577 else
13578   echo "configure: failed program was:" >&5
13579   cat conftest.$ac_ext >&5
13580   rm -rf conftest*
13581   ac_cv_c_bigendian=no
13582 fi
13583 rm -f conftest*
13584 else
13585   echo "configure: failed program was:" >&5
13586   cat conftest.$ac_ext >&5
13587 fi
13588 rm -f conftest*
13589 if test $ac_cv_c_bigendian = unknown; then
13590 if test "$cross_compiling" = yes; then
13591     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
13592 else
13593   cat > conftest.$ac_ext <<EOF
13594 #line 13595 "configure"
13595 #include "confdefs.h"
13596 main () {
13597   /* Are we little or big endian?  From Harbison&Steele.  */
13598   union
13599   {
13600     long l;
13601     char c[sizeof (long)];
13602   } u;
13603   u.l = 1;
13604   exit (u.c[sizeof (long) - 1] == 1);
13605 }
13606 EOF
13607 if { (eval echo configure:13608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13608 then
13609   ac_cv_c_bigendian=no
13610 else
13611   echo "configure: failed program was:" >&5
13612   cat conftest.$ac_ext >&5
13613   rm -fr conftest*
13614   ac_cv_c_bigendian=yes
13615 fi
13616 rm -fr conftest*
13617 fi
13618
13619 fi
13620 fi
13621
13622 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
13623 if test $ac_cv_c_bigendian = yes; then
13624   cat >> confdefs.h <<\EOF
13625 #define WORDS_BIGENDIAN 1
13626 EOF
13627
13628 fi
13629
13630         echo $ac_n "checking size of short""... $ac_c" 1>&6
13631 echo "configure:13632: checking size of short" >&5
13632 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
13633   echo $ac_n "(cached) $ac_c" 1>&6
13634 else
13635   if test "$cross_compiling" = yes; then
13636     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
13637 else
13638   cat > conftest.$ac_ext <<EOF
13639 #line 13640 "configure"
13640 #include "confdefs.h"
13641 #include <stdio.h>
13642 main()
13643 {
13644   FILE *f=fopen("conftestval", "w");
13645   if (!f) exit(1);
13646   fprintf(f, "%d\n", sizeof(short));
13647   exit(0);
13648 }
13649 EOF
13650 if { (eval echo configure:13651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13651 then
13652   ac_cv_sizeof_short=`cat conftestval`
13653 else
13654   echo "configure: failed program was:" >&5
13655   cat conftest.$ac_ext >&5
13656   rm -fr conftest*
13657   ac_cv_sizeof_short=0
13658 fi
13659 rm -fr conftest*
13660 fi
13661
13662 fi
13663 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
13664 cat >> confdefs.h <<EOF
13665 #define SIZEOF_SHORT $ac_cv_sizeof_short
13666 EOF
13667
13668  
13669         echo $ac_n "checking size of int""... $ac_c" 1>&6
13670 echo "configure:13671: checking size of int" >&5
13671 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
13672   echo $ac_n "(cached) $ac_c" 1>&6
13673 else
13674   if test "$cross_compiling" = yes; then
13675     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
13676 else
13677   cat > conftest.$ac_ext <<EOF
13678 #line 13679 "configure"
13679 #include "confdefs.h"
13680 #include <stdio.h>
13681 main()
13682 {
13683   FILE *f=fopen("conftestval", "w");
13684   if (!f) exit(1);
13685   fprintf(f, "%d\n", sizeof(int));
13686   exit(0);
13687 }
13688 EOF
13689 if { (eval echo configure:13690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13690 then
13691   ac_cv_sizeof_int=`cat conftestval`
13692 else
13693   echo "configure: failed program was:" >&5
13694   cat conftest.$ac_ext >&5
13695   rm -fr conftest*
13696   ac_cv_sizeof_int=0
13697 fi
13698 rm -fr conftest*
13699 fi
13700
13701 fi
13702 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
13703 cat >> confdefs.h <<EOF
13704 #define SIZEOF_INT $ac_cv_sizeof_int
13705 EOF
13706
13707  
13708         echo $ac_n "checking size of long""... $ac_c" 1>&6
13709 echo "configure:13710: checking size of long" >&5
13710 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
13711   echo $ac_n "(cached) $ac_c" 1>&6
13712 else
13713   if test "$cross_compiling" = yes; then
13714     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
13715 else
13716   cat > conftest.$ac_ext <<EOF
13717 #line 13718 "configure"
13718 #include "confdefs.h"
13719 #include <stdio.h>
13720 main()
13721 {
13722   FILE *f=fopen("conftestval", "w");
13723   if (!f) exit(1);
13724   fprintf(f, "%d\n", sizeof(long));
13725   exit(0);
13726 }
13727 EOF
13728 if { (eval echo configure:13729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13729 then
13730   ac_cv_sizeof_long=`cat conftestval`
13731 else
13732   echo "configure: failed program was:" >&5
13733   cat conftest.$ac_ext >&5
13734   rm -fr conftest*
13735   ac_cv_sizeof_long=0
13736 fi
13737 rm -fr conftest*
13738 fi
13739
13740 fi
13741 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
13742 cat >> confdefs.h <<EOF
13743 #define SIZEOF_LONG $ac_cv_sizeof_long
13744 EOF
13745
13746
13747
13748         if test "$ac_cv_sizeof_int" -lt 4 ; then
13749                 echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
13750
13751                 cat >> confdefs.h <<\EOF
13752 #define LBER_INT_T long
13753 EOF
13754
13755                 cat >> confdefs.h <<\EOF
13756 #define LBER_TAG_T long
13757 EOF
13758
13759                 cat >> confdefs.h <<\EOF
13760 #define LBER_SOCKET_T int
13761 EOF
13762
13763         else
13764                 cat >> confdefs.h <<\EOF
13765 #define LBER_INT_T int
13766 EOF
13767
13768                 cat >> confdefs.h <<\EOF
13769 #define LBER_TAG_T long
13770 EOF
13771
13772                 cat >> confdefs.h <<\EOF
13773 #define LBER_SOCKET_T int
13774 EOF
13775
13776         fi
13777 fi
13778
13779 cat >> confdefs.h <<\EOF
13780 #define LBER_LEN_T long
13781 EOF
13782
13783
13784 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
13785 echo "configure:13786: checking for 8-bit clean memcmp" >&5
13786 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
13787   echo $ac_n "(cached) $ac_c" 1>&6
13788 else
13789   if test "$cross_compiling" = yes; then
13790   ac_cv_func_memcmp_clean=no
13791 else
13792   cat > conftest.$ac_ext <<EOF
13793 #line 13794 "configure"
13794 #include "confdefs.h"
13795
13796 main()
13797 {
13798   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
13799   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
13800 }
13801
13802 EOF
13803 if { (eval echo configure:13804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13804 then
13805   ac_cv_func_memcmp_clean=yes
13806 else
13807   echo "configure: failed program was:" >&5
13808   cat conftest.$ac_ext >&5
13809   rm -fr conftest*
13810   ac_cv_func_memcmp_clean=no
13811 fi
13812 rm -fr conftest*
13813 fi
13814
13815 fi
13816
13817 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
13818 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
13819
13820 echo $ac_n "checking for strftime""... $ac_c" 1>&6
13821 echo "configure:13822: checking for strftime" >&5
13822 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
13823   echo $ac_n "(cached) $ac_c" 1>&6
13824 else
13825   cat > conftest.$ac_ext <<EOF
13826 #line 13827 "configure"
13827 #include "confdefs.h"
13828 /* System header to define __stub macros and hopefully few prototypes,
13829     which can conflict with char strftime(); below.  */
13830 #include <assert.h>
13831 /* Override any gcc2 internal prototype to avoid an error.  */
13832 /* We use char because int might match the return type of a gcc2
13833     builtin and then its argument prototype would still apply.  */
13834 char strftime();
13835 char (*f)();
13836
13837 int main() {
13838
13839 /* The GNU C library defines this for functions which it implements
13840     to always fail with ENOSYS.  Some functions are actually named
13841     something starting with __ and the normal name is an alias.  */
13842 #if defined (__stub_strftime) || defined (__stub___strftime)
13843 choke me
13844 #else
13845 f = strftime;
13846 #endif
13847
13848 ; return 0; }
13849 EOF
13850 if { (eval echo configure:13851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13851   rm -rf conftest*
13852   eval "ac_cv_func_strftime=yes"
13853 else
13854   echo "configure: failed program was:" >&5
13855   cat conftest.$ac_ext >&5
13856   rm -rf conftest*
13857   eval "ac_cv_func_strftime=no"
13858 fi
13859 rm -f conftest*
13860 fi
13861
13862 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
13863   echo "$ac_t""yes" 1>&6
13864   cat >> confdefs.h <<\EOF
13865 #define HAVE_STRFTIME 1
13866 EOF
13867
13868 else
13869   echo "$ac_t""no" 1>&6
13870 # strftime is in -lintl on SCO UNIX.
13871 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
13872 echo "configure:13873: checking for strftime in -lintl" >&5
13873 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
13874 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13875   echo $ac_n "(cached) $ac_c" 1>&6
13876 else
13877   ac_save_LIBS="$LIBS"
13878 LIBS="-lintl  $LIBS"
13879 cat > conftest.$ac_ext <<EOF
13880 #line 13881 "configure"
13881 #include "confdefs.h"
13882 /* Override any gcc2 internal prototype to avoid an error.  */
13883 /* We use char because int might match the return type of a gcc2
13884     builtin and then its argument prototype would still apply.  */
13885 char strftime();
13886
13887 int main() {
13888 strftime()
13889 ; return 0; }
13890 EOF
13891 if { (eval echo configure:13892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13892   rm -rf conftest*
13893   eval "ac_cv_lib_$ac_lib_var=yes"
13894 else
13895   echo "configure: failed program was:" >&5
13896   cat conftest.$ac_ext >&5
13897   rm -rf conftest*
13898   eval "ac_cv_lib_$ac_lib_var=no"
13899 fi
13900 rm -f conftest*
13901 LIBS="$ac_save_LIBS"
13902
13903 fi
13904 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13905   echo "$ac_t""yes" 1>&6
13906   cat >> confdefs.h <<\EOF
13907 #define HAVE_STRFTIME 1
13908 EOF
13909
13910 LIBS="-lintl $LIBS"
13911 else
13912   echo "$ac_t""no" 1>&6
13913 fi
13914
13915 fi
13916
13917
13918 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
13919 echo "configure:13920: checking for inet_aton()" >&5
13920 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
13921   echo $ac_n "(cached) $ac_c" 1>&6
13922 else
13923   cat > conftest.$ac_ext <<EOF
13924 #line 13925 "configure"
13925 #include "confdefs.h"
13926
13927 #ifdef HAVE_SYS_TYPES_H
13928 #       include <sys/types.h>
13929 #endif
13930 #ifdef HAVE_SYS_SOCKET_H
13931 #       include <sys/socket.h>
13932 #       ifdef HAVE_SYS_SELECT_H
13933 #               include <sys/select.h>
13934 #       endif
13935 #       include <netinet/in.h>
13936 #       ifdef HAVE_ARPA_INET_H
13937 #               include <arpa/inet.h>
13938 #       endif
13939 #endif
13940
13941 int main() {
13942 struct in_addr in;
13943 int rc = inet_aton( "255.255.255.255", &in );
13944 ; return 0; }
13945 EOF
13946 if { (eval echo configure:13947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13947   rm -rf conftest*
13948   ol_cv_func_inet_aton=yes
13949 else
13950   echo "configure: failed program was:" >&5
13951   cat conftest.$ac_ext >&5
13952   rm -rf conftest*
13953   ol_cv_func_inet_aton=no
13954 fi
13955 rm -f conftest*
13956 fi
13957
13958 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
13959   if test $ol_cv_func_inet_aton != no; then
13960     cat >> confdefs.h <<\EOF
13961 #define HAVE_INET_ATON 1
13962 EOF
13963
13964   fi
13965  
13966
13967 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
13968 echo "configure:13969: checking for vprintf" >&5
13969 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
13970   echo $ac_n "(cached) $ac_c" 1>&6
13971 else
13972   cat > conftest.$ac_ext <<EOF
13973 #line 13974 "configure"
13974 #include "confdefs.h"
13975 /* System header to define __stub macros and hopefully few prototypes,
13976     which can conflict with char vprintf(); below.  */
13977 #include <assert.h>
13978 /* Override any gcc2 internal prototype to avoid an error.  */
13979 /* We use char because int might match the return type of a gcc2
13980     builtin and then its argument prototype would still apply.  */
13981 char vprintf();
13982 char (*f)();
13983
13984 int main() {
13985
13986 /* The GNU C library defines this for functions which it implements
13987     to always fail with ENOSYS.  Some functions are actually named
13988     something starting with __ and the normal name is an alias.  */
13989 #if defined (__stub_vprintf) || defined (__stub___vprintf)
13990 choke me
13991 #else
13992 f = vprintf;
13993 #endif
13994
13995 ; return 0; }
13996 EOF
13997 if { (eval echo configure:13998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13998   rm -rf conftest*
13999   eval "ac_cv_func_vprintf=yes"
14000 else
14001   echo "configure: failed program was:" >&5
14002   cat conftest.$ac_ext >&5
14003   rm -rf conftest*
14004   eval "ac_cv_func_vprintf=no"
14005 fi
14006 rm -f conftest*
14007 fi
14008
14009 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
14010   echo "$ac_t""yes" 1>&6
14011   cat >> confdefs.h <<\EOF
14012 #define HAVE_VPRINTF 1
14013 EOF
14014
14015 else
14016   echo "$ac_t""no" 1>&6
14017 fi
14018
14019 if test "$ac_cv_func_vprintf" != yes; then
14020 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
14021 echo "configure:14022: checking for _doprnt" >&5
14022 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
14023   echo $ac_n "(cached) $ac_c" 1>&6
14024 else
14025   cat > conftest.$ac_ext <<EOF
14026 #line 14027 "configure"
14027 #include "confdefs.h"
14028 /* System header to define __stub macros and hopefully few prototypes,
14029     which can conflict with char _doprnt(); below.  */
14030 #include <assert.h>
14031 /* Override any gcc2 internal prototype to avoid an error.  */
14032 /* We use char because int might match the return type of a gcc2
14033     builtin and then its argument prototype would still apply.  */
14034 char _doprnt();
14035 char (*f)();
14036
14037 int main() {
14038
14039 /* The GNU C library defines this for functions which it implements
14040     to always fail with ENOSYS.  Some functions are actually named
14041     something starting with __ and the normal name is an alias.  */
14042 #if defined (__stub__doprnt) || defined (__stub____doprnt)
14043 choke me
14044 #else
14045 f = _doprnt;
14046 #endif
14047
14048 ; return 0; }
14049 EOF
14050 if { (eval echo configure:14051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14051   rm -rf conftest*
14052   eval "ac_cv_func__doprnt=yes"
14053 else
14054   echo "configure: failed program was:" >&5
14055   cat conftest.$ac_ext >&5
14056   rm -rf conftest*
14057   eval "ac_cv_func__doprnt=no"
14058 fi
14059 rm -f conftest*
14060 fi
14061
14062 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
14063   echo "$ac_t""yes" 1>&6
14064   cat >> confdefs.h <<\EOF
14065 #define HAVE_DOPRNT 1
14066 EOF
14067
14068 else
14069   echo "$ac_t""no" 1>&6
14070 fi
14071
14072 fi
14073
14074
14075 if test $ac_cv_func_vprintf = yes ; then
14076                 for ac_func in vsnprintf vsprintf
14077 do
14078 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14079 echo "configure:14080: checking for $ac_func" >&5
14080 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14081   echo $ac_n "(cached) $ac_c" 1>&6
14082 else
14083   cat > conftest.$ac_ext <<EOF
14084 #line 14085 "configure"
14085 #include "confdefs.h"
14086 /* System header to define __stub macros and hopefully few prototypes,
14087     which can conflict with char $ac_func(); below.  */
14088 #include <assert.h>
14089 /* Override any gcc2 internal prototype to avoid an error.  */
14090 /* We use char because int might match the return type of a gcc2
14091     builtin and then its argument prototype would still apply.  */
14092 char $ac_func();
14093 char (*f)();
14094
14095 int main() {
14096
14097 /* The GNU C library defines this for functions which it implements
14098     to always fail with ENOSYS.  Some functions are actually named
14099     something starting with __ and the normal name is an alias.  */
14100 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14101 choke me
14102 #else
14103 f = $ac_func;
14104 #endif
14105
14106 ; return 0; }
14107 EOF
14108 if { (eval echo configure:14109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14109   rm -rf conftest*
14110   eval "ac_cv_func_$ac_func=yes"
14111 else
14112   echo "configure: failed program was:" >&5
14113   cat conftest.$ac_ext >&5
14114   rm -rf conftest*
14115   eval "ac_cv_func_$ac_func=no"
14116 fi
14117 rm -f conftest*
14118 fi
14119
14120 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14121   echo "$ac_t""yes" 1>&6
14122     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14123   cat >> confdefs.h <<EOF
14124 #define $ac_tr_func 1
14125 EOF
14126  
14127 else
14128   echo "$ac_t""no" 1>&6
14129 fi
14130 done
14131
14132 fi
14133
14134 for ac_func in \
14135         bcopy                   \
14136         closesocket             \
14137         endgrent                \
14138         endpwent                \
14139         flock                   \
14140         getdtablesize   \
14141         getgrgid                \
14142         gethostname             \
14143         getpass                 \
14144         getpwuid                \
14145         getpwnam                \
14146         getspnam                \
14147         gettimeofday    \
14148         initgroups              \
14149         lockf                   \
14150         memcpy                  \
14151         memmove                 \
14152         mkstemp                 \
14153         read                    \
14154         recv                    \
14155         recvfrom                \
14156         setpwfile               \
14157         setgid                  \
14158         setegid                 \
14159         setsid                  \
14160         setuid                  \
14161         seteuid                 \
14162         sigaction               \
14163         signal                  \
14164         sigset                  \
14165         snprintf                \
14166         strdup                  \
14167         strerror                \
14168         strpbrk                 \
14169         strrchr                 \
14170         strsep                  \
14171         strstr                  \
14172         strtol                  \
14173         strtoul                 \
14174         strspn                  \
14175         sysconf                 \
14176         waitpid                 \
14177         wait4                   \
14178         write                   \
14179         send                    \
14180         sendto                  \
14181
14182 do
14183 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14184 echo "configure:14185: checking for $ac_func" >&5
14185 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14186   echo $ac_n "(cached) $ac_c" 1>&6
14187 else
14188   cat > conftest.$ac_ext <<EOF
14189 #line 14190 "configure"
14190 #include "confdefs.h"
14191 /* System header to define __stub macros and hopefully few prototypes,
14192     which can conflict with char $ac_func(); below.  */
14193 #include <assert.h>
14194 /* Override any gcc2 internal prototype to avoid an error.  */
14195 /* We use char because int might match the return type of a gcc2
14196     builtin and then its argument prototype would still apply.  */
14197 char $ac_func();
14198 char (*f)();
14199
14200 int main() {
14201
14202 /* The GNU C library defines this for functions which it implements
14203     to always fail with ENOSYS.  Some functions are actually named
14204     something starting with __ and the normal name is an alias.  */
14205 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14206 choke me
14207 #else
14208 f = $ac_func;
14209 #endif
14210
14211 ; return 0; }
14212 EOF
14213 if { (eval echo configure:14214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14214   rm -rf conftest*
14215   eval "ac_cv_func_$ac_func=yes"
14216 else
14217   echo "configure: failed program was:" >&5
14218   cat conftest.$ac_ext >&5
14219   rm -rf conftest*
14220   eval "ac_cv_func_$ac_func=no"
14221 fi
14222 rm -f conftest*
14223 fi
14224
14225 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14226   echo "$ac_t""yes" 1>&6
14227     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14228   cat >> confdefs.h <<EOF
14229 #define $ac_tr_func 1
14230 EOF
14231  
14232 else
14233   echo "$ac_t""no" 1>&6
14234 fi
14235 done
14236
14237
14238 for ac_func in getopt tempnam
14239 do
14240 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14241 echo "configure:14242: checking for $ac_func" >&5
14242 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14243   echo $ac_n "(cached) $ac_c" 1>&6
14244 else
14245   cat > conftest.$ac_ext <<EOF
14246 #line 14247 "configure"
14247 #include "confdefs.h"
14248 /* System header to define __stub macros and hopefully few prototypes,
14249     which can conflict with char $ac_func(); below.  */
14250 #include <assert.h>
14251 /* Override any gcc2 internal prototype to avoid an error.  */
14252 /* We use char because int might match the return type of a gcc2
14253     builtin and then its argument prototype would still apply.  */
14254 char $ac_func();
14255 char (*f)();
14256
14257 int main() {
14258
14259 /* The GNU C library defines this for functions which it implements
14260     to always fail with ENOSYS.  Some functions are actually named
14261     something starting with __ and the normal name is an alias.  */
14262 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14263 choke me
14264 #else
14265 f = $ac_func;
14266 #endif
14267
14268 ; return 0; }
14269 EOF
14270 if { (eval echo configure:14271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14271   rm -rf conftest*
14272   eval "ac_cv_func_$ac_func=yes"
14273 else
14274   echo "configure: failed program was:" >&5
14275   cat conftest.$ac_ext >&5
14276   rm -rf conftest*
14277   eval "ac_cv_func_$ac_func=no"
14278 fi
14279 rm -f conftest*
14280 fi
14281
14282 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14283   echo "$ac_t""yes" 1>&6
14284     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14285   cat >> confdefs.h <<EOF
14286 #define $ac_tr_func 1
14287 EOF
14288  
14289 else
14290   echo "$ac_t""no" 1>&6
14291 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
14292 fi
14293 done
14294
14295
14296
14297 # Check Configuration
14298 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
14299 echo "configure:14300: checking declaration of sys_errlist" >&5
14300 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
14301   echo $ac_n "(cached) $ac_c" 1>&6
14302 else
14303   
14304         cat > conftest.$ac_ext <<EOF
14305 #line 14306 "configure"
14306 #include "confdefs.h"
14307
14308 #include <stdio.h>
14309 #include <sys/types.h>
14310 #include <errno.h> 
14311 int main() {
14312 char *c = (char *) *sys_errlist
14313 ; return 0; }
14314 EOF
14315 if { (eval echo configure:14316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14316   rm -rf conftest*
14317   ol_cv_dcl_sys_errlist=yes
14318         ol_cv_have_sys_errlist=yes
14319 else
14320   echo "configure: failed program was:" >&5
14321   cat conftest.$ac_ext >&5
14322   rm -rf conftest*
14323   ol_cv_dcl_sys_errlist=no
14324 fi
14325 rm -f conftest*
14326 fi
14327
14328 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
14329 #
14330 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
14331 if test $ol_cv_dcl_sys_errlist = no ; then
14332         cat >> confdefs.h <<\EOF
14333 #define DECL_SYS_ERRLIST 1
14334 EOF
14335
14336
14337         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
14338 echo "configure:14339: checking existence of sys_errlist" >&5
14339 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
14340   echo $ac_n "(cached) $ac_c" 1>&6
14341 else
14342   
14343                 cat > conftest.$ac_ext <<EOF
14344 #line 14345 "configure"
14345 #include "confdefs.h"
14346 #include <errno.h>
14347 int main() {
14348 char *c = (char *) *sys_errlist
14349 ; return 0; }
14350 EOF
14351 if { (eval echo configure:14352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14352   rm -rf conftest*
14353   ol_cv_have_sys_errlist=yes
14354 else
14355   echo "configure: failed program was:" >&5
14356   cat conftest.$ac_ext >&5
14357   rm -rf conftest*
14358   ol_cv_have_sys_errlist=no
14359 fi
14360 rm -f conftest*
14361 fi
14362
14363 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
14364 fi
14365 if test $ol_cv_have_sys_errlist = yes ; then
14366         cat >> confdefs.h <<\EOF
14367 #define HAVE_SYS_ERRLIST 1
14368 EOF
14369
14370 fi
14371
14372
14373
14374 if test "$ol_enable_debug" != no ; then
14375         cat >> confdefs.h <<\EOF
14376 #define LDAP_DEBUG 1
14377 EOF
14378
14379 fi
14380 if test "$ol_enable_syslog" = yes ; then
14381         cat >> confdefs.h <<\EOF
14382 #define LDAP_SYSLOG 1
14383 EOF
14384
14385 fi
14386 if test "$ol_enable_libui" = yes ; then
14387         cat >> confdefs.h <<\EOF
14388 #define LDAP_LIBUI 1
14389 EOF
14390
14391 fi
14392 if test "$ol_enable_cache" = no ; then
14393         cat >> confdefs.h <<\EOF
14394 #define LDAP_NOCACHE 1
14395 EOF
14396
14397 fi
14398 if test "$ol_enable_dns" != no ; then
14399         cat >> confdefs.h <<\EOF
14400 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS LDAP_VENDOR_VERSION
14401 EOF
14402
14403 fi
14404 if test "$ol_enable_proctitle" != no ; then
14405         cat >> confdefs.h <<\EOF
14406 #define LDAP_PROCTITLE 1
14407 EOF
14408
14409 fi
14410 if test "$ol_enable_referrals" != no ; then
14411         cat >> confdefs.h <<\EOF
14412 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
14413 EOF
14414
14415 fi
14416 if test "$ol_enable_cldap" != no ; then
14417         cat >> confdefs.h <<\EOF
14418 #define LDAP_CONNECTIONLESS 1
14419 EOF
14420
14421 fi
14422
14423 if test "$ol_enable_crypt" != no ; then
14424         cat >> confdefs.h <<\EOF
14425 #define SLAPD_CRYPT 1
14426 EOF
14427
14428 fi
14429 if test "$ol_enable_cleartext" != no ; then
14430         cat >> confdefs.h <<\EOF
14431 #define SLAPD_CLEARTEXT 1
14432 EOF
14433
14434 fi
14435 if test "$ol_enable_multimaster" != no ; then
14436         cat >> confdefs.h <<\EOF
14437 #define SLAPD_MULTIMASTER 1
14438 EOF
14439
14440 fi
14441 if test "$ol_enable_phonetic" != no ; then
14442         cat >> confdefs.h <<\EOF
14443 #define SLAPD_PHONETIC 1
14444 EOF
14445
14446 fi
14447 if test "$ol_enable_rlookups" != no ; then
14448         cat >> confdefs.h <<\EOF
14449 #define SLAPD_RLOOKUPS 1
14450 EOF
14451
14452 fi
14453 if test "$ol_enable_aci" != no ; then
14454         cat >> confdefs.h <<\EOF
14455 #define SLAPD_ACI_ENABLED 1
14456 EOF
14457
14458 fi
14459 if test "$ol_enable_discreteaci" != no ; then
14460         cat >> confdefs.h <<\EOF
14461 #define SLAPD_ACI_DISCRETE_RIGHTS 1
14462 EOF
14463
14464 fi
14465
14466 if test "$ol_link_modules" != no ; then
14467         cat >> confdefs.h <<\EOF
14468 #define SLAPD_MODULES 1
14469 EOF
14470
14471         BUILD_SLAPD=yes
14472         MODULES_LIBS=-lltdl
14473         SLAPD_MODULES_LDFLAGS="-dlopen self"
14474 fi
14475
14476 if test "$ol_link_bdb2" != no ; then
14477         cat >> confdefs.h <<\EOF
14478 #define SLAPD_BDB2 1
14479 EOF
14480
14481         BUILD_SLAPD=yes
14482         BUILD_BDB2=yes
14483         if test "$ol_with_bdb2_module" != static ; then
14484                 cat >> confdefs.h <<\EOF
14485 #define SLAPD_BDB2_DYNAMIC 1
14486 EOF
14487
14488                 BUILD_BDB2=mod
14489                 BUILD_BDB2_DYNAMIC=shared
14490                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-bdb2/back_bdb2.la"
14491         fi
14492 fi
14493
14494 if test "$ol_enable_ldap" != no ; then
14495         cat >> confdefs.h <<\EOF
14496 #define SLAPD_LDAP 1
14497 EOF
14498
14499         BUILD_SLAPD=yes
14500         BUILD_LDAP=yes
14501         if test "$ol_with_ldap_module" != static ; then
14502                 cat >> confdefs.h <<\EOF
14503 #define SLAPD_LDAP_DYNAMIC 1
14504 EOF
14505
14506                 BUILD_LDAP=mod
14507                 BUILD_LDAP_DYNAMIC=shared
14508                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
14509         fi
14510 fi
14511
14512 if test "$ol_link_ldbm" != no ; then
14513         cat >> confdefs.h <<\EOF
14514 #define SLAPD_LDBM 1
14515 EOF
14516
14517         BUILD_SLAPD=yes
14518         BUILD_LDBM=yes
14519         if test "$ol_with_ldbm_module" != static ; then
14520                 cat >> confdefs.h <<\EOF
14521 #define SLAPD_LDBM_DYNAMIC 1
14522 EOF
14523
14524                 BUILD_LDBM=mod
14525                 BUILD_LDBM_DYNAMIC=shared
14526                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
14527         fi
14528 fi
14529
14530 if test "$ol_enable_passwd" != no ; then
14531         cat >> confdefs.h <<\EOF
14532 #define SLAPD_PASSWD 1
14533 EOF
14534
14535         BUILD_SLAPD=yes
14536         BUILD_PASSWD=yes
14537         if test "$ol_with_passwd_module" != static ; then
14538                 cat >> confdefs.h <<\EOF
14539 #define SLAPD_PASSWD_DYNAMIC 1
14540 EOF
14541
14542                 BUILD_PASSWD=mod
14543                 BUILD_PASSWD_DYNAMIC=shared
14544                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
14545         fi
14546 fi
14547
14548 if test "$ol_link_perl" != no ; then
14549         cat >> confdefs.h <<\EOF
14550 #define SLAPD_PERL 1
14551 EOF
14552
14553         BUILD_SLAPD=yes
14554         BUILD_PERL=yes
14555         if test "$ol_with_perl_module" != static ; then
14556                 cat >> confdefs.h <<\EOF
14557 #define SLAPD_PERL_DYNAMIC 1
14558 EOF
14559
14560                 BUILD_PERL=mod
14561                 BUILD_PERL_DYNAMIC=shared
14562                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-perl/back_perl.la"
14563         fi
14564 fi
14565
14566 if test "$ol_enable_shell" != no ; then
14567         cat >> confdefs.h <<\EOF
14568 #define SLAPD_SHELL 1
14569 EOF
14570
14571         BUILD_SLAPD=yes
14572         BUILD_SHELL=yes
14573         if test "$ol_with_shell_module" != static ; then
14574                 cat >> confdefs.h <<\EOF
14575 #define SLAPD_SHELL_DYNAMIC 1
14576 EOF
14577
14578                 BUILD_SHELL=mod
14579                 BUILD_SHELL_DYNAMIC=shared
14580                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
14581         fi
14582 fi
14583
14584 if test "$ol_enable_tcl" != no ; then
14585         cat >> confdefs.h <<\EOF
14586 #define SLAPD_TCL 1
14587 EOF
14588
14589         BUILD_SLAPD=yes
14590         BUILD_TCL=yes
14591         if test "$ol_with_tcl_module" != static; then
14592                 cat >> confdefs.h <<\EOF
14593 #define SLAPD_TCL_DYNAMIC 1
14594 EOF
14595
14596                 BUILD_TCL=mod
14597                 BUILD_TCL_DYNAMIC=shared
14598                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-tcl/back_tcl.la"
14599         fi
14600 fi
14601
14602 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
14603         $BUILD_SLAPD = yes ; then
14604         BUILD_SLURPD=yes
14605 fi
14606
14607 if test "$ol_link_isode" != no ; then
14608         BUILD_LDAPD=yes
14609 fi
14610
14611
14612
14613
14614   
14615   
14616   
14617   
14618   
14619   
14620   
14621   
14622   
14623   
14624   
14625   
14626   
14627   
14628   
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655 trap '' 1 2 15
14656
14657 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
14658
14659 test "x$prefix" = xNONE && prefix=$ac_default_prefix
14660 # Let make expand exec_prefix.
14661 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
14662
14663 # Any assignment to VPATH causes Sun make to only execute
14664 # the first set of double-colon rules, so remove it if not needed.
14665 # If there is a colon in the path, we need to keep it.
14666 if test "x$srcdir" = x.; then
14667   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
14668 fi
14669
14670 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
14671
14672 DEFS=-DHAVE_CONFIG_H
14673
14674 # Without the "./", some shells look in PATH for config.status.
14675 : ${CONFIG_STATUS=./config.status}
14676
14677 echo creating $CONFIG_STATUS
14678 rm -f $CONFIG_STATUS
14679 cat > $CONFIG_STATUS <<EOF
14680 #! /bin/sh
14681 # Generated automatically by configure.
14682 # Run this file to recreate the current configuration.
14683 # This directory was configured as follows,
14684 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
14685 #
14686 # $0 $ac_configure_args
14687 #
14688 # Compiler output produced by configure, useful for debugging
14689 # configure, is in ./config.log if it exists.
14690
14691 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
14692 for ac_option
14693 do
14694   case "\$ac_option" in
14695   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
14696     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
14697     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
14698   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
14699     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
14700     exit 0 ;;
14701   -help | --help | --hel | --he | --h)
14702     echo "\$ac_cs_usage"; exit 0 ;;
14703   *) echo "\$ac_cs_usage"; exit 1 ;;
14704   esac
14705 done
14706
14707 ac_given_srcdir=$srcdir
14708 ac_given_INSTALL="$INSTALL"
14709
14710 trap 'rm -fr `echo "\
14711 Makefile:build/top.mk:Makefile.in:build/dir.mk \
14712 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
14713 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
14714 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
14715 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
14716 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
14717 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
14718 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
14719 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
14720 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
14721 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
14722 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
14723 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
14724 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
14725 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
14726 include/Makefile:build/top.mk:include/Makefile.in \
14727 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
14728 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
14729 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
14730 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
14731 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
14732 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
14733 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
14734 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
14735 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
14736 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
14737 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
14738 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/mod.mk \
14739 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
14740 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
14741 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
14742 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
14743 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
14744 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
14745 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
14746 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
14747 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
14748 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
14749 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
14750 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
14751 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
14752 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
14753  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
14754 EOF
14755 cat >> $CONFIG_STATUS <<EOF
14756
14757 # Protect against being on the right side of a sed subst in config.status.
14758 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
14759  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
14760 $ac_vpsub
14761 $extrasub
14762 s%@SHELL@%$SHELL%g
14763 s%@CFLAGS@%$CFLAGS%g
14764 s%@CPPFLAGS@%$CPPFLAGS%g
14765 s%@CXXFLAGS@%$CXXFLAGS%g
14766 s%@FFLAGS@%$FFLAGS%g
14767 s%@DEFS@%$DEFS%g
14768 s%@LDFLAGS@%$LDFLAGS%g
14769 s%@LIBS@%$LIBS%g
14770 s%@exec_prefix@%$exec_prefix%g
14771 s%@prefix@%$prefix%g
14772 s%@program_transform_name@%$program_transform_name%g
14773 s%@bindir@%$bindir%g
14774 s%@sbindir@%$sbindir%g
14775 s%@libexecdir@%$libexecdir%g
14776 s%@datadir@%$datadir%g
14777 s%@sysconfdir@%$sysconfdir%g
14778 s%@sharedstatedir@%$sharedstatedir%g
14779 s%@localstatedir@%$localstatedir%g
14780 s%@libdir@%$libdir%g
14781 s%@includedir@%$includedir%g
14782 s%@oldincludedir@%$oldincludedir%g
14783 s%@infodir@%$infodir%g
14784 s%@mandir@%$mandir%g
14785 s%@host@%$host%g
14786 s%@host_alias@%$host_alias%g
14787 s%@host_cpu@%$host_cpu%g
14788 s%@host_vendor@%$host_vendor%g
14789 s%@host_os@%$host_os%g
14790 s%@target@%$target%g
14791 s%@target_alias@%$target_alias%g
14792 s%@target_cpu@%$target_cpu%g
14793 s%@target_vendor@%$target_vendor%g
14794 s%@target_os@%$target_os%g
14795 s%@build@%$build%g
14796 s%@build_alias@%$build_alias%g
14797 s%@build_cpu@%$build_cpu%g
14798 s%@build_vendor@%$build_vendor%g
14799 s%@build_os@%$build_os%g
14800 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
14801 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
14802 s%@INSTALL_DATA@%$INSTALL_DATA%g
14803 s%@PACKAGE@%$PACKAGE%g
14804 s%@VERSION@%$VERSION%g
14805 s%@ACLOCAL@%$ACLOCAL%g
14806 s%@AUTOCONF@%$AUTOCONF%g
14807 s%@AUTOMAKE@%$AUTOMAKE%g
14808 s%@AUTOHEADER@%$AUTOHEADER%g
14809 s%@MAKEINFO@%$MAKEINFO%g
14810 s%@install_sh@%$install_sh%g
14811 s%@AMTAR@%$AMTAR%g
14812 s%@AWK@%$AWK%g
14813 s%@AMTARFLAGS@%$AMTARFLAGS%g
14814 s%@SET_MAKE@%$SET_MAKE%g
14815 s%@top_builddir@%$top_builddir%g
14816 s%@ldap_subdir@%$ldap_subdir%g
14817 s%@CC@%$CC%g
14818 s%@RANLIB@%$RANLIB%g
14819 s%@LD@%$LD%g
14820 s%@NM@%$NM%g
14821 s%@LN_S@%$LN_S%g
14822 s%@LIBTOOL@%$LIBTOOL%g
14823 s%@LN_H@%$LN_H%g
14824 s%@SENDMAIL@%$SENDMAIL%g
14825 s%@EDITOR@%$EDITOR%g
14826 s%@FINGER@%$FINGER%g
14827 s%@PERLBIN@%$PERLBIN%g
14828 s%@CPP@%$CPP%g
14829 s%@EXEEXT@%$EXEEXT%g
14830 s%@OBJEXT@%$OBJEXT%g
14831 s%@OL_MKDEP@%$OL_MKDEP%g
14832 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
14833 s%@PEPSY@%$PEPSY%g
14834 s%@LIBOBJS@%$LIBOBJS%g
14835 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
14836 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
14837 s%@BUILD_BDB2@%$BUILD_BDB2%g
14838 s%@BUILD_LDAP@%$BUILD_LDAP%g
14839 s%@BUILD_LDBM@%$BUILD_LDBM%g
14840 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
14841 s%@BUILD_PERL@%$BUILD_PERL%g
14842 s%@BUILD_QUIPU@%$BUILD_QUIPU%g
14843 s%@BUILD_SHELL@%$BUILD_SHELL%g
14844 s%@BUILD_TCL@%$BUILD_TCL%g
14845 s%@BUILD_BDB2_DYNAMIC@%$BUILD_BDB2_DYNAMIC%g
14846 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
14847 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
14848 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
14849 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
14850 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
14851 s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
14852 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
14853 s%@LDAP_LIBS@%$LDAP_LIBS%g
14854 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
14855 s%@LDIF_LIBS@%$LDIF_LIBS%g
14856 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
14857 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
14858 s%@LDBM_LIBS@%$LDBM_LIBS%g
14859 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
14860 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
14861 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
14862 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
14863 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
14864 s%@SLAPD_PERL_CPPFLAGS@%$SLAPD_PERL_CPPFLAGS%g
14865 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
14866 s%@KRB_LIBS@%$KRB_LIBS%g
14867 s%@READLINE_LIBS@%$READLINE_LIBS%g
14868 s%@SASL_LIBS@%$SASL_LIBS%g
14869 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
14870 s%@TLS_LIBS@%$TLS_LIBS%g
14871 s%@MODULES_LIBS@%$MODULES_LIBS%g
14872
14873 CEOF
14874 EOF
14875
14876 cat >> $CONFIG_STATUS <<\EOF
14877
14878 # Split the substitutions into bite-sized pieces for seds with
14879 # small command number limits, like on Digital OSF/1 and HP-UX.
14880 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
14881 ac_file=1 # Number of current file.
14882 ac_beg=1 # First line for current file.
14883 ac_end=$ac_max_sed_cmds # Line after last line for current file.
14884 ac_more_lines=:
14885 ac_sed_cmds=""
14886 while $ac_more_lines; do
14887   if test $ac_beg -gt 1; then
14888     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
14889   else
14890     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
14891   fi
14892   if test ! -s conftest.s$ac_file; then
14893     ac_more_lines=false
14894     rm -f conftest.s$ac_file
14895   else
14896     if test -z "$ac_sed_cmds"; then
14897       ac_sed_cmds="sed -f conftest.s$ac_file"
14898     else
14899       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
14900     fi
14901     ac_file=`expr $ac_file + 1`
14902     ac_beg=$ac_end
14903     ac_end=`expr $ac_end + $ac_max_sed_cmds`
14904   fi
14905 done
14906 if test -z "$ac_sed_cmds"; then
14907   ac_sed_cmds=cat
14908 fi
14909 EOF
14910
14911 cat >> $CONFIG_STATUS <<EOF
14912
14913 CONFIG_FILES=\${CONFIG_FILES-"\
14914 Makefile:build/top.mk:Makefile.in:build/dir.mk \
14915 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
14916 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
14917 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
14918 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
14919 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
14920 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
14921 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
14922 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
14923 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
14924 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
14925 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
14926 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
14927 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
14928 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
14929 include/Makefile:build/top.mk:include/Makefile.in \
14930 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
14931 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
14932 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
14933 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
14934 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
14935 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
14936 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
14937 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
14938 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
14939 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
14940 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
14941 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/mod.mk \
14942 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
14943 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
14944 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
14945 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
14946 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
14947 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
14948 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
14949 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
14950 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
14951 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
14952 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
14953 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
14954 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
14955 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
14956 "}
14957 EOF
14958 cat >> $CONFIG_STATUS <<\EOF
14959 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
14960   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
14961   case "$ac_file" in
14962   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
14963        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
14964   *) ac_file_in="${ac_file}.in" ;;
14965   esac
14966
14967   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
14968
14969   # Remove last slash and all that follows it.  Not all systems have dirname.
14970   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
14971   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
14972     # The file is in a subdirectory.
14973     test ! -d "$ac_dir" && mkdir "$ac_dir"
14974     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
14975     # A "../" for each directory in $ac_dir_suffix.
14976     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
14977   else
14978     ac_dir_suffix= ac_dots=
14979   fi
14980
14981   case "$ac_given_srcdir" in
14982   .)  srcdir=.
14983       if test -z "$ac_dots"; then top_srcdir=.
14984       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
14985   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
14986   *) # Relative path.
14987     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
14988     top_srcdir="$ac_dots$ac_given_srcdir" ;;
14989   esac
14990
14991   case "$ac_given_INSTALL" in
14992   [/$]*) INSTALL="$ac_given_INSTALL" ;;
14993   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
14994   esac
14995
14996   echo creating "$ac_file"
14997   rm -f "$ac_file"
14998   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
14999   case "$ac_file" in
15000   *Makefile*) ac_comsub="1i\\
15001 # $configure_input" ;;
15002   *) ac_comsub= ;;
15003   esac
15004
15005   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
15006   sed -e "$ac_comsub
15007 s%@configure_input@%$configure_input%g
15008 s%@srcdir@%$srcdir%g
15009 s%@top_srcdir@%$top_srcdir%g
15010 s%@INSTALL@%$INSTALL%g
15011 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
15012 fi; done
15013 rm -f conftest.s*
15014
15015 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
15016 # NAME is the cpp macro being defined and VALUE is the value it is being given.
15017 #
15018 # ac_d sets the value in "#define NAME VALUE" lines.
15019 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
15020 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
15021 ac_dC='\3'
15022 ac_dD='%g'
15023 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
15024 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15025 ac_uB='\([      ]\)%\1#\2define\3'
15026 ac_uC=' '
15027 ac_uD='\4%g'
15028 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
15029 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15030 ac_eB='$%\1#\2define\3'
15031 ac_eC=' '
15032 ac_eD='%g'
15033
15034 if test "${CONFIG_HEADERS+set}" != set; then
15035 EOF
15036 cat >> $CONFIG_STATUS <<EOF
15037   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
15038 EOF
15039 cat >> $CONFIG_STATUS <<\EOF
15040 fi
15041 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
15042   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15043   case "$ac_file" in
15044   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
15045        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
15046   *) ac_file_in="${ac_file}.in" ;;
15047   esac
15048
15049   echo creating $ac_file
15050
15051   rm -f conftest.frag conftest.in conftest.out
15052   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
15053   cat $ac_file_inputs > conftest.in
15054
15055 EOF
15056
15057 # Transform confdefs.h into a sed script conftest.vals that substitutes
15058 # the proper values into config.h.in to produce config.h.  And first:
15059 # Protect against being on the right side of a sed subst in config.status.
15060 # Protect against being in an unquoted here document in config.status.
15061 rm -f conftest.vals
15062 cat > conftest.hdr <<\EOF
15063 s/[\\&%]/\\&/g
15064 s%[\\$`]%\\&%g
15065 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
15066 s%ac_d%ac_u%gp
15067 s%ac_u%ac_e%gp
15068 EOF
15069 sed -n -f conftest.hdr confdefs.h > conftest.vals
15070 rm -f conftest.hdr
15071
15072 # This sed command replaces #undef with comments.  This is necessary, for
15073 # example, in the case of _POSIX_SOURCE, which is predefined and required
15074 # on some systems where configure will not decide to define it.
15075 cat >> conftest.vals <<\EOF
15076 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
15077 EOF
15078
15079 # Break up conftest.vals because some shells have a limit on
15080 # the size of here documents, and old seds have small limits too.
15081
15082 rm -f conftest.tail
15083 while :
15084 do
15085   ac_lines=`grep -c . conftest.vals`
15086   # grep -c gives empty output for an empty file on some AIX systems.
15087   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
15088   # Write a limited-size here document to conftest.frag.
15089   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
15090   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
15091   echo 'CEOF
15092   sed -f conftest.frag conftest.in > conftest.out
15093   rm -f conftest.in
15094   mv conftest.out conftest.in
15095 ' >> $CONFIG_STATUS
15096   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
15097   rm -f conftest.vals
15098   mv conftest.tail conftest.vals
15099 done
15100 rm -f conftest.vals
15101
15102 cat >> $CONFIG_STATUS <<\EOF
15103   rm -f conftest.frag conftest.h
15104   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
15105   cat conftest.in >> conftest.h
15106   rm -f conftest.in
15107   if cmp -s $ac_file conftest.h 2>/dev/null; then
15108     echo "$ac_file is unchanged"
15109     rm -f conftest.h
15110   else
15111     # Remove last slash and all that follows it.  Not all systems have dirname.
15112       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
15113       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15114       # The file is in a subdirectory.
15115       test ! -d "$ac_dir" && mkdir "$ac_dir"
15116     fi
15117     rm -f $ac_file
15118     mv conftest.h $ac_file
15119   fi
15120 fi; done
15121
15122 EOF
15123 cat >> $CONFIG_STATUS <<EOF
15124
15125 EOF
15126 cat >> $CONFIG_STATUS <<\EOF
15127
15128 date > stamp-h
15129 echo Please \"make depend\" to build dependencies
15130
15131 exit 0
15132 EOF
15133 chmod +x $CONFIG_STATUS
15134 rm -fr confdefs* $ac_clean_files
15135 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
15136