]> git.sur5r.net Git - openldap/blob - configure
Generate OpenLDAP id for configure
[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 OPENLDAP_ID="$OpenLDAP$"
646
647 OL_VERSION=`cat $ac_aux_dir/version`
648 if test -z "$OL_VERSION"; then
649         { echo "configure: error: could not determine version" 1>&2; exit 1; }
650 fi
651
652
653 echo $ac_n "checking host system type""... $ac_c" 1>&6
654 echo "configure:655: checking host system type" >&5
655 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
656
657 # Make sure we can run config.sub.
658   if $ac_config_sub sun4 >/dev/null 2>&1; then :
659     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
660   fi
661
662   ac_cv_host_alias=$host
663   case "$ac_cv_host_alias" in
664   NONE)
665     case $nonopt in
666     NONE)
667       if ac_cv_host_alias=`$ac_config_guess`; then :
668       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
669       fi ;;
670     *) ac_cv_host_alias=$nonopt ;;
671     esac ;;
672   esac
673
674   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
675   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
676   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
677   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
678 else
679   echo $ac_n "(cached) $ac_c" 1>&6
680 fi
681
682 echo "$ac_t""$ac_cv_host" 1>&6
683
684 host=$ac_cv_host
685 host_alias=$ac_cv_host_alias
686 host_cpu=$ac_cv_host_cpu
687 host_vendor=$ac_cv_host_vendor
688 host_os=$ac_cv_host_os
689
690
691
692
693
694 echo $ac_n "checking target system type""... $ac_c" 1>&6
695 echo "configure:696: checking target system type" >&5
696 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
697
698 # Make sure we can run config.sub.
699   if $ac_config_sub sun4 >/dev/null 2>&1; then :
700     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
701   fi
702
703   ac_cv_target_alias=$target
704   case "$ac_cv_target_alias" in
705   NONE)
706     case $nonopt in
707     NONE)
708       ac_cv_target_alias=$host_alias ;;
709
710     *) ac_cv_target_alias=$nonopt ;;
711     esac ;;
712   esac
713
714   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
715   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
716   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
717   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
718 else
719   echo $ac_n "(cached) $ac_c" 1>&6
720 fi
721
722 echo "$ac_t""$ac_cv_target" 1>&6
723
724 target=$ac_cv_target
725 target_alias=$ac_cv_target_alias
726 target_cpu=$ac_cv_target_cpu
727 target_vendor=$ac_cv_target_vendor
728 target_os=$ac_cv_target_os
729
730
731
732
733
734 echo $ac_n "checking build system type""... $ac_c" 1>&6
735 echo "configure:736: checking build system type" >&5
736 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
737
738 # Make sure we can run config.sub.
739   if $ac_config_sub sun4 >/dev/null 2>&1; then :
740     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
741   fi
742
743   ac_cv_build_alias=$build
744   case "$ac_cv_build_alias" in
745   NONE)
746     case $nonopt in
747     NONE)
748       ac_cv_build_alias=$host_alias ;;
749
750     *) ac_cv_build_alias=$nonopt ;;
751     esac ;;
752   esac
753
754   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
755   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
756   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
757   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
758 else
759   echo $ac_n "(cached) $ac_c" 1>&6
760 fi
761
762 echo "$ac_t""$ac_cv_build" 1>&6
763
764 build=$ac_cv_build
765 build_alias=$ac_cv_build_alias
766 build_cpu=$ac_cv_build_cpu
767 build_vendor=$ac_cv_build_vendor
768 build_os=$ac_cv_build_os
769
770
771
772
773
774 # Do some error checking and defaulting for the host and target type.
775 # The inputs are:
776 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
777 #
778 # The rules are:
779 # 1. You are not allowed to specify --host, --target, and nonopt at the
780 #    same time.
781 # 2. Host defaults to nonopt.
782 # 3. If nonopt is not specified, then host defaults to the current host,
783 #    as determined by config.guess.
784 # 4. Target and build default to nonopt.
785 # 5. If nonopt is not specified, then target and build default to host.
786
787 # The aliases save the names the user supplied, while $host etc.
788 # will get canonicalized.
789 case $host---$target---$nonopt in
790 NONE---*---* | *---NONE---* | *---*---NONE) ;;
791 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
792 esac
793
794 test "$host_alias" != "$target_alias" &&
795   test "$program_prefix$program_suffix$program_transform_name" = \
796     NONENONEs,x,x, &&
797   program_prefix=${target_alias}-
798
799
800 # Find a good install program.  We prefer a C program (faster),
801 # so one script is as good as another.  But avoid the broken or
802 # incompatible versions:
803 # SysV /etc/install, /usr/sbin/install
804 # SunOS /usr/etc/install
805 # IRIX /sbin/install
806 # AIX /bin/install
807 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
808 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
809 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
810 # ./install, which can be erroneously created by make from ./install.sh.
811 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
812 echo "configure:813: checking for a BSD compatible install" >&5
813 if test -z "$INSTALL"; then
814 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
815   echo $ac_n "(cached) $ac_c" 1>&6
816 else
817     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
818   for ac_dir in $PATH; do
819     # Account for people who put trailing slashes in PATH elements.
820     case "$ac_dir/" in
821     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
822     *)
823       # OSF1 and SCO ODT 3.0 have their own names for install.
824       # Don't use installbsd from OSF since it installs stuff as root
825       # by default.
826       for ac_prog in ginstall scoinst install; do
827         if test -f $ac_dir/$ac_prog; then
828           if test $ac_prog = install &&
829             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
830             # AIX install.  It has an incompatible calling convention.
831             :
832           elif test $ac_prog = install &&
833             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
834             # program-specific install script used by HP pwplus--don't use.
835             :
836           else
837             ac_cv_path_install="$ac_dir/$ac_prog -c"
838             break 2
839           fi
840         fi
841       done
842       ;;
843     esac
844   done
845   IFS="$ac_save_IFS"
846
847 fi
848   if test "${ac_cv_path_install+set}" = set; then
849     INSTALL="$ac_cv_path_install"
850   else
851     # As a last resort, use the slow shell script.  We don't cache a
852     # path for INSTALL within a source directory, because that will
853     # break other packages using the cache if that directory is
854     # removed, or if the path is relative.
855     INSTALL="$ac_install_sh"
856   fi
857 fi
858 echo "$ac_t""$INSTALL" 1>&6
859
860 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
861 # It thinks the first close brace ends the variable substitution.
862 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
863
864 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
865
866 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
867
868 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
869 echo "configure:870: checking whether build environment is sane" >&5
870 # Just in case
871 sleep 1
872 echo timestamp > conftestfile
873 # Do `set' in a subshell so we don't clobber the current shell's
874 # arguments.  Must try -L first in case configure is actually a
875 # symlink; some systems play weird games with the mod time of symlinks
876 # (eg FreeBSD returns the mod time of the symlink's containing
877 # directory).
878 if (
879    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
880    if test "$*" = "X"; then
881       # -L didn't work.
882       set X `ls -t $srcdir/configure conftestfile`
883    fi
884    if test "$*" != "X $srcdir/configure conftestfile" \
885       && test "$*" != "X conftestfile $srcdir/configure"; then
886
887       # If neither matched, then we have a broken ls.  This can happen
888       # if, for instance, CONFIG_SHELL is bash and it inherits a
889       # broken ls alias from the environment.  This has actually
890       # happened.  Such a system could not be considered "sane".
891       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
892 alias in your environment" 1>&2; exit 1; }
893    fi
894
895    test "$2" = conftestfile
896    )
897 then
898    # Ok.
899    :
900 else
901    { echo "configure: error: newly created file is older than distributed files!
902 Check your system clock" 1>&2; exit 1; }
903 fi
904 rm -f conftest*
905 echo "$ac_t""yes" 1>&6
906 if test "$program_transform_name" = s,x,x,; then
907   program_transform_name=
908 else
909   # Double any \ or $.  echo might interpret backslashes.
910   cat <<\EOF_SED > conftestsed
911 s,\\,\\\\,g; s,\$,$$,g
912 EOF_SED
913   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
914   rm -f conftestsed
915 fi
916 test "$program_prefix" != NONE &&
917   program_transform_name="s,^,${program_prefix},;$program_transform_name"
918 # Use a double $ so make ignores it.
919 test "$program_suffix" != NONE &&
920   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
921
922 # sed with no file args requires a program.
923 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
924
925 for ac_prog in mawk gawk nawk awk
926 do
927 # Extract the first word of "$ac_prog", so it can be a program name with args.
928 set dummy $ac_prog; ac_word=$2
929 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
930 echo "configure:931: checking for $ac_word" >&5
931 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
932   echo $ac_n "(cached) $ac_c" 1>&6
933 else
934   if test -n "$AWK"; then
935   ac_cv_prog_AWK="$AWK" # Let the user override the test.
936 else
937   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
938   ac_dummy="$PATH"
939   for ac_dir in $ac_dummy; do
940     test -z "$ac_dir" && ac_dir=.
941     if test -f $ac_dir/$ac_word; then
942       ac_cv_prog_AWK="$ac_prog"
943       break
944     fi
945   done
946   IFS="$ac_save_ifs"
947 fi
948 fi
949 AWK="$ac_cv_prog_AWK"
950 if test -n "$AWK"; then
951   echo "$ac_t""$AWK" 1>&6
952 else
953   echo "$ac_t""no" 1>&6
954 fi
955
956 test -n "$AWK" && break
957 done
958
959 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
960 echo "configure:961: checking whether ${MAKE-make} sets \${MAKE}" >&5
961 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
962 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
963   echo $ac_n "(cached) $ac_c" 1>&6
964 else
965   cat > conftestmake <<\EOF
966 all:
967         @echo 'ac_maketemp="${MAKE}"'
968 EOF
969 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
970 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
971 if test -n "$ac_maketemp"; then
972   eval ac_cv_prog_make_${ac_make}_set=yes
973 else
974   eval ac_cv_prog_make_${ac_make}_set=no
975 fi
976 rm -f conftestmake
977 fi
978 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
979   echo "$ac_t""yes" 1>&6
980   SET_MAKE=
981 else
982   echo "$ac_t""no" 1>&6
983   SET_MAKE="MAKE=${MAKE-make}"
984 fi
985
986
987
988 PACKAGE=OpenLDAP
989
990 VERSION=$OL_VERSION
991
992 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
993   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
994 fi
995
996
997
998 missing_dir=`cd $ac_aux_dir && pwd`
999 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1000 echo "configure:1001: checking for working aclocal" >&5
1001 # Run test in a subshell; some versions of sh will print an error if
1002 # an executable is not found, even if stderr is redirected.
1003 # Redirect stdin to placate older versions of autoconf.  Sigh.
1004 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1005    ACLOCAL=aclocal
1006    echo "$ac_t""found" 1>&6
1007 else
1008    ACLOCAL="$missing_dir/missing aclocal"
1009    echo "$ac_t""missing" 1>&6
1010 fi
1011
1012 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1013 echo "configure:1014: checking for working autoconf" >&5
1014 # Run test in a subshell; some versions of sh will print an error if
1015 # an executable is not found, even if stderr is redirected.
1016 # Redirect stdin to placate older versions of autoconf.  Sigh.
1017 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1018    AUTOCONF=autoconf
1019    echo "$ac_t""found" 1>&6
1020 else
1021    AUTOCONF="$missing_dir/missing autoconf"
1022    echo "$ac_t""missing" 1>&6
1023 fi
1024
1025 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1026 echo "configure:1027: checking for working automake" >&5
1027 # Run test in a subshell; some versions of sh will print an error if
1028 # an executable is not found, even if stderr is redirected.
1029 # Redirect stdin to placate older versions of autoconf.  Sigh.
1030 if (automake --version) < /dev/null > /dev/null 2>&1; then
1031    AUTOMAKE=automake
1032    echo "$ac_t""found" 1>&6
1033 else
1034    AUTOMAKE="$missing_dir/missing automake"
1035    echo "$ac_t""missing" 1>&6
1036 fi
1037
1038 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1039 echo "configure:1040: checking for working autoheader" >&5
1040 # Run test in a subshell; some versions of sh will print an error if
1041 # an executable is not found, even if stderr is redirected.
1042 # Redirect stdin to placate older versions of autoconf.  Sigh.
1043 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1044    AUTOHEADER=autoheader
1045    echo "$ac_t""found" 1>&6
1046 else
1047    AUTOHEADER="$missing_dir/missing autoheader"
1048    echo "$ac_t""missing" 1>&6
1049 fi
1050
1051 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1052 echo "configure:1053: checking for working makeinfo" >&5
1053 # Run test in a subshell; some versions of sh will print an error if
1054 # an executable is not found, even if stderr is redirected.
1055 # Redirect stdin to placate older versions of autoconf.  Sigh.
1056 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1057    MAKEINFO=makeinfo
1058    echo "$ac_t""found" 1>&6
1059 else
1060    MAKEINFO="$missing_dir/missing makeinfo"
1061    echo "$ac_t""missing" 1>&6
1062 fi
1063
1064 install_sh="$missing_dir/install-sh"
1065 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1066
1067 for ac_prog in gnutar gtar tar
1068 do
1069 # Extract the first word of "$ac_prog", so it can be a program name with args.
1070 set dummy $ac_prog; ac_word=$2
1071 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1072 echo "configure:1073: checking for $ac_word" >&5
1073 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1074   echo $ac_n "(cached) $ac_c" 1>&6
1075 else
1076   if test -n "$AMTAR"; then
1077   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1078 else
1079   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1080   ac_dummy="$PATH"
1081   for ac_dir in $ac_dummy; do
1082     test -z "$ac_dir" && ac_dir=.
1083     if test -f $ac_dir/$ac_word; then
1084       ac_cv_prog_AMTAR="$ac_prog"
1085       break
1086     fi
1087   done
1088   IFS="$ac_save_ifs"
1089 fi
1090 fi
1091 AMTAR="$ac_cv_prog_AMTAR"
1092 if test -n "$AMTAR"; then
1093   echo "$ac_t""$AMTAR" 1>&6
1094 else
1095   echo "$ac_t""no" 1>&6
1096 fi
1097
1098 test -n "$AMTAR" && break
1099 done
1100
1101
1102 AMTARFLAGS=
1103 if test -n "$AMTAR"; then
1104   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1105         AMTARFLAGS=o
1106   fi
1107 fi
1108
1109
1110
1111 cat >> confdefs.h <<EOF
1112 #define OPENLDAP_PACKAGE "$PACKAGE"
1113 EOF
1114
1115 cat >> confdefs.h <<EOF
1116 #define OPENLDAP_VERSION "$VERSION"
1117 EOF
1118
1119
1120
1121
1122 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1123 echo "configure:1124: checking configure arguments" >&5
1124
1125
1126 top_builddir=`pwd`
1127
1128 ldap_subdir="/openldap"
1129
1130 # Check whether --with-subdir or --without-subdir was given.
1131 if test "${with_subdir+set}" = set; then
1132   withval="$with_subdir"
1133   case "$withval" in
1134         no) ldap_subdir=""
1135                 ;;
1136         yes)
1137                 ;;
1138         /*|\\*)
1139                 ldap_subdir="$withval"
1140                 ;;
1141         *)
1142                 ldap_subdir="/$withval"
1143                 ;;
1144 esac
1145
1146 fi
1147
1148
1149 # OpenLDAP --enable-debug
1150         # Check whether --enable-debug or --disable-debug was given.
1151 if test "${enable_debug+set}" = set; then
1152   enableval="$enable_debug"
1153   
1154         ol_arg=invalid
1155         for ol_val in auto yes no ; do
1156                 if test "$enableval" = "$ol_val" ; then
1157                         ol_arg="$ol_val"
1158                 fi
1159         done
1160         if test "$ol_arg" = "invalid" ; then
1161                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1162         fi
1163         ol_enable_debug="$ol_arg"
1164
1165 else
1166         ol_enable_debug="yes"
1167 fi
1168 # end --enable-debug
1169 # OpenLDAP --enable-syslog
1170         # Check whether --enable-syslog or --disable-syslog was given.
1171 if test "${enable_syslog+set}" = set; then
1172   enableval="$enable_syslog"
1173   
1174         ol_arg=invalid
1175         for ol_val in auto yes no ; do
1176                 if test "$enableval" = "$ol_val" ; then
1177                         ol_arg="$ol_val"
1178                 fi
1179         done
1180         if test "$ol_arg" = "invalid" ; then
1181                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1182         fi
1183         ol_enable_syslog="$ol_arg"
1184
1185 else
1186         ol_enable_syslog="auto"
1187 fi
1188 # end --enable-syslog
1189 # OpenLDAP --enable-proctitle
1190         # Check whether --enable-proctitle or --disable-proctitle was given.
1191 if test "${enable_proctitle+set}" = set; then
1192   enableval="$enable_proctitle"
1193   
1194         ol_arg=invalid
1195         for ol_val in auto yes no ; do
1196                 if test "$enableval" = "$ol_val" ; then
1197                         ol_arg="$ol_val"
1198                 fi
1199         done
1200         if test "$ol_arg" = "invalid" ; then
1201                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1202         fi
1203         ol_enable_proctitle="$ol_arg"
1204
1205 else
1206         ol_enable_proctitle="yes"
1207 fi
1208 # end --enable-proctitle
1209 # OpenLDAP --enable-cache
1210         # Check whether --enable-cache or --disable-cache was given.
1211 if test "${enable_cache+set}" = set; then
1212   enableval="$enable_cache"
1213   
1214         ol_arg=invalid
1215         for ol_val in auto yes no ; do
1216                 if test "$enableval" = "$ol_val" ; then
1217                         ol_arg="$ol_val"
1218                 fi
1219         done
1220         if test "$ol_arg" = "invalid" ; then
1221                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
1222         fi
1223         ol_enable_cache="$ol_arg"
1224
1225 else
1226         ol_enable_cache="yes"
1227 fi
1228 # end --enable-cache
1229 # OpenLDAP --enable-dns
1230         # Check whether --enable-dns or --disable-dns was given.
1231 if test "${enable_dns+set}" = set; then
1232   enableval="$enable_dns"
1233   
1234         ol_arg=invalid
1235         for ol_val in auto yes no ; do
1236                 if test "$enableval" = "$ol_val" ; then
1237                         ol_arg="$ol_val"
1238                 fi
1239         done
1240         if test "$ol_arg" = "invalid" ; then
1241                 { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; }
1242         fi
1243         ol_enable_dns="$ol_arg"
1244
1245 else
1246         ol_enable_dns="no"
1247 fi
1248 # end --enable-dns
1249 # OpenLDAP --enable-referrals
1250         # Check whether --enable-referrals or --disable-referrals was given.
1251 if test "${enable_referrals+set}" = set; then
1252   enableval="$enable_referrals"
1253   
1254         ol_arg=invalid
1255         for ol_val in auto yes no ; do
1256                 if test "$enableval" = "$ol_val" ; then
1257                         ol_arg="$ol_val"
1258                 fi
1259         done
1260         if test "$ol_arg" = "invalid" ; then
1261                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1262         fi
1263         ol_enable_referrals="$ol_arg"
1264
1265 else
1266         ol_enable_referrals="yes"
1267 fi
1268 # end --enable-referrals
1269 # OpenLDAP --enable-cldap
1270         # Check whether --enable-cldap or --disable-cldap was given.
1271 if test "${enable_cldap+set}" = set; then
1272   enableval="$enable_cldap"
1273   
1274         ol_arg=invalid
1275         for ol_val in auto yes no ; do
1276                 if test "$enableval" = "$ol_val" ; then
1277                         ol_arg="$ol_val"
1278                 fi
1279         done
1280         if test "$ol_arg" = "invalid" ; then
1281                 { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; }
1282         fi
1283         ol_enable_cldap="$ol_arg"
1284
1285 else
1286         ol_enable_cldap="no"
1287 fi
1288 # end --enable-cldap
1289 # OpenLDAP --enable-x_compile
1290         # Check whether --enable-x_compile or --disable-x_compile was given.
1291 if test "${enable_x_compile+set}" = set; then
1292   enableval="$enable_x_compile"
1293   
1294         ol_arg=invalid
1295         for ol_val in yes no ; do
1296                 if test "$enableval" = "$ol_val" ; then
1297                         ol_arg="$ol_val"
1298                 fi
1299         done
1300         if test "$ol_arg" = "invalid" ; then
1301                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1302         fi
1303         ol_enable_x_compile="$ol_arg"
1304
1305 else
1306         ol_enable_x_compile="no"
1307 fi
1308 # end --enable-x_compile
1309
1310 # OpenLDAP --enable-dmalloc
1311         # Check whether --enable-dmalloc or --disable-dmalloc was given.
1312 if test "${enable_dmalloc+set}" = set; then
1313   enableval="$enable_dmalloc"
1314   
1315         ol_arg=invalid
1316         for ol_val in auto yes no ; do
1317                 if test "$enableval" = "$ol_val" ; then
1318                         ol_arg="$ol_val"
1319                 fi
1320         done
1321         if test "$ol_arg" = "invalid" ; then
1322                 { echo "configure: error: bad value $enableval for --enable-dmalloc" 1>&2; exit 1; }
1323         fi
1324         ol_enable_dmalloc="$ol_arg"
1325
1326 else
1327         ol_enable_dmalloc="no"
1328 fi
1329 # end --enable-dmalloc
1330
1331 # OpenLDAP --with-cyrus_sasl
1332         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1333 if test "${with_cyrus_sasl+set}" = set; then
1334   withval="$with_cyrus_sasl"
1335   
1336         ol_arg=invalid
1337         for ol_val in auto yes no  ; do
1338                 if test "$withval" = "$ol_val" ; then
1339                         ol_arg="$ol_val"
1340                 fi
1341         done
1342         if test "$ol_arg" = "invalid" ; then
1343                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1344         fi
1345         ol_with_cyrus_sasl="$ol_arg"
1346
1347 else
1348         ol_with_cyrus_sasl="auto"
1349 fi
1350 # end --with-cyrus_sasl
1351
1352 # OpenLDAP --with-fetch
1353         # Check whether --with-fetch or --without-fetch was given.
1354 if test "${with_fetch+set}" = set; then
1355   withval="$with_fetch"
1356   
1357         ol_arg=invalid
1358         for ol_val in auto yes no  ; do
1359                 if test "$withval" = "$ol_val" ; then
1360                         ol_arg="$ol_val"
1361                 fi
1362         done
1363         if test "$ol_arg" = "invalid" ; then
1364                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1365         fi
1366         ol_with_fetch="$ol_arg"
1367
1368 else
1369         ol_with_fetch="auto"
1370 fi
1371 # end --with-fetch
1372
1373 # OpenLDAP --with-kerberos
1374         # Check whether --with-kerberos or --without-kerberos was given.
1375 if test "${with_kerberos+set}" = set; then
1376   withval="$with_kerberos"
1377   
1378         ol_arg=invalid
1379         for ol_val in auto k5 k4 afs yes no ; do
1380                 if test "$withval" = "$ol_val" ; then
1381                         ol_arg="$ol_val"
1382                 fi
1383         done
1384         if test "$ol_arg" = "invalid" ; then
1385                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1386         fi
1387         ol_with_kerberos="$ol_arg"
1388
1389 else
1390         ol_with_kerberos="auto"
1391 fi
1392 # end --with-kerberos
1393
1394 # OpenLDAP --with-readline
1395         # Check whether --with-readline or --without-readline was given.
1396 if test "${with_readline+set}" = set; then
1397   withval="$with_readline"
1398   
1399         ol_arg=invalid
1400         for ol_val in auto yes no  ; do
1401                 if test "$withval" = "$ol_val" ; then
1402                         ol_arg="$ol_val"
1403                 fi
1404         done
1405         if test "$ol_arg" = "invalid" ; then
1406                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1407         fi
1408         ol_with_readline="$ol_arg"
1409
1410 else
1411         ol_with_readline="auto"
1412 fi
1413 # end --with-readline
1414
1415 # OpenLDAP --with-threads
1416         # Check whether --with-threads or --without-threads was given.
1417 if test "${with_threads+set}" = set; then
1418   withval="$with_threads"
1419   
1420         ol_arg=invalid
1421         for ol_val in auto posix mach pth lwp yes no manual  ; do
1422                 if test "$withval" = "$ol_val" ; then
1423                         ol_arg="$ol_val"
1424                 fi
1425         done
1426         if test "$ol_arg" = "invalid" ; then
1427                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1428         fi
1429         ol_with_threads="$ol_arg"
1430
1431 else
1432         ol_with_threads="auto"
1433 fi
1434 # end --with-threads
1435
1436 # OpenLDAP --with-tls
1437         # Check whether --with-tls or --without-tls was given.
1438 if test "${with_tls+set}" = set; then
1439   withval="$with_tls"
1440   
1441         ol_arg=invalid
1442         for ol_val in auto ssleay openssl yes no  ; do
1443                 if test "$withval" = "$ol_val" ; then
1444                         ol_arg="$ol_val"
1445                 fi
1446         done
1447         if test "$ol_arg" = "invalid" ; then
1448                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1449         fi
1450         ol_with_tls="$ol_arg"
1451
1452 else
1453         ol_with_tls="auto"
1454 fi
1455 # end --with-tls
1456
1457 # OpenLDAP --with-yielding_select
1458         # Check whether --with-yielding_select or --without-yielding_select was given.
1459 if test "${with_yielding_select+set}" = set; then
1460   withval="$with_yielding_select"
1461   
1462         ol_arg=invalid
1463         for ol_val in auto yes no manual  ; do
1464                 if test "$withval" = "$ol_val" ; then
1465                         ol_arg="$ol_val"
1466                 fi
1467         done
1468         if test "$ol_arg" = "invalid" ; then
1469                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1470         fi
1471         ol_with_yielding_select="$ol_arg"
1472
1473 else
1474         ol_with_yielding_select="auto"
1475 fi
1476 # end --with-yielding_select
1477
1478
1479
1480 # Check whether --with-xxldapdoptions or --without-xxldapdoptions was given.
1481 if test "${with_xxldapdoptions+set}" = set; then
1482   withval="$with_xxldapdoptions"
1483   :
1484 fi
1485
1486 # OpenLDAP --enable-ldapd
1487         # Check whether --enable-ldapd or --disable-ldapd was given.
1488 if test "${enable_ldapd+set}" = set; then
1489   enableval="$enable_ldapd"
1490   
1491         ol_arg=invalid
1492         for ol_val in auto yes no ; do
1493                 if test "$enableval" = "$ol_val" ; then
1494                         ol_arg="$ol_val"
1495                 fi
1496         done
1497         if test "$ol_arg" = "invalid" ; then
1498                 { echo "configure: error: bad value $enableval for --enable-ldapd" 1>&2; exit 1; }
1499         fi
1500         ol_enable_ldapd="$ol_arg"
1501
1502 else
1503         ol_enable_ldapd="no"
1504 fi
1505 # end --enable-ldapd
1506
1507 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1508 if test "${with_xxslapdoptions+set}" = set; then
1509   withval="$with_xxslapdoptions"
1510   :
1511 fi
1512
1513 # OpenLDAP --enable-slapd
1514         # Check whether --enable-slapd or --disable-slapd was given.
1515 if test "${enable_slapd+set}" = set; then
1516   enableval="$enable_slapd"
1517   
1518         ol_arg=invalid
1519         for ol_val in auto yes no ; do
1520                 if test "$enableval" = "$ol_val" ; then
1521                         ol_arg="$ol_val"
1522                 fi
1523         done
1524         if test "$ol_arg" = "invalid" ; then
1525                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1526         fi
1527         ol_enable_slapd="$ol_arg"
1528
1529 else
1530         ol_enable_slapd="yes"
1531 fi
1532 # end --enable-slapd
1533 # OpenLDAP --enable-cleartext
1534         # Check whether --enable-cleartext or --disable-cleartext was given.
1535 if test "${enable_cleartext+set}" = set; then
1536   enableval="$enable_cleartext"
1537   
1538         ol_arg=invalid
1539         for ol_val in auto yes no ; do
1540                 if test "$enableval" = "$ol_val" ; then
1541                         ol_arg="$ol_val"
1542                 fi
1543         done
1544         if test "$ol_arg" = "invalid" ; then
1545                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1546         fi
1547         ol_enable_cleartext="$ol_arg"
1548
1549 else
1550         ol_enable_cleartext="yes"
1551 fi
1552 # end --enable-cleartext
1553 # OpenLDAP --enable-crypt
1554         # Check whether --enable-crypt or --disable-crypt was given.
1555 if test "${enable_crypt+set}" = set; then
1556   enableval="$enable_crypt"
1557   
1558         ol_arg=invalid
1559         for ol_val in auto yes no ; do
1560                 if test "$enableval" = "$ol_val" ; then
1561                         ol_arg="$ol_val"
1562                 fi
1563         done
1564         if test "$ol_arg" = "invalid" ; then
1565                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1566         fi
1567         ol_enable_crypt="$ol_arg"
1568
1569 else
1570         ol_enable_crypt="auto"
1571 fi
1572 # end --enable-crypt
1573 # OpenLDAP --enable-modules
1574         # Check whether --enable-modules or --disable-modules was given.
1575 if test "${enable_modules+set}" = set; then
1576   enableval="$enable_modules"
1577   
1578         ol_arg=invalid
1579         for ol_val in auto yes no ; do
1580                 if test "$enableval" = "$ol_val" ; then
1581                         ol_arg="$ol_val"
1582                 fi
1583         done
1584         if test "$ol_arg" = "invalid" ; then
1585                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1586         fi
1587         ol_enable_modules="$ol_arg"
1588
1589 else
1590         ol_enable_modules="no"
1591 fi
1592 # end --enable-modules
1593 # OpenLDAP --enable-multimaster
1594         # Check whether --enable-multimaster or --disable-multimaster was given.
1595 if test "${enable_multimaster+set}" = set; then
1596   enableval="$enable_multimaster"
1597   
1598         ol_arg=invalid
1599         for ol_val in auto yes no ; do
1600                 if test "$enableval" = "$ol_val" ; then
1601                         ol_arg="$ol_val"
1602                 fi
1603         done
1604         if test "$ol_arg" = "invalid" ; then
1605                 { echo "configure: error: bad value $enableval for --enable-multimaster" 1>&2; exit 1; }
1606         fi
1607         ol_enable_multimaster="$ol_arg"
1608
1609 else
1610         ol_enable_multimaster="no"
1611 fi
1612 # end --enable-multimaster
1613 # OpenLDAP --enable-phonetic
1614         # Check whether --enable-phonetic or --disable-phonetic was given.
1615 if test "${enable_phonetic+set}" = set; then
1616   enableval="$enable_phonetic"
1617   
1618         ol_arg=invalid
1619         for ol_val in auto yes no ; do
1620                 if test "$enableval" = "$ol_val" ; then
1621                         ol_arg="$ol_val"
1622                 fi
1623         done
1624         if test "$ol_arg" = "invalid" ; then
1625                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1626         fi
1627         ol_enable_phonetic="$ol_arg"
1628
1629 else
1630         ol_enable_phonetic="no"
1631 fi
1632 # end --enable-phonetic
1633 # OpenLDAP --enable-quipu
1634         # Check whether --enable-quipu or --disable-quipu was given.
1635 if test "${enable_quipu+set}" = set; then
1636   enableval="$enable_quipu"
1637   
1638         ol_arg=invalid
1639         for ol_val in auto yes no ; do
1640                 if test "$enableval" = "$ol_val" ; then
1641                         ol_arg="$ol_val"
1642                 fi
1643         done
1644         if test "$ol_arg" = "invalid" ; then
1645                 { echo "configure: error: bad value $enableval for --enable-quipu" 1>&2; exit 1; }
1646         fi
1647         ol_enable_quipu="$ol_arg"
1648
1649 else
1650         ol_enable_quipu="no"
1651 fi
1652 # end --enable-quipu
1653 # OpenLDAP --enable-rlookups
1654         # Check whether --enable-rlookups or --disable-rlookups was given.
1655 if test "${enable_rlookups+set}" = set; then
1656   enableval="$enable_rlookups"
1657   
1658         ol_arg=invalid
1659         for ol_val in auto yes no ; do
1660                 if test "$enableval" = "$ol_val" ; then
1661                         ol_arg="$ol_val"
1662                 fi
1663         done
1664         if test "$ol_arg" = "invalid" ; then
1665                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1666         fi
1667         ol_enable_rlookups="$ol_arg"
1668
1669 else
1670         ol_enable_rlookups="auto"
1671 fi
1672 # end --enable-rlookups
1673 # OpenLDAP --enable-aci
1674         # Check whether --enable-aci or --disable-aci was given.
1675 if test "${enable_aci+set}" = set; then
1676   enableval="$enable_aci"
1677   
1678         ol_arg=invalid
1679         for ol_val in auto yes no ; do
1680                 if test "$enableval" = "$ol_val" ; then
1681                         ol_arg="$ol_val"
1682                 fi
1683         done
1684         if test "$ol_arg" = "invalid" ; then
1685                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1686         fi
1687         ol_enable_aci="$ol_arg"
1688
1689 else
1690         ol_enable_aci="no"
1691 fi
1692 # end --enable-aci
1693 # OpenLDAP --enable-discreteaci
1694         # Check whether --enable-discreteaci or --disable-discreteaci was given.
1695 if test "${enable_discreteaci+set}" = set; then
1696   enableval="$enable_discreteaci"
1697   
1698         ol_arg=invalid
1699         for ol_val in auto yes no ; do
1700                 if test "$enableval" = "$ol_val" ; then
1701                         ol_arg="$ol_val"
1702                 fi
1703         done
1704         if test "$ol_arg" = "invalid" ; then
1705                 { echo "configure: error: bad value $enableval for --enable-discreteaci" 1>&2; exit 1; }
1706         fi
1707         ol_enable_discreteaci="$ol_arg"
1708
1709 else
1710         ol_enable_discreteaci="no"
1711 fi
1712 # end --enable-discreteaci
1713 # OpenLDAP --enable-wrappers
1714         # Check whether --enable-wrappers or --disable-wrappers was given.
1715 if test "${enable_wrappers+set}" = set; then
1716   enableval="$enable_wrappers"
1717   
1718         ol_arg=invalid
1719         for ol_val in auto yes no ; do
1720                 if test "$enableval" = "$ol_val" ; then
1721                         ol_arg="$ol_val"
1722                 fi
1723         done
1724         if test "$ol_arg" = "invalid" ; then
1725                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1726         fi
1727         ol_enable_wrappers="$ol_arg"
1728
1729 else
1730         ol_enable_wrappers="no"
1731 fi
1732 # end --enable-wrappers
1733
1734 # OpenLDAP --enable-bdb2
1735         # Check whether --enable-bdb2 or --disable-bdb2 was given.
1736 if test "${enable_bdb2+set}" = set; then
1737   enableval="$enable_bdb2"
1738   
1739         ol_arg=invalid
1740         for ol_val in auto yes no ; do
1741                 if test "$enableval" = "$ol_val" ; then
1742                         ol_arg="$ol_val"
1743                 fi
1744         done
1745         if test "$ol_arg" = "invalid" ; then
1746                 { echo "configure: error: bad value $enableval for --enable-bdb2" 1>&2; exit 1; }
1747         fi
1748         ol_enable_bdb2="$ol_arg"
1749
1750 else
1751         ol_enable_bdb2="no"
1752 fi
1753 # end --enable-bdb2
1754 # OpenLDAP --with-bdb2_module
1755         # Check whether --with-bdb2_module or --without-bdb2_module was given.
1756 if test "${with_bdb2_module+set}" = set; then
1757   withval="$with_bdb2_module"
1758   
1759         ol_arg=invalid
1760         for ol_val in static dynamic ; do
1761                 if test "$withval" = "$ol_val" ; then
1762                         ol_arg="$ol_val"
1763                 fi
1764         done
1765         if test "$ol_arg" = "invalid" ; then
1766                 { echo "configure: error: bad value $withval for --with-bdb2_module" 1>&2; exit 1; }
1767         fi
1768         ol_with_bdb2_module="$ol_arg"
1769
1770 else
1771         ol_with_bdb2_module="static"
1772 fi
1773 # end --with-bdb2_module
1774
1775 # OpenLDAP --enable-ldap
1776         # Check whether --enable-ldap or --disable-ldap was given.
1777 if test "${enable_ldap+set}" = set; then
1778   enableval="$enable_ldap"
1779   
1780         ol_arg=invalid
1781         for ol_val in auto yes no ; do
1782                 if test "$enableval" = "$ol_val" ; then
1783                         ol_arg="$ol_val"
1784                 fi
1785         done
1786         if test "$ol_arg" = "invalid" ; then
1787                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1788         fi
1789         ol_enable_ldap="$ol_arg"
1790
1791 else
1792         ol_enable_ldap="no"
1793 fi
1794 # end --enable-ldap
1795 # OpenLDAP --with-ldap_module
1796         # Check whether --with-ldap_module or --without-ldap_module was given.
1797 if test "${with_ldap_module+set}" = set; then
1798   withval="$with_ldap_module"
1799   
1800         ol_arg=invalid
1801         for ol_val in static dynamic ; do
1802                 if test "$withval" = "$ol_val" ; then
1803                         ol_arg="$ol_val"
1804                 fi
1805         done
1806         if test "$ol_arg" = "invalid" ; then
1807                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
1808         fi
1809         ol_with_ldap_module="$ol_arg"
1810
1811 else
1812         ol_with_ldap_module="static"
1813 fi
1814 # end --with-ldap_module
1815
1816 # OpenLDAP --enable-ldbm
1817         # Check whether --enable-ldbm or --disable-ldbm was given.
1818 if test "${enable_ldbm+set}" = set; then
1819   enableval="$enable_ldbm"
1820   
1821         ol_arg=invalid
1822         for ol_val in auto yes no ; do
1823                 if test "$enableval" = "$ol_val" ; then
1824                         ol_arg="$ol_val"
1825                 fi
1826         done
1827         if test "$ol_arg" = "invalid" ; then
1828                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1829         fi
1830         ol_enable_ldbm="$ol_arg"
1831
1832 else
1833         ol_enable_ldbm="yes"
1834 fi
1835 # end --enable-ldbm
1836 # OpenLDAP --with-ldbm_api
1837         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1838 if test "${with_ldbm_api+set}" = set; then
1839   withval="$with_ldbm_api"
1840   
1841         ol_arg=invalid
1842         for ol_val in auto db2 db mdbm gdbm ndbm manual ; do
1843                 if test "$withval" = "$ol_val" ; then
1844                         ol_arg="$ol_val"
1845                 fi
1846         done
1847         if test "$ol_arg" = "invalid" ; then
1848                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1849         fi
1850         ol_with_ldbm_api="$ol_arg"
1851
1852 else
1853         ol_with_ldbm_api="auto"
1854 fi
1855 # end --with-ldbm_api
1856
1857 # OpenLDAP --with-ldbm_module
1858         # Check whether --with-ldbm_module or --without-ldbm_module was given.
1859 if test "${with_ldbm_module+set}" = set; then
1860   withval="$with_ldbm_module"
1861   
1862         ol_arg=invalid
1863         for ol_val in static dynamic ; do
1864                 if test "$withval" = "$ol_val" ; then
1865                         ol_arg="$ol_val"
1866                 fi
1867         done
1868         if test "$ol_arg" = "invalid" ; then
1869                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
1870         fi
1871         ol_with_ldbm_module="$ol_arg"
1872
1873 else
1874         ol_with_ldbm_module="static"
1875 fi
1876 # end --with-ldbm_module
1877
1878 # OpenLDAP --with-ldbm_type
1879         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1880 if test "${with_ldbm_type+set}" = set; then
1881   withval="$with_ldbm_type"
1882   
1883         ol_arg=invalid
1884         for ol_val in auto btree hash ; do
1885                 if test "$withval" = "$ol_val" ; then
1886                         ol_arg="$ol_val"
1887                 fi
1888         done
1889         if test "$ol_arg" = "invalid" ; then
1890                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1891         fi
1892         ol_with_ldbm_type="$ol_arg"
1893
1894 else
1895         ol_with_ldbm_type="auto"
1896 fi
1897 # end --with-ldbm_type
1898
1899
1900 # OpenLDAP --enable-passwd
1901         # Check whether --enable-passwd or --disable-passwd was given.
1902 if test "${enable_passwd+set}" = set; then
1903   enableval="$enable_passwd"
1904   
1905         ol_arg=invalid
1906         for ol_val in auto yes no ; do
1907                 if test "$enableval" = "$ol_val" ; then
1908                         ol_arg="$ol_val"
1909                 fi
1910         done
1911         if test "$ol_arg" = "invalid" ; then
1912                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1913         fi
1914         ol_enable_passwd="$ol_arg"
1915
1916 else
1917         ol_enable_passwd="no"
1918 fi
1919 # end --enable-passwd
1920 # OpenLDAP --with-passwd_module
1921         # Check whether --with-passwd_module or --without-passwd_module was given.
1922 if test "${with_passwd_module+set}" = set; then
1923   withval="$with_passwd_module"
1924   
1925         ol_arg=invalid
1926         for ol_val in static dynamic ; do
1927                 if test "$withval" = "$ol_val" ; then
1928                         ol_arg="$ol_val"
1929                 fi
1930         done
1931         if test "$ol_arg" = "invalid" ; then
1932                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
1933         fi
1934         ol_with_passwd_module="$ol_arg"
1935
1936 else
1937         ol_with_passwd_module="static"
1938 fi
1939 # end --with-passwd_module
1940
1941 # OpenLDAP --enable-perl
1942         # Check whether --enable-perl or --disable-perl was given.
1943 if test "${enable_perl+set}" = set; then
1944   enableval="$enable_perl"
1945   
1946         ol_arg=invalid
1947         for ol_val in auto yes no ; do
1948                 if test "$enableval" = "$ol_val" ; then
1949                         ol_arg="$ol_val"
1950                 fi
1951         done
1952         if test "$ol_arg" = "invalid" ; then
1953                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
1954         fi
1955         ol_enable_perl="$ol_arg"
1956
1957 else
1958         ol_enable_perl="no"
1959 fi
1960 # end --enable-perl
1961 # OpenLDAP --with-perl_module
1962         # Check whether --with-perl_module or --without-perl_module was given.
1963 if test "${with_perl_module+set}" = set; then
1964   withval="$with_perl_module"
1965   
1966         ol_arg=invalid
1967         for ol_val in static dynamic ; do
1968                 if test "$withval" = "$ol_val" ; then
1969                         ol_arg="$ol_val"
1970                 fi
1971         done
1972         if test "$ol_arg" = "invalid" ; then
1973                 { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; }
1974         fi
1975         ol_with_perl_module="$ol_arg"
1976
1977 else
1978         ol_with_perl_module="static"
1979 fi
1980 # end --with-perl_module
1981
1982 # OpenLDAP --enable-shell
1983         # Check whether --enable-shell or --disable-shell was given.
1984 if test "${enable_shell+set}" = set; then
1985   enableval="$enable_shell"
1986   
1987         ol_arg=invalid
1988         for ol_val in auto yes no ; do
1989                 if test "$enableval" = "$ol_val" ; then
1990                         ol_arg="$ol_val"
1991                 fi
1992         done
1993         if test "$ol_arg" = "invalid" ; then
1994                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
1995         fi
1996         ol_enable_shell="$ol_arg"
1997
1998 else
1999         ol_enable_shell="no"
2000 fi
2001 # end --enable-shell
2002 # OpenLDAP --with-shell_module
2003         # Check whether --with-shell_module or --without-shell_module was given.
2004 if test "${with_shell_module+set}" = set; then
2005   withval="$with_shell_module"
2006   
2007         ol_arg=invalid
2008         for ol_val in static dynamic ; do
2009                 if test "$withval" = "$ol_val" ; then
2010                         ol_arg="$ol_val"
2011                 fi
2012         done
2013         if test "$ol_arg" = "invalid" ; then
2014                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
2015         fi
2016         ol_with_shell_module="$ol_arg"
2017
2018 else
2019         ol_with_shell_module="static"
2020 fi
2021 # end --with-shell_module
2022
2023 # OpenLDAP --enable-tcl
2024         # Check whether --enable-tcl or --disable-tcl was given.
2025 if test "${enable_tcl+set}" = set; then
2026   enableval="$enable_tcl"
2027   
2028         ol_arg=invalid
2029         for ol_val in auto yes no ; do
2030                 if test "$enableval" = "$ol_val" ; then
2031                         ol_arg="$ol_val"
2032                 fi
2033         done
2034         if test "$ol_arg" = "invalid" ; then
2035                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
2036         fi
2037         ol_enable_tcl="$ol_arg"
2038
2039 else
2040         ol_enable_tcl="no"
2041 fi
2042 # end --enable-tcl
2043 # OpenLDAP --with-tcl_module
2044         # Check whether --with-tcl_module or --without-tcl_module was given.
2045 if test "${with_tcl_module+set}" = set; then
2046   withval="$with_tcl_module"
2047   
2048         ol_arg=invalid
2049         for ol_val in static dynamic ; do
2050                 if test "$withval" = "$ol_val" ; then
2051                         ol_arg="$ol_val"
2052                 fi
2053         done
2054         if test "$ol_arg" = "invalid" ; then
2055                 { echo "configure: error: bad value $withval for --with-tcl_module" 1>&2; exit 1; }
2056         fi
2057         ol_with_tcl_module="$ol_arg"
2058
2059 else
2060         ol_with_tcl_module="static"
2061 fi
2062 # end --with-tcl_module
2063
2064
2065 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2066 if test "${with_xxslurpdoptions+set}" = set; then
2067   withval="$with_xxslurpdoptions"
2068   :
2069 fi
2070
2071 # OpenLDAP --enable-slurpd
2072         # Check whether --enable-slurpd or --disable-slurpd was given.
2073 if test "${enable_slurpd+set}" = set; then
2074   enableval="$enable_slurpd"
2075   
2076         ol_arg=invalid
2077         for ol_val in auto yes no ; do
2078                 if test "$enableval" = "$ol_val" ; then
2079                         ol_arg="$ol_val"
2080                 fi
2081         done
2082         if test "$ol_arg" = "invalid" ; then
2083                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2084         fi
2085         ol_enable_slurpd="$ol_arg"
2086
2087 else
2088         ol_enable_slurpd="auto"
2089 fi
2090 # end --enable-slurpd
2091
2092 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2093 if test "${with_xxliboptions+set}" = set; then
2094   withval="$with_xxliboptions"
2095   :
2096 fi
2097
2098 # Check whether --enable-static or --disable-static was given.
2099 if test "${enable_static+set}" = set; then
2100   enableval="$enable_static"
2101   p=${PACKAGE-default}
2102 case "$enableval" in
2103 yes) enable_static=yes ;;
2104 no) enable_static=no ;;
2105 *)
2106   enable_static=no
2107   # Look at the argument we got.  We use all the common list separators.
2108   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2109   for pkg in $enableval; do
2110     if test "X$pkg" = "X$p"; then
2111       enable_static=yes
2112     fi
2113   done
2114   IFS="$ac_save_ifs"
2115   ;;
2116 esac
2117 else
2118   enable_static=yes
2119 fi
2120
2121 # Check whether --enable-shared or --disable-shared was given.
2122 if test "${enable_shared+set}" = set; then
2123   enableval="$enable_shared"
2124   p=${PACKAGE-default}
2125 case "$enableval" in
2126 yes) enable_shared=yes ;;
2127 no) enable_shared=no ;;
2128 *)
2129   enable_shared=no
2130   # Look at the argument we got.  We use all the common list separators.
2131   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2132   for pkg in $enableval; do
2133     if test "X$pkg" = "X$p"; then
2134       enable_shared=yes
2135     fi
2136   done
2137   IFS="$ac_save_ifs"
2138   ;;
2139 esac
2140 else
2141   enable_shared=yes
2142 fi
2143
2144
2145 # validate options
2146 if test $ol_enable_dns = yes ; then
2147         if test $ol_enable_referrals = no ; then
2148                 { echo "configure: error: DNS requires --enable-referrals" 1>&2; exit 1; }
2149         fi
2150         if test $ol_enable_referrals = auto ; then
2151                 echo "configure: warning: DNS requires referrals, adding --enable-referrals" 1>&2
2152                 ol_enable_referrals=yes
2153         fi
2154 fi
2155
2156 if test $ol_enable_slapd = no ; then
2157                 if test $ol_enable_bdb2 = yes ; then
2158                 echo "configure: warning: slapd disabled, ignoring --enable-bdb2 argument" 1>&2
2159         fi
2160         if test $ol_enable_ldap = yes ; then
2161                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2162         fi
2163         if test $ol_enable_ldbm = yes ; then
2164                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2165         fi
2166         if test $ol_enable_passwd = yes ; then
2167                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2168         fi
2169         if test $ol_enable_perl = yes ; then
2170                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
2171         fi
2172         if test $ol_enable_shell = yes ; then
2173                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2174         fi
2175         if test $ol_enable_tcl = yes ; then
2176                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
2177         fi
2178         if test $ol_enable_modules = yes ; then
2179                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2180         fi
2181         if test $ol_enable_multimaster = yes ; then
2182                 echo "configure: warning: slapd disabled, ignoring --enable-multimaster argument" 1>&2
2183         fi
2184         if test $ol_enable_wrappers = yes ; then
2185                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2186         fi
2187         if test $ol_enable_phonetic = yes ; then
2188                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2189         fi
2190         if test $ol_enable_quipu = yes ; then
2191                 echo "configure: warning: slapd disabled, ignoring --enable-quipu argument" 1>&2
2192         fi
2193         if test $ol_enable_rlookups = yes ; then
2194                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2195         fi
2196         if test $ol_enable_aci = yes ; then
2197                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2198         fi
2199         if test $ol_enable_discreteaci = yes ; then
2200                 echo "configure: warning: slapd disabled, ignoring --enable-discreteaci argument" 1>&2
2201         fi
2202         if test $ol_with_ldbm_api != auto ; then
2203                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2204         fi
2205         if test $ol_with_ldbm_type != auto ; then
2206                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2207         fi
2208         if test $ol_with_bdb2_module != static ; then
2209                 echo "configure: warning: slapd disabled, ignoring --with-bdb2-module argument" 1>&2
2210         fi
2211         if test $ol_with_ldap_module != static ; then
2212                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2213         fi
2214         if test $ol_with_ldbm_module != static ; then
2215                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2216         fi
2217         if test $ol_with_passwd_module != static ; then
2218                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2219         fi
2220         if test $ol_with_perl_module != static ; then
2221                 echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
2222         fi
2223         if test $ol_with_shell_module != static ; then
2224                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2225         fi
2226         if test $ol_with_tcl_module != static ; then
2227                 echo "configure: warning: slapd disabled, ignoring --with-tcl-module argument" 1>&2
2228         fi
2229         if test $ol_enable_slurpd = yes ; then
2230                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2231         fi
2232
2233         # force settings to no
2234         ol_enable_bdb2=no
2235         ol_enable_ldap=no
2236         ol_enable_ldbm=no
2237         ol_enable_passwd=no
2238         ol_enable_perl=no
2239         ol_enable_shell=no
2240         ol_enable_tcl=no
2241
2242         ol_enable_modules=no
2243         ol_enable_multimaster=no
2244         ol_enable_phonetic=no
2245         ol_enable_quipu=no
2246         ol_enable_rlookups=no
2247         ol_enable_aci=no
2248         ol_enable_discreteaci=no
2249         ol_enable_wrappers=no
2250
2251         ol_with_ldbm_api=no
2252         ol_with_ldbm_type=no
2253
2254         ol_with_bdb2_module=static
2255         ol_with_ldap_module=static
2256         ol_with_ldbm_module=static
2257         ol_with_passwd_module=static
2258         ol_with_perl_module=static
2259         ol_with_shell_module=static
2260         ol_with_tcl_module=static
2261
2262         ol_enable_slurpd=no
2263
2264 elif test $ol_enable_ldbm = no ; then
2265         
2266         if test $ol_with_ldbm_api != auto ; then
2267                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2268         fi
2269
2270         if test $ol_with_ldbm_type != auto ; then
2271                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2272         fi
2273
2274         if test $ol_with_ldbm_module != static ; then
2275                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2276         fi
2277
2278         if test $ol_enable_bdb2 = yes ; then
2279                 { echo "configure: error: BDB2 requires --enable-ldbm" 1>&2; exit 1; }
2280         fi
2281
2282         if test $ol_enable_modules != yes -a \
2283                 $ol_enable_ldap = no -a \
2284                 $ol_enable_passwd = no -a \
2285                 $ol_enable_perl = no -a \
2286                 $ol_enable_shell = no -a \
2287                 $ol_enable_tcl = no ; then
2288                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2289         fi
2290
2291         ol_with_ldbm_api=no
2292         ol_with_ldbm_type=no
2293         ol_with_ldbm_module=static
2294
2295 elif test $ol_enable_bdb2 = yes ; then
2296         
2297         if test $ol_with_ldbm_api != auto -a \
2298                 $ol_with_ldbm_api != db2 ; then
2299                 { echo "configure: error: BDB2 requires LDBM API DB2" 1>&2; exit 1; }
2300         fi
2301
2302         ol_with_ldbm_api=db2
2303
2304 else
2305         
2306         if test $ol_enable_bdb2 != no ; then
2307                 if test $ol_with_ldbm_api != auto -a \
2308                         $ol_with_ldbm_api != db2 ; then
2309                         echo "configure: warning: BDB2 requires LDBM api db2 or auto" 1>&2
2310                         ol_enable_bdb2=no
2311                 fi
2312         fi
2313
2314         if test $ol_with_ldbm_api = gdbm -a \
2315                 $ol_with_ldbm_type = btree ; then
2316                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2317         fi
2318         if test $ol_with_ldbm_api = mdbm -a \
2319                 $ol_with_ldbm_type = btree ; then
2320                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2321         fi
2322         if test $ol_with_ldbm_api = ndbm -a \
2323                 $ol_with_ldbm_type = btree ; then
2324                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2325         fi
2326 fi
2327
2328 if test $ol_enable_slurpd = yes ; then
2329                 if test $ol_with_threads = no ; then
2330                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2331         fi
2332 fi
2333
2334 echo "$ac_t""done" 1>&6
2335
2336 ## Initialize vars
2337 LDAP_LIBS=
2338 LDIF_LIBS=
2339 LDBM_LIBS=
2340 LTHREAD_LIBS=
2341 LUTIL_LIBS=
2342
2343 LDAPD_LIBS=
2344 SLAPD_LIBS=
2345 SLURPD_LIBS=
2346
2347 BUILD_LDAPD=no
2348 BUILD_SLAPD=no
2349 BUILD_SLURPD=no
2350
2351 BUILD_BDB2=no
2352 BUILD_LDAP=no
2353 BUILD_LDBM=no
2354 BUILD_PASSWD=no
2355 BUILD_PERL=no
2356 BUILD_QUIPU=no
2357 BUILD_SHELL=no
2358 BUILD_TCL=no
2359 BUILD_THREAD=no
2360
2361 BUILD_BDB2_DYNAMIC=static
2362 BUILD_LDAP_DYNAMIC=static
2363 BUILD_LDBM_DYNAMIC=static
2364 BUILD_PASSWD_DYNAMIC=static
2365 BUILD_PERL_DYNAMIC=static
2366 BUILD_SHELL_DYNAMIC=static
2367 BUILD_TCL_DYNAMIC=static
2368
2369 SLAPD_MODULES_LDFLAGS=
2370 SLAPD_MODULES_CPPFLAGS=
2371 SLAPD_MODULES_LIST=
2372
2373 SLAPD_PERL_LDFLAGS=
2374 SLAPD_PERL_CPPFLAGS=
2375
2376 KRB_LIBS=
2377 READLINE_LIBS=
2378 SASL_LIBS=
2379 TERMCAP_LIBS=
2380 TLS_LIBS=
2381 MODULES_LIBS=
2382
2383
2384
2385 cat >> confdefs.h <<\EOF
2386 #define HAVE_MKVERSION 1
2387 EOF
2388
2389
2390
2391
2392 ol_aix_threads=no
2393 case "$target" in
2394 *-*-aix*)       if test -z "$CC" ; then
2395                 case "$ol_with_threads" in
2396                 auto | yes |  posix) ol_aix_threads=yes ;;
2397                 esac
2398         fi
2399 ;;
2400 esac
2401
2402 if test $ol_aix_threads = yes ; then
2403         if test -z "${CC}" ; then
2404                 for ac_prog in cc_r xlc_r cc
2405 do
2406 # Extract the first word of "$ac_prog", so it can be a program name with args.
2407 set dummy $ac_prog; ac_word=$2
2408 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2409 echo "configure:2410: checking for $ac_word" >&5
2410 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2411   echo $ac_n "(cached) $ac_c" 1>&6
2412 else
2413   if test -n "$CC"; then
2414   ac_cv_prog_CC="$CC" # Let the user override the test.
2415 else
2416   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2417   ac_dummy="$PATH"
2418   for ac_dir in $ac_dummy; do
2419     test -z "$ac_dir" && ac_dir=.
2420     if test -f $ac_dir/$ac_word; then
2421       ac_cv_prog_CC="$ac_prog"
2422       break
2423     fi
2424   done
2425   IFS="$ac_save_ifs"
2426 fi
2427 fi
2428 CC="$ac_cv_prog_CC"
2429 if test -n "$CC"; then
2430   echo "$ac_t""$CC" 1>&6
2431 else
2432   echo "$ac_t""no" 1>&6
2433 fi
2434
2435 test -n "$CC" && break
2436 done
2437
2438
2439                 if test "$CC" = cc ; then
2440                                                 if test $ol_with_threads != auto ; then
2441                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2442                         else
2443                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2444                         fi
2445                         ol_with_threads=no
2446                 fi
2447         fi
2448
2449         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2450                 ol_with_threads=posix
2451                 ol_cv_pthread_create=yes
2452         fi
2453 fi
2454
2455 if test -z "${CC}"; then
2456         for ac_prog in cc
2457 do
2458 # Extract the first word of "$ac_prog", so it can be a program name with args.
2459 set dummy $ac_prog; ac_word=$2
2460 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2461 echo "configure:2462: checking for $ac_word" >&5
2462 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2463   echo $ac_n "(cached) $ac_c" 1>&6
2464 else
2465   if test -n "$CC"; then
2466   ac_cv_prog_CC="$CC" # Let the user override the test.
2467 else
2468   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2469   ac_dummy="$PATH"
2470   for ac_dir in $ac_dummy; do
2471     test -z "$ac_dir" && ac_dir=.
2472     if test -f $ac_dir/$ac_word; then
2473       ac_cv_prog_CC="$ac_prog"
2474       break
2475     fi
2476   done
2477   IFS="$ac_save_ifs"
2478 fi
2479 fi
2480 CC="$ac_cv_prog_CC"
2481 if test -n "$CC"; then
2482   echo "$ac_t""$CC" 1>&6
2483 else
2484   echo "$ac_t""no" 1>&6
2485 fi
2486
2487 test -n "$CC" && break
2488 done
2489
2490 fi
2491
2492
2493
2494 # Check whether --enable-fast-install or --disable-fast-install was given.
2495 if test "${enable_fast_install+set}" = set; then
2496   enableval="$enable_fast_install"
2497   p=${PACKAGE-default}
2498 case "$enableval" in
2499 yes) enable_fast_install=yes ;;
2500 no) enable_fast_install=no ;;
2501 *)
2502   enable_fast_install=no
2503   # Look at the argument we got.  We use all the common list separators.
2504   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2505   for pkg in $enableval; do
2506     if test "X$pkg" = "X$p"; then
2507       enable_fast_install=yes
2508     fi
2509   done
2510   IFS="$ac_save_ifs"
2511   ;;
2512 esac
2513 else
2514   enable_fast_install=yes
2515 fi
2516
2517 # Extract the first word of "ranlib", so it can be a program name with args.
2518 set dummy ranlib; ac_word=$2
2519 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2520 echo "configure:2521: checking for $ac_word" >&5
2521 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
2522   echo $ac_n "(cached) $ac_c" 1>&6
2523 else
2524   if test -n "$RANLIB"; then
2525   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2526 else
2527   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2528   ac_dummy="$PATH"
2529   for ac_dir in $ac_dummy; do
2530     test -z "$ac_dir" && ac_dir=.
2531     if test -f $ac_dir/$ac_word; then
2532       ac_cv_prog_RANLIB="ranlib"
2533       break
2534     fi
2535   done
2536   IFS="$ac_save_ifs"
2537   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2538 fi
2539 fi
2540 RANLIB="$ac_cv_prog_RANLIB"
2541 if test -n "$RANLIB"; then
2542   echo "$ac_t""$RANLIB" 1>&6
2543 else
2544   echo "$ac_t""no" 1>&6
2545 fi
2546
2547 # Extract the first word of "gcc", so it can be a program name with args.
2548 set dummy gcc; ac_word=$2
2549 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2550 echo "configure:2551: checking for $ac_word" >&5
2551 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2552   echo $ac_n "(cached) $ac_c" 1>&6
2553 else
2554   if test -n "$CC"; then
2555   ac_cv_prog_CC="$CC" # Let the user override the test.
2556 else
2557   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2558   ac_dummy="$PATH"
2559   for ac_dir in $ac_dummy; do
2560     test -z "$ac_dir" && ac_dir=.
2561     if test -f $ac_dir/$ac_word; then
2562       ac_cv_prog_CC="gcc"
2563       break
2564     fi
2565   done
2566   IFS="$ac_save_ifs"
2567 fi
2568 fi
2569 CC="$ac_cv_prog_CC"
2570 if test -n "$CC"; then
2571   echo "$ac_t""$CC" 1>&6
2572 else
2573   echo "$ac_t""no" 1>&6
2574 fi
2575
2576 if test -z "$CC"; then
2577   # Extract the first word of "cc", so it can be a program name with args.
2578 set dummy cc; ac_word=$2
2579 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2580 echo "configure:2581: checking for $ac_word" >&5
2581 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2582   echo $ac_n "(cached) $ac_c" 1>&6
2583 else
2584   if test -n "$CC"; then
2585   ac_cv_prog_CC="$CC" # Let the user override the test.
2586 else
2587   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2588   ac_prog_rejected=no
2589   ac_dummy="$PATH"
2590   for ac_dir in $ac_dummy; do
2591     test -z "$ac_dir" && ac_dir=.
2592     if test -f $ac_dir/$ac_word; then
2593       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2594         ac_prog_rejected=yes
2595         continue
2596       fi
2597       ac_cv_prog_CC="cc"
2598       break
2599     fi
2600   done
2601   IFS="$ac_save_ifs"
2602 if test $ac_prog_rejected = yes; then
2603   # We found a bogon in the path, so make sure we never use it.
2604   set dummy $ac_cv_prog_CC
2605   shift
2606   if test $# -gt 0; then
2607     # We chose a different compiler from the bogus one.
2608     # However, it has the same basename, so the bogon will be chosen
2609     # first if we set CC to just the basename; use the full file name.
2610     shift
2611     set dummy "$ac_dir/$ac_word" "$@"
2612     shift
2613     ac_cv_prog_CC="$@"
2614   fi
2615 fi
2616 fi
2617 fi
2618 CC="$ac_cv_prog_CC"
2619 if test -n "$CC"; then
2620   echo "$ac_t""$CC" 1>&6
2621 else
2622   echo "$ac_t""no" 1>&6
2623 fi
2624
2625   if test -z "$CC"; then
2626     case "`uname -s`" in
2627     *win32* | *WIN32* | *CYGWIN*)
2628       # Extract the first word of "cl", so it can be a program name with args.
2629 set dummy cl; ac_word=$2
2630 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2631 echo "configure:2632: checking for $ac_word" >&5
2632 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2633   echo $ac_n "(cached) $ac_c" 1>&6
2634 else
2635   if test -n "$CC"; then
2636   ac_cv_prog_CC="$CC" # Let the user override the test.
2637 else
2638   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2639   ac_dummy="$PATH"
2640   for ac_dir in $ac_dummy; do
2641     test -z "$ac_dir" && ac_dir=.
2642     if test -f $ac_dir/$ac_word; then
2643       ac_cv_prog_CC="cl"
2644       break
2645     fi
2646   done
2647   IFS="$ac_save_ifs"
2648 fi
2649 fi
2650 CC="$ac_cv_prog_CC"
2651 if test -n "$CC"; then
2652   echo "$ac_t""$CC" 1>&6
2653 else
2654   echo "$ac_t""no" 1>&6
2655 fi
2656  ;;
2657     esac
2658   fi
2659   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2660 fi
2661
2662 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2663 echo "configure:2664: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
2664
2665 ac_ext=c
2666 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2667 ac_cpp='$CPP $CPPFLAGS'
2668 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2669 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2670 cross_compiling=$ac_cv_prog_cc_cross
2671
2672 cat > conftest.$ac_ext << EOF
2673
2674 #line 2675 "configure"
2675 #include "confdefs.h"
2676
2677 main(){return(0);}
2678 EOF
2679 if { (eval echo configure:2680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2680   ac_cv_prog_cc_works=yes
2681   # If we can't run a trivial program, we are probably using a cross compiler.
2682   if (./conftest; exit) 2>/dev/null; then
2683     ac_cv_prog_cc_cross=no
2684   else
2685     ac_cv_prog_cc_cross=yes
2686   fi
2687 else
2688   echo "configure: failed program was:" >&5
2689   cat conftest.$ac_ext >&5
2690   ac_cv_prog_cc_works=no
2691 fi
2692 rm -fr conftest*
2693 ac_ext=c
2694 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2695 ac_cpp='$CPP $CPPFLAGS'
2696 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2697 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2698 cross_compiling=$ac_cv_prog_cc_cross
2699
2700 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2701 if test $ac_cv_prog_cc_works = no; then
2702   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2703 fi
2704 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2705 echo "configure:2706: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
2706 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2707 cross_compiling=$ac_cv_prog_cc_cross
2708
2709 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2710 echo "configure:2711: checking whether we are using GNU C" >&5
2711 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
2712   echo $ac_n "(cached) $ac_c" 1>&6
2713 else
2714   cat > conftest.c <<EOF
2715 #ifdef __GNUC__
2716   yes;
2717 #endif
2718 EOF
2719 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2720: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2720   ac_cv_prog_gcc=yes
2721 else
2722   ac_cv_prog_gcc=no
2723 fi
2724 fi
2725
2726 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2727
2728 if test $ac_cv_prog_gcc = yes; then
2729   GCC=yes
2730 else
2731   GCC=
2732 fi
2733
2734 ac_test_CFLAGS="${CFLAGS+set}"
2735 ac_save_CFLAGS="$CFLAGS"
2736 CFLAGS=
2737 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2738 echo "configure:2739: checking whether ${CC-cc} accepts -g" >&5
2739 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
2740   echo $ac_n "(cached) $ac_c" 1>&6
2741 else
2742   echo 'void f(){}' > conftest.c
2743 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2744   ac_cv_prog_cc_g=yes
2745 else
2746   ac_cv_prog_cc_g=no
2747 fi
2748 rm -f conftest*
2749
2750 fi
2751
2752 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2753 if test "$ac_test_CFLAGS" = set; then
2754   CFLAGS="$ac_save_CFLAGS"
2755 elif test $ac_cv_prog_cc_g = yes; then
2756   if test "$GCC" = yes; then
2757     CFLAGS="-g -O2"
2758   else
2759     CFLAGS="-g"
2760   fi
2761 else
2762   if test "$GCC" = yes; then
2763     CFLAGS="-O2"
2764   else
2765     CFLAGS=
2766   fi
2767 fi
2768
2769 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2770 if test "${with_gnu_ld+set}" = set; then
2771   withval="$with_gnu_ld"
2772   test "$withval" = no || with_gnu_ld=yes
2773 else
2774   with_gnu_ld=no
2775 fi
2776
2777 ac_prog=ld
2778 if test "$ac_cv_prog_gcc" = yes; then
2779   # Check if gcc -print-prog-name=ld gives a path.
2780   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2781 echo "configure:2782: checking for ld used by GCC" >&5
2782   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2783   case "$ac_prog" in
2784     # Accept absolute paths.
2785     [\\/]* | [A-Za-z]:[\\/]*)
2786       re_direlt='/[^/][^/]*/\.\./'
2787       # Canonicalize the path of ld
2788       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2789       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2790         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2791       done
2792       test -z "$LD" && LD="$ac_prog"
2793       ;;
2794   "")
2795     # If it fails, then pretend we aren't using GCC.
2796     ac_prog=ld
2797     ;;
2798   *)
2799     # If it is relative, then search for the first ld in PATH.
2800     with_gnu_ld=unknown
2801     ;;
2802   esac
2803 elif test "$with_gnu_ld" = yes; then
2804   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2805 echo "configure:2806: checking for GNU ld" >&5
2806 else
2807   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2808 echo "configure:2809: checking for non-GNU ld" >&5
2809 fi
2810 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
2811   echo $ac_n "(cached) $ac_c" 1>&6
2812 else
2813   if test -z "$LD"; then
2814   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2815   for ac_dir in $PATH; do
2816     test -z "$ac_dir" && ac_dir=.
2817     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2818       ac_cv_path_LD="$ac_dir/$ac_prog"
2819       # Check to see if the program is GNU ld.  I'd rather use --version,
2820       # but apparently some GNU ld's only accept -v.
2821       # Break only if it was the GNU/non-GNU ld that we prefer.
2822       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2823         test "$with_gnu_ld" != no && break
2824       else
2825         test "$with_gnu_ld" != yes && break
2826       fi
2827     fi
2828   done
2829   IFS="$ac_save_ifs"
2830 else
2831   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2832 fi
2833 fi
2834
2835 LD="$ac_cv_path_LD"
2836 if test -n "$LD"; then
2837   echo "$ac_t""$LD" 1>&6
2838 else
2839   echo "$ac_t""no" 1>&6
2840 fi
2841 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2842
2843 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2844 echo "configure:2845: checking if the linker ($LD) is GNU ld" >&5
2845 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
2846   echo $ac_n "(cached) $ac_c" 1>&6
2847 else
2848   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2849 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2850   ac_cv_prog_gnu_ld=yes
2851 else
2852   ac_cv_prog_gnu_ld=no
2853 fi
2854 fi
2855
2856 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2857
2858
2859 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2860 echo "configure:2861: checking for BSD-compatible nm" >&5
2861 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
2862   echo $ac_n "(cached) $ac_c" 1>&6
2863 else
2864   if test -n "$NM"; then
2865   # Let the user override the test.
2866   ac_cv_path_NM="$NM"
2867 else
2868   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2869   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
2870     test -z "$ac_dir" && ac_dir=.
2871     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
2872       # Check to see if the nm accepts a BSD-compat flag.
2873       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2874       #   nm: unknown option "B" ignored
2875       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2876         ac_cv_path_NM="$ac_dir/nm -B"
2877         break
2878       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2879         ac_cv_path_NM="$ac_dir/nm -p"
2880         break
2881       else
2882         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
2883         continue # so that we can try to find one that supports BSD flags
2884       fi
2885     fi
2886   done
2887   IFS="$ac_save_ifs"
2888   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2889 fi
2890 fi
2891
2892 NM="$ac_cv_path_NM"
2893 echo "$ac_t""$NM" 1>&6
2894
2895
2896 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2897 echo "configure:2898: checking whether ln -s works" >&5
2898 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
2899   echo $ac_n "(cached) $ac_c" 1>&6
2900 else
2901   rm -f conftestdata
2902 if ln -s X conftestdata 2>/dev/null
2903 then
2904   rm -f conftestdata
2905   ac_cv_prog_LN_S="ln -s"
2906 else
2907   ac_cv_prog_LN_S=ln
2908 fi
2909 fi
2910 LN_S="$ac_cv_prog_LN_S"
2911 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2912   echo "$ac_t""yes" 1>&6
2913 else
2914   echo "$ac_t""no" 1>&6
2915 fi
2916
2917
2918 # Check for any special flags to pass to ltconfig.
2919 libtool_flags="--cache-file=$cache_file"
2920 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2921 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2922 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
2923 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2924 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2925 libtool_flags="$libtool_flags --enable-dlopen"
2926
2927 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
2928 if test "${enable_libtool_lock+set}" = set; then
2929   enableval="$enable_libtool_lock"
2930   :
2931 fi
2932
2933 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
2934 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
2935
2936 # Some flags need to be propagated to the compiler or linker for good
2937 # libtool support.
2938 case "$host" in
2939 *-*-irix6*)
2940   # Find out which ABI we are using.
2941   echo '#line 2942 "configure"' > conftest.$ac_ext
2942   if { (eval echo configure:2943: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2943     case "`/usr/bin/file conftest.o`" in
2944     *32-bit*)
2945       LD="${LD-ld} -32"
2946       ;;
2947     *N32*)
2948       LD="${LD-ld} -n32"
2949       ;;
2950     *64-bit*)
2951       LD="${LD-ld} -64"
2952       ;;
2953     esac
2954   fi
2955   rm -rf conftest*
2956   ;;
2957
2958 *-*-sco3.2v5*)
2959   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2960   SAVE_CFLAGS="$CFLAGS"
2961   CFLAGS="$CFLAGS -belf"
2962   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
2963 echo "configure:2964: checking whether the C compiler needs -belf" >&5
2964 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
2965   echo $ac_n "(cached) $ac_c" 1>&6
2966 else
2967   cat > conftest.$ac_ext <<EOF
2968 #line 2969 "configure"
2969 #include "confdefs.h"
2970
2971 int main() {
2972
2973 ; return 0; }
2974 EOF
2975 if { (eval echo configure:2976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2976   rm -rf conftest*
2977   lt_cv_cc_needs_belf=yes
2978 else
2979   echo "configure: failed program was:" >&5
2980   cat conftest.$ac_ext >&5
2981   rm -rf conftest*
2982   lt_cv_cc_needs_belf=no
2983 fi
2984 rm -f conftest*
2985 fi
2986
2987 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
2988   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2989     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2990     CFLAGS="$SAVE_CFLAGS"
2991   fi
2992   ;;
2993
2994
2995 esac
2996
2997
2998 # Save cache, so that ltconfig can load it
2999
3000
3001 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
3002 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
3003 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
3004 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
3005 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
3006 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
3007 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
3008 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
3009
3010 # Reload cache, that may have been modified by ltconfig
3011
3012
3013 # This can be used to rebuild libtool when needed
3014 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
3015
3016 # Always use our own libtool.
3017 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3018
3019 # Redirect the config.log output again, so that the ltconfig log is not
3020 # clobbered by the next message.
3021 exec 5>>./config.log
3022
3023
3024 for ac_prog in mawk gawk nawk awk
3025 do
3026 # Extract the first word of "$ac_prog", so it can be a program name with args.
3027 set dummy $ac_prog; ac_word=$2
3028 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3029 echo "configure:3030: checking for $ac_word" >&5
3030 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
3031   echo $ac_n "(cached) $ac_c" 1>&6
3032 else
3033   if test -n "$AWK"; then
3034   ac_cv_prog_AWK="$AWK" # Let the user override the test.
3035 else
3036   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3037   ac_dummy="$PATH"
3038   for ac_dir in $ac_dummy; do
3039     test -z "$ac_dir" && ac_dir=.
3040     if test -f $ac_dir/$ac_word; then
3041       ac_cv_prog_AWK="$ac_prog"
3042       break
3043     fi
3044   done
3045   IFS="$ac_save_ifs"
3046 fi
3047 fi
3048 AWK="$ac_cv_prog_AWK"
3049 if test -n "$AWK"; then
3050   echo "$ac_t""$AWK" 1>&6
3051 else
3052   echo "$ac_t""no" 1>&6
3053 fi
3054
3055 test -n "$AWK" && break
3056 done
3057
3058 # test for ln hardlink support
3059 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
3060 echo "configure:3061: checking whether ln works" >&5
3061 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
3062   echo $ac_n "(cached) $ac_c" 1>&6
3063 else
3064   rm -f conftest.src conftest.dst
3065 echo "conftest" > conftest.src
3066 if ln conftest.src conftest.dst 2>/dev/null
3067 then
3068   ol_cv_prog_LN_H="ln"
3069 else
3070   ol_cv_prog_LN_H="cp"
3071 fi
3072 rm -f conftest.src conftest.dst
3073
3074 fi
3075 LN_H="$ol_cv_prog_LN_H"
3076 if test "$ol_cv_prog_LN_H" = "ln"; then
3077         echo "$ac_t""yes" 1>&6
3078 else
3079         echo "$ac_t""no" 1>&6
3080 fi
3081
3082 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3083 echo "configure:3084: checking whether ln -s works" >&5
3084 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3085   echo $ac_n "(cached) $ac_c" 1>&6
3086 else
3087   rm -f conftestdata
3088 if ln -s X conftestdata 2>/dev/null
3089 then
3090   rm -f conftestdata
3091   ac_cv_prog_LN_S="ln -s"
3092 else
3093   ac_cv_prog_LN_S=ln
3094 fi
3095 fi
3096 LN_S="$ac_cv_prog_LN_S"
3097 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3098   echo "$ac_t""yes" 1>&6
3099 else
3100   echo "$ac_t""no" 1>&6
3101 fi
3102
3103
3104 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
3105         LN_S="$LN_H"
3106 fi
3107
3108 # Extract the first word of "sendmail", so it can be a program name with args.
3109 set dummy sendmail; ac_word=$2
3110 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3111 echo "configure:3112: checking for $ac_word" >&5
3112 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
3113   echo $ac_n "(cached) $ac_c" 1>&6
3114 else
3115   case "$SENDMAIL" in
3116   /*)
3117   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
3118   ;;
3119   ?:/*)                  
3120   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
3121   ;;
3122   *)
3123   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3124   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
3125   for ac_dir in $ac_dummy; do 
3126     test -z "$ac_dir" && ac_dir=.
3127     if test -f $ac_dir/$ac_word; then
3128       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
3129       break
3130     fi
3131   done
3132   IFS="$ac_save_ifs"
3133   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
3134   ;;
3135 esac
3136 fi
3137 SENDMAIL="$ac_cv_path_SENDMAIL"
3138 if test -n "$SENDMAIL"; then
3139   echo "$ac_t""$SENDMAIL" 1>&6
3140 else
3141   echo "$ac_t""no" 1>&6
3142 fi
3143
3144 # Extract the first word of "vi", so it can be a program name with args.
3145 set dummy vi; ac_word=$2
3146 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3147 echo "configure:3148: checking for $ac_word" >&5
3148 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
3149   echo $ac_n "(cached) $ac_c" 1>&6
3150 else
3151   case "$EDITOR" in
3152   /*)
3153   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
3154   ;;
3155   ?:/*)                  
3156   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
3157   ;;
3158   *)
3159   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3160   ac_dummy="$PATH:/usr/ucb"
3161   for ac_dir in $ac_dummy; do 
3162     test -z "$ac_dir" && ac_dir=.
3163     if test -f $ac_dir/$ac_word; then
3164       ac_cv_path_EDITOR="$ac_dir/$ac_word"
3165       break
3166     fi
3167   done
3168   IFS="$ac_save_ifs"
3169   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
3170   ;;
3171 esac
3172 fi
3173 EDITOR="$ac_cv_path_EDITOR"
3174 if test -n "$EDITOR"; then
3175   echo "$ac_t""$EDITOR" 1>&6
3176 else
3177   echo "$ac_t""no" 1>&6
3178 fi
3179
3180 # Extract the first word of "finger", so it can be a program name with args.
3181 set dummy finger; ac_word=$2
3182 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3183 echo "configure:3184: checking for $ac_word" >&5
3184 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
3185   echo $ac_n "(cached) $ac_c" 1>&6
3186 else
3187   case "$FINGER" in
3188   /*)
3189   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
3190   ;;
3191   ?:/*)                  
3192   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
3193   ;;
3194   *)
3195   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3196   ac_dummy="$PATH:/usr/ucb"
3197   for ac_dir in $ac_dummy; do 
3198     test -z "$ac_dir" && ac_dir=.
3199     if test -f $ac_dir/$ac_word; then
3200       ac_cv_path_FINGER="$ac_dir/$ac_word"
3201       break
3202     fi
3203   done
3204   IFS="$ac_save_ifs"
3205   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
3206   ;;
3207 esac
3208 fi
3209 FINGER="$ac_cv_path_FINGER"
3210 if test -n "$FINGER"; then
3211   echo "$ac_t""$FINGER" 1>&6
3212 else
3213   echo "$ac_t""no" 1>&6
3214 fi
3215
3216
3217 ol_link_perl=no
3218 if test $ol_enable_perl != no ; then
3219         # Extract the first word of "perl", so it can be a program name with args.
3220 set dummy perl; ac_word=$2
3221 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3222 echo "configure:3223: checking for $ac_word" >&5
3223 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
3224   echo $ac_n "(cached) $ac_c" 1>&6
3225 else
3226   case "$PERLBIN" in
3227   /*)
3228   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
3229   ;;
3230   ?:/*)                  
3231   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
3232   ;;
3233   *)
3234   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3235   ac_dummy="$PATH"
3236   for ac_dir in $ac_dummy; do 
3237     test -z "$ac_dir" && ac_dir=.
3238     if test -f $ac_dir/$ac_word; then
3239       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
3240       break
3241     fi
3242   done
3243   IFS="$ac_save_ifs"
3244   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
3245   ;;
3246 esac
3247 fi
3248 PERLBIN="$ac_cv_path_PERLBIN"
3249 if test -n "$PERLBIN"; then
3250   echo "$ac_t""$PERLBIN" 1>&6
3251 else
3252   echo "$ac_t""no" 1>&6
3253 fi
3254
3255
3256         if test "no$PERLBIN" = "no" ; then
3257                 if test $ol_enable_perl = yes ; then
3258                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
3259                 fi
3260
3261         else
3262                 SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3263                 SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
3264
3265                                 ol_link_perl=yes
3266         fi
3267 fi
3268
3269 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3270 echo "configure:3271: checking how to run the C preprocessor" >&5
3271 # On Suns, sometimes $CPP names a directory.
3272 if test -n "$CPP" && test -d "$CPP"; then
3273   CPP=
3274 fi
3275 if test -z "$CPP"; then
3276 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3277   echo $ac_n "(cached) $ac_c" 1>&6
3278 else
3279     # This must be in double quotes, not single quotes, because CPP may get
3280   # substituted into the Makefile and "${CC-cc}" will confuse make.
3281   CPP="${CC-cc} -E"
3282   # On the NeXT, cc -E runs the code through the compiler's parser,
3283   # not just through cpp.
3284   cat > conftest.$ac_ext <<EOF
3285 #line 3286 "configure"
3286 #include "confdefs.h"
3287 #include <assert.h>
3288 Syntax Error
3289 EOF
3290 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3291 { (eval echo configure:3292: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3292 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3293 if test -z "$ac_err"; then
3294   :
3295 else
3296   echo "$ac_err" >&5
3297   echo "configure: failed program was:" >&5
3298   cat conftest.$ac_ext >&5
3299   rm -rf conftest*
3300   CPP="${CC-cc} -E -traditional-cpp"
3301   cat > conftest.$ac_ext <<EOF
3302 #line 3303 "configure"
3303 #include "confdefs.h"
3304 #include <assert.h>
3305 Syntax Error
3306 EOF
3307 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3308 { (eval echo configure:3309: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3309 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3310 if test -z "$ac_err"; then
3311   :
3312 else
3313   echo "$ac_err" >&5
3314   echo "configure: failed program was:" >&5
3315   cat conftest.$ac_ext >&5
3316   rm -rf conftest*
3317   CPP="${CC-cc} -nologo -E"
3318   cat > conftest.$ac_ext <<EOF
3319 #line 3320 "configure"
3320 #include "confdefs.h"
3321 #include <assert.h>
3322 Syntax Error
3323 EOF
3324 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3325 { (eval echo configure:3326: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3326 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3327 if test -z "$ac_err"; then
3328   :
3329 else
3330   echo "$ac_err" >&5
3331   echo "configure: failed program was:" >&5
3332   cat conftest.$ac_ext >&5
3333   rm -rf conftest*
3334   CPP=/lib/cpp
3335 fi
3336 rm -f conftest*
3337 fi
3338 rm -f conftest*
3339 fi
3340 rm -f conftest*
3341   ac_cv_prog_CPP="$CPP"
3342 fi
3343   CPP="$ac_cv_prog_CPP"
3344 else
3345   ac_cv_prog_CPP="$CPP"
3346 fi
3347 echo "$ac_t""$CPP" 1>&6
3348
3349
3350 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3351         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3352
3353 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3354         echo "configure: warning: programs compiled here do run here..." 1>&2
3355         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3356
3357 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3358         echo "configure: warning: programs compiled here do not run here..." 1>&2
3359         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3360 fi
3361
3362 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3363 echo "configure:3364: checking for AIX" >&5
3364 cat > conftest.$ac_ext <<EOF
3365 #line 3366 "configure"
3366 #include "confdefs.h"
3367 #ifdef _AIX
3368   yes
3369 #endif
3370
3371 EOF
3372 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3373   egrep "yes" >/dev/null 2>&1; then
3374   rm -rf conftest*
3375   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3376 #define _ALL_SOURCE 1
3377 EOF
3378
3379 else
3380   rm -rf conftest*
3381   echo "$ac_t""no" 1>&6
3382 fi
3383 rm -f conftest*
3384
3385
3386 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3387 echo "configure:3388: checking for POSIXized ISC" >&5
3388 if test -d /etc/conf/kconfig.d &&
3389   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3390 then
3391   echo "$ac_t""yes" 1>&6
3392   ISC=yes # If later tests want to check for ISC.
3393   cat >> confdefs.h <<\EOF
3394 #define _POSIX_SOURCE 1
3395 EOF
3396
3397   if test "$GCC" = yes; then
3398     CC="$CC -posix"
3399   else
3400     CC="$CC -Xp"
3401   fi
3402 else
3403   echo "$ac_t""no" 1>&6
3404   ISC=
3405 fi
3406
3407 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3408 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3409 echo "configure:3410: checking for minix/config.h" >&5
3410 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3411   echo $ac_n "(cached) $ac_c" 1>&6
3412 else
3413   cat > conftest.$ac_ext <<EOF
3414 #line 3415 "configure"
3415 #include "confdefs.h"
3416 #include <minix/config.h>
3417 EOF
3418 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3419 { (eval echo configure:3420: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3420 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3421 if test -z "$ac_err"; then
3422   rm -rf conftest*
3423   eval "ac_cv_header_$ac_safe=yes"
3424 else
3425   echo "$ac_err" >&5
3426   echo "configure: failed program was:" >&5
3427   cat conftest.$ac_ext >&5
3428   rm -rf conftest*
3429   eval "ac_cv_header_$ac_safe=no"
3430 fi
3431 rm -f conftest*
3432 fi
3433 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3434   echo "$ac_t""yes" 1>&6
3435   MINIX=yes
3436 else
3437   echo "$ac_t""no" 1>&6
3438 MINIX=
3439 fi
3440
3441 if test "$MINIX" = yes; then
3442   cat >> confdefs.h <<\EOF
3443 #define _POSIX_SOURCE 1
3444 EOF
3445
3446   cat >> confdefs.h <<\EOF
3447 #define _POSIX_1_SOURCE 2
3448 EOF
3449
3450   cat >> confdefs.h <<\EOF
3451 #define _MINIX 1
3452 EOF
3453
3454 fi
3455
3456
3457 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3458 echo "configure:3459: checking for Cygwin environment" >&5
3459 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
3460   echo $ac_n "(cached) $ac_c" 1>&6
3461 else
3462   cat > conftest.$ac_ext <<EOF
3463 #line 3464 "configure"
3464 #include "confdefs.h"
3465
3466 int main() {
3467
3468 #ifndef __CYGWIN__
3469 #define __CYGWIN__ __CYGWIN32__
3470 #endif
3471 return __CYGWIN__;
3472 ; return 0; }
3473 EOF
3474 if { (eval echo configure:3475: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3475   rm -rf conftest*
3476   ac_cv_cygwin=yes
3477 else
3478   echo "configure: failed program was:" >&5
3479   cat conftest.$ac_ext >&5
3480   rm -rf conftest*
3481   ac_cv_cygwin=no
3482 fi
3483 rm -f conftest*
3484 fi
3485
3486 echo "$ac_t""$ac_cv_cygwin" 1>&6
3487 CYGWIN=
3488 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3489 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3490 echo "configure:3491: checking for mingw32 environment" >&5
3491 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
3492   echo $ac_n "(cached) $ac_c" 1>&6
3493 else
3494   cat > conftest.$ac_ext <<EOF
3495 #line 3496 "configure"
3496 #include "confdefs.h"
3497
3498 int main() {
3499 return __MINGW32__;
3500 ; return 0; }
3501 EOF
3502 if { (eval echo configure:3503: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3503   rm -rf conftest*
3504   ac_cv_mingw32=yes
3505 else
3506   echo "configure: failed program was:" >&5
3507   cat conftest.$ac_ext >&5
3508   rm -rf conftest*
3509   ac_cv_mingw32=no
3510 fi
3511 rm -f conftest*
3512 fi
3513
3514 echo "$ac_t""$ac_cv_mingw32" 1>&6
3515 MINGW32=
3516 test "$ac_cv_mingw32" = yes && MINGW32=yes
3517 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
3518 echo "configure:3519: checking for EMX OS/2 environment" >&5
3519 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
3520   echo $ac_n "(cached) $ac_c" 1>&6
3521 else
3522   cat > conftest.$ac_ext <<EOF
3523 #line 3524 "configure"
3524 #include "confdefs.h"
3525
3526 int main() {
3527 return __EMX__;
3528 ; return 0; }
3529 EOF
3530 if { (eval echo configure:3531: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3531   rm -rf conftest*
3532   ac_cv_emxos2=yes
3533 else
3534   echo "configure: failed program was:" >&5
3535   cat conftest.$ac_ext >&5
3536   rm -rf conftest*
3537   ac_cv_emxos2=no
3538 fi
3539 rm -f conftest*
3540 fi
3541
3542 echo "$ac_t""$ac_cv_emxos2" 1>&6
3543 EMXOS2=
3544 test "$ac_cv_emxos2" = yes && EMXOS2=yes
3545
3546
3547
3548 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
3549 echo "configure:3550: checking for executable suffix" >&5
3550 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
3551   echo $ac_n "(cached) $ac_c" 1>&6
3552 else
3553   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
3554   ac_cv_exeext=.exe
3555 else
3556   rm -f conftest*
3557   echo 'int main () { return 0; }' > conftest.$ac_ext
3558   ac_cv_exeext=
3559   if { (eval echo configure:3560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
3560     for file in conftest.*; do
3561       case $file in
3562       *.c | *.C | *.o | *.obj | *.xcoff) ;;
3563       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
3564       esac
3565     done
3566   else
3567     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
3568   fi
3569   rm -f conftest*
3570   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
3571 fi
3572 fi
3573
3574 EXEEXT=""
3575 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
3576 echo "$ac_t""${ac_cv_exeext}" 1>&6
3577 ac_exeext=$EXEEXT
3578
3579 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3580 echo "configure:3581: checking for object suffix" >&5
3581 if eval "test \"\${ac_cv_objext+set}\" = set"; then
3582   echo $ac_n "(cached) $ac_c" 1>&6
3583 else
3584   rm -f conftest*
3585 echo 'int i = 1;' > conftest.$ac_ext
3586 if { (eval echo configure:3587: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3587   for ac_file in conftest.*; do
3588     case $ac_file in
3589     *.c) ;;
3590     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
3591     esac
3592   done
3593 else
3594   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
3595 fi
3596 rm -f conftest*
3597 fi
3598
3599 echo "$ac_t""$ac_cv_objext" 1>&6
3600 OBJEXT=$ac_cv_objext
3601 ac_objext=$ac_cv_objext
3602
3603
3604 cat >> confdefs.h <<EOF
3605 #define EXEEXT "${EXEEXT}"
3606 EOF
3607
3608
3609 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
3610 echo "configure:3611: checking for be_app in -lbe" >&5
3611 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
3612 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3613   echo $ac_n "(cached) $ac_c" 1>&6
3614 else
3615   ac_save_LIBS="$LIBS"
3616 LIBS="-lbe -lroot -lnet $LIBS"
3617 cat > conftest.$ac_ext <<EOF
3618 #line 3619 "configure"
3619 #include "confdefs.h"
3620 /* Override any gcc2 internal prototype to avoid an error.  */
3621 /* We use char because int might match the return type of a gcc2
3622     builtin and then its argument prototype would still apply.  */
3623 char be_app();
3624
3625 int main() {
3626 be_app()
3627 ; return 0; }
3628 EOF
3629 if { (eval echo configure:3630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3630   rm -rf conftest*
3631   eval "ac_cv_lib_$ac_lib_var=yes"
3632 else
3633   echo "configure: failed program was:" >&5
3634   cat conftest.$ac_ext >&5
3635   rm -rf conftest*
3636   eval "ac_cv_lib_$ac_lib_var=no"
3637 fi
3638 rm -f conftest*
3639 LIBS="$ac_save_LIBS"
3640
3641 fi
3642 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3643   echo "$ac_t""yes" 1>&6
3644   LIBS="$LIBS -lbe -lroot -lnet"
3645 else
3646   echo "$ac_t""no" 1>&6
3647 :
3648 fi
3649
3650
3651
3652
3653
3654 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
3655 echo "configure:3656: checking for ${CC-cc} option to accept ANSI C" >&5
3656 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
3657   echo $ac_n "(cached) $ac_c" 1>&6
3658 else
3659   am_cv_prog_cc_stdc=no
3660 ac_save_CC="$CC"
3661 # Don't try gcc -ansi; that turns off useful extensions and
3662 # breaks some systems' header files.
3663 # AIX                   -qlanglvl=ansi
3664 # Ultrix and OSF/1      -std1
3665 # HP-UX 10.20 and later -Ae
3666 # HP-UX older versions  -Aa -D_HPUX_SOURCE
3667 # SVR4                  -Xc -D__EXTENSIONS__
3668 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3669 do
3670   CC="$ac_save_CC $ac_arg"
3671   cat > conftest.$ac_ext <<EOF
3672 #line 3673 "configure"
3673 #include "confdefs.h"
3674 #include <stdarg.h>
3675 #include <stdio.h>
3676 #include <sys/types.h>
3677 #include <sys/stat.h>
3678 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3679 struct buf { int x; };
3680 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3681 static char *e (p, i)
3682      char **p;
3683      int i;
3684 {
3685   return p[i];
3686 }
3687 static char *f (char * (*g) (char **, int), char **p, ...)
3688 {
3689   char *s;
3690   va_list v;
3691   va_start (v,p);
3692   s = g (p, va_arg (v,int));
3693   va_end (v);
3694   return s;
3695 }
3696 int test (int i, double x);
3697 struct s1 {int (*f) (int a);};
3698 struct s2 {int (*f) (double a);};
3699 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3700 int argc;
3701 char **argv;
3702
3703 int main() {
3704
3705 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3706
3707 ; return 0; }
3708 EOF
3709 if { (eval echo configure:3710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3710   rm -rf conftest*
3711   am_cv_prog_cc_stdc="$ac_arg"; break
3712 else
3713   echo "configure: failed program was:" >&5
3714   cat conftest.$ac_ext >&5
3715 fi
3716 rm -f conftest*
3717 done
3718 CC="$ac_save_CC"
3719
3720 fi
3721
3722 if test -z "$am_cv_prog_cc_stdc"; then
3723   echo "$ac_t""none needed" 1>&6
3724 else
3725   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
3726 fi
3727 case "x$am_cv_prog_cc_stdc" in
3728   x|xno) ;;
3729   *) CC="$CC $am_cv_prog_cc_stdc" ;;
3730 esac
3731
3732 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
3733         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
3734 fi
3735
3736 # test for make depend flag
3737 OL_MKDEP=
3738 OL_MKDEP_FLAGS=
3739 if test -z "${MKDEP}"; then
3740         OL_MKDEP="${CC-cc}"
3741         if test -z "${MKDEP_FLAGS}"; then
3742                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
3743 echo "configure:3744: checking for ${OL_MKDEP} depend flag" >&5
3744 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
3745   echo $ac_n "(cached) $ac_c" 1>&6
3746 else
3747   
3748                         ol_cv_mkdep=no
3749                         for flag in "-M" "-xM"; do
3750                                 cat > conftest.c <<EOF
3751  noCode;
3752 EOF
3753                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
3754                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
3755                                 then
3756                                         if test ! -f conftest."${ac_object}" ; then
3757                                                 ol_cv_mkdep=$flag
3758                                                 OL_MKDEP_FLAGS="$flag"
3759                                                 break
3760                                         fi
3761                                 fi
3762                         done
3763                         rm -f conftest*
3764                 
3765 fi
3766
3767 echo "$ac_t""$ol_cv_mkdep" 1>&6
3768         else
3769                 cc_cv_mkdep=yes
3770                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3771         fi
3772 else
3773         cc_cv_mkdep=yes
3774         OL_MKDEP="${MKDEP}"
3775         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3776 fi
3777
3778
3779
3780 if test "${ol_cv_mkdep}" = no ; then
3781         # this will soon become an error
3782         echo "configure: warning: do not know how to generate dependencies" 1>&2
3783 fi
3784
3785 ol_link_modules=no
3786 if test $ol_enable_modules != no ; then
3787         for ac_hdr in ltdl.h
3788 do
3789 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3790 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3791 echo "configure:3792: checking for $ac_hdr" >&5
3792 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3793   echo $ac_n "(cached) $ac_c" 1>&6
3794 else
3795   cat > conftest.$ac_ext <<EOF
3796 #line 3797 "configure"
3797 #include "confdefs.h"
3798 #include <$ac_hdr>
3799 EOF
3800 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3801 { (eval echo configure:3802: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3802 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3803 if test -z "$ac_err"; then
3804   rm -rf conftest*
3805   eval "ac_cv_header_$ac_safe=yes"
3806 else
3807   echo "$ac_err" >&5
3808   echo "configure: failed program was:" >&5
3809   cat conftest.$ac_ext >&5
3810   rm -rf conftest*
3811   eval "ac_cv_header_$ac_safe=no"
3812 fi
3813 rm -f conftest*
3814 fi
3815 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3816   echo "$ac_t""yes" 1>&6
3817     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3818   cat >> confdefs.h <<EOF
3819 #define $ac_tr_hdr 1
3820 EOF
3821  
3822 else
3823   echo "$ac_t""no" 1>&6
3824 fi
3825 done
3826
3827
3828         if test $ac_cv_header_ltdl_h = no ; then
3829                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
3830
3831         fi
3832
3833         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
3834 echo "configure:3835: checking for lt_dlinit in -lltdl" >&5
3835 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
3836 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3837   echo $ac_n "(cached) $ac_c" 1>&6
3838 else
3839   ac_save_LIBS="$LIBS"
3840 LIBS="-lltdl  $LIBS"
3841 cat > conftest.$ac_ext <<EOF
3842 #line 3843 "configure"
3843 #include "confdefs.h"
3844 /* Override any gcc2 internal prototype to avoid an error.  */
3845 /* We use char because int might match the return type of a gcc2
3846     builtin and then its argument prototype would still apply.  */
3847 char lt_dlinit();
3848
3849 int main() {
3850 lt_dlinit()
3851 ; return 0; }
3852 EOF
3853 if { (eval echo configure:3854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3854   rm -rf conftest*
3855   eval "ac_cv_lib_$ac_lib_var=yes"
3856 else
3857   echo "configure: failed program was:" >&5
3858   cat conftest.$ac_ext >&5
3859   rm -rf conftest*
3860   eval "ac_cv_lib_$ac_lib_var=no"
3861 fi
3862 rm -f conftest*
3863 LIBS="$ac_save_LIBS"
3864
3865 fi
3866 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3867   echo "$ac_t""yes" 1>&6
3868     ac_tr_lib=HAVE_LIB`echo ltdl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3869     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3870   cat >> confdefs.h <<EOF
3871 #define $ac_tr_lib 1
3872 EOF
3873
3874   LIBS="-lltdl $LIBS"
3875
3876 else
3877   echo "$ac_t""no" 1>&6
3878 fi
3879
3880         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
3881                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
3882         fi
3883         ol_link_modules=yes
3884 else
3885         ol_with_bdb2_module=static
3886         ol_with_ldap_module=static
3887         ol_with_ldbm_module=static
3888         ol_with_passwd_module=static
3889         ol_with_perl_module=static
3890         ol_with_shell_module=static
3891         ol_with_tcl_module=static
3892 fi
3893
3894 # test for EBCDIC
3895 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
3896 echo "configure:3897: checking for EBCDIC" >&5
3897 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
3898   echo $ac_n "(cached) $ac_c" 1>&6
3899 else
3900   
3901         cat > conftest.$ac_ext <<EOF
3902 #line 3903 "configure"
3903 #include "confdefs.h"
3904
3905 #if !('M' == 0xd4)
3906 #include <__ASCII__/generate_error.h>
3907 #endif
3908
3909 EOF
3910 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3911 { (eval echo configure:3912: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3912 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3913 if test -z "$ac_err"; then
3914   rm -rf conftest*
3915   ol_cv_cpp_ebcdic=yes
3916 else
3917   echo "$ac_err" >&5
3918   echo "configure: failed program was:" >&5
3919   cat conftest.$ac_ext >&5
3920   rm -rf conftest*
3921   ol_cv_cpp_ebcdic=no
3922 fi
3923 rm -f conftest*
3924 fi
3925
3926 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
3927 if test $ol_cv_cpp_ebcdic = yes ; then
3928         cat >> confdefs.h <<\EOF
3929 #define HAVE_EBCDIC 1
3930 EOF
3931
3932 fi
3933
3934 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3935 echo "configure:3936: checking for ANSI C header files" >&5
3936 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
3937   echo $ac_n "(cached) $ac_c" 1>&6
3938 else
3939   cat > conftest.$ac_ext <<EOF
3940 #line 3941 "configure"
3941 #include "confdefs.h"
3942 #include <stdlib.h>
3943 #include <stdarg.h>
3944 #include <string.h>
3945 #include <float.h>
3946 EOF
3947 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3948 { (eval echo configure:3949: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3949 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3950 if test -z "$ac_err"; then
3951   rm -rf conftest*
3952   ol_cv_header_stdc=yes
3953 else
3954   echo "$ac_err" >&5
3955   echo "configure: failed program was:" >&5
3956   cat conftest.$ac_ext >&5
3957   rm -rf conftest*
3958   ol_cv_header_stdc=no
3959 fi
3960 rm -f conftest*
3961
3962 if test $ol_cv_header_stdc = yes; then
3963   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3964 cat > conftest.$ac_ext <<EOF
3965 #line 3966 "configure"
3966 #include "confdefs.h"
3967 #include <string.h>
3968 EOF
3969 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3970   egrep "memchr" >/dev/null 2>&1; then
3971   :
3972 else
3973   rm -rf conftest*
3974   ol_cv_header_stdc=no
3975 fi
3976 rm -f conftest*
3977
3978 fi
3979
3980 if test $ol_cv_header_stdc = yes; then
3981   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3982 cat > conftest.$ac_ext <<EOF
3983 #line 3984 "configure"
3984 #include "confdefs.h"
3985 #include <stdlib.h>
3986 EOF
3987 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3988   egrep "free" >/dev/null 2>&1; then
3989   :
3990 else
3991   rm -rf conftest*
3992   ol_cv_header_stdc=no
3993 fi
3994 rm -f conftest*
3995
3996 fi
3997
3998 if test $ol_cv_header_stdc = yes; then
3999   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4000 if test "$cross_compiling" = yes; then
4001   :
4002 else
4003   cat > conftest.$ac_ext <<EOF
4004 #line 4005 "configure"
4005 #include "confdefs.h"
4006 #include <ctype.h>
4007 #ifndef HAVE_EBCDIC
4008 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4009 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4010 #else
4011 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4012                 || ('j' <= (c) && (c) <= 'r') \
4013                 || ('s' <= (c) && (c) <= 'z'))
4014 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
4015 #endif
4016 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4017 int main () { int i; for (i = 0; i < 256; i++)
4018 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4019 exit (0); }
4020
4021 EOF
4022 if { (eval echo configure:4023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4023 then
4024   :
4025 else
4026   echo "configure: failed program was:" >&5
4027   cat conftest.$ac_ext >&5
4028   rm -fr conftest*
4029   ol_cv_header_stdc=no
4030 fi
4031 rm -fr conftest*
4032 fi
4033
4034 fi
4035 fi
4036
4037 echo "$ac_t""$ol_cv_header_stdc" 1>&6
4038 if test $ol_cv_header_stdc = yes; then
4039   cat >> confdefs.h <<\EOF
4040 #define STDC_HEADERS 1
4041 EOF
4042
4043 fi
4044 ac_cv_header_stdc=disable
4045
4046
4047 if test $ol_cv_header_stdc != yes; then
4048         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
4049 fi
4050
4051 ac_header_dirent=no
4052 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4053 do
4054 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4055 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4056 echo "configure:4057: checking for $ac_hdr that defines DIR" >&5
4057 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
4058   echo $ac_n "(cached) $ac_c" 1>&6
4059 else
4060   cat > conftest.$ac_ext <<EOF
4061 #line 4062 "configure"
4062 #include "confdefs.h"
4063 #include <sys/types.h>
4064 #include <$ac_hdr>
4065 int main() {
4066 DIR *dirp = 0;
4067 ; return 0; }
4068 EOF
4069 if { (eval echo configure:4070: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4070   rm -rf conftest*
4071   eval "ac_cv_header_dirent_$ac_safe=yes"
4072 else
4073   echo "configure: failed program was:" >&5
4074   cat conftest.$ac_ext >&5
4075   rm -rf conftest*
4076   eval "ac_cv_header_dirent_$ac_safe=no"
4077 fi
4078 rm -f conftest*
4079 fi
4080 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4081   echo "$ac_t""yes" 1>&6
4082     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4083   cat >> confdefs.h <<EOF
4084 #define $ac_tr_hdr 1
4085 EOF
4086  ac_header_dirent=$ac_hdr; break
4087 else
4088   echo "$ac_t""no" 1>&6
4089 fi
4090 done
4091 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4092 if test $ac_header_dirent = dirent.h; then
4093 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4094 echo "configure:4095: checking for opendir in -ldir" >&5
4095 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
4096 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4097   echo $ac_n "(cached) $ac_c" 1>&6
4098 else
4099   ac_save_LIBS="$LIBS"
4100 LIBS="-ldir  $LIBS"
4101 cat > conftest.$ac_ext <<EOF
4102 #line 4103 "configure"
4103 #include "confdefs.h"
4104 /* Override any gcc2 internal prototype to avoid an error.  */
4105 /* We use char because int might match the return type of a gcc2
4106     builtin and then its argument prototype would still apply.  */
4107 char opendir();
4108
4109 int main() {
4110 opendir()
4111 ; return 0; }
4112 EOF
4113 if { (eval echo configure:4114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4114   rm -rf conftest*
4115   eval "ac_cv_lib_$ac_lib_var=yes"
4116 else
4117   echo "configure: failed program was:" >&5
4118   cat conftest.$ac_ext >&5
4119   rm -rf conftest*
4120   eval "ac_cv_lib_$ac_lib_var=no"
4121 fi
4122 rm -f conftest*
4123 LIBS="$ac_save_LIBS"
4124
4125 fi
4126 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4127   echo "$ac_t""yes" 1>&6
4128   LIBS="$LIBS -ldir"
4129 else
4130   echo "$ac_t""no" 1>&6
4131 fi
4132
4133 else
4134 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4135 echo "configure:4136: checking for opendir in -lx" >&5
4136 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
4137 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4138   echo $ac_n "(cached) $ac_c" 1>&6
4139 else
4140   ac_save_LIBS="$LIBS"
4141 LIBS="-lx  $LIBS"
4142 cat > conftest.$ac_ext <<EOF
4143 #line 4144 "configure"
4144 #include "confdefs.h"
4145 /* Override any gcc2 internal prototype to avoid an error.  */
4146 /* We use char because int might match the return type of a gcc2
4147     builtin and then its argument prototype would still apply.  */
4148 char opendir();
4149
4150 int main() {
4151 opendir()
4152 ; return 0; }
4153 EOF
4154 if { (eval echo configure:4155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4155   rm -rf conftest*
4156   eval "ac_cv_lib_$ac_lib_var=yes"
4157 else
4158   echo "configure: failed program was:" >&5
4159   cat conftest.$ac_ext >&5
4160   rm -rf conftest*
4161   eval "ac_cv_lib_$ac_lib_var=no"
4162 fi
4163 rm -f conftest*
4164 LIBS="$ac_save_LIBS"
4165
4166 fi
4167 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4168   echo "$ac_t""yes" 1>&6
4169   LIBS="$LIBS -lx"
4170 else
4171   echo "$ac_t""no" 1>&6
4172 fi
4173
4174 fi
4175
4176 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4177 echo "configure:4178: checking for sys/wait.h that is POSIX.1 compatible" >&5
4178 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
4179   echo $ac_n "(cached) $ac_c" 1>&6
4180 else
4181   cat > conftest.$ac_ext <<EOF
4182 #line 4183 "configure"
4183 #include "confdefs.h"
4184 #include <sys/types.h>
4185 #include <sys/wait.h>
4186 #ifndef WEXITSTATUS
4187 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4188 #endif
4189 #ifndef WIFEXITED
4190 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4191 #endif
4192 int main() {
4193 int s;
4194 wait (&s);
4195 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4196 ; return 0; }
4197 EOF
4198 if { (eval echo configure:4199: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4199   rm -rf conftest*
4200   ac_cv_header_sys_wait_h=yes
4201 else
4202   echo "configure: failed program was:" >&5
4203   cat conftest.$ac_ext >&5
4204   rm -rf conftest*
4205   ac_cv_header_sys_wait_h=no
4206 fi
4207 rm -f conftest*
4208 fi
4209
4210 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4211 if test $ac_cv_header_sys_wait_h = yes; then
4212   cat >> confdefs.h <<\EOF
4213 #define HAVE_SYS_WAIT_H 1
4214 EOF
4215
4216 fi
4217
4218 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4219 echo "configure:4220: checking POSIX termios" >&5
4220 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
4221   echo $ac_n "(cached) $ac_c" 1>&6
4222 else
4223   cat > conftest.$ac_ext <<EOF
4224 #line 4225 "configure"
4225 #include "confdefs.h"
4226 #include <sys/types.h>
4227 #include <unistd.h>
4228 #include <termios.h>
4229 int main() {
4230 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4231    tcgetattr(0, 0);
4232 ; return 0; }
4233 EOF
4234 if { (eval echo configure:4235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4235   rm -rf conftest*
4236   am_cv_sys_posix_termios=yes
4237 else
4238   echo "configure: failed program was:" >&5
4239   cat conftest.$ac_ext >&5
4240   rm -rf conftest*
4241   am_cv_sys_posix_termios=no
4242 fi
4243 rm -f conftest*
4244 fi
4245
4246 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4247
4248
4249  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4250 echo "configure:4251: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4251 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
4252   echo $ac_n "(cached) $ac_c" 1>&6
4253 else
4254   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4255
4256   gwinsz_in_termios_h=no
4257   if test $am_cv_sys_posix_termios = yes; then
4258     cat > conftest.$ac_ext <<EOF
4259 #line 4260 "configure"
4260 #include "confdefs.h"
4261 #include <sys/types.h>
4262 #     include <termios.h>
4263 #     ifdef TIOCGWINSZ
4264         yes
4265 #     endif
4266     
4267 EOF
4268 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4269   egrep "yes" >/dev/null 2>&1; then
4270   rm -rf conftest*
4271   gwinsz_in_termios_h=yes
4272 fi
4273 rm -f conftest*
4274
4275   fi
4276
4277   if test $gwinsz_in_termios_h = no; then
4278     cat > conftest.$ac_ext <<EOF
4279 #line 4280 "configure"
4280 #include "confdefs.h"
4281 #include <sys/types.h>
4282 #     include <sys/ioctl.h>
4283 #     ifdef TIOCGWINSZ
4284         yes
4285 #     endif
4286     
4287 EOF
4288 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4289   egrep "yes" >/dev/null 2>&1; then
4290   rm -rf conftest*
4291   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4292 fi
4293 rm -f conftest*
4294
4295   fi
4296   
4297 fi
4298
4299 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4300   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4301     cat >> confdefs.h <<\EOF
4302 #define GWINSZ_IN_SYS_IOCTL 1
4303 EOF
4304
4305   fi
4306
4307 if test $am_cv_sys_posix_termios = yes ; then
4308         cat >> confdefs.h <<\EOF
4309 #define HAVE_POSIX_TERMIOS 1
4310 EOF
4311
4312 fi
4313
4314 for ac_hdr in \
4315         arpa/inet.h             \
4316         arpa/nameser.h  \
4317         assert.h                \
4318         crypt.h                 \
4319         errno.h                 \
4320         fcntl.h                 \
4321         filio.h                 \
4322         getopt.h                \
4323         grp.h                   \
4324         libutil.h               \
4325         limits.h                \
4326         locale.h                \
4327         netinet/tcp.h   \
4328         malloc.h                \
4329         memory.h                \
4330         psap.h                  \
4331         pwd.h                   \
4332         resolv.h                \
4333         sgtty.h                 \
4334         shadow.h                \
4335         stddef.h                \
4336         string.h                \
4337         strings.h               \
4338         sysexits.h              \
4339         sys/file.h              \
4340         sys/filio.h             \
4341         sys/errno.h             \
4342         sys/ioctl.h             \
4343         sys/param.h             \
4344         sys/resource.h  \
4345         sys/select.h    \
4346         sys/socket.h    \
4347         sys/syslog.h    \
4348         sys/time.h              \
4349         sys/types.h             \
4350         syslog.h                \
4351         termios.h               \
4352         unistd.h                \
4353
4354 do
4355 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4356 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4357 echo "configure:4358: checking for $ac_hdr" >&5
4358 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4359   echo $ac_n "(cached) $ac_c" 1>&6
4360 else
4361   cat > conftest.$ac_ext <<EOF
4362 #line 4363 "configure"
4363 #include "confdefs.h"
4364 #include <$ac_hdr>
4365 EOF
4366 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4367 { (eval echo configure:4368: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4368 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4369 if test -z "$ac_err"; then
4370   rm -rf conftest*
4371   eval "ac_cv_header_$ac_safe=yes"
4372 else
4373   echo "$ac_err" >&5
4374   echo "configure: failed program was:" >&5
4375   cat conftest.$ac_ext >&5
4376   rm -rf conftest*
4377   eval "ac_cv_header_$ac_safe=no"
4378 fi
4379 rm -f conftest*
4380 fi
4381 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4382   echo "$ac_t""yes" 1>&6
4383     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4384   cat >> confdefs.h <<EOF
4385 #define $ac_tr_hdr 1
4386 EOF
4387  
4388 else
4389   echo "$ac_t""no" 1>&6
4390 fi
4391 done
4392
4393
4394
4395
4396 echo $ac_n "checking for socket""... $ac_c" 1>&6
4397 echo "configure:4398: checking for socket" >&5
4398 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
4399   echo $ac_n "(cached) $ac_c" 1>&6
4400 else
4401   cat > conftest.$ac_ext <<EOF
4402 #line 4403 "configure"
4403 #include "confdefs.h"
4404 /* System header to define __stub macros and hopefully few prototypes,
4405     which can conflict with char socket(); below.  */
4406 #include <assert.h>
4407 /* Override any gcc2 internal prototype to avoid an error.  */
4408 /* We use char because int might match the return type of a gcc2
4409     builtin and then its argument prototype would still apply.  */
4410 char socket();
4411 char (*f)();
4412
4413 int main() {
4414
4415 /* The GNU C library defines this for functions which it implements
4416     to always fail with ENOSYS.  Some functions are actually named
4417     something starting with __ and the normal name is an alias.  */
4418 #if defined (__stub_socket) || defined (__stub___socket)
4419 choke me
4420 #else
4421 f = socket;
4422 #endif
4423
4424 ; return 0; }
4425 EOF
4426 if { (eval echo configure:4427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4427   rm -rf conftest*
4428   eval "ac_cv_func_socket=yes"
4429 else
4430   echo "configure: failed program was:" >&5
4431   cat conftest.$ac_ext >&5
4432   rm -rf conftest*
4433   eval "ac_cv_func_socket=no"
4434 fi
4435 rm -f conftest*
4436 fi
4437
4438 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
4439   echo "$ac_t""yes" 1>&6
4440   :
4441 else
4442   echo "$ac_t""no" 1>&6
4443         
4444         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
4445 echo "configure:4446: checking for main in -lsocket" >&5
4446 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
4447 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4448   echo $ac_n "(cached) $ac_c" 1>&6
4449 else
4450   ac_save_LIBS="$LIBS"
4451 LIBS="-lsocket  $LIBS"
4452 cat > conftest.$ac_ext <<EOF
4453 #line 4454 "configure"
4454 #include "confdefs.h"
4455
4456 int main() {
4457 main()
4458 ; return 0; }
4459 EOF
4460 if { (eval echo configure:4461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4461   rm -rf conftest*
4462   eval "ac_cv_lib_$ac_lib_var=yes"
4463 else
4464   echo "configure: failed program was:" >&5
4465   cat conftest.$ac_ext >&5
4466   rm -rf conftest*
4467   eval "ac_cv_lib_$ac_lib_var=no"
4468 fi
4469 rm -f conftest*
4470 LIBS="$ac_save_LIBS"
4471
4472 fi
4473 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4474   echo "$ac_t""yes" 1>&6
4475     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4476     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4477   cat >> confdefs.h <<EOF
4478 #define $ac_tr_lib 1
4479 EOF
4480
4481   LIBS="-lsocket $LIBS"
4482
4483 else
4484   echo "$ac_t""no" 1>&6
4485 fi
4486
4487         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
4488 echo "configure:4489: checking for main in -lnet" >&5
4489 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
4490 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4491   echo $ac_n "(cached) $ac_c" 1>&6
4492 else
4493   ac_save_LIBS="$LIBS"
4494 LIBS="-lnet  $LIBS"
4495 cat > conftest.$ac_ext <<EOF
4496 #line 4497 "configure"
4497 #include "confdefs.h"
4498
4499 int main() {
4500 main()
4501 ; return 0; }
4502 EOF
4503 if { (eval echo configure:4504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4504   rm -rf conftest*
4505   eval "ac_cv_lib_$ac_lib_var=yes"
4506 else
4507   echo "configure: failed program was:" >&5
4508   cat conftest.$ac_ext >&5
4509   rm -rf conftest*
4510   eval "ac_cv_lib_$ac_lib_var=no"
4511 fi
4512 rm -f conftest*
4513 LIBS="$ac_save_LIBS"
4514
4515 fi
4516 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4517   echo "$ac_t""yes" 1>&6
4518     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4519     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4520   cat >> confdefs.h <<EOF
4521 #define $ac_tr_lib 1
4522 EOF
4523
4524   LIBS="-lnet $LIBS"
4525
4526 else
4527   echo "$ac_t""no" 1>&6
4528 fi
4529
4530         echo $ac_n "checking for socket in -lnet""... $ac_c" 1>&6
4531 echo "configure:4532: checking for socket in -lnet" >&5
4532 ac_lib_var=`echo net'_'socket | sed 'y%./+-:%__p__%'`
4533 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4534   echo $ac_n "(cached) $ac_c" 1>&6
4535 else
4536   ac_save_LIBS="$LIBS"
4537 LIBS="-lnet  $LIBS"
4538 cat > conftest.$ac_ext <<EOF
4539 #line 4540 "configure"
4540 #include "confdefs.h"
4541 /* Override any gcc2 internal prototype to avoid an error.  */
4542 /* We use char because int might match the return type of a gcc2
4543     builtin and then its argument prototype would still apply.  */
4544 char socket();
4545
4546 int main() {
4547 socket()
4548 ; return 0; }
4549 EOF
4550 if { (eval echo configure:4551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4551   rm -rf conftest*
4552   eval "ac_cv_lib_$ac_lib_var=yes"
4553 else
4554   echo "configure: failed program was:" >&5
4555   cat conftest.$ac_ext >&5
4556   rm -rf conftest*
4557   eval "ac_cv_lib_$ac_lib_var=no"
4558 fi
4559 rm -f conftest*
4560 LIBS="$ac_save_LIBS"
4561
4562 fi
4563 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4564   echo "$ac_t""yes" 1>&6
4565     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4566     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4567   cat >> confdefs.h <<EOF
4568 #define $ac_tr_lib 1
4569 EOF
4570
4571   LIBS="-lnet $LIBS"
4572
4573 else
4574   echo "$ac_t""no" 1>&6
4575 fi
4576
4577         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
4578 echo "configure:4579: checking for main in -lnsl_s" >&5
4579 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
4580 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4581   echo $ac_n "(cached) $ac_c" 1>&6
4582 else
4583   ac_save_LIBS="$LIBS"
4584 LIBS="-lnsl_s  $LIBS"
4585 cat > conftest.$ac_ext <<EOF
4586 #line 4587 "configure"
4587 #include "confdefs.h"
4588
4589 int main() {
4590 main()
4591 ; return 0; }
4592 EOF
4593 if { (eval echo configure:4594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4594   rm -rf conftest*
4595   eval "ac_cv_lib_$ac_lib_var=yes"
4596 else
4597   echo "configure: failed program was:" >&5
4598   cat conftest.$ac_ext >&5
4599   rm -rf conftest*
4600   eval "ac_cv_lib_$ac_lib_var=no"
4601 fi
4602 rm -f conftest*
4603 LIBS="$ac_save_LIBS"
4604
4605 fi
4606 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4607   echo "$ac_t""yes" 1>&6
4608     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4609     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4610   cat >> confdefs.h <<EOF
4611 #define $ac_tr_lib 1
4612 EOF
4613
4614   LIBS="-lnsl_s $LIBS"
4615
4616 else
4617   echo "$ac_t""no" 1>&6
4618 fi
4619
4620         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
4621 echo "configure:4622: checking for main in -lnsl" >&5
4622 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
4623 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4624   echo $ac_n "(cached) $ac_c" 1>&6
4625 else
4626   ac_save_LIBS="$LIBS"
4627 LIBS="-lnsl  $LIBS"
4628 cat > conftest.$ac_ext <<EOF
4629 #line 4630 "configure"
4630 #include "confdefs.h"
4631
4632 int main() {
4633 main()
4634 ; return 0; }
4635 EOF
4636 if { (eval echo configure:4637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4637   rm -rf conftest*
4638   eval "ac_cv_lib_$ac_lib_var=yes"
4639 else
4640   echo "configure: failed program was:" >&5
4641   cat conftest.$ac_ext >&5
4642   rm -rf conftest*
4643   eval "ac_cv_lib_$ac_lib_var=no"
4644 fi
4645 rm -f conftest*
4646 LIBS="$ac_save_LIBS"
4647
4648 fi
4649 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4650   echo "$ac_t""yes" 1>&6
4651     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4652     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4653   cat >> confdefs.h <<EOF
4654 #define $ac_tr_lib 1
4655 EOF
4656
4657   LIBS="-lnsl $LIBS"
4658
4659 else
4660   echo "$ac_t""no" 1>&6
4661 fi
4662
4663         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
4664 echo "configure:4665: checking for socket in -linet" >&5
4665 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
4666 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4667   echo $ac_n "(cached) $ac_c" 1>&6
4668 else
4669   ac_save_LIBS="$LIBS"
4670 LIBS="-linet  $LIBS"
4671 cat > conftest.$ac_ext <<EOF
4672 #line 4673 "configure"
4673 #include "confdefs.h"
4674 /* Override any gcc2 internal prototype to avoid an error.  */
4675 /* We use char because int might match the return type of a gcc2
4676     builtin and then its argument prototype would still apply.  */
4677 char socket();
4678
4679 int main() {
4680 socket()
4681 ; return 0; }
4682 EOF
4683 if { (eval echo configure:4684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4684   rm -rf conftest*
4685   eval "ac_cv_lib_$ac_lib_var=yes"
4686 else
4687   echo "configure: failed program was:" >&5
4688   cat conftest.$ac_ext >&5
4689   rm -rf conftest*
4690   eval "ac_cv_lib_$ac_lib_var=no"
4691 fi
4692 rm -f conftest*
4693 LIBS="$ac_save_LIBS"
4694
4695 fi
4696 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4697   echo "$ac_t""yes" 1>&6
4698     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4699     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4700   cat >> confdefs.h <<EOF
4701 #define $ac_tr_lib 1
4702 EOF
4703
4704   LIBS="-linet $LIBS"
4705
4706 else
4707   echo "$ac_t""no" 1>&6
4708 fi
4709
4710         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
4711 echo "configure:4712: checking for main in -lgen" >&5
4712 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
4713 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4714   echo $ac_n "(cached) $ac_c" 1>&6
4715 else
4716   ac_save_LIBS="$LIBS"
4717 LIBS="-lgen  $LIBS"
4718 cat > conftest.$ac_ext <<EOF
4719 #line 4720 "configure"
4720 #include "confdefs.h"
4721
4722 int main() {
4723 main()
4724 ; return 0; }
4725 EOF
4726 if { (eval echo configure:4727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4727   rm -rf conftest*
4728   eval "ac_cv_lib_$ac_lib_var=yes"
4729 else
4730   echo "configure: failed program was:" >&5
4731   cat conftest.$ac_ext >&5
4732   rm -rf conftest*
4733   eval "ac_cv_lib_$ac_lib_var=no"
4734 fi
4735 rm -f conftest*
4736 LIBS="$ac_save_LIBS"
4737
4738 fi
4739 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4740   echo "$ac_t""yes" 1>&6
4741     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4742     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4743   cat >> confdefs.h <<EOF
4744 #define $ac_tr_lib 1
4745 EOF
4746
4747   LIBS="-lgen $LIBS"
4748
4749 else
4750   echo "$ac_t""no" 1>&6
4751 fi
4752
4753
4754 fi
4755
4756
4757 echo $ac_n "checking for select""... $ac_c" 1>&6
4758 echo "configure:4759: checking for select" >&5
4759 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
4760   echo $ac_n "(cached) $ac_c" 1>&6
4761 else
4762   cat > conftest.$ac_ext <<EOF
4763 #line 4764 "configure"
4764 #include "confdefs.h"
4765 /* System header to define __stub macros and hopefully few prototypes,
4766     which can conflict with char select(); below.  */
4767 #include <assert.h>
4768 /* Override any gcc2 internal prototype to avoid an error.  */
4769 /* We use char because int might match the return type of a gcc2
4770     builtin and then its argument prototype would still apply.  */
4771 char select();
4772 char (*f)();
4773
4774 int main() {
4775
4776 /* The GNU C library defines this for functions which it implements
4777     to always fail with ENOSYS.  Some functions are actually named
4778     something starting with __ and the normal name is an alias.  */
4779 #if defined (__stub_select) || defined (__stub___select)
4780 choke me
4781 #else
4782 f = select;
4783 #endif
4784
4785 ; return 0; }
4786 EOF
4787 if { (eval echo configure:4788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4788   rm -rf conftest*
4789   eval "ac_cv_func_select=yes"
4790 else
4791   echo "configure: failed program was:" >&5
4792   cat conftest.$ac_ext >&5
4793   rm -rf conftest*
4794   eval "ac_cv_func_select=no"
4795 fi
4796 rm -f conftest*
4797 fi
4798
4799 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
4800   echo "$ac_t""yes" 1>&6
4801   :
4802 else
4803   echo "$ac_t""no" 1>&6
4804 { echo "configure: error: select() required." 1>&2; exit 1; }
4805 fi
4806
4807
4808 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
4809 echo "configure:4810: checking types of arguments for select()" >&5
4810  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
4811   echo $ac_n "(cached) $ac_c" 1>&6
4812 else
4813    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
4814   echo $ac_n "(cached) $ac_c" 1>&6
4815 else
4816     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
4817   echo $ac_n "(cached) $ac_c" 1>&6
4818 else
4819      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
4820      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
4821       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
4822        cat > conftest.$ac_ext <<EOF
4823 #line 4824 "configure"
4824 #include "confdefs.h"
4825 #ifdef HAVE_SYS_TYPES_H
4826 #include <sys/types.h>
4827 #endif
4828 #ifdef HAVE_SYS_TIME_H
4829 #include <sys/time.h>
4830 #endif
4831 #ifdef HAVE_SYS_SELECT_H
4832 #include <sys/select.h>
4833 #endif
4834 #ifdef HAVE_SYS_SOCKET_H
4835 #include <sys/socket.h>
4836 #endif
4837 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);
4838 int main() {
4839
4840 ; return 0; }
4841 EOF
4842 if { (eval echo configure:4843: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4843   rm -rf conftest*
4844           ac_not_found=no ; break 3
4845 else
4846   echo "configure: failed program was:" >&5
4847   cat conftest.$ac_ext >&5
4848   rm -rf conftest*
4849   ac_not_found=yes
4850 fi
4851 rm -f conftest*
4852       done
4853      done
4854     done
4855    
4856 fi
4857   
4858 fi
4859  
4860 fi
4861  if test "$ac_not_found" = yes; then
4862   ac_cv_func_select_arg1=int 
4863   ac_cv_func_select_arg234='int *' 
4864   ac_cv_func_select_arg5='struct timeval *'
4865  fi
4866  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
4867  cat >> confdefs.h <<EOF
4868 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
4869 EOF
4870
4871  cat >> confdefs.h <<EOF
4872 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
4873 EOF
4874
4875  cat >> confdefs.h <<EOF
4876 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
4877 EOF
4878
4879
4880
4881
4882 for ac_hdr in regex.h 
4883 do
4884 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4885 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4886 echo "configure:4887: checking for $ac_hdr" >&5
4887 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4888   echo $ac_n "(cached) $ac_c" 1>&6
4889 else
4890   cat > conftest.$ac_ext <<EOF
4891 #line 4892 "configure"
4892 #include "confdefs.h"
4893 #include <$ac_hdr>
4894 EOF
4895 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4896 { (eval echo configure:4897: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4897 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4898 if test -z "$ac_err"; then
4899   rm -rf conftest*
4900   eval "ac_cv_header_$ac_safe=yes"
4901 else
4902   echo "$ac_err" >&5
4903   echo "configure: failed program was:" >&5
4904   cat conftest.$ac_ext >&5
4905   rm -rf conftest*
4906   eval "ac_cv_header_$ac_safe=no"
4907 fi
4908 rm -f conftest*
4909 fi
4910 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4911   echo "$ac_t""yes" 1>&6
4912     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4913   cat >> confdefs.h <<EOF
4914 #define $ac_tr_hdr 1
4915 EOF
4916  
4917 else
4918   echo "$ac_t""no" 1>&6
4919 fi
4920 done
4921
4922 if test "$ac_cv_header_regex_h" != yes ; then
4923         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
4924 fi
4925 echo $ac_n "checking for regfree""... $ac_c" 1>&6
4926 echo "configure:4927: checking for regfree" >&5
4927 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
4928   echo $ac_n "(cached) $ac_c" 1>&6
4929 else
4930   cat > conftest.$ac_ext <<EOF
4931 #line 4932 "configure"
4932 #include "confdefs.h"
4933 /* System header to define __stub macros and hopefully few prototypes,
4934     which can conflict with char regfree(); below.  */
4935 #include <assert.h>
4936 /* Override any gcc2 internal prototype to avoid an error.  */
4937 /* We use char because int might match the return type of a gcc2
4938     builtin and then its argument prototype would still apply.  */
4939 char regfree();
4940 char (*f)();
4941
4942 int main() {
4943
4944 /* The GNU C library defines this for functions which it implements
4945     to always fail with ENOSYS.  Some functions are actually named
4946     something starting with __ and the normal name is an alias.  */
4947 #if defined (__stub_regfree) || defined (__stub___regfree)
4948 choke me
4949 #else
4950 f = regfree;
4951 #endif
4952
4953 ; return 0; }
4954 EOF
4955 if { (eval echo configure:4956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4956   rm -rf conftest*
4957   eval "ac_cv_func_regfree=yes"
4958 else
4959   echo "configure: failed program was:" >&5
4960   cat conftest.$ac_ext >&5
4961   rm -rf conftest*
4962   eval "ac_cv_func_regfree=no"
4963 fi
4964 rm -f conftest*
4965 fi
4966
4967 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
4968   echo "$ac_t""yes" 1>&6
4969   :
4970 else
4971   echo "$ac_t""no" 1>&6
4972 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
4973 fi
4974
4975
4976
4977 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
4978 echo "configure:4979: checking for compatible POSIX regex" >&5
4979 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
4980   echo $ac_n "(cached) $ac_c" 1>&6
4981 else
4982   
4983         if test "$cross_compiling" = yes; then
4984   ol_cv_c_posix_regex=cross
4985 else
4986   cat > conftest.$ac_ext <<EOF
4987 #line 4988 "configure"
4988 #include "confdefs.h"
4989
4990 #include <sys/types.h>
4991 #include <regex.h>
4992 static char *pattern, *string;
4993 main()
4994 {
4995         int rc;
4996         regex_t re;
4997
4998         pattern = "^A";
4999
5000         if(regcomp(&re, pattern, 0)) {
5001                 return -1;
5002         }
5003         
5004         string = "ALL MATCH";
5005         
5006         rc = regexec(&re, string, 0, (void*)0, 0);
5007
5008         regfree(&re);
5009
5010         return rc;
5011 }
5012 EOF
5013 if { (eval echo configure:5014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5014 then
5015   ol_cv_c_posix_regex=yes
5016 else
5017   echo "configure: failed program was:" >&5
5018   cat conftest.$ac_ext >&5
5019   rm -fr conftest*
5020   ol_cv_c_posix_regex=no
5021 fi
5022 rm -fr conftest*
5023 fi
5024
5025 fi
5026
5027 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5028
5029 if test "$ol_cv_c_posix_regex" = no ; then
5030         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5031 fi
5032
5033 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
5034 echo "configure:5035: checking for sigset in -lV3" >&5
5035 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
5036 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5037   echo $ac_n "(cached) $ac_c" 1>&6
5038 else
5039   ac_save_LIBS="$LIBS"
5040 LIBS="-lV3  $LIBS"
5041 cat > conftest.$ac_ext <<EOF
5042 #line 5043 "configure"
5043 #include "confdefs.h"
5044 /* Override any gcc2 internal prototype to avoid an error.  */
5045 /* We use char because int might match the return type of a gcc2
5046     builtin and then its argument prototype would still apply.  */
5047 char sigset();
5048
5049 int main() {
5050 sigset()
5051 ; return 0; }
5052 EOF
5053 if { (eval echo configure:5054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5054   rm -rf conftest*
5055   eval "ac_cv_lib_$ac_lib_var=yes"
5056 else
5057   echo "configure: failed program was:" >&5
5058   cat conftest.$ac_ext >&5
5059   rm -rf conftest*
5060   eval "ac_cv_lib_$ac_lib_var=no"
5061 fi
5062 rm -f conftest*
5063 LIBS="$ac_save_LIBS"
5064
5065 fi
5066 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5067   echo "$ac_t""yes" 1>&6
5068     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5069     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5070   cat >> confdefs.h <<EOF
5071 #define $ac_tr_lib 1
5072 EOF
5073
5074   LIBS="-lV3 $LIBS"
5075
5076 else
5077   echo "$ac_t""no" 1>&6
5078 fi
5079
5080
5081 echo $ac_n "checking for res_search""... $ac_c" 1>&6
5082 echo "configure:5083: checking for res_search" >&5
5083 if eval "test \"\${ac_cv_func_res_search+set}\" = set"; then
5084   echo $ac_n "(cached) $ac_c" 1>&6
5085 else
5086   cat > conftest.$ac_ext <<EOF
5087 #line 5088 "configure"
5088 #include "confdefs.h"
5089 /* System header to define __stub macros and hopefully few prototypes,
5090     which can conflict with char res_search(); below.  */
5091 #include <assert.h>
5092 /* Override any gcc2 internal prototype to avoid an error.  */
5093 /* We use char because int might match the return type of a gcc2
5094     builtin and then its argument prototype would still apply.  */
5095 char res_search();
5096 char (*f)();
5097
5098 int main() {
5099
5100 /* The GNU C library defines this for functions which it implements
5101     to always fail with ENOSYS.  Some functions are actually named
5102     something starting with __ and the normal name is an alias.  */
5103 #if defined (__stub_res_search) || defined (__stub___res_search)
5104 choke me
5105 #else
5106 f = res_search;
5107 #endif
5108
5109 ; return 0; }
5110 EOF
5111 if { (eval echo configure:5112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5112   rm -rf conftest*
5113   eval "ac_cv_func_res_search=yes"
5114 else
5115   echo "configure: failed program was:" >&5
5116   cat conftest.$ac_ext >&5
5117   rm -rf conftest*
5118   eval "ac_cv_func_res_search=no"
5119 fi
5120 rm -f conftest*
5121 fi
5122
5123 if eval "test \"`echo '$ac_cv_func_'res_search`\" = yes"; then
5124   echo "$ac_t""yes" 1>&6
5125   :
5126 else
5127   echo "$ac_t""no" 1>&6
5128 fi
5129
5130 if test $ac_cv_func_res_search = no ; then 
5131         echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
5132 echo "configure:5133: checking for res_search in -lbind" >&5
5133 ac_lib_var=`echo bind'_'res_search | sed 'y%./+-:%__p__%'`
5134 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5135   echo $ac_n "(cached) $ac_c" 1>&6
5136 else
5137   ac_save_LIBS="$LIBS"
5138 LIBS="-lbind  $LIBS"
5139 cat > conftest.$ac_ext <<EOF
5140 #line 5141 "configure"
5141 #include "confdefs.h"
5142 /* Override any gcc2 internal prototype to avoid an error.  */
5143 /* We use char because int might match the return type of a gcc2
5144     builtin and then its argument prototype would still apply.  */
5145 char res_search();
5146
5147 int main() {
5148 res_search()
5149 ; return 0; }
5150 EOF
5151 if { (eval echo configure:5152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5152   rm -rf conftest*
5153   eval "ac_cv_lib_$ac_lib_var=yes"
5154 else
5155   echo "configure: failed program was:" >&5
5156   cat conftest.$ac_ext >&5
5157   rm -rf conftest*
5158   eval "ac_cv_lib_$ac_lib_var=no"
5159 fi
5160 rm -f conftest*
5161 LIBS="$ac_save_LIBS"
5162
5163 fi
5164 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5165   echo "$ac_t""yes" 1>&6
5166     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5167     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5168   cat >> confdefs.h <<EOF
5169 #define $ac_tr_lib 1
5170 EOF
5171
5172   LIBS="-lbind $LIBS"
5173
5174 else
5175   echo "$ac_t""no" 1>&6
5176 fi
5177
5178         ac_cv_func_res_search=$ac_cv_lib_bind_res_search
5179 fi
5180
5181 if test $ac_cv_func_res_search = no ; then 
5182         echo $ac_n "checking for __res_search in -lbind""... $ac_c" 1>&6
5183 echo "configure:5184: checking for __res_search in -lbind" >&5
5184 ac_lib_var=`echo bind'_'__res_search | sed 'y%./+-:%__p__%'`
5185 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5186   echo $ac_n "(cached) $ac_c" 1>&6
5187 else
5188   ac_save_LIBS="$LIBS"
5189 LIBS="-lbind  $LIBS"
5190 cat > conftest.$ac_ext <<EOF
5191 #line 5192 "configure"
5192 #include "confdefs.h"
5193 /* Override any gcc2 internal prototype to avoid an error.  */
5194 /* We use char because int might match the return type of a gcc2
5195     builtin and then its argument prototype would still apply.  */
5196 char __res_search();
5197
5198 int main() {
5199 __res_search()
5200 ; return 0; }
5201 EOF
5202 if { (eval echo configure:5203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5203   rm -rf conftest*
5204   eval "ac_cv_lib_$ac_lib_var=yes"
5205 else
5206   echo "configure: failed program was:" >&5
5207   cat conftest.$ac_ext >&5
5208   rm -rf conftest*
5209   eval "ac_cv_lib_$ac_lib_var=no"
5210 fi
5211 rm -f conftest*
5212 LIBS="$ac_save_LIBS"
5213
5214 fi
5215 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5216   echo "$ac_t""yes" 1>&6
5217     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5218     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5219   cat >> confdefs.h <<EOF
5220 #define $ac_tr_lib 1
5221 EOF
5222
5223   LIBS="-lbind $LIBS"
5224
5225 else
5226   echo "$ac_t""no" 1>&6
5227 fi
5228
5229         ac_cv_func_res_search=$ac_cv_lib_bind___res_search
5230 fi
5231
5232 if test $ac_cv_func_res_search = no ; then 
5233         echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
5234 echo "configure:5235: checking for res_search in -lresolv" >&5
5235 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-:%__p__%'`
5236 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5237   echo $ac_n "(cached) $ac_c" 1>&6
5238 else
5239   ac_save_LIBS="$LIBS"
5240 LIBS="-lresolv  $LIBS"
5241 cat > conftest.$ac_ext <<EOF
5242 #line 5243 "configure"
5243 #include "confdefs.h"
5244 /* Override any gcc2 internal prototype to avoid an error.  */
5245 /* We use char because int might match the return type of a gcc2
5246     builtin and then its argument prototype would still apply.  */
5247 char res_search();
5248
5249 int main() {
5250 res_search()
5251 ; return 0; }
5252 EOF
5253 if { (eval echo configure:5254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5254   rm -rf conftest*
5255   eval "ac_cv_lib_$ac_lib_var=yes"
5256 else
5257   echo "configure: failed program was:" >&5
5258   cat conftest.$ac_ext >&5
5259   rm -rf conftest*
5260   eval "ac_cv_lib_$ac_lib_var=no"
5261 fi
5262 rm -f conftest*
5263 LIBS="$ac_save_LIBS"
5264
5265 fi
5266 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5267   echo "$ac_t""yes" 1>&6
5268     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5269     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5270   cat >> confdefs.h <<EOF
5271 #define $ac_tr_lib 1
5272 EOF
5273
5274   LIBS="-lresolv $LIBS"
5275
5276 else
5277   echo "$ac_t""no" 1>&6
5278 fi
5279
5280         ac_cv_func_res_search=$ac_cv_lib_resolv_res_search
5281 fi
5282
5283 if test "$ac_cv_func_res_search" = yes ; then
5284         cat >> confdefs.h <<\EOF
5285 #define HAVE_RES_SEARCH 1
5286 EOF
5287
5288 elif test $ol_enable_dns = yes ; then
5289         { echo "configure: error: --enable-dns requires res_search" 1>&2; exit 1; }
5290 elif test $ol_enable_dns != no ; then
5291         echo "configure: warning: no res_search, disabling DNS support" 1>&2
5292 fi
5293
5294
5295 # ISODE tests
5296 ol_link_isode=no
5297 if test $ol_enable_ldapd != no ; then
5298         echo "configure: warning: ldapd is not supported and may suffer from bit rot." 1>&2
5299
5300                 echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
5301 echo "configure:5302: checking for main in -lxtpp" >&5
5302 ac_lib_var=`echo xtpp'_'main | sed 'y%./+-:%__p__%'`
5303 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5304   echo $ac_n "(cached) $ac_c" 1>&6
5305 else
5306   ac_save_LIBS="$LIBS"
5307 LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
5308 cat > conftest.$ac_ext <<EOF
5309 #line 5310 "configure"
5310 #include "confdefs.h"
5311
5312 int main() {
5313 main()
5314 ; return 0; }
5315 EOF
5316 if { (eval echo configure:5317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5317   rm -rf conftest*
5318   eval "ac_cv_lib_$ac_lib_var=yes"
5319 else
5320   echo "configure: failed program was:" >&5
5321   cat conftest.$ac_ext >&5
5322   rm -rf conftest*
5323   eval "ac_cv_lib_$ac_lib_var=no"
5324 fi
5325 rm -f conftest*
5326 LIBS="$ac_save_LIBS"
5327
5328 fi
5329 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5330   echo "$ac_t""yes" 1>&6
5331   
5332                 ol_link_isode=yes
5333                 cat >> confdefs.h <<\EOF
5334 #define HAVE_XTPP 1
5335 EOF
5336
5337                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
5338                 
5339 else
5340   echo "$ac_t""no" 1>&6
5341 :
5342 fi
5343
5344         echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
5345 echo "configure:5346: checking for main in -ldsap" >&5
5346 ac_lib_var=`echo dsap'_'main | sed 'y%./+-:%__p__%'`
5347 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5348   echo $ac_n "(cached) $ac_c" 1>&6
5349 else
5350   ac_save_LIBS="$LIBS"
5351 LIBS="-ldsap -lisode $LIBS"
5352 cat > conftest.$ac_ext <<EOF
5353 #line 5354 "configure"
5354 #include "confdefs.h"
5355
5356 int main() {
5357 main()
5358 ; return 0; }
5359 EOF
5360 if { (eval echo configure:5361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5361   rm -rf conftest*
5362   eval "ac_cv_lib_$ac_lib_var=yes"
5363 else
5364   echo "configure: failed program was:" >&5
5365   cat conftest.$ac_ext >&5
5366   rm -rf conftest*
5367   eval "ac_cv_lib_$ac_lib_var=no"
5368 fi
5369 rm -f conftest*
5370 LIBS="$ac_save_LIBS"
5371
5372 fi
5373 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5374   echo "$ac_t""yes" 1>&6
5375   
5376                 ol_link_isode=yes
5377                 cat >> confdefs.h <<\EOF
5378 #define HAVE_DSAP 1
5379 EOF
5380
5381                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
5382                 
5383 else
5384   echo "$ac_t""no" 1>&6
5385 :
5386 fi
5387
5388         echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
5389 echo "configure:5390: checking for main in -lisode" >&5
5390 ac_lib_var=`echo isode'_'main | sed 'y%./+-:%__p__%'`
5391 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5392   echo $ac_n "(cached) $ac_c" 1>&6
5393 else
5394   ac_save_LIBS="$LIBS"
5395 LIBS="-lisode  $LIBS"
5396 cat > conftest.$ac_ext <<EOF
5397 #line 5398 "configure"
5398 #include "confdefs.h"
5399
5400 int main() {
5401 main()
5402 ; return 0; }
5403 EOF
5404 if { (eval echo configure:5405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5405   rm -rf conftest*
5406   eval "ac_cv_lib_$ac_lib_var=yes"
5407 else
5408   echo "configure: failed program was:" >&5
5409   cat conftest.$ac_ext >&5
5410   rm -rf conftest*
5411   eval "ac_cv_lib_$ac_lib_var=no"
5412 fi
5413 rm -f conftest*
5414 LIBS="$ac_save_LIBS"
5415
5416 fi
5417 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5418   echo "$ac_t""yes" 1>&6
5419   
5420                 ol_link_isode=yes
5421                 cat >> confdefs.h <<\EOF
5422 #define HAVE_ISODE 1
5423 EOF
5424
5425                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
5426                 
5427 else
5428   echo "$ac_t""no" 1>&6
5429 :
5430 fi
5431
5432 fi
5433
5434 if test $ol_link_isode != no; then
5435         echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
5436 echo "configure:5437: checking for main in -lpp" >&5
5437 ac_lib_var=`echo pp'_'main | sed 'y%./+-:%__p__%'`
5438 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5439   echo $ac_n "(cached) $ac_c" 1>&6
5440 else
5441   ac_save_LIBS="$LIBS"
5442 LIBS="-lpp  $LIBS"
5443 cat > conftest.$ac_ext <<EOF
5444 #line 5445 "configure"
5445 #include "confdefs.h"
5446
5447 int main() {
5448 main()
5449 ; return 0; }
5450 EOF
5451 if { (eval echo configure:5452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5452   rm -rf conftest*
5453   eval "ac_cv_lib_$ac_lib_var=yes"
5454 else
5455   echo "configure: failed program was:" >&5
5456   cat conftest.$ac_ext >&5
5457   rm -rf conftest*
5458   eval "ac_cv_lib_$ac_lib_var=no"
5459 fi
5460 rm -f conftest*
5461 LIBS="$ac_save_LIBS"
5462
5463 fi
5464 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5465   echo "$ac_t""yes" 1>&6
5466   
5467                 cat >> confdefs.h <<\EOF
5468 #define HAVE_PP 1
5469 EOF
5470
5471                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
5472                 
5473 else
5474   echo "$ac_t""no" 1>&6
5475 :
5476 fi
5477
5478
5479         # Extract the first word of "pepsy", so it can be a program name with args.
5480 set dummy pepsy; ac_word=$2
5481 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
5482 echo "configure:5483: checking for $ac_word" >&5
5483 if eval "test \"\${ac_cv_path_PEPSY+set}\" = set"; then
5484   echo $ac_n "(cached) $ac_c" 1>&6
5485 else
5486   case "$PEPSY" in
5487   /*)
5488   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a path.
5489   ;;
5490   ?:/*)                  
5491   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a dos path.
5492   ;;
5493   *)
5494   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
5495   ac_dummy="$PATH"
5496   for ac_dir in $ac_dummy; do 
5497     test -z "$ac_dir" && ac_dir=.
5498     if test -f $ac_dir/$ac_word; then
5499       ac_cv_path_PEPSY="$ac_dir/$ac_word"
5500       break
5501     fi
5502   done
5503   IFS="$ac_save_ifs"
5504   ;;
5505 esac
5506 fi
5507 PEPSY="$ac_cv_path_PEPSY"
5508 if test -n "$PEPSY"; then
5509   echo "$ac_t""$PEPSY" 1>&6
5510 else
5511   echo "$ac_t""no" 1>&6
5512 fi
5513
5514 fi
5515
5516 if test $ol_enable_quipu != no ; then
5517         for ac_hdr in quipu/commonarg.h
5518 do
5519 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5520 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5521 echo "configure:5522: checking for $ac_hdr" >&5
5522 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5523   echo $ac_n "(cached) $ac_c" 1>&6
5524 else
5525   cat > conftest.$ac_ext <<EOF
5526 #line 5527 "configure"
5527 #include "confdefs.h"
5528 #include <$ac_hdr>
5529 EOF
5530 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5531 { (eval echo configure:5532: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5532 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5533 if test -z "$ac_err"; then
5534   rm -rf conftest*
5535   eval "ac_cv_header_$ac_safe=yes"
5536 else
5537   echo "$ac_err" >&5
5538   echo "configure: failed program was:" >&5
5539   cat conftest.$ac_ext >&5
5540   rm -rf conftest*
5541   eval "ac_cv_header_$ac_safe=no"
5542 fi
5543 rm -f conftest*
5544 fi
5545 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5546   echo "$ac_t""yes" 1>&6
5547     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5548   cat >> confdefs.h <<EOF
5549 #define $ac_tr_hdr 1
5550 EOF
5551  
5552 else
5553   echo "$ac_t""no" 1>&6
5554 fi
5555 done
5556
5557
5558         if test $ac_cv_header_quipu_commonarg_h = yes ; then
5559                 BUILD_QUIPU=yes
5560         elif test $ol_enable_quipu = auto ; then
5561                 echo "configure: warning: no quipu for --enable-quipu=auto, disabling" 1>&2
5562         else
5563                 { echo "configure: error: no quipu for --enable-quipu=$ol_enable_quipu" 1>&2; exit 1; }
5564         fi
5565 fi
5566
5567 ol_link_kerberos=no
5568
5569 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
5570         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
5571 do
5572 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5573 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5574 echo "configure:5575: checking for $ac_hdr" >&5
5575 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5576   echo $ac_n "(cached) $ac_c" 1>&6
5577 else
5578   cat > conftest.$ac_ext <<EOF
5579 #line 5580 "configure"
5580 #include "confdefs.h"
5581 #include <$ac_hdr>
5582 EOF
5583 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5584 { (eval echo configure:5585: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5585 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5586 if test -z "$ac_err"; then
5587   rm -rf conftest*
5588   eval "ac_cv_header_$ac_safe=yes"
5589 else
5590   echo "$ac_err" >&5
5591   echo "configure: failed program was:" >&5
5592   cat conftest.$ac_ext >&5
5593   rm -rf conftest*
5594   eval "ac_cv_header_$ac_safe=no"
5595 fi
5596 rm -f conftest*
5597 fi
5598 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5599   echo "$ac_t""yes" 1>&6
5600     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5601   cat >> confdefs.h <<EOF
5602 #define $ac_tr_hdr 1
5603 EOF
5604  
5605 else
5606   echo "$ac_t""no" 1>&6
5607 fi
5608 done
5609
5610
5611         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
5612                 echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
5613 echo "configure:5614: checking for main in -lkrb4" >&5
5614 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
5615 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5616   echo $ac_n "(cached) $ac_c" 1>&6
5617 else
5618   ac_save_LIBS="$LIBS"
5619 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
5620 cat > conftest.$ac_ext <<EOF
5621 #line 5622 "configure"
5622 #include "confdefs.h"
5623
5624 int main() {
5625 main()
5626 ; return 0; }
5627 EOF
5628 if { (eval echo configure:5629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5629   rm -rf conftest*
5630   eval "ac_cv_lib_$ac_lib_var=yes"
5631 else
5632   echo "configure: failed program was:" >&5
5633   cat conftest.$ac_ext >&5
5634   rm -rf conftest*
5635   eval "ac_cv_lib_$ac_lib_var=no"
5636 fi
5637 rm -f conftest*
5638 LIBS="$ac_save_LIBS"
5639
5640 fi
5641 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5642   echo "$ac_t""yes" 1>&6
5643   have_k5=yes
5644 else
5645   echo "$ac_t""no" 1>&6
5646 have_k5=no
5647 fi
5648
5649
5650                 if test $have_k5 = yes ; then
5651                         ol_with_kerberos=found
5652                         ol_link_kerberos=yes
5653
5654                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
5655
5656                         LIBS="$KRB_LIBS $LIBS"
5657
5658                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
5659 echo "configure:5660: checking for des_debug in Kerberos libraries" >&5
5660 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
5661   echo $ac_n "(cached) $ac_c" 1>&6
5662 else
5663   
5664                                                                 save_LIBS="$LIBS"
5665                                 LIBS="$KRB_LIBS $LIBS"
5666                                 cat > conftest.$ac_ext <<EOF
5667 #line 5668 "configure"
5668 #include "confdefs.h"
5669
5670 #include <kerberosIV/krb.h>
5671 #include <kerberosIV/des.h>
5672 extern int des_debug;
5673
5674 int main() {
5675
5676 des_debug = 1;
5677
5678 ; return 0; }
5679 EOF
5680 if { (eval echo configure:5681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5681   rm -rf conftest*
5682   ol_cv_var_des_debug=yes
5683 else
5684   echo "configure: failed program was:" >&5
5685   cat conftest.$ac_ext >&5
5686   rm -rf conftest*
5687   ol_cv_var_des_debug=no
5688 fi
5689 rm -f conftest*
5690                                                                 LIBS="$save_LIBS"
5691                         
5692 fi
5693
5694 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
5695
5696                         if test $ol_cv_var_des_debug = yes ; then
5697                                 cat >> confdefs.h <<\EOF
5698 #define HAVE_DES_DEBUG 1
5699 EOF
5700
5701                         fi
5702
5703                         LIBS="$save_LIBS"
5704                 fi
5705         fi
5706 fi
5707
5708 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
5709         for ac_hdr in krb.h des.h
5710 do
5711 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5712 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5713 echo "configure:5714: checking for $ac_hdr" >&5
5714 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5715   echo $ac_n "(cached) $ac_c" 1>&6
5716 else
5717   cat > conftest.$ac_ext <<EOF
5718 #line 5719 "configure"
5719 #include "confdefs.h"
5720 #include <$ac_hdr>
5721 EOF
5722 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5723 { (eval echo configure:5724: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5724 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5725 if test -z "$ac_err"; then
5726   rm -rf conftest*
5727   eval "ac_cv_header_$ac_safe=yes"
5728 else
5729   echo "$ac_err" >&5
5730   echo "configure: failed program was:" >&5
5731   cat conftest.$ac_ext >&5
5732   rm -rf conftest*
5733   eval "ac_cv_header_$ac_safe=no"
5734 fi
5735 rm -f conftest*
5736 fi
5737 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5738   echo "$ac_t""yes" 1>&6
5739     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5740   cat >> confdefs.h <<EOF
5741 #define $ac_tr_hdr 1
5742 EOF
5743  
5744 else
5745   echo "$ac_t""no" 1>&6
5746 fi
5747 done
5748
5749
5750         if test $ac_cv_header_krb_h = yes ; then
5751                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
5752 echo "configure:5753: checking for main in -lkrb" >&5
5753 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
5754 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5755   echo $ac_n "(cached) $ac_c" 1>&6
5756 else
5757   ac_save_LIBS="$LIBS"
5758 LIBS="-lkrb -ldes $LIBS"
5759 cat > conftest.$ac_ext <<EOF
5760 #line 5761 "configure"
5761 #include "confdefs.h"
5762
5763 int main() {
5764 main()
5765 ; return 0; }
5766 EOF
5767 if { (eval echo configure:5768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5768   rm -rf conftest*
5769   eval "ac_cv_lib_$ac_lib_var=yes"
5770 else
5771   echo "configure: failed program was:" >&5
5772   cat conftest.$ac_ext >&5
5773   rm -rf conftest*
5774   eval "ac_cv_lib_$ac_lib_var=no"
5775 fi
5776 rm -f conftest*
5777 LIBS="$ac_save_LIBS"
5778
5779 fi
5780 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5781   echo "$ac_t""yes" 1>&6
5782   have_k4=yes
5783 else
5784   echo "$ac_t""no" 1>&6
5785 have_k4=no
5786 fi
5787
5788
5789                 if test $have_k4 = yes ; then
5790                         ol_with_kerberos=found
5791                         ol_link_kerberos=yes
5792
5793                         KRB_LIBS="-lkrb -ldes"
5794                 fi
5795         fi
5796 fi
5797
5798 if test $ol_link_kerberos = yes ; then
5799         cat >> confdefs.h <<\EOF
5800 #define HAVE_KERBEROS 1
5801 EOF
5802
5803 fi
5804
5805 ol_link_tls=no
5806 if test $ol_with_tls != no ; then
5807         
5808         for ac_hdr in openssl/ssl.h ssl.h
5809 do
5810 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5811 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5812 echo "configure:5813: checking for $ac_hdr" >&5
5813 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5814   echo $ac_n "(cached) $ac_c" 1>&6
5815 else
5816   cat > conftest.$ac_ext <<EOF
5817 #line 5818 "configure"
5818 #include "confdefs.h"
5819 #include <$ac_hdr>
5820 EOF
5821 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5822 { (eval echo configure:5823: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5823 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5824 if test -z "$ac_err"; then
5825   rm -rf conftest*
5826   eval "ac_cv_header_$ac_safe=yes"
5827 else
5828   echo "$ac_err" >&5
5829   echo "configure: failed program was:" >&5
5830   cat conftest.$ac_ext >&5
5831   rm -rf conftest*
5832   eval "ac_cv_header_$ac_safe=no"
5833 fi
5834 rm -f conftest*
5835 fi
5836 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5837   echo "$ac_t""yes" 1>&6
5838     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5839   cat >> confdefs.h <<EOF
5840 #define $ac_tr_hdr 1
5841 EOF
5842  
5843 else
5844   echo "$ac_t""no" 1>&6
5845 fi
5846 done
5847
5848         
5849         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
5850                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
5851 echo "configure:5852: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
5852 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
5853 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5854   echo $ac_n "(cached) $ac_c" 1>&6
5855 else
5856   ac_save_LIBS="$LIBS"
5857 LIBS="-lssl -lcrypto $LIBS"
5858 cat > conftest.$ac_ext <<EOF
5859 #line 5860 "configure"
5860 #include "confdefs.h"
5861 /* Override any gcc2 internal prototype to avoid an error.  */
5862 /* We use char because int might match the return type of a gcc2
5863     builtin and then its argument prototype would still apply.  */
5864 char SSLeay_add_ssl_algorithms();
5865
5866 int main() {
5867 SSLeay_add_ssl_algorithms()
5868 ; return 0; }
5869 EOF
5870 if { (eval echo configure:5871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5871   rm -rf conftest*
5872   eval "ac_cv_lib_$ac_lib_var=yes"
5873 else
5874   echo "configure: failed program was:" >&5
5875   cat conftest.$ac_ext >&5
5876   rm -rf conftest*
5877   eval "ac_cv_lib_$ac_lib_var=no"
5878 fi
5879 rm -f conftest*
5880 LIBS="$ac_save_LIBS"
5881
5882 fi
5883 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5884   echo "$ac_t""yes" 1>&6
5885   have_ssleay=yes
5886                         need_rsaref=no
5887 else
5888   echo "$ac_t""no" 1>&6
5889 have_ssleay=no
5890 fi
5891
5892                         
5893                 if test $have_ssleay = no ; then
5894                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
5895 echo "configure:5896: checking for SSL_library_init in -lssl" >&5
5896 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
5897 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5898   echo $ac_n "(cached) $ac_c" 1>&6
5899 else
5900   ac_save_LIBS="$LIBS"
5901 LIBS="-lssl -lcrypto $LIBS"
5902 cat > conftest.$ac_ext <<EOF
5903 #line 5904 "configure"
5904 #include "confdefs.h"
5905 /* Override any gcc2 internal prototype to avoid an error.  */
5906 /* We use char because int might match the return type of a gcc2
5907     builtin and then its argument prototype would still apply.  */
5908 char SSL_library_init();
5909
5910 int main() {
5911 SSL_library_init()
5912 ; return 0; }
5913 EOF
5914 if { (eval echo configure:5915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5915   rm -rf conftest*
5916   eval "ac_cv_lib_$ac_lib_var=yes"
5917 else
5918   echo "configure: failed program was:" >&5
5919   cat conftest.$ac_ext >&5
5920   rm -rf conftest*
5921   eval "ac_cv_lib_$ac_lib_var=no"
5922 fi
5923 rm -f conftest*
5924 LIBS="$ac_save_LIBS"
5925
5926 fi
5927 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5928   echo "$ac_t""yes" 1>&6
5929   have_ssleay=yes
5930                                 need_rsaref=no
5931 else
5932   echo "$ac_t""no" 1>&6
5933 have_ssleay=no
5934 fi
5935
5936                 fi
5937
5938                 if test $have_ssleay = no ; then
5939                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
5940 echo "configure:5941: checking for ssl3_accept in -lssl" >&5
5941 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
5942 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5943   echo $ac_n "(cached) $ac_c" 1>&6
5944 else
5945   ac_save_LIBS="$LIBS"
5946 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
5947 cat > conftest.$ac_ext <<EOF
5948 #line 5949 "configure"
5949 #include "confdefs.h"
5950 /* Override any gcc2 internal prototype to avoid an error.  */
5951 /* We use char because int might match the return type of a gcc2
5952     builtin and then its argument prototype would still apply.  */
5953 char ssl3_accept();
5954
5955 int main() {
5956 ssl3_accept()
5957 ; return 0; }
5958 EOF
5959 if { (eval echo configure:5960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5960   rm -rf conftest*
5961   eval "ac_cv_lib_$ac_lib_var=yes"
5962 else
5963   echo "configure: failed program was:" >&5
5964   cat conftest.$ac_ext >&5
5965   rm -rf conftest*
5966   eval "ac_cv_lib_$ac_lib_var=no"
5967 fi
5968 rm -f conftest*
5969 LIBS="$ac_save_LIBS"
5970
5971 fi
5972 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5973   echo "$ac_t""yes" 1>&6
5974   have_ssleay=yes
5975                                 need_rsaref=yes
5976 else
5977   echo "$ac_t""no" 1>&6
5978 have_ssleay=no
5979 fi
5980
5981                 fi
5982
5983                 if test $have_ssleay = yes ; then
5984                         ol_with_tls=found
5985                         ol_link_tls=yes
5986
5987                         cat >> confdefs.h <<\EOF
5988 #define HAVE_SSLEAY 1
5989 EOF
5990
5991
5992                         if test $need_rsaref = yes; then
5993                                 cat >> confdefs.h <<\EOF
5994 #define HAVE_RSAREF 1
5995 EOF
5996
5997
5998                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
5999                         else
6000                                 TLS_LIBS="-lssl -lcrypto"
6001                         fi
6002                 fi
6003         fi
6004 fi
6005
6006 if test $ol_link_tls = yes ; then
6007         cat >> confdefs.h <<\EOF
6008 #define HAVE_TLS 1
6009 EOF
6010
6011 fi      
6012
6013 for ac_func in \
6014         ctime_r                 \
6015         gethostbyname_r gethostbyaddr_r \
6016
6017 do
6018 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6019 echo "configure:6020: checking for $ac_func" >&5
6020 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6021   echo $ac_n "(cached) $ac_c" 1>&6
6022 else
6023   cat > conftest.$ac_ext <<EOF
6024 #line 6025 "configure"
6025 #include "confdefs.h"
6026 /* System header to define __stub macros and hopefully few prototypes,
6027     which can conflict with char $ac_func(); below.  */
6028 #include <assert.h>
6029 /* Override any gcc2 internal prototype to avoid an error.  */
6030 /* We use char because int might match the return type of a gcc2
6031     builtin and then its argument prototype would still apply.  */
6032 char $ac_func();
6033 char (*f)();
6034
6035 int main() {
6036
6037 /* The GNU C library defines this for functions which it implements
6038     to always fail with ENOSYS.  Some functions are actually named
6039     something starting with __ and the normal name is an alias.  */
6040 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6041 choke me
6042 #else
6043 f = $ac_func;
6044 #endif
6045
6046 ; return 0; }
6047 EOF
6048 if { (eval echo configure:6049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6049   rm -rf conftest*
6050   eval "ac_cv_func_$ac_func=yes"
6051 else
6052   echo "configure: failed program was:" >&5
6053   cat conftest.$ac_ext >&5
6054   rm -rf conftest*
6055   eval "ac_cv_func_$ac_func=no"
6056 fi
6057 rm -f conftest*
6058 fi
6059
6060 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6061   echo "$ac_t""yes" 1>&6
6062     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6063   cat >> confdefs.h <<EOF
6064 #define $ac_tr_func 1
6065 EOF
6066  
6067 else
6068   echo "$ac_t""no" 1>&6
6069 fi
6070 done
6071
6072
6073 if test "$ac_cv_func_ctime_r" = no ; then
6074         ol_cv_func_ctime_r_nargs=0
6075 else
6076         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
6077 echo "configure:6078: checking number of arguments of ctime_r" >&5
6078 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
6079   echo $ac_n "(cached) $ac_c" 1>&6
6080 else
6081   cat > conftest.$ac_ext <<EOF
6082 #line 6083 "configure"
6083 #include "confdefs.h"
6084 #include <time.h>
6085 int main() {
6086 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
6087 ; return 0; }
6088 EOF
6089 if { (eval echo configure:6090: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6090   rm -rf conftest*
6091   ol_cv_func_ctime_r_nargs=3
6092 else
6093   echo "configure: failed program was:" >&5
6094   cat conftest.$ac_ext >&5
6095   rm -rf conftest*
6096   cat > conftest.$ac_ext <<EOF
6097 #line 6098 "configure"
6098 #include "confdefs.h"
6099 #include <time.h>
6100 int main() {
6101 time_t ti; char *buffer; ctime_r(&ti,buffer);
6102 ; return 0; }
6103 EOF
6104 if { (eval echo configure:6105: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6105   rm -rf conftest*
6106   ol_cv_func_ctime_r_nargs=2
6107 else
6108   echo "configure: failed program was:" >&5
6109   cat conftest.$ac_ext >&5
6110   rm -rf conftest*
6111   ol_cv_func_ctime_r_nargs=0
6112 fi
6113 rm -f conftest*
6114 fi
6115 rm -f conftest*
6116 fi
6117
6118 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
6119   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
6120     cat >> confdefs.h <<EOF
6121 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
6122 EOF
6123
6124   fi
6125
6126 fi
6127
6128 if test "$ac_cv_func_gethostbyname_r" = yes ; then
6129         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
6130 echo "configure:6131: checking number of arguments of gethostbyname_r" >&5
6131 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
6132   echo $ac_n "(cached) $ac_c" 1>&6
6133 else
6134   cat > conftest.$ac_ext <<EOF
6135 #line 6136 "configure"
6136 #include "confdefs.h"
6137 #include <sys/types.h>
6138 #include <sys/socket.h>
6139 #include <netinet/in.h>
6140 #include <netdb.h>
6141 #define BUFSIZE (sizeof(struct hostent)+10)
6142 int main() {
6143 struct hostent hent; char buffer[BUFSIZE];
6144                 int bufsize=BUFSIZE;int h_errno;
6145                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
6146                         buffer, bufsize, &h_errno);
6147 ; return 0; }
6148 EOF
6149 if { (eval echo configure:6150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6150   rm -rf conftest*
6151   ol_cv_func_gethostbyname_r_nargs=5
6152 else
6153   echo "configure: failed program was:" >&5
6154   cat conftest.$ac_ext >&5
6155   rm -rf conftest*
6156   cat > conftest.$ac_ext <<EOF
6157 #line 6158 "configure"
6158 #include "confdefs.h"
6159 #include <sys/types.h>
6160 #include <sys/socket.h>
6161 #include <netinet/in.h>
6162 #include <netdb.h>
6163 #define BUFSIZE (sizeof(struct hostent)+10)
6164 int main() {
6165 struct hostent hent;struct hostent *rhent;
6166                         char buffer[BUFSIZE];
6167                         int bufsize=BUFSIZE;int h_errno;
6168                         (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
6169                                 &rhent, &h_errno);
6170 ; return 0; }
6171 EOF
6172 if { (eval echo configure:6173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6173   rm -rf conftest*
6174   ol_cv_func_gethostbyname_r_nargs=6
6175 else
6176   echo "configure: failed program was:" >&5
6177   cat conftest.$ac_ext >&5
6178   rm -rf conftest*
6179   ol_cv_func_gethostbyname_r_nargs=0
6180 fi
6181 rm -f conftest*
6182 fi
6183 rm -f conftest*
6184 fi
6185
6186 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
6187   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
6188         cat >> confdefs.h <<EOF
6189 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
6190 EOF
6191
6192   fi
6193
6194 else
6195         ol_cv_func_gethostbyname_r_nargs=0
6196 fi
6197  
6198 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
6199         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
6200 echo "configure:6201: checking number of arguments of gethostbyaddr_r" >&5
6201 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
6202   echo $ac_n "(cached) $ac_c" 1>&6
6203 else
6204   cat > conftest.$ac_ext <<EOF
6205 #line 6206 "configure"
6206 #include "confdefs.h"
6207 #include <sys/types.h>
6208 #include <sys/socket.h>
6209 #include <netinet/in.h>
6210 #include <netdb.h>
6211 #define BUFSIZE (sizeof(struct hostent)+10)
6212 int main() {
6213 struct hostent hent; char buffer[BUFSIZE]; 
6214             struct in_addr add;
6215             size_t alen=sizeof(struct in_addr);
6216             int bufsize=BUFSIZE;int h_errno;
6217                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
6218                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
6219 ; return 0; }
6220 EOF
6221 if { (eval echo configure:6222: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6222   rm -rf conftest*
6223   ol_cv_func_gethostbyaddr_r_nargs=7
6224 else
6225   echo "configure: failed program was:" >&5
6226   cat conftest.$ac_ext >&5
6227   rm -rf conftest*
6228   cat > conftest.$ac_ext <<EOF
6229 #line 6230 "configure"
6230 #include "confdefs.h"
6231 #include <sys/types.h>
6232 #include <sys/socket.h>
6233 #include <netinet/in.h>
6234 #include <netdb.h>
6235 #define BUFSIZE (sizeof(struct hostent)+10)
6236 int main() {
6237 struct hostent hent;
6238                         struct hostent *rhent; char buffer[BUFSIZE]; 
6239                         struct in_addr add;
6240                         size_t alen=sizeof(struct in_addr);
6241                         int bufsize=BUFSIZE;int h_errno;
6242                         (void)gethostbyaddr_r( (void *)&(add.s_addr),
6243                                 alen, AF_INET, &hent, buffer, bufsize, 
6244                                 &rhent, &h_errno);
6245 ; return 0; }
6246 EOF
6247 if { (eval echo configure:6248: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6248   rm -rf conftest*
6249   ol_cv_func_gethostbyaddr_r_nargs=8
6250 else
6251   echo "configure: failed program was:" >&5
6252   cat conftest.$ac_ext >&5
6253   rm -rf conftest*
6254   ol_cv_func_gethostbyaddr_r_nargs=0
6255 fi
6256 rm -f conftest*
6257 fi
6258 rm -f conftest*
6259 fi
6260
6261 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
6262   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
6263     cat >> confdefs.h <<EOF
6264 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
6265 EOF
6266
6267   fi
6268
6269 else
6270         ol_cv_func_gethostbyaddr_r_nargs=0
6271 fi
6272
6273 if test "$ac_cv_func_ctime_r" = yes \
6274         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
6275         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
6276         -a "$ac_cv_func_gethostbyname_r" = yes \
6277         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
6278         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
6279         -a "$ac_cv_func_gethostbyaddr_r" = yes \
6280         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
6281         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
6282         ; then
6283  
6284         cat >> confdefs.h <<\EOF
6285 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
6286 EOF
6287
6288 fi
6289
6290 ol_link_threads=no
6291 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6292         -o $ol_with_threads = posix ; then
6293
6294         for ac_hdr in pthread.h
6295 do
6296 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6297 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6298 echo "configure:6299: checking for $ac_hdr" >&5
6299 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6300   echo $ac_n "(cached) $ac_c" 1>&6
6301 else
6302   cat > conftest.$ac_ext <<EOF
6303 #line 6304 "configure"
6304 #include "confdefs.h"
6305 #include <$ac_hdr>
6306 EOF
6307 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6308 { (eval echo configure:6309: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6309 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6310 if test -z "$ac_err"; then
6311   rm -rf conftest*
6312   eval "ac_cv_header_$ac_safe=yes"
6313 else
6314   echo "$ac_err" >&5
6315   echo "configure: failed program was:" >&5
6316   cat conftest.$ac_ext >&5
6317   rm -rf conftest*
6318   eval "ac_cv_header_$ac_safe=no"
6319 fi
6320 rm -f conftest*
6321 fi
6322 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6323   echo "$ac_t""yes" 1>&6
6324     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6325   cat >> confdefs.h <<EOF
6326 #define $ac_tr_hdr 1
6327 EOF
6328  
6329 else
6330   echo "$ac_t""no" 1>&6
6331 fi
6332 done
6333
6334
6335         if test $ac_cv_header_pthread_h = yes ; then
6336                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
6337 echo "configure:6338: checking POSIX thread version" >&5
6338 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
6339   echo $ac_n "(cached) $ac_c" 1>&6
6340 else
6341   
6342         cat > conftest.$ac_ext <<EOF
6343 #line 6344 "configure"
6344 #include "confdefs.h"
6345
6346 #               include <pthread.h>
6347                 /* this check could be improved */
6348 #               ifdef PTHREAD_ONCE_INIT
6349                         pthread_version_final
6350 #               endif
6351         
6352 EOF
6353 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6354   egrep "pthread_version_final" >/dev/null 2>&1; then
6355   rm -rf conftest*
6356   ol_pthread_final=yes
6357 else
6358   rm -rf conftest*
6359   ol_pthread_final=no
6360 fi
6361 rm -f conftest*
6362
6363
6364         cat > conftest.$ac_ext <<EOF
6365 #line 6366 "configure"
6366 #include "confdefs.h"
6367
6368 #               include <pthread.h>
6369                 /* this check could be improved */
6370 #               ifdef pthread_once_init
6371                         pthread_version_draft4
6372 #               endif
6373         
6374 EOF
6375 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6376   egrep "pthread_version_draft4" >/dev/null 2>&1; then
6377   rm -rf conftest*
6378   ol_pthread_draft4=yes
6379 else
6380   rm -rf conftest*
6381   ol_pthread_draft4=no
6382 fi
6383 rm -f conftest*
6384
6385
6386         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
6387                 ol_cv_pthread_version=final
6388         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
6389                 ol_cv_pthread_version=draft4
6390         else
6391                 ol_cv_pthread_version=unknown
6392         fi
6393
6394 fi
6395
6396 echo "$ac_t""$ol_cv_pthread_version" 1>&6
6397
6398
6399                 if test $ol_cv_pthread_version = final ; then
6400                         cat >> confdefs.h <<\EOF
6401 #define HAVE_PTHREADS_FINAL 1
6402 EOF
6403
6404                 elif test $ol_cv_pthread_version = draft4 ; then
6405                         cat >> confdefs.h <<\EOF
6406 #define HAVE_PTHREADS_D4 1
6407 EOF
6408
6409                 else
6410                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
6411                 fi
6412
6413                 # consider threads found
6414                 ol_with_threads=found
6415
6416                 
6417         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
6418 echo "configure:6419: checking for LinuxThreads pthread.h" >&5
6419 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
6420   echo $ac_n "(cached) $ac_c" 1>&6
6421 else
6422   cat > conftest.$ac_ext <<EOF
6423 #line 6424 "configure"
6424 #include "confdefs.h"
6425 #include <pthread.h>
6426 EOF
6427 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6428   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
6429   rm -rf conftest*
6430   ol_cv_header_linux_threads=yes
6431 else
6432   rm -rf conftest*
6433   ol_cv_header_linux_threads=no
6434 fi
6435 rm -f conftest*
6436
6437                 
6438 fi
6439
6440 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
6441         if test $ol_cv_header_linux_threads = yes; then
6442                 cat >> confdefs.h <<\EOF
6443 #define HAVE_LINUX_THREADS 1
6444 EOF
6445
6446         fi
6447
6448                 
6449         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
6450 echo "configure:6451: checking for GNU Pth pthread.h" >&5
6451 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
6452   echo $ac_n "(cached) $ac_c" 1>&6
6453 else
6454   cat > conftest.$ac_ext <<EOF
6455 #line 6456 "configure"
6456 #include "confdefs.h"
6457 #include <pthread.h>
6458 #ifdef _POSIX_THREAD_IS_GNU_PTH
6459         __gnu_pth__
6460 #endif
6461
6462 EOF
6463 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6464   egrep "__gnu_pth__" >/dev/null 2>&1; then
6465   rm -rf conftest*
6466   ol_cv_header_gnu_pth_pthread_h=yes
6467 else
6468   rm -rf conftest*
6469   ol_cv_header_gnu_pth_pthread_h=no
6470 fi
6471 rm -f conftest*
6472
6473                 
6474 fi
6475
6476 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
6477
6478
6479                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
6480                         for ac_hdr in sched.h
6481 do
6482 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6483 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6484 echo "configure:6485: checking for $ac_hdr" >&5
6485 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6486   echo $ac_n "(cached) $ac_c" 1>&6
6487 else
6488   cat > conftest.$ac_ext <<EOF
6489 #line 6490 "configure"
6490 #include "confdefs.h"
6491 #include <$ac_hdr>
6492 EOF
6493 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6494 { (eval echo configure:6495: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6495 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6496 if test -z "$ac_err"; then
6497   rm -rf conftest*
6498   eval "ac_cv_header_$ac_safe=yes"
6499 else
6500   echo "$ac_err" >&5
6501   echo "configure: failed program was:" >&5
6502   cat conftest.$ac_ext >&5
6503   rm -rf conftest*
6504   eval "ac_cv_header_$ac_safe=no"
6505 fi
6506 rm -f conftest*
6507 fi
6508 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6509   echo "$ac_t""yes" 1>&6
6510     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6511   cat >> confdefs.h <<EOF
6512 #define $ac_tr_hdr 1
6513 EOF
6514  
6515 else
6516   echo "$ac_t""no" 1>&6
6517 fi
6518 done
6519
6520                 fi
6521
6522                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
6523                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
6524 echo "configure:6525: checking for pthread_create in default libraries" >&5
6525 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
6526   echo $ac_n "(cached) $ac_c" 1>&6
6527 else
6528   
6529                 if test "$cross_compiling" = yes; then
6530   cat > conftest.$ac_ext <<EOF
6531 #line 6532 "configure"
6532 #include "confdefs.h"
6533 /* pthread test headers */
6534 #include <pthread.h>
6535 #ifndef NULL
6536 #define NULL (void*)0
6537 #endif
6538
6539 static void *task(p)
6540         void *p;
6541 {
6542         return (void *) (p == NULL);
6543 }
6544
6545 int main() {
6546
6547         /* pthread test function */
6548         pthread_t t;
6549         int status;
6550
6551         /* make sure pthread_create() isn't just a stub */
6552 #if HAVE_PTHREADS_D4
6553         status = pthread_create(&t, pthread_attr_default, task, NULL);
6554 #else
6555         status = pthread_create(&t, NULL, task, NULL);
6556 #endif
6557
6558         if( status ) exit( status );
6559
6560         /* make sure pthread_detach() isn't just a stub */
6561 #if HAVE_PTHREADS_D4
6562         status = pthread_detach( &t );
6563 #else
6564         status = pthread_detach( t );
6565 #endif
6566
6567 #ifdef HAVE_LINUX_THREADS
6568         pthread_kill_other_threads_np();
6569 #endif
6570
6571         exit( status );
6572
6573 ; return 0; }
6574 EOF
6575 if { (eval echo configure:6576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6576   rm -rf conftest*
6577   ol_cv_pthread_create=yes
6578 else
6579   echo "configure: failed program was:" >&5
6580   cat conftest.$ac_ext >&5
6581   rm -rf conftest*
6582   ol_cv_pthread_create=no
6583 fi
6584 rm -f conftest*
6585 else
6586   cat > conftest.$ac_ext <<EOF
6587 #line 6588 "configure"
6588 #include "confdefs.h"
6589 /* pthread test headers */
6590 #include <pthread.h>
6591 #ifndef NULL
6592 #define NULL (void*)0
6593 #endif
6594
6595 static void *task(p)
6596         void *p;
6597 {
6598         return (void *) (p == NULL);
6599 }
6600
6601
6602 int main(argc, argv)
6603         int argc;
6604         char **argv;
6605 {
6606
6607         /* pthread test function */
6608         pthread_t t;
6609         int status;
6610
6611         /* make sure pthread_create() isn't just a stub */
6612 #if HAVE_PTHREADS_D4
6613         status = pthread_create(&t, pthread_attr_default, task, NULL);
6614 #else
6615         status = pthread_create(&t, NULL, task, NULL);
6616 #endif
6617
6618         if( status ) exit( status );
6619
6620         /* make sure pthread_detach() isn't just a stub */
6621 #if HAVE_PTHREADS_D4
6622         status = pthread_detach( &t );
6623 #else
6624         status = pthread_detach( t );
6625 #endif
6626
6627 #ifdef HAVE_LINUX_THREADS
6628         pthread_kill_other_threads_np();
6629 #endif
6630
6631         exit( status );
6632
6633 }
6634
6635 EOF
6636 if { (eval echo configure:6637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6637 then
6638   ol_cv_pthread_create=yes
6639 else
6640   echo "configure: failed program was:" >&5
6641   cat conftest.$ac_ext >&5
6642   rm -fr conftest*
6643   ol_cv_pthread_create=no
6644 fi
6645 rm -fr conftest*
6646 fi
6647
6648 fi
6649
6650 echo "$ac_t""$ol_cv_pthread_create" 1>&6
6651
6652                 if test $ol_cv_pthread_create != no ; then
6653                         ol_link_threads=posix
6654                         ol_link_pthreads=""
6655                 fi
6656                 
6657                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
6658 if test "$ol_link_threads" = no ; then
6659         # try -kthread
6660         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
6661 echo "configure:6662: checking for pthread link with -kthread" >&5
6662 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
6663   echo $ac_n "(cached) $ac_c" 1>&6
6664 else
6665   
6666                 # save the flags
6667                 ol_LIBS="$LIBS"
6668                 LIBS="-kthread $LIBS"
6669
6670                 if test "$cross_compiling" = yes; then
6671   cat > conftest.$ac_ext <<EOF
6672 #line 6673 "configure"
6673 #include "confdefs.h"
6674 /* pthread test headers */
6675 #include <pthread.h>
6676 #ifndef NULL
6677 #define NULL (void*)0
6678 #endif
6679
6680 static void *task(p)
6681         void *p;
6682 {
6683         return (void *) (p == NULL);
6684 }
6685
6686 int main() {
6687
6688         /* pthread test function */
6689         pthread_t t;
6690         int status;
6691
6692         /* make sure pthread_create() isn't just a stub */
6693 #if HAVE_PTHREADS_D4
6694         status = pthread_create(&t, pthread_attr_default, task, NULL);
6695 #else
6696         status = pthread_create(&t, NULL, task, NULL);
6697 #endif
6698
6699         if( status ) exit( status );
6700
6701         /* make sure pthread_detach() isn't just a stub */
6702 #if HAVE_PTHREADS_D4
6703         status = pthread_detach( &t );
6704 #else
6705         status = pthread_detach( t );
6706 #endif
6707
6708 #ifdef HAVE_LINUX_THREADS
6709         pthread_kill_other_threads_np();
6710 #endif
6711
6712         exit( status );
6713
6714 ; return 0; }
6715 EOF
6716 if { (eval echo configure:6717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6717   rm -rf conftest*
6718   ol_cv_pthread_kthread=yes
6719 else
6720   echo "configure: failed program was:" >&5
6721   cat conftest.$ac_ext >&5
6722   rm -rf conftest*
6723   ol_cv_pthread_kthread=no
6724 fi
6725 rm -f conftest*
6726 else
6727   cat > conftest.$ac_ext <<EOF
6728 #line 6729 "configure"
6729 #include "confdefs.h"
6730 /* pthread test headers */
6731 #include <pthread.h>
6732 #ifndef NULL
6733 #define NULL (void*)0
6734 #endif
6735
6736 static void *task(p)
6737         void *p;
6738 {
6739         return (void *) (p == NULL);
6740 }
6741
6742
6743 int main(argc, argv)
6744         int argc;
6745         char **argv;
6746 {
6747
6748         /* pthread test function */
6749         pthread_t t;
6750         int status;
6751
6752         /* make sure pthread_create() isn't just a stub */
6753 #if HAVE_PTHREADS_D4
6754         status = pthread_create(&t, pthread_attr_default, task, NULL);
6755 #else
6756         status = pthread_create(&t, NULL, task, NULL);
6757 #endif
6758
6759         if( status ) exit( status );
6760
6761         /* make sure pthread_detach() isn't just a stub */
6762 #if HAVE_PTHREADS_D4
6763         status = pthread_detach( &t );
6764 #else
6765         status = pthread_detach( t );
6766 #endif
6767
6768 #ifdef HAVE_LINUX_THREADS
6769         pthread_kill_other_threads_np();
6770 #endif
6771
6772         exit( status );
6773
6774 }
6775
6776 EOF
6777 if { (eval echo configure:6778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6778 then
6779   ol_cv_pthread_kthread=yes
6780 else
6781   echo "configure: failed program was:" >&5
6782   cat conftest.$ac_ext >&5
6783   rm -fr conftest*
6784   ol_cv_pthread_kthread=no
6785 fi
6786 rm -fr conftest*
6787 fi
6788
6789
6790                 # restore the LIBS
6791                 LIBS="$ol_LIBS"
6792         
6793 fi
6794
6795 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
6796
6797         if test $ol_cv_pthread_kthread = yes ; then
6798                 ol_link_pthreads="-kthread"
6799                 ol_link_threads=posix
6800         fi
6801 fi
6802
6803                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
6804 if test "$ol_link_threads" = no ; then
6805         # try -pthread
6806         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
6807 echo "configure:6808: checking for pthread link with -pthread" >&5
6808 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
6809   echo $ac_n "(cached) $ac_c" 1>&6
6810 else
6811   
6812                 # save the flags
6813                 ol_LIBS="$LIBS"
6814                 LIBS="-pthread $LIBS"
6815
6816                 if test "$cross_compiling" = yes; then
6817   cat > conftest.$ac_ext <<EOF
6818 #line 6819 "configure"
6819 #include "confdefs.h"
6820 /* pthread test headers */
6821 #include <pthread.h>
6822 #ifndef NULL
6823 #define NULL (void*)0
6824 #endif
6825
6826 static void *task(p)
6827         void *p;
6828 {
6829         return (void *) (p == NULL);
6830 }
6831
6832 int main() {
6833
6834         /* pthread test function */
6835         pthread_t t;
6836         int status;
6837
6838         /* make sure pthread_create() isn't just a stub */
6839 #if HAVE_PTHREADS_D4
6840         status = pthread_create(&t, pthread_attr_default, task, NULL);
6841 #else
6842         status = pthread_create(&t, NULL, task, NULL);
6843 #endif
6844
6845         if( status ) exit( status );
6846
6847         /* make sure pthread_detach() isn't just a stub */
6848 #if HAVE_PTHREADS_D4
6849         status = pthread_detach( &t );
6850 #else
6851         status = pthread_detach( t );
6852 #endif
6853
6854 #ifdef HAVE_LINUX_THREADS
6855         pthread_kill_other_threads_np();
6856 #endif
6857
6858         exit( status );
6859
6860 ; return 0; }
6861 EOF
6862 if { (eval echo configure:6863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6863   rm -rf conftest*
6864   ol_cv_pthread_pthread=yes
6865 else
6866   echo "configure: failed program was:" >&5
6867   cat conftest.$ac_ext >&5
6868   rm -rf conftest*
6869   ol_cv_pthread_pthread=no
6870 fi
6871 rm -f conftest*
6872 else
6873   cat > conftest.$ac_ext <<EOF
6874 #line 6875 "configure"
6875 #include "confdefs.h"
6876 /* pthread test headers */
6877 #include <pthread.h>
6878 #ifndef NULL
6879 #define NULL (void*)0
6880 #endif
6881
6882 static void *task(p)
6883         void *p;
6884 {
6885         return (void *) (p == NULL);
6886 }
6887
6888
6889 int main(argc, argv)
6890         int argc;
6891         char **argv;
6892 {
6893
6894         /* pthread test function */
6895         pthread_t t;
6896         int status;
6897
6898         /* make sure pthread_create() isn't just a stub */
6899 #if HAVE_PTHREADS_D4
6900         status = pthread_create(&t, pthread_attr_default, task, NULL);
6901 #else
6902         status = pthread_create(&t, NULL, task, NULL);
6903 #endif
6904
6905         if( status ) exit( status );
6906
6907         /* make sure pthread_detach() isn't just a stub */
6908 #if HAVE_PTHREADS_D4
6909         status = pthread_detach( &t );
6910 #else
6911         status = pthread_detach( t );
6912 #endif
6913
6914 #ifdef HAVE_LINUX_THREADS
6915         pthread_kill_other_threads_np();
6916 #endif
6917
6918         exit( status );
6919
6920 }
6921
6922 EOF
6923 if { (eval echo configure:6924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6924 then
6925   ol_cv_pthread_pthread=yes
6926 else
6927   echo "configure: failed program was:" >&5
6928   cat conftest.$ac_ext >&5
6929   rm -fr conftest*
6930   ol_cv_pthread_pthread=no
6931 fi
6932 rm -fr conftest*
6933 fi
6934
6935
6936                 # restore the LIBS
6937                 LIBS="$ol_LIBS"
6938         
6939 fi
6940
6941 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
6942
6943         if test $ol_cv_pthread_pthread = yes ; then
6944                 ol_link_pthreads="-pthread"
6945                 ol_link_threads=posix
6946         fi
6947 fi
6948
6949                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
6950 if test "$ol_link_threads" = no ; then
6951         # try -pthreads
6952         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
6953 echo "configure:6954: checking for pthread link with -pthreads" >&5
6954 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
6955   echo $ac_n "(cached) $ac_c" 1>&6
6956 else
6957   
6958                 # save the flags
6959                 ol_LIBS="$LIBS"
6960                 LIBS="-pthreads $LIBS"
6961
6962                 if test "$cross_compiling" = yes; then
6963   cat > conftest.$ac_ext <<EOF
6964 #line 6965 "configure"
6965 #include "confdefs.h"
6966 /* pthread test headers */
6967 #include <pthread.h>
6968 #ifndef NULL
6969 #define NULL (void*)0
6970 #endif
6971
6972 static void *task(p)
6973         void *p;
6974 {
6975         return (void *) (p == NULL);
6976 }
6977
6978 int main() {
6979
6980         /* pthread test function */
6981         pthread_t t;
6982         int status;
6983
6984         /* make sure pthread_create() isn't just a stub */
6985 #if HAVE_PTHREADS_D4
6986         status = pthread_create(&t, pthread_attr_default, task, NULL);
6987 #else
6988         status = pthread_create(&t, NULL, task, NULL);
6989 #endif
6990
6991         if( status ) exit( status );
6992
6993         /* make sure pthread_detach() isn't just a stub */
6994 #if HAVE_PTHREADS_D4
6995         status = pthread_detach( &t );
6996 #else
6997         status = pthread_detach( t );
6998 #endif
6999
7000 #ifdef HAVE_LINUX_THREADS
7001         pthread_kill_other_threads_np();
7002 #endif
7003
7004         exit( status );
7005
7006 ; return 0; }
7007 EOF
7008 if { (eval echo configure:7009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7009   rm -rf conftest*
7010   ol_cv_pthread_pthreads=yes
7011 else
7012   echo "configure: failed program was:" >&5
7013   cat conftest.$ac_ext >&5
7014   rm -rf conftest*
7015   ol_cv_pthread_pthreads=no
7016 fi
7017 rm -f conftest*
7018 else
7019   cat > conftest.$ac_ext <<EOF
7020 #line 7021 "configure"
7021 #include "confdefs.h"
7022 /* pthread test headers */
7023 #include <pthread.h>
7024 #ifndef NULL
7025 #define NULL (void*)0
7026 #endif
7027
7028 static void *task(p)
7029         void *p;
7030 {
7031         return (void *) (p == NULL);
7032 }
7033
7034
7035 int main(argc, argv)
7036         int argc;
7037         char **argv;
7038 {
7039
7040         /* pthread test function */
7041         pthread_t t;
7042         int status;
7043
7044         /* make sure pthread_create() isn't just a stub */
7045 #if HAVE_PTHREADS_D4
7046         status = pthread_create(&t, pthread_attr_default, task, NULL);
7047 #else
7048         status = pthread_create(&t, NULL, task, NULL);
7049 #endif
7050
7051         if( status ) exit( status );
7052
7053         /* make sure pthread_detach() isn't just a stub */
7054 #if HAVE_PTHREADS_D4
7055         status = pthread_detach( &t );
7056 #else
7057         status = pthread_detach( t );
7058 #endif
7059
7060 #ifdef HAVE_LINUX_THREADS
7061         pthread_kill_other_threads_np();
7062 #endif
7063
7064         exit( status );
7065
7066 }
7067
7068 EOF
7069 if { (eval echo configure:7070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7070 then
7071   ol_cv_pthread_pthreads=yes
7072 else
7073   echo "configure: failed program was:" >&5
7074   cat conftest.$ac_ext >&5
7075   rm -fr conftest*
7076   ol_cv_pthread_pthreads=no
7077 fi
7078 rm -fr conftest*
7079 fi
7080
7081
7082                 # restore the LIBS
7083                 LIBS="$ol_LIBS"
7084         
7085 fi
7086
7087 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
7088
7089         if test $ol_cv_pthread_pthreads = yes ; then
7090                 ol_link_pthreads="-pthreads"
7091                 ol_link_threads=posix
7092         fi
7093 fi
7094
7095                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
7096 if test "$ol_link_threads" = no ; then
7097         # try -mthreads
7098         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
7099 echo "configure:7100: checking for pthread link with -mthreads" >&5
7100 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
7101   echo $ac_n "(cached) $ac_c" 1>&6
7102 else
7103   
7104                 # save the flags
7105                 ol_LIBS="$LIBS"
7106                 LIBS="-mthreads $LIBS"
7107
7108                 if test "$cross_compiling" = yes; then
7109   cat > conftest.$ac_ext <<EOF
7110 #line 7111 "configure"
7111 #include "confdefs.h"
7112 /* pthread test headers */
7113 #include <pthread.h>
7114 #ifndef NULL
7115 #define NULL (void*)0
7116 #endif
7117
7118 static void *task(p)
7119         void *p;
7120 {
7121         return (void *) (p == NULL);
7122 }
7123
7124 int main() {
7125
7126         /* pthread test function */
7127         pthread_t t;
7128         int status;
7129
7130         /* make sure pthread_create() isn't just a stub */
7131 #if HAVE_PTHREADS_D4
7132         status = pthread_create(&t, pthread_attr_default, task, NULL);
7133 #else
7134         status = pthread_create(&t, NULL, task, NULL);
7135 #endif
7136
7137         if( status ) exit( status );
7138
7139         /* make sure pthread_detach() isn't just a stub */
7140 #if HAVE_PTHREADS_D4
7141         status = pthread_detach( &t );
7142 #else
7143         status = pthread_detach( t );
7144 #endif
7145
7146 #ifdef HAVE_LINUX_THREADS
7147         pthread_kill_other_threads_np();
7148 #endif
7149
7150         exit( status );
7151
7152 ; return 0; }
7153 EOF
7154 if { (eval echo configure:7155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7155   rm -rf conftest*
7156   ol_cv_pthread_mthreads=yes
7157 else
7158   echo "configure: failed program was:" >&5
7159   cat conftest.$ac_ext >&5
7160   rm -rf conftest*
7161   ol_cv_pthread_mthreads=no
7162 fi
7163 rm -f conftest*
7164 else
7165   cat > conftest.$ac_ext <<EOF
7166 #line 7167 "configure"
7167 #include "confdefs.h"
7168 /* pthread test headers */
7169 #include <pthread.h>
7170 #ifndef NULL
7171 #define NULL (void*)0
7172 #endif
7173
7174 static void *task(p)
7175         void *p;
7176 {
7177         return (void *) (p == NULL);
7178 }
7179
7180
7181 int main(argc, argv)
7182         int argc;
7183         char **argv;
7184 {
7185
7186         /* pthread test function */
7187         pthread_t t;
7188         int status;
7189
7190         /* make sure pthread_create() isn't just a stub */
7191 #if HAVE_PTHREADS_D4
7192         status = pthread_create(&t, pthread_attr_default, task, NULL);
7193 #else
7194         status = pthread_create(&t, NULL, task, NULL);
7195 #endif
7196
7197         if( status ) exit( status );
7198
7199         /* make sure pthread_detach() isn't just a stub */
7200 #if HAVE_PTHREADS_D4
7201         status = pthread_detach( &t );
7202 #else
7203         status = pthread_detach( t );
7204 #endif
7205
7206 #ifdef HAVE_LINUX_THREADS
7207         pthread_kill_other_threads_np();
7208 #endif
7209
7210         exit( status );
7211
7212 }
7213
7214 EOF
7215 if { (eval echo configure:7216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7216 then
7217   ol_cv_pthread_mthreads=yes
7218 else
7219   echo "configure: failed program was:" >&5
7220   cat conftest.$ac_ext >&5
7221   rm -fr conftest*
7222   ol_cv_pthread_mthreads=no
7223 fi
7224 rm -fr conftest*
7225 fi
7226
7227
7228                 # restore the LIBS
7229                 LIBS="$ol_LIBS"
7230         
7231 fi
7232
7233 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
7234
7235         if test $ol_cv_pthread_mthreads = yes ; then
7236                 ol_link_pthreads="-mthreads"
7237                 ol_link_threads=posix
7238         fi
7239 fi
7240
7241                 # Pthread try link: -thread (ol_cv_pthread_thread)
7242 if test "$ol_link_threads" = no ; then
7243         # try -thread
7244         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
7245 echo "configure:7246: checking for pthread link with -thread" >&5
7246 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
7247   echo $ac_n "(cached) $ac_c" 1>&6
7248 else
7249   
7250                 # save the flags
7251                 ol_LIBS="$LIBS"
7252                 LIBS="-thread $LIBS"
7253
7254                 if test "$cross_compiling" = yes; then
7255   cat > conftest.$ac_ext <<EOF
7256 #line 7257 "configure"
7257 #include "confdefs.h"
7258 /* pthread test headers */
7259 #include <pthread.h>
7260 #ifndef NULL
7261 #define NULL (void*)0
7262 #endif
7263
7264 static void *task(p)
7265         void *p;
7266 {
7267         return (void *) (p == NULL);
7268 }
7269
7270 int main() {
7271
7272         /* pthread test function */
7273         pthread_t t;
7274         int status;
7275
7276         /* make sure pthread_create() isn't just a stub */
7277 #if HAVE_PTHREADS_D4
7278         status = pthread_create(&t, pthread_attr_default, task, NULL);
7279 #else
7280         status = pthread_create(&t, NULL, task, NULL);
7281 #endif
7282
7283         if( status ) exit( status );
7284
7285         /* make sure pthread_detach() isn't just a stub */
7286 #if HAVE_PTHREADS_D4
7287         status = pthread_detach( &t );
7288 #else
7289         status = pthread_detach( t );
7290 #endif
7291
7292 #ifdef HAVE_LINUX_THREADS
7293         pthread_kill_other_threads_np();
7294 #endif
7295
7296         exit( status );
7297
7298 ; return 0; }
7299 EOF
7300 if { (eval echo configure:7301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7301   rm -rf conftest*
7302   ol_cv_pthread_thread=yes
7303 else
7304   echo "configure: failed program was:" >&5
7305   cat conftest.$ac_ext >&5
7306   rm -rf conftest*
7307   ol_cv_pthread_thread=no
7308 fi
7309 rm -f conftest*
7310 else
7311   cat > conftest.$ac_ext <<EOF
7312 #line 7313 "configure"
7313 #include "confdefs.h"
7314 /* pthread test headers */
7315 #include <pthread.h>
7316 #ifndef NULL
7317 #define NULL (void*)0
7318 #endif
7319
7320 static void *task(p)
7321         void *p;
7322 {
7323         return (void *) (p == NULL);
7324 }
7325
7326
7327 int main(argc, argv)
7328         int argc;
7329         char **argv;
7330 {
7331
7332         /* pthread test function */
7333         pthread_t t;
7334         int status;
7335
7336         /* make sure pthread_create() isn't just a stub */
7337 #if HAVE_PTHREADS_D4
7338         status = pthread_create(&t, pthread_attr_default, task, NULL);
7339 #else
7340         status = pthread_create(&t, NULL, task, NULL);
7341 #endif
7342
7343         if( status ) exit( status );
7344
7345         /* make sure pthread_detach() isn't just a stub */
7346 #if HAVE_PTHREADS_D4
7347         status = pthread_detach( &t );
7348 #else
7349         status = pthread_detach( t );
7350 #endif
7351
7352 #ifdef HAVE_LINUX_THREADS
7353         pthread_kill_other_threads_np();
7354 #endif
7355
7356         exit( status );
7357
7358 }
7359
7360 EOF
7361 if { (eval echo configure:7362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7362 then
7363   ol_cv_pthread_thread=yes
7364 else
7365   echo "configure: failed program was:" >&5
7366   cat conftest.$ac_ext >&5
7367   rm -fr conftest*
7368   ol_cv_pthread_thread=no
7369 fi
7370 rm -fr conftest*
7371 fi
7372
7373
7374                 # restore the LIBS
7375                 LIBS="$ol_LIBS"
7376         
7377 fi
7378
7379 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
7380
7381         if test $ol_cv_pthread_thread = yes ; then
7382                 ol_link_pthreads="-thread"
7383                 ol_link_threads=posix
7384         fi
7385 fi
7386
7387
7388                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
7389 if test "$ol_link_threads" = no ; then
7390         # try -lpthread -lmach -lexc -lc_r
7391         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
7392 echo "configure:7393: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
7393 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
7394   echo $ac_n "(cached) $ac_c" 1>&6
7395 else
7396   
7397                 # save the flags
7398                 ol_LIBS="$LIBS"
7399                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
7400
7401                 if test "$cross_compiling" = yes; then
7402   cat > conftest.$ac_ext <<EOF
7403 #line 7404 "configure"
7404 #include "confdefs.h"
7405 /* pthread test headers */
7406 #include <pthread.h>
7407 #ifndef NULL
7408 #define NULL (void*)0
7409 #endif
7410
7411 static void *task(p)
7412         void *p;
7413 {
7414         return (void *) (p == NULL);
7415 }
7416
7417 int main() {
7418
7419         /* pthread test function */
7420         pthread_t t;
7421         int status;
7422
7423         /* make sure pthread_create() isn't just a stub */
7424 #if HAVE_PTHREADS_D4
7425         status = pthread_create(&t, pthread_attr_default, task, NULL);
7426 #else
7427         status = pthread_create(&t, NULL, task, NULL);
7428 #endif
7429
7430         if( status ) exit( status );
7431
7432         /* make sure pthread_detach() isn't just a stub */
7433 #if HAVE_PTHREADS_D4
7434         status = pthread_detach( &t );
7435 #else
7436         status = pthread_detach( t );
7437 #endif
7438
7439 #ifdef HAVE_LINUX_THREADS
7440         pthread_kill_other_threads_np();
7441 #endif
7442
7443         exit( status );
7444
7445 ; return 0; }
7446 EOF
7447 if { (eval echo configure:7448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7448   rm -rf conftest*
7449   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
7450 else
7451   echo "configure: failed program was:" >&5
7452   cat conftest.$ac_ext >&5
7453   rm -rf conftest*
7454   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
7455 fi
7456 rm -f conftest*
7457 else
7458   cat > conftest.$ac_ext <<EOF
7459 #line 7460 "configure"
7460 #include "confdefs.h"
7461 /* pthread test headers */
7462 #include <pthread.h>
7463 #ifndef NULL
7464 #define NULL (void*)0
7465 #endif
7466
7467 static void *task(p)
7468         void *p;
7469 {
7470         return (void *) (p == NULL);
7471 }
7472
7473
7474 int main(argc, argv)
7475         int argc;
7476         char **argv;
7477 {
7478
7479         /* pthread test function */
7480         pthread_t t;
7481         int status;
7482
7483         /* make sure pthread_create() isn't just a stub */
7484 #if HAVE_PTHREADS_D4
7485         status = pthread_create(&t, pthread_attr_default, task, NULL);
7486 #else
7487         status = pthread_create(&t, NULL, task, NULL);
7488 #endif
7489
7490         if( status ) exit( status );
7491
7492         /* make sure pthread_detach() isn't just a stub */
7493 #if HAVE_PTHREADS_D4
7494         status = pthread_detach( &t );
7495 #else
7496         status = pthread_detach( t );
7497 #endif
7498
7499 #ifdef HAVE_LINUX_THREADS
7500         pthread_kill_other_threads_np();
7501 #endif
7502
7503         exit( status );
7504
7505 }
7506
7507 EOF
7508 if { (eval echo configure:7509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7509 then
7510   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
7511 else
7512   echo "configure: failed program was:" >&5
7513   cat conftest.$ac_ext >&5
7514   rm -fr conftest*
7515   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
7516 fi
7517 rm -fr conftest*
7518 fi
7519
7520
7521                 # restore the LIBS
7522                 LIBS="$ol_LIBS"
7523         
7524 fi
7525
7526 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
7527
7528         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
7529                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
7530                 ol_link_threads=posix
7531         fi
7532 fi
7533
7534                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
7535 if test "$ol_link_threads" = no ; then
7536         # try -lpthread -lmach -lexc
7537         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
7538 echo "configure:7539: checking for pthread link with -lpthread -lmach -lexc" >&5
7539 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
7540   echo $ac_n "(cached) $ac_c" 1>&6
7541 else
7542   
7543                 # save the flags
7544                 ol_LIBS="$LIBS"
7545                 LIBS="-lpthread -lmach -lexc $LIBS"
7546
7547                 if test "$cross_compiling" = yes; then
7548   cat > conftest.$ac_ext <<EOF
7549 #line 7550 "configure"
7550 #include "confdefs.h"
7551 /* pthread test headers */
7552 #include <pthread.h>
7553 #ifndef NULL
7554 #define NULL (void*)0
7555 #endif
7556
7557 static void *task(p)
7558         void *p;
7559 {
7560         return (void *) (p == NULL);
7561 }
7562
7563 int main() {
7564
7565         /* pthread test function */
7566         pthread_t t;
7567         int status;
7568
7569         /* make sure pthread_create() isn't just a stub */
7570 #if HAVE_PTHREADS_D4
7571         status = pthread_create(&t, pthread_attr_default, task, NULL);
7572 #else
7573         status = pthread_create(&t, NULL, task, NULL);
7574 #endif
7575
7576         if( status ) exit( status );
7577
7578         /* make sure pthread_detach() isn't just a stub */
7579 #if HAVE_PTHREADS_D4
7580         status = pthread_detach( &t );
7581 #else
7582         status = pthread_detach( t );
7583 #endif
7584
7585 #ifdef HAVE_LINUX_THREADS
7586         pthread_kill_other_threads_np();
7587 #endif
7588
7589         exit( status );
7590
7591 ; return 0; }
7592 EOF
7593 if { (eval echo configure:7594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7594   rm -rf conftest*
7595   ol_cv_pthread_lpthread_lmach_lexc=yes
7596 else
7597   echo "configure: failed program was:" >&5
7598   cat conftest.$ac_ext >&5
7599   rm -rf conftest*
7600   ol_cv_pthread_lpthread_lmach_lexc=no
7601 fi
7602 rm -f conftest*
7603 else
7604   cat > conftest.$ac_ext <<EOF
7605 #line 7606 "configure"
7606 #include "confdefs.h"
7607 /* pthread test headers */
7608 #include <pthread.h>
7609 #ifndef NULL
7610 #define NULL (void*)0
7611 #endif
7612
7613 static void *task(p)
7614         void *p;
7615 {
7616         return (void *) (p == NULL);
7617 }
7618
7619
7620 int main(argc, argv)
7621         int argc;
7622         char **argv;
7623 {
7624
7625         /* pthread test function */
7626         pthread_t t;
7627         int status;
7628
7629         /* make sure pthread_create() isn't just a stub */
7630 #if HAVE_PTHREADS_D4
7631         status = pthread_create(&t, pthread_attr_default, task, NULL);
7632 #else
7633         status = pthread_create(&t, NULL, task, NULL);
7634 #endif
7635
7636         if( status ) exit( status );
7637
7638         /* make sure pthread_detach() isn't just a stub */
7639 #if HAVE_PTHREADS_D4
7640         status = pthread_detach( &t );
7641 #else
7642         status = pthread_detach( t );
7643 #endif
7644
7645 #ifdef HAVE_LINUX_THREADS
7646         pthread_kill_other_threads_np();
7647 #endif
7648
7649         exit( status );
7650
7651 }
7652
7653 EOF
7654 if { (eval echo configure:7655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7655 then
7656   ol_cv_pthread_lpthread_lmach_lexc=yes
7657 else
7658   echo "configure: failed program was:" >&5
7659   cat conftest.$ac_ext >&5
7660   rm -fr conftest*
7661   ol_cv_pthread_lpthread_lmach_lexc=no
7662 fi
7663 rm -fr conftest*
7664 fi
7665
7666
7667                 # restore the LIBS
7668                 LIBS="$ol_LIBS"
7669         
7670 fi
7671
7672 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
7673
7674         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
7675                 ol_link_pthreads="-lpthread -lmach -lexc"
7676                 ol_link_threads=posix
7677         fi
7678 fi
7679
7680
7681                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
7682 if test "$ol_link_threads" = no ; then
7683         # try -lpthread -Wl,-woff,85
7684         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
7685 echo "configure:7686: checking for pthread link with -lpthread -Wl,-woff,85" >&5
7686 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
7687   echo $ac_n "(cached) $ac_c" 1>&6
7688 else
7689   
7690                 # save the flags
7691                 ol_LIBS="$LIBS"
7692                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
7693
7694                 if test "$cross_compiling" = yes; then
7695   cat > conftest.$ac_ext <<EOF
7696 #line 7697 "configure"
7697 #include "confdefs.h"
7698 /* pthread test headers */
7699 #include <pthread.h>
7700 #ifndef NULL
7701 #define NULL (void*)0
7702 #endif
7703
7704 static void *task(p)
7705         void *p;
7706 {
7707         return (void *) (p == NULL);
7708 }
7709
7710 int main() {
7711
7712         /* pthread test function */
7713         pthread_t t;
7714         int status;
7715
7716         /* make sure pthread_create() isn't just a stub */
7717 #if HAVE_PTHREADS_D4
7718         status = pthread_create(&t, pthread_attr_default, task, NULL);
7719 #else
7720         status = pthread_create(&t, NULL, task, NULL);
7721 #endif
7722
7723         if( status ) exit( status );
7724
7725         /* make sure pthread_detach() isn't just a stub */
7726 #if HAVE_PTHREADS_D4
7727         status = pthread_detach( &t );
7728 #else
7729         status = pthread_detach( t );
7730 #endif
7731
7732 #ifdef HAVE_LINUX_THREADS
7733         pthread_kill_other_threads_np();
7734 #endif
7735
7736         exit( status );
7737
7738 ; return 0; }
7739 EOF
7740 if { (eval echo configure:7741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7741   rm -rf conftest*
7742   ol_cv_pthread_lib_lpthread_woff=yes
7743 else
7744   echo "configure: failed program was:" >&5
7745   cat conftest.$ac_ext >&5
7746   rm -rf conftest*
7747   ol_cv_pthread_lib_lpthread_woff=no
7748 fi
7749 rm -f conftest*
7750 else
7751   cat > conftest.$ac_ext <<EOF
7752 #line 7753 "configure"
7753 #include "confdefs.h"
7754 /* pthread test headers */
7755 #include <pthread.h>
7756 #ifndef NULL
7757 #define NULL (void*)0
7758 #endif
7759
7760 static void *task(p)
7761         void *p;
7762 {
7763         return (void *) (p == NULL);
7764 }
7765
7766
7767 int main(argc, argv)
7768         int argc;
7769         char **argv;
7770 {
7771
7772         /* pthread test function */
7773         pthread_t t;
7774         int status;
7775
7776         /* make sure pthread_create() isn't just a stub */
7777 #if HAVE_PTHREADS_D4
7778         status = pthread_create(&t, pthread_attr_default, task, NULL);
7779 #else
7780         status = pthread_create(&t, NULL, task, NULL);
7781 #endif
7782
7783         if( status ) exit( status );
7784
7785         /* make sure pthread_detach() isn't just a stub */
7786 #if HAVE_PTHREADS_D4
7787         status = pthread_detach( &t );
7788 #else
7789         status = pthread_detach( t );
7790 #endif
7791
7792 #ifdef HAVE_LINUX_THREADS
7793         pthread_kill_other_threads_np();
7794 #endif
7795
7796         exit( status );
7797
7798 }
7799
7800 EOF
7801 if { (eval echo configure:7802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7802 then
7803   ol_cv_pthread_lib_lpthread_woff=yes
7804 else
7805   echo "configure: failed program was:" >&5
7806   cat conftest.$ac_ext >&5
7807   rm -fr conftest*
7808   ol_cv_pthread_lib_lpthread_woff=no
7809 fi
7810 rm -fr conftest*
7811 fi
7812
7813
7814                 # restore the LIBS
7815                 LIBS="$ol_LIBS"
7816         
7817 fi
7818
7819 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
7820
7821         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
7822                 ol_link_pthreads="-lpthread -Wl,-woff,85"
7823                 ol_link_threads=posix
7824         fi
7825 fi
7826
7827
7828                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
7829 if test "$ol_link_threads" = no ; then
7830         # try -lpthread
7831         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
7832 echo "configure:7833: checking for pthread link with -lpthread" >&5
7833 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
7834   echo $ac_n "(cached) $ac_c" 1>&6
7835 else
7836   
7837                 # save the flags
7838                 ol_LIBS="$LIBS"
7839                 LIBS="-lpthread $LIBS"
7840
7841                 if test "$cross_compiling" = yes; then
7842   cat > conftest.$ac_ext <<EOF
7843 #line 7844 "configure"
7844 #include "confdefs.h"
7845 /* pthread test headers */
7846 #include <pthread.h>
7847 #ifndef NULL
7848 #define NULL (void*)0
7849 #endif
7850
7851 static void *task(p)
7852         void *p;
7853 {
7854         return (void *) (p == NULL);
7855 }
7856
7857 int main() {
7858
7859         /* pthread test function */
7860         pthread_t t;
7861         int status;
7862
7863         /* make sure pthread_create() isn't just a stub */
7864 #if HAVE_PTHREADS_D4
7865         status = pthread_create(&t, pthread_attr_default, task, NULL);
7866 #else
7867         status = pthread_create(&t, NULL, task, NULL);
7868 #endif
7869
7870         if( status ) exit( status );
7871
7872         /* make sure pthread_detach() isn't just a stub */
7873 #if HAVE_PTHREADS_D4
7874         status = pthread_detach( &t );
7875 #else
7876         status = pthread_detach( t );
7877 #endif
7878
7879 #ifdef HAVE_LINUX_THREADS
7880         pthread_kill_other_threads_np();
7881 #endif
7882
7883         exit( status );
7884
7885 ; return 0; }
7886 EOF
7887 if { (eval echo configure:7888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7888   rm -rf conftest*
7889   ol_cv_pthread_lpthread=yes
7890 else
7891   echo "configure: failed program was:" >&5
7892   cat conftest.$ac_ext >&5
7893   rm -rf conftest*
7894   ol_cv_pthread_lpthread=no
7895 fi
7896 rm -f conftest*
7897 else
7898   cat > conftest.$ac_ext <<EOF
7899 #line 7900 "configure"
7900 #include "confdefs.h"
7901 /* pthread test headers */
7902 #include <pthread.h>
7903 #ifndef NULL
7904 #define NULL (void*)0
7905 #endif
7906
7907 static void *task(p)
7908         void *p;
7909 {
7910         return (void *) (p == NULL);
7911 }
7912
7913
7914 int main(argc, argv)
7915         int argc;
7916         char **argv;
7917 {
7918
7919         /* pthread test function */
7920         pthread_t t;
7921         int status;
7922
7923         /* make sure pthread_create() isn't just a stub */
7924 #if HAVE_PTHREADS_D4
7925         status = pthread_create(&t, pthread_attr_default, task, NULL);
7926 #else
7927         status = pthread_create(&t, NULL, task, NULL);
7928 #endif
7929
7930         if( status ) exit( status );
7931
7932         /* make sure pthread_detach() isn't just a stub */
7933 #if HAVE_PTHREADS_D4
7934         status = pthread_detach( &t );
7935 #else
7936         status = pthread_detach( t );
7937 #endif
7938
7939 #ifdef HAVE_LINUX_THREADS
7940         pthread_kill_other_threads_np();
7941 #endif
7942
7943         exit( status );
7944
7945 }
7946
7947 EOF
7948 if { (eval echo configure:7949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7949 then
7950   ol_cv_pthread_lpthread=yes
7951 else
7952   echo "configure: failed program was:" >&5
7953   cat conftest.$ac_ext >&5
7954   rm -fr conftest*
7955   ol_cv_pthread_lpthread=no
7956 fi
7957 rm -fr conftest*
7958 fi
7959
7960
7961                 # restore the LIBS
7962                 LIBS="$ol_LIBS"
7963         
7964 fi
7965
7966 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
7967
7968         if test $ol_cv_pthread_lpthread = yes ; then
7969                 ol_link_pthreads="-lpthread"
7970                 ol_link_threads=posix
7971         fi
7972 fi
7973
7974                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
7975 if test "$ol_link_threads" = no ; then
7976         # try -lc_r
7977         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
7978 echo "configure:7979: checking for pthread link with -lc_r" >&5
7979 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
7980   echo $ac_n "(cached) $ac_c" 1>&6
7981 else
7982   
7983                 # save the flags
7984                 ol_LIBS="$LIBS"
7985                 LIBS="-lc_r $LIBS"
7986
7987                 if test "$cross_compiling" = yes; then
7988   cat > conftest.$ac_ext <<EOF
7989 #line 7990 "configure"
7990 #include "confdefs.h"
7991 /* pthread test headers */
7992 #include <pthread.h>
7993 #ifndef NULL
7994 #define NULL (void*)0
7995 #endif
7996
7997 static void *task(p)
7998         void *p;
7999 {
8000         return (void *) (p == NULL);
8001 }
8002
8003 int main() {
8004
8005         /* pthread test function */
8006         pthread_t t;
8007         int status;
8008
8009         /* make sure pthread_create() isn't just a stub */
8010 #if HAVE_PTHREADS_D4
8011         status = pthread_create(&t, pthread_attr_default, task, NULL);
8012 #else
8013         status = pthread_create(&t, NULL, task, NULL);
8014 #endif
8015
8016         if( status ) exit( status );
8017
8018         /* make sure pthread_detach() isn't just a stub */
8019 #if HAVE_PTHREADS_D4
8020         status = pthread_detach( &t );
8021 #else
8022         status = pthread_detach( t );
8023 #endif
8024
8025 #ifdef HAVE_LINUX_THREADS
8026         pthread_kill_other_threads_np();
8027 #endif
8028
8029         exit( status );
8030
8031 ; return 0; }
8032 EOF
8033 if { (eval echo configure:8034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8034   rm -rf conftest*
8035   ol_cv_pthread_lc_r=yes
8036 else
8037   echo "configure: failed program was:" >&5
8038   cat conftest.$ac_ext >&5
8039   rm -rf conftest*
8040   ol_cv_pthread_lc_r=no
8041 fi
8042 rm -f conftest*
8043 else
8044   cat > conftest.$ac_ext <<EOF
8045 #line 8046 "configure"
8046 #include "confdefs.h"
8047 /* pthread test headers */
8048 #include <pthread.h>
8049 #ifndef NULL
8050 #define NULL (void*)0
8051 #endif
8052
8053 static void *task(p)
8054         void *p;
8055 {
8056         return (void *) (p == NULL);
8057 }
8058
8059
8060 int main(argc, argv)
8061         int argc;
8062         char **argv;
8063 {
8064
8065         /* pthread test function */
8066         pthread_t t;
8067         int status;
8068
8069         /* make sure pthread_create() isn't just a stub */
8070 #if HAVE_PTHREADS_D4
8071         status = pthread_create(&t, pthread_attr_default, task, NULL);
8072 #else
8073         status = pthread_create(&t, NULL, task, NULL);
8074 #endif
8075
8076         if( status ) exit( status );
8077
8078         /* make sure pthread_detach() isn't just a stub */
8079 #if HAVE_PTHREADS_D4
8080         status = pthread_detach( &t );
8081 #else
8082         status = pthread_detach( t );
8083 #endif
8084
8085 #ifdef HAVE_LINUX_THREADS
8086         pthread_kill_other_threads_np();
8087 #endif
8088
8089         exit( status );
8090
8091 }
8092
8093 EOF
8094 if { (eval echo configure:8095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8095 then
8096   ol_cv_pthread_lc_r=yes
8097 else
8098   echo "configure: failed program was:" >&5
8099   cat conftest.$ac_ext >&5
8100   rm -fr conftest*
8101   ol_cv_pthread_lc_r=no
8102 fi
8103 rm -fr conftest*
8104 fi
8105
8106
8107                 # restore the LIBS
8108                 LIBS="$ol_LIBS"
8109         
8110 fi
8111
8112 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
8113
8114         if test $ol_cv_pthread_lc_r = yes ; then
8115                 ol_link_pthreads="-lc_r"
8116                 ol_link_threads=posix
8117         fi
8118 fi
8119
8120
8121                 # Pthread try link: -threads (ol_cv_pthread_threads)
8122 if test "$ol_link_threads" = no ; then
8123         # try -threads
8124         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
8125 echo "configure:8126: checking for pthread link with -threads" >&5
8126 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
8127   echo $ac_n "(cached) $ac_c" 1>&6
8128 else
8129   
8130                 # save the flags
8131                 ol_LIBS="$LIBS"
8132                 LIBS="-threads $LIBS"
8133
8134                 if test "$cross_compiling" = yes; then
8135   cat > conftest.$ac_ext <<EOF
8136 #line 8137 "configure"
8137 #include "confdefs.h"
8138 /* pthread test headers */
8139 #include <pthread.h>
8140 #ifndef NULL
8141 #define NULL (void*)0
8142 #endif
8143
8144 static void *task(p)
8145         void *p;
8146 {
8147         return (void *) (p == NULL);
8148 }
8149
8150 int main() {
8151
8152         /* pthread test function */
8153         pthread_t t;
8154         int status;
8155
8156         /* make sure pthread_create() isn't just a stub */
8157 #if HAVE_PTHREADS_D4
8158         status = pthread_create(&t, pthread_attr_default, task, NULL);
8159 #else
8160         status = pthread_create(&t, NULL, task, NULL);
8161 #endif
8162
8163         if( status ) exit( status );
8164
8165         /* make sure pthread_detach() isn't just a stub */
8166 #if HAVE_PTHREADS_D4
8167         status = pthread_detach( &t );
8168 #else
8169         status = pthread_detach( t );
8170 #endif
8171
8172 #ifdef HAVE_LINUX_THREADS
8173         pthread_kill_other_threads_np();
8174 #endif
8175
8176         exit( status );
8177
8178 ; return 0; }
8179 EOF
8180 if { (eval echo configure:8181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8181   rm -rf conftest*
8182   ol_cv_pthread_threads=yes
8183 else
8184   echo "configure: failed program was:" >&5
8185   cat conftest.$ac_ext >&5
8186   rm -rf conftest*
8187   ol_cv_pthread_threads=no
8188 fi
8189 rm -f conftest*
8190 else
8191   cat > conftest.$ac_ext <<EOF
8192 #line 8193 "configure"
8193 #include "confdefs.h"
8194 /* pthread test headers */
8195 #include <pthread.h>
8196 #ifndef NULL
8197 #define NULL (void*)0
8198 #endif
8199
8200 static void *task(p)
8201         void *p;
8202 {
8203         return (void *) (p == NULL);
8204 }
8205
8206
8207 int main(argc, argv)
8208         int argc;
8209         char **argv;
8210 {
8211
8212         /* pthread test function */
8213         pthread_t t;
8214         int status;
8215
8216         /* make sure pthread_create() isn't just a stub */
8217 #if HAVE_PTHREADS_D4
8218         status = pthread_create(&t, pthread_attr_default, task, NULL);
8219 #else
8220         status = pthread_create(&t, NULL, task, NULL);
8221 #endif
8222
8223         if( status ) exit( status );
8224
8225         /* make sure pthread_detach() isn't just a stub */
8226 #if HAVE_PTHREADS_D4
8227         status = pthread_detach( &t );
8228 #else
8229         status = pthread_detach( t );
8230 #endif
8231
8232 #ifdef HAVE_LINUX_THREADS
8233         pthread_kill_other_threads_np();
8234 #endif
8235
8236         exit( status );
8237
8238 }
8239
8240 EOF
8241 if { (eval echo configure:8242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8242 then
8243   ol_cv_pthread_threads=yes
8244 else
8245   echo "configure: failed program was:" >&5
8246   cat conftest.$ac_ext >&5
8247   rm -fr conftest*
8248   ol_cv_pthread_threads=no
8249 fi
8250 rm -fr conftest*
8251 fi
8252
8253
8254                 # restore the LIBS
8255                 LIBS="$ol_LIBS"
8256         
8257 fi
8258
8259 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
8260
8261         if test $ol_cv_pthread_threads = yes ; then
8262                 ol_link_pthreads="-threads"
8263                 ol_link_threads=posix
8264         fi
8265 fi
8266
8267
8268                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
8269 if test "$ol_link_threads" = no ; then
8270         # try -lpthreads -lmach -lexc -lc_r
8271         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
8272 echo "configure:8273: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
8273 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
8274   echo $ac_n "(cached) $ac_c" 1>&6
8275 else
8276   
8277                 # save the flags
8278                 ol_LIBS="$LIBS"
8279                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
8280
8281                 if test "$cross_compiling" = yes; then
8282   cat > conftest.$ac_ext <<EOF
8283 #line 8284 "configure"
8284 #include "confdefs.h"
8285 /* pthread test headers */
8286 #include <pthread.h>
8287 #ifndef NULL
8288 #define NULL (void*)0
8289 #endif
8290
8291 static void *task(p)
8292         void *p;
8293 {
8294         return (void *) (p == NULL);
8295 }
8296
8297 int main() {
8298
8299         /* pthread test function */
8300         pthread_t t;
8301         int status;
8302
8303         /* make sure pthread_create() isn't just a stub */
8304 #if HAVE_PTHREADS_D4
8305         status = pthread_create(&t, pthread_attr_default, task, NULL);
8306 #else
8307         status = pthread_create(&t, NULL, task, NULL);
8308 #endif
8309
8310         if( status ) exit( status );
8311
8312         /* make sure pthread_detach() isn't just a stub */
8313 #if HAVE_PTHREADS_D4
8314         status = pthread_detach( &t );
8315 #else
8316         status = pthread_detach( t );
8317 #endif
8318
8319 #ifdef HAVE_LINUX_THREADS
8320         pthread_kill_other_threads_np();
8321 #endif
8322
8323         exit( status );
8324
8325 ; return 0; }
8326 EOF
8327 if { (eval echo configure:8328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8328   rm -rf conftest*
8329   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
8330 else
8331   echo "configure: failed program was:" >&5
8332   cat conftest.$ac_ext >&5
8333   rm -rf conftest*
8334   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
8335 fi
8336 rm -f conftest*
8337 else
8338   cat > conftest.$ac_ext <<EOF
8339 #line 8340 "configure"
8340 #include "confdefs.h"
8341 /* pthread test headers */
8342 #include <pthread.h>
8343 #ifndef NULL
8344 #define NULL (void*)0
8345 #endif
8346
8347 static void *task(p)
8348         void *p;
8349 {
8350         return (void *) (p == NULL);
8351 }
8352
8353
8354 int main(argc, argv)
8355         int argc;
8356         char **argv;
8357 {
8358
8359         /* pthread test function */
8360         pthread_t t;
8361         int status;
8362
8363         /* make sure pthread_create() isn't just a stub */
8364 #if HAVE_PTHREADS_D4
8365         status = pthread_create(&t, pthread_attr_default, task, NULL);
8366 #else
8367         status = pthread_create(&t, NULL, task, NULL);
8368 #endif
8369
8370         if( status ) exit( status );
8371
8372         /* make sure pthread_detach() isn't just a stub */
8373 #if HAVE_PTHREADS_D4
8374         status = pthread_detach( &t );
8375 #else
8376         status = pthread_detach( t );
8377 #endif
8378
8379 #ifdef HAVE_LINUX_THREADS
8380         pthread_kill_other_threads_np();
8381 #endif
8382
8383         exit( status );
8384
8385 }
8386
8387 EOF
8388 if { (eval echo configure:8389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8389 then
8390   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
8391 else
8392   echo "configure: failed program was:" >&5
8393   cat conftest.$ac_ext >&5
8394   rm -fr conftest*
8395   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
8396 fi
8397 rm -fr conftest*
8398 fi
8399
8400
8401                 # restore the LIBS
8402                 LIBS="$ol_LIBS"
8403         
8404 fi
8405
8406 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
8407
8408         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
8409                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
8410                 ol_link_threads=posix
8411         fi
8412 fi
8413
8414                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
8415 if test "$ol_link_threads" = no ; then
8416         # try -lpthreads -lmach -lexc
8417         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
8418 echo "configure:8419: checking for pthread link with -lpthreads -lmach -lexc" >&5
8419 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
8420   echo $ac_n "(cached) $ac_c" 1>&6
8421 else
8422   
8423                 # save the flags
8424                 ol_LIBS="$LIBS"
8425                 LIBS="-lpthreads -lmach -lexc $LIBS"
8426
8427                 if test "$cross_compiling" = yes; then
8428   cat > conftest.$ac_ext <<EOF
8429 #line 8430 "configure"
8430 #include "confdefs.h"
8431 /* pthread test headers */
8432 #include <pthread.h>
8433 #ifndef NULL
8434 #define NULL (void*)0
8435 #endif
8436
8437 static void *task(p)
8438         void *p;
8439 {
8440         return (void *) (p == NULL);
8441 }
8442
8443 int main() {
8444
8445         /* pthread test function */
8446         pthread_t t;
8447         int status;
8448
8449         /* make sure pthread_create() isn't just a stub */
8450 #if HAVE_PTHREADS_D4
8451         status = pthread_create(&t, pthread_attr_default, task, NULL);
8452 #else
8453         status = pthread_create(&t, NULL, task, NULL);
8454 #endif
8455
8456         if( status ) exit( status );
8457
8458         /* make sure pthread_detach() isn't just a stub */
8459 #if HAVE_PTHREADS_D4
8460         status = pthread_detach( &t );
8461 #else
8462         status = pthread_detach( t );
8463 #endif
8464
8465 #ifdef HAVE_LINUX_THREADS
8466         pthread_kill_other_threads_np();
8467 #endif
8468
8469         exit( status );
8470
8471 ; return 0; }
8472 EOF
8473 if { (eval echo configure:8474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8474   rm -rf conftest*
8475   ol_cv_pthread_lpthreads_lmach_lexc=yes
8476 else
8477   echo "configure: failed program was:" >&5
8478   cat conftest.$ac_ext >&5
8479   rm -rf conftest*
8480   ol_cv_pthread_lpthreads_lmach_lexc=no
8481 fi
8482 rm -f conftest*
8483 else
8484   cat > conftest.$ac_ext <<EOF
8485 #line 8486 "configure"
8486 #include "confdefs.h"
8487 /* pthread test headers */
8488 #include <pthread.h>
8489 #ifndef NULL
8490 #define NULL (void*)0
8491 #endif
8492
8493 static void *task(p)
8494         void *p;
8495 {
8496         return (void *) (p == NULL);
8497 }
8498
8499
8500 int main(argc, argv)
8501         int argc;
8502         char **argv;
8503 {
8504
8505         /* pthread test function */
8506         pthread_t t;
8507         int status;
8508
8509         /* make sure pthread_create() isn't just a stub */
8510 #if HAVE_PTHREADS_D4
8511         status = pthread_create(&t, pthread_attr_default, task, NULL);
8512 #else
8513         status = pthread_create(&t, NULL, task, NULL);
8514 #endif
8515
8516         if( status ) exit( status );
8517
8518         /* make sure pthread_detach() isn't just a stub */
8519 #if HAVE_PTHREADS_D4
8520         status = pthread_detach( &t );
8521 #else
8522         status = pthread_detach( t );
8523 #endif
8524
8525 #ifdef HAVE_LINUX_THREADS
8526         pthread_kill_other_threads_np();
8527 #endif
8528
8529         exit( status );
8530
8531 }
8532
8533 EOF
8534 if { (eval echo configure:8535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8535 then
8536   ol_cv_pthread_lpthreads_lmach_lexc=yes
8537 else
8538   echo "configure: failed program was:" >&5
8539   cat conftest.$ac_ext >&5
8540   rm -fr conftest*
8541   ol_cv_pthread_lpthreads_lmach_lexc=no
8542 fi
8543 rm -fr conftest*
8544 fi
8545
8546
8547                 # restore the LIBS
8548                 LIBS="$ol_LIBS"
8549         
8550 fi
8551
8552 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
8553
8554         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
8555                 ol_link_pthreads="-lpthreads -lmach -lexc"
8556                 ol_link_threads=posix
8557         fi
8558 fi
8559
8560                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
8561 if test "$ol_link_threads" = no ; then
8562         # try -lpthreads -lexc
8563         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
8564 echo "configure:8565: checking for pthread link with -lpthreads -lexc" >&5
8565 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
8566   echo $ac_n "(cached) $ac_c" 1>&6
8567 else
8568   
8569                 # save the flags
8570                 ol_LIBS="$LIBS"
8571                 LIBS="-lpthreads -lexc $LIBS"
8572
8573                 if test "$cross_compiling" = yes; then
8574   cat > conftest.$ac_ext <<EOF
8575 #line 8576 "configure"
8576 #include "confdefs.h"
8577 /* pthread test headers */
8578 #include <pthread.h>
8579 #ifndef NULL
8580 #define NULL (void*)0
8581 #endif
8582
8583 static void *task(p)
8584         void *p;
8585 {
8586         return (void *) (p == NULL);
8587 }
8588
8589 int main() {
8590
8591         /* pthread test function */
8592         pthread_t t;
8593         int status;
8594
8595         /* make sure pthread_create() isn't just a stub */
8596 #if HAVE_PTHREADS_D4
8597         status = pthread_create(&t, pthread_attr_default, task, NULL);
8598 #else
8599         status = pthread_create(&t, NULL, task, NULL);
8600 #endif
8601
8602         if( status ) exit( status );
8603
8604         /* make sure pthread_detach() isn't just a stub */
8605 #if HAVE_PTHREADS_D4
8606         status = pthread_detach( &t );
8607 #else
8608         status = pthread_detach( t );
8609 #endif
8610
8611 #ifdef HAVE_LINUX_THREADS
8612         pthread_kill_other_threads_np();
8613 #endif
8614
8615         exit( status );
8616
8617 ; return 0; }
8618 EOF
8619 if { (eval echo configure:8620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8620   rm -rf conftest*
8621   ol_cv_pthread_lpthreads_lexc=yes
8622 else
8623   echo "configure: failed program was:" >&5
8624   cat conftest.$ac_ext >&5
8625   rm -rf conftest*
8626   ol_cv_pthread_lpthreads_lexc=no
8627 fi
8628 rm -f conftest*
8629 else
8630   cat > conftest.$ac_ext <<EOF
8631 #line 8632 "configure"
8632 #include "confdefs.h"
8633 /* pthread test headers */
8634 #include <pthread.h>
8635 #ifndef NULL
8636 #define NULL (void*)0
8637 #endif
8638
8639 static void *task(p)
8640         void *p;
8641 {
8642         return (void *) (p == NULL);
8643 }
8644
8645
8646 int main(argc, argv)
8647         int argc;
8648         char **argv;
8649 {
8650
8651         /* pthread test function */
8652         pthread_t t;
8653         int status;
8654
8655         /* make sure pthread_create() isn't just a stub */
8656 #if HAVE_PTHREADS_D4
8657         status = pthread_create(&t, pthread_attr_default, task, NULL);
8658 #else
8659         status = pthread_create(&t, NULL, task, NULL);
8660 #endif
8661
8662         if( status ) exit( status );
8663
8664         /* make sure pthread_detach() isn't just a stub */
8665 #if HAVE_PTHREADS_D4
8666         status = pthread_detach( &t );
8667 #else
8668         status = pthread_detach( t );
8669 #endif
8670
8671 #ifdef HAVE_LINUX_THREADS
8672         pthread_kill_other_threads_np();
8673 #endif
8674
8675         exit( status );
8676
8677 }
8678
8679 EOF
8680 if { (eval echo configure:8681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8681 then
8682   ol_cv_pthread_lpthreads_lexc=yes
8683 else
8684   echo "configure: failed program was:" >&5
8685   cat conftest.$ac_ext >&5
8686   rm -fr conftest*
8687   ol_cv_pthread_lpthreads_lexc=no
8688 fi
8689 rm -fr conftest*
8690 fi
8691
8692
8693                 # restore the LIBS
8694                 LIBS="$ol_LIBS"
8695         
8696 fi
8697
8698 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
8699
8700         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
8701                 ol_link_pthreads="-lpthreads -lexc"
8702                 ol_link_threads=posix
8703         fi
8704 fi
8705
8706
8707                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
8708 if test "$ol_link_threads" = no ; then
8709         # try -lpthreads
8710         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
8711 echo "configure:8712: checking for pthread link with -lpthreads" >&5
8712 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
8713   echo $ac_n "(cached) $ac_c" 1>&6
8714 else
8715   
8716                 # save the flags
8717                 ol_LIBS="$LIBS"
8718                 LIBS="-lpthreads $LIBS"
8719
8720                 if test "$cross_compiling" = yes; then
8721   cat > conftest.$ac_ext <<EOF
8722 #line 8723 "configure"
8723 #include "confdefs.h"
8724 /* pthread test headers */
8725 #include <pthread.h>
8726 #ifndef NULL
8727 #define NULL (void*)0
8728 #endif
8729
8730 static void *task(p)
8731         void *p;
8732 {
8733         return (void *) (p == NULL);
8734 }
8735
8736 int main() {
8737
8738         /* pthread test function */
8739         pthread_t t;
8740         int status;
8741
8742         /* make sure pthread_create() isn't just a stub */
8743 #if HAVE_PTHREADS_D4
8744         status = pthread_create(&t, pthread_attr_default, task, NULL);
8745 #else
8746         status = pthread_create(&t, NULL, task, NULL);
8747 #endif
8748
8749         if( status ) exit( status );
8750
8751         /* make sure pthread_detach() isn't just a stub */
8752 #if HAVE_PTHREADS_D4
8753         status = pthread_detach( &t );
8754 #else
8755         status = pthread_detach( t );
8756 #endif
8757
8758 #ifdef HAVE_LINUX_THREADS
8759         pthread_kill_other_threads_np();
8760 #endif
8761
8762         exit( status );
8763
8764 ; return 0; }
8765 EOF
8766 if { (eval echo configure:8767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8767   rm -rf conftest*
8768   ol_cv_pthread_lib_lpthreads=yes
8769 else
8770   echo "configure: failed program was:" >&5
8771   cat conftest.$ac_ext >&5
8772   rm -rf conftest*
8773   ol_cv_pthread_lib_lpthreads=no
8774 fi
8775 rm -f conftest*
8776 else
8777   cat > conftest.$ac_ext <<EOF
8778 #line 8779 "configure"
8779 #include "confdefs.h"
8780 /* pthread test headers */
8781 #include <pthread.h>
8782 #ifndef NULL
8783 #define NULL (void*)0
8784 #endif
8785
8786 static void *task(p)
8787         void *p;
8788 {
8789         return (void *) (p == NULL);
8790 }
8791
8792
8793 int main(argc, argv)
8794         int argc;
8795         char **argv;
8796 {
8797
8798         /* pthread test function */
8799         pthread_t t;
8800         int status;
8801
8802         /* make sure pthread_create() isn't just a stub */
8803 #if HAVE_PTHREADS_D4
8804         status = pthread_create(&t, pthread_attr_default, task, NULL);
8805 #else
8806         status = pthread_create(&t, NULL, task, NULL);
8807 #endif
8808
8809         if( status ) exit( status );
8810
8811         /* make sure pthread_detach() isn't just a stub */
8812 #if HAVE_PTHREADS_D4
8813         status = pthread_detach( &t );
8814 #else
8815         status = pthread_detach( t );
8816 #endif
8817
8818 #ifdef HAVE_LINUX_THREADS
8819         pthread_kill_other_threads_np();
8820 #endif
8821
8822         exit( status );
8823
8824 }
8825
8826 EOF
8827 if { (eval echo configure:8828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8828 then
8829   ol_cv_pthread_lib_lpthreads=yes
8830 else
8831   echo "configure: failed program was:" >&5
8832   cat conftest.$ac_ext >&5
8833   rm -fr conftest*
8834   ol_cv_pthread_lib_lpthreads=no
8835 fi
8836 rm -fr conftest*
8837 fi
8838
8839
8840                 # restore the LIBS
8841                 LIBS="$ol_LIBS"
8842         
8843 fi
8844
8845 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
8846
8847         if test $ol_cv_pthread_lib_lpthreads = yes ; then
8848                 ol_link_pthreads="-lpthreads"
8849                 ol_link_threads=posix
8850         fi
8851 fi
8852
8853
8854                 if test $ol_link_threads != no ; then
8855                         cat >> confdefs.h <<\EOF
8856 #define HAVE_PTHREADS 1
8857 EOF
8858
8859
8860                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
8861
8862                                                 save_CPPFLAGS="$CPPFLAGS"
8863                         save_LIBS="$LIBS"
8864                         LIBS="$LTHREAD_LIBS $LIBS"
8865
8866                                                                                                 for ac_func in sched_yield pthread_yield
8867 do
8868 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8869 echo "configure:8870: checking for $ac_func" >&5
8870 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
8871   echo $ac_n "(cached) $ac_c" 1>&6
8872 else
8873   cat > conftest.$ac_ext <<EOF
8874 #line 8875 "configure"
8875 #include "confdefs.h"
8876 /* System header to define __stub macros and hopefully few prototypes,
8877     which can conflict with char $ac_func(); below.  */
8878 #include <assert.h>
8879 /* Override any gcc2 internal prototype to avoid an error.  */
8880 /* We use char because int might match the return type of a gcc2
8881     builtin and then its argument prototype would still apply.  */
8882 char $ac_func();
8883 char (*f)();
8884
8885 int main() {
8886
8887 /* The GNU C library defines this for functions which it implements
8888     to always fail with ENOSYS.  Some functions are actually named
8889     something starting with __ and the normal name is an alias.  */
8890 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8891 choke me
8892 #else
8893 f = $ac_func;
8894 #endif
8895
8896 ; return 0; }
8897 EOF
8898 if { (eval echo configure:8899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8899   rm -rf conftest*
8900   eval "ac_cv_func_$ac_func=yes"
8901 else
8902   echo "configure: failed program was:" >&5
8903   cat conftest.$ac_ext >&5
8904   rm -rf conftest*
8905   eval "ac_cv_func_$ac_func=no"
8906 fi
8907 rm -f conftest*
8908 fi
8909
8910 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8911   echo "$ac_t""yes" 1>&6
8912     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8913   cat >> confdefs.h <<EOF
8914 #define $ac_tr_func 1
8915 EOF
8916  
8917 else
8918   echo "$ac_t""no" 1>&6
8919 fi
8920 done
8921
8922
8923                         if test $ac_cv_func_sched_yield = no -a \
8924                                 $ac_cv_func_pthread_yield = no ; then
8925                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
8926 echo "configure:8927: checking for sched_yield in -lrt" >&5
8927 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
8928 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8929   echo $ac_n "(cached) $ac_c" 1>&6
8930 else
8931   ac_save_LIBS="$LIBS"
8932 LIBS="-lrt  $LIBS"
8933 cat > conftest.$ac_ext <<EOF
8934 #line 8935 "configure"
8935 #include "confdefs.h"
8936 /* Override any gcc2 internal prototype to avoid an error.  */
8937 /* We use char because int might match the return type of a gcc2
8938     builtin and then its argument prototype would still apply.  */
8939 char sched_yield();
8940
8941 int main() {
8942 sched_yield()
8943 ; return 0; }
8944 EOF
8945 if { (eval echo configure:8946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8946   rm -rf conftest*
8947   eval "ac_cv_lib_$ac_lib_var=yes"
8948 else
8949   echo "configure: failed program was:" >&5
8950   cat conftest.$ac_ext >&5
8951   rm -rf conftest*
8952   eval "ac_cv_lib_$ac_lib_var=no"
8953 fi
8954 rm -f conftest*
8955 LIBS="$ac_save_LIBS"
8956
8957 fi
8958 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8959   echo "$ac_t""yes" 1>&6
8960   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
8961                                         cat >> confdefs.h <<\EOF
8962 #define HAVE_SCHED_YIELD 1
8963 EOF
8964
8965                                         ac_cv_func_sched_yield=yes
8966 else
8967   echo "$ac_t""no" 1>&6
8968 ac_cv_func_sched_yield=no
8969 fi
8970
8971                         fi
8972                         if test $ac_cv_func_sched_yield = no -a \
8973                                 $ac_cv_func_pthread_yield = no ; then
8974                                                                                                 for ac_func in thr_yield
8975 do
8976 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8977 echo "configure:8978: checking for $ac_func" >&5
8978 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
8979   echo $ac_n "(cached) $ac_c" 1>&6
8980 else
8981   cat > conftest.$ac_ext <<EOF
8982 #line 8983 "configure"
8983 #include "confdefs.h"
8984 /* System header to define __stub macros and hopefully few prototypes,
8985     which can conflict with char $ac_func(); below.  */
8986 #include <assert.h>
8987 /* Override any gcc2 internal prototype to avoid an error.  */
8988 /* We use char because int might match the return type of a gcc2
8989     builtin and then its argument prototype would still apply.  */
8990 char $ac_func();
8991 char (*f)();
8992
8993 int main() {
8994
8995 /* The GNU C library defines this for functions which it implements
8996     to always fail with ENOSYS.  Some functions are actually named
8997     something starting with __ and the normal name is an alias.  */
8998 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8999 choke me
9000 #else
9001 f = $ac_func;
9002 #endif
9003
9004 ; return 0; }
9005 EOF
9006 if { (eval echo configure:9007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9007   rm -rf conftest*
9008   eval "ac_cv_func_$ac_func=yes"
9009 else
9010   echo "configure: failed program was:" >&5
9011   cat conftest.$ac_ext >&5
9012   rm -rf conftest*
9013   eval "ac_cv_func_$ac_func=no"
9014 fi
9015 rm -f conftest*
9016 fi
9017
9018 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9019   echo "$ac_t""yes" 1>&6
9020     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9021   cat >> confdefs.h <<EOF
9022 #define $ac_tr_func 1
9023 EOF
9024  
9025 else
9026   echo "$ac_t""no" 1>&6
9027 fi
9028 done
9029
9030                         fi
9031                         if test $ac_cv_func_sched_yield = no -a \
9032                                 $ac_cv_func_pthread_yield = no -a \
9033                                 "$ac_cv_func_thr_yield" = no ; then
9034                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
9035                         fi
9036
9037                                                 for ac_func in pthread_kill
9038 do
9039 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9040 echo "configure:9041: checking for $ac_func" >&5
9041 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9042   echo $ac_n "(cached) $ac_c" 1>&6
9043 else
9044   cat > conftest.$ac_ext <<EOF
9045 #line 9046 "configure"
9046 #include "confdefs.h"
9047 /* System header to define __stub macros and hopefully few prototypes,
9048     which can conflict with char $ac_func(); below.  */
9049 #include <assert.h>
9050 /* Override any gcc2 internal prototype to avoid an error.  */
9051 /* We use char because int might match the return type of a gcc2
9052     builtin and then its argument prototype would still apply.  */
9053 char $ac_func();
9054 char (*f)();
9055
9056 int main() {
9057
9058 /* The GNU C library defines this for functions which it implements
9059     to always fail with ENOSYS.  Some functions are actually named
9060     something starting with __ and the normal name is an alias.  */
9061 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9062 choke me
9063 #else
9064 f = $ac_func;
9065 #endif
9066
9067 ; return 0; }
9068 EOF
9069 if { (eval echo configure:9070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9070   rm -rf conftest*
9071   eval "ac_cv_func_$ac_func=yes"
9072 else
9073   echo "configure: failed program was:" >&5
9074   cat conftest.$ac_ext >&5
9075   rm -rf conftest*
9076   eval "ac_cv_func_$ac_func=no"
9077 fi
9078 rm -f conftest*
9079 fi
9080
9081 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9082   echo "$ac_t""yes" 1>&6
9083     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9084   cat >> confdefs.h <<EOF
9085 #define $ac_tr_func 1
9086 EOF
9087  
9088 else
9089   echo "$ac_t""no" 1>&6
9090 fi
9091 done
9092
9093
9094                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
9095 echo "configure:9096: checking for pthread_detach with <pthread.h>" >&5
9096 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
9097   echo $ac_n "(cached) $ac_c" 1>&6
9098 else
9099   
9100                                                                 cat > conftest.$ac_ext <<EOF
9101 #line 9102 "configure"
9102 #include "confdefs.h"
9103
9104 #include <pthread.h>
9105 #ifndef NULL
9106 #define NULL (void*)0
9107 #endif
9108
9109 int main() {
9110 pthread_detach(NULL);
9111 ; return 0; }
9112 EOF
9113 if { (eval echo configure:9114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9114   rm -rf conftest*
9115   ol_cv_func_pthread_detach=yes
9116 else
9117   echo "configure: failed program was:" >&5
9118   cat conftest.$ac_ext >&5
9119   rm -rf conftest*
9120   ol_cv_func_pthread_detach=no
9121 fi
9122 rm -f conftest*
9123                         
9124 fi
9125
9126 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
9127
9128                         if test $ol_cv_func_pthread_detach = no ; then
9129                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
9130                         fi
9131
9132                         cat >> confdefs.h <<\EOF
9133 #define HAVE_PTHREAD_DETACH 1
9134 EOF
9135
9136
9137                                                 for ac_func in \
9138                                 pthread_setconcurrency \
9139                                 pthread_getconcurrency \
9140                                 thr_setconcurrency \
9141                                 thr_getconcurrency \
9142                         
9143 do
9144 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9145 echo "configure:9146: checking for $ac_func" >&5
9146 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9147   echo $ac_n "(cached) $ac_c" 1>&6
9148 else
9149   cat > conftest.$ac_ext <<EOF
9150 #line 9151 "configure"
9151 #include "confdefs.h"
9152 /* System header to define __stub macros and hopefully few prototypes,
9153     which can conflict with char $ac_func(); below.  */
9154 #include <assert.h>
9155 /* Override any gcc2 internal prototype to avoid an error.  */
9156 /* We use char because int might match the return type of a gcc2
9157     builtin and then its argument prototype would still apply.  */
9158 char $ac_func();
9159 char (*f)();
9160
9161 int main() {
9162
9163 /* The GNU C library defines this for functions which it implements
9164     to always fail with ENOSYS.  Some functions are actually named
9165     something starting with __ and the normal name is an alias.  */
9166 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9167 choke me
9168 #else
9169 f = $ac_func;
9170 #endif
9171
9172 ; return 0; }
9173 EOF
9174 if { (eval echo configure:9175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9175   rm -rf conftest*
9176   eval "ac_cv_func_$ac_func=yes"
9177 else
9178   echo "configure: failed program was:" >&5
9179   cat conftest.$ac_ext >&5
9180   rm -rf conftest*
9181   eval "ac_cv_func_$ac_func=no"
9182 fi
9183 rm -f conftest*
9184 fi
9185
9186 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9187   echo "$ac_t""yes" 1>&6
9188     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9189   cat >> confdefs.h <<EOF
9190 #define $ac_tr_func 1
9191 EOF
9192  
9193 else
9194   echo "$ac_t""no" 1>&6
9195 fi
9196 done
9197
9198
9199                         
9200         echo $ac_n "checking for pthread_kill_other_threads_np""... $ac_c" 1>&6
9201 echo "configure:9202: checking for pthread_kill_other_threads_np" >&5
9202 if eval "test \"\${ac_cv_func_pthread_kill_other_threads_np+set}\" = set"; then
9203   echo $ac_n "(cached) $ac_c" 1>&6
9204 else
9205   cat > conftest.$ac_ext <<EOF
9206 #line 9207 "configure"
9207 #include "confdefs.h"
9208 /* System header to define __stub macros and hopefully few prototypes,
9209     which can conflict with char pthread_kill_other_threads_np(); below.  */
9210 #include <assert.h>
9211 /* Override any gcc2 internal prototype to avoid an error.  */
9212 /* We use char because int might match the return type of a gcc2
9213     builtin and then its argument prototype would still apply.  */
9214 char pthread_kill_other_threads_np();
9215 char (*f)();
9216
9217 int main() {
9218
9219 /* The GNU C library defines this for functions which it implements
9220     to always fail with ENOSYS.  Some functions are actually named
9221     something starting with __ and the normal name is an alias.  */
9222 #if defined (__stub_pthread_kill_other_threads_np) || defined (__stub___pthread_kill_other_threads_np)
9223 choke me
9224 #else
9225 f = pthread_kill_other_threads_np;
9226 #endif
9227
9228 ; return 0; }
9229 EOF
9230 if { (eval echo configure:9231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9231   rm -rf conftest*
9232   eval "ac_cv_func_pthread_kill_other_threads_np=yes"
9233 else
9234   echo "configure: failed program was:" >&5
9235   cat conftest.$ac_ext >&5
9236   rm -rf conftest*
9237   eval "ac_cv_func_pthread_kill_other_threads_np=no"
9238 fi
9239 rm -f conftest*
9240 fi
9241
9242 if eval "test \"`echo '$ac_cv_func_'pthread_kill_other_threads_np`\" = yes"; then
9243   echo "$ac_t""yes" 1>&6
9244   :
9245 else
9246   echo "$ac_t""no" 1>&6
9247 fi
9248
9249         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
9250 echo "configure:9251: checking for LinuxThreads implementation" >&5
9251 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
9252   echo $ac_n "(cached) $ac_c" 1>&6
9253 else
9254   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
9255 fi
9256
9257 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
9258
9259                         
9260         
9261         
9262         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
9263 echo "configure:9264: checking for LinuxThreads consistency" >&5
9264 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
9265   echo $ac_n "(cached) $ac_c" 1>&6
9266 else
9267   
9268                 if test $ol_cv_header_linux_threads = yes -a \
9269                         $ol_cv_sys_linux_threads = yes; then
9270                         ol_cv_linux_threads=yes
9271                 elif test $ol_cv_header_linux_threads = no -a \
9272                         $ol_cv_sys_linux_threads = no; then
9273                         ol_cv_linux_threads=no
9274                 else
9275                         ol_cv_linux_threads=error
9276                 fi
9277         
9278 fi
9279
9280 echo "$ac_t""$ol_cv_linux_threads" 1>&6
9281
9282
9283                         if test $ol_cv_linux_threads = error; then
9284                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
9285                         fi
9286
9287                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
9288 echo "configure:9289: checking if pthread_create() works" >&5
9289 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
9290   echo $ac_n "(cached) $ac_c" 1>&6
9291 else
9292   
9293                         if test "$cross_compiling" = yes; then
9294                                 ol_cv_pthread_create_works=yes
9295 else
9296   cat > conftest.$ac_ext <<EOF
9297 #line 9298 "configure"
9298 #include "confdefs.h"
9299 /* pthread test headers */
9300 #include <pthread.h>
9301 #ifndef NULL
9302 #define NULL (void*)0
9303 #endif
9304
9305 static void *task(p)
9306         void *p;
9307 {
9308         return (void *) (p == NULL);
9309 }
9310
9311
9312 int main(argc, argv)
9313         int argc;
9314         char **argv;
9315 {
9316
9317         /* pthread test function */
9318         pthread_t t;
9319         int status;
9320
9321         /* make sure pthread_create() isn't just a stub */
9322 #if HAVE_PTHREADS_D4
9323         status = pthread_create(&t, pthread_attr_default, task, NULL);
9324 #else
9325         status = pthread_create(&t, NULL, task, NULL);
9326 #endif
9327
9328         if( status ) exit( status );
9329
9330         /* make sure pthread_detach() isn't just a stub */
9331 #if HAVE_PTHREADS_D4
9332         status = pthread_detach( &t );
9333 #else
9334         status = pthread_detach( t );
9335 #endif
9336
9337 #ifdef HAVE_LINUX_THREADS
9338         pthread_kill_other_threads_np();
9339 #endif
9340
9341         exit( status );
9342
9343 }
9344
9345 EOF
9346 if { (eval echo configure:9347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9347 then
9348   ol_cv_pthread_create_works=yes
9349 else
9350   echo "configure: failed program was:" >&5
9351   cat conftest.$ac_ext >&5
9352   rm -fr conftest*
9353   ol_cv_pthread_create_works=no
9354 fi
9355 rm -fr conftest*
9356 fi
9357
9358 fi
9359
9360 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
9361
9362                         if test $ol_cv_pthread_create_works = no ; then
9363                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
9364                         fi
9365
9366                                                 if test $ol_with_yielding_select = auto ; then
9367                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
9368 echo "configure:9369: checking if select yields when using pthreads" >&5
9369 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
9370   echo $ac_n "(cached) $ac_c" 1>&6
9371 else
9372   
9373                                 if test "$cross_compiling" = yes; then
9374   ol_cv_pthread_select_yields=cross
9375 else
9376   cat > conftest.$ac_ext <<EOF
9377 #line 9378 "configure"
9378 #include "confdefs.h"
9379
9380 #include <sys/types.h>
9381 #include <sys/time.h>
9382 #include <unistd.h>
9383 #include <pthread.h>
9384 #ifndef NULL
9385 #define NULL (void*) 0
9386 #endif
9387
9388 static int fildes[2];
9389
9390 static void *task(p)
9391         void *p;
9392 {
9393         int i;
9394         struct timeval tv;
9395
9396         fd_set rfds;
9397
9398         tv.tv_sec=10;
9399         tv.tv_usec=0;
9400
9401         FD_ZERO(&rfds);
9402         FD_SET(fildes[0], &rfds);
9403
9404         /* we're not interested in any fds */
9405         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
9406
9407         if(i < 0) {
9408                 perror("select");
9409                 exit(10);
9410         }
9411
9412         exit(0); /* if we exit here, the select blocked the whole process */
9413 }
9414
9415 int main(argc, argv)
9416         int argc;
9417         char **argv;
9418 {
9419         pthread_t t;
9420
9421         /* create a pipe to select */
9422         if(pipe(&fildes[0])) {
9423                 perror("select");
9424                 exit(1);
9425         }
9426
9427 #ifdef HAVE_PTHREAD_SETCONCURRENCY
9428         (void) pthread_setconcurrency(2);
9429 #else
9430 #ifdef HAVE_THR_SETCONCURRENCY
9431         /* Set Solaris LWP concurrency to 2 */
9432         thr_setconcurrency(2);
9433 #endif
9434 #endif
9435
9436 #if HAVE_PTHREADS_D4
9437         pthread_create(&t, pthread_attr_default, task, NULL);
9438 #else
9439         pthread_create(&t, NULL, task, NULL);
9440 #endif
9441
9442 #if HAVE_SCHED_YIELD
9443         sched_yield();  /* make sure task runs first */
9444 #else
9445 #ifdef HAVE_PTHREAD_YIELD
9446         pthread_yield();        /* make sure task runs first */
9447 #endif
9448 #endif
9449
9450         exit(2);
9451 }
9452 EOF
9453 if { (eval echo configure:9454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9454 then
9455   ol_cv_pthread_select_yields=no
9456 else
9457   echo "configure: failed program was:" >&5
9458   cat conftest.$ac_ext >&5
9459   rm -fr conftest*
9460   ol_cv_pthread_select_yields=yes
9461 fi
9462 rm -fr conftest*
9463 fi
9464
9465 fi
9466
9467 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
9468
9469                                 if test $ol_cv_pthread_select_yields = cross ; then
9470                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
9471                                 fi
9472
9473                                 if test $ol_cv_pthread_select_yields = yes ; then
9474                                         ol_with_yielding_select=yes
9475                                 fi
9476                         fi
9477
9478                                                 CPPFLAGS="$save_CPPFLAGS"
9479                         LIBS="$save_LIBS"
9480                 else
9481                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
9482                 fi
9483         fi
9484
9485         if test $ol_with_threads = posix ; then
9486                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
9487         fi
9488 fi
9489
9490 if test $ol_with_threads = auto -o $ol_with_threads = yes \
9491         -o $ol_with_threads = mach ; then
9492
9493                 for ac_hdr in mach/cthreads.h
9494 do
9495 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9496 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9497 echo "configure:9498: checking for $ac_hdr" >&5
9498 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9499   echo $ac_n "(cached) $ac_c" 1>&6
9500 else
9501   cat > conftest.$ac_ext <<EOF
9502 #line 9503 "configure"
9503 #include "confdefs.h"
9504 #include <$ac_hdr>
9505 EOF
9506 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9507 { (eval echo configure:9508: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9508 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9509 if test -z "$ac_err"; then
9510   rm -rf conftest*
9511   eval "ac_cv_header_$ac_safe=yes"
9512 else
9513   echo "$ac_err" >&5
9514   echo "configure: failed program was:" >&5
9515   cat conftest.$ac_ext >&5
9516   rm -rf conftest*
9517   eval "ac_cv_header_$ac_safe=no"
9518 fi
9519 rm -f conftest*
9520 fi
9521 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9522   echo "$ac_t""yes" 1>&6
9523     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9524   cat >> confdefs.h <<EOF
9525 #define $ac_tr_hdr 1
9526 EOF
9527  
9528 else
9529   echo "$ac_t""no" 1>&6
9530 fi
9531 done
9532
9533         if test $ac_cv_header_mach_cthreads_h = yes ; then
9534                 ol_with_threads=found
9535
9536                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
9537 echo "configure:9538: checking for cthread_fork" >&5
9538 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
9539   echo $ac_n "(cached) $ac_c" 1>&6
9540 else
9541   cat > conftest.$ac_ext <<EOF
9542 #line 9543 "configure"
9543 #include "confdefs.h"
9544 /* System header to define __stub macros and hopefully few prototypes,
9545     which can conflict with char cthread_fork(); below.  */
9546 #include <assert.h>
9547 /* Override any gcc2 internal prototype to avoid an error.  */
9548 /* We use char because int might match the return type of a gcc2
9549     builtin and then its argument prototype would still apply.  */
9550 char cthread_fork();
9551 char (*f)();
9552
9553 int main() {
9554
9555 /* The GNU C library defines this for functions which it implements
9556     to always fail with ENOSYS.  Some functions are actually named
9557     something starting with __ and the normal name is an alias.  */
9558 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
9559 choke me
9560 #else
9561 f = cthread_fork;
9562 #endif
9563
9564 ; return 0; }
9565 EOF
9566 if { (eval echo configure:9567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9567   rm -rf conftest*
9568   eval "ac_cv_func_cthread_fork=yes"
9569 else
9570   echo "configure: failed program was:" >&5
9571   cat conftest.$ac_ext >&5
9572   rm -rf conftest*
9573   eval "ac_cv_func_cthread_fork=no"
9574 fi
9575 rm -f conftest*
9576 fi
9577
9578 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
9579   echo "$ac_t""yes" 1>&6
9580   ol_link_threads=yes
9581 else
9582   echo "$ac_t""no" 1>&6
9583 fi
9584
9585
9586                 if test $ol_link_threads = no ; then
9587                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
9588 echo "configure:9589: checking for cthread_fork with -all_load" >&5
9589 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
9590   echo $ac_n "(cached) $ac_c" 1>&6
9591 else
9592   
9593                                                                 save_LIBS="$LIBS"
9594                                 LIBS="-all_load $LIBS"
9595                                 cat > conftest.$ac_ext <<EOF
9596 #line 9597 "configure"
9597 #include "confdefs.h"
9598 #include <mach/cthreads.h>
9599 int main() {
9600
9601                                         cthread_fork((void *)0, (void *)0);
9602                                         
9603 ; return 0; }
9604 EOF
9605 if { (eval echo configure:9606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9606   rm -rf conftest*
9607   ol_cv_cthread_all_load=yes
9608 else
9609   echo "configure: failed program was:" >&5
9610   cat conftest.$ac_ext >&5
9611   rm -rf conftest*
9612   ol_cv_cthread_all_load=no
9613 fi
9614 rm -f conftest*
9615                                                                 LIBS="$save_LIBS"
9616                         
9617 fi
9618
9619 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
9620
9621                         if test $ol_cv_cthread_all_load = yes ; then
9622                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
9623                                 ol_link_threads=mach
9624                         fi
9625                 fi
9626
9627                 if test $ol_link_threads != no ; then
9628                         : check for cthread specific functionality here
9629                         cat >> confdefs.h <<\EOF
9630 #define HAVE_MACH_CTHREADS 1
9631 EOF
9632
9633                 else
9634                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
9635                 fi
9636         fi
9637
9638         if test $ol_with_threads = mach ; then
9639                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
9640         fi
9641 fi
9642
9643 if test $ol_with_threads = auto -o $ol_with_threads = yes \
9644         -o $ol_with_threads = pth ; then
9645
9646         for ac_hdr in pth.h
9647 do
9648 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9649 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9650 echo "configure:9651: checking for $ac_hdr" >&5
9651 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9652   echo $ac_n "(cached) $ac_c" 1>&6
9653 else
9654   cat > conftest.$ac_ext <<EOF
9655 #line 9656 "configure"
9656 #include "confdefs.h"
9657 #include <$ac_hdr>
9658 EOF
9659 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9660 { (eval echo configure:9661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9661 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9662 if test -z "$ac_err"; then
9663   rm -rf conftest*
9664   eval "ac_cv_header_$ac_safe=yes"
9665 else
9666   echo "$ac_err" >&5
9667   echo "configure: failed program was:" >&5
9668   cat conftest.$ac_ext >&5
9669   rm -rf conftest*
9670   eval "ac_cv_header_$ac_safe=no"
9671 fi
9672 rm -f conftest*
9673 fi
9674 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9675   echo "$ac_t""yes" 1>&6
9676     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9677   cat >> confdefs.h <<EOF
9678 #define $ac_tr_hdr 1
9679 EOF
9680  
9681 else
9682   echo "$ac_t""no" 1>&6
9683 fi
9684 done
9685
9686
9687         if test $ac_cv_header_pth_h = yes ; then
9688                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
9689 echo "configure:9690: checking for pth_version in -lpth" >&5
9690 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
9691 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9692   echo $ac_n "(cached) $ac_c" 1>&6
9693 else
9694   ac_save_LIBS="$LIBS"
9695 LIBS="-lpth  $LIBS"
9696 cat > conftest.$ac_ext <<EOF
9697 #line 9698 "configure"
9698 #include "confdefs.h"
9699 /* Override any gcc2 internal prototype to avoid an error.  */
9700 /* We use char because int might match the return type of a gcc2
9701     builtin and then its argument prototype would still apply.  */
9702 char pth_version();
9703
9704 int main() {
9705 pth_version()
9706 ; return 0; }
9707 EOF
9708 if { (eval echo configure:9709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9709   rm -rf conftest*
9710   eval "ac_cv_lib_$ac_lib_var=yes"
9711 else
9712   echo "configure: failed program was:" >&5
9713   cat conftest.$ac_ext >&5
9714   rm -rf conftest*
9715   eval "ac_cv_lib_$ac_lib_var=no"
9716 fi
9717 rm -f conftest*
9718 LIBS="$ac_save_LIBS"
9719
9720 fi
9721 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9722   echo "$ac_t""yes" 1>&6
9723   have_pth=yes
9724 else
9725   echo "$ac_t""no" 1>&6
9726 have_pth=no
9727 fi
9728
9729
9730                 if test $have_pth = yes ; then
9731                         cat >> confdefs.h <<\EOF
9732 #define HAVE_GNU_PTH 1
9733 EOF
9734
9735                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
9736                         ol_link_threads=pth
9737
9738                         if test $ol_with_yielding_select = auto ; then
9739                                 ol_with_yielding_select=yes
9740                         fi
9741                 fi
9742         fi
9743 fi
9744
9745 if test $ol_with_threads = auto -o $ol_with_threads = yes \
9746         -o $ol_with_threads = lwp ; then
9747
9748                 for ac_hdr in thread.h synch.h
9749 do
9750 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9751 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9752 echo "configure:9753: checking for $ac_hdr" >&5
9753 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9754   echo $ac_n "(cached) $ac_c" 1>&6
9755 else
9756   cat > conftest.$ac_ext <<EOF
9757 #line 9758 "configure"
9758 #include "confdefs.h"
9759 #include <$ac_hdr>
9760 EOF
9761 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9762 { (eval echo configure:9763: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9763 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9764 if test -z "$ac_err"; then
9765   rm -rf conftest*
9766   eval "ac_cv_header_$ac_safe=yes"
9767 else
9768   echo "$ac_err" >&5
9769   echo "configure: failed program was:" >&5
9770   cat conftest.$ac_ext >&5
9771   rm -rf conftest*
9772   eval "ac_cv_header_$ac_safe=no"
9773 fi
9774 rm -f conftest*
9775 fi
9776 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9777   echo "$ac_t""yes" 1>&6
9778     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9779   cat >> confdefs.h <<EOF
9780 #define $ac_tr_hdr 1
9781 EOF
9782  
9783 else
9784   echo "$ac_t""no" 1>&6
9785 fi
9786 done
9787
9788         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
9789                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
9790 echo "configure:9791: checking for thr_create in -lthread" >&5
9791 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
9792 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9793   echo $ac_n "(cached) $ac_c" 1>&6
9794 else
9795   ac_save_LIBS="$LIBS"
9796 LIBS="-lthread  $LIBS"
9797 cat > conftest.$ac_ext <<EOF
9798 #line 9799 "configure"
9799 #include "confdefs.h"
9800 /* Override any gcc2 internal prototype to avoid an error.  */
9801 /* We use char because int might match the return type of a gcc2
9802     builtin and then its argument prototype would still apply.  */
9803 char thr_create();
9804
9805 int main() {
9806 thr_create()
9807 ; return 0; }
9808 EOF
9809 if { (eval echo configure:9810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9810   rm -rf conftest*
9811   eval "ac_cv_lib_$ac_lib_var=yes"
9812 else
9813   echo "configure: failed program was:" >&5
9814   cat conftest.$ac_ext >&5
9815   rm -rf conftest*
9816   eval "ac_cv_lib_$ac_lib_var=no"
9817 fi
9818 rm -f conftest*
9819 LIBS="$ac_save_LIBS"
9820
9821 fi
9822 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9823   echo "$ac_t""yes" 1>&6
9824   have_thr=yes
9825 else
9826   echo "$ac_t""no" 1>&6
9827 have_thr=no
9828 fi
9829
9830
9831                 if test $have_thr = yes ; then
9832                         cat >> confdefs.h <<\EOF
9833 #define HAVE_THR 1
9834 EOF
9835
9836                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
9837                         ol_link_threads=thr
9838
9839                         if test $ol_with_yielding_select = auto ; then
9840                                 ol_with_yielding_select=yes
9841                         fi
9842
9843                                                 for ac_func in \
9844                                 thr_setconcurrency \
9845                                 thr_getconcurrency \
9846                         
9847 do
9848 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9849 echo "configure:9850: checking for $ac_func" >&5
9850 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9851   echo $ac_n "(cached) $ac_c" 1>&6
9852 else
9853   cat > conftest.$ac_ext <<EOF
9854 #line 9855 "configure"
9855 #include "confdefs.h"
9856 /* System header to define __stub macros and hopefully few prototypes,
9857     which can conflict with char $ac_func(); below.  */
9858 #include <assert.h>
9859 /* Override any gcc2 internal prototype to avoid an error.  */
9860 /* We use char because int might match the return type of a gcc2
9861     builtin and then its argument prototype would still apply.  */
9862 char $ac_func();
9863 char (*f)();
9864
9865 int main() {
9866
9867 /* The GNU C library defines this for functions which it implements
9868     to always fail with ENOSYS.  Some functions are actually named
9869     something starting with __ and the normal name is an alias.  */
9870 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9871 choke me
9872 #else
9873 f = $ac_func;
9874 #endif
9875
9876 ; return 0; }
9877 EOF
9878 if { (eval echo configure:9879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9879   rm -rf conftest*
9880   eval "ac_cv_func_$ac_func=yes"
9881 else
9882   echo "configure: failed program was:" >&5
9883   cat conftest.$ac_ext >&5
9884   rm -rf conftest*
9885   eval "ac_cv_func_$ac_func=no"
9886 fi
9887 rm -f conftest*
9888 fi
9889
9890 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9891   echo "$ac_t""yes" 1>&6
9892     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9893   cat >> confdefs.h <<EOF
9894 #define $ac_tr_func 1
9895 EOF
9896  
9897 else
9898   echo "$ac_t""no" 1>&6
9899 fi
9900 done
9901
9902                 fi
9903         fi
9904
9905                 for ac_hdr in lwp/lwp.h
9906 do
9907 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9908 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9909 echo "configure:9910: checking for $ac_hdr" >&5
9910 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9911   echo $ac_n "(cached) $ac_c" 1>&6
9912 else
9913   cat > conftest.$ac_ext <<EOF
9914 #line 9915 "configure"
9915 #include "confdefs.h"
9916 #include <$ac_hdr>
9917 EOF
9918 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9919 { (eval echo configure:9920: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9920 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9921 if test -z "$ac_err"; then
9922   rm -rf conftest*
9923   eval "ac_cv_header_$ac_safe=yes"
9924 else
9925   echo "$ac_err" >&5
9926   echo "configure: failed program was:" >&5
9927   cat conftest.$ac_ext >&5
9928   rm -rf conftest*
9929   eval "ac_cv_header_$ac_safe=no"
9930 fi
9931 rm -f conftest*
9932 fi
9933 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9934   echo "$ac_t""yes" 1>&6
9935     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9936   cat >> confdefs.h <<EOF
9937 #define $ac_tr_hdr 1
9938 EOF
9939  
9940 else
9941   echo "$ac_t""no" 1>&6
9942 fi
9943 done
9944
9945         if test $ac_cv_header_lwp_lwp_h = yes ; then
9946                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
9947 echo "configure:9948: checking for lwp_create in -llwp" >&5
9948 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
9949 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9950   echo $ac_n "(cached) $ac_c" 1>&6
9951 else
9952   ac_save_LIBS="$LIBS"
9953 LIBS="-llwp  $LIBS"
9954 cat > conftest.$ac_ext <<EOF
9955 #line 9956 "configure"
9956 #include "confdefs.h"
9957 /* Override any gcc2 internal prototype to avoid an error.  */
9958 /* We use char because int might match the return type of a gcc2
9959     builtin and then its argument prototype would still apply.  */
9960 char lwp_create();
9961
9962 int main() {
9963 lwp_create()
9964 ; return 0; }
9965 EOF
9966 if { (eval echo configure:9967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9967   rm -rf conftest*
9968   eval "ac_cv_lib_$ac_lib_var=yes"
9969 else
9970   echo "configure: failed program was:" >&5
9971   cat conftest.$ac_ext >&5
9972   rm -rf conftest*
9973   eval "ac_cv_lib_$ac_lib_var=no"
9974 fi
9975 rm -f conftest*
9976 LIBS="$ac_save_LIBS"
9977
9978 fi
9979 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9980   echo "$ac_t""yes" 1>&6
9981   have_lwp=yes
9982 else
9983   echo "$ac_t""no" 1>&6
9984 have_lwp=no
9985 fi
9986
9987
9988                 if test $have_lwp = yes ; then
9989                         cat >> confdefs.h <<\EOF
9990 #define HAVE_LWP 1
9991 EOF
9992
9993                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
9994                         ol_link_threads=lwp
9995
9996                         if test $ol_with_yielding_select = auto ; then
9997                                 ol_with_yielding_select=no
9998                         fi
9999                 fi
10000         fi
10001 fi
10002
10003 if test $ol_with_yielding_select = yes ; then
10004         cat >> confdefs.h <<\EOF
10005 #define HAVE_YIELDING_SELECT 1
10006 EOF
10007
10008 fi
10009
10010 if test $ol_with_threads = manual ; then
10011                 ol_link_threads=yes
10012
10013         echo "configure: warning: thread defines and link options must be set manually" 1>&2
10014
10015         for ac_hdr in pthread.h sched.h
10016 do
10017 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10018 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10019 echo "configure:10020: checking for $ac_hdr" >&5
10020 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10021   echo $ac_n "(cached) $ac_c" 1>&6
10022 else
10023   cat > conftest.$ac_ext <<EOF
10024 #line 10025 "configure"
10025 #include "confdefs.h"
10026 #include <$ac_hdr>
10027 EOF
10028 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10029 { (eval echo configure:10030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10030 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10031 if test -z "$ac_err"; then
10032   rm -rf conftest*
10033   eval "ac_cv_header_$ac_safe=yes"
10034 else
10035   echo "$ac_err" >&5
10036   echo "configure: failed program was:" >&5
10037   cat conftest.$ac_ext >&5
10038   rm -rf conftest*
10039   eval "ac_cv_header_$ac_safe=no"
10040 fi
10041 rm -f conftest*
10042 fi
10043 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10044   echo "$ac_t""yes" 1>&6
10045     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10046   cat >> confdefs.h <<EOF
10047 #define $ac_tr_hdr 1
10048 EOF
10049  
10050 else
10051   echo "$ac_t""no" 1>&6
10052 fi
10053 done
10054
10055         for ac_func in sched_yield pthread_yield
10056 do
10057 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10058 echo "configure:10059: checking for $ac_func" >&5
10059 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10060   echo $ac_n "(cached) $ac_c" 1>&6
10061 else
10062   cat > conftest.$ac_ext <<EOF
10063 #line 10064 "configure"
10064 #include "confdefs.h"
10065 /* System header to define __stub macros and hopefully few prototypes,
10066     which can conflict with char $ac_func(); below.  */
10067 #include <assert.h>
10068 /* Override any gcc2 internal prototype to avoid an error.  */
10069 /* We use char because int might match the return type of a gcc2
10070     builtin and then its argument prototype would still apply.  */
10071 char $ac_func();
10072 char (*f)();
10073
10074 int main() {
10075
10076 /* The GNU C library defines this for functions which it implements
10077     to always fail with ENOSYS.  Some functions are actually named
10078     something starting with __ and the normal name is an alias.  */
10079 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10080 choke me
10081 #else
10082 f = $ac_func;
10083 #endif
10084
10085 ; return 0; }
10086 EOF
10087 if { (eval echo configure:10088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10088   rm -rf conftest*
10089   eval "ac_cv_func_$ac_func=yes"
10090 else
10091   echo "configure: failed program was:" >&5
10092   cat conftest.$ac_ext >&5
10093   rm -rf conftest*
10094   eval "ac_cv_func_$ac_func=no"
10095 fi
10096 rm -f conftest*
10097 fi
10098
10099 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10100   echo "$ac_t""yes" 1>&6
10101     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10102   cat >> confdefs.h <<EOF
10103 #define $ac_tr_func 1
10104 EOF
10105  
10106 else
10107   echo "$ac_t""no" 1>&6
10108 fi
10109 done
10110
10111         
10112         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
10113 echo "configure:10114: checking for LinuxThreads pthread.h" >&5
10114 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
10115   echo $ac_n "(cached) $ac_c" 1>&6
10116 else
10117   cat > conftest.$ac_ext <<EOF
10118 #line 10119 "configure"
10119 #include "confdefs.h"
10120 #include <pthread.h>
10121 EOF
10122 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10123   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
10124   rm -rf conftest*
10125   ol_cv_header_linux_threads=yes
10126 else
10127   rm -rf conftest*
10128   ol_cv_header_linux_threads=no
10129 fi
10130 rm -f conftest*
10131
10132                 
10133 fi
10134
10135 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
10136         if test $ol_cv_header_linux_threads = yes; then
10137                 cat >> confdefs.h <<\EOF
10138 #define HAVE_LINUX_THREADS 1
10139 EOF
10140
10141         fi
10142
10143
10144         for ac_hdr in mach/cthreads.h
10145 do
10146 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10147 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10148 echo "configure:10149: checking for $ac_hdr" >&5
10149 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10150   echo $ac_n "(cached) $ac_c" 1>&6
10151 else
10152   cat > conftest.$ac_ext <<EOF
10153 #line 10154 "configure"
10154 #include "confdefs.h"
10155 #include <$ac_hdr>
10156 EOF
10157 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10158 { (eval echo configure:10159: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10159 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10160 if test -z "$ac_err"; then
10161   rm -rf conftest*
10162   eval "ac_cv_header_$ac_safe=yes"
10163 else
10164   echo "$ac_err" >&5
10165   echo "configure: failed program was:" >&5
10166   cat conftest.$ac_ext >&5
10167   rm -rf conftest*
10168   eval "ac_cv_header_$ac_safe=no"
10169 fi
10170 rm -f conftest*
10171 fi
10172 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10173   echo "$ac_t""yes" 1>&6
10174     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10175   cat >> confdefs.h <<EOF
10176 #define $ac_tr_hdr 1
10177 EOF
10178  
10179 else
10180   echo "$ac_t""no" 1>&6
10181 fi
10182 done
10183
10184         for ac_hdr in lwp/lwp.h
10185 do
10186 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10187 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10188 echo "configure:10189: checking for $ac_hdr" >&5
10189 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10190   echo $ac_n "(cached) $ac_c" 1>&6
10191 else
10192   cat > conftest.$ac_ext <<EOF
10193 #line 10194 "configure"
10194 #include "confdefs.h"
10195 #include <$ac_hdr>
10196 EOF
10197 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10198 { (eval echo configure:10199: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10199 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10200 if test -z "$ac_err"; then
10201   rm -rf conftest*
10202   eval "ac_cv_header_$ac_safe=yes"
10203 else
10204   echo "$ac_err" >&5
10205   echo "configure: failed program was:" >&5
10206   cat conftest.$ac_ext >&5
10207   rm -rf conftest*
10208   eval "ac_cv_header_$ac_safe=no"
10209 fi
10210 rm -f conftest*
10211 fi
10212 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10213   echo "$ac_t""yes" 1>&6
10214     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10215   cat >> confdefs.h <<EOF
10216 #define $ac_tr_hdr 1
10217 EOF
10218  
10219 else
10220   echo "$ac_t""no" 1>&6
10221 fi
10222 done
10223
10224         for ac_hdr in thread.h synch.h
10225 do
10226 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10227 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10228 echo "configure:10229: checking for $ac_hdr" >&5
10229 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10230   echo $ac_n "(cached) $ac_c" 1>&6
10231 else
10232   cat > conftest.$ac_ext <<EOF
10233 #line 10234 "configure"
10234 #include "confdefs.h"
10235 #include <$ac_hdr>
10236 EOF
10237 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10238 { (eval echo configure:10239: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10239 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10240 if test -z "$ac_err"; then
10241   rm -rf conftest*
10242   eval "ac_cv_header_$ac_safe=yes"
10243 else
10244   echo "$ac_err" >&5
10245   echo "configure: failed program was:" >&5
10246   cat conftest.$ac_ext >&5
10247   rm -rf conftest*
10248   eval "ac_cv_header_$ac_safe=no"
10249 fi
10250 rm -f conftest*
10251 fi
10252 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10253   echo "$ac_t""yes" 1>&6
10254     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10255   cat >> confdefs.h <<EOF
10256 #define $ac_tr_hdr 1
10257 EOF
10258  
10259 else
10260   echo "$ac_t""no" 1>&6
10261 fi
10262 done
10263
10264 fi
10265
10266 if test $ol_link_threads != no ; then  
10267                         cat >> confdefs.h <<\EOF
10268 #define REENTRANT 1
10269 EOF
10270
10271         cat >> confdefs.h <<\EOF
10272 #define _REENTRANT 1
10273 EOF
10274
10275         cat >> confdefs.h <<\EOF
10276 #define THREAD_SAFE 1
10277 EOF
10278
10279         cat >> confdefs.h <<\EOF
10280 #define _THREAD_SAFE 1
10281 EOF
10282
10283         cat >> confdefs.h <<\EOF
10284 #define THREADSAFE 1
10285 EOF
10286
10287         cat >> confdefs.h <<\EOF
10288 #define _THREADSAFE 1
10289 EOF
10290
10291         cat >> confdefs.h <<\EOF
10292 #define _SGI_MP_SOURCE 1
10293 EOF
10294
10295
10296                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
10297 echo "configure:10298: checking for thread specific errno" >&5
10298 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
10299   echo $ac_n "(cached) $ac_c" 1>&6
10300 else
10301   
10302                 cat > conftest.$ac_ext <<EOF
10303 #line 10304 "configure"
10304 #include "confdefs.h"
10305 #include <errno.h>
10306 int main() {
10307 errno = 0;
10308 ; return 0; }
10309 EOF
10310 if { (eval echo configure:10311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10311   rm -rf conftest*
10312   ol_cv_errno_thread_specific=yes
10313 else
10314   echo "configure: failed program was:" >&5
10315   cat conftest.$ac_ext >&5
10316   rm -rf conftest*
10317   ol_cv_errno_thread_specific=no
10318 fi
10319 rm -f conftest*
10320         
10321 fi
10322
10323 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
10324
10325                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
10326 echo "configure:10327: checking for thread specific h_errno" >&5
10327 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
10328   echo $ac_n "(cached) $ac_c" 1>&6
10329 else
10330   
10331                 cat > conftest.$ac_ext <<EOF
10332 #line 10333 "configure"
10333 #include "confdefs.h"
10334 #include <netdb.h>
10335 int main() {
10336 h_errno = 0;
10337 ; return 0; }
10338 EOF
10339 if { (eval echo configure:10340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10340   rm -rf conftest*
10341   ol_cv_h_errno_thread_specific=yes
10342 else
10343   echo "configure: failed program was:" >&5
10344   cat conftest.$ac_ext >&5
10345   rm -rf conftest*
10346   ol_cv_h_errno_thread_specific=no
10347 fi
10348 rm -f conftest*
10349         
10350 fi
10351
10352 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
10353
10354         if test $ol_cv_errno_thread_specific != yes \
10355                 -o $ol_cv_h_errno_thread_specific != yes ; then
10356                 LIBS="$LTHREAD_LIBS $LIBS"
10357                 LTHREAD_LIBS=""
10358         fi
10359
10360 fi  
10361
10362 if test $ol_link_threads = no ; then
10363         if test $ol_with_threads = yes ; then
10364                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
10365         fi
10366
10367         if test $ol_with_threads = auto ; then
10368                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
10369                 ol_with_threads=no
10370         fi
10371
10372         cat >> confdefs.h <<\EOF
10373 #define NO_THREADS 1
10374 EOF
10375
10376         LTHREAD_LIBS=""
10377 fi
10378
10379 if test $ol_link_threads != no ; then
10380         cat >> confdefs.h <<\EOF
10381 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
10382 EOF
10383
10384 fi
10385
10386
10387 ol_link_ldbm=no 
10388 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
10389         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
10390 echo "configure:10391: checking for DB2 library" >&5
10391 if eval "test \"\${ol_cv_lib_db2+set}\" = set"; then
10392   echo $ac_n "(cached) $ac_c" 1>&6
10393 else
10394         ol_LIBS="$LIBS"
10395         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
10396 echo "configure:10397: checking for db_open in -ldb" >&5
10397 ac_lib_var=`echo db'_'db_open | sed 'y%./+-:%__p__%'`
10398 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10399   echo $ac_n "(cached) $ac_c" 1>&6
10400 else
10401   ac_save_LIBS="$LIBS"
10402 LIBS="-ldb  $LIBS"
10403 cat > conftest.$ac_ext <<EOF
10404 #line 10405 "configure"
10405 #include "confdefs.h"
10406 /* Override any gcc2 internal prototype to avoid an error.  */
10407 /* We use char because int might match the return type of a gcc2
10408     builtin and then its argument prototype would still apply.  */
10409 char db_open();
10410
10411 int main() {
10412 db_open()
10413 ; return 0; }
10414 EOF
10415 if { (eval echo configure:10416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10416   rm -rf conftest*
10417   eval "ac_cv_lib_$ac_lib_var=yes"
10418 else
10419   echo "configure: failed program was:" >&5
10420   cat conftest.$ac_ext >&5
10421   rm -rf conftest*
10422   eval "ac_cv_lib_$ac_lib_var=no"
10423 fi
10424 rm -f conftest*
10425 LIBS="$ac_save_LIBS"
10426
10427 fi
10428 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10429   echo "$ac_t""yes" 1>&6
10430   ol_cv_lib_db2=-ldb
10431 else
10432   echo "$ac_t""no" 1>&6
10433 ol_cv_lib_db2=no
10434 fi
10435
10436         LIBS="$ol_LIBS"
10437
10438 fi
10439
10440 echo "$ac_t""$ol_cv_lib_db2" 1>&6
10441
10442 for ac_hdr in db.h
10443 do
10444 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10445 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10446 echo "configure:10447: checking for $ac_hdr" >&5
10447 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10448   echo $ac_n "(cached) $ac_c" 1>&6
10449 else
10450   cat > conftest.$ac_ext <<EOF
10451 #line 10452 "configure"
10452 #include "confdefs.h"
10453 #include <$ac_hdr>
10454 EOF
10455 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10456 { (eval echo configure:10457: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10457 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10458 if test -z "$ac_err"; then
10459   rm -rf conftest*
10460   eval "ac_cv_header_$ac_safe=yes"
10461 else
10462   echo "$ac_err" >&5
10463   echo "configure: failed program was:" >&5
10464   cat conftest.$ac_ext >&5
10465   rm -rf conftest*
10466   eval "ac_cv_header_$ac_safe=no"
10467 fi
10468 rm -f conftest*
10469 fi
10470 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10471   echo "$ac_t""yes" 1>&6
10472     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10473   cat >> confdefs.h <<EOF
10474 #define $ac_tr_hdr 1
10475 EOF
10476  
10477 else
10478   echo "$ac_t""no" 1>&6
10479 fi
10480 done
10481
10482 if test $ac_cv_header_db_h = yes ; then
10483         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
10484 echo "configure:10485: checking if db.h is DB2" >&5
10485 if eval "test \"\${ol_cv_header_db2+set}\" = set"; then
10486   echo $ac_n "(cached) $ac_c" 1>&6
10487 else
10488   
10489                 cat > conftest.$ac_ext <<EOF
10490 #line 10491 "configure"
10491 #include "confdefs.h"
10492
10493 #                       include <db.h>
10494                         /* this check could be improved */
10495 #                       ifdef DB_VERSION_MAJOR
10496 #                               if DB_VERSION_MAJOR == 2
10497                                         __db_version_2
10498 #                               endif
10499 #                       endif
10500                 
10501 EOF
10502 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10503   egrep "__db_version_2" >/dev/null 2>&1; then
10504   rm -rf conftest*
10505   ol_cv_header_db2=yes
10506 else
10507   rm -rf conftest*
10508   ol_cv_header_db2=no
10509 fi
10510 rm -f conftest*
10511
10512 fi
10513
10514 echo "$ac_t""$ol_cv_header_db2" 1>&6
10515 else
10516         ol_cv_header_db2=no
10517 fi
10518
10519
10520  
10521  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
10522 echo "configure:10523: checking for Berkeley DB2" >&5
10523 if eval "test \"\${ol_cv_berkeley_db2+set}\" = set"; then
10524   echo $ac_n "(cached) $ac_c" 1>&6
10525 else
10526   
10527         if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then
10528                 ol_cv_berkeley_db2=no
10529         else
10530                 ol_cv_berkeley_db2=yes
10531         fi
10532
10533 fi
10534
10535 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
10536  if test $ol_cv_berkeley_db2 = yes ; then
10537         cat >> confdefs.h <<\EOF
10538 #define HAVE_BERKELEY_DB2 1
10539 EOF
10540
10541  fi
10542
10543
10544         if test $ol_cv_berkeley_db2 = yes ; then
10545                 ol_link_ldbm=db2
10546                 ol_with_ldbm_api=db2
10547
10548                 if test $ol_with_ldbm_type = hash ; then
10549                         cat >> confdefs.h <<\EOF
10550 #define LDBM_USE_DBHASH 1
10551 EOF
10552
10553                 else
10554                         cat >> confdefs.h <<\EOF
10555 #define LDBM_USE_DBBTREE 1
10556 EOF
10557
10558                 fi
10559
10560                                                 if test $ol_cv_lib_db2 != yes ; then
10561                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
10562                 fi
10563         fi
10564 fi
10565
10566 ol_link_bdb2=no
10567 if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
10568         ol_link_bdb2=yes
10569 fi
10570
10571 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
10572         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
10573 echo "configure:10574: checking for Berkeley DB library" >&5
10574 if eval "test \"\${ol_cv_lib_db+set}\" = set"; then
10575   echo $ac_n "(cached) $ac_c" 1>&6
10576 else
10577   
10578         for ac_hdr in db1/db.h
10579 do
10580 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10581 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10582 echo "configure:10583: checking for $ac_hdr" >&5
10583 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10584   echo $ac_n "(cached) $ac_c" 1>&6
10585 else
10586   cat > conftest.$ac_ext <<EOF
10587 #line 10588 "configure"
10588 #include "confdefs.h"
10589 #include <$ac_hdr>
10590 EOF
10591 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10592 { (eval echo configure:10593: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10593 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10594 if test -z "$ac_err"; then
10595   rm -rf conftest*
10596   eval "ac_cv_header_$ac_safe=yes"
10597 else
10598   echo "$ac_err" >&5
10599   echo "configure: failed program was:" >&5
10600   cat conftest.$ac_ext >&5
10601   rm -rf conftest*
10602   eval "ac_cv_header_$ac_safe=no"
10603 fi
10604 rm -f conftest*
10605 fi
10606 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10607   echo "$ac_t""yes" 1>&6
10608     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10609   cat >> confdefs.h <<EOF
10610 #define $ac_tr_hdr 1
10611 EOF
10612  
10613 else
10614   echo "$ac_t""no" 1>&6
10615 fi
10616 done
10617
10618         ol_LIBS="$LIBS"
10619         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
10620 echo "configure:10621: checking for dbopen" >&5
10621 if eval "test \"\${ac_cv_func_dbopen+set}\" = set"; then
10622   echo $ac_n "(cached) $ac_c" 1>&6
10623 else
10624   cat > conftest.$ac_ext <<EOF
10625 #line 10626 "configure"
10626 #include "confdefs.h"
10627 /* System header to define __stub macros and hopefully few prototypes,
10628     which can conflict with char dbopen(); below.  */
10629 #include <assert.h>
10630 /* Override any gcc2 internal prototype to avoid an error.  */
10631 /* We use char because int might match the return type of a gcc2
10632     builtin and then its argument prototype would still apply.  */
10633 char dbopen();
10634 char (*f)();
10635
10636 int main() {
10637
10638 /* The GNU C library defines this for functions which it implements
10639     to always fail with ENOSYS.  Some functions are actually named
10640     something starting with __ and the normal name is an alias.  */
10641 #if defined (__stub_dbopen) || defined (__stub___dbopen)
10642 choke me
10643 #else
10644 f = dbopen;
10645 #endif
10646
10647 ; return 0; }
10648 EOF
10649 if { (eval echo configure:10650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10650   rm -rf conftest*
10651   eval "ac_cv_func_dbopen=yes"
10652 else
10653   echo "configure: failed program was:" >&5
10654   cat conftest.$ac_ext >&5
10655   rm -rf conftest*
10656   eval "ac_cv_func_dbopen=no"
10657 fi
10658 rm -f conftest*
10659 fi
10660
10661 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
10662   echo "$ac_t""yes" 1>&6
10663   ol_cv_lib_db=yes
10664 else
10665   echo "$ac_t""no" 1>&6
10666
10667                 echo $ac_n "checking for dbopen in -ldb1""... $ac_c" 1>&6
10668 echo "configure:10669: checking for dbopen in -ldb1" >&5
10669 ac_lib_var=`echo db1'_'dbopen | sed 'y%./+-:%__p__%'`
10670 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10671   echo $ac_n "(cached) $ac_c" 1>&6
10672 else
10673   ac_save_LIBS="$LIBS"
10674 LIBS="-ldb1  $LIBS"
10675 cat > conftest.$ac_ext <<EOF
10676 #line 10677 "configure"
10677 #include "confdefs.h"
10678 /* Override any gcc2 internal prototype to avoid an error.  */
10679 /* We use char because int might match the return type of a gcc2
10680     builtin and then its argument prototype would still apply.  */
10681 char dbopen();
10682
10683 int main() {
10684 dbopen()
10685 ; return 0; }
10686 EOF
10687 if { (eval echo configure:10688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10688   rm -rf conftest*
10689   eval "ac_cv_lib_$ac_lib_var=yes"
10690 else
10691   echo "configure: failed program was:" >&5
10692   cat conftest.$ac_ext >&5
10693   rm -rf conftest*
10694   eval "ac_cv_lib_$ac_lib_var=no"
10695 fi
10696 rm -f conftest*
10697 LIBS="$ac_save_LIBS"
10698
10699 fi
10700 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10701   echo "$ac_t""yes" 1>&6
10702   ol_cv_lib_db=-ldb1
10703 else
10704   echo "$ac_t""no" 1>&6
10705
10706                         echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
10707 echo "configure:10708: checking for dbopen in -ldb" >&5
10708 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-:%__p__%'`
10709 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10710   echo $ac_n "(cached) $ac_c" 1>&6
10711 else
10712   ac_save_LIBS="$LIBS"
10713 LIBS="-ldb  $LIBS"
10714 cat > conftest.$ac_ext <<EOF
10715 #line 10716 "configure"
10716 #include "confdefs.h"
10717 /* Override any gcc2 internal prototype to avoid an error.  */
10718 /* We use char because int might match the return type of a gcc2
10719     builtin and then its argument prototype would still apply.  */
10720 char dbopen();
10721
10722 int main() {
10723 dbopen()
10724 ; return 0; }
10725 EOF
10726 if { (eval echo configure:10727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10727   rm -rf conftest*
10728   eval "ac_cv_lib_$ac_lib_var=yes"
10729 else
10730   echo "configure: failed program was:" >&5
10731   cat conftest.$ac_ext >&5
10732   rm -rf conftest*
10733   eval "ac_cv_lib_$ac_lib_var=no"
10734 fi
10735 rm -f conftest*
10736 LIBS="$ac_save_LIBS"
10737
10738 fi
10739 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10740   echo "$ac_t""yes" 1>&6
10741   ol_cv_lib_db=-ldb
10742 else
10743   echo "$ac_t""no" 1>&6
10744 ol_cv_lib_db=no
10745 fi
10746
10747                 
10748 fi
10749
10750         
10751 fi
10752
10753         LIBS="$ol_LIBS"
10754
10755 fi
10756
10757 echo "$ac_t""$ol_cv_lib_db" 1>&6
10758
10759
10760 for ac_hdr in db_185.h
10761 do
10762 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10763 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10764 echo "configure:10765: checking for $ac_hdr" >&5
10765 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10766   echo $ac_n "(cached) $ac_c" 1>&6
10767 else
10768   cat > conftest.$ac_ext <<EOF
10769 #line 10770 "configure"
10770 #include "confdefs.h"
10771 #include <$ac_hdr>
10772 EOF
10773 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10774 { (eval echo configure:10775: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10775 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10776 if test -z "$ac_err"; then
10777   rm -rf conftest*
10778   eval "ac_cv_header_$ac_safe=yes"
10779 else
10780   echo "$ac_err" >&5
10781   echo "configure: failed program was:" >&5
10782   cat conftest.$ac_ext >&5
10783   rm -rf conftest*
10784   eval "ac_cv_header_$ac_safe=no"
10785 fi
10786 rm -f conftest*
10787 fi
10788 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10789   echo "$ac_t""yes" 1>&6
10790     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10791   cat >> confdefs.h <<EOF
10792 #define $ac_tr_hdr 1
10793 EOF
10794  
10795 else
10796   echo "$ac_t""no" 1>&6
10797 fi
10798 done
10799
10800 if test "$ol_cv_header_db2" = yes ; then
10801         
10802         ol_cv_header_db=$ac_cv_header_db_185_h
10803 else
10804         ol_cv_header_db=$ac_cv_header_db_h
10805 fi
10806
10807
10808  
10809  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
10810 echo "configure:10811: checking for Berkeley DB" >&5
10811 if eval "test \"\${ol_cv_berkeley_db+set}\" = set"; then
10812   echo $ac_n "(cached) $ac_c" 1>&6
10813 else
10814   
10815         if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then
10816                 ol_cv_berkeley_db=no
10817         else
10818                 ol_cv_berkeley_db=yes
10819         fi
10820
10821 fi
10822
10823 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
10824  if test $ol_cv_berkeley_db = yes ; then
10825         cat >> confdefs.h <<\EOF
10826 #define HAVE_BERKELEY_DB 1
10827 EOF
10828
10829  fi
10830
10831
10832         if test $ol_cv_berkeley_db = yes ; then
10833                 ol_link_ldbm=db
10834                 ol_with_ldbm_api=db
10835
10836                 if test $ol_with_ldbm_type = hash ; then
10837                         cat >> confdefs.h <<\EOF
10838 #define LDBM_USE_DBHASH 1
10839 EOF
10840
10841                 else
10842                         cat >> confdefs.h <<\EOF
10843 #define LDBM_USE_DBBTREE 1
10844 EOF
10845
10846                 fi
10847
10848                                                 if test $ol_cv_lib_db != yes ; then
10849                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
10850                 fi
10851         fi
10852 fi
10853
10854 if test $ol_with_ldbm_api = manual ; then
10855                 ol_link_ldbm=yes
10856
10857         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
10858
10859         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
10860 do
10861 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10862 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10863 echo "configure:10864: checking for $ac_hdr" >&5
10864 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10865   echo $ac_n "(cached) $ac_c" 1>&6
10866 else
10867   cat > conftest.$ac_ext <<EOF
10868 #line 10869 "configure"
10869 #include "confdefs.h"
10870 #include <$ac_hdr>
10871 EOF
10872 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10873 { (eval echo configure:10874: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10874 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10875 if test -z "$ac_err"; then
10876   rm -rf conftest*
10877   eval "ac_cv_header_$ac_safe=yes"
10878 else
10879   echo "$ac_err" >&5
10880   echo "configure: failed program was:" >&5
10881   cat conftest.$ac_ext >&5
10882   rm -rf conftest*
10883   eval "ac_cv_header_$ac_safe=no"
10884 fi
10885 rm -f conftest*
10886 fi
10887 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10888   echo "$ac_t""yes" 1>&6
10889     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10890   cat >> confdefs.h <<EOF
10891 #define $ac_tr_hdr 1
10892 EOF
10893  
10894 else
10895   echo "$ac_t""no" 1>&6
10896 fi
10897 done
10898
10899 fi
10900
10901 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
10902         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
10903         ol_with_ldbm_api=none
10904 fi
10905
10906 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
10907         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
10908 echo "configure:10909: checking for MDBM library" >&5
10909 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
10910   echo $ac_n "(cached) $ac_c" 1>&6
10911 else
10912         ol_LIBS="$LIBS"
10913         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
10914 echo "configure:10915: checking for mdbm_set_chain" >&5
10915 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
10916   echo $ac_n "(cached) $ac_c" 1>&6
10917 else
10918   cat > conftest.$ac_ext <<EOF
10919 #line 10920 "configure"
10920 #include "confdefs.h"
10921 /* System header to define __stub macros and hopefully few prototypes,
10922     which can conflict with char mdbm_set_chain(); below.  */
10923 #include <assert.h>
10924 /* Override any gcc2 internal prototype to avoid an error.  */
10925 /* We use char because int might match the return type of a gcc2
10926     builtin and then its argument prototype would still apply.  */
10927 char mdbm_set_chain();
10928 char (*f)();
10929
10930 int main() {
10931
10932 /* The GNU C library defines this for functions which it implements
10933     to always fail with ENOSYS.  Some functions are actually named
10934     something starting with __ and the normal name is an alias.  */
10935 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
10936 choke me
10937 #else
10938 f = mdbm_set_chain;
10939 #endif
10940
10941 ; return 0; }
10942 EOF
10943 if { (eval echo configure:10944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10944   rm -rf conftest*
10945   eval "ac_cv_func_mdbm_set_chain=yes"
10946 else
10947   echo "configure: failed program was:" >&5
10948   cat conftest.$ac_ext >&5
10949   rm -rf conftest*
10950   eval "ac_cv_func_mdbm_set_chain=no"
10951 fi
10952 rm -f conftest*
10953 fi
10954
10955 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
10956   echo "$ac_t""yes" 1>&6
10957   ol_cv_lib_mdbm=yes
10958 else
10959   echo "$ac_t""no" 1>&6
10960
10961                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
10962 echo "configure:10963: checking for mdbm_set_chain in -lmdbm" >&5
10963 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
10964 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10965   echo $ac_n "(cached) $ac_c" 1>&6
10966 else
10967   ac_save_LIBS="$LIBS"
10968 LIBS="-lmdbm  $LIBS"
10969 cat > conftest.$ac_ext <<EOF
10970 #line 10971 "configure"
10971 #include "confdefs.h"
10972 /* Override any gcc2 internal prototype to avoid an error.  */
10973 /* We use char because int might match the return type of a gcc2
10974     builtin and then its argument prototype would still apply.  */
10975 char mdbm_set_chain();
10976
10977 int main() {
10978 mdbm_set_chain()
10979 ; return 0; }
10980 EOF
10981 if { (eval echo configure:10982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10982   rm -rf conftest*
10983   eval "ac_cv_lib_$ac_lib_var=yes"
10984 else
10985   echo "configure: failed program was:" >&5
10986   cat conftest.$ac_ext >&5
10987   rm -rf conftest*
10988   eval "ac_cv_lib_$ac_lib_var=no"
10989 fi
10990 rm -f conftest*
10991 LIBS="$ac_save_LIBS"
10992
10993 fi
10994 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10995   echo "$ac_t""yes" 1>&6
10996   ol_cv_lib_mdbm=-lmdbm
10997 else
10998   echo "$ac_t""no" 1>&6
10999 ol_cv_lib_mdbm=no
11000 fi
11001
11002         
11003 fi
11004
11005         LIBS="$ol_LIBS"
11006
11007 fi
11008
11009 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
11010
11011
11012  for ac_hdr in mdbm.h
11013 do
11014 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11015 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11016 echo "configure:11017: checking for $ac_hdr" >&5
11017 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11018   echo $ac_n "(cached) $ac_c" 1>&6
11019 else
11020   cat > conftest.$ac_ext <<EOF
11021 #line 11022 "configure"
11022 #include "confdefs.h"
11023 #include <$ac_hdr>
11024 EOF
11025 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11026 { (eval echo configure:11027: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11027 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11028 if test -z "$ac_err"; then
11029   rm -rf conftest*
11030   eval "ac_cv_header_$ac_safe=yes"
11031 else
11032   echo "$ac_err" >&5
11033   echo "configure: failed program was:" >&5
11034   cat conftest.$ac_ext >&5
11035   rm -rf conftest*
11036   eval "ac_cv_header_$ac_safe=no"
11037 fi
11038 rm -f conftest*
11039 fi
11040 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11041   echo "$ac_t""yes" 1>&6
11042     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11043   cat >> confdefs.h <<EOF
11044 #define $ac_tr_hdr 1
11045 EOF
11046  
11047 else
11048   echo "$ac_t""no" 1>&6
11049 fi
11050 done
11051
11052  echo $ac_n "checking for db""... $ac_c" 1>&6
11053 echo "configure:11054: checking for db" >&5
11054 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
11055   echo $ac_n "(cached) $ac_c" 1>&6
11056 else
11057   
11058         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
11059                 ol_cv_mdbm=no
11060         else
11061                 ol_cv_mdbm=yes
11062         fi
11063
11064 fi
11065
11066 echo "$ac_t""$ol_cv_mdbm" 1>&6
11067  if test $ol_cv_mdbm = yes ; then
11068         cat >> confdefs.h <<\EOF
11069 #define HAVE_MDBM 1
11070 EOF
11071
11072  fi
11073
11074
11075         if test $ol_cv_mdbm = yes ; then
11076                 ol_link_ldbm=mdbm
11077                 ol_with_ldbm_api=mdbm
11078                 if test $ol_cv_lib_mdbm != yes ; then
11079                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
11080                 fi
11081         fi
11082 fi
11083
11084 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
11085         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
11086 echo "configure:11087: checking for GDBM library" >&5
11087 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
11088   echo $ac_n "(cached) $ac_c" 1>&6
11089 else
11090         ol_LIBS="$LIBS"
11091         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
11092 echo "configure:11093: checking for gdbm_open" >&5
11093 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
11094   echo $ac_n "(cached) $ac_c" 1>&6
11095 else
11096   cat > conftest.$ac_ext <<EOF
11097 #line 11098 "configure"
11098 #include "confdefs.h"
11099 /* System header to define __stub macros and hopefully few prototypes,
11100     which can conflict with char gdbm_open(); below.  */
11101 #include <assert.h>
11102 /* Override any gcc2 internal prototype to avoid an error.  */
11103 /* We use char because int might match the return type of a gcc2
11104     builtin and then its argument prototype would still apply.  */
11105 char gdbm_open();
11106 char (*f)();
11107
11108 int main() {
11109
11110 /* The GNU C library defines this for functions which it implements
11111     to always fail with ENOSYS.  Some functions are actually named
11112     something starting with __ and the normal name is an alias.  */
11113 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
11114 choke me
11115 #else
11116 f = gdbm_open;
11117 #endif
11118
11119 ; return 0; }
11120 EOF
11121 if { (eval echo configure:11122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11122   rm -rf conftest*
11123   eval "ac_cv_func_gdbm_open=yes"
11124 else
11125   echo "configure: failed program was:" >&5
11126   cat conftest.$ac_ext >&5
11127   rm -rf conftest*
11128   eval "ac_cv_func_gdbm_open=no"
11129 fi
11130 rm -f conftest*
11131 fi
11132
11133 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
11134   echo "$ac_t""yes" 1>&6
11135   ol_cv_lib_gdbm=yes
11136 else
11137   echo "$ac_t""no" 1>&6
11138
11139                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
11140 echo "configure:11141: checking for gdbm_open in -lgdbm" >&5
11141 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
11142 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11143   echo $ac_n "(cached) $ac_c" 1>&6
11144 else
11145   ac_save_LIBS="$LIBS"
11146 LIBS="-lgdbm  $LIBS"
11147 cat > conftest.$ac_ext <<EOF
11148 #line 11149 "configure"
11149 #include "confdefs.h"
11150 /* Override any gcc2 internal prototype to avoid an error.  */
11151 /* We use char because int might match the return type of a gcc2
11152     builtin and then its argument prototype would still apply.  */
11153 char gdbm_open();
11154
11155 int main() {
11156 gdbm_open()
11157 ; return 0; }
11158 EOF
11159 if { (eval echo configure:11160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11160   rm -rf conftest*
11161   eval "ac_cv_lib_$ac_lib_var=yes"
11162 else
11163   echo "configure: failed program was:" >&5
11164   cat conftest.$ac_ext >&5
11165   rm -rf conftest*
11166   eval "ac_cv_lib_$ac_lib_var=no"
11167 fi
11168 rm -f conftest*
11169 LIBS="$ac_save_LIBS"
11170
11171 fi
11172 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11173   echo "$ac_t""yes" 1>&6
11174   ol_cv_lib_gdbm=-lgdbm
11175 else
11176   echo "$ac_t""no" 1>&6
11177 ol_cv_lib_gdbm=no
11178 fi
11179
11180         
11181 fi
11182
11183         LIBS="$ol_LIBS"
11184
11185 fi
11186
11187 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
11188
11189
11190  for ac_hdr in gdbm.h
11191 do
11192 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11193 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11194 echo "configure:11195: checking for $ac_hdr" >&5
11195 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11196   echo $ac_n "(cached) $ac_c" 1>&6
11197 else
11198   cat > conftest.$ac_ext <<EOF
11199 #line 11200 "configure"
11200 #include "confdefs.h"
11201 #include <$ac_hdr>
11202 EOF
11203 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11204 { (eval echo configure:11205: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11205 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11206 if test -z "$ac_err"; then
11207   rm -rf conftest*
11208   eval "ac_cv_header_$ac_safe=yes"
11209 else
11210   echo "$ac_err" >&5
11211   echo "configure: failed program was:" >&5
11212   cat conftest.$ac_ext >&5
11213   rm -rf conftest*
11214   eval "ac_cv_header_$ac_safe=no"
11215 fi
11216 rm -f conftest*
11217 fi
11218 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11219   echo "$ac_t""yes" 1>&6
11220     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11221   cat >> confdefs.h <<EOF
11222 #define $ac_tr_hdr 1
11223 EOF
11224  
11225 else
11226   echo "$ac_t""no" 1>&6
11227 fi
11228 done
11229
11230  echo $ac_n "checking for db""... $ac_c" 1>&6
11231 echo "configure:11232: checking for db" >&5
11232 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
11233   echo $ac_n "(cached) $ac_c" 1>&6
11234 else
11235   
11236         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
11237                 ol_cv_gdbm=no
11238         else
11239                 ol_cv_gdbm=yes
11240         fi
11241
11242 fi
11243
11244 echo "$ac_t""$ol_cv_gdbm" 1>&6
11245  if test $ol_cv_gdbm = yes ; then
11246         cat >> confdefs.h <<\EOF
11247 #define HAVE_GDBM 1
11248 EOF
11249
11250  fi
11251
11252
11253         if test $ol_cv_gdbm = yes ; then
11254                 ol_link_ldbm=gdbm
11255                 ol_with_ldbm_api=gdbm
11256
11257                 if test $ol_cv_lib_gdbm != yes ; then
11258                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
11259                 fi
11260         fi
11261 fi
11262
11263 if test $ol_with_ldbm_api = auto ; then
11264         echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
11265 elif test $ol_with_ldbm_api = ndbm ; then
11266         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
11267 echo "configure:11268: checking for NDBM library" >&5
11268 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
11269   echo $ac_n "(cached) $ac_c" 1>&6
11270 else
11271         ol_LIBS="$LIBS"
11272         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
11273 echo "configure:11274: checking for dbm_open" >&5
11274 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
11275   echo $ac_n "(cached) $ac_c" 1>&6
11276 else
11277   cat > conftest.$ac_ext <<EOF
11278 #line 11279 "configure"
11279 #include "confdefs.h"
11280 /* System header to define __stub macros and hopefully few prototypes,
11281     which can conflict with char dbm_open(); below.  */
11282 #include <assert.h>
11283 /* Override any gcc2 internal prototype to avoid an error.  */
11284 /* We use char because int might match the return type of a gcc2
11285     builtin and then its argument prototype would still apply.  */
11286 char dbm_open();
11287 char (*f)();
11288
11289 int main() {
11290
11291 /* The GNU C library defines this for functions which it implements
11292     to always fail with ENOSYS.  Some functions are actually named
11293     something starting with __ and the normal name is an alias.  */
11294 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
11295 choke me
11296 #else
11297 f = dbm_open;
11298 #endif
11299
11300 ; return 0; }
11301 EOF
11302 if { (eval echo configure:11303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11303   rm -rf conftest*
11304   eval "ac_cv_func_dbm_open=yes"
11305 else
11306   echo "configure: failed program was:" >&5
11307   cat conftest.$ac_ext >&5
11308   rm -rf conftest*
11309   eval "ac_cv_func_dbm_open=no"
11310 fi
11311 rm -f conftest*
11312 fi
11313
11314 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
11315   echo "$ac_t""yes" 1>&6
11316   ol_cv_lib_ndbm=yes
11317 else
11318   echo "$ac_t""no" 1>&6
11319
11320                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
11321 echo "configure:11322: checking for dbm_open in -lndbm" >&5
11322 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
11323 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11324   echo $ac_n "(cached) $ac_c" 1>&6
11325 else
11326   ac_save_LIBS="$LIBS"
11327 LIBS="-lndbm  $LIBS"
11328 cat > conftest.$ac_ext <<EOF
11329 #line 11330 "configure"
11330 #include "confdefs.h"
11331 /* Override any gcc2 internal prototype to avoid an error.  */
11332 /* We use char because int might match the return type of a gcc2
11333     builtin and then its argument prototype would still apply.  */
11334 char dbm_open();
11335
11336 int main() {
11337 dbm_open()
11338 ; return 0; }
11339 EOF
11340 if { (eval echo configure:11341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11341   rm -rf conftest*
11342   eval "ac_cv_lib_$ac_lib_var=yes"
11343 else
11344   echo "configure: failed program was:" >&5
11345   cat conftest.$ac_ext >&5
11346   rm -rf conftest*
11347   eval "ac_cv_lib_$ac_lib_var=no"
11348 fi
11349 rm -f conftest*
11350 LIBS="$ac_save_LIBS"
11351
11352 fi
11353 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11354   echo "$ac_t""yes" 1>&6
11355   ol_cv_lib_ndbm=-lndbm
11356 else
11357   echo "$ac_t""no" 1>&6
11358
11359                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
11360 echo "configure:11361: checking for dbm_open in -ldbm" >&5
11361 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
11362 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11363   echo $ac_n "(cached) $ac_c" 1>&6
11364 else
11365   ac_save_LIBS="$LIBS"
11366 LIBS="-ldbm  $LIBS"
11367 cat > conftest.$ac_ext <<EOF
11368 #line 11369 "configure"
11369 #include "confdefs.h"
11370 /* Override any gcc2 internal prototype to avoid an error.  */
11371 /* We use char because int might match the return type of a gcc2
11372     builtin and then its argument prototype would still apply.  */
11373 char dbm_open();
11374
11375 int main() {
11376 dbm_open()
11377 ; return 0; }
11378 EOF
11379 if { (eval echo configure:11380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11380   rm -rf conftest*
11381   eval "ac_cv_lib_$ac_lib_var=yes"
11382 else
11383   echo "configure: failed program was:" >&5
11384   cat conftest.$ac_ext >&5
11385   rm -rf conftest*
11386   eval "ac_cv_lib_$ac_lib_var=no"
11387 fi
11388 rm -f conftest*
11389 LIBS="$ac_save_LIBS"
11390
11391 fi
11392 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11393   echo "$ac_t""yes" 1>&6
11394   ol_cv_lib_ndbm=-ldbm
11395 else
11396   echo "$ac_t""no" 1>&6
11397 ol_cv_lib_ndbm=no
11398 fi
11399                 
11400 fi
11401
11402         
11403 fi
11404
11405         LIBS="$ol_LIBS"
11406
11407 fi
11408
11409 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
11410
11411
11412  for ac_hdr in ndbm.h
11413 do
11414 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11415 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11416 echo "configure:11417: checking for $ac_hdr" >&5
11417 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11418   echo $ac_n "(cached) $ac_c" 1>&6
11419 else
11420   cat > conftest.$ac_ext <<EOF
11421 #line 11422 "configure"
11422 #include "confdefs.h"
11423 #include <$ac_hdr>
11424 EOF
11425 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11426 { (eval echo configure:11427: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11427 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11428 if test -z "$ac_err"; then
11429   rm -rf conftest*
11430   eval "ac_cv_header_$ac_safe=yes"
11431 else
11432   echo "$ac_err" >&5
11433   echo "configure: failed program was:" >&5
11434   cat conftest.$ac_ext >&5
11435   rm -rf conftest*
11436   eval "ac_cv_header_$ac_safe=no"
11437 fi
11438 rm -f conftest*
11439 fi
11440 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11441   echo "$ac_t""yes" 1>&6
11442     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11443   cat >> confdefs.h <<EOF
11444 #define $ac_tr_hdr 1
11445 EOF
11446  
11447 else
11448   echo "$ac_t""no" 1>&6
11449 fi
11450 done
11451
11452  echo $ac_n "checking for db""... $ac_c" 1>&6
11453 echo "configure:11454: checking for db" >&5
11454 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
11455   echo $ac_n "(cached) $ac_c" 1>&6
11456 else
11457   
11458         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
11459                 ol_cv_ndbm=no
11460         else
11461                 ol_cv_ndbm=yes
11462         fi
11463
11464 fi
11465
11466 echo "$ac_t""$ol_cv_ndbm" 1>&6
11467  if test $ol_cv_ndbm = yes ; then
11468         cat >> confdefs.h <<\EOF
11469 #define HAVE_NDBM 1
11470 EOF
11471
11472  fi
11473
11474
11475         if test $ol_cv_ndbm = yes ; then
11476                 ol_link_ldbm=ndbm
11477                 ol_with_ldbm_api=ndbm
11478
11479                 if test $ol_cv_lib_ndbm != yes ; then
11480                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
11481                 fi
11482         fi
11483 fi
11484
11485 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
11486         echo "configure: warning: could not find suitable LDBM backend" 1>&2
11487         if test $ol_enable_ldbm = yes ; then
11488                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
11489         fi
11490
11491         echo "configure: warning: disabling LDBM" 1>&2
11492         ol_enable_ldbm=no
11493 fi
11494
11495 if test $ol_enable_wrappers != no ; then
11496         for ac_hdr in tcpd.h
11497 do
11498 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11499 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11500 echo "configure:11501: checking for $ac_hdr" >&5
11501 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11502   echo $ac_n "(cached) $ac_c" 1>&6
11503 else
11504   cat > conftest.$ac_ext <<EOF
11505 #line 11506 "configure"
11506 #include "confdefs.h"
11507 #include <$ac_hdr>
11508 EOF
11509 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11510 { (eval echo configure:11511: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11511 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11512 if test -z "$ac_err"; then
11513   rm -rf conftest*
11514   eval "ac_cv_header_$ac_safe=yes"
11515 else
11516   echo "$ac_err" >&5
11517   echo "configure: failed program was:" >&5
11518   cat conftest.$ac_ext >&5
11519   rm -rf conftest*
11520   eval "ac_cv_header_$ac_safe=no"
11521 fi
11522 rm -f conftest*
11523 fi
11524 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11525   echo "$ac_t""yes" 1>&6
11526     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11527   cat >> confdefs.h <<EOF
11528 #define $ac_tr_hdr 1
11529 EOF
11530  
11531 else
11532   echo "$ac_t""no" 1>&6
11533 fi
11534 done
11535
11536
11537         if test $ac_cv_header_tcpd_h != yes ; then
11538                 have_wrappers=no
11539         else
11540                 echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
11541 echo "configure:11542: checking for main in -lwrap" >&5
11542 ac_lib_var=`echo wrap'_'main | sed 'y%./+-:%__p__%'`
11543 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11544   echo $ac_n "(cached) $ac_c" 1>&6
11545 else
11546   ac_save_LIBS="$LIBS"
11547 LIBS="-lwrap  $LIBS"
11548 cat > conftest.$ac_ext <<EOF
11549 #line 11550 "configure"
11550 #include "confdefs.h"
11551
11552 int main() {
11553 main()
11554 ; return 0; }
11555 EOF
11556 if { (eval echo configure:11557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11557   rm -rf conftest*
11558   eval "ac_cv_lib_$ac_lib_var=yes"
11559 else
11560   echo "configure: failed program was:" >&5
11561   cat conftest.$ac_ext >&5
11562   rm -rf conftest*
11563   eval "ac_cv_lib_$ac_lib_var=no"
11564 fi
11565 rm -f conftest*
11566 LIBS="$ac_save_LIBS"
11567
11568 fi
11569 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11570   echo "$ac_t""yes" 1>&6
11571   have_wrappers=yes
11572 else
11573   echo "$ac_t""no" 1>&6
11574 have_wrappers=no
11575 fi
11576
11577         fi
11578
11579         if test $have_wrappers = yes ; then
11580                 cat >> confdefs.h <<\EOF
11581 #define HAVE_TCPD 1
11582 EOF
11583
11584                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
11585
11586                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
11587 echo "configure:11588: checking for main in -lnsl" >&5
11588 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
11589 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11590   echo $ac_n "(cached) $ac_c" 1>&6
11591 else
11592   ac_save_LIBS="$LIBS"
11593 LIBS="-lnsl  $LIBS"
11594 cat > conftest.$ac_ext <<EOF
11595 #line 11596 "configure"
11596 #include "confdefs.h"
11597
11598 int main() {
11599 main()
11600 ; return 0; }
11601 EOF
11602 if { (eval echo configure:11603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11603   rm -rf conftest*
11604   eval "ac_cv_lib_$ac_lib_var=yes"
11605 else
11606   echo "configure: failed program was:" >&5
11607   cat conftest.$ac_ext >&5
11608   rm -rf conftest*
11609   eval "ac_cv_lib_$ac_lib_var=no"
11610 fi
11611 rm -f conftest*
11612 LIBS="$ac_save_LIBS"
11613
11614 fi
11615 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11616   echo "$ac_t""yes" 1>&6
11617     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
11618     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
11619   cat >> confdefs.h <<EOF
11620 #define $ac_tr_lib 1
11621 EOF
11622
11623   LIBS="-lnsl $LIBS"
11624
11625 else
11626   echo "$ac_t""no" 1>&6
11627 fi
11628
11629         else
11630                 echo "configure: warning: could not find -lwrap" 1>&2
11631                 if test $ol_enable_wrappers = yes ; then
11632                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
11633                 fi
11634
11635                 echo "configure: warning: disabling wrappers support" 1>&2
11636                 ol_enable_wrappers=no
11637         fi
11638 fi
11639
11640 if test $ol_enable_syslog != no ; then
11641         echo $ac_n "checking for openlog""... $ac_c" 1>&6
11642 echo "configure:11643: checking for openlog" >&5
11643 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
11644   echo $ac_n "(cached) $ac_c" 1>&6
11645 else
11646   cat > conftest.$ac_ext <<EOF
11647 #line 11648 "configure"
11648 #include "confdefs.h"
11649 /* System header to define __stub macros and hopefully few prototypes,
11650     which can conflict with char openlog(); below.  */
11651 #include <assert.h>
11652 /* Override any gcc2 internal prototype to avoid an error.  */
11653 /* We use char because int might match the return type of a gcc2
11654     builtin and then its argument prototype would still apply.  */
11655 char openlog();
11656 char (*f)();
11657
11658 int main() {
11659
11660 /* The GNU C library defines this for functions which it implements
11661     to always fail with ENOSYS.  Some functions are actually named
11662     something starting with __ and the normal name is an alias.  */
11663 #if defined (__stub_openlog) || defined (__stub___openlog)
11664 choke me
11665 #else
11666 f = openlog;
11667 #endif
11668
11669 ; return 0; }
11670 EOF
11671 if { (eval echo configure:11672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11672   rm -rf conftest*
11673   eval "ac_cv_func_openlog=yes"
11674 else
11675   echo "configure: failed program was:" >&5
11676   cat conftest.$ac_ext >&5
11677   rm -rf conftest*
11678   eval "ac_cv_func_openlog=no"
11679 fi
11680 rm -f conftest*
11681 fi
11682
11683 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
11684   echo "$ac_t""yes" 1>&6
11685   :
11686 else
11687   echo "$ac_t""no" 1>&6
11688 fi
11689
11690         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
11691                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
11692         fi
11693         ol_enable_syslog=$ac_cv_func_openlog
11694 fi
11695
11696 if test $ol_enable_dmalloc != no ; then
11697         for ac_hdr in dmalloc.h
11698 do
11699 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11700 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11701 echo "configure:11702: checking for $ac_hdr" >&5
11702 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11703   echo $ac_n "(cached) $ac_c" 1>&6
11704 else
11705   cat > conftest.$ac_ext <<EOF
11706 #line 11707 "configure"
11707 #include "confdefs.h"
11708 #include <$ac_hdr>
11709 EOF
11710 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11711 { (eval echo configure:11712: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11712 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11713 if test -z "$ac_err"; then
11714   rm -rf conftest*
11715   eval "ac_cv_header_$ac_safe=yes"
11716 else
11717   echo "$ac_err" >&5
11718   echo "configure: failed program was:" >&5
11719   cat conftest.$ac_ext >&5
11720   rm -rf conftest*
11721   eval "ac_cv_header_$ac_safe=no"
11722 fi
11723 rm -f conftest*
11724 fi
11725 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11726   echo "$ac_t""yes" 1>&6
11727     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11728   cat >> confdefs.h <<EOF
11729 #define $ac_tr_hdr 1
11730 EOF
11731  
11732 else
11733   echo "$ac_t""no" 1>&6
11734 fi
11735 done
11736
11737         echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
11738 echo "configure:11739: checking for dmalloc_shutdown in -ldmalloc" >&5
11739 ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-:%__p__%'`
11740 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11741   echo $ac_n "(cached) $ac_c" 1>&6
11742 else
11743   ac_save_LIBS="$LIBS"
11744 LIBS="-ldmalloc  $LIBS"
11745 cat > conftest.$ac_ext <<EOF
11746 #line 11747 "configure"
11747 #include "confdefs.h"
11748 /* Override any gcc2 internal prototype to avoid an error.  */
11749 /* We use char because int might match the return type of a gcc2
11750     builtin and then its argument prototype would still apply.  */
11751 char dmalloc_shutdown();
11752
11753 int main() {
11754 dmalloc_shutdown()
11755 ; return 0; }
11756 EOF
11757 if { (eval echo configure:11758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11758   rm -rf conftest*
11759   eval "ac_cv_lib_$ac_lib_var=yes"
11760 else
11761   echo "configure: failed program was:" >&5
11762   cat conftest.$ac_ext >&5
11763   rm -rf conftest*
11764   eval "ac_cv_lib_$ac_lib_var=no"
11765 fi
11766 rm -f conftest*
11767 LIBS="$ac_save_LIBS"
11768
11769 fi
11770 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11771   echo "$ac_t""yes" 1>&6
11772     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
11773     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
11774   cat >> confdefs.h <<EOF
11775 #define $ac_tr_lib 1
11776 EOF
11777
11778   LIBS="-ldmalloc $LIBS"
11779
11780 else
11781   echo "$ac_t""no" 1>&6
11782 fi
11783
11784 fi
11785
11786 if test $ol_enable_tcl != no ; then
11787         for ac_hdr in tcl.h
11788 do
11789 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11790 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11791 echo "configure:11792: checking for $ac_hdr" >&5
11792 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11793   echo $ac_n "(cached) $ac_c" 1>&6
11794 else
11795   cat > conftest.$ac_ext <<EOF
11796 #line 11797 "configure"
11797 #include "confdefs.h"
11798 #include <$ac_hdr>
11799 EOF
11800 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11801 { (eval echo configure:11802: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11802 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11803 if test -z "$ac_err"; then
11804   rm -rf conftest*
11805   eval "ac_cv_header_$ac_safe=yes"
11806 else
11807   echo "$ac_err" >&5
11808   echo "configure: failed program was:" >&5
11809   cat conftest.$ac_ext >&5
11810   rm -rf conftest*
11811   eval "ac_cv_header_$ac_safe=no"
11812 fi
11813 rm -f conftest*
11814 fi
11815 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11816   echo "$ac_t""yes" 1>&6
11817     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11818   cat >> confdefs.h <<EOF
11819 #define $ac_tr_hdr 1
11820 EOF
11821  
11822 else
11823   echo "$ac_t""no" 1>&6
11824 fi
11825 done
11826
11827
11828         if test $ac_cv_header_tcl_h != yes ; then
11829                 have_tcl=no
11830         else
11831                 echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6
11832 echo "configure:11833: checking for main in -ltcl" >&5
11833 ac_lib_var=`echo tcl'_'main | sed 'y%./+-:%__p__%'`
11834 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11835   echo $ac_n "(cached) $ac_c" 1>&6
11836 else
11837   ac_save_LIBS="$LIBS"
11838 LIBS="-ltcl  $LIBS"
11839 cat > conftest.$ac_ext <<EOF
11840 #line 11841 "configure"
11841 #include "confdefs.h"
11842
11843 int main() {
11844 main()
11845 ; return 0; }
11846 EOF
11847 if { (eval echo configure:11848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11848   rm -rf conftest*
11849   eval "ac_cv_lib_$ac_lib_var=yes"
11850 else
11851   echo "configure: failed program was:" >&5
11852   cat conftest.$ac_ext >&5
11853   rm -rf conftest*
11854   eval "ac_cv_lib_$ac_lib_var=no"
11855 fi
11856 rm -f conftest*
11857 LIBS="$ac_save_LIBS"
11858
11859 fi
11860 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11861   echo "$ac_t""yes" 1>&6
11862   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"
11863 else
11864   echo "$ac_t""no" 1>&6
11865 have_tcl=no
11866 fi
11867
11868
11869                 if test $have_tcl != yes; then
11870                         echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6
11871 echo "configure:11872: checking for main in -ltcl7.6" >&5
11872 ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-:%__p__%'`
11873 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11874   echo $ac_n "(cached) $ac_c" 1>&6
11875 else
11876   ac_save_LIBS="$LIBS"
11877 LIBS="-ltcl7.6  $LIBS"
11878 cat > conftest.$ac_ext <<EOF
11879 #line 11880 "configure"
11880 #include "confdefs.h"
11881
11882 int main() {
11883 main()
11884 ; return 0; }
11885 EOF
11886 if { (eval echo configure:11887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11887   rm -rf conftest*
11888   eval "ac_cv_lib_$ac_lib_var=yes"
11889 else
11890   echo "configure: failed program was:" >&5
11891   cat conftest.$ac_ext >&5
11892   rm -rf conftest*
11893   eval "ac_cv_lib_$ac_lib_var=no"
11894 fi
11895 rm -f conftest*
11896 LIBS="$ac_save_LIBS"
11897
11898 fi
11899 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11900   echo "$ac_t""yes" 1>&6
11901   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"
11902 else
11903   echo "$ac_t""no" 1>&6
11904 have_tcl=no
11905 fi
11906
11907                 fi
11908
11909                 if test $have_tcl != yes; then
11910                         echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6
11911 echo "configure:11912: checking for main in -ltcl8.0" >&5
11912 ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-:%__p__%'`
11913 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11914   echo $ac_n "(cached) $ac_c" 1>&6
11915 else
11916   ac_save_LIBS="$LIBS"
11917 LIBS="-ltcl8.0  $LIBS"
11918 cat > conftest.$ac_ext <<EOF
11919 #line 11920 "configure"
11920 #include "confdefs.h"
11921
11922 int main() {
11923 main()
11924 ; return 0; }
11925 EOF
11926 if { (eval echo configure:11927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11927   rm -rf conftest*
11928   eval "ac_cv_lib_$ac_lib_var=yes"
11929 else
11930   echo "configure: failed program was:" >&5
11931   cat conftest.$ac_ext >&5
11932   rm -rf conftest*
11933   eval "ac_cv_lib_$ac_lib_var=no"
11934 fi
11935 rm -f conftest*
11936 LIBS="$ac_save_LIBS"
11937
11938 fi
11939 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11940   echo "$ac_t""yes" 1>&6
11941   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"
11942 else
11943   echo "$ac_t""no" 1>&6
11944 have_tcl=no
11945 fi
11946
11947                 fi
11948         fi
11949
11950         if test $have_tcl != yes ; then
11951                 echo "configure: warning: could not find -ltcl" 1>&2
11952                 if test $ol_enable_tcl = yes ; then
11953                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
11954                 fi
11955
11956                 ol_enable_tcl=no
11957         fi
11958 fi
11959
11960 # ud needs termcap (should insert check here)
11961 ol_link_termcap=no
11962 for ac_hdr in termcap.h ncurses.h
11963 do
11964 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11965 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11966 echo "configure:11967: checking for $ac_hdr" >&5
11967 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11968   echo $ac_n "(cached) $ac_c" 1>&6
11969 else
11970   cat > conftest.$ac_ext <<EOF
11971 #line 11972 "configure"
11972 #include "confdefs.h"
11973 #include <$ac_hdr>
11974 EOF
11975 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11976 { (eval echo configure:11977: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11977 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11978 if test -z "$ac_err"; then
11979   rm -rf conftest*
11980   eval "ac_cv_header_$ac_safe=yes"
11981 else
11982   echo "$ac_err" >&5
11983   echo "configure: failed program was:" >&5
11984   cat conftest.$ac_ext >&5
11985   rm -rf conftest*
11986   eval "ac_cv_header_$ac_safe=no"
11987 fi
11988 rm -f conftest*
11989 fi
11990 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11991   echo "$ac_t""yes" 1>&6
11992     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11993   cat >> confdefs.h <<EOF
11994 #define $ac_tr_hdr 1
11995 EOF
11996  
11997 else
11998   echo "$ac_t""no" 1>&6
11999 fi
12000 done
12001
12002
12003 if test $ol_link_termcap = no ; then
12004         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
12005 echo "configure:12006: checking for tputs in -ltermcap" >&5
12006 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
12007 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12008   echo $ac_n "(cached) $ac_c" 1>&6
12009 else
12010   ac_save_LIBS="$LIBS"
12011 LIBS="-ltermcap  $LIBS"
12012 cat > conftest.$ac_ext <<EOF
12013 #line 12014 "configure"
12014 #include "confdefs.h"
12015 /* Override any gcc2 internal prototype to avoid an error.  */
12016 /* We use char because int might match the return type of a gcc2
12017     builtin and then its argument prototype would still apply.  */
12018 char tputs();
12019
12020 int main() {
12021 tputs()
12022 ; return 0; }
12023 EOF
12024 if { (eval echo configure:12025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12025   rm -rf conftest*
12026   eval "ac_cv_lib_$ac_lib_var=yes"
12027 else
12028   echo "configure: failed program was:" >&5
12029   cat conftest.$ac_ext >&5
12030   rm -rf conftest*
12031   eval "ac_cv_lib_$ac_lib_var=no"
12032 fi
12033 rm -f conftest*
12034 LIBS="$ac_save_LIBS"
12035
12036 fi
12037 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12038   echo "$ac_t""yes" 1>&6
12039   have_termcap=yes
12040 else
12041   echo "$ac_t""no" 1>&6
12042 have_termcap=no
12043 fi
12044
12045         if test $have_termcap = yes ; then
12046                 cat >> confdefs.h <<\EOF
12047 #define HAVE_TERMCAP 1
12048 EOF
12049
12050                 ol_link_termcap=yes
12051                 TERMCAP_LIBS=-ltermcap
12052         fi
12053 fi
12054
12055 if test $ol_link_termcap = no ; then
12056         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
12057 echo "configure:12058: checking for initscr in -lncurses" >&5
12058 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
12059 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12060   echo $ac_n "(cached) $ac_c" 1>&6
12061 else
12062   ac_save_LIBS="$LIBS"
12063 LIBS="-lncurses  $LIBS"
12064 cat > conftest.$ac_ext <<EOF
12065 #line 12066 "configure"
12066 #include "confdefs.h"
12067 /* Override any gcc2 internal prototype to avoid an error.  */
12068 /* We use char because int might match the return type of a gcc2
12069     builtin and then its argument prototype would still apply.  */
12070 char initscr();
12071
12072 int main() {
12073 initscr()
12074 ; return 0; }
12075 EOF
12076 if { (eval echo configure:12077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12077   rm -rf conftest*
12078   eval "ac_cv_lib_$ac_lib_var=yes"
12079 else
12080   echo "configure: failed program was:" >&5
12081   cat conftest.$ac_ext >&5
12082   rm -rf conftest*
12083   eval "ac_cv_lib_$ac_lib_var=no"
12084 fi
12085 rm -f conftest*
12086 LIBS="$ac_save_LIBS"
12087
12088 fi
12089 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12090   echo "$ac_t""yes" 1>&6
12091   have_ncurses=yes
12092 else
12093   echo "$ac_t""no" 1>&6
12094 have_ncurses=no
12095 fi
12096
12097         if test $have_ncurses = yes ; then
12098                 cat >> confdefs.h <<\EOF
12099 #define HAVE_NCURSES 1
12100 EOF
12101
12102                 ol_link_termcap=yes
12103                 TERMCAP_LIBS=-lncurses
12104         fi
12105 fi
12106
12107 if test $ol_link_termcap = no ; then
12108         cat >> confdefs.h <<\EOF
12109 #define NO_TERMCAP 1
12110 EOF
12111
12112         TERMCAP_LIBS=
12113 fi
12114
12115 ol_link_sasl=no
12116 if test $ol_with_cyrus_sasl != no ; then
12117         ac_safe=`echo "sasl.h" | sed 'y%./+-%__p_%'`
12118 echo $ac_n "checking for sasl.h""... $ac_c" 1>&6
12119 echo "configure:12120: checking for sasl.h" >&5
12120 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12121   echo $ac_n "(cached) $ac_c" 1>&6
12122 else
12123   cat > conftest.$ac_ext <<EOF
12124 #line 12125 "configure"
12125 #include "confdefs.h"
12126 #include <sasl.h>
12127 EOF
12128 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12129 { (eval echo configure:12130: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12130 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12131 if test -z "$ac_err"; then
12132   rm -rf conftest*
12133   eval "ac_cv_header_$ac_safe=yes"
12134 else
12135   echo "$ac_err" >&5
12136   echo "configure: failed program was:" >&5
12137   cat conftest.$ac_ext >&5
12138   rm -rf conftest*
12139   eval "ac_cv_header_$ac_safe=no"
12140 fi
12141 rm -f conftest*
12142 fi
12143 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12144   echo "$ac_t""yes" 1>&6
12145   :
12146 else
12147   echo "$ac_t""no" 1>&6
12148 fi
12149
12150
12151         if test $ac_cv_header_sasl_h = yes ; then
12152                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
12153 echo "configure:12154: checking for sasl_client_init in -lsasl" >&5
12154 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
12155 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12156   echo $ac_n "(cached) $ac_c" 1>&6
12157 else
12158   ac_save_LIBS="$LIBS"
12159 LIBS="-lsasl  $LIBS"
12160 cat > conftest.$ac_ext <<EOF
12161 #line 12162 "configure"
12162 #include "confdefs.h"
12163 /* Override any gcc2 internal prototype to avoid an error.  */
12164 /* We use char because int might match the return type of a gcc2
12165     builtin and then its argument prototype would still apply.  */
12166 char sasl_client_init();
12167
12168 int main() {
12169 sasl_client_init()
12170 ; return 0; }
12171 EOF
12172 if { (eval echo configure:12173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12173   rm -rf conftest*
12174   eval "ac_cv_lib_$ac_lib_var=yes"
12175 else
12176   echo "configure: failed program was:" >&5
12177   cat conftest.$ac_ext >&5
12178   rm -rf conftest*
12179   eval "ac_cv_lib_$ac_lib_var=no"
12180 fi
12181 rm -f conftest*
12182 LIBS="$ac_save_LIBS"
12183
12184 fi
12185 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12186   echo "$ac_t""yes" 1>&6
12187   have_cyrus_sasl=yes
12188 else
12189   echo "$ac_t""no" 1>&6
12190 have_cyrus_sasl=no
12191 fi
12192
12193
12194                 if test $have_cyrus_sasl != no ; then
12195                         SASL_LIBS="-lsasl"
12196                         cat >> confdefs.h <<\EOF
12197 #define HAVE_CYRUS_SASL 1
12198 EOF
12199
12200                         ol_link_sasl=yes
12201                 fi
12202         fi
12203
12204         if test $ol_link_sasl = no -a $ol_with_cyrus_sasl = yes ; then
12205                 { echo "configure: error: no suitable API for --with-cyrus-sasl=$ol_with_cyrus_sasl" 1>&2; exit 1; }
12206         fi
12207 fi
12208
12209 ol_link_fetch=no
12210 if test $ol_with_fetch != no ; then
12211         ol=$LIBS
12212 LIBS="-lfetch -lcom_err $LIBS"
12213 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
12214 echo "configure:12215: checking fetch(3) library" >&5
12215 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
12216   echo $ac_n "(cached) $ac_c" 1>&6
12217 else
12218   
12219         cat > conftest.$ac_ext <<EOF
12220 #line 12221 "configure"
12221 #include "confdefs.h"
12222
12223 #include <sys/param.h>
12224 #include <stdio.h>
12225 #include <fetch.h>
12226 int main() {
12227 struct url *u = fetchParseURL("file:///"); 
12228 ; return 0; }
12229 EOF
12230 if { (eval echo configure:12231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12231   rm -rf conftest*
12232   ol_cv_lib_fetch=yes
12233 else
12234   echo "configure: failed program was:" >&5
12235   cat conftest.$ac_ext >&5
12236   rm -rf conftest*
12237   ol_cv_lib_fetch=no
12238 fi
12239 rm -f conftest*
12240 fi
12241
12242 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
12243 LIBS=$ol_LIBS
12244 if test $ol_cv_lib_fetch != no ; then
12245         ol_link_fetch="-lfetch -lcom_err"
12246         cat >> confdefs.h <<\EOF
12247 #define HAVE_FETCH 1
12248 EOF
12249
12250 fi
12251
12252
12253         if test $ol_cv_lib_fetch != no ; then
12254                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
12255                 ol_link_fetch=freebsd
12256
12257         elif test $ol_with_fetch != auto ; then
12258                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
12259         fi 
12260 fi
12261
12262 ol_link_readline=no
12263 if test $ol_with_readline != no ; then
12264         for ac_hdr in readline/readline.h readline/history.h
12265 do
12266 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12267 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12268 echo "configure:12269: checking for $ac_hdr" >&5
12269 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12270   echo $ac_n "(cached) $ac_c" 1>&6
12271 else
12272   cat > conftest.$ac_ext <<EOF
12273 #line 12274 "configure"
12274 #include "confdefs.h"
12275 #include <$ac_hdr>
12276 EOF
12277 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12278 { (eval echo configure:12279: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12279 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12280 if test -z "$ac_err"; then
12281   rm -rf conftest*
12282   eval "ac_cv_header_$ac_safe=yes"
12283 else
12284   echo "$ac_err" >&5
12285   echo "configure: failed program was:" >&5
12286   cat conftest.$ac_ext >&5
12287   rm -rf conftest*
12288   eval "ac_cv_header_$ac_safe=no"
12289 fi
12290 rm -f conftest*
12291 fi
12292 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12293   echo "$ac_t""yes" 1>&6
12294     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12295   cat >> confdefs.h <<EOF
12296 #define $ac_tr_hdr 1
12297 EOF
12298  
12299 else
12300   echo "$ac_t""no" 1>&6
12301 fi
12302 done
12303
12304
12305         if test $ac_cv_header_readline_readline_h = yes ; then
12306                 save_LIBS="$LIBS"
12307                 LIBS="$TERMCAP_LIBS $LIBS"
12308                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
12309 echo "configure:12310: checking for readline in -lreadline" >&5
12310 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
12311 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12312   echo $ac_n "(cached) $ac_c" 1>&6
12313 else
12314   ac_save_LIBS="$LIBS"
12315 LIBS="-lreadline  $LIBS"
12316 cat > conftest.$ac_ext <<EOF
12317 #line 12318 "configure"
12318 #include "confdefs.h"
12319 /* Override any gcc2 internal prototype to avoid an error.  */
12320 /* We use char because int might match the return type of a gcc2
12321     builtin and then its argument prototype would still apply.  */
12322 char readline();
12323
12324 int main() {
12325 readline()
12326 ; return 0; }
12327 EOF
12328 if { (eval echo configure:12329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12329   rm -rf conftest*
12330   eval "ac_cv_lib_$ac_lib_var=yes"
12331 else
12332   echo "configure: failed program was:" >&5
12333   cat conftest.$ac_ext >&5
12334   rm -rf conftest*
12335   eval "ac_cv_lib_$ac_lib_var=no"
12336 fi
12337 rm -f conftest*
12338 LIBS="$ac_save_LIBS"
12339
12340 fi
12341 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12342   echo "$ac_t""yes" 1>&6
12343   have_readline=yes
12344 else
12345   echo "$ac_t""no" 1>&6
12346 have_readline=no
12347 fi
12348
12349                 LIBS="$save_LIBS"
12350                         
12351                 if test $have_readline = yes ; then
12352                         ol_with_readline=found
12353                         ol_link_readline=yes
12354
12355                         READLINE_LIBS="-lreadline"
12356                 fi
12357         fi
12358 fi
12359
12360 if test $ol_link_readline = yes ; then
12361         cat >> confdefs.h <<\EOF
12362 #define HAVE_READLINE 1
12363 EOF
12364
12365 fi
12366
12367
12368 # FreeBSD (and others) have crypt(3) in -lcrypt
12369 if test $ol_enable_crypt != no ; then
12370         echo $ac_n "checking for crypt""... $ac_c" 1>&6
12371 echo "configure:12372: checking for crypt" >&5
12372 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
12373   echo $ac_n "(cached) $ac_c" 1>&6
12374 else
12375   cat > conftest.$ac_ext <<EOF
12376 #line 12377 "configure"
12377 #include "confdefs.h"
12378 /* System header to define __stub macros and hopefully few prototypes,
12379     which can conflict with char crypt(); below.  */
12380 #include <assert.h>
12381 /* Override any gcc2 internal prototype to avoid an error.  */
12382 /* We use char because int might match the return type of a gcc2
12383     builtin and then its argument prototype would still apply.  */
12384 char crypt();
12385 char (*f)();
12386
12387 int main() {
12388
12389 /* The GNU C library defines this for functions which it implements
12390     to always fail with ENOSYS.  Some functions are actually named
12391     something starting with __ and the normal name is an alias.  */
12392 #if defined (__stub_crypt) || defined (__stub___crypt)
12393 choke me
12394 #else
12395 f = crypt;
12396 #endif
12397
12398 ; return 0; }
12399 EOF
12400 if { (eval echo configure:12401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12401   rm -rf conftest*
12402   eval "ac_cv_func_crypt=yes"
12403 else
12404   echo "configure: failed program was:" >&5
12405   cat conftest.$ac_ext >&5
12406   rm -rf conftest*
12407   eval "ac_cv_func_crypt=no"
12408 fi
12409 rm -f conftest*
12410 fi
12411
12412 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
12413   echo "$ac_t""yes" 1>&6
12414   have_crypt=yes
12415 else
12416   echo "$ac_t""no" 1>&6
12417
12418                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
12419 echo "configure:12420: checking for crypt in -lcrypt" >&5
12420 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
12421 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12422   echo $ac_n "(cached) $ac_c" 1>&6
12423 else
12424   ac_save_LIBS="$LIBS"
12425 LIBS="-lcrypt  $LIBS"
12426 cat > conftest.$ac_ext <<EOF
12427 #line 12428 "configure"
12428 #include "confdefs.h"
12429 /* Override any gcc2 internal prototype to avoid an error.  */
12430 /* We use char because int might match the return type of a gcc2
12431     builtin and then its argument prototype would still apply.  */
12432 char crypt();
12433
12434 int main() {
12435 crypt()
12436 ; return 0; }
12437 EOF
12438 if { (eval echo configure:12439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12439   rm -rf conftest*
12440   eval "ac_cv_lib_$ac_lib_var=yes"
12441 else
12442   echo "configure: failed program was:" >&5
12443   cat conftest.$ac_ext >&5
12444   rm -rf conftest*
12445   eval "ac_cv_lib_$ac_lib_var=no"
12446 fi
12447 rm -f conftest*
12448 LIBS="$ac_save_LIBS"
12449
12450 fi
12451 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12452   echo "$ac_t""yes" 1>&6
12453   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
12454                         have_crypt=yes
12455 else
12456   echo "$ac_t""no" 1>&6
12457 have_crypt=no
12458 fi
12459
12460 fi
12461
12462
12463         if test $have_crypt = yes ; then
12464                 cat >> confdefs.h <<\EOF
12465 #define HAVE_CRYPT 1
12466 EOF
12467
12468         else
12469                 echo "configure: warning: could not find crypt" 1>&2
12470                 if test $ol_enable_crypt = yes ; then
12471                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
12472                 fi
12473
12474                 echo "configure: warning: disabling crypt support" 1>&2
12475                 ol_enable_crypt=no
12476         fi
12477 fi
12478
12479 # FreeBSD (and others) have setproctitle(3) in -lutil
12480 if test $ol_enable_proctitle != no ; then
12481         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
12482 echo "configure:12483: checking for setproctitle" >&5
12483 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
12484   echo $ac_n "(cached) $ac_c" 1>&6
12485 else
12486   cat > conftest.$ac_ext <<EOF
12487 #line 12488 "configure"
12488 #include "confdefs.h"
12489 /* System header to define __stub macros and hopefully few prototypes,
12490     which can conflict with char setproctitle(); below.  */
12491 #include <assert.h>
12492 /* Override any gcc2 internal prototype to avoid an error.  */
12493 /* We use char because int might match the return type of a gcc2
12494     builtin and then its argument prototype would still apply.  */
12495 char setproctitle();
12496 char (*f)();
12497
12498 int main() {
12499
12500 /* The GNU C library defines this for functions which it implements
12501     to always fail with ENOSYS.  Some functions are actually named
12502     something starting with __ and the normal name is an alias.  */
12503 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
12504 choke me
12505 #else
12506 f = setproctitle;
12507 #endif
12508
12509 ; return 0; }
12510 EOF
12511 if { (eval echo configure:12512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12512   rm -rf conftest*
12513   eval "ac_cv_func_setproctitle=yes"
12514 else
12515   echo "configure: failed program was:" >&5
12516   cat conftest.$ac_ext >&5
12517   rm -rf conftest*
12518   eval "ac_cv_func_setproctitle=no"
12519 fi
12520 rm -f conftest*
12521 fi
12522
12523 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
12524   echo "$ac_t""yes" 1>&6
12525   have_setproctitle=yes
12526 else
12527   echo "$ac_t""no" 1>&6
12528
12529                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
12530 echo "configure:12531: checking for setproctitle in -lutil" >&5
12531 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
12532 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12533   echo $ac_n "(cached) $ac_c" 1>&6
12534 else
12535   ac_save_LIBS="$LIBS"
12536 LIBS="-lutil  $LIBS"
12537 cat > conftest.$ac_ext <<EOF
12538 #line 12539 "configure"
12539 #include "confdefs.h"
12540 /* Override any gcc2 internal prototype to avoid an error.  */
12541 /* We use char because int might match the return type of a gcc2
12542     builtin and then its argument prototype would still apply.  */
12543 char setproctitle();
12544
12545 int main() {
12546 setproctitle()
12547 ; return 0; }
12548 EOF
12549 if { (eval echo configure:12550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12550   rm -rf conftest*
12551   eval "ac_cv_lib_$ac_lib_var=yes"
12552 else
12553   echo "configure: failed program was:" >&5
12554   cat conftest.$ac_ext >&5
12555   rm -rf conftest*
12556   eval "ac_cv_lib_$ac_lib_var=no"
12557 fi
12558 rm -f conftest*
12559 LIBS="$ac_save_LIBS"
12560
12561 fi
12562 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12563   echo "$ac_t""yes" 1>&6
12564   have_setproctitle=yes
12565                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
12566 else
12567   echo "$ac_t""no" 1>&6
12568 have_setproctitle=no
12569                         LIBOBJS="$LIBOBJS setproctitle.o"
12570 fi
12571
12572 fi
12573
12574
12575         if test $have_setproctitle = yes ; then
12576                 cat >> confdefs.h <<\EOF
12577 #define HAVE_SETPROCTITLE 1
12578 EOF
12579
12580         fi
12581 fi
12582
12583 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
12584 echo "configure:12585: checking for uid_t in sys/types.h" >&5
12585 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
12586   echo $ac_n "(cached) $ac_c" 1>&6
12587 else
12588   cat > conftest.$ac_ext <<EOF
12589 #line 12590 "configure"
12590 #include "confdefs.h"
12591 #include <sys/types.h>
12592 EOF
12593 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12594   egrep "uid_t" >/dev/null 2>&1; then
12595   rm -rf conftest*
12596   ac_cv_type_uid_t=yes
12597 else
12598   rm -rf conftest*
12599   ac_cv_type_uid_t=no
12600 fi
12601 rm -f conftest*
12602
12603 fi
12604
12605 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
12606 if test $ac_cv_type_uid_t = no; then
12607   cat >> confdefs.h <<\EOF
12608 #define uid_t int
12609 EOF
12610
12611   cat >> confdefs.h <<\EOF
12612 #define gid_t int
12613 EOF
12614
12615 fi
12616
12617 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
12618 echo "configure:12619: checking type of array argument to getgroups" >&5
12619 if eval "test \"\${ac_cv_type_getgroups+set}\" = set"; then
12620   echo $ac_n "(cached) $ac_c" 1>&6
12621 else
12622   if test "$cross_compiling" = yes; then
12623   ac_cv_type_getgroups=cross
12624 else
12625   cat > conftest.$ac_ext <<EOF
12626 #line 12627 "configure"
12627 #include "confdefs.h"
12628
12629 /* Thanks to Mike Rendell for this test.  */
12630 #include <sys/types.h>
12631 #define NGID 256
12632 #undef MAX
12633 #define MAX(x, y) ((x) > (y) ? (x) : (y))
12634 main()
12635 {
12636   gid_t gidset[NGID];
12637   int i, n;
12638   union { gid_t gval; long lval; }  val;
12639
12640   val.lval = -1;
12641   for (i = 0; i < NGID; i++)
12642     gidset[i] = val.gval;
12643   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
12644                  gidset);
12645   /* Exit non-zero if getgroups seems to require an array of ints.  This
12646      happens when gid_t is short but getgroups modifies an array of ints.  */
12647   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
12648 }
12649
12650 EOF
12651 if { (eval echo configure:12652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12652 then
12653     ac_cv_type_getgroups=gid_t
12654 else
12655   echo "configure: failed program was:" >&5
12656   cat conftest.$ac_ext >&5
12657   rm -fr conftest*
12658   ac_cv_type_getgroups=int
12659 fi
12660 rm -fr conftest*
12661 fi
12662
12663 if test $ac_cv_type_getgroups = cross; then
12664         cat > conftest.$ac_ext <<EOF
12665 #line 12666 "configure"
12666 #include "confdefs.h"
12667 #include <unistd.h>
12668 EOF
12669 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12670   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
12671   rm -rf conftest*
12672   ac_cv_type_getgroups=gid_t
12673 else
12674   rm -rf conftest*
12675   ac_cv_type_getgroups=int
12676 fi
12677 rm -f conftest*
12678
12679 fi
12680 fi
12681
12682 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
12683 cat >> confdefs.h <<EOF
12684 #define GETGROUPS_T $ac_cv_type_getgroups
12685 EOF
12686
12687  echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
12688 echo "configure:12689: checking for ANSI C header files" >&5
12689 if eval "test \"\${ac_cv_header_stdc+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 <stdlib.h>
12696 #include <stdarg.h>
12697 #include <string.h>
12698 #include <float.h>
12699 EOF
12700 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12701 { (eval echo configure:12702: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12702 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12703 if test -z "$ac_err"; then
12704   rm -rf conftest*
12705   ac_cv_header_stdc=yes
12706 else
12707   echo "$ac_err" >&5
12708   echo "configure: failed program was:" >&5
12709   cat conftest.$ac_ext >&5
12710   rm -rf conftest*
12711   ac_cv_header_stdc=no
12712 fi
12713 rm -f conftest*
12714
12715 if test $ac_cv_header_stdc = yes; then
12716   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
12717 cat > conftest.$ac_ext <<EOF
12718 #line 12719 "configure"
12719 #include "confdefs.h"
12720 #include <string.h>
12721 EOF
12722 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12723   egrep "memchr" >/dev/null 2>&1; then
12724   :
12725 else
12726   rm -rf conftest*
12727   ac_cv_header_stdc=no
12728 fi
12729 rm -f conftest*
12730
12731 fi
12732
12733 if test $ac_cv_header_stdc = yes; then
12734   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
12735 cat > conftest.$ac_ext <<EOF
12736 #line 12737 "configure"
12737 #include "confdefs.h"
12738 #include <stdlib.h>
12739 EOF
12740 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12741   egrep "free" >/dev/null 2>&1; then
12742   :
12743 else
12744   rm -rf conftest*
12745   ac_cv_header_stdc=no
12746 fi
12747 rm -f conftest*
12748
12749 fi
12750
12751 if test $ac_cv_header_stdc = yes; then
12752   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
12753 if test "$cross_compiling" = yes; then
12754   :
12755 else
12756   cat > conftest.$ac_ext <<EOF
12757 #line 12758 "configure"
12758 #include "confdefs.h"
12759 #include <ctype.h>
12760 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
12761 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
12762 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
12763 int main () { int i; for (i = 0; i < 256; i++)
12764 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
12765 exit (0); }
12766
12767 EOF
12768 if { (eval echo configure:12769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12769 then
12770   :
12771 else
12772   echo "configure: failed program was:" >&5
12773   cat conftest.$ac_ext >&5
12774   rm -fr conftest*
12775   ac_cv_header_stdc=no
12776 fi
12777 rm -fr conftest*
12778 fi
12779
12780 fi
12781 fi
12782
12783 echo "$ac_t""$ac_cv_header_stdc" 1>&6
12784 if test $ac_cv_header_stdc = yes; then
12785   cat >> confdefs.h <<\EOF
12786 #define STDC_HEADERS 1
12787 EOF
12788
12789 fi
12790
12791 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
12792 echo "configure:12793: checking for mode_t" >&5
12793 if eval "test \"\${ac_cv_type_mode_t+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 <sys/types.h>
12800 #if STDC_HEADERS
12801 #include <stdlib.h>
12802 #include <stddef.h>
12803 #endif
12804 EOF
12805 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12806   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
12807   rm -rf conftest*
12808   eval "ac_cv_type_mode_t=yes"
12809 else
12810   rm -rf conftest*
12811   eval "ac_cv_type_mode_t=no"
12812 fi
12813 rm -f conftest*
12814
12815 fi
12816 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
12817   echo "$ac_t""yes" 1>&6
12818 else
12819   echo "$ac_t""no" 1>&6
12820   cat >> confdefs.h <<EOF
12821 #define mode_t int
12822 EOF
12823
12824 fi
12825
12826 echo $ac_n "checking for off_t""... $ac_c" 1>&6
12827 echo "configure:12828: checking for off_t" >&5
12828 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
12829   echo $ac_n "(cached) $ac_c" 1>&6
12830 else
12831   cat > conftest.$ac_ext <<EOF
12832 #line 12833 "configure"
12833 #include "confdefs.h"
12834 #include <sys/types.h>
12835 #if STDC_HEADERS
12836 #include <stdlib.h>
12837 #include <stddef.h>
12838 #endif
12839 EOF
12840 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12841   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
12842   rm -rf conftest*
12843   eval "ac_cv_type_off_t=yes"
12844 else
12845   rm -rf conftest*
12846   eval "ac_cv_type_off_t=no"
12847 fi
12848 rm -f conftest*
12849
12850 fi
12851 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
12852   echo "$ac_t""yes" 1>&6
12853 else
12854   echo "$ac_t""no" 1>&6
12855   cat >> confdefs.h <<EOF
12856 #define off_t long
12857 EOF
12858
12859 fi
12860
12861 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
12862 echo "configure:12863: checking for pid_t" >&5
12863 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
12864   echo $ac_n "(cached) $ac_c" 1>&6
12865 else
12866   cat > conftest.$ac_ext <<EOF
12867 #line 12868 "configure"
12868 #include "confdefs.h"
12869 #include <sys/types.h>
12870 #if STDC_HEADERS
12871 #include <stdlib.h>
12872 #include <stddef.h>
12873 #endif
12874 EOF
12875 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12876   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
12877   rm -rf conftest*
12878   eval "ac_cv_type_pid_t=yes"
12879 else
12880   rm -rf conftest*
12881   eval "ac_cv_type_pid_t=no"
12882 fi
12883 rm -f conftest*
12884
12885 fi
12886 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
12887   echo "$ac_t""yes" 1>&6
12888 else
12889   echo "$ac_t""no" 1>&6
12890   cat >> confdefs.h <<EOF
12891 #define pid_t int
12892 EOF
12893
12894 fi
12895
12896 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
12897 echo "configure:12898: checking for ptrdiff_t" >&5
12898 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
12899   echo $ac_n "(cached) $ac_c" 1>&6
12900 else
12901   cat > conftest.$ac_ext <<EOF
12902 #line 12903 "configure"
12903 #include "confdefs.h"
12904 #include <stddef.h>
12905 int main() {
12906 ptrdiff_t p
12907 ; return 0; }
12908 EOF
12909 if { (eval echo configure:12910: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12910   rm -rf conftest*
12911   am_cv_type_ptrdiff_t=yes
12912 else
12913   echo "configure: failed program was:" >&5
12914   cat conftest.$ac_ext >&5
12915   rm -rf conftest*
12916   am_cv_type_ptrdiff_t=no
12917 fi
12918 rm -f conftest*
12919 fi
12920
12921 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
12922    if test $am_cv_type_ptrdiff_t = yes; then
12923      cat >> confdefs.h <<\EOF
12924 #define HAVE_PTRDIFF_T 1
12925 EOF
12926
12927    fi
12928
12929 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
12930 echo "configure:12931: checking return type of signal handlers" >&5
12931 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
12932   echo $ac_n "(cached) $ac_c" 1>&6
12933 else
12934   cat > conftest.$ac_ext <<EOF
12935 #line 12936 "configure"
12936 #include "confdefs.h"
12937 #include <sys/types.h>
12938 #include <signal.h>
12939 #ifdef signal
12940 #undef signal
12941 #endif
12942 #ifdef __cplusplus
12943 extern "C" void (*signal (int, void (*)(int)))(int);
12944 #else
12945 void (*signal ()) ();
12946 #endif
12947
12948 int main() {
12949 int i;
12950 ; return 0; }
12951 EOF
12952 if { (eval echo configure:12953: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12953   rm -rf conftest*
12954   ac_cv_type_signal=void
12955 else
12956   echo "configure: failed program was:" >&5
12957   cat conftest.$ac_ext >&5
12958   rm -rf conftest*
12959   ac_cv_type_signal=int
12960 fi
12961 rm -f conftest*
12962 fi
12963
12964 echo "$ac_t""$ac_cv_type_signal" 1>&6
12965 cat >> confdefs.h <<EOF
12966 #define RETSIGTYPE $ac_cv_type_signal
12967 EOF
12968
12969
12970 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
12971 echo "configure:12972: checking for sig_atomic_t" >&5
12972 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
12973   echo $ac_n "(cached) $ac_c" 1>&6
12974 else
12975   cat > conftest.$ac_ext <<EOF
12976 #line 12977 "configure"
12977 #include "confdefs.h"
12978 #include <signal.h>
12979 int main() {
12980 sig_atomic_t atomic;
12981 ; return 0; }
12982 EOF
12983 if { (eval echo configure:12984: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12984   rm -rf conftest*
12985   ol_cv_type_sig_atomic_t=yes
12986 else
12987   echo "configure: failed program was:" >&5
12988   cat conftest.$ac_ext >&5
12989   rm -rf conftest*
12990   ol_cv_type_sig_atomic_t=no
12991 fi
12992 rm -f conftest*
12993 fi
12994
12995 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
12996   if test $ol_cv_type_sig_atomic_t = no; then
12997     cat >> confdefs.h <<\EOF
12998 #define sig_atomic_t int
12999 EOF
13000
13001   fi
13002  
13003 echo $ac_n "checking for size_t""... $ac_c" 1>&6
13004 echo "configure:13005: checking for size_t" >&5
13005 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
13006   echo $ac_n "(cached) $ac_c" 1>&6
13007 else
13008   cat > conftest.$ac_ext <<EOF
13009 #line 13010 "configure"
13010 #include "confdefs.h"
13011 #include <sys/types.h>
13012 #if STDC_HEADERS
13013 #include <stdlib.h>
13014 #include <stddef.h>
13015 #endif
13016 EOF
13017 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13018   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
13019   rm -rf conftest*
13020   eval "ac_cv_type_size_t=yes"
13021 else
13022   rm -rf conftest*
13023   eval "ac_cv_type_size_t=no"
13024 fi
13025 rm -f conftest*
13026
13027 fi
13028 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
13029   echo "$ac_t""yes" 1>&6
13030 else
13031   echo "$ac_t""no" 1>&6
13032   cat >> confdefs.h <<EOF
13033 #define size_t unsigned
13034 EOF
13035
13036 fi
13037
13038 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
13039 echo "configure:13040: checking for socklen_t" >&5
13040 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
13041   echo $ac_n "(cached) $ac_c" 1>&6
13042 else
13043   cat > conftest.$ac_ext <<EOF
13044 #line 13045 "configure"
13045 #include "confdefs.h"
13046
13047 #ifdef HAVE_SYS_TYPES_H
13048 #include <sys/types.h>
13049 #endif
13050 #ifdef HAVE_SYS_SOCKET_H
13051 #include <sys/socket.h>
13052 #endif
13053
13054 int main() {
13055 socklen_t len;
13056 ; return 0; }
13057 EOF
13058 if { (eval echo configure:13059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13059   rm -rf conftest*
13060   ol_cv_type_socklen_t=yes
13061 else
13062   echo "configure: failed program was:" >&5
13063   cat conftest.$ac_ext >&5
13064   rm -rf conftest*
13065   ol_cv_type_socklen_t=no
13066 fi
13067 rm -f conftest*
13068 fi
13069
13070 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
13071   if test $ol_cv_type_socklen_t = no; then
13072     cat >> confdefs.h <<\EOF
13073 #define socklen_t int
13074 EOF
13075
13076   fi
13077  
13078 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
13079 echo "configure:13080: checking for member st_blksize in aggregate type struct stat" >&5
13080 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
13081   echo $ac_n "(cached) $ac_c" 1>&6
13082 else
13083   cat > conftest.$ac_ext <<EOF
13084 #line 13085 "configure"
13085 #include "confdefs.h"
13086 #include <sys/types.h>
13087 #include <sys/stat.h>
13088 int main() {
13089 struct stat foo; foo.st_blksize;
13090 ; return 0; }
13091 EOF
13092 if { (eval echo configure:13093: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13093   rm -rf conftest*
13094   ac_cv_c_struct_member_st_blksize=yes
13095 else
13096   echo "configure: failed program was:" >&5
13097   cat conftest.$ac_ext >&5
13098   rm -rf conftest*
13099   ac_cv_c_struct_member_st_blksize=no
13100 fi
13101 rm -f conftest*
13102 fi
13103
13104 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
13105 st_blksize="$ac_cv_c_struct_member_st_blksize"
13106 if test $ac_cv_c_struct_member_st_blksize = yes; then
13107   cat >> confdefs.h <<\EOF
13108 #define HAVE_ST_BLKSIZE 1
13109 EOF
13110
13111 fi
13112
13113 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
13114 echo "configure:13115: checking whether time.h and sys/time.h may both be included" >&5
13115 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
13116   echo $ac_n "(cached) $ac_c" 1>&6
13117 else
13118   cat > conftest.$ac_ext <<EOF
13119 #line 13120 "configure"
13120 #include "confdefs.h"
13121 #include <sys/types.h>
13122 #include <sys/time.h>
13123 #include <time.h>
13124 int main() {
13125 struct tm *tp;
13126 ; return 0; }
13127 EOF
13128 if { (eval echo configure:13129: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13129   rm -rf conftest*
13130   ac_cv_header_time=yes
13131 else
13132   echo "configure: failed program was:" >&5
13133   cat conftest.$ac_ext >&5
13134   rm -rf conftest*
13135   ac_cv_header_time=no
13136 fi
13137 rm -f conftest*
13138 fi
13139
13140 echo "$ac_t""$ac_cv_header_time" 1>&6
13141 if test $ac_cv_header_time = yes; then
13142   cat >> confdefs.h <<\EOF
13143 #define TIME_WITH_SYS_TIME 1
13144 EOF
13145
13146 fi
13147
13148 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
13149 echo "configure:13150: checking whether struct tm is in sys/time.h or time.h" >&5
13150 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
13151   echo $ac_n "(cached) $ac_c" 1>&6
13152 else
13153   cat > conftest.$ac_ext <<EOF
13154 #line 13155 "configure"
13155 #include "confdefs.h"
13156 #include <sys/types.h>
13157 #include <time.h>
13158 int main() {
13159 struct tm *tp; tp->tm_sec;
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   ac_cv_struct_tm=time.h
13165 else
13166   echo "configure: failed program was:" >&5
13167   cat conftest.$ac_ext >&5
13168   rm -rf conftest*
13169   ac_cv_struct_tm=sys/time.h
13170 fi
13171 rm -f conftest*
13172 fi
13173
13174 echo "$ac_t""$ac_cv_struct_tm" 1>&6
13175 if test $ac_cv_struct_tm = sys/time.h; then
13176   cat >> confdefs.h <<\EOF
13177 #define TM_IN_SYS_TIME 1
13178 EOF
13179
13180 fi
13181
13182 # test for pw_gecos in struct passwd
13183 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
13184 echo "configure:13185: checking struct passwd for pw_gecos" >&5
13185 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
13186   echo $ac_n "(cached) $ac_c" 1>&6
13187 else
13188   
13189         cat > conftest.$ac_ext <<EOF
13190 #line 13191 "configure"
13191 #include "confdefs.h"
13192 #include <pwd.h>
13193 int main() {
13194
13195         struct passwd pwd;
13196         pwd.pw_gecos = pwd.pw_name;
13197
13198 ; return 0; }
13199 EOF
13200 if { (eval echo configure:13201: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13201   rm -rf conftest*
13202   ol_cv_struct_passwd_pw_gecos=yes
13203 else
13204   echo "configure: failed program was:" >&5
13205   cat conftest.$ac_ext >&5
13206   rm -rf conftest*
13207   ol_cv_struct_passwd_pw_gecos=no
13208 fi
13209 rm -f conftest*
13210 fi
13211
13212 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
13213 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
13214         cat >> confdefs.h <<\EOF
13215 #define HAVE_PW_GECOS 1
13216 EOF
13217
13218 fi
13219
13220 # test for pw_passwd in struct passwd
13221 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
13222 echo "configure:13223: checking struct passwd for pw_passwd" >&5
13223 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
13224   echo $ac_n "(cached) $ac_c" 1>&6
13225 else
13226   
13227         cat > conftest.$ac_ext <<EOF
13228 #line 13229 "configure"
13229 #include "confdefs.h"
13230 #include <pwd.h>
13231 int main() {
13232
13233         struct passwd pwd;
13234         pwd.pw_passwd = pwd.pw_name;
13235
13236 ; return 0; }
13237 EOF
13238 if { (eval echo configure:13239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13239   rm -rf conftest*
13240   ol_cv_struct_passwd_pw_passwd=yes
13241 else
13242   echo "configure: failed program was:" >&5
13243   cat conftest.$ac_ext >&5
13244   rm -rf conftest*
13245   ol_cv_struct_passwd_pw_passwd=no
13246 fi
13247 rm -f conftest*
13248 fi
13249
13250 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
13251 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
13252         cat >> confdefs.h <<\EOF
13253 #define HAVE_PW_PASSWD 1
13254 EOF
13255
13256 fi
13257
13258
13259 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
13260 echo "configure:13261: checking if toupper() requires islower()" >&5
13261 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
13262   echo $ac_n "(cached) $ac_c" 1>&6
13263 else
13264   
13265         if test "$cross_compiling" = yes; then
13266   ol_cv_c_upper_lower=safe
13267 else
13268   cat > conftest.$ac_ext <<EOF
13269 #line 13270 "configure"
13270 #include "confdefs.h"
13271
13272 #include <ctype.h>
13273 main()
13274 {
13275         if ('C' == toupper('C'))
13276                 exit(0);
13277         else
13278                 exit(1);
13279 }
13280 EOF
13281 if { (eval echo configure:13282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13282 then
13283   ol_cv_c_upper_lower=no
13284 else
13285   echo "configure: failed program was:" >&5
13286   cat conftest.$ac_ext >&5
13287   rm -fr conftest*
13288   ol_cv_c_upper_lower=yes
13289 fi
13290 rm -fr conftest*
13291 fi
13292
13293 fi
13294
13295 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
13296 if test $ol_cv_c_upper_lower != no ; then
13297         cat >> confdefs.h <<\EOF
13298 #define C_UPPER_LOWER 1
13299 EOF
13300
13301 fi
13302
13303 echo $ac_n "checking for working const""... $ac_c" 1>&6
13304 echo "configure:13305: checking for working const" >&5
13305 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
13306   echo $ac_n "(cached) $ac_c" 1>&6
13307 else
13308   cat > conftest.$ac_ext <<EOF
13309 #line 13310 "configure"
13310 #include "confdefs.h"
13311
13312 int main() {
13313
13314 /* Ultrix mips cc rejects this.  */
13315 typedef int charset[2]; const charset x;
13316 /* SunOS 4.1.1 cc rejects this.  */
13317 char const *const *ccp;
13318 char **p;
13319 /* NEC SVR4.0.2 mips cc rejects this.  */
13320 struct point {int x, y;};
13321 static struct point const zero = {0,0};
13322 /* AIX XL C 1.02.0.0 rejects this.
13323    It does not let you subtract one const X* pointer from another in an arm
13324    of an if-expression whose if-part is not a constant expression */
13325 const char *g = "string";
13326 ccp = &g + (g ? g-g : 0);
13327 /* HPUX 7.0 cc rejects these. */
13328 ++ccp;
13329 p = (char**) ccp;
13330 ccp = (char const *const *) p;
13331 { /* SCO 3.2v4 cc rejects this.  */
13332   char *t;
13333   char const *s = 0 ? (char *) 0 : (char const *) 0;
13334
13335   *t++ = 0;
13336 }
13337 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
13338   int x[] = {25, 17};
13339   const int *foo = &x[0];
13340   ++foo;
13341 }
13342 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
13343   typedef const int *iptr;
13344   iptr p = 0;
13345   ++p;
13346 }
13347 { /* AIX XL C 1.02.0.0 rejects this saying
13348      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
13349   struct s { int j; const int *ap[3]; };
13350   struct s *b; b->j = 5;
13351 }
13352 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
13353   const int foo = 10;
13354 }
13355
13356 ; return 0; }
13357 EOF
13358 if { (eval echo configure:13359: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13359   rm -rf conftest*
13360   ac_cv_c_const=yes
13361 else
13362   echo "configure: failed program was:" >&5
13363   cat conftest.$ac_ext >&5
13364   rm -rf conftest*
13365   ac_cv_c_const=no
13366 fi
13367 rm -f conftest*
13368 fi
13369
13370 echo "$ac_t""$ac_cv_c_const" 1>&6
13371 if test $ac_cv_c_const = no; then
13372   cat >> confdefs.h <<\EOF
13373 #define const 
13374 EOF
13375
13376 fi
13377
13378 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
13379 echo "configure:13380: checking if compiler understands volatile" >&5
13380 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
13381   echo $ac_n "(cached) $ac_c" 1>&6
13382 else
13383   cat > conftest.$ac_ext <<EOF
13384 #line 13385 "configure"
13385 #include "confdefs.h"
13386 int x, y, z;
13387 int main() {
13388 volatile int a; int * volatile b = x ? &y : &z;
13389       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
13390       *b = 0;
13391 ; return 0; }
13392 EOF
13393 if { (eval echo configure:13394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13394   rm -rf conftest*
13395   ol_cv_c_volatile=yes
13396 else
13397   echo "configure: failed program was:" >&5
13398   cat conftest.$ac_ext >&5
13399   rm -rf conftest*
13400   ol_cv_c_volatile=no
13401 fi
13402 rm -f conftest*
13403 fi
13404
13405 echo "$ac_t""$ol_cv_c_volatile" 1>&6
13406   if test $ol_cv_c_volatile = yes; then
13407     : 
13408   else
13409     cat >> confdefs.h <<\EOF
13410 #define volatile 
13411 EOF
13412
13413   fi
13414  
13415
13416 if test $cross_compiling = yes ; then
13417         cat >> confdefs.h <<\EOF
13418 #define CROSS_COMPILING 1
13419 EOF
13420
13421
13422         cat >> confdefs.h <<\EOF
13423 #define LBER_INT_T long
13424 EOF
13425
13426         cat >> confdefs.h <<\EOF
13427 #define LBER_TAG_T long
13428 EOF
13429
13430         cat >> confdefs.h <<\EOF
13431 #define LBER_SOCKET_T int
13432 EOF
13433
13434
13435 else
13436         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
13437 echo "configure:13438: checking whether byte ordering is bigendian" >&5
13438 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
13439   echo $ac_n "(cached) $ac_c" 1>&6
13440 else
13441   ac_cv_c_bigendian=unknown
13442 # See if sys/param.h defines the BYTE_ORDER macro.
13443 cat > conftest.$ac_ext <<EOF
13444 #line 13445 "configure"
13445 #include "confdefs.h"
13446 #include <sys/types.h>
13447 #include <sys/param.h>
13448 int main() {
13449
13450 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
13451  bogus endian macros
13452 #endif
13453 ; return 0; }
13454 EOF
13455 if { (eval echo configure:13456: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13456   rm -rf conftest*
13457   # It does; now see whether it defined to BIG_ENDIAN or not.
13458 cat > conftest.$ac_ext <<EOF
13459 #line 13460 "configure"
13460 #include "confdefs.h"
13461 #include <sys/types.h>
13462 #include <sys/param.h>
13463 int main() {
13464
13465 #if BYTE_ORDER != BIG_ENDIAN
13466  not big endian
13467 #endif
13468 ; return 0; }
13469 EOF
13470 if { (eval echo configure:13471: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13471   rm -rf conftest*
13472   ac_cv_c_bigendian=yes
13473 else
13474   echo "configure: failed program was:" >&5
13475   cat conftest.$ac_ext >&5
13476   rm -rf conftest*
13477   ac_cv_c_bigendian=no
13478 fi
13479 rm -f conftest*
13480 else
13481   echo "configure: failed program was:" >&5
13482   cat conftest.$ac_ext >&5
13483 fi
13484 rm -f conftest*
13485 if test $ac_cv_c_bigendian = unknown; then
13486 if test "$cross_compiling" = yes; then
13487     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
13488 else
13489   cat > conftest.$ac_ext <<EOF
13490 #line 13491 "configure"
13491 #include "confdefs.h"
13492 main () {
13493   /* Are we little or big endian?  From Harbison&Steele.  */
13494   union
13495   {
13496     long l;
13497     char c[sizeof (long)];
13498   } u;
13499   u.l = 1;
13500   exit (u.c[sizeof (long) - 1] == 1);
13501 }
13502 EOF
13503 if { (eval echo configure:13504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13504 then
13505   ac_cv_c_bigendian=no
13506 else
13507   echo "configure: failed program was:" >&5
13508   cat conftest.$ac_ext >&5
13509   rm -fr conftest*
13510   ac_cv_c_bigendian=yes
13511 fi
13512 rm -fr conftest*
13513 fi
13514
13515 fi
13516 fi
13517
13518 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
13519 if test $ac_cv_c_bigendian = yes; then
13520   cat >> confdefs.h <<\EOF
13521 #define WORDS_BIGENDIAN 1
13522 EOF
13523
13524 fi
13525
13526         echo $ac_n "checking size of short""... $ac_c" 1>&6
13527 echo "configure:13528: checking size of short" >&5
13528 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
13529   echo $ac_n "(cached) $ac_c" 1>&6
13530 else
13531   if test "$cross_compiling" = yes; then
13532     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
13533 else
13534   cat > conftest.$ac_ext <<EOF
13535 #line 13536 "configure"
13536 #include "confdefs.h"
13537 #include <stdio.h>
13538 main()
13539 {
13540   FILE *f=fopen("conftestval", "w");
13541   if (!f) exit(1);
13542   fprintf(f, "%d\n", sizeof(short));
13543   exit(0);
13544 }
13545 EOF
13546 if { (eval echo configure:13547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13547 then
13548   ac_cv_sizeof_short=`cat conftestval`
13549 else
13550   echo "configure: failed program was:" >&5
13551   cat conftest.$ac_ext >&5
13552   rm -fr conftest*
13553   ac_cv_sizeof_short=0
13554 fi
13555 rm -fr conftest*
13556 fi
13557
13558 fi
13559 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
13560 cat >> confdefs.h <<EOF
13561 #define SIZEOF_SHORT $ac_cv_sizeof_short
13562 EOF
13563
13564  
13565         echo $ac_n "checking size of int""... $ac_c" 1>&6
13566 echo "configure:13567: checking size of int" >&5
13567 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
13568   echo $ac_n "(cached) $ac_c" 1>&6
13569 else
13570   if test "$cross_compiling" = yes; then
13571     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
13572 else
13573   cat > conftest.$ac_ext <<EOF
13574 #line 13575 "configure"
13575 #include "confdefs.h"
13576 #include <stdio.h>
13577 main()
13578 {
13579   FILE *f=fopen("conftestval", "w");
13580   if (!f) exit(1);
13581   fprintf(f, "%d\n", sizeof(int));
13582   exit(0);
13583 }
13584 EOF
13585 if { (eval echo configure:13586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13586 then
13587   ac_cv_sizeof_int=`cat conftestval`
13588 else
13589   echo "configure: failed program was:" >&5
13590   cat conftest.$ac_ext >&5
13591   rm -fr conftest*
13592   ac_cv_sizeof_int=0
13593 fi
13594 rm -fr conftest*
13595 fi
13596
13597 fi
13598 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
13599 cat >> confdefs.h <<EOF
13600 #define SIZEOF_INT $ac_cv_sizeof_int
13601 EOF
13602
13603  
13604         echo $ac_n "checking size of long""... $ac_c" 1>&6
13605 echo "configure:13606: checking size of long" >&5
13606 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
13607   echo $ac_n "(cached) $ac_c" 1>&6
13608 else
13609   if test "$cross_compiling" = yes; then
13610     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
13611 else
13612   cat > conftest.$ac_ext <<EOF
13613 #line 13614 "configure"
13614 #include "confdefs.h"
13615 #include <stdio.h>
13616 main()
13617 {
13618   FILE *f=fopen("conftestval", "w");
13619   if (!f) exit(1);
13620   fprintf(f, "%d\n", sizeof(long));
13621   exit(0);
13622 }
13623 EOF
13624 if { (eval echo configure:13625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13625 then
13626   ac_cv_sizeof_long=`cat conftestval`
13627 else
13628   echo "configure: failed program was:" >&5
13629   cat conftest.$ac_ext >&5
13630   rm -fr conftest*
13631   ac_cv_sizeof_long=0
13632 fi
13633 rm -fr conftest*
13634 fi
13635
13636 fi
13637 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
13638 cat >> confdefs.h <<EOF
13639 #define SIZEOF_LONG $ac_cv_sizeof_long
13640 EOF
13641
13642
13643
13644         if test "$ac_cv_sizeof_int" -lt 4 ; then
13645                 echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
13646
13647                 cat >> confdefs.h <<\EOF
13648 #define LBER_INT_T long
13649 EOF
13650
13651                 cat >> confdefs.h <<\EOF
13652 #define LBER_TAG_T long
13653 EOF
13654
13655                 cat >> confdefs.h <<\EOF
13656 #define LBER_SOCKET_T int
13657 EOF
13658
13659         else
13660                 cat >> confdefs.h <<\EOF
13661 #define LBER_INT_T int
13662 EOF
13663
13664                 cat >> confdefs.h <<\EOF
13665 #define LBER_TAG_T long
13666 EOF
13667
13668                 cat >> confdefs.h <<\EOF
13669 #define LBER_SOCKET_T int
13670 EOF
13671
13672         fi
13673 fi
13674
13675 cat >> confdefs.h <<\EOF
13676 #define LBER_LEN_T long
13677 EOF
13678
13679
13680 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
13681 echo "configure:13682: checking for 8-bit clean memcmp" >&5
13682 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
13683   echo $ac_n "(cached) $ac_c" 1>&6
13684 else
13685   if test "$cross_compiling" = yes; then
13686   ac_cv_func_memcmp_clean=no
13687 else
13688   cat > conftest.$ac_ext <<EOF
13689 #line 13690 "configure"
13690 #include "confdefs.h"
13691
13692 main()
13693 {
13694   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
13695   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
13696 }
13697
13698 EOF
13699 if { (eval echo configure:13700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13700 then
13701   ac_cv_func_memcmp_clean=yes
13702 else
13703   echo "configure: failed program was:" >&5
13704   cat conftest.$ac_ext >&5
13705   rm -fr conftest*
13706   ac_cv_func_memcmp_clean=no
13707 fi
13708 rm -fr conftest*
13709 fi
13710
13711 fi
13712
13713 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
13714 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
13715
13716 echo $ac_n "checking for strftime""... $ac_c" 1>&6
13717 echo "configure:13718: checking for strftime" >&5
13718 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
13719   echo $ac_n "(cached) $ac_c" 1>&6
13720 else
13721   cat > conftest.$ac_ext <<EOF
13722 #line 13723 "configure"
13723 #include "confdefs.h"
13724 /* System header to define __stub macros and hopefully few prototypes,
13725     which can conflict with char strftime(); below.  */
13726 #include <assert.h>
13727 /* Override any gcc2 internal prototype to avoid an error.  */
13728 /* We use char because int might match the return type of a gcc2
13729     builtin and then its argument prototype would still apply.  */
13730 char strftime();
13731 char (*f)();
13732
13733 int main() {
13734
13735 /* The GNU C library defines this for functions which it implements
13736     to always fail with ENOSYS.  Some functions are actually named
13737     something starting with __ and the normal name is an alias.  */
13738 #if defined (__stub_strftime) || defined (__stub___strftime)
13739 choke me
13740 #else
13741 f = strftime;
13742 #endif
13743
13744 ; return 0; }
13745 EOF
13746 if { (eval echo configure:13747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13747   rm -rf conftest*
13748   eval "ac_cv_func_strftime=yes"
13749 else
13750   echo "configure: failed program was:" >&5
13751   cat conftest.$ac_ext >&5
13752   rm -rf conftest*
13753   eval "ac_cv_func_strftime=no"
13754 fi
13755 rm -f conftest*
13756 fi
13757
13758 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
13759   echo "$ac_t""yes" 1>&6
13760   cat >> confdefs.h <<\EOF
13761 #define HAVE_STRFTIME 1
13762 EOF
13763
13764 else
13765   echo "$ac_t""no" 1>&6
13766 # strftime is in -lintl on SCO UNIX.
13767 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
13768 echo "configure:13769: checking for strftime in -lintl" >&5
13769 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
13770 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13771   echo $ac_n "(cached) $ac_c" 1>&6
13772 else
13773   ac_save_LIBS="$LIBS"
13774 LIBS="-lintl  $LIBS"
13775 cat > conftest.$ac_ext <<EOF
13776 #line 13777 "configure"
13777 #include "confdefs.h"
13778 /* Override any gcc2 internal prototype to avoid an error.  */
13779 /* We use char because int might match the return type of a gcc2
13780     builtin and then its argument prototype would still apply.  */
13781 char strftime();
13782
13783 int main() {
13784 strftime()
13785 ; return 0; }
13786 EOF
13787 if { (eval echo configure:13788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13788   rm -rf conftest*
13789   eval "ac_cv_lib_$ac_lib_var=yes"
13790 else
13791   echo "configure: failed program was:" >&5
13792   cat conftest.$ac_ext >&5
13793   rm -rf conftest*
13794   eval "ac_cv_lib_$ac_lib_var=no"
13795 fi
13796 rm -f conftest*
13797 LIBS="$ac_save_LIBS"
13798
13799 fi
13800 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13801   echo "$ac_t""yes" 1>&6
13802   cat >> confdefs.h <<\EOF
13803 #define HAVE_STRFTIME 1
13804 EOF
13805
13806 LIBS="-lintl $LIBS"
13807 else
13808   echo "$ac_t""no" 1>&6
13809 fi
13810
13811 fi
13812
13813
13814 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
13815 echo "configure:13816: checking for inet_aton()" >&5
13816 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
13817   echo $ac_n "(cached) $ac_c" 1>&6
13818 else
13819   cat > conftest.$ac_ext <<EOF
13820 #line 13821 "configure"
13821 #include "confdefs.h"
13822
13823 #ifdef HAVE_SYS_TYPES_H
13824 #       include <sys/types.h>
13825 #endif
13826 #ifdef HAVE_SYS_SOCKET_H
13827 #       include <sys/socket.h>
13828 #       ifdef HAVE_SYS_SELECT_H
13829 #               include <sys/select.h>
13830 #       endif
13831 #       include <netinet/in.h>
13832 #       ifdef HAVE_ARPA_INET_H
13833 #               include <arpa/inet.h>
13834 #       endif
13835 #endif
13836
13837 int main() {
13838 struct in_addr in;
13839 int rc = inet_aton( "255.255.255.255", &in );
13840 ; return 0; }
13841 EOF
13842 if { (eval echo configure:13843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13843   rm -rf conftest*
13844   ol_cv_func_inet_aton=yes
13845 else
13846   echo "configure: failed program was:" >&5
13847   cat conftest.$ac_ext >&5
13848   rm -rf conftest*
13849   ol_cv_func_inet_aton=no
13850 fi
13851 rm -f conftest*
13852 fi
13853
13854 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
13855   if test $ol_cv_func_inet_aton != no; then
13856     cat >> confdefs.h <<\EOF
13857 #define HAVE_INET_ATON 1
13858 EOF
13859
13860   fi
13861  
13862
13863 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
13864 echo "configure:13865: checking for vprintf" >&5
13865 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
13866   echo $ac_n "(cached) $ac_c" 1>&6
13867 else
13868   cat > conftest.$ac_ext <<EOF
13869 #line 13870 "configure"
13870 #include "confdefs.h"
13871 /* System header to define __stub macros and hopefully few prototypes,
13872     which can conflict with char vprintf(); below.  */
13873 #include <assert.h>
13874 /* Override any gcc2 internal prototype to avoid an error.  */
13875 /* We use char because int might match the return type of a gcc2
13876     builtin and then its argument prototype would still apply.  */
13877 char vprintf();
13878 char (*f)();
13879
13880 int main() {
13881
13882 /* The GNU C library defines this for functions which it implements
13883     to always fail with ENOSYS.  Some functions are actually named
13884     something starting with __ and the normal name is an alias.  */
13885 #if defined (__stub_vprintf) || defined (__stub___vprintf)
13886 choke me
13887 #else
13888 f = vprintf;
13889 #endif
13890
13891 ; return 0; }
13892 EOF
13893 if { (eval echo configure:13894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13894   rm -rf conftest*
13895   eval "ac_cv_func_vprintf=yes"
13896 else
13897   echo "configure: failed program was:" >&5
13898   cat conftest.$ac_ext >&5
13899   rm -rf conftest*
13900   eval "ac_cv_func_vprintf=no"
13901 fi
13902 rm -f conftest*
13903 fi
13904
13905 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
13906   echo "$ac_t""yes" 1>&6
13907   cat >> confdefs.h <<\EOF
13908 #define HAVE_VPRINTF 1
13909 EOF
13910
13911 else
13912   echo "$ac_t""no" 1>&6
13913 fi
13914
13915 if test "$ac_cv_func_vprintf" != yes; then
13916 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
13917 echo "configure:13918: checking for _doprnt" >&5
13918 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
13919   echo $ac_n "(cached) $ac_c" 1>&6
13920 else
13921   cat > conftest.$ac_ext <<EOF
13922 #line 13923 "configure"
13923 #include "confdefs.h"
13924 /* System header to define __stub macros and hopefully few prototypes,
13925     which can conflict with char _doprnt(); below.  */
13926 #include <assert.h>
13927 /* Override any gcc2 internal prototype to avoid an error.  */
13928 /* We use char because int might match the return type of a gcc2
13929     builtin and then its argument prototype would still apply.  */
13930 char _doprnt();
13931 char (*f)();
13932
13933 int main() {
13934
13935 /* The GNU C library defines this for functions which it implements
13936     to always fail with ENOSYS.  Some functions are actually named
13937     something starting with __ and the normal name is an alias.  */
13938 #if defined (__stub__doprnt) || defined (__stub____doprnt)
13939 choke me
13940 #else
13941 f = _doprnt;
13942 #endif
13943
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   eval "ac_cv_func__doprnt=yes"
13949 else
13950   echo "configure: failed program was:" >&5
13951   cat conftest.$ac_ext >&5
13952   rm -rf conftest*
13953   eval "ac_cv_func__doprnt=no"
13954 fi
13955 rm -f conftest*
13956 fi
13957
13958 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
13959   echo "$ac_t""yes" 1>&6
13960   cat >> confdefs.h <<\EOF
13961 #define HAVE_DOPRNT 1
13962 EOF
13963
13964 else
13965   echo "$ac_t""no" 1>&6
13966 fi
13967
13968 fi
13969
13970
13971 if test $ac_cv_func_vprintf = yes ; then
13972                 for ac_func in vsnprintf vsprintf
13973 do
13974 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
13975 echo "configure:13976: checking for $ac_func" >&5
13976 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
13977   echo $ac_n "(cached) $ac_c" 1>&6
13978 else
13979   cat > conftest.$ac_ext <<EOF
13980 #line 13981 "configure"
13981 #include "confdefs.h"
13982 /* System header to define __stub macros and hopefully few prototypes,
13983     which can conflict with char $ac_func(); below.  */
13984 #include <assert.h>
13985 /* Override any gcc2 internal prototype to avoid an error.  */
13986 /* We use char because int might match the return type of a gcc2
13987     builtin and then its argument prototype would still apply.  */
13988 char $ac_func();
13989 char (*f)();
13990
13991 int main() {
13992
13993 /* The GNU C library defines this for functions which it implements
13994     to always fail with ENOSYS.  Some functions are actually named
13995     something starting with __ and the normal name is an alias.  */
13996 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13997 choke me
13998 #else
13999 f = $ac_func;
14000 #endif
14001
14002 ; return 0; }
14003 EOF
14004 if { (eval echo configure:14005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14005   rm -rf conftest*
14006   eval "ac_cv_func_$ac_func=yes"
14007 else
14008   echo "configure: failed program was:" >&5
14009   cat conftest.$ac_ext >&5
14010   rm -rf conftest*
14011   eval "ac_cv_func_$ac_func=no"
14012 fi
14013 rm -f conftest*
14014 fi
14015
14016 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14017   echo "$ac_t""yes" 1>&6
14018     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14019   cat >> confdefs.h <<EOF
14020 #define $ac_tr_func 1
14021 EOF
14022  
14023 else
14024   echo "$ac_t""no" 1>&6
14025 fi
14026 done
14027
14028 fi
14029
14030 for ac_func in \
14031         bcopy                   \
14032         closesocket             \
14033         endgrent                \
14034         endpwent                \
14035         flock                   \
14036         getdtablesize   \
14037         getgrgid                \
14038         gethostname             \
14039         getpass                 \
14040         getpwuid                \
14041         getpwnam                \
14042         getspnam                \
14043         gettimeofday    \
14044         initgroups              \
14045         lockf                   \
14046         memcpy                  \
14047         memmove                 \
14048         mkstemp                 \
14049         pipe                    \
14050         read                    \
14051         recv                    \
14052         recvfrom                \
14053         setpwfile               \
14054         setgid                  \
14055         setegid                 \
14056         setsid                  \
14057         setuid                  \
14058         seteuid                 \
14059         sigaction               \
14060         signal                  \
14061         sigset                  \
14062         snprintf                \
14063         strdup                  \
14064         strerror                \
14065         strpbrk                 \
14066         strrchr                 \
14067         strsep                  \
14068         strstr                  \
14069         strtol                  \
14070         strtoul                 \
14071         strspn                  \
14072         sysconf                 \
14073         waitpid                 \
14074         wait4                   \
14075         write                   \
14076         send                    \
14077         sendto                  \
14078
14079 do
14080 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14081 echo "configure:14082: checking for $ac_func" >&5
14082 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14083   echo $ac_n "(cached) $ac_c" 1>&6
14084 else
14085   cat > conftest.$ac_ext <<EOF
14086 #line 14087 "configure"
14087 #include "confdefs.h"
14088 /* System header to define __stub macros and hopefully few prototypes,
14089     which can conflict with char $ac_func(); below.  */
14090 #include <assert.h>
14091 /* Override any gcc2 internal prototype to avoid an error.  */
14092 /* We use char because int might match the return type of a gcc2
14093     builtin and then its argument prototype would still apply.  */
14094 char $ac_func();
14095 char (*f)();
14096
14097 int main() {
14098
14099 /* The GNU C library defines this for functions which it implements
14100     to always fail with ENOSYS.  Some functions are actually named
14101     something starting with __ and the normal name is an alias.  */
14102 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14103 choke me
14104 #else
14105 f = $ac_func;
14106 #endif
14107
14108 ; return 0; }
14109 EOF
14110 if { (eval echo configure:14111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14111   rm -rf conftest*
14112   eval "ac_cv_func_$ac_func=yes"
14113 else
14114   echo "configure: failed program was:" >&5
14115   cat conftest.$ac_ext >&5
14116   rm -rf conftest*
14117   eval "ac_cv_func_$ac_func=no"
14118 fi
14119 rm -f conftest*
14120 fi
14121
14122 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14123   echo "$ac_t""yes" 1>&6
14124     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14125   cat >> confdefs.h <<EOF
14126 #define $ac_tr_func 1
14127 EOF
14128  
14129 else
14130   echo "$ac_t""no" 1>&6
14131 fi
14132 done
14133
14134
14135 for ac_func in getopt tempnam
14136 do
14137 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14138 echo "configure:14139: checking for $ac_func" >&5
14139 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
14140   echo $ac_n "(cached) $ac_c" 1>&6
14141 else
14142   cat > conftest.$ac_ext <<EOF
14143 #line 14144 "configure"
14144 #include "confdefs.h"
14145 /* System header to define __stub macros and hopefully few prototypes,
14146     which can conflict with char $ac_func(); below.  */
14147 #include <assert.h>
14148 /* Override any gcc2 internal prototype to avoid an error.  */
14149 /* We use char because int might match the return type of a gcc2
14150     builtin and then its argument prototype would still apply.  */
14151 char $ac_func();
14152 char (*f)();
14153
14154 int main() {
14155
14156 /* The GNU C library defines this for functions which it implements
14157     to always fail with ENOSYS.  Some functions are actually named
14158     something starting with __ and the normal name is an alias.  */
14159 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14160 choke me
14161 #else
14162 f = $ac_func;
14163 #endif
14164
14165 ; return 0; }
14166 EOF
14167 if { (eval echo configure:14168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14168   rm -rf conftest*
14169   eval "ac_cv_func_$ac_func=yes"
14170 else
14171   echo "configure: failed program was:" >&5
14172   cat conftest.$ac_ext >&5
14173   rm -rf conftest*
14174   eval "ac_cv_func_$ac_func=no"
14175 fi
14176 rm -f conftest*
14177 fi
14178
14179 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14180   echo "$ac_t""yes" 1>&6
14181     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14182   cat >> confdefs.h <<EOF
14183 #define $ac_tr_func 1
14184 EOF
14185  
14186 else
14187   echo "$ac_t""no" 1>&6
14188 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
14189 fi
14190 done
14191
14192
14193
14194 # Check Configuration
14195 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
14196 echo "configure:14197: checking declaration of sys_errlist" >&5
14197 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
14198   echo $ac_n "(cached) $ac_c" 1>&6
14199 else
14200   
14201         cat > conftest.$ac_ext <<EOF
14202 #line 14203 "configure"
14203 #include "confdefs.h"
14204
14205 #include <stdio.h>
14206 #include <sys/types.h>
14207 #include <errno.h> 
14208 int main() {
14209 char *c = (char *) *sys_errlist
14210 ; return 0; }
14211 EOF
14212 if { (eval echo configure:14213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14213   rm -rf conftest*
14214   ol_cv_dcl_sys_errlist=yes
14215         ol_cv_have_sys_errlist=yes
14216 else
14217   echo "configure: failed program was:" >&5
14218   cat conftest.$ac_ext >&5
14219   rm -rf conftest*
14220   ol_cv_dcl_sys_errlist=no
14221 fi
14222 rm -f conftest*
14223 fi
14224
14225 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
14226 #
14227 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
14228 if test $ol_cv_dcl_sys_errlist = no ; then
14229         cat >> confdefs.h <<\EOF
14230 #define DECL_SYS_ERRLIST 1
14231 EOF
14232
14233
14234         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
14235 echo "configure:14236: checking existence of sys_errlist" >&5
14236 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
14237   echo $ac_n "(cached) $ac_c" 1>&6
14238 else
14239   
14240                 cat > conftest.$ac_ext <<EOF
14241 #line 14242 "configure"
14242 #include "confdefs.h"
14243 #include <errno.h>
14244 int main() {
14245 char *c = (char *) *sys_errlist
14246 ; return 0; }
14247 EOF
14248 if { (eval echo configure:14249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14249   rm -rf conftest*
14250   ol_cv_have_sys_errlist=yes
14251 else
14252   echo "configure: failed program was:" >&5
14253   cat conftest.$ac_ext >&5
14254   rm -rf conftest*
14255   ol_cv_have_sys_errlist=no
14256 fi
14257 rm -f conftest*
14258 fi
14259
14260 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
14261 fi
14262 if test $ol_cv_have_sys_errlist = yes ; then
14263         cat >> confdefs.h <<\EOF
14264 #define HAVE_SYS_ERRLIST 1
14265 EOF
14266
14267 fi
14268
14269
14270
14271 if test "$ol_enable_debug" != no ; then
14272         cat >> confdefs.h <<\EOF
14273 #define LDAP_DEBUG 1
14274 EOF
14275
14276 fi
14277 if test "$ol_enable_syslog" = yes ; then
14278         cat >> confdefs.h <<\EOF
14279 #define LDAP_SYSLOG 1
14280 EOF
14281
14282 fi
14283 if test "$ol_enable_libui" = yes ; then
14284         cat >> confdefs.h <<\EOF
14285 #define LDAP_LIBUI 1
14286 EOF
14287
14288 fi
14289 if test "$ol_enable_cache" = no ; then
14290         cat >> confdefs.h <<\EOF
14291 #define LDAP_NOCACHE 1
14292 EOF
14293
14294 fi
14295 if test "$ol_enable_dns" != no ; then
14296         cat >> confdefs.h <<\EOF
14297 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS LDAP_VENDOR_VERSION
14298 EOF
14299
14300 fi
14301 if test "$ol_enable_proctitle" != no ; then
14302         cat >> confdefs.h <<\EOF
14303 #define LDAP_PROCTITLE 1
14304 EOF
14305
14306 fi
14307 if test "$ol_enable_referrals" != no ; then
14308         cat >> confdefs.h <<\EOF
14309 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
14310 EOF
14311
14312 fi
14313 if test "$ol_enable_cldap" != no ; then
14314         cat >> confdefs.h <<\EOF
14315 #define LDAP_CONNECTIONLESS 1
14316 EOF
14317
14318 fi
14319
14320 if test "$ol_enable_crypt" != no ; then
14321         cat >> confdefs.h <<\EOF
14322 #define SLAPD_CRYPT 1
14323 EOF
14324
14325 fi
14326 if test "$ol_enable_cleartext" != no ; then
14327         cat >> confdefs.h <<\EOF
14328 #define SLAPD_CLEARTEXT 1
14329 EOF
14330
14331 fi
14332 if test "$ol_enable_multimaster" != no ; then
14333         cat >> confdefs.h <<\EOF
14334 #define SLAPD_MULTIMASTER 1
14335 EOF
14336
14337 fi
14338 if test "$ol_enable_phonetic" != no ; then
14339         cat >> confdefs.h <<\EOF
14340 #define SLAPD_PHONETIC 1
14341 EOF
14342
14343 fi
14344 if test "$ol_enable_rlookups" != no ; then
14345         cat >> confdefs.h <<\EOF
14346 #define SLAPD_RLOOKUPS 1
14347 EOF
14348
14349 fi
14350 if test "$ol_enable_aci" != no ; then
14351         cat >> confdefs.h <<\EOF
14352 #define SLAPD_ACI_ENABLED 1
14353 EOF
14354
14355 fi
14356 if test "$ol_enable_discreteaci" != no ; then
14357         cat >> confdefs.h <<\EOF
14358 #define SLAPD_ACI_DISCRETE_RIGHTS 1
14359 EOF
14360
14361 fi
14362
14363 if test "$ol_link_modules" != no ; then
14364         cat >> confdefs.h <<\EOF
14365 #define SLAPD_MODULES 1
14366 EOF
14367
14368         BUILD_SLAPD=yes
14369         MODULES_LIBS=-lltdl
14370         SLAPD_MODULES_LDFLAGS="-dlopen self"
14371 fi
14372
14373 if test "$ol_link_bdb2" != no ; then
14374         cat >> confdefs.h <<\EOF
14375 #define SLAPD_BDB2 1
14376 EOF
14377
14378         BUILD_SLAPD=yes
14379         BUILD_BDB2=yes
14380         if test "$ol_with_bdb2_module" != static ; then
14381                 cat >> confdefs.h <<\EOF
14382 #define SLAPD_BDB2_DYNAMIC 1
14383 EOF
14384
14385                 BUILD_BDB2=mod
14386                 BUILD_BDB2_DYNAMIC=shared
14387                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-bdb2/back_bdb2.la"
14388         fi
14389 fi
14390
14391 if test "$ol_enable_ldap" != no ; then
14392         cat >> confdefs.h <<\EOF
14393 #define SLAPD_LDAP 1
14394 EOF
14395
14396         BUILD_SLAPD=yes
14397         BUILD_LDAP=yes
14398         if test "$ol_with_ldap_module" != static ; then
14399                 cat >> confdefs.h <<\EOF
14400 #define SLAPD_LDAP_DYNAMIC 1
14401 EOF
14402
14403                 BUILD_LDAP=mod
14404                 BUILD_LDAP_DYNAMIC=shared
14405                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
14406         fi
14407 fi
14408
14409 if test "$ol_link_ldbm" != no ; then
14410         cat >> confdefs.h <<\EOF
14411 #define SLAPD_LDBM 1
14412 EOF
14413
14414         BUILD_SLAPD=yes
14415         BUILD_LDBM=yes
14416         if test "$ol_with_ldbm_module" != static ; then
14417                 cat >> confdefs.h <<\EOF
14418 #define SLAPD_LDBM_DYNAMIC 1
14419 EOF
14420
14421                 BUILD_LDBM=mod
14422                 BUILD_LDBM_DYNAMIC=shared
14423                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
14424         fi
14425 fi
14426
14427 if test "$ol_enable_passwd" != no ; then
14428         cat >> confdefs.h <<\EOF
14429 #define SLAPD_PASSWD 1
14430 EOF
14431
14432         BUILD_SLAPD=yes
14433         BUILD_PASSWD=yes
14434         if test "$ol_with_passwd_module" != static ; then
14435                 cat >> confdefs.h <<\EOF
14436 #define SLAPD_PASSWD_DYNAMIC 1
14437 EOF
14438
14439                 BUILD_PASSWD=mod
14440                 BUILD_PASSWD_DYNAMIC=shared
14441                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
14442         fi
14443 fi
14444
14445 if test "$ol_link_perl" != no ; then
14446         cat >> confdefs.h <<\EOF
14447 #define SLAPD_PERL 1
14448 EOF
14449
14450         BUILD_SLAPD=yes
14451         BUILD_PERL=yes
14452         if test "$ol_with_perl_module" != static ; then
14453                 cat >> confdefs.h <<\EOF
14454 #define SLAPD_PERL_DYNAMIC 1
14455 EOF
14456
14457                 BUILD_PERL=mod
14458                 BUILD_PERL_DYNAMIC=shared
14459                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-perl/back_perl.la"
14460         fi
14461 fi
14462
14463 if test "$ol_enable_shell" != no ; then
14464         cat >> confdefs.h <<\EOF
14465 #define SLAPD_SHELL 1
14466 EOF
14467
14468         BUILD_SLAPD=yes
14469         BUILD_SHELL=yes
14470         if test "$ol_with_shell_module" != static ; then
14471                 cat >> confdefs.h <<\EOF
14472 #define SLAPD_SHELL_DYNAMIC 1
14473 EOF
14474
14475                 BUILD_SHELL=mod
14476                 BUILD_SHELL_DYNAMIC=shared
14477                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
14478         fi
14479 fi
14480
14481 if test "$ol_enable_tcl" != no ; then
14482         cat >> confdefs.h <<\EOF
14483 #define SLAPD_TCL 1
14484 EOF
14485
14486         BUILD_SLAPD=yes
14487         BUILD_TCL=yes
14488         if test "$ol_with_tcl_module" != static; then
14489                 cat >> confdefs.h <<\EOF
14490 #define SLAPD_TCL_DYNAMIC 1
14491 EOF
14492
14493                 BUILD_TCL=mod
14494                 BUILD_TCL_DYNAMIC=shared
14495                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-tcl/back_tcl.la"
14496         fi
14497 fi
14498
14499 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
14500         $BUILD_SLAPD = yes ; then
14501         BUILD_SLURPD=yes
14502 fi
14503
14504 if test "$ol_link_isode" != no ; then
14505         BUILD_LDAPD=yes
14506 fi
14507
14508
14509
14510
14511   
14512   
14513   
14514   
14515   
14516   
14517   
14518   
14519   
14520   
14521   
14522   
14523   
14524   
14525   
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552 trap '' 1 2 15
14553
14554 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
14555
14556 test "x$prefix" = xNONE && prefix=$ac_default_prefix
14557 # Let make expand exec_prefix.
14558 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
14559
14560 # Any assignment to VPATH causes Sun make to only execute
14561 # the first set of double-colon rules, so remove it if not needed.
14562 # If there is a colon in the path, we need to keep it.
14563 if test "x$srcdir" = x.; then
14564   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
14565 fi
14566
14567 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
14568
14569 DEFS=-DHAVE_CONFIG_H
14570
14571 # Without the "./", some shells look in PATH for config.status.
14572 : ${CONFIG_STATUS=./config.status}
14573
14574 echo creating $CONFIG_STATUS
14575 rm -f $CONFIG_STATUS
14576 cat > $CONFIG_STATUS <<EOF
14577 #! /bin/sh
14578 # Generated automatically by configure.
14579 # Run this file to recreate the current configuration.
14580 # This directory was configured as follows,
14581 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
14582 #
14583 # $0 $ac_configure_args
14584 #
14585 # Compiler output produced by configure, useful for debugging
14586 # configure, is in ./config.log if it exists.
14587
14588 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
14589 for ac_option
14590 do
14591   case "\$ac_option" in
14592   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
14593     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
14594     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
14595   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
14596     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
14597     exit 0 ;;
14598   -help | --help | --hel | --he | --h)
14599     echo "\$ac_cs_usage"; exit 0 ;;
14600   *) echo "\$ac_cs_usage"; exit 1 ;;
14601   esac
14602 done
14603
14604 ac_given_srcdir=$srcdir
14605 ac_given_INSTALL="$INSTALL"
14606
14607 trap 'rm -fr `echo "\
14608 Makefile:build/top.mk:Makefile.in:build/dir.mk \
14609 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
14610 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
14611 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
14612 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
14613 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
14614 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
14615 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
14616 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
14617 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
14618 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
14619 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
14620 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
14621 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
14622 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
14623 include/Makefile:build/top.mk:include/Makefile.in \
14624 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
14625 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
14626 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
14627 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
14628 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
14629 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
14630 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
14631 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
14632 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
14633 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
14634 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
14635 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/mod.mk \
14636 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
14637 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
14638 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
14639 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
14640 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
14641 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
14642 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
14643 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
14644 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
14645 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
14646 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
14647 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
14648 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
14649 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
14650  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
14651 EOF
14652 cat >> $CONFIG_STATUS <<EOF
14653
14654 # Protect against being on the right side of a sed subst in config.status.
14655 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
14656  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
14657 $ac_vpsub
14658 $extrasub
14659 s%@SHELL@%$SHELL%g
14660 s%@CFLAGS@%$CFLAGS%g
14661 s%@CPPFLAGS@%$CPPFLAGS%g
14662 s%@CXXFLAGS@%$CXXFLAGS%g
14663 s%@FFLAGS@%$FFLAGS%g
14664 s%@DEFS@%$DEFS%g
14665 s%@LDFLAGS@%$LDFLAGS%g
14666 s%@LIBS@%$LIBS%g
14667 s%@exec_prefix@%$exec_prefix%g
14668 s%@prefix@%$prefix%g
14669 s%@program_transform_name@%$program_transform_name%g
14670 s%@bindir@%$bindir%g
14671 s%@sbindir@%$sbindir%g
14672 s%@libexecdir@%$libexecdir%g
14673 s%@datadir@%$datadir%g
14674 s%@sysconfdir@%$sysconfdir%g
14675 s%@sharedstatedir@%$sharedstatedir%g
14676 s%@localstatedir@%$localstatedir%g
14677 s%@libdir@%$libdir%g
14678 s%@includedir@%$includedir%g
14679 s%@oldincludedir@%$oldincludedir%g
14680 s%@infodir@%$infodir%g
14681 s%@mandir@%$mandir%g
14682 s%@host@%$host%g
14683 s%@host_alias@%$host_alias%g
14684 s%@host_cpu@%$host_cpu%g
14685 s%@host_vendor@%$host_vendor%g
14686 s%@host_os@%$host_os%g
14687 s%@target@%$target%g
14688 s%@target_alias@%$target_alias%g
14689 s%@target_cpu@%$target_cpu%g
14690 s%@target_vendor@%$target_vendor%g
14691 s%@target_os@%$target_os%g
14692 s%@build@%$build%g
14693 s%@build_alias@%$build_alias%g
14694 s%@build_cpu@%$build_cpu%g
14695 s%@build_vendor@%$build_vendor%g
14696 s%@build_os@%$build_os%g
14697 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
14698 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
14699 s%@INSTALL_DATA@%$INSTALL_DATA%g
14700 s%@PACKAGE@%$PACKAGE%g
14701 s%@VERSION@%$VERSION%g
14702 s%@ACLOCAL@%$ACLOCAL%g
14703 s%@AUTOCONF@%$AUTOCONF%g
14704 s%@AUTOMAKE@%$AUTOMAKE%g
14705 s%@AUTOHEADER@%$AUTOHEADER%g
14706 s%@MAKEINFO@%$MAKEINFO%g
14707 s%@install_sh@%$install_sh%g
14708 s%@AMTAR@%$AMTAR%g
14709 s%@AWK@%$AWK%g
14710 s%@AMTARFLAGS@%$AMTARFLAGS%g
14711 s%@SET_MAKE@%$SET_MAKE%g
14712 s%@top_builddir@%$top_builddir%g
14713 s%@ldap_subdir@%$ldap_subdir%g
14714 s%@CC@%$CC%g
14715 s%@RANLIB@%$RANLIB%g
14716 s%@LD@%$LD%g
14717 s%@NM@%$NM%g
14718 s%@LN_S@%$LN_S%g
14719 s%@LIBTOOL@%$LIBTOOL%g
14720 s%@LN_H@%$LN_H%g
14721 s%@SENDMAIL@%$SENDMAIL%g
14722 s%@EDITOR@%$EDITOR%g
14723 s%@FINGER@%$FINGER%g
14724 s%@PERLBIN@%$PERLBIN%g
14725 s%@CPP@%$CPP%g
14726 s%@EXEEXT@%$EXEEXT%g
14727 s%@OBJEXT@%$OBJEXT%g
14728 s%@OL_MKDEP@%$OL_MKDEP%g
14729 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
14730 s%@PEPSY@%$PEPSY%g
14731 s%@LIBOBJS@%$LIBOBJS%g
14732 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
14733 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
14734 s%@BUILD_BDB2@%$BUILD_BDB2%g
14735 s%@BUILD_LDAP@%$BUILD_LDAP%g
14736 s%@BUILD_LDBM@%$BUILD_LDBM%g
14737 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
14738 s%@BUILD_PERL@%$BUILD_PERL%g
14739 s%@BUILD_QUIPU@%$BUILD_QUIPU%g
14740 s%@BUILD_SHELL@%$BUILD_SHELL%g
14741 s%@BUILD_TCL@%$BUILD_TCL%g
14742 s%@BUILD_BDB2_DYNAMIC@%$BUILD_BDB2_DYNAMIC%g
14743 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
14744 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
14745 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
14746 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
14747 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
14748 s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
14749 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
14750 s%@LDAP_LIBS@%$LDAP_LIBS%g
14751 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
14752 s%@LDIF_LIBS@%$LDIF_LIBS%g
14753 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
14754 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
14755 s%@LDBM_LIBS@%$LDBM_LIBS%g
14756 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
14757 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
14758 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
14759 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
14760 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
14761 s%@SLAPD_PERL_CPPFLAGS@%$SLAPD_PERL_CPPFLAGS%g
14762 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
14763 s%@KRB_LIBS@%$KRB_LIBS%g
14764 s%@READLINE_LIBS@%$READLINE_LIBS%g
14765 s%@SASL_LIBS@%$SASL_LIBS%g
14766 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
14767 s%@TLS_LIBS@%$TLS_LIBS%g
14768 s%@MODULES_LIBS@%$MODULES_LIBS%g
14769
14770 CEOF
14771 EOF
14772
14773 cat >> $CONFIG_STATUS <<\EOF
14774
14775 # Split the substitutions into bite-sized pieces for seds with
14776 # small command number limits, like on Digital OSF/1 and HP-UX.
14777 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
14778 ac_file=1 # Number of current file.
14779 ac_beg=1 # First line for current file.
14780 ac_end=$ac_max_sed_cmds # Line after last line for current file.
14781 ac_more_lines=:
14782 ac_sed_cmds=""
14783 while $ac_more_lines; do
14784   if test $ac_beg -gt 1; then
14785     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
14786   else
14787     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
14788   fi
14789   if test ! -s conftest.s$ac_file; then
14790     ac_more_lines=false
14791     rm -f conftest.s$ac_file
14792   else
14793     if test -z "$ac_sed_cmds"; then
14794       ac_sed_cmds="sed -f conftest.s$ac_file"
14795     else
14796       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
14797     fi
14798     ac_file=`expr $ac_file + 1`
14799     ac_beg=$ac_end
14800     ac_end=`expr $ac_end + $ac_max_sed_cmds`
14801   fi
14802 done
14803 if test -z "$ac_sed_cmds"; then
14804   ac_sed_cmds=cat
14805 fi
14806 EOF
14807
14808 cat >> $CONFIG_STATUS <<EOF
14809
14810 CONFIG_FILES=\${CONFIG_FILES-"\
14811 Makefile:build/top.mk:Makefile.in:build/dir.mk \
14812 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
14813 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
14814 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
14815 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
14816 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
14817 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
14818 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
14819 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
14820 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
14821 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
14822 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
14823 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
14824 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
14825 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
14826 include/Makefile:build/top.mk:include/Makefile.in \
14827 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
14828 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
14829 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
14830 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
14831 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
14832 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
14833 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
14834 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
14835 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
14836 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
14837 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
14838 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/mod.mk \
14839 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
14840 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
14841 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
14842 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
14843 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
14844 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
14845 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
14846 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
14847 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
14848 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
14849 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
14850 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
14851 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
14852 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
14853 "}
14854 EOF
14855 cat >> $CONFIG_STATUS <<\EOF
14856 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
14857   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
14858   case "$ac_file" in
14859   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
14860        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
14861   *) ac_file_in="${ac_file}.in" ;;
14862   esac
14863
14864   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
14865
14866   # Remove last slash and all that follows it.  Not all systems have dirname.
14867   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
14868   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
14869     # The file is in a subdirectory.
14870     test ! -d "$ac_dir" && mkdir "$ac_dir"
14871     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
14872     # A "../" for each directory in $ac_dir_suffix.
14873     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
14874   else
14875     ac_dir_suffix= ac_dots=
14876   fi
14877
14878   case "$ac_given_srcdir" in
14879   .)  srcdir=.
14880       if test -z "$ac_dots"; then top_srcdir=.
14881       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
14882   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
14883   *) # Relative path.
14884     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
14885     top_srcdir="$ac_dots$ac_given_srcdir" ;;
14886   esac
14887
14888   case "$ac_given_INSTALL" in
14889   [/$]*) INSTALL="$ac_given_INSTALL" ;;
14890   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
14891   esac
14892
14893   echo creating "$ac_file"
14894   rm -f "$ac_file"
14895   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
14896   case "$ac_file" in
14897   *Makefile*) ac_comsub="1i\\
14898 # $configure_input" ;;
14899   *) ac_comsub= ;;
14900   esac
14901
14902   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
14903   sed -e "$ac_comsub
14904 s%@configure_input@%$configure_input%g
14905 s%@srcdir@%$srcdir%g
14906 s%@top_srcdir@%$top_srcdir%g
14907 s%@INSTALL@%$INSTALL%g
14908 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
14909 fi; done
14910 rm -f conftest.s*
14911
14912 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
14913 # NAME is the cpp macro being defined and VALUE is the value it is being given.
14914 #
14915 # ac_d sets the value in "#define NAME VALUE" lines.
14916 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
14917 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
14918 ac_dC='\3'
14919 ac_dD='%g'
14920 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
14921 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
14922 ac_uB='\([      ]\)%\1#\2define\3'
14923 ac_uC=' '
14924 ac_uD='\4%g'
14925 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
14926 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
14927 ac_eB='$%\1#\2define\3'
14928 ac_eC=' '
14929 ac_eD='%g'
14930
14931 if test "${CONFIG_HEADERS+set}" != set; then
14932 EOF
14933 cat >> $CONFIG_STATUS <<EOF
14934   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
14935 EOF
14936 cat >> $CONFIG_STATUS <<\EOF
14937 fi
14938 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
14939   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
14940   case "$ac_file" in
14941   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
14942        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
14943   *) ac_file_in="${ac_file}.in" ;;
14944   esac
14945
14946   echo creating $ac_file
14947
14948   rm -f conftest.frag conftest.in conftest.out
14949   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
14950   cat $ac_file_inputs > conftest.in
14951
14952 EOF
14953
14954 # Transform confdefs.h into a sed script conftest.vals that substitutes
14955 # the proper values into config.h.in to produce config.h.  And first:
14956 # Protect against being on the right side of a sed subst in config.status.
14957 # Protect against being in an unquoted here document in config.status.
14958 rm -f conftest.vals
14959 cat > conftest.hdr <<\EOF
14960 s/[\\&%]/\\&/g
14961 s%[\\$`]%\\&%g
14962 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
14963 s%ac_d%ac_u%gp
14964 s%ac_u%ac_e%gp
14965 EOF
14966 sed -n -f conftest.hdr confdefs.h > conftest.vals
14967 rm -f conftest.hdr
14968
14969 # This sed command replaces #undef with comments.  This is necessary, for
14970 # example, in the case of _POSIX_SOURCE, which is predefined and required
14971 # on some systems where configure will not decide to define it.
14972 cat >> conftest.vals <<\EOF
14973 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
14974 EOF
14975
14976 # Break up conftest.vals because some shells have a limit on
14977 # the size of here documents, and old seds have small limits too.
14978
14979 rm -f conftest.tail
14980 while :
14981 do
14982   ac_lines=`grep -c . conftest.vals`
14983   # grep -c gives empty output for an empty file on some AIX systems.
14984   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
14985   # Write a limited-size here document to conftest.frag.
14986   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
14987   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
14988   echo 'CEOF
14989   sed -f conftest.frag conftest.in > conftest.out
14990   rm -f conftest.in
14991   mv conftest.out conftest.in
14992 ' >> $CONFIG_STATUS
14993   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
14994   rm -f conftest.vals
14995   mv conftest.tail conftest.vals
14996 done
14997 rm -f conftest.vals
14998
14999 cat >> $CONFIG_STATUS <<\EOF
15000   rm -f conftest.frag conftest.h
15001   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
15002   cat conftest.in >> conftest.h
15003   rm -f conftest.in
15004   if cmp -s $ac_file conftest.h 2>/dev/null; then
15005     echo "$ac_file is unchanged"
15006     rm -f conftest.h
15007   else
15008     # Remove last slash and all that follows it.  Not all systems have dirname.
15009       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
15010       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15011       # The file is in a subdirectory.
15012       test ! -d "$ac_dir" && mkdir "$ac_dir"
15013     fi
15014     rm -f $ac_file
15015     mv conftest.h $ac_file
15016   fi
15017 fi; done
15018
15019 EOF
15020 cat >> $CONFIG_STATUS <<EOF
15021
15022 EOF
15023 cat >> $CONFIG_STATUS <<\EOF
15024
15025 date > stamp-h
15026 echo Please \"make depend\" to build dependencies
15027
15028 exit 0
15029 EOF
15030 chmod +x $CONFIG_STATUS
15031 rm -fr confdefs* $ac_clean_files
15032 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
15033