]> git.sur5r.net Git - openldap/blob - configure
Reorder the pthreads tests and hope for the best. IRIX users beware.
[openldap] / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13 
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-proctitle    enable proctitle support (yes)"
21 ac_help="$ac_help
22   --enable-cache        enable caching (yes)"
23 ac_help="$ac_help
24   --enable-dns          enable V2 DNS  extension (no)"
25 ac_help="$ac_help
26   --enable-referrals    enable V2 Referrals extension (yes)"
27 ac_help="$ac_help
28   --enable-cldap        enable connectionless ldap (no)"
29 ac_help="$ac_help
30   --enable-x-compile    enable cross compiling (no)"
31 ac_help="$ac_help
32   --enable-dmalloc      enable debug malloc support (no)"
33 ac_help="$ac_help
34   --with-kerberos       with Kerberos support (auto)"
35 ac_help="$ac_help
36   --with-readline  with readline support (auto)"
37 ac_help="$ac_help
38   --with-threads        use threads (auto)"
39 ac_help="$ac_help
40   --with-tls  with TLS/SSL support (auto)"
41 ac_help="$ac_help
42   --with-yielding-select        with implicitly yielding select (auto)"
43 ac_help="$ac_help
44 LDAPD Options:"
45 ac_help="$ac_help
46   --enable-ldapd        enable building ldapd (no)"
47 ac_help="$ac_help
48 SLAPD Options:"
49 ac_help="$ac_help
50   --enable-slapd        enable building slapd (yes)"
51 ac_help="$ac_help
52     --enable-aclgroups  enable ACL group support (auto)"
53 ac_help="$ac_help
54     --enable-cleartext  enable cleartext passwords (yes)"
55 ac_help="$ac_help
56     --enable-crypt      enable crypt(3) passwords (auto)"
57 ac_help="$ac_help
58     --enable-wrappers   enable tcp wrapper support (no)"
59 ac_help="$ac_help
60     --enable-phonetic   enable phonetic/soundex (no)"
61 ac_help="$ac_help
62     --enable-rlookups   enable reverse lookups (auto)"
63 ac_help="$ac_help
64     --enable-bdb2       enable bdb2 backend (no)"
65 ac_help="$ac_help
66     --enable-ldbm       enable ldbm backend (yes)"
67 ac_help="$ac_help
68       --with-ldbm-api   use LDBM API (auto)"
69 ac_help="$ac_help
70       --with-ldbm-type  use LDBM type (auto)"
71 ac_help="$ac_help
72     --enable-passwd     enable passwd backend (no)"
73 ac_help="$ac_help
74     --enable-perl       enable perl backend (no)"
75 ac_help="$ac_help
76     --enable-shell      enable shell backend (no)"
77 ac_help="$ac_help
78     --enable-tcl        enable tcl backend (no)"
79 ac_help="$ac_help
80 SLURPD Options:"
81 ac_help="$ac_help
82   --enable-slurpd       enable building slurpd (auto)"
83 ac_help="$ac_help
84 Library Generation & Linking Options"
85 ac_help="$ac_help
86   --enable-static         build static libraries [default=yes]
87   --enable-static=PKGS    only build shared libraries if the current package
88                           appears as an element in the PKGS list"
89 ac_help="$ac_help
90   --enable-shared         build shared libraries [default=yes]
91   --enable-shared=PKGS    only build shared libraries if the current package
92                           appears as an element in the PKGS list"
93 ac_help="$ac_help
94   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
95
96 # Initialize some variables set by options.
97 # The variables have the same names as the options, with
98 # dashes changed to underlines.
99 build=NONE
100 cache_file=./config.cache
101 exec_prefix=NONE
102 host=NONE
103 no_create=
104 nonopt=NONE
105 no_recursion=
106 prefix=NONE
107 program_prefix=NONE
108 program_suffix=NONE
109 program_transform_name=s,x,x,
110 silent=
111 site=
112 srcdir=
113 target=NONE
114 verbose=
115 x_includes=NONE
116 x_libraries=NONE
117 bindir='${exec_prefix}/bin'
118 sbindir='${exec_prefix}/sbin'
119 libexecdir='${exec_prefix}/libexec'
120 datadir='${prefix}/share'
121 sysconfdir='${prefix}/etc'
122 sharedstatedir='${prefix}/com'
123 localstatedir='${prefix}/var'
124 libdir='${exec_prefix}/lib'
125 includedir='${prefix}/include'
126 oldincludedir='/usr/include'
127 infodir='${prefix}/info'
128 mandir='${prefix}/man'
129
130 # Initialize some other variables.
131 subdirs=
132 MFLAGS= MAKEFLAGS=
133 SHELL=${CONFIG_SHELL-/bin/sh}
134 # Maximum number of lines to put in a shell here document.
135 ac_max_here_lines=12
136
137 ac_prev=
138 for ac_option
139 do
140
141   # If the previous option needs an argument, assign it.
142   if test -n "$ac_prev"; then
143     eval "$ac_prev=\$ac_option"
144     ac_prev=
145     continue
146   fi
147
148   case "$ac_option" in
149   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
150   *) ac_optarg= ;;
151   esac
152
153   # Accept the important Cygnus configure options, so we can diagnose typos.
154
155   case "$ac_option" in
156
157   -bindir | --bindir | --bindi | --bind | --bin | --bi)
158     ac_prev=bindir ;;
159   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
160     bindir="$ac_optarg" ;;
161
162   -build | --build | --buil | --bui | --bu)
163     ac_prev=build ;;
164   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
165     build="$ac_optarg" ;;
166
167   -cache-file | --cache-file | --cache-fil | --cache-fi \
168   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
169     ac_prev=cache_file ;;
170   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
171   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
172     cache_file="$ac_optarg" ;;
173
174   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
175     ac_prev=datadir ;;
176   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
177   | --da=*)
178     datadir="$ac_optarg" ;;
179
180   -disable-* | --disable-*)
181     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
182     # Reject names that are not valid shell variable names.
183     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
184       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
185     fi
186     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
187     eval "enable_${ac_feature}=no" ;;
188
189   -enable-* | --enable-*)
190     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
191     # Reject names that are not valid shell variable names.
192     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
193       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
194     fi
195     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
196     case "$ac_option" in
197       *=*) ;;
198       *) ac_optarg=yes ;;
199     esac
200     eval "enable_${ac_feature}='$ac_optarg'" ;;
201
202   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
203   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
204   | --exec | --exe | --ex)
205     ac_prev=exec_prefix ;;
206   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
207   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
208   | --exec=* | --exe=* | --ex=*)
209     exec_prefix="$ac_optarg" ;;
210
211   -gas | --gas | --ga | --g)
212     # Obsolete; use --with-gas.
213     with_gas=yes ;;
214
215   -help | --help | --hel | --he)
216     # Omit some internal or obsolete options to make the list less imposing.
217     # This message is too long to be a string in the A/UX 3.1 sh.
218     cat << EOF
219 Usage: configure [options] [host]
220 Options: [defaults in brackets after descriptions]
221 Configuration:
222   --cache-file=FILE       cache test results in FILE
223   --help                  print this message
224   --no-create             do not create output files
225   --quiet, --silent       do not print \`checking...' messages
226   --version               print the version of autoconf that created configure
227 Directory and file names:
228   --prefix=PREFIX         install architecture-independent files in PREFIX
229                           [$ac_default_prefix]
230   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
231                           [same as prefix]
232   --bindir=DIR            user executables in DIR [EPREFIX/bin]
233   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
234   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
235   --datadir=DIR           read-only architecture-independent data in DIR
236                           [PREFIX/share]
237   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
238   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
239                           [PREFIX/com]
240   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
241   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
242   --includedir=DIR        C header files in DIR [PREFIX/include]
243   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
244   --infodir=DIR           info documentation in DIR [PREFIX/info]
245   --mandir=DIR            man documentation in DIR [PREFIX/man]
246   --srcdir=DIR            find the sources in DIR [configure dir or ..]
247   --program-prefix=PREFIX prepend PREFIX to installed program names
248   --program-suffix=SUFFIX append SUFFIX to installed program names
249   --program-transform-name=PROGRAM
250                           run sed PROGRAM on installed program names
251 EOF
252     cat << EOF
253 Host type:
254   --build=BUILD           configure for building on BUILD [BUILD=HOST]
255   --host=HOST             configure for HOST [guessed]
256   --target=TARGET         configure for TARGET [TARGET=HOST]
257 Features and packages:
258   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
259   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
260   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
261   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
262   --x-includes=DIR        X include files are in DIR
263   --x-libraries=DIR       X library files are in DIR
264 EOF
265     if test -n "$ac_help"; then
266       echo "--enable and --with options recognized:$ac_help"
267     fi
268     exit 0 ;;
269
270   -host | --host | --hos | --ho)
271     ac_prev=host ;;
272   -host=* | --host=* | --hos=* | --ho=*)
273     host="$ac_optarg" ;;
274
275   -includedir | --includedir | --includedi | --included | --include \
276   | --includ | --inclu | --incl | --inc)
277     ac_prev=includedir ;;
278   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
279   | --includ=* | --inclu=* | --incl=* | --inc=*)
280     includedir="$ac_optarg" ;;
281
282   -infodir | --infodir | --infodi | --infod | --info | --inf)
283     ac_prev=infodir ;;
284   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
285     infodir="$ac_optarg" ;;
286
287   -libdir | --libdir | --libdi | --libd)
288     ac_prev=libdir ;;
289   -libdir=* | --libdir=* | --libdi=* | --libd=*)
290     libdir="$ac_optarg" ;;
291
292   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
293   | --libexe | --libex | --libe)
294     ac_prev=libexecdir ;;
295   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
296   | --libexe=* | --libex=* | --libe=*)
297     libexecdir="$ac_optarg" ;;
298
299   -localstatedir | --localstatedir | --localstatedi | --localstated \
300   | --localstate | --localstat | --localsta | --localst \
301   | --locals | --local | --loca | --loc | --lo)
302     ac_prev=localstatedir ;;
303   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
304   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
305   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
306     localstatedir="$ac_optarg" ;;
307
308   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
309     ac_prev=mandir ;;
310   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
311     mandir="$ac_optarg" ;;
312
313   -nfp | --nfp | --nf)
314     # Obsolete; use --without-fp.
315     with_fp=no ;;
316
317   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
318   | --no-cr | --no-c)
319     no_create=yes ;;
320
321   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
322   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
323     no_recursion=yes ;;
324
325   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
326   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
327   | --oldin | --oldi | --old | --ol | --o)
328     ac_prev=oldincludedir ;;
329   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
330   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
331   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
332     oldincludedir="$ac_optarg" ;;
333
334   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
335     ac_prev=prefix ;;
336   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
337     prefix="$ac_optarg" ;;
338
339   -program-prefix | --program-prefix | --program-prefi | --program-pref \
340   | --program-pre | --program-pr | --program-p)
341     ac_prev=program_prefix ;;
342   -program-prefix=* | --program-prefix=* | --program-prefi=* \
343   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
344     program_prefix="$ac_optarg" ;;
345
346   -program-suffix | --program-suffix | --program-suffi | --program-suff \
347   | --program-suf | --program-su | --program-s)
348     ac_prev=program_suffix ;;
349   -program-suffix=* | --program-suffix=* | --program-suffi=* \
350   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
351     program_suffix="$ac_optarg" ;;
352
353   -program-transform-name | --program-transform-name \
354   | --program-transform-nam | --program-transform-na \
355   | --program-transform-n | --program-transform- \
356   | --program-transform | --program-transfor \
357   | --program-transfo | --program-transf \
358   | --program-trans | --program-tran \
359   | --progr-tra | --program-tr | --program-t)
360     ac_prev=program_transform_name ;;
361   -program-transform-name=* | --program-transform-name=* \
362   | --program-transform-nam=* | --program-transform-na=* \
363   | --program-transform-n=* | --program-transform-=* \
364   | --program-transform=* | --program-transfor=* \
365   | --program-transfo=* | --program-transf=* \
366   | --program-trans=* | --program-tran=* \
367   | --progr-tra=* | --program-tr=* | --program-t=*)
368     program_transform_name="$ac_optarg" ;;
369
370   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
371   | -silent | --silent | --silen | --sile | --sil)
372     silent=yes ;;
373
374   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
375     ac_prev=sbindir ;;
376   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
377   | --sbi=* | --sb=*)
378     sbindir="$ac_optarg" ;;
379
380   -sharedstatedir | --sharedstatedir | --sharedstatedi \
381   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
382   | --sharedst | --shareds | --shared | --share | --shar \
383   | --sha | --sh)
384     ac_prev=sharedstatedir ;;
385   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
386   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
387   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
388   | --sha=* | --sh=*)
389     sharedstatedir="$ac_optarg" ;;
390
391   -site | --site | --sit)
392     ac_prev=site ;;
393   -site=* | --site=* | --sit=*)
394     site="$ac_optarg" ;;
395
396   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
397     ac_prev=srcdir ;;
398   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
399     srcdir="$ac_optarg" ;;
400
401   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
402   | --syscon | --sysco | --sysc | --sys | --sy)
403     ac_prev=sysconfdir ;;
404   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
405   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
406     sysconfdir="$ac_optarg" ;;
407
408   -target | --target | --targe | --targ | --tar | --ta | --t)
409     ac_prev=target ;;
410   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
411     target="$ac_optarg" ;;
412
413   -v | -verbose | --verbose | --verbos | --verbo | --verb)
414     verbose=yes ;;
415
416   -version | --version | --versio | --versi | --vers)
417     echo "configure generated by autoconf version 2.13"
418     exit 0 ;;
419
420   -with-* | --with-*)
421     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
422     # Reject names that are not valid shell variable names.
423     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
424       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
425     fi
426     ac_package=`echo $ac_package| sed 's/-/_/g'`
427     case "$ac_option" in
428       *=*) ;;
429       *) ac_optarg=yes ;;
430     esac
431     eval "with_${ac_package}='$ac_optarg'" ;;
432
433   -without-* | --without-*)
434     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
435     # Reject names that are not valid shell variable names.
436     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
437       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
438     fi
439     ac_package=`echo $ac_package| sed 's/-/_/g'`
440     eval "with_${ac_package}=no" ;;
441
442   --x)
443     # Obsolete; use --with-x.
444     with_x=yes ;;
445
446   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
447   | --x-incl | --x-inc | --x-in | --x-i)
448     ac_prev=x_includes ;;
449   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
450   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
451     x_includes="$ac_optarg" ;;
452
453   -x-libraries | --x-libraries | --x-librarie | --x-librari \
454   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
455     ac_prev=x_libraries ;;
456   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
457   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
458     x_libraries="$ac_optarg" ;;
459
460   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
461     ;;
462
463   *)
464     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
465       echo "configure: warning: $ac_option: invalid host type" 1>&2
466     fi
467     if test "x$nonopt" != xNONE; then
468       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
469     fi
470     nonopt="$ac_option"
471     ;;
472
473   esac
474 done
475
476 if test -n "$ac_prev"; then
477   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
478 fi
479
480 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
481
482 # File descriptor usage:
483 # 0 standard input
484 # 1 file creation
485 # 2 errors and warnings
486 # 3 some systems may open it to /dev/tty
487 # 4 used on the Kubota Titan
488 # 6 checking for... messages and results
489 # 5 compiler messages saved in config.log
490 if test "$silent" = yes; then
491   exec 6>/dev/null
492 else
493   exec 6>&1
494 fi
495 exec 5>./config.log
496
497 echo "\
498 This file contains any messages produced by compilers while
499 running configure, to aid debugging if configure makes a mistake.
500 " 1>&5
501
502 # Strip out --no-create and --no-recursion so they do not pile up.
503 # Also quote any args containing shell metacharacters.
504 ac_configure_args=
505 for ac_arg
506 do
507   case "$ac_arg" in
508   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
509   | --no-cr | --no-c) ;;
510   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
511   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
512   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
513   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
514   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
515   esac
516 done
517
518 # NLS nuisances.
519 # Only set these to C if already set.  These must not be set unconditionally
520 # because not all systems understand e.g. LANG=C (notably SCO).
521 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
522 # Non-C LC_CTYPE values break the ctype check.
523 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
524 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
525 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
526 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
527
528 # confdefs.h avoids OS command line length limits that DEFS can exceed.
529 rm -rf conftest* confdefs.h
530 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
531 echo > confdefs.h
532
533 # A filename unique to this package, relative to the directory that
534 # configure is in, which we can look for to find out if srcdir is correct.
535 ac_unique_file=include/ldap.h
536
537 # Find the source files, if location was not specified.
538 if test -z "$srcdir"; then
539   ac_srcdir_defaulted=yes
540   # Try the directory containing this script, then its parent.
541   ac_prog=$0
542   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
543   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
544   srcdir=$ac_confdir
545   if test ! -r $srcdir/$ac_unique_file; then
546     srcdir=..
547   fi
548 else
549   ac_srcdir_defaulted=no
550 fi
551 if test ! -r $srcdir/$ac_unique_file; then
552   if test "$ac_srcdir_defaulted" = yes; then
553     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
554   else
555     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
556   fi
557 fi
558 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
559
560 # Prefer explicitly selected file to automatically selected ones.
561 if test -z "$CONFIG_SITE"; then
562   if test "x$prefix" != xNONE; then
563     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
564   else
565     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
566   fi
567 fi
568 for ac_site_file in $CONFIG_SITE; do
569   if test -r "$ac_site_file"; then
570     echo "loading site script $ac_site_file"
571     . "$ac_site_file"
572   fi
573 done
574
575 if test -r "$cache_file"; then
576   echo "loading cache $cache_file"
577   . $cache_file
578 else
579   echo "creating cache $cache_file"
580   > $cache_file
581 fi
582
583 ac_ext=c
584 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
585 ac_cpp='$CPP $CPPFLAGS'
586 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
587 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
588 cross_compiling=$ac_cv_prog_cc_cross
589
590 ac_exeext=
591 ac_objext=o
592 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
593   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
594   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
595     ac_n= ac_c='
596 ' ac_t='        '
597   else
598     ac_n=-n ac_c= ac_t=
599   fi
600 else
601   ac_n= ac_c='\c' ac_t=
602 fi
603
604 ac_aux_dir=
605 for ac_dir in build $srcdir/build; do
606   if test -f $ac_dir/install-sh; then
607     ac_aux_dir=$ac_dir
608     ac_install_sh="$ac_aux_dir/install-sh -c"
609     break
610   elif test -f $ac_dir/install.sh; then
611     ac_aux_dir=$ac_dir
612     ac_install_sh="$ac_aux_dir/install.sh -c"
613     break
614   fi
615 done
616 if test -z "$ac_aux_dir"; then
617   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
618 fi
619 ac_config_guess=$ac_aux_dir/config.guess
620 ac_config_sub=$ac_aux_dir/config.sub
621 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
622 # Find a good install program.  We prefer a C program (faster),
623 # so one script is as good as another.  But avoid the broken or
624 # incompatible versions:
625 # SysV /etc/install, /usr/sbin/install
626 # SunOS /usr/etc/install
627 # IRIX /sbin/install
628 # AIX /bin/install
629 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
630 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
631 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
632 # ./install, which can be erroneously created by make from ./install.sh.
633 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
634 echo "configure:635: checking for a BSD compatible install" >&5
635 if test -z "$INSTALL"; then
636 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
637   echo $ac_n "(cached) $ac_c" 1>&6
638 else
639     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
640   for ac_dir in $PATH; do
641     # Account for people who put trailing slashes in PATH elements.
642     case "$ac_dir/" in
643     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
644     *)
645       # OSF1 and SCO ODT 3.0 have their own names for install.
646       # Don't use installbsd from OSF since it installs stuff as root
647       # by default.
648       for ac_prog in ginstall scoinst install; do
649         if test -f $ac_dir/$ac_prog; then
650           if test $ac_prog = install &&
651             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
652             # AIX install.  It has an incompatible calling convention.
653             :
654           else
655             ac_cv_path_install="$ac_dir/$ac_prog -c"
656             break 2
657           fi
658         fi
659       done
660       ;;
661     esac
662   done
663   IFS="$ac_save_IFS"
664
665 fi
666   if test "${ac_cv_path_install+set}" = set; then
667     INSTALL="$ac_cv_path_install"
668   else
669     # As a last resort, use the slow shell script.  We don't cache a
670     # path for INSTALL within a source directory, because that will
671     # break other packages using the cache if that directory is
672     # removed, or if the path is relative.
673     INSTALL="$ac_install_sh"
674   fi
675 fi
676 echo "$ac_t""$INSTALL" 1>&6
677
678 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
679 # It thinks the first close brace ends the variable substitution.
680 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
681
682 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
683
684 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
685
686 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
687 echo "configure:688: checking whether build environment is sane" >&5
688 # Just in case
689 sleep 1
690 echo timestamp > conftestfile
691 # Do `set' in a subshell so we don't clobber the current shell's
692 # arguments.  Must try -L first in case configure is actually a
693 # symlink; some systems play weird games with the mod time of symlinks
694 # (eg FreeBSD returns the mod time of the symlink's containing
695 # directory).
696 if (
697    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
698    if test "$*" = "X"; then
699       # -L didn't work.
700       set X `ls -t $srcdir/configure conftestfile`
701    fi
702    if test "$*" != "X $srcdir/configure conftestfile" \
703       && test "$*" != "X conftestfile $srcdir/configure"; then
704
705       # If neither matched, then we have a broken ls.  This can happen
706       # if, for instance, CONFIG_SHELL is bash and it inherits a
707       # broken ls alias from the environment.  This has actually
708       # happened.  Such a system could not be considered "sane".
709       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
710 alias in your environment" 1>&2; exit 1; }
711    fi
712
713    test "$2" = conftestfile
714    )
715 then
716    # Ok.
717    :
718 else
719    { echo "configure: error: newly created file is older than distributed files!
720 Check your system clock" 1>&2; exit 1; }
721 fi
722 rm -f conftest*
723 echo "$ac_t""yes" 1>&6
724 if test "$program_transform_name" = s,x,x,; then
725   program_transform_name=
726 else
727   # Double any \ or $.  echo might interpret backslashes.
728   cat <<\EOF_SED > conftestsed
729 s,\\,\\\\,g; s,\$,$$,g
730 EOF_SED
731   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
732   rm -f conftestsed
733 fi
734 test "$program_prefix" != NONE &&
735   program_transform_name="s,^,${program_prefix},; $program_transform_name"
736 # Use a double $ so make ignores it.
737 test "$program_suffix" != NONE &&
738   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
739
740 # sed with no file args requires a program.
741 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
742
743 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
744 echo "configure:745: checking whether ${MAKE-make} sets \${MAKE}" >&5
745 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
746 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
747   echo $ac_n "(cached) $ac_c" 1>&6
748 else
749   cat > conftestmake <<\EOF
750 all:
751         @echo 'ac_maketemp="${MAKE}"'
752 EOF
753 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
754 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
755 if test -n "$ac_maketemp"; then
756   eval ac_cv_prog_make_${ac_make}_set=yes
757 else
758   eval ac_cv_prog_make_${ac_make}_set=no
759 fi
760 rm -f conftestmake
761 fi
762 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
763   echo "$ac_t""yes" 1>&6
764   SET_MAKE=
765 else
766   echo "$ac_t""no" 1>&6
767   SET_MAKE="MAKE=${MAKE-make}"
768 fi
769
770
771 PACKAGE=OpenLDAP
772
773 VERSION=2.0-devel
774
775 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
776   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
777 fi
778
779
780
781 missing_dir=`cd $ac_aux_dir && pwd`
782 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
783 echo "configure:784: checking for working aclocal" >&5
784 # Run test in a subshell; some versions of sh will print an error if
785 # an executable is not found, even if stderr is redirected.
786 # Redirect stdin to placate older versions of autoconf.  Sigh.
787 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
788    ACLOCAL=aclocal
789    echo "$ac_t""found" 1>&6
790 else
791    ACLOCAL="$missing_dir/missing aclocal"
792    echo "$ac_t""missing" 1>&6
793 fi
794
795 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
796 echo "configure:797: checking for working autoconf" >&5
797 # Run test in a subshell; some versions of sh will print an error if
798 # an executable is not found, even if stderr is redirected.
799 # Redirect stdin to placate older versions of autoconf.  Sigh.
800 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
801    AUTOCONF=autoconf
802    echo "$ac_t""found" 1>&6
803 else
804    AUTOCONF="$missing_dir/missing autoconf"
805    echo "$ac_t""missing" 1>&6
806 fi
807
808 echo $ac_n "checking for working automake""... $ac_c" 1>&6
809 echo "configure:810: checking for working automake" >&5
810 # Run test in a subshell; some versions of sh will print an error if
811 # an executable is not found, even if stderr is redirected.
812 # Redirect stdin to placate older versions of autoconf.  Sigh.
813 if (automake --version) < /dev/null > /dev/null 2>&1; then
814    AUTOMAKE=automake
815    echo "$ac_t""found" 1>&6
816 else
817    AUTOMAKE="$missing_dir/missing automake"
818    echo "$ac_t""missing" 1>&6
819 fi
820
821 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
822 echo "configure:823: checking for working autoheader" >&5
823 # Run test in a subshell; some versions of sh will print an error if
824 # an executable is not found, even if stderr is redirected.
825 # Redirect stdin to placate older versions of autoconf.  Sigh.
826 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
827    AUTOHEADER=autoheader
828    echo "$ac_t""found" 1>&6
829 else
830    AUTOHEADER="$missing_dir/missing autoheader"
831    echo "$ac_t""missing" 1>&6
832 fi
833
834 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
835 echo "configure:836: checking for working makeinfo" >&5
836 # Run test in a subshell; some versions of sh will print an error if
837 # an executable is not found, even if stderr is redirected.
838 # Redirect stdin to placate older versions of autoconf.  Sigh.
839 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
840    MAKEINFO=makeinfo
841    echo "$ac_t""found" 1>&6
842 else
843    MAKEINFO="$missing_dir/missing makeinfo"
844    echo "$ac_t""missing" 1>&6
845 fi
846
847
848
849
850 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
851 echo "configure:852: checking configure arguments" >&5
852
853
854 top_builddir=`pwd`
855
856 ldap_subdir="openldap"
857
858 # Check whether --with-subdir or --without-subdir was given.
859 if test "${with_subdir+set}" = set; then
860   withval="$with_subdir"
861   
862         if test "$withval" = "no"; then
863                 ldap_subdir=""
864         elif test "$withval" != "yes"; then
865                 ldap_subdir="$withval"
866         fi
867
868 fi
869
870
871 # OpenLDAP --enable-debug
872         # Check whether --enable-debug or --disable-debug was given.
873 if test "${enable_debug+set}" = set; then
874   enableval="$enable_debug"
875   
876         ol_arg=invalid
877         for ol_val in auto yes no ; do
878                 if test "$enableval" = "$ol_val" ; then
879                         ol_arg="$ol_val"
880                 fi
881         done
882         if test "$ol_arg" = "invalid" ; then
883                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
884         fi
885         ol_enable_debug="$ol_arg"
886
887 else
888         ol_enable_debug="yes"
889 fi
890 # end --enable-debug
891 ol_enable_syslog=no
892 # OpenLDAP --enable-proctitle
893         # Check whether --enable-proctitle or --disable-proctitle was given.
894 if test "${enable_proctitle+set}" = set; then
895   enableval="$enable_proctitle"
896   
897         ol_arg=invalid
898         for ol_val in auto yes no ; do
899                 if test "$enableval" = "$ol_val" ; then
900                         ol_arg="$ol_val"
901                 fi
902         done
903         if test "$ol_arg" = "invalid" ; then
904                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
905         fi
906         ol_enable_proctitle="$ol_arg"
907
908 else
909         ol_enable_proctitle="yes"
910 fi
911 # end --enable-proctitle
912 # OpenLDAP --enable-cache
913         # Check whether --enable-cache or --disable-cache was given.
914 if test "${enable_cache+set}" = set; then
915   enableval="$enable_cache"
916   
917         ol_arg=invalid
918         for ol_val in auto yes no ; do
919                 if test "$enableval" = "$ol_val" ; then
920                         ol_arg="$ol_val"
921                 fi
922         done
923         if test "$ol_arg" = "invalid" ; then
924                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
925         fi
926         ol_enable_cache="$ol_arg"
927
928 else
929         ol_enable_cache="yes"
930 fi
931 # end --enable-cache
932 # OpenLDAP --enable-dns
933         # Check whether --enable-dns or --disable-dns was given.
934 if test "${enable_dns+set}" = set; then
935   enableval="$enable_dns"
936   
937         ol_arg=invalid
938         for ol_val in auto yes no ; do
939                 if test "$enableval" = "$ol_val" ; then
940                         ol_arg="$ol_val"
941                 fi
942         done
943         if test "$ol_arg" = "invalid" ; then
944                 { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; }
945         fi
946         ol_enable_dns="$ol_arg"
947
948 else
949         ol_enable_dns="no"
950 fi
951 # end --enable-dns
952 # OpenLDAP --enable-referrals
953         # Check whether --enable-referrals or --disable-referrals was given.
954 if test "${enable_referrals+set}" = set; then
955   enableval="$enable_referrals"
956   
957         ol_arg=invalid
958         for ol_val in auto yes no ; do
959                 if test "$enableval" = "$ol_val" ; then
960                         ol_arg="$ol_val"
961                 fi
962         done
963         if test "$ol_arg" = "invalid" ; then
964                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
965         fi
966         ol_enable_referrals="$ol_arg"
967
968 else
969         ol_enable_referrals="yes"
970 fi
971 # end --enable-referrals
972 # OpenLDAP --enable-cldap
973         # Check whether --enable-cldap or --disable-cldap was given.
974 if test "${enable_cldap+set}" = set; then
975   enableval="$enable_cldap"
976   
977         ol_arg=invalid
978         for ol_val in auto yes no ; do
979                 if test "$enableval" = "$ol_val" ; then
980                         ol_arg="$ol_val"
981                 fi
982         done
983         if test "$ol_arg" = "invalid" ; then
984                 { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; }
985         fi
986         ol_enable_cldap="$ol_arg"
987
988 else
989         ol_enable_cldap="no"
990 fi
991 # end --enable-cldap
992 # OpenLDAP --enable-x_compile
993         # Check whether --enable-x_compile or --disable-x_compile was given.
994 if test "${enable_x_compile+set}" = set; then
995   enableval="$enable_x_compile"
996   
997         ol_arg=invalid
998         for ol_val in yes no ; do
999                 if test "$enableval" = "$ol_val" ; then
1000                         ol_arg="$ol_val"
1001                 fi
1002         done
1003         if test "$ol_arg" = "invalid" ; then
1004                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1005         fi
1006         ol_enable_x_compile="$ol_arg"
1007
1008 else
1009         ol_enable_x_compile="no"
1010 fi
1011 # end --enable-x_compile
1012
1013 # OpenLDAP --enable-dmalloc
1014         # Check whether --enable-dmalloc or --disable-dmalloc was given.
1015 if test "${enable_dmalloc+set}" = set; then
1016   enableval="$enable_dmalloc"
1017   
1018         ol_arg=invalid
1019         for ol_val in auto yes no ; do
1020                 if test "$enableval" = "$ol_val" ; then
1021                         ol_arg="$ol_val"
1022                 fi
1023         done
1024         if test "$ol_arg" = "invalid" ; then
1025                 { echo "configure: error: bad value $enableval for --enable-dmalloc" 1>&2; exit 1; }
1026         fi
1027         ol_enable_dmalloc="$ol_arg"
1028
1029 else
1030         ol_enable_dmalloc="no"
1031 fi
1032 # end --enable-dmalloc
1033
1034 # OpenLDAP --with-kerberos
1035         # Check whether --with-kerberos or --without-kerberos was given.
1036 if test "${with_kerberos+set}" = set; then
1037   withval="$with_kerberos"
1038   
1039         ol_arg=invalid
1040         for ol_val in auto k5 k4 afs yes no ; do
1041                 if test "$withval" = "$ol_val" ; then
1042                         ol_arg="$ol_val"
1043                 fi
1044         done
1045         if test "$ol_arg" = "invalid" ; then
1046                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1047         fi
1048         ol_with_kerberos="$ol_arg"
1049
1050 else
1051         ol_with_kerberos="auto"
1052 fi
1053 # end --with-kerberos
1054
1055 # OpenLDAP --with-readline
1056         # Check whether --with-readline or --without-readline was given.
1057 if test "${with_readline+set}" = set; then
1058   withval="$with_readline"
1059   
1060         ol_arg=invalid
1061         for ol_val in auto yes no  ; do
1062                 if test "$withval" = "$ol_val" ; then
1063                         ol_arg="$ol_val"
1064                 fi
1065         done
1066         if test "$ol_arg" = "invalid" ; then
1067                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1068         fi
1069         ol_with_readline="$ol_arg"
1070
1071 else
1072         ol_with_readline="auto"
1073 fi
1074 # end --with-readline
1075
1076 # OpenLDAP --with-threads
1077         # Check whether --with-threads or --without-threads was given.
1078 if test "${with_threads+set}" = set; then
1079   withval="$with_threads"
1080   
1081         ol_arg=invalid
1082         for ol_val in auto posix mach lwp yes no manual  ; do
1083                 if test "$withval" = "$ol_val" ; then
1084                         ol_arg="$ol_val"
1085                 fi
1086         done
1087         if test "$ol_arg" = "invalid" ; then
1088                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1089         fi
1090         ol_with_threads="$ol_arg"
1091
1092 else
1093         ol_with_threads="auto"
1094 fi
1095 # end --with-threads
1096
1097 # OpenLDAP --with-tls
1098         # Check whether --with-tls or --without-tls was given.
1099 if test "${with_tls+set}" = set; then
1100   withval="$with_tls"
1101   
1102         ol_arg=invalid
1103         for ol_val in auto ssleay openssl yes no  ; do
1104                 if test "$withval" = "$ol_val" ; then
1105                         ol_arg="$ol_val"
1106                 fi
1107         done
1108         if test "$ol_arg" = "invalid" ; then
1109                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1110         fi
1111         ol_with_tls="$ol_arg"
1112
1113 else
1114         ol_with_tls="auto"
1115 fi
1116 # end --with-tls
1117
1118 # OpenLDAP --with-yielding_select
1119         # Check whether --with-yielding_select or --without-yielding_select was given.
1120 if test "${with_yielding_select+set}" = set; then
1121   withval="$with_yielding_select"
1122   
1123         ol_arg=invalid
1124         for ol_val in auto yes no manual  ; do
1125                 if test "$withval" = "$ol_val" ; then
1126                         ol_arg="$ol_val"
1127                 fi
1128         done
1129         if test "$ol_arg" = "invalid" ; then
1130                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1131         fi
1132         ol_with_yielding_select="$ol_arg"
1133
1134 else
1135         ol_with_yielding_select="auto"
1136 fi
1137 # end --with-yielding_select
1138
1139
1140
1141 # Check whether --with-xxldapdoptions or --without-xxldapdoptions was given.
1142 if test "${with_xxldapdoptions+set}" = set; then
1143   withval="$with_xxldapdoptions"
1144   :
1145 fi
1146
1147 # OpenLDAP --enable-ldapd
1148         # Check whether --enable-ldapd or --disable-ldapd was given.
1149 if test "${enable_ldapd+set}" = set; then
1150   enableval="$enable_ldapd"
1151   
1152         ol_arg=invalid
1153         for ol_val in auto yes no ; do
1154                 if test "$enableval" = "$ol_val" ; then
1155                         ol_arg="$ol_val"
1156                 fi
1157         done
1158         if test "$ol_arg" = "invalid" ; then
1159                 { echo "configure: error: bad value $enableval for --enable-ldapd" 1>&2; exit 1; }
1160         fi
1161         ol_enable_ldapd="$ol_arg"
1162
1163 else
1164         ol_enable_ldapd="no"
1165 fi
1166 # end --enable-ldapd
1167
1168 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1169 if test "${with_xxslapdoptions+set}" = set; then
1170   withval="$with_xxslapdoptions"
1171   :
1172 fi
1173
1174 # OpenLDAP --enable-slapd
1175         # Check whether --enable-slapd or --disable-slapd was given.
1176 if test "${enable_slapd+set}" = set; then
1177   enableval="$enable_slapd"
1178   
1179         ol_arg=invalid
1180         for ol_val in auto yes no ; do
1181                 if test "$enableval" = "$ol_val" ; then
1182                         ol_arg="$ol_val"
1183                 fi
1184         done
1185         if test "$ol_arg" = "invalid" ; then
1186                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1187         fi
1188         ol_enable_slapd="$ol_arg"
1189
1190 else
1191         ol_enable_slapd="yes"
1192 fi
1193 # end --enable-slapd
1194 # OpenLDAP --enable-aclgroups
1195         # Check whether --enable-aclgroups or --disable-aclgroups was given.
1196 if test "${enable_aclgroups+set}" = set; then
1197   enableval="$enable_aclgroups"
1198   
1199         ol_arg=invalid
1200         for ol_val in auto yes no ; do
1201                 if test "$enableval" = "$ol_val" ; then
1202                         ol_arg="$ol_val"
1203                 fi
1204         done
1205         if test "$ol_arg" = "invalid" ; then
1206                 { echo "configure: error: bad value $enableval for --enable-aclgroups" 1>&2; exit 1; }
1207         fi
1208         ol_enable_aclgroups="$ol_arg"
1209
1210 else
1211         ol_enable_aclgroups="auto"
1212 fi
1213 # end --enable-aclgroups
1214 # OpenLDAP --enable-cleartext
1215         # Check whether --enable-cleartext or --disable-cleartext was given.
1216 if test "${enable_cleartext+set}" = set; then
1217   enableval="$enable_cleartext"
1218   
1219         ol_arg=invalid
1220         for ol_val in auto yes no ; do
1221                 if test "$enableval" = "$ol_val" ; then
1222                         ol_arg="$ol_val"
1223                 fi
1224         done
1225         if test "$ol_arg" = "invalid" ; then
1226                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1227         fi
1228         ol_enable_cleartext="$ol_arg"
1229
1230 else
1231         ol_enable_cleartext="yes"
1232 fi
1233 # end --enable-cleartext
1234 # OpenLDAP --enable-crypt
1235         # Check whether --enable-crypt or --disable-crypt was given.
1236 if test "${enable_crypt+set}" = set; then
1237   enableval="$enable_crypt"
1238   
1239         ol_arg=invalid
1240         for ol_val in auto yes no ; do
1241                 if test "$enableval" = "$ol_val" ; then
1242                         ol_arg="$ol_val"
1243                 fi
1244         done
1245         if test "$ol_arg" = "invalid" ; then
1246                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1247         fi
1248         ol_enable_crypt="$ol_arg"
1249
1250 else
1251         ol_enable_crypt="auto"
1252 fi
1253 # end --enable-crypt
1254 # OpenLDAP --enable-wrappers
1255         # Check whether --enable-wrappers or --disable-wrappers was given.
1256 if test "${enable_wrappers+set}" = set; then
1257   enableval="$enable_wrappers"
1258   
1259         ol_arg=invalid
1260         for ol_val in auto yes no ; do
1261                 if test "$enableval" = "$ol_val" ; then
1262                         ol_arg="$ol_val"
1263                 fi
1264         done
1265         if test "$ol_arg" = "invalid" ; then
1266                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1267         fi
1268         ol_enable_wrappers="$ol_arg"
1269
1270 else
1271         ol_enable_wrappers="no"
1272 fi
1273 # end --enable-wrappers
1274 # OpenLDAP --enable-phonetic
1275         # Check whether --enable-phonetic or --disable-phonetic was given.
1276 if test "${enable_phonetic+set}" = set; then
1277   enableval="$enable_phonetic"
1278   
1279         ol_arg=invalid
1280         for ol_val in auto yes no ; do
1281                 if test "$enableval" = "$ol_val" ; then
1282                         ol_arg="$ol_val"
1283                 fi
1284         done
1285         if test "$ol_arg" = "invalid" ; then
1286                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1287         fi
1288         ol_enable_phonetic="$ol_arg"
1289
1290 else
1291         ol_enable_phonetic="no"
1292 fi
1293 # end --enable-phonetic
1294 # OpenLDAP --enable-rlookups
1295         # Check whether --enable-rlookups or --disable-rlookups was given.
1296 if test "${enable_rlookups+set}" = set; then
1297   enableval="$enable_rlookups"
1298   
1299         ol_arg=invalid
1300         for ol_val in auto yes no ; do
1301                 if test "$enableval" = "$ol_val" ; then
1302                         ol_arg="$ol_val"
1303                 fi
1304         done
1305         if test "$ol_arg" = "invalid" ; then
1306                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1307         fi
1308         ol_enable_rlookups="$ol_arg"
1309
1310 else
1311         ol_enable_rlookups="auto"
1312 fi
1313 # end --enable-rlookups
1314
1315 # OpenLDAP --enable-bdb2
1316         # Check whether --enable-bdb2 or --disable-bdb2 was given.
1317 if test "${enable_bdb2+set}" = set; then
1318   enableval="$enable_bdb2"
1319   
1320         ol_arg=invalid
1321         for ol_val in auto yes no ; do
1322                 if test "$enableval" = "$ol_val" ; then
1323                         ol_arg="$ol_val"
1324                 fi
1325         done
1326         if test "$ol_arg" = "invalid" ; then
1327                 { echo "configure: error: bad value $enableval for --enable-bdb2" 1>&2; exit 1; }
1328         fi
1329         ol_enable_bdb2="$ol_arg"
1330
1331 else
1332         ol_enable_bdb2="no"
1333 fi
1334 # end --enable-bdb2
1335 # OpenLDAP --enable-ldbm
1336         # Check whether --enable-ldbm or --disable-ldbm was given.
1337 if test "${enable_ldbm+set}" = set; then
1338   enableval="$enable_ldbm"
1339   
1340         ol_arg=invalid
1341         for ol_val in auto yes no ; do
1342                 if test "$enableval" = "$ol_val" ; then
1343                         ol_arg="$ol_val"
1344                 fi
1345         done
1346         if test "$ol_arg" = "invalid" ; then
1347                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1348         fi
1349         ol_enable_ldbm="$ol_arg"
1350
1351 else
1352         ol_enable_ldbm="yes"
1353 fi
1354 # end --enable-ldbm
1355 # OpenLDAP --with-ldbm_api
1356         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1357 if test "${with_ldbm_api+set}" = set; then
1358   withval="$with_ldbm_api"
1359   
1360         ol_arg=invalid
1361         for ol_val in auto db2 db mdbm gdbm ndbm manual ; do
1362                 if test "$withval" = "$ol_val" ; then
1363                         ol_arg="$ol_val"
1364                 fi
1365         done
1366         if test "$ol_arg" = "invalid" ; then
1367                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1368         fi
1369         ol_with_ldbm_api="$ol_arg"
1370
1371 else
1372         ol_with_ldbm_api="auto"
1373 fi
1374 # end --with-ldbm_api
1375
1376 # OpenLDAP --with-ldbm_type
1377         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1378 if test "${with_ldbm_type+set}" = set; then
1379   withval="$with_ldbm_type"
1380   
1381         ol_arg=invalid
1382         for ol_val in auto btree hash ; do
1383                 if test "$withval" = "$ol_val" ; then
1384                         ol_arg="$ol_val"
1385                 fi
1386         done
1387         if test "$ol_arg" = "invalid" ; then
1388                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1389         fi
1390         ol_with_ldbm_type="$ol_arg"
1391
1392 else
1393         ol_with_ldbm_type="auto"
1394 fi
1395 # end --with-ldbm_type
1396
1397
1398 # OpenLDAP --enable-passwd
1399         # Check whether --enable-passwd or --disable-passwd was given.
1400 if test "${enable_passwd+set}" = set; then
1401   enableval="$enable_passwd"
1402   
1403         ol_arg=invalid
1404         for ol_val in auto yes no ; do
1405                 if test "$enableval" = "$ol_val" ; then
1406                         ol_arg="$ol_val"
1407                 fi
1408         done
1409         if test "$ol_arg" = "invalid" ; then
1410                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1411         fi
1412         ol_enable_passwd="$ol_arg"
1413
1414 else
1415         ol_enable_passwd="no"
1416 fi
1417 # end --enable-passwd
1418 # OpenLDAP --enable-perl
1419         # Check whether --enable-perl or --disable-perl was given.
1420 if test "${enable_perl+set}" = set; then
1421   enableval="$enable_perl"
1422   
1423         ol_arg=invalid
1424         for ol_val in auto yes no ; do
1425                 if test "$enableval" = "$ol_val" ; then
1426                         ol_arg="$ol_val"
1427                 fi
1428         done
1429         if test "$ol_arg" = "invalid" ; then
1430                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
1431         fi
1432         ol_enable_perl="$ol_arg"
1433
1434 else
1435         ol_enable_perl="no"
1436 fi
1437 # end --enable-perl
1438 # OpenLDAP --enable-shell
1439         # Check whether --enable-shell or --disable-shell was given.
1440 if test "${enable_shell+set}" = set; then
1441   enableval="$enable_shell"
1442   
1443         ol_arg=invalid
1444         for ol_val in auto yes no ; do
1445                 if test "$enableval" = "$ol_val" ; then
1446                         ol_arg="$ol_val"
1447                 fi
1448         done
1449         if test "$ol_arg" = "invalid" ; then
1450                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
1451         fi
1452         ol_enable_shell="$ol_arg"
1453
1454 else
1455         ol_enable_shell="no"
1456 fi
1457 # end --enable-shell
1458 # OpenLDAP --enable-tcl
1459         # Check whether --enable-tcl or --disable-tcl was given.
1460 if test "${enable_tcl+set}" = set; then
1461   enableval="$enable_tcl"
1462   
1463         ol_arg=invalid
1464         for ol_val in auto yes no ; do
1465                 if test "$enableval" = "$ol_val" ; then
1466                         ol_arg="$ol_val"
1467                 fi
1468         done
1469         if test "$ol_arg" = "invalid" ; then
1470                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
1471         fi
1472         ol_enable_tcl="$ol_arg"
1473
1474 else
1475         ol_enable_tcl="no"
1476 fi
1477 # end --enable-tcl
1478
1479 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
1480 if test "${with_xxslurpdoptions+set}" = set; then
1481   withval="$with_xxslurpdoptions"
1482   :
1483 fi
1484
1485 # OpenLDAP --enable-slurpd
1486         # Check whether --enable-slurpd or --disable-slurpd was given.
1487 if test "${enable_slurpd+set}" = set; then
1488   enableval="$enable_slurpd"
1489   
1490         ol_arg=invalid
1491         for ol_val in auto yes no ; do
1492                 if test "$enableval" = "$ol_val" ; then
1493                         ol_arg="$ol_val"
1494                 fi
1495         done
1496         if test "$ol_arg" = "invalid" ; then
1497                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
1498         fi
1499         ol_enable_slurpd="$ol_arg"
1500
1501 else
1502         ol_enable_slurpd="auto"
1503 fi
1504 # end --enable-slurpd
1505
1506 # Check whether --with-xxliboptions or --without-xxliboptions was given.
1507 if test "${with_xxliboptions+set}" = set; then
1508   withval="$with_xxliboptions"
1509   :
1510 fi
1511
1512 # Check whether --enable-static or --disable-static was given.
1513 if test "${enable_static+set}" = set; then
1514   enableval="$enable_static"
1515   p=${PACKAGE-default}
1516 case "$enableval" in
1517 yes) enable_static=yes ;;
1518 no) enable_static=no ;;
1519 *)
1520   enable_static=no
1521   # Look at the argument we got.  We use all the common list separators.
1522   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1523   for pkg in $enableval; do
1524     if test "X$pkg" = "X$p"; then
1525       enable_static=yes
1526     fi
1527   done
1528   IFS="$ac_save_ifs"
1529   ;;
1530 esac
1531 else
1532   enable_static=yes
1533 fi
1534
1535 # Check whether --enable-shared or --disable-shared was given.
1536 if test "${enable_shared+set}" = set; then
1537   enableval="$enable_shared"
1538   p=${PACKAGE-default}
1539 case "$enableval" in
1540 yes) enable_shared=yes ;;
1541 no) enable_shared=no ;;
1542 *)
1543   enable_shared=no
1544   # Look at the argument we got.  We use all the common list separators.
1545   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1546   for pkg in $enableval; do
1547     if test "X$pkg" = "X$p"; then
1548       enable_shared=yes
1549     fi
1550   done
1551   IFS="$ac_save_ifs"
1552   ;;
1553 esac
1554 else
1555   enable_shared=yes
1556 fi
1557
1558
1559 # validate options
1560 if test $ol_enable_dns = yes ; then
1561         if test $ol_enable_referrals = no ; then
1562                 { echo "configure: error: DNS requires --enable-referrals" 1>&2; exit 1; }
1563         fi
1564         if test $ol_enable_referrals = auto ; then
1565                 echo "configure: warning: DNS requires referrals, adding --enable-referrals" 1>&2
1566                 ol_enable_referrals=yes
1567         fi
1568 fi
1569
1570 if test $ol_enable_slapd = no ; then
1571                 if test $ol_enable_bdb2 = yes ; then
1572                 echo "configure: warning: slapd disabled, ignoring --enable_bdb2 argument" 1>&2
1573         fi
1574         if test $ol_enable_ldbm = yes ; then
1575                 echo "configure: warning: slapd disabled, ignoring --enable_ldbm argument" 1>&2
1576         fi
1577         if test $ol_enable_passwd = yes ; then
1578                 echo "configure: warning: slapd disabled, ignoring --enable_passwd argument" 1>&2
1579         fi
1580         if test $ol_enable_perl = yes ; then
1581                 echo "configure: warning: slapd disabled, ignoring --enable_perl argument" 1>&2
1582         fi
1583         if test $ol_enable_shell = yes ; then
1584                 echo "configure: warning: slapd disabled, ignoring --enable_shell argument" 1>&2
1585         fi
1586         if test $ol_enable_tcl = yes ; then
1587                 echo "configure: warning: slapd disabled, ignoring --enable_tcl argument" 1>&2
1588         fi
1589         if test $ol_enable_aclgroups = yes ; then
1590                 echo "configure: warning: slapd disabled, ignoring --enable_aclgroups argument" 1>&2
1591         fi
1592         if test $ol_enable_wrappers = yes ; then
1593                 echo "configure: warning: slapd disabled, ignoring --enable_wrappers argument" 1>&2
1594         fi
1595         if test $ol_enable_phonetic = yes ; then
1596                 echo "configure: warning: slapd disabled, ignoring --enable_phonetic argument" 1>&2
1597         fi
1598         if test $ol_enable_rlookups = yes ; then
1599                 echo "configure: warning: slapd disabled, ignoring --enable_rlookups argument" 1>&2
1600         fi
1601         if test $ol_with_ldbm_api != auto ; then
1602                 echo "configure: warning: slapd disabled, ignoring --with_ldbm_api argument" 1>&2
1603         fi
1604         if test $ol_with_ldbm_type != auto ; then
1605                 echo "configure: warning: slapd disabled, ignoring --with_ldbm_type argument" 1>&2
1606         fi
1607         if test $ol_enable_slurpd = yes ; then
1608                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
1609         fi
1610
1611         # force settings to no
1612         ol_enable_bdb2=no
1613         ol_enable_ldbm=no
1614         ol_enable_passwd=no
1615         ol_enable_perl=no
1616         ol_enable_shell=no
1617         ol_enable_tcl=no
1618         ol_enable_aclgroups=no
1619         ol_enable_wrappers=no
1620         ol_enable_phonetic=no
1621         ol_enable_rlookups=no
1622         ol_with_ldbm_api=no
1623         ol_with_ldbm_type=no
1624         ol_enable_slurpd=no
1625
1626 elif test $ol_enable_ldbm = no ; then
1627         
1628         if test $ol_with_ldbm_api != auto ; then
1629                 echo "configure: warning: LDBM disabled, ignoring --with_ldbm_api argument" 1>&2
1630         fi
1631
1632         if test $ol_with_ldbm_type != auto ; then
1633                 echo "configure: warning: LDBM disabled, ignoring --with_ldbm_type argument" 1>&2
1634         fi
1635
1636         if test $ol_enable_bdb2 = yes ; then
1637                 { echo "configure: error: BDB2 requires --enable-ldbm" 1>&2; exit 1; }
1638         fi
1639
1640         if test $ol_enable_passwd = no -a \
1641                 $ol_enable_perl = no -a \
1642                 $ol_enable_shell = no -a \
1643                 $ol_enable_tcl = no ; then
1644                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
1645         fi
1646
1647         ol_with_ldbm_api=no
1648         ol_with_ldbm_type=no
1649
1650 elif test $ol_enable_bdb2 = yes ; then
1651         
1652         if test $ol_with_ldbm_api != auto -a \
1653                 $ol_with_ldbm_api != db2 ; then
1654                 { echo "configure: error: BDB2 requires LDBM API DB2" 1>&2; exit 1; }
1655         fi
1656
1657         ol_with_ldbm_api=db2
1658
1659 else
1660         
1661         if test $ol_enable_bdb2 != no ; then
1662                 if test $ol_with_ldbm_api != auto -a \
1663                         $ol_with_ldbm_api != db2 ; then
1664                         echo "configure: warning: BDB2 requires LDBM api db2 or auto" 1>&2
1665                         ol_enable_bdb2=no
1666                 fi
1667         fi
1668
1669         if test $ol_with_ldbm_api = gdbm -a \
1670                 $ol_with_ldbm_type = btree ; then
1671                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
1672         fi
1673         if test $ol_with_ldbm_api = mdbm -a \
1674                 $ol_with_ldbm_type = btree ; then
1675                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
1676         fi
1677         if test $ol_with_ldbm_api = ndbm -a \
1678                 $ol_with_ldbm_type = btree ; then
1679                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
1680         fi
1681 fi
1682
1683 if test $ol_enable_slurpd = yes ; then
1684                 if test $ol_with_threads = no ; then
1685                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
1686         fi
1687 fi
1688
1689 echo "$ac_t""done" 1>&6
1690
1691 ## Initialize vars
1692 LDAP_LIBS=
1693 LDBM_LIBS=
1694 LTHREAD_LIBS=
1695 LUTIL_LIBS=
1696
1697 LDAPD_LIBS=
1698 SLAPD_LIBS=
1699 SLURPD_LIBS=
1700
1701 BUILD_LDAPD=no
1702 BUILD_SLAPD=no
1703 BUILD_SLURPD=no
1704
1705 BUILD_BDB2=no
1706 BUILD_LDBM=no
1707 BUILD_PASSWD=no
1708 BUILD_PERL=no
1709 BUILD_SHELL=no
1710 BUILD_TCL=no
1711 BUILD_THREAD=no
1712
1713 SLAPD_PERL_LDFLAGS=
1714 SLAPD_PERL_CPPFLAGS=
1715
1716 KRB_LIBS=
1717 READLINE_LIBS=
1718 TERMCAP_LIBS=
1719 TLS_LIBS=
1720
1721
1722 # Find a good install program.  We prefer a C program (faster),
1723 # so one script is as good as another.  But avoid the broken or
1724 # incompatible versions:
1725 # SysV /etc/install, /usr/sbin/install
1726 # SunOS /usr/etc/install
1727 # IRIX /sbin/install
1728 # AIX /bin/install
1729 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1730 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1731 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1732 # ./install, which can be erroneously created by make from ./install.sh.
1733 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1734 echo "configure:1735: checking for a BSD compatible install" >&5
1735 if test -z "$INSTALL"; then
1736 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1737   echo $ac_n "(cached) $ac_c" 1>&6
1738 else
1739     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1740   for ac_dir in $PATH; do
1741     # Account for people who put trailing slashes in PATH elements.
1742     case "$ac_dir/" in
1743     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1744     *)
1745       # OSF1 and SCO ODT 3.0 have their own names for install.
1746       # Don't use installbsd from OSF since it installs stuff as root
1747       # by default.
1748       for ac_prog in ginstall scoinst install; do
1749         if test -f $ac_dir/$ac_prog; then
1750           if test $ac_prog = install &&
1751             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1752             # AIX install.  It has an incompatible calling convention.
1753             :
1754           else
1755             ac_cv_path_install="$ac_dir/$ac_prog -c"
1756             break 2
1757           fi
1758         fi
1759       done
1760       ;;
1761     esac
1762   done
1763   IFS="$ac_save_IFS"
1764
1765 fi
1766   if test "${ac_cv_path_install+set}" = set; then
1767     INSTALL="$ac_cv_path_install"
1768   else
1769     # As a last resort, use the slow shell script.  We don't cache a
1770     # path for INSTALL within a source directory, because that will
1771     # break other packages using the cache if that directory is
1772     # removed, or if the path is relative.
1773     INSTALL="$ac_install_sh"
1774   fi
1775 fi
1776 echo "$ac_t""$INSTALL" 1>&6
1777
1778 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1779 # It thinks the first close brace ends the variable substitution.
1780 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1781
1782 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1783
1784 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1785
1786
1787 CC=${CC-"cc"}
1788
1789
1790 # Make sure we can run config.sub.
1791 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
1792 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
1793 fi
1794
1795 echo $ac_n "checking host system type""... $ac_c" 1>&6
1796 echo "configure:1797: checking host system type" >&5
1797
1798 host_alias=$host
1799 case "$host_alias" in
1800 NONE)
1801   case $nonopt in
1802   NONE)
1803     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
1804     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
1805     fi ;;
1806   *) host_alias=$nonopt ;;
1807   esac ;;
1808 esac
1809
1810 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
1811 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1812 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1813 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1814 echo "$ac_t""$host" 1>&6
1815
1816 # Extract the first word of "ranlib", so it can be a program name with args.
1817 set dummy ranlib; ac_word=$2
1818 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1819 echo "configure:1820: checking for $ac_word" >&5
1820 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1821   echo $ac_n "(cached) $ac_c" 1>&6
1822 else
1823   if test -n "$RANLIB"; then
1824   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1825 else
1826   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1827   ac_dummy="$PATH"
1828   for ac_dir in $ac_dummy; do
1829     test -z "$ac_dir" && ac_dir=.
1830     if test -f $ac_dir/$ac_word; then
1831       ac_cv_prog_RANLIB="ranlib"
1832       break
1833     fi
1834   done
1835   IFS="$ac_save_ifs"
1836   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1837 fi
1838 fi
1839 RANLIB="$ac_cv_prog_RANLIB"
1840 if test -n "$RANLIB"; then
1841   echo "$ac_t""$RANLIB" 1>&6
1842 else
1843   echo "$ac_t""no" 1>&6
1844 fi
1845
1846 # Extract the first word of "gcc", so it can be a program name with args.
1847 set dummy gcc; ac_word=$2
1848 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1849 echo "configure:1850: checking for $ac_word" >&5
1850 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1851   echo $ac_n "(cached) $ac_c" 1>&6
1852 else
1853   if test -n "$CC"; then
1854   ac_cv_prog_CC="$CC" # Let the user override the test.
1855 else
1856   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1857   ac_dummy="$PATH"
1858   for ac_dir in $ac_dummy; do
1859     test -z "$ac_dir" && ac_dir=.
1860     if test -f $ac_dir/$ac_word; then
1861       ac_cv_prog_CC="gcc"
1862       break
1863     fi
1864   done
1865   IFS="$ac_save_ifs"
1866 fi
1867 fi
1868 CC="$ac_cv_prog_CC"
1869 if test -n "$CC"; then
1870   echo "$ac_t""$CC" 1>&6
1871 else
1872   echo "$ac_t""no" 1>&6
1873 fi
1874
1875 if test -z "$CC"; then
1876   # Extract the first word of "cc", so it can be a program name with args.
1877 set dummy cc; ac_word=$2
1878 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1879 echo "configure:1880: checking for $ac_word" >&5
1880 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1881   echo $ac_n "(cached) $ac_c" 1>&6
1882 else
1883   if test -n "$CC"; then
1884   ac_cv_prog_CC="$CC" # Let the user override the test.
1885 else
1886   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1887   ac_prog_rejected=no
1888   ac_dummy="$PATH"
1889   for ac_dir in $ac_dummy; do
1890     test -z "$ac_dir" && ac_dir=.
1891     if test -f $ac_dir/$ac_word; then
1892       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1893         ac_prog_rejected=yes
1894         continue
1895       fi
1896       ac_cv_prog_CC="cc"
1897       break
1898     fi
1899   done
1900   IFS="$ac_save_ifs"
1901 if test $ac_prog_rejected = yes; then
1902   # We found a bogon in the path, so make sure we never use it.
1903   set dummy $ac_cv_prog_CC
1904   shift
1905   if test $# -gt 0; then
1906     # We chose a different compiler from the bogus one.
1907     # However, it has the same basename, so the bogon will be chosen
1908     # first if we set CC to just the basename; use the full file name.
1909     shift
1910     set dummy "$ac_dir/$ac_word" "$@"
1911     shift
1912     ac_cv_prog_CC="$@"
1913   fi
1914 fi
1915 fi
1916 fi
1917 CC="$ac_cv_prog_CC"
1918 if test -n "$CC"; then
1919   echo "$ac_t""$CC" 1>&6
1920 else
1921   echo "$ac_t""no" 1>&6
1922 fi
1923
1924   if test -z "$CC"; then
1925     case "`uname -s`" in
1926     *win32* | *WIN32*)
1927       # Extract the first word of "cl", so it can be a program name with args.
1928 set dummy cl; ac_word=$2
1929 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1930 echo "configure:1931: checking for $ac_word" >&5
1931 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1932   echo $ac_n "(cached) $ac_c" 1>&6
1933 else
1934   if test -n "$CC"; then
1935   ac_cv_prog_CC="$CC" # Let the user override the test.
1936 else
1937   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1938   ac_dummy="$PATH"
1939   for ac_dir in $ac_dummy; do
1940     test -z "$ac_dir" && ac_dir=.
1941     if test -f $ac_dir/$ac_word; then
1942       ac_cv_prog_CC="cl"
1943       break
1944     fi
1945   done
1946   IFS="$ac_save_ifs"
1947 fi
1948 fi
1949 CC="$ac_cv_prog_CC"
1950 if test -n "$CC"; then
1951   echo "$ac_t""$CC" 1>&6
1952 else
1953   echo "$ac_t""no" 1>&6
1954 fi
1955  ;;
1956     esac
1957   fi
1958   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1959 fi
1960
1961 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1962 echo "configure:1963: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1963
1964 ac_ext=c
1965 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1966 ac_cpp='$CPP $CPPFLAGS'
1967 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1968 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1969 cross_compiling=$ac_cv_prog_cc_cross
1970
1971 cat > conftest.$ac_ext << EOF
1972
1973 #line 1974 "configure"
1974 #include "confdefs.h"
1975
1976 main(){return(0);}
1977 EOF
1978 if { (eval echo configure:1979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1979   ac_cv_prog_cc_works=yes
1980   # If we can't run a trivial program, we are probably using a cross compiler.
1981   if (./conftest; exit) 2>/dev/null; then
1982     ac_cv_prog_cc_cross=no
1983   else
1984     ac_cv_prog_cc_cross=yes
1985   fi
1986 else
1987   echo "configure: failed program was:" >&5
1988   cat conftest.$ac_ext >&5
1989   ac_cv_prog_cc_works=no
1990 fi
1991 rm -fr conftest*
1992 ac_ext=c
1993 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1994 ac_cpp='$CPP $CPPFLAGS'
1995 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1996 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1997 cross_compiling=$ac_cv_prog_cc_cross
1998
1999 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2000 if test $ac_cv_prog_cc_works = no; then
2001   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2002 fi
2003 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2004 echo "configure:2005: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
2005 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2006 cross_compiling=$ac_cv_prog_cc_cross
2007
2008 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2009 echo "configure:2010: checking whether we are using GNU C" >&5
2010 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
2011   echo $ac_n "(cached) $ac_c" 1>&6
2012 else
2013   cat > conftest.c <<EOF
2014 #ifdef __GNUC__
2015   yes;
2016 #endif
2017 EOF
2018 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2019: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2019   ac_cv_prog_gcc=yes
2020 else
2021   ac_cv_prog_gcc=no
2022 fi
2023 fi
2024
2025 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2026
2027 if test $ac_cv_prog_gcc = yes; then
2028   GCC=yes
2029 else
2030   GCC=
2031 fi
2032
2033 ac_test_CFLAGS="${CFLAGS+set}"
2034 ac_save_CFLAGS="$CFLAGS"
2035 CFLAGS=
2036 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2037 echo "configure:2038: checking whether ${CC-cc} accepts -g" >&5
2038 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
2039   echo $ac_n "(cached) $ac_c" 1>&6
2040 else
2041   echo 'void f(){}' > conftest.c
2042 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2043   ac_cv_prog_cc_g=yes
2044 else
2045   ac_cv_prog_cc_g=no
2046 fi
2047 rm -f conftest*
2048
2049 fi
2050
2051 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2052 if test "$ac_test_CFLAGS" = set; then
2053   CFLAGS="$ac_save_CFLAGS"
2054 elif test $ac_cv_prog_cc_g = yes; then
2055   if test "$GCC" = yes; then
2056     CFLAGS="-g -O2"
2057   else
2058     CFLAGS="-g"
2059   fi
2060 else
2061   if test "$GCC" = yes; then
2062     CFLAGS="-O2"
2063   else
2064     CFLAGS=
2065   fi
2066 fi
2067
2068 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2069 if test "${with_gnu_ld+set}" = set; then
2070   withval="$with_gnu_ld"
2071   test "$withval" = no || with_gnu_ld=yes
2072 else
2073   with_gnu_ld=no
2074 fi
2075
2076
2077 ac_prog=ld
2078 if test "$ac_cv_prog_gcc" = yes; then
2079   # Check if gcc -print-prog-name=ld gives a path.
2080   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2081 echo "configure:2082: checking for ld used by GCC" >&5
2082   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2083   case "$ac_prog" in
2084   # Accept absolute paths.
2085   /* | A-Za-z:\\*)
2086     test -z "$LD" && LD="$ac_prog"
2087     ;;
2088   "")
2089     # If it fails, then pretend we aren't using GCC.
2090     ac_prog=ld
2091     ;;
2092   *)
2093     # If it is relative, then search for the first ld in PATH.
2094     with_gnu_ld=unknown
2095     ;;
2096   esac
2097 elif test "$with_gnu_ld" = yes; then
2098   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2099 echo "configure:2100: checking for GNU ld" >&5
2100 else
2101   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2102 echo "configure:2103: checking for non-GNU ld" >&5
2103 fi
2104 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
2105   echo $ac_n "(cached) $ac_c" 1>&6
2106 else
2107   if test -z "$LD"; then
2108   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2109   for ac_dir in $PATH; do
2110     test -z "$ac_dir" && ac_dir=.
2111     if test -f "$ac_dir/$ac_prog"; then
2112       ac_cv_path_LD="$ac_dir/$ac_prog"
2113       # Check to see if the program is GNU ld.  I'd rather use --version,
2114       # but apparently some GNU ld's only accept -v.
2115       # Break only if it was the GNU/non-GNU ld that we prefer.
2116       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2117         test "$with_gnu_ld" != no && break
2118       else
2119         test "$with_gnu_ld" != yes && break
2120       fi
2121     fi
2122   done
2123   IFS="$ac_save_ifs"
2124 else
2125   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2126 fi
2127 fi
2128
2129 LD="$ac_cv_path_LD"
2130 if test -n "$LD"; then
2131   echo "$ac_t""$LD" 1>&6
2132 else
2133   echo "$ac_t""no" 1>&6
2134 fi
2135 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2136
2137 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2138 echo "configure:2139: checking if the linker ($LD) is GNU ld" >&5
2139 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
2140   echo $ac_n "(cached) $ac_c" 1>&6
2141 else
2142   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2143 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2144   ac_cv_prog_gnu_ld=yes
2145 else
2146   ac_cv_prog_gnu_ld=no
2147 fi
2148 fi
2149
2150 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2151
2152
2153 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2154 echo "configure:2155: checking for BSD-compatible nm" >&5
2155 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
2156   echo $ac_n "(cached) $ac_c" 1>&6
2157 else
2158   case "$NM" in
2159 /* | A-Za-z:\\*)
2160   ac_cv_path_NM="$NM" # Let the user override the test with a path.
2161   ;;
2162 *)
2163   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2164   for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
2165     test -z "$ac_dir" && ac_dir=.
2166     if test -f $ac_dir/nm; then
2167       # Check to see if the nm accepts a BSD-compat flag.
2168       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2169       #   nm: unknown option "B" ignored
2170       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2171         ac_cv_path_NM="$ac_dir/nm -B"
2172       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2173         ac_cv_path_NM="$ac_dir/nm -p"
2174       else
2175         ac_cv_path_NM="$ac_dir/nm"
2176       fi
2177       break
2178     fi
2179   done
2180   IFS="$ac_save_ifs"
2181   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2182   ;;
2183 esac
2184 fi
2185
2186 NM="$ac_cv_path_NM"
2187 echo "$ac_t""$NM" 1>&6
2188
2189
2190 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2191 echo "configure:2192: checking whether ln -s works" >&5
2192 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2193   echo $ac_n "(cached) $ac_c" 1>&6
2194 else
2195   rm -f conftestdata
2196 if ln -s X conftestdata 2>/dev/null
2197 then
2198   rm -f conftestdata
2199   ac_cv_prog_LN_S="ln -s"
2200 else
2201   ac_cv_prog_LN_S=ln
2202 fi
2203 fi
2204 LN_S="$ac_cv_prog_LN_S"
2205 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2206   echo "$ac_t""yes" 1>&6
2207 else
2208   echo "$ac_t""no" 1>&6
2209 fi
2210
2211 # Always use our own libtool.
2212 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
2213
2214 # Check for any special flags to pass to ltconfig.
2215 libtool_flags=
2216 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2217 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2218 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
2219 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2220 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2221
2222 # Some flags need to be propagated to the compiler or linker for good
2223 # libtool support.
2224 case "$host" in
2225 *-*-irix6*)
2226   # Find out which ABI we are using.
2227   echo '#line 2228 "configure"' > conftest.$ac_ext
2228   if { (eval echo configure:2229: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2229     case "`/usr/bin/file conftest.o`" in
2230     *32-bit*)
2231       LD="${LD-ld} -32"
2232       ;;
2233     *N32*)
2234       LD="${LD-ld} -n32"
2235       ;;
2236     *64-bit*)
2237       LD="${LD-ld} -64"
2238       ;;
2239     esac
2240   fi
2241   rm -rf conftest*
2242   ;;
2243
2244 *-*-sco3.2v5*)
2245   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2246   CFLAGS="$CFLAGS -belf"
2247   ;;
2248 esac
2249
2250 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
2251 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
2252 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
2253 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
2254 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
2255 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
2256
2257
2258 for ac_prog in mawk gawk nawk awk
2259 do
2260 # Extract the first word of "$ac_prog", so it can be a program name with args.
2261 set dummy $ac_prog; ac_word=$2
2262 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2263 echo "configure:2264: checking for $ac_word" >&5
2264 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
2265   echo $ac_n "(cached) $ac_c" 1>&6
2266 else
2267   if test -n "$AWK"; then
2268   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2269 else
2270   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2271   ac_dummy="$PATH"
2272   for ac_dir in $ac_dummy; do
2273     test -z "$ac_dir" && ac_dir=.
2274     if test -f $ac_dir/$ac_word; then
2275       ac_cv_prog_AWK="$ac_prog"
2276       break
2277     fi
2278   done
2279   IFS="$ac_save_ifs"
2280 fi
2281 fi
2282 AWK="$ac_cv_prog_AWK"
2283 if test -n "$AWK"; then
2284   echo "$ac_t""$AWK" 1>&6
2285 else
2286   echo "$ac_t""no" 1>&6
2287 fi
2288
2289 test -n "$AWK" && break
2290 done
2291
2292 # test for ln hardlink support
2293 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
2294 echo "configure:2295: checking whether ln works" >&5
2295 if eval "test \"`echo '$''{'ol_cv_prog_LN_H'+set}'`\" = set"; then
2296   echo $ac_n "(cached) $ac_c" 1>&6
2297 else
2298   rm -f conftest.src conftest.dst
2299 echo "conftest" > conftest.src
2300 if ln conftest.src conftest.dst 2>/dev/null
2301 then
2302   ol_cv_prog_LN_H="ln"
2303 else
2304   ol_cv_prog_LN_H="cp"
2305 fi
2306 rm -f conftest.src conftest.dst
2307
2308 fi
2309 LN_H="$ol_cv_prog_LN_H"
2310 if test "$ol_cv_prog_LN_H" = "ln"; then
2311         echo "$ac_t""yes" 1>&6
2312 else
2313         echo "$ac_t""no" 1>&6
2314 fi
2315
2316 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2317 echo "configure:2318: checking whether ln -s works" >&5
2318 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2319   echo $ac_n "(cached) $ac_c" 1>&6
2320 else
2321   rm -f conftestdata
2322 if ln -s X conftestdata 2>/dev/null
2323 then
2324   rm -f conftestdata
2325   ac_cv_prog_LN_S="ln -s"
2326 else
2327   ac_cv_prog_LN_S=ln
2328 fi
2329 fi
2330 LN_S="$ac_cv_prog_LN_S"
2331 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2332   echo "$ac_t""yes" 1>&6
2333 else
2334   echo "$ac_t""no" 1>&6
2335 fi
2336
2337
2338 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
2339         LN_S="$LN_H"
2340 fi
2341
2342 # Extract the first word of "sendmail", so it can be a program name with args.
2343 set dummy sendmail; ac_word=$2
2344 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2345 echo "configure:2346: checking for $ac_word" >&5
2346 if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then
2347   echo $ac_n "(cached) $ac_c" 1>&6
2348 else
2349   case "$SENDMAIL" in
2350   /*)
2351   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
2352   ;;
2353   ?:/*)                  
2354   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
2355   ;;
2356   *)
2357   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2358   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
2359   for ac_dir in $ac_dummy; do 
2360     test -z "$ac_dir" && ac_dir=.
2361     if test -f $ac_dir/$ac_word; then
2362       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
2363       break
2364     fi
2365   done
2366   IFS="$ac_save_ifs"
2367   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
2368   ;;
2369 esac
2370 fi
2371 SENDMAIL="$ac_cv_path_SENDMAIL"
2372 if test -n "$SENDMAIL"; then
2373   echo "$ac_t""$SENDMAIL" 1>&6
2374 else
2375   echo "$ac_t""no" 1>&6
2376 fi
2377
2378 # Extract the first word of "vi", so it can be a program name with args.
2379 set dummy vi; ac_word=$2
2380 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2381 echo "configure:2382: checking for $ac_word" >&5
2382 if eval "test \"`echo '$''{'ac_cv_path_EDITOR'+set}'`\" = set"; then
2383   echo $ac_n "(cached) $ac_c" 1>&6
2384 else
2385   case "$EDITOR" in
2386   /*)
2387   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
2388   ;;
2389   ?:/*)                  
2390   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
2391   ;;
2392   *)
2393   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2394   ac_dummy="$PATH:/usr/ucb"
2395   for ac_dir in $ac_dummy; do 
2396     test -z "$ac_dir" && ac_dir=.
2397     if test -f $ac_dir/$ac_word; then
2398       ac_cv_path_EDITOR="$ac_dir/$ac_word"
2399       break
2400     fi
2401   done
2402   IFS="$ac_save_ifs"
2403   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
2404   ;;
2405 esac
2406 fi
2407 EDITOR="$ac_cv_path_EDITOR"
2408 if test -n "$EDITOR"; then
2409   echo "$ac_t""$EDITOR" 1>&6
2410 else
2411   echo "$ac_t""no" 1>&6
2412 fi
2413
2414 # Extract the first word of "finger", so it can be a program name with args.
2415 set dummy finger; ac_word=$2
2416 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2417 echo "configure:2418: checking for $ac_word" >&5
2418 if eval "test \"`echo '$''{'ac_cv_path_FINGER'+set}'`\" = set"; then
2419   echo $ac_n "(cached) $ac_c" 1>&6
2420 else
2421   case "$FINGER" in
2422   /*)
2423   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
2424   ;;
2425   ?:/*)                  
2426   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
2427   ;;
2428   *)
2429   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2430   ac_dummy="$PATH:/usr/ucb"
2431   for ac_dir in $ac_dummy; do 
2432     test -z "$ac_dir" && ac_dir=.
2433     if test -f $ac_dir/$ac_word; then
2434       ac_cv_path_FINGER="$ac_dir/$ac_word"
2435       break
2436     fi
2437   done
2438   IFS="$ac_save_ifs"
2439   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
2440   ;;
2441 esac
2442 fi
2443 FINGER="$ac_cv_path_FINGER"
2444 if test -n "$FINGER"; then
2445   echo "$ac_t""$FINGER" 1>&6
2446 else
2447   echo "$ac_t""no" 1>&6
2448 fi
2449
2450
2451 if test $ol_enable_perl = yes ; then
2452         # Extract the first word of "perl", so it can be a program name with args.
2453 set dummy perl; ac_word=$2
2454 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2455 echo "configure:2456: checking for $ac_word" >&5
2456 if eval "test \"`echo '$''{'ac_cv_path_PERLBIN'+set}'`\" = set"; then
2457   echo $ac_n "(cached) $ac_c" 1>&6
2458 else
2459   case "$PERLBIN" in
2460   /*)
2461   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
2462   ;;
2463   ?:/*)                  
2464   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
2465   ;;
2466   *)
2467   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2468   ac_dummy="$PATH"
2469   for ac_dir in $ac_dummy; do 
2470     test -z "$ac_dir" && ac_dir=.
2471     if test -f $ac_dir/$ac_word; then
2472       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
2473       break
2474     fi
2475   done
2476   IFS="$ac_save_ifs"
2477   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
2478   ;;
2479 esac
2480 fi
2481 PERLBIN="$ac_cv_path_PERLBIN"
2482 if test -n "$PERLBIN"; then
2483   echo "$ac_t""$PERLBIN" 1>&6
2484 else
2485   echo "$ac_t""no" 1>&6
2486 fi
2487
2488
2489         if test "no$PERLBIN" = "no" ; then
2490                 ol_enable_perl=no
2491         fi
2492
2493         SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
2494         SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e perl_inc`"
2495 fi
2496
2497 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2498 echo "configure:2499: checking how to run the C preprocessor" >&5
2499 # On Suns, sometimes $CPP names a directory.
2500 if test -n "$CPP" && test -d "$CPP"; then
2501   CPP=
2502 fi
2503 if test -z "$CPP"; then
2504 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
2505   echo $ac_n "(cached) $ac_c" 1>&6
2506 else
2507     # This must be in double quotes, not single quotes, because CPP may get
2508   # substituted into the Makefile and "${CC-cc}" will confuse make.
2509   CPP="${CC-cc} -E"
2510   # On the NeXT, cc -E runs the code through the compiler's parser,
2511   # not just through cpp.
2512   cat > conftest.$ac_ext <<EOF
2513 #line 2514 "configure"
2514 #include "confdefs.h"
2515 #include <assert.h>
2516 Syntax Error
2517 EOF
2518 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2519 { (eval echo configure:2520: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2520 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2521 if test -z "$ac_err"; then
2522   :
2523 else
2524   echo "$ac_err" >&5
2525   echo "configure: failed program was:" >&5
2526   cat conftest.$ac_ext >&5
2527   rm -rf conftest*
2528   CPP="${CC-cc} -E -traditional-cpp"
2529   cat > conftest.$ac_ext <<EOF
2530 #line 2531 "configure"
2531 #include "confdefs.h"
2532 #include <assert.h>
2533 Syntax Error
2534 EOF
2535 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2536 { (eval echo configure:2537: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2537 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2538 if test -z "$ac_err"; then
2539   :
2540 else
2541   echo "$ac_err" >&5
2542   echo "configure: failed program was:" >&5
2543   cat conftest.$ac_ext >&5
2544   rm -rf conftest*
2545   CPP="${CC-cc} -nologo -E"
2546   cat > conftest.$ac_ext <<EOF
2547 #line 2548 "configure"
2548 #include "confdefs.h"
2549 #include <assert.h>
2550 Syntax Error
2551 EOF
2552 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2553 { (eval echo configure:2554: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2554 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2555 if test -z "$ac_err"; then
2556   :
2557 else
2558   echo "$ac_err" >&5
2559   echo "configure: failed program was:" >&5
2560   cat conftest.$ac_ext >&5
2561   rm -rf conftest*
2562   CPP=/lib/cpp
2563 fi
2564 rm -f conftest*
2565 fi
2566 rm -f conftest*
2567 fi
2568 rm -f conftest*
2569   ac_cv_prog_CPP="$CPP"
2570 fi
2571   CPP="$ac_cv_prog_CPP"
2572 else
2573   ac_cv_prog_CPP="$CPP"
2574 fi
2575 echo "$ac_t""$CPP" 1>&6
2576
2577
2578 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
2579         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
2580
2581 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
2582         echo "configure: warning: programs compiled here do run here..." 1>&2
2583         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
2584
2585 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
2586         echo "configure: warning: programs compiled here do not run here..." 1>&2
2587         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
2588 fi
2589
2590 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2591 echo "configure:2592: checking for AIX" >&5
2592 cat > conftest.$ac_ext <<EOF
2593 #line 2594 "configure"
2594 #include "confdefs.h"
2595 #ifdef _AIX
2596   yes
2597 #endif
2598
2599 EOF
2600 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2601   egrep "yes" >/dev/null 2>&1; then
2602   rm -rf conftest*
2603   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
2604 #define _ALL_SOURCE 1
2605 EOF
2606
2607 else
2608   rm -rf conftest*
2609   echo "$ac_t""no" 1>&6
2610 fi
2611 rm -f conftest*
2612
2613
2614 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
2615 echo "configure:2616: checking for POSIXized ISC" >&5
2616 if test -d /etc/conf/kconfig.d &&
2617   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
2618 then
2619   echo "$ac_t""yes" 1>&6
2620   ISC=yes # If later tests want to check for ISC.
2621   cat >> confdefs.h <<\EOF
2622 #define _POSIX_SOURCE 1
2623 EOF
2624
2625   if test "$GCC" = yes; then
2626     CC="$CC -posix"
2627   else
2628     CC="$CC -Xp"
2629   fi
2630 else
2631   echo "$ac_t""no" 1>&6
2632   ISC=
2633 fi
2634
2635 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
2636 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
2637 echo "configure:2638: checking for minix/config.h" >&5
2638 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2639   echo $ac_n "(cached) $ac_c" 1>&6
2640 else
2641   cat > conftest.$ac_ext <<EOF
2642 #line 2643 "configure"
2643 #include "confdefs.h"
2644 #include <minix/config.h>
2645 EOF
2646 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2647 { (eval echo configure:2648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2648 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2649 if test -z "$ac_err"; then
2650   rm -rf conftest*
2651   eval "ac_cv_header_$ac_safe=yes"
2652 else
2653   echo "$ac_err" >&5
2654   echo "configure: failed program was:" >&5
2655   cat conftest.$ac_ext >&5
2656   rm -rf conftest*
2657   eval "ac_cv_header_$ac_safe=no"
2658 fi
2659 rm -f conftest*
2660 fi
2661 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2662   echo "$ac_t""yes" 1>&6
2663   MINIX=yes
2664 else
2665   echo "$ac_t""no" 1>&6
2666 MINIX=
2667 fi
2668
2669 if test "$MINIX" = yes; then
2670   cat >> confdefs.h <<\EOF
2671 #define _POSIX_SOURCE 1
2672 EOF
2673
2674   cat >> confdefs.h <<\EOF
2675 #define _POSIX_1_SOURCE 2
2676 EOF
2677
2678   cat >> confdefs.h <<\EOF
2679 #define _MINIX 1
2680 EOF
2681
2682 fi
2683
2684
2685 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
2686 echo "configure:2687: checking for be_app in -lbe" >&5
2687 ac_lib_var=`echo be'_'be_app | sed 'y%./+-%__p_%'`
2688 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2689   echo $ac_n "(cached) $ac_c" 1>&6
2690 else
2691   ac_save_LIBS="$LIBS"
2692 LIBS="-lbe -lroot $LIBS"
2693 cat > conftest.$ac_ext <<EOF
2694 #line 2695 "configure"
2695 #include "confdefs.h"
2696 /* Override any gcc2 internal prototype to avoid an error.  */
2697 /* We use char because int might match the return type of a gcc2
2698     builtin and then its argument prototype would still apply.  */
2699 char be_app();
2700
2701 int main() {
2702 be_app()
2703 ; return 0; }
2704 EOF
2705 if { (eval echo configure:2706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2706   rm -rf conftest*
2707   eval "ac_cv_lib_$ac_lib_var=yes"
2708 else
2709   echo "configure: failed program was:" >&5
2710   cat conftest.$ac_ext >&5
2711   rm -rf conftest*
2712   eval "ac_cv_lib_$ac_lib_var=no"
2713 fi
2714 rm -f conftest*
2715 LIBS="$ac_save_LIBS"
2716
2717 fi
2718 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2719   echo "$ac_t""yes" 1>&6
2720   LIBS="$LIBS -lbe -lroot"
2721 else
2722   echo "$ac_t""no" 1>&6
2723 :
2724 fi
2725
2726
2727 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
2728 echo "configure:2729: checking for Cygwin environment" >&5
2729 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
2730   echo $ac_n "(cached) $ac_c" 1>&6
2731 else
2732   cat > conftest.$ac_ext <<EOF
2733 #line 2734 "configure"
2734 #include "confdefs.h"
2735
2736 int main() {
2737
2738 #ifndef __CYGWIN__
2739 #define __CYGWIN__ __CYGWIN32__
2740 #endif
2741 return __CYGWIN__;
2742 ; return 0; }
2743 EOF
2744 if { (eval echo configure:2745: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2745   rm -rf conftest*
2746   ac_cv_cygwin=yes
2747 else
2748   echo "configure: failed program was:" >&5
2749   cat conftest.$ac_ext >&5
2750   rm -rf conftest*
2751   ac_cv_cygwin=no
2752 fi
2753 rm -f conftest*
2754 rm -f conftest*
2755 fi
2756
2757 echo "$ac_t""$ac_cv_cygwin" 1>&6
2758 CYGWIN=
2759 test "$ac_cv_cygwin" = yes && CYGWIN=yes
2760 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
2761 echo "configure:2762: checking for mingw32 environment" >&5
2762 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
2763   echo $ac_n "(cached) $ac_c" 1>&6
2764 else
2765   cat > conftest.$ac_ext <<EOF
2766 #line 2767 "configure"
2767 #include "confdefs.h"
2768
2769 int main() {
2770 return __MINGW32__;
2771 ; return 0; }
2772 EOF
2773 if { (eval echo configure:2774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2774   rm -rf conftest*
2775   ac_cv_mingw32=yes
2776 else
2777   echo "configure: failed program was:" >&5
2778   cat conftest.$ac_ext >&5
2779   rm -rf conftest*
2780   ac_cv_mingw32=no
2781 fi
2782 rm -f conftest*
2783 rm -f conftest*
2784 fi
2785
2786 echo "$ac_t""$ac_cv_mingw32" 1>&6
2787 MINGW32=
2788 test "$ac_cv_mingw32" = yes && MINGW32=yes
2789
2790
2791 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
2792 echo "configure:2793: checking for executable suffix" >&5
2793 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
2794   echo $ac_n "(cached) $ac_c" 1>&6
2795 else
2796   if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
2797   ac_cv_exeext=.exe
2798 else
2799   rm -f conftest*
2800   echo 'int main () { return 0; }' > conftest.$ac_ext
2801   ac_cv_exeext=
2802   if { (eval echo configure:2803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
2803     for file in conftest.*; do
2804       case $file in
2805       *.c | *.o | *.obj) ;;
2806       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
2807       esac
2808     done
2809   else
2810     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
2811   fi
2812   rm -f conftest*
2813   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
2814 fi
2815 fi
2816
2817 EXEEXT=""
2818 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
2819 echo "$ac_t""${ac_cv_exeext}" 1>&6
2820 ac_exeext=$EXEEXT
2821
2822 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
2823 echo "configure:2824: checking for object suffix" >&5
2824 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
2825   echo $ac_n "(cached) $ac_c" 1>&6
2826 else
2827   rm -f conftest*
2828 echo 'int i = 1;' > conftest.$ac_ext
2829 if { (eval echo configure:2830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2830   for ac_file in conftest.*; do
2831     case $ac_file in
2832     *.c) ;;
2833     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
2834     esac
2835   done
2836 else
2837   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
2838 fi
2839 rm -f conftest*
2840 fi
2841
2842 echo "$ac_t""$ac_cv_objext" 1>&6
2843 OBJEXT=$ac_cv_objext
2844 ac_objext=$ac_cv_objext
2845
2846
2847
2848
2849
2850 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
2851 echo "configure:2852: checking for ${CC-cc} option to accept ANSI C" >&5
2852 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
2853   echo $ac_n "(cached) $ac_c" 1>&6
2854 else
2855   am_cv_prog_cc_stdc=no
2856 ac_save_CC="$CC"
2857 # Don't try gcc -ansi; that turns off useful extensions and
2858 # breaks some systems' header files.
2859 # AIX                   -qlanglvl=ansi
2860 # Ultrix and OSF/1      -std1
2861 # HP-UX                 -Aa -D_HPUX_SOURCE
2862 # SVR4                  -Xc -D__EXTENSIONS__
2863 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2864 do
2865   CC="$ac_save_CC $ac_arg"
2866   cat > conftest.$ac_ext <<EOF
2867 #line 2868 "configure"
2868 #include "confdefs.h"
2869 #include <stdarg.h>
2870 #include <stdio.h>
2871 #include <sys/types.h>
2872 #include <sys/stat.h>
2873 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2874 struct buf { int x; };
2875 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2876 static char *e (p, i)
2877      char **p;
2878      int i;
2879 {
2880   return p[i];
2881 }
2882 static char *f (char * (*g) (char **, int), char **p, ...)
2883 {
2884   char *s;
2885   va_list v;
2886   va_start (v,p);
2887   s = g (p, va_arg (v,int));
2888   va_end (v);
2889   return s;
2890 }
2891 int test (int i, double x);
2892 struct s1 {int (*f) (int a);};
2893 struct s2 {int (*f) (double a);};
2894 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2895 int argc;
2896 char **argv;
2897
2898 int main() {
2899
2900 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2901
2902 ; return 0; }
2903 EOF
2904 if { (eval echo configure:2905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2905   rm -rf conftest*
2906   am_cv_prog_cc_stdc="$ac_arg"; break
2907 else
2908   echo "configure: failed program was:" >&5
2909   cat conftest.$ac_ext >&5
2910 fi
2911 rm -f conftest*
2912 done
2913 CC="$ac_save_CC"
2914
2915 fi
2916
2917 if test -z "$am_cv_prog_cc_stdc"; then
2918   echo "$ac_t""none needed" 1>&6
2919 else
2920   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
2921 fi
2922 case "x$am_cv_prog_cc_stdc" in
2923   x|xno) ;;
2924   *) CC="$CC $am_cv_prog_cc_stdc" ;;
2925 esac
2926
2927 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
2928         { echo "configure: error: OpenLDAP requires compiler to support STDC prototypes." 1>&2; exit 1; }
2929 fi
2930
2931
2932
2933
2934 echo $ac_n "checking for socket""... $ac_c" 1>&6
2935 echo "configure:2936: checking for socket" >&5
2936 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
2937   echo $ac_n "(cached) $ac_c" 1>&6
2938 else
2939   cat > conftest.$ac_ext <<EOF
2940 #line 2941 "configure"
2941 #include "confdefs.h"
2942 /* System header to define __stub macros and hopefully few prototypes,
2943     which can conflict with char socket(); below.  */
2944 #include <assert.h>
2945 /* Override any gcc2 internal prototype to avoid an error.  */
2946 /* We use char because int might match the return type of a gcc2
2947     builtin and then its argument prototype would still apply.  */
2948 char socket();
2949
2950 int main() {
2951
2952 /* The GNU C library defines this for functions which it implements
2953     to always fail with ENOSYS.  Some functions are actually named
2954     something starting with __ and the normal name is an alias.  */
2955 #if defined (__stub_socket) || defined (__stub___socket)
2956 choke me
2957 #else
2958 socket();
2959 #endif
2960
2961 ; return 0; }
2962 EOF
2963 if { (eval echo configure:2964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2964   rm -rf conftest*
2965   eval "ac_cv_func_socket=yes"
2966 else
2967   echo "configure: failed program was:" >&5
2968   cat conftest.$ac_ext >&5
2969   rm -rf conftest*
2970   eval "ac_cv_func_socket=no"
2971 fi
2972 rm -f conftest*
2973 fi
2974
2975 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
2976   echo "$ac_t""yes" 1>&6
2977   have_socket=yes
2978 else
2979   echo "$ac_t""no" 1>&6
2980         
2981         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
2982 echo "configure:2983: checking for main in -lsocket" >&5
2983 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
2984 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2985   echo $ac_n "(cached) $ac_c" 1>&6
2986 else
2987   ac_save_LIBS="$LIBS"
2988 LIBS="-lsocket  $LIBS"
2989 cat > conftest.$ac_ext <<EOF
2990 #line 2991 "configure"
2991 #include "confdefs.h"
2992
2993 int main() {
2994 main()
2995 ; return 0; }
2996 EOF
2997 if { (eval echo configure:2998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2998   rm -rf conftest*
2999   eval "ac_cv_lib_$ac_lib_var=yes"
3000 else
3001   echo "configure: failed program was:" >&5
3002   cat conftest.$ac_ext >&5
3003   rm -rf conftest*
3004   eval "ac_cv_lib_$ac_lib_var=no"
3005 fi
3006 rm -f conftest*
3007 LIBS="$ac_save_LIBS"
3008
3009 fi
3010 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3011   echo "$ac_t""yes" 1>&6
3012     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3013     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3014   cat >> confdefs.h <<EOF
3015 #define $ac_tr_lib 1
3016 EOF
3017
3018   LIBS="-lsocket $LIBS"
3019
3020 else
3021   echo "$ac_t""no" 1>&6
3022 fi
3023
3024         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
3025 echo "configure:3026: checking for main in -lnet" >&5
3026 ac_lib_var=`echo net'_'main | sed 'y%./+-%__p_%'`
3027 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3028   echo $ac_n "(cached) $ac_c" 1>&6
3029 else
3030   ac_save_LIBS="$LIBS"
3031 LIBS="-lnet  $LIBS"
3032 cat > conftest.$ac_ext <<EOF
3033 #line 3034 "configure"
3034 #include "confdefs.h"
3035
3036 int main() {
3037 main()
3038 ; return 0; }
3039 EOF
3040 if { (eval echo configure:3041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3041   rm -rf conftest*
3042   eval "ac_cv_lib_$ac_lib_var=yes"
3043 else
3044   echo "configure: failed program was:" >&5
3045   cat conftest.$ac_ext >&5
3046   rm -rf conftest*
3047   eval "ac_cv_lib_$ac_lib_var=no"
3048 fi
3049 rm -f conftest*
3050 LIBS="$ac_save_LIBS"
3051
3052 fi
3053 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3054   echo "$ac_t""yes" 1>&6
3055     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3056     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3057   cat >> confdefs.h <<EOF
3058 #define $ac_tr_lib 1
3059 EOF
3060
3061   LIBS="-lnet $LIBS"
3062
3063 else
3064   echo "$ac_t""no" 1>&6
3065 fi
3066
3067         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
3068 echo "configure:3069: checking for main in -lnsl_s" >&5
3069 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-%__p_%'`
3070 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3071   echo $ac_n "(cached) $ac_c" 1>&6
3072 else
3073   ac_save_LIBS="$LIBS"
3074 LIBS="-lnsl_s  $LIBS"
3075 cat > conftest.$ac_ext <<EOF
3076 #line 3077 "configure"
3077 #include "confdefs.h"
3078
3079 int main() {
3080 main()
3081 ; return 0; }
3082 EOF
3083 if { (eval echo configure:3084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3084   rm -rf conftest*
3085   eval "ac_cv_lib_$ac_lib_var=yes"
3086 else
3087   echo "configure: failed program was:" >&5
3088   cat conftest.$ac_ext >&5
3089   rm -rf conftest*
3090   eval "ac_cv_lib_$ac_lib_var=no"
3091 fi
3092 rm -f conftest*
3093 LIBS="$ac_save_LIBS"
3094
3095 fi
3096 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3097   echo "$ac_t""yes" 1>&6
3098     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3099     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3100   cat >> confdefs.h <<EOF
3101 #define $ac_tr_lib 1
3102 EOF
3103
3104   LIBS="-lnsl_s $LIBS"
3105
3106 else
3107   echo "$ac_t""no" 1>&6
3108 fi
3109
3110         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
3111 echo "configure:3112: checking for main in -lnsl" >&5
3112 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
3113 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3114   echo $ac_n "(cached) $ac_c" 1>&6
3115 else
3116   ac_save_LIBS="$LIBS"
3117 LIBS="-lnsl  $LIBS"
3118 cat > conftest.$ac_ext <<EOF
3119 #line 3120 "configure"
3120 #include "confdefs.h"
3121
3122 int main() {
3123 main()
3124 ; return 0; }
3125 EOF
3126 if { (eval echo configure:3127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3127   rm -rf conftest*
3128   eval "ac_cv_lib_$ac_lib_var=yes"
3129 else
3130   echo "configure: failed program was:" >&5
3131   cat conftest.$ac_ext >&5
3132   rm -rf conftest*
3133   eval "ac_cv_lib_$ac_lib_var=no"
3134 fi
3135 rm -f conftest*
3136 LIBS="$ac_save_LIBS"
3137
3138 fi
3139 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3140   echo "$ac_t""yes" 1>&6
3141     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3142     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3143   cat >> confdefs.h <<EOF
3144 #define $ac_tr_lib 1
3145 EOF
3146
3147   LIBS="-lnsl $LIBS"
3148
3149 else
3150   echo "$ac_t""no" 1>&6
3151 fi
3152
3153         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
3154 echo "configure:3155: checking for socket in -linet" >&5
3155 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
3156 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3157   echo $ac_n "(cached) $ac_c" 1>&6
3158 else
3159   ac_save_LIBS="$LIBS"
3160 LIBS="-linet  $LIBS"
3161 cat > conftest.$ac_ext <<EOF
3162 #line 3163 "configure"
3163 #include "confdefs.h"
3164 /* Override any gcc2 internal prototype to avoid an error.  */
3165 /* We use char because int might match the return type of a gcc2
3166     builtin and then its argument prototype would still apply.  */
3167 char socket();
3168
3169 int main() {
3170 socket()
3171 ; return 0; }
3172 EOF
3173 if { (eval echo configure:3174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3174   rm -rf conftest*
3175   eval "ac_cv_lib_$ac_lib_var=yes"
3176 else
3177   echo "configure: failed program was:" >&5
3178   cat conftest.$ac_ext >&5
3179   rm -rf conftest*
3180   eval "ac_cv_lib_$ac_lib_var=no"
3181 fi
3182 rm -f conftest*
3183 LIBS="$ac_save_LIBS"
3184
3185 fi
3186 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3187   echo "$ac_t""yes" 1>&6
3188     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3189     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3190   cat >> confdefs.h <<EOF
3191 #define $ac_tr_lib 1
3192 EOF
3193
3194   LIBS="-linet $LIBS"
3195
3196 else
3197   echo "$ac_t""no" 1>&6
3198 fi
3199
3200         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
3201 echo "configure:3202: checking for main in -lgen" >&5
3202 ac_lib_var=`echo gen'_'main | sed 'y%./+-%__p_%'`
3203 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3204   echo $ac_n "(cached) $ac_c" 1>&6
3205 else
3206   ac_save_LIBS="$LIBS"
3207 LIBS="-lgen  $LIBS"
3208 cat > conftest.$ac_ext <<EOF
3209 #line 3210 "configure"
3210 #include "confdefs.h"
3211
3212 int main() {
3213 main()
3214 ; return 0; }
3215 EOF
3216 if { (eval echo configure:3217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3217   rm -rf conftest*
3218   eval "ac_cv_lib_$ac_lib_var=yes"
3219 else
3220   echo "configure: failed program was:" >&5
3221   cat conftest.$ac_ext >&5
3222   rm -rf conftest*
3223   eval "ac_cv_lib_$ac_lib_var=no"
3224 fi
3225 rm -f conftest*
3226 LIBS="$ac_save_LIBS"
3227
3228 fi
3229 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3230   echo "$ac_t""yes" 1>&6
3231     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3232     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3233   cat >> confdefs.h <<EOF
3234 #define $ac_tr_lib 1
3235 EOF
3236
3237   LIBS="-lgen $LIBS"
3238
3239 else
3240   echo "$ac_t""no" 1>&6
3241 fi
3242
3243
3244 fi
3245
3246
3247 for ac_func in res_search
3248 do
3249 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3250 echo "configure:3251: checking for $ac_func" >&5
3251 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3252   echo $ac_n "(cached) $ac_c" 1>&6
3253 else
3254   cat > conftest.$ac_ext <<EOF
3255 #line 3256 "configure"
3256 #include "confdefs.h"
3257 /* System header to define __stub macros and hopefully few prototypes,
3258     which can conflict with char $ac_func(); below.  */
3259 #include <assert.h>
3260 /* Override any gcc2 internal prototype to avoid an error.  */
3261 /* We use char because int might match the return type of a gcc2
3262     builtin and then its argument prototype would still apply.  */
3263 char $ac_func();
3264
3265 int main() {
3266
3267 /* The GNU C library defines this for functions which it implements
3268     to always fail with ENOSYS.  Some functions are actually named
3269     something starting with __ and the normal name is an alias.  */
3270 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3271 choke me
3272 #else
3273 $ac_func();
3274 #endif
3275
3276 ; return 0; }
3277 EOF
3278 if { (eval echo configure:3279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3279   rm -rf conftest*
3280   eval "ac_cv_func_$ac_func=yes"
3281 else
3282   echo "configure: failed program was:" >&5
3283   cat conftest.$ac_ext >&5
3284   rm -rf conftest*
3285   eval "ac_cv_func_$ac_func=no"
3286 fi
3287 rm -f conftest*
3288 fi
3289
3290 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3291   echo "$ac_t""yes" 1>&6
3292     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3293   cat >> confdefs.h <<EOF
3294 #define $ac_tr_func 1
3295 EOF
3296  
3297 else
3298   echo "$ac_t""no" 1>&6
3299 fi
3300 done
3301
3302 if test $ac_cv_func_res_search = "no" ; then 
3303         echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
3304 echo "configure:3305: checking for res_search in -lbind" >&5
3305 ac_lib_var=`echo bind'_'res_search | sed 'y%./+-%__p_%'`
3306 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3307   echo $ac_n "(cached) $ac_c" 1>&6
3308 else
3309   ac_save_LIBS="$LIBS"
3310 LIBS="-lbind  $LIBS"
3311 cat > conftest.$ac_ext <<EOF
3312 #line 3313 "configure"
3313 #include "confdefs.h"
3314 /* Override any gcc2 internal prototype to avoid an error.  */
3315 /* We use char because int might match the return type of a gcc2
3316     builtin and then its argument prototype would still apply.  */
3317 char res_search();
3318
3319 int main() {
3320 res_search()
3321 ; return 0; }
3322 EOF
3323 if { (eval echo configure:3324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3324   rm -rf conftest*
3325   eval "ac_cv_lib_$ac_lib_var=yes"
3326 else
3327   echo "configure: failed program was:" >&5
3328   cat conftest.$ac_ext >&5
3329   rm -rf conftest*
3330   eval "ac_cv_lib_$ac_lib_var=no"
3331 fi
3332 rm -f conftest*
3333 LIBS="$ac_save_LIBS"
3334
3335 fi
3336 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3337   echo "$ac_t""yes" 1>&6
3338     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3339     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3340   cat >> confdefs.h <<EOF
3341 #define $ac_tr_lib 1
3342 EOF
3343
3344   LIBS="-lbind $LIBS"
3345
3346 else
3347   echo "$ac_t""no" 1>&6
3348 fi
3349
3350         if test "$ac_cv_lib_bind_res_search" = "yes" ; then
3351                 cat >> confdefs.h <<\EOF
3352 #define HAVE_RES_SEARCH 1
3353 EOF
3354
3355         else
3356                 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
3357 echo "configure:3358: checking for res_search in -lresolv" >&5
3358 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
3359 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3360   echo $ac_n "(cached) $ac_c" 1>&6
3361 else
3362   ac_save_LIBS="$LIBS"
3363 LIBS="-lresolv  $LIBS"
3364 cat > conftest.$ac_ext <<EOF
3365 #line 3366 "configure"
3366 #include "confdefs.h"
3367 /* Override any gcc2 internal prototype to avoid an error.  */
3368 /* We use char because int might match the return type of a gcc2
3369     builtin and then its argument prototype would still apply.  */
3370 char res_search();
3371
3372 int main() {
3373 res_search()
3374 ; return 0; }
3375 EOF
3376 if { (eval echo configure:3377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3377   rm -rf conftest*
3378   eval "ac_cv_lib_$ac_lib_var=yes"
3379 else
3380   echo "configure: failed program was:" >&5
3381   cat conftest.$ac_ext >&5
3382   rm -rf conftest*
3383   eval "ac_cv_lib_$ac_lib_var=no"
3384 fi
3385 rm -f conftest*
3386 LIBS="$ac_save_LIBS"
3387
3388 fi
3389 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3390   echo "$ac_t""yes" 1>&6
3391     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3392     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3393   cat >> confdefs.h <<EOF
3394 #define $ac_tr_lib 1
3395 EOF
3396
3397   LIBS="-lresolv $LIBS"
3398
3399 else
3400   echo "$ac_t""no" 1>&6
3401 fi
3402
3403                 if test "$ac_cv_lib_resolv_res_search" = "yes" ; then
3404                         cat >> confdefs.h <<\EOF
3405 #define HAVE_RES_SEARCH 1
3406 EOF
3407
3408                 fi
3409         fi
3410 fi
3411
3412 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
3413 echo "configure:3414: checking for sigset in -lV3" >&5
3414 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-%__p_%'`
3415 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3416   echo $ac_n "(cached) $ac_c" 1>&6
3417 else
3418   ac_save_LIBS="$LIBS"
3419 LIBS="-lV3  $LIBS"
3420 cat > conftest.$ac_ext <<EOF
3421 #line 3422 "configure"
3422 #include "confdefs.h"
3423 /* Override any gcc2 internal prototype to avoid an error.  */
3424 /* We use char because int might match the return type of a gcc2
3425     builtin and then its argument prototype would still apply.  */
3426 char sigset();
3427
3428 int main() {
3429 sigset()
3430 ; return 0; }
3431 EOF
3432 if { (eval echo configure:3433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3433   rm -rf conftest*
3434   eval "ac_cv_lib_$ac_lib_var=yes"
3435 else
3436   echo "configure: failed program was:" >&5
3437   cat conftest.$ac_ext >&5
3438   rm -rf conftest*
3439   eval "ac_cv_lib_$ac_lib_var=no"
3440 fi
3441 rm -f conftest*
3442 LIBS="$ac_save_LIBS"
3443
3444 fi
3445 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3446   echo "$ac_t""yes" 1>&6
3447     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3448     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3449   cat >> confdefs.h <<EOF
3450 #define $ac_tr_lib 1
3451 EOF
3452
3453   LIBS="-lV3 $LIBS"
3454
3455 else
3456   echo "$ac_t""no" 1>&6
3457 fi
3458
3459
3460 # ISODE tests
3461 ol_link_isode=no
3462 if test $ol_enable_ldapd != no ; then
3463                 echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
3464 echo "configure:3465: checking for main in -lxtpp" >&5
3465 ac_lib_var=`echo xtpp'_'main | sed 'y%./+-%__p_%'`
3466 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3467   echo $ac_n "(cached) $ac_c" 1>&6
3468 else
3469   ac_save_LIBS="$LIBS"
3470 LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
3471 cat > conftest.$ac_ext <<EOF
3472 #line 3473 "configure"
3473 #include "confdefs.h"
3474
3475 int main() {
3476 main()
3477 ; return 0; }
3478 EOF
3479 if { (eval echo configure:3480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3480   rm -rf conftest*
3481   eval "ac_cv_lib_$ac_lib_var=yes"
3482 else
3483   echo "configure: failed program was:" >&5
3484   cat conftest.$ac_ext >&5
3485   rm -rf conftest*
3486   eval "ac_cv_lib_$ac_lib_var=no"
3487 fi
3488 rm -f conftest*
3489 LIBS="$ac_save_LIBS"
3490
3491 fi
3492 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3493   echo "$ac_t""yes" 1>&6
3494   
3495                 ol_link_isode=yes
3496                 cat >> confdefs.h <<\EOF
3497 #define HAVE_XTPP 1
3498 EOF
3499
3500                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
3501                 
3502 else
3503   echo "$ac_t""no" 1>&6
3504 :
3505 fi
3506
3507         echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
3508 echo "configure:3509: checking for main in -ldsap" >&5
3509 ac_lib_var=`echo dsap'_'main | sed 'y%./+-%__p_%'`
3510 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3511   echo $ac_n "(cached) $ac_c" 1>&6
3512 else
3513   ac_save_LIBS="$LIBS"
3514 LIBS="-ldsap -lisode $LIBS"
3515 cat > conftest.$ac_ext <<EOF
3516 #line 3517 "configure"
3517 #include "confdefs.h"
3518
3519 int main() {
3520 main()
3521 ; return 0; }
3522 EOF
3523 if { (eval echo configure:3524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3524   rm -rf conftest*
3525   eval "ac_cv_lib_$ac_lib_var=yes"
3526 else
3527   echo "configure: failed program was:" >&5
3528   cat conftest.$ac_ext >&5
3529   rm -rf conftest*
3530   eval "ac_cv_lib_$ac_lib_var=no"
3531 fi
3532 rm -f conftest*
3533 LIBS="$ac_save_LIBS"
3534
3535 fi
3536 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3537   echo "$ac_t""yes" 1>&6
3538   
3539                 ol_link_isode=yes
3540                 cat >> confdefs.h <<\EOF
3541 #define HAVE_DSAP 1
3542 EOF
3543
3544                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
3545                 
3546 else
3547   echo "$ac_t""no" 1>&6
3548 :
3549 fi
3550
3551         echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
3552 echo "configure:3553: checking for main in -lisode" >&5
3553 ac_lib_var=`echo isode'_'main | sed 'y%./+-%__p_%'`
3554 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3555   echo $ac_n "(cached) $ac_c" 1>&6
3556 else
3557   ac_save_LIBS="$LIBS"
3558 LIBS="-lisode  $LIBS"
3559 cat > conftest.$ac_ext <<EOF
3560 #line 3561 "configure"
3561 #include "confdefs.h"
3562
3563 int main() {
3564 main()
3565 ; return 0; }
3566 EOF
3567 if { (eval echo configure:3568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3568   rm -rf conftest*
3569   eval "ac_cv_lib_$ac_lib_var=yes"
3570 else
3571   echo "configure: failed program was:" >&5
3572   cat conftest.$ac_ext >&5
3573   rm -rf conftest*
3574   eval "ac_cv_lib_$ac_lib_var=no"
3575 fi
3576 rm -f conftest*
3577 LIBS="$ac_save_LIBS"
3578
3579 fi
3580 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3581   echo "$ac_t""yes" 1>&6
3582   
3583                 ol_link_isode=yes
3584                 cat >> confdefs.h <<\EOF
3585 #define HAVE_ISODE 1
3586 EOF
3587
3588                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
3589                 
3590 else
3591   echo "$ac_t""no" 1>&6
3592 :
3593 fi
3594
3595 fi
3596
3597 if test $ol_link_isode != no; then
3598         echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
3599 echo "configure:3600: checking for main in -lpp" >&5
3600 ac_lib_var=`echo pp'_'main | sed 'y%./+-%__p_%'`
3601 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3602   echo $ac_n "(cached) $ac_c" 1>&6
3603 else
3604   ac_save_LIBS="$LIBS"
3605 LIBS="-lpp  $LIBS"
3606 cat > conftest.$ac_ext <<EOF
3607 #line 3608 "configure"
3608 #include "confdefs.h"
3609
3610 int main() {
3611 main()
3612 ; return 0; }
3613 EOF
3614 if { (eval echo configure:3615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3615   rm -rf conftest*
3616   eval "ac_cv_lib_$ac_lib_var=yes"
3617 else
3618   echo "configure: failed program was:" >&5
3619   cat conftest.$ac_ext >&5
3620   rm -rf conftest*
3621   eval "ac_cv_lib_$ac_lib_var=no"
3622 fi
3623 rm -f conftest*
3624 LIBS="$ac_save_LIBS"
3625
3626 fi
3627 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3628   echo "$ac_t""yes" 1>&6
3629   
3630                 cat >> confdefs.h <<\EOF
3631 #define HAVE_PP 1
3632 EOF
3633
3634                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
3635                 
3636 else
3637   echo "$ac_t""no" 1>&6
3638 :
3639 fi
3640
3641
3642         # Extract the first word of "pepsy", so it can be a program name with args.
3643 set dummy pepsy; ac_word=$2
3644 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3645 echo "configure:3646: checking for $ac_word" >&5
3646 if eval "test \"`echo '$''{'ac_cv_path_PEPSY'+set}'`\" = set"; then
3647   echo $ac_n "(cached) $ac_c" 1>&6
3648 else
3649   case "$PEPSY" in
3650   /*)
3651   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a path.
3652   ;;
3653   ?:/*)                  
3654   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a dos path.
3655   ;;
3656   *)
3657   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3658   ac_dummy="$PATH"
3659   for ac_dir in $ac_dummy; do 
3660     test -z "$ac_dir" && ac_dir=.
3661     if test -f $ac_dir/$ac_word; then
3662       ac_cv_path_PEPSY="$ac_dir/$ac_word"
3663       break
3664     fi
3665   done
3666   IFS="$ac_save_ifs"
3667   ;;
3668 esac
3669 fi
3670 PEPSY="$ac_cv_path_PEPSY"
3671 if test -n "$PEPSY"; then
3672   echo "$ac_t""$PEPSY" 1>&6
3673 else
3674   echo "$ac_t""no" 1>&6
3675 fi
3676
3677 fi
3678
3679 ol_link_kerberos=no
3680
3681 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
3682         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
3683 do
3684 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3685 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3686 echo "configure:3687: checking for $ac_hdr" >&5
3687 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3688   echo $ac_n "(cached) $ac_c" 1>&6
3689 else
3690   cat > conftest.$ac_ext <<EOF
3691 #line 3692 "configure"
3692 #include "confdefs.h"
3693 #include <$ac_hdr>
3694 EOF
3695 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3696 { (eval echo configure:3697: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3697 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3698 if test -z "$ac_err"; then
3699   rm -rf conftest*
3700   eval "ac_cv_header_$ac_safe=yes"
3701 else
3702   echo "$ac_err" >&5
3703   echo "configure: failed program was:" >&5
3704   cat conftest.$ac_ext >&5
3705   rm -rf conftest*
3706   eval "ac_cv_header_$ac_safe=no"
3707 fi
3708 rm -f conftest*
3709 fi
3710 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3711   echo "$ac_t""yes" 1>&6
3712     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3713   cat >> confdefs.h <<EOF
3714 #define $ac_tr_hdr 1
3715 EOF
3716  
3717 else
3718   echo "$ac_t""no" 1>&6
3719 fi
3720 done
3721
3722
3723         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
3724                 echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
3725 echo "configure:3726: checking for main in -lkrb4" >&5
3726 ac_lib_var=`echo krb4'_'main | sed 'y%./+-%__p_%'`
3727 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3728   echo $ac_n "(cached) $ac_c" 1>&6
3729 else
3730   ac_save_LIBS="$LIBS"
3731 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
3732 cat > conftest.$ac_ext <<EOF
3733 #line 3734 "configure"
3734 #include "confdefs.h"
3735
3736 int main() {
3737 main()
3738 ; return 0; }
3739 EOF
3740 if { (eval echo configure:3741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3741   rm -rf conftest*
3742   eval "ac_cv_lib_$ac_lib_var=yes"
3743 else
3744   echo "configure: failed program was:" >&5
3745   cat conftest.$ac_ext >&5
3746   rm -rf conftest*
3747   eval "ac_cv_lib_$ac_lib_var=no"
3748 fi
3749 rm -f conftest*
3750 LIBS="$ac_save_LIBS"
3751
3752 fi
3753 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3754   echo "$ac_t""yes" 1>&6
3755   have_k5=yes
3756 else
3757   echo "$ac_t""no" 1>&6
3758 have_k5=no
3759 fi
3760
3761
3762                 if test $have_k5 = yes ; then
3763                         ol_with_kerberos=found
3764                         ol_link_kerberos=yes
3765
3766                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
3767
3768                         LIBS="$KRB_LIBS $LIBS"
3769
3770                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
3771 echo "configure:3772: checking for des_debug in Kerberos libraries" >&5
3772 if eval "test \"`echo '$''{'ol_cv_var_des_debug'+set}'`\" = set"; then
3773   echo $ac_n "(cached) $ac_c" 1>&6
3774 else
3775   
3776                                                                 save_LIBS="$LIBS"
3777                                 LIBS="$KRB_LIBS $LIBS"
3778                                 cat > conftest.$ac_ext <<EOF
3779 #line 3780 "configure"
3780 #include "confdefs.h"
3781
3782 #include <kerberosIV/krb.h>
3783 #include <kerberosIV/des.h>
3784 extern int des_debug;
3785
3786 int main() {
3787
3788 des_debug = 1;
3789
3790 ; return 0; }
3791 EOF
3792 if { (eval echo configure:3793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3793   rm -rf conftest*
3794   ol_cv_var_des_debug=yes
3795 else
3796   echo "configure: failed program was:" >&5
3797   cat conftest.$ac_ext >&5
3798   rm -rf conftest*
3799   ol_cv_var_des_debug=no
3800 fi
3801 rm -f conftest*
3802                                                                 LIBS="$save_LIBS"
3803                         
3804 fi
3805
3806 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
3807
3808                         if test $ol_cv_var_des_debug = yes ; then
3809                                 cat >> confdefs.h <<\EOF
3810 #define HAVE_DES_DEBUG 1
3811 EOF
3812
3813                         fi
3814
3815                         LIBS="$save_LIBS"
3816                 fi
3817         fi
3818 fi
3819
3820 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
3821         for ac_hdr in krb.h des.h
3822 do
3823 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3824 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3825 echo "configure:3826: checking for $ac_hdr" >&5
3826 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+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 <$ac_hdr>
3833 EOF
3834 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3835 { (eval echo configure:3836: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3836 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3837 if test -z "$ac_err"; then
3838   rm -rf conftest*
3839   eval "ac_cv_header_$ac_safe=yes"
3840 else
3841   echo "$ac_err" >&5
3842   echo "configure: failed program was:" >&5
3843   cat conftest.$ac_ext >&5
3844   rm -rf conftest*
3845   eval "ac_cv_header_$ac_safe=no"
3846 fi
3847 rm -f conftest*
3848 fi
3849 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3850   echo "$ac_t""yes" 1>&6
3851     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3852   cat >> confdefs.h <<EOF
3853 #define $ac_tr_hdr 1
3854 EOF
3855  
3856 else
3857   echo "$ac_t""no" 1>&6
3858 fi
3859 done
3860
3861
3862         if test $ac_cv_header_krb_h = yes ; then
3863                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
3864 echo "configure:3865: checking for main in -lkrb" >&5
3865 ac_lib_var=`echo krb'_'main | sed 'y%./+-%__p_%'`
3866 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3867   echo $ac_n "(cached) $ac_c" 1>&6
3868 else
3869   ac_save_LIBS="$LIBS"
3870 LIBS="-lkrb -ldes $LIBS"
3871 cat > conftest.$ac_ext <<EOF
3872 #line 3873 "configure"
3873 #include "confdefs.h"
3874
3875 int main() {
3876 main()
3877 ; return 0; }
3878 EOF
3879 if { (eval echo configure:3880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3880   rm -rf conftest*
3881   eval "ac_cv_lib_$ac_lib_var=yes"
3882 else
3883   echo "configure: failed program was:" >&5
3884   cat conftest.$ac_ext >&5
3885   rm -rf conftest*
3886   eval "ac_cv_lib_$ac_lib_var=no"
3887 fi
3888 rm -f conftest*
3889 LIBS="$ac_save_LIBS"
3890
3891 fi
3892 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3893   echo "$ac_t""yes" 1>&6
3894   have_k4=yes
3895 else
3896   echo "$ac_t""no" 1>&6
3897 have_k4=no
3898 fi
3899
3900
3901                 if test $have_k4 = yes ; then
3902                         ol_with_kerberos=found
3903                         ol_link_kerberos=yes
3904
3905                         KRB_LIBS="-lkrb -ldes"
3906                 fi
3907         fi
3908 fi
3909
3910 if test $ol_link_kerberos = yes ; then
3911         cat >> confdefs.h <<\EOF
3912 #define HAVE_KERBEROS 1
3913 EOF
3914
3915 fi
3916
3917 ol_link_tls=no
3918 if test $ol_with_tls != no ; then
3919         
3920         for ac_hdr in ssl.h
3921 do
3922 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3923 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3924 echo "configure:3925: checking for $ac_hdr" >&5
3925 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3926   echo $ac_n "(cached) $ac_c" 1>&6
3927 else
3928   cat > conftest.$ac_ext <<EOF
3929 #line 3930 "configure"
3930 #include "confdefs.h"
3931 #include <$ac_hdr>
3932 EOF
3933 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3934 { (eval echo configure:3935: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3935 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3936 if test -z "$ac_err"; then
3937   rm -rf conftest*
3938   eval "ac_cv_header_$ac_safe=yes"
3939 else
3940   echo "$ac_err" >&5
3941   echo "configure: failed program was:" >&5
3942   cat conftest.$ac_ext >&5
3943   rm -rf conftest*
3944   eval "ac_cv_header_$ac_safe=no"
3945 fi
3946 rm -f conftest*
3947 fi
3948 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3949   echo "$ac_t""yes" 1>&6
3950     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3951   cat >> confdefs.h <<EOF
3952 #define $ac_tr_hdr 1
3953 EOF
3954  
3955 else
3956   echo "$ac_t""no" 1>&6
3957 fi
3958 done
3959
3960         
3961         if test $ac_cv_header_ssl_h = yes ; then
3962                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
3963 echo "configure:3964: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
3964 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-%__p_%'`
3965 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3966   echo $ac_n "(cached) $ac_c" 1>&6
3967 else
3968   ac_save_LIBS="$LIBS"
3969 LIBS="-lssl -lcrypto $LIBS"
3970 cat > conftest.$ac_ext <<EOF
3971 #line 3972 "configure"
3972 #include "confdefs.h"
3973 /* Override any gcc2 internal prototype to avoid an error.  */
3974 /* We use char because int might match the return type of a gcc2
3975     builtin and then its argument prototype would still apply.  */
3976 char SSLeay_add_ssl_algorithms();
3977
3978 int main() {
3979 SSLeay_add_ssl_algorithms()
3980 ; return 0; }
3981 EOF
3982 if { (eval echo configure:3983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3983   rm -rf conftest*
3984   eval "ac_cv_lib_$ac_lib_var=yes"
3985 else
3986   echo "configure: failed program was:" >&5
3987   cat conftest.$ac_ext >&5
3988   rm -rf conftest*
3989   eval "ac_cv_lib_$ac_lib_var=no"
3990 fi
3991 rm -f conftest*
3992 LIBS="$ac_save_LIBS"
3993
3994 fi
3995 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3996   echo "$ac_t""yes" 1>&6
3997   have_ssleay=yes
3998                         need_rsaref=no
3999 else
4000   echo "$ac_t""no" 1>&6
4001 have_ssleay=no
4002 fi
4003
4004                         
4005                 if test $have_ssleay = no ; then
4006                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
4007 echo "configure:4008: checking for ssl3_accept in -lssl" >&5
4008 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-%__p_%'`
4009 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4010   echo $ac_n "(cached) $ac_c" 1>&6
4011 else
4012   ac_save_LIBS="$LIBS"
4013 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
4014 cat > conftest.$ac_ext <<EOF
4015 #line 4016 "configure"
4016 #include "confdefs.h"
4017 /* Override any gcc2 internal prototype to avoid an error.  */
4018 /* We use char because int might match the return type of a gcc2
4019     builtin and then its argument prototype would still apply.  */
4020 char ssl3_accept();
4021
4022 int main() {
4023 ssl3_accept()
4024 ; return 0; }
4025 EOF
4026 if { (eval echo configure:4027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4027   rm -rf conftest*
4028   eval "ac_cv_lib_$ac_lib_var=yes"
4029 else
4030   echo "configure: failed program was:" >&5
4031   cat conftest.$ac_ext >&5
4032   rm -rf conftest*
4033   eval "ac_cv_lib_$ac_lib_var=no"
4034 fi
4035 rm -f conftest*
4036 LIBS="$ac_save_LIBS"
4037
4038 fi
4039 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4040   echo "$ac_t""yes" 1>&6
4041   have_ssleay=yes
4042                                 need_rsaref=yes
4043 else
4044   echo "$ac_t""no" 1>&6
4045 have_ssleay=no
4046 fi
4047
4048                 fi
4049
4050                 if test $have_ssleay = yes ; then
4051                         ol_with_tls=found
4052                         ol_link_tls=yes
4053
4054                         cat >> confdefs.h <<\EOF
4055 #define HAVE_SSLEAY 1
4056 EOF
4057
4058
4059                         if test $need_rsaref = yes; then
4060                                 cat >> confdefs.h <<\EOF
4061 #define HAVE_RSAREF 1
4062 EOF
4063
4064
4065                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
4066                         else
4067                                 TLS_LIBS="-lssl -lcrypto"
4068                         fi
4069                 fi
4070         fi
4071 fi
4072
4073 if test $ol_link_tls = yes ; then
4074         cat >> confdefs.h <<\EOF
4075 #define HAVE_TLS 1
4076 EOF
4077
4078 fi      
4079
4080 for ac_func in \
4081         ctime_r                 \
4082         gethostbyname_r gethostbyaddr_r \
4083
4084 do
4085 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4086 echo "configure:4087: checking for $ac_func" >&5
4087 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4088   echo $ac_n "(cached) $ac_c" 1>&6
4089 else
4090   cat > conftest.$ac_ext <<EOF
4091 #line 4092 "configure"
4092 #include "confdefs.h"
4093 /* System header to define __stub macros and hopefully few prototypes,
4094     which can conflict with char $ac_func(); below.  */
4095 #include <assert.h>
4096 /* Override any gcc2 internal prototype to avoid an error.  */
4097 /* We use char because int might match the return type of a gcc2
4098     builtin and then its argument prototype would still apply.  */
4099 char $ac_func();
4100
4101 int main() {
4102
4103 /* The GNU C library defines this for functions which it implements
4104     to always fail with ENOSYS.  Some functions are actually named
4105     something starting with __ and the normal name is an alias.  */
4106 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4107 choke me
4108 #else
4109 $ac_func();
4110 #endif
4111
4112 ; return 0; }
4113 EOF
4114 if { (eval echo configure:4115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4115   rm -rf conftest*
4116   eval "ac_cv_func_$ac_func=yes"
4117 else
4118   echo "configure: failed program was:" >&5
4119   cat conftest.$ac_ext >&5
4120   rm -rf conftest*
4121   eval "ac_cv_func_$ac_func=no"
4122 fi
4123 rm -f conftest*
4124 fi
4125
4126 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4127   echo "$ac_t""yes" 1>&6
4128     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4129   cat >> confdefs.h <<EOF
4130 #define $ac_tr_func 1
4131 EOF
4132  
4133 else
4134   echo "$ac_t""no" 1>&6
4135 fi
4136 done
4137
4138
4139 if test "$ac_cv_func_ctime_r" = no ; then
4140         ol_cv_func_ctime_r_nargs=0
4141 else
4142         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
4143 echo "configure:4144: checking number of arguments of ctime_r" >&5
4144 if eval "test \"`echo '$''{'ol_cv_func_ctime_r_nargs'+set}'`\" = set"; then
4145   echo $ac_n "(cached) $ac_c" 1>&6
4146 else
4147   cat > conftest.$ac_ext <<EOF
4148 #line 4149 "configure"
4149 #include "confdefs.h"
4150 #include <time.h>
4151 int main() {
4152 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
4153 ; return 0; }
4154 EOF
4155 if { (eval echo configure:4156: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4156   rm -rf conftest*
4157   ol_cv_func_ctime_r_nargs=3
4158 else
4159   echo "configure: failed program was:" >&5
4160   cat conftest.$ac_ext >&5
4161   rm -rf conftest*
4162   cat > conftest.$ac_ext <<EOF
4163 #line 4164 "configure"
4164 #include "confdefs.h"
4165 #include <time.h>
4166 int main() {
4167 time_t ti; char *buffer; ctime_r(&ti,buffer);
4168 ; return 0; }
4169 EOF
4170 if { (eval echo configure:4171: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4171   rm -rf conftest*
4172   ol_cv_func_ctime_r_nargs=2
4173 else
4174   echo "configure: failed program was:" >&5
4175   cat conftest.$ac_ext >&5
4176   rm -rf conftest*
4177   ol_cv_func_ctime_r_nargs=0
4178 fi
4179 rm -f conftest*
4180 fi
4181 rm -f conftest*
4182 fi
4183
4184 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
4185   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
4186     cat >> confdefs.h <<EOF
4187 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
4188 EOF
4189
4190   fi
4191
4192 fi
4193
4194 if test "$ac_cv_func_gethostbyname_r" = yes ; then
4195         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
4196 echo "configure:4197: checking number of arguments of gethostbyname_r" >&5
4197 if eval "test \"`echo '$''{'ol_cv_func_gethostbyname_r_nargs'+set}'`\" = set"; then
4198   echo $ac_n "(cached) $ac_c" 1>&6
4199 else
4200   cat > conftest.$ac_ext <<EOF
4201 #line 4202 "configure"
4202 #include "confdefs.h"
4203 #include <sys/types.h>
4204 #include <sys/socket.h>
4205 #include <netinet/in.h>
4206 #include <netdb.h>
4207 #define BUFSIZE (sizeof(struct hostent)+10)
4208 int main() {
4209 struct hostent hent; char buffer[BUFSIZE];
4210                 int bufsize=BUFSIZE;int h_errno;
4211                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
4212                         buffer, bufsize, &h_errno);
4213 ; return 0; }
4214 EOF
4215 if { (eval echo configure:4216: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4216   rm -rf conftest*
4217   ol_cv_func_gethostbyname_r_nargs=5
4218 else
4219   echo "configure: failed program was:" >&5
4220   cat conftest.$ac_ext >&5
4221   rm -rf conftest*
4222   cat > conftest.$ac_ext <<EOF
4223 #line 4224 "configure"
4224 #include "confdefs.h"
4225 #include <sys/types.h>
4226 #include <sys/socket.h>
4227 #include <netinet/in.h>
4228 #include <netdb.h>
4229 #define BUFSIZE (sizeof(struct hostent)+10)
4230 int main() {
4231 struct hostent hent;struct hostent *rhent;
4232                         char buffer[BUFSIZE];
4233                         int bufsize=BUFSIZE;int h_errno;
4234                         (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
4235                                 &rhent, &h_errno);
4236 ; return 0; }
4237 EOF
4238 if { (eval echo configure:4239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4239   rm -rf conftest*
4240   ol_cv_func_gethostbyname_r_nargs=6
4241 else
4242   echo "configure: failed program was:" >&5
4243   cat conftest.$ac_ext >&5
4244   rm -rf conftest*
4245   ol_cv_func_gethostbyname_r_nargs=0
4246 fi
4247 rm -f conftest*
4248 fi
4249 rm -f conftest*
4250 fi
4251
4252 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
4253   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
4254         cat >> confdefs.h <<EOF
4255 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
4256 EOF
4257
4258   fi
4259
4260 else
4261         ol_cv_func_gethostbyname_r_nargs=0
4262 fi
4263  
4264 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
4265         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
4266 echo "configure:4267: checking number of arguments of gethostbyaddr_r" >&5
4267 if eval "test \"`echo '$''{'ol_cv_func_gethostbyaddr_r_nargs'+set}'`\" = set"; then
4268   echo $ac_n "(cached) $ac_c" 1>&6
4269 else
4270   cat > conftest.$ac_ext <<EOF
4271 #line 4272 "configure"
4272 #include "confdefs.h"
4273 #include <sys/types.h>
4274 #include <sys/socket.h>
4275 #include <netinet/in.h>
4276 #include <netdb.h>
4277 #define BUFSIZE (sizeof(struct hostent)+10)
4278 int main() {
4279 struct hostent hent; char buffer[BUFSIZE]; 
4280             struct in_addr add;
4281             size_t alen=sizeof(struct in_addr);
4282             int bufsize=BUFSIZE;int h_errno;
4283                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
4284                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
4285 ; return 0; }
4286 EOF
4287 if { (eval echo configure:4288: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4288   rm -rf conftest*
4289   ol_cv_func_gethostbyaddr_r_nargs=7
4290 else
4291   echo "configure: failed program was:" >&5
4292   cat conftest.$ac_ext >&5
4293   rm -rf conftest*
4294   cat > conftest.$ac_ext <<EOF
4295 #line 4296 "configure"
4296 #include "confdefs.h"
4297 #include <sys/types.h>
4298 #include <sys/socket.h>
4299 #include <netinet/in.h>
4300 #include <netdb.h>
4301 #define BUFSIZE (sizeof(struct hostent)+10)
4302 int main() {
4303 struct hostent hent;
4304                         struct hostent *rhent; char buffer[BUFSIZE]; 
4305                         struct in_addr add;
4306                         size_t alen=sizeof(struct in_addr);
4307                         int bufsize=BUFSIZE;int h_errno;
4308                         (void)gethostbyaddr_r( (void *)&(add.s_addr),
4309                                 alen, AF_INET, &hent, buffer, bufsize, 
4310                                 &rhent, &h_errno);
4311 ; return 0; }
4312 EOF
4313 if { (eval echo configure:4314: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4314   rm -rf conftest*
4315   ol_cv_func_gethostbyaddr_r_nargs=8
4316 else
4317   echo "configure: failed program was:" >&5
4318   cat conftest.$ac_ext >&5
4319   rm -rf conftest*
4320   ol_cv_func_gethostbyaddr_r_nargs=0
4321 fi
4322 rm -f conftest*
4323 fi
4324 rm -f conftest*
4325 fi
4326
4327 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
4328   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
4329     cat >> confdefs.h <<EOF
4330 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
4331 EOF
4332
4333   fi
4334
4335 else
4336         ol_cv_func_gethostbyaddr_r_nargs=0
4337 fi
4338
4339 if test "$ac_cv_func_ctime_r" = yes \
4340         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
4341         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
4342         -a "$ac_cv_func_gethostbyname_r" = yes \
4343         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
4344         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
4345         -a "$ac_cv_func_gethostbyaddr_r" = yes \
4346         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
4347         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
4348         ; then
4349  
4350         cat >> confdefs.h <<\EOF
4351 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
4352 EOF
4353
4354 fi
4355
4356 ol_link_threads=no
4357 if test $ol_with_threads = auto -o $ol_with_threads = yes \
4358         -o $ol_with_threads = posix ; then
4359
4360         for ac_hdr in pthread.h sched.h
4361 do
4362 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4363 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4364 echo "configure:4365: checking for $ac_hdr" >&5
4365 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4366   echo $ac_n "(cached) $ac_c" 1>&6
4367 else
4368   cat > conftest.$ac_ext <<EOF
4369 #line 4370 "configure"
4370 #include "confdefs.h"
4371 #include <$ac_hdr>
4372 EOF
4373 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4374 { (eval echo configure:4375: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4375 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4376 if test -z "$ac_err"; then
4377   rm -rf conftest*
4378   eval "ac_cv_header_$ac_safe=yes"
4379 else
4380   echo "$ac_err" >&5
4381   echo "configure: failed program was:" >&5
4382   cat conftest.$ac_ext >&5
4383   rm -rf conftest*
4384   eval "ac_cv_header_$ac_safe=no"
4385 fi
4386 rm -f conftest*
4387 fi
4388 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4389   echo "$ac_t""yes" 1>&6
4390     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4391   cat >> confdefs.h <<EOF
4392 #define $ac_tr_hdr 1
4393 EOF
4394  
4395 else
4396   echo "$ac_t""no" 1>&6
4397 fi
4398 done
4399
4400
4401         if test $ac_cv_header_pthread_h = yes ; then
4402                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
4403 echo "configure:4404: checking POSIX thread version" >&5
4404 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
4405   echo $ac_n "(cached) $ac_c" 1>&6
4406 else
4407   
4408         cat > conftest.$ac_ext <<EOF
4409 #line 4410 "configure"
4410 #include "confdefs.h"
4411
4412 #               include <pthread.h>
4413                 /* this check could be improved */
4414 #               ifdef PTHREAD_ONCE_INIT
4415                         pthread_version_final
4416 #               endif
4417         
4418 EOF
4419 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4420   egrep "pthread_version_final" >/dev/null 2>&1; then
4421   rm -rf conftest*
4422   ol_pthread_final=yes
4423 else
4424   rm -rf conftest*
4425   ol_pthread_final=no
4426 fi
4427 rm -f conftest*
4428
4429
4430         cat > conftest.$ac_ext <<EOF
4431 #line 4432 "configure"
4432 #include "confdefs.h"
4433
4434 #               include <pthread.h>
4435                 /* this check could be improved */
4436 #               ifdef pthread_once_init
4437                         pthread_version_draft4
4438 #               endif
4439         
4440 EOF
4441 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4442   egrep "pthread_version_draft4" >/dev/null 2>&1; then
4443   rm -rf conftest*
4444   ol_pthread_draft4=yes
4445 else
4446   rm -rf conftest*
4447   ol_pthread_draft4=no
4448 fi
4449 rm -f conftest*
4450
4451
4452         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
4453                 ol_cv_pthread_version=final
4454         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
4455                 ol_cv_pthread_version=draft4
4456         else
4457                 ol_cv_pthread_version=unknown
4458         fi
4459
4460 fi
4461
4462 echo "$ac_t""$ol_cv_pthread_version" 1>&6
4463
4464
4465                 if test $ol_cv_pthread_version = final ; then
4466                         cat >> confdefs.h <<\EOF
4467 #define HAVE_PTHREADS_FINAL 1
4468 EOF
4469
4470                 elif test $ol_cv_pthread_version = draft4 ; then
4471                         cat >> confdefs.h <<\EOF
4472 #define HAVE_PTHREADS_D4 1
4473 EOF
4474
4475                 else
4476                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
4477                 fi
4478
4479                 # consider threads found
4480                 ol_with_threads=found
4481
4482                 
4483 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
4484 echo "configure:4485: checking for LinuxThreads" >&5
4485 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
4486   echo $ac_n "(cached) $ac_c" 1>&6
4487 else
4488   
4489         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
4490         if test "$res" -gt 0 ; then
4491                 ol_cv_linux_threads=yes
4492         else
4493                 ol_cv_linux_threads=no
4494         fi
4495
4496 fi
4497
4498 echo "$ac_t""$ol_cv_linux_threads" 1>&6
4499
4500
4501                 if test $ol_cv_linux_threads = yes ; then
4502                         cat >> confdefs.h <<\EOF
4503 #define HAVE_LINUX_THREADS 1
4504 EOF
4505
4506                 fi
4507
4508                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
4509                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
4510 echo "configure:4511: checking for pthread_create in default libraries" >&5
4511                 if eval "test \"`echo '$''{'ol_cv_pthread_create'+set}'`\" = set"; then
4512   echo $ac_n "(cached) $ac_c" 1>&6
4513 else
4514   
4515                 if test "$cross_compiling" = yes; then
4516                         ol_cv_pthread_create=yes
4517 else
4518   cat > conftest.$ac_ext <<EOF
4519 #line 4520 "configure"
4520 #include "confdefs.h"
4521
4522 #include <pthread.h>
4523 #ifndef NULL
4524 #define NULL (void*)0
4525 #endif
4526
4527 static void *task(p)
4528         void *p;
4529 {
4530         return (void *) (p == NULL);
4531 }
4532
4533 int main(argc, argv)
4534         int argc;
4535         char **argv;
4536 {
4537         pthread_t t;
4538         int status;
4539
4540         /* make sure pthread_create() isn't just a stub */
4541 #if HAVE_PTHREADS_D4
4542         status = pthread_create(&t, pthread_attr_default, task, NULL));
4543 #else
4544         status = pthread_create(&t, NULL, task, NULL);
4545 #endif
4546
4547         if( status ) return status;
4548
4549         /* make sure pthread_detach() isn't just a stub */
4550 #if HAVE_PTHREADS_D4
4551         status = pthread_detach( &t );
4552 #else
4553         status = pthread_detach( t );
4554 #endif
4555
4556         if( status ) return status;
4557
4558         return status;
4559 }
4560
4561 EOF
4562 if { (eval echo configure:4563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4563 then
4564   ol_cv_pthread_create=yes
4565 else
4566   echo "configure: failed program was:" >&5
4567   cat conftest.$ac_ext >&5
4568   rm -fr conftest*
4569   ol_cv_pthread_create=no
4570 fi
4571 rm -fr conftest*
4572 fi
4573
4574 fi
4575
4576                 echo "$ac_t""$ol_cv_pthread_create" 1>&6
4577
4578                 if test $ol_cv_pthread_create != no ; then
4579                         ol_link_threads=posix
4580                 fi
4581
4582                 if test $ol_link_threads = no ; then
4583                                                 echo $ac_n "checking for pthread_create with -mt""... $ac_c" 1>&6
4584 echo "configure:4585: checking for pthread_create with -mt" >&5
4585 if eval "test \"`echo '$''{'ol_cv_pthread_mt_flag'+set}'`\" = set"; then
4586   echo $ac_n "(cached) $ac_c" 1>&6
4587 else
4588   
4589                                                                 save_LIBS="$LIBS"
4590                                 LIBS="-mt $LIBS"
4591                                 cat > conftest.$ac_ext <<EOF
4592 #line 4593 "configure"
4593 #include "confdefs.h"
4594 char pthread_create();
4595 int main() {
4596 pthread_create();
4597 ; return 0; }
4598 EOF
4599 if { (eval echo configure:4600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4600   rm -rf conftest*
4601   ol_cv_pthread_mt_flag=yes
4602 else
4603   echo "configure: failed program was:" >&5
4604   cat conftest.$ac_ext >&5
4605   rm -rf conftest*
4606   ol_cv_pthread_mt_flag=no
4607 fi
4608 rm -f conftest*
4609                                                                 LIBS="$save_LIBS"
4610                         
4611 fi
4612
4613 echo "$ac_t""$ol_cv_pthread_mt_flag" 1>&6
4614
4615                         if test $ol_cv_pthread_mt_flag = yes ; then
4616                                 LTHREAD_LIBS="$LTHREAD_LIBS -mt"
4617                                 ol_link_threads=posix
4618                         fi
4619                 fi
4620
4621                 if test $ol_link_threads = no ; then
4622                                                 echo $ac_n "checking for pthread_create with -kthread""... $ac_c" 1>&6
4623 echo "configure:4624: checking for pthread_create with -kthread" >&5
4624 if eval "test \"`echo '$''{'ol_cv_kthread_flag'+set}'`\" = set"; then
4625   echo $ac_n "(cached) $ac_c" 1>&6
4626 else
4627   
4628                                                                 save_LIBS="$LIBS"
4629                                 LIBS="-kthread $LIBS"
4630                                 cat > conftest.$ac_ext <<EOF
4631 #line 4632 "configure"
4632 #include "confdefs.h"
4633 #include <pthread.h>
4634 int main() {
4635
4636 #if HAVE_PTHREADS_D4
4637         pthread_create(NULL,pthread_attr_default,NULL,NULL);
4638 #else
4639         pthread_t t;
4640         pthread_create(&t,NULL,NULL,NULL);
4641         pthread_detach(t);
4642 #endif
4643
4644 ; return 0; }
4645 EOF
4646 if { (eval echo configure:4647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4647   rm -rf conftest*
4648   ol_cv_kthread_flag=yes
4649 else
4650   echo "configure: failed program was:" >&5
4651   cat conftest.$ac_ext >&5
4652   rm -rf conftest*
4653   ol_cv_kthread_flag=no
4654 fi
4655 rm -f conftest*
4656                                                                 LIBS="$save_LIBS"
4657                         
4658 fi
4659
4660 echo "$ac_t""$ol_cv_kthread_flag" 1>&6
4661
4662                         if test $ol_cv_kthread_flag = yes ; then
4663                                 LTHREAD_LIBS="$LTHREAD_LIBS -kthread"
4664                                 ol_link_threads=posix
4665                         fi
4666                 fi
4667
4668                 if test $ol_link_threads = no ; then
4669                                                 echo $ac_n "checking for pthread_create with -pthread""... $ac_c" 1>&6
4670 echo "configure:4671: checking for pthread_create with -pthread" >&5
4671 if eval "test \"`echo '$''{'ol_cv_pthread_flag'+set}'`\" = set"; then
4672   echo $ac_n "(cached) $ac_c" 1>&6
4673 else
4674   
4675                                                                 save_LIBS="$LIBS"
4676                                 LIBS="-pthread $LIBS"
4677                                 cat > conftest.$ac_ext <<EOF
4678 #line 4679 "configure"
4679 #include "confdefs.h"
4680 #include <pthread.h>
4681 int main() {
4682
4683 #if HAVE_PTHREADS_D4
4684         pthread_create(NULL,pthread_attr_default,NULL,NULL);
4685 #else
4686         pthread_create(NULL,NULL,NULL,NULL);
4687 #endif
4688
4689 ; return 0; }
4690 EOF
4691 if { (eval echo configure:4692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4692   rm -rf conftest*
4693   ol_cv_pthread_flag=yes
4694 else
4695   echo "configure: failed program was:" >&5
4696   cat conftest.$ac_ext >&5
4697   rm -rf conftest*
4698   ol_cv_pthread_flag=no
4699 fi
4700 rm -f conftest*
4701                                                                 LIBS="$save_LIBS"
4702                         
4703 fi
4704
4705 echo "$ac_t""$ol_cv_pthread_flag" 1>&6
4706
4707                         if test $ol_cv_pthread_flag = yes ; then
4708                                 LTHREAD_LIBS="$LTHREAD_LIBS -pthread"
4709                                 ol_link_threads=posix
4710                         fi
4711                 fi
4712
4713                 if test $ol_link_threads = no ; then
4714                                                 echo $ac_n "checking for pthread_create with -pthreads""... $ac_c" 1>&6
4715 echo "configure:4716: checking for pthread_create with -pthreads" >&5
4716 if eval "test \"`echo '$''{'ol_cv_pthreads_flag'+set}'`\" = set"; then
4717   echo $ac_n "(cached) $ac_c" 1>&6
4718 else
4719   
4720                                                                 save_LIBS="$LIBS"
4721                                 LIBS="-pthreads $LIBS"
4722                                 cat > conftest.$ac_ext <<EOF
4723 #line 4724 "configure"
4724 #include "confdefs.h"
4725 #include <pthread.h>
4726 int main() {
4727
4728 #if HAVE_PTHREADS_D4
4729         pthread_create(NULL,pthread_attr_default,NULL,NULL);
4730 #else
4731         pthread_create(NULL,NULL,NULL,NULL);
4732 #endif
4733
4734 ; return 0; }
4735 EOF
4736 if { (eval echo configure:4737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4737   rm -rf conftest*
4738   ol_cv_pthreads_flag=yes
4739 else
4740   echo "configure: failed program was:" >&5
4741   cat conftest.$ac_ext >&5
4742   rm -rf conftest*
4743   ol_cv_pthreads_flag=no
4744 fi
4745 rm -f conftest*
4746                                                                 LIBS="$save_LIBS"
4747                         
4748 fi
4749
4750 echo "$ac_t""$ol_cv_pthreads_flag" 1>&6
4751
4752                         if test $ol_cv_pthreads_flag = yes ; then
4753                                 LTHREAD_LIBS="$LTHREAD_LIBS -pthreads"
4754                                 ol_link_threads=posix
4755                         fi
4756                 fi
4757
4758                 if test $ol_link_threads = no ; then
4759                                                 echo $ac_n "checking for pthread_create with -thread""... $ac_c" 1>&6
4760 echo "configure:4761: checking for pthread_create with -thread" >&5
4761 if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
4762   echo $ac_n "(cached) $ac_c" 1>&6
4763 else
4764   
4765                                                                 save_LIBS="$LIBS"
4766                                 LIBS="-thread $LIBS"
4767                                 cat > conftest.$ac_ext <<EOF
4768 #line 4769 "configure"
4769 #include "confdefs.h"
4770 char pthread_create();
4771 int main() {
4772 pthread_create();
4773 ; return 0; }
4774 EOF
4775 if { (eval echo configure:4776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4776   rm -rf conftest*
4777   ol_cv_thread_flag=yes
4778 else
4779   echo "configure: failed program was:" >&5
4780   cat conftest.$ac_ext >&5
4781   rm -rf conftest*
4782   ol_cv_thread_flag=no
4783 fi
4784 rm -f conftest*
4785                                                                 LIBS="$save_LIBS"
4786                         
4787 fi
4788
4789 echo "$ac_t""$ol_cv_thread_flag" 1>&6
4790
4791                         if test $ol_cv_thread_flag = yes ; then
4792                                 LTHREAD_LIBS="$LTHREAD_LIBS -thread"
4793                                 ol_link_threads=posix
4794                         fi
4795                 fi
4796
4797                 if test $ol_link_threads = no ; then
4798                                                 save_LIBS="$LIBS"
4799                         echo $ac_n "checking for pthread_mutex_unlock in -lpthread""... $ac_c" 1>&6
4800 echo "configure:4801: checking for pthread_mutex_unlock in -lpthread" >&5
4801 ac_lib_var=`echo pthread'_'pthread_mutex_unlock | sed 'y%./+-%__p_%'`
4802 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4803   echo $ac_n "(cached) $ac_c" 1>&6
4804 else
4805   ac_save_LIBS="$LIBS"
4806 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
4807 cat > conftest.$ac_ext <<EOF
4808 #line 4809 "configure"
4809 #include "confdefs.h"
4810 /* Override any gcc2 internal prototype to avoid an error.  */
4811 /* We use char because int might match the return type of a gcc2
4812     builtin and then its argument prototype would still apply.  */
4813 char pthread_mutex_unlock();
4814
4815 int main() {
4816 pthread_mutex_unlock()
4817 ; return 0; }
4818 EOF
4819 if { (eval echo configure:4820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4820   rm -rf conftest*
4821   eval "ac_cv_lib_$ac_lib_var=yes"
4822 else
4823   echo "configure: failed program was:" >&5
4824   cat conftest.$ac_ext >&5
4825   rm -rf conftest*
4826   eval "ac_cv_lib_$ac_lib_var=no"
4827 fi
4828 rm -f conftest*
4829 LIBS="$ac_save_LIBS"
4830
4831 fi
4832 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4833   echo "$ac_t""yes" 1>&6
4834   
4835                                 ol_link_threads=posix
4836                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc -lc_r"
4837                                 if test $ol_with_yielding_select = auto ; then
4838                                         ol_with_yielding_select=yes
4839                                 fi
4840                                 
4841 else
4842   echo "$ac_t""no" 1>&6
4843 :
4844 fi
4845
4846                         LIBS="$save_LIBS"
4847                 fi
4848
4849                 if test $ol_link_threads = no ; then
4850                                                 save_LIBS="$LIBS"
4851                         echo $ac_n "checking for pthread_mutex_lock in -lpthread""... $ac_c" 1>&6
4852 echo "configure:4853: checking for pthread_mutex_lock in -lpthread" >&5
4853 ac_lib_var=`echo pthread'_'pthread_mutex_lock | sed 'y%./+-%__p_%'`
4854 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4855   echo $ac_n "(cached) $ac_c" 1>&6
4856 else
4857   ac_save_LIBS="$LIBS"
4858 LIBS="-lpthread -lmach -lexc $LIBS"
4859 cat > conftest.$ac_ext <<EOF
4860 #line 4861 "configure"
4861 #include "confdefs.h"
4862 /* Override any gcc2 internal prototype to avoid an error.  */
4863 /* We use char because int might match the return type of a gcc2
4864     builtin and then its argument prototype would still apply.  */
4865 char pthread_mutex_lock();
4866
4867 int main() {
4868 pthread_mutex_lock()
4869 ; return 0; }
4870 EOF
4871 if { (eval echo configure:4872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4872   rm -rf conftest*
4873   eval "ac_cv_lib_$ac_lib_var=yes"
4874 else
4875   echo "configure: failed program was:" >&5
4876   cat conftest.$ac_ext >&5
4877   rm -rf conftest*
4878   eval "ac_cv_lib_$ac_lib_var=no"
4879 fi
4880 rm -f conftest*
4881 LIBS="$ac_save_LIBS"
4882
4883 fi
4884 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4885   echo "$ac_t""yes" 1>&6
4886   
4887                                 ol_link_threads=posix
4888                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc"
4889                                 if test $ol_with_yielding_select = auto ; then
4890                                         ol_with_yielding_select=yes
4891                                 fi
4892                                 
4893 else
4894   echo "$ac_t""no" 1>&6
4895 :
4896 fi
4897
4898                         LIBS="$save_LIBS"
4899                 fi
4900
4901                 if test $ol_link_threads = no ; then
4902                                                 save_LIBS="$LIBS"
4903                         echo $ac_n "checking for pthread_mutex_trylock in -lpthread""... $ac_c" 1>&6
4904 echo "configure:4905: checking for pthread_mutex_trylock in -lpthread" >&5
4905 ac_lib_var=`echo pthread'_'pthread_mutex_trylock | sed 'y%./+-%__p_%'`
4906 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4907   echo $ac_n "(cached) $ac_c" 1>&6
4908 else
4909   ac_save_LIBS="$LIBS"
4910 LIBS="-lpthread -lexc $LIBS"
4911 cat > conftest.$ac_ext <<EOF
4912 #line 4913 "configure"
4913 #include "confdefs.h"
4914 /* Override any gcc2 internal prototype to avoid an error.  */
4915 /* We use char because int might match the return type of a gcc2
4916     builtin and then its argument prototype would still apply.  */
4917 char pthread_mutex_trylock();
4918
4919 int main() {
4920 pthread_mutex_trylock()
4921 ; return 0; }
4922 EOF
4923 if { (eval echo configure:4924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4924   rm -rf conftest*
4925   eval "ac_cv_lib_$ac_lib_var=yes"
4926 else
4927   echo "configure: failed program was:" >&5
4928   cat conftest.$ac_ext >&5
4929   rm -rf conftest*
4930   eval "ac_cv_lib_$ac_lib_var=no"
4931 fi
4932 rm -f conftest*
4933 LIBS="$ac_save_LIBS"
4934
4935 fi
4936 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4937   echo "$ac_t""yes" 1>&6
4938   
4939                                 ol_link_threads=posix
4940                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lexc"
4941                                 if test $ol_with_yielding_select = auto ; then
4942                                         ol_with_yielding_select=yes
4943                                 fi
4944                                 
4945 else
4946   echo "$ac_t""no" 1>&6
4947 :
4948 fi
4949
4950                         LIBS="$save_LIBS"
4951                 fi
4952
4953                                 if test $ol_link_threads = no ; then
4954                                                 save_LIBS="$LIBS"
4955                         echo $ac_n "checking for pthread_join in -lpthread""... $ac_c" 1>&6
4956 echo "configure:4957: checking for pthread_join in -lpthread" >&5
4957 ac_lib_var=`echo pthread'_'pthread_join | sed 'y%./+-%__p_%'`
4958 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4959   echo $ac_n "(cached) $ac_c" 1>&6
4960 else
4961   ac_save_LIBS="$LIBS"
4962 LIBS="-lpthread -Wl,-woff,85 $LIBS"
4963 cat > conftest.$ac_ext <<EOF
4964 #line 4965 "configure"
4965 #include "confdefs.h"
4966 /* Override any gcc2 internal prototype to avoid an error.  */
4967 /* We use char because int might match the return type of a gcc2
4968     builtin and then its argument prototype would still apply.  */
4969 char pthread_join();
4970
4971 int main() {
4972 pthread_join()
4973 ; return 0; }
4974 EOF
4975 if { (eval echo configure:4976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4976   rm -rf conftest*
4977   eval "ac_cv_lib_$ac_lib_var=yes"
4978 else
4979   echo "configure: failed program was:" >&5
4980   cat conftest.$ac_ext >&5
4981   rm -rf conftest*
4982   eval "ac_cv_lib_$ac_lib_var=no"
4983 fi
4984 rm -f conftest*
4985 LIBS="$ac_save_LIBS"
4986
4987 fi
4988 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4989   echo "$ac_t""yes" 1>&6
4990   
4991                                 ol_link_threads=posix
4992                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
4993                                 
4994 else
4995   echo "$ac_t""no" 1>&6
4996 :
4997 fi
4998
4999                         LIBS="$save_LIBS"
5000                 fi
5001
5002                 if test $ol_link_threads = no ; then
5003                                                 save_LIBS="$LIBS"
5004                         echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
5005 echo "configure:5006: checking for pthread_create in -lpthread" >&5
5006 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
5007 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5008   echo $ac_n "(cached) $ac_c" 1>&6
5009 else
5010   ac_save_LIBS="$LIBS"
5011 LIBS="-lpthread  $LIBS"
5012 cat > conftest.$ac_ext <<EOF
5013 #line 5014 "configure"
5014 #include "confdefs.h"
5015 /* Override any gcc2 internal prototype to avoid an error.  */
5016 /* We use char because int might match the return type of a gcc2
5017     builtin and then its argument prototype would still apply.  */
5018 char pthread_create();
5019
5020 int main() {
5021 pthread_create()
5022 ; return 0; }
5023 EOF
5024 if { (eval echo configure:5025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5025   rm -rf conftest*
5026   eval "ac_cv_lib_$ac_lib_var=yes"
5027 else
5028   echo "configure: failed program was:" >&5
5029   cat conftest.$ac_ext >&5
5030   rm -rf conftest*
5031   eval "ac_cv_lib_$ac_lib_var=no"
5032 fi
5033 rm -f conftest*
5034 LIBS="$ac_save_LIBS"
5035
5036 fi
5037 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5038   echo "$ac_t""yes" 1>&6
5039   
5040                                 ol_link_threads=posix
5041                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
5042 else
5043   echo "$ac_t""no" 1>&6
5044 :
5045 fi
5046
5047                         LIBS="$save_LIBS"
5048                 fi
5049
5050                 if test $ol_link_threads = no ; then
5051                                                 save_LIBS="$LIBS"
5052                         echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
5053 echo "configure:5054: checking for pthread_create in -lc_r" >&5
5054 ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
5055 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5056   echo $ac_n "(cached) $ac_c" 1>&6
5057 else
5058   ac_save_LIBS="$LIBS"
5059 LIBS="-lc_r  $LIBS"
5060 cat > conftest.$ac_ext <<EOF
5061 #line 5062 "configure"
5062 #include "confdefs.h"
5063 /* Override any gcc2 internal prototype to avoid an error.  */
5064 /* We use char because int might match the return type of a gcc2
5065     builtin and then its argument prototype would still apply.  */
5066 char pthread_create();
5067
5068 int main() {
5069 pthread_create()
5070 ; return 0; }
5071 EOF
5072 if { (eval echo configure:5073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5073   rm -rf conftest*
5074   eval "ac_cv_lib_$ac_lib_var=yes"
5075 else
5076   echo "configure: failed program was:" >&5
5077   cat conftest.$ac_ext >&5
5078   rm -rf conftest*
5079   eval "ac_cv_lib_$ac_lib_var=no"
5080 fi
5081 rm -f conftest*
5082 LIBS="$ac_save_LIBS"
5083
5084 fi
5085 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5086   echo "$ac_t""yes" 1>&6
5087   
5088                                 ol_link_threads=posix
5089                                 LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"
5090 else
5091   echo "$ac_t""no" 1>&6
5092 :
5093 fi
5094
5095                         LIBS="$save_LIBS"
5096                 fi
5097
5098                 if test $ol_link_threads = no ; then
5099                                                 echo $ac_n "checking for pthread_create with -threads""... $ac_c" 1>&6
5100 echo "configure:5101: checking for pthread_create with -threads" >&5
5101 if eval "test \"`echo '$''{'ol_cv_threads_flag'+set}'`\" = set"; then
5102   echo $ac_n "(cached) $ac_c" 1>&6
5103 else
5104   
5105                                                                 save_LIBS="$LIBS"
5106                                 LIBS="-threads $LIBS"
5107                                 cat > conftest.$ac_ext <<EOF
5108 #line 5109 "configure"
5109 #include "confdefs.h"
5110 char pthread_create();
5111 int main() {
5112
5113                                         pthread_create();
5114                                         
5115 ; return 0; }
5116 EOF
5117 if { (eval echo configure:5118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5118   rm -rf conftest*
5119   ol_cv_threads_flag=yes
5120 else
5121   echo "configure: failed program was:" >&5
5122   cat conftest.$ac_ext >&5
5123   rm -rf conftest*
5124   ol_cv_threads_flag=no
5125 fi
5126 rm -f conftest*
5127                                                                 LIBS="$save_LIBS"
5128                         
5129 fi
5130
5131 echo "$ac_t""$ol_cv_threads_flag" 1>&6
5132
5133                         if test $ol_cv_threads_flag = yes ; then
5134                                 LTHREAD_LIBS="$LTHREAD_LIBS -threads"
5135                                 ol_link_threads=posix
5136                         fi
5137                 fi
5138
5139                 if test $ol_link_threads = no ; then
5140                                                 save_LIBS="$LIBS"
5141                         echo $ac_n "checking for pthread_mutex_unlock in -lpthreads""... $ac_c" 1>&6
5142 echo "configure:5143: checking for pthread_mutex_unlock in -lpthreads" >&5
5143 ac_lib_var=`echo pthreads'_'pthread_mutex_unlock | sed 'y%./+-%__p_%'`
5144 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5145   echo $ac_n "(cached) $ac_c" 1>&6
5146 else
5147   ac_save_LIBS="$LIBS"
5148 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
5149 cat > conftest.$ac_ext <<EOF
5150 #line 5151 "configure"
5151 #include "confdefs.h"
5152 /* Override any gcc2 internal prototype to avoid an error.  */
5153 /* We use char because int might match the return type of a gcc2
5154     builtin and then its argument prototype would still apply.  */
5155 char pthread_mutex_unlock();
5156
5157 int main() {
5158 pthread_mutex_unlock()
5159 ; return 0; }
5160 EOF
5161 if { (eval echo configure:5162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5162   rm -rf conftest*
5163   eval "ac_cv_lib_$ac_lib_var=yes"
5164 else
5165   echo "configure: failed program was:" >&5
5166   cat conftest.$ac_ext >&5
5167   rm -rf conftest*
5168   eval "ac_cv_lib_$ac_lib_var=no"
5169 fi
5170 rm -f conftest*
5171 LIBS="$ac_save_LIBS"
5172
5173 fi
5174 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5175   echo "$ac_t""yes" 1>&6
5176   
5177                                 ol_link_threads=posix
5178                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc -lc_r"
5179                                 if test $ol_with_yielding_select = auto ; then
5180                                         ol_with_yielding_select=yes
5181                                 fi
5182                                 
5183 else
5184   echo "$ac_t""no" 1>&6
5185 :
5186 fi
5187
5188                         LIBS="$save_LIBS"
5189                 fi
5190
5191                 if test $ol_link_threads = no ; then
5192                                                 save_LIBS="$LIBS"
5193                         echo $ac_n "checking for pthread_mutex_lock in -lpthreads""... $ac_c" 1>&6
5194 echo "configure:5195: checking for pthread_mutex_lock in -lpthreads" >&5
5195 ac_lib_var=`echo pthreads'_'pthread_mutex_lock | sed 'y%./+-%__p_%'`
5196 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5197   echo $ac_n "(cached) $ac_c" 1>&6
5198 else
5199   ac_save_LIBS="$LIBS"
5200 LIBS="-lpthreads -lmach -lexc $LIBS"
5201 cat > conftest.$ac_ext <<EOF
5202 #line 5203 "configure"
5203 #include "confdefs.h"
5204 /* Override any gcc2 internal prototype to avoid an error.  */
5205 /* We use char because int might match the return type of a gcc2
5206     builtin and then its argument prototype would still apply.  */
5207 char pthread_mutex_lock();
5208
5209 int main() {
5210 pthread_mutex_lock()
5211 ; return 0; }
5212 EOF
5213 if { (eval echo configure:5214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5214   rm -rf conftest*
5215   eval "ac_cv_lib_$ac_lib_var=yes"
5216 else
5217   echo "configure: failed program was:" >&5
5218   cat conftest.$ac_ext >&5
5219   rm -rf conftest*
5220   eval "ac_cv_lib_$ac_lib_var=no"
5221 fi
5222 rm -f conftest*
5223 LIBS="$ac_save_LIBS"
5224
5225 fi
5226 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5227   echo "$ac_t""yes" 1>&6
5228   
5229                                 ol_link_threads=posix
5230                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc"
5231                                 if test $ol_with_yielding_select = auto ; then
5232                                         ol_with_yielding_select=yes
5233                                 fi
5234                                 
5235 else
5236   echo "$ac_t""no" 1>&6
5237 :
5238 fi
5239
5240                         LIBS="$save_LIBS"
5241                 fi
5242
5243                 if test $ol_link_threads = no ; then
5244                                                 save_LIBS="$LIBS"
5245                         echo $ac_n "checking for pthread_mutex_trylock in -lpthreads""... $ac_c" 1>&6
5246 echo "configure:5247: checking for pthread_mutex_trylock in -lpthreads" >&5
5247 ac_lib_var=`echo pthreads'_'pthread_mutex_trylock | sed 'y%./+-%__p_%'`
5248 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5249   echo $ac_n "(cached) $ac_c" 1>&6
5250 else
5251   ac_save_LIBS="$LIBS"
5252 LIBS="-lpthreads -lexc $LIBS"
5253 cat > conftest.$ac_ext <<EOF
5254 #line 5255 "configure"
5255 #include "confdefs.h"
5256 /* Override any gcc2 internal prototype to avoid an error.  */
5257 /* We use char because int might match the return type of a gcc2
5258     builtin and then its argument prototype would still apply.  */
5259 char pthread_mutex_trylock();
5260
5261 int main() {
5262 pthread_mutex_trylock()
5263 ; return 0; }
5264 EOF
5265 if { (eval echo configure:5266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5266   rm -rf conftest*
5267   eval "ac_cv_lib_$ac_lib_var=yes"
5268 else
5269   echo "configure: failed program was:" >&5
5270   cat conftest.$ac_ext >&5
5271   rm -rf conftest*
5272   eval "ac_cv_lib_$ac_lib_var=no"
5273 fi
5274 rm -f conftest*
5275 LIBS="$ac_save_LIBS"
5276
5277 fi
5278 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5279   echo "$ac_t""yes" 1>&6
5280   
5281                                 ol_link_threads=posix
5282                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lexc"
5283                                 if test $ol_with_yielding_select = auto ; then
5284                                         ol_with_yielding_select=yes
5285                                 fi
5286                                 
5287 else
5288   echo "$ac_t""no" 1>&6
5289 :
5290 fi
5291
5292                         LIBS="$save_LIBS"
5293                 fi
5294
5295                 if test $ol_link_threads = no ; then
5296                                                 save_LIBS="$LIBS"
5297                         echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
5298 echo "configure:5299: checking for pthread_create in -lpthreads" >&5
5299 ac_lib_var=`echo pthreads'_'pthread_create | sed 'y%./+-%__p_%'`
5300 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5301   echo $ac_n "(cached) $ac_c" 1>&6
5302 else
5303   ac_save_LIBS="$LIBS"
5304 LIBS="-lpthreads  $LIBS"
5305 cat > conftest.$ac_ext <<EOF
5306 #line 5307 "configure"
5307 #include "confdefs.h"
5308 /* Override any gcc2 internal prototype to avoid an error.  */
5309 /* We use char because int might match the return type of a gcc2
5310     builtin and then its argument prototype would still apply.  */
5311 char pthread_create();
5312
5313 int main() {
5314 pthread_create()
5315 ; return 0; }
5316 EOF
5317 if { (eval echo configure:5318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5318   rm -rf conftest*
5319   eval "ac_cv_lib_$ac_lib_var=yes"
5320 else
5321   echo "configure: failed program was:" >&5
5322   cat conftest.$ac_ext >&5
5323   rm -rf conftest*
5324   eval "ac_cv_lib_$ac_lib_var=no"
5325 fi
5326 rm -f conftest*
5327 LIBS="$ac_save_LIBS"
5328
5329 fi
5330 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5331   echo "$ac_t""yes" 1>&6
5332   
5333                                 ol_link_threads=posix
5334                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads"
5335 else
5336   echo "$ac_t""no" 1>&6
5337 :
5338 fi
5339
5340                         LIBS="$save_LIBS"
5341                 fi
5342
5343                 if test $ol_link_threads != no ; then
5344                         cat >> confdefs.h <<\EOF
5345 #define HAVE_PTHREADS 1
5346 EOF
5347
5348
5349                                                 save_CPPFLAGS="$CPPFLAGS"
5350                         save_LIBS="$LIBS"
5351                         LIBS="$LTHREAD_LIBS $LIBS"
5352
5353                                                                                                 for ac_func in sched_yield pthread_yield
5354 do
5355 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5356 echo "configure:5357: checking for $ac_func" >&5
5357 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5358   echo $ac_n "(cached) $ac_c" 1>&6
5359 else
5360   cat > conftest.$ac_ext <<EOF
5361 #line 5362 "configure"
5362 #include "confdefs.h"
5363 /* System header to define __stub macros and hopefully few prototypes,
5364     which can conflict with char $ac_func(); below.  */
5365 #include <assert.h>
5366 /* Override any gcc2 internal prototype to avoid an error.  */
5367 /* We use char because int might match the return type of a gcc2
5368     builtin and then its argument prototype would still apply.  */
5369 char $ac_func();
5370
5371 int main() {
5372
5373 /* The GNU C library defines this for functions which it implements
5374     to always fail with ENOSYS.  Some functions are actually named
5375     something starting with __ and the normal name is an alias.  */
5376 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5377 choke me
5378 #else
5379 $ac_func();
5380 #endif
5381
5382 ; return 0; }
5383 EOF
5384 if { (eval echo configure:5385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5385   rm -rf conftest*
5386   eval "ac_cv_func_$ac_func=yes"
5387 else
5388   echo "configure: failed program was:" >&5
5389   cat conftest.$ac_ext >&5
5390   rm -rf conftest*
5391   eval "ac_cv_func_$ac_func=no"
5392 fi
5393 rm -f conftest*
5394 fi
5395
5396 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5397   echo "$ac_t""yes" 1>&6
5398     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5399   cat >> confdefs.h <<EOF
5400 #define $ac_tr_func 1
5401 EOF
5402  
5403 else
5404   echo "$ac_t""no" 1>&6
5405 fi
5406 done
5407
5408
5409                         if test $ac_cv_func_sched_yield = no -a \
5410                                 $ac_cv_func_pthread_yield = no ; then
5411                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
5412 echo "configure:5413: checking for sched_yield in -lrt" >&5
5413 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
5414 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5415   echo $ac_n "(cached) $ac_c" 1>&6
5416 else
5417   ac_save_LIBS="$LIBS"
5418 LIBS="-lrt  $LIBS"
5419 cat > conftest.$ac_ext <<EOF
5420 #line 5421 "configure"
5421 #include "confdefs.h"
5422 /* Override any gcc2 internal prototype to avoid an error.  */
5423 /* We use char because int might match the return type of a gcc2
5424     builtin and then its argument prototype would still apply.  */
5425 char sched_yield();
5426
5427 int main() {
5428 sched_yield()
5429 ; return 0; }
5430 EOF
5431 if { (eval echo configure:5432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5432   rm -rf conftest*
5433   eval "ac_cv_lib_$ac_lib_var=yes"
5434 else
5435   echo "configure: failed program was:" >&5
5436   cat conftest.$ac_ext >&5
5437   rm -rf conftest*
5438   eval "ac_cv_lib_$ac_lib_var=no"
5439 fi
5440 rm -f conftest*
5441 LIBS="$ac_save_LIBS"
5442
5443 fi
5444 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5445   echo "$ac_t""yes" 1>&6
5446   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
5447                                         cat >> confdefs.h <<\EOF
5448 #define HAVE_SCHED_YIELD 1
5449 EOF
5450
5451                                         ac_cv_func_sched_yield=yes
5452 else
5453   echo "$ac_t""no" 1>&6
5454 ac_cv_func_sched_yield=no
5455 fi
5456
5457                         fi
5458                         if test $ac_cv_func_sched_yield = no -a \
5459                                 $ac_cv_func_pthread_yield = no ; then
5460                                                                                                 for ac_func in thr_yield
5461 do
5462 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5463 echo "configure:5464: checking for $ac_func" >&5
5464 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5465   echo $ac_n "(cached) $ac_c" 1>&6
5466 else
5467   cat > conftest.$ac_ext <<EOF
5468 #line 5469 "configure"
5469 #include "confdefs.h"
5470 /* System header to define __stub macros and hopefully few prototypes,
5471     which can conflict with char $ac_func(); below.  */
5472 #include <assert.h>
5473 /* Override any gcc2 internal prototype to avoid an error.  */
5474 /* We use char because int might match the return type of a gcc2
5475     builtin and then its argument prototype would still apply.  */
5476 char $ac_func();
5477
5478 int main() {
5479
5480 /* The GNU C library defines this for functions which it implements
5481     to always fail with ENOSYS.  Some functions are actually named
5482     something starting with __ and the normal name is an alias.  */
5483 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5484 choke me
5485 #else
5486 $ac_func();
5487 #endif
5488
5489 ; return 0; }
5490 EOF
5491 if { (eval echo configure:5492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5492   rm -rf conftest*
5493   eval "ac_cv_func_$ac_func=yes"
5494 else
5495   echo "configure: failed program was:" >&5
5496   cat conftest.$ac_ext >&5
5497   rm -rf conftest*
5498   eval "ac_cv_func_$ac_func=no"
5499 fi
5500 rm -f conftest*
5501 fi
5502
5503 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5504   echo "$ac_t""yes" 1>&6
5505     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5506   cat >> confdefs.h <<EOF
5507 #define $ac_tr_func 1
5508 EOF
5509  
5510 else
5511   echo "$ac_t""no" 1>&6
5512 fi
5513 done
5514
5515                         fi
5516                         if test $ac_cv_func_sched_yield = no -a \
5517                                 $ac_cv_func_pthread_yield = no -a \
5518                                 "$ac_cv_func_thr_yield" = no ; then
5519                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
5520                         fi
5521
5522                                                 for ac_func in pthread_kill
5523 do
5524 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5525 echo "configure:5526: checking for $ac_func" >&5
5526 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5527   echo $ac_n "(cached) $ac_c" 1>&6
5528 else
5529   cat > conftest.$ac_ext <<EOF
5530 #line 5531 "configure"
5531 #include "confdefs.h"
5532 /* System header to define __stub macros and hopefully few prototypes,
5533     which can conflict with char $ac_func(); below.  */
5534 #include <assert.h>
5535 /* Override any gcc2 internal prototype to avoid an error.  */
5536 /* We use char because int might match the return type of a gcc2
5537     builtin and then its argument prototype would still apply.  */
5538 char $ac_func();
5539
5540 int main() {
5541
5542 /* The GNU C library defines this for functions which it implements
5543     to always fail with ENOSYS.  Some functions are actually named
5544     something starting with __ and the normal name is an alias.  */
5545 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5546 choke me
5547 #else
5548 $ac_func();
5549 #endif
5550
5551 ; return 0; }
5552 EOF
5553 if { (eval echo configure:5554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5554   rm -rf conftest*
5555   eval "ac_cv_func_$ac_func=yes"
5556 else
5557   echo "configure: failed program was:" >&5
5558   cat conftest.$ac_ext >&5
5559   rm -rf conftest*
5560   eval "ac_cv_func_$ac_func=no"
5561 fi
5562 rm -f conftest*
5563 fi
5564
5565 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5566   echo "$ac_t""yes" 1>&6
5567     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5568   cat >> confdefs.h <<EOF
5569 #define $ac_tr_func 1
5570 EOF
5571  
5572 else
5573   echo "$ac_t""no" 1>&6
5574 fi
5575 done
5576
5577
5578                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
5579 echo "configure:5580: checking for pthread_detach with <pthread.h>" >&5
5580 if eval "test \"`echo '$''{'ol_cv_func_pthread_detach'+set}'`\" = set"; then
5581   echo $ac_n "(cached) $ac_c" 1>&6
5582 else
5583   
5584                                                                 cat > conftest.$ac_ext <<EOF
5585 #line 5586 "configure"
5586 #include "confdefs.h"
5587
5588 #include <pthread.h>
5589 #ifndef NULL
5590 #define NULL (void*)0
5591 #endif
5592
5593 int main() {
5594 pthread_detach(NULL);
5595 ; return 0; }
5596 EOF
5597 if { (eval echo configure:5598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5598   rm -rf conftest*
5599   ol_cv_func_pthread_detach=yes
5600 else
5601   echo "configure: failed program was:" >&5
5602   cat conftest.$ac_ext >&5
5603   rm -rf conftest*
5604   ol_cv_func_pthread_detach=no
5605 fi
5606 rm -f conftest*
5607                         
5608 fi
5609
5610 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
5611
5612                         if test $ol_cv_func_pthread_detach = no ; then
5613                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
5614                         fi
5615
5616                         cat >> confdefs.h <<\EOF
5617 #define HAVE_PTHREAD_DETACH 1
5618 EOF
5619
5620
5621                                                 for ac_func in \
5622                                 pthread_setconcurrency \
5623                                 pthread_getconcurrency \
5624                                 thr_setconcurrency \
5625                                 thr_getconcurrency \
5626                         
5627 do
5628 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5629 echo "configure:5630: checking for $ac_func" >&5
5630 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5631   echo $ac_n "(cached) $ac_c" 1>&6
5632 else
5633   cat > conftest.$ac_ext <<EOF
5634 #line 5635 "configure"
5635 #include "confdefs.h"
5636 /* System header to define __stub macros and hopefully few prototypes,
5637     which can conflict with char $ac_func(); below.  */
5638 #include <assert.h>
5639 /* Override any gcc2 internal prototype to avoid an error.  */
5640 /* We use char because int might match the return type of a gcc2
5641     builtin and then its argument prototype would still apply.  */
5642 char $ac_func();
5643
5644 int main() {
5645
5646 /* The GNU C library defines this for functions which it implements
5647     to always fail with ENOSYS.  Some functions are actually named
5648     something starting with __ and the normal name is an alias.  */
5649 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5650 choke me
5651 #else
5652 $ac_func();
5653 #endif
5654
5655 ; return 0; }
5656 EOF
5657 if { (eval echo configure:5658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5658   rm -rf conftest*
5659   eval "ac_cv_func_$ac_func=yes"
5660 else
5661   echo "configure: failed program was:" >&5
5662   cat conftest.$ac_ext >&5
5663   rm -rf conftest*
5664   eval "ac_cv_func_$ac_func=no"
5665 fi
5666 rm -f conftest*
5667 fi
5668
5669 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5670   echo "$ac_t""yes" 1>&6
5671     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5672   cat >> confdefs.h <<EOF
5673 #define $ac_tr_func 1
5674 EOF
5675  
5676 else
5677   echo "$ac_t""no" 1>&6
5678 fi
5679 done
5680
5681
5682                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
5683 echo "configure:5684: checking if pthread_create() works" >&5
5684                         if eval "test \"`echo '$''{'ol_cv_pthread_create_works'+set}'`\" = set"; then
5685   echo $ac_n "(cached) $ac_c" 1>&6
5686 else
5687   
5688                         if test "$cross_compiling" = yes; then
5689                                 ol_cv_pthread_create_works=yes
5690 else
5691   cat > conftest.$ac_ext <<EOF
5692 #line 5693 "configure"
5693 #include "confdefs.h"
5694
5695 #include <pthread.h>
5696 #ifndef NULL
5697 #define NULL (void*)0
5698 #endif
5699
5700 static void *task(p)
5701         void *p;
5702 {
5703         return (void *) (p == NULL);
5704 }
5705
5706 int main(argc, argv)
5707         int argc;
5708         char **argv;
5709 {
5710         pthread_t t;
5711 #if HAVE_PTHREADS_D4
5712         exit(pthread_create(&t, pthread_attr_default, task, NULL));
5713 #else
5714         exit(pthread_create(&t, NULL, task, NULL));
5715 #endif
5716 }
5717
5718 EOF
5719 if { (eval echo configure:5720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5720 then
5721   ol_cv_pthread_create_works=yes
5722 else
5723   echo "configure: failed program was:" >&5
5724   cat conftest.$ac_ext >&5
5725   rm -fr conftest*
5726   ol_cv_pthread_create_works=no
5727 fi
5728 rm -fr conftest*
5729 fi
5730
5731 fi
5732
5733                         echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
5734
5735                         if test $ol_cv_pthread_create_works = no ; then
5736                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
5737                         fi
5738
5739                                                 if test $ol_with_yielding_select = auto ; then
5740                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
5741 echo "configure:5742: checking if select yields when using pthreads" >&5
5742                                 if eval "test \"`echo '$''{'ol_cv_pthread_select_yields'+set}'`\" = set"; then
5743   echo $ac_n "(cached) $ac_c" 1>&6
5744 else
5745   
5746                                 if test "$cross_compiling" = yes; then
5747   
5748                                 { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
5749 else
5750   cat > conftest.$ac_ext <<EOF
5751 #line 5752 "configure"
5752 #include "confdefs.h"
5753
5754 #include <sys/types.h>
5755 #include <sys/time.h>
5756 #include <unistd.h>
5757 #include <pthread.h>
5758 #ifndef NULL
5759 #define NULL (void*) 0
5760 #endif
5761
5762 static int fildes[2];
5763
5764 static void *task(p)
5765         void *p;
5766 {
5767         int i;
5768         struct timeval tv;
5769
5770         fd_set rfds;
5771
5772         tv.tv_sec=10;
5773         tv.tv_usec=0;
5774
5775         FD_ZERO(&rfds);
5776         FD_SET(fildes[0], &rfds);
5777
5778         /* we're not interested in any fds */
5779         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
5780
5781         if(i < 0) {
5782                 perror("select");
5783                 exit(10);
5784         }
5785
5786         exit(0); /* if we exit here, the select blocked the whole process */
5787 }
5788
5789 int main(argc, argv)
5790         int argc;
5791         char **argv;
5792 {
5793         pthread_t t;
5794
5795         /* create a pipe to select */
5796         if(pipe(&fildes[0])) {
5797                 perror("select");
5798                 exit(1);
5799         }
5800
5801 #ifdef HAVE_PTHREAD_SETCONCURRENCY
5802         (void) pthread_setconcurrency(2);
5803 #else
5804 #ifdef HAVE_THR_SETCONCURRENCY
5805         /* Set Solaris LWP concurrency to 2 */
5806         thr_setconcurrency(2);
5807 #endif
5808 #endif
5809
5810 #if HAVE_PTHREADS_D4
5811         pthread_create(&t, pthread_attr_default, task, NULL);
5812 #else
5813         pthread_create(&t, NULL, task, NULL);
5814 #endif
5815
5816 #if HAVE_SCHED_YIELD
5817         sched_yield();  /* make sure task runs first */
5818 #else
5819 #ifdef HAVE_PTHREAD_YIELD
5820         pthread_yield();        /* make sure task runs first */
5821 #endif
5822 #endif
5823
5824         exit(2);
5825 }
5826 EOF
5827 if { (eval echo configure:5828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5828 then
5829   ol_cv_pthread_select_yields=no
5830 else
5831   echo "configure: failed program was:" >&5
5832   cat conftest.$ac_ext >&5
5833   rm -fr conftest*
5834   ol_cv_pthread_select_yields=yes
5835 fi
5836 rm -fr conftest*
5837 fi
5838
5839 fi
5840
5841                                 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
5842
5843                                 if test $ol_cv_pthread_select_yields = yes ; then
5844                                         ol_with_yielding_select=yes
5845                                 fi
5846                         fi
5847
5848                                                 CPPFLAGS="$save_CPPFLAGS"
5849                         LIBS="$save_LIBS"
5850                 else
5851                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
5852                 fi
5853         fi
5854
5855         if test $ol_with_threads = posix ; then
5856                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
5857         fi
5858 fi
5859
5860 if test $ol_with_threads = auto -o $ol_with_threads = yes \
5861         -o $ol_with_threads = mach ; then
5862
5863                 for ac_hdr in mach/cthreads.h
5864 do
5865 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5866 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5867 echo "configure:5868: checking for $ac_hdr" >&5
5868 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5869   echo $ac_n "(cached) $ac_c" 1>&6
5870 else
5871   cat > conftest.$ac_ext <<EOF
5872 #line 5873 "configure"
5873 #include "confdefs.h"
5874 #include <$ac_hdr>
5875 EOF
5876 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5877 { (eval echo configure:5878: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5878 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5879 if test -z "$ac_err"; then
5880   rm -rf conftest*
5881   eval "ac_cv_header_$ac_safe=yes"
5882 else
5883   echo "$ac_err" >&5
5884   echo "configure: failed program was:" >&5
5885   cat conftest.$ac_ext >&5
5886   rm -rf conftest*
5887   eval "ac_cv_header_$ac_safe=no"
5888 fi
5889 rm -f conftest*
5890 fi
5891 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5892   echo "$ac_t""yes" 1>&6
5893     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5894   cat >> confdefs.h <<EOF
5895 #define $ac_tr_hdr 1
5896 EOF
5897  
5898 else
5899   echo "$ac_t""no" 1>&6
5900 fi
5901 done
5902
5903         if test $ac_cv_header_mach_cthreads_h = yes ; then
5904                 ol_with_threads=found
5905
5906                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
5907 echo "configure:5908: checking for cthread_fork" >&5
5908 if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
5909   echo $ac_n "(cached) $ac_c" 1>&6
5910 else
5911   cat > conftest.$ac_ext <<EOF
5912 #line 5913 "configure"
5913 #include "confdefs.h"
5914 /* System header to define __stub macros and hopefully few prototypes,
5915     which can conflict with char cthread_fork(); below.  */
5916 #include <assert.h>
5917 /* Override any gcc2 internal prototype to avoid an error.  */
5918 /* We use char because int might match the return type of a gcc2
5919     builtin and then its argument prototype would still apply.  */
5920 char cthread_fork();
5921
5922 int main() {
5923
5924 /* The GNU C library defines this for functions which it implements
5925     to always fail with ENOSYS.  Some functions are actually named
5926     something starting with __ and the normal name is an alias.  */
5927 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
5928 choke me
5929 #else
5930 cthread_fork();
5931 #endif
5932
5933 ; return 0; }
5934 EOF
5935 if { (eval echo configure:5936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5936   rm -rf conftest*
5937   eval "ac_cv_func_cthread_fork=yes"
5938 else
5939   echo "configure: failed program was:" >&5
5940   cat conftest.$ac_ext >&5
5941   rm -rf conftest*
5942   eval "ac_cv_func_cthread_fork=no"
5943 fi
5944 rm -f conftest*
5945 fi
5946
5947 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
5948   echo "$ac_t""yes" 1>&6
5949   ol_link_threads=yes
5950 else
5951   echo "$ac_t""no" 1>&6
5952 fi
5953
5954
5955                 if test $ol_link_threads = no ; then
5956                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
5957 echo "configure:5958: checking for cthread_fork with -all_load" >&5
5958 if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
5959   echo $ac_n "(cached) $ac_c" 1>&6
5960 else
5961   
5962                                                                 save_LIBS="$LIBS"
5963                                 LIBS="-all_load $LIBS"
5964                                 cat > conftest.$ac_ext <<EOF
5965 #line 5966 "configure"
5966 #include "confdefs.h"
5967 #include <mach/cthreads.h>
5968 int main() {
5969
5970                                         cthread_fork((void *)0, (void *)0);
5971                                         
5972 ; return 0; }
5973 EOF
5974 if { (eval echo configure:5975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5975   rm -rf conftest*
5976   ol_cv_cthread_all_load=yes
5977 else
5978   echo "configure: failed program was:" >&5
5979   cat conftest.$ac_ext >&5
5980   rm -rf conftest*
5981   ol_cv_cthread_all_load=no
5982 fi
5983 rm -f conftest*
5984                                                                 LIBS="$save_LIBS"
5985                         
5986 fi
5987
5988 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
5989
5990                         if test $ol_cv_cthread_all_load = yes ; then
5991                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
5992                                 ol_link_threads=mach
5993                         fi
5994                 fi
5995
5996                 if test $ol_link_threads != no ; then
5997                         : check for cthread specific functionality here
5998                         cat >> confdefs.h <<\EOF
5999 #define HAVE_MACH_CTHREADS 1
6000 EOF
6001
6002                 else
6003                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
6004                 fi
6005         fi
6006
6007         if test $ol_with_threads = mach ; then
6008                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
6009         fi
6010 fi
6011
6012 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6013         -o $ol_with_threads = lwp ; then
6014
6015                 for ac_hdr in thread.h synch.h
6016 do
6017 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6018 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6019 echo "configure:6020: checking for $ac_hdr" >&5
6020 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6021   echo $ac_n "(cached) $ac_c" 1>&6
6022 else
6023   cat > conftest.$ac_ext <<EOF
6024 #line 6025 "configure"
6025 #include "confdefs.h"
6026 #include <$ac_hdr>
6027 EOF
6028 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6029 { (eval echo configure:6030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6030 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6031 if test -z "$ac_err"; then
6032   rm -rf conftest*
6033   eval "ac_cv_header_$ac_safe=yes"
6034 else
6035   echo "$ac_err" >&5
6036   echo "configure: failed program was:" >&5
6037   cat conftest.$ac_ext >&5
6038   rm -rf conftest*
6039   eval "ac_cv_header_$ac_safe=no"
6040 fi
6041 rm -f conftest*
6042 fi
6043 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6044   echo "$ac_t""yes" 1>&6
6045     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6046   cat >> confdefs.h <<EOF
6047 #define $ac_tr_hdr 1
6048 EOF
6049  
6050 else
6051   echo "$ac_t""no" 1>&6
6052 fi
6053 done
6054
6055         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
6056                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
6057 echo "configure:6058: checking for thr_create in -lthread" >&5
6058 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
6059 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6060   echo $ac_n "(cached) $ac_c" 1>&6
6061 else
6062   ac_save_LIBS="$LIBS"
6063 LIBS="-lthread  $LIBS"
6064 cat > conftest.$ac_ext <<EOF
6065 #line 6066 "configure"
6066 #include "confdefs.h"
6067 /* Override any gcc2 internal prototype to avoid an error.  */
6068 /* We use char because int might match the return type of a gcc2
6069     builtin and then its argument prototype would still apply.  */
6070 char thr_create();
6071
6072 int main() {
6073 thr_create()
6074 ; return 0; }
6075 EOF
6076 if { (eval echo configure:6077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6077   rm -rf conftest*
6078   eval "ac_cv_lib_$ac_lib_var=yes"
6079 else
6080   echo "configure: failed program was:" >&5
6081   cat conftest.$ac_ext >&5
6082   rm -rf conftest*
6083   eval "ac_cv_lib_$ac_lib_var=no"
6084 fi
6085 rm -f conftest*
6086 LIBS="$ac_save_LIBS"
6087
6088 fi
6089 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6090   echo "$ac_t""yes" 1>&6
6091   have_thr=yes
6092 else
6093   echo "$ac_t""no" 1>&6
6094 have_thr=no
6095 fi
6096
6097
6098                 if test $have_thr = yes ; then
6099                         cat >> confdefs.h <<\EOF
6100 #define HAVE_THR 1
6101 EOF
6102
6103                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
6104                         ol_link_threads=thr
6105
6106                         if test $ol_with_yielding_select = auto ; then
6107                                 ol_with_yielding_select=yes
6108                         fi
6109
6110                                                 for ac_func in \
6111                                 thr_setconcurrency \
6112                                 thr_getconcurrency \
6113                         
6114 do
6115 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6116 echo "configure:6117: checking for $ac_func" >&5
6117 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6118   echo $ac_n "(cached) $ac_c" 1>&6
6119 else
6120   cat > conftest.$ac_ext <<EOF
6121 #line 6122 "configure"
6122 #include "confdefs.h"
6123 /* System header to define __stub macros and hopefully few prototypes,
6124     which can conflict with char $ac_func(); below.  */
6125 #include <assert.h>
6126 /* Override any gcc2 internal prototype to avoid an error.  */
6127 /* We use char because int might match the return type of a gcc2
6128     builtin and then its argument prototype would still apply.  */
6129 char $ac_func();
6130
6131 int main() {
6132
6133 /* The GNU C library defines this for functions which it implements
6134     to always fail with ENOSYS.  Some functions are actually named
6135     something starting with __ and the normal name is an alias.  */
6136 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6137 choke me
6138 #else
6139 $ac_func();
6140 #endif
6141
6142 ; return 0; }
6143 EOF
6144 if { (eval echo configure:6145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6145   rm -rf conftest*
6146   eval "ac_cv_func_$ac_func=yes"
6147 else
6148   echo "configure: failed program was:" >&5
6149   cat conftest.$ac_ext >&5
6150   rm -rf conftest*
6151   eval "ac_cv_func_$ac_func=no"
6152 fi
6153 rm -f conftest*
6154 fi
6155
6156 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6157   echo "$ac_t""yes" 1>&6
6158     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6159   cat >> confdefs.h <<EOF
6160 #define $ac_tr_func 1
6161 EOF
6162  
6163 else
6164   echo "$ac_t""no" 1>&6
6165 fi
6166 done
6167
6168                 fi
6169         fi
6170
6171                 for ac_hdr in lwp/lwp.h
6172 do
6173 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6174 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6175 echo "configure:6176: checking for $ac_hdr" >&5
6176 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6177   echo $ac_n "(cached) $ac_c" 1>&6
6178 else
6179   cat > conftest.$ac_ext <<EOF
6180 #line 6181 "configure"
6181 #include "confdefs.h"
6182 #include <$ac_hdr>
6183 EOF
6184 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6185 { (eval echo configure:6186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6186 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6187 if test -z "$ac_err"; then
6188   rm -rf conftest*
6189   eval "ac_cv_header_$ac_safe=yes"
6190 else
6191   echo "$ac_err" >&5
6192   echo "configure: failed program was:" >&5
6193   cat conftest.$ac_ext >&5
6194   rm -rf conftest*
6195   eval "ac_cv_header_$ac_safe=no"
6196 fi
6197 rm -f conftest*
6198 fi
6199 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6200   echo "$ac_t""yes" 1>&6
6201     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6202   cat >> confdefs.h <<EOF
6203 #define $ac_tr_hdr 1
6204 EOF
6205  
6206 else
6207   echo "$ac_t""no" 1>&6
6208 fi
6209 done
6210
6211         if test $ac_cv_header_lwp_lwp_h = yes ; then
6212                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
6213 echo "configure:6214: checking for lwp_create in -llwp" >&5
6214 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
6215 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6216   echo $ac_n "(cached) $ac_c" 1>&6
6217 else
6218   ac_save_LIBS="$LIBS"
6219 LIBS="-llwp  $LIBS"
6220 cat > conftest.$ac_ext <<EOF
6221 #line 6222 "configure"
6222 #include "confdefs.h"
6223 /* Override any gcc2 internal prototype to avoid an error.  */
6224 /* We use char because int might match the return type of a gcc2
6225     builtin and then its argument prototype would still apply.  */
6226 char lwp_create();
6227
6228 int main() {
6229 lwp_create()
6230 ; return 0; }
6231 EOF
6232 if { (eval echo configure:6233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6233   rm -rf conftest*
6234   eval "ac_cv_lib_$ac_lib_var=yes"
6235 else
6236   echo "configure: failed program was:" >&5
6237   cat conftest.$ac_ext >&5
6238   rm -rf conftest*
6239   eval "ac_cv_lib_$ac_lib_var=no"
6240 fi
6241 rm -f conftest*
6242 LIBS="$ac_save_LIBS"
6243
6244 fi
6245 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6246   echo "$ac_t""yes" 1>&6
6247   have_lwp=yes
6248 else
6249   echo "$ac_t""no" 1>&6
6250 have_lwp=no
6251 fi
6252
6253
6254                 if test $have_lwp = yes ; then
6255                         cat >> confdefs.h <<\EOF
6256 #define HAVE_LWP 1
6257 EOF
6258
6259                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
6260                         ol_link_threads=lwp
6261
6262                         if test $ol_with_yielding_select = auto ; then
6263                                 ol_with_yielding_select=no
6264                         fi
6265                 fi
6266         fi
6267 fi
6268
6269 if test $ol_with_yielding_select = yes ; then
6270         cat >> confdefs.h <<\EOF
6271 #define HAVE_YIELDING_SELECT 1
6272 EOF
6273
6274 fi
6275
6276 if test $ol_with_threads = manual ; then
6277                 ol_link_threads=yes
6278
6279         echo "configure: warning: thread defines and link options must be set manually" 1>&2
6280
6281         for ac_hdr in pthread.h sched.h
6282 do
6283 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6284 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6285 echo "configure:6286: checking for $ac_hdr" >&5
6286 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6287   echo $ac_n "(cached) $ac_c" 1>&6
6288 else
6289   cat > conftest.$ac_ext <<EOF
6290 #line 6291 "configure"
6291 #include "confdefs.h"
6292 #include <$ac_hdr>
6293 EOF
6294 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6295 { (eval echo configure:6296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6296 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6297 if test -z "$ac_err"; then
6298   rm -rf conftest*
6299   eval "ac_cv_header_$ac_safe=yes"
6300 else
6301   echo "$ac_err" >&5
6302   echo "configure: failed program was:" >&5
6303   cat conftest.$ac_ext >&5
6304   rm -rf conftest*
6305   eval "ac_cv_header_$ac_safe=no"
6306 fi
6307 rm -f conftest*
6308 fi
6309 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6310   echo "$ac_t""yes" 1>&6
6311     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6312   cat >> confdefs.h <<EOF
6313 #define $ac_tr_hdr 1
6314 EOF
6315  
6316 else
6317   echo "$ac_t""no" 1>&6
6318 fi
6319 done
6320
6321         for ac_func in sched_yield pthread_yield
6322 do
6323 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6324 echo "configure:6325: checking for $ac_func" >&5
6325 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6326   echo $ac_n "(cached) $ac_c" 1>&6
6327 else
6328   cat > conftest.$ac_ext <<EOF
6329 #line 6330 "configure"
6330 #include "confdefs.h"
6331 /* System header to define __stub macros and hopefully few prototypes,
6332     which can conflict with char $ac_func(); below.  */
6333 #include <assert.h>
6334 /* Override any gcc2 internal prototype to avoid an error.  */
6335 /* We use char because int might match the return type of a gcc2
6336     builtin and then its argument prototype would still apply.  */
6337 char $ac_func();
6338
6339 int main() {
6340
6341 /* The GNU C library defines this for functions which it implements
6342     to always fail with ENOSYS.  Some functions are actually named
6343     something starting with __ and the normal name is an alias.  */
6344 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6345 choke me
6346 #else
6347 $ac_func();
6348 #endif
6349
6350 ; return 0; }
6351 EOF
6352 if { (eval echo configure:6353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6353   rm -rf conftest*
6354   eval "ac_cv_func_$ac_func=yes"
6355 else
6356   echo "configure: failed program was:" >&5
6357   cat conftest.$ac_ext >&5
6358   rm -rf conftest*
6359   eval "ac_cv_func_$ac_func=no"
6360 fi
6361 rm -f conftest*
6362 fi
6363
6364 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6365   echo "$ac_t""yes" 1>&6
6366     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6367   cat >> confdefs.h <<EOF
6368 #define $ac_tr_func 1
6369 EOF
6370  
6371 else
6372   echo "$ac_t""no" 1>&6
6373 fi
6374 done
6375
6376         
6377 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
6378 echo "configure:6379: checking for LinuxThreads" >&5
6379 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
6380   echo $ac_n "(cached) $ac_c" 1>&6
6381 else
6382   
6383         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
6384         if test "$res" -gt 0 ; then
6385                 ol_cv_linux_threads=yes
6386         else
6387                 ol_cv_linux_threads=no
6388         fi
6389
6390 fi
6391
6392 echo "$ac_t""$ol_cv_linux_threads" 1>&6
6393
6394
6395         for ac_hdr in mach/cthreads.h
6396 do
6397 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6398 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6399 echo "configure:6400: checking for $ac_hdr" >&5
6400 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6401   echo $ac_n "(cached) $ac_c" 1>&6
6402 else
6403   cat > conftest.$ac_ext <<EOF
6404 #line 6405 "configure"
6405 #include "confdefs.h"
6406 #include <$ac_hdr>
6407 EOF
6408 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6409 { (eval echo configure:6410: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6410 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6411 if test -z "$ac_err"; then
6412   rm -rf conftest*
6413   eval "ac_cv_header_$ac_safe=yes"
6414 else
6415   echo "$ac_err" >&5
6416   echo "configure: failed program was:" >&5
6417   cat conftest.$ac_ext >&5
6418   rm -rf conftest*
6419   eval "ac_cv_header_$ac_safe=no"
6420 fi
6421 rm -f conftest*
6422 fi
6423 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6424   echo "$ac_t""yes" 1>&6
6425     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6426   cat >> confdefs.h <<EOF
6427 #define $ac_tr_hdr 1
6428 EOF
6429  
6430 else
6431   echo "$ac_t""no" 1>&6
6432 fi
6433 done
6434
6435         for ac_hdr in lwp/lwp.h
6436 do
6437 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6438 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6439 echo "configure:6440: checking for $ac_hdr" >&5
6440 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6441   echo $ac_n "(cached) $ac_c" 1>&6
6442 else
6443   cat > conftest.$ac_ext <<EOF
6444 #line 6445 "configure"
6445 #include "confdefs.h"
6446 #include <$ac_hdr>
6447 EOF
6448 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6449 { (eval echo configure:6450: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6450 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6451 if test -z "$ac_err"; then
6452   rm -rf conftest*
6453   eval "ac_cv_header_$ac_safe=yes"
6454 else
6455   echo "$ac_err" >&5
6456   echo "configure: failed program was:" >&5
6457   cat conftest.$ac_ext >&5
6458   rm -rf conftest*
6459   eval "ac_cv_header_$ac_safe=no"
6460 fi
6461 rm -f conftest*
6462 fi
6463 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6464   echo "$ac_t""yes" 1>&6
6465     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6466   cat >> confdefs.h <<EOF
6467 #define $ac_tr_hdr 1
6468 EOF
6469  
6470 else
6471   echo "$ac_t""no" 1>&6
6472 fi
6473 done
6474
6475         for ac_hdr in thread.h synch.h
6476 do
6477 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6478 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6479 echo "configure:6480: checking for $ac_hdr" >&5
6480 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6481   echo $ac_n "(cached) $ac_c" 1>&6
6482 else
6483   cat > conftest.$ac_ext <<EOF
6484 #line 6485 "configure"
6485 #include "confdefs.h"
6486 #include <$ac_hdr>
6487 EOF
6488 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6489 { (eval echo configure:6490: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6490 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6491 if test -z "$ac_err"; then
6492   rm -rf conftest*
6493   eval "ac_cv_header_$ac_safe=yes"
6494 else
6495   echo "$ac_err" >&5
6496   echo "configure: failed program was:" >&5
6497   cat conftest.$ac_ext >&5
6498   rm -rf conftest*
6499   eval "ac_cv_header_$ac_safe=no"
6500 fi
6501 rm -f conftest*
6502 fi
6503 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6504   echo "$ac_t""yes" 1>&6
6505     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6506   cat >> confdefs.h <<EOF
6507 #define $ac_tr_hdr 1
6508 EOF
6509  
6510 else
6511   echo "$ac_t""no" 1>&6
6512 fi
6513 done
6514
6515 fi
6516
6517 if test $ol_link_threads != no ; then  
6518                         cat >> confdefs.h <<\EOF
6519 #define REENTRANT 1
6520 EOF
6521
6522         cat >> confdefs.h <<\EOF
6523 #define _REENTRANT 1
6524 EOF
6525
6526         cat >> confdefs.h <<\EOF
6527 #define THREAD_SAFE 1
6528 EOF
6529
6530         cat >> confdefs.h <<\EOF
6531 #define _THREAD_SAFE 1
6532 EOF
6533
6534         cat >> confdefs.h <<\EOF
6535 #define THREADSAFE 1
6536 EOF
6537
6538         cat >> confdefs.h <<\EOF
6539 #define _THREADSAFE 1
6540 EOF
6541
6542
6543                                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
6544 echo "configure:6545: checking for thread specific errno" >&5
6545 if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
6546   echo $ac_n "(cached) $ac_c" 1>&6
6547 else
6548   
6549                 cat > conftest.$ac_ext <<EOF
6550 #line 6551 "configure"
6551 #include "confdefs.h"
6552 #include <errno.h>
6553 int main() {
6554 int x = errno;
6555 ; return 0; }
6556 EOF
6557 if { (eval echo configure:6558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6558   rm -rf conftest*
6559   ol_cv_errno_thread_specific=yes
6560 else
6561   echo "configure: failed program was:" >&5
6562   cat conftest.$ac_ext >&5
6563   rm -rf conftest*
6564   ol_cv_errno_thread_specific=no
6565 fi
6566 rm -f conftest*
6567         
6568 fi
6569
6570 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
6571
6572         if test $ol_cv_errno_thread_specific != yes ; then
6573                 LIBS="$LTHREAD_LIBS $LIBS"
6574                 LTHREAD_LIBS=""
6575         fi
6576
6577 fi  
6578
6579 if test $ol_link_threads = no ; then
6580         if test $ol_with_threads = yes ; then
6581                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
6582         fi
6583
6584         if test $ol_with_threads = auto ; then
6585                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
6586                 ol_with_threads=no
6587         fi
6588
6589         cat >> confdefs.h <<\EOF
6590 #define NO_THREADS 1
6591 EOF
6592
6593         LTHREAD_LIBS=""
6594 fi
6595
6596 if test $ol_link_threads != no ; then
6597         cat >> confdefs.h <<\EOF
6598 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
6599 EOF
6600
6601 fi
6602
6603
6604 ol_link_ldbm=no 
6605 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
6606         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
6607 echo "configure:6608: checking for DB2 library" >&5
6608 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
6609   echo $ac_n "(cached) $ac_c" 1>&6
6610 else
6611         ol_LIBS="$LIBS"
6612         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
6613 echo "configure:6614: checking for db_open in -ldb" >&5
6614 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
6615 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6616   echo $ac_n "(cached) $ac_c" 1>&6
6617 else
6618   ac_save_LIBS="$LIBS"
6619 LIBS="-ldb  $LIBS"
6620 cat > conftest.$ac_ext <<EOF
6621 #line 6622 "configure"
6622 #include "confdefs.h"
6623 /* Override any gcc2 internal prototype to avoid an error.  */
6624 /* We use char because int might match the return type of a gcc2
6625     builtin and then its argument prototype would still apply.  */
6626 char db_open();
6627
6628 int main() {
6629 db_open()
6630 ; return 0; }
6631 EOF
6632 if { (eval echo configure:6633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6633   rm -rf conftest*
6634   eval "ac_cv_lib_$ac_lib_var=yes"
6635 else
6636   echo "configure: failed program was:" >&5
6637   cat conftest.$ac_ext >&5
6638   rm -rf conftest*
6639   eval "ac_cv_lib_$ac_lib_var=no"
6640 fi
6641 rm -f conftest*
6642 LIBS="$ac_save_LIBS"
6643
6644 fi
6645 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6646   echo "$ac_t""yes" 1>&6
6647   ol_cv_lib_db2=-ldb
6648 else
6649   echo "$ac_t""no" 1>&6
6650 ol_cv_lib_db2=no
6651 fi
6652
6653         LIBS="$ol_LIBS"
6654
6655 fi
6656
6657 echo "$ac_t""$ol_cv_lib_db2" 1>&6
6658
6659 for ac_hdr in db.h
6660 do
6661 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6662 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6663 echo "configure:6664: checking for $ac_hdr" >&5
6664 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6665   echo $ac_n "(cached) $ac_c" 1>&6
6666 else
6667   cat > conftest.$ac_ext <<EOF
6668 #line 6669 "configure"
6669 #include "confdefs.h"
6670 #include <$ac_hdr>
6671 EOF
6672 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6673 { (eval echo configure:6674: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6674 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6675 if test -z "$ac_err"; then
6676   rm -rf conftest*
6677   eval "ac_cv_header_$ac_safe=yes"
6678 else
6679   echo "$ac_err" >&5
6680   echo "configure: failed program was:" >&5
6681   cat conftest.$ac_ext >&5
6682   rm -rf conftest*
6683   eval "ac_cv_header_$ac_safe=no"
6684 fi
6685 rm -f conftest*
6686 fi
6687 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6688   echo "$ac_t""yes" 1>&6
6689     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6690   cat >> confdefs.h <<EOF
6691 #define $ac_tr_hdr 1
6692 EOF
6693  
6694 else
6695   echo "$ac_t""no" 1>&6
6696 fi
6697 done
6698
6699 if test $ac_cv_header_db_h = yes ; then
6700         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
6701 echo "configure:6702: checking if db.h is DB2" >&5
6702 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
6703   echo $ac_n "(cached) $ac_c" 1>&6
6704 else
6705   
6706                 cat > conftest.$ac_ext <<EOF
6707 #line 6708 "configure"
6708 #include "confdefs.h"
6709
6710 #                       include <db.h>
6711                         /* this check could be improved */
6712 #                       ifdef DB_VERSION_MAJOR
6713 #                               if DB_VERSION_MAJOR == 2
6714                                         __db_version_2
6715 #                               endif
6716 #                       endif
6717                 
6718 EOF
6719 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6720   egrep "__db_version_2" >/dev/null 2>&1; then
6721   rm -rf conftest*
6722   ol_cv_header_db2=yes
6723 else
6724   rm -rf conftest*
6725   ol_cv_header_db2=no
6726 fi
6727 rm -f conftest*
6728
6729 fi
6730
6731 echo "$ac_t""$ol_cv_header_db2" 1>&6
6732 else
6733         ol_cv_header_db2=no
6734 fi
6735
6736
6737  
6738  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
6739 echo "configure:6740: checking for Berkeley DB2" >&5
6740 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
6741   echo $ac_n "(cached) $ac_c" 1>&6
6742 else
6743   
6744         if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then
6745                 ol_cv_berkeley_db2=no
6746         else
6747                 ol_cv_berkeley_db2=yes
6748         fi
6749
6750 fi
6751
6752 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
6753  if test $ol_cv_berkeley_db2 = yes ; then
6754         cat >> confdefs.h <<\EOF
6755 #define HAVE_BERKELEY_DB2 1
6756 EOF
6757
6758  fi
6759
6760
6761         if test $ol_cv_berkeley_db2 = yes ; then
6762                 ol_link_ldbm=db2
6763                 ol_with_ldbm_api=db2
6764
6765                 if test $ol_with_ldbm_type = hash ; then
6766                         cat >> confdefs.h <<\EOF
6767 #define LDBM_USE_DBHASH 1
6768 EOF
6769
6770                 else
6771                         cat >> confdefs.h <<\EOF
6772 #define LDBM_USE_DBBTREE 1
6773 EOF
6774
6775                 fi
6776
6777                                                 if test $ol_cv_lib_db2 != yes ; then
6778                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
6779                 fi
6780         fi
6781 fi
6782
6783 ol_link_bdb2=no
6784 if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
6785         ol_link_bdb2=yes
6786 fi
6787
6788 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
6789         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
6790 echo "configure:6791: checking for Berkeley DB library" >&5
6791 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
6792   echo $ac_n "(cached) $ac_c" 1>&6
6793 else
6794         ol_LIBS="$LIBS"
6795         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
6796 echo "configure:6797: checking for dbopen" >&5
6797 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
6798   echo $ac_n "(cached) $ac_c" 1>&6
6799 else
6800   cat > conftest.$ac_ext <<EOF
6801 #line 6802 "configure"
6802 #include "confdefs.h"
6803 /* System header to define __stub macros and hopefully few prototypes,
6804     which can conflict with char dbopen(); below.  */
6805 #include <assert.h>
6806 /* Override any gcc2 internal prototype to avoid an error.  */
6807 /* We use char because int might match the return type of a gcc2
6808     builtin and then its argument prototype would still apply.  */
6809 char dbopen();
6810
6811 int main() {
6812
6813 /* The GNU C library defines this for functions which it implements
6814     to always fail with ENOSYS.  Some functions are actually named
6815     something starting with __ and the normal name is an alias.  */
6816 #if defined (__stub_dbopen) || defined (__stub___dbopen)
6817 choke me
6818 #else
6819 dbopen();
6820 #endif
6821
6822 ; return 0; }
6823 EOF
6824 if { (eval echo configure:6825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6825   rm -rf conftest*
6826   eval "ac_cv_func_dbopen=yes"
6827 else
6828   echo "configure: failed program was:" >&5
6829   cat conftest.$ac_ext >&5
6830   rm -rf conftest*
6831   eval "ac_cv_func_dbopen=no"
6832 fi
6833 rm -f conftest*
6834 fi
6835
6836 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
6837   echo "$ac_t""yes" 1>&6
6838   ol_cv_lib_db=yes
6839 else
6840   echo "$ac_t""no" 1>&6
6841
6842                 echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
6843 echo "configure:6844: checking for dbopen in -ldb" >&5
6844 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
6845 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6846   echo $ac_n "(cached) $ac_c" 1>&6
6847 else
6848   ac_save_LIBS="$LIBS"
6849 LIBS="-ldb  $LIBS"
6850 cat > conftest.$ac_ext <<EOF
6851 #line 6852 "configure"
6852 #include "confdefs.h"
6853 /* Override any gcc2 internal prototype to avoid an error.  */
6854 /* We use char because int might match the return type of a gcc2
6855     builtin and then its argument prototype would still apply.  */
6856 char dbopen();
6857
6858 int main() {
6859 dbopen()
6860 ; return 0; }
6861 EOF
6862 if { (eval echo configure:6863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6863   rm -rf conftest*
6864   eval "ac_cv_lib_$ac_lib_var=yes"
6865 else
6866   echo "configure: failed program was:" >&5
6867   cat conftest.$ac_ext >&5
6868   rm -rf conftest*
6869   eval "ac_cv_lib_$ac_lib_var=no"
6870 fi
6871 rm -f conftest*
6872 LIBS="$ac_save_LIBS"
6873
6874 fi
6875 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6876   echo "$ac_t""yes" 1>&6
6877   ol_cv_lib_db=-ldb
6878 else
6879   echo "$ac_t""no" 1>&6
6880 ol_cv_lib_db=no
6881 fi
6882
6883         
6884 fi
6885
6886         LIBS="$ol_LIBS"
6887
6888 fi
6889
6890 echo "$ac_t""$ol_cv_lib_db" 1>&6
6891
6892
6893 for ac_hdr in db_185.h
6894 do
6895 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6896 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6897 echo "configure:6898: checking for $ac_hdr" >&5
6898 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6899   echo $ac_n "(cached) $ac_c" 1>&6
6900 else
6901   cat > conftest.$ac_ext <<EOF
6902 #line 6903 "configure"
6903 #include "confdefs.h"
6904 #include <$ac_hdr>
6905 EOF
6906 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6907 { (eval echo configure:6908: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6908 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6909 if test -z "$ac_err"; then
6910   rm -rf conftest*
6911   eval "ac_cv_header_$ac_safe=yes"
6912 else
6913   echo "$ac_err" >&5
6914   echo "configure: failed program was:" >&5
6915   cat conftest.$ac_ext >&5
6916   rm -rf conftest*
6917   eval "ac_cv_header_$ac_safe=no"
6918 fi
6919 rm -f conftest*
6920 fi
6921 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6922   echo "$ac_t""yes" 1>&6
6923     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6924   cat >> confdefs.h <<EOF
6925 #define $ac_tr_hdr 1
6926 EOF
6927  
6928 else
6929   echo "$ac_t""no" 1>&6
6930 fi
6931 done
6932
6933 if test "$ol_cv_header_db2" = yes ; then
6934         
6935         ol_cv_header_db=$ac_cv_header_db_185_h
6936 else
6937         ol_cv_header_db=$ac_cv_header_db_h
6938 fi
6939
6940
6941  
6942  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
6943 echo "configure:6944: checking for Berkeley DB" >&5
6944 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
6945   echo $ac_n "(cached) $ac_c" 1>&6
6946 else
6947   
6948         if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then
6949                 ol_cv_berkeley_db=no
6950         else
6951                 ol_cv_berkeley_db=yes
6952         fi
6953
6954 fi
6955
6956 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
6957  if test $ol_cv_berkeley_db = yes ; then
6958         cat >> confdefs.h <<\EOF
6959 #define HAVE_BERKELEY_DB 1
6960 EOF
6961
6962  fi
6963
6964
6965         if test $ol_cv_berkeley_db = yes ; then
6966                 ol_link_ldbm=db
6967                 ol_with_ldbm_api=db
6968
6969                 if test $ol_with_ldbm_type = hash ; then
6970                         cat >> confdefs.h <<\EOF
6971 #define LDBM_USE_DBHASH 1
6972 EOF
6973
6974                 else
6975                         cat >> confdefs.h <<\EOF
6976 #define LDBM_USE_DBBTREE 1
6977 EOF
6978
6979                 fi
6980
6981                                                 if test $ol_cv_lib_db != yes ; then
6982                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
6983                 fi
6984         fi
6985 fi
6986
6987 if test $ol_with_ldbm_api = manual ; then
6988                 ol_link_ldbm=yes
6989
6990         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
6991
6992         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
6993 do
6994 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6995 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6996 echo "configure:6997: checking for $ac_hdr" >&5
6997 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6998   echo $ac_n "(cached) $ac_c" 1>&6
6999 else
7000   cat > conftest.$ac_ext <<EOF
7001 #line 7002 "configure"
7002 #include "confdefs.h"
7003 #include <$ac_hdr>
7004 EOF
7005 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7006 { (eval echo configure:7007: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7007 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7008 if test -z "$ac_err"; then
7009   rm -rf conftest*
7010   eval "ac_cv_header_$ac_safe=yes"
7011 else
7012   echo "$ac_err" >&5
7013   echo "configure: failed program was:" >&5
7014   cat conftest.$ac_ext >&5
7015   rm -rf conftest*
7016   eval "ac_cv_header_$ac_safe=no"
7017 fi
7018 rm -f conftest*
7019 fi
7020 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7021   echo "$ac_t""yes" 1>&6
7022     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7023   cat >> confdefs.h <<EOF
7024 #define $ac_tr_hdr 1
7025 EOF
7026  
7027 else
7028   echo "$ac_t""no" 1>&6
7029 fi
7030 done
7031
7032 fi
7033
7034 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
7035         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
7036         ol_with_ldbm_api=none
7037 fi
7038
7039 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
7040         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
7041 echo "configure:7042: checking for MDBM library" >&5
7042 if eval "test \"`echo '$''{'ol_cv_lib_mdbm'+set}'`\" = set"; then
7043   echo $ac_n "(cached) $ac_c" 1>&6
7044 else
7045         ol_LIBS="$LIBS"
7046         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
7047 echo "configure:7048: checking for mdbm_set_chain" >&5
7048 if eval "test \"`echo '$''{'ac_cv_func_mdbm_set_chain'+set}'`\" = set"; then
7049   echo $ac_n "(cached) $ac_c" 1>&6
7050 else
7051   cat > conftest.$ac_ext <<EOF
7052 #line 7053 "configure"
7053 #include "confdefs.h"
7054 /* System header to define __stub macros and hopefully few prototypes,
7055     which can conflict with char mdbm_set_chain(); below.  */
7056 #include <assert.h>
7057 /* Override any gcc2 internal prototype to avoid an error.  */
7058 /* We use char because int might match the return type of a gcc2
7059     builtin and then its argument prototype would still apply.  */
7060 char mdbm_set_chain();
7061
7062 int main() {
7063
7064 /* The GNU C library defines this for functions which it implements
7065     to always fail with ENOSYS.  Some functions are actually named
7066     something starting with __ and the normal name is an alias.  */
7067 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
7068 choke me
7069 #else
7070 mdbm_set_chain();
7071 #endif
7072
7073 ; return 0; }
7074 EOF
7075 if { (eval echo configure:7076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7076   rm -rf conftest*
7077   eval "ac_cv_func_mdbm_set_chain=yes"
7078 else
7079   echo "configure: failed program was:" >&5
7080   cat conftest.$ac_ext >&5
7081   rm -rf conftest*
7082   eval "ac_cv_func_mdbm_set_chain=no"
7083 fi
7084 rm -f conftest*
7085 fi
7086
7087 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
7088   echo "$ac_t""yes" 1>&6
7089   ol_cv_lib_mdbm=yes
7090 else
7091   echo "$ac_t""no" 1>&6
7092
7093                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
7094 echo "configure:7095: checking for mdbm_set_chain in -lmdbm" >&5
7095 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-%__p_%'`
7096 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7097   echo $ac_n "(cached) $ac_c" 1>&6
7098 else
7099   ac_save_LIBS="$LIBS"
7100 LIBS="-lmdbm  $LIBS"
7101 cat > conftest.$ac_ext <<EOF
7102 #line 7103 "configure"
7103 #include "confdefs.h"
7104 /* Override any gcc2 internal prototype to avoid an error.  */
7105 /* We use char because int might match the return type of a gcc2
7106     builtin and then its argument prototype would still apply.  */
7107 char mdbm_set_chain();
7108
7109 int main() {
7110 mdbm_set_chain()
7111 ; return 0; }
7112 EOF
7113 if { (eval echo configure:7114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7114   rm -rf conftest*
7115   eval "ac_cv_lib_$ac_lib_var=yes"
7116 else
7117   echo "configure: failed program was:" >&5
7118   cat conftest.$ac_ext >&5
7119   rm -rf conftest*
7120   eval "ac_cv_lib_$ac_lib_var=no"
7121 fi
7122 rm -f conftest*
7123 LIBS="$ac_save_LIBS"
7124
7125 fi
7126 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7127   echo "$ac_t""yes" 1>&6
7128   ol_cv_lib_mdbm=-lmdbm
7129 else
7130   echo "$ac_t""no" 1>&6
7131 ol_cv_lib_mdbm=no
7132 fi
7133
7134         
7135 fi
7136
7137         LIBS="$ol_LIBS"
7138
7139 fi
7140
7141 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
7142
7143
7144  for ac_hdr in mdbm.h
7145 do
7146 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7147 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7148 echo "configure:7149: checking for $ac_hdr" >&5
7149 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7150   echo $ac_n "(cached) $ac_c" 1>&6
7151 else
7152   cat > conftest.$ac_ext <<EOF
7153 #line 7154 "configure"
7154 #include "confdefs.h"
7155 #include <$ac_hdr>
7156 EOF
7157 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7158 { (eval echo configure:7159: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7159 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7160 if test -z "$ac_err"; then
7161   rm -rf conftest*
7162   eval "ac_cv_header_$ac_safe=yes"
7163 else
7164   echo "$ac_err" >&5
7165   echo "configure: failed program was:" >&5
7166   cat conftest.$ac_ext >&5
7167   rm -rf conftest*
7168   eval "ac_cv_header_$ac_safe=no"
7169 fi
7170 rm -f conftest*
7171 fi
7172 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7173   echo "$ac_t""yes" 1>&6
7174     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7175   cat >> confdefs.h <<EOF
7176 #define $ac_tr_hdr 1
7177 EOF
7178  
7179 else
7180   echo "$ac_t""no" 1>&6
7181 fi
7182 done
7183
7184  echo $ac_n "checking for db""... $ac_c" 1>&6
7185 echo "configure:7186: checking for db" >&5
7186 if eval "test \"`echo '$''{'ol_cv_mdbm'+set}'`\" = set"; then
7187   echo $ac_n "(cached) $ac_c" 1>&6
7188 else
7189   
7190         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
7191                 ol_cv_mdbm=no
7192         else
7193                 ol_cv_mdbm=yes
7194         fi
7195
7196 fi
7197
7198 echo "$ac_t""$ol_cv_mdbm" 1>&6
7199  if test $ol_cv_mdbm = yes ; then
7200         cat >> confdefs.h <<\EOF
7201 #define HAVE_MDBM 1
7202 EOF
7203
7204  fi
7205
7206
7207         if test $ol_cv_mdbm = yes ; then
7208                 ol_link_ldbm=mdbm
7209                 ol_with_ldbm_api=mdbm
7210                 if test $ol_cv_lib_mdbm != yes ; then
7211                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
7212                 fi
7213         fi
7214 fi
7215
7216 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
7217         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
7218 echo "configure:7219: checking for GDBM library" >&5
7219 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
7220   echo $ac_n "(cached) $ac_c" 1>&6
7221 else
7222         ol_LIBS="$LIBS"
7223         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
7224 echo "configure:7225: checking for gdbm_open" >&5
7225 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
7226   echo $ac_n "(cached) $ac_c" 1>&6
7227 else
7228   cat > conftest.$ac_ext <<EOF
7229 #line 7230 "configure"
7230 #include "confdefs.h"
7231 /* System header to define __stub macros and hopefully few prototypes,
7232     which can conflict with char gdbm_open(); below.  */
7233 #include <assert.h>
7234 /* Override any gcc2 internal prototype to avoid an error.  */
7235 /* We use char because int might match the return type of a gcc2
7236     builtin and then its argument prototype would still apply.  */
7237 char gdbm_open();
7238
7239 int main() {
7240
7241 /* The GNU C library defines this for functions which it implements
7242     to always fail with ENOSYS.  Some functions are actually named
7243     something starting with __ and the normal name is an alias.  */
7244 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
7245 choke me
7246 #else
7247 gdbm_open();
7248 #endif
7249
7250 ; return 0; }
7251 EOF
7252 if { (eval echo configure:7253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7253   rm -rf conftest*
7254   eval "ac_cv_func_gdbm_open=yes"
7255 else
7256   echo "configure: failed program was:" >&5
7257   cat conftest.$ac_ext >&5
7258   rm -rf conftest*
7259   eval "ac_cv_func_gdbm_open=no"
7260 fi
7261 rm -f conftest*
7262 fi
7263
7264 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
7265   echo "$ac_t""yes" 1>&6
7266   ol_cv_lib_gdbm=yes
7267 else
7268   echo "$ac_t""no" 1>&6
7269
7270                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
7271 echo "configure:7272: checking for gdbm_open in -lgdbm" >&5
7272 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
7273 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7274   echo $ac_n "(cached) $ac_c" 1>&6
7275 else
7276   ac_save_LIBS="$LIBS"
7277 LIBS="-lgdbm  $LIBS"
7278 cat > conftest.$ac_ext <<EOF
7279 #line 7280 "configure"
7280 #include "confdefs.h"
7281 /* Override any gcc2 internal prototype to avoid an error.  */
7282 /* We use char because int might match the return type of a gcc2
7283     builtin and then its argument prototype would still apply.  */
7284 char gdbm_open();
7285
7286 int main() {
7287 gdbm_open()
7288 ; return 0; }
7289 EOF
7290 if { (eval echo configure:7291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7291   rm -rf conftest*
7292   eval "ac_cv_lib_$ac_lib_var=yes"
7293 else
7294   echo "configure: failed program was:" >&5
7295   cat conftest.$ac_ext >&5
7296   rm -rf conftest*
7297   eval "ac_cv_lib_$ac_lib_var=no"
7298 fi
7299 rm -f conftest*
7300 LIBS="$ac_save_LIBS"
7301
7302 fi
7303 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7304   echo "$ac_t""yes" 1>&6
7305   ol_cv_lib_gdbm=-lgdbm
7306 else
7307   echo "$ac_t""no" 1>&6
7308 ol_cv_lib_gdbm=no
7309 fi
7310
7311         
7312 fi
7313
7314         LIBS="$ol_LIBS"
7315
7316 fi
7317
7318 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
7319
7320
7321  for ac_hdr in gdbm.h
7322 do
7323 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7324 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7325 echo "configure:7326: checking for $ac_hdr" >&5
7326 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7327   echo $ac_n "(cached) $ac_c" 1>&6
7328 else
7329   cat > conftest.$ac_ext <<EOF
7330 #line 7331 "configure"
7331 #include "confdefs.h"
7332 #include <$ac_hdr>
7333 EOF
7334 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7335 { (eval echo configure:7336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7336 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7337 if test -z "$ac_err"; then
7338   rm -rf conftest*
7339   eval "ac_cv_header_$ac_safe=yes"
7340 else
7341   echo "$ac_err" >&5
7342   echo "configure: failed program was:" >&5
7343   cat conftest.$ac_ext >&5
7344   rm -rf conftest*
7345   eval "ac_cv_header_$ac_safe=no"
7346 fi
7347 rm -f conftest*
7348 fi
7349 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7350   echo "$ac_t""yes" 1>&6
7351     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7352   cat >> confdefs.h <<EOF
7353 #define $ac_tr_hdr 1
7354 EOF
7355  
7356 else
7357   echo "$ac_t""no" 1>&6
7358 fi
7359 done
7360
7361  echo $ac_n "checking for db""... $ac_c" 1>&6
7362 echo "configure:7363: checking for db" >&5
7363 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
7364   echo $ac_n "(cached) $ac_c" 1>&6
7365 else
7366   
7367         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
7368                 ol_cv_gdbm=no
7369         else
7370                 ol_cv_gdbm=yes
7371         fi
7372
7373 fi
7374
7375 echo "$ac_t""$ol_cv_gdbm" 1>&6
7376  if test $ol_cv_gdbm = yes ; then
7377         cat >> confdefs.h <<\EOF
7378 #define HAVE_GDBM 1
7379 EOF
7380
7381  fi
7382
7383
7384         if test $ol_cv_gdbm = yes ; then
7385                 ol_link_ldbm=gdbm
7386                 ol_with_ldbm_api=gdbm
7387
7388                 if test $ol_cv_lib_gdbm != yes ; then
7389                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
7390                 fi
7391         fi
7392 fi
7393
7394 if test $ol_with_ldbm_api = auto ; then
7395         echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
7396 elif test $ol_with_ldbm_api = ndbm ; then
7397         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
7398 echo "configure:7399: checking for NDBM library" >&5
7399 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
7400   echo $ac_n "(cached) $ac_c" 1>&6
7401 else
7402         ol_LIBS="$LIBS"
7403         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
7404 echo "configure:7405: checking for dbm_open" >&5
7405 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
7406   echo $ac_n "(cached) $ac_c" 1>&6
7407 else
7408   cat > conftest.$ac_ext <<EOF
7409 #line 7410 "configure"
7410 #include "confdefs.h"
7411 /* System header to define __stub macros and hopefully few prototypes,
7412     which can conflict with char dbm_open(); below.  */
7413 #include <assert.h>
7414 /* Override any gcc2 internal prototype to avoid an error.  */
7415 /* We use char because int might match the return type of a gcc2
7416     builtin and then its argument prototype would still apply.  */
7417 char dbm_open();
7418
7419 int main() {
7420
7421 /* The GNU C library defines this for functions which it implements
7422     to always fail with ENOSYS.  Some functions are actually named
7423     something starting with __ and the normal name is an alias.  */
7424 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
7425 choke me
7426 #else
7427 dbm_open();
7428 #endif
7429
7430 ; return 0; }
7431 EOF
7432 if { (eval echo configure:7433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7433   rm -rf conftest*
7434   eval "ac_cv_func_dbm_open=yes"
7435 else
7436   echo "configure: failed program was:" >&5
7437   cat conftest.$ac_ext >&5
7438   rm -rf conftest*
7439   eval "ac_cv_func_dbm_open=no"
7440 fi
7441 rm -f conftest*
7442 fi
7443
7444 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
7445   echo "$ac_t""yes" 1>&6
7446   ol_cv_lib_ndbm=yes
7447 else
7448   echo "$ac_t""no" 1>&6
7449
7450                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
7451 echo "configure:7452: checking for dbm_open in -lndbm" >&5
7452 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
7453 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7454   echo $ac_n "(cached) $ac_c" 1>&6
7455 else
7456   ac_save_LIBS="$LIBS"
7457 LIBS="-lndbm  $LIBS"
7458 cat > conftest.$ac_ext <<EOF
7459 #line 7460 "configure"
7460 #include "confdefs.h"
7461 /* Override any gcc2 internal prototype to avoid an error.  */
7462 /* We use char because int might match the return type of a gcc2
7463     builtin and then its argument prototype would still apply.  */
7464 char dbm_open();
7465
7466 int main() {
7467 dbm_open()
7468 ; return 0; }
7469 EOF
7470 if { (eval echo configure:7471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7471   rm -rf conftest*
7472   eval "ac_cv_lib_$ac_lib_var=yes"
7473 else
7474   echo "configure: failed program was:" >&5
7475   cat conftest.$ac_ext >&5
7476   rm -rf conftest*
7477   eval "ac_cv_lib_$ac_lib_var=no"
7478 fi
7479 rm -f conftest*
7480 LIBS="$ac_save_LIBS"
7481
7482 fi
7483 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7484   echo "$ac_t""yes" 1>&6
7485   ol_cv_lib_ndbm=-lndbm
7486 else
7487   echo "$ac_t""no" 1>&6
7488
7489                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
7490 echo "configure:7491: checking for dbm_open in -ldbm" >&5
7491 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
7492 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7493   echo $ac_n "(cached) $ac_c" 1>&6
7494 else
7495   ac_save_LIBS="$LIBS"
7496 LIBS="-ldbm  $LIBS"
7497 cat > conftest.$ac_ext <<EOF
7498 #line 7499 "configure"
7499 #include "confdefs.h"
7500 /* Override any gcc2 internal prototype to avoid an error.  */
7501 /* We use char because int might match the return type of a gcc2
7502     builtin and then its argument prototype would still apply.  */
7503 char dbm_open();
7504
7505 int main() {
7506 dbm_open()
7507 ; return 0; }
7508 EOF
7509 if { (eval echo configure:7510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7510   rm -rf conftest*
7511   eval "ac_cv_lib_$ac_lib_var=yes"
7512 else
7513   echo "configure: failed program was:" >&5
7514   cat conftest.$ac_ext >&5
7515   rm -rf conftest*
7516   eval "ac_cv_lib_$ac_lib_var=no"
7517 fi
7518 rm -f conftest*
7519 LIBS="$ac_save_LIBS"
7520
7521 fi
7522 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7523   echo "$ac_t""yes" 1>&6
7524   ol_cv_lib_ndbm=-ldbm
7525 else
7526   echo "$ac_t""no" 1>&6
7527 ol_cv_lib_ndbm=no
7528 fi
7529                 
7530 fi
7531
7532         
7533 fi
7534
7535         LIBS="$ol_LIBS"
7536
7537 fi
7538
7539 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
7540
7541
7542  for ac_hdr in ndbm.h
7543 do
7544 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7545 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7546 echo "configure:7547: checking for $ac_hdr" >&5
7547 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7548   echo $ac_n "(cached) $ac_c" 1>&6
7549 else
7550   cat > conftest.$ac_ext <<EOF
7551 #line 7552 "configure"
7552 #include "confdefs.h"
7553 #include <$ac_hdr>
7554 EOF
7555 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7556 { (eval echo configure:7557: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7557 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7558 if test -z "$ac_err"; then
7559   rm -rf conftest*
7560   eval "ac_cv_header_$ac_safe=yes"
7561 else
7562   echo "$ac_err" >&5
7563   echo "configure: failed program was:" >&5
7564   cat conftest.$ac_ext >&5
7565   rm -rf conftest*
7566   eval "ac_cv_header_$ac_safe=no"
7567 fi
7568 rm -f conftest*
7569 fi
7570 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7571   echo "$ac_t""yes" 1>&6
7572     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7573   cat >> confdefs.h <<EOF
7574 #define $ac_tr_hdr 1
7575 EOF
7576  
7577 else
7578   echo "$ac_t""no" 1>&6
7579 fi
7580 done
7581
7582  echo $ac_n "checking for db""... $ac_c" 1>&6
7583 echo "configure:7584: checking for db" >&5
7584 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
7585   echo $ac_n "(cached) $ac_c" 1>&6
7586 else
7587   
7588         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
7589                 ol_cv_ndbm=no
7590         else
7591                 ol_cv_ndbm=yes
7592         fi
7593
7594 fi
7595
7596 echo "$ac_t""$ol_cv_ndbm" 1>&6
7597  if test $ol_cv_ndbm = yes ; then
7598         cat >> confdefs.h <<\EOF
7599 #define HAVE_NDBM 1
7600 EOF
7601
7602  fi
7603
7604
7605         if test $ol_cv_ndbm = yes ; then
7606                 ol_link_ldbm=ndbm
7607                 ol_with_ldbm_api=ndbm
7608
7609                 if test $ol_cv_lib_ndbm != yes ; then
7610                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
7611                 fi
7612         fi
7613 fi
7614
7615 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
7616         echo "configure: warning: could not find suitable LDBM backend" 1>&2
7617         if test $ol_enable_ldbm = yes ; then
7618                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
7619         fi
7620
7621         echo "configure: warning: disabling LDBM" 1>&2
7622         ol_enable_ldbm=no
7623 fi
7624
7625 if test $ol_enable_wrappers != no ; then
7626         for ac_hdr in tcpd.h
7627 do
7628 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7629 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7630 echo "configure:7631: checking for $ac_hdr" >&5
7631 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7632   echo $ac_n "(cached) $ac_c" 1>&6
7633 else
7634   cat > conftest.$ac_ext <<EOF
7635 #line 7636 "configure"
7636 #include "confdefs.h"
7637 #include <$ac_hdr>
7638 EOF
7639 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7640 { (eval echo configure:7641: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7641 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7642 if test -z "$ac_err"; then
7643   rm -rf conftest*
7644   eval "ac_cv_header_$ac_safe=yes"
7645 else
7646   echo "$ac_err" >&5
7647   echo "configure: failed program was:" >&5
7648   cat conftest.$ac_ext >&5
7649   rm -rf conftest*
7650   eval "ac_cv_header_$ac_safe=no"
7651 fi
7652 rm -f conftest*
7653 fi
7654 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7655   echo "$ac_t""yes" 1>&6
7656     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7657   cat >> confdefs.h <<EOF
7658 #define $ac_tr_hdr 1
7659 EOF
7660  
7661 else
7662   echo "$ac_t""no" 1>&6
7663 fi
7664 done
7665
7666
7667         if test $ac_cv_header_tcpd_h != yes ; then
7668                 have_wrappers=no
7669         else
7670                 echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
7671 echo "configure:7672: checking for main in -lwrap" >&5
7672 ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'`
7673 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7674   echo $ac_n "(cached) $ac_c" 1>&6
7675 else
7676   ac_save_LIBS="$LIBS"
7677 LIBS="-lwrap  $LIBS"
7678 cat > conftest.$ac_ext <<EOF
7679 #line 7680 "configure"
7680 #include "confdefs.h"
7681
7682 int main() {
7683 main()
7684 ; return 0; }
7685 EOF
7686 if { (eval echo configure:7687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7687   rm -rf conftest*
7688   eval "ac_cv_lib_$ac_lib_var=yes"
7689 else
7690   echo "configure: failed program was:" >&5
7691   cat conftest.$ac_ext >&5
7692   rm -rf conftest*
7693   eval "ac_cv_lib_$ac_lib_var=no"
7694 fi
7695 rm -f conftest*
7696 LIBS="$ac_save_LIBS"
7697
7698 fi
7699 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7700   echo "$ac_t""yes" 1>&6
7701   have_wrappers=yes
7702 else
7703   echo "$ac_t""no" 1>&6
7704 have_wrappers=no
7705 fi
7706
7707         fi
7708
7709         if test $have_wrappers = yes ; then
7710                 cat >> confdefs.h <<\EOF
7711 #define HAVE_TCPD 1
7712 EOF
7713
7714                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
7715         else
7716                 echo "configure: warning: could not find -lwrap" 1>&2
7717                 if test $ol_enable_wrappers = yes ; then
7718                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
7719                 fi
7720
7721                 echo "configure: warning: disabling wrappers support" 1>&2
7722                 ol_enable_wrappers=no
7723         fi
7724 fi
7725
7726 if test $ol_enable_syslog != no ; then
7727         echo $ac_n "checking for openlog""... $ac_c" 1>&6
7728 echo "configure:7729: checking for openlog" >&5
7729 if eval "test \"`echo '$''{'ac_cv_func_openlog'+set}'`\" = set"; then
7730   echo $ac_n "(cached) $ac_c" 1>&6
7731 else
7732   cat > conftest.$ac_ext <<EOF
7733 #line 7734 "configure"
7734 #include "confdefs.h"
7735 /* System header to define __stub macros and hopefully few prototypes,
7736     which can conflict with char openlog(); below.  */
7737 #include <assert.h>
7738 /* Override any gcc2 internal prototype to avoid an error.  */
7739 /* We use char because int might match the return type of a gcc2
7740     builtin and then its argument prototype would still apply.  */
7741 char openlog();
7742
7743 int main() {
7744
7745 /* The GNU C library defines this for functions which it implements
7746     to always fail with ENOSYS.  Some functions are actually named
7747     something starting with __ and the normal name is an alias.  */
7748 #if defined (__stub_openlog) || defined (__stub___openlog)
7749 choke me
7750 #else
7751 openlog();
7752 #endif
7753
7754 ; return 0; }
7755 EOF
7756 if { (eval echo configure:7757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7757   rm -rf conftest*
7758   eval "ac_cv_func_openlog=yes"
7759 else
7760   echo "configure: failed program was:" >&5
7761   cat conftest.$ac_ext >&5
7762   rm -rf conftest*
7763   eval "ac_cv_func_openlog=no"
7764 fi
7765 rm -f conftest*
7766 fi
7767
7768 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
7769   echo "$ac_t""yes" 1>&6
7770   :
7771 else
7772   echo "$ac_t""no" 1>&6
7773 fi
7774
7775         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
7776                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
7777         fi
7778         ol_enable_syslog=$ac_cv_func_openlog
7779 fi
7780
7781 if test $ol_enable_dmalloc != no ; then
7782         for ac_hdr in dmalloc.h
7783 do
7784 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7785 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7786 echo "configure:7787: checking for $ac_hdr" >&5
7787 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7788   echo $ac_n "(cached) $ac_c" 1>&6
7789 else
7790   cat > conftest.$ac_ext <<EOF
7791 #line 7792 "configure"
7792 #include "confdefs.h"
7793 #include <$ac_hdr>
7794 EOF
7795 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7796 { (eval echo configure:7797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7797 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7798 if test -z "$ac_err"; then
7799   rm -rf conftest*
7800   eval "ac_cv_header_$ac_safe=yes"
7801 else
7802   echo "$ac_err" >&5
7803   echo "configure: failed program was:" >&5
7804   cat conftest.$ac_ext >&5
7805   rm -rf conftest*
7806   eval "ac_cv_header_$ac_safe=no"
7807 fi
7808 rm -f conftest*
7809 fi
7810 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7811   echo "$ac_t""yes" 1>&6
7812     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7813   cat >> confdefs.h <<EOF
7814 #define $ac_tr_hdr 1
7815 EOF
7816  
7817 else
7818   echo "$ac_t""no" 1>&6
7819 fi
7820 done
7821
7822         echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
7823 echo "configure:7824: checking for dmalloc_shutdown in -ldmalloc" >&5
7824 ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-%__p_%'`
7825 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7826   echo $ac_n "(cached) $ac_c" 1>&6
7827 else
7828   ac_save_LIBS="$LIBS"
7829 LIBS="-ldmalloc  $LIBS"
7830 cat > conftest.$ac_ext <<EOF
7831 #line 7832 "configure"
7832 #include "confdefs.h"
7833 /* Override any gcc2 internal prototype to avoid an error.  */
7834 /* We use char because int might match the return type of a gcc2
7835     builtin and then its argument prototype would still apply.  */
7836 char dmalloc_shutdown();
7837
7838 int main() {
7839 dmalloc_shutdown()
7840 ; return 0; }
7841 EOF
7842 if { (eval echo configure:7843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7843   rm -rf conftest*
7844   eval "ac_cv_lib_$ac_lib_var=yes"
7845 else
7846   echo "configure: failed program was:" >&5
7847   cat conftest.$ac_ext >&5
7848   rm -rf conftest*
7849   eval "ac_cv_lib_$ac_lib_var=no"
7850 fi
7851 rm -f conftest*
7852 LIBS="$ac_save_LIBS"
7853
7854 fi
7855 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7856   echo "$ac_t""yes" 1>&6
7857     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7858     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7859   cat >> confdefs.h <<EOF
7860 #define $ac_tr_lib 1
7861 EOF
7862
7863   LIBS="-ldmalloc $LIBS"
7864
7865 else
7866   echo "$ac_t""no" 1>&6
7867 fi
7868
7869 fi
7870
7871 if test $ol_enable_tcl != no ; then
7872         for ac_hdr in tcl.h
7873 do
7874 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7875 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7876 echo "configure:7877: checking for $ac_hdr" >&5
7877 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7878   echo $ac_n "(cached) $ac_c" 1>&6
7879 else
7880   cat > conftest.$ac_ext <<EOF
7881 #line 7882 "configure"
7882 #include "confdefs.h"
7883 #include <$ac_hdr>
7884 EOF
7885 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7886 { (eval echo configure:7887: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7887 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7888 if test -z "$ac_err"; then
7889   rm -rf conftest*
7890   eval "ac_cv_header_$ac_safe=yes"
7891 else
7892   echo "$ac_err" >&5
7893   echo "configure: failed program was:" >&5
7894   cat conftest.$ac_ext >&5
7895   rm -rf conftest*
7896   eval "ac_cv_header_$ac_safe=no"
7897 fi
7898 rm -f conftest*
7899 fi
7900 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7901   echo "$ac_t""yes" 1>&6
7902     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7903   cat >> confdefs.h <<EOF
7904 #define $ac_tr_hdr 1
7905 EOF
7906  
7907 else
7908   echo "$ac_t""no" 1>&6
7909 fi
7910 done
7911
7912
7913         if test $ac_cv_header_tcl_h != yes ; then
7914                 have_tcl=no
7915         else
7916                 echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6
7917 echo "configure:7918: checking for main in -ltcl" >&5
7918 ac_lib_var=`echo tcl'_'main | sed 'y%./+-%__p_%'`
7919 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7920   echo $ac_n "(cached) $ac_c" 1>&6
7921 else
7922   ac_save_LIBS="$LIBS"
7923 LIBS="-ltcl  $LIBS"
7924 cat > conftest.$ac_ext <<EOF
7925 #line 7926 "configure"
7926 #include "confdefs.h"
7927
7928 int main() {
7929 main()
7930 ; return 0; }
7931 EOF
7932 if { (eval echo configure:7933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7933   rm -rf conftest*
7934   eval "ac_cv_lib_$ac_lib_var=yes"
7935 else
7936   echo "configure: failed program was:" >&5
7937   cat conftest.$ac_ext >&5
7938   rm -rf conftest*
7939   eval "ac_cv_lib_$ac_lib_var=no"
7940 fi
7941 rm -f conftest*
7942 LIBS="$ac_save_LIBS"
7943
7944 fi
7945 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7946   echo "$ac_t""yes" 1>&6
7947   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"
7948 else
7949   echo "$ac_t""no" 1>&6
7950 have_tcl=no
7951 fi
7952
7953
7954                 if test $have_tcl != yes; then
7955                         echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6
7956 echo "configure:7957: checking for main in -ltcl7.6" >&5
7957 ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-%__p_%'`
7958 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7959   echo $ac_n "(cached) $ac_c" 1>&6
7960 else
7961   ac_save_LIBS="$LIBS"
7962 LIBS="-ltcl7.6  $LIBS"
7963 cat > conftest.$ac_ext <<EOF
7964 #line 7965 "configure"
7965 #include "confdefs.h"
7966
7967 int main() {
7968 main()
7969 ; return 0; }
7970 EOF
7971 if { (eval echo configure:7972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7972   rm -rf conftest*
7973   eval "ac_cv_lib_$ac_lib_var=yes"
7974 else
7975   echo "configure: failed program was:" >&5
7976   cat conftest.$ac_ext >&5
7977   rm -rf conftest*
7978   eval "ac_cv_lib_$ac_lib_var=no"
7979 fi
7980 rm -f conftest*
7981 LIBS="$ac_save_LIBS"
7982
7983 fi
7984 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7985   echo "$ac_t""yes" 1>&6
7986   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"
7987 else
7988   echo "$ac_t""no" 1>&6
7989 have_tcl=no
7990 fi
7991
7992                 fi
7993
7994                 if test $have_tcl != yes; then
7995                         echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6
7996 echo "configure:7997: checking for main in -ltcl8.0" >&5
7997 ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-%__p_%'`
7998 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7999   echo $ac_n "(cached) $ac_c" 1>&6
8000 else
8001   ac_save_LIBS="$LIBS"
8002 LIBS="-ltcl8.0  $LIBS"
8003 cat > conftest.$ac_ext <<EOF
8004 #line 8005 "configure"
8005 #include "confdefs.h"
8006
8007 int main() {
8008 main()
8009 ; return 0; }
8010 EOF
8011 if { (eval echo configure:8012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8012   rm -rf conftest*
8013   eval "ac_cv_lib_$ac_lib_var=yes"
8014 else
8015   echo "configure: failed program was:" >&5
8016   cat conftest.$ac_ext >&5
8017   rm -rf conftest*
8018   eval "ac_cv_lib_$ac_lib_var=no"
8019 fi
8020 rm -f conftest*
8021 LIBS="$ac_save_LIBS"
8022
8023 fi
8024 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8025   echo "$ac_t""yes" 1>&6
8026   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"
8027 else
8028   echo "$ac_t""no" 1>&6
8029 have_tcl=no
8030 fi
8031
8032                 fi
8033         fi
8034
8035         if test $have_tcl != yes ; then
8036                 echo "configure: warning: could not find -ltcl" 1>&2
8037                 if test $ol_enable_tcl = yes ; then
8038                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
8039                 fi
8040
8041                 ol_enable_tcl=no
8042         fi
8043 fi
8044
8045 # ud needs termcap (should insert check here)
8046 ol_link_termcap=no
8047 for ac_hdr in termcap.h ncurses.h
8048 do
8049 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8050 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8051 echo "configure:8052: checking for $ac_hdr" >&5
8052 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8053   echo $ac_n "(cached) $ac_c" 1>&6
8054 else
8055   cat > conftest.$ac_ext <<EOF
8056 #line 8057 "configure"
8057 #include "confdefs.h"
8058 #include <$ac_hdr>
8059 EOF
8060 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8061 { (eval echo configure:8062: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8062 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8063 if test -z "$ac_err"; then
8064   rm -rf conftest*
8065   eval "ac_cv_header_$ac_safe=yes"
8066 else
8067   echo "$ac_err" >&5
8068   echo "configure: failed program was:" >&5
8069   cat conftest.$ac_ext >&5
8070   rm -rf conftest*
8071   eval "ac_cv_header_$ac_safe=no"
8072 fi
8073 rm -f conftest*
8074 fi
8075 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8076   echo "$ac_t""yes" 1>&6
8077     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8078   cat >> confdefs.h <<EOF
8079 #define $ac_tr_hdr 1
8080 EOF
8081  
8082 else
8083   echo "$ac_t""no" 1>&6
8084 fi
8085 done
8086
8087
8088 if test $ol_link_termcap = no ; then
8089         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
8090 echo "configure:8091: checking for tputs in -ltermcap" >&5
8091 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
8092 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8093   echo $ac_n "(cached) $ac_c" 1>&6
8094 else
8095   ac_save_LIBS="$LIBS"
8096 LIBS="-ltermcap  $LIBS"
8097 cat > conftest.$ac_ext <<EOF
8098 #line 8099 "configure"
8099 #include "confdefs.h"
8100 /* Override any gcc2 internal prototype to avoid an error.  */
8101 /* We use char because int might match the return type of a gcc2
8102     builtin and then its argument prototype would still apply.  */
8103 char tputs();
8104
8105 int main() {
8106 tputs()
8107 ; return 0; }
8108 EOF
8109 if { (eval echo configure:8110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8110   rm -rf conftest*
8111   eval "ac_cv_lib_$ac_lib_var=yes"
8112 else
8113   echo "configure: failed program was:" >&5
8114   cat conftest.$ac_ext >&5
8115   rm -rf conftest*
8116   eval "ac_cv_lib_$ac_lib_var=no"
8117 fi
8118 rm -f conftest*
8119 LIBS="$ac_save_LIBS"
8120
8121 fi
8122 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8123   echo "$ac_t""yes" 1>&6
8124   have_termcap=yes
8125 else
8126   echo "$ac_t""no" 1>&6
8127 have_termcap=no
8128 fi
8129
8130         if test $have_termcap = yes ; then
8131                 cat >> confdefs.h <<\EOF
8132 #define HAVE_TERMCAP 1
8133 EOF
8134
8135                 ol_link_termcap=yes
8136                 TERMCAP_LIBS=-ltermcap
8137         fi
8138 fi
8139
8140 if test $ol_link_termcap = no ; then
8141         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
8142 echo "configure:8143: checking for initscr in -lncurses" >&5
8143 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
8144 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8145   echo $ac_n "(cached) $ac_c" 1>&6
8146 else
8147   ac_save_LIBS="$LIBS"
8148 LIBS="-lncurses  $LIBS"
8149 cat > conftest.$ac_ext <<EOF
8150 #line 8151 "configure"
8151 #include "confdefs.h"
8152 /* Override any gcc2 internal prototype to avoid an error.  */
8153 /* We use char because int might match the return type of a gcc2
8154     builtin and then its argument prototype would still apply.  */
8155 char initscr();
8156
8157 int main() {
8158 initscr()
8159 ; return 0; }
8160 EOF
8161 if { (eval echo configure:8162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8162   rm -rf conftest*
8163   eval "ac_cv_lib_$ac_lib_var=yes"
8164 else
8165   echo "configure: failed program was:" >&5
8166   cat conftest.$ac_ext >&5
8167   rm -rf conftest*
8168   eval "ac_cv_lib_$ac_lib_var=no"
8169 fi
8170 rm -f conftest*
8171 LIBS="$ac_save_LIBS"
8172
8173 fi
8174 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8175   echo "$ac_t""yes" 1>&6
8176   have_ncurses=yes
8177 else
8178   echo "$ac_t""no" 1>&6
8179 have_ncurses=no
8180 fi
8181
8182         if test $have_ncurses = yes ; then
8183                 cat >> confdefs.h <<\EOF
8184 #define HAVE_NCURSES 1
8185 EOF
8186
8187                 ol_link_termcap=yes
8188                 TERMCAP_LIBS=-lncurses
8189         fi
8190 fi
8191
8192 if test $ol_link_termcap = no ; then
8193         cat >> confdefs.h <<\EOF
8194 #define NO_TERMCAP 1
8195 EOF
8196
8197         TERMCAP_LIBS=
8198 fi
8199
8200 ol_link_readline=no
8201 if test $ol_with_readline != no ; then
8202         for ac_hdr in readline/readline.h readline/history.h
8203 do
8204 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8205 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8206 echo "configure:8207: checking for $ac_hdr" >&5
8207 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8208   echo $ac_n "(cached) $ac_c" 1>&6
8209 else
8210   cat > conftest.$ac_ext <<EOF
8211 #line 8212 "configure"
8212 #include "confdefs.h"
8213 #include <$ac_hdr>
8214 EOF
8215 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8216 { (eval echo configure:8217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8217 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8218 if test -z "$ac_err"; then
8219   rm -rf conftest*
8220   eval "ac_cv_header_$ac_safe=yes"
8221 else
8222   echo "$ac_err" >&5
8223   echo "configure: failed program was:" >&5
8224   cat conftest.$ac_ext >&5
8225   rm -rf conftest*
8226   eval "ac_cv_header_$ac_safe=no"
8227 fi
8228 rm -f conftest*
8229 fi
8230 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8231   echo "$ac_t""yes" 1>&6
8232     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8233   cat >> confdefs.h <<EOF
8234 #define $ac_tr_hdr 1
8235 EOF
8236  
8237 else
8238   echo "$ac_t""no" 1>&6
8239 fi
8240 done
8241
8242
8243         if test $ac_cv_header_readline_readline_h = yes ; then
8244                 save_LIBS="$LIBS"
8245                 LIBS="$TERMCAP_LIBS $LIBS"
8246                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
8247 echo "configure:8248: checking for readline in -lreadline" >&5
8248 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`
8249 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8250   echo $ac_n "(cached) $ac_c" 1>&6
8251 else
8252   ac_save_LIBS="$LIBS"
8253 LIBS="-lreadline  $LIBS"
8254 cat > conftest.$ac_ext <<EOF
8255 #line 8256 "configure"
8256 #include "confdefs.h"
8257 /* Override any gcc2 internal prototype to avoid an error.  */
8258 /* We use char because int might match the return type of a gcc2
8259     builtin and then its argument prototype would still apply.  */
8260 char readline();
8261
8262 int main() {
8263 readline()
8264 ; return 0; }
8265 EOF
8266 if { (eval echo configure:8267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8267   rm -rf conftest*
8268   eval "ac_cv_lib_$ac_lib_var=yes"
8269 else
8270   echo "configure: failed program was:" >&5
8271   cat conftest.$ac_ext >&5
8272   rm -rf conftest*
8273   eval "ac_cv_lib_$ac_lib_var=no"
8274 fi
8275 rm -f conftest*
8276 LIBS="$ac_save_LIBS"
8277
8278 fi
8279 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8280   echo "$ac_t""yes" 1>&6
8281   have_readline=yes
8282 else
8283   echo "$ac_t""no" 1>&6
8284 have_readline=no
8285 fi
8286
8287                 LIBS="$save_LIBS"
8288                         
8289                 if test $have_readline = yes ; then
8290                         ol_with_readline=found
8291                         ol_link_readline=yes
8292
8293                         READLINE_LIBS="-lreadline"
8294                 fi
8295         fi
8296 fi
8297
8298 if test $ol_link_readline = yes ; then
8299         cat >> confdefs.h <<\EOF
8300 #define HAVE_READLINE 1
8301 EOF
8302
8303 fi
8304
8305
8306 # FreeBSD (and others) have crypt(3) in -lcrypt
8307 if test $ol_enable_crypt != no ; then
8308         echo $ac_n "checking for crypt""... $ac_c" 1>&6
8309 echo "configure:8310: checking for crypt" >&5
8310 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
8311   echo $ac_n "(cached) $ac_c" 1>&6
8312 else
8313   cat > conftest.$ac_ext <<EOF
8314 #line 8315 "configure"
8315 #include "confdefs.h"
8316 /* System header to define __stub macros and hopefully few prototypes,
8317     which can conflict with char crypt(); below.  */
8318 #include <assert.h>
8319 /* Override any gcc2 internal prototype to avoid an error.  */
8320 /* We use char because int might match the return type of a gcc2
8321     builtin and then its argument prototype would still apply.  */
8322 char crypt();
8323
8324 int main() {
8325
8326 /* The GNU C library defines this for functions which it implements
8327     to always fail with ENOSYS.  Some functions are actually named
8328     something starting with __ and the normal name is an alias.  */
8329 #if defined (__stub_crypt) || defined (__stub___crypt)
8330 choke me
8331 #else
8332 crypt();
8333 #endif
8334
8335 ; return 0; }
8336 EOF
8337 if { (eval echo configure:8338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8338   rm -rf conftest*
8339   eval "ac_cv_func_crypt=yes"
8340 else
8341   echo "configure: failed program was:" >&5
8342   cat conftest.$ac_ext >&5
8343   rm -rf conftest*
8344   eval "ac_cv_func_crypt=no"
8345 fi
8346 rm -f conftest*
8347 fi
8348
8349 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
8350   echo "$ac_t""yes" 1>&6
8351   have_crypt=yes
8352 else
8353   echo "$ac_t""no" 1>&6
8354
8355                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
8356 echo "configure:8357: checking for crypt in -lcrypt" >&5
8357 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
8358 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8359   echo $ac_n "(cached) $ac_c" 1>&6
8360 else
8361   ac_save_LIBS="$LIBS"
8362 LIBS="-lcrypt  $LIBS"
8363 cat > conftest.$ac_ext <<EOF
8364 #line 8365 "configure"
8365 #include "confdefs.h"
8366 /* Override any gcc2 internal prototype to avoid an error.  */
8367 /* We use char because int might match the return type of a gcc2
8368     builtin and then its argument prototype would still apply.  */
8369 char crypt();
8370
8371 int main() {
8372 crypt()
8373 ; return 0; }
8374 EOF
8375 if { (eval echo configure:8376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8376   rm -rf conftest*
8377   eval "ac_cv_lib_$ac_lib_var=yes"
8378 else
8379   echo "configure: failed program was:" >&5
8380   cat conftest.$ac_ext >&5
8381   rm -rf conftest*
8382   eval "ac_cv_lib_$ac_lib_var=no"
8383 fi
8384 rm -f conftest*
8385 LIBS="$ac_save_LIBS"
8386
8387 fi
8388 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8389   echo "$ac_t""yes" 1>&6
8390   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
8391                         have_crypt=yes
8392 else
8393   echo "$ac_t""no" 1>&6
8394 have_crypt=no
8395 fi
8396
8397 fi
8398
8399
8400         if test $have_crypt = yes ; then
8401                 cat >> confdefs.h <<\EOF
8402 #define HAVE_CRYPT 1
8403 EOF
8404
8405         else
8406                 echo "configure: warning: could not find crypt" 1>&2
8407                 if test $ol_enable_crypt = yes ; then
8408                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
8409                 fi
8410
8411                 echo "configure: warning: disabling crypt support" 1>&2
8412                 ol_enable_crypt=no
8413         fi
8414 fi
8415
8416 # FreeBSD (and others) have setproctitle(3) in -lutil
8417 if test $ol_enable_proctitle != no ; then
8418         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
8419 echo "configure:8420: checking for setproctitle" >&5
8420 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
8421   echo $ac_n "(cached) $ac_c" 1>&6
8422 else
8423   cat > conftest.$ac_ext <<EOF
8424 #line 8425 "configure"
8425 #include "confdefs.h"
8426 /* System header to define __stub macros and hopefully few prototypes,
8427     which can conflict with char setproctitle(); below.  */
8428 #include <assert.h>
8429 /* Override any gcc2 internal prototype to avoid an error.  */
8430 /* We use char because int might match the return type of a gcc2
8431     builtin and then its argument prototype would still apply.  */
8432 char setproctitle();
8433
8434 int main() {
8435
8436 /* The GNU C library defines this for functions which it implements
8437     to always fail with ENOSYS.  Some functions are actually named
8438     something starting with __ and the normal name is an alias.  */
8439 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
8440 choke me
8441 #else
8442 setproctitle();
8443 #endif
8444
8445 ; return 0; }
8446 EOF
8447 if { (eval echo configure:8448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8448   rm -rf conftest*
8449   eval "ac_cv_func_setproctitle=yes"
8450 else
8451   echo "configure: failed program was:" >&5
8452   cat conftest.$ac_ext >&5
8453   rm -rf conftest*
8454   eval "ac_cv_func_setproctitle=no"
8455 fi
8456 rm -f conftest*
8457 fi
8458
8459 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
8460   echo "$ac_t""yes" 1>&6
8461   have_setproctitle=yes
8462 else
8463   echo "$ac_t""no" 1>&6
8464
8465                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
8466 echo "configure:8467: checking for setproctitle in -lutil" >&5
8467 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
8468 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8469   echo $ac_n "(cached) $ac_c" 1>&6
8470 else
8471   ac_save_LIBS="$LIBS"
8472 LIBS="-lutil  $LIBS"
8473 cat > conftest.$ac_ext <<EOF
8474 #line 8475 "configure"
8475 #include "confdefs.h"
8476 /* Override any gcc2 internal prototype to avoid an error.  */
8477 /* We use char because int might match the return type of a gcc2
8478     builtin and then its argument prototype would still apply.  */
8479 char setproctitle();
8480
8481 int main() {
8482 setproctitle()
8483 ; return 0; }
8484 EOF
8485 if { (eval echo configure:8486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8486   rm -rf conftest*
8487   eval "ac_cv_lib_$ac_lib_var=yes"
8488 else
8489   echo "configure: failed program was:" >&5
8490   cat conftest.$ac_ext >&5
8491   rm -rf conftest*
8492   eval "ac_cv_lib_$ac_lib_var=no"
8493 fi
8494 rm -f conftest*
8495 LIBS="$ac_save_LIBS"
8496
8497 fi
8498 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8499   echo "$ac_t""yes" 1>&6
8500   have_setproctitle=yes
8501                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
8502 else
8503   echo "$ac_t""no" 1>&6
8504 have_setproctitle=no
8505                         LIBOBJS="$LIBOBJS setproctitle.o"
8506 fi
8507
8508 fi
8509
8510
8511         if test $have_setproctitle = yes ; then
8512                 cat >> confdefs.h <<\EOF
8513 #define HAVE_SETPROCTITLE 1
8514 EOF
8515
8516         fi
8517 fi
8518
8519 # test for EBCDIC
8520 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
8521 echo "configure:8522: checking for EBCDIC" >&5
8522 if eval "test \"`echo '$''{'ol_cv_cpp_ebcdic'+set}'`\" = set"; then
8523   echo $ac_n "(cached) $ac_c" 1>&6
8524 else
8525   
8526         cat > conftest.$ac_ext <<EOF
8527 #line 8528 "configure"
8528 #include "confdefs.h"
8529
8530 #if !('M' == 0xd4)
8531 #include <__ASCII__/generate_error.h>
8532 #endif
8533
8534 EOF
8535 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8536 { (eval echo configure:8537: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8537 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8538 if test -z "$ac_err"; then
8539   rm -rf conftest*
8540   ol_cv_cpp_ebcdic=yes
8541 else
8542   echo "$ac_err" >&5
8543   echo "configure: failed program was:" >&5
8544   cat conftest.$ac_ext >&5
8545   rm -rf conftest*
8546   ol_cv_cpp_ebcdic=no
8547 fi
8548 rm -f conftest*
8549 fi
8550
8551 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
8552 if test $ol_cv_cpp_ebcdic = yes ; then
8553         cat >> confdefs.h <<\EOF
8554 #define HAVE_EBCDIC 1
8555 EOF
8556
8557 fi
8558
8559 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
8560 echo "configure:8561: checking for ANSI C header files" >&5
8561 if eval "test \"`echo '$''{'ol_cv_header_stdc'+set}'`\" = set"; then
8562   echo $ac_n "(cached) $ac_c" 1>&6
8563 else
8564   cat > conftest.$ac_ext <<EOF
8565 #line 8566 "configure"
8566 #include "confdefs.h"
8567 #include <stdlib.h>
8568 #include <stdarg.h>
8569 #include <string.h>
8570 #include <float.h>
8571 EOF
8572 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8573 { (eval echo configure:8574: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8574 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8575 if test -z "$ac_err"; then
8576   rm -rf conftest*
8577   ol_cv_header_stdc=yes
8578 else
8579   echo "$ac_err" >&5
8580   echo "configure: failed program was:" >&5
8581   cat conftest.$ac_ext >&5
8582   rm -rf conftest*
8583   ol_cv_header_stdc=no
8584 fi
8585 rm -f conftest*
8586
8587 if test $ol_cv_header_stdc = yes; then
8588   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
8589 cat > conftest.$ac_ext <<EOF
8590 #line 8591 "configure"
8591 #include "confdefs.h"
8592 #include <string.h>
8593 EOF
8594 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8595   egrep "memchr" >/dev/null 2>&1; then
8596   :
8597 else
8598   rm -rf conftest*
8599   ol_cv_header_stdc=no
8600 fi
8601 rm -f conftest*
8602
8603 fi
8604
8605 if test $ol_cv_header_stdc = yes; then
8606   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
8607 cat > conftest.$ac_ext <<EOF
8608 #line 8609 "configure"
8609 #include "confdefs.h"
8610 #include <stdlib.h>
8611 EOF
8612 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8613   egrep "free" >/dev/null 2>&1; then
8614   :
8615 else
8616   rm -rf conftest*
8617   ol_cv_header_stdc=no
8618 fi
8619 rm -f conftest*
8620
8621 fi
8622
8623 if test $ol_cv_header_stdc = yes; then
8624   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
8625 if test "$cross_compiling" = yes; then
8626   :
8627 else
8628   cat > conftest.$ac_ext <<EOF
8629 #line 8630 "configure"
8630 #include "confdefs.h"
8631 #include <ctype.h>
8632 #ifndef HAVE_EBCDIC
8633 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
8634 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
8635 #else
8636 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
8637                 || ('j' <= (c) && (c) <= 'r') \
8638                 || ('s' <= (c) && (c) <= 'z'))
8639 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
8640 #endif
8641 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
8642 int main () { int i; for (i = 0; i < 256; i++)
8643 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
8644 exit (0); }
8645
8646 EOF
8647 if { (eval echo configure:8648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8648 then
8649   :
8650 else
8651   echo "configure: failed program was:" >&5
8652   cat conftest.$ac_ext >&5
8653   rm -fr conftest*
8654   ol_cv_header_stdc=no
8655 fi
8656 rm -fr conftest*
8657 fi
8658
8659 fi
8660 fi
8661
8662 echo "$ac_t""$ol_cv_header_stdc" 1>&6
8663 if test $ol_cv_header_stdc = yes; then
8664   cat >> confdefs.h <<\EOF
8665 #define STDC_HEADERS 1
8666 EOF
8667
8668 fi
8669 ac_cv_header_stdc=disable
8670
8671
8672 if test $ol_cv_header_stdc != yes; then
8673         echo "configure: warning: could not Standard C compliant headers" 1>&2
8674 fi
8675
8676 ac_header_dirent=no
8677 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
8678 do
8679 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8680 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
8681 echo "configure:8682: checking for $ac_hdr that defines DIR" >&5
8682 if eval "test \"`echo '$''{'ac_cv_header_dirent_$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 <sys/types.h>
8689 #include <$ac_hdr>
8690 int main() {
8691 DIR *dirp = 0;
8692 ; return 0; }
8693 EOF
8694 if { (eval echo configure:8695: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8695   rm -rf conftest*
8696   eval "ac_cv_header_dirent_$ac_safe=yes"
8697 else
8698   echo "configure: failed program was:" >&5
8699   cat conftest.$ac_ext >&5
8700   rm -rf conftest*
8701   eval "ac_cv_header_dirent_$ac_safe=no"
8702 fi
8703 rm -f conftest*
8704 fi
8705 if eval "test \"`echo '$ac_cv_header_dirent_'$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  ac_header_dirent=$ac_hdr; break
8712 else
8713   echo "$ac_t""no" 1>&6
8714 fi
8715 done
8716 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
8717 if test $ac_header_dirent = dirent.h; then
8718 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
8719 echo "configure:8720: checking for opendir in -ldir" >&5
8720 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
8721 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8722   echo $ac_n "(cached) $ac_c" 1>&6
8723 else
8724   ac_save_LIBS="$LIBS"
8725 LIBS="-ldir  $LIBS"
8726 cat > conftest.$ac_ext <<EOF
8727 #line 8728 "configure"
8728 #include "confdefs.h"
8729 /* Override any gcc2 internal prototype to avoid an error.  */
8730 /* We use char because int might match the return type of a gcc2
8731     builtin and then its argument prototype would still apply.  */
8732 char opendir();
8733
8734 int main() {
8735 opendir()
8736 ; return 0; }
8737 EOF
8738 if { (eval echo configure:8739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8739   rm -rf conftest*
8740   eval "ac_cv_lib_$ac_lib_var=yes"
8741 else
8742   echo "configure: failed program was:" >&5
8743   cat conftest.$ac_ext >&5
8744   rm -rf conftest*
8745   eval "ac_cv_lib_$ac_lib_var=no"
8746 fi
8747 rm -f conftest*
8748 LIBS="$ac_save_LIBS"
8749
8750 fi
8751 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8752   echo "$ac_t""yes" 1>&6
8753   LIBS="$LIBS -ldir"
8754 else
8755   echo "$ac_t""no" 1>&6
8756 fi
8757
8758 else
8759 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
8760 echo "configure:8761: checking for opendir in -lx" >&5
8761 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
8762 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8763   echo $ac_n "(cached) $ac_c" 1>&6
8764 else
8765   ac_save_LIBS="$LIBS"
8766 LIBS="-lx  $LIBS"
8767 cat > conftest.$ac_ext <<EOF
8768 #line 8769 "configure"
8769 #include "confdefs.h"
8770 /* Override any gcc2 internal prototype to avoid an error.  */
8771 /* We use char because int might match the return type of a gcc2
8772     builtin and then its argument prototype would still apply.  */
8773 char opendir();
8774
8775 int main() {
8776 opendir()
8777 ; return 0; }
8778 EOF
8779 if { (eval echo configure:8780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8780   rm -rf conftest*
8781   eval "ac_cv_lib_$ac_lib_var=yes"
8782 else
8783   echo "configure: failed program was:" >&5
8784   cat conftest.$ac_ext >&5
8785   rm -rf conftest*
8786   eval "ac_cv_lib_$ac_lib_var=no"
8787 fi
8788 rm -f conftest*
8789 LIBS="$ac_save_LIBS"
8790
8791 fi
8792 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8793   echo "$ac_t""yes" 1>&6
8794   LIBS="$LIBS -lx"
8795 else
8796   echo "$ac_t""no" 1>&6
8797 fi
8798
8799 fi
8800
8801 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
8802 echo "configure:8803: checking for sys/wait.h that is POSIX.1 compatible" >&5
8803 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
8804   echo $ac_n "(cached) $ac_c" 1>&6
8805 else
8806   cat > conftest.$ac_ext <<EOF
8807 #line 8808 "configure"
8808 #include "confdefs.h"
8809 #include <sys/types.h>
8810 #include <sys/wait.h>
8811 #ifndef WEXITSTATUS
8812 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
8813 #endif
8814 #ifndef WIFEXITED
8815 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
8816 #endif
8817 int main() {
8818 int s;
8819 wait (&s);
8820 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
8821 ; return 0; }
8822 EOF
8823 if { (eval echo configure:8824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8824   rm -rf conftest*
8825   ac_cv_header_sys_wait_h=yes
8826 else
8827   echo "configure: failed program was:" >&5
8828   cat conftest.$ac_ext >&5
8829   rm -rf conftest*
8830   ac_cv_header_sys_wait_h=no
8831 fi
8832 rm -f conftest*
8833 fi
8834
8835 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
8836 if test $ac_cv_header_sys_wait_h = yes; then
8837   cat >> confdefs.h <<\EOF
8838 #define HAVE_SYS_WAIT_H 1
8839 EOF
8840
8841 fi
8842
8843 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
8844 echo "configure:8845: checking POSIX termios" >&5
8845 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
8846   echo $ac_n "(cached) $ac_c" 1>&6
8847 else
8848   cat > conftest.$ac_ext <<EOF
8849 #line 8850 "configure"
8850 #include "confdefs.h"
8851 #include <sys/types.h>
8852 #include <unistd.h>
8853 #include <termios.h>
8854 int main() {
8855 /* SunOS 4.0.3 has termios.h but not the library calls.  */
8856    tcgetattr(0, 0);
8857 ; return 0; }
8858 EOF
8859 if { (eval echo configure:8860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8860   rm -rf conftest*
8861   am_cv_sys_posix_termios=yes
8862 else
8863   echo "configure: failed program was:" >&5
8864   cat conftest.$ac_ext >&5
8865   rm -rf conftest*
8866   am_cv_sys_posix_termios=no
8867 fi
8868 rm -f conftest*
8869 fi
8870
8871 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
8872
8873
8874  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
8875 echo "configure:8876: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
8876 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
8877   echo $ac_n "(cached) $ac_c" 1>&6
8878 else
8879   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
8880
8881   gwinsz_in_termios_h=no
8882   if test $am_cv_sys_posix_termios = yes; then
8883     cat > conftest.$ac_ext <<EOF
8884 #line 8885 "configure"
8885 #include "confdefs.h"
8886 #include <sys/types.h>
8887 #     include <termios.h>
8888 #     ifdef TIOCGWINSZ
8889         yes
8890 #     endif
8891     
8892 EOF
8893 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8894   egrep "yes" >/dev/null 2>&1; then
8895   rm -rf conftest*
8896   gwinsz_in_termios_h=yes
8897 fi
8898 rm -f conftest*
8899
8900   fi
8901
8902   if test $gwinsz_in_termios_h = no; then
8903     cat > conftest.$ac_ext <<EOF
8904 #line 8905 "configure"
8905 #include "confdefs.h"
8906 #include <sys/types.h>
8907 #     include <sys/ioctl.h>
8908 #     ifdef TIOCGWINSZ
8909         yes
8910 #     endif
8911     
8912 EOF
8913 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8914   egrep "yes" >/dev/null 2>&1; then
8915   rm -rf conftest*
8916   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
8917 fi
8918 rm -f conftest*
8919
8920   fi
8921   
8922 fi
8923
8924 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
8925   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
8926     cat >> confdefs.h <<\EOF
8927 #define GWINSZ_IN_SYS_IOCTL 1
8928 EOF
8929
8930   fi
8931
8932 if test $am_cv_sys_posix_termios = yes ; then
8933         cat >> confdefs.h <<\EOF
8934 #define HAVE_POSIX_TERMIOS 1
8935 EOF
8936
8937 fi
8938
8939 for ac_hdr in \
8940         arpa/inet.h             \
8941         arpa/nameser.h  \
8942         assert.h                \
8943         crypt.h                 \
8944         errno.h                 \
8945         fcntl.h                 \
8946         filio.h                 \
8947         getopt.h                \
8948         grp.h                   \
8949         libutil.h               \
8950         limits.h                \
8951         locale.h                \
8952         malloc.h                \
8953         memory.h                \
8954         regex.h                 \
8955         psap.h                  \
8956         pwd.h                   \
8957         resolv.h                \
8958         sgtty.h                 \
8959         stdarg.h                \
8960         stddef.h                \
8961         string.h                \
8962         strings.h               \
8963         sysexits.h              \
8964         sys/file.h              \
8965         sys/filio.h             \
8966         sys/errno.h             \
8967         sys/ioctl.h             \
8968         sys/param.h             \
8969         sys/resource.h  \
8970         sys/socket.h    \
8971         sys/syslog.h    \
8972         sys/time.h              \
8973         sys/types.h             \
8974         syslog.h                \
8975         termios.h               \
8976         unistd.h                \
8977
8978 do
8979 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8980 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8981 echo "configure:8982: checking for $ac_hdr" >&5
8982 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8983   echo $ac_n "(cached) $ac_c" 1>&6
8984 else
8985   cat > conftest.$ac_ext <<EOF
8986 #line 8987 "configure"
8987 #include "confdefs.h"
8988 #include <$ac_hdr>
8989 EOF
8990 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8991 { (eval echo configure:8992: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8992 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8993 if test -z "$ac_err"; then
8994   rm -rf conftest*
8995   eval "ac_cv_header_$ac_safe=yes"
8996 else
8997   echo "$ac_err" >&5
8998   echo "configure: failed program was:" >&5
8999   cat conftest.$ac_ext >&5
9000   rm -rf conftest*
9001   eval "ac_cv_header_$ac_safe=no"
9002 fi
9003 rm -f conftest*
9004 fi
9005 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9006   echo "$ac_t""yes" 1>&6
9007     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9008   cat >> confdefs.h <<EOF
9009 #define $ac_tr_hdr 1
9010 EOF
9011  
9012 else
9013   echo "$ac_t""no" 1>&6
9014 fi
9015 done
9016
9017
9018 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
9019 echo "configure:9020: checking for uid_t in sys/types.h" >&5
9020 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
9021   echo $ac_n "(cached) $ac_c" 1>&6
9022 else
9023   cat > conftest.$ac_ext <<EOF
9024 #line 9025 "configure"
9025 #include "confdefs.h"
9026 #include <sys/types.h>
9027 EOF
9028 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9029   egrep "uid_t" >/dev/null 2>&1; then
9030   rm -rf conftest*
9031   ac_cv_type_uid_t=yes
9032 else
9033   rm -rf conftest*
9034   ac_cv_type_uid_t=no
9035 fi
9036 rm -f conftest*
9037
9038 fi
9039
9040 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
9041 if test $ac_cv_type_uid_t = no; then
9042   cat >> confdefs.h <<\EOF
9043 #define uid_t int
9044 EOF
9045
9046   cat >> confdefs.h <<\EOF
9047 #define gid_t int
9048 EOF
9049
9050 fi
9051
9052 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
9053 echo "configure:9054: checking type of array argument to getgroups" >&5
9054 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
9055   echo $ac_n "(cached) $ac_c" 1>&6
9056 else
9057   if test "$cross_compiling" = yes; then
9058   ac_cv_type_getgroups=cross
9059 else
9060   cat > conftest.$ac_ext <<EOF
9061 #line 9062 "configure"
9062 #include "confdefs.h"
9063
9064 /* Thanks to Mike Rendell for this test.  */
9065 #include <sys/types.h>
9066 #define NGID 256
9067 #undef MAX
9068 #define MAX(x, y) ((x) > (y) ? (x) : (y))
9069 main()
9070 {
9071   gid_t gidset[NGID];
9072   int i, n;
9073   union { gid_t gval; long lval; }  val;
9074
9075   val.lval = -1;
9076   for (i = 0; i < NGID; i++)
9077     gidset[i] = val.gval;
9078   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
9079                  gidset);
9080   /* Exit non-zero if getgroups seems to require an array of ints.  This
9081      happens when gid_t is short but getgroups modifies an array of ints.  */
9082   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
9083 }
9084
9085 EOF
9086 if { (eval echo configure:9087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9087 then
9088     ac_cv_type_getgroups=gid_t
9089 else
9090   echo "configure: failed program was:" >&5
9091   cat conftest.$ac_ext >&5
9092   rm -fr conftest*
9093   ac_cv_type_getgroups=int
9094 fi
9095 rm -fr conftest*
9096 fi
9097
9098 if test $ac_cv_type_getgroups = cross; then
9099         cat > conftest.$ac_ext <<EOF
9100 #line 9101 "configure"
9101 #include "confdefs.h"
9102 #include <unistd.h>
9103 EOF
9104 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9105   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
9106   rm -rf conftest*
9107   ac_cv_type_getgroups=gid_t
9108 else
9109   rm -rf conftest*
9110   ac_cv_type_getgroups=int
9111 fi
9112 rm -f conftest*
9113
9114 fi
9115 fi
9116
9117 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
9118 cat >> confdefs.h <<EOF
9119 #define GETGROUPS_T $ac_cv_type_getgroups
9120 EOF
9121
9122  echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
9123 echo "configure:9124: checking for ANSI C header files" >&5
9124 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
9125   echo $ac_n "(cached) $ac_c" 1>&6
9126 else
9127   cat > conftest.$ac_ext <<EOF
9128 #line 9129 "configure"
9129 #include "confdefs.h"
9130 #include <stdlib.h>
9131 #include <stdarg.h>
9132 #include <string.h>
9133 #include <float.h>
9134 EOF
9135 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9136 { (eval echo configure:9137: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9137 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9138 if test -z "$ac_err"; then
9139   rm -rf conftest*
9140   ac_cv_header_stdc=yes
9141 else
9142   echo "$ac_err" >&5
9143   echo "configure: failed program was:" >&5
9144   cat conftest.$ac_ext >&5
9145   rm -rf conftest*
9146   ac_cv_header_stdc=no
9147 fi
9148 rm -f conftest*
9149
9150 if test $ac_cv_header_stdc = yes; then
9151   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
9152 cat > conftest.$ac_ext <<EOF
9153 #line 9154 "configure"
9154 #include "confdefs.h"
9155 #include <string.h>
9156 EOF
9157 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9158   egrep "memchr" >/dev/null 2>&1; then
9159   :
9160 else
9161   rm -rf conftest*
9162   ac_cv_header_stdc=no
9163 fi
9164 rm -f conftest*
9165
9166 fi
9167
9168 if test $ac_cv_header_stdc = yes; then
9169   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
9170 cat > conftest.$ac_ext <<EOF
9171 #line 9172 "configure"
9172 #include "confdefs.h"
9173 #include <stdlib.h>
9174 EOF
9175 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9176   egrep "free" >/dev/null 2>&1; then
9177   :
9178 else
9179   rm -rf conftest*
9180   ac_cv_header_stdc=no
9181 fi
9182 rm -f conftest*
9183
9184 fi
9185
9186 if test $ac_cv_header_stdc = yes; then
9187   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
9188 if test "$cross_compiling" = yes; then
9189   :
9190 else
9191   cat > conftest.$ac_ext <<EOF
9192 #line 9193 "configure"
9193 #include "confdefs.h"
9194 #include <ctype.h>
9195 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
9196 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
9197 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
9198 int main () { int i; for (i = 0; i < 256; i++)
9199 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
9200 exit (0); }
9201
9202 EOF
9203 if { (eval echo configure:9204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9204 then
9205   :
9206 else
9207   echo "configure: failed program was:" >&5
9208   cat conftest.$ac_ext >&5
9209   rm -fr conftest*
9210   ac_cv_header_stdc=no
9211 fi
9212 rm -fr conftest*
9213 fi
9214
9215 fi
9216 fi
9217
9218 echo "$ac_t""$ac_cv_header_stdc" 1>&6
9219 if test $ac_cv_header_stdc = yes; then
9220   cat >> confdefs.h <<\EOF
9221 #define STDC_HEADERS 1
9222 EOF
9223
9224 fi
9225
9226 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
9227 echo "configure:9228: checking for mode_t" >&5
9228 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
9229   echo $ac_n "(cached) $ac_c" 1>&6
9230 else
9231   cat > conftest.$ac_ext <<EOF
9232 #line 9233 "configure"
9233 #include "confdefs.h"
9234 #include <sys/types.h>
9235 #if STDC_HEADERS
9236 #include <stdlib.h>
9237 #include <stddef.h>
9238 #endif
9239 EOF
9240 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9241   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
9242   rm -rf conftest*
9243   ac_cv_type_mode_t=yes
9244 else
9245   rm -rf conftest*
9246   ac_cv_type_mode_t=no
9247 fi
9248 rm -f conftest*
9249
9250 fi
9251 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
9252 if test $ac_cv_type_mode_t = no; then
9253   cat >> confdefs.h <<\EOF
9254 #define mode_t int
9255 EOF
9256
9257 fi
9258
9259 echo $ac_n "checking for off_t""... $ac_c" 1>&6
9260 echo "configure:9261: checking for off_t" >&5
9261 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
9262   echo $ac_n "(cached) $ac_c" 1>&6
9263 else
9264   cat > conftest.$ac_ext <<EOF
9265 #line 9266 "configure"
9266 #include "confdefs.h"
9267 #include <sys/types.h>
9268 #if STDC_HEADERS
9269 #include <stdlib.h>
9270 #include <stddef.h>
9271 #endif
9272 EOF
9273 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9274   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
9275   rm -rf conftest*
9276   ac_cv_type_off_t=yes
9277 else
9278   rm -rf conftest*
9279   ac_cv_type_off_t=no
9280 fi
9281 rm -f conftest*
9282
9283 fi
9284 echo "$ac_t""$ac_cv_type_off_t" 1>&6
9285 if test $ac_cv_type_off_t = no; then
9286   cat >> confdefs.h <<\EOF
9287 #define off_t long
9288 EOF
9289
9290 fi
9291
9292 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
9293 echo "configure:9294: checking for pid_t" >&5
9294 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
9295   echo $ac_n "(cached) $ac_c" 1>&6
9296 else
9297   cat > conftest.$ac_ext <<EOF
9298 #line 9299 "configure"
9299 #include "confdefs.h"
9300 #include <sys/types.h>
9301 #if STDC_HEADERS
9302 #include <stdlib.h>
9303 #include <stddef.h>
9304 #endif
9305 EOF
9306 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9307   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
9308   rm -rf conftest*
9309   ac_cv_type_pid_t=yes
9310 else
9311   rm -rf conftest*
9312   ac_cv_type_pid_t=no
9313 fi
9314 rm -f conftest*
9315
9316 fi
9317 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
9318 if test $ac_cv_type_pid_t = no; then
9319   cat >> confdefs.h <<\EOF
9320 #define pid_t int
9321 EOF
9322
9323 fi
9324
9325 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
9326 echo "configure:9327: checking for ptrdiff_t" >&5
9327 if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then
9328   echo $ac_n "(cached) $ac_c" 1>&6
9329 else
9330   cat > conftest.$ac_ext <<EOF
9331 #line 9332 "configure"
9332 #include "confdefs.h"
9333 #include <stddef.h>
9334 int main() {
9335 ptrdiff_t p
9336 ; return 0; }
9337 EOF
9338 if { (eval echo configure:9339: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9339   rm -rf conftest*
9340   am_cv_type_ptrdiff_t=yes
9341 else
9342   echo "configure: failed program was:" >&5
9343   cat conftest.$ac_ext >&5
9344   rm -rf conftest*
9345   am_cv_type_ptrdiff_t=no
9346 fi
9347 rm -f conftest*
9348 fi
9349
9350 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
9351    if test $am_cv_type_ptrdiff_t = yes; then
9352      cat >> confdefs.h <<\EOF
9353 #define HAVE_PTRDIFF_T 1
9354 EOF
9355
9356    fi
9357
9358 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
9359 echo "configure:9360: checking return type of signal handlers" >&5
9360 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
9361   echo $ac_n "(cached) $ac_c" 1>&6
9362 else
9363   cat > conftest.$ac_ext <<EOF
9364 #line 9365 "configure"
9365 #include "confdefs.h"
9366 #include <sys/types.h>
9367 #include <signal.h>
9368 #ifdef signal
9369 #undef signal
9370 #endif
9371 #ifdef __cplusplus
9372 extern "C" void (*signal (int, void (*)(int)))(int);
9373 #else
9374 void (*signal ()) ();
9375 #endif
9376
9377 int main() {
9378 int i;
9379 ; return 0; }
9380 EOF
9381 if { (eval echo configure:9382: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9382   rm -rf conftest*
9383   ac_cv_type_signal=void
9384 else
9385   echo "configure: failed program was:" >&5
9386   cat conftest.$ac_ext >&5
9387   rm -rf conftest*
9388   ac_cv_type_signal=int
9389 fi
9390 rm -f conftest*
9391 fi
9392
9393 echo "$ac_t""$ac_cv_type_signal" 1>&6
9394 cat >> confdefs.h <<EOF
9395 #define RETSIGTYPE $ac_cv_type_signal
9396 EOF
9397
9398
9399 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
9400 echo "configure:9401: checking for sig_atomic_t" >&5
9401 if eval "test \"`echo '$''{'ol_cv_type_sig_atomic_t'+set}'`\" = set"; then
9402   echo $ac_n "(cached) $ac_c" 1>&6
9403 else
9404   cat > conftest.$ac_ext <<EOF
9405 #line 9406 "configure"
9406 #include "confdefs.h"
9407 #include <signal.h>
9408 int main() {
9409 sig_atomic_t atomic;
9410 ; return 0; }
9411 EOF
9412 if { (eval echo configure:9413: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9413   rm -rf conftest*
9414   ol_cv_type_sig_atomic_t=yes
9415 else
9416   echo "configure: failed program was:" >&5
9417   cat conftest.$ac_ext >&5
9418   rm -rf conftest*
9419   ol_cv_type_sig_atomic_t=no
9420 fi
9421 rm -f conftest*
9422 fi
9423
9424 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
9425   if test $ol_cv_type_sig_atomic_t = no; then
9426     cat >> confdefs.h <<\EOF
9427 #define sig_atomic_t int
9428 EOF
9429
9430   fi
9431  
9432 echo $ac_n "checking for size_t""... $ac_c" 1>&6
9433 echo "configure:9434: checking for size_t" >&5
9434 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
9435   echo $ac_n "(cached) $ac_c" 1>&6
9436 else
9437   cat > conftest.$ac_ext <<EOF
9438 #line 9439 "configure"
9439 #include "confdefs.h"
9440 #include <sys/types.h>
9441 #if STDC_HEADERS
9442 #include <stdlib.h>
9443 #include <stddef.h>
9444 #endif
9445 EOF
9446 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9447   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
9448   rm -rf conftest*
9449   ac_cv_type_size_t=yes
9450 else
9451   rm -rf conftest*
9452   ac_cv_type_size_t=no
9453 fi
9454 rm -f conftest*
9455
9456 fi
9457 echo "$ac_t""$ac_cv_type_size_t" 1>&6
9458 if test $ac_cv_type_size_t = no; then
9459   cat >> confdefs.h <<\EOF
9460 #define size_t unsigned
9461 EOF
9462
9463 fi
9464
9465 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
9466 echo "configure:9467: checking for st_blksize in struct stat" >&5
9467 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
9468   echo $ac_n "(cached) $ac_c" 1>&6
9469 else
9470   cat > conftest.$ac_ext <<EOF
9471 #line 9472 "configure"
9472 #include "confdefs.h"
9473 #include <sys/types.h>
9474 #include <sys/stat.h>
9475 int main() {
9476 struct stat s; s.st_blksize;
9477 ; return 0; }
9478 EOF
9479 if { (eval echo configure:9480: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9480   rm -rf conftest*
9481   ac_cv_struct_st_blksize=yes
9482 else
9483   echo "configure: failed program was:" >&5
9484   cat conftest.$ac_ext >&5
9485   rm -rf conftest*
9486   ac_cv_struct_st_blksize=no
9487 fi
9488 rm -f conftest*
9489 fi
9490
9491 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
9492 if test $ac_cv_struct_st_blksize = yes; then
9493   cat >> confdefs.h <<\EOF
9494 #define HAVE_ST_BLKSIZE 1
9495 EOF
9496
9497 fi
9498
9499 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
9500 echo "configure:9501: checking whether time.h and sys/time.h may both be included" >&5
9501 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
9502   echo $ac_n "(cached) $ac_c" 1>&6
9503 else
9504   cat > conftest.$ac_ext <<EOF
9505 #line 9506 "configure"
9506 #include "confdefs.h"
9507 #include <sys/types.h>
9508 #include <sys/time.h>
9509 #include <time.h>
9510 int main() {
9511 struct tm *tp;
9512 ; return 0; }
9513 EOF
9514 if { (eval echo configure:9515: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9515   rm -rf conftest*
9516   ac_cv_header_time=yes
9517 else
9518   echo "configure: failed program was:" >&5
9519   cat conftest.$ac_ext >&5
9520   rm -rf conftest*
9521   ac_cv_header_time=no
9522 fi
9523 rm -f conftest*
9524 fi
9525
9526 echo "$ac_t""$ac_cv_header_time" 1>&6
9527 if test $ac_cv_header_time = yes; then
9528   cat >> confdefs.h <<\EOF
9529 #define TIME_WITH_SYS_TIME 1
9530 EOF
9531
9532 fi
9533
9534 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
9535 echo "configure:9536: checking whether struct tm is in sys/time.h or time.h" >&5
9536 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
9537   echo $ac_n "(cached) $ac_c" 1>&6
9538 else
9539   cat > conftest.$ac_ext <<EOF
9540 #line 9541 "configure"
9541 #include "confdefs.h"
9542 #include <sys/types.h>
9543 #include <time.h>
9544 int main() {
9545 struct tm *tp; tp->tm_sec;
9546 ; return 0; }
9547 EOF
9548 if { (eval echo configure:9549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9549   rm -rf conftest*
9550   ac_cv_struct_tm=time.h
9551 else
9552   echo "configure: failed program was:" >&5
9553   cat conftest.$ac_ext >&5
9554   rm -rf conftest*
9555   ac_cv_struct_tm=sys/time.h
9556 fi
9557 rm -f conftest*
9558 fi
9559
9560 echo "$ac_t""$ac_cv_struct_tm" 1>&6
9561 if test $ac_cv_struct_tm = sys/time.h; then
9562   cat >> confdefs.h <<\EOF
9563 #define TM_IN_SYS_TIME 1
9564 EOF
9565
9566 fi
9567
9568 # test for pw_gecos in struct passwd
9569 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
9570 echo "configure:9571: checking struct passwd for pw_gecos" >&5
9571 if eval "test \"`echo '$''{'ol_cv_struct_passwd_pw_gecos'+set}'`\" = set"; then
9572   echo $ac_n "(cached) $ac_c" 1>&6
9573 else
9574   
9575         cat > conftest.$ac_ext <<EOF
9576 #line 9577 "configure"
9577 #include "confdefs.h"
9578 #include <pwd.h>
9579 int main() {
9580
9581         struct passwd pwd;
9582         pwd.pw_gecos = pwd.pw_name;
9583
9584 ; return 0; }
9585 EOF
9586 if { (eval echo configure:9587: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9587   rm -rf conftest*
9588   ol_cv_struct_passwd_pw_gecos=yes
9589 else
9590   echo "configure: failed program was:" >&5
9591   cat conftest.$ac_ext >&5
9592   rm -rf conftest*
9593   ol_cv_struct_passwd_pw_gecos=no
9594 fi
9595 rm -f conftest*
9596 fi
9597
9598 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
9599 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
9600         cat >> confdefs.h <<\EOF
9601 #define HAVE_PW_GECOS 1
9602 EOF
9603
9604 fi
9605
9606
9607
9608 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
9609 echo "configure:9610: checking if toupper() requires islower()" >&5
9610 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
9611   echo $ac_n "(cached) $ac_c" 1>&6
9612 else
9613   
9614         if test "$cross_compiling" = yes; then
9615   ol_cv_c_upper_lower=safe
9616 else
9617   cat > conftest.$ac_ext <<EOF
9618 #line 9619 "configure"
9619 #include "confdefs.h"
9620
9621 #include <ctype.h>
9622 main()
9623 {
9624         if ('C' == toupper('C'))
9625                 exit(0);
9626         else
9627                 exit(1);
9628 }
9629 EOF
9630 if { (eval echo configure:9631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9631 then
9632   ol_cv_c_upper_lower=no
9633 else
9634   echo "configure: failed program was:" >&5
9635   cat conftest.$ac_ext >&5
9636   rm -fr conftest*
9637   ol_cv_c_upper_lower=yes
9638 fi
9639 rm -fr conftest*
9640 fi
9641
9642 fi
9643
9644 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
9645 if test $ol_cv_c_upper_lower != no ; then
9646         cat >> confdefs.h <<\EOF
9647 #define C_UPPER_LOWER 1
9648 EOF
9649
9650 fi
9651
9652 echo $ac_n "checking for working const""... $ac_c" 1>&6
9653 echo "configure:9654: checking for working const" >&5
9654 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
9655   echo $ac_n "(cached) $ac_c" 1>&6
9656 else
9657   cat > conftest.$ac_ext <<EOF
9658 #line 9659 "configure"
9659 #include "confdefs.h"
9660
9661 int main() {
9662
9663 /* Ultrix mips cc rejects this.  */
9664 typedef int charset[2]; const charset x;
9665 /* SunOS 4.1.1 cc rejects this.  */
9666 char const *const *ccp;
9667 char **p;
9668 /* NEC SVR4.0.2 mips cc rejects this.  */
9669 struct point {int x, y;};
9670 static struct point const zero = {0,0};
9671 /* AIX XL C 1.02.0.0 rejects this.
9672    It does not let you subtract one const X* pointer from another in an arm
9673    of an if-expression whose if-part is not a constant expression */
9674 const char *g = "string";
9675 ccp = &g + (g ? g-g : 0);
9676 /* HPUX 7.0 cc rejects these. */
9677 ++ccp;
9678 p = (char**) ccp;
9679 ccp = (char const *const *) p;
9680 { /* SCO 3.2v4 cc rejects this.  */
9681   char *t;
9682   char const *s = 0 ? (char *) 0 : (char const *) 0;
9683
9684   *t++ = 0;
9685 }
9686 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
9687   int x[] = {25, 17};
9688   const int *foo = &x[0];
9689   ++foo;
9690 }
9691 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
9692   typedef const int *iptr;
9693   iptr p = 0;
9694   ++p;
9695 }
9696 { /* AIX XL C 1.02.0.0 rejects this saying
9697      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
9698   struct s { int j; const int *ap[3]; };
9699   struct s *b; b->j = 5;
9700 }
9701 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
9702   const int foo = 10;
9703 }
9704
9705 ; return 0; }
9706 EOF
9707 if { (eval echo configure:9708: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9708   rm -rf conftest*
9709   ac_cv_c_const=yes
9710 else
9711   echo "configure: failed program was:" >&5
9712   cat conftest.$ac_ext >&5
9713   rm -rf conftest*
9714   ac_cv_c_const=no
9715 fi
9716 rm -f conftest*
9717 fi
9718
9719 echo "$ac_t""$ac_cv_c_const" 1>&6
9720 if test $ac_cv_c_const = no; then
9721   cat >> confdefs.h <<\EOF
9722 #define const 
9723 EOF
9724
9725 fi
9726
9727 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
9728 echo "configure:9729: checking if compiler understands volatile" >&5
9729 if eval "test \"`echo '$''{'ol_cv_c_volatile'+set}'`\" = set"; then
9730   echo $ac_n "(cached) $ac_c" 1>&6
9731 else
9732   cat > conftest.$ac_ext <<EOF
9733 #line 9734 "configure"
9734 #include "confdefs.h"
9735 int x, y, z;
9736 int main() {
9737 volatile int a; int * volatile b = x ? &y : &z;
9738       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
9739       *b = 0;
9740 ; return 0; }
9741 EOF
9742 if { (eval echo configure:9743: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9743   rm -rf conftest*
9744   ol_cv_c_volatile=yes
9745 else
9746   echo "configure: failed program was:" >&5
9747   cat conftest.$ac_ext >&5
9748   rm -rf conftest*
9749   ol_cv_c_volatile=no
9750 fi
9751 rm -f conftest*
9752 fi
9753
9754 echo "$ac_t""$ol_cv_c_volatile" 1>&6
9755   if test $ol_cv_c_volatile = yes; then
9756     : 
9757   else
9758     cat >> confdefs.h <<\EOF
9759 #define volatile 
9760 EOF
9761
9762   fi
9763  
9764
9765 if test $cross_compiling = yes ; then
9766         cat >> confdefs.h <<\EOF
9767 #define CROSS_COMPILING 1
9768 EOF
9769
9770 else
9771         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
9772 echo "configure:9773: checking whether byte ordering is bigendian" >&5
9773 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
9774   echo $ac_n "(cached) $ac_c" 1>&6
9775 else
9776   ac_cv_c_bigendian=unknown
9777 # See if sys/param.h defines the BYTE_ORDER macro.
9778 cat > conftest.$ac_ext <<EOF
9779 #line 9780 "configure"
9780 #include "confdefs.h"
9781 #include <sys/types.h>
9782 #include <sys/param.h>
9783 int main() {
9784
9785 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
9786  bogus endian macros
9787 #endif
9788 ; return 0; }
9789 EOF
9790 if { (eval echo configure:9791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9791   rm -rf conftest*
9792   # It does; now see whether it defined to BIG_ENDIAN or not.
9793 cat > conftest.$ac_ext <<EOF
9794 #line 9795 "configure"
9795 #include "confdefs.h"
9796 #include <sys/types.h>
9797 #include <sys/param.h>
9798 int main() {
9799
9800 #if BYTE_ORDER != BIG_ENDIAN
9801  not big endian
9802 #endif
9803 ; return 0; }
9804 EOF
9805 if { (eval echo configure:9806: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9806   rm -rf conftest*
9807   ac_cv_c_bigendian=yes
9808 else
9809   echo "configure: failed program was:" >&5
9810   cat conftest.$ac_ext >&5
9811   rm -rf conftest*
9812   ac_cv_c_bigendian=no
9813 fi
9814 rm -f conftest*
9815 else
9816   echo "configure: failed program was:" >&5
9817   cat conftest.$ac_ext >&5
9818 fi
9819 rm -f conftest*
9820 if test $ac_cv_c_bigendian = unknown; then
9821 if test "$cross_compiling" = yes; then
9822     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
9823 else
9824   cat > conftest.$ac_ext <<EOF
9825 #line 9826 "configure"
9826 #include "confdefs.h"
9827 main () {
9828   /* Are we little or big endian?  From Harbison&Steele.  */
9829   union
9830   {
9831     long l;
9832     char c[sizeof (long)];
9833   } u;
9834   u.l = 1;
9835   exit (u.c[sizeof (long) - 1] == 1);
9836 }
9837 EOF
9838 if { (eval echo configure:9839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9839 then
9840   ac_cv_c_bigendian=no
9841 else
9842   echo "configure: failed program was:" >&5
9843   cat conftest.$ac_ext >&5
9844   rm -fr conftest*
9845   ac_cv_c_bigendian=yes
9846 fi
9847 rm -fr conftest*
9848 fi
9849
9850 fi
9851 fi
9852
9853 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
9854 if test $ac_cv_c_bigendian = yes; then
9855   cat >> confdefs.h <<\EOF
9856 #define WORDS_BIGENDIAN 1
9857 EOF
9858
9859 fi
9860
9861         echo $ac_n "checking size of short""... $ac_c" 1>&6
9862 echo "configure:9863: checking size of short" >&5
9863 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
9864   echo $ac_n "(cached) $ac_c" 1>&6
9865 else
9866   if test "$cross_compiling" = yes; then
9867     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
9868 else
9869   cat > conftest.$ac_ext <<EOF
9870 #line 9871 "configure"
9871 #include "confdefs.h"
9872 #include <stdio.h>
9873 main()
9874 {
9875   FILE *f=fopen("conftestval", "w");
9876   if (!f) exit(1);
9877   fprintf(f, "%d\n", sizeof(short));
9878   exit(0);
9879 }
9880 EOF
9881 if { (eval echo configure:9882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9882 then
9883   ac_cv_sizeof_short=`cat conftestval`
9884 else
9885   echo "configure: failed program was:" >&5
9886   cat conftest.$ac_ext >&5
9887   rm -fr conftest*
9888   ac_cv_sizeof_short=0
9889 fi
9890 rm -fr conftest*
9891 fi
9892
9893 fi
9894 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
9895 cat >> confdefs.h <<EOF
9896 #define SIZEOF_SHORT $ac_cv_sizeof_short
9897 EOF
9898
9899  
9900         echo $ac_n "checking size of int""... $ac_c" 1>&6
9901 echo "configure:9902: checking size of int" >&5
9902 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
9903   echo $ac_n "(cached) $ac_c" 1>&6
9904 else
9905   if test "$cross_compiling" = yes; then
9906     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
9907 else
9908   cat > conftest.$ac_ext <<EOF
9909 #line 9910 "configure"
9910 #include "confdefs.h"
9911 #include <stdio.h>
9912 main()
9913 {
9914   FILE *f=fopen("conftestval", "w");
9915   if (!f) exit(1);
9916   fprintf(f, "%d\n", sizeof(int));
9917   exit(0);
9918 }
9919 EOF
9920 if { (eval echo configure:9921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9921 then
9922   ac_cv_sizeof_int=`cat conftestval`
9923 else
9924   echo "configure: failed program was:" >&5
9925   cat conftest.$ac_ext >&5
9926   rm -fr conftest*
9927   ac_cv_sizeof_int=0
9928 fi
9929 rm -fr conftest*
9930 fi
9931
9932 fi
9933 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
9934 cat >> confdefs.h <<EOF
9935 #define SIZEOF_INT $ac_cv_sizeof_int
9936 EOF
9937
9938  
9939         echo $ac_n "checking size of long""... $ac_c" 1>&6
9940 echo "configure:9941: checking size of long" >&5
9941 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
9942   echo $ac_n "(cached) $ac_c" 1>&6
9943 else
9944   if test "$cross_compiling" = yes; then
9945     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
9946 else
9947   cat > conftest.$ac_ext <<EOF
9948 #line 9949 "configure"
9949 #include "confdefs.h"
9950 #include <stdio.h>
9951 main()
9952 {
9953   FILE *f=fopen("conftestval", "w");
9954   if (!f) exit(1);
9955   fprintf(f, "%d\n", sizeof(long));
9956   exit(0);
9957 }
9958 EOF
9959 if { (eval echo configure:9960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9960 then
9961   ac_cv_sizeof_long=`cat conftestval`
9962 else
9963   echo "configure: failed program was:" >&5
9964   cat conftest.$ac_ext >&5
9965   rm -fr conftest*
9966   ac_cv_sizeof_long=0
9967 fi
9968 rm -fr conftest*
9969 fi
9970
9971 fi
9972 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
9973 cat >> confdefs.h <<EOF
9974 #define SIZEOF_LONG $ac_cv_sizeof_long
9975 EOF
9976
9977
9978 fi
9979
9980 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
9981 echo "configure:9982: checking for 8-bit clean memcmp" >&5
9982 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
9983   echo $ac_n "(cached) $ac_c" 1>&6
9984 else
9985   if test "$cross_compiling" = yes; then
9986   ac_cv_func_memcmp_clean=no
9987 else
9988   cat > conftest.$ac_ext <<EOF
9989 #line 9990 "configure"
9990 #include "confdefs.h"
9991
9992 main()
9993 {
9994   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
9995   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
9996 }
9997
9998 EOF
9999 if { (eval echo configure:10000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10000 then
10001   ac_cv_func_memcmp_clean=yes
10002 else
10003   echo "configure: failed program was:" >&5
10004   cat conftest.$ac_ext >&5
10005   rm -fr conftest*
10006   ac_cv_func_memcmp_clean=no
10007 fi
10008 rm -fr conftest*
10009 fi
10010
10011 fi
10012
10013 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
10014 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
10015
10016 echo $ac_n "checking for strftime""... $ac_c" 1>&6
10017 echo "configure:10018: checking for strftime" >&5
10018 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
10019   echo $ac_n "(cached) $ac_c" 1>&6
10020 else
10021   cat > conftest.$ac_ext <<EOF
10022 #line 10023 "configure"
10023 #include "confdefs.h"
10024 /* System header to define __stub macros and hopefully few prototypes,
10025     which can conflict with char strftime(); below.  */
10026 #include <assert.h>
10027 /* Override any gcc2 internal prototype to avoid an error.  */
10028 /* We use char because int might match the return type of a gcc2
10029     builtin and then its argument prototype would still apply.  */
10030 char strftime();
10031
10032 int main() {
10033
10034 /* The GNU C library defines this for functions which it implements
10035     to always fail with ENOSYS.  Some functions are actually named
10036     something starting with __ and the normal name is an alias.  */
10037 #if defined (__stub_strftime) || defined (__stub___strftime)
10038 choke me
10039 #else
10040 strftime();
10041 #endif
10042
10043 ; return 0; }
10044 EOF
10045 if { (eval echo configure:10046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10046   rm -rf conftest*
10047   eval "ac_cv_func_strftime=yes"
10048 else
10049   echo "configure: failed program was:" >&5
10050   cat conftest.$ac_ext >&5
10051   rm -rf conftest*
10052   eval "ac_cv_func_strftime=no"
10053 fi
10054 rm -f conftest*
10055 fi
10056
10057 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
10058   echo "$ac_t""yes" 1>&6
10059   cat >> confdefs.h <<\EOF
10060 #define HAVE_STRFTIME 1
10061 EOF
10062
10063 else
10064   echo "$ac_t""no" 1>&6
10065 # strftime is in -lintl on SCO UNIX.
10066 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
10067 echo "configure:10068: checking for strftime in -lintl" >&5
10068 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
10069 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
10070   echo $ac_n "(cached) $ac_c" 1>&6
10071 else
10072   ac_save_LIBS="$LIBS"
10073 LIBS="-lintl  $LIBS"
10074 cat > conftest.$ac_ext <<EOF
10075 #line 10076 "configure"
10076 #include "confdefs.h"
10077 /* Override any gcc2 internal prototype to avoid an error.  */
10078 /* We use char because int might match the return type of a gcc2
10079     builtin and then its argument prototype would still apply.  */
10080 char strftime();
10081
10082 int main() {
10083 strftime()
10084 ; return 0; }
10085 EOF
10086 if { (eval echo configure:10087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10087   rm -rf conftest*
10088   eval "ac_cv_lib_$ac_lib_var=yes"
10089 else
10090   echo "configure: failed program was:" >&5
10091   cat conftest.$ac_ext >&5
10092   rm -rf conftest*
10093   eval "ac_cv_lib_$ac_lib_var=no"
10094 fi
10095 rm -f conftest*
10096 LIBS="$ac_save_LIBS"
10097
10098 fi
10099 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10100   echo "$ac_t""yes" 1>&6
10101   cat >> confdefs.h <<\EOF
10102 #define HAVE_STRFTIME 1
10103 EOF
10104
10105 LIBS="-lintl $LIBS"
10106 else
10107   echo "$ac_t""no" 1>&6
10108 fi
10109
10110 fi
10111
10112 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
10113 echo "configure:10114: checking for vprintf" >&5
10114 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
10115   echo $ac_n "(cached) $ac_c" 1>&6
10116 else
10117   cat > conftest.$ac_ext <<EOF
10118 #line 10119 "configure"
10119 #include "confdefs.h"
10120 /* System header to define __stub macros and hopefully few prototypes,
10121     which can conflict with char vprintf(); below.  */
10122 #include <assert.h>
10123 /* Override any gcc2 internal prototype to avoid an error.  */
10124 /* We use char because int might match the return type of a gcc2
10125     builtin and then its argument prototype would still apply.  */
10126 char vprintf();
10127
10128 int main() {
10129
10130 /* The GNU C library defines this for functions which it implements
10131     to always fail with ENOSYS.  Some functions are actually named
10132     something starting with __ and the normal name is an alias.  */
10133 #if defined (__stub_vprintf) || defined (__stub___vprintf)
10134 choke me
10135 #else
10136 vprintf();
10137 #endif
10138
10139 ; return 0; }
10140 EOF
10141 if { (eval echo configure:10142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10142   rm -rf conftest*
10143   eval "ac_cv_func_vprintf=yes"
10144 else
10145   echo "configure: failed program was:" >&5
10146   cat conftest.$ac_ext >&5
10147   rm -rf conftest*
10148   eval "ac_cv_func_vprintf=no"
10149 fi
10150 rm -f conftest*
10151 fi
10152
10153 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
10154   echo "$ac_t""yes" 1>&6
10155   cat >> confdefs.h <<\EOF
10156 #define HAVE_VPRINTF 1
10157 EOF
10158
10159 else
10160   echo "$ac_t""no" 1>&6
10161 fi
10162
10163 if test "$ac_cv_func_vprintf" != yes; then
10164 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
10165 echo "configure:10166: checking for _doprnt" >&5
10166 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
10167   echo $ac_n "(cached) $ac_c" 1>&6
10168 else
10169   cat > conftest.$ac_ext <<EOF
10170 #line 10171 "configure"
10171 #include "confdefs.h"
10172 /* System header to define __stub macros and hopefully few prototypes,
10173     which can conflict with char _doprnt(); below.  */
10174 #include <assert.h>
10175 /* Override any gcc2 internal prototype to avoid an error.  */
10176 /* We use char because int might match the return type of a gcc2
10177     builtin and then its argument prototype would still apply.  */
10178 char _doprnt();
10179
10180 int main() {
10181
10182 /* The GNU C library defines this for functions which it implements
10183     to always fail with ENOSYS.  Some functions are actually named
10184     something starting with __ and the normal name is an alias.  */
10185 #if defined (__stub__doprnt) || defined (__stub____doprnt)
10186 choke me
10187 #else
10188 _doprnt();
10189 #endif
10190
10191 ; return 0; }
10192 EOF
10193 if { (eval echo configure:10194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10194   rm -rf conftest*
10195   eval "ac_cv_func__doprnt=yes"
10196 else
10197   echo "configure: failed program was:" >&5
10198   cat conftest.$ac_ext >&5
10199   rm -rf conftest*
10200   eval "ac_cv_func__doprnt=no"
10201 fi
10202 rm -f conftest*
10203 fi
10204
10205 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
10206   echo "$ac_t""yes" 1>&6
10207   cat >> confdefs.h <<\EOF
10208 #define HAVE_DOPRNT 1
10209 EOF
10210
10211 else
10212   echo "$ac_t""no" 1>&6
10213 fi
10214
10215 fi
10216
10217
10218 if test $ac_cv_func_vprintf = yes ; then
10219                 for ac_func in vsnprintf vsprintf
10220 do
10221 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10222 echo "configure:10223: checking for $ac_func" >&5
10223 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
10224   echo $ac_n "(cached) $ac_c" 1>&6
10225 else
10226   cat > conftest.$ac_ext <<EOF
10227 #line 10228 "configure"
10228 #include "confdefs.h"
10229 /* System header to define __stub macros and hopefully few prototypes,
10230     which can conflict with char $ac_func(); below.  */
10231 #include <assert.h>
10232 /* Override any gcc2 internal prototype to avoid an error.  */
10233 /* We use char because int might match the return type of a gcc2
10234     builtin and then its argument prototype would still apply.  */
10235 char $ac_func();
10236
10237 int main() {
10238
10239 /* The GNU C library defines this for functions which it implements
10240     to always fail with ENOSYS.  Some functions are actually named
10241     something starting with __ and the normal name is an alias.  */
10242 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10243 choke me
10244 #else
10245 $ac_func();
10246 #endif
10247
10248 ; return 0; }
10249 EOF
10250 if { (eval echo configure:10251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10251   rm -rf conftest*
10252   eval "ac_cv_func_$ac_func=yes"
10253 else
10254   echo "configure: failed program was:" >&5
10255   cat conftest.$ac_ext >&5
10256   rm -rf conftest*
10257   eval "ac_cv_func_$ac_func=no"
10258 fi
10259 rm -f conftest*
10260 fi
10261
10262 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10263   echo "$ac_t""yes" 1>&6
10264     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10265   cat >> confdefs.h <<EOF
10266 #define $ac_tr_func 1
10267 EOF
10268  
10269 else
10270   echo "$ac_t""no" 1>&6
10271 fi
10272 done
10273
10274 fi
10275
10276 for ac_func in \
10277         bcopy                   \
10278         endgrent                \
10279         endpwent                \
10280         flock                   \
10281         getdtablesize           \
10282         getgrgid                \
10283         gethostname             \
10284         getpass                 \
10285         getpwuid                \
10286         gettimeofday            \
10287         lockf                   \
10288         memcpy                  \
10289         memmove                 \
10290         mkstemp                 \
10291         recv                    \
10292         recvfrom                \
10293         select                  \
10294         setpwfile               \
10295         setsid                  \
10296         signal                  \
10297         sigset                  \
10298         snprintf                \
10299         socket                  \
10300         strdup                  \
10301         strerror                \
10302         strpbrk                 \
10303         strrchr                 \
10304         strsep                  \
10305         strstr                  \
10306         strtol                  \
10307         strtoul                 \
10308         strspn                  \
10309         sysconf                 \
10310         waitpid                 \
10311         wait4                   \
10312
10313 do
10314 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10315 echo "configure:10316: checking for $ac_func" >&5
10316 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
10317   echo $ac_n "(cached) $ac_c" 1>&6
10318 else
10319   cat > conftest.$ac_ext <<EOF
10320 #line 10321 "configure"
10321 #include "confdefs.h"
10322 /* System header to define __stub macros and hopefully few prototypes,
10323     which can conflict with char $ac_func(); below.  */
10324 #include <assert.h>
10325 /* Override any gcc2 internal prototype to avoid an error.  */
10326 /* We use char because int might match the return type of a gcc2
10327     builtin and then its argument prototype would still apply.  */
10328 char $ac_func();
10329
10330 int main() {
10331
10332 /* The GNU C library defines this for functions which it implements
10333     to always fail with ENOSYS.  Some functions are actually named
10334     something starting with __ and the normal name is an alias.  */
10335 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10336 choke me
10337 #else
10338 $ac_func();
10339 #endif
10340
10341 ; return 0; }
10342 EOF
10343 if { (eval echo configure:10344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10344   rm -rf conftest*
10345   eval "ac_cv_func_$ac_func=yes"
10346 else
10347   echo "configure: failed program was:" >&5
10348   cat conftest.$ac_ext >&5
10349   rm -rf conftest*
10350   eval "ac_cv_func_$ac_func=no"
10351 fi
10352 rm -f conftest*
10353 fi
10354
10355 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10356   echo "$ac_t""yes" 1>&6
10357     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10358   cat >> confdefs.h <<EOF
10359 #define $ac_tr_func 1
10360 EOF
10361  
10362 else
10363   echo "$ac_t""no" 1>&6
10364 fi
10365 done
10366
10367
10368 for ac_func in getopt tempnam
10369 do
10370 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10371 echo "configure:10372: checking for $ac_func" >&5
10372 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
10373   echo $ac_n "(cached) $ac_c" 1>&6
10374 else
10375   cat > conftest.$ac_ext <<EOF
10376 #line 10377 "configure"
10377 #include "confdefs.h"
10378 /* System header to define __stub macros and hopefully few prototypes,
10379     which can conflict with char $ac_func(); below.  */
10380 #include <assert.h>
10381 /* Override any gcc2 internal prototype to avoid an error.  */
10382 /* We use char because int might match the return type of a gcc2
10383     builtin and then its argument prototype would still apply.  */
10384 char $ac_func();
10385
10386 int main() {
10387
10388 /* The GNU C library defines this for functions which it implements
10389     to always fail with ENOSYS.  Some functions are actually named
10390     something starting with __ and the normal name is an alias.  */
10391 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10392 choke me
10393 #else
10394 $ac_func();
10395 #endif
10396
10397 ; return 0; }
10398 EOF
10399 if { (eval echo configure:10400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10400   rm -rf conftest*
10401   eval "ac_cv_func_$ac_func=yes"
10402 else
10403   echo "configure: failed program was:" >&5
10404   cat conftest.$ac_ext >&5
10405   rm -rf conftest*
10406   eval "ac_cv_func_$ac_func=no"
10407 fi
10408 rm -f conftest*
10409 fi
10410
10411 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10412   echo "$ac_t""yes" 1>&6
10413     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10414   cat >> confdefs.h <<EOF
10415 #define $ac_tr_func 1
10416 EOF
10417  
10418 else
10419   echo "$ac_t""no" 1>&6
10420 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
10421 fi
10422 done
10423
10424
10425
10426 # Check Configuration
10427
10428 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
10429 echo "configure:10430: checking declaration of sys_errlist" >&5
10430 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
10431   echo $ac_n "(cached) $ac_c" 1>&6
10432 else
10433   
10434         cat > conftest.$ac_ext <<EOF
10435 #line 10436 "configure"
10436 #include "confdefs.h"
10437
10438 #include <stdio.h>
10439 #include <sys/types.h>
10440 #include <errno.h> 
10441 int main() {
10442 char *c = (char *) *sys_errlist
10443 ; return 0; }
10444 EOF
10445 if { (eval echo configure:10446: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10446   rm -rf conftest*
10447   ol_cv_dcl_sys_errlist=yes
10448 else
10449   echo "configure: failed program was:" >&5
10450   cat conftest.$ac_ext >&5
10451   rm -rf conftest*
10452   ol_cv_dcl_sys_errlist=no
10453 fi
10454 rm -f conftest*
10455 fi
10456
10457 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
10458 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
10459 if test $ol_cv_dcl_sys_errlist = no ; then
10460         cat >> confdefs.h <<\EOF
10461 #define DECL_SYS_ERRLIST 1
10462 EOF
10463
10464         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
10465 echo "configure:10466: checking existence of sys_errlist" >&5
10466         if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
10467   echo $ac_n "(cached) $ac_c" 1>&6
10468 else
10469   
10470                 cat > conftest.$ac_ext <<EOF
10471 #line 10472 "configure"
10472 #include "confdefs.h"
10473 #include <errno.h>
10474 int main() {
10475 char *c = (char *) *sys_errlist
10476 ; return 0; }
10477 EOF
10478 if { (eval echo configure:10479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10479   rm -rf conftest*
10480   ol_cv_have_sys_errlist=yes
10481 else
10482   echo "configure: failed program was:" >&5
10483   cat conftest.$ac_ext >&5
10484   rm -rf conftest*
10485   ol_cv_have_sys_errlist=no
10486 fi
10487 rm -f conftest*
10488 fi
10489
10490         echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
10491         if test $ol_cv_have_sys_errlist = yes ; then
10492                 cat >> confdefs.h <<\EOF
10493 #define HAVE_SYS_ERRLIST 1
10494 EOF
10495
10496         fi
10497 fi
10498
10499
10500
10501 echo $ac_n "checking strdup declaration""... $ac_c" 1>&6
10502 echo "configure:10503: checking strdup declaration" >&5
10503 if eval "test \"`echo '$''{'ol_cv_dcl_strdup'+set}'`\" = set"; then
10504   echo $ac_n "(cached) $ac_c" 1>&6
10505 else
10506   
10507         cat > conftest.$ac_ext <<EOF
10508 #line 10509 "configure"
10509 #include "confdefs.h"
10510
10511 #include <string.h> 
10512 int main() {
10513 extern char *strdup();
10514 ; return 0; }
10515 EOF
10516 if { (eval echo configure:10517: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10517   rm -rf conftest*
10518   ol_cv_dcl_strdup=yes
10519 else
10520   echo "configure: failed program was:" >&5
10521   cat conftest.$ac_ext >&5
10522   rm -rf conftest*
10523   ol_cv_dcl_strdup=no
10524 fi
10525 rm -f conftest*
10526 fi
10527
10528 echo "$ac_t""$ol_cv_dcl_strdup" 1>&6
10529 if test $ol_cv_dcl_strdup = yes ; then
10530         cat >> confdefs.h <<\EOF
10531 #define DECL_STRDUP 1
10532 EOF
10533
10534 fi
10535
10536
10537
10538 if test "$ol_enable_debug" != no ; then
10539         cat >> confdefs.h <<\EOF
10540 #define LDAP_DEBUG 1
10541 EOF
10542
10543 fi
10544 if test "$ol_enable_syslog" = yes ; then
10545         cat >> confdefs.h <<\EOF
10546 #define LDAP_SYSLOG 1
10547 EOF
10548
10549 fi
10550 if test "$ol_enable_libui" = yes ; then
10551         cat >> confdefs.h <<\EOF
10552 #define LDAP_LIBUI 1
10553 EOF
10554
10555 fi
10556 if test "$ol_enable_cache" = no ; then
10557         cat >> confdefs.h <<\EOF
10558 #define LDAP_NOCACHE 1
10559 EOF
10560
10561 fi
10562 if test "$ol_enable_dns" != no ; then
10563         cat >> confdefs.h <<\EOF
10564 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS LDAP_VENDOR_VERSION
10565 EOF
10566
10567 fi
10568 if test "$ol_enable_proctitle" != no ; then
10569         cat >> confdefs.h <<\EOF
10570 #define LDAP_PROCTITLE 1
10571 EOF
10572
10573 fi
10574 if test "$ol_enable_referrals" != no ; then
10575         cat >> confdefs.h <<\EOF
10576 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
10577 EOF
10578
10579 fi
10580 if test "$ol_enable_cldap" != no ; then
10581         cat >> confdefs.h <<\EOF
10582 #define LDAP_CONNECTIONLESS 1
10583 EOF
10584
10585 fi
10586
10587 if test "$ol_enable_aclgroups" != no ; then
10588         cat >> confdefs.h <<\EOF
10589 #define SLAPD_ACLGROUPS 1
10590 EOF
10591
10592 fi
10593 if test "$ol_enable_crypt" != no ; then
10594         cat >> confdefs.h <<\EOF
10595 #define SLAPD_CRYPT 1
10596 EOF
10597
10598 fi
10599 if test "$ol_enable_cleartext" != no ; then
10600         cat >> confdefs.h <<\EOF
10601 #define SLAPD_CLEARTEXT 1
10602 EOF
10603
10604 fi
10605 if test "$ol_enable_phonetic" != no ; then
10606         cat >> confdefs.h <<\EOF
10607 #define SLAPD_PHONETIC 1
10608 EOF
10609
10610 fi
10611 if test "$ol_enable_rlookups" != no ; then
10612         cat >> confdefs.h <<\EOF
10613 #define SLAPD_RLOOKUPS 1
10614 EOF
10615
10616 fi
10617
10618 if test "$ol_link_bdb2" != no ; then
10619         cat >> confdefs.h <<\EOF
10620 #define SLAPD_BDB2 1
10621 EOF
10622
10623         BUILD_SLAPD=yes
10624         BUILD_BDB2=yes
10625 fi
10626
10627 if test "$ol_link_ldbm" != no ; then
10628         cat >> confdefs.h <<\EOF
10629 #define SLAPD_LDBM 1
10630 EOF
10631
10632         BUILD_SLAPD=yes
10633         BUILD_LDBM=yes
10634 fi
10635
10636 if test "$ol_enable_passwd" != no ; then
10637         cat >> confdefs.h <<\EOF
10638 #define SLAPD_PASSWD 1
10639 EOF
10640
10641         BUILD_SLAPD=yes
10642         BUILD_PASSWD=yes
10643 fi
10644
10645 if test "$ol_enable_perl" != no ; then
10646         cat >> confdefs.h <<\EOF
10647 #define SLAPD_PERL 1
10648 EOF
10649
10650         BUILD_SLAPD=yes
10651         BUILD_PERL=yes
10652 fi
10653
10654 if test "$ol_enable_shell" != no ; then
10655         cat >> confdefs.h <<\EOF
10656 #define SLAPD_SHELL 1
10657 EOF
10658
10659         BUILD_SLAPD=yes
10660         BUILD_SHELL=yes
10661 fi
10662
10663 if test "$ol_enable_tcl" != no ; then
10664         cat >> confdefs.h <<\EOF
10665 #define SLAPD_TCL 1
10666 EOF
10667
10668         BUILD_SLAPD=yes
10669         BUILD_TCL=yes
10670 fi
10671
10672 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
10673         $BUILD_SLAPD = yes ; then
10674         BUILD_SLURPD=yes
10675 fi
10676
10677 if test "$ol_link_isode" != no ; then
10678         BUILD_LDAPD=yes
10679 fi
10680
10681
10682
10683
10684   
10685   
10686   
10687   
10688   
10689   
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709 trap '' 1 2 15
10710 cat > confcache <<\EOF
10711 # This file is a shell script that caches the results of configure
10712 # tests run on this system so they can be shared between configure
10713 # scripts and configure runs.  It is not useful on other systems.
10714 # If it contains results you don't want to keep, you may remove or edit it.
10715 #
10716 # By default, configure uses ./config.cache as the cache file,
10717 # creating it if it does not exist already.  You can give configure
10718 # the --cache-file=FILE option to use a different cache file; that is
10719 # what configure does when it calls configure scripts in
10720 # subdirectories, so they share the cache.
10721 # Giving --cache-file=/dev/null disables caching, for debugging configure.
10722 # config.status only pays attention to the cache file if you give it the
10723 # --recheck option to rerun configure.
10724 #
10725 EOF
10726 # The following way of writing the cache mishandles newlines in values,
10727 # but we know of no workaround that is simple, portable, and efficient.
10728 # So, don't put newlines in cache variables' values.
10729 # Ultrix sh set writes to stderr and can't be redirected directly,
10730 # and sets the high bit in the cache file unless we assign to the vars.
10731 (set) 2>&1 |
10732   case `(ac_space=' '; set | grep ac_space) 2>&1` in
10733   *ac_space=\ *)
10734     # `set' does not quote correctly, so add quotes (double-quote substitution
10735     # turns \\\\ into \\, and sed turns \\ into \).
10736     sed -n \
10737       -e "s/'/'\\\\''/g" \
10738       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
10739     ;;
10740   *)
10741     # `set' quotes correctly as required by POSIX, so do not add quotes.
10742     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
10743     ;;
10744   esac >> confcache
10745 if cmp -s $cache_file confcache; then
10746   :
10747 else
10748   if test -w $cache_file; then
10749     echo "updating cache $cache_file"
10750     cat confcache > $cache_file
10751   else
10752     echo "not updating unwritable cache $cache_file"
10753   fi
10754 fi
10755 rm -f confcache
10756
10757 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
10758
10759 test "x$prefix" = xNONE && prefix=$ac_default_prefix
10760 # Let make expand exec_prefix.
10761 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
10762
10763 # Any assignment to VPATH causes Sun make to only execute
10764 # the first set of double-colon rules, so remove it if not needed.
10765 # If there is a colon in the path, we need to keep it.
10766 if test "x$srcdir" = x.; then
10767   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
10768 fi
10769
10770 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
10771
10772 DEFS=-DHAVE_CONFIG_H
10773
10774 # Without the "./", some shells look in PATH for config.status.
10775 : ${CONFIG_STATUS=./config.status}
10776
10777 echo creating $CONFIG_STATUS
10778 rm -f $CONFIG_STATUS
10779 cat > $CONFIG_STATUS <<EOF
10780 #! /bin/sh
10781 # Generated automatically by configure.
10782 # Run this file to recreate the current configuration.
10783 # This directory was configured as follows,
10784 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
10785 #
10786 # $0 $ac_configure_args
10787 #
10788 # Compiler output produced by configure, useful for debugging
10789 # configure, is in ./config.log if it exists.
10790
10791 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
10792 for ac_option
10793 do
10794   case "\$ac_option" in
10795   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
10796     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
10797     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
10798   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
10799     echo "$CONFIG_STATUS generated by autoconf version 2.13"
10800     exit 0 ;;
10801   -help | --help | --hel | --he | --h)
10802     echo "\$ac_cs_usage"; exit 0 ;;
10803   *) echo "\$ac_cs_usage"; exit 1 ;;
10804   esac
10805 done
10806
10807 ac_given_srcdir=$srcdir
10808 ac_given_INSTALL="$INSTALL"
10809
10810 trap 'rm -fr `echo "\
10811 Makefile:build/top.mk:Makefile.in:build/dir.mk \
10812 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
10813 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
10814 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
10815 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
10816 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
10817 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
10818 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
10819 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
10820 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
10821 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
10822 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
10823 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
10824 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
10825 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
10826 include/Makefile:build/top.mk:include/Makefile.in \
10827 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
10828 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
10829 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
10830 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
10831 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
10832 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
10833 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
10834 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
10835 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
10836 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
10837 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
10838 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
10839 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
10840 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
10841 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
10842 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
10843 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
10844 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
10845 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
10846 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
10847 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
10848 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
10849 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
10850 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
10851 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
10852  include/portable.h include/ldap_features.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
10853 EOF
10854 cat >> $CONFIG_STATUS <<EOF
10855
10856 # Protect against being on the right side of a sed subst in config.status.
10857 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
10858  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
10859 $ac_vpsub
10860 $extrasub
10861 s%@SHELL@%$SHELL%g
10862 s%@CFLAGS@%$CFLAGS%g
10863 s%@CPPFLAGS@%$CPPFLAGS%g
10864 s%@CXXFLAGS@%$CXXFLAGS%g
10865 s%@FFLAGS@%$FFLAGS%g
10866 s%@DEFS@%$DEFS%g
10867 s%@LDFLAGS@%$LDFLAGS%g
10868 s%@LIBS@%$LIBS%g
10869 s%@exec_prefix@%$exec_prefix%g
10870 s%@prefix@%$prefix%g
10871 s%@program_transform_name@%$program_transform_name%g
10872 s%@bindir@%$bindir%g
10873 s%@sbindir@%$sbindir%g
10874 s%@libexecdir@%$libexecdir%g
10875 s%@datadir@%$datadir%g
10876 s%@sysconfdir@%$sysconfdir%g
10877 s%@sharedstatedir@%$sharedstatedir%g
10878 s%@localstatedir@%$localstatedir%g
10879 s%@libdir@%$libdir%g
10880 s%@includedir@%$includedir%g
10881 s%@oldincludedir@%$oldincludedir%g
10882 s%@infodir@%$infodir%g
10883 s%@mandir@%$mandir%g
10884 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
10885 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
10886 s%@INSTALL_DATA@%$INSTALL_DATA%g
10887 s%@PACKAGE@%$PACKAGE%g
10888 s%@VERSION@%$VERSION%g
10889 s%@ACLOCAL@%$ACLOCAL%g
10890 s%@AUTOCONF@%$AUTOCONF%g
10891 s%@AUTOMAKE@%$AUTOMAKE%g
10892 s%@AUTOHEADER@%$AUTOHEADER%g
10893 s%@MAKEINFO@%$MAKEINFO%g
10894 s%@SET_MAKE@%$SET_MAKE%g
10895 s%@top_builddir@%$top_builddir%g
10896 s%@ldap_subdir@%$ldap_subdir%g
10897 s%@host@%$host%g
10898 s%@host_alias@%$host_alias%g
10899 s%@host_cpu@%$host_cpu%g
10900 s%@host_vendor@%$host_vendor%g
10901 s%@host_os@%$host_os%g
10902 s%@RANLIB@%$RANLIB%g
10903 s%@CC@%$CC%g
10904 s%@LD@%$LD%g
10905 s%@NM@%$NM%g
10906 s%@LN_S@%$LN_S%g
10907 s%@LIBTOOL@%$LIBTOOL%g
10908 s%@AWK@%$AWK%g
10909 s%@LN_H@%$LN_H%g
10910 s%@SENDMAIL@%$SENDMAIL%g
10911 s%@EDITOR@%$EDITOR%g
10912 s%@FINGER@%$FINGER%g
10913 s%@PERLBIN@%$PERLBIN%g
10914 s%@CPP@%$CPP%g
10915 s%@EXEEXT@%$EXEEXT%g
10916 s%@OBJEXT@%$OBJEXT%g
10917 s%@PEPSY@%$PEPSY%g
10918 s%@LIBOBJS@%$LIBOBJS%g
10919 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
10920 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
10921 s%@BUILD_BDB2@%$BUILD_BDB2%g
10922 s%@BUILD_LDBM@%$BUILD_LDBM%g
10923 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
10924 s%@BUILD_PERL@%$BUILD_PERL%g
10925 s%@BUILD_SHELL@%$BUILD_SHELL%g
10926 s%@BUILD_TCL@%$BUILD_TCL%g
10927 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
10928 s%@LDAP_LIBS@%$LDAP_LIBS%g
10929 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
10930 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
10931 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
10932 s%@LDBM_LIBS@%$LDBM_LIBS%g
10933 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
10934 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
10935 s%@SLAPD_PERL_CPPFLAGS@%$SLAPD_PERL_CPPFLAGS%g
10936 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
10937 s%@KRB_LIBS@%$KRB_LIBS%g
10938 s%@READLINE_LIBS@%$READLINE_LIBS%g
10939 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
10940 s%@TLS_LIBS@%$TLS_LIBS%g
10941
10942 CEOF
10943 EOF
10944
10945 cat >> $CONFIG_STATUS <<\EOF
10946
10947 # Split the substitutions into bite-sized pieces for seds with
10948 # small command number limits, like on Digital OSF/1 and HP-UX.
10949 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
10950 ac_file=1 # Number of current file.
10951 ac_beg=1 # First line for current file.
10952 ac_end=$ac_max_sed_cmds # Line after last line for current file.
10953 ac_more_lines=:
10954 ac_sed_cmds=""
10955 while $ac_more_lines; do
10956   if test $ac_beg -gt 1; then
10957     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
10958   else
10959     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
10960   fi
10961   if test ! -s conftest.s$ac_file; then
10962     ac_more_lines=false
10963     rm -f conftest.s$ac_file
10964   else
10965     if test -z "$ac_sed_cmds"; then
10966       ac_sed_cmds="sed -f conftest.s$ac_file"
10967     else
10968       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
10969     fi
10970     ac_file=`expr $ac_file + 1`
10971     ac_beg=$ac_end
10972     ac_end=`expr $ac_end + $ac_max_sed_cmds`
10973   fi
10974 done
10975 if test -z "$ac_sed_cmds"; then
10976   ac_sed_cmds=cat
10977 fi
10978 EOF
10979
10980 cat >> $CONFIG_STATUS <<EOF
10981
10982 CONFIG_FILES=\${CONFIG_FILES-"\
10983 Makefile:build/top.mk:Makefile.in:build/dir.mk \
10984 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
10985 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
10986 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
10987 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
10988 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
10989 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
10990 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
10991 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
10992 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
10993 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
10994 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
10995 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
10996 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
10997 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
10998 include/Makefile:build/top.mk:include/Makefile.in \
10999 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
11000 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
11001 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11002 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11003 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
11004 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
11005 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
11006 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
11007 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
11008 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
11009 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
11010 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
11011 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
11012 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
11013 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
11014 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
11015 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
11016 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
11017 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
11018 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
11019 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
11020 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
11021 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
11022 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
11023 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
11024 "}
11025 EOF
11026 cat >> $CONFIG_STATUS <<\EOF
11027 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
11028   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
11029   case "$ac_file" in
11030   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
11031        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
11032   *) ac_file_in="${ac_file}.in" ;;
11033   esac
11034
11035   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
11036
11037   # Remove last slash and all that follows it.  Not all systems have dirname.
11038   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
11039   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
11040     # The file is in a subdirectory.
11041     test ! -d "$ac_dir" && mkdir "$ac_dir"
11042     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
11043     # A "../" for each directory in $ac_dir_suffix.
11044     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
11045   else
11046     ac_dir_suffix= ac_dots=
11047   fi
11048
11049   case "$ac_given_srcdir" in
11050   .)  srcdir=.
11051       if test -z "$ac_dots"; then top_srcdir=.
11052       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
11053   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
11054   *) # Relative path.
11055     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
11056     top_srcdir="$ac_dots$ac_given_srcdir" ;;
11057   esac
11058
11059   case "$ac_given_INSTALL" in
11060   [/$]*) INSTALL="$ac_given_INSTALL" ;;
11061   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
11062   esac
11063
11064   echo creating "$ac_file"
11065   rm -f "$ac_file"
11066   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
11067   case "$ac_file" in
11068   *Makefile*) ac_comsub="1i\\
11069 # $configure_input" ;;
11070   *) ac_comsub= ;;
11071   esac
11072
11073   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
11074   sed -e "$ac_comsub
11075 s%@configure_input@%$configure_input%g
11076 s%@srcdir@%$srcdir%g
11077 s%@top_srcdir@%$top_srcdir%g
11078 s%@INSTALL@%$INSTALL%g
11079 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
11080 fi; done
11081 rm -f conftest.s*
11082
11083 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
11084 # NAME is the cpp macro being defined and VALUE is the value it is being given.
11085 #
11086 # ac_d sets the value in "#define NAME VALUE" lines.
11087 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
11088 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
11089 ac_dC='\3'
11090 ac_dD='%g'
11091 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
11092 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
11093 ac_uB='\([      ]\)%\1#\2define\3'
11094 ac_uC=' '
11095 ac_uD='\4%g'
11096 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
11097 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
11098 ac_eB='$%\1#\2define\3'
11099 ac_eC=' '
11100 ac_eD='%g'
11101
11102 if test "${CONFIG_HEADERS+set}" != set; then
11103 EOF
11104 cat >> $CONFIG_STATUS <<EOF
11105   CONFIG_HEADERS="include/portable.h include/ldap_features.h"
11106 EOF
11107 cat >> $CONFIG_STATUS <<\EOF
11108 fi
11109 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
11110   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
11111   case "$ac_file" in
11112   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
11113        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
11114   *) ac_file_in="${ac_file}.in" ;;
11115   esac
11116
11117   echo creating $ac_file
11118
11119   rm -f conftest.frag conftest.in conftest.out
11120   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
11121   cat $ac_file_inputs > conftest.in
11122
11123 EOF
11124
11125 # Transform confdefs.h into a sed script conftest.vals that substitutes
11126 # the proper values into config.h.in to produce config.h.  And first:
11127 # Protect against being on the right side of a sed subst in config.status.
11128 # Protect against being in an unquoted here document in config.status.
11129 rm -f conftest.vals
11130 cat > conftest.hdr <<\EOF
11131 s/[\\&%]/\\&/g
11132 s%[\\$`]%\\&%g
11133 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
11134 s%ac_d%ac_u%gp
11135 s%ac_u%ac_e%gp
11136 EOF
11137 sed -n -f conftest.hdr confdefs.h > conftest.vals
11138 rm -f conftest.hdr
11139
11140 # This sed command replaces #undef with comments.  This is necessary, for
11141 # example, in the case of _POSIX_SOURCE, which is predefined and required
11142 # on some systems where configure will not decide to define it.
11143 cat >> conftest.vals <<\EOF
11144 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
11145 EOF
11146
11147 # Break up conftest.vals because some shells have a limit on
11148 # the size of here documents, and old seds have small limits too.
11149
11150 rm -f conftest.tail
11151 while :
11152 do
11153   ac_lines=`grep -c . conftest.vals`
11154   # grep -c gives empty output for an empty file on some AIX systems.
11155   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
11156   # Write a limited-size here document to conftest.frag.
11157   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
11158   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
11159   echo 'CEOF
11160   sed -f conftest.frag conftest.in > conftest.out
11161   rm -f conftest.in
11162   mv conftest.out conftest.in
11163 ' >> $CONFIG_STATUS
11164   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
11165   rm -f conftest.vals
11166   mv conftest.tail conftest.vals
11167 done
11168 rm -f conftest.vals
11169
11170 cat >> $CONFIG_STATUS <<\EOF
11171   rm -f conftest.frag conftest.h
11172   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
11173   cat conftest.in >> conftest.h
11174   rm -f conftest.in
11175   if cmp -s $ac_file conftest.h 2>/dev/null; then
11176     echo "$ac_file is unchanged"
11177     rm -f conftest.h
11178   else
11179     # Remove last slash and all that follows it.  Not all systems have dirname.
11180       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
11181       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
11182       # The file is in a subdirectory.
11183       test ! -d "$ac_dir" && mkdir "$ac_dir"
11184     fi
11185     rm -f $ac_file
11186     mv conftest.h $ac_file
11187   fi
11188 fi; done
11189
11190 EOF
11191 cat >> $CONFIG_STATUS <<EOF
11192
11193 EOF
11194 cat >> $CONFIG_STATUS <<\EOF
11195
11196 date > stamp-h
11197 echo Please \"make depend\" to build dependencies
11198
11199 exit 0
11200 EOF
11201 chmod +x $CONFIG_STATUS
11202 rm -fr confdefs* $ac_clean_files
11203 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
11204