]> git.sur5r.net Git - openldap/blob - configure
Typo: s/elineno, elineno/elineno, lineno/ in error message
[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 DNS  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 Options:"
51 ac_help="$ac_help
52   --enable-ldapd        enable building ldapd (no)"
53 ac_help="$ac_help
54 SLAPD 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-wrappers   enable tcp wrapper support (no)"
73 ac_help="$ac_help
74     --enable-bdb2       enable bdb2 backend (no)"
75 ac_help="$ac_help
76       --with-bdb2-module        module type (static)"
77 ac_help="$ac_help
78     --enable-ldap       enable ldap backend (no)"
79 ac_help="$ac_help
80       --with-ldap-module        module type (static)"
81 ac_help="$ac_help
82     --enable-ldbm       enable ldbm backend (yes)"
83 ac_help="$ac_help
84       --with-ldbm-module        module type (static)"
85 ac_help="$ac_help
86       --with-ldbm-api   use LDBM API (auto)"
87 ac_help="$ac_help
88       --with-ldbm-type  use LDBM type (auto)"
89 ac_help="$ac_help
90     --enable-passwd     enable passwd backend (no)"
91 ac_help="$ac_help
92       --with-passwd-module      module type (static)"
93 ac_help="$ac_help
94     --enable-perl       enable perl backend (no)"
95 ac_help="$ac_help
96       --with-perl-module        module type (static)"
97 ac_help="$ac_help
98     --enable-shell      enable shell backend (no)"
99 ac_help="$ac_help
100       --with-shell-module       module type (static)"
101 ac_help="$ac_help
102     --enable-tcl        enable tcl backend (no)"
103 ac_help="$ac_help
104       --with-tcl-module module type (static)"
105 ac_help="$ac_help
106 SLURPD Options:"
107 ac_help="$ac_help
108   --enable-slurpd       enable building slurpd (auto)"
109 ac_help="$ac_help
110 Library Generation & Linking Options"
111 ac_help="$ac_help
112   --enable-static[=PKGS]  build static libraries [default=yes]"
113 ac_help="$ac_help
114   --enable-shared[=PKGS]  build shared libraries [default=yes]"
115 ac_help="$ac_help
116   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
117 ac_help="$ac_help
118   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
119 ac_help="$ac_help
120   --disable-libtool-lock  avoid locking (might break parallel builds)"
121
122 # Initialize some variables set by options.
123 # The variables have the same names as the options, with
124 # dashes changed to underlines.
125 build=NONE
126 cache_file=./config.cache
127 exec_prefix=NONE
128 host=NONE
129 no_create=
130 nonopt=NONE
131 no_recursion=
132 prefix=NONE
133 program_prefix=NONE
134 program_suffix=NONE
135 program_transform_name=s,x,x,
136 silent=
137 site=
138 srcdir=
139 target=NONE
140 verbose=
141 x_includes=NONE
142 x_libraries=NONE
143 bindir='${exec_prefix}/bin'
144 sbindir='${exec_prefix}/sbin'
145 libexecdir='${exec_prefix}/libexec'
146 datadir='${prefix}/share'
147 sysconfdir='${prefix}/etc'
148 sharedstatedir='${prefix}/com'
149 localstatedir='${prefix}/var'
150 libdir='${exec_prefix}/lib'
151 includedir='${prefix}/include'
152 oldincludedir='/usr/include'
153 infodir='${prefix}/info'
154 mandir='${prefix}/man'
155
156 # Initialize some other variables.
157 subdirs=
158 MFLAGS= MAKEFLAGS=
159 SHELL=${CONFIG_SHELL-/bin/sh}
160 # Maximum number of lines to put in a shell here document.
161 ac_max_here_lines=12
162
163 ac_prev=
164 for ac_option
165 do
166
167   # If the previous option needs an argument, assign it.
168   if test -n "$ac_prev"; then
169     eval "$ac_prev=\$ac_option"
170     ac_prev=
171     continue
172   fi
173
174   case "$ac_option" in
175   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
176   *) ac_optarg= ;;
177   esac
178
179   # Accept the important Cygnus configure options, so we can diagnose typos.
180
181   case "$ac_option" in
182
183   -bindir | --bindir | --bindi | --bind | --bin | --bi)
184     ac_prev=bindir ;;
185   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
186     bindir="$ac_optarg" ;;
187
188   -build | --build | --buil | --bui | --bu)
189     ac_prev=build ;;
190   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
191     build="$ac_optarg" ;;
192
193   -cache-file | --cache-file | --cache-fil | --cache-fi \
194   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
195     ac_prev=cache_file ;;
196   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
197   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
198     cache_file="$ac_optarg" ;;
199
200   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
201     ac_prev=datadir ;;
202   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
203   | --da=*)
204     datadir="$ac_optarg" ;;
205
206   -disable-* | --disable-*)
207     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
208     # Reject names that are not valid shell variable names.
209     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
210       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
211     fi
212     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
213     eval "enable_${ac_feature}=no" ;;
214
215   -enable-* | --enable-*)
216     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
217     # Reject names that are not valid shell variable names.
218     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
219       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
220     fi
221     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
222     case "$ac_option" in
223       *=*) ;;
224       *) ac_optarg=yes ;;
225     esac
226     eval "enable_${ac_feature}='$ac_optarg'" ;;
227
228   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
229   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
230   | --exec | --exe | --ex)
231     ac_prev=exec_prefix ;;
232   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
233   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
234   | --exec=* | --exe=* | --ex=*)
235     exec_prefix="$ac_optarg" ;;
236
237   -gas | --gas | --ga | --g)
238     # Obsolete; use --with-gas.
239     with_gas=yes ;;
240
241   -help | --help | --hel | --he)
242     # Omit some internal or obsolete options to make the list less imposing.
243     # This message is too long to be a string in the A/UX 3.1 sh.
244     cat << EOF
245 Usage: configure [options] [host]
246 Options: [defaults in brackets after descriptions]
247 Configuration:
248   --cache-file=FILE       cache test results in FILE
249   --help                  print this message
250   --no-create             do not create output files
251   --quiet, --silent       do not print \`checking...' messages
252   --version               print the version of autoconf that created configure
253 Directory and file names:
254   --prefix=PREFIX         install architecture-independent files in PREFIX
255                           [$ac_default_prefix]
256   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
257                           [same as prefix]
258   --bindir=DIR            user executables in DIR [EPREFIX/bin]
259   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
260   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
261   --datadir=DIR           read-only architecture-independent data in DIR
262                           [PREFIX/share]
263   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
264   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
265                           [PREFIX/com]
266   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
267   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
268   --includedir=DIR        C header files in DIR [PREFIX/include]
269   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
270   --infodir=DIR           info documentation in DIR [PREFIX/info]
271   --mandir=DIR            man documentation in DIR [PREFIX/man]
272   --srcdir=DIR            find the sources in DIR [configure dir or ..]
273   --program-prefix=PREFIX prepend PREFIX to installed program names
274   --program-suffix=SUFFIX append SUFFIX to installed program names
275   --program-transform-name=PROGRAM
276                           run sed PROGRAM on installed program names
277 EOF
278     cat << EOF
279 Host type:
280   --build=BUILD           configure for building on BUILD [BUILD=HOST]
281   --host=HOST             configure for HOST [guessed]
282   --target=TARGET         configure for TARGET [TARGET=HOST]
283 Features and packages:
284   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
285   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
286   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
287   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
288   --x-includes=DIR        X include files are in DIR
289   --x-libraries=DIR       X library files are in DIR
290 EOF
291     if test -n "$ac_help"; then
292       echo "--enable and --with options recognized:$ac_help"
293     fi
294     exit 0 ;;
295
296   -host | --host | --hos | --ho)
297     ac_prev=host ;;
298   -host=* | --host=* | --hos=* | --ho=*)
299     host="$ac_optarg" ;;
300
301   -includedir | --includedir | --includedi | --included | --include \
302   | --includ | --inclu | --incl | --inc)
303     ac_prev=includedir ;;
304   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
305   | --includ=* | --inclu=* | --incl=* | --inc=*)
306     includedir="$ac_optarg" ;;
307
308   -infodir | --infodir | --infodi | --infod | --info | --inf)
309     ac_prev=infodir ;;
310   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
311     infodir="$ac_optarg" ;;
312
313   -libdir | --libdir | --libdi | --libd)
314     ac_prev=libdir ;;
315   -libdir=* | --libdir=* | --libdi=* | --libd=*)
316     libdir="$ac_optarg" ;;
317
318   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
319   | --libexe | --libex | --libe)
320     ac_prev=libexecdir ;;
321   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
322   | --libexe=* | --libex=* | --libe=*)
323     libexecdir="$ac_optarg" ;;
324
325   -localstatedir | --localstatedir | --localstatedi | --localstated \
326   | --localstate | --localstat | --localsta | --localst \
327   | --locals | --local | --loca | --loc | --lo)
328     ac_prev=localstatedir ;;
329   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
330   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
331   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
332     localstatedir="$ac_optarg" ;;
333
334   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
335     ac_prev=mandir ;;
336   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
337     mandir="$ac_optarg" ;;
338
339   -nfp | --nfp | --nf)
340     # Obsolete; use --without-fp.
341     with_fp=no ;;
342
343   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
344   | --no-cr | --no-c)
345     no_create=yes ;;
346
347   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
348   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
349     no_recursion=yes ;;
350
351   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
352   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
353   | --oldin | --oldi | --old | --ol | --o)
354     ac_prev=oldincludedir ;;
355   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
356   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
357   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
358     oldincludedir="$ac_optarg" ;;
359
360   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
361     ac_prev=prefix ;;
362   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
363     prefix="$ac_optarg" ;;
364
365   -program-prefix | --program-prefix | --program-prefi | --program-pref \
366   | --program-pre | --program-pr | --program-p)
367     ac_prev=program_prefix ;;
368   -program-prefix=* | --program-prefix=* | --program-prefi=* \
369   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
370     program_prefix="$ac_optarg" ;;
371
372   -program-suffix | --program-suffix | --program-suffi | --program-suff \
373   | --program-suf | --program-su | --program-s)
374     ac_prev=program_suffix ;;
375   -program-suffix=* | --program-suffix=* | --program-suffi=* \
376   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
377     program_suffix="$ac_optarg" ;;
378
379   -program-transform-name | --program-transform-name \
380   | --program-transform-nam | --program-transform-na \
381   | --program-transform-n | --program-transform- \
382   | --program-transform | --program-transfor \
383   | --program-transfo | --program-transf \
384   | --program-trans | --program-tran \
385   | --progr-tra | --program-tr | --program-t)
386     ac_prev=program_transform_name ;;
387   -program-transform-name=* | --program-transform-name=* \
388   | --program-transform-nam=* | --program-transform-na=* \
389   | --program-transform-n=* | --program-transform-=* \
390   | --program-transform=* | --program-transfor=* \
391   | --program-transfo=* | --program-transf=* \
392   | --program-trans=* | --program-tran=* \
393   | --progr-tra=* | --program-tr=* | --program-t=*)
394     program_transform_name="$ac_optarg" ;;
395
396   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
397   | -silent | --silent | --silen | --sile | --sil)
398     silent=yes ;;
399
400   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
401     ac_prev=sbindir ;;
402   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
403   | --sbi=* | --sb=*)
404     sbindir="$ac_optarg" ;;
405
406   -sharedstatedir | --sharedstatedir | --sharedstatedi \
407   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
408   | --sharedst | --shareds | --shared | --share | --shar \
409   | --sha | --sh)
410     ac_prev=sharedstatedir ;;
411   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
412   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
413   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
414   | --sha=* | --sh=*)
415     sharedstatedir="$ac_optarg" ;;
416
417   -site | --site | --sit)
418     ac_prev=site ;;
419   -site=* | --site=* | --sit=*)
420     site="$ac_optarg" ;;
421
422   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
423     ac_prev=srcdir ;;
424   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
425     srcdir="$ac_optarg" ;;
426
427   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
428   | --syscon | --sysco | --sysc | --sys | --sy)
429     ac_prev=sysconfdir ;;
430   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
431   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
432     sysconfdir="$ac_optarg" ;;
433
434   -target | --target | --targe | --targ | --tar | --ta | --t)
435     ac_prev=target ;;
436   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
437     target="$ac_optarg" ;;
438
439   -v | -verbose | --verbose | --verbos | --verbo | --verb)
440     verbose=yes ;;
441
442   -version | --version | --versio | --versi | --vers)
443     echo "configure generated by autoconf version 2.13.1"
444     exit 0 ;;
445
446   -with-* | --with-*)
447     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
448     # Reject names that are not valid shell variable names.
449     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
450       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
451     fi
452     ac_package=`echo $ac_package| sed 's/-/_/g'`
453     case "$ac_option" in
454       *=*) ;;
455       *) ac_optarg=yes ;;
456     esac
457     eval "with_${ac_package}='$ac_optarg'" ;;
458
459   -without-* | --without-*)
460     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
461     # Reject names that are not valid shell variable names.
462     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
463       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
464     fi
465     ac_package=`echo $ac_package| sed 's/-/_/g'`
466     eval "with_${ac_package}=no" ;;
467
468   --x)
469     # Obsolete; use --with-x.
470     with_x=yes ;;
471
472   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
473   | --x-incl | --x-inc | --x-in | --x-i)
474     ac_prev=x_includes ;;
475   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
476   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
477     x_includes="$ac_optarg" ;;
478
479   -x-libraries | --x-libraries | --x-librarie | --x-librari \
480   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
481     ac_prev=x_libraries ;;
482   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
483   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
484     x_libraries="$ac_optarg" ;;
485
486   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
487     ;;
488
489   *)
490     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
491       echo "configure: warning: $ac_option: invalid host type" 1>&2
492     fi
493     if test "x$nonopt" != xNONE; then
494       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
495     fi
496     nonopt="$ac_option"
497     ;;
498
499   esac
500 done
501
502 if test -n "$ac_prev"; then
503   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
504 fi
505
506 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
507
508 # File descriptor usage:
509 # 0 standard input
510 # 1 file creation
511 # 2 errors and warnings
512 # 3 some systems may open it to /dev/tty
513 # 4 used on the Kubota Titan
514 # 6 checking for... messages and results
515 # 5 compiler messages saved in config.log
516 if test "$silent" = yes; then
517   exec 6>/dev/null
518 else
519   exec 6>&1
520 fi
521 exec 5>./config.log
522
523 echo "\
524 This file contains any messages produced by compilers while
525 running configure, to aid debugging if configure makes a mistake.
526 " 1>&5
527
528 # Strip out --no-create and --no-recursion so they do not pile up.
529 # Also quote any args containing shell metacharacters.
530 ac_configure_args=
531 for ac_arg
532 do
533   case "$ac_arg" in
534   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
535   | --no-cr | --no-c) ;;
536   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
537   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
538   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
539   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
540   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
541   esac
542 done
543
544 # NLS nuisances.
545 # Only set these to C if already set.  These must not be set unconditionally
546 # because not all systems understand e.g. LANG=C (notably SCO).
547 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
548 # Non-C LC_CTYPE values break the ctype check.
549 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
550 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
551 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
552 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
553
554 # confdefs.h avoids OS command line length limits that DEFS can exceed.
555 rm -rf conftest* confdefs.h
556 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
557 echo > confdefs.h
558
559 # A filename unique to this package, relative to the directory that
560 # configure is in, which we can look for to find out if srcdir is correct.
561 ac_unique_file=build/version
562
563 # Find the source files, if location was not specified.
564 if test -z "$srcdir"; then
565   ac_srcdir_defaulted=yes
566   # Try the directory containing this script, then its parent.
567   ac_prog=$0
568   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
569   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
570   srcdir=$ac_confdir
571   if test ! -r $srcdir/$ac_unique_file; then
572     srcdir=..
573   fi
574 else
575   ac_srcdir_defaulted=no
576 fi
577 if test ! -r $srcdir/$ac_unique_file; then
578   if test "$ac_srcdir_defaulted" = yes; then
579     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
580   else
581     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
582   fi
583 fi
584 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
585
586 # Prefer explicitly selected file to automatically selected ones.
587 if test -z "$CONFIG_SITE"; then
588   if test "x$prefix" != xNONE; then
589     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
590   else
591     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
592   fi
593 fi
594 for ac_site_file in $CONFIG_SITE; do
595   if test -r "$ac_site_file"; then
596     echo "loading site script $ac_site_file"
597     . "$ac_site_file"
598   fi
599 done
600
601
602 ac_ext=c
603 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
604 ac_cpp='$CPP $CPPFLAGS'
605 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
606 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
607 cross_compiling=$ac_cv_prog_cc_cross
608
609 ac_exeext=
610 ac_objext=o
611 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
612   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
613   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
614     ac_n= ac_c='
615 ' ac_t='        '
616   else
617     ac_n=-n ac_c= ac_t=
618   fi
619 else
620   ac_n= ac_c='\c' ac_t=
621 fi
622
623 ac_aux_dir=
624 for ac_dir in build $srcdir/build; do
625   if test -f $ac_dir/install-sh; then
626     ac_aux_dir=$ac_dir
627     ac_install_sh="$ac_aux_dir/install-sh -c"
628     break
629   elif 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   fi
634 done
635 if test -z "$ac_aux_dir"; then
636   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
637 fi
638 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
639 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
640 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
641
642 OL_VERSION=`cat $ac_aux_dir/version`
643 if test -z "$OL_VERSION"; then
644         { echo "configure: error: could not determine version" 1>&2; exit 1; }
645 fi
646
647
648 echo $ac_n "checking host system type""... $ac_c" 1>&6
649 echo "configure:650: checking host system type" >&5
650 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
651
652 # Make sure we can run config.sub.
653   if $ac_config_sub sun4 >/dev/null 2>&1; then :
654     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
655   fi
656
657   ac_cv_host_alias=$host
658   case "$ac_cv_host_alias" in
659   NONE)
660     case $nonopt in
661     NONE)
662       if ac_cv_host_alias=`$ac_config_guess`; then :
663       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
664       fi ;;
665     *) ac_cv_host_alias=$nonopt ;;
666     esac ;;
667   esac
668
669   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
670   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
671   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
672   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
673 else
674   echo $ac_n "(cached) $ac_c" 1>&6
675 fi
676
677 echo "$ac_t""$ac_cv_host" 1>&6
678
679 host=$ac_cv_host
680 host_alias=$ac_cv_host_alias
681 host_cpu=$ac_cv_host_cpu
682 host_vendor=$ac_cv_host_vendor
683 host_os=$ac_cv_host_os
684
685
686
687
688
689 echo $ac_n "checking target system type""... $ac_c" 1>&6
690 echo "configure:691: checking target system type" >&5
691 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
692
693 # Make sure we can run config.sub.
694   if $ac_config_sub sun4 >/dev/null 2>&1; then :
695     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
696   fi
697
698   ac_cv_target_alias=$target
699   case "$ac_cv_target_alias" in
700   NONE)
701     case $nonopt in
702     NONE)
703       ac_cv_target_alias=$host_alias ;;
704
705     *) ac_cv_target_alias=$nonopt ;;
706     esac ;;
707   esac
708
709   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
710   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
711   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
712   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
713 else
714   echo $ac_n "(cached) $ac_c" 1>&6
715 fi
716
717 echo "$ac_t""$ac_cv_target" 1>&6
718
719 target=$ac_cv_target
720 target_alias=$ac_cv_target_alias
721 target_cpu=$ac_cv_target_cpu
722 target_vendor=$ac_cv_target_vendor
723 target_os=$ac_cv_target_os
724
725
726
727
728
729 echo $ac_n "checking build system type""... $ac_c" 1>&6
730 echo "configure:731: checking build system type" >&5
731 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
732
733 # Make sure we can run config.sub.
734   if $ac_config_sub sun4 >/dev/null 2>&1; then :
735     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
736   fi
737
738   ac_cv_build_alias=$build
739   case "$ac_cv_build_alias" in
740   NONE)
741     case $nonopt in
742     NONE)
743       ac_cv_build_alias=$host_alias ;;
744
745     *) ac_cv_build_alias=$nonopt ;;
746     esac ;;
747   esac
748
749   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
750   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
751   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
752   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
753 else
754   echo $ac_n "(cached) $ac_c" 1>&6
755 fi
756
757 echo "$ac_t""$ac_cv_build" 1>&6
758
759 build=$ac_cv_build
760 build_alias=$ac_cv_build_alias
761 build_cpu=$ac_cv_build_cpu
762 build_vendor=$ac_cv_build_vendor
763 build_os=$ac_cv_build_os
764
765
766
767
768
769 # Do some error checking and defaulting for the host and target type.
770 # The inputs are:
771 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
772 #
773 # The rules are:
774 # 1. You are not allowed to specify --host, --target, and nonopt at the
775 #    same time.
776 # 2. Host defaults to nonopt.
777 # 3. If nonopt is not specified, then host defaults to the current host,
778 #    as determined by config.guess.
779 # 4. Target and build default to nonopt.
780 # 5. If nonopt is not specified, then target and build default to host.
781
782 # The aliases save the names the user supplied, while $host etc.
783 # will get canonicalized.
784 case $host---$target---$nonopt in
785 NONE---*---* | *---NONE---* | *---*---NONE) ;;
786 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
787 esac
788
789 test "$host_alias" != "$target_alias" &&
790   test "$program_prefix$program_suffix$program_transform_name" = \
791     NONENONEs,x,x, &&
792   program_prefix=${target_alias}-
793
794
795 # Find a good install program.  We prefer a C program (faster),
796 # so one script is as good as another.  But avoid the broken or
797 # incompatible versions:
798 # SysV /etc/install, /usr/sbin/install
799 # SunOS /usr/etc/install
800 # IRIX /sbin/install
801 # AIX /bin/install
802 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
803 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
804 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
805 # ./install, which can be erroneously created by make from ./install.sh.
806 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
807 echo "configure:808: checking for a BSD compatible install" >&5
808 if test -z "$INSTALL"; then
809 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
810   echo $ac_n "(cached) $ac_c" 1>&6
811 else
812     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
813   for ac_dir in $PATH; do
814     # Account for people who put trailing slashes in PATH elements.
815     case "$ac_dir/" in
816     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
817     *)
818       # OSF1 and SCO ODT 3.0 have their own names for install.
819       # Don't use installbsd from OSF since it installs stuff as root
820       # by default.
821       for ac_prog in ginstall scoinst install; do
822         if test -f $ac_dir/$ac_prog; then
823           if test $ac_prog = install &&
824             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
825             # AIX install.  It has an incompatible calling convention.
826             :
827           elif test $ac_prog = install &&
828             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
829             # program-specific install script used by HP pwplus--don't use.
830             :
831           else
832             ac_cv_path_install="$ac_dir/$ac_prog -c"
833             break 2
834           fi
835         fi
836       done
837       ;;
838     esac
839   done
840   IFS="$ac_save_IFS"
841
842 fi
843   if test "${ac_cv_path_install+set}" = set; then
844     INSTALL="$ac_cv_path_install"
845   else
846     # As a last resort, use the slow shell script.  We don't cache a
847     # path for INSTALL within a source directory, because that will
848     # break other packages using the cache if that directory is
849     # removed, or if the path is relative.
850     INSTALL="$ac_install_sh"
851   fi
852 fi
853 echo "$ac_t""$INSTALL" 1>&6
854
855 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
856 # It thinks the first close brace ends the variable substitution.
857 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
858
859 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
860
861 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
862
863 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
864 echo "configure:865: checking whether build environment is sane" >&5
865 # Just in case
866 sleep 1
867 echo timestamp > conftestfile
868 # Do `set' in a subshell so we don't clobber the current shell's
869 # arguments.  Must try -L first in case configure is actually a
870 # symlink; some systems play weird games with the mod time of symlinks
871 # (eg FreeBSD returns the mod time of the symlink's containing
872 # directory).
873 if (
874    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
875    if test "$*" = "X"; then
876       # -L didn't work.
877       set X `ls -t $srcdir/configure conftestfile`
878    fi
879    if test "$*" != "X $srcdir/configure conftestfile" \
880       && test "$*" != "X conftestfile $srcdir/configure"; then
881
882       # If neither matched, then we have a broken ls.  This can happen
883       # if, for instance, CONFIG_SHELL is bash and it inherits a
884       # broken ls alias from the environment.  This has actually
885       # happened.  Such a system could not be considered "sane".
886       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
887 alias in your environment" 1>&2; exit 1; }
888    fi
889
890    test "$2" = conftestfile
891    )
892 then
893    # Ok.
894    :
895 else
896    { echo "configure: error: newly created file is older than distributed files!
897 Check your system clock" 1>&2; exit 1; }
898 fi
899 rm -f conftest*
900 echo "$ac_t""yes" 1>&6
901 if test "$program_transform_name" = s,x,x,; then
902   program_transform_name=
903 else
904   # Double any \ or $.  echo might interpret backslashes.
905   cat <<\EOF_SED > conftestsed
906 s,\\,\\\\,g; s,\$,$$,g
907 EOF_SED
908   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
909   rm -f conftestsed
910 fi
911 test "$program_prefix" != NONE &&
912   program_transform_name="s,^,${program_prefix},;$program_transform_name"
913 # Use a double $ so make ignores it.
914 test "$program_suffix" != NONE &&
915   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
916
917 # sed with no file args requires a program.
918 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
919
920 for ac_prog in mawk gawk nawk awk
921 do
922 # Extract the first word of "$ac_prog", so it can be a program name with args.
923 set dummy $ac_prog; ac_word=$2
924 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
925 echo "configure:926: checking for $ac_word" >&5
926 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
927   echo $ac_n "(cached) $ac_c" 1>&6
928 else
929   if test -n "$AWK"; then
930   ac_cv_prog_AWK="$AWK" # Let the user override the test.
931 else
932   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
933   ac_dummy="$PATH"
934   for ac_dir in $ac_dummy; do
935     test -z "$ac_dir" && ac_dir=.
936     if test -f $ac_dir/$ac_word; then
937       ac_cv_prog_AWK="$ac_prog"
938       break
939     fi
940   done
941   IFS="$ac_save_ifs"
942 fi
943 fi
944 AWK="$ac_cv_prog_AWK"
945 if test -n "$AWK"; then
946   echo "$ac_t""$AWK" 1>&6
947 else
948   echo "$ac_t""no" 1>&6
949 fi
950
951 test -n "$AWK" && break
952 done
953
954 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
955 echo "configure:956: checking whether ${MAKE-make} sets \${MAKE}" >&5
956 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
957 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
958   echo $ac_n "(cached) $ac_c" 1>&6
959 else
960   cat > conftestmake <<\EOF
961 all:
962         @echo 'ac_maketemp="${MAKE}"'
963 EOF
964 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
965 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
966 if test -n "$ac_maketemp"; then
967   eval ac_cv_prog_make_${ac_make}_set=yes
968 else
969   eval ac_cv_prog_make_${ac_make}_set=no
970 fi
971 rm -f conftestmake
972 fi
973 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
974   echo "$ac_t""yes" 1>&6
975   SET_MAKE=
976 else
977   echo "$ac_t""no" 1>&6
978   SET_MAKE="MAKE=${MAKE-make}"
979 fi
980
981
982
983 PACKAGE=OpenLDAP
984
985 VERSION=$OL_VERSION
986
987 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
988   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
989 fi
990
991
992
993 missing_dir=`cd $ac_aux_dir && pwd`
994 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
995 echo "configure:996: checking for working aclocal" >&5
996 # Run test in a subshell; some versions of sh will print an error if
997 # an executable is not found, even if stderr is redirected.
998 # Redirect stdin to placate older versions of autoconf.  Sigh.
999 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1000    ACLOCAL=aclocal
1001    echo "$ac_t""found" 1>&6
1002 else
1003    ACLOCAL="$missing_dir/missing aclocal"
1004    echo "$ac_t""missing" 1>&6
1005 fi
1006
1007 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1008 echo "configure:1009: checking for working autoconf" >&5
1009 # Run test in a subshell; some versions of sh will print an error if
1010 # an executable is not found, even if stderr is redirected.
1011 # Redirect stdin to placate older versions of autoconf.  Sigh.
1012 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1013    AUTOCONF=autoconf
1014    echo "$ac_t""found" 1>&6
1015 else
1016    AUTOCONF="$missing_dir/missing autoconf"
1017    echo "$ac_t""missing" 1>&6
1018 fi
1019
1020 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1021 echo "configure:1022: checking for working automake" >&5
1022 # Run test in a subshell; some versions of sh will print an error if
1023 # an executable is not found, even if stderr is redirected.
1024 # Redirect stdin to placate older versions of autoconf.  Sigh.
1025 if (automake --version) < /dev/null > /dev/null 2>&1; then
1026    AUTOMAKE=automake
1027    echo "$ac_t""found" 1>&6
1028 else
1029    AUTOMAKE="$missing_dir/missing automake"
1030    echo "$ac_t""missing" 1>&6
1031 fi
1032
1033 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1034 echo "configure:1035: checking for working autoheader" >&5
1035 # Run test in a subshell; some versions of sh will print an error if
1036 # an executable is not found, even if stderr is redirected.
1037 # Redirect stdin to placate older versions of autoconf.  Sigh.
1038 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1039    AUTOHEADER=autoheader
1040    echo "$ac_t""found" 1>&6
1041 else
1042    AUTOHEADER="$missing_dir/missing autoheader"
1043    echo "$ac_t""missing" 1>&6
1044 fi
1045
1046 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1047 echo "configure:1048: checking for working makeinfo" >&5
1048 # Run test in a subshell; some versions of sh will print an error if
1049 # an executable is not found, even if stderr is redirected.
1050 # Redirect stdin to placate older versions of autoconf.  Sigh.
1051 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1052    MAKEINFO=makeinfo
1053    echo "$ac_t""found" 1>&6
1054 else
1055    MAKEINFO="$missing_dir/missing makeinfo"
1056    echo "$ac_t""missing" 1>&6
1057 fi
1058
1059 install_sh="$missing_dir/install-sh"
1060 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1061
1062 for ac_prog in gnutar gtar tar
1063 do
1064 # Extract the first word of "$ac_prog", so it can be a program name with args.
1065 set dummy $ac_prog; ac_word=$2
1066 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1067 echo "configure:1068: checking for $ac_word" >&5
1068 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1069   echo $ac_n "(cached) $ac_c" 1>&6
1070 else
1071   if test -n "$AMTAR"; then
1072   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1073 else
1074   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1075   ac_dummy="$PATH"
1076   for ac_dir in $ac_dummy; do
1077     test -z "$ac_dir" && ac_dir=.
1078     if test -f $ac_dir/$ac_word; then
1079       ac_cv_prog_AMTAR="$ac_prog"
1080       break
1081     fi
1082   done
1083   IFS="$ac_save_ifs"
1084 fi
1085 fi
1086 AMTAR="$ac_cv_prog_AMTAR"
1087 if test -n "$AMTAR"; then
1088   echo "$ac_t""$AMTAR" 1>&6
1089 else
1090   echo "$ac_t""no" 1>&6
1091 fi
1092
1093 test -n "$AMTAR" && break
1094 done
1095
1096
1097 AMTARFLAGS=
1098 if test -n "$AMTAR"; then
1099   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1100         AMTARFLAGS=o
1101   fi
1102 fi
1103
1104
1105
1106 cat >> confdefs.h <<EOF
1107 #define OPENLDAP_PACKAGE "$PACKAGE"
1108 EOF
1109
1110 cat >> confdefs.h <<EOF
1111 #define OPENLDAP_VERSION "$VERSION"
1112 EOF
1113
1114
1115
1116
1117 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1118 echo "configure:1119: checking configure arguments" >&5
1119
1120
1121 top_builddir=`pwd`
1122
1123 ldap_subdir="openldap"
1124
1125 # Check whether --with-subdir or --without-subdir was given.
1126 if test "${with_subdir+set}" = set; then
1127   withval="$with_subdir"
1128   
1129         if test "$withval" = "no"; then
1130                 ldap_subdir=""
1131         elif test "$withval" != "yes"; then
1132                 ldap_subdir="$withval"
1133         fi
1134
1135 fi
1136
1137
1138 # OpenLDAP --enable-debug
1139         # Check whether --enable-debug or --disable-debug was given.
1140 if test "${enable_debug+set}" = set; then
1141   enableval="$enable_debug"
1142   
1143         ol_arg=invalid
1144         for ol_val in auto yes no ; do
1145                 if test "$enableval" = "$ol_val" ; then
1146                         ol_arg="$ol_val"
1147                 fi
1148         done
1149         if test "$ol_arg" = "invalid" ; then
1150                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1151         fi
1152         ol_enable_debug="$ol_arg"
1153
1154 else
1155         ol_enable_debug="yes"
1156 fi
1157 # end --enable-debug
1158 # OpenLDAP --enable-syslog
1159         # Check whether --enable-syslog or --disable-syslog was given.
1160 if test "${enable_syslog+set}" = set; then
1161   enableval="$enable_syslog"
1162   
1163         ol_arg=invalid
1164         for ol_val in auto yes no ; do
1165                 if test "$enableval" = "$ol_val" ; then
1166                         ol_arg="$ol_val"
1167                 fi
1168         done
1169         if test "$ol_arg" = "invalid" ; then
1170                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1171         fi
1172         ol_enable_syslog="$ol_arg"
1173
1174 else
1175         ol_enable_syslog="auto"
1176 fi
1177 # end --enable-syslog
1178 # OpenLDAP --enable-proctitle
1179         # Check whether --enable-proctitle or --disable-proctitle was given.
1180 if test "${enable_proctitle+set}" = set; then
1181   enableval="$enable_proctitle"
1182   
1183         ol_arg=invalid
1184         for ol_val in auto yes no ; do
1185                 if test "$enableval" = "$ol_val" ; then
1186                         ol_arg="$ol_val"
1187                 fi
1188         done
1189         if test "$ol_arg" = "invalid" ; then
1190                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1191         fi
1192         ol_enable_proctitle="$ol_arg"
1193
1194 else
1195         ol_enable_proctitle="yes"
1196 fi
1197 # end --enable-proctitle
1198 # OpenLDAP --enable-cache
1199         # Check whether --enable-cache or --disable-cache was given.
1200 if test "${enable_cache+set}" = set; then
1201   enableval="$enable_cache"
1202   
1203         ol_arg=invalid
1204         for ol_val in auto yes no ; do
1205                 if test "$enableval" = "$ol_val" ; then
1206                         ol_arg="$ol_val"
1207                 fi
1208         done
1209         if test "$ol_arg" = "invalid" ; then
1210                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
1211         fi
1212         ol_enable_cache="$ol_arg"
1213
1214 else
1215         ol_enable_cache="yes"
1216 fi
1217 # end --enable-cache
1218 # OpenLDAP --enable-dns
1219         # Check whether --enable-dns or --disable-dns was given.
1220 if test "${enable_dns+set}" = set; then
1221   enableval="$enable_dns"
1222   
1223         ol_arg=invalid
1224         for ol_val in auto yes no ; do
1225                 if test "$enableval" = "$ol_val" ; then
1226                         ol_arg="$ol_val"
1227                 fi
1228         done
1229         if test "$ol_arg" = "invalid" ; then
1230                 { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; }
1231         fi
1232         ol_enable_dns="$ol_arg"
1233
1234 else
1235         ol_enable_dns="no"
1236 fi
1237 # end --enable-dns
1238 # OpenLDAP --enable-referrals
1239         # Check whether --enable-referrals or --disable-referrals was given.
1240 if test "${enable_referrals+set}" = set; then
1241   enableval="$enable_referrals"
1242   
1243         ol_arg=invalid
1244         for ol_val in auto yes no ; do
1245                 if test "$enableval" = "$ol_val" ; then
1246                         ol_arg="$ol_val"
1247                 fi
1248         done
1249         if test "$ol_arg" = "invalid" ; then
1250                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1251         fi
1252         ol_enable_referrals="$ol_arg"
1253
1254 else
1255         ol_enable_referrals="yes"
1256 fi
1257 # end --enable-referrals
1258 # OpenLDAP --enable-cldap
1259         # Check whether --enable-cldap or --disable-cldap was given.
1260 if test "${enable_cldap+set}" = set; then
1261   enableval="$enable_cldap"
1262   
1263         ol_arg=invalid
1264         for ol_val in auto yes no ; do
1265                 if test "$enableval" = "$ol_val" ; then
1266                         ol_arg="$ol_val"
1267                 fi
1268         done
1269         if test "$ol_arg" = "invalid" ; then
1270                 { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; }
1271         fi
1272         ol_enable_cldap="$ol_arg"
1273
1274 else
1275         ol_enable_cldap="no"
1276 fi
1277 # end --enable-cldap
1278 # OpenLDAP --enable-x_compile
1279         # Check whether --enable-x_compile or --disable-x_compile was given.
1280 if test "${enable_x_compile+set}" = set; then
1281   enableval="$enable_x_compile"
1282   
1283         ol_arg=invalid
1284         for ol_val in yes no ; do
1285                 if test "$enableval" = "$ol_val" ; then
1286                         ol_arg="$ol_val"
1287                 fi
1288         done
1289         if test "$ol_arg" = "invalid" ; then
1290                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1291         fi
1292         ol_enable_x_compile="$ol_arg"
1293
1294 else
1295         ol_enable_x_compile="no"
1296 fi
1297 # end --enable-x_compile
1298
1299 # OpenLDAP --enable-dmalloc
1300         # Check whether --enable-dmalloc or --disable-dmalloc was given.
1301 if test "${enable_dmalloc+set}" = set; then
1302   enableval="$enable_dmalloc"
1303   
1304         ol_arg=invalid
1305         for ol_val in auto yes no ; do
1306                 if test "$enableval" = "$ol_val" ; then
1307                         ol_arg="$ol_val"
1308                 fi
1309         done
1310         if test "$ol_arg" = "invalid" ; then
1311                 { echo "configure: error: bad value $enableval for --enable-dmalloc" 1>&2; exit 1; }
1312         fi
1313         ol_enable_dmalloc="$ol_arg"
1314
1315 else
1316         ol_enable_dmalloc="no"
1317 fi
1318 # end --enable-dmalloc
1319
1320 # OpenLDAP --with-cyrus_sasl
1321         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1322 if test "${with_cyrus_sasl+set}" = set; then
1323   withval="$with_cyrus_sasl"
1324   
1325         ol_arg=invalid
1326         for ol_val in auto yes no  ; do
1327                 if test "$withval" = "$ol_val" ; then
1328                         ol_arg="$ol_val"
1329                 fi
1330         done
1331         if test "$ol_arg" = "invalid" ; then
1332                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1333         fi
1334         ol_with_cyrus_sasl="$ol_arg"
1335
1336 else
1337         ol_with_cyrus_sasl="auto"
1338 fi
1339 # end --with-cyrus_sasl
1340
1341 # OpenLDAP --with-fetch
1342         # Check whether --with-fetch or --without-fetch was given.
1343 if test "${with_fetch+set}" = set; then
1344   withval="$with_fetch"
1345   
1346         ol_arg=invalid
1347         for ol_val in auto yes no  ; do
1348                 if test "$withval" = "$ol_val" ; then
1349                         ol_arg="$ol_val"
1350                 fi
1351         done
1352         if test "$ol_arg" = "invalid" ; then
1353                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1354         fi
1355         ol_with_fetch="$ol_arg"
1356
1357 else
1358         ol_with_fetch="auto"
1359 fi
1360 # end --with-fetch
1361
1362 # OpenLDAP --with-kerberos
1363         # Check whether --with-kerberos or --without-kerberos was given.
1364 if test "${with_kerberos+set}" = set; then
1365   withval="$with_kerberos"
1366   
1367         ol_arg=invalid
1368         for ol_val in auto k5 k4 afs yes no ; do
1369                 if test "$withval" = "$ol_val" ; then
1370                         ol_arg="$ol_val"
1371                 fi
1372         done
1373         if test "$ol_arg" = "invalid" ; then
1374                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1375         fi
1376         ol_with_kerberos="$ol_arg"
1377
1378 else
1379         ol_with_kerberos="auto"
1380 fi
1381 # end --with-kerberos
1382
1383 # OpenLDAP --with-readline
1384         # Check whether --with-readline or --without-readline was given.
1385 if test "${with_readline+set}" = set; then
1386   withval="$with_readline"
1387   
1388         ol_arg=invalid
1389         for ol_val in auto yes no  ; do
1390                 if test "$withval" = "$ol_val" ; then
1391                         ol_arg="$ol_val"
1392                 fi
1393         done
1394         if test "$ol_arg" = "invalid" ; then
1395                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1396         fi
1397         ol_with_readline="$ol_arg"
1398
1399 else
1400         ol_with_readline="auto"
1401 fi
1402 # end --with-readline
1403
1404 # OpenLDAP --with-threads
1405         # Check whether --with-threads or --without-threads was given.
1406 if test "${with_threads+set}" = set; then
1407   withval="$with_threads"
1408   
1409         ol_arg=invalid
1410         for ol_val in auto posix mach lwp yes no manual  ; do
1411                 if test "$withval" = "$ol_val" ; then
1412                         ol_arg="$ol_val"
1413                 fi
1414         done
1415         if test "$ol_arg" = "invalid" ; then
1416                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1417         fi
1418         ol_with_threads="$ol_arg"
1419
1420 else
1421         ol_with_threads="auto"
1422 fi
1423 # end --with-threads
1424
1425 # OpenLDAP --with-tls
1426         # Check whether --with-tls or --without-tls was given.
1427 if test "${with_tls+set}" = set; then
1428   withval="$with_tls"
1429   
1430         ol_arg=invalid
1431         for ol_val in auto ssleay openssl yes no  ; do
1432                 if test "$withval" = "$ol_val" ; then
1433                         ol_arg="$ol_val"
1434                 fi
1435         done
1436         if test "$ol_arg" = "invalid" ; then
1437                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1438         fi
1439         ol_with_tls="$ol_arg"
1440
1441 else
1442         ol_with_tls="auto"
1443 fi
1444 # end --with-tls
1445
1446 # OpenLDAP --with-yielding_select
1447         # Check whether --with-yielding_select or --without-yielding_select was given.
1448 if test "${with_yielding_select+set}" = set; then
1449   withval="$with_yielding_select"
1450   
1451         ol_arg=invalid
1452         for ol_val in auto yes no manual  ; do
1453                 if test "$withval" = "$ol_val" ; then
1454                         ol_arg="$ol_val"
1455                 fi
1456         done
1457         if test "$ol_arg" = "invalid" ; then
1458                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1459         fi
1460         ol_with_yielding_select="$ol_arg"
1461
1462 else
1463         ol_with_yielding_select="auto"
1464 fi
1465 # end --with-yielding_select
1466
1467
1468
1469 # Check whether --with-xxldapdoptions or --without-xxldapdoptions was given.
1470 if test "${with_xxldapdoptions+set}" = set; then
1471   withval="$with_xxldapdoptions"
1472   :
1473 fi
1474
1475 # OpenLDAP --enable-ldapd
1476         # Check whether --enable-ldapd or --disable-ldapd was given.
1477 if test "${enable_ldapd+set}" = set; then
1478   enableval="$enable_ldapd"
1479   
1480         ol_arg=invalid
1481         for ol_val in auto yes no ; do
1482                 if test "$enableval" = "$ol_val" ; then
1483                         ol_arg="$ol_val"
1484                 fi
1485         done
1486         if test "$ol_arg" = "invalid" ; then
1487                 { echo "configure: error: bad value $enableval for --enable-ldapd" 1>&2; exit 1; }
1488         fi
1489         ol_enable_ldapd="$ol_arg"
1490
1491 else
1492         ol_enable_ldapd="no"
1493 fi
1494 # end --enable-ldapd
1495
1496 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1497 if test "${with_xxslapdoptions+set}" = set; then
1498   withval="$with_xxslapdoptions"
1499   :
1500 fi
1501
1502 # OpenLDAP --enable-slapd
1503         # Check whether --enable-slapd or --disable-slapd was given.
1504 if test "${enable_slapd+set}" = set; then
1505   enableval="$enable_slapd"
1506   
1507         ol_arg=invalid
1508         for ol_val in auto yes no ; do
1509                 if test "$enableval" = "$ol_val" ; then
1510                         ol_arg="$ol_val"
1511                 fi
1512         done
1513         if test "$ol_arg" = "invalid" ; then
1514                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1515         fi
1516         ol_enable_slapd="$ol_arg"
1517
1518 else
1519         ol_enable_slapd="yes"
1520 fi
1521 # end --enable-slapd
1522 # OpenLDAP --enable-cleartext
1523         # Check whether --enable-cleartext or --disable-cleartext was given.
1524 if test "${enable_cleartext+set}" = set; then
1525   enableval="$enable_cleartext"
1526   
1527         ol_arg=invalid
1528         for ol_val in auto yes no ; do
1529                 if test "$enableval" = "$ol_val" ; then
1530                         ol_arg="$ol_val"
1531                 fi
1532         done
1533         if test "$ol_arg" = "invalid" ; then
1534                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1535         fi
1536         ol_enable_cleartext="$ol_arg"
1537
1538 else
1539         ol_enable_cleartext="yes"
1540 fi
1541 # end --enable-cleartext
1542 # OpenLDAP --enable-crypt
1543         # Check whether --enable-crypt or --disable-crypt was given.
1544 if test "${enable_crypt+set}" = set; then
1545   enableval="$enable_crypt"
1546   
1547         ol_arg=invalid
1548         for ol_val in auto yes no ; do
1549                 if test "$enableval" = "$ol_val" ; then
1550                         ol_arg="$ol_val"
1551                 fi
1552         done
1553         if test "$ol_arg" = "invalid" ; then
1554                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1555         fi
1556         ol_enable_crypt="$ol_arg"
1557
1558 else
1559         ol_enable_crypt="auto"
1560 fi
1561 # end --enable-crypt
1562 # OpenLDAP --enable-modules
1563         # Check whether --enable-modules or --disable-modules was given.
1564 if test "${enable_modules+set}" = set; then
1565   enableval="$enable_modules"
1566   
1567         ol_arg=invalid
1568         for ol_val in auto yes no ; do
1569                 if test "$enableval" = "$ol_val" ; then
1570                         ol_arg="$ol_val"
1571                 fi
1572         done
1573         if test "$ol_arg" = "invalid" ; then
1574                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1575         fi
1576         ol_enable_modules="$ol_arg"
1577
1578 else
1579         ol_enable_modules="no"
1580 fi
1581 # end --enable-modules
1582 # OpenLDAP --enable-multimaster
1583         # Check whether --enable-multimaster or --disable-multimaster was given.
1584 if test "${enable_multimaster+set}" = set; then
1585   enableval="$enable_multimaster"
1586   
1587         ol_arg=invalid
1588         for ol_val in auto yes no ; do
1589                 if test "$enableval" = "$ol_val" ; then
1590                         ol_arg="$ol_val"
1591                 fi
1592         done
1593         if test "$ol_arg" = "invalid" ; then
1594                 { echo "configure: error: bad value $enableval for --enable-multimaster" 1>&2; exit 1; }
1595         fi
1596         ol_enable_multimaster="$ol_arg"
1597
1598 else
1599         ol_enable_multimaster="no"
1600 fi
1601 # end --enable-multimaster
1602 # OpenLDAP --enable-phonetic
1603         # Check whether --enable-phonetic or --disable-phonetic was given.
1604 if test "${enable_phonetic+set}" = set; then
1605   enableval="$enable_phonetic"
1606   
1607         ol_arg=invalid
1608         for ol_val in auto yes no ; do
1609                 if test "$enableval" = "$ol_val" ; then
1610                         ol_arg="$ol_val"
1611                 fi
1612         done
1613         if test "$ol_arg" = "invalid" ; then
1614                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1615         fi
1616         ol_enable_phonetic="$ol_arg"
1617
1618 else
1619         ol_enable_phonetic="no"
1620 fi
1621 # end --enable-phonetic
1622 # OpenLDAP --enable-quipu
1623         # Check whether --enable-quipu or --disable-quipu was given.
1624 if test "${enable_quipu+set}" = set; then
1625   enableval="$enable_quipu"
1626   
1627         ol_arg=invalid
1628         for ol_val in auto yes no ; do
1629                 if test "$enableval" = "$ol_val" ; then
1630                         ol_arg="$ol_val"
1631                 fi
1632         done
1633         if test "$ol_arg" = "invalid" ; then
1634                 { echo "configure: error: bad value $enableval for --enable-quipu" 1>&2; exit 1; }
1635         fi
1636         ol_enable_quipu="$ol_arg"
1637
1638 else
1639         ol_enable_quipu="no"
1640 fi
1641 # end --enable-quipu
1642 # OpenLDAP --enable-rlookups
1643         # Check whether --enable-rlookups or --disable-rlookups was given.
1644 if test "${enable_rlookups+set}" = set; then
1645   enableval="$enable_rlookups"
1646   
1647         ol_arg=invalid
1648         for ol_val in auto yes no ; do
1649                 if test "$enableval" = "$ol_val" ; then
1650                         ol_arg="$ol_val"
1651                 fi
1652         done
1653         if test "$ol_arg" = "invalid" ; then
1654                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1655         fi
1656         ol_enable_rlookups="$ol_arg"
1657
1658 else
1659         ol_enable_rlookups="auto"
1660 fi
1661 # end --enable-rlookups
1662 # OpenLDAP --enable-wrappers
1663         # Check whether --enable-wrappers or --disable-wrappers was given.
1664 if test "${enable_wrappers+set}" = set; then
1665   enableval="$enable_wrappers"
1666   
1667         ol_arg=invalid
1668         for ol_val in auto yes no ; do
1669                 if test "$enableval" = "$ol_val" ; then
1670                         ol_arg="$ol_val"
1671                 fi
1672         done
1673         if test "$ol_arg" = "invalid" ; then
1674                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1675         fi
1676         ol_enable_wrappers="$ol_arg"
1677
1678 else
1679         ol_enable_wrappers="no"
1680 fi
1681 # end --enable-wrappers
1682
1683 # OpenLDAP --enable-bdb2
1684         # Check whether --enable-bdb2 or --disable-bdb2 was given.
1685 if test "${enable_bdb2+set}" = set; then
1686   enableval="$enable_bdb2"
1687   
1688         ol_arg=invalid
1689         for ol_val in auto yes no ; do
1690                 if test "$enableval" = "$ol_val" ; then
1691                         ol_arg="$ol_val"
1692                 fi
1693         done
1694         if test "$ol_arg" = "invalid" ; then
1695                 { echo "configure: error: bad value $enableval for --enable-bdb2" 1>&2; exit 1; }
1696         fi
1697         ol_enable_bdb2="$ol_arg"
1698
1699 else
1700         ol_enable_bdb2="no"
1701 fi
1702 # end --enable-bdb2
1703 # OpenLDAP --with-bdb2_module
1704         # Check whether --with-bdb2_module or --without-bdb2_module was given.
1705 if test "${with_bdb2_module+set}" = set; then
1706   withval="$with_bdb2_module"
1707   
1708         ol_arg=invalid
1709         for ol_val in static dynamic ; do
1710                 if test "$withval" = "$ol_val" ; then
1711                         ol_arg="$ol_val"
1712                 fi
1713         done
1714         if test "$ol_arg" = "invalid" ; then
1715                 { echo "configure: error: bad value $withval for --with-bdb2_module" 1>&2; exit 1; }
1716         fi
1717         ol_with_bdb2_module="$ol_arg"
1718
1719 else
1720         ol_with_bdb2_module="static"
1721 fi
1722 # end --with-bdb2_module
1723
1724 # OpenLDAP --enable-ldap
1725         # Check whether --enable-ldap or --disable-ldap was given.
1726 if test "${enable_ldap+set}" = set; then
1727   enableval="$enable_ldap"
1728   
1729         ol_arg=invalid
1730         for ol_val in auto yes no ; do
1731                 if test "$enableval" = "$ol_val" ; then
1732                         ol_arg="$ol_val"
1733                 fi
1734         done
1735         if test "$ol_arg" = "invalid" ; then
1736                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1737         fi
1738         ol_enable_ldap="$ol_arg"
1739
1740 else
1741         ol_enable_ldap="no"
1742 fi
1743 # end --enable-ldap
1744 # OpenLDAP --with-ldap_module
1745         # Check whether --with-ldap_module or --without-ldap_module was given.
1746 if test "${with_ldap_module+set}" = set; then
1747   withval="$with_ldap_module"
1748   
1749         ol_arg=invalid
1750         for ol_val in static dynamic ; do
1751                 if test "$withval" = "$ol_val" ; then
1752                         ol_arg="$ol_val"
1753                 fi
1754         done
1755         if test "$ol_arg" = "invalid" ; then
1756                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
1757         fi
1758         ol_with_ldap_module="$ol_arg"
1759
1760 else
1761         ol_with_ldap_module="static"
1762 fi
1763 # end --with-ldap_module
1764
1765 # OpenLDAP --enable-ldbm
1766         # Check whether --enable-ldbm or --disable-ldbm was given.
1767 if test "${enable_ldbm+set}" = set; then
1768   enableval="$enable_ldbm"
1769   
1770         ol_arg=invalid
1771         for ol_val in auto yes no ; do
1772                 if test "$enableval" = "$ol_val" ; then
1773                         ol_arg="$ol_val"
1774                 fi
1775         done
1776         if test "$ol_arg" = "invalid" ; then
1777                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1778         fi
1779         ol_enable_ldbm="$ol_arg"
1780
1781 else
1782         ol_enable_ldbm="yes"
1783 fi
1784 # end --enable-ldbm
1785 # OpenLDAP --with-ldbm_module
1786         # Check whether --with-ldbm_module or --without-ldbm_module was given.
1787 if test "${with_ldbm_module+set}" = set; then
1788   withval="$with_ldbm_module"
1789   
1790         ol_arg=invalid
1791         for ol_val in static dynamic ; do
1792                 if test "$withval" = "$ol_val" ; then
1793                         ol_arg="$ol_val"
1794                 fi
1795         done
1796         if test "$ol_arg" = "invalid" ; then
1797                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
1798         fi
1799         ol_with_ldbm_module="$ol_arg"
1800
1801 else
1802         ol_with_ldbm_module="static"
1803 fi
1804 # end --with-ldbm_module
1805
1806 # OpenLDAP --with-ldbm_api
1807         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1808 if test "${with_ldbm_api+set}" = set; then
1809   withval="$with_ldbm_api"
1810   
1811         ol_arg=invalid
1812         for ol_val in auto db2 db mdbm gdbm ndbm manual ; do
1813                 if test "$withval" = "$ol_val" ; then
1814                         ol_arg="$ol_val"
1815                 fi
1816         done
1817         if test "$ol_arg" = "invalid" ; then
1818                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1819         fi
1820         ol_with_ldbm_api="$ol_arg"
1821
1822 else
1823         ol_with_ldbm_api="auto"
1824 fi
1825 # end --with-ldbm_api
1826
1827 # OpenLDAP --with-ldbm_type
1828         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1829 if test "${with_ldbm_type+set}" = set; then
1830   withval="$with_ldbm_type"
1831   
1832         ol_arg=invalid
1833         for ol_val in auto btree hash ; do
1834                 if test "$withval" = "$ol_val" ; then
1835                         ol_arg="$ol_val"
1836                 fi
1837         done
1838         if test "$ol_arg" = "invalid" ; then
1839                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1840         fi
1841         ol_with_ldbm_type="$ol_arg"
1842
1843 else
1844         ol_with_ldbm_type="auto"
1845 fi
1846 # end --with-ldbm_type
1847
1848
1849 # OpenLDAP --enable-passwd
1850         # Check whether --enable-passwd or --disable-passwd was given.
1851 if test "${enable_passwd+set}" = set; then
1852   enableval="$enable_passwd"
1853   
1854         ol_arg=invalid
1855         for ol_val in auto yes no ; do
1856                 if test "$enableval" = "$ol_val" ; then
1857                         ol_arg="$ol_val"
1858                 fi
1859         done
1860         if test "$ol_arg" = "invalid" ; then
1861                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1862         fi
1863         ol_enable_passwd="$ol_arg"
1864
1865 else
1866         ol_enable_passwd="no"
1867 fi
1868 # end --enable-passwd
1869 # OpenLDAP --with-passwd_module
1870         # Check whether --with-passwd_module or --without-passwd_module was given.
1871 if test "${with_passwd_module+set}" = set; then
1872   withval="$with_passwd_module"
1873   
1874         ol_arg=invalid
1875         for ol_val in static dynamic ; do
1876                 if test "$withval" = "$ol_val" ; then
1877                         ol_arg="$ol_val"
1878                 fi
1879         done
1880         if test "$ol_arg" = "invalid" ; then
1881                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
1882         fi
1883         ol_with_passwd_module="$ol_arg"
1884
1885 else
1886         ol_with_passwd_module="static"
1887 fi
1888 # end --with-passwd_module
1889
1890 # OpenLDAP --enable-perl
1891         # Check whether --enable-perl or --disable-perl was given.
1892 if test "${enable_perl+set}" = set; then
1893   enableval="$enable_perl"
1894   
1895         ol_arg=invalid
1896         for ol_val in auto yes no ; do
1897                 if test "$enableval" = "$ol_val" ; then
1898                         ol_arg="$ol_val"
1899                 fi
1900         done
1901         if test "$ol_arg" = "invalid" ; then
1902                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
1903         fi
1904         ol_enable_perl="$ol_arg"
1905
1906 else
1907         ol_enable_perl="no"
1908 fi
1909 # end --enable-perl
1910 # OpenLDAP --with-perl_module
1911         # Check whether --with-perl_module or --without-perl_module was given.
1912 if test "${with_perl_module+set}" = set; then
1913   withval="$with_perl_module"
1914   
1915         ol_arg=invalid
1916         for ol_val in static dynamic ; do
1917                 if test "$withval" = "$ol_val" ; then
1918                         ol_arg="$ol_val"
1919                 fi
1920         done
1921         if test "$ol_arg" = "invalid" ; then
1922                 { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; }
1923         fi
1924         ol_with_perl_module="$ol_arg"
1925
1926 else
1927         ol_with_perl_module="static"
1928 fi
1929 # end --with-perl_module
1930
1931 # OpenLDAP --enable-shell
1932         # Check whether --enable-shell or --disable-shell was given.
1933 if test "${enable_shell+set}" = set; then
1934   enableval="$enable_shell"
1935   
1936         ol_arg=invalid
1937         for ol_val in auto yes no ; do
1938                 if test "$enableval" = "$ol_val" ; then
1939                         ol_arg="$ol_val"
1940                 fi
1941         done
1942         if test "$ol_arg" = "invalid" ; then
1943                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
1944         fi
1945         ol_enable_shell="$ol_arg"
1946
1947 else
1948         ol_enable_shell="no"
1949 fi
1950 # end --enable-shell
1951 # OpenLDAP --with-shell_module
1952         # Check whether --with-shell_module or --without-shell_module was given.
1953 if test "${with_shell_module+set}" = set; then
1954   withval="$with_shell_module"
1955   
1956         ol_arg=invalid
1957         for ol_val in static dynamic ; do
1958                 if test "$withval" = "$ol_val" ; then
1959                         ol_arg="$ol_val"
1960                 fi
1961         done
1962         if test "$ol_arg" = "invalid" ; then
1963                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
1964         fi
1965         ol_with_shell_module="$ol_arg"
1966
1967 else
1968         ol_with_shell_module="static"
1969 fi
1970 # end --with-shell_module
1971
1972 # OpenLDAP --enable-tcl
1973         # Check whether --enable-tcl or --disable-tcl was given.
1974 if test "${enable_tcl+set}" = set; then
1975   enableval="$enable_tcl"
1976   
1977         ol_arg=invalid
1978         for ol_val in auto yes no ; do
1979                 if test "$enableval" = "$ol_val" ; then
1980                         ol_arg="$ol_val"
1981                 fi
1982         done
1983         if test "$ol_arg" = "invalid" ; then
1984                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
1985         fi
1986         ol_enable_tcl="$ol_arg"
1987
1988 else
1989         ol_enable_tcl="no"
1990 fi
1991 # end --enable-tcl
1992 # OpenLDAP --with-tcl_module
1993         # Check whether --with-tcl_module or --without-tcl_module was given.
1994 if test "${with_tcl_module+set}" = set; then
1995   withval="$with_tcl_module"
1996   
1997         ol_arg=invalid
1998         for ol_val in static dynamic ; do
1999                 if test "$withval" = "$ol_val" ; then
2000                         ol_arg="$ol_val"
2001                 fi
2002         done
2003         if test "$ol_arg" = "invalid" ; then
2004                 { echo "configure: error: bad value $withval for --with-tcl_module" 1>&2; exit 1; }
2005         fi
2006         ol_with_tcl_module="$ol_arg"
2007
2008 else
2009         ol_with_tcl_module="static"
2010 fi
2011 # end --with-tcl_module
2012
2013
2014 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2015 if test "${with_xxslurpdoptions+set}" = set; then
2016   withval="$with_xxslurpdoptions"
2017   :
2018 fi
2019
2020 # OpenLDAP --enable-slurpd
2021         # Check whether --enable-slurpd or --disable-slurpd was given.
2022 if test "${enable_slurpd+set}" = set; then
2023   enableval="$enable_slurpd"
2024   
2025         ol_arg=invalid
2026         for ol_val in auto yes no ; do
2027                 if test "$enableval" = "$ol_val" ; then
2028                         ol_arg="$ol_val"
2029                 fi
2030         done
2031         if test "$ol_arg" = "invalid" ; then
2032                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2033         fi
2034         ol_enable_slurpd="$ol_arg"
2035
2036 else
2037         ol_enable_slurpd="auto"
2038 fi
2039 # end --enable-slurpd
2040
2041 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2042 if test "${with_xxliboptions+set}" = set; then
2043   withval="$with_xxliboptions"
2044   :
2045 fi
2046
2047 # Check whether --enable-static or --disable-static was given.
2048 if test "${enable_static+set}" = set; then
2049   enableval="$enable_static"
2050   p=${PACKAGE-default}
2051 case "$enableval" in
2052 yes) enable_static=yes ;;
2053 no) enable_static=no ;;
2054 *)
2055   enable_static=no
2056   # Look at the argument we got.  We use all the common list separators.
2057   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2058   for pkg in $enableval; do
2059     if test "X$pkg" = "X$p"; then
2060       enable_static=yes
2061     fi
2062   done
2063   IFS="$ac_save_ifs"
2064   ;;
2065 esac
2066 else
2067   enable_static=yes
2068 fi
2069
2070 # Check whether --enable-shared or --disable-shared was given.
2071 if test "${enable_shared+set}" = set; then
2072   enableval="$enable_shared"
2073   p=${PACKAGE-default}
2074 case "$enableval" in
2075 yes) enable_shared=yes ;;
2076 no) enable_shared=no ;;
2077 *)
2078   enable_shared=no
2079   # Look at the argument we got.  We use all the common list separators.
2080   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2081   for pkg in $enableval; do
2082     if test "X$pkg" = "X$p"; then
2083       enable_shared=yes
2084     fi
2085   done
2086   IFS="$ac_save_ifs"
2087   ;;
2088 esac
2089 else
2090   enable_shared=yes
2091 fi
2092
2093
2094 # validate options
2095 if test $ol_enable_dns = yes ; then
2096         if test $ol_enable_referrals = no ; then
2097                 { echo "configure: error: DNS requires --enable-referrals" 1>&2; exit 1; }
2098         fi
2099         if test $ol_enable_referrals = auto ; then
2100                 echo "configure: warning: DNS requires referrals, adding --enable-referrals" 1>&2
2101                 ol_enable_referrals=yes
2102         fi
2103 fi
2104
2105 if test $ol_enable_slapd = no ; then
2106                 if test $ol_enable_bdb2 = yes ; then
2107                 echo "configure: warning: slapd disabled, ignoring --enable-bdb2 argument" 1>&2
2108         fi
2109         if test $ol_enable_ldap = yes ; then
2110                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2111         fi
2112         if test $ol_enable_ldbm = yes ; then
2113                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2114         fi
2115         if test $ol_enable_passwd = yes ; then
2116                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2117         fi
2118         if test $ol_enable_perl = yes ; then
2119                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
2120         fi
2121         if test $ol_enable_shell = yes ; then
2122                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2123         fi
2124         if test $ol_enable_tcl = yes ; then
2125                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
2126         fi
2127         if test $ol_enable_modules = yes ; then
2128                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2129         fi
2130         if test $ol_enable_multimaster = yes ; then
2131                 echo "configure: warning: slapd disabled, ignoring --enable-multimaster argument" 1>&2
2132         fi
2133         if test $ol_enable_wrappers = yes ; then
2134                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2135         fi
2136         if test $ol_enable_phonetic = yes ; then
2137                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2138         fi
2139         if test $ol_enable_quipu = yes ; then
2140                 echo "configure: warning: slapd disabled, ignoring --enable-quipu argument" 1>&2
2141         fi
2142         if test $ol_enable_rlookups = yes ; then
2143                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2144         fi
2145         if test $ol_with_ldbm_api != auto ; then
2146                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2147         fi
2148         if test $ol_with_ldbm_type != auto ; then
2149                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2150         fi
2151         if test $ol_with_bdb2_module != static ; then
2152                 echo "configure: warning: slapd disabled, ignoring --with-bdb2-module argument" 1>&2
2153         fi
2154         if test $ol_with_ldap_module != static ; then
2155                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2156         fi
2157         if test $ol_with_ldbm_module != static ; then
2158                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2159         fi
2160         if test $ol_with_passwd_module != static ; then
2161                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2162         fi
2163         if test $ol_with_perl_module != static ; then
2164                 echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
2165         fi
2166         if test $ol_with_shell_module != static ; then
2167                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2168         fi
2169         if test $ol_with_tcl_module != static ; then
2170                 echo "configure: warning: slapd disabled, ignoring --with-tcl-module argument" 1>&2
2171         fi
2172         if test $ol_enable_slurpd = yes ; then
2173                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2174         fi
2175
2176         # force settings to no
2177         ol_enable_bdb2=no
2178         ol_enable_ldap=no
2179         ol_enable_ldbm=no
2180         ol_enable_passwd=no
2181         ol_enable_perl=no
2182         ol_enable_shell=no
2183         ol_enable_tcl=no
2184
2185         ol_enable_modules=no
2186         ol_enable_multimaster=no
2187         ol_enable_phonetic=no
2188         ol_enable_quipu=no
2189         ol_enable_rlookups=no
2190         ol_enable_wrappers=no
2191
2192         ol_with_ldbm_api=no
2193         ol_with_ldbm_type=no
2194
2195         ol_with_bdb2_module=static
2196         ol_with_ldap_module=static
2197         ol_with_ldbm_module=static
2198         ol_with_passwd_module=static
2199         ol_with_perl_module=static
2200         ol_with_shell_module=static
2201         ol_with_tcl_module=static
2202
2203         ol_enable_slurpd=no
2204
2205 elif test $ol_enable_ldbm = no ; then
2206         
2207         if test $ol_with_ldbm_api != auto ; then
2208                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2209         fi
2210
2211         if test $ol_with_ldbm_type != auto ; then
2212                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2213         fi
2214
2215         if test $ol_with_ldbm_module != static ; then
2216                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2217         fi
2218
2219         if test $ol_enable_bdb2 = yes ; then
2220                 { echo "configure: error: BDB2 requires --enable-ldbm" 1>&2; exit 1; }
2221         fi
2222
2223         if test $ol_enable_modules != yes -a \
2224                 $ol_enable_ldap = no -a \
2225                 $ol_enable_passwd = no -a \
2226                 $ol_enable_perl = no -a \
2227                 $ol_enable_shell = no -a \
2228                 $ol_enable_tcl = no ; then
2229                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2230         fi
2231
2232         ol_with_ldbm_api=no
2233         ol_with_ldbm_type=no
2234         ol_with_ldbm_module=static
2235
2236 elif test $ol_enable_bdb2 = yes ; then
2237         
2238         if test $ol_with_ldbm_api != auto -a \
2239                 $ol_with_ldbm_api != db2 ; then
2240                 { echo "configure: error: BDB2 requires LDBM API DB2" 1>&2; exit 1; }
2241         fi
2242
2243         ol_with_ldbm_api=db2
2244
2245 else
2246         
2247         if test $ol_enable_bdb2 != no ; then
2248                 if test $ol_with_ldbm_api != auto -a \
2249                         $ol_with_ldbm_api != db2 ; then
2250                         echo "configure: warning: BDB2 requires LDBM api db2 or auto" 1>&2
2251                         ol_enable_bdb2=no
2252                 fi
2253         fi
2254
2255         if test $ol_with_ldbm_api = gdbm -a \
2256                 $ol_with_ldbm_type = btree ; then
2257                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2258         fi
2259         if test $ol_with_ldbm_api = mdbm -a \
2260                 $ol_with_ldbm_type = btree ; then
2261                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2262         fi
2263         if test $ol_with_ldbm_api = ndbm -a \
2264                 $ol_with_ldbm_type = btree ; then
2265                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2266         fi
2267 fi
2268
2269 if test $ol_enable_slurpd = yes ; then
2270                 if test $ol_with_threads = no ; then
2271                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2272         fi
2273 fi
2274
2275 echo "$ac_t""done" 1>&6
2276
2277 ## Initialize vars
2278 LDAP_LIBS=
2279 LDIF_LIBS=
2280 LDBM_LIBS=
2281 LTHREAD_LIBS=
2282 LUTIL_LIBS=
2283
2284 LDAPD_LIBS=
2285 SLAPD_LIBS=
2286 SLURPD_LIBS=
2287
2288 BUILD_LDAPD=no
2289 BUILD_SLAPD=no
2290 BUILD_SLURPD=no
2291
2292 BUILD_BDB2=no
2293 BUILD_LDAP=no
2294 BUILD_LDBM=no
2295 BUILD_PASSWD=no
2296 BUILD_PERL=no
2297 BUILD_QUIPU=no
2298 BUILD_SHELL=no
2299 BUILD_TCL=no
2300 BUILD_THREAD=no
2301
2302 BUILD_BDB2_DYNAMIC=no
2303 BUILD_LDAP_DYNAMIC=no
2304 BUILD_LDBM_DYNAMIC=no
2305 BUILD_PASSWD_DYNAMIC=no
2306 BUILD_PERL_DYNAMIC=no
2307 BUILD_SHELL_DYNAMIC=no
2308 BUILD_TCL_DYNAMIC=no
2309
2310 SLAPD_MODULES_LDFLAGS=
2311 SLAPD_MODULES_CPPFLAGS=
2312
2313 SLAPD_PERL_LDFLAGS=
2314 SLAPD_PERL_CPPFLAGS=
2315
2316 KRB_LIBS=
2317 READLINE_LIBS=
2318 SASL_LIBS=
2319 TERMCAP_LIBS=
2320 TLS_LIBS=
2321
2322
2323
2324 cat >> confdefs.h <<\EOF
2325 #define HAVE_MKVERSION 1
2326 EOF
2327
2328
2329
2330
2331
2332 ol_aix_threads=no
2333 case "$target" in
2334 *-*-aix*)       if test -z "$CC" ; then
2335                 case "$ol_with_threads" in
2336                 auto | yes |  posix) ol_aix_threads=yes ;;
2337                 esac
2338         fi
2339 ;;
2340 esac
2341
2342 if test $ol_aix_threads = yes ; then
2343         if test -z "${CC}" ; then
2344                 for ac_prog in cc_r xlc_r cc
2345 do
2346 # Extract the first word of "$ac_prog", so it can be a program name with args.
2347 set dummy $ac_prog; ac_word=$2
2348 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2349 echo "configure:2350: checking for $ac_word" >&5
2350 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2351   echo $ac_n "(cached) $ac_c" 1>&6
2352 else
2353   if test -n "$CC"; then
2354   ac_cv_prog_CC="$CC" # Let the user override the test.
2355 else
2356   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2357   ac_dummy="$PATH"
2358   for ac_dir in $ac_dummy; do
2359     test -z "$ac_dir" && ac_dir=.
2360     if test -f $ac_dir/$ac_word; then
2361       ac_cv_prog_CC="$ac_prog"
2362       break
2363     fi
2364   done
2365   IFS="$ac_save_ifs"
2366 fi
2367 fi
2368 CC="$ac_cv_prog_CC"
2369 if test -n "$CC"; then
2370   echo "$ac_t""$CC" 1>&6
2371 else
2372   echo "$ac_t""no" 1>&6
2373 fi
2374
2375 test -n "$CC" && break
2376 done
2377
2378
2379                 if test "$CC" = cc ; then
2380                                                 if test $ol_with_threads != auto ; then
2381                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2382                         else
2383                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2384                         fi
2385                         ol_with_threads=no
2386                 fi
2387         fi
2388
2389         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2390                 ol_with_threads=posix
2391                 ol_cv_pthread_create=yes
2392         fi
2393 fi
2394
2395 if test -z "${CC}"; then
2396         for ac_prog in cc
2397 do
2398 # Extract the first word of "$ac_prog", so it can be a program name with args.
2399 set dummy $ac_prog; ac_word=$2
2400 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2401 echo "configure:2402: checking for $ac_word" >&5
2402 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2403   echo $ac_n "(cached) $ac_c" 1>&6
2404 else
2405   if test -n "$CC"; then
2406   ac_cv_prog_CC="$CC" # Let the user override the test.
2407 else
2408   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2409   ac_dummy="$PATH"
2410   for ac_dir in $ac_dummy; do
2411     test -z "$ac_dir" && ac_dir=.
2412     if test -f $ac_dir/$ac_word; then
2413       ac_cv_prog_CC="$ac_prog"
2414       break
2415     fi
2416   done
2417   IFS="$ac_save_ifs"
2418 fi
2419 fi
2420 CC="$ac_cv_prog_CC"
2421 if test -n "$CC"; then
2422   echo "$ac_t""$CC" 1>&6
2423 else
2424   echo "$ac_t""no" 1>&6
2425 fi
2426
2427 test -n "$CC" && break
2428 done
2429
2430 fi
2431
2432
2433 # Check whether --enable-fast-install or --disable-fast-install was given.
2434 if test "${enable_fast_install+set}" = set; then
2435   enableval="$enable_fast_install"
2436   p=${PACKAGE-default}
2437 case "$enableval" in
2438 yes) enable_fast_install=yes ;;
2439 no) enable_fast_install=no ;;
2440 *)
2441   enable_fast_install=no
2442   # Look at the argument we got.  We use all the common list separators.
2443   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2444   for pkg in $enableval; do
2445     if test "X$pkg" = "X$p"; then
2446       enable_fast_install=yes
2447     fi
2448   done
2449   IFS="$ac_save_ifs"
2450   ;;
2451 esac
2452 else
2453   enable_fast_install=yes
2454 fi
2455
2456 # Extract the first word of "ranlib", so it can be a program name with args.
2457 set dummy ranlib; ac_word=$2
2458 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2459 echo "configure:2460: checking for $ac_word" >&5
2460 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
2461   echo $ac_n "(cached) $ac_c" 1>&6
2462 else
2463   if test -n "$RANLIB"; then
2464   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2465 else
2466   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2467   ac_dummy="$PATH"
2468   for ac_dir in $ac_dummy; do
2469     test -z "$ac_dir" && ac_dir=.
2470     if test -f $ac_dir/$ac_word; then
2471       ac_cv_prog_RANLIB="ranlib"
2472       break
2473     fi
2474   done
2475   IFS="$ac_save_ifs"
2476   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2477 fi
2478 fi
2479 RANLIB="$ac_cv_prog_RANLIB"
2480 if test -n "$RANLIB"; then
2481   echo "$ac_t""$RANLIB" 1>&6
2482 else
2483   echo "$ac_t""no" 1>&6
2484 fi
2485
2486 # Extract the first word of "gcc", so it can be a program name with args.
2487 set dummy gcc; ac_word=$2
2488 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2489 echo "configure:2490: checking for $ac_word" >&5
2490 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2491   echo $ac_n "(cached) $ac_c" 1>&6
2492 else
2493   if test -n "$CC"; then
2494   ac_cv_prog_CC="$CC" # Let the user override the test.
2495 else
2496   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2497   ac_dummy="$PATH"
2498   for ac_dir in $ac_dummy; do
2499     test -z "$ac_dir" && ac_dir=.
2500     if test -f $ac_dir/$ac_word; then
2501       ac_cv_prog_CC="gcc"
2502       break
2503     fi
2504   done
2505   IFS="$ac_save_ifs"
2506 fi
2507 fi
2508 CC="$ac_cv_prog_CC"
2509 if test -n "$CC"; then
2510   echo "$ac_t""$CC" 1>&6
2511 else
2512   echo "$ac_t""no" 1>&6
2513 fi
2514
2515 if test -z "$CC"; then
2516   # Extract the first word of "cc", so it can be a program name with args.
2517 set dummy cc; ac_word=$2
2518 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2519 echo "configure:2520: checking for $ac_word" >&5
2520 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2521   echo $ac_n "(cached) $ac_c" 1>&6
2522 else
2523   if test -n "$CC"; then
2524   ac_cv_prog_CC="$CC" # Let the user override the test.
2525 else
2526   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2527   ac_prog_rejected=no
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       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2533         ac_prog_rejected=yes
2534         continue
2535       fi
2536       ac_cv_prog_CC="cc"
2537       break
2538     fi
2539   done
2540   IFS="$ac_save_ifs"
2541 if test $ac_prog_rejected = yes; then
2542   # We found a bogon in the path, so make sure we never use it.
2543   set dummy $ac_cv_prog_CC
2544   shift
2545   if test $# -gt 0; then
2546     # We chose a different compiler from the bogus one.
2547     # However, it has the same basename, so the bogon will be chosen
2548     # first if we set CC to just the basename; use the full file name.
2549     shift
2550     set dummy "$ac_dir/$ac_word" "$@"
2551     shift
2552     ac_cv_prog_CC="$@"
2553   fi
2554 fi
2555 fi
2556 fi
2557 CC="$ac_cv_prog_CC"
2558 if test -n "$CC"; then
2559   echo "$ac_t""$CC" 1>&6
2560 else
2561   echo "$ac_t""no" 1>&6
2562 fi
2563
2564   if test -z "$CC"; then
2565     case "`uname -s`" in
2566     *win32* | *WIN32* | *CYGWIN*)
2567       # Extract the first word of "cl", so it can be a program name with args.
2568 set dummy cl; ac_word=$2
2569 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2570 echo "configure:2571: checking for $ac_word" >&5
2571 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2572   echo $ac_n "(cached) $ac_c" 1>&6
2573 else
2574   if test -n "$CC"; then
2575   ac_cv_prog_CC="$CC" # Let the user override the test.
2576 else
2577   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2578   ac_dummy="$PATH"
2579   for ac_dir in $ac_dummy; do
2580     test -z "$ac_dir" && ac_dir=.
2581     if test -f $ac_dir/$ac_word; then
2582       ac_cv_prog_CC="cl"
2583       break
2584     fi
2585   done
2586   IFS="$ac_save_ifs"
2587 fi
2588 fi
2589 CC="$ac_cv_prog_CC"
2590 if test -n "$CC"; then
2591   echo "$ac_t""$CC" 1>&6
2592 else
2593   echo "$ac_t""no" 1>&6
2594 fi
2595  ;;
2596     esac
2597   fi
2598   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2599 fi
2600
2601 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2602 echo "configure:2603: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
2603
2604 ac_ext=c
2605 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2606 ac_cpp='$CPP $CPPFLAGS'
2607 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2608 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2609 cross_compiling=$ac_cv_prog_cc_cross
2610
2611 cat > conftest.$ac_ext << EOF
2612
2613 #line 2614 "configure"
2614 #include "confdefs.h"
2615
2616 main(){return(0);}
2617 EOF
2618 if { (eval echo configure:2619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2619   ac_cv_prog_cc_works=yes
2620   # If we can't run a trivial program, we are probably using a cross compiler.
2621   if (./conftest; exit) 2>/dev/null; then
2622     ac_cv_prog_cc_cross=no
2623   else
2624     ac_cv_prog_cc_cross=yes
2625   fi
2626 else
2627   echo "configure: failed program was:" >&5
2628   cat conftest.$ac_ext >&5
2629   ac_cv_prog_cc_works=no
2630 fi
2631 rm -fr conftest*
2632 ac_ext=c
2633 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2634 ac_cpp='$CPP $CPPFLAGS'
2635 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2636 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2637 cross_compiling=$ac_cv_prog_cc_cross
2638
2639 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2640 if test $ac_cv_prog_cc_works = no; then
2641   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2642 fi
2643 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2644 echo "configure:2645: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
2645 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2646 cross_compiling=$ac_cv_prog_cc_cross
2647
2648 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2649 echo "configure:2650: checking whether we are using GNU C" >&5
2650 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
2651   echo $ac_n "(cached) $ac_c" 1>&6
2652 else
2653   cat > conftest.c <<EOF
2654 #ifdef __GNUC__
2655   yes;
2656 #endif
2657 EOF
2658 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2659: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2659   ac_cv_prog_gcc=yes
2660 else
2661   ac_cv_prog_gcc=no
2662 fi
2663 fi
2664
2665 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2666
2667 if test $ac_cv_prog_gcc = yes; then
2668   GCC=yes
2669 else
2670   GCC=
2671 fi
2672
2673 ac_test_CFLAGS="${CFLAGS+set}"
2674 ac_save_CFLAGS="$CFLAGS"
2675 CFLAGS=
2676 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2677 echo "configure:2678: checking whether ${CC-cc} accepts -g" >&5
2678 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
2679   echo $ac_n "(cached) $ac_c" 1>&6
2680 else
2681   echo 'void f(){}' > conftest.c
2682 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2683   ac_cv_prog_cc_g=yes
2684 else
2685   ac_cv_prog_cc_g=no
2686 fi
2687 rm -f conftest*
2688
2689 fi
2690
2691 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2692 if test "$ac_test_CFLAGS" = set; then
2693   CFLAGS="$ac_save_CFLAGS"
2694 elif test $ac_cv_prog_cc_g = yes; then
2695   if test "$GCC" = yes; then
2696     CFLAGS="-g -O2"
2697   else
2698     CFLAGS="-g"
2699   fi
2700 else
2701   if test "$GCC" = yes; then
2702     CFLAGS="-O2"
2703   else
2704     CFLAGS=
2705   fi
2706 fi
2707
2708 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2709 if test "${with_gnu_ld+set}" = set; then
2710   withval="$with_gnu_ld"
2711   test "$withval" = no || with_gnu_ld=yes
2712 else
2713   with_gnu_ld=no
2714 fi
2715
2716 ac_prog=ld
2717 if test "$ac_cv_prog_gcc" = yes; then
2718   # Check if gcc -print-prog-name=ld gives a path.
2719   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2720 echo "configure:2721: checking for ld used by GCC" >&5
2721   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2722   case "$ac_prog" in
2723     # Accept absolute paths.
2724     [\\/]* | [A-Za-z]:[\\/]*)
2725       re_direlt='/[^/][^/]*/\.\./'
2726       # Canonicalize the path of ld
2727       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2728       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2729         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2730       done
2731       test -z "$LD" && LD="$ac_prog"
2732       ;;
2733   "")
2734     # If it fails, then pretend we aren't using GCC.
2735     ac_prog=ld
2736     ;;
2737   *)
2738     # If it is relative, then search for the first ld in PATH.
2739     with_gnu_ld=unknown
2740     ;;
2741   esac
2742 elif test "$with_gnu_ld" = yes; then
2743   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2744 echo "configure:2745: checking for GNU ld" >&5
2745 else
2746   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2747 echo "configure:2748: checking for non-GNU ld" >&5
2748 fi
2749 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
2750   echo $ac_n "(cached) $ac_c" 1>&6
2751 else
2752   if test -z "$LD"; then
2753   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2754   for ac_dir in $PATH; do
2755     test -z "$ac_dir" && ac_dir=.
2756     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2757       ac_cv_path_LD="$ac_dir/$ac_prog"
2758       # Check to see if the program is GNU ld.  I'd rather use --version,
2759       # but apparently some GNU ld's only accept -v.
2760       # Break only if it was the GNU/non-GNU ld that we prefer.
2761       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2762         test "$with_gnu_ld" != no && break
2763       else
2764         test "$with_gnu_ld" != yes && break
2765       fi
2766     fi
2767   done
2768   IFS="$ac_save_ifs"
2769 else
2770   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2771 fi
2772 fi
2773
2774 LD="$ac_cv_path_LD"
2775 if test -n "$LD"; then
2776   echo "$ac_t""$LD" 1>&6
2777 else
2778   echo "$ac_t""no" 1>&6
2779 fi
2780 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2781
2782 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2783 echo "configure:2784: checking if the linker ($LD) is GNU ld" >&5
2784 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
2785   echo $ac_n "(cached) $ac_c" 1>&6
2786 else
2787   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2788 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2789   ac_cv_prog_gnu_ld=yes
2790 else
2791   ac_cv_prog_gnu_ld=no
2792 fi
2793 fi
2794
2795 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2796
2797
2798 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2799 echo "configure:2800: checking for BSD-compatible nm" >&5
2800 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
2801   echo $ac_n "(cached) $ac_c" 1>&6
2802 else
2803   if test -n "$NM"; then
2804   # Let the user override the test.
2805   ac_cv_path_NM="$NM"
2806 else
2807   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2808   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
2809     test -z "$ac_dir" && ac_dir=.
2810     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
2811       # Check to see if the nm accepts a BSD-compat flag.
2812       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2813       #   nm: unknown option "B" ignored
2814       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2815         ac_cv_path_NM="$ac_dir/nm -B"
2816         break
2817       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2818         ac_cv_path_NM="$ac_dir/nm -p"
2819         break
2820       else
2821         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
2822         continue # so that we can try to find one that supports BSD flags
2823       fi
2824     fi
2825   done
2826   IFS="$ac_save_ifs"
2827   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2828 fi
2829 fi
2830
2831 NM="$ac_cv_path_NM"
2832 echo "$ac_t""$NM" 1>&6
2833
2834
2835 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2836 echo "configure:2837: checking whether ln -s works" >&5
2837 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
2838   echo $ac_n "(cached) $ac_c" 1>&6
2839 else
2840   rm -f conftestdata
2841 if ln -s X conftestdata 2>/dev/null
2842 then
2843   rm -f conftestdata
2844   ac_cv_prog_LN_S="ln -s"
2845 else
2846   ac_cv_prog_LN_S=ln
2847 fi
2848 fi
2849 LN_S="$ac_cv_prog_LN_S"
2850 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2851   echo "$ac_t""yes" 1>&6
2852 else
2853   echo "$ac_t""no" 1>&6
2854 fi
2855
2856
2857 # Check for any special flags to pass to ltconfig.
2858 libtool_flags="--cache-file=$cache_file"
2859 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2860 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2861 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
2862 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2863 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2864
2865
2866 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
2867 if test "${enable_libtool_lock+set}" = set; then
2868   enableval="$enable_libtool_lock"
2869   :
2870 fi
2871
2872 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
2873 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
2874
2875 # Some flags need to be propagated to the compiler or linker for good
2876 # libtool support.
2877 case "$host" in
2878 *-*-irix6*)
2879   # Find out which ABI we are using.
2880   echo '#line 2881 "configure"' > conftest.$ac_ext
2881   if { (eval echo configure:2882: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2882     case "`/usr/bin/file conftest.o`" in
2883     *32-bit*)
2884       LD="${LD-ld} -32"
2885       ;;
2886     *N32*)
2887       LD="${LD-ld} -n32"
2888       ;;
2889     *64-bit*)
2890       LD="${LD-ld} -64"
2891       ;;
2892     esac
2893   fi
2894   rm -rf conftest*
2895   ;;
2896
2897 *-*-sco3.2v5*)
2898   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2899   SAVE_CFLAGS="$CFLAGS"
2900   CFLAGS="$CFLAGS -belf"
2901   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
2902 echo "configure:2903: checking whether the C compiler needs -belf" >&5
2903 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
2904   echo $ac_n "(cached) $ac_c" 1>&6
2905 else
2906   cat > conftest.$ac_ext <<EOF
2907 #line 2908 "configure"
2908 #include "confdefs.h"
2909
2910 int main() {
2911
2912 ; return 0; }
2913 EOF
2914 if { (eval echo configure:2915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2915   rm -rf conftest*
2916   lt_cv_cc_needs_belf=yes
2917 else
2918   echo "configure: failed program was:" >&5
2919   cat conftest.$ac_ext >&5
2920   rm -rf conftest*
2921   lt_cv_cc_needs_belf=no
2922 fi
2923 rm -f conftest*
2924 fi
2925
2926 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
2927   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2928     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2929     CFLAGS="$SAVE_CFLAGS"
2930   fi
2931   ;;
2932
2933
2934 esac
2935
2936
2937 # Save cache, so that ltconfig can load it
2938
2939
2940 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
2941 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
2942 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
2943 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
2944 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
2945 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
2946 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
2947 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
2948
2949 # Reload cache, that may have been modified by ltconfig
2950
2951
2952 # This can be used to rebuild libtool when needed
2953 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
2954
2955 # Always use our own libtool.
2956 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
2957
2958 # Redirect the config.log output again, so that the ltconfig log is not
2959 # clobbered by the next message.
2960 exec 5>>./config.log
2961
2962
2963 for ac_prog in mawk gawk nawk awk
2964 do
2965 # Extract the first word of "$ac_prog", so it can be a program name with args.
2966 set dummy $ac_prog; ac_word=$2
2967 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2968 echo "configure:2969: checking for $ac_word" >&5
2969 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
2970   echo $ac_n "(cached) $ac_c" 1>&6
2971 else
2972   if test -n "$AWK"; then
2973   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2974 else
2975   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2976   ac_dummy="$PATH"
2977   for ac_dir in $ac_dummy; do
2978     test -z "$ac_dir" && ac_dir=.
2979     if test -f $ac_dir/$ac_word; then
2980       ac_cv_prog_AWK="$ac_prog"
2981       break
2982     fi
2983   done
2984   IFS="$ac_save_ifs"
2985 fi
2986 fi
2987 AWK="$ac_cv_prog_AWK"
2988 if test -n "$AWK"; then
2989   echo "$ac_t""$AWK" 1>&6
2990 else
2991   echo "$ac_t""no" 1>&6
2992 fi
2993
2994 test -n "$AWK" && break
2995 done
2996
2997 # test for ln hardlink support
2998 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
2999 echo "configure:3000: checking whether ln works" >&5
3000 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
3001   echo $ac_n "(cached) $ac_c" 1>&6
3002 else
3003   rm -f conftest.src conftest.dst
3004 echo "conftest" > conftest.src
3005 if ln conftest.src conftest.dst 2>/dev/null
3006 then
3007   ol_cv_prog_LN_H="ln"
3008 else
3009   ol_cv_prog_LN_H="cp"
3010 fi
3011 rm -f conftest.src conftest.dst
3012
3013 fi
3014 LN_H="$ol_cv_prog_LN_H"
3015 if test "$ol_cv_prog_LN_H" = "ln"; then
3016         echo "$ac_t""yes" 1>&6
3017 else
3018         echo "$ac_t""no" 1>&6
3019 fi
3020
3021 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3022 echo "configure:3023: checking whether ln -s works" >&5
3023 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3024   echo $ac_n "(cached) $ac_c" 1>&6
3025 else
3026   rm -f conftestdata
3027 if ln -s X conftestdata 2>/dev/null
3028 then
3029   rm -f conftestdata
3030   ac_cv_prog_LN_S="ln -s"
3031 else
3032   ac_cv_prog_LN_S=ln
3033 fi
3034 fi
3035 LN_S="$ac_cv_prog_LN_S"
3036 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3037   echo "$ac_t""yes" 1>&6
3038 else
3039   echo "$ac_t""no" 1>&6
3040 fi
3041
3042
3043 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
3044         LN_S="$LN_H"
3045 fi
3046
3047 # Extract the first word of "sendmail", so it can be a program name with args.
3048 set dummy sendmail; ac_word=$2
3049 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3050 echo "configure:3051: checking for $ac_word" >&5
3051 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
3052   echo $ac_n "(cached) $ac_c" 1>&6
3053 else
3054   case "$SENDMAIL" in
3055   /*)
3056   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
3057   ;;
3058   ?:/*)                  
3059   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
3060   ;;
3061   *)
3062   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3063   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
3064   for ac_dir in $ac_dummy; do 
3065     test -z "$ac_dir" && ac_dir=.
3066     if test -f $ac_dir/$ac_word; then
3067       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
3068       break
3069     fi
3070   done
3071   IFS="$ac_save_ifs"
3072   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
3073   ;;
3074 esac
3075 fi
3076 SENDMAIL="$ac_cv_path_SENDMAIL"
3077 if test -n "$SENDMAIL"; then
3078   echo "$ac_t""$SENDMAIL" 1>&6
3079 else
3080   echo "$ac_t""no" 1>&6
3081 fi
3082
3083 # Extract the first word of "vi", so it can be a program name with args.
3084 set dummy vi; ac_word=$2
3085 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3086 echo "configure:3087: checking for $ac_word" >&5
3087 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
3088   echo $ac_n "(cached) $ac_c" 1>&6
3089 else
3090   case "$EDITOR" in
3091   /*)
3092   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
3093   ;;
3094   ?:/*)                  
3095   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
3096   ;;
3097   *)
3098   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3099   ac_dummy="$PATH:/usr/ucb"
3100   for ac_dir in $ac_dummy; do 
3101     test -z "$ac_dir" && ac_dir=.
3102     if test -f $ac_dir/$ac_word; then
3103       ac_cv_path_EDITOR="$ac_dir/$ac_word"
3104       break
3105     fi
3106   done
3107   IFS="$ac_save_ifs"
3108   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
3109   ;;
3110 esac
3111 fi
3112 EDITOR="$ac_cv_path_EDITOR"
3113 if test -n "$EDITOR"; then
3114   echo "$ac_t""$EDITOR" 1>&6
3115 else
3116   echo "$ac_t""no" 1>&6
3117 fi
3118
3119 # Extract the first word of "finger", so it can be a program name with args.
3120 set dummy finger; ac_word=$2
3121 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3122 echo "configure:3123: checking for $ac_word" >&5
3123 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
3124   echo $ac_n "(cached) $ac_c" 1>&6
3125 else
3126   case "$FINGER" in
3127   /*)
3128   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
3129   ;;
3130   ?:/*)                  
3131   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
3132   ;;
3133   *)
3134   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3135   ac_dummy="$PATH:/usr/ucb"
3136   for ac_dir in $ac_dummy; do 
3137     test -z "$ac_dir" && ac_dir=.
3138     if test -f $ac_dir/$ac_word; then
3139       ac_cv_path_FINGER="$ac_dir/$ac_word"
3140       break
3141     fi
3142   done
3143   IFS="$ac_save_ifs"
3144   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
3145   ;;
3146 esac
3147 fi
3148 FINGER="$ac_cv_path_FINGER"
3149 if test -n "$FINGER"; then
3150   echo "$ac_t""$FINGER" 1>&6
3151 else
3152   echo "$ac_t""no" 1>&6
3153 fi
3154
3155
3156 ol_link_perl=no
3157 if test $ol_enable_perl != no ; then
3158         # Extract the first word of "perl", so it can be a program name with args.
3159 set dummy perl; ac_word=$2
3160 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3161 echo "configure:3162: checking for $ac_word" >&5
3162 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
3163   echo $ac_n "(cached) $ac_c" 1>&6
3164 else
3165   case "$PERLBIN" in
3166   /*)
3167   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
3168   ;;
3169   ?:/*)                  
3170   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
3171   ;;
3172   *)
3173   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3174   ac_dummy="$PATH"
3175   for ac_dir in $ac_dummy; do 
3176     test -z "$ac_dir" && ac_dir=.
3177     if test -f $ac_dir/$ac_word; then
3178       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
3179       break
3180     fi
3181   done
3182   IFS="$ac_save_ifs"
3183   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
3184   ;;
3185 esac
3186 fi
3187 PERLBIN="$ac_cv_path_PERLBIN"
3188 if test -n "$PERLBIN"; then
3189   echo "$ac_t""$PERLBIN" 1>&6
3190 else
3191   echo "$ac_t""no" 1>&6
3192 fi
3193
3194
3195         if test "no$PERLBIN" = "no" ; then
3196                 if test $ol_enable_perl = yes ; then
3197                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
3198                 fi
3199
3200         else
3201                 SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3202                 SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
3203
3204                                 ol_link_perl=yes
3205         fi
3206 fi
3207
3208 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3209 echo "configure:3210: checking how to run the C preprocessor" >&5
3210 # On Suns, sometimes $CPP names a directory.
3211 if test -n "$CPP" && test -d "$CPP"; then
3212   CPP=
3213 fi
3214 if test -z "$CPP"; then
3215 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3216   echo $ac_n "(cached) $ac_c" 1>&6
3217 else
3218     # This must be in double quotes, not single quotes, because CPP may get
3219   # substituted into the Makefile and "${CC-cc}" will confuse make.
3220   CPP="${CC-cc} -E"
3221   # On the NeXT, cc -E runs the code through the compiler's parser,
3222   # not just through cpp.
3223   cat > conftest.$ac_ext <<EOF
3224 #line 3225 "configure"
3225 #include "confdefs.h"
3226 #include <assert.h>
3227 Syntax Error
3228 EOF
3229 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3230 { (eval echo configure:3231: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3231 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3232 if test -z "$ac_err"; then
3233   :
3234 else
3235   echo "$ac_err" >&5
3236   echo "configure: failed program was:" >&5
3237   cat conftest.$ac_ext >&5
3238   rm -rf conftest*
3239   CPP="${CC-cc} -E -traditional-cpp"
3240   cat > conftest.$ac_ext <<EOF
3241 #line 3242 "configure"
3242 #include "confdefs.h"
3243 #include <assert.h>
3244 Syntax Error
3245 EOF
3246 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3247 { (eval echo configure:3248: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3248 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3249 if test -z "$ac_err"; then
3250   :
3251 else
3252   echo "$ac_err" >&5
3253   echo "configure: failed program was:" >&5
3254   cat conftest.$ac_ext >&5
3255   rm -rf conftest*
3256   CPP="${CC-cc} -nologo -E"
3257   cat > conftest.$ac_ext <<EOF
3258 #line 3259 "configure"
3259 #include "confdefs.h"
3260 #include <assert.h>
3261 Syntax Error
3262 EOF
3263 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3264 { (eval echo configure:3265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3265 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3266 if test -z "$ac_err"; then
3267   :
3268 else
3269   echo "$ac_err" >&5
3270   echo "configure: failed program was:" >&5
3271   cat conftest.$ac_ext >&5
3272   rm -rf conftest*
3273   CPP=/lib/cpp
3274 fi
3275 rm -f conftest*
3276 fi
3277 rm -f conftest*
3278 fi
3279 rm -f conftest*
3280   ac_cv_prog_CPP="$CPP"
3281 fi
3282   CPP="$ac_cv_prog_CPP"
3283 else
3284   ac_cv_prog_CPP="$CPP"
3285 fi
3286 echo "$ac_t""$CPP" 1>&6
3287
3288
3289 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3290         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3291
3292 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3293         echo "configure: warning: programs compiled here do run here..." 1>&2
3294         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3295
3296 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3297         echo "configure: warning: programs compiled here do not run here..." 1>&2
3298         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3299 fi
3300
3301 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3302 echo "configure:3303: checking for AIX" >&5
3303 cat > conftest.$ac_ext <<EOF
3304 #line 3305 "configure"
3305 #include "confdefs.h"
3306 #ifdef _AIX
3307   yes
3308 #endif
3309
3310 EOF
3311 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3312   egrep "yes" >/dev/null 2>&1; then
3313   rm -rf conftest*
3314   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3315 #define _ALL_SOURCE 1
3316 EOF
3317
3318 else
3319   rm -rf conftest*
3320   echo "$ac_t""no" 1>&6
3321 fi
3322 rm -f conftest*
3323
3324
3325 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3326 echo "configure:3327: checking for POSIXized ISC" >&5
3327 if test -d /etc/conf/kconfig.d &&
3328   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3329 then
3330   echo "$ac_t""yes" 1>&6
3331   ISC=yes # If later tests want to check for ISC.
3332   cat >> confdefs.h <<\EOF
3333 #define _POSIX_SOURCE 1
3334 EOF
3335
3336   if test "$GCC" = yes; then
3337     CC="$CC -posix"
3338   else
3339     CC="$CC -Xp"
3340   fi
3341 else
3342   echo "$ac_t""no" 1>&6
3343   ISC=
3344 fi
3345
3346 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3347 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3348 echo "configure:3349: checking for minix/config.h" >&5
3349 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3350   echo $ac_n "(cached) $ac_c" 1>&6
3351 else
3352   cat > conftest.$ac_ext <<EOF
3353 #line 3354 "configure"
3354 #include "confdefs.h"
3355 #include <minix/config.h>
3356 EOF
3357 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3358 { (eval echo configure:3359: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3359 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3360 if test -z "$ac_err"; then
3361   rm -rf conftest*
3362   eval "ac_cv_header_$ac_safe=yes"
3363 else
3364   echo "$ac_err" >&5
3365   echo "configure: failed program was:" >&5
3366   cat conftest.$ac_ext >&5
3367   rm -rf conftest*
3368   eval "ac_cv_header_$ac_safe=no"
3369 fi
3370 rm -f conftest*
3371 fi
3372 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3373   echo "$ac_t""yes" 1>&6
3374   MINIX=yes
3375 else
3376   echo "$ac_t""no" 1>&6
3377 MINIX=
3378 fi
3379
3380 if test "$MINIX" = yes; then
3381   cat >> confdefs.h <<\EOF
3382 #define _POSIX_SOURCE 1
3383 EOF
3384
3385   cat >> confdefs.h <<\EOF
3386 #define _POSIX_1_SOURCE 2
3387 EOF
3388
3389   cat >> confdefs.h <<\EOF
3390 #define _MINIX 1
3391 EOF
3392
3393 fi
3394
3395
3396 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3397 echo "configure:3398: checking for Cygwin environment" >&5
3398 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
3399   echo $ac_n "(cached) $ac_c" 1>&6
3400 else
3401   cat > conftest.$ac_ext <<EOF
3402 #line 3403 "configure"
3403 #include "confdefs.h"
3404
3405 int main() {
3406
3407 #ifndef __CYGWIN__
3408 #define __CYGWIN__ __CYGWIN32__
3409 #endif
3410 return __CYGWIN__;
3411 ; return 0; }
3412 EOF
3413 if { (eval echo configure:3414: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3414   rm -rf conftest*
3415   ac_cv_cygwin=yes
3416 else
3417   echo "configure: failed program was:" >&5
3418   cat conftest.$ac_ext >&5
3419   rm -rf conftest*
3420   ac_cv_cygwin=no
3421 fi
3422 rm -f conftest*
3423 fi
3424
3425 echo "$ac_t""$ac_cv_cygwin" 1>&6
3426 CYGWIN=
3427 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3428 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3429 echo "configure:3430: checking for mingw32 environment" >&5
3430 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
3431   echo $ac_n "(cached) $ac_c" 1>&6
3432 else
3433   cat > conftest.$ac_ext <<EOF
3434 #line 3435 "configure"
3435 #include "confdefs.h"
3436
3437 int main() {
3438 return __MINGW32__;
3439 ; return 0; }
3440 EOF
3441 if { (eval echo configure:3442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3442   rm -rf conftest*
3443   ac_cv_mingw32=yes
3444 else
3445   echo "configure: failed program was:" >&5
3446   cat conftest.$ac_ext >&5
3447   rm -rf conftest*
3448   ac_cv_mingw32=no
3449 fi
3450 rm -f conftest*
3451 fi
3452
3453 echo "$ac_t""$ac_cv_mingw32" 1>&6
3454 MINGW32=
3455 test "$ac_cv_mingw32" = yes && MINGW32=yes
3456 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
3457 echo "configure:3458: checking for EMX OS/2 environment" >&5
3458 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
3459   echo $ac_n "(cached) $ac_c" 1>&6
3460 else
3461   cat > conftest.$ac_ext <<EOF
3462 #line 3463 "configure"
3463 #include "confdefs.h"
3464
3465 int main() {
3466 return __EMX__;
3467 ; return 0; }
3468 EOF
3469 if { (eval echo configure:3470: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3470   rm -rf conftest*
3471   ac_cv_emxos2=yes
3472 else
3473   echo "configure: failed program was:" >&5
3474   cat conftest.$ac_ext >&5
3475   rm -rf conftest*
3476   ac_cv_emxos2=no
3477 fi
3478 rm -f conftest*
3479 fi
3480
3481 echo "$ac_t""$ac_cv_emxos2" 1>&6
3482 EMXOS2=
3483 test "$ac_cv_emxos2" = yes && EMXOS2=yes
3484
3485
3486
3487 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
3488 echo "configure:3489: checking for executable suffix" >&5
3489 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
3490   echo $ac_n "(cached) $ac_c" 1>&6
3491 else
3492   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
3493   ac_cv_exeext=.exe
3494 else
3495   rm -f conftest*
3496   echo 'int main () { return 0; }' > conftest.$ac_ext
3497   ac_cv_exeext=
3498   if { (eval echo configure:3499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
3499     for file in conftest.*; do
3500       case $file in
3501       *.c | *.C | *.o | *.obj | *.xcoff) ;;
3502       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
3503       esac
3504     done
3505   else
3506     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
3507   fi
3508   rm -f conftest*
3509   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
3510 fi
3511 fi
3512
3513 EXEEXT=""
3514 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
3515 echo "$ac_t""${ac_cv_exeext}" 1>&6
3516 ac_exeext=$EXEEXT
3517
3518 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3519 echo "configure:3520: checking for object suffix" >&5
3520 if eval "test \"\${ac_cv_objext+set}\" = set"; then
3521   echo $ac_n "(cached) $ac_c" 1>&6
3522 else
3523   rm -f conftest*
3524 echo 'int i = 1;' > conftest.$ac_ext
3525 if { (eval echo configure:3526: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3526   for ac_file in conftest.*; do
3527     case $ac_file in
3528     *.c) ;;
3529     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
3530     esac
3531   done
3532 else
3533   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
3534 fi
3535 rm -f conftest*
3536 fi
3537
3538 echo "$ac_t""$ac_cv_objext" 1>&6
3539 OBJEXT=$ac_cv_objext
3540 ac_objext=$ac_cv_objext
3541
3542
3543 cat >> confdefs.h <<EOF
3544 #define EXEEXT "${EXEEXT}"
3545 EOF
3546
3547
3548 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
3549 echo "configure:3550: checking for be_app in -lbe" >&5
3550 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
3551 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3552   echo $ac_n "(cached) $ac_c" 1>&6
3553 else
3554   ac_save_LIBS="$LIBS"
3555 LIBS="-lbe -lroot -lnet $LIBS"
3556 cat > conftest.$ac_ext <<EOF
3557 #line 3558 "configure"
3558 #include "confdefs.h"
3559 /* Override any gcc2 internal prototype to avoid an error.  */
3560 /* We use char because int might match the return type of a gcc2
3561     builtin and then its argument prototype would still apply.  */
3562 char be_app();
3563
3564 int main() {
3565 be_app()
3566 ; return 0; }
3567 EOF
3568 if { (eval echo configure:3569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3569   rm -rf conftest*
3570   eval "ac_cv_lib_$ac_lib_var=yes"
3571 else
3572   echo "configure: failed program was:" >&5
3573   cat conftest.$ac_ext >&5
3574   rm -rf conftest*
3575   eval "ac_cv_lib_$ac_lib_var=no"
3576 fi
3577 rm -f conftest*
3578 LIBS="$ac_save_LIBS"
3579
3580 fi
3581 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3582   echo "$ac_t""yes" 1>&6
3583   LIBS="$LIBS -lbe -lroot -lnet"
3584 else
3585   echo "$ac_t""no" 1>&6
3586 :
3587 fi
3588
3589
3590
3591
3592
3593 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
3594 echo "configure:3595: checking for ${CC-cc} option to accept ANSI C" >&5
3595 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
3596   echo $ac_n "(cached) $ac_c" 1>&6
3597 else
3598   am_cv_prog_cc_stdc=no
3599 ac_save_CC="$CC"
3600 # Don't try gcc -ansi; that turns off useful extensions and
3601 # breaks some systems' header files.
3602 # AIX                   -qlanglvl=ansi
3603 # Ultrix and OSF/1      -std1
3604 # HP-UX 10.20 and later -Ae
3605 # HP-UX older versions  -Aa -D_HPUX_SOURCE
3606 # SVR4                  -Xc -D__EXTENSIONS__
3607 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3608 do
3609   CC="$ac_save_CC $ac_arg"
3610   cat > conftest.$ac_ext <<EOF
3611 #line 3612 "configure"
3612 #include "confdefs.h"
3613 #include <stdarg.h>
3614 #include <stdio.h>
3615 #include <sys/types.h>
3616 #include <sys/stat.h>
3617 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3618 struct buf { int x; };
3619 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3620 static char *e (p, i)
3621      char **p;
3622      int i;
3623 {
3624   return p[i];
3625 }
3626 static char *f (char * (*g) (char **, int), char **p, ...)
3627 {
3628   char *s;
3629   va_list v;
3630   va_start (v,p);
3631   s = g (p, va_arg (v,int));
3632   va_end (v);
3633   return s;
3634 }
3635 int test (int i, double x);
3636 struct s1 {int (*f) (int a);};
3637 struct s2 {int (*f) (double a);};
3638 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3639 int argc;
3640 char **argv;
3641
3642 int main() {
3643
3644 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3645
3646 ; return 0; }
3647 EOF
3648 if { (eval echo configure:3649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3649   rm -rf conftest*
3650   am_cv_prog_cc_stdc="$ac_arg"; break
3651 else
3652   echo "configure: failed program was:" >&5
3653   cat conftest.$ac_ext >&5
3654 fi
3655 rm -f conftest*
3656 done
3657 CC="$ac_save_CC"
3658
3659 fi
3660
3661 if test -z "$am_cv_prog_cc_stdc"; then
3662   echo "$ac_t""none needed" 1>&6
3663 else
3664   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
3665 fi
3666 case "x$am_cv_prog_cc_stdc" in
3667   x|xno) ;;
3668   *) CC="$CC $am_cv_prog_cc_stdc" ;;
3669 esac
3670
3671 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
3672         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
3673 fi
3674
3675 # test for make depend flag
3676 OL_MKDEP=
3677 OL_MKDEP_FLAGS=
3678 if test -z "${MKDEP}"; then
3679         OL_MKDEP="${CC-cc}"
3680         if test -z "${MKDEP_FLAGS}"; then
3681                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
3682 echo "configure:3683: checking for ${OL_MKDEP} depend flag" >&5
3683 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
3684   echo $ac_n "(cached) $ac_c" 1>&6
3685 else
3686   
3687                         ol_cv_mkdep=no
3688                         for flag in "-M" "-xM"; do
3689                                 cat > conftest.c <<EOF
3690  noCode;
3691 EOF
3692                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3693: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
3693                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
3694                                 then
3695                                         if test ! -f conftest."${ac_object}" ; then
3696                                                 ol_cv_mkdep=$flag
3697                                                 OL_MKDEP_FLAGS="$flag"
3698                                                 break
3699                                         fi
3700                                 fi
3701                         done
3702                         rm -f conftest*
3703                 
3704 fi
3705
3706 echo "$ac_t""$ol_cv_mkdep" 1>&6
3707         else
3708                 cc_cv_mkdep=yes
3709                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3710         fi
3711 else
3712         cc_cv_mkdep=yes
3713         OL_MKDEP="${MKDEP}"
3714         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3715 fi
3716
3717
3718
3719 if test "${ol_cv_mkdep}" = no ; then
3720         # this will soon become an error
3721         echo "configure: warning: do not know how to generate dependencies" 1>&2
3722 fi
3723
3724 ol_link_modules=no
3725 if test $ol_enable_modules != no ; then
3726         # Extract the first word of "glib-config", so it can be a program name with args.
3727 set dummy glib-config; ac_word=$2
3728 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3729 echo "configure:3730: checking for $ac_word" >&5
3730 if eval "test \"\${ac_cv_path_GLIBCONFIG+set}\" = set"; then
3731   echo $ac_n "(cached) $ac_c" 1>&6
3732 else
3733   case "$GLIBCONFIG" in
3734   /*)
3735   ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a path.
3736   ;;
3737   ?:/*)                  
3738   ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a dos path.
3739   ;;
3740   *)
3741   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3742   ac_dummy="$PATH"
3743   for ac_dir in $ac_dummy; do 
3744     test -z "$ac_dir" && ac_dir=.
3745     if test -f $ac_dir/$ac_word; then
3746       ac_cv_path_GLIBCONFIG="$ac_dir/$ac_word"
3747       break
3748     fi
3749   done
3750   IFS="$ac_save_ifs"
3751   ;;
3752 esac
3753 fi
3754 GLIBCONFIG="$ac_cv_path_GLIBCONFIG"
3755 if test -n "$GLIBCONFIG"; then
3756   echo "$ac_t""$GLIBCONFIG" 1>&6
3757 else
3758   echo "$ac_t""no" 1>&6
3759 fi
3760
3761
3762         if test "no$GLIBCONFIG" = "no" ; then
3763                 if test $ol_enable_modules = yes ; then
3764                         { echo "configure: error: could not locate glib-config" 1>&2; exit 1; }
3765                 fi
3766
3767         else
3768                 SLAPD_MODULES_VERSION="`$GLIBCONFIG --version gmodule`"
3769                 SLAPD_MODULES_CPPFLAGS="`$GLIBCONFIG --cflags gmodule`"
3770                 SLAPD_MODULES_LDFLAGS="`$GLIBCONFIG --libs gmodule`"
3771
3772                                 ol_link_modules=yes
3773         fi
3774 else
3775         ol_with_bdb2_module=static
3776         ol_with_ldap_module=static
3777         ol_with_ldbm_module=static
3778         ol_with_passwd_module=static
3779         ol_with_perl_module=static
3780         ol_with_shell_module=static
3781         ol_with_tcl_module=static
3782 fi
3783
3784 # test for EBCDIC
3785 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
3786 echo "configure:3787: checking for EBCDIC" >&5
3787 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
3788   echo $ac_n "(cached) $ac_c" 1>&6
3789 else
3790   
3791         cat > conftest.$ac_ext <<EOF
3792 #line 3793 "configure"
3793 #include "confdefs.h"
3794
3795 #if !('M' == 0xd4)
3796 #include <__ASCII__/generate_error.h>
3797 #endif
3798
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   ol_cv_cpp_ebcdic=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   ol_cv_cpp_ebcdic=no
3812 fi
3813 rm -f conftest*
3814 fi
3815
3816 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
3817 if test $ol_cv_cpp_ebcdic = yes ; then
3818         cat >> confdefs.h <<\EOF
3819 #define HAVE_EBCDIC 1
3820 EOF
3821
3822 fi
3823
3824 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3825 echo "configure:3826: checking for ANSI C header files" >&5
3826 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
3827   echo $ac_n "(cached) $ac_c" 1>&6
3828 else
3829   cat > conftest.$ac_ext <<EOF
3830 #line 3831 "configure"
3831 #include "confdefs.h"
3832 #include <stdlib.h>
3833 #include <stdarg.h>
3834 #include <string.h>
3835 #include <float.h>
3836 EOF
3837 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3838 { (eval echo configure:3839: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3839 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3840 if test -z "$ac_err"; then
3841   rm -rf conftest*
3842   ol_cv_header_stdc=yes
3843 else
3844   echo "$ac_err" >&5
3845   echo "configure: failed program was:" >&5
3846   cat conftest.$ac_ext >&5
3847   rm -rf conftest*
3848   ol_cv_header_stdc=no
3849 fi
3850 rm -f conftest*
3851
3852 if test $ol_cv_header_stdc = yes; then
3853   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3854 cat > conftest.$ac_ext <<EOF
3855 #line 3856 "configure"
3856 #include "confdefs.h"
3857 #include <string.h>
3858 EOF
3859 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3860   egrep "memchr" >/dev/null 2>&1; then
3861   :
3862 else
3863   rm -rf conftest*
3864   ol_cv_header_stdc=no
3865 fi
3866 rm -f conftest*
3867
3868 fi
3869
3870 if test $ol_cv_header_stdc = yes; then
3871   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3872 cat > conftest.$ac_ext <<EOF
3873 #line 3874 "configure"
3874 #include "confdefs.h"
3875 #include <stdlib.h>
3876 EOF
3877 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3878   egrep "free" >/dev/null 2>&1; then
3879   :
3880 else
3881   rm -rf conftest*
3882   ol_cv_header_stdc=no
3883 fi
3884 rm -f conftest*
3885
3886 fi
3887
3888 if test $ol_cv_header_stdc = yes; then
3889   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3890 if test "$cross_compiling" = yes; then
3891   :
3892 else
3893   cat > conftest.$ac_ext <<EOF
3894 #line 3895 "configure"
3895 #include "confdefs.h"
3896 #include <ctype.h>
3897 #ifndef HAVE_EBCDIC
3898 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3899 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3900 #else
3901 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
3902                 || ('j' <= (c) && (c) <= 'r') \
3903                 || ('s' <= (c) && (c) <= 'z'))
3904 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
3905 #endif
3906 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3907 int main () { int i; for (i = 0; i < 256; i++)
3908 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
3909 exit (0); }
3910
3911 EOF
3912 if { (eval echo configure:3913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3913 then
3914   :
3915 else
3916   echo "configure: failed program was:" >&5
3917   cat conftest.$ac_ext >&5
3918   rm -fr conftest*
3919   ol_cv_header_stdc=no
3920 fi
3921 rm -fr conftest*
3922 fi
3923
3924 fi
3925 fi
3926
3927 echo "$ac_t""$ol_cv_header_stdc" 1>&6
3928 if test $ol_cv_header_stdc = yes; then
3929   cat >> confdefs.h <<\EOF
3930 #define STDC_HEADERS 1
3931 EOF
3932
3933 fi
3934 ac_cv_header_stdc=disable
3935
3936
3937 if test $ol_cv_header_stdc != yes; then
3938         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
3939 fi
3940
3941 ac_header_dirent=no
3942 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
3943 do
3944 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3945 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
3946 echo "configure:3947: checking for $ac_hdr that defines DIR" >&5
3947 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
3948   echo $ac_n "(cached) $ac_c" 1>&6
3949 else
3950   cat > conftest.$ac_ext <<EOF
3951 #line 3952 "configure"
3952 #include "confdefs.h"
3953 #include <sys/types.h>
3954 #include <$ac_hdr>
3955 int main() {
3956 DIR *dirp = 0;
3957 ; return 0; }
3958 EOF
3959 if { (eval echo configure:3960: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3960   rm -rf conftest*
3961   eval "ac_cv_header_dirent_$ac_safe=yes"
3962 else
3963   echo "configure: failed program was:" >&5
3964   cat conftest.$ac_ext >&5
3965   rm -rf conftest*
3966   eval "ac_cv_header_dirent_$ac_safe=no"
3967 fi
3968 rm -f conftest*
3969 fi
3970 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
3971   echo "$ac_t""yes" 1>&6
3972     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3973   cat >> confdefs.h <<EOF
3974 #define $ac_tr_hdr 1
3975 EOF
3976  ac_header_dirent=$ac_hdr; break
3977 else
3978   echo "$ac_t""no" 1>&6
3979 fi
3980 done
3981 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
3982 if test $ac_header_dirent = dirent.h; then
3983 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
3984 echo "configure:3985: checking for opendir in -ldir" >&5
3985 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
3986 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3987   echo $ac_n "(cached) $ac_c" 1>&6
3988 else
3989   ac_save_LIBS="$LIBS"
3990 LIBS="-ldir  $LIBS"
3991 cat > conftest.$ac_ext <<EOF
3992 #line 3993 "configure"
3993 #include "confdefs.h"
3994 /* Override any gcc2 internal prototype to avoid an error.  */
3995 /* We use char because int might match the return type of a gcc2
3996     builtin and then its argument prototype would still apply.  */
3997 char opendir();
3998
3999 int main() {
4000 opendir()
4001 ; return 0; }
4002 EOF
4003 if { (eval echo configure:4004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4004   rm -rf conftest*
4005   eval "ac_cv_lib_$ac_lib_var=yes"
4006 else
4007   echo "configure: failed program was:" >&5
4008   cat conftest.$ac_ext >&5
4009   rm -rf conftest*
4010   eval "ac_cv_lib_$ac_lib_var=no"
4011 fi
4012 rm -f conftest*
4013 LIBS="$ac_save_LIBS"
4014
4015 fi
4016 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4017   echo "$ac_t""yes" 1>&6
4018   LIBS="$LIBS -ldir"
4019 else
4020   echo "$ac_t""no" 1>&6
4021 fi
4022
4023 else
4024 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4025 echo "configure:4026: checking for opendir in -lx" >&5
4026 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
4027 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4028   echo $ac_n "(cached) $ac_c" 1>&6
4029 else
4030   ac_save_LIBS="$LIBS"
4031 LIBS="-lx  $LIBS"
4032 cat > conftest.$ac_ext <<EOF
4033 #line 4034 "configure"
4034 #include "confdefs.h"
4035 /* Override any gcc2 internal prototype to avoid an error.  */
4036 /* We use char because int might match the return type of a gcc2
4037     builtin and then its argument prototype would still apply.  */
4038 char opendir();
4039
4040 int main() {
4041 opendir()
4042 ; return 0; }
4043 EOF
4044 if { (eval echo configure:4045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4045   rm -rf conftest*
4046   eval "ac_cv_lib_$ac_lib_var=yes"
4047 else
4048   echo "configure: failed program was:" >&5
4049   cat conftest.$ac_ext >&5
4050   rm -rf conftest*
4051   eval "ac_cv_lib_$ac_lib_var=no"
4052 fi
4053 rm -f conftest*
4054 LIBS="$ac_save_LIBS"
4055
4056 fi
4057 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4058   echo "$ac_t""yes" 1>&6
4059   LIBS="$LIBS -lx"
4060 else
4061   echo "$ac_t""no" 1>&6
4062 fi
4063
4064 fi
4065
4066 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4067 echo "configure:4068: checking for sys/wait.h that is POSIX.1 compatible" >&5
4068 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
4069   echo $ac_n "(cached) $ac_c" 1>&6
4070 else
4071   cat > conftest.$ac_ext <<EOF
4072 #line 4073 "configure"
4073 #include "confdefs.h"
4074 #include <sys/types.h>
4075 #include <sys/wait.h>
4076 #ifndef WEXITSTATUS
4077 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4078 #endif
4079 #ifndef WIFEXITED
4080 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4081 #endif
4082 int main() {
4083 int s;
4084 wait (&s);
4085 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4086 ; return 0; }
4087 EOF
4088 if { (eval echo configure:4089: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4089   rm -rf conftest*
4090   ac_cv_header_sys_wait_h=yes
4091 else
4092   echo "configure: failed program was:" >&5
4093   cat conftest.$ac_ext >&5
4094   rm -rf conftest*
4095   ac_cv_header_sys_wait_h=no
4096 fi
4097 rm -f conftest*
4098 fi
4099
4100 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4101 if test $ac_cv_header_sys_wait_h = yes; then
4102   cat >> confdefs.h <<\EOF
4103 #define HAVE_SYS_WAIT_H 1
4104 EOF
4105
4106 fi
4107
4108 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4109 echo "configure:4110: checking POSIX termios" >&5
4110 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
4111   echo $ac_n "(cached) $ac_c" 1>&6
4112 else
4113   cat > conftest.$ac_ext <<EOF
4114 #line 4115 "configure"
4115 #include "confdefs.h"
4116 #include <sys/types.h>
4117 #include <unistd.h>
4118 #include <termios.h>
4119 int main() {
4120 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4121    tcgetattr(0, 0);
4122 ; return 0; }
4123 EOF
4124 if { (eval echo configure:4125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4125   rm -rf conftest*
4126   am_cv_sys_posix_termios=yes
4127 else
4128   echo "configure: failed program was:" >&5
4129   cat conftest.$ac_ext >&5
4130   rm -rf conftest*
4131   am_cv_sys_posix_termios=no
4132 fi
4133 rm -f conftest*
4134 fi
4135
4136 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4137
4138
4139  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4140 echo "configure:4141: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4141 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
4142   echo $ac_n "(cached) $ac_c" 1>&6
4143 else
4144   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4145
4146   gwinsz_in_termios_h=no
4147   if test $am_cv_sys_posix_termios = yes; then
4148     cat > conftest.$ac_ext <<EOF
4149 #line 4150 "configure"
4150 #include "confdefs.h"
4151 #include <sys/types.h>
4152 #     include <termios.h>
4153 #     ifdef TIOCGWINSZ
4154         yes
4155 #     endif
4156     
4157 EOF
4158 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4159   egrep "yes" >/dev/null 2>&1; then
4160   rm -rf conftest*
4161   gwinsz_in_termios_h=yes
4162 fi
4163 rm -f conftest*
4164
4165   fi
4166
4167   if test $gwinsz_in_termios_h = no; then
4168     cat > conftest.$ac_ext <<EOF
4169 #line 4170 "configure"
4170 #include "confdefs.h"
4171 #include <sys/types.h>
4172 #     include <sys/ioctl.h>
4173 #     ifdef TIOCGWINSZ
4174         yes
4175 #     endif
4176     
4177 EOF
4178 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4179   egrep "yes" >/dev/null 2>&1; then
4180   rm -rf conftest*
4181   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4182 fi
4183 rm -f conftest*
4184
4185   fi
4186   
4187 fi
4188
4189 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4190   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4191     cat >> confdefs.h <<\EOF
4192 #define GWINSZ_IN_SYS_IOCTL 1
4193 EOF
4194
4195   fi
4196
4197 if test $am_cv_sys_posix_termios = yes ; then
4198         cat >> confdefs.h <<\EOF
4199 #define HAVE_POSIX_TERMIOS 1
4200 EOF
4201
4202 fi
4203
4204 for ac_hdr in \
4205         arpa/inet.h             \
4206         arpa/nameser.h  \
4207         assert.h                \
4208         crypt.h                 \
4209         errno.h                 \
4210         fcntl.h                 \
4211         filio.h                 \
4212         getopt.h                \
4213         grp.h                   \
4214         libutil.h               \
4215         limits.h                \
4216         locale.h                \
4217         netinet/tcp.h   \
4218         malloc.h                \
4219         memory.h                \
4220         psap.h                  \
4221         pwd.h                   \
4222         resolv.h                \
4223         sgtty.h                 \
4224         shadow.h                \
4225         stdarg.h                \
4226         stddef.h                \
4227         string.h                \
4228         strings.h               \
4229         sysexits.h              \
4230         sys/file.h              \
4231         sys/filio.h             \
4232         sys/errno.h             \
4233         sys/ioctl.h             \
4234         sys/param.h             \
4235         sys/resource.h  \
4236         sys/select.h    \
4237         sys/socket.h    \
4238         sys/syslog.h    \
4239         sys/time.h              \
4240         sys/types.h             \
4241         syslog.h                \
4242         termios.h               \
4243         unistd.h                \
4244
4245 do
4246 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4247 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4248 echo "configure:4249: checking for $ac_hdr" >&5
4249 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4250   echo $ac_n "(cached) $ac_c" 1>&6
4251 else
4252   cat > conftest.$ac_ext <<EOF
4253 #line 4254 "configure"
4254 #include "confdefs.h"
4255 #include <$ac_hdr>
4256 EOF
4257 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4258 { (eval echo configure:4259: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4259 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4260 if test -z "$ac_err"; then
4261   rm -rf conftest*
4262   eval "ac_cv_header_$ac_safe=yes"
4263 else
4264   echo "$ac_err" >&5
4265   echo "configure: failed program was:" >&5
4266   cat conftest.$ac_ext >&5
4267   rm -rf conftest*
4268   eval "ac_cv_header_$ac_safe=no"
4269 fi
4270 rm -f conftest*
4271 fi
4272 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4273   echo "$ac_t""yes" 1>&6
4274     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4275   cat >> confdefs.h <<EOF
4276 #define $ac_tr_hdr 1
4277 EOF
4278  
4279 else
4280   echo "$ac_t""no" 1>&6
4281 fi
4282 done
4283
4284
4285
4286
4287 echo $ac_n "checking for socket""... $ac_c" 1>&6
4288 echo "configure:4289: checking for socket" >&5
4289 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
4290   echo $ac_n "(cached) $ac_c" 1>&6
4291 else
4292   cat > conftest.$ac_ext <<EOF
4293 #line 4294 "configure"
4294 #include "confdefs.h"
4295 /* System header to define __stub macros and hopefully few prototypes,
4296     which can conflict with char socket(); below.  */
4297 #include <assert.h>
4298 /* Override any gcc2 internal prototype to avoid an error.  */
4299 /* We use char because int might match the return type of a gcc2
4300     builtin and then its argument prototype would still apply.  */
4301 char socket();
4302 char (*f)();
4303
4304 int main() {
4305
4306 /* The GNU C library defines this for functions which it implements
4307     to always fail with ENOSYS.  Some functions are actually named
4308     something starting with __ and the normal name is an alias.  */
4309 #if defined (__stub_socket) || defined (__stub___socket)
4310 choke me
4311 #else
4312 f = socket;
4313 #endif
4314
4315 ; return 0; }
4316 EOF
4317 if { (eval echo configure:4318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4318   rm -rf conftest*
4319   eval "ac_cv_func_socket=yes"
4320 else
4321   echo "configure: failed program was:" >&5
4322   cat conftest.$ac_ext >&5
4323   rm -rf conftest*
4324   eval "ac_cv_func_socket=no"
4325 fi
4326 rm -f conftest*
4327 fi
4328
4329 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
4330   echo "$ac_t""yes" 1>&6
4331   :
4332 else
4333   echo "$ac_t""no" 1>&6
4334         
4335         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
4336 echo "configure:4337: checking for main in -lsocket" >&5
4337 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
4338 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4339   echo $ac_n "(cached) $ac_c" 1>&6
4340 else
4341   ac_save_LIBS="$LIBS"
4342 LIBS="-lsocket  $LIBS"
4343 cat > conftest.$ac_ext <<EOF
4344 #line 4345 "configure"
4345 #include "confdefs.h"
4346
4347 int main() {
4348 main()
4349 ; return 0; }
4350 EOF
4351 if { (eval echo configure:4352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4352   rm -rf conftest*
4353   eval "ac_cv_lib_$ac_lib_var=yes"
4354 else
4355   echo "configure: failed program was:" >&5
4356   cat conftest.$ac_ext >&5
4357   rm -rf conftest*
4358   eval "ac_cv_lib_$ac_lib_var=no"
4359 fi
4360 rm -f conftest*
4361 LIBS="$ac_save_LIBS"
4362
4363 fi
4364 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4365   echo "$ac_t""yes" 1>&6
4366     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4367     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4368   cat >> confdefs.h <<EOF
4369 #define $ac_tr_lib 1
4370 EOF
4371
4372   LIBS="-lsocket $LIBS"
4373
4374 else
4375   echo "$ac_t""no" 1>&6
4376 fi
4377
4378         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
4379 echo "configure:4380: checking for main in -lnet" >&5
4380 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
4381 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4382   echo $ac_n "(cached) $ac_c" 1>&6
4383 else
4384   ac_save_LIBS="$LIBS"
4385 LIBS="-lnet  $LIBS"
4386 cat > conftest.$ac_ext <<EOF
4387 #line 4388 "configure"
4388 #include "confdefs.h"
4389
4390 int main() {
4391 main()
4392 ; return 0; }
4393 EOF
4394 if { (eval echo configure:4395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4395   rm -rf conftest*
4396   eval "ac_cv_lib_$ac_lib_var=yes"
4397 else
4398   echo "configure: failed program was:" >&5
4399   cat conftest.$ac_ext >&5
4400   rm -rf conftest*
4401   eval "ac_cv_lib_$ac_lib_var=no"
4402 fi
4403 rm -f conftest*
4404 LIBS="$ac_save_LIBS"
4405
4406 fi
4407 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4408   echo "$ac_t""yes" 1>&6
4409     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4410     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4411   cat >> confdefs.h <<EOF
4412 #define $ac_tr_lib 1
4413 EOF
4414
4415   LIBS="-lnet $LIBS"
4416
4417 else
4418   echo "$ac_t""no" 1>&6
4419 fi
4420
4421         echo $ac_n "checking for socket in -lnet""... $ac_c" 1>&6
4422 echo "configure:4423: checking for socket in -lnet" >&5
4423 ac_lib_var=`echo net'_'socket | sed 'y%./+-:%__p__%'`
4424 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4425   echo $ac_n "(cached) $ac_c" 1>&6
4426 else
4427   ac_save_LIBS="$LIBS"
4428 LIBS="-lnet  $LIBS"
4429 cat > conftest.$ac_ext <<EOF
4430 #line 4431 "configure"
4431 #include "confdefs.h"
4432 /* Override any gcc2 internal prototype to avoid an error.  */
4433 /* We use char because int might match the return type of a gcc2
4434     builtin and then its argument prototype would still apply.  */
4435 char socket();
4436
4437 int main() {
4438 socket()
4439 ; return 0; }
4440 EOF
4441 if { (eval echo configure:4442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4442   rm -rf conftest*
4443   eval "ac_cv_lib_$ac_lib_var=yes"
4444 else
4445   echo "configure: failed program was:" >&5
4446   cat conftest.$ac_ext >&5
4447   rm -rf conftest*
4448   eval "ac_cv_lib_$ac_lib_var=no"
4449 fi
4450 rm -f conftest*
4451 LIBS="$ac_save_LIBS"
4452
4453 fi
4454 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4455   echo "$ac_t""yes" 1>&6
4456     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4457     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4458   cat >> confdefs.h <<EOF
4459 #define $ac_tr_lib 1
4460 EOF
4461
4462   LIBS="-lnet $LIBS"
4463
4464 else
4465   echo "$ac_t""no" 1>&6
4466 fi
4467
4468         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
4469 echo "configure:4470: checking for main in -lnsl_s" >&5
4470 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
4471 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4472   echo $ac_n "(cached) $ac_c" 1>&6
4473 else
4474   ac_save_LIBS="$LIBS"
4475 LIBS="-lnsl_s  $LIBS"
4476 cat > conftest.$ac_ext <<EOF
4477 #line 4478 "configure"
4478 #include "confdefs.h"
4479
4480 int main() {
4481 main()
4482 ; return 0; }
4483 EOF
4484 if { (eval echo configure:4485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4485   rm -rf conftest*
4486   eval "ac_cv_lib_$ac_lib_var=yes"
4487 else
4488   echo "configure: failed program was:" >&5
4489   cat conftest.$ac_ext >&5
4490   rm -rf conftest*
4491   eval "ac_cv_lib_$ac_lib_var=no"
4492 fi
4493 rm -f conftest*
4494 LIBS="$ac_save_LIBS"
4495
4496 fi
4497 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4498   echo "$ac_t""yes" 1>&6
4499     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4500     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4501   cat >> confdefs.h <<EOF
4502 #define $ac_tr_lib 1
4503 EOF
4504
4505   LIBS="-lnsl_s $LIBS"
4506
4507 else
4508   echo "$ac_t""no" 1>&6
4509 fi
4510
4511         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
4512 echo "configure:4513: checking for main in -lnsl" >&5
4513 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
4514 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4515   echo $ac_n "(cached) $ac_c" 1>&6
4516 else
4517   ac_save_LIBS="$LIBS"
4518 LIBS="-lnsl  $LIBS"
4519 cat > conftest.$ac_ext <<EOF
4520 #line 4521 "configure"
4521 #include "confdefs.h"
4522
4523 int main() {
4524 main()
4525 ; return 0; }
4526 EOF
4527 if { (eval echo configure:4528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4528   rm -rf conftest*
4529   eval "ac_cv_lib_$ac_lib_var=yes"
4530 else
4531   echo "configure: failed program was:" >&5
4532   cat conftest.$ac_ext >&5
4533   rm -rf conftest*
4534   eval "ac_cv_lib_$ac_lib_var=no"
4535 fi
4536 rm -f conftest*
4537 LIBS="$ac_save_LIBS"
4538
4539 fi
4540 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4541   echo "$ac_t""yes" 1>&6
4542     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4543     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4544   cat >> confdefs.h <<EOF
4545 #define $ac_tr_lib 1
4546 EOF
4547
4548   LIBS="-lnsl $LIBS"
4549
4550 else
4551   echo "$ac_t""no" 1>&6
4552 fi
4553
4554         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
4555 echo "configure:4556: checking for socket in -linet" >&5
4556 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
4557 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4558   echo $ac_n "(cached) $ac_c" 1>&6
4559 else
4560   ac_save_LIBS="$LIBS"
4561 LIBS="-linet  $LIBS"
4562 cat > conftest.$ac_ext <<EOF
4563 #line 4564 "configure"
4564 #include "confdefs.h"
4565 /* Override any gcc2 internal prototype to avoid an error.  */
4566 /* We use char because int might match the return type of a gcc2
4567     builtin and then its argument prototype would still apply.  */
4568 char socket();
4569
4570 int main() {
4571 socket()
4572 ; return 0; }
4573 EOF
4574 if { (eval echo configure:4575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4575   rm -rf conftest*
4576   eval "ac_cv_lib_$ac_lib_var=yes"
4577 else
4578   echo "configure: failed program was:" >&5
4579   cat conftest.$ac_ext >&5
4580   rm -rf conftest*
4581   eval "ac_cv_lib_$ac_lib_var=no"
4582 fi
4583 rm -f conftest*
4584 LIBS="$ac_save_LIBS"
4585
4586 fi
4587 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4588   echo "$ac_t""yes" 1>&6
4589     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4590     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4591   cat >> confdefs.h <<EOF
4592 #define $ac_tr_lib 1
4593 EOF
4594
4595   LIBS="-linet $LIBS"
4596
4597 else
4598   echo "$ac_t""no" 1>&6
4599 fi
4600
4601         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
4602 echo "configure:4603: checking for main in -lgen" >&5
4603 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
4604 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4605   echo $ac_n "(cached) $ac_c" 1>&6
4606 else
4607   ac_save_LIBS="$LIBS"
4608 LIBS="-lgen  $LIBS"
4609 cat > conftest.$ac_ext <<EOF
4610 #line 4611 "configure"
4611 #include "confdefs.h"
4612
4613 int main() {
4614 main()
4615 ; return 0; }
4616 EOF
4617 if { (eval echo configure:4618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4618   rm -rf conftest*
4619   eval "ac_cv_lib_$ac_lib_var=yes"
4620 else
4621   echo "configure: failed program was:" >&5
4622   cat conftest.$ac_ext >&5
4623   rm -rf conftest*
4624   eval "ac_cv_lib_$ac_lib_var=no"
4625 fi
4626 rm -f conftest*
4627 LIBS="$ac_save_LIBS"
4628
4629 fi
4630 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4631   echo "$ac_t""yes" 1>&6
4632     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4633     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4634   cat >> confdefs.h <<EOF
4635 #define $ac_tr_lib 1
4636 EOF
4637
4638   LIBS="-lgen $LIBS"
4639
4640 else
4641   echo "$ac_t""no" 1>&6
4642 fi
4643
4644
4645 fi
4646
4647
4648 echo $ac_n "checking for select""... $ac_c" 1>&6
4649 echo "configure:4650: checking for select" >&5
4650 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
4651   echo $ac_n "(cached) $ac_c" 1>&6
4652 else
4653   cat > conftest.$ac_ext <<EOF
4654 #line 4655 "configure"
4655 #include "confdefs.h"
4656 /* System header to define __stub macros and hopefully few prototypes,
4657     which can conflict with char select(); below.  */
4658 #include <assert.h>
4659 /* Override any gcc2 internal prototype to avoid an error.  */
4660 /* We use char because int might match the return type of a gcc2
4661     builtin and then its argument prototype would still apply.  */
4662 char select();
4663 char (*f)();
4664
4665 int main() {
4666
4667 /* The GNU C library defines this for functions which it implements
4668     to always fail with ENOSYS.  Some functions are actually named
4669     something starting with __ and the normal name is an alias.  */
4670 #if defined (__stub_select) || defined (__stub___select)
4671 choke me
4672 #else
4673 f = select;
4674 #endif
4675
4676 ; return 0; }
4677 EOF
4678 if { (eval echo configure:4679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4679   rm -rf conftest*
4680   eval "ac_cv_func_select=yes"
4681 else
4682   echo "configure: failed program was:" >&5
4683   cat conftest.$ac_ext >&5
4684   rm -rf conftest*
4685   eval "ac_cv_func_select=no"
4686 fi
4687 rm -f conftest*
4688 fi
4689
4690 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
4691   echo "$ac_t""yes" 1>&6
4692   :
4693 else
4694   echo "$ac_t""no" 1>&6
4695 { echo "configure: error: select() required." 1>&2; exit 1; }
4696 fi
4697
4698
4699 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
4700 echo "configure:4701: checking types of arguments for select()" >&5
4701  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
4702   echo $ac_n "(cached) $ac_c" 1>&6
4703 else
4704    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
4705   echo $ac_n "(cached) $ac_c" 1>&6
4706 else
4707     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
4708   echo $ac_n "(cached) $ac_c" 1>&6
4709 else
4710      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
4711      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
4712       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
4713        cat > conftest.$ac_ext <<EOF
4714 #line 4715 "configure"
4715 #include "confdefs.h"
4716 #ifdef HAVE_SYS_TYPES_H
4717 #include <sys/types.h>
4718 #endif
4719 #ifdef HAVE_SYS_TIME_H
4720 #include <sys/time.h>
4721 #endif
4722 #ifdef HAVE_SYS_SELECT_H
4723 #include <sys/select.h>
4724 #endif
4725 #ifdef HAVE_SYS_SOCKET_H
4726 #include <sys/socket.h>
4727 #endif
4728 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);
4729 int main() {
4730
4731 ; return 0; }
4732 EOF
4733 if { (eval echo configure:4734: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4734   rm -rf conftest*
4735           ac_not_found=no ; break 3
4736 else
4737   echo "configure: failed program was:" >&5
4738   cat conftest.$ac_ext >&5
4739   rm -rf conftest*
4740   ac_not_found=yes
4741 fi
4742 rm -f conftest*
4743       done
4744      done
4745     done
4746    
4747 fi
4748   
4749 fi
4750  
4751 fi
4752  if test "$ac_not_found" = yes; then
4753   ac_cv_func_select_arg1=int 
4754   ac_cv_func_select_arg234='int *' 
4755   ac_cv_func_select_arg5='struct timeval *'
4756  fi
4757  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
4758  cat >> confdefs.h <<EOF
4759 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
4760 EOF
4761
4762  cat >> confdefs.h <<EOF
4763 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
4764 EOF
4765
4766  cat >> confdefs.h <<EOF
4767 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
4768 EOF
4769
4770
4771
4772
4773 for ac_hdr in regex.h 
4774 do
4775 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4776 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4777 echo "configure:4778: checking for $ac_hdr" >&5
4778 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4779   echo $ac_n "(cached) $ac_c" 1>&6
4780 else
4781   cat > conftest.$ac_ext <<EOF
4782 #line 4783 "configure"
4783 #include "confdefs.h"
4784 #include <$ac_hdr>
4785 EOF
4786 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4787 { (eval echo configure:4788: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4788 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4789 if test -z "$ac_err"; then
4790   rm -rf conftest*
4791   eval "ac_cv_header_$ac_safe=yes"
4792 else
4793   echo "$ac_err" >&5
4794   echo "configure: failed program was:" >&5
4795   cat conftest.$ac_ext >&5
4796   rm -rf conftest*
4797   eval "ac_cv_header_$ac_safe=no"
4798 fi
4799 rm -f conftest*
4800 fi
4801 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4802   echo "$ac_t""yes" 1>&6
4803     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4804   cat >> confdefs.h <<EOF
4805 #define $ac_tr_hdr 1
4806 EOF
4807  
4808 else
4809   echo "$ac_t""no" 1>&6
4810 fi
4811 done
4812
4813 if test "$ac_cv_header_regex_h" != yes ; then
4814         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
4815 fi
4816 echo $ac_n "checking for regfree""... $ac_c" 1>&6
4817 echo "configure:4818: checking for regfree" >&5
4818 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
4819   echo $ac_n "(cached) $ac_c" 1>&6
4820 else
4821   cat > conftest.$ac_ext <<EOF
4822 #line 4823 "configure"
4823 #include "confdefs.h"
4824 /* System header to define __stub macros and hopefully few prototypes,
4825     which can conflict with char regfree(); below.  */
4826 #include <assert.h>
4827 /* Override any gcc2 internal prototype to avoid an error.  */
4828 /* We use char because int might match the return type of a gcc2
4829     builtin and then its argument prototype would still apply.  */
4830 char regfree();
4831 char (*f)();
4832
4833 int main() {
4834
4835 /* The GNU C library defines this for functions which it implements
4836     to always fail with ENOSYS.  Some functions are actually named
4837     something starting with __ and the normal name is an alias.  */
4838 #if defined (__stub_regfree) || defined (__stub___regfree)
4839 choke me
4840 #else
4841 f = regfree;
4842 #endif
4843
4844 ; return 0; }
4845 EOF
4846 if { (eval echo configure:4847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4847   rm -rf conftest*
4848   eval "ac_cv_func_regfree=yes"
4849 else
4850   echo "configure: failed program was:" >&5
4851   cat conftest.$ac_ext >&5
4852   rm -rf conftest*
4853   eval "ac_cv_func_regfree=no"
4854 fi
4855 rm -f conftest*
4856 fi
4857
4858 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
4859   echo "$ac_t""yes" 1>&6
4860   :
4861 else
4862   echo "$ac_t""no" 1>&6
4863 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
4864 fi
4865
4866
4867
4868 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
4869 echo "configure:4870: checking for compatible POSIX regex" >&5
4870 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
4871   echo $ac_n "(cached) $ac_c" 1>&6
4872 else
4873   
4874         if test "$cross_compiling" = yes; then
4875   ol_cv_c_posix_regex=cross
4876 else
4877   cat > conftest.$ac_ext <<EOF
4878 #line 4879 "configure"
4879 #include "confdefs.h"
4880
4881 #include <sys/types.h>
4882 #include <regex.h>
4883 static char *pattern, *string;
4884 main()
4885 {
4886         int rc;
4887         regex_t re;
4888
4889         pattern = "^A";
4890
4891         if(regcomp(&re, pattern, 0)) {
4892                 return -1;
4893         }
4894         
4895         string = "ALL MATCH";
4896         
4897         rc = regexec(&re, string, 0, (void*)0, 0);
4898
4899         regfree(&re);
4900
4901         return rc;
4902 }
4903 EOF
4904 if { (eval echo configure:4905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4905 then
4906   ol_cv_c_posix_regex=yes
4907 else
4908   echo "configure: failed program was:" >&5
4909   cat conftest.$ac_ext >&5
4910   rm -fr conftest*
4911   ol_cv_c_posix_regex=no
4912 fi
4913 rm -fr conftest*
4914 fi
4915
4916 fi
4917
4918 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
4919
4920 if test "$ol_cv_c_posix_regex" = no ; then
4921         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
4922 fi
4923
4924
4925 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
4926 echo "configure:4927: checking for sigset in -lV3" >&5
4927 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
4928 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4929   echo $ac_n "(cached) $ac_c" 1>&6
4930 else
4931   ac_save_LIBS="$LIBS"
4932 LIBS="-lV3  $LIBS"
4933 cat > conftest.$ac_ext <<EOF
4934 #line 4935 "configure"
4935 #include "confdefs.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 sigset();
4940
4941 int main() {
4942 sigset()
4943 ; return 0; }
4944 EOF
4945 if { (eval echo configure:4946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4946   rm -rf conftest*
4947   eval "ac_cv_lib_$ac_lib_var=yes"
4948 else
4949   echo "configure: failed program was:" >&5
4950   cat conftest.$ac_ext >&5
4951   rm -rf conftest*
4952   eval "ac_cv_lib_$ac_lib_var=no"
4953 fi
4954 rm -f conftest*
4955 LIBS="$ac_save_LIBS"
4956
4957 fi
4958 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4959   echo "$ac_t""yes" 1>&6
4960     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4961     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4962   cat >> confdefs.h <<EOF
4963 #define $ac_tr_lib 1
4964 EOF
4965
4966   LIBS="-lV3 $LIBS"
4967
4968 else
4969   echo "$ac_t""no" 1>&6
4970 fi
4971
4972
4973
4974 # find res_search
4975 if test $ol_enable_dns != no ; then
4976                 echo $ac_n "checking for res_search""... $ac_c" 1>&6
4977 echo "configure:4978: checking for res_search" >&5
4978 if eval "test \"\${ac_cv_func_res_search+set}\" = set"; then
4979   echo $ac_n "(cached) $ac_c" 1>&6
4980 else
4981   cat > conftest.$ac_ext <<EOF
4982 #line 4983 "configure"
4983 #include "confdefs.h"
4984 /* System header to define __stub macros and hopefully few prototypes,
4985     which can conflict with char res_search(); below.  */
4986 #include <assert.h>
4987 /* Override any gcc2 internal prototype to avoid an error.  */
4988 /* We use char because int might match the return type of a gcc2
4989     builtin and then its argument prototype would still apply.  */
4990 char res_search();
4991 char (*f)();
4992
4993 int main() {
4994
4995 /* The GNU C library defines this for functions which it implements
4996     to always fail with ENOSYS.  Some functions are actually named
4997     something starting with __ and the normal name is an alias.  */
4998 #if defined (__stub_res_search) || defined (__stub___res_search)
4999 choke me
5000 #else
5001 f = res_search;
5002 #endif
5003
5004 ; return 0; }
5005 EOF
5006 if { (eval echo configure:5007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5007   rm -rf conftest*
5008   eval "ac_cv_func_res_search=yes"
5009 else
5010   echo "configure: failed program was:" >&5
5011   cat conftest.$ac_ext >&5
5012   rm -rf conftest*
5013   eval "ac_cv_func_res_search=no"
5014 fi
5015 rm -f conftest*
5016 fi
5017
5018 if eval "test \"`echo '$ac_cv_func_'res_search`\" = yes"; then
5019   echo "$ac_t""yes" 1>&6
5020   :
5021 else
5022   echo "$ac_t""no" 1>&6
5023 fi
5024
5025         if test $ac_cv_func_res_search = no ; then 
5026                 echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
5027 echo "configure:5028: checking for res_search in -lbind" >&5
5028 ac_lib_var=`echo bind'_'res_search | sed 'y%./+-:%__p__%'`
5029 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5030   echo $ac_n "(cached) $ac_c" 1>&6
5031 else
5032   ac_save_LIBS="$LIBS"
5033 LIBS="-lbind  $LIBS"
5034 cat > conftest.$ac_ext <<EOF
5035 #line 5036 "configure"
5036 #include "confdefs.h"
5037 /* Override any gcc2 internal prototype to avoid an error.  */
5038 /* We use char because int might match the return type of a gcc2
5039     builtin and then its argument prototype would still apply.  */
5040 char res_search();
5041
5042 int main() {
5043 res_search()
5044 ; return 0; }
5045 EOF
5046 if { (eval echo configure:5047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5047   rm -rf conftest*
5048   eval "ac_cv_lib_$ac_lib_var=yes"
5049 else
5050   echo "configure: failed program was:" >&5
5051   cat conftest.$ac_ext >&5
5052   rm -rf conftest*
5053   eval "ac_cv_lib_$ac_lib_var=no"
5054 fi
5055 rm -f conftest*
5056 LIBS="$ac_save_LIBS"
5057
5058 fi
5059 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5060   echo "$ac_t""yes" 1>&6
5061     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5062     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5063   cat >> confdefs.h <<EOF
5064 #define $ac_tr_lib 1
5065 EOF
5066
5067   LIBS="-lbind $LIBS"
5068
5069 else
5070   echo "$ac_t""no" 1>&6
5071 fi
5072
5073                 ac_cv_func_res_search=$ac_cv_lib_bind_res_search
5074         fi
5075         if test $ac_cv_func_res_search = no ; then 
5076                 echo $ac_n "checking for __res_search in -lbind""... $ac_c" 1>&6
5077 echo "configure:5078: checking for __res_search in -lbind" >&5
5078 ac_lib_var=`echo bind'_'__res_search | sed 'y%./+-:%__p__%'`
5079 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5080   echo $ac_n "(cached) $ac_c" 1>&6
5081 else
5082   ac_save_LIBS="$LIBS"
5083 LIBS="-lbind  $LIBS"
5084 cat > conftest.$ac_ext <<EOF
5085 #line 5086 "configure"
5086 #include "confdefs.h"
5087 /* Override any gcc2 internal prototype to avoid an error.  */
5088 /* We use char because int might match the return type of a gcc2
5089     builtin and then its argument prototype would still apply.  */
5090 char __res_search();
5091
5092 int main() {
5093 __res_search()
5094 ; return 0; }
5095 EOF
5096 if { (eval echo configure:5097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5097   rm -rf conftest*
5098   eval "ac_cv_lib_$ac_lib_var=yes"
5099 else
5100   echo "configure: failed program was:" >&5
5101   cat conftest.$ac_ext >&5
5102   rm -rf conftest*
5103   eval "ac_cv_lib_$ac_lib_var=no"
5104 fi
5105 rm -f conftest*
5106 LIBS="$ac_save_LIBS"
5107
5108 fi
5109 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5110   echo "$ac_t""yes" 1>&6
5111     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5112     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5113   cat >> confdefs.h <<EOF
5114 #define $ac_tr_lib 1
5115 EOF
5116
5117   LIBS="-lbind $LIBS"
5118
5119 else
5120   echo "$ac_t""no" 1>&6
5121 fi
5122
5123                 ac_cv_func_res_search=$ac_cv_lib_bind___res_search
5124         fi
5125         if test $ac_cv_func_res_search = no ; then 
5126                 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
5127 echo "configure:5128: checking for res_search in -lresolv" >&5
5128 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-:%__p__%'`
5129 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5130   echo $ac_n "(cached) $ac_c" 1>&6
5131 else
5132   ac_save_LIBS="$LIBS"
5133 LIBS="-lresolv  $LIBS"
5134 cat > conftest.$ac_ext <<EOF
5135 #line 5136 "configure"
5136 #include "confdefs.h"
5137 /* Override any gcc2 internal prototype to avoid an error.  */
5138 /* We use char because int might match the return type of a gcc2
5139     builtin and then its argument prototype would still apply.  */
5140 char res_search();
5141
5142 int main() {
5143 res_search()
5144 ; return 0; }
5145 EOF
5146 if { (eval echo configure:5147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5147   rm -rf conftest*
5148   eval "ac_cv_lib_$ac_lib_var=yes"
5149 else
5150   echo "configure: failed program was:" >&5
5151   cat conftest.$ac_ext >&5
5152   rm -rf conftest*
5153   eval "ac_cv_lib_$ac_lib_var=no"
5154 fi
5155 rm -f conftest*
5156 LIBS="$ac_save_LIBS"
5157
5158 fi
5159 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5160   echo "$ac_t""yes" 1>&6
5161     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5162     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5163   cat >> confdefs.h <<EOF
5164 #define $ac_tr_lib 1
5165 EOF
5166
5167   LIBS="-lresolv $LIBS"
5168
5169 else
5170   echo "$ac_t""no" 1>&6
5171 fi
5172
5173                 ac_cv_func_res_search=$ac_cv_lib_resolv_res_search
5174         fi
5175
5176         if test "$ac_cv_func_res_search" = yes ; then
5177                 cat >> confdefs.h <<\EOF
5178 #define HAVE_RES_SEARCH 1
5179 EOF
5180
5181         elif test $ol_enable_dns = yes ; then
5182                 { echo "configure: error: --enable-dns requires res_search" 1>&2; exit 1; }
5183         else
5184                 echo "configure: warning: no res_search, disabling DNS support" 1>&2
5185         fi
5186 fi
5187
5188
5189 # ISODE tests
5190 ol_link_isode=no
5191 if test $ol_enable_ldapd != no ; then
5192         echo "configure: warning: ldapd is not supported and may suffer from bit rot." 1>&2
5193
5194                 echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
5195 echo "configure:5196: checking for main in -lxtpp" >&5
5196 ac_lib_var=`echo xtpp'_'main | sed 'y%./+-:%__p__%'`
5197 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5198   echo $ac_n "(cached) $ac_c" 1>&6
5199 else
5200   ac_save_LIBS="$LIBS"
5201 LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
5202 cat > conftest.$ac_ext <<EOF
5203 #line 5204 "configure"
5204 #include "confdefs.h"
5205
5206 int main() {
5207 main()
5208 ; return 0; }
5209 EOF
5210 if { (eval echo configure:5211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5211   rm -rf conftest*
5212   eval "ac_cv_lib_$ac_lib_var=yes"
5213 else
5214   echo "configure: failed program was:" >&5
5215   cat conftest.$ac_ext >&5
5216   rm -rf conftest*
5217   eval "ac_cv_lib_$ac_lib_var=no"
5218 fi
5219 rm -f conftest*
5220 LIBS="$ac_save_LIBS"
5221
5222 fi
5223 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5224   echo "$ac_t""yes" 1>&6
5225   
5226                 ol_link_isode=yes
5227                 cat >> confdefs.h <<\EOF
5228 #define HAVE_XTPP 1
5229 EOF
5230
5231                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
5232                 
5233 else
5234   echo "$ac_t""no" 1>&6
5235 :
5236 fi
5237
5238         echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
5239 echo "configure:5240: checking for main in -ldsap" >&5
5240 ac_lib_var=`echo dsap'_'main | sed 'y%./+-:%__p__%'`
5241 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5242   echo $ac_n "(cached) $ac_c" 1>&6
5243 else
5244   ac_save_LIBS="$LIBS"
5245 LIBS="-ldsap -lisode $LIBS"
5246 cat > conftest.$ac_ext <<EOF
5247 #line 5248 "configure"
5248 #include "confdefs.h"
5249
5250 int main() {
5251 main()
5252 ; return 0; }
5253 EOF
5254 if { (eval echo configure:5255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5255   rm -rf conftest*
5256   eval "ac_cv_lib_$ac_lib_var=yes"
5257 else
5258   echo "configure: failed program was:" >&5
5259   cat conftest.$ac_ext >&5
5260   rm -rf conftest*
5261   eval "ac_cv_lib_$ac_lib_var=no"
5262 fi
5263 rm -f conftest*
5264 LIBS="$ac_save_LIBS"
5265
5266 fi
5267 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5268   echo "$ac_t""yes" 1>&6
5269   
5270                 ol_link_isode=yes
5271                 cat >> confdefs.h <<\EOF
5272 #define HAVE_DSAP 1
5273 EOF
5274
5275                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
5276                 
5277 else
5278   echo "$ac_t""no" 1>&6
5279 :
5280 fi
5281
5282         echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
5283 echo "configure:5284: checking for main in -lisode" >&5
5284 ac_lib_var=`echo isode'_'main | sed 'y%./+-:%__p__%'`
5285 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5286   echo $ac_n "(cached) $ac_c" 1>&6
5287 else
5288   ac_save_LIBS="$LIBS"
5289 LIBS="-lisode  $LIBS"
5290 cat > conftest.$ac_ext <<EOF
5291 #line 5292 "configure"
5292 #include "confdefs.h"
5293
5294 int main() {
5295 main()
5296 ; return 0; }
5297 EOF
5298 if { (eval echo configure:5299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5299   rm -rf conftest*
5300   eval "ac_cv_lib_$ac_lib_var=yes"
5301 else
5302   echo "configure: failed program was:" >&5
5303   cat conftest.$ac_ext >&5
5304   rm -rf conftest*
5305   eval "ac_cv_lib_$ac_lib_var=no"
5306 fi
5307 rm -f conftest*
5308 LIBS="$ac_save_LIBS"
5309
5310 fi
5311 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5312   echo "$ac_t""yes" 1>&6
5313   
5314                 ol_link_isode=yes
5315                 cat >> confdefs.h <<\EOF
5316 #define HAVE_ISODE 1
5317 EOF
5318
5319                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
5320                 
5321 else
5322   echo "$ac_t""no" 1>&6
5323 :
5324 fi
5325
5326 fi
5327
5328 if test $ol_link_isode != no; then
5329         echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
5330 echo "configure:5331: checking for main in -lpp" >&5
5331 ac_lib_var=`echo pp'_'main | sed 'y%./+-:%__p__%'`
5332 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5333   echo $ac_n "(cached) $ac_c" 1>&6
5334 else
5335   ac_save_LIBS="$LIBS"
5336 LIBS="-lpp  $LIBS"
5337 cat > conftest.$ac_ext <<EOF
5338 #line 5339 "configure"
5339 #include "confdefs.h"
5340
5341 int main() {
5342 main()
5343 ; return 0; }
5344 EOF
5345 if { (eval echo configure:5346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5346   rm -rf conftest*
5347   eval "ac_cv_lib_$ac_lib_var=yes"
5348 else
5349   echo "configure: failed program was:" >&5
5350   cat conftest.$ac_ext >&5
5351   rm -rf conftest*
5352   eval "ac_cv_lib_$ac_lib_var=no"
5353 fi
5354 rm -f conftest*
5355 LIBS="$ac_save_LIBS"
5356
5357 fi
5358 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5359   echo "$ac_t""yes" 1>&6
5360   
5361                 cat >> confdefs.h <<\EOF
5362 #define HAVE_PP 1
5363 EOF
5364
5365                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
5366                 
5367 else
5368   echo "$ac_t""no" 1>&6
5369 :
5370 fi
5371
5372
5373         # Extract the first word of "pepsy", so it can be a program name with args.
5374 set dummy pepsy; ac_word=$2
5375 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
5376 echo "configure:5377: checking for $ac_word" >&5
5377 if eval "test \"\${ac_cv_path_PEPSY+set}\" = set"; then
5378   echo $ac_n "(cached) $ac_c" 1>&6
5379 else
5380   case "$PEPSY" in
5381   /*)
5382   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a path.
5383   ;;
5384   ?:/*)                  
5385   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a dos path.
5386   ;;
5387   *)
5388   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
5389   ac_dummy="$PATH"
5390   for ac_dir in $ac_dummy; do 
5391     test -z "$ac_dir" && ac_dir=.
5392     if test -f $ac_dir/$ac_word; then
5393       ac_cv_path_PEPSY="$ac_dir/$ac_word"
5394       break
5395     fi
5396   done
5397   IFS="$ac_save_ifs"
5398   ;;
5399 esac
5400 fi
5401 PEPSY="$ac_cv_path_PEPSY"
5402 if test -n "$PEPSY"; then
5403   echo "$ac_t""$PEPSY" 1>&6
5404 else
5405   echo "$ac_t""no" 1>&6
5406 fi
5407
5408 fi
5409
5410 if test $ol_enable_quipu != no ; then
5411         for ac_hdr in quipu/commonarg.h
5412 do
5413 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5414 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5415 echo "configure:5416: checking for $ac_hdr" >&5
5416 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5417   echo $ac_n "(cached) $ac_c" 1>&6
5418 else
5419   cat > conftest.$ac_ext <<EOF
5420 #line 5421 "configure"
5421 #include "confdefs.h"
5422 #include <$ac_hdr>
5423 EOF
5424 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5425 { (eval echo configure:5426: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5426 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5427 if test -z "$ac_err"; then
5428   rm -rf conftest*
5429   eval "ac_cv_header_$ac_safe=yes"
5430 else
5431   echo "$ac_err" >&5
5432   echo "configure: failed program was:" >&5
5433   cat conftest.$ac_ext >&5
5434   rm -rf conftest*
5435   eval "ac_cv_header_$ac_safe=no"
5436 fi
5437 rm -f conftest*
5438 fi
5439 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5440   echo "$ac_t""yes" 1>&6
5441     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5442   cat >> confdefs.h <<EOF
5443 #define $ac_tr_hdr 1
5444 EOF
5445  
5446 else
5447   echo "$ac_t""no" 1>&6
5448 fi
5449 done
5450
5451
5452         if test $ac_cv_header_quipu_commonarg_h = yes ; then
5453                 BUILD_QUIPU=yes
5454         elif test $ol_enable_quipu = auto ; then
5455                 echo "configure: warning: no quipu for --enable-quipu=auto, disabling" 1>&2
5456         else
5457                 { echo "configure: error: no quipu for --enable-quipu=$ol_enable_quipu" 1>&2; exit 1; }
5458         fi
5459 fi
5460
5461 ol_link_kerberos=no
5462
5463 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
5464         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
5465 do
5466 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5467 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5468 echo "configure:5469: checking for $ac_hdr" >&5
5469 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5470   echo $ac_n "(cached) $ac_c" 1>&6
5471 else
5472   cat > conftest.$ac_ext <<EOF
5473 #line 5474 "configure"
5474 #include "confdefs.h"
5475 #include <$ac_hdr>
5476 EOF
5477 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5478 { (eval echo configure:5479: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5479 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5480 if test -z "$ac_err"; then
5481   rm -rf conftest*
5482   eval "ac_cv_header_$ac_safe=yes"
5483 else
5484   echo "$ac_err" >&5
5485   echo "configure: failed program was:" >&5
5486   cat conftest.$ac_ext >&5
5487   rm -rf conftest*
5488   eval "ac_cv_header_$ac_safe=no"
5489 fi
5490 rm -f conftest*
5491 fi
5492 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5493   echo "$ac_t""yes" 1>&6
5494     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5495   cat >> confdefs.h <<EOF
5496 #define $ac_tr_hdr 1
5497 EOF
5498  
5499 else
5500   echo "$ac_t""no" 1>&6
5501 fi
5502 done
5503
5504
5505         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
5506                 echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
5507 echo "configure:5508: checking for main in -lkrb4" >&5
5508 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
5509 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5510   echo $ac_n "(cached) $ac_c" 1>&6
5511 else
5512   ac_save_LIBS="$LIBS"
5513 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
5514 cat > conftest.$ac_ext <<EOF
5515 #line 5516 "configure"
5516 #include "confdefs.h"
5517
5518 int main() {
5519 main()
5520 ; return 0; }
5521 EOF
5522 if { (eval echo configure:5523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5523   rm -rf conftest*
5524   eval "ac_cv_lib_$ac_lib_var=yes"
5525 else
5526   echo "configure: failed program was:" >&5
5527   cat conftest.$ac_ext >&5
5528   rm -rf conftest*
5529   eval "ac_cv_lib_$ac_lib_var=no"
5530 fi
5531 rm -f conftest*
5532 LIBS="$ac_save_LIBS"
5533
5534 fi
5535 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5536   echo "$ac_t""yes" 1>&6
5537   have_k5=yes
5538 else
5539   echo "$ac_t""no" 1>&6
5540 have_k5=no
5541 fi
5542
5543
5544                 if test $have_k5 = yes ; then
5545                         ol_with_kerberos=found
5546                         ol_link_kerberos=yes
5547
5548                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
5549
5550                         LIBS="$KRB_LIBS $LIBS"
5551
5552                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
5553 echo "configure:5554: checking for des_debug in Kerberos libraries" >&5
5554 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
5555   echo $ac_n "(cached) $ac_c" 1>&6
5556 else
5557   
5558                                                                 save_LIBS="$LIBS"
5559                                 LIBS="$KRB_LIBS $LIBS"
5560                                 cat > conftest.$ac_ext <<EOF
5561 #line 5562 "configure"
5562 #include "confdefs.h"
5563
5564 #include <kerberosIV/krb.h>
5565 #include <kerberosIV/des.h>
5566 extern int des_debug;
5567
5568 int main() {
5569
5570 des_debug = 1;
5571
5572 ; return 0; }
5573 EOF
5574 if { (eval echo configure:5575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5575   rm -rf conftest*
5576   ol_cv_var_des_debug=yes
5577 else
5578   echo "configure: failed program was:" >&5
5579   cat conftest.$ac_ext >&5
5580   rm -rf conftest*
5581   ol_cv_var_des_debug=no
5582 fi
5583 rm -f conftest*
5584                                                                 LIBS="$save_LIBS"
5585                         
5586 fi
5587
5588 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
5589
5590                         if test $ol_cv_var_des_debug = yes ; then
5591                                 cat >> confdefs.h <<\EOF
5592 #define HAVE_DES_DEBUG 1
5593 EOF
5594
5595                         fi
5596
5597                         LIBS="$save_LIBS"
5598                 fi
5599         fi
5600 fi
5601
5602 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
5603         for ac_hdr in krb.h des.h
5604 do
5605 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5606 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5607 echo "configure:5608: checking for $ac_hdr" >&5
5608 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5609   echo $ac_n "(cached) $ac_c" 1>&6
5610 else
5611   cat > conftest.$ac_ext <<EOF
5612 #line 5613 "configure"
5613 #include "confdefs.h"
5614 #include <$ac_hdr>
5615 EOF
5616 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5617 { (eval echo configure:5618: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5618 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5619 if test -z "$ac_err"; then
5620   rm -rf conftest*
5621   eval "ac_cv_header_$ac_safe=yes"
5622 else
5623   echo "$ac_err" >&5
5624   echo "configure: failed program was:" >&5
5625   cat conftest.$ac_ext >&5
5626   rm -rf conftest*
5627   eval "ac_cv_header_$ac_safe=no"
5628 fi
5629 rm -f conftest*
5630 fi
5631 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5632   echo "$ac_t""yes" 1>&6
5633     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5634   cat >> confdefs.h <<EOF
5635 #define $ac_tr_hdr 1
5636 EOF
5637  
5638 else
5639   echo "$ac_t""no" 1>&6
5640 fi
5641 done
5642
5643
5644         if test $ac_cv_header_krb_h = yes ; then
5645                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
5646 echo "configure:5647: checking for main in -lkrb" >&5
5647 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
5648 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5649   echo $ac_n "(cached) $ac_c" 1>&6
5650 else
5651   ac_save_LIBS="$LIBS"
5652 LIBS="-lkrb -ldes $LIBS"
5653 cat > conftest.$ac_ext <<EOF
5654 #line 5655 "configure"
5655 #include "confdefs.h"
5656
5657 int main() {
5658 main()
5659 ; return 0; }
5660 EOF
5661 if { (eval echo configure:5662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5662   rm -rf conftest*
5663   eval "ac_cv_lib_$ac_lib_var=yes"
5664 else
5665   echo "configure: failed program was:" >&5
5666   cat conftest.$ac_ext >&5
5667   rm -rf conftest*
5668   eval "ac_cv_lib_$ac_lib_var=no"
5669 fi
5670 rm -f conftest*
5671 LIBS="$ac_save_LIBS"
5672
5673 fi
5674 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5675   echo "$ac_t""yes" 1>&6
5676   have_k4=yes
5677 else
5678   echo "$ac_t""no" 1>&6
5679 have_k4=no
5680 fi
5681
5682
5683                 if test $have_k4 = yes ; then
5684                         ol_with_kerberos=found
5685                         ol_link_kerberos=yes
5686
5687                         KRB_LIBS="-lkrb -ldes"
5688                 fi
5689         fi
5690 fi
5691
5692 if test $ol_link_kerberos = yes ; then
5693         cat >> confdefs.h <<\EOF
5694 #define HAVE_KERBEROS 1
5695 EOF
5696
5697 fi
5698
5699 ol_link_tls=no
5700 if test $ol_with_tls != no ; then
5701         
5702         for ac_hdr in openssl/ssl.h ssl.h
5703 do
5704 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5705 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5706 echo "configure:5707: checking for $ac_hdr" >&5
5707 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5708   echo $ac_n "(cached) $ac_c" 1>&6
5709 else
5710   cat > conftest.$ac_ext <<EOF
5711 #line 5712 "configure"
5712 #include "confdefs.h"
5713 #include <$ac_hdr>
5714 EOF
5715 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5716 { (eval echo configure:5717: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5717 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5718 if test -z "$ac_err"; then
5719   rm -rf conftest*
5720   eval "ac_cv_header_$ac_safe=yes"
5721 else
5722   echo "$ac_err" >&5
5723   echo "configure: failed program was:" >&5
5724   cat conftest.$ac_ext >&5
5725   rm -rf conftest*
5726   eval "ac_cv_header_$ac_safe=no"
5727 fi
5728 rm -f conftest*
5729 fi
5730 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5731   echo "$ac_t""yes" 1>&6
5732     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5733   cat >> confdefs.h <<EOF
5734 #define $ac_tr_hdr 1
5735 EOF
5736  
5737 else
5738   echo "$ac_t""no" 1>&6
5739 fi
5740 done
5741
5742         
5743         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
5744                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
5745 echo "configure:5746: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
5746 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
5747 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5748   echo $ac_n "(cached) $ac_c" 1>&6
5749 else
5750   ac_save_LIBS="$LIBS"
5751 LIBS="-lssl -lcrypto $LIBS"
5752 cat > conftest.$ac_ext <<EOF
5753 #line 5754 "configure"
5754 #include "confdefs.h"
5755 /* Override any gcc2 internal prototype to avoid an error.  */
5756 /* We use char because int might match the return type of a gcc2
5757     builtin and then its argument prototype would still apply.  */
5758 char SSLeay_add_ssl_algorithms();
5759
5760 int main() {
5761 SSLeay_add_ssl_algorithms()
5762 ; return 0; }
5763 EOF
5764 if { (eval echo configure:5765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5765   rm -rf conftest*
5766   eval "ac_cv_lib_$ac_lib_var=yes"
5767 else
5768   echo "configure: failed program was:" >&5
5769   cat conftest.$ac_ext >&5
5770   rm -rf conftest*
5771   eval "ac_cv_lib_$ac_lib_var=no"
5772 fi
5773 rm -f conftest*
5774 LIBS="$ac_save_LIBS"
5775
5776 fi
5777 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5778   echo "$ac_t""yes" 1>&6
5779   have_ssleay=yes
5780                         need_rsaref=no
5781 else
5782   echo "$ac_t""no" 1>&6
5783 have_ssleay=no
5784 fi
5785
5786                         
5787                 if test $have_ssleay = no ; then
5788                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
5789 echo "configure:5790: checking for SSL_library_init in -lssl" >&5
5790 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
5791 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5792   echo $ac_n "(cached) $ac_c" 1>&6
5793 else
5794   ac_save_LIBS="$LIBS"
5795 LIBS="-lssl -lcrypto $LIBS"
5796 cat > conftest.$ac_ext <<EOF
5797 #line 5798 "configure"
5798 #include "confdefs.h"
5799 /* Override any gcc2 internal prototype to avoid an error.  */
5800 /* We use char because int might match the return type of a gcc2
5801     builtin and then its argument prototype would still apply.  */
5802 char SSL_library_init();
5803
5804 int main() {
5805 SSL_library_init()
5806 ; return 0; }
5807 EOF
5808 if { (eval echo configure:5809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5809   rm -rf conftest*
5810   eval "ac_cv_lib_$ac_lib_var=yes"
5811 else
5812   echo "configure: failed program was:" >&5
5813   cat conftest.$ac_ext >&5
5814   rm -rf conftest*
5815   eval "ac_cv_lib_$ac_lib_var=no"
5816 fi
5817 rm -f conftest*
5818 LIBS="$ac_save_LIBS"
5819
5820 fi
5821 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5822   echo "$ac_t""yes" 1>&6
5823   have_ssleay=yes
5824                                 need_rsaref=no
5825 else
5826   echo "$ac_t""no" 1>&6
5827 have_ssleay=no
5828 fi
5829
5830                 fi
5831
5832                 if test $have_ssleay = no ; then
5833                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
5834 echo "configure:5835: checking for ssl3_accept in -lssl" >&5
5835 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
5836 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5837   echo $ac_n "(cached) $ac_c" 1>&6
5838 else
5839   ac_save_LIBS="$LIBS"
5840 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
5841 cat > conftest.$ac_ext <<EOF
5842 #line 5843 "configure"
5843 #include "confdefs.h"
5844 /* Override any gcc2 internal prototype to avoid an error.  */
5845 /* We use char because int might match the return type of a gcc2
5846     builtin and then its argument prototype would still apply.  */
5847 char ssl3_accept();
5848
5849 int main() {
5850 ssl3_accept()
5851 ; return 0; }
5852 EOF
5853 if { (eval echo configure:5854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5854   rm -rf conftest*
5855   eval "ac_cv_lib_$ac_lib_var=yes"
5856 else
5857   echo "configure: failed program was:" >&5
5858   cat conftest.$ac_ext >&5
5859   rm -rf conftest*
5860   eval "ac_cv_lib_$ac_lib_var=no"
5861 fi
5862 rm -f conftest*
5863 LIBS="$ac_save_LIBS"
5864
5865 fi
5866 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5867   echo "$ac_t""yes" 1>&6
5868   have_ssleay=yes
5869                                 need_rsaref=yes
5870 else
5871   echo "$ac_t""no" 1>&6
5872 have_ssleay=no
5873 fi
5874
5875                 fi
5876
5877                 if test $have_ssleay = yes ; then
5878                         ol_with_tls=found
5879                         ol_link_tls=yes
5880
5881                         cat >> confdefs.h <<\EOF
5882 #define HAVE_SSLEAY 1
5883 EOF
5884
5885
5886                         if test $need_rsaref = yes; then
5887                                 cat >> confdefs.h <<\EOF
5888 #define HAVE_RSAREF 1
5889 EOF
5890
5891
5892                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
5893                         else
5894                                 TLS_LIBS="-lssl -lcrypto"
5895                         fi
5896                 fi
5897         fi
5898 fi
5899
5900 if test $ol_link_tls = yes ; then
5901         cat >> confdefs.h <<\EOF
5902 #define HAVE_TLS 1
5903 EOF
5904
5905 fi      
5906
5907 for ac_func in \
5908         ctime_r                 \
5909         gethostbyname_r gethostbyaddr_r \
5910
5911 do
5912 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5913 echo "configure:5914: checking for $ac_func" >&5
5914 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
5915   echo $ac_n "(cached) $ac_c" 1>&6
5916 else
5917   cat > conftest.$ac_ext <<EOF
5918 #line 5919 "configure"
5919 #include "confdefs.h"
5920 /* System header to define __stub macros and hopefully few prototypes,
5921     which can conflict with char $ac_func(); below.  */
5922 #include <assert.h>
5923 /* Override any gcc2 internal prototype to avoid an error.  */
5924 /* We use char because int might match the return type of a gcc2
5925     builtin and then its argument prototype would still apply.  */
5926 char $ac_func();
5927 char (*f)();
5928
5929 int main() {
5930
5931 /* The GNU C library defines this for functions which it implements
5932     to always fail with ENOSYS.  Some functions are actually named
5933     something starting with __ and the normal name is an alias.  */
5934 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5935 choke me
5936 #else
5937 f = $ac_func;
5938 #endif
5939
5940 ; return 0; }
5941 EOF
5942 if { (eval echo configure:5943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5943   rm -rf conftest*
5944   eval "ac_cv_func_$ac_func=yes"
5945 else
5946   echo "configure: failed program was:" >&5
5947   cat conftest.$ac_ext >&5
5948   rm -rf conftest*
5949   eval "ac_cv_func_$ac_func=no"
5950 fi
5951 rm -f conftest*
5952 fi
5953
5954 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5955   echo "$ac_t""yes" 1>&6
5956     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5957   cat >> confdefs.h <<EOF
5958 #define $ac_tr_func 1
5959 EOF
5960  
5961 else
5962   echo "$ac_t""no" 1>&6
5963 fi
5964 done
5965
5966
5967 if test "$ac_cv_func_ctime_r" = no ; then
5968         ol_cv_func_ctime_r_nargs=0
5969 else
5970         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
5971 echo "configure:5972: checking number of arguments of ctime_r" >&5
5972 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
5973   echo $ac_n "(cached) $ac_c" 1>&6
5974 else
5975   cat > conftest.$ac_ext <<EOF
5976 #line 5977 "configure"
5977 #include "confdefs.h"
5978 #include <time.h>
5979 int main() {
5980 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
5981 ; return 0; }
5982 EOF
5983 if { (eval echo configure:5984: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5984   rm -rf conftest*
5985   ol_cv_func_ctime_r_nargs=3
5986 else
5987   echo "configure: failed program was:" >&5
5988   cat conftest.$ac_ext >&5
5989   rm -rf conftest*
5990   cat > conftest.$ac_ext <<EOF
5991 #line 5992 "configure"
5992 #include "confdefs.h"
5993 #include <time.h>
5994 int main() {
5995 time_t ti; char *buffer; ctime_r(&ti,buffer);
5996 ; return 0; }
5997 EOF
5998 if { (eval echo configure:5999: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5999   rm -rf conftest*
6000   ol_cv_func_ctime_r_nargs=2
6001 else
6002   echo "configure: failed program was:" >&5
6003   cat conftest.$ac_ext >&5
6004   rm -rf conftest*
6005   ol_cv_func_ctime_r_nargs=0
6006 fi
6007 rm -f conftest*
6008 fi
6009 rm -f conftest*
6010 fi
6011
6012 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
6013   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
6014     cat >> confdefs.h <<EOF
6015 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
6016 EOF
6017
6018   fi
6019
6020 fi
6021
6022 if test "$ac_cv_func_gethostbyname_r" = yes ; then
6023         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
6024 echo "configure:6025: checking number of arguments of gethostbyname_r" >&5
6025 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
6026   echo $ac_n "(cached) $ac_c" 1>&6
6027 else
6028   cat > conftest.$ac_ext <<EOF
6029 #line 6030 "configure"
6030 #include "confdefs.h"
6031 #include <sys/types.h>
6032 #include <sys/socket.h>
6033 #include <netinet/in.h>
6034 #include <netdb.h>
6035 #define BUFSIZE (sizeof(struct hostent)+10)
6036 int main() {
6037 struct hostent hent; char buffer[BUFSIZE];
6038                 int bufsize=BUFSIZE;int h_errno;
6039                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
6040                         buffer, bufsize, &h_errno);
6041 ; return 0; }
6042 EOF
6043 if { (eval echo configure:6044: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6044   rm -rf conftest*
6045   ol_cv_func_gethostbyname_r_nargs=5
6046 else
6047   echo "configure: failed program was:" >&5
6048   cat conftest.$ac_ext >&5
6049   rm -rf conftest*
6050   cat > conftest.$ac_ext <<EOF
6051 #line 6052 "configure"
6052 #include "confdefs.h"
6053 #include <sys/types.h>
6054 #include <sys/socket.h>
6055 #include <netinet/in.h>
6056 #include <netdb.h>
6057 #define BUFSIZE (sizeof(struct hostent)+10)
6058 int main() {
6059 struct hostent hent;struct hostent *rhent;
6060                         char buffer[BUFSIZE];
6061                         int bufsize=BUFSIZE;int h_errno;
6062                         (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
6063                                 &rhent, &h_errno);
6064 ; return 0; }
6065 EOF
6066 if { (eval echo configure:6067: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6067   rm -rf conftest*
6068   ol_cv_func_gethostbyname_r_nargs=6
6069 else
6070   echo "configure: failed program was:" >&5
6071   cat conftest.$ac_ext >&5
6072   rm -rf conftest*
6073   ol_cv_func_gethostbyname_r_nargs=0
6074 fi
6075 rm -f conftest*
6076 fi
6077 rm -f conftest*
6078 fi
6079
6080 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
6081   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
6082         cat >> confdefs.h <<EOF
6083 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
6084 EOF
6085
6086   fi
6087
6088 else
6089         ol_cv_func_gethostbyname_r_nargs=0
6090 fi
6091  
6092 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
6093         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
6094 echo "configure:6095: checking number of arguments of gethostbyaddr_r" >&5
6095 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
6096   echo $ac_n "(cached) $ac_c" 1>&6
6097 else
6098   cat > conftest.$ac_ext <<EOF
6099 #line 6100 "configure"
6100 #include "confdefs.h"
6101 #include <sys/types.h>
6102 #include <sys/socket.h>
6103 #include <netinet/in.h>
6104 #include <netdb.h>
6105 #define BUFSIZE (sizeof(struct hostent)+10)
6106 int main() {
6107 struct hostent hent; char buffer[BUFSIZE]; 
6108             struct in_addr add;
6109             size_t alen=sizeof(struct in_addr);
6110             int bufsize=BUFSIZE;int h_errno;
6111                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
6112                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
6113 ; return 0; }
6114 EOF
6115 if { (eval echo configure:6116: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6116   rm -rf conftest*
6117   ol_cv_func_gethostbyaddr_r_nargs=7
6118 else
6119   echo "configure: failed program was:" >&5
6120   cat conftest.$ac_ext >&5
6121   rm -rf conftest*
6122   cat > conftest.$ac_ext <<EOF
6123 #line 6124 "configure"
6124 #include "confdefs.h"
6125 #include <sys/types.h>
6126 #include <sys/socket.h>
6127 #include <netinet/in.h>
6128 #include <netdb.h>
6129 #define BUFSIZE (sizeof(struct hostent)+10)
6130 int main() {
6131 struct hostent hent;
6132                         struct hostent *rhent; char buffer[BUFSIZE]; 
6133                         struct in_addr add;
6134                         size_t alen=sizeof(struct in_addr);
6135                         int bufsize=BUFSIZE;int h_errno;
6136                         (void)gethostbyaddr_r( (void *)&(add.s_addr),
6137                                 alen, AF_INET, &hent, buffer, bufsize, 
6138                                 &rhent, &h_errno);
6139 ; return 0; }
6140 EOF
6141 if { (eval echo configure:6142: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6142   rm -rf conftest*
6143   ol_cv_func_gethostbyaddr_r_nargs=8
6144 else
6145   echo "configure: failed program was:" >&5
6146   cat conftest.$ac_ext >&5
6147   rm -rf conftest*
6148   ol_cv_func_gethostbyaddr_r_nargs=0
6149 fi
6150 rm -f conftest*
6151 fi
6152 rm -f conftest*
6153 fi
6154
6155 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
6156   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
6157     cat >> confdefs.h <<EOF
6158 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
6159 EOF
6160
6161   fi
6162
6163 else
6164         ol_cv_func_gethostbyaddr_r_nargs=0
6165 fi
6166
6167 if test "$ac_cv_func_ctime_r" = yes \
6168         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
6169         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
6170         -a "$ac_cv_func_gethostbyname_r" = yes \
6171         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
6172         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
6173         -a "$ac_cv_func_gethostbyaddr_r" = yes \
6174         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
6175         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
6176         ; then
6177  
6178         cat >> confdefs.h <<\EOF
6179 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
6180 EOF
6181
6182 fi
6183
6184 ol_link_threads=no
6185 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6186         -o $ol_with_threads = posix ; then
6187
6188         for ac_hdr in pthread.h sched.h
6189 do
6190 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6191 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6192 echo "configure:6193: checking for $ac_hdr" >&5
6193 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6194   echo $ac_n "(cached) $ac_c" 1>&6
6195 else
6196   cat > conftest.$ac_ext <<EOF
6197 #line 6198 "configure"
6198 #include "confdefs.h"
6199 #include <$ac_hdr>
6200 EOF
6201 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6202 { (eval echo configure:6203: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6203 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6204 if test -z "$ac_err"; then
6205   rm -rf conftest*
6206   eval "ac_cv_header_$ac_safe=yes"
6207 else
6208   echo "$ac_err" >&5
6209   echo "configure: failed program was:" >&5
6210   cat conftest.$ac_ext >&5
6211   rm -rf conftest*
6212   eval "ac_cv_header_$ac_safe=no"
6213 fi
6214 rm -f conftest*
6215 fi
6216 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6217   echo "$ac_t""yes" 1>&6
6218     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6219   cat >> confdefs.h <<EOF
6220 #define $ac_tr_hdr 1
6221 EOF
6222  
6223 else
6224   echo "$ac_t""no" 1>&6
6225 fi
6226 done
6227
6228
6229         if test $ac_cv_header_pthread_h = yes ; then
6230                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
6231 echo "configure:6232: checking POSIX thread version" >&5
6232 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
6233   echo $ac_n "(cached) $ac_c" 1>&6
6234 else
6235   
6236         cat > conftest.$ac_ext <<EOF
6237 #line 6238 "configure"
6238 #include "confdefs.h"
6239
6240 #               include <pthread.h>
6241                 /* this check could be improved */
6242 #               ifdef PTHREAD_ONCE_INIT
6243                         pthread_version_final
6244 #               endif
6245         
6246 EOF
6247 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6248   egrep "pthread_version_final" >/dev/null 2>&1; then
6249   rm -rf conftest*
6250   ol_pthread_final=yes
6251 else
6252   rm -rf conftest*
6253   ol_pthread_final=no
6254 fi
6255 rm -f conftest*
6256
6257
6258         cat > conftest.$ac_ext <<EOF
6259 #line 6260 "configure"
6260 #include "confdefs.h"
6261
6262 #               include <pthread.h>
6263                 /* this check could be improved */
6264 #               ifdef pthread_once_init
6265                         pthread_version_draft4
6266 #               endif
6267         
6268 EOF
6269 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6270   egrep "pthread_version_draft4" >/dev/null 2>&1; then
6271   rm -rf conftest*
6272   ol_pthread_draft4=yes
6273 else
6274   rm -rf conftest*
6275   ol_pthread_draft4=no
6276 fi
6277 rm -f conftest*
6278
6279
6280         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
6281                 ol_cv_pthread_version=final
6282         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
6283                 ol_cv_pthread_version=draft4
6284         else
6285                 ol_cv_pthread_version=unknown
6286         fi
6287
6288 fi
6289
6290 echo "$ac_t""$ol_cv_pthread_version" 1>&6
6291
6292
6293                 if test $ol_cv_pthread_version = final ; then
6294                         cat >> confdefs.h <<\EOF
6295 #define HAVE_PTHREADS_FINAL 1
6296 EOF
6297
6298                 elif test $ol_cv_pthread_version = draft4 ; then
6299                         cat >> confdefs.h <<\EOF
6300 #define HAVE_PTHREADS_D4 1
6301 EOF
6302
6303                 else
6304                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
6305                 fi
6306
6307                 # consider threads found
6308                 ol_with_threads=found
6309
6310                 
6311         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
6312 echo "configure:6313: checking for LinuxThreads pthread.h" >&5
6313 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
6314   echo $ac_n "(cached) $ac_c" 1>&6
6315 else
6316   cat > conftest.$ac_ext <<EOF
6317 #line 6318 "configure"
6318 #include "confdefs.h"
6319 #include <pthread.h>
6320 EOF
6321 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6322   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
6323   rm -rf conftest*
6324   ol_cv_header_linux_threads=yes
6325 else
6326   rm -rf conftest*
6327   ol_cv_header_linux_threads=no
6328 fi
6329 rm -f conftest*
6330
6331                 
6332 fi
6333
6334 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
6335         if test $ol_cv_header_linux_threads = yes; then
6336                 cat >> confdefs.h <<\EOF
6337 #define HAVE_LINUX_THREADS 1
6338 EOF
6339
6340         fi
6341
6342
6343                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
6344                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
6345 echo "configure:6346: checking for pthread_create in default libraries" >&5
6346 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
6347   echo $ac_n "(cached) $ac_c" 1>&6
6348 else
6349   
6350                 if test "$cross_compiling" = yes; then
6351                         ol_cv_pthread_create=yes
6352 else
6353   cat > conftest.$ac_ext <<EOF
6354 #line 6355 "configure"
6355 #include "confdefs.h"
6356
6357 #include <pthread.h>
6358 #ifndef NULL
6359 #define NULL (void*)0
6360 #endif
6361
6362 static void *task(p)
6363         void *p;
6364 {
6365         return (void *) (p == NULL);
6366 }
6367
6368 int main(argc, argv)
6369         int argc;
6370         char **argv;
6371 {
6372         pthread_t t;
6373         int status;
6374
6375         /* make sure pthread_create() isn't just a stub */
6376 #if HAVE_PTHREADS_D4
6377         status = pthread_create(&t, pthread_attr_default, task, NULL);
6378 #else
6379         status = pthread_create(&t, NULL, task, NULL);
6380 #endif
6381
6382         if( status ) return status;
6383
6384         /* make sure pthread_detach() isn't just a stub */
6385 #if HAVE_PTHREADS_D4
6386         status = pthread_detach( &t );
6387 #else
6388         status = pthread_detach( t );
6389 #endif
6390
6391         return status;
6392 }
6393
6394 EOF
6395 if { (eval echo configure:6396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6396 then
6397   ol_cv_pthread_create=yes
6398 else
6399   echo "configure: failed program was:" >&5
6400   cat conftest.$ac_ext >&5
6401   rm -fr conftest*
6402   ol_cv_pthread_create=no
6403 fi
6404 rm -fr conftest*
6405 fi
6406
6407 fi
6408
6409 echo "$ac_t""$ol_cv_pthread_create" 1>&6
6410
6411                 if test $ol_cv_pthread_create != no ; then
6412                         ol_link_threads=posix
6413                         ol_link_pthreads=""
6414                 fi
6415                 
6416                 # Pthread try link: -mt (ol_cv_pthread_mt)
6417         if test "$ol_link_threads" = no ; then
6418                 # try -mt
6419                 echo $ac_n "checking for pthread link with -mt""... $ac_c" 1>&6
6420 echo "configure:6421: checking for pthread link with -mt" >&5
6421 if eval "test \"\${ol_cv_pthread_mt+set}\" = set"; then
6422   echo $ac_n "(cached) $ac_c" 1>&6
6423 else
6424   
6425                         # save the flags
6426                         ol_LIBS="$LIBS"
6427                         LIBS="-mt $LIBS"
6428
6429                         cat > conftest.$ac_ext <<EOF
6430 #line 6431 "configure"
6431 #include "confdefs.h"
6432
6433 #include <pthread.h>
6434 #ifndef NULL
6435 #define NULL (void*)0
6436 #endif
6437
6438 int main() {
6439
6440         pthread_t t;
6441
6442 #if HAVE_PTHREADS_D4
6443         pthread_create(&t, pthread_attr_default, NULL, NULL);
6444         pthread_detach( &t );
6445 #else
6446         pthread_create(&t, NULL, NULL, NULL);
6447         pthread_detach( t );
6448 #endif
6449 #ifdef HAVE_LINUX_THREADS
6450         pthread_kill_other_threads_np();
6451 #endif
6452
6453 ; return 0; }
6454 EOF
6455 if { (eval echo configure:6456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6456   rm -rf conftest*
6457   ol_cv_pthread_mt=yes
6458 else
6459   echo "configure: failed program was:" >&5
6460   cat conftest.$ac_ext >&5
6461   rm -rf conftest*
6462   ol_cv_pthread_mt=no
6463 fi
6464 rm -f conftest*
6465
6466                 # restore the LIBS
6467                 LIBS="$ol_LIBS"
6468                 
6469 fi
6470
6471 echo "$ac_t""$ol_cv_pthread_mt" 1>&6
6472
6473                 if test $ol_cv_pthread_mt = yes ; then
6474                         ol_link_pthreads="-mt"
6475                         ol_link_threads=posix
6476                 fi
6477         fi
6478
6479                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
6480         if test "$ol_link_threads" = no ; then
6481                 # try -kthread
6482                 echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
6483 echo "configure:6484: checking for pthread link with -kthread" >&5
6484 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
6485   echo $ac_n "(cached) $ac_c" 1>&6
6486 else
6487   
6488                         # save the flags
6489                         ol_LIBS="$LIBS"
6490                         LIBS="-kthread $LIBS"
6491
6492                         cat > conftest.$ac_ext <<EOF
6493 #line 6494 "configure"
6494 #include "confdefs.h"
6495
6496 #include <pthread.h>
6497 #ifndef NULL
6498 #define NULL (void*)0
6499 #endif
6500
6501 int main() {
6502
6503         pthread_t t;
6504
6505 #if HAVE_PTHREADS_D4
6506         pthread_create(&t, pthread_attr_default, NULL, NULL);
6507         pthread_detach( &t );
6508 #else
6509         pthread_create(&t, NULL, NULL, NULL);
6510         pthread_detach( t );
6511 #endif
6512 #ifdef HAVE_LINUX_THREADS
6513         pthread_kill_other_threads_np();
6514 #endif
6515
6516 ; return 0; }
6517 EOF
6518 if { (eval echo configure:6519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6519   rm -rf conftest*
6520   ol_cv_pthread_kthread=yes
6521 else
6522   echo "configure: failed program was:" >&5
6523   cat conftest.$ac_ext >&5
6524   rm -rf conftest*
6525   ol_cv_pthread_kthread=no
6526 fi
6527 rm -f conftest*
6528
6529                 # restore the LIBS
6530                 LIBS="$ol_LIBS"
6531                 
6532 fi
6533
6534 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
6535
6536                 if test $ol_cv_pthread_kthread = yes ; then
6537                         ol_link_pthreads="-kthread"
6538                         ol_link_threads=posix
6539                 fi
6540         fi
6541
6542                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
6543         if test "$ol_link_threads" = no ; then
6544                 # try -pthread
6545                 echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
6546 echo "configure:6547: checking for pthread link with -pthread" >&5
6547 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
6548   echo $ac_n "(cached) $ac_c" 1>&6
6549 else
6550   
6551                         # save the flags
6552                         ol_LIBS="$LIBS"
6553                         LIBS="-pthread $LIBS"
6554
6555                         cat > conftest.$ac_ext <<EOF
6556 #line 6557 "configure"
6557 #include "confdefs.h"
6558
6559 #include <pthread.h>
6560 #ifndef NULL
6561 #define NULL (void*)0
6562 #endif
6563
6564 int main() {
6565
6566         pthread_t t;
6567
6568 #if HAVE_PTHREADS_D4
6569         pthread_create(&t, pthread_attr_default, NULL, NULL);
6570         pthread_detach( &t );
6571 #else
6572         pthread_create(&t, NULL, NULL, NULL);
6573         pthread_detach( t );
6574 #endif
6575 #ifdef HAVE_LINUX_THREADS
6576         pthread_kill_other_threads_np();
6577 #endif
6578
6579 ; return 0; }
6580 EOF
6581 if { (eval echo configure:6582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6582   rm -rf conftest*
6583   ol_cv_pthread_pthread=yes
6584 else
6585   echo "configure: failed program was:" >&5
6586   cat conftest.$ac_ext >&5
6587   rm -rf conftest*
6588   ol_cv_pthread_pthread=no
6589 fi
6590 rm -f conftest*
6591
6592                 # restore the LIBS
6593                 LIBS="$ol_LIBS"
6594                 
6595 fi
6596
6597 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
6598
6599                 if test $ol_cv_pthread_pthread = yes ; then
6600                         ol_link_pthreads="-pthread"
6601                         ol_link_threads=posix
6602                 fi
6603         fi
6604
6605                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
6606         if test "$ol_link_threads" = no ; then
6607                 # try -pthreads
6608                 echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
6609 echo "configure:6610: checking for pthread link with -pthreads" >&5
6610 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
6611   echo $ac_n "(cached) $ac_c" 1>&6
6612 else
6613   
6614                         # save the flags
6615                         ol_LIBS="$LIBS"
6616                         LIBS="-pthreads $LIBS"
6617
6618                         cat > conftest.$ac_ext <<EOF
6619 #line 6620 "configure"
6620 #include "confdefs.h"
6621
6622 #include <pthread.h>
6623 #ifndef NULL
6624 #define NULL (void*)0
6625 #endif
6626
6627 int main() {
6628
6629         pthread_t t;
6630
6631 #if HAVE_PTHREADS_D4
6632         pthread_create(&t, pthread_attr_default, NULL, NULL);
6633         pthread_detach( &t );
6634 #else
6635         pthread_create(&t, NULL, NULL, NULL);
6636         pthread_detach( t );
6637 #endif
6638 #ifdef HAVE_LINUX_THREADS
6639         pthread_kill_other_threads_np();
6640 #endif
6641
6642 ; return 0; }
6643 EOF
6644 if { (eval echo configure:6645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6645   rm -rf conftest*
6646   ol_cv_pthread_pthreads=yes
6647 else
6648   echo "configure: failed program was:" >&5
6649   cat conftest.$ac_ext >&5
6650   rm -rf conftest*
6651   ol_cv_pthread_pthreads=no
6652 fi
6653 rm -f conftest*
6654
6655                 # restore the LIBS
6656                 LIBS="$ol_LIBS"
6657                 
6658 fi
6659
6660 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
6661
6662                 if test $ol_cv_pthread_pthreads = yes ; then
6663                         ol_link_pthreads="-pthreads"
6664                         ol_link_threads=posix
6665                 fi
6666         fi
6667
6668                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
6669         if test "$ol_link_threads" = no ; then
6670                 # try -mthreads
6671                 echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
6672 echo "configure:6673: checking for pthread link with -mthreads" >&5
6673 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
6674   echo $ac_n "(cached) $ac_c" 1>&6
6675 else
6676   
6677                         # save the flags
6678                         ol_LIBS="$LIBS"
6679                         LIBS="-mthreads $LIBS"
6680
6681                         cat > conftest.$ac_ext <<EOF
6682 #line 6683 "configure"
6683 #include "confdefs.h"
6684
6685 #include <pthread.h>
6686 #ifndef NULL
6687 #define NULL (void*)0
6688 #endif
6689
6690 int main() {
6691
6692         pthread_t t;
6693
6694 #if HAVE_PTHREADS_D4
6695         pthread_create(&t, pthread_attr_default, NULL, NULL);
6696         pthread_detach( &t );
6697 #else
6698         pthread_create(&t, NULL, NULL, NULL);
6699         pthread_detach( t );
6700 #endif
6701 #ifdef HAVE_LINUX_THREADS
6702         pthread_kill_other_threads_np();
6703 #endif
6704
6705 ; return 0; }
6706 EOF
6707 if { (eval echo configure:6708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6708   rm -rf conftest*
6709   ol_cv_pthread_mthreads=yes
6710 else
6711   echo "configure: failed program was:" >&5
6712   cat conftest.$ac_ext >&5
6713   rm -rf conftest*
6714   ol_cv_pthread_mthreads=no
6715 fi
6716 rm -f conftest*
6717
6718                 # restore the LIBS
6719                 LIBS="$ol_LIBS"
6720                 
6721 fi
6722
6723 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
6724
6725                 if test $ol_cv_pthread_mthreads = yes ; then
6726                         ol_link_pthreads="-mthreads"
6727                         ol_link_threads=posix
6728                 fi
6729         fi
6730
6731                 # Pthread try link: -thread (ol_cv_pthread_thread)
6732         if test "$ol_link_threads" = no ; then
6733                 # try -thread
6734                 echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
6735 echo "configure:6736: checking for pthread link with -thread" >&5
6736 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
6737   echo $ac_n "(cached) $ac_c" 1>&6
6738 else
6739   
6740                         # save the flags
6741                         ol_LIBS="$LIBS"
6742                         LIBS="-thread $LIBS"
6743
6744                         cat > conftest.$ac_ext <<EOF
6745 #line 6746 "configure"
6746 #include "confdefs.h"
6747
6748 #include <pthread.h>
6749 #ifndef NULL
6750 #define NULL (void*)0
6751 #endif
6752
6753 int main() {
6754
6755         pthread_t t;
6756
6757 #if HAVE_PTHREADS_D4
6758         pthread_create(&t, pthread_attr_default, NULL, NULL);
6759         pthread_detach( &t );
6760 #else
6761         pthread_create(&t, NULL, NULL, NULL);
6762         pthread_detach( t );
6763 #endif
6764 #ifdef HAVE_LINUX_THREADS
6765         pthread_kill_other_threads_np();
6766 #endif
6767
6768 ; return 0; }
6769 EOF
6770 if { (eval echo configure:6771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6771   rm -rf conftest*
6772   ol_cv_pthread_thread=yes
6773 else
6774   echo "configure: failed program was:" >&5
6775   cat conftest.$ac_ext >&5
6776   rm -rf conftest*
6777   ol_cv_pthread_thread=no
6778 fi
6779 rm -f conftest*
6780
6781                 # restore the LIBS
6782                 LIBS="$ol_LIBS"
6783                 
6784 fi
6785
6786 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
6787
6788                 if test $ol_cv_pthread_thread = yes ; then
6789                         ol_link_pthreads="-thread"
6790                         ol_link_threads=posix
6791                 fi
6792         fi
6793
6794
6795                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
6796         if test "$ol_link_threads" = no ; then
6797                 # try -lpthread -lmach -lexc -lc_r
6798                 echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
6799 echo "configure:6800: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
6800 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
6801   echo $ac_n "(cached) $ac_c" 1>&6
6802 else
6803   
6804                         # save the flags
6805                         ol_LIBS="$LIBS"
6806                         LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
6807
6808                         cat > conftest.$ac_ext <<EOF
6809 #line 6810 "configure"
6810 #include "confdefs.h"
6811
6812 #include <pthread.h>
6813 #ifndef NULL
6814 #define NULL (void*)0
6815 #endif
6816
6817 int main() {
6818
6819         pthread_t t;
6820
6821 #if HAVE_PTHREADS_D4
6822         pthread_create(&t, pthread_attr_default, NULL, NULL);
6823         pthread_detach( &t );
6824 #else
6825         pthread_create(&t, NULL, NULL, NULL);
6826         pthread_detach( t );
6827 #endif
6828 #ifdef HAVE_LINUX_THREADS
6829         pthread_kill_other_threads_np();
6830 #endif
6831
6832 ; return 0; }
6833 EOF
6834 if { (eval echo configure:6835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6835   rm -rf conftest*
6836   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
6837 else
6838   echo "configure: failed program was:" >&5
6839   cat conftest.$ac_ext >&5
6840   rm -rf conftest*
6841   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
6842 fi
6843 rm -f conftest*
6844
6845                 # restore the LIBS
6846                 LIBS="$ol_LIBS"
6847                 
6848 fi
6849
6850 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
6851
6852                 if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
6853                         ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
6854                         ol_link_threads=posix
6855                 fi
6856         fi
6857
6858                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
6859         if test "$ol_link_threads" = no ; then
6860                 # try -lpthread -lmach -lexc
6861                 echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
6862 echo "configure:6863: checking for pthread link with -lpthread -lmach -lexc" >&5
6863 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
6864   echo $ac_n "(cached) $ac_c" 1>&6
6865 else
6866   
6867                         # save the flags
6868                         ol_LIBS="$LIBS"
6869                         LIBS="-lpthread -lmach -lexc $LIBS"
6870
6871                         cat > conftest.$ac_ext <<EOF
6872 #line 6873 "configure"
6873 #include "confdefs.h"
6874
6875 #include <pthread.h>
6876 #ifndef NULL
6877 #define NULL (void*)0
6878 #endif
6879
6880 int main() {
6881
6882         pthread_t t;
6883
6884 #if HAVE_PTHREADS_D4
6885         pthread_create(&t, pthread_attr_default, NULL, NULL);
6886         pthread_detach( &t );
6887 #else
6888         pthread_create(&t, NULL, NULL, NULL);
6889         pthread_detach( t );
6890 #endif
6891 #ifdef HAVE_LINUX_THREADS
6892         pthread_kill_other_threads_np();
6893 #endif
6894
6895 ; return 0; }
6896 EOF
6897 if { (eval echo configure:6898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6898   rm -rf conftest*
6899   ol_cv_pthread_lpthread_lmach_lexc=yes
6900 else
6901   echo "configure: failed program was:" >&5
6902   cat conftest.$ac_ext >&5
6903   rm -rf conftest*
6904   ol_cv_pthread_lpthread_lmach_lexc=no
6905 fi
6906 rm -f conftest*
6907
6908                 # restore the LIBS
6909                 LIBS="$ol_LIBS"
6910                 
6911 fi
6912
6913 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
6914
6915                 if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
6916                         ol_link_pthreads="-lpthread -lmach -lexc"
6917                         ol_link_threads=posix
6918                 fi
6919         fi
6920
6921
6922                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
6923         if test "$ol_link_threads" = no ; then
6924                 # try -lpthread -Wl,-woff,85
6925                 echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
6926 echo "configure:6927: checking for pthread link with -lpthread -Wl,-woff,85" >&5
6927 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
6928   echo $ac_n "(cached) $ac_c" 1>&6
6929 else
6930   
6931                         # save the flags
6932                         ol_LIBS="$LIBS"
6933                         LIBS="-lpthread -Wl,-woff,85 $LIBS"
6934
6935                         cat > conftest.$ac_ext <<EOF
6936 #line 6937 "configure"
6937 #include "confdefs.h"
6938
6939 #include <pthread.h>
6940 #ifndef NULL
6941 #define NULL (void*)0
6942 #endif
6943
6944 int main() {
6945
6946         pthread_t t;
6947
6948 #if HAVE_PTHREADS_D4
6949         pthread_create(&t, pthread_attr_default, NULL, NULL);
6950         pthread_detach( &t );
6951 #else
6952         pthread_create(&t, NULL, NULL, NULL);
6953         pthread_detach( t );
6954 #endif
6955 #ifdef HAVE_LINUX_THREADS
6956         pthread_kill_other_threads_np();
6957 #endif
6958
6959 ; return 0; }
6960 EOF
6961 if { (eval echo configure:6962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6962   rm -rf conftest*
6963   ol_cv_pthread_lib_lpthread_woff=yes
6964 else
6965   echo "configure: failed program was:" >&5
6966   cat conftest.$ac_ext >&5
6967   rm -rf conftest*
6968   ol_cv_pthread_lib_lpthread_woff=no
6969 fi
6970 rm -f conftest*
6971
6972                 # restore the LIBS
6973                 LIBS="$ol_LIBS"
6974                 
6975 fi
6976
6977 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
6978
6979                 if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
6980                         ol_link_pthreads="-lpthread -Wl,-woff,85"
6981                         ol_link_threads=posix
6982                 fi
6983         fi
6984
6985
6986                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
6987         if test "$ol_link_threads" = no ; then
6988                 # try -lpthread
6989                 echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
6990 echo "configure:6991: checking for pthread link with -lpthread" >&5
6991 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
6992   echo $ac_n "(cached) $ac_c" 1>&6
6993 else
6994   
6995                         # save the flags
6996                         ol_LIBS="$LIBS"
6997                         LIBS="-lpthread $LIBS"
6998
6999                         cat > conftest.$ac_ext <<EOF
7000 #line 7001 "configure"
7001 #include "confdefs.h"
7002
7003 #include <pthread.h>
7004 #ifndef NULL
7005 #define NULL (void*)0
7006 #endif
7007
7008 int main() {
7009
7010         pthread_t t;
7011
7012 #if HAVE_PTHREADS_D4
7013         pthread_create(&t, pthread_attr_default, NULL, NULL);
7014         pthread_detach( &t );
7015 #else
7016         pthread_create(&t, NULL, NULL, NULL);
7017         pthread_detach( t );
7018 #endif
7019 #ifdef HAVE_LINUX_THREADS
7020         pthread_kill_other_threads_np();
7021 #endif
7022
7023 ; return 0; }
7024 EOF
7025 if { (eval echo configure:7026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7026   rm -rf conftest*
7027   ol_cv_pthread_lpthread=yes
7028 else
7029   echo "configure: failed program was:" >&5
7030   cat conftest.$ac_ext >&5
7031   rm -rf conftest*
7032   ol_cv_pthread_lpthread=no
7033 fi
7034 rm -f conftest*
7035
7036                 # restore the LIBS
7037                 LIBS="$ol_LIBS"
7038                 
7039 fi
7040
7041 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
7042
7043                 if test $ol_cv_pthread_lpthread = yes ; then
7044                         ol_link_pthreads="-lpthread"
7045                         ol_link_threads=posix
7046                 fi
7047         fi
7048
7049                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
7050         if test "$ol_link_threads" = no ; then
7051                 # try -lc_r
7052                 echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
7053 echo "configure:7054: checking for pthread link with -lc_r" >&5
7054 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
7055   echo $ac_n "(cached) $ac_c" 1>&6
7056 else
7057   
7058                         # save the flags
7059                         ol_LIBS="$LIBS"
7060                         LIBS="-lc_r $LIBS"
7061
7062                         cat > conftest.$ac_ext <<EOF
7063 #line 7064 "configure"
7064 #include "confdefs.h"
7065
7066 #include <pthread.h>
7067 #ifndef NULL
7068 #define NULL (void*)0
7069 #endif
7070
7071 int main() {
7072
7073         pthread_t t;
7074
7075 #if HAVE_PTHREADS_D4
7076         pthread_create(&t, pthread_attr_default, NULL, NULL);
7077         pthread_detach( &t );
7078 #else
7079         pthread_create(&t, NULL, NULL, NULL);
7080         pthread_detach( t );
7081 #endif
7082 #ifdef HAVE_LINUX_THREADS
7083         pthread_kill_other_threads_np();
7084 #endif
7085
7086 ; return 0; }
7087 EOF
7088 if { (eval echo configure:7089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7089   rm -rf conftest*
7090   ol_cv_pthread_lc_r=yes
7091 else
7092   echo "configure: failed program was:" >&5
7093   cat conftest.$ac_ext >&5
7094   rm -rf conftest*
7095   ol_cv_pthread_lc_r=no
7096 fi
7097 rm -f conftest*
7098
7099                 # restore the LIBS
7100                 LIBS="$ol_LIBS"
7101                 
7102 fi
7103
7104 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
7105
7106                 if test $ol_cv_pthread_lc_r = yes ; then
7107                         ol_link_pthreads="-lc_r"
7108                         ol_link_threads=posix
7109                 fi
7110         fi
7111
7112
7113                 # Pthread try link: -threads (ol_cv_pthread_threads)
7114         if test "$ol_link_threads" = no ; then
7115                 # try -threads
7116                 echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
7117 echo "configure:7118: checking for pthread link with -threads" >&5
7118 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
7119   echo $ac_n "(cached) $ac_c" 1>&6
7120 else
7121   
7122                         # save the flags
7123                         ol_LIBS="$LIBS"
7124                         LIBS="-threads $LIBS"
7125
7126                         cat > conftest.$ac_ext <<EOF
7127 #line 7128 "configure"
7128 #include "confdefs.h"
7129
7130 #include <pthread.h>
7131 #ifndef NULL
7132 #define NULL (void*)0
7133 #endif
7134
7135 int main() {
7136
7137         pthread_t t;
7138
7139 #if HAVE_PTHREADS_D4
7140         pthread_create(&t, pthread_attr_default, NULL, NULL);
7141         pthread_detach( &t );
7142 #else
7143         pthread_create(&t, NULL, NULL, NULL);
7144         pthread_detach( t );
7145 #endif
7146 #ifdef HAVE_LINUX_THREADS
7147         pthread_kill_other_threads_np();
7148 #endif
7149
7150 ; return 0; }
7151 EOF
7152 if { (eval echo configure:7153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7153   rm -rf conftest*
7154   ol_cv_pthread_threads=yes
7155 else
7156   echo "configure: failed program was:" >&5
7157   cat conftest.$ac_ext >&5
7158   rm -rf conftest*
7159   ol_cv_pthread_threads=no
7160 fi
7161 rm -f conftest*
7162
7163                 # restore the LIBS
7164                 LIBS="$ol_LIBS"
7165                 
7166 fi
7167
7168 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
7169
7170                 if test $ol_cv_pthread_threads = yes ; then
7171                         ol_link_pthreads="-threads"
7172                         ol_link_threads=posix
7173                 fi
7174         fi
7175
7176
7177                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
7178         if test "$ol_link_threads" = no ; then
7179                 # try -lpthreads -lmach -lexc -lc_r
7180                 echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
7181 echo "configure:7182: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
7182 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
7183   echo $ac_n "(cached) $ac_c" 1>&6
7184 else
7185   
7186                         # save the flags
7187                         ol_LIBS="$LIBS"
7188                         LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
7189
7190                         cat > conftest.$ac_ext <<EOF
7191 #line 7192 "configure"
7192 #include "confdefs.h"
7193
7194 #include <pthread.h>
7195 #ifndef NULL
7196 #define NULL (void*)0
7197 #endif
7198
7199 int main() {
7200
7201         pthread_t t;
7202
7203 #if HAVE_PTHREADS_D4
7204         pthread_create(&t, pthread_attr_default, NULL, NULL);
7205         pthread_detach( &t );
7206 #else
7207         pthread_create(&t, NULL, NULL, NULL);
7208         pthread_detach( t );
7209 #endif
7210 #ifdef HAVE_LINUX_THREADS
7211         pthread_kill_other_threads_np();
7212 #endif
7213
7214 ; return 0; }
7215 EOF
7216 if { (eval echo configure:7217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7217   rm -rf conftest*
7218   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
7219 else
7220   echo "configure: failed program was:" >&5
7221   cat conftest.$ac_ext >&5
7222   rm -rf conftest*
7223   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
7224 fi
7225 rm -f conftest*
7226
7227                 # restore the LIBS
7228                 LIBS="$ol_LIBS"
7229                 
7230 fi
7231
7232 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
7233
7234                 if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
7235                         ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
7236                         ol_link_threads=posix
7237                 fi
7238         fi
7239
7240                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
7241         if test "$ol_link_threads" = no ; then
7242                 # try -lpthreads -lmach -lexc
7243                 echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
7244 echo "configure:7245: checking for pthread link with -lpthreads -lmach -lexc" >&5
7245 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
7246   echo $ac_n "(cached) $ac_c" 1>&6
7247 else
7248   
7249                         # save the flags
7250                         ol_LIBS="$LIBS"
7251                         LIBS="-lpthreads -lmach -lexc $LIBS"
7252
7253                         cat > conftest.$ac_ext <<EOF
7254 #line 7255 "configure"
7255 #include "confdefs.h"
7256
7257 #include <pthread.h>
7258 #ifndef NULL
7259 #define NULL (void*)0
7260 #endif
7261
7262 int main() {
7263
7264         pthread_t t;
7265
7266 #if HAVE_PTHREADS_D4
7267         pthread_create(&t, pthread_attr_default, NULL, NULL);
7268         pthread_detach( &t );
7269 #else
7270         pthread_create(&t, NULL, NULL, NULL);
7271         pthread_detach( t );
7272 #endif
7273 #ifdef HAVE_LINUX_THREADS
7274         pthread_kill_other_threads_np();
7275 #endif
7276
7277 ; return 0; }
7278 EOF
7279 if { (eval echo configure:7280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7280   rm -rf conftest*
7281   ol_cv_pthread_lpthreads_lmach_lexc=yes
7282 else
7283   echo "configure: failed program was:" >&5
7284   cat conftest.$ac_ext >&5
7285   rm -rf conftest*
7286   ol_cv_pthread_lpthreads_lmach_lexc=no
7287 fi
7288 rm -f conftest*
7289
7290                 # restore the LIBS
7291                 LIBS="$ol_LIBS"
7292                 
7293 fi
7294
7295 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
7296
7297                 if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
7298                         ol_link_pthreads="-lpthreads -lmach -lexc"
7299                         ol_link_threads=posix
7300                 fi
7301         fi
7302
7303                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
7304         if test "$ol_link_threads" = no ; then
7305                 # try -lpthreads -lexc
7306                 echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
7307 echo "configure:7308: checking for pthread link with -lpthreads -lexc" >&5
7308 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
7309   echo $ac_n "(cached) $ac_c" 1>&6
7310 else
7311   
7312                         # save the flags
7313                         ol_LIBS="$LIBS"
7314                         LIBS="-lpthreads -lexc $LIBS"
7315
7316                         cat > conftest.$ac_ext <<EOF
7317 #line 7318 "configure"
7318 #include "confdefs.h"
7319
7320 #include <pthread.h>
7321 #ifndef NULL
7322 #define NULL (void*)0
7323 #endif
7324
7325 int main() {
7326
7327         pthread_t t;
7328
7329 #if HAVE_PTHREADS_D4
7330         pthread_create(&t, pthread_attr_default, NULL, NULL);
7331         pthread_detach( &t );
7332 #else
7333         pthread_create(&t, NULL, NULL, NULL);
7334         pthread_detach( t );
7335 #endif
7336 #ifdef HAVE_LINUX_THREADS
7337         pthread_kill_other_threads_np();
7338 #endif
7339
7340 ; return 0; }
7341 EOF
7342 if { (eval echo configure:7343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7343   rm -rf conftest*
7344   ol_cv_pthread_lpthreads_lexc=yes
7345 else
7346   echo "configure: failed program was:" >&5
7347   cat conftest.$ac_ext >&5
7348   rm -rf conftest*
7349   ol_cv_pthread_lpthreads_lexc=no
7350 fi
7351 rm -f conftest*
7352
7353                 # restore the LIBS
7354                 LIBS="$ol_LIBS"
7355                 
7356 fi
7357
7358 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
7359
7360                 if test $ol_cv_pthread_lpthreads_lexc = yes ; then
7361                         ol_link_pthreads="-lpthreads -lexc"
7362                         ol_link_threads=posix
7363                 fi
7364         fi
7365
7366
7367                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
7368         if test "$ol_link_threads" = no ; then
7369                 # try -lpthreads
7370                 echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
7371 echo "configure:7372: checking for pthread link with -lpthreads" >&5
7372 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
7373   echo $ac_n "(cached) $ac_c" 1>&6
7374 else
7375   
7376                         # save the flags
7377                         ol_LIBS="$LIBS"
7378                         LIBS="-lpthreads $LIBS"
7379
7380                         cat > conftest.$ac_ext <<EOF
7381 #line 7382 "configure"
7382 #include "confdefs.h"
7383
7384 #include <pthread.h>
7385 #ifndef NULL
7386 #define NULL (void*)0
7387 #endif
7388
7389 int main() {
7390
7391         pthread_t t;
7392
7393 #if HAVE_PTHREADS_D4
7394         pthread_create(&t, pthread_attr_default, NULL, NULL);
7395         pthread_detach( &t );
7396 #else
7397         pthread_create(&t, NULL, NULL, NULL);
7398         pthread_detach( t );
7399 #endif
7400 #ifdef HAVE_LINUX_THREADS
7401         pthread_kill_other_threads_np();
7402 #endif
7403
7404 ; return 0; }
7405 EOF
7406 if { (eval echo configure:7407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7407   rm -rf conftest*
7408   ol_cv_pthread_lib_lpthreads=yes
7409 else
7410   echo "configure: failed program was:" >&5
7411   cat conftest.$ac_ext >&5
7412   rm -rf conftest*
7413   ol_cv_pthread_lib_lpthreads=no
7414 fi
7415 rm -f conftest*
7416
7417                 # restore the LIBS
7418                 LIBS="$ol_LIBS"
7419                 
7420 fi
7421
7422 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
7423
7424                 if test $ol_cv_pthread_lib_lpthreads = yes ; then
7425                         ol_link_pthreads="-lpthreads"
7426                         ol_link_threads=posix
7427                 fi
7428         fi
7429
7430
7431                 if test $ol_link_threads != no ; then
7432                         cat >> confdefs.h <<\EOF
7433 #define HAVE_PTHREADS 1
7434 EOF
7435
7436
7437                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
7438
7439                                                 save_CPPFLAGS="$CPPFLAGS"
7440                         save_LIBS="$LIBS"
7441                         LIBS="$LTHREAD_LIBS $LIBS"
7442
7443                                                                                                 for ac_func in sched_yield pthread_yield
7444 do
7445 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7446 echo "configure:7447: checking for $ac_func" >&5
7447 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
7448   echo $ac_n "(cached) $ac_c" 1>&6
7449 else
7450   cat > conftest.$ac_ext <<EOF
7451 #line 7452 "configure"
7452 #include "confdefs.h"
7453 /* System header to define __stub macros and hopefully few prototypes,
7454     which can conflict with char $ac_func(); below.  */
7455 #include <assert.h>
7456 /* Override any gcc2 internal prototype to avoid an error.  */
7457 /* We use char because int might match the return type of a gcc2
7458     builtin and then its argument prototype would still apply.  */
7459 char $ac_func();
7460 char (*f)();
7461
7462 int main() {
7463
7464 /* The GNU C library defines this for functions which it implements
7465     to always fail with ENOSYS.  Some functions are actually named
7466     something starting with __ and the normal name is an alias.  */
7467 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7468 choke me
7469 #else
7470 f = $ac_func;
7471 #endif
7472
7473 ; return 0; }
7474 EOF
7475 if { (eval echo configure:7476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7476   rm -rf conftest*
7477   eval "ac_cv_func_$ac_func=yes"
7478 else
7479   echo "configure: failed program was:" >&5
7480   cat conftest.$ac_ext >&5
7481   rm -rf conftest*
7482   eval "ac_cv_func_$ac_func=no"
7483 fi
7484 rm -f conftest*
7485 fi
7486
7487 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7488   echo "$ac_t""yes" 1>&6
7489     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7490   cat >> confdefs.h <<EOF
7491 #define $ac_tr_func 1
7492 EOF
7493  
7494 else
7495   echo "$ac_t""no" 1>&6
7496 fi
7497 done
7498
7499
7500                         if test $ac_cv_func_sched_yield = no -a \
7501                                 $ac_cv_func_pthread_yield = no ; then
7502                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
7503 echo "configure:7504: checking for sched_yield in -lrt" >&5
7504 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
7505 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
7506   echo $ac_n "(cached) $ac_c" 1>&6
7507 else
7508   ac_save_LIBS="$LIBS"
7509 LIBS="-lrt  $LIBS"
7510 cat > conftest.$ac_ext <<EOF
7511 #line 7512 "configure"
7512 #include "confdefs.h"
7513 /* Override any gcc2 internal prototype to avoid an error.  */
7514 /* We use char because int might match the return type of a gcc2
7515     builtin and then its argument prototype would still apply.  */
7516 char sched_yield();
7517
7518 int main() {
7519 sched_yield()
7520 ; return 0; }
7521 EOF
7522 if { (eval echo configure:7523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7523   rm -rf conftest*
7524   eval "ac_cv_lib_$ac_lib_var=yes"
7525 else
7526   echo "configure: failed program was:" >&5
7527   cat conftest.$ac_ext >&5
7528   rm -rf conftest*
7529   eval "ac_cv_lib_$ac_lib_var=no"
7530 fi
7531 rm -f conftest*
7532 LIBS="$ac_save_LIBS"
7533
7534 fi
7535 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7536   echo "$ac_t""yes" 1>&6
7537   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
7538                                         cat >> confdefs.h <<\EOF
7539 #define HAVE_SCHED_YIELD 1
7540 EOF
7541
7542                                         ac_cv_func_sched_yield=yes
7543 else
7544   echo "$ac_t""no" 1>&6
7545 ac_cv_func_sched_yield=no
7546 fi
7547
7548                         fi
7549                         if test $ac_cv_func_sched_yield = no -a \
7550                                 $ac_cv_func_pthread_yield = no ; then
7551                                                                                                 for ac_func in thr_yield
7552 do
7553 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7554 echo "configure:7555: checking for $ac_func" >&5
7555 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
7556   echo $ac_n "(cached) $ac_c" 1>&6
7557 else
7558   cat > conftest.$ac_ext <<EOF
7559 #line 7560 "configure"
7560 #include "confdefs.h"
7561 /* System header to define __stub macros and hopefully few prototypes,
7562     which can conflict with char $ac_func(); below.  */
7563 #include <assert.h>
7564 /* Override any gcc2 internal prototype to avoid an error.  */
7565 /* We use char because int might match the return type of a gcc2
7566     builtin and then its argument prototype would still apply.  */
7567 char $ac_func();
7568 char (*f)();
7569
7570 int main() {
7571
7572 /* The GNU C library defines this for functions which it implements
7573     to always fail with ENOSYS.  Some functions are actually named
7574     something starting with __ and the normal name is an alias.  */
7575 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7576 choke me
7577 #else
7578 f = $ac_func;
7579 #endif
7580
7581 ; return 0; }
7582 EOF
7583 if { (eval echo configure:7584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7584   rm -rf conftest*
7585   eval "ac_cv_func_$ac_func=yes"
7586 else
7587   echo "configure: failed program was:" >&5
7588   cat conftest.$ac_ext >&5
7589   rm -rf conftest*
7590   eval "ac_cv_func_$ac_func=no"
7591 fi
7592 rm -f conftest*
7593 fi
7594
7595 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7596   echo "$ac_t""yes" 1>&6
7597     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7598   cat >> confdefs.h <<EOF
7599 #define $ac_tr_func 1
7600 EOF
7601  
7602 else
7603   echo "$ac_t""no" 1>&6
7604 fi
7605 done
7606
7607                         fi
7608                         if test $ac_cv_func_sched_yield = no -a \
7609                                 $ac_cv_func_pthread_yield = no -a \
7610                                 "$ac_cv_func_thr_yield" = no ; then
7611                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
7612                         fi
7613
7614                                                 for ac_func in pthread_kill
7615 do
7616 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7617 echo "configure:7618: checking for $ac_func" >&5
7618 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
7619   echo $ac_n "(cached) $ac_c" 1>&6
7620 else
7621   cat > conftest.$ac_ext <<EOF
7622 #line 7623 "configure"
7623 #include "confdefs.h"
7624 /* System header to define __stub macros and hopefully few prototypes,
7625     which can conflict with char $ac_func(); below.  */
7626 #include <assert.h>
7627 /* Override any gcc2 internal prototype to avoid an error.  */
7628 /* We use char because int might match the return type of a gcc2
7629     builtin and then its argument prototype would still apply.  */
7630 char $ac_func();
7631 char (*f)();
7632
7633 int main() {
7634
7635 /* The GNU C library defines this for functions which it implements
7636     to always fail with ENOSYS.  Some functions are actually named
7637     something starting with __ and the normal name is an alias.  */
7638 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7639 choke me
7640 #else
7641 f = $ac_func;
7642 #endif
7643
7644 ; return 0; }
7645 EOF
7646 if { (eval echo configure:7647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7647   rm -rf conftest*
7648   eval "ac_cv_func_$ac_func=yes"
7649 else
7650   echo "configure: failed program was:" >&5
7651   cat conftest.$ac_ext >&5
7652   rm -rf conftest*
7653   eval "ac_cv_func_$ac_func=no"
7654 fi
7655 rm -f conftest*
7656 fi
7657
7658 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7659   echo "$ac_t""yes" 1>&6
7660     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7661   cat >> confdefs.h <<EOF
7662 #define $ac_tr_func 1
7663 EOF
7664  
7665 else
7666   echo "$ac_t""no" 1>&6
7667 fi
7668 done
7669
7670
7671                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
7672 echo "configure:7673: checking for pthread_detach with <pthread.h>" >&5
7673 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
7674   echo $ac_n "(cached) $ac_c" 1>&6
7675 else
7676   
7677                                                                 cat > conftest.$ac_ext <<EOF
7678 #line 7679 "configure"
7679 #include "confdefs.h"
7680
7681 #include <pthread.h>
7682 #ifndef NULL
7683 #define NULL (void*)0
7684 #endif
7685
7686 int main() {
7687 pthread_detach(NULL);
7688 ; return 0; }
7689 EOF
7690 if { (eval echo configure:7691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7691   rm -rf conftest*
7692   ol_cv_func_pthread_detach=yes
7693 else
7694   echo "configure: failed program was:" >&5
7695   cat conftest.$ac_ext >&5
7696   rm -rf conftest*
7697   ol_cv_func_pthread_detach=no
7698 fi
7699 rm -f conftest*
7700                         
7701 fi
7702
7703 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
7704
7705                         if test $ol_cv_func_pthread_detach = no ; then
7706                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
7707                         fi
7708
7709                         cat >> confdefs.h <<\EOF
7710 #define HAVE_PTHREAD_DETACH 1
7711 EOF
7712
7713
7714                                                 for ac_func in \
7715                                 pthread_setconcurrency \
7716                                 pthread_getconcurrency \
7717                                 thr_setconcurrency \
7718                                 thr_getconcurrency \
7719                         
7720 do
7721 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7722 echo "configure:7723: checking for $ac_func" >&5
7723 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
7724   echo $ac_n "(cached) $ac_c" 1>&6
7725 else
7726   cat > conftest.$ac_ext <<EOF
7727 #line 7728 "configure"
7728 #include "confdefs.h"
7729 /* System header to define __stub macros and hopefully few prototypes,
7730     which can conflict with char $ac_func(); below.  */
7731 #include <assert.h>
7732 /* Override any gcc2 internal prototype to avoid an error.  */
7733 /* We use char because int might match the return type of a gcc2
7734     builtin and then its argument prototype would still apply.  */
7735 char $ac_func();
7736 char (*f)();
7737
7738 int main() {
7739
7740 /* The GNU C library defines this for functions which it implements
7741     to always fail with ENOSYS.  Some functions are actually named
7742     something starting with __ and the normal name is an alias.  */
7743 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7744 choke me
7745 #else
7746 f = $ac_func;
7747 #endif
7748
7749 ; return 0; }
7750 EOF
7751 if { (eval echo configure:7752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7752   rm -rf conftest*
7753   eval "ac_cv_func_$ac_func=yes"
7754 else
7755   echo "configure: failed program was:" >&5
7756   cat conftest.$ac_ext >&5
7757   rm -rf conftest*
7758   eval "ac_cv_func_$ac_func=no"
7759 fi
7760 rm -f conftest*
7761 fi
7762
7763 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7764   echo "$ac_t""yes" 1>&6
7765     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7766   cat >> confdefs.h <<EOF
7767 #define $ac_tr_func 1
7768 EOF
7769  
7770 else
7771   echo "$ac_t""no" 1>&6
7772 fi
7773 done
7774
7775
7776                         
7777         echo $ac_n "checking for pthread_kill_other_threads_np""... $ac_c" 1>&6
7778 echo "configure:7779: checking for pthread_kill_other_threads_np" >&5
7779 if eval "test \"\${ac_cv_func_pthread_kill_other_threads_np+set}\" = set"; then
7780   echo $ac_n "(cached) $ac_c" 1>&6
7781 else
7782   cat > conftest.$ac_ext <<EOF
7783 #line 7784 "configure"
7784 #include "confdefs.h"
7785 /* System header to define __stub macros and hopefully few prototypes,
7786     which can conflict with char pthread_kill_other_threads_np(); below.  */
7787 #include <assert.h>
7788 /* Override any gcc2 internal prototype to avoid an error.  */
7789 /* We use char because int might match the return type of a gcc2
7790     builtin and then its argument prototype would still apply.  */
7791 char pthread_kill_other_threads_np();
7792 char (*f)();
7793
7794 int main() {
7795
7796 /* The GNU C library defines this for functions which it implements
7797     to always fail with ENOSYS.  Some functions are actually named
7798     something starting with __ and the normal name is an alias.  */
7799 #if defined (__stub_pthread_kill_other_threads_np) || defined (__stub___pthread_kill_other_threads_np)
7800 choke me
7801 #else
7802 f = pthread_kill_other_threads_np;
7803 #endif
7804
7805 ; return 0; }
7806 EOF
7807 if { (eval echo configure:7808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7808   rm -rf conftest*
7809   eval "ac_cv_func_pthread_kill_other_threads_np=yes"
7810 else
7811   echo "configure: failed program was:" >&5
7812   cat conftest.$ac_ext >&5
7813   rm -rf conftest*
7814   eval "ac_cv_func_pthread_kill_other_threads_np=no"
7815 fi
7816 rm -f conftest*
7817 fi
7818
7819 if eval "test \"`echo '$ac_cv_func_'pthread_kill_other_threads_np`\" = yes"; then
7820   echo "$ac_t""yes" 1>&6
7821   :
7822 else
7823   echo "$ac_t""no" 1>&6
7824 fi
7825
7826         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
7827 echo "configure:7828: checking for LinuxThreads implementation" >&5
7828 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
7829   echo $ac_n "(cached) $ac_c" 1>&6
7830 else
7831   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
7832 fi
7833
7834 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
7835
7836                         
7837         
7838         
7839         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
7840 echo "configure:7841: checking for LinuxThreads consistency" >&5
7841 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
7842   echo $ac_n "(cached) $ac_c" 1>&6
7843 else
7844   
7845                 if test $ol_cv_header_linux_threads = yes -a \
7846                         $ol_cv_sys_linux_threads = yes; then
7847                         ol_cv_linux_threads=yes
7848                 elif test $ol_cv_header_linux_threads = no -a \
7849                         $ol_cv_sys_linux_threads = no; then
7850                         ol_cv_linux_threads=no
7851                 else
7852                         ol_cv_linux_threads=error
7853                 fi
7854         
7855 fi
7856
7857 echo "$ac_t""$ol_cv_linux_threads" 1>&6
7858
7859
7860                         if test $ol_cv_linux_threads = error; then
7861                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
7862                         fi
7863
7864                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
7865 echo "configure:7866: checking if pthread_create() works" >&5
7866 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
7867   echo $ac_n "(cached) $ac_c" 1>&6
7868 else
7869   
7870                         if test "$cross_compiling" = yes; then
7871                                 ol_cv_pthread_create_works=yes
7872 else
7873   cat > conftest.$ac_ext <<EOF
7874 #line 7875 "configure"
7875 #include "confdefs.h"
7876
7877 #include <pthread.h>
7878 #ifndef NULL
7879 #define NULL (void*)0
7880 #endif
7881
7882 static void *task(p)
7883         void *p;
7884 {
7885         return (void *) (p == NULL);
7886 }
7887
7888 int main(argc, argv)
7889         int argc;
7890         char **argv;
7891 {
7892         pthread_t t;
7893 #if HAVE_PTHREADS_D4
7894         exit(pthread_create(&t, pthread_attr_default, task, NULL));
7895 #else
7896         exit(pthread_create(&t, NULL, task, NULL));
7897 #endif
7898 }
7899
7900 EOF
7901 if { (eval echo configure:7902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7902 then
7903   ol_cv_pthread_create_works=yes
7904 else
7905   echo "configure: failed program was:" >&5
7906   cat conftest.$ac_ext >&5
7907   rm -fr conftest*
7908   ol_cv_pthread_create_works=no
7909 fi
7910 rm -fr conftest*
7911 fi
7912
7913 fi
7914
7915 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
7916
7917                         if test $ol_cv_pthread_create_works = no ; then
7918                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
7919                         fi
7920
7921                                                 if test $ol_with_yielding_select = auto ; then
7922                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
7923 echo "configure:7924: checking if select yields when using pthreads" >&5
7924 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
7925   echo $ac_n "(cached) $ac_c" 1>&6
7926 else
7927   
7928                                 if test "$cross_compiling" = yes; then
7929   ol_cv_pthread_select_yields=cross
7930 else
7931   cat > conftest.$ac_ext <<EOF
7932 #line 7933 "configure"
7933 #include "confdefs.h"
7934
7935 #include <sys/types.h>
7936 #include <sys/time.h>
7937 #include <unistd.h>
7938 #include <pthread.h>
7939 #ifndef NULL
7940 #define NULL (void*) 0
7941 #endif
7942
7943 static int fildes[2];
7944
7945 static void *task(p)
7946         void *p;
7947 {
7948         int i;
7949         struct timeval tv;
7950
7951         fd_set rfds;
7952
7953         tv.tv_sec=10;
7954         tv.tv_usec=0;
7955
7956         FD_ZERO(&rfds);
7957         FD_SET(fildes[0], &rfds);
7958
7959         /* we're not interested in any fds */
7960         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
7961
7962         if(i < 0) {
7963                 perror("select");
7964                 exit(10);
7965         }
7966
7967         exit(0); /* if we exit here, the select blocked the whole process */
7968 }
7969
7970 int main(argc, argv)
7971         int argc;
7972         char **argv;
7973 {
7974         pthread_t t;
7975
7976         /* create a pipe to select */
7977         if(pipe(&fildes[0])) {
7978                 perror("select");
7979                 exit(1);
7980         }
7981
7982 #ifdef HAVE_PTHREAD_SETCONCURRENCY
7983         (void) pthread_setconcurrency(2);
7984 #else
7985 #ifdef HAVE_THR_SETCONCURRENCY
7986         /* Set Solaris LWP concurrency to 2 */
7987         thr_setconcurrency(2);
7988 #endif
7989 #endif
7990
7991 #if HAVE_PTHREADS_D4
7992         pthread_create(&t, pthread_attr_default, task, NULL);
7993 #else
7994         pthread_create(&t, NULL, task, NULL);
7995 #endif
7996
7997 #if HAVE_SCHED_YIELD
7998         sched_yield();  /* make sure task runs first */
7999 #else
8000 #ifdef HAVE_PTHREAD_YIELD
8001         pthread_yield();        /* make sure task runs first */
8002 #endif
8003 #endif
8004
8005         exit(2);
8006 }
8007 EOF
8008 if { (eval echo configure:8009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8009 then
8010   ol_cv_pthread_select_yields=no
8011 else
8012   echo "configure: failed program was:" >&5
8013   cat conftest.$ac_ext >&5
8014   rm -fr conftest*
8015   ol_cv_pthread_select_yields=yes
8016 fi
8017 rm -fr conftest*
8018 fi
8019
8020 fi
8021
8022 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
8023
8024                                 if test $ol_cv_pthread_select_yields = cross ; then
8025                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
8026                                 fi
8027
8028                                 if test $ol_cv_pthread_select_yields = yes ; then
8029                                         ol_with_yielding_select=yes
8030                                 fi
8031                         fi
8032
8033                                                 CPPFLAGS="$save_CPPFLAGS"
8034                         LIBS="$save_LIBS"
8035                 else
8036                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
8037                 fi
8038         fi
8039
8040         if test $ol_with_threads = posix ; then
8041                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
8042         fi
8043 fi
8044
8045 if test $ol_with_threads = auto -o $ol_with_threads = yes \
8046         -o $ol_with_threads = mach ; then
8047
8048                 for ac_hdr in mach/cthreads.h
8049 do
8050 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8051 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8052 echo "configure:8053: checking for $ac_hdr" >&5
8053 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8054   echo $ac_n "(cached) $ac_c" 1>&6
8055 else
8056   cat > conftest.$ac_ext <<EOF
8057 #line 8058 "configure"
8058 #include "confdefs.h"
8059 #include <$ac_hdr>
8060 EOF
8061 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8062 { (eval echo configure:8063: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8063 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8064 if test -z "$ac_err"; then
8065   rm -rf conftest*
8066   eval "ac_cv_header_$ac_safe=yes"
8067 else
8068   echo "$ac_err" >&5
8069   echo "configure: failed program was:" >&5
8070   cat conftest.$ac_ext >&5
8071   rm -rf conftest*
8072   eval "ac_cv_header_$ac_safe=no"
8073 fi
8074 rm -f conftest*
8075 fi
8076 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8077   echo "$ac_t""yes" 1>&6
8078     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8079   cat >> confdefs.h <<EOF
8080 #define $ac_tr_hdr 1
8081 EOF
8082  
8083 else
8084   echo "$ac_t""no" 1>&6
8085 fi
8086 done
8087
8088         if test $ac_cv_header_mach_cthreads_h = yes ; then
8089                 ol_with_threads=found
8090
8091                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
8092 echo "configure:8093: checking for cthread_fork" >&5
8093 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
8094   echo $ac_n "(cached) $ac_c" 1>&6
8095 else
8096   cat > conftest.$ac_ext <<EOF
8097 #line 8098 "configure"
8098 #include "confdefs.h"
8099 /* System header to define __stub macros and hopefully few prototypes,
8100     which can conflict with char cthread_fork(); below.  */
8101 #include <assert.h>
8102 /* Override any gcc2 internal prototype to avoid an error.  */
8103 /* We use char because int might match the return type of a gcc2
8104     builtin and then its argument prototype would still apply.  */
8105 char cthread_fork();
8106 char (*f)();
8107
8108 int main() {
8109
8110 /* The GNU C library defines this for functions which it implements
8111     to always fail with ENOSYS.  Some functions are actually named
8112     something starting with __ and the normal name is an alias.  */
8113 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
8114 choke me
8115 #else
8116 f = cthread_fork;
8117 #endif
8118
8119 ; return 0; }
8120 EOF
8121 if { (eval echo configure:8122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8122   rm -rf conftest*
8123   eval "ac_cv_func_cthread_fork=yes"
8124 else
8125   echo "configure: failed program was:" >&5
8126   cat conftest.$ac_ext >&5
8127   rm -rf conftest*
8128   eval "ac_cv_func_cthread_fork=no"
8129 fi
8130 rm -f conftest*
8131 fi
8132
8133 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
8134   echo "$ac_t""yes" 1>&6
8135   ol_link_threads=yes
8136 else
8137   echo "$ac_t""no" 1>&6
8138 fi
8139
8140
8141                 if test $ol_link_threads = no ; then
8142                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
8143 echo "configure:8144: checking for cthread_fork with -all_load" >&5
8144 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
8145   echo $ac_n "(cached) $ac_c" 1>&6
8146 else
8147   
8148                                                                 save_LIBS="$LIBS"
8149                                 LIBS="-all_load $LIBS"
8150                                 cat > conftest.$ac_ext <<EOF
8151 #line 8152 "configure"
8152 #include "confdefs.h"
8153 #include <mach/cthreads.h>
8154 int main() {
8155
8156                                         cthread_fork((void *)0, (void *)0);
8157                                         
8158 ; return 0; }
8159 EOF
8160 if { (eval echo configure:8161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8161   rm -rf conftest*
8162   ol_cv_cthread_all_load=yes
8163 else
8164   echo "configure: failed program was:" >&5
8165   cat conftest.$ac_ext >&5
8166   rm -rf conftest*
8167   ol_cv_cthread_all_load=no
8168 fi
8169 rm -f conftest*
8170                                                                 LIBS="$save_LIBS"
8171                         
8172 fi
8173
8174 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
8175
8176                         if test $ol_cv_cthread_all_load = yes ; then
8177                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
8178                                 ol_link_threads=mach
8179                         fi
8180                 fi
8181
8182                 if test $ol_link_threads != no ; then
8183                         : check for cthread specific functionality here
8184                         cat >> confdefs.h <<\EOF
8185 #define HAVE_MACH_CTHREADS 1
8186 EOF
8187
8188                 else
8189                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
8190                 fi
8191         fi
8192
8193         if test $ol_with_threads = mach ; then
8194                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
8195         fi
8196 fi
8197
8198 if test $ol_with_threads = auto -o $ol_with_threads = yes \
8199         -o $ol_with_threads = lwp ; then
8200
8201                 for ac_hdr in thread.h synch.h
8202 do
8203 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8204 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8205 echo "configure:8206: checking for $ac_hdr" >&5
8206 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8207   echo $ac_n "(cached) $ac_c" 1>&6
8208 else
8209   cat > conftest.$ac_ext <<EOF
8210 #line 8211 "configure"
8211 #include "confdefs.h"
8212 #include <$ac_hdr>
8213 EOF
8214 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8215 { (eval echo configure:8216: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8216 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8217 if test -z "$ac_err"; then
8218   rm -rf conftest*
8219   eval "ac_cv_header_$ac_safe=yes"
8220 else
8221   echo "$ac_err" >&5
8222   echo "configure: failed program was:" >&5
8223   cat conftest.$ac_ext >&5
8224   rm -rf conftest*
8225   eval "ac_cv_header_$ac_safe=no"
8226 fi
8227 rm -f conftest*
8228 fi
8229 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8230   echo "$ac_t""yes" 1>&6
8231     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8232   cat >> confdefs.h <<EOF
8233 #define $ac_tr_hdr 1
8234 EOF
8235  
8236 else
8237   echo "$ac_t""no" 1>&6
8238 fi
8239 done
8240
8241         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
8242                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
8243 echo "configure:8244: checking for thr_create in -lthread" >&5
8244 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
8245 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8246   echo $ac_n "(cached) $ac_c" 1>&6
8247 else
8248   ac_save_LIBS="$LIBS"
8249 LIBS="-lthread  $LIBS"
8250 cat > conftest.$ac_ext <<EOF
8251 #line 8252 "configure"
8252 #include "confdefs.h"
8253 /* Override any gcc2 internal prototype to avoid an error.  */
8254 /* We use char because int might match the return type of a gcc2
8255     builtin and then its argument prototype would still apply.  */
8256 char thr_create();
8257
8258 int main() {
8259 thr_create()
8260 ; return 0; }
8261 EOF
8262 if { (eval echo configure:8263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8263   rm -rf conftest*
8264   eval "ac_cv_lib_$ac_lib_var=yes"
8265 else
8266   echo "configure: failed program was:" >&5
8267   cat conftest.$ac_ext >&5
8268   rm -rf conftest*
8269   eval "ac_cv_lib_$ac_lib_var=no"
8270 fi
8271 rm -f conftest*
8272 LIBS="$ac_save_LIBS"
8273
8274 fi
8275 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8276   echo "$ac_t""yes" 1>&6
8277   have_thr=yes
8278 else
8279   echo "$ac_t""no" 1>&6
8280 have_thr=no
8281 fi
8282
8283
8284                 if test $have_thr = yes ; then
8285                         cat >> confdefs.h <<\EOF
8286 #define HAVE_THR 1
8287 EOF
8288
8289                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
8290                         ol_link_threads=thr
8291
8292                         if test $ol_with_yielding_select = auto ; then
8293                                 ol_with_yielding_select=yes
8294                         fi
8295
8296                                                 for ac_func in \
8297                                 thr_setconcurrency \
8298                                 thr_getconcurrency \
8299                         
8300 do
8301 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8302 echo "configure:8303: checking for $ac_func" >&5
8303 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
8304   echo $ac_n "(cached) $ac_c" 1>&6
8305 else
8306   cat > conftest.$ac_ext <<EOF
8307 #line 8308 "configure"
8308 #include "confdefs.h"
8309 /* System header to define __stub macros and hopefully few prototypes,
8310     which can conflict with char $ac_func(); below.  */
8311 #include <assert.h>
8312 /* Override any gcc2 internal prototype to avoid an error.  */
8313 /* We use char because int might match the return type of a gcc2
8314     builtin and then its argument prototype would still apply.  */
8315 char $ac_func();
8316 char (*f)();
8317
8318 int main() {
8319
8320 /* The GNU C library defines this for functions which it implements
8321     to always fail with ENOSYS.  Some functions are actually named
8322     something starting with __ and the normal name is an alias.  */
8323 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8324 choke me
8325 #else
8326 f = $ac_func;
8327 #endif
8328
8329 ; return 0; }
8330 EOF
8331 if { (eval echo configure:8332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8332   rm -rf conftest*
8333   eval "ac_cv_func_$ac_func=yes"
8334 else
8335   echo "configure: failed program was:" >&5
8336   cat conftest.$ac_ext >&5
8337   rm -rf conftest*
8338   eval "ac_cv_func_$ac_func=no"
8339 fi
8340 rm -f conftest*
8341 fi
8342
8343 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8344   echo "$ac_t""yes" 1>&6
8345     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8346   cat >> confdefs.h <<EOF
8347 #define $ac_tr_func 1
8348 EOF
8349  
8350 else
8351   echo "$ac_t""no" 1>&6
8352 fi
8353 done
8354
8355                 fi
8356         fi
8357
8358                 for ac_hdr in lwp/lwp.h
8359 do
8360 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8361 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8362 echo "configure:8363: checking for $ac_hdr" >&5
8363 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8364   echo $ac_n "(cached) $ac_c" 1>&6
8365 else
8366   cat > conftest.$ac_ext <<EOF
8367 #line 8368 "configure"
8368 #include "confdefs.h"
8369 #include <$ac_hdr>
8370 EOF
8371 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8372 { (eval echo configure:8373: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8373 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8374 if test -z "$ac_err"; then
8375   rm -rf conftest*
8376   eval "ac_cv_header_$ac_safe=yes"
8377 else
8378   echo "$ac_err" >&5
8379   echo "configure: failed program was:" >&5
8380   cat conftest.$ac_ext >&5
8381   rm -rf conftest*
8382   eval "ac_cv_header_$ac_safe=no"
8383 fi
8384 rm -f conftest*
8385 fi
8386 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8387   echo "$ac_t""yes" 1>&6
8388     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8389   cat >> confdefs.h <<EOF
8390 #define $ac_tr_hdr 1
8391 EOF
8392  
8393 else
8394   echo "$ac_t""no" 1>&6
8395 fi
8396 done
8397
8398         if test $ac_cv_header_lwp_lwp_h = yes ; then
8399                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
8400 echo "configure:8401: checking for lwp_create in -llwp" >&5
8401 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
8402 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8403   echo $ac_n "(cached) $ac_c" 1>&6
8404 else
8405   ac_save_LIBS="$LIBS"
8406 LIBS="-llwp  $LIBS"
8407 cat > conftest.$ac_ext <<EOF
8408 #line 8409 "configure"
8409 #include "confdefs.h"
8410 /* Override any gcc2 internal prototype to avoid an error.  */
8411 /* We use char because int might match the return type of a gcc2
8412     builtin and then its argument prototype would still apply.  */
8413 char lwp_create();
8414
8415 int main() {
8416 lwp_create()
8417 ; return 0; }
8418 EOF
8419 if { (eval echo configure:8420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8420   rm -rf conftest*
8421   eval "ac_cv_lib_$ac_lib_var=yes"
8422 else
8423   echo "configure: failed program was:" >&5
8424   cat conftest.$ac_ext >&5
8425   rm -rf conftest*
8426   eval "ac_cv_lib_$ac_lib_var=no"
8427 fi
8428 rm -f conftest*
8429 LIBS="$ac_save_LIBS"
8430
8431 fi
8432 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8433   echo "$ac_t""yes" 1>&6
8434   have_lwp=yes
8435 else
8436   echo "$ac_t""no" 1>&6
8437 have_lwp=no
8438 fi
8439
8440
8441                 if test $have_lwp = yes ; then
8442                         cat >> confdefs.h <<\EOF
8443 #define HAVE_LWP 1
8444 EOF
8445
8446                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
8447                         ol_link_threads=lwp
8448
8449                         if test $ol_with_yielding_select = auto ; then
8450                                 ol_with_yielding_select=no
8451                         fi
8452                 fi
8453         fi
8454 fi
8455
8456 if test $ol_with_yielding_select = yes ; then
8457         cat >> confdefs.h <<\EOF
8458 #define HAVE_YIELDING_SELECT 1
8459 EOF
8460
8461 fi
8462
8463 if test $ol_with_threads = manual ; then
8464                 ol_link_threads=yes
8465
8466         echo "configure: warning: thread defines and link options must be set manually" 1>&2
8467
8468         for ac_hdr in pthread.h sched.h
8469 do
8470 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8471 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8472 echo "configure:8473: checking for $ac_hdr" >&5
8473 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8474   echo $ac_n "(cached) $ac_c" 1>&6
8475 else
8476   cat > conftest.$ac_ext <<EOF
8477 #line 8478 "configure"
8478 #include "confdefs.h"
8479 #include <$ac_hdr>
8480 EOF
8481 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8482 { (eval echo configure:8483: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8483 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8484 if test -z "$ac_err"; then
8485   rm -rf conftest*
8486   eval "ac_cv_header_$ac_safe=yes"
8487 else
8488   echo "$ac_err" >&5
8489   echo "configure: failed program was:" >&5
8490   cat conftest.$ac_ext >&5
8491   rm -rf conftest*
8492   eval "ac_cv_header_$ac_safe=no"
8493 fi
8494 rm -f conftest*
8495 fi
8496 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8497   echo "$ac_t""yes" 1>&6
8498     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8499   cat >> confdefs.h <<EOF
8500 #define $ac_tr_hdr 1
8501 EOF
8502  
8503 else
8504   echo "$ac_t""no" 1>&6
8505 fi
8506 done
8507
8508         for ac_func in sched_yield pthread_yield
8509 do
8510 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8511 echo "configure:8512: checking for $ac_func" >&5
8512 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
8513   echo $ac_n "(cached) $ac_c" 1>&6
8514 else
8515   cat > conftest.$ac_ext <<EOF
8516 #line 8517 "configure"
8517 #include "confdefs.h"
8518 /* System header to define __stub macros and hopefully few prototypes,
8519     which can conflict with char $ac_func(); below.  */
8520 #include <assert.h>
8521 /* Override any gcc2 internal prototype to avoid an error.  */
8522 /* We use char because int might match the return type of a gcc2
8523     builtin and then its argument prototype would still apply.  */
8524 char $ac_func();
8525 char (*f)();
8526
8527 int main() {
8528
8529 /* The GNU C library defines this for functions which it implements
8530     to always fail with ENOSYS.  Some functions are actually named
8531     something starting with __ and the normal name is an alias.  */
8532 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8533 choke me
8534 #else
8535 f = $ac_func;
8536 #endif
8537
8538 ; return 0; }
8539 EOF
8540 if { (eval echo configure:8541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8541   rm -rf conftest*
8542   eval "ac_cv_func_$ac_func=yes"
8543 else
8544   echo "configure: failed program was:" >&5
8545   cat conftest.$ac_ext >&5
8546   rm -rf conftest*
8547   eval "ac_cv_func_$ac_func=no"
8548 fi
8549 rm -f conftest*
8550 fi
8551
8552 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8553   echo "$ac_t""yes" 1>&6
8554     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8555   cat >> confdefs.h <<EOF
8556 #define $ac_tr_func 1
8557 EOF
8558  
8559 else
8560   echo "$ac_t""no" 1>&6
8561 fi
8562 done
8563
8564         
8565         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
8566 echo "configure:8567: checking for LinuxThreads pthread.h" >&5
8567 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
8568   echo $ac_n "(cached) $ac_c" 1>&6
8569 else
8570   cat > conftest.$ac_ext <<EOF
8571 #line 8572 "configure"
8572 #include "confdefs.h"
8573 #include <pthread.h>
8574 EOF
8575 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8576   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
8577   rm -rf conftest*
8578   ol_cv_header_linux_threads=yes
8579 else
8580   rm -rf conftest*
8581   ol_cv_header_linux_threads=no
8582 fi
8583 rm -f conftest*
8584
8585                 
8586 fi
8587
8588 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
8589         if test $ol_cv_header_linux_threads = yes; then
8590                 cat >> confdefs.h <<\EOF
8591 #define HAVE_LINUX_THREADS 1
8592 EOF
8593
8594         fi
8595
8596
8597         for ac_hdr in mach/cthreads.h
8598 do
8599 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8600 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8601 echo "configure:8602: checking for $ac_hdr" >&5
8602 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8603   echo $ac_n "(cached) $ac_c" 1>&6
8604 else
8605   cat > conftest.$ac_ext <<EOF
8606 #line 8607 "configure"
8607 #include "confdefs.h"
8608 #include <$ac_hdr>
8609 EOF
8610 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8611 { (eval echo configure:8612: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8612 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8613 if test -z "$ac_err"; then
8614   rm -rf conftest*
8615   eval "ac_cv_header_$ac_safe=yes"
8616 else
8617   echo "$ac_err" >&5
8618   echo "configure: failed program was:" >&5
8619   cat conftest.$ac_ext >&5
8620   rm -rf conftest*
8621   eval "ac_cv_header_$ac_safe=no"
8622 fi
8623 rm -f conftest*
8624 fi
8625 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8626   echo "$ac_t""yes" 1>&6
8627     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8628   cat >> confdefs.h <<EOF
8629 #define $ac_tr_hdr 1
8630 EOF
8631  
8632 else
8633   echo "$ac_t""no" 1>&6
8634 fi
8635 done
8636
8637         for ac_hdr in lwp/lwp.h
8638 do
8639 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8640 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8641 echo "configure:8642: checking for $ac_hdr" >&5
8642 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8643   echo $ac_n "(cached) $ac_c" 1>&6
8644 else
8645   cat > conftest.$ac_ext <<EOF
8646 #line 8647 "configure"
8647 #include "confdefs.h"
8648 #include <$ac_hdr>
8649 EOF
8650 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8651 { (eval echo configure:8652: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8652 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8653 if test -z "$ac_err"; then
8654   rm -rf conftest*
8655   eval "ac_cv_header_$ac_safe=yes"
8656 else
8657   echo "$ac_err" >&5
8658   echo "configure: failed program was:" >&5
8659   cat conftest.$ac_ext >&5
8660   rm -rf conftest*
8661   eval "ac_cv_header_$ac_safe=no"
8662 fi
8663 rm -f conftest*
8664 fi
8665 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8666   echo "$ac_t""yes" 1>&6
8667     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8668   cat >> confdefs.h <<EOF
8669 #define $ac_tr_hdr 1
8670 EOF
8671  
8672 else
8673   echo "$ac_t""no" 1>&6
8674 fi
8675 done
8676
8677         for ac_hdr in thread.h synch.h
8678 do
8679 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8680 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8681 echo "configure:8682: checking for $ac_hdr" >&5
8682 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8683   echo $ac_n "(cached) $ac_c" 1>&6
8684 else
8685   cat > conftest.$ac_ext <<EOF
8686 #line 8687 "configure"
8687 #include "confdefs.h"
8688 #include <$ac_hdr>
8689 EOF
8690 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8691 { (eval echo configure:8692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8692 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8693 if test -z "$ac_err"; then
8694   rm -rf conftest*
8695   eval "ac_cv_header_$ac_safe=yes"
8696 else
8697   echo "$ac_err" >&5
8698   echo "configure: failed program was:" >&5
8699   cat conftest.$ac_ext >&5
8700   rm -rf conftest*
8701   eval "ac_cv_header_$ac_safe=no"
8702 fi
8703 rm -f conftest*
8704 fi
8705 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8706   echo "$ac_t""yes" 1>&6
8707     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8708   cat >> confdefs.h <<EOF
8709 #define $ac_tr_hdr 1
8710 EOF
8711  
8712 else
8713   echo "$ac_t""no" 1>&6
8714 fi
8715 done
8716
8717 fi
8718
8719 if test $ol_link_threads != no ; then  
8720                         cat >> confdefs.h <<\EOF
8721 #define REENTRANT 1
8722 EOF
8723
8724         cat >> confdefs.h <<\EOF
8725 #define _REENTRANT 1
8726 EOF
8727
8728         cat >> confdefs.h <<\EOF
8729 #define THREAD_SAFE 1
8730 EOF
8731
8732         cat >> confdefs.h <<\EOF
8733 #define _THREAD_SAFE 1
8734 EOF
8735
8736         cat >> confdefs.h <<\EOF
8737 #define THREADSAFE 1
8738 EOF
8739
8740         cat >> confdefs.h <<\EOF
8741 #define _THREADSAFE 1
8742 EOF
8743
8744         cat >> confdefs.h <<\EOF
8745 #define _SGI_MP_SOURCE 1
8746 EOF
8747
8748
8749                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
8750 echo "configure:8751: checking for thread specific errno" >&5
8751 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
8752   echo $ac_n "(cached) $ac_c" 1>&6
8753 else
8754   
8755                 cat > conftest.$ac_ext <<EOF
8756 #line 8757 "configure"
8757 #include "confdefs.h"
8758 #include <errno.h>
8759 int main() {
8760 errno = 0;
8761 ; return 0; }
8762 EOF
8763 if { (eval echo configure:8764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8764   rm -rf conftest*
8765   ol_cv_errno_thread_specific=yes
8766 else
8767   echo "configure: failed program was:" >&5
8768   cat conftest.$ac_ext >&5
8769   rm -rf conftest*
8770   ol_cv_errno_thread_specific=no
8771 fi
8772 rm -f conftest*
8773         
8774 fi
8775
8776 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
8777
8778                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
8779 echo "configure:8780: checking for thread specific h_errno" >&5
8780 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
8781   echo $ac_n "(cached) $ac_c" 1>&6
8782 else
8783   
8784                 cat > conftest.$ac_ext <<EOF
8785 #line 8786 "configure"
8786 #include "confdefs.h"
8787 #include <netdb.h>
8788 int main() {
8789 h_errno = 0;
8790 ; return 0; }
8791 EOF
8792 if { (eval echo configure:8793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8793   rm -rf conftest*
8794   ol_cv_h_errno_thread_specific=yes
8795 else
8796   echo "configure: failed program was:" >&5
8797   cat conftest.$ac_ext >&5
8798   rm -rf conftest*
8799   ol_cv_h_errno_thread_specific=no
8800 fi
8801 rm -f conftest*
8802         
8803 fi
8804
8805 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
8806
8807         if test $ol_cv_errno_thread_specific != yes \
8808                 -o $ol_cv_h_errno_thread_specific != yes ; then
8809                 LIBS="$LTHREAD_LIBS $LIBS"
8810                 LTHREAD_LIBS=""
8811         fi
8812
8813 fi  
8814
8815 if test $ol_link_threads = no ; then
8816         if test $ol_with_threads = yes ; then
8817                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
8818         fi
8819
8820         if test $ol_with_threads = auto ; then
8821                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
8822                 ol_with_threads=no
8823         fi
8824
8825         cat >> confdefs.h <<\EOF
8826 #define NO_THREADS 1
8827 EOF
8828
8829         LTHREAD_LIBS=""
8830 fi
8831
8832 if test $ol_link_threads != no ; then
8833         cat >> confdefs.h <<\EOF
8834 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
8835 EOF
8836
8837 fi
8838
8839
8840 ol_link_ldbm=no 
8841 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
8842         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
8843 echo "configure:8844: checking for DB2 library" >&5
8844 if eval "test \"\${ol_cv_lib_db2+set}\" = set"; then
8845   echo $ac_n "(cached) $ac_c" 1>&6
8846 else
8847         ol_LIBS="$LIBS"
8848         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
8849 echo "configure:8850: checking for db_open in -ldb" >&5
8850 ac_lib_var=`echo db'_'db_open | sed 'y%./+-:%__p__%'`
8851 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8852   echo $ac_n "(cached) $ac_c" 1>&6
8853 else
8854   ac_save_LIBS="$LIBS"
8855 LIBS="-ldb  $LIBS"
8856 cat > conftest.$ac_ext <<EOF
8857 #line 8858 "configure"
8858 #include "confdefs.h"
8859 /* Override any gcc2 internal prototype to avoid an error.  */
8860 /* We use char because int might match the return type of a gcc2
8861     builtin and then its argument prototype would still apply.  */
8862 char db_open();
8863
8864 int main() {
8865 db_open()
8866 ; return 0; }
8867 EOF
8868 if { (eval echo configure:8869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8869   rm -rf conftest*
8870   eval "ac_cv_lib_$ac_lib_var=yes"
8871 else
8872   echo "configure: failed program was:" >&5
8873   cat conftest.$ac_ext >&5
8874   rm -rf conftest*
8875   eval "ac_cv_lib_$ac_lib_var=no"
8876 fi
8877 rm -f conftest*
8878 LIBS="$ac_save_LIBS"
8879
8880 fi
8881 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8882   echo "$ac_t""yes" 1>&6
8883   ol_cv_lib_db2=-ldb
8884 else
8885   echo "$ac_t""no" 1>&6
8886 ol_cv_lib_db2=no
8887 fi
8888
8889         LIBS="$ol_LIBS"
8890
8891 fi
8892
8893 echo "$ac_t""$ol_cv_lib_db2" 1>&6
8894
8895 for ac_hdr in db.h
8896 do
8897 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8898 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8899 echo "configure:8900: checking for $ac_hdr" >&5
8900 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8901   echo $ac_n "(cached) $ac_c" 1>&6
8902 else
8903   cat > conftest.$ac_ext <<EOF
8904 #line 8905 "configure"
8905 #include "confdefs.h"
8906 #include <$ac_hdr>
8907 EOF
8908 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8909 { (eval echo configure:8910: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8910 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8911 if test -z "$ac_err"; then
8912   rm -rf conftest*
8913   eval "ac_cv_header_$ac_safe=yes"
8914 else
8915   echo "$ac_err" >&5
8916   echo "configure: failed program was:" >&5
8917   cat conftest.$ac_ext >&5
8918   rm -rf conftest*
8919   eval "ac_cv_header_$ac_safe=no"
8920 fi
8921 rm -f conftest*
8922 fi
8923 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8924   echo "$ac_t""yes" 1>&6
8925     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8926   cat >> confdefs.h <<EOF
8927 #define $ac_tr_hdr 1
8928 EOF
8929  
8930 else
8931   echo "$ac_t""no" 1>&6
8932 fi
8933 done
8934
8935 if test $ac_cv_header_db_h = yes ; then
8936         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
8937 echo "configure:8938: checking if db.h is DB2" >&5
8938 if eval "test \"\${ol_cv_header_db2+set}\" = set"; then
8939   echo $ac_n "(cached) $ac_c" 1>&6
8940 else
8941   
8942                 cat > conftest.$ac_ext <<EOF
8943 #line 8944 "configure"
8944 #include "confdefs.h"
8945
8946 #                       include <db.h>
8947                         /* this check could be improved */
8948 #                       ifdef DB_VERSION_MAJOR
8949 #                               if DB_VERSION_MAJOR == 2
8950                                         __db_version_2
8951 #                               endif
8952 #                       endif
8953                 
8954 EOF
8955 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8956   egrep "__db_version_2" >/dev/null 2>&1; then
8957   rm -rf conftest*
8958   ol_cv_header_db2=yes
8959 else
8960   rm -rf conftest*
8961   ol_cv_header_db2=no
8962 fi
8963 rm -f conftest*
8964
8965 fi
8966
8967 echo "$ac_t""$ol_cv_header_db2" 1>&6
8968 else
8969         ol_cv_header_db2=no
8970 fi
8971
8972
8973  
8974  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
8975 echo "configure:8976: checking for Berkeley DB2" >&5
8976 if eval "test \"\${ol_cv_berkeley_db2+set}\" = set"; then
8977   echo $ac_n "(cached) $ac_c" 1>&6
8978 else
8979   
8980         if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then
8981                 ol_cv_berkeley_db2=no
8982         else
8983                 ol_cv_berkeley_db2=yes
8984         fi
8985
8986 fi
8987
8988 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
8989  if test $ol_cv_berkeley_db2 = yes ; then
8990         cat >> confdefs.h <<\EOF
8991 #define HAVE_BERKELEY_DB2 1
8992 EOF
8993
8994  fi
8995
8996
8997         if test $ol_cv_berkeley_db2 = yes ; then
8998                 ol_link_ldbm=db2
8999                 ol_with_ldbm_api=db2
9000
9001                 if test $ol_with_ldbm_type = hash ; then
9002                         cat >> confdefs.h <<\EOF
9003 #define LDBM_USE_DBHASH 1
9004 EOF
9005
9006                 else
9007                         cat >> confdefs.h <<\EOF
9008 #define LDBM_USE_DBBTREE 1
9009 EOF
9010
9011                 fi
9012
9013                                                 if test $ol_cv_lib_db2 != yes ; then
9014                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
9015                 fi
9016         fi
9017 fi
9018
9019 ol_link_bdb2=no
9020 if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
9021         ol_link_bdb2=yes
9022 fi
9023
9024 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
9025         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
9026 echo "configure:9027: checking for Berkeley DB library" >&5
9027 if eval "test \"\${ol_cv_lib_db+set}\" = set"; then
9028   echo $ac_n "(cached) $ac_c" 1>&6
9029 else
9030   
9031         for ac_hdr in db1/db.h
9032 do
9033 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9034 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9035 echo "configure:9036: checking for $ac_hdr" >&5
9036 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9037   echo $ac_n "(cached) $ac_c" 1>&6
9038 else
9039   cat > conftest.$ac_ext <<EOF
9040 #line 9041 "configure"
9041 #include "confdefs.h"
9042 #include <$ac_hdr>
9043 EOF
9044 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9045 { (eval echo configure:9046: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9046 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9047 if test -z "$ac_err"; then
9048   rm -rf conftest*
9049   eval "ac_cv_header_$ac_safe=yes"
9050 else
9051   echo "$ac_err" >&5
9052   echo "configure: failed program was:" >&5
9053   cat conftest.$ac_ext >&5
9054   rm -rf conftest*
9055   eval "ac_cv_header_$ac_safe=no"
9056 fi
9057 rm -f conftest*
9058 fi
9059 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9060   echo "$ac_t""yes" 1>&6
9061     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9062   cat >> confdefs.h <<EOF
9063 #define $ac_tr_hdr 1
9064 EOF
9065  
9066 else
9067   echo "$ac_t""no" 1>&6
9068 fi
9069 done
9070
9071         ol_LIBS="$LIBS"
9072         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
9073 echo "configure:9074: checking for dbopen" >&5
9074 if eval "test \"\${ac_cv_func_dbopen+set}\" = set"; then
9075   echo $ac_n "(cached) $ac_c" 1>&6
9076 else
9077   cat > conftest.$ac_ext <<EOF
9078 #line 9079 "configure"
9079 #include "confdefs.h"
9080 /* System header to define __stub macros and hopefully few prototypes,
9081     which can conflict with char dbopen(); below.  */
9082 #include <assert.h>
9083 /* Override any gcc2 internal prototype to avoid an error.  */
9084 /* We use char because int might match the return type of a gcc2
9085     builtin and then its argument prototype would still apply.  */
9086 char dbopen();
9087 char (*f)();
9088
9089 int main() {
9090
9091 /* The GNU C library defines this for functions which it implements
9092     to always fail with ENOSYS.  Some functions are actually named
9093     something starting with __ and the normal name is an alias.  */
9094 #if defined (__stub_dbopen) || defined (__stub___dbopen)
9095 choke me
9096 #else
9097 f = dbopen;
9098 #endif
9099
9100 ; return 0; }
9101 EOF
9102 if { (eval echo configure:9103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9103   rm -rf conftest*
9104   eval "ac_cv_func_dbopen=yes"
9105 else
9106   echo "configure: failed program was:" >&5
9107   cat conftest.$ac_ext >&5
9108   rm -rf conftest*
9109   eval "ac_cv_func_dbopen=no"
9110 fi
9111 rm -f conftest*
9112 fi
9113
9114 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
9115   echo "$ac_t""yes" 1>&6
9116   ol_cv_lib_db=yes
9117 else
9118   echo "$ac_t""no" 1>&6
9119
9120                 echo $ac_n "checking for dbopen in -ldb1""... $ac_c" 1>&6
9121 echo "configure:9122: checking for dbopen in -ldb1" >&5
9122 ac_lib_var=`echo db1'_'dbopen | sed 'y%./+-:%__p__%'`
9123 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9124   echo $ac_n "(cached) $ac_c" 1>&6
9125 else
9126   ac_save_LIBS="$LIBS"
9127 LIBS="-ldb1  $LIBS"
9128 cat > conftest.$ac_ext <<EOF
9129 #line 9130 "configure"
9130 #include "confdefs.h"
9131 /* Override any gcc2 internal prototype to avoid an error.  */
9132 /* We use char because int might match the return type of a gcc2
9133     builtin and then its argument prototype would still apply.  */
9134 char dbopen();
9135
9136 int main() {
9137 dbopen()
9138 ; return 0; }
9139 EOF
9140 if { (eval echo configure:9141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9141   rm -rf conftest*
9142   eval "ac_cv_lib_$ac_lib_var=yes"
9143 else
9144   echo "configure: failed program was:" >&5
9145   cat conftest.$ac_ext >&5
9146   rm -rf conftest*
9147   eval "ac_cv_lib_$ac_lib_var=no"
9148 fi
9149 rm -f conftest*
9150 LIBS="$ac_save_LIBS"
9151
9152 fi
9153 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9154   echo "$ac_t""yes" 1>&6
9155   ol_cv_lib_db=-ldb1
9156 else
9157   echo "$ac_t""no" 1>&6
9158
9159                         echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
9160 echo "configure:9161: checking for dbopen in -ldb" >&5
9161 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-:%__p__%'`
9162 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9163   echo $ac_n "(cached) $ac_c" 1>&6
9164 else
9165   ac_save_LIBS="$LIBS"
9166 LIBS="-ldb  $LIBS"
9167 cat > conftest.$ac_ext <<EOF
9168 #line 9169 "configure"
9169 #include "confdefs.h"
9170 /* Override any gcc2 internal prototype to avoid an error.  */
9171 /* We use char because int might match the return type of a gcc2
9172     builtin and then its argument prototype would still apply.  */
9173 char dbopen();
9174
9175 int main() {
9176 dbopen()
9177 ; return 0; }
9178 EOF
9179 if { (eval echo configure:9180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9180   rm -rf conftest*
9181   eval "ac_cv_lib_$ac_lib_var=yes"
9182 else
9183   echo "configure: failed program was:" >&5
9184   cat conftest.$ac_ext >&5
9185   rm -rf conftest*
9186   eval "ac_cv_lib_$ac_lib_var=no"
9187 fi
9188 rm -f conftest*
9189 LIBS="$ac_save_LIBS"
9190
9191 fi
9192 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9193   echo "$ac_t""yes" 1>&6
9194   ol_cv_lib_db=-ldb
9195 else
9196   echo "$ac_t""no" 1>&6
9197 ol_cv_lib_db=no
9198 fi
9199
9200                 
9201 fi
9202
9203         
9204 fi
9205
9206         LIBS="$ol_LIBS"
9207
9208 fi
9209
9210 echo "$ac_t""$ol_cv_lib_db" 1>&6
9211
9212
9213 for ac_hdr in db_185.h
9214 do
9215 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9216 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9217 echo "configure:9218: checking for $ac_hdr" >&5
9218 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9219   echo $ac_n "(cached) $ac_c" 1>&6
9220 else
9221   cat > conftest.$ac_ext <<EOF
9222 #line 9223 "configure"
9223 #include "confdefs.h"
9224 #include <$ac_hdr>
9225 EOF
9226 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9227 { (eval echo configure:9228: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9228 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9229 if test -z "$ac_err"; then
9230   rm -rf conftest*
9231   eval "ac_cv_header_$ac_safe=yes"
9232 else
9233   echo "$ac_err" >&5
9234   echo "configure: failed program was:" >&5
9235   cat conftest.$ac_ext >&5
9236   rm -rf conftest*
9237   eval "ac_cv_header_$ac_safe=no"
9238 fi
9239 rm -f conftest*
9240 fi
9241 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9242   echo "$ac_t""yes" 1>&6
9243     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9244   cat >> confdefs.h <<EOF
9245 #define $ac_tr_hdr 1
9246 EOF
9247  
9248 else
9249   echo "$ac_t""no" 1>&6
9250 fi
9251 done
9252
9253 if test "$ol_cv_header_db2" = yes ; then
9254         
9255         ol_cv_header_db=$ac_cv_header_db_185_h
9256 else
9257         ol_cv_header_db=$ac_cv_header_db_h
9258 fi
9259
9260
9261  
9262  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
9263 echo "configure:9264: checking for Berkeley DB" >&5
9264 if eval "test \"\${ol_cv_berkeley_db+set}\" = set"; then
9265   echo $ac_n "(cached) $ac_c" 1>&6
9266 else
9267   
9268         if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then
9269                 ol_cv_berkeley_db=no
9270         else
9271                 ol_cv_berkeley_db=yes
9272         fi
9273
9274 fi
9275
9276 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
9277  if test $ol_cv_berkeley_db = yes ; then
9278         cat >> confdefs.h <<\EOF
9279 #define HAVE_BERKELEY_DB 1
9280 EOF
9281
9282  fi
9283
9284
9285         if test $ol_cv_berkeley_db = yes ; then
9286                 ol_link_ldbm=db
9287                 ol_with_ldbm_api=db
9288
9289                 if test $ol_with_ldbm_type = hash ; then
9290                         cat >> confdefs.h <<\EOF
9291 #define LDBM_USE_DBHASH 1
9292 EOF
9293
9294                 else
9295                         cat >> confdefs.h <<\EOF
9296 #define LDBM_USE_DBBTREE 1
9297 EOF
9298
9299                 fi
9300
9301                                                 if test $ol_cv_lib_db != yes ; then
9302                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
9303                 fi
9304         fi
9305 fi
9306
9307 if test $ol_with_ldbm_api = manual ; then
9308                 ol_link_ldbm=yes
9309
9310         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
9311
9312         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
9313 do
9314 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9315 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9316 echo "configure:9317: checking for $ac_hdr" >&5
9317 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9318   echo $ac_n "(cached) $ac_c" 1>&6
9319 else
9320   cat > conftest.$ac_ext <<EOF
9321 #line 9322 "configure"
9322 #include "confdefs.h"
9323 #include <$ac_hdr>
9324 EOF
9325 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9326 { (eval echo configure:9327: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9327 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9328 if test -z "$ac_err"; then
9329   rm -rf conftest*
9330   eval "ac_cv_header_$ac_safe=yes"
9331 else
9332   echo "$ac_err" >&5
9333   echo "configure: failed program was:" >&5
9334   cat conftest.$ac_ext >&5
9335   rm -rf conftest*
9336   eval "ac_cv_header_$ac_safe=no"
9337 fi
9338 rm -f conftest*
9339 fi
9340 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9341   echo "$ac_t""yes" 1>&6
9342     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9343   cat >> confdefs.h <<EOF
9344 #define $ac_tr_hdr 1
9345 EOF
9346  
9347 else
9348   echo "$ac_t""no" 1>&6
9349 fi
9350 done
9351
9352 fi
9353
9354 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
9355         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
9356         ol_with_ldbm_api=none
9357 fi
9358
9359 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
9360         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
9361 echo "configure:9362: checking for MDBM library" >&5
9362 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
9363   echo $ac_n "(cached) $ac_c" 1>&6
9364 else
9365         ol_LIBS="$LIBS"
9366         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
9367 echo "configure:9368: checking for mdbm_set_chain" >&5
9368 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
9369   echo $ac_n "(cached) $ac_c" 1>&6
9370 else
9371   cat > conftest.$ac_ext <<EOF
9372 #line 9373 "configure"
9373 #include "confdefs.h"
9374 /* System header to define __stub macros and hopefully few prototypes,
9375     which can conflict with char mdbm_set_chain(); below.  */
9376 #include <assert.h>
9377 /* Override any gcc2 internal prototype to avoid an error.  */
9378 /* We use char because int might match the return type of a gcc2
9379     builtin and then its argument prototype would still apply.  */
9380 char mdbm_set_chain();
9381 char (*f)();
9382
9383 int main() {
9384
9385 /* The GNU C library defines this for functions which it implements
9386     to always fail with ENOSYS.  Some functions are actually named
9387     something starting with __ and the normal name is an alias.  */
9388 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
9389 choke me
9390 #else
9391 f = mdbm_set_chain;
9392 #endif
9393
9394 ; return 0; }
9395 EOF
9396 if { (eval echo configure:9397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9397   rm -rf conftest*
9398   eval "ac_cv_func_mdbm_set_chain=yes"
9399 else
9400   echo "configure: failed program was:" >&5
9401   cat conftest.$ac_ext >&5
9402   rm -rf conftest*
9403   eval "ac_cv_func_mdbm_set_chain=no"
9404 fi
9405 rm -f conftest*
9406 fi
9407
9408 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
9409   echo "$ac_t""yes" 1>&6
9410   ol_cv_lib_mdbm=yes
9411 else
9412   echo "$ac_t""no" 1>&6
9413
9414                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
9415 echo "configure:9416: checking for mdbm_set_chain in -lmdbm" >&5
9416 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
9417 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9418   echo $ac_n "(cached) $ac_c" 1>&6
9419 else
9420   ac_save_LIBS="$LIBS"
9421 LIBS="-lmdbm  $LIBS"
9422 cat > conftest.$ac_ext <<EOF
9423 #line 9424 "configure"
9424 #include "confdefs.h"
9425 /* Override any gcc2 internal prototype to avoid an error.  */
9426 /* We use char because int might match the return type of a gcc2
9427     builtin and then its argument prototype would still apply.  */
9428 char mdbm_set_chain();
9429
9430 int main() {
9431 mdbm_set_chain()
9432 ; return 0; }
9433 EOF
9434 if { (eval echo configure:9435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9435   rm -rf conftest*
9436   eval "ac_cv_lib_$ac_lib_var=yes"
9437 else
9438   echo "configure: failed program was:" >&5
9439   cat conftest.$ac_ext >&5
9440   rm -rf conftest*
9441   eval "ac_cv_lib_$ac_lib_var=no"
9442 fi
9443 rm -f conftest*
9444 LIBS="$ac_save_LIBS"
9445
9446 fi
9447 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9448   echo "$ac_t""yes" 1>&6
9449   ol_cv_lib_mdbm=-lmdbm
9450 else
9451   echo "$ac_t""no" 1>&6
9452 ol_cv_lib_mdbm=no
9453 fi
9454
9455         
9456 fi
9457
9458         LIBS="$ol_LIBS"
9459
9460 fi
9461
9462 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
9463
9464
9465  for ac_hdr in mdbm.h
9466 do
9467 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9468 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9469 echo "configure:9470: checking for $ac_hdr" >&5
9470 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9471   echo $ac_n "(cached) $ac_c" 1>&6
9472 else
9473   cat > conftest.$ac_ext <<EOF
9474 #line 9475 "configure"
9475 #include "confdefs.h"
9476 #include <$ac_hdr>
9477 EOF
9478 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9479 { (eval echo configure:9480: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9480 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9481 if test -z "$ac_err"; then
9482   rm -rf conftest*
9483   eval "ac_cv_header_$ac_safe=yes"
9484 else
9485   echo "$ac_err" >&5
9486   echo "configure: failed program was:" >&5
9487   cat conftest.$ac_ext >&5
9488   rm -rf conftest*
9489   eval "ac_cv_header_$ac_safe=no"
9490 fi
9491 rm -f conftest*
9492 fi
9493 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9494   echo "$ac_t""yes" 1>&6
9495     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9496   cat >> confdefs.h <<EOF
9497 #define $ac_tr_hdr 1
9498 EOF
9499  
9500 else
9501   echo "$ac_t""no" 1>&6
9502 fi
9503 done
9504
9505  echo $ac_n "checking for db""... $ac_c" 1>&6
9506 echo "configure:9507: checking for db" >&5
9507 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
9508   echo $ac_n "(cached) $ac_c" 1>&6
9509 else
9510   
9511         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
9512                 ol_cv_mdbm=no
9513         else
9514                 ol_cv_mdbm=yes
9515         fi
9516
9517 fi
9518
9519 echo "$ac_t""$ol_cv_mdbm" 1>&6
9520  if test $ol_cv_mdbm = yes ; then
9521         cat >> confdefs.h <<\EOF
9522 #define HAVE_MDBM 1
9523 EOF
9524
9525  fi
9526
9527
9528         if test $ol_cv_mdbm = yes ; then
9529                 ol_link_ldbm=mdbm
9530                 ol_with_ldbm_api=mdbm
9531                 if test $ol_cv_lib_mdbm != yes ; then
9532                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
9533                 fi
9534         fi
9535 fi
9536
9537 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
9538         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
9539 echo "configure:9540: checking for GDBM library" >&5
9540 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
9541   echo $ac_n "(cached) $ac_c" 1>&6
9542 else
9543         ol_LIBS="$LIBS"
9544         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
9545 echo "configure:9546: checking for gdbm_open" >&5
9546 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
9547   echo $ac_n "(cached) $ac_c" 1>&6
9548 else
9549   cat > conftest.$ac_ext <<EOF
9550 #line 9551 "configure"
9551 #include "confdefs.h"
9552 /* System header to define __stub macros and hopefully few prototypes,
9553     which can conflict with char gdbm_open(); below.  */
9554 #include <assert.h>
9555 /* Override any gcc2 internal prototype to avoid an error.  */
9556 /* We use char because int might match the return type of a gcc2
9557     builtin and then its argument prototype would still apply.  */
9558 char gdbm_open();
9559 char (*f)();
9560
9561 int main() {
9562
9563 /* The GNU C library defines this for functions which it implements
9564     to always fail with ENOSYS.  Some functions are actually named
9565     something starting with __ and the normal name is an alias.  */
9566 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
9567 choke me
9568 #else
9569 f = gdbm_open;
9570 #endif
9571
9572 ; return 0; }
9573 EOF
9574 if { (eval echo configure:9575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9575   rm -rf conftest*
9576   eval "ac_cv_func_gdbm_open=yes"
9577 else
9578   echo "configure: failed program was:" >&5
9579   cat conftest.$ac_ext >&5
9580   rm -rf conftest*
9581   eval "ac_cv_func_gdbm_open=no"
9582 fi
9583 rm -f conftest*
9584 fi
9585
9586 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
9587   echo "$ac_t""yes" 1>&6
9588   ol_cv_lib_gdbm=yes
9589 else
9590   echo "$ac_t""no" 1>&6
9591
9592                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
9593 echo "configure:9594: checking for gdbm_open in -lgdbm" >&5
9594 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
9595 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9596   echo $ac_n "(cached) $ac_c" 1>&6
9597 else
9598   ac_save_LIBS="$LIBS"
9599 LIBS="-lgdbm  $LIBS"
9600 cat > conftest.$ac_ext <<EOF
9601 #line 9602 "configure"
9602 #include "confdefs.h"
9603 /* Override any gcc2 internal prototype to avoid an error.  */
9604 /* We use char because int might match the return type of a gcc2
9605     builtin and then its argument prototype would still apply.  */
9606 char gdbm_open();
9607
9608 int main() {
9609 gdbm_open()
9610 ; return 0; }
9611 EOF
9612 if { (eval echo configure:9613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9613   rm -rf conftest*
9614   eval "ac_cv_lib_$ac_lib_var=yes"
9615 else
9616   echo "configure: failed program was:" >&5
9617   cat conftest.$ac_ext >&5
9618   rm -rf conftest*
9619   eval "ac_cv_lib_$ac_lib_var=no"
9620 fi
9621 rm -f conftest*
9622 LIBS="$ac_save_LIBS"
9623
9624 fi
9625 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9626   echo "$ac_t""yes" 1>&6
9627   ol_cv_lib_gdbm=-lgdbm
9628 else
9629   echo "$ac_t""no" 1>&6
9630 ol_cv_lib_gdbm=no
9631 fi
9632
9633         
9634 fi
9635
9636         LIBS="$ol_LIBS"
9637
9638 fi
9639
9640 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
9641
9642
9643  for ac_hdr in gdbm.h
9644 do
9645 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9646 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9647 echo "configure:9648: checking for $ac_hdr" >&5
9648 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9649   echo $ac_n "(cached) $ac_c" 1>&6
9650 else
9651   cat > conftest.$ac_ext <<EOF
9652 #line 9653 "configure"
9653 #include "confdefs.h"
9654 #include <$ac_hdr>
9655 EOF
9656 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9657 { (eval echo configure:9658: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9658 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9659 if test -z "$ac_err"; then
9660   rm -rf conftest*
9661   eval "ac_cv_header_$ac_safe=yes"
9662 else
9663   echo "$ac_err" >&5
9664   echo "configure: failed program was:" >&5
9665   cat conftest.$ac_ext >&5
9666   rm -rf conftest*
9667   eval "ac_cv_header_$ac_safe=no"
9668 fi
9669 rm -f conftest*
9670 fi
9671 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9672   echo "$ac_t""yes" 1>&6
9673     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9674   cat >> confdefs.h <<EOF
9675 #define $ac_tr_hdr 1
9676 EOF
9677  
9678 else
9679   echo "$ac_t""no" 1>&6
9680 fi
9681 done
9682
9683  echo $ac_n "checking for db""... $ac_c" 1>&6
9684 echo "configure:9685: checking for db" >&5
9685 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
9686   echo $ac_n "(cached) $ac_c" 1>&6
9687 else
9688   
9689         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
9690                 ol_cv_gdbm=no
9691         else
9692                 ol_cv_gdbm=yes
9693         fi
9694
9695 fi
9696
9697 echo "$ac_t""$ol_cv_gdbm" 1>&6
9698  if test $ol_cv_gdbm = yes ; then
9699         cat >> confdefs.h <<\EOF
9700 #define HAVE_GDBM 1
9701 EOF
9702
9703  fi
9704
9705
9706         if test $ol_cv_gdbm = yes ; then
9707                 ol_link_ldbm=gdbm
9708                 ol_with_ldbm_api=gdbm
9709
9710                 if test $ol_cv_lib_gdbm != yes ; then
9711                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
9712                 fi
9713         fi
9714 fi
9715
9716 if test $ol_with_ldbm_api = auto ; then
9717         echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
9718 elif test $ol_with_ldbm_api = ndbm ; then
9719         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
9720 echo "configure:9721: checking for NDBM library" >&5
9721 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
9722   echo $ac_n "(cached) $ac_c" 1>&6
9723 else
9724         ol_LIBS="$LIBS"
9725         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
9726 echo "configure:9727: checking for dbm_open" >&5
9727 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
9728   echo $ac_n "(cached) $ac_c" 1>&6
9729 else
9730   cat > conftest.$ac_ext <<EOF
9731 #line 9732 "configure"
9732 #include "confdefs.h"
9733 /* System header to define __stub macros and hopefully few prototypes,
9734     which can conflict with char dbm_open(); below.  */
9735 #include <assert.h>
9736 /* Override any gcc2 internal prototype to avoid an error.  */
9737 /* We use char because int might match the return type of a gcc2
9738     builtin and then its argument prototype would still apply.  */
9739 char dbm_open();
9740 char (*f)();
9741
9742 int main() {
9743
9744 /* The GNU C library defines this for functions which it implements
9745     to always fail with ENOSYS.  Some functions are actually named
9746     something starting with __ and the normal name is an alias.  */
9747 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
9748 choke me
9749 #else
9750 f = dbm_open;
9751 #endif
9752
9753 ; return 0; }
9754 EOF
9755 if { (eval echo configure:9756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9756   rm -rf conftest*
9757   eval "ac_cv_func_dbm_open=yes"
9758 else
9759   echo "configure: failed program was:" >&5
9760   cat conftest.$ac_ext >&5
9761   rm -rf conftest*
9762   eval "ac_cv_func_dbm_open=no"
9763 fi
9764 rm -f conftest*
9765 fi
9766
9767 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
9768   echo "$ac_t""yes" 1>&6
9769   ol_cv_lib_ndbm=yes
9770 else
9771   echo "$ac_t""no" 1>&6
9772
9773                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
9774 echo "configure:9775: checking for dbm_open in -lndbm" >&5
9775 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
9776 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9777   echo $ac_n "(cached) $ac_c" 1>&6
9778 else
9779   ac_save_LIBS="$LIBS"
9780 LIBS="-lndbm  $LIBS"
9781 cat > conftest.$ac_ext <<EOF
9782 #line 9783 "configure"
9783 #include "confdefs.h"
9784 /* Override any gcc2 internal prototype to avoid an error.  */
9785 /* We use char because int might match the return type of a gcc2
9786     builtin and then its argument prototype would still apply.  */
9787 char dbm_open();
9788
9789 int main() {
9790 dbm_open()
9791 ; return 0; }
9792 EOF
9793 if { (eval echo configure:9794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9794   rm -rf conftest*
9795   eval "ac_cv_lib_$ac_lib_var=yes"
9796 else
9797   echo "configure: failed program was:" >&5
9798   cat conftest.$ac_ext >&5
9799   rm -rf conftest*
9800   eval "ac_cv_lib_$ac_lib_var=no"
9801 fi
9802 rm -f conftest*
9803 LIBS="$ac_save_LIBS"
9804
9805 fi
9806 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9807   echo "$ac_t""yes" 1>&6
9808   ol_cv_lib_ndbm=-lndbm
9809 else
9810   echo "$ac_t""no" 1>&6
9811
9812                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
9813 echo "configure:9814: checking for dbm_open in -ldbm" >&5
9814 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
9815 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9816   echo $ac_n "(cached) $ac_c" 1>&6
9817 else
9818   ac_save_LIBS="$LIBS"
9819 LIBS="-ldbm  $LIBS"
9820 cat > conftest.$ac_ext <<EOF
9821 #line 9822 "configure"
9822 #include "confdefs.h"
9823 /* Override any gcc2 internal prototype to avoid an error.  */
9824 /* We use char because int might match the return type of a gcc2
9825     builtin and then its argument prototype would still apply.  */
9826 char dbm_open();
9827
9828 int main() {
9829 dbm_open()
9830 ; return 0; }
9831 EOF
9832 if { (eval echo configure:9833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9833   rm -rf conftest*
9834   eval "ac_cv_lib_$ac_lib_var=yes"
9835 else
9836   echo "configure: failed program was:" >&5
9837   cat conftest.$ac_ext >&5
9838   rm -rf conftest*
9839   eval "ac_cv_lib_$ac_lib_var=no"
9840 fi
9841 rm -f conftest*
9842 LIBS="$ac_save_LIBS"
9843
9844 fi
9845 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9846   echo "$ac_t""yes" 1>&6
9847   ol_cv_lib_ndbm=-ldbm
9848 else
9849   echo "$ac_t""no" 1>&6
9850 ol_cv_lib_ndbm=no
9851 fi
9852                 
9853 fi
9854
9855         
9856 fi
9857
9858         LIBS="$ol_LIBS"
9859
9860 fi
9861
9862 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
9863
9864
9865  for ac_hdr in ndbm.h
9866 do
9867 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9868 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9869 echo "configure:9870: checking for $ac_hdr" >&5
9870 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9871   echo $ac_n "(cached) $ac_c" 1>&6
9872 else
9873   cat > conftest.$ac_ext <<EOF
9874 #line 9875 "configure"
9875 #include "confdefs.h"
9876 #include <$ac_hdr>
9877 EOF
9878 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9879 { (eval echo configure:9880: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9880 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9881 if test -z "$ac_err"; then
9882   rm -rf conftest*
9883   eval "ac_cv_header_$ac_safe=yes"
9884 else
9885   echo "$ac_err" >&5
9886   echo "configure: failed program was:" >&5
9887   cat conftest.$ac_ext >&5
9888   rm -rf conftest*
9889   eval "ac_cv_header_$ac_safe=no"
9890 fi
9891 rm -f conftest*
9892 fi
9893 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9894   echo "$ac_t""yes" 1>&6
9895     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9896   cat >> confdefs.h <<EOF
9897 #define $ac_tr_hdr 1
9898 EOF
9899  
9900 else
9901   echo "$ac_t""no" 1>&6
9902 fi
9903 done
9904
9905  echo $ac_n "checking for db""... $ac_c" 1>&6
9906 echo "configure:9907: checking for db" >&5
9907 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
9908   echo $ac_n "(cached) $ac_c" 1>&6
9909 else
9910   
9911         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
9912                 ol_cv_ndbm=no
9913         else
9914                 ol_cv_ndbm=yes
9915         fi
9916
9917 fi
9918
9919 echo "$ac_t""$ol_cv_ndbm" 1>&6
9920  if test $ol_cv_ndbm = yes ; then
9921         cat >> confdefs.h <<\EOF
9922 #define HAVE_NDBM 1
9923 EOF
9924
9925  fi
9926
9927
9928         if test $ol_cv_ndbm = yes ; then
9929                 ol_link_ldbm=ndbm
9930                 ol_with_ldbm_api=ndbm
9931
9932                 if test $ol_cv_lib_ndbm != yes ; then
9933                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
9934                 fi
9935         fi
9936 fi
9937
9938 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
9939         echo "configure: warning: could not find suitable LDBM backend" 1>&2
9940         if test $ol_enable_ldbm = yes ; then
9941                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
9942         fi
9943
9944         echo "configure: warning: disabling LDBM" 1>&2
9945         ol_enable_ldbm=no
9946 fi
9947
9948 if test $ol_enable_wrappers != no ; then
9949         for ac_hdr in tcpd.h
9950 do
9951 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9952 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9953 echo "configure:9954: checking for $ac_hdr" >&5
9954 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9955   echo $ac_n "(cached) $ac_c" 1>&6
9956 else
9957   cat > conftest.$ac_ext <<EOF
9958 #line 9959 "configure"
9959 #include "confdefs.h"
9960 #include <$ac_hdr>
9961 EOF
9962 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9963 { (eval echo configure:9964: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9964 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9965 if test -z "$ac_err"; then
9966   rm -rf conftest*
9967   eval "ac_cv_header_$ac_safe=yes"
9968 else
9969   echo "$ac_err" >&5
9970   echo "configure: failed program was:" >&5
9971   cat conftest.$ac_ext >&5
9972   rm -rf conftest*
9973   eval "ac_cv_header_$ac_safe=no"
9974 fi
9975 rm -f conftest*
9976 fi
9977 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9978   echo "$ac_t""yes" 1>&6
9979     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9980   cat >> confdefs.h <<EOF
9981 #define $ac_tr_hdr 1
9982 EOF
9983  
9984 else
9985   echo "$ac_t""no" 1>&6
9986 fi
9987 done
9988
9989
9990         if test $ac_cv_header_tcpd_h != yes ; then
9991                 have_wrappers=no
9992         else
9993                 echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
9994 echo "configure:9995: checking for main in -lwrap" >&5
9995 ac_lib_var=`echo wrap'_'main | sed 'y%./+-:%__p__%'`
9996 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9997   echo $ac_n "(cached) $ac_c" 1>&6
9998 else
9999   ac_save_LIBS="$LIBS"
10000 LIBS="-lwrap  $LIBS"
10001 cat > conftest.$ac_ext <<EOF
10002 #line 10003 "configure"
10003 #include "confdefs.h"
10004
10005 int main() {
10006 main()
10007 ; return 0; }
10008 EOF
10009 if { (eval echo configure:10010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10010   rm -rf conftest*
10011   eval "ac_cv_lib_$ac_lib_var=yes"
10012 else
10013   echo "configure: failed program was:" >&5
10014   cat conftest.$ac_ext >&5
10015   rm -rf conftest*
10016   eval "ac_cv_lib_$ac_lib_var=no"
10017 fi
10018 rm -f conftest*
10019 LIBS="$ac_save_LIBS"
10020
10021 fi
10022 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10023   echo "$ac_t""yes" 1>&6
10024   have_wrappers=yes
10025 else
10026   echo "$ac_t""no" 1>&6
10027 have_wrappers=no
10028 fi
10029
10030         fi
10031
10032         if test $have_wrappers = yes ; then
10033                 cat >> confdefs.h <<\EOF
10034 #define HAVE_TCPD 1
10035 EOF
10036
10037                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
10038
10039                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
10040 echo "configure:10041: checking for main in -lnsl" >&5
10041 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
10042 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10043   echo $ac_n "(cached) $ac_c" 1>&6
10044 else
10045   ac_save_LIBS="$LIBS"
10046 LIBS="-lnsl  $LIBS"
10047 cat > conftest.$ac_ext <<EOF
10048 #line 10049 "configure"
10049 #include "confdefs.h"
10050
10051 int main() {
10052 main()
10053 ; return 0; }
10054 EOF
10055 if { (eval echo configure:10056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10056   rm -rf conftest*
10057   eval "ac_cv_lib_$ac_lib_var=yes"
10058 else
10059   echo "configure: failed program was:" >&5
10060   cat conftest.$ac_ext >&5
10061   rm -rf conftest*
10062   eval "ac_cv_lib_$ac_lib_var=no"
10063 fi
10064 rm -f conftest*
10065 LIBS="$ac_save_LIBS"
10066
10067 fi
10068 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10069   echo "$ac_t""yes" 1>&6
10070     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10071     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10072   cat >> confdefs.h <<EOF
10073 #define $ac_tr_lib 1
10074 EOF
10075
10076   LIBS="-lnsl $LIBS"
10077
10078 else
10079   echo "$ac_t""no" 1>&6
10080 fi
10081
10082         else
10083                 echo "configure: warning: could not find -lwrap" 1>&2
10084                 if test $ol_enable_wrappers = yes ; then
10085                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
10086                 fi
10087
10088                 echo "configure: warning: disabling wrappers support" 1>&2
10089                 ol_enable_wrappers=no
10090         fi
10091 fi
10092
10093 if test $ol_enable_syslog != no ; then
10094         echo $ac_n "checking for openlog""... $ac_c" 1>&6
10095 echo "configure:10096: checking for openlog" >&5
10096 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
10097   echo $ac_n "(cached) $ac_c" 1>&6
10098 else
10099   cat > conftest.$ac_ext <<EOF
10100 #line 10101 "configure"
10101 #include "confdefs.h"
10102 /* System header to define __stub macros and hopefully few prototypes,
10103     which can conflict with char openlog(); below.  */
10104 #include <assert.h>
10105 /* Override any gcc2 internal prototype to avoid an error.  */
10106 /* We use char because int might match the return type of a gcc2
10107     builtin and then its argument prototype would still apply.  */
10108 char openlog();
10109 char (*f)();
10110
10111 int main() {
10112
10113 /* The GNU C library defines this for functions which it implements
10114     to always fail with ENOSYS.  Some functions are actually named
10115     something starting with __ and the normal name is an alias.  */
10116 #if defined (__stub_openlog) || defined (__stub___openlog)
10117 choke me
10118 #else
10119 f = openlog;
10120 #endif
10121
10122 ; return 0; }
10123 EOF
10124 if { (eval echo configure:10125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10125   rm -rf conftest*
10126   eval "ac_cv_func_openlog=yes"
10127 else
10128   echo "configure: failed program was:" >&5
10129   cat conftest.$ac_ext >&5
10130   rm -rf conftest*
10131   eval "ac_cv_func_openlog=no"
10132 fi
10133 rm -f conftest*
10134 fi
10135
10136 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
10137   echo "$ac_t""yes" 1>&6
10138   :
10139 else
10140   echo "$ac_t""no" 1>&6
10141 fi
10142
10143         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
10144                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
10145         fi
10146         ol_enable_syslog=$ac_cv_func_openlog
10147 fi
10148
10149 if test $ol_enable_dmalloc != no ; then
10150         for ac_hdr in dmalloc.h
10151 do
10152 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10153 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10154 echo "configure:10155: checking for $ac_hdr" >&5
10155 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10156   echo $ac_n "(cached) $ac_c" 1>&6
10157 else
10158   cat > conftest.$ac_ext <<EOF
10159 #line 10160 "configure"
10160 #include "confdefs.h"
10161 #include <$ac_hdr>
10162 EOF
10163 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10164 { (eval echo configure:10165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10165 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10166 if test -z "$ac_err"; then
10167   rm -rf conftest*
10168   eval "ac_cv_header_$ac_safe=yes"
10169 else
10170   echo "$ac_err" >&5
10171   echo "configure: failed program was:" >&5
10172   cat conftest.$ac_ext >&5
10173   rm -rf conftest*
10174   eval "ac_cv_header_$ac_safe=no"
10175 fi
10176 rm -f conftest*
10177 fi
10178 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10179   echo "$ac_t""yes" 1>&6
10180     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10181   cat >> confdefs.h <<EOF
10182 #define $ac_tr_hdr 1
10183 EOF
10184  
10185 else
10186   echo "$ac_t""no" 1>&6
10187 fi
10188 done
10189
10190         echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
10191 echo "configure:10192: checking for dmalloc_shutdown in -ldmalloc" >&5
10192 ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-:%__p__%'`
10193 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10194   echo $ac_n "(cached) $ac_c" 1>&6
10195 else
10196   ac_save_LIBS="$LIBS"
10197 LIBS="-ldmalloc  $LIBS"
10198 cat > conftest.$ac_ext <<EOF
10199 #line 10200 "configure"
10200 #include "confdefs.h"
10201 /* Override any gcc2 internal prototype to avoid an error.  */
10202 /* We use char because int might match the return type of a gcc2
10203     builtin and then its argument prototype would still apply.  */
10204 char dmalloc_shutdown();
10205
10206 int main() {
10207 dmalloc_shutdown()
10208 ; return 0; }
10209 EOF
10210 if { (eval echo configure:10211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10211   rm -rf conftest*
10212   eval "ac_cv_lib_$ac_lib_var=yes"
10213 else
10214   echo "configure: failed program was:" >&5
10215   cat conftest.$ac_ext >&5
10216   rm -rf conftest*
10217   eval "ac_cv_lib_$ac_lib_var=no"
10218 fi
10219 rm -f conftest*
10220 LIBS="$ac_save_LIBS"
10221
10222 fi
10223 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10224   echo "$ac_t""yes" 1>&6
10225     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10226     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10227   cat >> confdefs.h <<EOF
10228 #define $ac_tr_lib 1
10229 EOF
10230
10231   LIBS="-ldmalloc $LIBS"
10232
10233 else
10234   echo "$ac_t""no" 1>&6
10235 fi
10236
10237 fi
10238
10239 if test $ol_enable_tcl != no ; then
10240         for ac_hdr in tcl.h
10241 do
10242 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10243 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10244 echo "configure:10245: checking for $ac_hdr" >&5
10245 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10246   echo $ac_n "(cached) $ac_c" 1>&6
10247 else
10248   cat > conftest.$ac_ext <<EOF
10249 #line 10250 "configure"
10250 #include "confdefs.h"
10251 #include <$ac_hdr>
10252 EOF
10253 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10254 { (eval echo configure:10255: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10255 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10256 if test -z "$ac_err"; then
10257   rm -rf conftest*
10258   eval "ac_cv_header_$ac_safe=yes"
10259 else
10260   echo "$ac_err" >&5
10261   echo "configure: failed program was:" >&5
10262   cat conftest.$ac_ext >&5
10263   rm -rf conftest*
10264   eval "ac_cv_header_$ac_safe=no"
10265 fi
10266 rm -f conftest*
10267 fi
10268 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10269   echo "$ac_t""yes" 1>&6
10270     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10271   cat >> confdefs.h <<EOF
10272 #define $ac_tr_hdr 1
10273 EOF
10274  
10275 else
10276   echo "$ac_t""no" 1>&6
10277 fi
10278 done
10279
10280
10281         if test $ac_cv_header_tcl_h != yes ; then
10282                 have_tcl=no
10283         else
10284                 echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6
10285 echo "configure:10286: checking for main in -ltcl" >&5
10286 ac_lib_var=`echo tcl'_'main | sed 'y%./+-:%__p__%'`
10287 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10288   echo $ac_n "(cached) $ac_c" 1>&6
10289 else
10290   ac_save_LIBS="$LIBS"
10291 LIBS="-ltcl  $LIBS"
10292 cat > conftest.$ac_ext <<EOF
10293 #line 10294 "configure"
10294 #include "confdefs.h"
10295
10296 int main() {
10297 main()
10298 ; return 0; }
10299 EOF
10300 if { (eval echo configure:10301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10301   rm -rf conftest*
10302   eval "ac_cv_lib_$ac_lib_var=yes"
10303 else
10304   echo "configure: failed program was:" >&5
10305   cat conftest.$ac_ext >&5
10306   rm -rf conftest*
10307   eval "ac_cv_lib_$ac_lib_var=no"
10308 fi
10309 rm -f conftest*
10310 LIBS="$ac_save_LIBS"
10311
10312 fi
10313 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10314   echo "$ac_t""yes" 1>&6
10315   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"
10316 else
10317   echo "$ac_t""no" 1>&6
10318 have_tcl=no
10319 fi
10320
10321
10322                 if test $have_tcl != yes; then
10323                         echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6
10324 echo "configure:10325: checking for main in -ltcl7.6" >&5
10325 ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-:%__p__%'`
10326 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10327   echo $ac_n "(cached) $ac_c" 1>&6
10328 else
10329   ac_save_LIBS="$LIBS"
10330 LIBS="-ltcl7.6  $LIBS"
10331 cat > conftest.$ac_ext <<EOF
10332 #line 10333 "configure"
10333 #include "confdefs.h"
10334
10335 int main() {
10336 main()
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   eval "ac_cv_lib_$ac_lib_var=yes"
10342 else
10343   echo "configure: failed program was:" >&5
10344   cat conftest.$ac_ext >&5
10345   rm -rf conftest*
10346   eval "ac_cv_lib_$ac_lib_var=no"
10347 fi
10348 rm -f conftest*
10349 LIBS="$ac_save_LIBS"
10350
10351 fi
10352 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10353   echo "$ac_t""yes" 1>&6
10354   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"
10355 else
10356   echo "$ac_t""no" 1>&6
10357 have_tcl=no
10358 fi
10359
10360                 fi
10361
10362                 if test $have_tcl != yes; then
10363                         echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6
10364 echo "configure:10365: checking for main in -ltcl8.0" >&5
10365 ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-:%__p__%'`
10366 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10367   echo $ac_n "(cached) $ac_c" 1>&6
10368 else
10369   ac_save_LIBS="$LIBS"
10370 LIBS="-ltcl8.0  $LIBS"
10371 cat > conftest.$ac_ext <<EOF
10372 #line 10373 "configure"
10373 #include "confdefs.h"
10374
10375 int main() {
10376 main()
10377 ; return 0; }
10378 EOF
10379 if { (eval echo configure:10380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10380   rm -rf conftest*
10381   eval "ac_cv_lib_$ac_lib_var=yes"
10382 else
10383   echo "configure: failed program was:" >&5
10384   cat conftest.$ac_ext >&5
10385   rm -rf conftest*
10386   eval "ac_cv_lib_$ac_lib_var=no"
10387 fi
10388 rm -f conftest*
10389 LIBS="$ac_save_LIBS"
10390
10391 fi
10392 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10393   echo "$ac_t""yes" 1>&6
10394   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"
10395 else
10396   echo "$ac_t""no" 1>&6
10397 have_tcl=no
10398 fi
10399
10400                 fi
10401         fi
10402
10403         if test $have_tcl != yes ; then
10404                 echo "configure: warning: could not find -ltcl" 1>&2
10405                 if test $ol_enable_tcl = yes ; then
10406                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
10407                 fi
10408
10409                 ol_enable_tcl=no
10410         fi
10411 fi
10412
10413 # ud needs termcap (should insert check here)
10414 ol_link_termcap=no
10415 for ac_hdr in termcap.h ncurses.h
10416 do
10417 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10418 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10419 echo "configure:10420: checking for $ac_hdr" >&5
10420 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10421   echo $ac_n "(cached) $ac_c" 1>&6
10422 else
10423   cat > conftest.$ac_ext <<EOF
10424 #line 10425 "configure"
10425 #include "confdefs.h"
10426 #include <$ac_hdr>
10427 EOF
10428 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10429 { (eval echo configure:10430: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10430 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10431 if test -z "$ac_err"; then
10432   rm -rf conftest*
10433   eval "ac_cv_header_$ac_safe=yes"
10434 else
10435   echo "$ac_err" >&5
10436   echo "configure: failed program was:" >&5
10437   cat conftest.$ac_ext >&5
10438   rm -rf conftest*
10439   eval "ac_cv_header_$ac_safe=no"
10440 fi
10441 rm -f conftest*
10442 fi
10443 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10444   echo "$ac_t""yes" 1>&6
10445     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10446   cat >> confdefs.h <<EOF
10447 #define $ac_tr_hdr 1
10448 EOF
10449  
10450 else
10451   echo "$ac_t""no" 1>&6
10452 fi
10453 done
10454
10455
10456 if test $ol_link_termcap = no ; then
10457         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
10458 echo "configure:10459: checking for tputs in -ltermcap" >&5
10459 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
10460 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10461   echo $ac_n "(cached) $ac_c" 1>&6
10462 else
10463   ac_save_LIBS="$LIBS"
10464 LIBS="-ltermcap  $LIBS"
10465 cat > conftest.$ac_ext <<EOF
10466 #line 10467 "configure"
10467 #include "confdefs.h"
10468 /* Override any gcc2 internal prototype to avoid an error.  */
10469 /* We use char because int might match the return type of a gcc2
10470     builtin and then its argument prototype would still apply.  */
10471 char tputs();
10472
10473 int main() {
10474 tputs()
10475 ; return 0; }
10476 EOF
10477 if { (eval echo configure:10478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10478   rm -rf conftest*
10479   eval "ac_cv_lib_$ac_lib_var=yes"
10480 else
10481   echo "configure: failed program was:" >&5
10482   cat conftest.$ac_ext >&5
10483   rm -rf conftest*
10484   eval "ac_cv_lib_$ac_lib_var=no"
10485 fi
10486 rm -f conftest*
10487 LIBS="$ac_save_LIBS"
10488
10489 fi
10490 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10491   echo "$ac_t""yes" 1>&6
10492   have_termcap=yes
10493 else
10494   echo "$ac_t""no" 1>&6
10495 have_termcap=no
10496 fi
10497
10498         if test $have_termcap = yes ; then
10499                 cat >> confdefs.h <<\EOF
10500 #define HAVE_TERMCAP 1
10501 EOF
10502
10503                 ol_link_termcap=yes
10504                 TERMCAP_LIBS=-ltermcap
10505         fi
10506 fi
10507
10508 if test $ol_link_termcap = no ; then
10509         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
10510 echo "configure:10511: checking for initscr in -lncurses" >&5
10511 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
10512 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10513   echo $ac_n "(cached) $ac_c" 1>&6
10514 else
10515   ac_save_LIBS="$LIBS"
10516 LIBS="-lncurses  $LIBS"
10517 cat > conftest.$ac_ext <<EOF
10518 #line 10519 "configure"
10519 #include "confdefs.h"
10520 /* Override any gcc2 internal prototype to avoid an error.  */
10521 /* We use char because int might match the return type of a gcc2
10522     builtin and then its argument prototype would still apply.  */
10523 char initscr();
10524
10525 int main() {
10526 initscr()
10527 ; return 0; }
10528 EOF
10529 if { (eval echo configure:10530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10530   rm -rf conftest*
10531   eval "ac_cv_lib_$ac_lib_var=yes"
10532 else
10533   echo "configure: failed program was:" >&5
10534   cat conftest.$ac_ext >&5
10535   rm -rf conftest*
10536   eval "ac_cv_lib_$ac_lib_var=no"
10537 fi
10538 rm -f conftest*
10539 LIBS="$ac_save_LIBS"
10540
10541 fi
10542 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10543   echo "$ac_t""yes" 1>&6
10544   have_ncurses=yes
10545 else
10546   echo "$ac_t""no" 1>&6
10547 have_ncurses=no
10548 fi
10549
10550         if test $have_ncurses = yes ; then
10551                 cat >> confdefs.h <<\EOF
10552 #define HAVE_NCURSES 1
10553 EOF
10554
10555                 ol_link_termcap=yes
10556                 TERMCAP_LIBS=-lncurses
10557         fi
10558 fi
10559
10560 if test $ol_link_termcap = no ; then
10561         cat >> confdefs.h <<\EOF
10562 #define NO_TERMCAP 1
10563 EOF
10564
10565         TERMCAP_LIBS=
10566 fi
10567
10568 ol_link_sasl=no
10569 if test $ol_with_cyrus_sasl != no ; then
10570         ac_safe=`echo "sasl.h" | sed 'y%./+-%__p_%'`
10571 echo $ac_n "checking for sasl.h""... $ac_c" 1>&6
10572 echo "configure:10573: checking for sasl.h" >&5
10573 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10574   echo $ac_n "(cached) $ac_c" 1>&6
10575 else
10576   cat > conftest.$ac_ext <<EOF
10577 #line 10578 "configure"
10578 #include "confdefs.h"
10579 #include <sasl.h>
10580 EOF
10581 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10582 { (eval echo configure:10583: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10583 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10584 if test -z "$ac_err"; then
10585   rm -rf conftest*
10586   eval "ac_cv_header_$ac_safe=yes"
10587 else
10588   echo "$ac_err" >&5
10589   echo "configure: failed program was:" >&5
10590   cat conftest.$ac_ext >&5
10591   rm -rf conftest*
10592   eval "ac_cv_header_$ac_safe=no"
10593 fi
10594 rm -f conftest*
10595 fi
10596 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10597   echo "$ac_t""yes" 1>&6
10598   :
10599 else
10600   echo "$ac_t""no" 1>&6
10601 fi
10602
10603
10604         if test $ac_cv_header_sasl_h = yes ; then
10605                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
10606 echo "configure:10607: checking for sasl_client_init in -lsasl" >&5
10607 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
10608 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10609   echo $ac_n "(cached) $ac_c" 1>&6
10610 else
10611   ac_save_LIBS="$LIBS"
10612 LIBS="-lsasl  $LIBS"
10613 cat > conftest.$ac_ext <<EOF
10614 #line 10615 "configure"
10615 #include "confdefs.h"
10616 /* Override any gcc2 internal prototype to avoid an error.  */
10617 /* We use char because int might match the return type of a gcc2
10618     builtin and then its argument prototype would still apply.  */
10619 char sasl_client_init();
10620
10621 int main() {
10622 sasl_client_init()
10623 ; return 0; }
10624 EOF
10625 if { (eval echo configure:10626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10626   rm -rf conftest*
10627   eval "ac_cv_lib_$ac_lib_var=yes"
10628 else
10629   echo "configure: failed program was:" >&5
10630   cat conftest.$ac_ext >&5
10631   rm -rf conftest*
10632   eval "ac_cv_lib_$ac_lib_var=no"
10633 fi
10634 rm -f conftest*
10635 LIBS="$ac_save_LIBS"
10636
10637 fi
10638 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10639   echo "$ac_t""yes" 1>&6
10640   have_cyrus_sasl=yes
10641 else
10642   echo "$ac_t""no" 1>&6
10643 have_cyrus_sasl=no
10644 fi
10645
10646
10647                 if test $have_cyrus_sasl != no ; then
10648                         SASL_LIBS="-lsasl"
10649                         cat >> confdefs.h <<\EOF
10650 #define HAVE_CYRUS_SASL 1
10651 EOF
10652
10653                         ol_link_sasl=yes
10654                 fi
10655         fi
10656
10657         if test $ol_link_sasl = no -a $ol_with_cyrus_sasl = yes ; then
10658                 { echo "configure: error: no suitable API for --with-cyrus-sasl=$ol_with_cyrus_sasl" 1>&2; exit 1; }
10659         fi
10660 fi
10661
10662 ol_link_fetch=no
10663 if test $ol_with_fetch != no ; then
10664         ol=$LIBS
10665 LIBS="-lfetch -lcom_err $LIBS"
10666 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
10667 echo "configure:10668: checking fetch(3) library" >&5
10668 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
10669   echo $ac_n "(cached) $ac_c" 1>&6
10670 else
10671   
10672         cat > conftest.$ac_ext <<EOF
10673 #line 10674 "configure"
10674 #include "confdefs.h"
10675
10676 #include <sys/param.h>
10677 #include <stdio.h>
10678 #include <fetch.h>
10679 int main() {
10680 struct url *u = fetchParseURL("file:///"); 
10681 ; return 0; }
10682 EOF
10683 if { (eval echo configure:10684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10684   rm -rf conftest*
10685   ol_cv_lib_fetch=yes
10686 else
10687   echo "configure: failed program was:" >&5
10688   cat conftest.$ac_ext >&5
10689   rm -rf conftest*
10690   ol_cv_lib_fetch=no
10691 fi
10692 rm -f conftest*
10693 fi
10694
10695 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
10696 LIBS=$ol_LIBS
10697 if test $ol_cv_lib_fetch != no ; then
10698         ol_link_fetch="-lfetch -lcom_err"
10699         cat >> confdefs.h <<\EOF
10700 #define HAVE_FETCH 1
10701 EOF
10702
10703 fi
10704
10705
10706         if test $ol_cv_lib_fetch != no ; then
10707                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
10708                 ol_link_fetch=freebsd
10709
10710         elif test $ol_with_fetch != auto ; then
10711                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
10712         fi 
10713 fi
10714
10715 ol_link_readline=no
10716 if test $ol_with_readline != no ; then
10717         for ac_hdr in readline/readline.h readline/history.h
10718 do
10719 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10720 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10721 echo "configure:10722: checking for $ac_hdr" >&5
10722 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10723   echo $ac_n "(cached) $ac_c" 1>&6
10724 else
10725   cat > conftest.$ac_ext <<EOF
10726 #line 10727 "configure"
10727 #include "confdefs.h"
10728 #include <$ac_hdr>
10729 EOF
10730 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10731 { (eval echo configure:10732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10732 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10733 if test -z "$ac_err"; then
10734   rm -rf conftest*
10735   eval "ac_cv_header_$ac_safe=yes"
10736 else
10737   echo "$ac_err" >&5
10738   echo "configure: failed program was:" >&5
10739   cat conftest.$ac_ext >&5
10740   rm -rf conftest*
10741   eval "ac_cv_header_$ac_safe=no"
10742 fi
10743 rm -f conftest*
10744 fi
10745 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10746   echo "$ac_t""yes" 1>&6
10747     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10748   cat >> confdefs.h <<EOF
10749 #define $ac_tr_hdr 1
10750 EOF
10751  
10752 else
10753   echo "$ac_t""no" 1>&6
10754 fi
10755 done
10756
10757
10758         if test $ac_cv_header_readline_readline_h = yes ; then
10759                 save_LIBS="$LIBS"
10760                 LIBS="$TERMCAP_LIBS $LIBS"
10761                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
10762 echo "configure:10763: checking for readline in -lreadline" >&5
10763 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
10764 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10765   echo $ac_n "(cached) $ac_c" 1>&6
10766 else
10767   ac_save_LIBS="$LIBS"
10768 LIBS="-lreadline  $LIBS"
10769 cat > conftest.$ac_ext <<EOF
10770 #line 10771 "configure"
10771 #include "confdefs.h"
10772 /* Override any gcc2 internal prototype to avoid an error.  */
10773 /* We use char because int might match the return type of a gcc2
10774     builtin and then its argument prototype would still apply.  */
10775 char readline();
10776
10777 int main() {
10778 readline()
10779 ; return 0; }
10780 EOF
10781 if { (eval echo configure:10782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10782   rm -rf conftest*
10783   eval "ac_cv_lib_$ac_lib_var=yes"
10784 else
10785   echo "configure: failed program was:" >&5
10786   cat conftest.$ac_ext >&5
10787   rm -rf conftest*
10788   eval "ac_cv_lib_$ac_lib_var=no"
10789 fi
10790 rm -f conftest*
10791 LIBS="$ac_save_LIBS"
10792
10793 fi
10794 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10795   echo "$ac_t""yes" 1>&6
10796   have_readline=yes
10797 else
10798   echo "$ac_t""no" 1>&6
10799 have_readline=no
10800 fi
10801
10802                 LIBS="$save_LIBS"
10803                         
10804                 if test $have_readline = yes ; then
10805                         ol_with_readline=found
10806                         ol_link_readline=yes
10807
10808                         READLINE_LIBS="-lreadline"
10809                 fi
10810         fi
10811 fi
10812
10813 if test $ol_link_readline = yes ; then
10814         cat >> confdefs.h <<\EOF
10815 #define HAVE_READLINE 1
10816 EOF
10817
10818 fi
10819
10820
10821 # FreeBSD (and others) have crypt(3) in -lcrypt
10822 if test $ol_enable_crypt != no ; then
10823         echo $ac_n "checking for crypt""... $ac_c" 1>&6
10824 echo "configure:10825: checking for crypt" >&5
10825 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
10826   echo $ac_n "(cached) $ac_c" 1>&6
10827 else
10828   cat > conftest.$ac_ext <<EOF
10829 #line 10830 "configure"
10830 #include "confdefs.h"
10831 /* System header to define __stub macros and hopefully few prototypes,
10832     which can conflict with char crypt(); below.  */
10833 #include <assert.h>
10834 /* Override any gcc2 internal prototype to avoid an error.  */
10835 /* We use char because int might match the return type of a gcc2
10836     builtin and then its argument prototype would still apply.  */
10837 char crypt();
10838 char (*f)();
10839
10840 int main() {
10841
10842 /* The GNU C library defines this for functions which it implements
10843     to always fail with ENOSYS.  Some functions are actually named
10844     something starting with __ and the normal name is an alias.  */
10845 #if defined (__stub_crypt) || defined (__stub___crypt)
10846 choke me
10847 #else
10848 f = crypt;
10849 #endif
10850
10851 ; return 0; }
10852 EOF
10853 if { (eval echo configure:10854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10854   rm -rf conftest*
10855   eval "ac_cv_func_crypt=yes"
10856 else
10857   echo "configure: failed program was:" >&5
10858   cat conftest.$ac_ext >&5
10859   rm -rf conftest*
10860   eval "ac_cv_func_crypt=no"
10861 fi
10862 rm -f conftest*
10863 fi
10864
10865 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
10866   echo "$ac_t""yes" 1>&6
10867   have_crypt=yes
10868 else
10869   echo "$ac_t""no" 1>&6
10870
10871                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
10872 echo "configure:10873: checking for crypt in -lcrypt" >&5
10873 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
10874 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10875   echo $ac_n "(cached) $ac_c" 1>&6
10876 else
10877   ac_save_LIBS="$LIBS"
10878 LIBS="-lcrypt  $LIBS"
10879 cat > conftest.$ac_ext <<EOF
10880 #line 10881 "configure"
10881 #include "confdefs.h"
10882 /* Override any gcc2 internal prototype to avoid an error.  */
10883 /* We use char because int might match the return type of a gcc2
10884     builtin and then its argument prototype would still apply.  */
10885 char crypt();
10886
10887 int main() {
10888 crypt()
10889 ; return 0; }
10890 EOF
10891 if { (eval echo configure:10892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10892   rm -rf conftest*
10893   eval "ac_cv_lib_$ac_lib_var=yes"
10894 else
10895   echo "configure: failed program was:" >&5
10896   cat conftest.$ac_ext >&5
10897   rm -rf conftest*
10898   eval "ac_cv_lib_$ac_lib_var=no"
10899 fi
10900 rm -f conftest*
10901 LIBS="$ac_save_LIBS"
10902
10903 fi
10904 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10905   echo "$ac_t""yes" 1>&6
10906   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
10907                         have_crypt=yes
10908 else
10909   echo "$ac_t""no" 1>&6
10910 have_crypt=no
10911 fi
10912
10913 fi
10914
10915
10916         if test $have_crypt = yes ; then
10917                 cat >> confdefs.h <<\EOF
10918 #define HAVE_CRYPT 1
10919 EOF
10920
10921         else
10922                 echo "configure: warning: could not find crypt" 1>&2
10923                 if test $ol_enable_crypt = yes ; then
10924                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
10925                 fi
10926
10927                 echo "configure: warning: disabling crypt support" 1>&2
10928                 ol_enable_crypt=no
10929         fi
10930 fi
10931
10932 # FreeBSD (and others) have setproctitle(3) in -lutil
10933 if test $ol_enable_proctitle != no ; then
10934         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
10935 echo "configure:10936: checking for setproctitle" >&5
10936 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
10937   echo $ac_n "(cached) $ac_c" 1>&6
10938 else
10939   cat > conftest.$ac_ext <<EOF
10940 #line 10941 "configure"
10941 #include "confdefs.h"
10942 /* System header to define __stub macros and hopefully few prototypes,
10943     which can conflict with char setproctitle(); below.  */
10944 #include <assert.h>
10945 /* Override any gcc2 internal prototype to avoid an error.  */
10946 /* We use char because int might match the return type of a gcc2
10947     builtin and then its argument prototype would still apply.  */
10948 char setproctitle();
10949 char (*f)();
10950
10951 int main() {
10952
10953 /* The GNU C library defines this for functions which it implements
10954     to always fail with ENOSYS.  Some functions are actually named
10955     something starting with __ and the normal name is an alias.  */
10956 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
10957 choke me
10958 #else
10959 f = setproctitle;
10960 #endif
10961
10962 ; return 0; }
10963 EOF
10964 if { (eval echo configure:10965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10965   rm -rf conftest*
10966   eval "ac_cv_func_setproctitle=yes"
10967 else
10968   echo "configure: failed program was:" >&5
10969   cat conftest.$ac_ext >&5
10970   rm -rf conftest*
10971   eval "ac_cv_func_setproctitle=no"
10972 fi
10973 rm -f conftest*
10974 fi
10975
10976 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
10977   echo "$ac_t""yes" 1>&6
10978   have_setproctitle=yes
10979 else
10980   echo "$ac_t""no" 1>&6
10981
10982                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
10983 echo "configure:10984: checking for setproctitle in -lutil" >&5
10984 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
10985 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10986   echo $ac_n "(cached) $ac_c" 1>&6
10987 else
10988   ac_save_LIBS="$LIBS"
10989 LIBS="-lutil  $LIBS"
10990 cat > conftest.$ac_ext <<EOF
10991 #line 10992 "configure"
10992 #include "confdefs.h"
10993 /* Override any gcc2 internal prototype to avoid an error.  */
10994 /* We use char because int might match the return type of a gcc2
10995     builtin and then its argument prototype would still apply.  */
10996 char setproctitle();
10997
10998 int main() {
10999 setproctitle()
11000 ; return 0; }
11001 EOF
11002 if { (eval echo configure:11003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11003   rm -rf conftest*
11004   eval "ac_cv_lib_$ac_lib_var=yes"
11005 else
11006   echo "configure: failed program was:" >&5
11007   cat conftest.$ac_ext >&5
11008   rm -rf conftest*
11009   eval "ac_cv_lib_$ac_lib_var=no"
11010 fi
11011 rm -f conftest*
11012 LIBS="$ac_save_LIBS"
11013
11014 fi
11015 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11016   echo "$ac_t""yes" 1>&6
11017   have_setproctitle=yes
11018                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
11019 else
11020   echo "$ac_t""no" 1>&6
11021 have_setproctitle=no
11022                         LIBOBJS="$LIBOBJS setproctitle.o"
11023 fi
11024
11025 fi
11026
11027
11028         if test $have_setproctitle = yes ; then
11029                 cat >> confdefs.h <<\EOF
11030 #define HAVE_SETPROCTITLE 1
11031 EOF
11032
11033         fi
11034 fi
11035
11036 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
11037 echo "configure:11038: checking for uid_t in sys/types.h" >&5
11038 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
11039   echo $ac_n "(cached) $ac_c" 1>&6
11040 else
11041   cat > conftest.$ac_ext <<EOF
11042 #line 11043 "configure"
11043 #include "confdefs.h"
11044 #include <sys/types.h>
11045 EOF
11046 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11047   egrep "uid_t" >/dev/null 2>&1; then
11048   rm -rf conftest*
11049   ac_cv_type_uid_t=yes
11050 else
11051   rm -rf conftest*
11052   ac_cv_type_uid_t=no
11053 fi
11054 rm -f conftest*
11055
11056 fi
11057
11058 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
11059 if test $ac_cv_type_uid_t = no; then
11060   cat >> confdefs.h <<\EOF
11061 #define uid_t int
11062 EOF
11063
11064   cat >> confdefs.h <<\EOF
11065 #define gid_t int
11066 EOF
11067
11068 fi
11069
11070 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
11071 echo "configure:11072: checking type of array argument to getgroups" >&5
11072 if eval "test \"\${ac_cv_type_getgroups+set}\" = set"; then
11073   echo $ac_n "(cached) $ac_c" 1>&6
11074 else
11075   if test "$cross_compiling" = yes; then
11076   ac_cv_type_getgroups=cross
11077 else
11078   cat > conftest.$ac_ext <<EOF
11079 #line 11080 "configure"
11080 #include "confdefs.h"
11081
11082 /* Thanks to Mike Rendell for this test.  */
11083 #include <sys/types.h>
11084 #define NGID 256
11085 #undef MAX
11086 #define MAX(x, y) ((x) > (y) ? (x) : (y))
11087 main()
11088 {
11089   gid_t gidset[NGID];
11090   int i, n;
11091   union { gid_t gval; long lval; }  val;
11092
11093   val.lval = -1;
11094   for (i = 0; i < NGID; i++)
11095     gidset[i] = val.gval;
11096   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
11097                  gidset);
11098   /* Exit non-zero if getgroups seems to require an array of ints.  This
11099      happens when gid_t is short but getgroups modifies an array of ints.  */
11100   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
11101 }
11102
11103 EOF
11104 if { (eval echo configure:11105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11105 then
11106     ac_cv_type_getgroups=gid_t
11107 else
11108   echo "configure: failed program was:" >&5
11109   cat conftest.$ac_ext >&5
11110   rm -fr conftest*
11111   ac_cv_type_getgroups=int
11112 fi
11113 rm -fr conftest*
11114 fi
11115
11116 if test $ac_cv_type_getgroups = cross; then
11117         cat > conftest.$ac_ext <<EOF
11118 #line 11119 "configure"
11119 #include "confdefs.h"
11120 #include <unistd.h>
11121 EOF
11122 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11123   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
11124   rm -rf conftest*
11125   ac_cv_type_getgroups=gid_t
11126 else
11127   rm -rf conftest*
11128   ac_cv_type_getgroups=int
11129 fi
11130 rm -f conftest*
11131
11132 fi
11133 fi
11134
11135 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
11136 cat >> confdefs.h <<EOF
11137 #define GETGROUPS_T $ac_cv_type_getgroups
11138 EOF
11139
11140  echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
11141 echo "configure:11142: checking for ANSI C header files" >&5
11142 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
11143   echo $ac_n "(cached) $ac_c" 1>&6
11144 else
11145   cat > conftest.$ac_ext <<EOF
11146 #line 11147 "configure"
11147 #include "confdefs.h"
11148 #include <stdlib.h>
11149 #include <stdarg.h>
11150 #include <string.h>
11151 #include <float.h>
11152 EOF
11153 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11154 { (eval echo configure:11155: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11155 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11156 if test -z "$ac_err"; then
11157   rm -rf conftest*
11158   ac_cv_header_stdc=yes
11159 else
11160   echo "$ac_err" >&5
11161   echo "configure: failed program was:" >&5
11162   cat conftest.$ac_ext >&5
11163   rm -rf conftest*
11164   ac_cv_header_stdc=no
11165 fi
11166 rm -f conftest*
11167
11168 if test $ac_cv_header_stdc = yes; then
11169   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
11170 cat > conftest.$ac_ext <<EOF
11171 #line 11172 "configure"
11172 #include "confdefs.h"
11173 #include <string.h>
11174 EOF
11175 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11176   egrep "memchr" >/dev/null 2>&1; then
11177   :
11178 else
11179   rm -rf conftest*
11180   ac_cv_header_stdc=no
11181 fi
11182 rm -f conftest*
11183
11184 fi
11185
11186 if test $ac_cv_header_stdc = yes; then
11187   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
11188 cat > conftest.$ac_ext <<EOF
11189 #line 11190 "configure"
11190 #include "confdefs.h"
11191 #include <stdlib.h>
11192 EOF
11193 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11194   egrep "free" >/dev/null 2>&1; then
11195   :
11196 else
11197   rm -rf conftest*
11198   ac_cv_header_stdc=no
11199 fi
11200 rm -f conftest*
11201
11202 fi
11203
11204 if test $ac_cv_header_stdc = yes; then
11205   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
11206 if test "$cross_compiling" = yes; then
11207   :
11208 else
11209   cat > conftest.$ac_ext <<EOF
11210 #line 11211 "configure"
11211 #include "confdefs.h"
11212 #include <ctype.h>
11213 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
11214 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
11215 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
11216 int main () { int i; for (i = 0; i < 256; i++)
11217 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
11218 exit (0); }
11219
11220 EOF
11221 if { (eval echo configure:11222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11222 then
11223   :
11224 else
11225   echo "configure: failed program was:" >&5
11226   cat conftest.$ac_ext >&5
11227   rm -fr conftest*
11228   ac_cv_header_stdc=no
11229 fi
11230 rm -fr conftest*
11231 fi
11232
11233 fi
11234 fi
11235
11236 echo "$ac_t""$ac_cv_header_stdc" 1>&6
11237 if test $ac_cv_header_stdc = yes; then
11238   cat >> confdefs.h <<\EOF
11239 #define STDC_HEADERS 1
11240 EOF
11241
11242 fi
11243
11244 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
11245 echo "configure:11246: checking for mode_t" >&5
11246 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
11247   echo $ac_n "(cached) $ac_c" 1>&6
11248 else
11249   cat > conftest.$ac_ext <<EOF
11250 #line 11251 "configure"
11251 #include "confdefs.h"
11252 #include <sys/types.h>
11253 #if STDC_HEADERS
11254 #include <stdlib.h>
11255 #include <stddef.h>
11256 #endif
11257 EOF
11258 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11259   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
11260   rm -rf conftest*
11261   eval "ac_cv_type_mode_t=yes"
11262 else
11263   rm -rf conftest*
11264   eval "ac_cv_type_mode_t=no"
11265 fi
11266 rm -f conftest*
11267
11268 fi
11269 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
11270   echo "$ac_t""yes" 1>&6
11271 else
11272   echo "$ac_t""no" 1>&6
11273   cat >> confdefs.h <<EOF
11274 #define mode_t int
11275 EOF
11276
11277 fi
11278
11279 echo $ac_n "checking for off_t""... $ac_c" 1>&6
11280 echo "configure:11281: checking for off_t" >&5
11281 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
11282   echo $ac_n "(cached) $ac_c" 1>&6
11283 else
11284   cat > conftest.$ac_ext <<EOF
11285 #line 11286 "configure"
11286 #include "confdefs.h"
11287 #include <sys/types.h>
11288 #if STDC_HEADERS
11289 #include <stdlib.h>
11290 #include <stddef.h>
11291 #endif
11292 EOF
11293 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11294   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
11295   rm -rf conftest*
11296   eval "ac_cv_type_off_t=yes"
11297 else
11298   rm -rf conftest*
11299   eval "ac_cv_type_off_t=no"
11300 fi
11301 rm -f conftest*
11302
11303 fi
11304 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
11305   echo "$ac_t""yes" 1>&6
11306 else
11307   echo "$ac_t""no" 1>&6
11308   cat >> confdefs.h <<EOF
11309 #define off_t long
11310 EOF
11311
11312 fi
11313
11314 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
11315 echo "configure:11316: checking for pid_t" >&5
11316 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
11317   echo $ac_n "(cached) $ac_c" 1>&6
11318 else
11319   cat > conftest.$ac_ext <<EOF
11320 #line 11321 "configure"
11321 #include "confdefs.h"
11322 #include <sys/types.h>
11323 #if STDC_HEADERS
11324 #include <stdlib.h>
11325 #include <stddef.h>
11326 #endif
11327 EOF
11328 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11329   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
11330   rm -rf conftest*
11331   eval "ac_cv_type_pid_t=yes"
11332 else
11333   rm -rf conftest*
11334   eval "ac_cv_type_pid_t=no"
11335 fi
11336 rm -f conftest*
11337
11338 fi
11339 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
11340   echo "$ac_t""yes" 1>&6
11341 else
11342   echo "$ac_t""no" 1>&6
11343   cat >> confdefs.h <<EOF
11344 #define pid_t int
11345 EOF
11346
11347 fi
11348
11349 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
11350 echo "configure:11351: checking for ptrdiff_t" >&5
11351 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
11352   echo $ac_n "(cached) $ac_c" 1>&6
11353 else
11354   cat > conftest.$ac_ext <<EOF
11355 #line 11356 "configure"
11356 #include "confdefs.h"
11357 #include <stddef.h>
11358 int main() {
11359 ptrdiff_t p
11360 ; return 0; }
11361 EOF
11362 if { (eval echo configure:11363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11363   rm -rf conftest*
11364   am_cv_type_ptrdiff_t=yes
11365 else
11366   echo "configure: failed program was:" >&5
11367   cat conftest.$ac_ext >&5
11368   rm -rf conftest*
11369   am_cv_type_ptrdiff_t=no
11370 fi
11371 rm -f conftest*
11372 fi
11373
11374 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
11375    if test $am_cv_type_ptrdiff_t = yes; then
11376      cat >> confdefs.h <<\EOF
11377 #define HAVE_PTRDIFF_T 1
11378 EOF
11379
11380    fi
11381
11382 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
11383 echo "configure:11384: checking return type of signal handlers" >&5
11384 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
11385   echo $ac_n "(cached) $ac_c" 1>&6
11386 else
11387   cat > conftest.$ac_ext <<EOF
11388 #line 11389 "configure"
11389 #include "confdefs.h"
11390 #include <sys/types.h>
11391 #include <signal.h>
11392 #ifdef signal
11393 #undef signal
11394 #endif
11395 #ifdef __cplusplus
11396 extern "C" void (*signal (int, void (*)(int)))(int);
11397 #else
11398 void (*signal ()) ();
11399 #endif
11400
11401 int main() {
11402 int i;
11403 ; return 0; }
11404 EOF
11405 if { (eval echo configure:11406: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11406   rm -rf conftest*
11407   ac_cv_type_signal=void
11408 else
11409   echo "configure: failed program was:" >&5
11410   cat conftest.$ac_ext >&5
11411   rm -rf conftest*
11412   ac_cv_type_signal=int
11413 fi
11414 rm -f conftest*
11415 fi
11416
11417 echo "$ac_t""$ac_cv_type_signal" 1>&6
11418 cat >> confdefs.h <<EOF
11419 #define RETSIGTYPE $ac_cv_type_signal
11420 EOF
11421
11422
11423 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
11424 echo "configure:11425: checking for sig_atomic_t" >&5
11425 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
11426   echo $ac_n "(cached) $ac_c" 1>&6
11427 else
11428   cat > conftest.$ac_ext <<EOF
11429 #line 11430 "configure"
11430 #include "confdefs.h"
11431 #include <signal.h>
11432 int main() {
11433 sig_atomic_t atomic;
11434 ; return 0; }
11435 EOF
11436 if { (eval echo configure:11437: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11437   rm -rf conftest*
11438   ol_cv_type_sig_atomic_t=yes
11439 else
11440   echo "configure: failed program was:" >&5
11441   cat conftest.$ac_ext >&5
11442   rm -rf conftest*
11443   ol_cv_type_sig_atomic_t=no
11444 fi
11445 rm -f conftest*
11446 fi
11447
11448 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
11449   if test $ol_cv_type_sig_atomic_t = no; then
11450     cat >> confdefs.h <<\EOF
11451 #define sig_atomic_t int
11452 EOF
11453
11454   fi
11455  
11456 echo $ac_n "checking for size_t""... $ac_c" 1>&6
11457 echo "configure:11458: checking for size_t" >&5
11458 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
11459   echo $ac_n "(cached) $ac_c" 1>&6
11460 else
11461   cat > conftest.$ac_ext <<EOF
11462 #line 11463 "configure"
11463 #include "confdefs.h"
11464 #include <sys/types.h>
11465 #if STDC_HEADERS
11466 #include <stdlib.h>
11467 #include <stddef.h>
11468 #endif
11469 EOF
11470 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11471   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
11472   rm -rf conftest*
11473   eval "ac_cv_type_size_t=yes"
11474 else
11475   rm -rf conftest*
11476   eval "ac_cv_type_size_t=no"
11477 fi
11478 rm -f conftest*
11479
11480 fi
11481 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
11482   echo "$ac_t""yes" 1>&6
11483 else
11484   echo "$ac_t""no" 1>&6
11485   cat >> confdefs.h <<EOF
11486 #define size_t unsigned
11487 EOF
11488
11489 fi
11490
11491 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
11492 echo "configure:11493: checking for socklen_t" >&5
11493 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
11494   echo $ac_n "(cached) $ac_c" 1>&6
11495 else
11496   cat > conftest.$ac_ext <<EOF
11497 #line 11498 "configure"
11498 #include "confdefs.h"
11499
11500 #ifdef HAVE_SYS_TYPES_H
11501 #include <sys/types.h>
11502 #endif
11503 #ifdef HAVE_SYS_SOCKET_H
11504 #include <sys/socket.h>
11505 #endif
11506
11507 int main() {
11508 socklen_t len;
11509 ; return 0; }
11510 EOF
11511 if { (eval echo configure:11512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11512   rm -rf conftest*
11513   ol_cv_type_socklen_t=yes
11514 else
11515   echo "configure: failed program was:" >&5
11516   cat conftest.$ac_ext >&5
11517   rm -rf conftest*
11518   ol_cv_type_socklen_t=no
11519 fi
11520 rm -f conftest*
11521 fi
11522
11523 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
11524   if test $ol_cv_type_socklen_t = no; then
11525     cat >> confdefs.h <<\EOF
11526 #define socklen_t int
11527 EOF
11528
11529   fi
11530  
11531 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
11532 echo "configure:11533: checking for member st_blksize in aggregate type struct stat" >&5
11533 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
11534   echo $ac_n "(cached) $ac_c" 1>&6
11535 else
11536   cat > conftest.$ac_ext <<EOF
11537 #line 11538 "configure"
11538 #include "confdefs.h"
11539 #include <sys/types.h>
11540 #include <sys/stat.h>
11541 int main() {
11542 struct stat foo; foo.st_blksize;
11543 ; return 0; }
11544 EOF
11545 if { (eval echo configure:11546: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11546   rm -rf conftest*
11547   ac_cv_c_struct_member_st_blksize=yes
11548 else
11549   echo "configure: failed program was:" >&5
11550   cat conftest.$ac_ext >&5
11551   rm -rf conftest*
11552   ac_cv_c_struct_member_st_blksize=no
11553 fi
11554 rm -f conftest*
11555 fi
11556
11557 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
11558 st_blksize="$ac_cv_c_struct_member_st_blksize"
11559 if test $ac_cv_c_struct_member_st_blksize = yes; then
11560   cat >> confdefs.h <<\EOF
11561 #define HAVE_ST_BLKSIZE 1
11562 EOF
11563
11564 fi
11565
11566 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
11567 echo "configure:11568: checking whether time.h and sys/time.h may both be included" >&5
11568 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
11569   echo $ac_n "(cached) $ac_c" 1>&6
11570 else
11571   cat > conftest.$ac_ext <<EOF
11572 #line 11573 "configure"
11573 #include "confdefs.h"
11574 #include <sys/types.h>
11575 #include <sys/time.h>
11576 #include <time.h>
11577 int main() {
11578 struct tm *tp;
11579 ; return 0; }
11580 EOF
11581 if { (eval echo configure:11582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11582   rm -rf conftest*
11583   ac_cv_header_time=yes
11584 else
11585   echo "configure: failed program was:" >&5
11586   cat conftest.$ac_ext >&5
11587   rm -rf conftest*
11588   ac_cv_header_time=no
11589 fi
11590 rm -f conftest*
11591 fi
11592
11593 echo "$ac_t""$ac_cv_header_time" 1>&6
11594 if test $ac_cv_header_time = yes; then
11595   cat >> confdefs.h <<\EOF
11596 #define TIME_WITH_SYS_TIME 1
11597 EOF
11598
11599 fi
11600
11601 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
11602 echo "configure:11603: checking whether struct tm is in sys/time.h or time.h" >&5
11603 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
11604   echo $ac_n "(cached) $ac_c" 1>&6
11605 else
11606   cat > conftest.$ac_ext <<EOF
11607 #line 11608 "configure"
11608 #include "confdefs.h"
11609 #include <sys/types.h>
11610 #include <time.h>
11611 int main() {
11612 struct tm *tp; tp->tm_sec;
11613 ; return 0; }
11614 EOF
11615 if { (eval echo configure:11616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11616   rm -rf conftest*
11617   ac_cv_struct_tm=time.h
11618 else
11619   echo "configure: failed program was:" >&5
11620   cat conftest.$ac_ext >&5
11621   rm -rf conftest*
11622   ac_cv_struct_tm=sys/time.h
11623 fi
11624 rm -f conftest*
11625 fi
11626
11627 echo "$ac_t""$ac_cv_struct_tm" 1>&6
11628 if test $ac_cv_struct_tm = sys/time.h; then
11629   cat >> confdefs.h <<\EOF
11630 #define TM_IN_SYS_TIME 1
11631 EOF
11632
11633 fi
11634
11635 # test for pw_gecos in struct passwd
11636 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
11637 echo "configure:11638: checking struct passwd for pw_gecos" >&5
11638 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
11639   echo $ac_n "(cached) $ac_c" 1>&6
11640 else
11641   
11642         cat > conftest.$ac_ext <<EOF
11643 #line 11644 "configure"
11644 #include "confdefs.h"
11645 #include <pwd.h>
11646 int main() {
11647
11648         struct passwd pwd;
11649         pwd.pw_gecos = pwd.pw_name;
11650
11651 ; return 0; }
11652 EOF
11653 if { (eval echo configure:11654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11654   rm -rf conftest*
11655   ol_cv_struct_passwd_pw_gecos=yes
11656 else
11657   echo "configure: failed program was:" >&5
11658   cat conftest.$ac_ext >&5
11659   rm -rf conftest*
11660   ol_cv_struct_passwd_pw_gecos=no
11661 fi
11662 rm -f conftest*
11663 fi
11664
11665 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
11666 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
11667         cat >> confdefs.h <<\EOF
11668 #define HAVE_PW_GECOS 1
11669 EOF
11670
11671 fi
11672
11673 # test for pw_passwd in struct passwd
11674 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
11675 echo "configure:11676: checking struct passwd for pw_passwd" >&5
11676 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
11677   echo $ac_n "(cached) $ac_c" 1>&6
11678 else
11679   
11680         cat > conftest.$ac_ext <<EOF
11681 #line 11682 "configure"
11682 #include "confdefs.h"
11683 #include <pwd.h>
11684 int main() {
11685
11686         struct passwd pwd;
11687         pwd.pw_passwd = pwd.pw_name;
11688
11689 ; return 0; }
11690 EOF
11691 if { (eval echo configure:11692: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11692   rm -rf conftest*
11693   ol_cv_struct_passwd_pw_passwd=yes
11694 else
11695   echo "configure: failed program was:" >&5
11696   cat conftest.$ac_ext >&5
11697   rm -rf conftest*
11698   ol_cv_struct_passwd_pw_passwd=no
11699 fi
11700 rm -f conftest*
11701 fi
11702
11703 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
11704 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
11705         cat >> confdefs.h <<\EOF
11706 #define HAVE_PW_PASSWD 1
11707 EOF
11708
11709 fi
11710
11711
11712 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
11713 echo "configure:11714: checking if toupper() requires islower()" >&5
11714 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
11715   echo $ac_n "(cached) $ac_c" 1>&6
11716 else
11717   
11718         if test "$cross_compiling" = yes; then
11719   ol_cv_c_upper_lower=safe
11720 else
11721   cat > conftest.$ac_ext <<EOF
11722 #line 11723 "configure"
11723 #include "confdefs.h"
11724
11725 #include <ctype.h>
11726 main()
11727 {
11728         if ('C' == toupper('C'))
11729                 exit(0);
11730         else
11731                 exit(1);
11732 }
11733 EOF
11734 if { (eval echo configure:11735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11735 then
11736   ol_cv_c_upper_lower=no
11737 else
11738   echo "configure: failed program was:" >&5
11739   cat conftest.$ac_ext >&5
11740   rm -fr conftest*
11741   ol_cv_c_upper_lower=yes
11742 fi
11743 rm -fr conftest*
11744 fi
11745
11746 fi
11747
11748 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
11749 if test $ol_cv_c_upper_lower != no ; then
11750         cat >> confdefs.h <<\EOF
11751 #define C_UPPER_LOWER 1
11752 EOF
11753
11754 fi
11755
11756 echo $ac_n "checking for working const""... $ac_c" 1>&6
11757 echo "configure:11758: checking for working const" >&5
11758 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
11759   echo $ac_n "(cached) $ac_c" 1>&6
11760 else
11761   cat > conftest.$ac_ext <<EOF
11762 #line 11763 "configure"
11763 #include "confdefs.h"
11764
11765 int main() {
11766
11767 /* Ultrix mips cc rejects this.  */
11768 typedef int charset[2]; const charset x;
11769 /* SunOS 4.1.1 cc rejects this.  */
11770 char const *const *ccp;
11771 char **p;
11772 /* NEC SVR4.0.2 mips cc rejects this.  */
11773 struct point {int x, y;};
11774 static struct point const zero = {0,0};
11775 /* AIX XL C 1.02.0.0 rejects this.
11776    It does not let you subtract one const X* pointer from another in an arm
11777    of an if-expression whose if-part is not a constant expression */
11778 const char *g = "string";
11779 ccp = &g + (g ? g-g : 0);
11780 /* HPUX 7.0 cc rejects these. */
11781 ++ccp;
11782 p = (char**) ccp;
11783 ccp = (char const *const *) p;
11784 { /* SCO 3.2v4 cc rejects this.  */
11785   char *t;
11786   char const *s = 0 ? (char *) 0 : (char const *) 0;
11787
11788   *t++ = 0;
11789 }
11790 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
11791   int x[] = {25, 17};
11792   const int *foo = &x[0];
11793   ++foo;
11794 }
11795 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
11796   typedef const int *iptr;
11797   iptr p = 0;
11798   ++p;
11799 }
11800 { /* AIX XL C 1.02.0.0 rejects this saying
11801      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
11802   struct s { int j; const int *ap[3]; };
11803   struct s *b; b->j = 5;
11804 }
11805 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
11806   const int foo = 10;
11807 }
11808
11809 ; return 0; }
11810 EOF
11811 if { (eval echo configure:11812: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11812   rm -rf conftest*
11813   ac_cv_c_const=yes
11814 else
11815   echo "configure: failed program was:" >&5
11816   cat conftest.$ac_ext >&5
11817   rm -rf conftest*
11818   ac_cv_c_const=no
11819 fi
11820 rm -f conftest*
11821 fi
11822
11823 echo "$ac_t""$ac_cv_c_const" 1>&6
11824 if test $ac_cv_c_const = no; then
11825   cat >> confdefs.h <<\EOF
11826 #define const 
11827 EOF
11828
11829 fi
11830
11831 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
11832 echo "configure:11833: checking if compiler understands volatile" >&5
11833 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
11834   echo $ac_n "(cached) $ac_c" 1>&6
11835 else
11836   cat > conftest.$ac_ext <<EOF
11837 #line 11838 "configure"
11838 #include "confdefs.h"
11839 int x, y, z;
11840 int main() {
11841 volatile int a; int * volatile b = x ? &y : &z;
11842       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
11843       *b = 0;
11844 ; return 0; }
11845 EOF
11846 if { (eval echo configure:11847: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11847   rm -rf conftest*
11848   ol_cv_c_volatile=yes
11849 else
11850   echo "configure: failed program was:" >&5
11851   cat conftest.$ac_ext >&5
11852   rm -rf conftest*
11853   ol_cv_c_volatile=no
11854 fi
11855 rm -f conftest*
11856 fi
11857
11858 echo "$ac_t""$ol_cv_c_volatile" 1>&6
11859   if test $ol_cv_c_volatile = yes; then
11860     : 
11861   else
11862     cat >> confdefs.h <<\EOF
11863 #define volatile 
11864 EOF
11865
11866   fi
11867  
11868
11869 if test $cross_compiling = yes ; then
11870         cat >> confdefs.h <<\EOF
11871 #define CROSS_COMPILING 1
11872 EOF
11873
11874
11875         cat >> confdefs.h <<\EOF
11876 #define LBER_INT_T long
11877 EOF
11878
11879         cat >> confdefs.h <<\EOF
11880 #define LBER_TAG_T long
11881 EOF
11882
11883         cat >> confdefs.h <<\EOF
11884 #define LBER_SOCKET_T int
11885 EOF
11886
11887
11888 else
11889         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
11890 echo "configure:11891: checking whether byte ordering is bigendian" >&5
11891 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
11892   echo $ac_n "(cached) $ac_c" 1>&6
11893 else
11894   ac_cv_c_bigendian=unknown
11895 # See if sys/param.h defines the BYTE_ORDER macro.
11896 cat > conftest.$ac_ext <<EOF
11897 #line 11898 "configure"
11898 #include "confdefs.h"
11899 #include <sys/types.h>
11900 #include <sys/param.h>
11901 int main() {
11902
11903 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
11904  bogus endian macros
11905 #endif
11906 ; return 0; }
11907 EOF
11908 if { (eval echo configure:11909: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11909   rm -rf conftest*
11910   # It does; now see whether it defined to BIG_ENDIAN or not.
11911 cat > conftest.$ac_ext <<EOF
11912 #line 11913 "configure"
11913 #include "confdefs.h"
11914 #include <sys/types.h>
11915 #include <sys/param.h>
11916 int main() {
11917
11918 #if BYTE_ORDER != BIG_ENDIAN
11919  not big endian
11920 #endif
11921 ; return 0; }
11922 EOF
11923 if { (eval echo configure:11924: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11924   rm -rf conftest*
11925   ac_cv_c_bigendian=yes
11926 else
11927   echo "configure: failed program was:" >&5
11928   cat conftest.$ac_ext >&5
11929   rm -rf conftest*
11930   ac_cv_c_bigendian=no
11931 fi
11932 rm -f conftest*
11933 else
11934   echo "configure: failed program was:" >&5
11935   cat conftest.$ac_ext >&5
11936 fi
11937 rm -f conftest*
11938 if test $ac_cv_c_bigendian = unknown; then
11939 if test "$cross_compiling" = yes; then
11940     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
11941 else
11942   cat > conftest.$ac_ext <<EOF
11943 #line 11944 "configure"
11944 #include "confdefs.h"
11945 main () {
11946   /* Are we little or big endian?  From Harbison&Steele.  */
11947   union
11948   {
11949     long l;
11950     char c[sizeof (long)];
11951   } u;
11952   u.l = 1;
11953   exit (u.c[sizeof (long) - 1] == 1);
11954 }
11955 EOF
11956 if { (eval echo configure:11957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11957 then
11958   ac_cv_c_bigendian=no
11959 else
11960   echo "configure: failed program was:" >&5
11961   cat conftest.$ac_ext >&5
11962   rm -fr conftest*
11963   ac_cv_c_bigendian=yes
11964 fi
11965 rm -fr conftest*
11966 fi
11967
11968 fi
11969 fi
11970
11971 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
11972 if test $ac_cv_c_bigendian = yes; then
11973   cat >> confdefs.h <<\EOF
11974 #define WORDS_BIGENDIAN 1
11975 EOF
11976
11977 fi
11978
11979         echo $ac_n "checking size of short""... $ac_c" 1>&6
11980 echo "configure:11981: checking size of short" >&5
11981 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
11982   echo $ac_n "(cached) $ac_c" 1>&6
11983 else
11984   if test "$cross_compiling" = yes; then
11985     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
11986 else
11987   cat > conftest.$ac_ext <<EOF
11988 #line 11989 "configure"
11989 #include "confdefs.h"
11990 #include <stdio.h>
11991 main()
11992 {
11993   FILE *f=fopen("conftestval", "w");
11994   if (!f) exit(1);
11995   fprintf(f, "%d\n", sizeof(short));
11996   exit(0);
11997 }
11998 EOF
11999 if { (eval echo configure:12000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12000 then
12001   ac_cv_sizeof_short=`cat conftestval`
12002 else
12003   echo "configure: failed program was:" >&5
12004   cat conftest.$ac_ext >&5
12005   rm -fr conftest*
12006   ac_cv_sizeof_short=0
12007 fi
12008 rm -fr conftest*
12009 fi
12010
12011 fi
12012 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
12013 cat >> confdefs.h <<EOF
12014 #define SIZEOF_SHORT $ac_cv_sizeof_short
12015 EOF
12016
12017  
12018         echo $ac_n "checking size of int""... $ac_c" 1>&6
12019 echo "configure:12020: checking size of int" >&5
12020 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
12021   echo $ac_n "(cached) $ac_c" 1>&6
12022 else
12023   if test "$cross_compiling" = yes; then
12024     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
12025 else
12026   cat > conftest.$ac_ext <<EOF
12027 #line 12028 "configure"
12028 #include "confdefs.h"
12029 #include <stdio.h>
12030 main()
12031 {
12032   FILE *f=fopen("conftestval", "w");
12033   if (!f) exit(1);
12034   fprintf(f, "%d\n", sizeof(int));
12035   exit(0);
12036 }
12037 EOF
12038 if { (eval echo configure:12039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12039 then
12040   ac_cv_sizeof_int=`cat conftestval`
12041 else
12042   echo "configure: failed program was:" >&5
12043   cat conftest.$ac_ext >&5
12044   rm -fr conftest*
12045   ac_cv_sizeof_int=0
12046 fi
12047 rm -fr conftest*
12048 fi
12049
12050 fi
12051 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
12052 cat >> confdefs.h <<EOF
12053 #define SIZEOF_INT $ac_cv_sizeof_int
12054 EOF
12055
12056  
12057         echo $ac_n "checking size of long""... $ac_c" 1>&6
12058 echo "configure:12059: checking size of long" >&5
12059 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
12060   echo $ac_n "(cached) $ac_c" 1>&6
12061 else
12062   if test "$cross_compiling" = yes; then
12063     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
12064 else
12065   cat > conftest.$ac_ext <<EOF
12066 #line 12067 "configure"
12067 #include "confdefs.h"
12068 #include <stdio.h>
12069 main()
12070 {
12071   FILE *f=fopen("conftestval", "w");
12072   if (!f) exit(1);
12073   fprintf(f, "%d\n", sizeof(long));
12074   exit(0);
12075 }
12076 EOF
12077 if { (eval echo configure:12078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12078 then
12079   ac_cv_sizeof_long=`cat conftestval`
12080 else
12081   echo "configure: failed program was:" >&5
12082   cat conftest.$ac_ext >&5
12083   rm -fr conftest*
12084   ac_cv_sizeof_long=0
12085 fi
12086 rm -fr conftest*
12087 fi
12088
12089 fi
12090 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
12091 cat >> confdefs.h <<EOF
12092 #define SIZEOF_LONG $ac_cv_sizeof_long
12093 EOF
12094
12095
12096
12097         if test "$ac_cv_sizeof_int" -lt 4 ; then
12098                 echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
12099
12100                 cat >> confdefs.h <<\EOF
12101 #define LBER_INT_T long
12102 EOF
12103
12104                 cat >> confdefs.h <<\EOF
12105 #define LBER_TAG_T long
12106 EOF
12107
12108                 cat >> confdefs.h <<\EOF
12109 #define LBER_SOCKET_T int
12110 EOF
12111
12112         else
12113                 cat >> confdefs.h <<\EOF
12114 #define LBER_INT_T int
12115 EOF
12116
12117                 cat >> confdefs.h <<\EOF
12118 #define LBER_TAG_T long
12119 EOF
12120
12121                 cat >> confdefs.h <<\EOF
12122 #define LBER_SOCKET_T int
12123 EOF
12124
12125         fi
12126 fi
12127
12128 cat >> confdefs.h <<\EOF
12129 #define LBER_LEN_T long
12130 EOF
12131
12132
12133 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
12134 echo "configure:12135: checking for 8-bit clean memcmp" >&5
12135 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
12136   echo $ac_n "(cached) $ac_c" 1>&6
12137 else
12138   if test "$cross_compiling" = yes; then
12139   ac_cv_func_memcmp_clean=no
12140 else
12141   cat > conftest.$ac_ext <<EOF
12142 #line 12143 "configure"
12143 #include "confdefs.h"
12144
12145 main()
12146 {
12147   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
12148   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
12149 }
12150
12151 EOF
12152 if { (eval echo configure:12153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12153 then
12154   ac_cv_func_memcmp_clean=yes
12155 else
12156   echo "configure: failed program was:" >&5
12157   cat conftest.$ac_ext >&5
12158   rm -fr conftest*
12159   ac_cv_func_memcmp_clean=no
12160 fi
12161 rm -fr conftest*
12162 fi
12163
12164 fi
12165
12166 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
12167 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
12168
12169 echo $ac_n "checking for strftime""... $ac_c" 1>&6
12170 echo "configure:12171: checking for strftime" >&5
12171 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
12172   echo $ac_n "(cached) $ac_c" 1>&6
12173 else
12174   cat > conftest.$ac_ext <<EOF
12175 #line 12176 "configure"
12176 #include "confdefs.h"
12177 /* System header to define __stub macros and hopefully few prototypes,
12178     which can conflict with char strftime(); below.  */
12179 #include <assert.h>
12180 /* Override any gcc2 internal prototype to avoid an error.  */
12181 /* We use char because int might match the return type of a gcc2
12182     builtin and then its argument prototype would still apply.  */
12183 char strftime();
12184 char (*f)();
12185
12186 int main() {
12187
12188 /* The GNU C library defines this for functions which it implements
12189     to always fail with ENOSYS.  Some functions are actually named
12190     something starting with __ and the normal name is an alias.  */
12191 #if defined (__stub_strftime) || defined (__stub___strftime)
12192 choke me
12193 #else
12194 f = strftime;
12195 #endif
12196
12197 ; return 0; }
12198 EOF
12199 if { (eval echo configure:12200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12200   rm -rf conftest*
12201   eval "ac_cv_func_strftime=yes"
12202 else
12203   echo "configure: failed program was:" >&5
12204   cat conftest.$ac_ext >&5
12205   rm -rf conftest*
12206   eval "ac_cv_func_strftime=no"
12207 fi
12208 rm -f conftest*
12209 fi
12210
12211 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
12212   echo "$ac_t""yes" 1>&6
12213   cat >> confdefs.h <<\EOF
12214 #define HAVE_STRFTIME 1
12215 EOF
12216
12217 else
12218   echo "$ac_t""no" 1>&6
12219 # strftime is in -lintl on SCO UNIX.
12220 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
12221 echo "configure:12222: checking for strftime in -lintl" >&5
12222 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
12223 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12224   echo $ac_n "(cached) $ac_c" 1>&6
12225 else
12226   ac_save_LIBS="$LIBS"
12227 LIBS="-lintl  $LIBS"
12228 cat > conftest.$ac_ext <<EOF
12229 #line 12230 "configure"
12230 #include "confdefs.h"
12231 /* Override any gcc2 internal prototype to avoid an error.  */
12232 /* We use char because int might match the return type of a gcc2
12233     builtin and then its argument prototype would still apply.  */
12234 char strftime();
12235
12236 int main() {
12237 strftime()
12238 ; return 0; }
12239 EOF
12240 if { (eval echo configure:12241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12241   rm -rf conftest*
12242   eval "ac_cv_lib_$ac_lib_var=yes"
12243 else
12244   echo "configure: failed program was:" >&5
12245   cat conftest.$ac_ext >&5
12246   rm -rf conftest*
12247   eval "ac_cv_lib_$ac_lib_var=no"
12248 fi
12249 rm -f conftest*
12250 LIBS="$ac_save_LIBS"
12251
12252 fi
12253 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12254   echo "$ac_t""yes" 1>&6
12255   cat >> confdefs.h <<\EOF
12256 #define HAVE_STRFTIME 1
12257 EOF
12258
12259 LIBS="-lintl $LIBS"
12260 else
12261   echo "$ac_t""no" 1>&6
12262 fi
12263
12264 fi
12265
12266
12267 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
12268 echo "configure:12269: checking for inet_aton()" >&5
12269 if eval "test \"\${ol_cv_func_inet_aton+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
12276 #ifdef HAVE_SYS_TYPES_H
12277 #       include <sys/types.h>
12278 #endif
12279 #ifdef HAVE_SYS_SOCKET_H
12280 #       include <sys/socket.h>
12281 #       ifdef HAVE_SYS_SELECT_H
12282 #               include <sys/select.h>
12283 #       endif
12284 #       include <netinet/in.h>
12285 #       ifdef HAVE_ARPA_INET_H
12286 #               include <arpa/inet.h>
12287 #       endif
12288 #endif
12289
12290 int main() {
12291 struct in_addr in;
12292 int rc = inet_aton( "255.255.255.255", &in );
12293 ; return 0; }
12294 EOF
12295 if { (eval echo configure:12296: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12296   rm -rf conftest*
12297   ol_cv_func_inet_aton=yes
12298 else
12299   echo "configure: failed program was:" >&5
12300   cat conftest.$ac_ext >&5
12301   rm -rf conftest*
12302   ol_cv_func_inet_aton=no
12303 fi
12304 rm -f conftest*
12305 fi
12306
12307 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
12308   if test $ol_cv_func_inet_aton != no; then
12309     cat >> confdefs.h <<\EOF
12310 #define HAVE_INET_ATON 1
12311 EOF
12312
12313   fi
12314  
12315
12316 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
12317 echo "configure:12318: checking for vprintf" >&5
12318 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
12319   echo $ac_n "(cached) $ac_c" 1>&6
12320 else
12321   cat > conftest.$ac_ext <<EOF
12322 #line 12323 "configure"
12323 #include "confdefs.h"
12324 /* System header to define __stub macros and hopefully few prototypes,
12325     which can conflict with char vprintf(); below.  */
12326 #include <assert.h>
12327 /* Override any gcc2 internal prototype to avoid an error.  */
12328 /* We use char because int might match the return type of a gcc2
12329     builtin and then its argument prototype would still apply.  */
12330 char vprintf();
12331 char (*f)();
12332
12333 int main() {
12334
12335 /* The GNU C library defines this for functions which it implements
12336     to always fail with ENOSYS.  Some functions are actually named
12337     something starting with __ and the normal name is an alias.  */
12338 #if defined (__stub_vprintf) || defined (__stub___vprintf)
12339 choke me
12340 #else
12341 f = vprintf;
12342 #endif
12343
12344 ; return 0; }
12345 EOF
12346 if { (eval echo configure:12347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12347   rm -rf conftest*
12348   eval "ac_cv_func_vprintf=yes"
12349 else
12350   echo "configure: failed program was:" >&5
12351   cat conftest.$ac_ext >&5
12352   rm -rf conftest*
12353   eval "ac_cv_func_vprintf=no"
12354 fi
12355 rm -f conftest*
12356 fi
12357
12358 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
12359   echo "$ac_t""yes" 1>&6
12360   cat >> confdefs.h <<\EOF
12361 #define HAVE_VPRINTF 1
12362 EOF
12363
12364 else
12365   echo "$ac_t""no" 1>&6
12366 fi
12367
12368 if test "$ac_cv_func_vprintf" != yes; then
12369 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
12370 echo "configure:12371: checking for _doprnt" >&5
12371 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
12372   echo $ac_n "(cached) $ac_c" 1>&6
12373 else
12374   cat > conftest.$ac_ext <<EOF
12375 #line 12376 "configure"
12376 #include "confdefs.h"
12377 /* System header to define __stub macros and hopefully few prototypes,
12378     which can conflict with char _doprnt(); below.  */
12379 #include <assert.h>
12380 /* Override any gcc2 internal prototype to avoid an error.  */
12381 /* We use char because int might match the return type of a gcc2
12382     builtin and then its argument prototype would still apply.  */
12383 char _doprnt();
12384 char (*f)();
12385
12386 int main() {
12387
12388 /* The GNU C library defines this for functions which it implements
12389     to always fail with ENOSYS.  Some functions are actually named
12390     something starting with __ and the normal name is an alias.  */
12391 #if defined (__stub__doprnt) || defined (__stub____doprnt)
12392 choke me
12393 #else
12394 f = _doprnt;
12395 #endif
12396
12397 ; return 0; }
12398 EOF
12399 if { (eval echo configure:12400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12400   rm -rf conftest*
12401   eval "ac_cv_func__doprnt=yes"
12402 else
12403   echo "configure: failed program was:" >&5
12404   cat conftest.$ac_ext >&5
12405   rm -rf conftest*
12406   eval "ac_cv_func__doprnt=no"
12407 fi
12408 rm -f conftest*
12409 fi
12410
12411 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
12412   echo "$ac_t""yes" 1>&6
12413   cat >> confdefs.h <<\EOF
12414 #define HAVE_DOPRNT 1
12415 EOF
12416
12417 else
12418   echo "$ac_t""no" 1>&6
12419 fi
12420
12421 fi
12422
12423
12424 if test $ac_cv_func_vprintf = yes ; then
12425                 for ac_func in vsnprintf vsprintf
12426 do
12427 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12428 echo "configure:12429: checking for $ac_func" >&5
12429 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12430   echo $ac_n "(cached) $ac_c" 1>&6
12431 else
12432   cat > conftest.$ac_ext <<EOF
12433 #line 12434 "configure"
12434 #include "confdefs.h"
12435 /* System header to define __stub macros and hopefully few prototypes,
12436     which can conflict with char $ac_func(); below.  */
12437 #include <assert.h>
12438 /* Override any gcc2 internal prototype to avoid an error.  */
12439 /* We use char because int might match the return type of a gcc2
12440     builtin and then its argument prototype would still apply.  */
12441 char $ac_func();
12442 char (*f)();
12443
12444 int main() {
12445
12446 /* The GNU C library defines this for functions which it implements
12447     to always fail with ENOSYS.  Some functions are actually named
12448     something starting with __ and the normal name is an alias.  */
12449 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12450 choke me
12451 #else
12452 f = $ac_func;
12453 #endif
12454
12455 ; return 0; }
12456 EOF
12457 if { (eval echo configure:12458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12458   rm -rf conftest*
12459   eval "ac_cv_func_$ac_func=yes"
12460 else
12461   echo "configure: failed program was:" >&5
12462   cat conftest.$ac_ext >&5
12463   rm -rf conftest*
12464   eval "ac_cv_func_$ac_func=no"
12465 fi
12466 rm -f conftest*
12467 fi
12468
12469 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12470   echo "$ac_t""yes" 1>&6
12471     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12472   cat >> confdefs.h <<EOF
12473 #define $ac_tr_func 1
12474 EOF
12475  
12476 else
12477   echo "$ac_t""no" 1>&6
12478 fi
12479 done
12480
12481 fi
12482
12483 for ac_func in \
12484         bcopy                   \
12485         closesocket             \
12486         endgrent                \
12487         endpwent                \
12488         flock                   \
12489         getdtablesize   \
12490         getgrgid                \
12491         gethostname             \
12492         getpass                 \
12493         getpwuid                \
12494         getpwnam                \
12495         getspnam                \
12496         gettimeofday    \
12497         initgroups              \
12498         lockf                   \
12499         memcpy                  \
12500         memmove                 \
12501         mkstemp                 \
12502         read                    \
12503         recv                    \
12504         recvfrom                \
12505         setpwfile               \
12506         setgid                  \
12507         setegid                 \
12508         setsid                  \
12509         setuid                  \
12510         seteuid                 \
12511         signal                  \
12512         sigset                  \
12513         snprintf                \
12514         strdup                  \
12515         strerror                \
12516         strpbrk                 \
12517         strrchr                 \
12518         strsep                  \
12519         strstr                  \
12520         strtol                  \
12521         strtoul                 \
12522         strspn                  \
12523         sysconf                 \
12524         waitpid                 \
12525         wait4                   \
12526         write                   \
12527         send                    \
12528         sendto                  \
12529
12530 do
12531 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12532 echo "configure:12533: checking for $ac_func" >&5
12533 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12534   echo $ac_n "(cached) $ac_c" 1>&6
12535 else
12536   cat > conftest.$ac_ext <<EOF
12537 #line 12538 "configure"
12538 #include "confdefs.h"
12539 /* System header to define __stub macros and hopefully few prototypes,
12540     which can conflict with char $ac_func(); below.  */
12541 #include <assert.h>
12542 /* Override any gcc2 internal prototype to avoid an error.  */
12543 /* We use char because int might match the return type of a gcc2
12544     builtin and then its argument prototype would still apply.  */
12545 char $ac_func();
12546 char (*f)();
12547
12548 int main() {
12549
12550 /* The GNU C library defines this for functions which it implements
12551     to always fail with ENOSYS.  Some functions are actually named
12552     something starting with __ and the normal name is an alias.  */
12553 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12554 choke me
12555 #else
12556 f = $ac_func;
12557 #endif
12558
12559 ; return 0; }
12560 EOF
12561 if { (eval echo configure:12562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12562   rm -rf conftest*
12563   eval "ac_cv_func_$ac_func=yes"
12564 else
12565   echo "configure: failed program was:" >&5
12566   cat conftest.$ac_ext >&5
12567   rm -rf conftest*
12568   eval "ac_cv_func_$ac_func=no"
12569 fi
12570 rm -f conftest*
12571 fi
12572
12573 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12574   echo "$ac_t""yes" 1>&6
12575     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12576   cat >> confdefs.h <<EOF
12577 #define $ac_tr_func 1
12578 EOF
12579  
12580 else
12581   echo "$ac_t""no" 1>&6
12582 fi
12583 done
12584
12585
12586 for ac_func in getopt tempnam
12587 do
12588 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12589 echo "configure:12590: checking for $ac_func" >&5
12590 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12591   echo $ac_n "(cached) $ac_c" 1>&6
12592 else
12593   cat > conftest.$ac_ext <<EOF
12594 #line 12595 "configure"
12595 #include "confdefs.h"
12596 /* System header to define __stub macros and hopefully few prototypes,
12597     which can conflict with char $ac_func(); below.  */
12598 #include <assert.h>
12599 /* Override any gcc2 internal prototype to avoid an error.  */
12600 /* We use char because int might match the return type of a gcc2
12601     builtin and then its argument prototype would still apply.  */
12602 char $ac_func();
12603 char (*f)();
12604
12605 int main() {
12606
12607 /* The GNU C library defines this for functions which it implements
12608     to always fail with ENOSYS.  Some functions are actually named
12609     something starting with __ and the normal name is an alias.  */
12610 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12611 choke me
12612 #else
12613 f = $ac_func;
12614 #endif
12615
12616 ; return 0; }
12617 EOF
12618 if { (eval echo configure:12619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12619   rm -rf conftest*
12620   eval "ac_cv_func_$ac_func=yes"
12621 else
12622   echo "configure: failed program was:" >&5
12623   cat conftest.$ac_ext >&5
12624   rm -rf conftest*
12625   eval "ac_cv_func_$ac_func=no"
12626 fi
12627 rm -f conftest*
12628 fi
12629
12630 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12631   echo "$ac_t""yes" 1>&6
12632     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12633   cat >> confdefs.h <<EOF
12634 #define $ac_tr_func 1
12635 EOF
12636  
12637 else
12638   echo "$ac_t""no" 1>&6
12639 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
12640 fi
12641 done
12642
12643
12644
12645 # Check Configuration
12646 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
12647 echo "configure:12648: checking declaration of sys_errlist" >&5
12648 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
12649   echo $ac_n "(cached) $ac_c" 1>&6
12650 else
12651   
12652         cat > conftest.$ac_ext <<EOF
12653 #line 12654 "configure"
12654 #include "confdefs.h"
12655
12656 #include <stdio.h>
12657 #include <sys/types.h>
12658 #include <errno.h> 
12659 int main() {
12660 char *c = (char *) *sys_errlist
12661 ; return 0; }
12662 EOF
12663 if { (eval echo configure:12664: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12664   rm -rf conftest*
12665   ol_cv_dcl_sys_errlist=yes
12666         ol_cv_have_sys_errlist=yes
12667 else
12668   echo "configure: failed program was:" >&5
12669   cat conftest.$ac_ext >&5
12670   rm -rf conftest*
12671   ol_cv_dcl_sys_errlist=no
12672 fi
12673 rm -f conftest*
12674 fi
12675
12676 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
12677 #
12678 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
12679 if test $ol_cv_dcl_sys_errlist = no ; then
12680         cat >> confdefs.h <<\EOF
12681 #define DECL_SYS_ERRLIST 1
12682 EOF
12683
12684
12685         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
12686 echo "configure:12687: checking existence of sys_errlist" >&5
12687 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
12688   echo $ac_n "(cached) $ac_c" 1>&6
12689 else
12690   
12691                 cat > conftest.$ac_ext <<EOF
12692 #line 12693 "configure"
12693 #include "confdefs.h"
12694 #include <errno.h>
12695 int main() {
12696 char *c = (char *) *sys_errlist
12697 ; return 0; }
12698 EOF
12699 if { (eval echo configure:12700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12700   rm -rf conftest*
12701   ol_cv_have_sys_errlist=yes
12702 else
12703   echo "configure: failed program was:" >&5
12704   cat conftest.$ac_ext >&5
12705   rm -rf conftest*
12706   ol_cv_have_sys_errlist=no
12707 fi
12708 rm -f conftest*
12709 fi
12710
12711 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
12712 fi
12713 if test $ol_cv_have_sys_errlist = yes ; then
12714         cat >> confdefs.h <<\EOF
12715 #define HAVE_SYS_ERRLIST 1
12716 EOF
12717
12718 fi
12719
12720
12721
12722 if test "$ol_enable_debug" != no ; then
12723         cat >> confdefs.h <<\EOF
12724 #define LDAP_DEBUG 1
12725 EOF
12726
12727 fi
12728 if test "$ol_enable_syslog" = yes ; then
12729         cat >> confdefs.h <<\EOF
12730 #define LDAP_SYSLOG 1
12731 EOF
12732
12733 fi
12734 if test "$ol_enable_libui" = yes ; then
12735         cat >> confdefs.h <<\EOF
12736 #define LDAP_LIBUI 1
12737 EOF
12738
12739 fi
12740 if test "$ol_enable_cache" = no ; then
12741         cat >> confdefs.h <<\EOF
12742 #define LDAP_NOCACHE 1
12743 EOF
12744
12745 fi
12746 if test "$ol_enable_dns" != no ; then
12747         cat >> confdefs.h <<\EOF
12748 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS LDAP_VENDOR_VERSION
12749 EOF
12750
12751 fi
12752 if test "$ol_enable_proctitle" != no ; then
12753         cat >> confdefs.h <<\EOF
12754 #define LDAP_PROCTITLE 1
12755 EOF
12756
12757 fi
12758 if test "$ol_enable_referrals" != no ; then
12759         cat >> confdefs.h <<\EOF
12760 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
12761 EOF
12762
12763 fi
12764 if test "$ol_enable_cldap" != no ; then
12765         cat >> confdefs.h <<\EOF
12766 #define LDAP_CONNECTIONLESS 1
12767 EOF
12768
12769 fi
12770
12771 if test "$ol_enable_crypt" != no ; then
12772         cat >> confdefs.h <<\EOF
12773 #define SLAPD_CRYPT 1
12774 EOF
12775
12776 fi
12777 if test "$ol_enable_cleartext" != no ; then
12778         cat >> confdefs.h <<\EOF
12779 #define SLAPD_CLEARTEXT 1
12780 EOF
12781
12782 fi
12783 if test "$ol_enable_multimaster" != no ; then
12784         cat >> confdefs.h <<\EOF
12785 #define SLAPD_MULTIMASTER 1
12786 EOF
12787
12788 fi
12789 if test "$ol_enable_phonetic" != no ; then
12790         cat >> confdefs.h <<\EOF
12791 #define SLAPD_PHONETIC 1
12792 EOF
12793
12794 fi
12795 if test "$ol_enable_rlookups" != no ; then
12796         cat >> confdefs.h <<\EOF
12797 #define SLAPD_RLOOKUPS 1
12798 EOF
12799
12800 fi
12801
12802 if test "$ol_link_modules" != no ; then
12803         cat >> confdefs.h <<\EOF
12804 #define SLAPD_MODULES 1
12805 EOF
12806
12807         BUILD_SLAPD=yes
12808 fi
12809
12810 if test "$ol_link_bdb2" != no ; then
12811         cat >> confdefs.h <<\EOF
12812 #define SLAPD_BDB2 1
12813 EOF
12814
12815         BUILD_SLAPD=yes
12816         BUILD_BDB2=yes
12817         if test "$ol_with_bdb2_module" != static ; then
12818                 cat >> confdefs.h <<\EOF
12819 #define SLAPD_BDB2_DYNAMIC 1
12820 EOF
12821
12822                 BUILD_BDB2_DYNAMIC=yes
12823         fi
12824 fi
12825
12826 if test "$ol_enable_ldap" != no ; then
12827         cat >> confdefs.h <<\EOF
12828 #define SLAPD_LDAP 1
12829 EOF
12830
12831         BUILD_SLAPD=yes
12832         BUILD_LDAP=yes
12833         if test "$ol_with_ldap_module" != static ; then
12834                 cat >> confdefs.h <<\EOF
12835 #define SLAPD_LDAP_DYNAMIC 1
12836 EOF
12837
12838                 BUILD_LDAP_DYNAMIC=yes
12839         fi
12840 fi
12841
12842 if test "$ol_link_ldbm" != no ; then
12843         cat >> confdefs.h <<\EOF
12844 #define SLAPD_LDBM 1
12845 EOF
12846
12847         BUILD_SLAPD=yes
12848         BUILD_LDBM=yes
12849         if test "$ol_with_ldbm_module" != static ; then
12850                 cat >> confdefs.h <<\EOF
12851 #define SLAPD_LDBM_DYNAMIC 1
12852 EOF
12853
12854                 BUILD_LDBM_DYNAMIC=yes
12855         fi
12856 fi
12857
12858 if test "$ol_enable_passwd" != no ; then
12859         cat >> confdefs.h <<\EOF
12860 #define SLAPD_PASSWD 1
12861 EOF
12862
12863         BUILD_SLAPD=yes
12864         BUILD_PASSWD=yes
12865         if test "$ol_with_passwd_module" != static ; then
12866                 cat >> confdefs.h <<\EOF
12867 #define SLAPD_PASSWD_DYNAMIC 1
12868 EOF
12869
12870                 BUILD_PASSWD_DYNAMIC=yes
12871         fi
12872 fi
12873
12874 if test "$ol_link_perl" != no ; then
12875         cat >> confdefs.h <<\EOF
12876 #define SLAPD_PERL 1
12877 EOF
12878
12879         BUILD_SLAPD=yes
12880         BUILD_PERL=yes
12881         if test "$ol_with_perl_module" != static ; then
12882                 cat >> confdefs.h <<\EOF
12883 #define SLAPD_PERL_DYNAMIC 1
12884 EOF
12885
12886                 BUILD_PERL_DYNAMIC=yes
12887         fi
12888 fi
12889
12890 if test "$ol_enable_shell" != no ; then
12891         cat >> confdefs.h <<\EOF
12892 #define SLAPD_SHELL 1
12893 EOF
12894
12895         BUILD_SLAPD=yes
12896         BUILD_SHELL=yes
12897         if test "$ol_with_shell_module" != static ; then
12898                 cat >> confdefs.h <<\EOF
12899 #define SLAPD_SHELL_DYNAMIC 1
12900 EOF
12901
12902                 BUILD_SHELL_DYNAMIC=yes
12903         fi
12904 fi
12905
12906 if test "$ol_enable_tcl" != no ; then
12907         cat >> confdefs.h <<\EOF
12908 #define SLAPD_TCL 1
12909 EOF
12910
12911         BUILD_SLAPD=yes
12912         BUILD_TCL=yes
12913         if test "$ol_with_tcl_module" != static; then
12914                 cat >> confdefs.h <<\EOF
12915 #define SLAPD_TCL_DYNAMIC 1
12916 EOF
12917
12918                 BUILD_TCL_DYNAMIC=yes
12919         fi
12920 fi
12921
12922 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
12923         $BUILD_SLAPD = yes ; then
12924         BUILD_SLURPD=yes
12925 fi
12926
12927 if test "$ol_link_isode" != no ; then
12928         BUILD_LDAPD=yes
12929 fi
12930
12931
12932
12933
12934   
12935   
12936   
12937   
12938   
12939   
12940   
12941   
12942   
12943   
12944   
12945   
12946   
12947   
12948   
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973 trap '' 1 2 15
12974
12975 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
12976
12977 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12978 # Let make expand exec_prefix.
12979 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
12980
12981 # Any assignment to VPATH causes Sun make to only execute
12982 # the first set of double-colon rules, so remove it if not needed.
12983 # If there is a colon in the path, we need to keep it.
12984 if test "x$srcdir" = x.; then
12985   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
12986 fi
12987
12988 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
12989
12990 DEFS=-DHAVE_CONFIG_H
12991
12992 # Without the "./", some shells look in PATH for config.status.
12993 : ${CONFIG_STATUS=./config.status}
12994
12995 echo creating $CONFIG_STATUS
12996 rm -f $CONFIG_STATUS
12997 cat > $CONFIG_STATUS <<EOF
12998 #! /bin/sh
12999 # Generated automatically by configure.
13000 # Run this file to recreate the current configuration.
13001 # This directory was configured as follows,
13002 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
13003 #
13004 # $0 $ac_configure_args
13005 #
13006 # Compiler output produced by configure, useful for debugging
13007 # configure, is in ./config.log if it exists.
13008
13009 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
13010 for ac_option
13011 do
13012   case "\$ac_option" in
13013   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
13014     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
13015     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
13016   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
13017     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
13018     exit 0 ;;
13019   -help | --help | --hel | --he | --h)
13020     echo "\$ac_cs_usage"; exit 0 ;;
13021   *) echo "\$ac_cs_usage"; exit 1 ;;
13022   esac
13023 done
13024
13025 ac_given_srcdir=$srcdir
13026 ac_given_INSTALL="$INSTALL"
13027
13028 trap 'rm -fr `echo "\
13029 Makefile:build/top.mk:Makefile.in:build/dir.mk \
13030 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
13031 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
13032 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
13033 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
13034 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
13035 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
13036 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
13037 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
13038 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
13039 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
13040 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
13041 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
13042 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
13043 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
13044 include/Makefile:build/top.mk:include/Makefile.in \
13045 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
13046 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
13047 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
13048 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
13049 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
13050 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
13051 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
13052 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
13053 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
13054 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
13055 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
13056 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
13057 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \
13058 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
13059 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
13060 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
13061 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
13062 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
13063 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
13064 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
13065 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
13066 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
13067 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
13068 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
13069 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
13070 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
13071  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
13072 EOF
13073 cat >> $CONFIG_STATUS <<EOF
13074
13075 # Protect against being on the right side of a sed subst in config.status.
13076 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
13077  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
13078 $ac_vpsub
13079 $extrasub
13080 s%@SHELL@%$SHELL%g
13081 s%@CFLAGS@%$CFLAGS%g
13082 s%@CPPFLAGS@%$CPPFLAGS%g
13083 s%@CXXFLAGS@%$CXXFLAGS%g
13084 s%@FFLAGS@%$FFLAGS%g
13085 s%@DEFS@%$DEFS%g
13086 s%@LDFLAGS@%$LDFLAGS%g
13087 s%@LIBS@%$LIBS%g
13088 s%@exec_prefix@%$exec_prefix%g
13089 s%@prefix@%$prefix%g
13090 s%@program_transform_name@%$program_transform_name%g
13091 s%@bindir@%$bindir%g
13092 s%@sbindir@%$sbindir%g
13093 s%@libexecdir@%$libexecdir%g
13094 s%@datadir@%$datadir%g
13095 s%@sysconfdir@%$sysconfdir%g
13096 s%@sharedstatedir@%$sharedstatedir%g
13097 s%@localstatedir@%$localstatedir%g
13098 s%@libdir@%$libdir%g
13099 s%@includedir@%$includedir%g
13100 s%@oldincludedir@%$oldincludedir%g
13101 s%@infodir@%$infodir%g
13102 s%@mandir@%$mandir%g
13103 s%@host@%$host%g
13104 s%@host_alias@%$host_alias%g
13105 s%@host_cpu@%$host_cpu%g
13106 s%@host_vendor@%$host_vendor%g
13107 s%@host_os@%$host_os%g
13108 s%@target@%$target%g
13109 s%@target_alias@%$target_alias%g
13110 s%@target_cpu@%$target_cpu%g
13111 s%@target_vendor@%$target_vendor%g
13112 s%@target_os@%$target_os%g
13113 s%@build@%$build%g
13114 s%@build_alias@%$build_alias%g
13115 s%@build_cpu@%$build_cpu%g
13116 s%@build_vendor@%$build_vendor%g
13117 s%@build_os@%$build_os%g
13118 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
13119 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
13120 s%@INSTALL_DATA@%$INSTALL_DATA%g
13121 s%@PACKAGE@%$PACKAGE%g
13122 s%@VERSION@%$VERSION%g
13123 s%@ACLOCAL@%$ACLOCAL%g
13124 s%@AUTOCONF@%$AUTOCONF%g
13125 s%@AUTOMAKE@%$AUTOMAKE%g
13126 s%@AUTOHEADER@%$AUTOHEADER%g
13127 s%@MAKEINFO@%$MAKEINFO%g
13128 s%@install_sh@%$install_sh%g
13129 s%@AMTAR@%$AMTAR%g
13130 s%@AWK@%$AWK%g
13131 s%@AMTARFLAGS@%$AMTARFLAGS%g
13132 s%@SET_MAKE@%$SET_MAKE%g
13133 s%@top_builddir@%$top_builddir%g
13134 s%@ldap_subdir@%$ldap_subdir%g
13135 s%@CC@%$CC%g
13136 s%@RANLIB@%$RANLIB%g
13137 s%@LD@%$LD%g
13138 s%@NM@%$NM%g
13139 s%@LN_S@%$LN_S%g
13140 s%@LIBTOOL@%$LIBTOOL%g
13141 s%@LN_H@%$LN_H%g
13142 s%@SENDMAIL@%$SENDMAIL%g
13143 s%@EDITOR@%$EDITOR%g
13144 s%@FINGER@%$FINGER%g
13145 s%@PERLBIN@%$PERLBIN%g
13146 s%@CPP@%$CPP%g
13147 s%@EXEEXT@%$EXEEXT%g
13148 s%@OBJEXT@%$OBJEXT%g
13149 s%@OL_MKDEP@%$OL_MKDEP%g
13150 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
13151 s%@GLIBCONFIG@%$GLIBCONFIG%g
13152 s%@PEPSY@%$PEPSY%g
13153 s%@LIBOBJS@%$LIBOBJS%g
13154 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
13155 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
13156 s%@BUILD_BDB2@%$BUILD_BDB2%g
13157 s%@BUILD_LDAP@%$BUILD_LDAP%g
13158 s%@BUILD_LDBM@%$BUILD_LDBM%g
13159 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
13160 s%@BUILD_PERL@%$BUILD_PERL%g
13161 s%@BUILD_QUIPU@%$BUILD_QUIPU%g
13162 s%@BUILD_SHELL@%$BUILD_SHELL%g
13163 s%@BUILD_TCL@%$BUILD_TCL%g
13164 s%@BUILD_BDB2_DYNAMIC@%$BUILD_BDB2_DYNAMIC%g
13165 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
13166 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
13167 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
13168 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
13169 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
13170 s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
13171 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
13172 s%@LDAP_LIBS@%$LDAP_LIBS%g
13173 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
13174 s%@LDIF_LIBS@%$LDIF_LIBS%g
13175 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
13176 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
13177 s%@LDBM_LIBS@%$LDBM_LIBS%g
13178 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
13179 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
13180 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
13181 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
13182 s%@SLAPD_PERL_CPPFLAGS@%$SLAPD_PERL_CPPFLAGS%g
13183 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
13184 s%@KRB_LIBS@%$KRB_LIBS%g
13185 s%@READLINE_LIBS@%$READLINE_LIBS%g
13186 s%@SASL_LIBS@%$SASL_LIBS%g
13187 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
13188 s%@TLS_LIBS@%$TLS_LIBS%g
13189
13190 CEOF
13191 EOF
13192
13193 cat >> $CONFIG_STATUS <<\EOF
13194
13195 # Split the substitutions into bite-sized pieces for seds with
13196 # small command number limits, like on Digital OSF/1 and HP-UX.
13197 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
13198 ac_file=1 # Number of current file.
13199 ac_beg=1 # First line for current file.
13200 ac_end=$ac_max_sed_cmds # Line after last line for current file.
13201 ac_more_lines=:
13202 ac_sed_cmds=""
13203 while $ac_more_lines; do
13204   if test $ac_beg -gt 1; then
13205     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
13206   else
13207     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
13208   fi
13209   if test ! -s conftest.s$ac_file; then
13210     ac_more_lines=false
13211     rm -f conftest.s$ac_file
13212   else
13213     if test -z "$ac_sed_cmds"; then
13214       ac_sed_cmds="sed -f conftest.s$ac_file"
13215     else
13216       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
13217     fi
13218     ac_file=`expr $ac_file + 1`
13219     ac_beg=$ac_end
13220     ac_end=`expr $ac_end + $ac_max_sed_cmds`
13221   fi
13222 done
13223 if test -z "$ac_sed_cmds"; then
13224   ac_sed_cmds=cat
13225 fi
13226 EOF
13227
13228 cat >> $CONFIG_STATUS <<EOF
13229
13230 CONFIG_FILES=\${CONFIG_FILES-"\
13231 Makefile:build/top.mk:Makefile.in:build/dir.mk \
13232 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
13233 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
13234 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
13235 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
13236 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
13237 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
13238 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
13239 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
13240 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
13241 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
13242 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
13243 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
13244 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
13245 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
13246 include/Makefile:build/top.mk:include/Makefile.in \
13247 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
13248 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
13249 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
13250 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
13251 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
13252 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
13253 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
13254 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
13255 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
13256 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
13257 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
13258 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
13259 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \
13260 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
13261 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
13262 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
13263 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
13264 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
13265 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
13266 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
13267 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
13268 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
13269 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
13270 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
13271 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
13272 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
13273 "}
13274 EOF
13275 cat >> $CONFIG_STATUS <<\EOF
13276 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
13277   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13278   case "$ac_file" in
13279   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
13280        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
13281   *) ac_file_in="${ac_file}.in" ;;
13282   esac
13283
13284   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
13285
13286   # Remove last slash and all that follows it.  Not all systems have dirname.
13287   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
13288   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13289     # The file is in a subdirectory.
13290     test ! -d "$ac_dir" && mkdir "$ac_dir"
13291     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
13292     # A "../" for each directory in $ac_dir_suffix.
13293     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
13294   else
13295     ac_dir_suffix= ac_dots=
13296   fi
13297
13298   case "$ac_given_srcdir" in
13299   .)  srcdir=.
13300       if test -z "$ac_dots"; then top_srcdir=.
13301       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
13302   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
13303   *) # Relative path.
13304     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
13305     top_srcdir="$ac_dots$ac_given_srcdir" ;;
13306   esac
13307
13308   case "$ac_given_INSTALL" in
13309   [/$]*) INSTALL="$ac_given_INSTALL" ;;
13310   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
13311   esac
13312
13313   echo creating "$ac_file"
13314   rm -f "$ac_file"
13315   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
13316   case "$ac_file" in
13317   *Makefile*) ac_comsub="1i\\
13318 # $configure_input" ;;
13319   *) ac_comsub= ;;
13320   esac
13321
13322   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
13323   sed -e "$ac_comsub
13324 s%@configure_input@%$configure_input%g
13325 s%@srcdir@%$srcdir%g
13326 s%@top_srcdir@%$top_srcdir%g
13327 s%@INSTALL@%$INSTALL%g
13328 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
13329 fi; done
13330 rm -f conftest.s*
13331
13332 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
13333 # NAME is the cpp macro being defined and VALUE is the value it is being given.
13334 #
13335 # ac_d sets the value in "#define NAME VALUE" lines.
13336 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
13337 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
13338 ac_dC='\3'
13339 ac_dD='%g'
13340 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
13341 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13342 ac_uB='\([      ]\)%\1#\2define\3'
13343 ac_uC=' '
13344 ac_uD='\4%g'
13345 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
13346 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13347 ac_eB='$%\1#\2define\3'
13348 ac_eC=' '
13349 ac_eD='%g'
13350
13351 if test "${CONFIG_HEADERS+set}" != set; then
13352 EOF
13353 cat >> $CONFIG_STATUS <<EOF
13354   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
13355 EOF
13356 cat >> $CONFIG_STATUS <<\EOF
13357 fi
13358 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
13359   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13360   case "$ac_file" in
13361   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
13362        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
13363   *) ac_file_in="${ac_file}.in" ;;
13364   esac
13365
13366   echo creating $ac_file
13367
13368   rm -f conftest.frag conftest.in conftest.out
13369   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
13370   cat $ac_file_inputs > conftest.in
13371
13372 EOF
13373
13374 # Transform confdefs.h into a sed script conftest.vals that substitutes
13375 # the proper values into config.h.in to produce config.h.  And first:
13376 # Protect against being on the right side of a sed subst in config.status.
13377 # Protect against being in an unquoted here document in config.status.
13378 rm -f conftest.vals
13379 cat > conftest.hdr <<\EOF
13380 s/[\\&%]/\\&/g
13381 s%[\\$`]%\\&%g
13382 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
13383 s%ac_d%ac_u%gp
13384 s%ac_u%ac_e%gp
13385 EOF
13386 sed -n -f conftest.hdr confdefs.h > conftest.vals
13387 rm -f conftest.hdr
13388
13389 # This sed command replaces #undef with comments.  This is necessary, for
13390 # example, in the case of _POSIX_SOURCE, which is predefined and required
13391 # on some systems where configure will not decide to define it.
13392 cat >> conftest.vals <<\EOF
13393 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
13394 EOF
13395
13396 # Break up conftest.vals because some shells have a limit on
13397 # the size of here documents, and old seds have small limits too.
13398
13399 rm -f conftest.tail
13400 while :
13401 do
13402   ac_lines=`grep -c . conftest.vals`
13403   # grep -c gives empty output for an empty file on some AIX systems.
13404   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
13405   # Write a limited-size here document to conftest.frag.
13406   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
13407   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
13408   echo 'CEOF
13409   sed -f conftest.frag conftest.in > conftest.out
13410   rm -f conftest.in
13411   mv conftest.out conftest.in
13412 ' >> $CONFIG_STATUS
13413   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
13414   rm -f conftest.vals
13415   mv conftest.tail conftest.vals
13416 done
13417 rm -f conftest.vals
13418
13419 cat >> $CONFIG_STATUS <<\EOF
13420   rm -f conftest.frag conftest.h
13421   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
13422   cat conftest.in >> conftest.h
13423   rm -f conftest.in
13424   if cmp -s $ac_file conftest.h 2>/dev/null; then
13425     echo "$ac_file is unchanged"
13426     rm -f conftest.h
13427   else
13428     # Remove last slash and all that follows it.  Not all systems have dirname.
13429       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
13430       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13431       # The file is in a subdirectory.
13432       test ! -d "$ac_dir" && mkdir "$ac_dir"
13433     fi
13434     rm -f $ac_file
13435     mv conftest.h $ac_file
13436   fi
13437 fi; done
13438
13439 EOF
13440 cat >> $CONFIG_STATUS <<EOF
13441
13442 EOF
13443 cat >> $CONFIG_STATUS <<\EOF
13444
13445 date > stamp-h
13446 echo Please \"make depend\" to build dependencies
13447
13448 exit 0
13449 EOF
13450 chmod +x $CONFIG_STATUS
13451 rm -fr confdefs* $ac_clean_files
13452 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
13453