]> git.sur5r.net Git - openldap/blob - configure
17193c430386ca0fc49a0d9a965572992f496e1b
[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       use Kerberos (auto)"
35 ac_help="$ac_help
36   --with-threads        use threads (auto)"
37 ac_help="$ac_help
38   --with-yielding-select        with implicitly yielding select (auto)"
39 ac_help="$ac_help
40   --with-tls  with TLS/SSL support (auto)"
41 ac_help="$ac_help
42 LDAPD Options:"
43 ac_help="$ac_help
44   --enable-ldapd        enable building ldapd (no)"
45 ac_help="$ac_help
46 SLAPD Options:"
47 ac_help="$ac_help
48   --enable-slapd        enable building slapd (yes)"
49 ac_help="$ac_help
50     --enable-aclgroups  enable ACL group support (auto)"
51 ac_help="$ac_help
52     --enable-cleartext  enable cleartext passwords (yes)"
53 ac_help="$ac_help
54     --enable-crypt      enable crypt(3) passwords (auto)"
55 ac_help="$ac_help
56     --enable-wrappers   enable tcp wrapper support (no)"
57 ac_help="$ac_help
58     --enable-phonetic   enable phonetic/soundex (no)"
59 ac_help="$ac_help
60     --enable-rlookups   enable reverse lookups (auto)"
61 ac_help="$ac_help
62     --enable-bdb2       enable bdb2 backend (no)"
63 ac_help="$ac_help
64     --enable-ldbm       enable ldbm backend (yes)"
65 ac_help="$ac_help
66       --with-ldbm-api   use LDBM API (auto)"
67 ac_help="$ac_help
68       --with-ldbm-type  use LDBM type (auto)"
69 ac_help="$ac_help
70     --enable-passwd     enable passwd backend (no)"
71 ac_help="$ac_help
72     --enable-perl       enable perl backend (no)"
73 ac_help="$ac_help
74     --enable-shell      enable shell backend (no)"
75 ac_help="$ac_help
76     --enable-tcl        enable tcl backend (no)"
77 ac_help="$ac_help
78 SLURPD Options:"
79 ac_help="$ac_help
80   --enable-slurpd       enable building slurpd (auto)"
81 ac_help="$ac_help
82 Library Generation & Linking Options"
83 ac_help="$ac_help
84   --enable-static         build static libraries [default=yes]
85   --enable-static=PKGS    only build shared libraries if the current package
86                           appears as an element in the PKGS list"
87 ac_help="$ac_help
88   --enable-shared         build shared libraries [default=yes]
89   --enable-shared=PKGS    only build shared libraries if the current package
90                           appears as an element in the PKGS list"
91 ac_help="$ac_help
92   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
93
94 # Initialize some variables set by options.
95 # The variables have the same names as the options, with
96 # dashes changed to underlines.
97 build=NONE
98 cache_file=./config.cache
99 exec_prefix=NONE
100 host=NONE
101 no_create=
102 nonopt=NONE
103 no_recursion=
104 prefix=NONE
105 program_prefix=NONE
106 program_suffix=NONE
107 program_transform_name=s,x,x,
108 silent=
109 site=
110 srcdir=
111 target=NONE
112 verbose=
113 x_includes=NONE
114 x_libraries=NONE
115 bindir='${exec_prefix}/bin'
116 sbindir='${exec_prefix}/sbin'
117 libexecdir='${exec_prefix}/libexec'
118 datadir='${prefix}/share'
119 sysconfdir='${prefix}/etc'
120 sharedstatedir='${prefix}/com'
121 localstatedir='${prefix}/var'
122 libdir='${exec_prefix}/lib'
123 includedir='${prefix}/include'
124 oldincludedir='/usr/include'
125 infodir='${prefix}/info'
126 mandir='${prefix}/man'
127
128 # Initialize some other variables.
129 subdirs=
130 MFLAGS= MAKEFLAGS=
131 SHELL=${CONFIG_SHELL-/bin/sh}
132 # Maximum number of lines to put in a shell here document.
133 ac_max_here_lines=12
134
135 ac_prev=
136 for ac_option
137 do
138
139   # If the previous option needs an argument, assign it.
140   if test -n "$ac_prev"; then
141     eval "$ac_prev=\$ac_option"
142     ac_prev=
143     continue
144   fi
145
146   case "$ac_option" in
147   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
148   *) ac_optarg= ;;
149   esac
150
151   # Accept the important Cygnus configure options, so we can diagnose typos.
152
153   case "$ac_option" in
154
155   -bindir | --bindir | --bindi | --bind | --bin | --bi)
156     ac_prev=bindir ;;
157   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
158     bindir="$ac_optarg" ;;
159
160   -build | --build | --buil | --bui | --bu)
161     ac_prev=build ;;
162   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
163     build="$ac_optarg" ;;
164
165   -cache-file | --cache-file | --cache-fil | --cache-fi \
166   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
167     ac_prev=cache_file ;;
168   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
169   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
170     cache_file="$ac_optarg" ;;
171
172   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
173     ac_prev=datadir ;;
174   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
175   | --da=*)
176     datadir="$ac_optarg" ;;
177
178   -disable-* | --disable-*)
179     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
180     # Reject names that are not valid shell variable names.
181     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
182       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
183     fi
184     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
185     eval "enable_${ac_feature}=no" ;;
186
187   -enable-* | --enable-*)
188     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
189     # Reject names that are not valid shell variable names.
190     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
191       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
192     fi
193     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
194     case "$ac_option" in
195       *=*) ;;
196       *) ac_optarg=yes ;;
197     esac
198     eval "enable_${ac_feature}='$ac_optarg'" ;;
199
200   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
201   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
202   | --exec | --exe | --ex)
203     ac_prev=exec_prefix ;;
204   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
205   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
206   | --exec=* | --exe=* | --ex=*)
207     exec_prefix="$ac_optarg" ;;
208
209   -gas | --gas | --ga | --g)
210     # Obsolete; use --with-gas.
211     with_gas=yes ;;
212
213   -help | --help | --hel | --he)
214     # Omit some internal or obsolete options to make the list less imposing.
215     # This message is too long to be a string in the A/UX 3.1 sh.
216     cat << EOF
217 Usage: configure [options] [host]
218 Options: [defaults in brackets after descriptions]
219 Configuration:
220   --cache-file=FILE       cache test results in FILE
221   --help                  print this message
222   --no-create             do not create output files
223   --quiet, --silent       do not print \`checking...' messages
224   --version               print the version of autoconf that created configure
225 Directory and file names:
226   --prefix=PREFIX         install architecture-independent files in PREFIX
227                           [$ac_default_prefix]
228   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
229                           [same as prefix]
230   --bindir=DIR            user executables in DIR [EPREFIX/bin]
231   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
232   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
233   --datadir=DIR           read-only architecture-independent data in DIR
234                           [PREFIX/share]
235   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
236   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
237                           [PREFIX/com]
238   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
239   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
240   --includedir=DIR        C header files in DIR [PREFIX/include]
241   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
242   --infodir=DIR           info documentation in DIR [PREFIX/info]
243   --mandir=DIR            man documentation in DIR [PREFIX/man]
244   --srcdir=DIR            find the sources in DIR [configure dir or ..]
245   --program-prefix=PREFIX prepend PREFIX to installed program names
246   --program-suffix=SUFFIX append SUFFIX to installed program names
247   --program-transform-name=PROGRAM
248                           run sed PROGRAM on installed program names
249 EOF
250     cat << EOF
251 Host type:
252   --build=BUILD           configure for building on BUILD [BUILD=HOST]
253   --host=HOST             configure for HOST [guessed]
254   --target=TARGET         configure for TARGET [TARGET=HOST]
255 Features and packages:
256   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
257   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
258   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
259   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
260   --x-includes=DIR        X include files are in DIR
261   --x-libraries=DIR       X library files are in DIR
262 EOF
263     if test -n "$ac_help"; then
264       echo "--enable and --with options recognized:$ac_help"
265     fi
266     exit 0 ;;
267
268   -host | --host | --hos | --ho)
269     ac_prev=host ;;
270   -host=* | --host=* | --hos=* | --ho=*)
271     host="$ac_optarg" ;;
272
273   -includedir | --includedir | --includedi | --included | --include \
274   | --includ | --inclu | --incl | --inc)
275     ac_prev=includedir ;;
276   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
277   | --includ=* | --inclu=* | --incl=* | --inc=*)
278     includedir="$ac_optarg" ;;
279
280   -infodir | --infodir | --infodi | --infod | --info | --inf)
281     ac_prev=infodir ;;
282   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
283     infodir="$ac_optarg" ;;
284
285   -libdir | --libdir | --libdi | --libd)
286     ac_prev=libdir ;;
287   -libdir=* | --libdir=* | --libdi=* | --libd=*)
288     libdir="$ac_optarg" ;;
289
290   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
291   | --libexe | --libex | --libe)
292     ac_prev=libexecdir ;;
293   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
294   | --libexe=* | --libex=* | --libe=*)
295     libexecdir="$ac_optarg" ;;
296
297   -localstatedir | --localstatedir | --localstatedi | --localstated \
298   | --localstate | --localstat | --localsta | --localst \
299   | --locals | --local | --loca | --loc | --lo)
300     ac_prev=localstatedir ;;
301   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
302   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
303   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
304     localstatedir="$ac_optarg" ;;
305
306   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
307     ac_prev=mandir ;;
308   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
309     mandir="$ac_optarg" ;;
310
311   -nfp | --nfp | --nf)
312     # Obsolete; use --without-fp.
313     with_fp=no ;;
314
315   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
316   | --no-cr | --no-c)
317     no_create=yes ;;
318
319   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
320   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
321     no_recursion=yes ;;
322
323   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
324   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
325   | --oldin | --oldi | --old | --ol | --o)
326     ac_prev=oldincludedir ;;
327   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
328   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
329   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
330     oldincludedir="$ac_optarg" ;;
331
332   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
333     ac_prev=prefix ;;
334   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
335     prefix="$ac_optarg" ;;
336
337   -program-prefix | --program-prefix | --program-prefi | --program-pref \
338   | --program-pre | --program-pr | --program-p)
339     ac_prev=program_prefix ;;
340   -program-prefix=* | --program-prefix=* | --program-prefi=* \
341   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
342     program_prefix="$ac_optarg" ;;
343
344   -program-suffix | --program-suffix | --program-suffi | --program-suff \
345   | --program-suf | --program-su | --program-s)
346     ac_prev=program_suffix ;;
347   -program-suffix=* | --program-suffix=* | --program-suffi=* \
348   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
349     program_suffix="$ac_optarg" ;;
350
351   -program-transform-name | --program-transform-name \
352   | --program-transform-nam | --program-transform-na \
353   | --program-transform-n | --program-transform- \
354   | --program-transform | --program-transfor \
355   | --program-transfo | --program-transf \
356   | --program-trans | --program-tran \
357   | --progr-tra | --program-tr | --program-t)
358     ac_prev=program_transform_name ;;
359   -program-transform-name=* | --program-transform-name=* \
360   | --program-transform-nam=* | --program-transform-na=* \
361   | --program-transform-n=* | --program-transform-=* \
362   | --program-transform=* | --program-transfor=* \
363   | --program-transfo=* | --program-transf=* \
364   | --program-trans=* | --program-tran=* \
365   | --progr-tra=* | --program-tr=* | --program-t=*)
366     program_transform_name="$ac_optarg" ;;
367
368   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
369   | -silent | --silent | --silen | --sile | --sil)
370     silent=yes ;;
371
372   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
373     ac_prev=sbindir ;;
374   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
375   | --sbi=* | --sb=*)
376     sbindir="$ac_optarg" ;;
377
378   -sharedstatedir | --sharedstatedir | --sharedstatedi \
379   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
380   | --sharedst | --shareds | --shared | --share | --shar \
381   | --sha | --sh)
382     ac_prev=sharedstatedir ;;
383   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
384   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
385   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
386   | --sha=* | --sh=*)
387     sharedstatedir="$ac_optarg" ;;
388
389   -site | --site | --sit)
390     ac_prev=site ;;
391   -site=* | --site=* | --sit=*)
392     site="$ac_optarg" ;;
393
394   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
395     ac_prev=srcdir ;;
396   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
397     srcdir="$ac_optarg" ;;
398
399   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
400   | --syscon | --sysco | --sysc | --sys | --sy)
401     ac_prev=sysconfdir ;;
402   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
403   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
404     sysconfdir="$ac_optarg" ;;
405
406   -target | --target | --targe | --targ | --tar | --ta | --t)
407     ac_prev=target ;;
408   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
409     target="$ac_optarg" ;;
410
411   -v | -verbose | --verbose | --verbos | --verbo | --verb)
412     verbose=yes ;;
413
414   -version | --version | --versio | --versi | --vers)
415     echo "configure generated by autoconf version 2.13"
416     exit 0 ;;
417
418   -with-* | --with-*)
419     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
420     # Reject names that are not valid shell variable names.
421     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
422       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
423     fi
424     ac_package=`echo $ac_package| sed 's/-/_/g'`
425     case "$ac_option" in
426       *=*) ;;
427       *) ac_optarg=yes ;;
428     esac
429     eval "with_${ac_package}='$ac_optarg'" ;;
430
431   -without-* | --without-*)
432     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
433     # Reject names that are not valid shell variable names.
434     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
435       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
436     fi
437     ac_package=`echo $ac_package| sed 's/-/_/g'`
438     eval "with_${ac_package}=no" ;;
439
440   --x)
441     # Obsolete; use --with-x.
442     with_x=yes ;;
443
444   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
445   | --x-incl | --x-inc | --x-in | --x-i)
446     ac_prev=x_includes ;;
447   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
448   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
449     x_includes="$ac_optarg" ;;
450
451   -x-libraries | --x-libraries | --x-librarie | --x-librari \
452   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
453     ac_prev=x_libraries ;;
454   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
455   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
456     x_libraries="$ac_optarg" ;;
457
458   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
459     ;;
460
461   *)
462     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
463       echo "configure: warning: $ac_option: invalid host type" 1>&2
464     fi
465     if test "x$nonopt" != xNONE; then
466       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
467     fi
468     nonopt="$ac_option"
469     ;;
470
471   esac
472 done
473
474 if test -n "$ac_prev"; then
475   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
476 fi
477
478 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
479
480 # File descriptor usage:
481 # 0 standard input
482 # 1 file creation
483 # 2 errors and warnings
484 # 3 some systems may open it to /dev/tty
485 # 4 used on the Kubota Titan
486 # 6 checking for... messages and results
487 # 5 compiler messages saved in config.log
488 if test "$silent" = yes; then
489   exec 6>/dev/null
490 else
491   exec 6>&1
492 fi
493 exec 5>./config.log
494
495 echo "\
496 This file contains any messages produced by compilers while
497 running configure, to aid debugging if configure makes a mistake.
498 " 1>&5
499
500 # Strip out --no-create and --no-recursion so they do not pile up.
501 # Also quote any args containing shell metacharacters.
502 ac_configure_args=
503 for ac_arg
504 do
505   case "$ac_arg" in
506   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
507   | --no-cr | --no-c) ;;
508   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
509   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
510   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
511   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
512   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
513   esac
514 done
515
516 # NLS nuisances.
517 # Only set these to C if already set.  These must not be set unconditionally
518 # because not all systems understand e.g. LANG=C (notably SCO).
519 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
520 # Non-C LC_CTYPE values break the ctype check.
521 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
522 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
523 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
524 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
525
526 # confdefs.h avoids OS command line length limits that DEFS can exceed.
527 rm -rf conftest* confdefs.h
528 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
529 echo > confdefs.h
530
531 # A filename unique to this package, relative to the directory that
532 # configure is in, which we can look for to find out if srcdir is correct.
533 ac_unique_file=include/ldap.h
534
535 # Find the source files, if location was not specified.
536 if test -z "$srcdir"; then
537   ac_srcdir_defaulted=yes
538   # Try the directory containing this script, then its parent.
539   ac_prog=$0
540   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
541   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
542   srcdir=$ac_confdir
543   if test ! -r $srcdir/$ac_unique_file; then
544     srcdir=..
545   fi
546 else
547   ac_srcdir_defaulted=no
548 fi
549 if test ! -r $srcdir/$ac_unique_file; then
550   if test "$ac_srcdir_defaulted" = yes; then
551     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
552   else
553     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
554   fi
555 fi
556 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
557
558 # Prefer explicitly selected file to automatically selected ones.
559 if test -z "$CONFIG_SITE"; then
560   if test "x$prefix" != xNONE; then
561     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
562   else
563     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
564   fi
565 fi
566 for ac_site_file in $CONFIG_SITE; do
567   if test -r "$ac_site_file"; then
568     echo "loading site script $ac_site_file"
569     . "$ac_site_file"
570   fi
571 done
572
573 if test -r "$cache_file"; then
574   echo "loading cache $cache_file"
575   . $cache_file
576 else
577   echo "creating cache $cache_file"
578   > $cache_file
579 fi
580
581 ac_ext=c
582 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
583 ac_cpp='$CPP $CPPFLAGS'
584 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
585 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
586 cross_compiling=$ac_cv_prog_cc_cross
587
588 ac_exeext=
589 ac_objext=o
590 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
591   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
592   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
593     ac_n= ac_c='
594 ' ac_t='        '
595   else
596     ac_n=-n ac_c= ac_t=
597   fi
598 else
599   ac_n= ac_c='\c' ac_t=
600 fi
601
602 ac_aux_dir=
603 for ac_dir in build $srcdir/build; do
604   if test -f $ac_dir/install-sh; then
605     ac_aux_dir=$ac_dir
606     ac_install_sh="$ac_aux_dir/install-sh -c"
607     break
608   elif test -f $ac_dir/install.sh; then
609     ac_aux_dir=$ac_dir
610     ac_install_sh="$ac_aux_dir/install.sh -c"
611     break
612   fi
613 done
614 if test -z "$ac_aux_dir"; then
615   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
616 fi
617 ac_config_guess=$ac_aux_dir/config.guess
618 ac_config_sub=$ac_aux_dir/config.sub
619 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
620 # Find a good install program.  We prefer a C program (faster),
621 # so one script is as good as another.  But avoid the broken or
622 # incompatible versions:
623 # SysV /etc/install, /usr/sbin/install
624 # SunOS /usr/etc/install
625 # IRIX /sbin/install
626 # AIX /bin/install
627 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
628 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
629 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
630 # ./install, which can be erroneously created by make from ./install.sh.
631 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
632 echo "configure:633: checking for a BSD compatible install" >&5
633 if test -z "$INSTALL"; then
634 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
635   echo $ac_n "(cached) $ac_c" 1>&6
636 else
637     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
638   for ac_dir in $PATH; do
639     # Account for people who put trailing slashes in PATH elements.
640     case "$ac_dir/" in
641     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
642     *)
643       # OSF1 and SCO ODT 3.0 have their own names for install.
644       # Don't use installbsd from OSF since it installs stuff as root
645       # by default.
646       for ac_prog in ginstall scoinst install; do
647         if test -f $ac_dir/$ac_prog; then
648           if test $ac_prog = install &&
649             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
650             # AIX install.  It has an incompatible calling convention.
651             :
652           else
653             ac_cv_path_install="$ac_dir/$ac_prog -c"
654             break 2
655           fi
656         fi
657       done
658       ;;
659     esac
660   done
661   IFS="$ac_save_IFS"
662
663 fi
664   if test "${ac_cv_path_install+set}" = set; then
665     INSTALL="$ac_cv_path_install"
666   else
667     # As a last resort, use the slow shell script.  We don't cache a
668     # path for INSTALL within a source directory, because that will
669     # break other packages using the cache if that directory is
670     # removed, or if the path is relative.
671     INSTALL="$ac_install_sh"
672   fi
673 fi
674 echo "$ac_t""$INSTALL" 1>&6
675
676 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
677 # It thinks the first close brace ends the variable substitution.
678 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
679
680 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
681
682 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
683
684 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
685 echo "configure:686: checking whether build environment is sane" >&5
686 # Just in case
687 sleep 1
688 echo timestamp > conftestfile
689 # Do `set' in a subshell so we don't clobber the current shell's
690 # arguments.  Must try -L first in case configure is actually a
691 # symlink; some systems play weird games with the mod time of symlinks
692 # (eg FreeBSD returns the mod time of the symlink's containing
693 # directory).
694 if (
695    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
696    if test "$*" = "X"; then
697       # -L didn't work.
698       set X `ls -t $srcdir/configure conftestfile`
699    fi
700    if test "$*" != "X $srcdir/configure conftestfile" \
701       && test "$*" != "X conftestfile $srcdir/configure"; then
702
703       # If neither matched, then we have a broken ls.  This can happen
704       # if, for instance, CONFIG_SHELL is bash and it inherits a
705       # broken ls alias from the environment.  This has actually
706       # happened.  Such a system could not be considered "sane".
707       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
708 alias in your environment" 1>&2; exit 1; }
709    fi
710
711    test "$2" = conftestfile
712    )
713 then
714    # Ok.
715    :
716 else
717    { echo "configure: error: newly created file is older than distributed files!
718 Check your system clock" 1>&2; exit 1; }
719 fi
720 rm -f conftest*
721 echo "$ac_t""yes" 1>&6
722 if test "$program_transform_name" = s,x,x,; then
723   program_transform_name=
724 else
725   # Double any \ or $.  echo might interpret backslashes.
726   cat <<\EOF_SED > conftestsed
727 s,\\,\\\\,g; s,\$,$$,g
728 EOF_SED
729   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
730   rm -f conftestsed
731 fi
732 test "$program_prefix" != NONE &&
733   program_transform_name="s,^,${program_prefix},; $program_transform_name"
734 # Use a double $ so make ignores it.
735 test "$program_suffix" != NONE &&
736   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
737
738 # sed with no file args requires a program.
739 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
740
741 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
742 echo "configure:743: checking whether ${MAKE-make} sets \${MAKE}" >&5
743 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
744 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
745   echo $ac_n "(cached) $ac_c" 1>&6
746 else
747   cat > conftestmake <<\EOF
748 all:
749         @echo 'ac_maketemp="${MAKE}"'
750 EOF
751 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
752 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
753 if test -n "$ac_maketemp"; then
754   eval ac_cv_prog_make_${ac_make}_set=yes
755 else
756   eval ac_cv_prog_make_${ac_make}_set=no
757 fi
758 rm -f conftestmake
759 fi
760 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
761   echo "$ac_t""yes" 1>&6
762   SET_MAKE=
763 else
764   echo "$ac_t""no" 1>&6
765   SET_MAKE="MAKE=${MAKE-make}"
766 fi
767
768
769 PACKAGE=OpenLDAP
770
771 VERSION=2.0-devel
772
773 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
774   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
775 fi
776
777
778
779 missing_dir=`cd $ac_aux_dir && pwd`
780 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
781 echo "configure:782: checking for working aclocal" >&5
782 # Run test in a subshell; some versions of sh will print an error if
783 # an executable is not found, even if stderr is redirected.
784 # Redirect stdin to placate older versions of autoconf.  Sigh.
785 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
786    ACLOCAL=aclocal
787    echo "$ac_t""found" 1>&6
788 else
789    ACLOCAL="$missing_dir/missing aclocal"
790    echo "$ac_t""missing" 1>&6
791 fi
792
793 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
794 echo "configure:795: checking for working autoconf" >&5
795 # Run test in a subshell; some versions of sh will print an error if
796 # an executable is not found, even if stderr is redirected.
797 # Redirect stdin to placate older versions of autoconf.  Sigh.
798 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
799    AUTOCONF=autoconf
800    echo "$ac_t""found" 1>&6
801 else
802    AUTOCONF="$missing_dir/missing autoconf"
803    echo "$ac_t""missing" 1>&6
804 fi
805
806 echo $ac_n "checking for working automake""... $ac_c" 1>&6
807 echo "configure:808: checking for working automake" >&5
808 # Run test in a subshell; some versions of sh will print an error if
809 # an executable is not found, even if stderr is redirected.
810 # Redirect stdin to placate older versions of autoconf.  Sigh.
811 if (automake --version) < /dev/null > /dev/null 2>&1; then
812    AUTOMAKE=automake
813    echo "$ac_t""found" 1>&6
814 else
815    AUTOMAKE="$missing_dir/missing automake"
816    echo "$ac_t""missing" 1>&6
817 fi
818
819 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
820 echo "configure:821: checking for working autoheader" >&5
821 # Run test in a subshell; some versions of sh will print an error if
822 # an executable is not found, even if stderr is redirected.
823 # Redirect stdin to placate older versions of autoconf.  Sigh.
824 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
825    AUTOHEADER=autoheader
826    echo "$ac_t""found" 1>&6
827 else
828    AUTOHEADER="$missing_dir/missing autoheader"
829    echo "$ac_t""missing" 1>&6
830 fi
831
832 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
833 echo "configure:834: checking for working makeinfo" >&5
834 # Run test in a subshell; some versions of sh will print an error if
835 # an executable is not found, even if stderr is redirected.
836 # Redirect stdin to placate older versions of autoconf.  Sigh.
837 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
838    MAKEINFO=makeinfo
839    echo "$ac_t""found" 1>&6
840 else
841    MAKEINFO="$missing_dir/missing makeinfo"
842    echo "$ac_t""missing" 1>&6
843 fi
844
845
846
847
848 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
849 echo "configure:850: checking configure arguments" >&5
850
851
852 top_builddir=`pwd`
853
854 ldap_subdir="openldap"
855
856 # Check whether --with-subdir or --without-subdir was given.
857 if test "${with_subdir+set}" = set; then
858   withval="$with_subdir"
859   
860         if test "$withval" = "no"; then
861                 ldap_subdir=""
862         elif test "$withval" != "yes"; then
863                 ldap_subdir="$withval"
864         fi
865
866 fi
867
868
869 # OpenLDAP --enable-debug
870         # Check whether --enable-debug or --disable-debug was given.
871 if test "${enable_debug+set}" = set; then
872   enableval="$enable_debug"
873   
874         ol_arg=invalid
875         for ol_val in auto yes no ; do
876                 if test "$enableval" = "$ol_val" ; then
877                         ol_arg="$ol_val"
878                 fi
879         done
880         if test "$ol_arg" = "invalid" ; then
881                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
882         fi
883         ol_enable_debug="$ol_arg"
884
885 else
886         ol_enable_debug="yes"
887 fi
888 # end --enable-debug
889 ol_enable_syslog=no
890 # OpenLDAP --enable-proctitle
891         # Check whether --enable-proctitle or --disable-proctitle was given.
892 if test "${enable_proctitle+set}" = set; then
893   enableval="$enable_proctitle"
894   
895         ol_arg=invalid
896         for ol_val in auto yes no ; do
897                 if test "$enableval" = "$ol_val" ; then
898                         ol_arg="$ol_val"
899                 fi
900         done
901         if test "$ol_arg" = "invalid" ; then
902                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
903         fi
904         ol_enable_proctitle="$ol_arg"
905
906 else
907         ol_enable_proctitle="yes"
908 fi
909 # end --enable-proctitle
910 # OpenLDAP --enable-cache
911         # Check whether --enable-cache or --disable-cache was given.
912 if test "${enable_cache+set}" = set; then
913   enableval="$enable_cache"
914   
915         ol_arg=invalid
916         for ol_val in auto yes no ; do
917                 if test "$enableval" = "$ol_val" ; then
918                         ol_arg="$ol_val"
919                 fi
920         done
921         if test "$ol_arg" = "invalid" ; then
922                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
923         fi
924         ol_enable_cache="$ol_arg"
925
926 else
927         ol_enable_cache="yes"
928 fi
929 # end --enable-cache
930 # OpenLDAP --enable-dns
931         # Check whether --enable-dns or --disable-dns was given.
932 if test "${enable_dns+set}" = set; then
933   enableval="$enable_dns"
934   
935         ol_arg=invalid
936         for ol_val in auto yes no ; do
937                 if test "$enableval" = "$ol_val" ; then
938                         ol_arg="$ol_val"
939                 fi
940         done
941         if test "$ol_arg" = "invalid" ; then
942                 { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; }
943         fi
944         ol_enable_dns="$ol_arg"
945
946 else
947         ol_enable_dns="no"
948 fi
949 # end --enable-dns
950 # OpenLDAP --enable-referrals
951         # Check whether --enable-referrals or --disable-referrals was given.
952 if test "${enable_referrals+set}" = set; then
953   enableval="$enable_referrals"
954   
955         ol_arg=invalid
956         for ol_val in auto yes no ; do
957                 if test "$enableval" = "$ol_val" ; then
958                         ol_arg="$ol_val"
959                 fi
960         done
961         if test "$ol_arg" = "invalid" ; then
962                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
963         fi
964         ol_enable_referrals="$ol_arg"
965
966 else
967         ol_enable_referrals="yes"
968 fi
969 # end --enable-referrals
970 # OpenLDAP --enable-cldap
971         # Check whether --enable-cldap or --disable-cldap was given.
972 if test "${enable_cldap+set}" = set; then
973   enableval="$enable_cldap"
974   
975         ol_arg=invalid
976         for ol_val in auto yes no ; do
977                 if test "$enableval" = "$ol_val" ; then
978                         ol_arg="$ol_val"
979                 fi
980         done
981         if test "$ol_arg" = "invalid" ; then
982                 { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; }
983         fi
984         ol_enable_cldap="$ol_arg"
985
986 else
987         ol_enable_cldap="no"
988 fi
989 # end --enable-cldap
990 # OpenLDAP --enable-x_compile
991         # Check whether --enable-x_compile or --disable-x_compile was given.
992 if test "${enable_x_compile+set}" = set; then
993   enableval="$enable_x_compile"
994   
995         ol_arg=invalid
996         for ol_val in yes no ; do
997                 if test "$enableval" = "$ol_val" ; then
998                         ol_arg="$ol_val"
999                 fi
1000         done
1001         if test "$ol_arg" = "invalid" ; then
1002                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1003         fi
1004         ol_enable_x_compile="$ol_arg"
1005
1006 else
1007         ol_enable_x_compile="no"
1008 fi
1009 # end --enable-x_compile
1010
1011 # OpenLDAP --enable-dmalloc
1012         # Check whether --enable-dmalloc or --disable-dmalloc was given.
1013 if test "${enable_dmalloc+set}" = set; then
1014   enableval="$enable_dmalloc"
1015   
1016         ol_arg=invalid
1017         for ol_val in auto yes no ; do
1018                 if test "$enableval" = "$ol_val" ; then
1019                         ol_arg="$ol_val"
1020                 fi
1021         done
1022         if test "$ol_arg" = "invalid" ; then
1023                 { echo "configure: error: bad value $enableval for --enable-dmalloc" 1>&2; exit 1; }
1024         fi
1025         ol_enable_dmalloc="$ol_arg"
1026
1027 else
1028         ol_enable_dmalloc="no"
1029 fi
1030 # end --enable-dmalloc
1031
1032 # OpenLDAP --with-kerberos
1033         # Check whether --with-kerberos or --without-kerberos was given.
1034 if test "${with_kerberos+set}" = set; then
1035   withval="$with_kerberos"
1036   
1037         ol_arg=invalid
1038         for ol_val in auto k5 k4 afs yes no ; do
1039                 if test "$withval" = "$ol_val" ; then
1040                         ol_arg="$ol_val"
1041                 fi
1042         done
1043         if test "$ol_arg" = "invalid" ; then
1044                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1045         fi
1046         ol_with_kerberos="$ol_arg"
1047
1048 else
1049         ol_with_kerberos="auto"
1050 fi
1051 # end --with-kerberos
1052
1053 # OpenLDAP --with-threads
1054         # Check whether --with-threads or --without-threads was given.
1055 if test "${with_threads+set}" = set; then
1056   withval="$with_threads"
1057   
1058         ol_arg=invalid
1059         for ol_val in auto posix mach lwp yes no manual  ; do
1060                 if test "$withval" = "$ol_val" ; then
1061                         ol_arg="$ol_val"
1062                 fi
1063         done
1064         if test "$ol_arg" = "invalid" ; then
1065                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1066         fi
1067         ol_with_threads="$ol_arg"
1068
1069 else
1070         ol_with_threads="auto"
1071 fi
1072 # end --with-threads
1073
1074 # OpenLDAP --with-yielding_select
1075         # Check whether --with-yielding_select or --without-yielding_select was given.
1076 if test "${with_yielding_select+set}" = set; then
1077   withval="$with_yielding_select"
1078   
1079         ol_arg=invalid
1080         for ol_val in auto yes no manual  ; do
1081                 if test "$withval" = "$ol_val" ; then
1082                         ol_arg="$ol_val"
1083                 fi
1084         done
1085         if test "$ol_arg" = "invalid" ; then
1086                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1087         fi
1088         ol_with_yielding_select="$ol_arg"
1089
1090 else
1091         ol_with_yielding_select="auto"
1092 fi
1093 # end --with-yielding_select
1094
1095 # OpenLDAP --with-tls
1096         # Check whether --with-tls or --without-tls was given.
1097 if test "${with_tls+set}" = set; then
1098   withval="$with_tls"
1099   
1100         ol_arg=invalid
1101         for ol_val in auto ssleay openssl yes no  ; do
1102                 if test "$withval" = "$ol_val" ; then
1103                         ol_arg="$ol_val"
1104                 fi
1105         done
1106         if test "$ol_arg" = "invalid" ; then
1107                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1108         fi
1109         ol_with_tls="$ol_arg"
1110
1111 else
1112         ol_with_tls="auto"
1113 fi
1114 # end --with-tls
1115
1116
1117
1118 # Check whether --with-xxldapdoptions or --without-xxldapdoptions was given.
1119 if test "${with_xxldapdoptions+set}" = set; then
1120   withval="$with_xxldapdoptions"
1121   :
1122 fi
1123
1124 # OpenLDAP --enable-ldapd
1125         # Check whether --enable-ldapd or --disable-ldapd was given.
1126 if test "${enable_ldapd+set}" = set; then
1127   enableval="$enable_ldapd"
1128   
1129         ol_arg=invalid
1130         for ol_val in auto yes no ; do
1131                 if test "$enableval" = "$ol_val" ; then
1132                         ol_arg="$ol_val"
1133                 fi
1134         done
1135         if test "$ol_arg" = "invalid" ; then
1136                 { echo "configure: error: bad value $enableval for --enable-ldapd" 1>&2; exit 1; }
1137         fi
1138         ol_enable_ldapd="$ol_arg"
1139
1140 else
1141         ol_enable_ldapd="no"
1142 fi
1143 # end --enable-ldapd
1144
1145 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1146 if test "${with_xxslapdoptions+set}" = set; then
1147   withval="$with_xxslapdoptions"
1148   :
1149 fi
1150
1151 # OpenLDAP --enable-slapd
1152         # Check whether --enable-slapd or --disable-slapd was given.
1153 if test "${enable_slapd+set}" = set; then
1154   enableval="$enable_slapd"
1155   
1156         ol_arg=invalid
1157         for ol_val in auto yes no ; do
1158                 if test "$enableval" = "$ol_val" ; then
1159                         ol_arg="$ol_val"
1160                 fi
1161         done
1162         if test "$ol_arg" = "invalid" ; then
1163                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1164         fi
1165         ol_enable_slapd="$ol_arg"
1166
1167 else
1168         ol_enable_slapd="yes"
1169 fi
1170 # end --enable-slapd
1171 # OpenLDAP --enable-aclgroups
1172         # Check whether --enable-aclgroups or --disable-aclgroups was given.
1173 if test "${enable_aclgroups+set}" = set; then
1174   enableval="$enable_aclgroups"
1175   
1176         ol_arg=invalid
1177         for ol_val in auto yes no ; do
1178                 if test "$enableval" = "$ol_val" ; then
1179                         ol_arg="$ol_val"
1180                 fi
1181         done
1182         if test "$ol_arg" = "invalid" ; then
1183                 { echo "configure: error: bad value $enableval for --enable-aclgroups" 1>&2; exit 1; }
1184         fi
1185         ol_enable_aclgroups="$ol_arg"
1186
1187 else
1188         ol_enable_aclgroups="auto"
1189 fi
1190 # end --enable-aclgroups
1191 # OpenLDAP --enable-cleartext
1192         # Check whether --enable-cleartext or --disable-cleartext was given.
1193 if test "${enable_cleartext+set}" = set; then
1194   enableval="$enable_cleartext"
1195   
1196         ol_arg=invalid
1197         for ol_val in auto yes no ; do
1198                 if test "$enableval" = "$ol_val" ; then
1199                         ol_arg="$ol_val"
1200                 fi
1201         done
1202         if test "$ol_arg" = "invalid" ; then
1203                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1204         fi
1205         ol_enable_cleartext="$ol_arg"
1206
1207 else
1208         ol_enable_cleartext="yes"
1209 fi
1210 # end --enable-cleartext
1211 # OpenLDAP --enable-crypt
1212         # Check whether --enable-crypt or --disable-crypt was given.
1213 if test "${enable_crypt+set}" = set; then
1214   enableval="$enable_crypt"
1215   
1216         ol_arg=invalid
1217         for ol_val in auto yes no ; do
1218                 if test "$enableval" = "$ol_val" ; then
1219                         ol_arg="$ol_val"
1220                 fi
1221         done
1222         if test "$ol_arg" = "invalid" ; then
1223                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1224         fi
1225         ol_enable_crypt="$ol_arg"
1226
1227 else
1228         ol_enable_crypt="auto"
1229 fi
1230 # end --enable-crypt
1231 # OpenLDAP --enable-wrappers
1232         # Check whether --enable-wrappers or --disable-wrappers was given.
1233 if test "${enable_wrappers+set}" = set; then
1234   enableval="$enable_wrappers"
1235   
1236         ol_arg=invalid
1237         for ol_val in auto yes no ; do
1238                 if test "$enableval" = "$ol_val" ; then
1239                         ol_arg="$ol_val"
1240                 fi
1241         done
1242         if test "$ol_arg" = "invalid" ; then
1243                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1244         fi
1245         ol_enable_wrappers="$ol_arg"
1246
1247 else
1248         ol_enable_wrappers="no"
1249 fi
1250 # end --enable-wrappers
1251 # OpenLDAP --enable-phonetic
1252         # Check whether --enable-phonetic or --disable-phonetic was given.
1253 if test "${enable_phonetic+set}" = set; then
1254   enableval="$enable_phonetic"
1255   
1256         ol_arg=invalid
1257         for ol_val in auto yes no ; do
1258                 if test "$enableval" = "$ol_val" ; then
1259                         ol_arg="$ol_val"
1260                 fi
1261         done
1262         if test "$ol_arg" = "invalid" ; then
1263                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1264         fi
1265         ol_enable_phonetic="$ol_arg"
1266
1267 else
1268         ol_enable_phonetic="no"
1269 fi
1270 # end --enable-phonetic
1271 # OpenLDAP --enable-rlookups
1272         # Check whether --enable-rlookups or --disable-rlookups was given.
1273 if test "${enable_rlookups+set}" = set; then
1274   enableval="$enable_rlookups"
1275   
1276         ol_arg=invalid
1277         for ol_val in auto yes no ; do
1278                 if test "$enableval" = "$ol_val" ; then
1279                         ol_arg="$ol_val"
1280                 fi
1281         done
1282         if test "$ol_arg" = "invalid" ; then
1283                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1284         fi
1285         ol_enable_rlookups="$ol_arg"
1286
1287 else
1288         ol_enable_rlookups="auto"
1289 fi
1290 # end --enable-rlookups
1291
1292 # OpenLDAP --enable-bdb2
1293         # Check whether --enable-bdb2 or --disable-bdb2 was given.
1294 if test "${enable_bdb2+set}" = set; then
1295   enableval="$enable_bdb2"
1296   
1297         ol_arg=invalid
1298         for ol_val in auto yes no ; do
1299                 if test "$enableval" = "$ol_val" ; then
1300                         ol_arg="$ol_val"
1301                 fi
1302         done
1303         if test "$ol_arg" = "invalid" ; then
1304                 { echo "configure: error: bad value $enableval for --enable-bdb2" 1>&2; exit 1; }
1305         fi
1306         ol_enable_bdb2="$ol_arg"
1307
1308 else
1309         ol_enable_bdb2="no"
1310 fi
1311 # end --enable-bdb2
1312 # OpenLDAP --enable-ldbm
1313         # Check whether --enable-ldbm or --disable-ldbm was given.
1314 if test "${enable_ldbm+set}" = set; then
1315   enableval="$enable_ldbm"
1316   
1317         ol_arg=invalid
1318         for ol_val in auto yes no ; do
1319                 if test "$enableval" = "$ol_val" ; then
1320                         ol_arg="$ol_val"
1321                 fi
1322         done
1323         if test "$ol_arg" = "invalid" ; then
1324                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1325         fi
1326         ol_enable_ldbm="$ol_arg"
1327
1328 else
1329         ol_enable_ldbm="yes"
1330 fi
1331 # end --enable-ldbm
1332 # OpenLDAP --with-ldbm_api
1333         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1334 if test "${with_ldbm_api+set}" = set; then
1335   withval="$with_ldbm_api"
1336   
1337         ol_arg=invalid
1338         for ol_val in auto db2 db gdbm ndbm manual ; do
1339                 if test "$withval" = "$ol_val" ; then
1340                         ol_arg="$ol_val"
1341                 fi
1342         done
1343         if test "$ol_arg" = "invalid" ; then
1344                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1345         fi
1346         ol_with_ldbm_api="$ol_arg"
1347
1348 else
1349         ol_with_ldbm_api="auto"
1350 fi
1351 # end --with-ldbm_api
1352
1353 # OpenLDAP --with-ldbm_type
1354         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1355 if test "${with_ldbm_type+set}" = set; then
1356   withval="$with_ldbm_type"
1357   
1358         ol_arg=invalid
1359         for ol_val in auto btree hash ; do
1360                 if test "$withval" = "$ol_val" ; then
1361                         ol_arg="$ol_val"
1362                 fi
1363         done
1364         if test "$ol_arg" = "invalid" ; then
1365                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1366         fi
1367         ol_with_ldbm_type="$ol_arg"
1368
1369 else
1370         ol_with_ldbm_type="auto"
1371 fi
1372 # end --with-ldbm_type
1373
1374
1375 # OpenLDAP --enable-passwd
1376         # Check whether --enable-passwd or --disable-passwd was given.
1377 if test "${enable_passwd+set}" = set; then
1378   enableval="$enable_passwd"
1379   
1380         ol_arg=invalid
1381         for ol_val in auto yes no ; do
1382                 if test "$enableval" = "$ol_val" ; then
1383                         ol_arg="$ol_val"
1384                 fi
1385         done
1386         if test "$ol_arg" = "invalid" ; then
1387                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1388         fi
1389         ol_enable_passwd="$ol_arg"
1390
1391 else
1392         ol_enable_passwd="no"
1393 fi
1394 # end --enable-passwd
1395 # OpenLDAP --enable-perl
1396         # Check whether --enable-perl or --disable-perl was given.
1397 if test "${enable_perl+set}" = set; then
1398   enableval="$enable_perl"
1399   
1400         ol_arg=invalid
1401         for ol_val in auto yes no ; do
1402                 if test "$enableval" = "$ol_val" ; then
1403                         ol_arg="$ol_val"
1404                 fi
1405         done
1406         if test "$ol_arg" = "invalid" ; then
1407                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
1408         fi
1409         ol_enable_perl="$ol_arg"
1410
1411 else
1412         ol_enable_perl="no"
1413 fi
1414 # end --enable-perl
1415 # OpenLDAP --enable-shell
1416         # Check whether --enable-shell or --disable-shell was given.
1417 if test "${enable_shell+set}" = set; then
1418   enableval="$enable_shell"
1419   
1420         ol_arg=invalid
1421         for ol_val in auto yes no ; do
1422                 if test "$enableval" = "$ol_val" ; then
1423                         ol_arg="$ol_val"
1424                 fi
1425         done
1426         if test "$ol_arg" = "invalid" ; then
1427                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
1428         fi
1429         ol_enable_shell="$ol_arg"
1430
1431 else
1432         ol_enable_shell="no"
1433 fi
1434 # end --enable-shell
1435 # OpenLDAP --enable-tcl
1436         # Check whether --enable-tcl or --disable-tcl was given.
1437 if test "${enable_tcl+set}" = set; then
1438   enableval="$enable_tcl"
1439   
1440         ol_arg=invalid
1441         for ol_val in auto yes no ; do
1442                 if test "$enableval" = "$ol_val" ; then
1443                         ol_arg="$ol_val"
1444                 fi
1445         done
1446         if test "$ol_arg" = "invalid" ; then
1447                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
1448         fi
1449         ol_enable_tcl="$ol_arg"
1450
1451 else
1452         ol_enable_tcl="no"
1453 fi
1454 # end --enable-tcl
1455
1456 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
1457 if test "${with_xxslurpdoptions+set}" = set; then
1458   withval="$with_xxslurpdoptions"
1459   :
1460 fi
1461
1462 # OpenLDAP --enable-slurpd
1463         # Check whether --enable-slurpd or --disable-slurpd was given.
1464 if test "${enable_slurpd+set}" = set; then
1465   enableval="$enable_slurpd"
1466   
1467         ol_arg=invalid
1468         for ol_val in auto yes no ; do
1469                 if test "$enableval" = "$ol_val" ; then
1470                         ol_arg="$ol_val"
1471                 fi
1472         done
1473         if test "$ol_arg" = "invalid" ; then
1474                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
1475         fi
1476         ol_enable_slurpd="$ol_arg"
1477
1478 else
1479         ol_enable_slurpd="auto"
1480 fi
1481 # end --enable-slurpd
1482
1483 # Check whether --with-xxliboptions or --without-xxliboptions was given.
1484 if test "${with_xxliboptions+set}" = set; then
1485   withval="$with_xxliboptions"
1486   :
1487 fi
1488
1489 # Check whether --enable-static or --disable-static was given.
1490 if test "${enable_static+set}" = set; then
1491   enableval="$enable_static"
1492   p=${PACKAGE-default}
1493 case "$enableval" in
1494 yes) enable_static=yes ;;
1495 no) enable_static=no ;;
1496 *)
1497   enable_static=no
1498   # Look at the argument we got.  We use all the common list separators.
1499   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1500   for pkg in $enableval; do
1501     if test "X$pkg" = "X$p"; then
1502       enable_static=yes
1503     fi
1504   done
1505   IFS="$ac_save_ifs"
1506   ;;
1507 esac
1508 else
1509   enable_static=yes
1510 fi
1511
1512 # Check whether --enable-shared or --disable-shared was given.
1513 if test "${enable_shared+set}" = set; then
1514   enableval="$enable_shared"
1515   p=${PACKAGE-default}
1516 case "$enableval" in
1517 yes) enable_shared=yes ;;
1518 no) enable_shared=no ;;
1519 *)
1520   enable_shared=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_shared=yes
1526     fi
1527   done
1528   IFS="$ac_save_ifs"
1529   ;;
1530 esac
1531 else
1532   enable_shared=yes
1533 fi
1534
1535
1536 # validate options
1537 if test $ol_enable_dns = yes ; then
1538         if test $ol_enable_referrals = no ; then
1539                 { echo "configure: error: DNS requires --enable-referrals" 1>&2; exit 1; }
1540         fi
1541         if test $ol_enable_referrals = auto ; then
1542                 echo "configure: warning: DNS requires referrals, adding --enable-referrals" 1>&2
1543                 ol_enable_referrals=yes
1544         fi
1545 fi
1546
1547 if test $ol_enable_slapd = no ; then
1548                 if test $ol_enable_bdb2 = yes ; then
1549                 echo "configure: warning: slapd disabled, ignoring --enable_bdb2 argument" 1>&2
1550         fi
1551         if test $ol_enable_ldbm = yes ; then
1552                 echo "configure: warning: slapd disabled, ignoring --enable_ldbm argument" 1>&2
1553         fi
1554         if test $ol_enable_passwd = yes ; then
1555                 echo "configure: warning: slapd disabled, ignoring --enable_passwd argument" 1>&2
1556         fi
1557         if test $ol_enable_perl = yes ; then
1558                 echo "configure: warning: slapd disabled, ignoring --enable_perl argument" 1>&2
1559         fi
1560         if test $ol_enable_shell = yes ; then
1561                 echo "configure: warning: slapd disabled, ignoring --enable_shell argument" 1>&2
1562         fi
1563         if test $ol_enable_tcl = yes ; then
1564                 echo "configure: warning: slapd disabled, ignoring --enable_tcl argument" 1>&2
1565         fi
1566         if test $ol_enable_aclgroups = yes ; then
1567                 echo "configure: warning: slapd disabled, ignoring --enable_aclgroups argument" 1>&2
1568         fi
1569         if test $ol_enable_wrappers = yes ; then
1570                 echo "configure: warning: slapd disabled, ignoring --enable_wrappers argument" 1>&2
1571         fi
1572         if test $ol_enable_phonetic = yes ; then
1573                 echo "configure: warning: slapd disabled, ignoring --enable_phonetic argument" 1>&2
1574         fi
1575         if test $ol_enable_rlookups = yes ; then
1576                 echo "configure: warning: slapd disabled, ignoring --enable_rlookups argument" 1>&2
1577         fi
1578         if test $ol_with_ldbm_api != auto ; then
1579                 echo "configure: warning: slapd disabled, ignoring --with_ldbm_api argument" 1>&2
1580         fi
1581         if test $ol_with_ldbm_type != auto ; then
1582                 echo "configure: warning: slapd disabled, ignoring --with_ldbm_type argument" 1>&2
1583         fi
1584         if test $ol_enable_slurpd = yes ; then
1585                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
1586         fi
1587
1588         # force settings to no
1589         ol_enable_bdb2=no
1590         ol_enable_ldbm=no
1591         ol_enable_passwd=no
1592         ol_enable_perl=no
1593         ol_enable_shell=no
1594         ol_enable_tcl=no
1595         ol_enable_aclgroups=no
1596         ol_enable_wrappers=no
1597         ol_enable_phonetic=no
1598         ol_enable_rlookups=no
1599         ol_with_ldbm_api=no
1600         ol_with_ldbm_type=no
1601         ol_enable_slurpd=no
1602
1603 elif test $ol_enable_ldbm = no ; then
1604         
1605         if test $ol_with_ldbm_api != auto ; then
1606                 echo "configure: warning: LDBM disabled, ignoring --with_ldbm_api argument" 1>&2
1607         fi
1608
1609         if test $ol_with_ldbm_type != auto ; then
1610                 echo "configure: warning: LDBM disabled, ignoring --with_ldbm_type argument" 1>&2
1611         fi
1612
1613         if test $ol_enable_bdb2 = yes ; then
1614                 { echo "configure: error: BDB2 requires --enable-ldbm" 1>&2; exit 1; }
1615         fi
1616
1617         if test $ol_enable_passwd = no -a \
1618                 $ol_enable_perl = no -a \
1619                 $ol_enable_shell = no -a \
1620                 $ol_enable_tcl = no ; then
1621                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
1622         fi
1623
1624         ol_with_ldbm_api=no
1625         ol_with_ldbm_type=no
1626
1627 elif test $ol_enable_bdb2 = yes ; then
1628         
1629         if test $ol_with_ldbm_api != auto -a \
1630                 $ol_with_ldbm_api != db2 ; then
1631                 { echo "configure: error: BDB2 requires LDBM API DB2" 1>&2; exit 1; }
1632         fi
1633
1634         ol_with_ldbm_api=db2
1635
1636 else
1637         
1638         if test $ol_enable_bdb2 != no ; then
1639                 if test $ol_with_ldbm_api != auto -a \
1640                         $ol_with_ldbm_api != db2 ; then
1641                         echo "configure: warning: BDB2 requires LDBM api db2 or auto" 1>&2
1642                         ol_enable_bdb2=no
1643                 fi
1644         fi
1645
1646         if test $ol_with_ldbm_api = gdbm -a \
1647                 $ol_with_ldbm_type = btree ; then
1648                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
1649         fi
1650         if test $ol_with_ldbm_api = ndbm -a \
1651                 $ol_with_ldbm_type = btree ; then
1652                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
1653         fi
1654 fi
1655
1656 if test $ol_enable_slurpd = yes ; then
1657                 if test $ol_with_threads = no ; then
1658                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
1659         fi
1660 fi
1661
1662 echo "$ac_t""done" 1>&6
1663
1664
1665 # Make sure we can run config.sub.
1666 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
1667 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
1668 fi
1669
1670 echo $ac_n "checking host system type""... $ac_c" 1>&6
1671 echo "configure:1672: checking host system type" >&5
1672
1673 host_alias=$host
1674 case "$host_alias" in
1675 NONE)
1676   case $nonopt in
1677   NONE)
1678     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
1679     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
1680     fi ;;
1681   *) host_alias=$nonopt ;;
1682   esac ;;
1683 esac
1684
1685 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
1686 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1687 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1688 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1689 echo "$ac_t""$host" 1>&6
1690
1691
1692 ## Initialize vars
1693 LDAP_LIBS=
1694 LDBM_LIBS=
1695 LTHREAD_LIBS=
1696 LUTIL_LIBS=
1697
1698 LDAPD_LIBS=
1699 SLAPD_LIBS=
1700 SLURPD_LIBS=
1701
1702 BUILD_LDAPD=no
1703 BUILD_SLAPD=no
1704 BUILD_SLURPD=no
1705
1706 BUILD_BDB2=no
1707 BUILD_LDBM=no
1708 BUILD_PASSWD=no
1709 BUILD_PERL=no
1710 BUILD_SHELL=no
1711 BUILD_TCL=no
1712 BUILD_THREAD=no
1713
1714 SLAPD_PERL_LDFLAGS=
1715 SLAPD_PERL_CPPFLAGS=
1716
1717 KRB_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
1788 # Extract the first word of "ranlib", so it can be a program name with args.
1789 set dummy ranlib; ac_word=$2
1790 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1791 echo "configure:1792: checking for $ac_word" >&5
1792 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1793   echo $ac_n "(cached) $ac_c" 1>&6
1794 else
1795   if test -n "$RANLIB"; then
1796   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1797 else
1798   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1799   ac_dummy="$PATH"
1800   for ac_dir in $ac_dummy; do
1801     test -z "$ac_dir" && ac_dir=.
1802     if test -f $ac_dir/$ac_word; then
1803       ac_cv_prog_RANLIB="ranlib"
1804       break
1805     fi
1806   done
1807   IFS="$ac_save_ifs"
1808   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1809 fi
1810 fi
1811 RANLIB="$ac_cv_prog_RANLIB"
1812 if test -n "$RANLIB"; then
1813   echo "$ac_t""$RANLIB" 1>&6
1814 else
1815   echo "$ac_t""no" 1>&6
1816 fi
1817
1818 # Extract the first word of "gcc", so it can be a program name with args.
1819 set dummy gcc; ac_word=$2
1820 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1821 echo "configure:1822: checking for $ac_word" >&5
1822 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1823   echo $ac_n "(cached) $ac_c" 1>&6
1824 else
1825   if test -n "$CC"; then
1826   ac_cv_prog_CC="$CC" # Let the user override the test.
1827 else
1828   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1829   ac_dummy="$PATH"
1830   for ac_dir in $ac_dummy; do
1831     test -z "$ac_dir" && ac_dir=.
1832     if test -f $ac_dir/$ac_word; then
1833       ac_cv_prog_CC="gcc"
1834       break
1835     fi
1836   done
1837   IFS="$ac_save_ifs"
1838 fi
1839 fi
1840 CC="$ac_cv_prog_CC"
1841 if test -n "$CC"; then
1842   echo "$ac_t""$CC" 1>&6
1843 else
1844   echo "$ac_t""no" 1>&6
1845 fi
1846
1847 if test -z "$CC"; then
1848   # Extract the first word of "cc", so it can be a program name with args.
1849 set dummy cc; ac_word=$2
1850 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1851 echo "configure:1852: checking for $ac_word" >&5
1852 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1853   echo $ac_n "(cached) $ac_c" 1>&6
1854 else
1855   if test -n "$CC"; then
1856   ac_cv_prog_CC="$CC" # Let the user override the test.
1857 else
1858   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1859   ac_prog_rejected=no
1860   ac_dummy="$PATH"
1861   for ac_dir in $ac_dummy; do
1862     test -z "$ac_dir" && ac_dir=.
1863     if test -f $ac_dir/$ac_word; then
1864       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1865         ac_prog_rejected=yes
1866         continue
1867       fi
1868       ac_cv_prog_CC="cc"
1869       break
1870     fi
1871   done
1872   IFS="$ac_save_ifs"
1873 if test $ac_prog_rejected = yes; then
1874   # We found a bogon in the path, so make sure we never use it.
1875   set dummy $ac_cv_prog_CC
1876   shift
1877   if test $# -gt 0; then
1878     # We chose a different compiler from the bogus one.
1879     # However, it has the same basename, so the bogon will be chosen
1880     # first if we set CC to just the basename; use the full file name.
1881     shift
1882     set dummy "$ac_dir/$ac_word" "$@"
1883     shift
1884     ac_cv_prog_CC="$@"
1885   fi
1886 fi
1887 fi
1888 fi
1889 CC="$ac_cv_prog_CC"
1890 if test -n "$CC"; then
1891   echo "$ac_t""$CC" 1>&6
1892 else
1893   echo "$ac_t""no" 1>&6
1894 fi
1895
1896   if test -z "$CC"; then
1897     case "`uname -s`" in
1898     *win32* | *WIN32*)
1899       # Extract the first word of "cl", so it can be a program name with args.
1900 set dummy cl; ac_word=$2
1901 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1902 echo "configure:1903: checking for $ac_word" >&5
1903 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1904   echo $ac_n "(cached) $ac_c" 1>&6
1905 else
1906   if test -n "$CC"; then
1907   ac_cv_prog_CC="$CC" # Let the user override the test.
1908 else
1909   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1910   ac_dummy="$PATH"
1911   for ac_dir in $ac_dummy; do
1912     test -z "$ac_dir" && ac_dir=.
1913     if test -f $ac_dir/$ac_word; then
1914       ac_cv_prog_CC="cl"
1915       break
1916     fi
1917   done
1918   IFS="$ac_save_ifs"
1919 fi
1920 fi
1921 CC="$ac_cv_prog_CC"
1922 if test -n "$CC"; then
1923   echo "$ac_t""$CC" 1>&6
1924 else
1925   echo "$ac_t""no" 1>&6
1926 fi
1927  ;;
1928     esac
1929   fi
1930   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1931 fi
1932
1933 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1934 echo "configure:1935: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1935
1936 ac_ext=c
1937 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1938 ac_cpp='$CPP $CPPFLAGS'
1939 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1940 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1941 cross_compiling=$ac_cv_prog_cc_cross
1942
1943 cat > conftest.$ac_ext << EOF
1944
1945 #line 1946 "configure"
1946 #include "confdefs.h"
1947
1948 main(){return(0);}
1949 EOF
1950 if { (eval echo configure:1951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1951   ac_cv_prog_cc_works=yes
1952   # If we can't run a trivial program, we are probably using a cross compiler.
1953   if (./conftest; exit) 2>/dev/null; then
1954     ac_cv_prog_cc_cross=no
1955   else
1956     ac_cv_prog_cc_cross=yes
1957   fi
1958 else
1959   echo "configure: failed program was:" >&5
1960   cat conftest.$ac_ext >&5
1961   ac_cv_prog_cc_works=no
1962 fi
1963 rm -fr conftest*
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 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1972 if test $ac_cv_prog_cc_works = no; then
1973   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1974 fi
1975 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1976 echo "configure:1977: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1977 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1978 cross_compiling=$ac_cv_prog_cc_cross
1979
1980 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1981 echo "configure:1982: checking whether we are using GNU C" >&5
1982 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1983   echo $ac_n "(cached) $ac_c" 1>&6
1984 else
1985   cat > conftest.c <<EOF
1986 #ifdef __GNUC__
1987   yes;
1988 #endif
1989 EOF
1990 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1991: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1991   ac_cv_prog_gcc=yes
1992 else
1993   ac_cv_prog_gcc=no
1994 fi
1995 fi
1996
1997 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1998
1999 if test $ac_cv_prog_gcc = yes; then
2000   GCC=yes
2001 else
2002   GCC=
2003 fi
2004
2005 ac_test_CFLAGS="${CFLAGS+set}"
2006 ac_save_CFLAGS="$CFLAGS"
2007 CFLAGS=
2008 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2009 echo "configure:2010: checking whether ${CC-cc} accepts -g" >&5
2010 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
2011   echo $ac_n "(cached) $ac_c" 1>&6
2012 else
2013   echo 'void f(){}' > conftest.c
2014 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2015   ac_cv_prog_cc_g=yes
2016 else
2017   ac_cv_prog_cc_g=no
2018 fi
2019 rm -f conftest*
2020
2021 fi
2022
2023 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2024 if test "$ac_test_CFLAGS" = set; then
2025   CFLAGS="$ac_save_CFLAGS"
2026 elif test $ac_cv_prog_cc_g = yes; then
2027   if test "$GCC" = yes; then
2028     CFLAGS="-g -O2"
2029   else
2030     CFLAGS="-g"
2031   fi
2032 else
2033   if test "$GCC" = yes; then
2034     CFLAGS="-O2"
2035   else
2036     CFLAGS=
2037   fi
2038 fi
2039
2040 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2041 if test "${with_gnu_ld+set}" = set; then
2042   withval="$with_gnu_ld"
2043   test "$withval" = no || with_gnu_ld=yes
2044 else
2045   with_gnu_ld=no
2046 fi
2047
2048
2049 ac_prog=ld
2050 if test "$ac_cv_prog_gcc" = yes; then
2051   # Check if gcc -print-prog-name=ld gives a path.
2052   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2053 echo "configure:2054: checking for ld used by GCC" >&5
2054   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2055   case "$ac_prog" in
2056   # Accept absolute paths.
2057   /* | A-Za-z:\\*)
2058     test -z "$LD" && LD="$ac_prog"
2059     ;;
2060   "")
2061     # If it fails, then pretend we aren't using GCC.
2062     ac_prog=ld
2063     ;;
2064   *)
2065     # If it is relative, then search for the first ld in PATH.
2066     with_gnu_ld=unknown
2067     ;;
2068   esac
2069 elif test "$with_gnu_ld" = yes; then
2070   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2071 echo "configure:2072: checking for GNU ld" >&5
2072 else
2073   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2074 echo "configure:2075: checking for non-GNU ld" >&5
2075 fi
2076 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
2077   echo $ac_n "(cached) $ac_c" 1>&6
2078 else
2079   if test -z "$LD"; then
2080   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2081   for ac_dir in $PATH; do
2082     test -z "$ac_dir" && ac_dir=.
2083     if test -f "$ac_dir/$ac_prog"; then
2084       ac_cv_path_LD="$ac_dir/$ac_prog"
2085       # Check to see if the program is GNU ld.  I'd rather use --version,
2086       # but apparently some GNU ld's only accept -v.
2087       # Break only if it was the GNU/non-GNU ld that we prefer.
2088       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2089         test "$with_gnu_ld" != no && break
2090       else
2091         test "$with_gnu_ld" != yes && break
2092       fi
2093     fi
2094   done
2095   IFS="$ac_save_ifs"
2096 else
2097   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2098 fi
2099 fi
2100
2101 LD="$ac_cv_path_LD"
2102 if test -n "$LD"; then
2103   echo "$ac_t""$LD" 1>&6
2104 else
2105   echo "$ac_t""no" 1>&6
2106 fi
2107 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2108
2109 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2110 echo "configure:2111: checking if the linker ($LD) is GNU ld" >&5
2111 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
2112   echo $ac_n "(cached) $ac_c" 1>&6
2113 else
2114   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2115 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2116   ac_cv_prog_gnu_ld=yes
2117 else
2118   ac_cv_prog_gnu_ld=no
2119 fi
2120 fi
2121
2122 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2123
2124
2125 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2126 echo "configure:2127: checking for BSD-compatible nm" >&5
2127 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
2128   echo $ac_n "(cached) $ac_c" 1>&6
2129 else
2130   case "$NM" in
2131 /* | A-Za-z:\\*)
2132   ac_cv_path_NM="$NM" # Let the user override the test with a path.
2133   ;;
2134 *)
2135   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2136   for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
2137     test -z "$ac_dir" && ac_dir=.
2138     if test -f $ac_dir/nm; then
2139       # Check to see if the nm accepts a BSD-compat flag.
2140       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2141       #   nm: unknown option "B" ignored
2142       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2143         ac_cv_path_NM="$ac_dir/nm -B"
2144       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2145         ac_cv_path_NM="$ac_dir/nm -p"
2146       else
2147         ac_cv_path_NM="$ac_dir/nm"
2148       fi
2149       break
2150     fi
2151   done
2152   IFS="$ac_save_ifs"
2153   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2154   ;;
2155 esac
2156 fi
2157
2158 NM="$ac_cv_path_NM"
2159 echo "$ac_t""$NM" 1>&6
2160
2161
2162 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2163 echo "configure:2164: checking whether ln -s works" >&5
2164 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2165   echo $ac_n "(cached) $ac_c" 1>&6
2166 else
2167   rm -f conftestdata
2168 if ln -s X conftestdata 2>/dev/null
2169 then
2170   rm -f conftestdata
2171   ac_cv_prog_LN_S="ln -s"
2172 else
2173   ac_cv_prog_LN_S=ln
2174 fi
2175 fi
2176 LN_S="$ac_cv_prog_LN_S"
2177 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2178   echo "$ac_t""yes" 1>&6
2179 else
2180   echo "$ac_t""no" 1>&6
2181 fi
2182
2183 # Always use our own libtool.
2184 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
2185
2186 # Check for any special flags to pass to ltconfig.
2187 libtool_flags=
2188 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2189 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2190 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
2191 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2192 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2193
2194 # Some flags need to be propagated to the compiler or linker for good
2195 # libtool support.
2196 case "$host" in
2197 *-*-irix6*)
2198   # Find out which ABI we are using.
2199   echo '#line 2200 "configure"' > conftest.$ac_ext
2200   if { (eval echo configure:2201: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2201     case "`/usr/bin/file conftest.o`" in
2202     *32-bit*)
2203       LD="${LD-ld} -32"
2204       ;;
2205     *N32*)
2206       LD="${LD-ld} -n32"
2207       ;;
2208     *64-bit*)
2209       LD="${LD-ld} -64"
2210       ;;
2211     esac
2212   fi
2213   rm -rf conftest*
2214   ;;
2215
2216 *-*-sco3.2v5*)
2217   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2218   CFLAGS="$CFLAGS -belf"
2219   ;;
2220 esac
2221
2222 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
2223 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
2224 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
2225 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
2226 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
2227 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
2228
2229
2230 for ac_prog in mawk gawk nawk awk
2231 do
2232 # Extract the first word of "$ac_prog", so it can be a program name with args.
2233 set dummy $ac_prog; ac_word=$2
2234 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2235 echo "configure:2236: checking for $ac_word" >&5
2236 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
2237   echo $ac_n "(cached) $ac_c" 1>&6
2238 else
2239   if test -n "$AWK"; then
2240   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2241 else
2242   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2243   ac_dummy="$PATH"
2244   for ac_dir in $ac_dummy; do
2245     test -z "$ac_dir" && ac_dir=.
2246     if test -f $ac_dir/$ac_word; then
2247       ac_cv_prog_AWK="$ac_prog"
2248       break
2249     fi
2250   done
2251   IFS="$ac_save_ifs"
2252 fi
2253 fi
2254 AWK="$ac_cv_prog_AWK"
2255 if test -n "$AWK"; then
2256   echo "$ac_t""$AWK" 1>&6
2257 else
2258   echo "$ac_t""no" 1>&6
2259 fi
2260
2261 test -n "$AWK" && break
2262 done
2263
2264 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2265 echo "configure:2266: checking whether ln -s works" >&5
2266 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2267   echo $ac_n "(cached) $ac_c" 1>&6
2268 else
2269   rm -f conftestdata
2270 if ln -s X conftestdata 2>/dev/null
2271 then
2272   rm -f conftestdata
2273   ac_cv_prog_LN_S="ln -s"
2274 else
2275   ac_cv_prog_LN_S=ln
2276 fi
2277 fi
2278 LN_S="$ac_cv_prog_LN_S"
2279 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2280   echo "$ac_t""yes" 1>&6
2281 else
2282   echo "$ac_t""no" 1>&6
2283 fi
2284
2285
2286 # Extract the first word of "sendmail", so it can be a program name with args.
2287 set dummy sendmail; ac_word=$2
2288 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2289 echo "configure:2290: checking for $ac_word" >&5
2290 if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then
2291   echo $ac_n "(cached) $ac_c" 1>&6
2292 else
2293   case "$SENDMAIL" in
2294   /*)
2295   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
2296   ;;
2297   ?:/*)                  
2298   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
2299   ;;
2300   *)
2301   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2302   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
2303   for ac_dir in $ac_dummy; do 
2304     test -z "$ac_dir" && ac_dir=.
2305     if test -f $ac_dir/$ac_word; then
2306       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
2307       break
2308     fi
2309   done
2310   IFS="$ac_save_ifs"
2311   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
2312   ;;
2313 esac
2314 fi
2315 SENDMAIL="$ac_cv_path_SENDMAIL"
2316 if test -n "$SENDMAIL"; then
2317   echo "$ac_t""$SENDMAIL" 1>&6
2318 else
2319   echo "$ac_t""no" 1>&6
2320 fi
2321
2322 # Extract the first word of "vi", so it can be a program name with args.
2323 set dummy vi; ac_word=$2
2324 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2325 echo "configure:2326: checking for $ac_word" >&5
2326 if eval "test \"`echo '$''{'ac_cv_path_EDITOR'+set}'`\" = set"; then
2327   echo $ac_n "(cached) $ac_c" 1>&6
2328 else
2329   case "$EDITOR" in
2330   /*)
2331   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
2332   ;;
2333   ?:/*)                  
2334   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
2335   ;;
2336   *)
2337   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2338   ac_dummy="$PATH:/usr/ucb"
2339   for ac_dir in $ac_dummy; do 
2340     test -z "$ac_dir" && ac_dir=.
2341     if test -f $ac_dir/$ac_word; then
2342       ac_cv_path_EDITOR="$ac_dir/$ac_word"
2343       break
2344     fi
2345   done
2346   IFS="$ac_save_ifs"
2347   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
2348   ;;
2349 esac
2350 fi
2351 EDITOR="$ac_cv_path_EDITOR"
2352 if test -n "$EDITOR"; then
2353   echo "$ac_t""$EDITOR" 1>&6
2354 else
2355   echo "$ac_t""no" 1>&6
2356 fi
2357
2358 # Extract the first word of "finger", so it can be a program name with args.
2359 set dummy finger; ac_word=$2
2360 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2361 echo "configure:2362: checking for $ac_word" >&5
2362 if eval "test \"`echo '$''{'ac_cv_path_FINGER'+set}'`\" = set"; then
2363   echo $ac_n "(cached) $ac_c" 1>&6
2364 else
2365   case "$FINGER" in
2366   /*)
2367   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
2368   ;;
2369   ?:/*)                  
2370   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
2371   ;;
2372   *)
2373   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2374   ac_dummy="$PATH:/usr/ucb"
2375   for ac_dir in $ac_dummy; do 
2376     test -z "$ac_dir" && ac_dir=.
2377     if test -f $ac_dir/$ac_word; then
2378       ac_cv_path_FINGER="$ac_dir/$ac_word"
2379       break
2380     fi
2381   done
2382   IFS="$ac_save_ifs"
2383   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
2384   ;;
2385 esac
2386 fi
2387 FINGER="$ac_cv_path_FINGER"
2388 if test -n "$FINGER"; then
2389   echo "$ac_t""$FINGER" 1>&6
2390 else
2391   echo "$ac_t""no" 1>&6
2392 fi
2393
2394
2395 if test $ol_enable_perl = yes ; then
2396         # Extract the first word of "perl", so it can be a program name with args.
2397 set dummy perl; ac_word=$2
2398 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2399 echo "configure:2400: checking for $ac_word" >&5
2400 if eval "test \"`echo '$''{'ac_cv_path_PERLBIN'+set}'`\" = set"; then
2401   echo $ac_n "(cached) $ac_c" 1>&6
2402 else
2403   case "$PERLBIN" in
2404   /*)
2405   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
2406   ;;
2407   ?:/*)                  
2408   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
2409   ;;
2410   *)
2411   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2412   ac_dummy="$PATH"
2413   for ac_dir in $ac_dummy; do 
2414     test -z "$ac_dir" && ac_dir=.
2415     if test -f $ac_dir/$ac_word; then
2416       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
2417       break
2418     fi
2419   done
2420   IFS="$ac_save_ifs"
2421   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
2422   ;;
2423 esac
2424 fi
2425 PERLBIN="$ac_cv_path_PERLBIN"
2426 if test -n "$PERLBIN"; then
2427   echo "$ac_t""$PERLBIN" 1>&6
2428 else
2429   echo "$ac_t""no" 1>&6
2430 fi
2431
2432
2433         if test "no$PERLBIN" = "no" ; then
2434                 ol_enable_perl=no
2435         fi
2436
2437         SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
2438         SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e perl_inc`"
2439 fi
2440
2441 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2442 echo "configure:2443: checking how to run the C preprocessor" >&5
2443 # On Suns, sometimes $CPP names a directory.
2444 if test -n "$CPP" && test -d "$CPP"; then
2445   CPP=
2446 fi
2447 if test -z "$CPP"; then
2448 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
2449   echo $ac_n "(cached) $ac_c" 1>&6
2450 else
2451     # This must be in double quotes, not single quotes, because CPP may get
2452   # substituted into the Makefile and "${CC-cc}" will confuse make.
2453   CPP="${CC-cc} -E"
2454   # On the NeXT, cc -E runs the code through the compiler's parser,
2455   # not just through cpp.
2456   cat > conftest.$ac_ext <<EOF
2457 #line 2458 "configure"
2458 #include "confdefs.h"
2459 #include <assert.h>
2460 Syntax Error
2461 EOF
2462 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2463 { (eval echo configure:2464: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2464 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2465 if test -z "$ac_err"; then
2466   :
2467 else
2468   echo "$ac_err" >&5
2469   echo "configure: failed program was:" >&5
2470   cat conftest.$ac_ext >&5
2471   rm -rf conftest*
2472   CPP="${CC-cc} -E -traditional-cpp"
2473   cat > conftest.$ac_ext <<EOF
2474 #line 2475 "configure"
2475 #include "confdefs.h"
2476 #include <assert.h>
2477 Syntax Error
2478 EOF
2479 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2480 { (eval echo configure:2481: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2481 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2482 if test -z "$ac_err"; then
2483   :
2484 else
2485   echo "$ac_err" >&5
2486   echo "configure: failed program was:" >&5
2487   cat conftest.$ac_ext >&5
2488   rm -rf conftest*
2489   CPP="${CC-cc} -nologo -E"
2490   cat > conftest.$ac_ext <<EOF
2491 #line 2492 "configure"
2492 #include "confdefs.h"
2493 #include <assert.h>
2494 Syntax Error
2495 EOF
2496 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2497 { (eval echo configure:2498: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2498 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2499 if test -z "$ac_err"; then
2500   :
2501 else
2502   echo "$ac_err" >&5
2503   echo "configure: failed program was:" >&5
2504   cat conftest.$ac_ext >&5
2505   rm -rf conftest*
2506   CPP=/lib/cpp
2507 fi
2508 rm -f conftest*
2509 fi
2510 rm -f conftest*
2511 fi
2512 rm -f conftest*
2513   ac_cv_prog_CPP="$CPP"
2514 fi
2515   CPP="$ac_cv_prog_CPP"
2516 else
2517   ac_cv_prog_CPP="$CPP"
2518 fi
2519 echo "$ac_t""$CPP" 1>&6
2520
2521
2522 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
2523         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
2524
2525 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
2526         echo "configure: warning: programs compiled here do run here..." 1>&2
2527         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
2528
2529 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
2530         echo "configure: warning: programs compiled here do not run here..." 1>&2
2531         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
2532 fi
2533
2534 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2535 echo "configure:2536: checking for AIX" >&5
2536 cat > conftest.$ac_ext <<EOF
2537 #line 2538 "configure"
2538 #include "confdefs.h"
2539 #ifdef _AIX
2540   yes
2541 #endif
2542
2543 EOF
2544 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2545   egrep "yes" >/dev/null 2>&1; then
2546   rm -rf conftest*
2547   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
2548 #define _ALL_SOURCE 1
2549 EOF
2550
2551 else
2552   rm -rf conftest*
2553   echo "$ac_t""no" 1>&6
2554 fi
2555 rm -f conftest*
2556
2557
2558 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
2559 echo "configure:2560: checking for POSIXized ISC" >&5
2560 if test -d /etc/conf/kconfig.d &&
2561   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
2562 then
2563   echo "$ac_t""yes" 1>&6
2564   ISC=yes # If later tests want to check for ISC.
2565   cat >> confdefs.h <<\EOF
2566 #define _POSIX_SOURCE 1
2567 EOF
2568
2569   if test "$GCC" = yes; then
2570     CC="$CC -posix"
2571   else
2572     CC="$CC -Xp"
2573   fi
2574 else
2575   echo "$ac_t""no" 1>&6
2576   ISC=
2577 fi
2578
2579 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
2580 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
2581 echo "configure:2582: checking for minix/config.h" >&5
2582 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2583   echo $ac_n "(cached) $ac_c" 1>&6
2584 else
2585   cat > conftest.$ac_ext <<EOF
2586 #line 2587 "configure"
2587 #include "confdefs.h"
2588 #include <minix/config.h>
2589 EOF
2590 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2591 { (eval echo configure:2592: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2592 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2593 if test -z "$ac_err"; then
2594   rm -rf conftest*
2595   eval "ac_cv_header_$ac_safe=yes"
2596 else
2597   echo "$ac_err" >&5
2598   echo "configure: failed program was:" >&5
2599   cat conftest.$ac_ext >&5
2600   rm -rf conftest*
2601   eval "ac_cv_header_$ac_safe=no"
2602 fi
2603 rm -f conftest*
2604 fi
2605 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2606   echo "$ac_t""yes" 1>&6
2607   MINIX=yes
2608 else
2609   echo "$ac_t""no" 1>&6
2610 MINIX=
2611 fi
2612
2613 if test "$MINIX" = yes; then
2614   cat >> confdefs.h <<\EOF
2615 #define _POSIX_SOURCE 1
2616 EOF
2617
2618   cat >> confdefs.h <<\EOF
2619 #define _POSIX_1_SOURCE 2
2620 EOF
2621
2622   cat >> confdefs.h <<\EOF
2623 #define _MINIX 1
2624 EOF
2625
2626 fi
2627
2628
2629 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
2630 echo "configure:2631: checking for Cygwin environment" >&5
2631 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
2632   echo $ac_n "(cached) $ac_c" 1>&6
2633 else
2634   cat > conftest.$ac_ext <<EOF
2635 #line 2636 "configure"
2636 #include "confdefs.h"
2637
2638 int main() {
2639
2640 #ifndef __CYGWIN__
2641 #define __CYGWIN__ __CYGWIN32__
2642 #endif
2643 return __CYGWIN__;
2644 ; return 0; }
2645 EOF
2646 if { (eval echo configure:2647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2647   rm -rf conftest*
2648   ac_cv_cygwin=yes
2649 else
2650   echo "configure: failed program was:" >&5
2651   cat conftest.$ac_ext >&5
2652   rm -rf conftest*
2653   ac_cv_cygwin=no
2654 fi
2655 rm -f conftest*
2656 rm -f conftest*
2657 fi
2658
2659 echo "$ac_t""$ac_cv_cygwin" 1>&6
2660 CYGWIN=
2661 test "$ac_cv_cygwin" = yes && CYGWIN=yes
2662 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
2663 echo "configure:2664: checking for mingw32 environment" >&5
2664 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
2665   echo $ac_n "(cached) $ac_c" 1>&6
2666 else
2667   cat > conftest.$ac_ext <<EOF
2668 #line 2669 "configure"
2669 #include "confdefs.h"
2670
2671 int main() {
2672 return __MINGW32__;
2673 ; return 0; }
2674 EOF
2675 if { (eval echo configure:2676: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2676   rm -rf conftest*
2677   ac_cv_mingw32=yes
2678 else
2679   echo "configure: failed program was:" >&5
2680   cat conftest.$ac_ext >&5
2681   rm -rf conftest*
2682   ac_cv_mingw32=no
2683 fi
2684 rm -f conftest*
2685 rm -f conftest*
2686 fi
2687
2688 echo "$ac_t""$ac_cv_mingw32" 1>&6
2689 MINGW32=
2690 test "$ac_cv_mingw32" = yes && MINGW32=yes
2691
2692
2693 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
2694 echo "configure:2695: checking for executable suffix" >&5
2695 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
2696   echo $ac_n "(cached) $ac_c" 1>&6
2697 else
2698   if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
2699   ac_cv_exeext=.exe
2700 else
2701   rm -f conftest*
2702   echo 'int main () { return 0; }' > conftest.$ac_ext
2703   ac_cv_exeext=
2704   if { (eval echo configure:2705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
2705     for file in conftest.*; do
2706       case $file in
2707       *.c | *.o | *.obj) ;;
2708       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
2709       esac
2710     done
2711   else
2712     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
2713   fi
2714   rm -f conftest*
2715   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
2716 fi
2717 fi
2718
2719 EXEEXT=""
2720 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
2721 echo "$ac_t""${ac_cv_exeext}" 1>&6
2722 ac_exeext=$EXEEXT
2723
2724 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
2725 echo "configure:2726: checking for object suffix" >&5
2726 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
2727   echo $ac_n "(cached) $ac_c" 1>&6
2728 else
2729   rm -f conftest*
2730 echo 'int i = 1;' > conftest.$ac_ext
2731 if { (eval echo configure:2732: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2732   for ac_file in conftest.*; do
2733     case $ac_file in
2734     *.c) ;;
2735     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
2736     esac
2737   done
2738 else
2739   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
2740 fi
2741 rm -f conftest*
2742 fi
2743
2744 echo "$ac_t""$ac_cv_objext" 1>&6
2745 OBJEXT=$ac_cv_objext
2746 ac_objext=$ac_cv_objext
2747
2748
2749
2750
2751
2752 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
2753 echo "configure:2754: checking for ${CC-cc} option to accept ANSI C" >&5
2754 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
2755   echo $ac_n "(cached) $ac_c" 1>&6
2756 else
2757   am_cv_prog_cc_stdc=no
2758 ac_save_CC="$CC"
2759 # Don't try gcc -ansi; that turns off useful extensions and
2760 # breaks some systems' header files.
2761 # AIX                   -qlanglvl=ansi
2762 # Ultrix and OSF/1      -std1
2763 # HP-UX                 -Aa -D_HPUX_SOURCE
2764 # SVR4                  -Xc -D__EXTENSIONS__
2765 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2766 do
2767   CC="$ac_save_CC $ac_arg"
2768   cat > conftest.$ac_ext <<EOF
2769 #line 2770 "configure"
2770 #include "confdefs.h"
2771 #include <stdarg.h>
2772 #include <stdio.h>
2773 #include <sys/types.h>
2774 #include <sys/stat.h>
2775 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2776 struct buf { int x; };
2777 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2778 static char *e (p, i)
2779      char **p;
2780      int i;
2781 {
2782   return p[i];
2783 }
2784 static char *f (char * (*g) (char **, int), char **p, ...)
2785 {
2786   char *s;
2787   va_list v;
2788   va_start (v,p);
2789   s = g (p, va_arg (v,int));
2790   va_end (v);
2791   return s;
2792 }
2793 int test (int i, double x);
2794 struct s1 {int (*f) (int a);};
2795 struct s2 {int (*f) (double a);};
2796 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2797 int argc;
2798 char **argv;
2799
2800 int main() {
2801
2802 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2803
2804 ; return 0; }
2805 EOF
2806 if { (eval echo configure:2807: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2807   rm -rf conftest*
2808   am_cv_prog_cc_stdc="$ac_arg"; break
2809 else
2810   echo "configure: failed program was:" >&5
2811   cat conftest.$ac_ext >&5
2812 fi
2813 rm -f conftest*
2814 done
2815 CC="$ac_save_CC"
2816
2817 fi
2818
2819 if test -z "$am_cv_prog_cc_stdc"; then
2820   echo "$ac_t""none needed" 1>&6
2821 else
2822   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
2823 fi
2824 case "x$am_cv_prog_cc_stdc" in
2825   x|xno) ;;
2826   *) CC="$CC $am_cv_prog_cc_stdc" ;;
2827 esac
2828
2829 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
2830         { echo "configure: error: OpenLDAP requires compiler to support STDC prototypes." 1>&2; exit 1; }
2831 fi
2832
2833
2834
2835
2836 echo $ac_n "checking for socket""... $ac_c" 1>&6
2837 echo "configure:2838: checking for socket" >&5
2838 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
2839   echo $ac_n "(cached) $ac_c" 1>&6
2840 else
2841   cat > conftest.$ac_ext <<EOF
2842 #line 2843 "configure"
2843 #include "confdefs.h"
2844 /* System header to define __stub macros and hopefully few prototypes,
2845     which can conflict with char socket(); below.  */
2846 #include <assert.h>
2847 /* Override any gcc2 internal prototype to avoid an error.  */
2848 /* We use char because int might match the return type of a gcc2
2849     builtin and then its argument prototype would still apply.  */
2850 char socket();
2851
2852 int main() {
2853
2854 /* The GNU C library defines this for functions which it implements
2855     to always fail with ENOSYS.  Some functions are actually named
2856     something starting with __ and the normal name is an alias.  */
2857 #if defined (__stub_socket) || defined (__stub___socket)
2858 choke me
2859 #else
2860 socket();
2861 #endif
2862
2863 ; return 0; }
2864 EOF
2865 if { (eval echo configure:2866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2866   rm -rf conftest*
2867   eval "ac_cv_func_socket=yes"
2868 else
2869   echo "configure: failed program was:" >&5
2870   cat conftest.$ac_ext >&5
2871   rm -rf conftest*
2872   eval "ac_cv_func_socket=no"
2873 fi
2874 rm -f conftest*
2875 fi
2876
2877 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
2878   echo "$ac_t""yes" 1>&6
2879   have_socket=yes
2880 else
2881   echo "$ac_t""no" 1>&6
2882         
2883         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
2884 echo "configure:2885: checking for main in -lsocket" >&5
2885 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
2886 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2887   echo $ac_n "(cached) $ac_c" 1>&6
2888 else
2889   ac_save_LIBS="$LIBS"
2890 LIBS="-lsocket  $LIBS"
2891 cat > conftest.$ac_ext <<EOF
2892 #line 2893 "configure"
2893 #include "confdefs.h"
2894
2895 int main() {
2896 main()
2897 ; return 0; }
2898 EOF
2899 if { (eval echo configure:2900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2900   rm -rf conftest*
2901   eval "ac_cv_lib_$ac_lib_var=yes"
2902 else
2903   echo "configure: failed program was:" >&5
2904   cat conftest.$ac_ext >&5
2905   rm -rf conftest*
2906   eval "ac_cv_lib_$ac_lib_var=no"
2907 fi
2908 rm -f conftest*
2909 LIBS="$ac_save_LIBS"
2910
2911 fi
2912 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2913   echo "$ac_t""yes" 1>&6
2914     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2915     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2916   cat >> confdefs.h <<EOF
2917 #define $ac_tr_lib 1
2918 EOF
2919
2920   LIBS="-lsocket $LIBS"
2921
2922 else
2923   echo "$ac_t""no" 1>&6
2924 fi
2925
2926         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
2927 echo "configure:2928: checking for main in -lnet" >&5
2928 ac_lib_var=`echo net'_'main | sed 'y%./+-%__p_%'`
2929 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2930   echo $ac_n "(cached) $ac_c" 1>&6
2931 else
2932   ac_save_LIBS="$LIBS"
2933 LIBS="-lnet  $LIBS"
2934 cat > conftest.$ac_ext <<EOF
2935 #line 2936 "configure"
2936 #include "confdefs.h"
2937
2938 int main() {
2939 main()
2940 ; return 0; }
2941 EOF
2942 if { (eval echo configure:2943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2943   rm -rf conftest*
2944   eval "ac_cv_lib_$ac_lib_var=yes"
2945 else
2946   echo "configure: failed program was:" >&5
2947   cat conftest.$ac_ext >&5
2948   rm -rf conftest*
2949   eval "ac_cv_lib_$ac_lib_var=no"
2950 fi
2951 rm -f conftest*
2952 LIBS="$ac_save_LIBS"
2953
2954 fi
2955 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2956   echo "$ac_t""yes" 1>&6
2957     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2958     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2959   cat >> confdefs.h <<EOF
2960 #define $ac_tr_lib 1
2961 EOF
2962
2963   LIBS="-lnet $LIBS"
2964
2965 else
2966   echo "$ac_t""no" 1>&6
2967 fi
2968
2969         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
2970 echo "configure:2971: checking for main in -lnsl_s" >&5
2971 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-%__p_%'`
2972 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2973   echo $ac_n "(cached) $ac_c" 1>&6
2974 else
2975   ac_save_LIBS="$LIBS"
2976 LIBS="-lnsl_s  $LIBS"
2977 cat > conftest.$ac_ext <<EOF
2978 #line 2979 "configure"
2979 #include "confdefs.h"
2980
2981 int main() {
2982 main()
2983 ; return 0; }
2984 EOF
2985 if { (eval echo configure:2986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2986   rm -rf conftest*
2987   eval "ac_cv_lib_$ac_lib_var=yes"
2988 else
2989   echo "configure: failed program was:" >&5
2990   cat conftest.$ac_ext >&5
2991   rm -rf conftest*
2992   eval "ac_cv_lib_$ac_lib_var=no"
2993 fi
2994 rm -f conftest*
2995 LIBS="$ac_save_LIBS"
2996
2997 fi
2998 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2999   echo "$ac_t""yes" 1>&6
3000     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3001     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3002   cat >> confdefs.h <<EOF
3003 #define $ac_tr_lib 1
3004 EOF
3005
3006   LIBS="-lnsl_s $LIBS"
3007
3008 else
3009   echo "$ac_t""no" 1>&6
3010 fi
3011
3012         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
3013 echo "configure:3014: checking for main in -lnsl" >&5
3014 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
3015 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3016   echo $ac_n "(cached) $ac_c" 1>&6
3017 else
3018   ac_save_LIBS="$LIBS"
3019 LIBS="-lnsl  $LIBS"
3020 cat > conftest.$ac_ext <<EOF
3021 #line 3022 "configure"
3022 #include "confdefs.h"
3023
3024 int main() {
3025 main()
3026 ; return 0; }
3027 EOF
3028 if { (eval echo configure:3029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3029   rm -rf conftest*
3030   eval "ac_cv_lib_$ac_lib_var=yes"
3031 else
3032   echo "configure: failed program was:" >&5
3033   cat conftest.$ac_ext >&5
3034   rm -rf conftest*
3035   eval "ac_cv_lib_$ac_lib_var=no"
3036 fi
3037 rm -f conftest*
3038 LIBS="$ac_save_LIBS"
3039
3040 fi
3041 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3042   echo "$ac_t""yes" 1>&6
3043     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3044     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3045   cat >> confdefs.h <<EOF
3046 #define $ac_tr_lib 1
3047 EOF
3048
3049   LIBS="-lnsl $LIBS"
3050
3051 else
3052   echo "$ac_t""no" 1>&6
3053 fi
3054
3055         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
3056 echo "configure:3057: checking for socket in -linet" >&5
3057 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
3058 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3059   echo $ac_n "(cached) $ac_c" 1>&6
3060 else
3061   ac_save_LIBS="$LIBS"
3062 LIBS="-linet  $LIBS"
3063 cat > conftest.$ac_ext <<EOF
3064 #line 3065 "configure"
3065 #include "confdefs.h"
3066 /* Override any gcc2 internal prototype to avoid an error.  */
3067 /* We use char because int might match the return type of a gcc2
3068     builtin and then its argument prototype would still apply.  */
3069 char socket();
3070
3071 int main() {
3072 socket()
3073 ; return 0; }
3074 EOF
3075 if { (eval echo configure:3076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3076   rm -rf conftest*
3077   eval "ac_cv_lib_$ac_lib_var=yes"
3078 else
3079   echo "configure: failed program was:" >&5
3080   cat conftest.$ac_ext >&5
3081   rm -rf conftest*
3082   eval "ac_cv_lib_$ac_lib_var=no"
3083 fi
3084 rm -f conftest*
3085 LIBS="$ac_save_LIBS"
3086
3087 fi
3088 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3089   echo "$ac_t""yes" 1>&6
3090     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3091     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3092   cat >> confdefs.h <<EOF
3093 #define $ac_tr_lib 1
3094 EOF
3095
3096   LIBS="-linet $LIBS"
3097
3098 else
3099   echo "$ac_t""no" 1>&6
3100 fi
3101
3102         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
3103 echo "configure:3104: checking for main in -lgen" >&5
3104 ac_lib_var=`echo gen'_'main | sed 'y%./+-%__p_%'`
3105 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3106   echo $ac_n "(cached) $ac_c" 1>&6
3107 else
3108   ac_save_LIBS="$LIBS"
3109 LIBS="-lgen  $LIBS"
3110 cat > conftest.$ac_ext <<EOF
3111 #line 3112 "configure"
3112 #include "confdefs.h"
3113
3114 int main() {
3115 main()
3116 ; return 0; }
3117 EOF
3118 if { (eval echo configure:3119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3119   rm -rf conftest*
3120   eval "ac_cv_lib_$ac_lib_var=yes"
3121 else
3122   echo "configure: failed program was:" >&5
3123   cat conftest.$ac_ext >&5
3124   rm -rf conftest*
3125   eval "ac_cv_lib_$ac_lib_var=no"
3126 fi
3127 rm -f conftest*
3128 LIBS="$ac_save_LIBS"
3129
3130 fi
3131 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3132   echo "$ac_t""yes" 1>&6
3133     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3134     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3135   cat >> confdefs.h <<EOF
3136 #define $ac_tr_lib 1
3137 EOF
3138
3139   LIBS="-lgen $LIBS"
3140
3141 else
3142   echo "$ac_t""no" 1>&6
3143 fi
3144
3145
3146 fi
3147
3148
3149 for ac_func in res_search
3150 do
3151 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3152 echo "configure:3153: checking for $ac_func" >&5
3153 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3154   echo $ac_n "(cached) $ac_c" 1>&6
3155 else
3156   cat > conftest.$ac_ext <<EOF
3157 #line 3158 "configure"
3158 #include "confdefs.h"
3159 /* System header to define __stub macros and hopefully few prototypes,
3160     which can conflict with char $ac_func(); below.  */
3161 #include <assert.h>
3162 /* Override any gcc2 internal prototype to avoid an error.  */
3163 /* We use char because int might match the return type of a gcc2
3164     builtin and then its argument prototype would still apply.  */
3165 char $ac_func();
3166
3167 int main() {
3168
3169 /* The GNU C library defines this for functions which it implements
3170     to always fail with ENOSYS.  Some functions are actually named
3171     something starting with __ and the normal name is an alias.  */
3172 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3173 choke me
3174 #else
3175 $ac_func();
3176 #endif
3177
3178 ; return 0; }
3179 EOF
3180 if { (eval echo configure:3181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3181   rm -rf conftest*
3182   eval "ac_cv_func_$ac_func=yes"
3183 else
3184   echo "configure: failed program was:" >&5
3185   cat conftest.$ac_ext >&5
3186   rm -rf conftest*
3187   eval "ac_cv_func_$ac_func=no"
3188 fi
3189 rm -f conftest*
3190 fi
3191
3192 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3193   echo "$ac_t""yes" 1>&6
3194     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3195   cat >> confdefs.h <<EOF
3196 #define $ac_tr_func 1
3197 EOF
3198  
3199 else
3200   echo "$ac_t""no" 1>&6
3201 fi
3202 done
3203
3204 if test $ac_cv_func_res_search = "no" ; then 
3205         echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
3206 echo "configure:3207: checking for res_search in -lbind" >&5
3207 ac_lib_var=`echo bind'_'res_search | sed 'y%./+-%__p_%'`
3208 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3209   echo $ac_n "(cached) $ac_c" 1>&6
3210 else
3211   ac_save_LIBS="$LIBS"
3212 LIBS="-lbind  $LIBS"
3213 cat > conftest.$ac_ext <<EOF
3214 #line 3215 "configure"
3215 #include "confdefs.h"
3216 /* Override any gcc2 internal prototype to avoid an error.  */
3217 /* We use char because int might match the return type of a gcc2
3218     builtin and then its argument prototype would still apply.  */
3219 char res_search();
3220
3221 int main() {
3222 res_search()
3223 ; return 0; }
3224 EOF
3225 if { (eval echo configure:3226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3226   rm -rf conftest*
3227   eval "ac_cv_lib_$ac_lib_var=yes"
3228 else
3229   echo "configure: failed program was:" >&5
3230   cat conftest.$ac_ext >&5
3231   rm -rf conftest*
3232   eval "ac_cv_lib_$ac_lib_var=no"
3233 fi
3234 rm -f conftest*
3235 LIBS="$ac_save_LIBS"
3236
3237 fi
3238 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3239   echo "$ac_t""yes" 1>&6
3240     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3241     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3242   cat >> confdefs.h <<EOF
3243 #define $ac_tr_lib 1
3244 EOF
3245
3246   LIBS="-lbind $LIBS"
3247
3248 else
3249   echo "$ac_t""no" 1>&6
3250 fi
3251
3252         if test "$ac_cv_lib_bind_res_search" = "yes" ; then
3253                 cat >> confdefs.h <<\EOF
3254 #define HAVE_RES_SEARCH 1
3255 EOF
3256
3257         else
3258                 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
3259 echo "configure:3260: checking for res_search in -lresolv" >&5
3260 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
3261 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3262   echo $ac_n "(cached) $ac_c" 1>&6
3263 else
3264   ac_save_LIBS="$LIBS"
3265 LIBS="-lresolv  $LIBS"
3266 cat > conftest.$ac_ext <<EOF
3267 #line 3268 "configure"
3268 #include "confdefs.h"
3269 /* Override any gcc2 internal prototype to avoid an error.  */
3270 /* We use char because int might match the return type of a gcc2
3271     builtin and then its argument prototype would still apply.  */
3272 char res_search();
3273
3274 int main() {
3275 res_search()
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_lib_$ac_lib_var=yes"
3281 else
3282   echo "configure: failed program was:" >&5
3283   cat conftest.$ac_ext >&5
3284   rm -rf conftest*
3285   eval "ac_cv_lib_$ac_lib_var=no"
3286 fi
3287 rm -f conftest*
3288 LIBS="$ac_save_LIBS"
3289
3290 fi
3291 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3292   echo "$ac_t""yes" 1>&6
3293     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3294     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3295   cat >> confdefs.h <<EOF
3296 #define $ac_tr_lib 1
3297 EOF
3298
3299   LIBS="-lresolv $LIBS"
3300
3301 else
3302   echo "$ac_t""no" 1>&6
3303 fi
3304
3305                 if test "$ac_cv_lib_resolv_res_search" = "yes" ; then
3306                         cat >> confdefs.h <<\EOF
3307 #define HAVE_RES_SEARCH 1
3308 EOF
3309
3310                 fi
3311         fi
3312 fi
3313
3314 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
3315 echo "configure:3316: checking for sigset in -lV3" >&5
3316 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-%__p_%'`
3317 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3318   echo $ac_n "(cached) $ac_c" 1>&6
3319 else
3320   ac_save_LIBS="$LIBS"
3321 LIBS="-lV3  $LIBS"
3322 cat > conftest.$ac_ext <<EOF
3323 #line 3324 "configure"
3324 #include "confdefs.h"
3325 /* Override any gcc2 internal prototype to avoid an error.  */
3326 /* We use char because int might match the return type of a gcc2
3327     builtin and then its argument prototype would still apply.  */
3328 char sigset();
3329
3330 int main() {
3331 sigset()
3332 ; return 0; }
3333 EOF
3334 if { (eval echo configure:3335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3335   rm -rf conftest*
3336   eval "ac_cv_lib_$ac_lib_var=yes"
3337 else
3338   echo "configure: failed program was:" >&5
3339   cat conftest.$ac_ext >&5
3340   rm -rf conftest*
3341   eval "ac_cv_lib_$ac_lib_var=no"
3342 fi
3343 rm -f conftest*
3344 LIBS="$ac_save_LIBS"
3345
3346 fi
3347 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3348   echo "$ac_t""yes" 1>&6
3349     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3350     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3351   cat >> confdefs.h <<EOF
3352 #define $ac_tr_lib 1
3353 EOF
3354
3355   LIBS="-lV3 $LIBS"
3356
3357 else
3358   echo "$ac_t""no" 1>&6
3359 fi
3360
3361
3362 # ISODE tests
3363 ol_link_isode=no
3364 if test $ol_enable_ldapd != no ; then
3365                 echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
3366 echo "configure:3367: checking for main in -lxtpp" >&5
3367 ac_lib_var=`echo xtpp'_'main | sed 'y%./+-%__p_%'`
3368 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3369   echo $ac_n "(cached) $ac_c" 1>&6
3370 else
3371   ac_save_LIBS="$LIBS"
3372 LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
3373 cat > conftest.$ac_ext <<EOF
3374 #line 3375 "configure"
3375 #include "confdefs.h"
3376
3377 int main() {
3378 main()
3379 ; return 0; }
3380 EOF
3381 if { (eval echo configure:3382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3382   rm -rf conftest*
3383   eval "ac_cv_lib_$ac_lib_var=yes"
3384 else
3385   echo "configure: failed program was:" >&5
3386   cat conftest.$ac_ext >&5
3387   rm -rf conftest*
3388   eval "ac_cv_lib_$ac_lib_var=no"
3389 fi
3390 rm -f conftest*
3391 LIBS="$ac_save_LIBS"
3392
3393 fi
3394 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3395   echo "$ac_t""yes" 1>&6
3396   
3397                 ol_link_isode=yes
3398                 cat >> confdefs.h <<\EOF
3399 #define HAVE_XTPP 1
3400 EOF
3401
3402                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
3403                 
3404 else
3405   echo "$ac_t""no" 1>&6
3406 :
3407 fi
3408
3409         echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
3410 echo "configure:3411: checking for main in -ldsap" >&5
3411 ac_lib_var=`echo dsap'_'main | sed 'y%./+-%__p_%'`
3412 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3413   echo $ac_n "(cached) $ac_c" 1>&6
3414 else
3415   ac_save_LIBS="$LIBS"
3416 LIBS="-ldsap -lisode $LIBS"
3417 cat > conftest.$ac_ext <<EOF
3418 #line 3419 "configure"
3419 #include "confdefs.h"
3420
3421 int main() {
3422 main()
3423 ; return 0; }
3424 EOF
3425 if { (eval echo configure:3426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3426   rm -rf conftest*
3427   eval "ac_cv_lib_$ac_lib_var=yes"
3428 else
3429   echo "configure: failed program was:" >&5
3430   cat conftest.$ac_ext >&5
3431   rm -rf conftest*
3432   eval "ac_cv_lib_$ac_lib_var=no"
3433 fi
3434 rm -f conftest*
3435 LIBS="$ac_save_LIBS"
3436
3437 fi
3438 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3439   echo "$ac_t""yes" 1>&6
3440   
3441                 ol_link_isode=yes
3442                 cat >> confdefs.h <<\EOF
3443 #define HAVE_DSAP 1
3444 EOF
3445
3446                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
3447                 
3448 else
3449   echo "$ac_t""no" 1>&6
3450 :
3451 fi
3452
3453         echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
3454 echo "configure:3455: checking for main in -lisode" >&5
3455 ac_lib_var=`echo isode'_'main | sed 'y%./+-%__p_%'`
3456 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3457   echo $ac_n "(cached) $ac_c" 1>&6
3458 else
3459   ac_save_LIBS="$LIBS"
3460 LIBS="-lisode  $LIBS"
3461 cat > conftest.$ac_ext <<EOF
3462 #line 3463 "configure"
3463 #include "confdefs.h"
3464
3465 int main() {
3466 main()
3467 ; return 0; }
3468 EOF
3469 if { (eval echo configure:3470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3470   rm -rf conftest*
3471   eval "ac_cv_lib_$ac_lib_var=yes"
3472 else
3473   echo "configure: failed program was:" >&5
3474   cat conftest.$ac_ext >&5
3475   rm -rf conftest*
3476   eval "ac_cv_lib_$ac_lib_var=no"
3477 fi
3478 rm -f conftest*
3479 LIBS="$ac_save_LIBS"
3480
3481 fi
3482 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3483   echo "$ac_t""yes" 1>&6
3484   
3485                 ol_link_isode=yes
3486                 cat >> confdefs.h <<\EOF
3487 #define HAVE_ISODE 1
3488 EOF
3489
3490                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
3491                 
3492 else
3493   echo "$ac_t""no" 1>&6
3494 :
3495 fi
3496
3497 fi
3498
3499 if test $ol_link_isode != no; then
3500         echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
3501 echo "configure:3502: checking for main in -lpp" >&5
3502 ac_lib_var=`echo pp'_'main | sed 'y%./+-%__p_%'`
3503 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3504   echo $ac_n "(cached) $ac_c" 1>&6
3505 else
3506   ac_save_LIBS="$LIBS"
3507 LIBS="-lpp  $LIBS"
3508 cat > conftest.$ac_ext <<EOF
3509 #line 3510 "configure"
3510 #include "confdefs.h"
3511
3512 int main() {
3513 main()
3514 ; return 0; }
3515 EOF
3516 if { (eval echo configure:3517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3517   rm -rf conftest*
3518   eval "ac_cv_lib_$ac_lib_var=yes"
3519 else
3520   echo "configure: failed program was:" >&5
3521   cat conftest.$ac_ext >&5
3522   rm -rf conftest*
3523   eval "ac_cv_lib_$ac_lib_var=no"
3524 fi
3525 rm -f conftest*
3526 LIBS="$ac_save_LIBS"
3527
3528 fi
3529 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3530   echo "$ac_t""yes" 1>&6
3531   
3532                 cat >> confdefs.h <<\EOF
3533 #define HAVE_PP 1
3534 EOF
3535
3536                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
3537                 
3538 else
3539   echo "$ac_t""no" 1>&6
3540 :
3541 fi
3542
3543
3544         # Extract the first word of "pepsy", so it can be a program name with args.
3545 set dummy pepsy; ac_word=$2
3546 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3547 echo "configure:3548: checking for $ac_word" >&5
3548 if eval "test \"`echo '$''{'ac_cv_path_PEPSY'+set}'`\" = set"; then
3549   echo $ac_n "(cached) $ac_c" 1>&6
3550 else
3551   case "$PEPSY" in
3552   /*)
3553   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a path.
3554   ;;
3555   ?:/*)                  
3556   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a dos path.
3557   ;;
3558   *)
3559   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3560   ac_dummy="$PATH"
3561   for ac_dir in $ac_dummy; do 
3562     test -z "$ac_dir" && ac_dir=.
3563     if test -f $ac_dir/$ac_word; then
3564       ac_cv_path_PEPSY="$ac_dir/$ac_word"
3565       break
3566     fi
3567   done
3568   IFS="$ac_save_ifs"
3569   ;;
3570 esac
3571 fi
3572 PEPSY="$ac_cv_path_PEPSY"
3573 if test -n "$PEPSY"; then
3574   echo "$ac_t""$PEPSY" 1>&6
3575 else
3576   echo "$ac_t""no" 1>&6
3577 fi
3578
3579 fi
3580
3581 ol_link_kerberos=no
3582
3583 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
3584         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
3585 do
3586 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3587 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3588 echo "configure:3589: checking for $ac_hdr" >&5
3589 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3590   echo $ac_n "(cached) $ac_c" 1>&6
3591 else
3592   cat > conftest.$ac_ext <<EOF
3593 #line 3594 "configure"
3594 #include "confdefs.h"
3595 #include <$ac_hdr>
3596 EOF
3597 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3598 { (eval echo configure:3599: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3599 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3600 if test -z "$ac_err"; then
3601   rm -rf conftest*
3602   eval "ac_cv_header_$ac_safe=yes"
3603 else
3604   echo "$ac_err" >&5
3605   echo "configure: failed program was:" >&5
3606   cat conftest.$ac_ext >&5
3607   rm -rf conftest*
3608   eval "ac_cv_header_$ac_safe=no"
3609 fi
3610 rm -f conftest*
3611 fi
3612 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3613   echo "$ac_t""yes" 1>&6
3614     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3615   cat >> confdefs.h <<EOF
3616 #define $ac_tr_hdr 1
3617 EOF
3618  
3619 else
3620   echo "$ac_t""no" 1>&6
3621 fi
3622 done
3623
3624
3625         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
3626                 echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
3627 echo "configure:3628: checking for main in -lkrb4" >&5
3628 ac_lib_var=`echo krb4'_'main | sed 'y%./+-%__p_%'`
3629 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3630   echo $ac_n "(cached) $ac_c" 1>&6
3631 else
3632   ac_save_LIBS="$LIBS"
3633 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
3634 cat > conftest.$ac_ext <<EOF
3635 #line 3636 "configure"
3636 #include "confdefs.h"
3637
3638 int main() {
3639 main()
3640 ; return 0; }
3641 EOF
3642 if { (eval echo configure:3643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3643   rm -rf conftest*
3644   eval "ac_cv_lib_$ac_lib_var=yes"
3645 else
3646   echo "configure: failed program was:" >&5
3647   cat conftest.$ac_ext >&5
3648   rm -rf conftest*
3649   eval "ac_cv_lib_$ac_lib_var=no"
3650 fi
3651 rm -f conftest*
3652 LIBS="$ac_save_LIBS"
3653
3654 fi
3655 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3656   echo "$ac_t""yes" 1>&6
3657   have_k5=yes
3658 else
3659   echo "$ac_t""no" 1>&6
3660 have_k5=no
3661 fi
3662
3663
3664                 if test $have_k5 = yes ; then
3665                         ol_with_kerberos=found
3666                         ol_link_kerberos=yes
3667
3668                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
3669
3670                         LIBS="$KRB_LIBS $LIBS"
3671
3672                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
3673 echo "configure:3674: checking for des_debug in Kerberos libraries" >&5
3674 if eval "test \"`echo '$''{'ol_cv_var_des_debug'+set}'`\" = set"; then
3675   echo $ac_n "(cached) $ac_c" 1>&6
3676 else
3677   
3678                                                                 save_LIBS="$LIBS"
3679                                 LIBS="$KRB_LIBS $LIBS"
3680                                 cat > conftest.$ac_ext <<EOF
3681 #line 3682 "configure"
3682 #include "confdefs.h"
3683
3684 #include <kerberosIV/krb.h>
3685 #include <kerberosIV/des.h>
3686 extern int des_debug;
3687
3688 int main() {
3689
3690 des_debug = 1;
3691
3692 ; return 0; }
3693 EOF
3694 if { (eval echo configure:3695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3695   rm -rf conftest*
3696   ol_cv_var_des_debug=yes
3697 else
3698   echo "configure: failed program was:" >&5
3699   cat conftest.$ac_ext >&5
3700   rm -rf conftest*
3701   ol_cv_var_des_debug=no
3702 fi
3703 rm -f conftest*
3704                                                                 LIBS="$save_LIBS"
3705                         
3706 fi
3707
3708 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
3709
3710                         if test $ol_cv_var_des_debug= yes ; then
3711                                 cat >> confdefs.h <<\EOF
3712 #define HAVE_DES_DEBUG 1
3713 EOF
3714
3715                         fi
3716
3717                         LIBS="$save_LIBS"
3718                 fi
3719         fi
3720 fi
3721
3722 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
3723         for ac_hdr in krb.h des.h
3724 do
3725 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3726 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3727 echo "configure:3728: checking for $ac_hdr" >&5
3728 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3729   echo $ac_n "(cached) $ac_c" 1>&6
3730 else
3731   cat > conftest.$ac_ext <<EOF
3732 #line 3733 "configure"
3733 #include "confdefs.h"
3734 #include <$ac_hdr>
3735 EOF
3736 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3737 { (eval echo configure:3738: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3738 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3739 if test -z "$ac_err"; then
3740   rm -rf conftest*
3741   eval "ac_cv_header_$ac_safe=yes"
3742 else
3743   echo "$ac_err" >&5
3744   echo "configure: failed program was:" >&5
3745   cat conftest.$ac_ext >&5
3746   rm -rf conftest*
3747   eval "ac_cv_header_$ac_safe=no"
3748 fi
3749 rm -f conftest*
3750 fi
3751 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3752   echo "$ac_t""yes" 1>&6
3753     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3754   cat >> confdefs.h <<EOF
3755 #define $ac_tr_hdr 1
3756 EOF
3757  
3758 else
3759   echo "$ac_t""no" 1>&6
3760 fi
3761 done
3762
3763
3764         if test $ac_cv_header_krb_h = yes ; then
3765                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
3766 echo "configure:3767: checking for main in -lkrb" >&5
3767 ac_lib_var=`echo krb'_'main | sed 'y%./+-%__p_%'`
3768 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3769   echo $ac_n "(cached) $ac_c" 1>&6
3770 else
3771   ac_save_LIBS="$LIBS"
3772 LIBS="-lkrb -ldes $LIBS"
3773 cat > conftest.$ac_ext <<EOF
3774 #line 3775 "configure"
3775 #include "confdefs.h"
3776
3777 int main() {
3778 main()
3779 ; return 0; }
3780 EOF
3781 if { (eval echo configure:3782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3782   rm -rf conftest*
3783   eval "ac_cv_lib_$ac_lib_var=yes"
3784 else
3785   echo "configure: failed program was:" >&5
3786   cat conftest.$ac_ext >&5
3787   rm -rf conftest*
3788   eval "ac_cv_lib_$ac_lib_var=no"
3789 fi
3790 rm -f conftest*
3791 LIBS="$ac_save_LIBS"
3792
3793 fi
3794 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3795   echo "$ac_t""yes" 1>&6
3796   have_k4=yes
3797 else
3798   echo "$ac_t""no" 1>&6
3799 have_k4=no
3800 fi
3801
3802
3803                 if test $have_k4 = yes ; then
3804                         ol_with_kerberos=found
3805                         ol_link_kerberos=yes
3806
3807                         KRB_LIBS="-lkrb -ldes"
3808                 fi
3809         fi
3810 fi
3811
3812 if test $ol_link_kerberos = yes ; then
3813         cat >> confdefs.h <<\EOF
3814 #define HAVE_KERBEROS 1
3815 EOF
3816
3817 fi
3818
3819 ol_link_tls=no
3820 if test $ol_with_tls != no ; then
3821         
3822         for ac_hdr in ssl.h
3823 do
3824 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3825 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3826 echo "configure:3827: checking for $ac_hdr" >&5
3827 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3828   echo $ac_n "(cached) $ac_c" 1>&6
3829 else
3830   cat > conftest.$ac_ext <<EOF
3831 #line 3832 "configure"
3832 #include "confdefs.h"
3833 #include <$ac_hdr>
3834 EOF
3835 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3836 { (eval echo configure:3837: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3837 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3838 if test -z "$ac_err"; then
3839   rm -rf conftest*
3840   eval "ac_cv_header_$ac_safe=yes"
3841 else
3842   echo "$ac_err" >&5
3843   echo "configure: failed program was:" >&5
3844   cat conftest.$ac_ext >&5
3845   rm -rf conftest*
3846   eval "ac_cv_header_$ac_safe=no"
3847 fi
3848 rm -f conftest*
3849 fi
3850 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3851   echo "$ac_t""yes" 1>&6
3852     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3853   cat >> confdefs.h <<EOF
3854 #define $ac_tr_hdr 1
3855 EOF
3856  
3857 else
3858   echo "$ac_t""no" 1>&6
3859 fi
3860 done
3861
3862         
3863         if test $ac_cv_header_ssl_h = yes ; then
3864                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
3865 echo "configure:3866: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
3866 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-%__p_%'`
3867 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3868   echo $ac_n "(cached) $ac_c" 1>&6
3869 else
3870   ac_save_LIBS="$LIBS"
3871 LIBS="-lssl -lcrypto $LIBS"
3872 cat > conftest.$ac_ext <<EOF
3873 #line 3874 "configure"
3874 #include "confdefs.h"
3875 /* Override any gcc2 internal prototype to avoid an error.  */
3876 /* We use char because int might match the return type of a gcc2
3877     builtin and then its argument prototype would still apply.  */
3878 char SSLeay_add_ssl_algorithms();
3879
3880 int main() {
3881 SSLeay_add_ssl_algorithms()
3882 ; return 0; }
3883 EOF
3884 if { (eval echo configure:3885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3885   rm -rf conftest*
3886   eval "ac_cv_lib_$ac_lib_var=yes"
3887 else
3888   echo "configure: failed program was:" >&5
3889   cat conftest.$ac_ext >&5
3890   rm -rf conftest*
3891   eval "ac_cv_lib_$ac_lib_var=no"
3892 fi
3893 rm -f conftest*
3894 LIBS="$ac_save_LIBS"
3895
3896 fi
3897 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3898   echo "$ac_t""yes" 1>&6
3899   have_ssleay=yes
3900                         need_rsaref=no
3901 else
3902   echo "$ac_t""no" 1>&6
3903 have_ssleay=no
3904 fi
3905
3906                         
3907                 if test $have_ssleay = no ; then
3908                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
3909 echo "configure:3910: checking for ssl3_accept in -lssl" >&5
3910 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-%__p_%'`
3911 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3912   echo $ac_n "(cached) $ac_c" 1>&6
3913 else
3914   ac_save_LIBS="$LIBS"
3915 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
3916 cat > conftest.$ac_ext <<EOF
3917 #line 3918 "configure"
3918 #include "confdefs.h"
3919 /* Override any gcc2 internal prototype to avoid an error.  */
3920 /* We use char because int might match the return type of a gcc2
3921     builtin and then its argument prototype would still apply.  */
3922 char ssl3_accept();
3923
3924 int main() {
3925 ssl3_accept()
3926 ; return 0; }
3927 EOF
3928 if { (eval echo configure:3929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3929   rm -rf conftest*
3930   eval "ac_cv_lib_$ac_lib_var=yes"
3931 else
3932   echo "configure: failed program was:" >&5
3933   cat conftest.$ac_ext >&5
3934   rm -rf conftest*
3935   eval "ac_cv_lib_$ac_lib_var=no"
3936 fi
3937 rm -f conftest*
3938 LIBS="$ac_save_LIBS"
3939
3940 fi
3941 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3942   echo "$ac_t""yes" 1>&6
3943   have_ssleay=yes
3944                                 need_rsaref=yes
3945 else
3946   echo "$ac_t""no" 1>&6
3947 have_ssleay=no
3948 fi
3949
3950                 fi
3951
3952                 if test $have_ssleay = yes ; then
3953                         ol_with_tls=found
3954                         ol_link_tls=yes
3955
3956                         cat >> confdefs.h <<\EOF
3957 #define HAVE_SSLEAY 1
3958 EOF
3959
3960
3961                         if test $need_rsaref = yes; then
3962                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
3963                         else
3964                                 TLS_LIBS="-lssl -lcrypto"
3965                         fi
3966                 fi
3967         fi
3968 fi
3969
3970 if test $ol_link_tls = yes ; then
3971         cat >> confdefs.h <<\EOF
3972 #define HAVE_TLS 1
3973 EOF
3974
3975 fi      
3976
3977 for ac_func in \
3978         ctime_r                 \
3979         gethostbyaddr_r \
3980         gethostbyname_r \
3981
3982 do
3983 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3984 echo "configure:3985: checking for $ac_func" >&5
3985 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3986   echo $ac_n "(cached) $ac_c" 1>&6
3987 else
3988   cat > conftest.$ac_ext <<EOF
3989 #line 3990 "configure"
3990 #include "confdefs.h"
3991 /* System header to define __stub macros and hopefully few prototypes,
3992     which can conflict with char $ac_func(); below.  */
3993 #include <assert.h>
3994 /* Override any gcc2 internal prototype to avoid an error.  */
3995 /* We use char because int might match the return type of a gcc2
3996     builtin and then its argument prototype would still apply.  */
3997 char $ac_func();
3998
3999 int main() {
4000
4001 /* The GNU C library defines this for functions which it implements
4002     to always fail with ENOSYS.  Some functions are actually named
4003     something starting with __ and the normal name is an alias.  */
4004 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4005 choke me
4006 #else
4007 $ac_func();
4008 #endif
4009
4010 ; return 0; }
4011 EOF
4012 if { (eval echo configure:4013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4013   rm -rf conftest*
4014   eval "ac_cv_func_$ac_func=yes"
4015 else
4016   echo "configure: failed program was:" >&5
4017   cat conftest.$ac_ext >&5
4018   rm -rf conftest*
4019   eval "ac_cv_func_$ac_func=no"
4020 fi
4021 rm -f conftest*
4022 fi
4023
4024 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4025   echo "$ac_t""yes" 1>&6
4026     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4027   cat >> confdefs.h <<EOF
4028 #define $ac_tr_func 1
4029 EOF
4030  
4031 else
4032   echo "$ac_t""no" 1>&6
4033 fi
4034 done
4035
4036
4037 if test "$ac_cv_func_ctime_r" = yes ; then
4038         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
4039 echo "configure:4040: checking number of arguments of ctime_r" >&5
4040 if eval "test \"`echo '$''{'ol_cv_func_ctime_r_nargs'+set}'`\" = set"; then
4041   echo $ac_n "(cached) $ac_c" 1>&6
4042 else
4043   cat > conftest.$ac_ext <<EOF
4044 #line 4045 "configure"
4045 #include "confdefs.h"
4046 #include <time.h>
4047 int main() {
4048 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
4049 ; return 0; }
4050 EOF
4051 if { (eval echo configure:4052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4052   rm -rf conftest*
4053   ol_cv_func_ctime_r_nargs=3
4054 else
4055   echo "configure: failed program was:" >&5
4056   cat conftest.$ac_ext >&5
4057   rm -rf conftest*
4058   ol_cv_func_ctime_r_nargs=0
4059 fi
4060 rm -f conftest*
4061                 if test $ol_cv_func_ctime_r_nargs = 0 ; then
4062                         cat > conftest.$ac_ext <<EOF
4063 #line 4064 "configure"
4064 #include "confdefs.h"
4065 #include <time.h>
4066 int main() {
4067 time_t ti; char *buffer;
4068                                         ctime_r(&ti,buffer);
4069 ; return 0; }
4070 EOF
4071 if { (eval echo configure:4072: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4072   rm -rf conftest*
4073   ol_cv_func_ctime_r_nargs=2
4074 else
4075   echo "configure: failed program was:" >&5
4076   cat conftest.$ac_ext >&5
4077   rm -rf conftest*
4078   ol_cv_func_ctime_r_nargs=0
4079 fi
4080 rm -f conftest*
4081                 fi
4082         
4083 fi
4084
4085 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
4086   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
4087     cat >> confdefs.h <<EOF
4088 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
4089 EOF
4090
4091   fi
4092
4093 else
4094         ol_cv_func_ctime_r_nargs=0
4095 fi
4096
4097 if test "$ac_cv_func_gethostbyname_r" = yes ; then
4098         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
4099 echo "configure:4100: checking number of arguments of gethostbyname_r" >&5
4100 if eval "test \"`echo '$''{'ol_cv_func_gethostbyname_r_nargs'+set}'`\" = set"; then
4101   echo $ac_n "(cached) $ac_c" 1>&6
4102 else
4103   cat > conftest.$ac_ext <<EOF
4104 #line 4105 "configure"
4105 #include "confdefs.h"
4106 #include <sys/types.h>
4107                     #include <sys/socket.h>
4108                     #include <netinet/in.h>
4109                     #include <netdb.h>
4110                     #define BUFSIZE (sizeof(struct hostent)+10)
4111 int main() {
4112 struct hostent hent; char buffer[BUFSIZE];
4113                     int bufsize=BUFSIZE;int h_errno;
4114                     (void)gethostbyname_r( "segovia.cs.purdue.edu", &hent, buffer, bufsize, &h_errno);
4115                     return 0;
4116 ; return 0; }
4117 EOF
4118 if { (eval echo configure:4119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4119   rm -rf conftest*
4120   ol_cv_func_gethostbyname_r_nargs=5
4121 else
4122   echo "configure: failed program was:" >&5
4123   cat conftest.$ac_ext >&5
4124   rm -rf conftest*
4125   ol_cv_func_gethostbyname_r_nargs=0
4126 fi
4127 rm -f conftest*
4128                 if test $ol_cv_func_gethostbyname_r_nargs = 0 ; then
4129                         cat > conftest.$ac_ext <<EOF
4130 #line 4131 "configure"
4131 #include "confdefs.h"
4132 #include <sys/types.h>
4133                     #include <sys/socket.h>
4134                     #include <netinet/in.h>
4135                     #include <netdb.h>
4136                     #define BUFSIZE (sizeof(struct hostent)+10)
4137 int main() {
4138 struct hostent hent;struct hostent *rhent;
4139                     char buffer[BUFSIZE];
4140                     int bufsize=BUFSIZE;int h_errno;
4141                      (void)gethostbyname_r( "segovia.cs.purdue.edu", &hent, buffer, bufsize, &rhent, &h_errno);
4142                     return 0;
4143 ; return 0; }
4144 EOF
4145 if { (eval echo configure:4146: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4146   rm -rf conftest*
4147   ol_cv_func_gethostbyname_r_nargs=6
4148 else
4149   echo "configure: failed program was:" >&5
4150   cat conftest.$ac_ext >&5
4151   rm -rf conftest*
4152   ol_cv_func_gethostbyname_r_nargs=0
4153 fi
4154 rm -f conftest*
4155                 fi
4156         
4157 fi
4158
4159 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
4160   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
4161     cat >> confdefs.h <<EOF
4162 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
4163 EOF
4164
4165   fi
4166
4167 else
4168         ol_cv_func_gethostbyname_r_nargs=0
4169 fi
4170  
4171 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
4172         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
4173 echo "configure:4174: checking number of arguments of gethostbyaddr_r" >&5
4174 if eval "test \"`echo '$''{'ol_cv_func_gethostbyaddr_r_nargs'+set}'`\" = set"; then
4175   echo $ac_n "(cached) $ac_c" 1>&6
4176 else
4177   cat > conftest.$ac_ext <<EOF
4178 #line 4179 "configure"
4179 #include "confdefs.h"
4180 #include <sys/types.h>
4181                     #include <sys/socket.h>
4182                     #include <netinet/in.h>
4183                     #include <netdb.h>
4184                     #define BUFSIZE (sizeof(struct hostent)+10)
4185 int main() {
4186 struct hostent hent; char buffer[BUFSIZE]; 
4187                     struct in_addr add={0x70707070};
4188                     size_t alen=sizeof(struct in_addr);
4189                     int bufsize=BUFSIZE;int h_errno;
4190                     (void)gethostbyaddr_r( (void *)&(add.s_addr),
4191                                 alen, AF_INET, &hent, buffer, bufsize, &h_errno);
4192                     return 0;
4193 ; return 0; }
4194 EOF
4195 if { (eval echo configure:4196: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4196   rm -rf conftest*
4197   ol_cv_func_gethostbyaddr_r_nargs=7
4198 else
4199   echo "configure: failed program was:" >&5
4200   cat conftest.$ac_ext >&5
4201   rm -rf conftest*
4202   ol_cv_func_gethostbyaddr_r_nargs=0
4203 fi
4204 rm -f conftest*
4205                 if test $ol_cv_func_gethostbyaddr_r_nargs = 0 ; then
4206                         cat > conftest.$ac_ext <<EOF
4207 #line 4208 "configure"
4208 #include "confdefs.h"
4209 #include <sys/types.h>
4210                     #include <sys/socket.h>
4211                     #include <netinet/in.h>
4212                     #include <netdb.h>
4213                     #define BUFSIZE (sizeof(struct hostent)+10)
4214 int main() {
4215 struct hostent hent; struct hostent *rhent; char buffer[BUFSIZE]; 
4216                     struct in_addr add={0x70707070};
4217                     size_t alen=sizeof(struct in_addr);
4218                     int bufsize=BUFSIZE;int h_errno;
4219                     (void)gethostbyaddr_r( (void *)&(add.s_addr),
4220                                 alen, AF_INET, &hent, buffer, bufsize, 
4221                                 &rhent, &h_errno);
4222                     return 0;
4223 ; return 0; }
4224 EOF
4225 if { (eval echo configure:4226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4226   rm -rf conftest*
4227   ol_cv_func_gethostbyaddr_r_nargs=8
4228 else
4229   echo "configure: failed program was:" >&5
4230   cat conftest.$ac_ext >&5
4231   rm -rf conftest*
4232   ol_cv_func_gethostbyaddr_r_nargs=0
4233 fi
4234 rm -f conftest*
4235                 fi
4236         
4237 fi
4238
4239 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
4240   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
4241     cat >> confdefs.h <<EOF
4242 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
4243 EOF
4244
4245   fi
4246
4247 else
4248         ol_cv_func_gethostbyaddr_r_nargs=0
4249 fi
4250
4251 if test "$ac_cv_func_ctime_r" = yes \
4252         -a "$ol_cv_func_ctime_r_nargs" -ge 2 -a "$ol_cv_func_ctime_r_nargs" -le 3 \
4253         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
4254         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
4255         -a "$ac_cv_func_gethostbyaddr_r" = yes \
4256         -a "$ac_cv_func_gethostbyname_r" = yes \
4257         ; then
4258
4259         cat >> confdefs.h <<\EOF
4260 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
4261 EOF
4262
4263 fi
4264
4265 if test $ol_link_threads != no ; then
4266         cat >> confdefs.h <<\EOF
4267 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
4268 EOF
4269
4270 fi
4271
4272
4273 ol_link_threads=no
4274 if test $ol_with_threads = auto -o $ol_with_threads = yes \
4275         -o $ol_with_threads = posix ; then
4276
4277         for ac_hdr in pthread.h sched.h
4278 do
4279 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4280 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4281 echo "configure:4282: checking for $ac_hdr" >&5
4282 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4283   echo $ac_n "(cached) $ac_c" 1>&6
4284 else
4285   cat > conftest.$ac_ext <<EOF
4286 #line 4287 "configure"
4287 #include "confdefs.h"
4288 #include <$ac_hdr>
4289 EOF
4290 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4291 { (eval echo configure:4292: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4292 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4293 if test -z "$ac_err"; then
4294   rm -rf conftest*
4295   eval "ac_cv_header_$ac_safe=yes"
4296 else
4297   echo "$ac_err" >&5
4298   echo "configure: failed program was:" >&5
4299   cat conftest.$ac_ext >&5
4300   rm -rf conftest*
4301   eval "ac_cv_header_$ac_safe=no"
4302 fi
4303 rm -f conftest*
4304 fi
4305 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4306   echo "$ac_t""yes" 1>&6
4307     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4308   cat >> confdefs.h <<EOF
4309 #define $ac_tr_hdr 1
4310 EOF
4311  
4312 else
4313   echo "$ac_t""no" 1>&6
4314 fi
4315 done
4316
4317
4318         if test $ac_cv_header_pthread_h = yes ; then
4319                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
4320 echo "configure:4321: checking POSIX thread version" >&5
4321 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
4322   echo $ac_n "(cached) $ac_c" 1>&6
4323 else
4324   
4325         cat > conftest.$ac_ext <<EOF
4326 #line 4327 "configure"
4327 #include "confdefs.h"
4328
4329 #               include <pthread.h>
4330                 /* this check could be improved */
4331 #               ifdef PTHREAD_ONCE_INIT
4332                         pthread_version_final
4333 #               endif
4334         
4335 EOF
4336 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4337   egrep "pthread_version_final" >/dev/null 2>&1; then
4338   rm -rf conftest*
4339   ol_pthread_final=yes
4340 else
4341   rm -rf conftest*
4342   ol_pthread_final=no
4343 fi
4344 rm -f conftest*
4345
4346
4347         cat > conftest.$ac_ext <<EOF
4348 #line 4349 "configure"
4349 #include "confdefs.h"
4350
4351 #               include <pthread.h>
4352                 /* this check could be improved */
4353 #               ifdef pthread_once_init
4354                         pthread_version_draft4
4355 #               endif
4356         
4357 EOF
4358 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4359   egrep "pthread_version_draft4" >/dev/null 2>&1; then
4360   rm -rf conftest*
4361   ol_pthread_draft4=yes
4362 else
4363   rm -rf conftest*
4364   ol_pthread_draft4=no
4365 fi
4366 rm -f conftest*
4367
4368
4369         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
4370                 ol_cv_pthread_version=final
4371         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
4372                 ol_cv_pthread_version=draft4
4373         else
4374                 ol_cv_pthread_version=unknown
4375         fi
4376
4377 fi
4378
4379 echo "$ac_t""$ol_cv_pthread_version" 1>&6
4380
4381
4382                 if test $ol_cv_pthread_version = final ; then
4383                         cat >> confdefs.h <<\EOF
4384 #define HAVE_PTHREADS_FINAL 1
4385 EOF
4386
4387                 elif test $ol_cv_pthread_version = draft4 ; then
4388                         cat >> confdefs.h <<\EOF
4389 #define HAVE_PTHREADS_D4 1
4390 EOF
4391
4392                 else
4393                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
4394                 fi
4395
4396                 # consider threads found
4397                 ol_with_threads=found
4398
4399                 
4400 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
4401 echo "configure:4402: checking for LinuxThreads" >&5
4402 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
4403   echo $ac_n "(cached) $ac_c" 1>&6
4404 else
4405   
4406         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
4407         if test "$res" -gt 0 ; then
4408                 ol_cv_linux_threads=yes
4409         else
4410                 ol_cv_linux_threads=no
4411         fi
4412
4413 fi
4414
4415 echo "$ac_t""$ol_cv_linux_threads" 1>&6
4416
4417
4418                 if test $ol_cv_linux_threads = yes ; then
4419                         cat >> confdefs.h <<\EOF
4420 #define HAVE_LINUX_THREADS 1
4421 EOF
4422
4423                 fi
4424
4425                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
4426                                 echo $ac_n "checking for pthread_create""... $ac_c" 1>&6
4427 echo "configure:4428: checking for pthread_create" >&5
4428 if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then
4429   echo $ac_n "(cached) $ac_c" 1>&6
4430 else
4431   cat > conftest.$ac_ext <<EOF
4432 #line 4433 "configure"
4433 #include "confdefs.h"
4434 /* System header to define __stub macros and hopefully few prototypes,
4435     which can conflict with char pthread_create(); below.  */
4436 #include <assert.h>
4437 /* Override any gcc2 internal prototype to avoid an error.  */
4438 /* We use char because int might match the return type of a gcc2
4439     builtin and then its argument prototype would still apply.  */
4440 char pthread_create();
4441
4442 int main() {
4443
4444 /* The GNU C library defines this for functions which it implements
4445     to always fail with ENOSYS.  Some functions are actually named
4446     something starting with __ and the normal name is an alias.  */
4447 #if defined (__stub_pthread_create) || defined (__stub___pthread_create)
4448 choke me
4449 #else
4450 pthread_create();
4451 #endif
4452
4453 ; return 0; }
4454 EOF
4455 if { (eval echo configure:4456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4456   rm -rf conftest*
4457   eval "ac_cv_func_pthread_create=yes"
4458 else
4459   echo "configure: failed program was:" >&5
4460   cat conftest.$ac_ext >&5
4461   rm -rf conftest*
4462   eval "ac_cv_func_pthread_create=no"
4463 fi
4464 rm -f conftest*
4465 fi
4466
4467 if eval "test \"`echo '$ac_cv_func_'pthread_create`\" = yes"; then
4468   echo "$ac_t""yes" 1>&6
4469   ol_link_threads=yes
4470 else
4471   echo "$ac_t""no" 1>&6
4472 fi
4473
4474
4475                 if test $ol_link_threads = no ; then
4476                                                 echo $ac_n "checking for pthread_create with -kthread""... $ac_c" 1>&6
4477 echo "configure:4478: checking for pthread_create with -kthread" >&5
4478 if eval "test \"`echo '$''{'ol_cv_kthread_flag'+set}'`\" = set"; then
4479   echo $ac_n "(cached) $ac_c" 1>&6
4480 else
4481   
4482                                                                 save_LIBS="$LIBS"
4483                                 LIBS="-kthread $LIBS"
4484                                 cat > conftest.$ac_ext <<EOF
4485 #line 4486 "configure"
4486 #include "confdefs.h"
4487 #include <pthread.h>
4488 int main() {
4489
4490 #if HAVE_PTHREADS_D4
4491         pthread_create(NULL,pthread_attr_default,NULL,NULL);
4492 #else
4493         pthread_create(NULL,NULL,NULL,NULL);
4494 #endif
4495
4496 ; return 0; }
4497 EOF
4498 if { (eval echo configure:4499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4499   rm -rf conftest*
4500   ol_cv_kthread_flag=yes
4501 else
4502   echo "configure: failed program was:" >&5
4503   cat conftest.$ac_ext >&5
4504   rm -rf conftest*
4505   ol_cv_kthread_flag=no
4506 fi
4507 rm -f conftest*
4508                                                                 LIBS="$save_LIBS"
4509                         
4510 fi
4511
4512 echo "$ac_t""$ol_cv_kthread_flag" 1>&6
4513
4514                         if test $ol_cv_kthread_flag = yes ; then
4515                                 LTHREAD_LIBS="$LTHREAD_LIBS -kthread"
4516                                 ol_link_threads=posix
4517                         fi
4518                 fi
4519
4520                 if test $ol_link_threads = no ; then
4521                                                 echo $ac_n "checking for pthread_create with -pthread""... $ac_c" 1>&6
4522 echo "configure:4523: checking for pthread_create with -pthread" >&5
4523 if eval "test \"`echo '$''{'ol_cv_pthread_flag'+set}'`\" = set"; then
4524   echo $ac_n "(cached) $ac_c" 1>&6
4525 else
4526   
4527                                                                 save_LIBS="$LIBS"
4528                                 LIBS="-pthread $LIBS"
4529                                 cat > conftest.$ac_ext <<EOF
4530 #line 4531 "configure"
4531 #include "confdefs.h"
4532 #include <pthread.h>
4533 int main() {
4534
4535 #if HAVE_PTHREADS_D4
4536         pthread_create(NULL,pthread_attr_default,NULL,NULL);
4537 #else
4538         pthread_create(NULL,NULL,NULL,NULL);
4539 #endif
4540
4541 ; return 0; }
4542 EOF
4543 if { (eval echo configure:4544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4544   rm -rf conftest*
4545   ol_cv_pthread_flag=yes
4546 else
4547   echo "configure: failed program was:" >&5
4548   cat conftest.$ac_ext >&5
4549   rm -rf conftest*
4550   ol_cv_pthread_flag=no
4551 fi
4552 rm -f conftest*
4553                                                                 LIBS="$save_LIBS"
4554                         
4555 fi
4556
4557 echo "$ac_t""$ol_cv_pthread_flag" 1>&6
4558
4559                         if test $ol_cv_pthread_flag = yes ; then
4560                                 LTHREAD_LIBS="$LTHREAD_LIBS -pthread"
4561                                 ol_link_threads=posix
4562                         fi
4563                 fi
4564
4565                 if test $ol_link_threads = no ; then
4566                                                 echo $ac_n "checking for pthread_create with -pthreads""... $ac_c" 1>&6
4567 echo "configure:4568: checking for pthread_create with -pthreads" >&5
4568 if eval "test \"`echo '$''{'ol_cv_pthreads_flag'+set}'`\" = set"; then
4569   echo $ac_n "(cached) $ac_c" 1>&6
4570 else
4571   
4572                                                                 save_LIBS="$LIBS"
4573                                 LIBS="-pthreads $LIBS"
4574                                 cat > conftest.$ac_ext <<EOF
4575 #line 4576 "configure"
4576 #include "confdefs.h"
4577 #include <pthread.h>
4578 int main() {
4579
4580 #if HAVE_PTHREADS_D4
4581         pthread_create(NULL,pthread_attr_default,NULL,NULL);
4582 #else
4583         pthread_create(NULL,NULL,NULL,NULL);
4584 #endif
4585
4586 ; return 0; }
4587 EOF
4588 if { (eval echo configure:4589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4589   rm -rf conftest*
4590   ol_cv_pthreads_flag=yes
4591 else
4592   echo "configure: failed program was:" >&5
4593   cat conftest.$ac_ext >&5
4594   rm -rf conftest*
4595   ol_cv_pthreads_flag=no
4596 fi
4597 rm -f conftest*
4598                                                                 LIBS="$save_LIBS"
4599                         
4600 fi
4601
4602 echo "$ac_t""$ol_cv_pthreads_flag" 1>&6
4603
4604                         if test $ol_cv_pthreads_flag = yes ; then
4605                                 LTHREAD_LIBS="$LTHREAD_LIBS -pthreads"
4606                                 ol_link_threads=posix
4607                         fi
4608                 fi
4609
4610                 if test $ol_link_threads = no ; then
4611                                                 echo $ac_n "checking for pthread_create with -thread""... $ac_c" 1>&6
4612 echo "configure:4613: checking for pthread_create with -thread" >&5
4613 if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
4614   echo $ac_n "(cached) $ac_c" 1>&6
4615 else
4616   
4617                                                                 save_LIBS="$LIBS"
4618                                 LIBS="-thread $LIBS"
4619                                 cat > conftest.$ac_ext <<EOF
4620 #line 4621 "configure"
4621 #include "confdefs.h"
4622 char pthread_create();
4623 int main() {
4624 pthread_create();
4625 ; return 0; }
4626 EOF
4627 if { (eval echo configure:4628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4628   rm -rf conftest*
4629   ol_cv_thread_flag=yes
4630 else
4631   echo "configure: failed program was:" >&5
4632   cat conftest.$ac_ext >&5
4633   rm -rf conftest*
4634   ol_cv_thread_flag=no
4635 fi
4636 rm -f conftest*
4637                                                                 LIBS="$save_LIBS"
4638                         
4639 fi
4640
4641 echo "$ac_t""$ol_cv_thread_flag" 1>&6
4642
4643                         if test $ol_cv_thread_flag = yes ; then
4644                                 LTHREAD_LIBS="$LTHREAD_LIBS -thread"
4645                                 ol_link_threads=posix
4646                         fi
4647                 fi
4648
4649                 if test $ol_link_threads = no ; then
4650                                                 echo $ac_n "checking for pthread_create with -mt""... $ac_c" 1>&6
4651 echo "configure:4652: checking for pthread_create with -mt" >&5
4652 if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
4653   echo $ac_n "(cached) $ac_c" 1>&6
4654 else
4655   
4656                                                                 save_LIBS="$LIBS"
4657                                 LIBS="-mt $LIBS"
4658                                 cat > conftest.$ac_ext <<EOF
4659 #line 4660 "configure"
4660 #include "confdefs.h"
4661 char pthread_create();
4662 int main() {
4663 pthread_create();
4664 ; return 0; }
4665 EOF
4666 if { (eval echo configure:4667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4667   rm -rf conftest*
4668   ol_cv_thread_flag=yes
4669 else
4670   echo "configure: failed program was:" >&5
4671   cat conftest.$ac_ext >&5
4672   rm -rf conftest*
4673   ol_cv_thread_flag=no
4674 fi
4675 rm -f conftest*
4676                                                                 LIBS="$save_LIBS"
4677                         
4678 fi
4679
4680 echo "$ac_t""$ol_cv_thread_flag" 1>&6
4681
4682                         if test $ol_cv_thread_flag = yes ; then
4683                                 LTHREAD_LIBS="$LTHREAD_LIBS -mt"
4684                                 ol_link_threads=posix
4685                         fi
4686                 fi
4687
4688                 if test $ol_link_threads = no ; then
4689                                                 save_LIBS="$LIBS"
4690                         echo $ac_n "checking for pthread_mutex_unlock in -lpthread""... $ac_c" 1>&6
4691 echo "configure:4692: checking for pthread_mutex_unlock in -lpthread" >&5
4692 ac_lib_var=`echo pthread'_'pthread_mutex_unlock | sed 'y%./+-%__p_%'`
4693 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4694   echo $ac_n "(cached) $ac_c" 1>&6
4695 else
4696   ac_save_LIBS="$LIBS"
4697 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
4698 cat > conftest.$ac_ext <<EOF
4699 #line 4700 "configure"
4700 #include "confdefs.h"
4701 /* Override any gcc2 internal prototype to avoid an error.  */
4702 /* We use char because int might match the return type of a gcc2
4703     builtin and then its argument prototype would still apply.  */
4704 char pthread_mutex_unlock();
4705
4706 int main() {
4707 pthread_mutex_unlock()
4708 ; return 0; }
4709 EOF
4710 if { (eval echo configure:4711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4711   rm -rf conftest*
4712   eval "ac_cv_lib_$ac_lib_var=yes"
4713 else
4714   echo "configure: failed program was:" >&5
4715   cat conftest.$ac_ext >&5
4716   rm -rf conftest*
4717   eval "ac_cv_lib_$ac_lib_var=no"
4718 fi
4719 rm -f conftest*
4720 LIBS="$ac_save_LIBS"
4721
4722 fi
4723 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4724   echo "$ac_t""yes" 1>&6
4725   
4726                                 ol_link_threads=posix
4727                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc -lc_r"
4728                                 if test $ol_with_yielding_select = auto ; then
4729                                         ol_with_yielding_select=yes
4730                                 fi
4731                                 
4732 else
4733   echo "$ac_t""no" 1>&6
4734 :
4735 fi
4736
4737                         LIBS="$save_LIBS"
4738                 fi
4739
4740                 if test $ol_link_threads = no ; then
4741                                                 save_LIBS="$LIBS"
4742                         echo $ac_n "checking for pthread_mutex_lock in -lpthread""... $ac_c" 1>&6
4743 echo "configure:4744: checking for pthread_mutex_lock in -lpthread" >&5
4744 ac_lib_var=`echo pthread'_'pthread_mutex_lock | sed 'y%./+-%__p_%'`
4745 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4746   echo $ac_n "(cached) $ac_c" 1>&6
4747 else
4748   ac_save_LIBS="$LIBS"
4749 LIBS="-lpthread -lmach -lexc $LIBS"
4750 cat > conftest.$ac_ext <<EOF
4751 #line 4752 "configure"
4752 #include "confdefs.h"
4753 /* Override any gcc2 internal prototype to avoid an error.  */
4754 /* We use char because int might match the return type of a gcc2
4755     builtin and then its argument prototype would still apply.  */
4756 char pthread_mutex_lock();
4757
4758 int main() {
4759 pthread_mutex_lock()
4760 ; return 0; }
4761 EOF
4762 if { (eval echo configure:4763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4763   rm -rf conftest*
4764   eval "ac_cv_lib_$ac_lib_var=yes"
4765 else
4766   echo "configure: failed program was:" >&5
4767   cat conftest.$ac_ext >&5
4768   rm -rf conftest*
4769   eval "ac_cv_lib_$ac_lib_var=no"
4770 fi
4771 rm -f conftest*
4772 LIBS="$ac_save_LIBS"
4773
4774 fi
4775 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4776   echo "$ac_t""yes" 1>&6
4777   
4778                                 ol_link_threads=posix
4779                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc"
4780                                 if test $ol_with_yielding_select = auto ; then
4781                                         ol_with_yielding_select=yes
4782                                 fi
4783                                 
4784 else
4785   echo "$ac_t""no" 1>&6
4786 :
4787 fi
4788
4789                         LIBS="$save_LIBS"
4790                 fi
4791
4792                 if test $ol_link_threads = no ; then
4793                                                 save_LIBS="$LIBS"
4794                         echo $ac_n "checking for pthread_mutex_trylock in -lpthread""... $ac_c" 1>&6
4795 echo "configure:4796: checking for pthread_mutex_trylock in -lpthread" >&5
4796 ac_lib_var=`echo pthread'_'pthread_mutex_trylock | sed 'y%./+-%__p_%'`
4797 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4798   echo $ac_n "(cached) $ac_c" 1>&6
4799 else
4800   ac_save_LIBS="$LIBS"
4801 LIBS="-lpthread -lexc $LIBS"
4802 cat > conftest.$ac_ext <<EOF
4803 #line 4804 "configure"
4804 #include "confdefs.h"
4805 /* Override any gcc2 internal prototype to avoid an error.  */
4806 /* We use char because int might match the return type of a gcc2
4807     builtin and then its argument prototype would still apply.  */
4808 char pthread_mutex_trylock();
4809
4810 int main() {
4811 pthread_mutex_trylock()
4812 ; return 0; }
4813 EOF
4814 if { (eval echo configure:4815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4815   rm -rf conftest*
4816   eval "ac_cv_lib_$ac_lib_var=yes"
4817 else
4818   echo "configure: failed program was:" >&5
4819   cat conftest.$ac_ext >&5
4820   rm -rf conftest*
4821   eval "ac_cv_lib_$ac_lib_var=no"
4822 fi
4823 rm -f conftest*
4824 LIBS="$ac_save_LIBS"
4825
4826 fi
4827 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4828   echo "$ac_t""yes" 1>&6
4829   
4830                                 ol_link_threads=posix
4831                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lexc"
4832                                 if test $ol_with_yielding_select = auto ; then
4833                                         ol_with_yielding_select=yes
4834                                 fi
4835                                 
4836 else
4837   echo "$ac_t""no" 1>&6
4838 :
4839 fi
4840
4841                         LIBS="$save_LIBS"
4842                 fi
4843
4844                 if test $ol_link_threads = no ; then
4845                                                 save_LIBS="$LIBS"
4846                         echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
4847 echo "configure:4848: checking for pthread_create in -lpthread" >&5
4848 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
4849 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4850   echo $ac_n "(cached) $ac_c" 1>&6
4851 else
4852   ac_save_LIBS="$LIBS"
4853 LIBS="-lpthread  $LIBS"
4854 cat > conftest.$ac_ext <<EOF
4855 #line 4856 "configure"
4856 #include "confdefs.h"
4857 /* Override any gcc2 internal prototype to avoid an error.  */
4858 /* We use char because int might match the return type of a gcc2
4859     builtin and then its argument prototype would still apply.  */
4860 char pthread_create();
4861
4862 int main() {
4863 pthread_create()
4864 ; return 0; }
4865 EOF
4866 if { (eval echo configure:4867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4867   rm -rf conftest*
4868   eval "ac_cv_lib_$ac_lib_var=yes"
4869 else
4870   echo "configure: failed program was:" >&5
4871   cat conftest.$ac_ext >&5
4872   rm -rf conftest*
4873   eval "ac_cv_lib_$ac_lib_var=no"
4874 fi
4875 rm -f conftest*
4876 LIBS="$ac_save_LIBS"
4877
4878 fi
4879 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4880   echo "$ac_t""yes" 1>&6
4881   
4882                                 ol_link_threads=posix
4883                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
4884 else
4885   echo "$ac_t""no" 1>&6
4886 :
4887 fi
4888
4889                         LIBS="$save_LIBS"
4890                 fi
4891
4892                 if test $ol_link_threads = no ; then
4893                                                 save_LIBS="$LIBS"
4894                         echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
4895 echo "configure:4896: checking for pthread_create in -lc_r" >&5
4896 ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
4897 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4898   echo $ac_n "(cached) $ac_c" 1>&6
4899 else
4900   ac_save_LIBS="$LIBS"
4901 LIBS="-lc_r  $LIBS"
4902 cat > conftest.$ac_ext <<EOF
4903 #line 4904 "configure"
4904 #include "confdefs.h"
4905 /* Override any gcc2 internal prototype to avoid an error.  */
4906 /* We use char because int might match the return type of a gcc2
4907     builtin and then its argument prototype would still apply.  */
4908 char pthread_create();
4909
4910 int main() {
4911 pthread_create()
4912 ; return 0; }
4913 EOF
4914 if { (eval echo configure:4915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4915   rm -rf conftest*
4916   eval "ac_cv_lib_$ac_lib_var=yes"
4917 else
4918   echo "configure: failed program was:" >&5
4919   cat conftest.$ac_ext >&5
4920   rm -rf conftest*
4921   eval "ac_cv_lib_$ac_lib_var=no"
4922 fi
4923 rm -f conftest*
4924 LIBS="$ac_save_LIBS"
4925
4926 fi
4927 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4928   echo "$ac_t""yes" 1>&6
4929   
4930                                 ol_link_threads=posix
4931                                 LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"
4932 else
4933   echo "$ac_t""no" 1>&6
4934 :
4935 fi
4936
4937                         LIBS="$save_LIBS"
4938                 fi
4939
4940                 if test $ol_link_threads = no ; then
4941                                                 save_LIBS="$LIBS"
4942                         echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
4943 echo "configure:4944: checking for pthread_create in -lpthreads" >&5
4944 ac_lib_var=`echo pthreads'_'pthread_create | sed 'y%./+-%__p_%'`
4945 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4946   echo $ac_n "(cached) $ac_c" 1>&6
4947 else
4948   ac_save_LIBS="$LIBS"
4949 LIBS="-lpthreads  $LIBS"
4950 cat > conftest.$ac_ext <<EOF
4951 #line 4952 "configure"
4952 #include "confdefs.h"
4953 /* Override any gcc2 internal prototype to avoid an error.  */
4954 /* We use char because int might match the return type of a gcc2
4955     builtin and then its argument prototype would still apply.  */
4956 char pthread_create();
4957
4958 int main() {
4959 pthread_create()
4960 ; return 0; }
4961 EOF
4962 if { (eval echo configure:4963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4963   rm -rf conftest*
4964   eval "ac_cv_lib_$ac_lib_var=yes"
4965 else
4966   echo "configure: failed program was:" >&5
4967   cat conftest.$ac_ext >&5
4968   rm -rf conftest*
4969   eval "ac_cv_lib_$ac_lib_var=no"
4970 fi
4971 rm -f conftest*
4972 LIBS="$ac_save_LIBS"
4973
4974 fi
4975 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4976   echo "$ac_t""yes" 1>&6
4977   
4978                                 ol_link_threads=posix
4979                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads"
4980 else
4981   echo "$ac_t""no" 1>&6
4982 :
4983 fi
4984
4985                         LIBS="$save_LIBS"
4986                 fi
4987
4988                                 if test $ol_link_threads = no ; then
4989                                                 save_LIBS="$LIBS"
4990                         echo $ac_n "checking for pthread_join in -lpthreads""... $ac_c" 1>&6
4991 echo "configure:4992: checking for pthread_join in -lpthreads" >&5
4992 ac_lib_var=`echo pthreads'_'pthread_join | sed 'y%./+-%__p_%'`
4993 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4994   echo $ac_n "(cached) $ac_c" 1>&6
4995 else
4996   ac_save_LIBS="$LIBS"
4997 LIBS="-lpthreads -Wl,-woff,85 $LIBS"
4998 cat > conftest.$ac_ext <<EOF
4999 #line 5000 "configure"
5000 #include "confdefs.h"
5001 /* Override any gcc2 internal prototype to avoid an error.  */
5002 /* We use char because int might match the return type of a gcc2
5003     builtin and then its argument prototype would still apply.  */
5004 char pthread_join();
5005
5006 int main() {
5007 pthread_join()
5008 ; return 0; }
5009 EOF
5010 if { (eval echo configure:5011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5011   rm -rf conftest*
5012   eval "ac_cv_lib_$ac_lib_var=yes"
5013 else
5014   echo "configure: failed program was:" >&5
5015   cat conftest.$ac_ext >&5
5016   rm -rf conftest*
5017   eval "ac_cv_lib_$ac_lib_var=no"
5018 fi
5019 rm -f conftest*
5020 LIBS="$ac_save_LIBS"
5021
5022 fi
5023 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5024   echo "$ac_t""yes" 1>&6
5025   
5026                                 ol_link_threads=posix
5027                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads"
5028                                 
5029 else
5030   echo "$ac_t""no" 1>&6
5031 :
5032 fi
5033
5034                         LIBS="$save_LIBS"
5035                 fi
5036
5037                 if test $ol_link_threads = no ; then
5038                                                 echo $ac_n "checking for pthread_create with -threads""... $ac_c" 1>&6
5039 echo "configure:5040: checking for pthread_create with -threads" >&5
5040 if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
5041   echo $ac_n "(cached) $ac_c" 1>&6
5042 else
5043   
5044                                                                 save_LIBS="$LIBS"
5045                                 LIBS="-threads $LIBS"
5046                                 cat > conftest.$ac_ext <<EOF
5047 #line 5048 "configure"
5048 #include "confdefs.h"
5049 char pthread_create();
5050 int main() {
5051
5052                                         pthread_create();
5053                                         
5054 ; return 0; }
5055 EOF
5056 if { (eval echo configure:5057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5057   rm -rf conftest*
5058   ol_cv_thread_flag=yes
5059 else
5060   echo "configure: failed program was:" >&5
5061   cat conftest.$ac_ext >&5
5062   rm -rf conftest*
5063   ol_cv_thread_flag=no
5064 fi
5065 rm -f conftest*
5066                                                                 LIBS="$save_LIBS"
5067                         
5068 fi
5069
5070 echo "$ac_t""$ol_cv_thread_flag" 1>&6
5071
5072                         if test $ol_cv_thread_flag = yes ; then
5073                                 LTHREAD_LIBS="$LTHREAD_LIBS -threads"
5074                                 ol_link_threads=posix
5075                         fi
5076                 fi
5077
5078                 if test $ol_link_threads = no ; then
5079                                                 save_LIBS="$LIBS"
5080                         echo $ac_n "checking for pthread_mutex_unlock in -lpthreads""... $ac_c" 1>&6
5081 echo "configure:5082: checking for pthread_mutex_unlock in -lpthreads" >&5
5082 ac_lib_var=`echo pthreads'_'pthread_mutex_unlock | sed 'y%./+-%__p_%'`
5083 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5084   echo $ac_n "(cached) $ac_c" 1>&6
5085 else
5086   ac_save_LIBS="$LIBS"
5087 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
5088 cat > conftest.$ac_ext <<EOF
5089 #line 5090 "configure"
5090 #include "confdefs.h"
5091 /* Override any gcc2 internal prototype to avoid an error.  */
5092 /* We use char because int might match the return type of a gcc2
5093     builtin and then its argument prototype would still apply.  */
5094 char pthread_mutex_unlock();
5095
5096 int main() {
5097 pthread_mutex_unlock()
5098 ; return 0; }
5099 EOF
5100 if { (eval echo configure:5101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5101   rm -rf conftest*
5102   eval "ac_cv_lib_$ac_lib_var=yes"
5103 else
5104   echo "configure: failed program was:" >&5
5105   cat conftest.$ac_ext >&5
5106   rm -rf conftest*
5107   eval "ac_cv_lib_$ac_lib_var=no"
5108 fi
5109 rm -f conftest*
5110 LIBS="$ac_save_LIBS"
5111
5112 fi
5113 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5114   echo "$ac_t""yes" 1>&6
5115   
5116                                 ol_link_threads=posix
5117                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc -lc_r"
5118                                 if test $ol_with_yielding_select = auto ; then
5119                                         ol_with_yielding_select=yes
5120                                 fi
5121                                 
5122 else
5123   echo "$ac_t""no" 1>&6
5124 :
5125 fi
5126
5127                         LIBS="$save_LIBS"
5128                 fi
5129
5130                 if test $ol_link_threads = no ; then
5131                                                 save_LIBS="$LIBS"
5132                         echo $ac_n "checking for pthread_mutex_lock in -lpthreads""... $ac_c" 1>&6
5133 echo "configure:5134: checking for pthread_mutex_lock in -lpthreads" >&5
5134 ac_lib_var=`echo pthreads'_'pthread_mutex_lock | sed 'y%./+-%__p_%'`
5135 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5136   echo $ac_n "(cached) $ac_c" 1>&6
5137 else
5138   ac_save_LIBS="$LIBS"
5139 LIBS="-lpthreads -lmach -lexc $LIBS"
5140 cat > conftest.$ac_ext <<EOF
5141 #line 5142 "configure"
5142 #include "confdefs.h"
5143 /* Override any gcc2 internal prototype to avoid an error.  */
5144 /* We use char because int might match the return type of a gcc2
5145     builtin and then its argument prototype would still apply.  */
5146 char pthread_mutex_lock();
5147
5148 int main() {
5149 pthread_mutex_lock()
5150 ; return 0; }
5151 EOF
5152 if { (eval echo configure:5153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5153   rm -rf conftest*
5154   eval "ac_cv_lib_$ac_lib_var=yes"
5155 else
5156   echo "configure: failed program was:" >&5
5157   cat conftest.$ac_ext >&5
5158   rm -rf conftest*
5159   eval "ac_cv_lib_$ac_lib_var=no"
5160 fi
5161 rm -f conftest*
5162 LIBS="$ac_save_LIBS"
5163
5164 fi
5165 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5166   echo "$ac_t""yes" 1>&6
5167   
5168                                 ol_link_threads=posix
5169                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc"
5170                                 if test $ol_with_yielding_select = auto ; then
5171                                         ol_with_yielding_select=yes
5172                                 fi
5173                                 
5174 else
5175   echo "$ac_t""no" 1>&6
5176 :
5177 fi
5178
5179                         LIBS="$save_LIBS"
5180                 fi
5181
5182                 if test $ol_link_threads = no ; then
5183                                                 save_LIBS="$LIBS"
5184                         echo $ac_n "checking for pthread_mutex_trylock in -lpthreads""... $ac_c" 1>&6
5185 echo "configure:5186: checking for pthread_mutex_trylock in -lpthreads" >&5
5186 ac_lib_var=`echo pthreads'_'pthread_mutex_trylock | sed 'y%./+-%__p_%'`
5187 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5188   echo $ac_n "(cached) $ac_c" 1>&6
5189 else
5190   ac_save_LIBS="$LIBS"
5191 LIBS="-lpthreads -lexc $LIBS"
5192 cat > conftest.$ac_ext <<EOF
5193 #line 5194 "configure"
5194 #include "confdefs.h"
5195 /* Override any gcc2 internal prototype to avoid an error.  */
5196 /* We use char because int might match the return type of a gcc2
5197     builtin and then its argument prototype would still apply.  */
5198 char pthread_mutex_trylock();
5199
5200 int main() {
5201 pthread_mutex_trylock()
5202 ; return 0; }
5203 EOF
5204 if { (eval echo configure:5205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5205   rm -rf conftest*
5206   eval "ac_cv_lib_$ac_lib_var=yes"
5207 else
5208   echo "configure: failed program was:" >&5
5209   cat conftest.$ac_ext >&5
5210   rm -rf conftest*
5211   eval "ac_cv_lib_$ac_lib_var=no"
5212 fi
5213 rm -f conftest*
5214 LIBS="$ac_save_LIBS"
5215
5216 fi
5217 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5218   echo "$ac_t""yes" 1>&6
5219   
5220                                 ol_link_threads=posix
5221                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lexc"
5222                                 if test $ol_with_yielding_select = auto ; then
5223                                         ol_with_yielding_select=yes
5224                                 fi
5225                                 
5226 else
5227   echo "$ac_t""no" 1>&6
5228 :
5229 fi
5230
5231                         LIBS="$save_LIBS"
5232                 fi
5233
5234                 if test $ol_link_threads != no ; then
5235                         cat >> confdefs.h <<\EOF
5236 #define HAVE_PTHREADS 1
5237 EOF
5238
5239
5240                                                 save_CPPFLAGS="$CPPFLAGS"
5241                         save_LIBS="$LIBS"
5242                         LIBS="$LTHREAD_LIBS $LIBS"
5243
5244                                                                                                 for ac_func in sched_yield pthread_yield
5245 do
5246 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5247 echo "configure:5248: checking for $ac_func" >&5
5248 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5249   echo $ac_n "(cached) $ac_c" 1>&6
5250 else
5251   cat > conftest.$ac_ext <<EOF
5252 #line 5253 "configure"
5253 #include "confdefs.h"
5254 /* System header to define __stub macros and hopefully few prototypes,
5255     which can conflict with char $ac_func(); below.  */
5256 #include <assert.h>
5257 /* Override any gcc2 internal prototype to avoid an error.  */
5258 /* We use char because int might match the return type of a gcc2
5259     builtin and then its argument prototype would still apply.  */
5260 char $ac_func();
5261
5262 int main() {
5263
5264 /* The GNU C library defines this for functions which it implements
5265     to always fail with ENOSYS.  Some functions are actually named
5266     something starting with __ and the normal name is an alias.  */
5267 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5268 choke me
5269 #else
5270 $ac_func();
5271 #endif
5272
5273 ; return 0; }
5274 EOF
5275 if { (eval echo configure:5276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5276   rm -rf conftest*
5277   eval "ac_cv_func_$ac_func=yes"
5278 else
5279   echo "configure: failed program was:" >&5
5280   cat conftest.$ac_ext >&5
5281   rm -rf conftest*
5282   eval "ac_cv_func_$ac_func=no"
5283 fi
5284 rm -f conftest*
5285 fi
5286
5287 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5288   echo "$ac_t""yes" 1>&6
5289     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5290   cat >> confdefs.h <<EOF
5291 #define $ac_tr_func 1
5292 EOF
5293  
5294 else
5295   echo "$ac_t""no" 1>&6
5296 fi
5297 done
5298
5299
5300                         if test $ac_cv_func_sched_yield = no -a \
5301                                 $ac_cv_func_pthread_yield = no ; then
5302                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
5303 echo "configure:5304: checking for sched_yield in -lrt" >&5
5304 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
5305 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5306   echo $ac_n "(cached) $ac_c" 1>&6
5307 else
5308   ac_save_LIBS="$LIBS"
5309 LIBS="-lrt  $LIBS"
5310 cat > conftest.$ac_ext <<EOF
5311 #line 5312 "configure"
5312 #include "confdefs.h"
5313 /* Override any gcc2 internal prototype to avoid an error.  */
5314 /* We use char because int might match the return type of a gcc2
5315     builtin and then its argument prototype would still apply.  */
5316 char sched_yield();
5317
5318 int main() {
5319 sched_yield()
5320 ; return 0; }
5321 EOF
5322 if { (eval echo configure:5323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5323   rm -rf conftest*
5324   eval "ac_cv_lib_$ac_lib_var=yes"
5325 else
5326   echo "configure: failed program was:" >&5
5327   cat conftest.$ac_ext >&5
5328   rm -rf conftest*
5329   eval "ac_cv_lib_$ac_lib_var=no"
5330 fi
5331 rm -f conftest*
5332 LIBS="$ac_save_LIBS"
5333
5334 fi
5335 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5336   echo "$ac_t""yes" 1>&6
5337   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
5338                                         cat >> confdefs.h <<\EOF
5339 #define HAVE_SCHED_YIELD 1
5340 EOF
5341
5342                                         ac_cv_func_sched_yield=yes
5343 else
5344   echo "$ac_t""no" 1>&6
5345 ac_cv_func_sched_yield=no
5346 fi
5347
5348                         fi
5349                         if test $ac_cv_func_sched_yield = no -a \
5350                                 $ac_cv_func_pthread_yield = no ; then
5351                                                                                                 for ac_func in thr_yield
5352 do
5353 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5354 echo "configure:5355: checking for $ac_func" >&5
5355 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5356   echo $ac_n "(cached) $ac_c" 1>&6
5357 else
5358   cat > conftest.$ac_ext <<EOF
5359 #line 5360 "configure"
5360 #include "confdefs.h"
5361 /* System header to define __stub macros and hopefully few prototypes,
5362     which can conflict with char $ac_func(); below.  */
5363 #include <assert.h>
5364 /* Override any gcc2 internal prototype to avoid an error.  */
5365 /* We use char because int might match the return type of a gcc2
5366     builtin and then its argument prototype would still apply.  */
5367 char $ac_func();
5368
5369 int main() {
5370
5371 /* The GNU C library defines this for functions which it implements
5372     to always fail with ENOSYS.  Some functions are actually named
5373     something starting with __ and the normal name is an alias.  */
5374 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5375 choke me
5376 #else
5377 $ac_func();
5378 #endif
5379
5380 ; return 0; }
5381 EOF
5382 if { (eval echo configure:5383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5383   rm -rf conftest*
5384   eval "ac_cv_func_$ac_func=yes"
5385 else
5386   echo "configure: failed program was:" >&5
5387   cat conftest.$ac_ext >&5
5388   rm -rf conftest*
5389   eval "ac_cv_func_$ac_func=no"
5390 fi
5391 rm -f conftest*
5392 fi
5393
5394 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5395   echo "$ac_t""yes" 1>&6
5396     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5397   cat >> confdefs.h <<EOF
5398 #define $ac_tr_func 1
5399 EOF
5400  
5401 else
5402   echo "$ac_t""no" 1>&6
5403 fi
5404 done
5405
5406                         fi
5407                         if test $ac_cv_func_sched_yield = no -a \
5408                                 $ac_cv_func_pthread_yield = no -a \
5409                                 "$ac_cv_func_thr_yield" = no ; then
5410                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
5411                         fi
5412
5413                                                 for ac_func in pthread_kill
5414 do
5415 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5416 echo "configure:5417: checking for $ac_func" >&5
5417 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5418   echo $ac_n "(cached) $ac_c" 1>&6
5419 else
5420   cat > conftest.$ac_ext <<EOF
5421 #line 5422 "configure"
5422 #include "confdefs.h"
5423 /* System header to define __stub macros and hopefully few prototypes,
5424     which can conflict with char $ac_func(); below.  */
5425 #include <assert.h>
5426 /* Override any gcc2 internal prototype to avoid an error.  */
5427 /* We use char because int might match the return type of a gcc2
5428     builtin and then its argument prototype would still apply.  */
5429 char $ac_func();
5430
5431 int main() {
5432
5433 /* The GNU C library defines this for functions which it implements
5434     to always fail with ENOSYS.  Some functions are actually named
5435     something starting with __ and the normal name is an alias.  */
5436 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5437 choke me
5438 #else
5439 $ac_func();
5440 #endif
5441
5442 ; return 0; }
5443 EOF
5444 if { (eval echo configure:5445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5445   rm -rf conftest*
5446   eval "ac_cv_func_$ac_func=yes"
5447 else
5448   echo "configure: failed program was:" >&5
5449   cat conftest.$ac_ext >&5
5450   rm -rf conftest*
5451   eval "ac_cv_func_$ac_func=no"
5452 fi
5453 rm -f conftest*
5454 fi
5455
5456 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5457   echo "$ac_t""yes" 1>&6
5458     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5459   cat >> confdefs.h <<EOF
5460 #define $ac_tr_func 1
5461 EOF
5462  
5463 else
5464   echo "$ac_t""no" 1>&6
5465 fi
5466 done
5467
5468
5469                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
5470 echo "configure:5471: checking for pthread_detach with <pthread.h>" >&5
5471 if eval "test \"`echo '$''{'ol_cv_func_pthread_detach'+set}'`\" = set"; then
5472   echo $ac_n "(cached) $ac_c" 1>&6
5473 else
5474   
5475                                                                 cat > conftest.$ac_ext <<EOF
5476 #line 5477 "configure"
5477 #include "confdefs.h"
5478 #include <pthread.h>
5479 int main() {
5480 pthread_detach(NULL);
5481 ; return 0; }
5482 EOF
5483 if { (eval echo configure:5484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5484   rm -rf conftest*
5485   ol_cv_func_pthread_detach=yes
5486 else
5487   echo "configure: failed program was:" >&5
5488   cat conftest.$ac_ext >&5
5489   rm -rf conftest*
5490   ol_cv_func_pthread_detach=no
5491 fi
5492 rm -f conftest*
5493                         
5494 fi
5495
5496 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
5497
5498                         if test $ol_cv_func_pthread_detach = no ; then
5499                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
5500                         fi
5501
5502                         cat >> confdefs.h <<\EOF
5503 #define HAVE_PTHREAD_DETACH 1
5504 EOF
5505
5506
5507                                                 for ac_func in \
5508                                 pthread_setconcurrency \
5509                                 pthread_getconcurrency \
5510                                 thr_setconcurrency \
5511                                 thr_getconcurrency \
5512                         
5513 do
5514 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5515 echo "configure:5516: checking for $ac_func" >&5
5516 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5517   echo $ac_n "(cached) $ac_c" 1>&6
5518 else
5519   cat > conftest.$ac_ext <<EOF
5520 #line 5521 "configure"
5521 #include "confdefs.h"
5522 /* System header to define __stub macros and hopefully few prototypes,
5523     which can conflict with char $ac_func(); below.  */
5524 #include <assert.h>
5525 /* Override any gcc2 internal prototype to avoid an error.  */
5526 /* We use char because int might match the return type of a gcc2
5527     builtin and then its argument prototype would still apply.  */
5528 char $ac_func();
5529
5530 int main() {
5531
5532 /* The GNU C library defines this for functions which it implements
5533     to always fail with ENOSYS.  Some functions are actually named
5534     something starting with __ and the normal name is an alias.  */
5535 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5536 choke me
5537 #else
5538 $ac_func();
5539 #endif
5540
5541 ; return 0; }
5542 EOF
5543 if { (eval echo configure:5544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5544   rm -rf conftest*
5545   eval "ac_cv_func_$ac_func=yes"
5546 else
5547   echo "configure: failed program was:" >&5
5548   cat conftest.$ac_ext >&5
5549   rm -rf conftest*
5550   eval "ac_cv_func_$ac_func=no"
5551 fi
5552 rm -f conftest*
5553 fi
5554
5555 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5556   echo "$ac_t""yes" 1>&6
5557     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5558   cat >> confdefs.h <<EOF
5559 #define $ac_tr_func 1
5560 EOF
5561  
5562 else
5563   echo "$ac_t""no" 1>&6
5564 fi
5565 done
5566
5567
5568                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
5569 echo "configure:5570: checking if pthread_create() works" >&5
5570                         if eval "test \"`echo '$''{'ol_cv_pthread_create_works'+set}'`\" = set"; then
5571   echo $ac_n "(cached) $ac_c" 1>&6
5572 else
5573   
5574                         if test "$cross_compiling" = yes; then
5575                                 ol_cv_pthread_create_works=yes
5576 else
5577   cat > conftest.$ac_ext <<EOF
5578 #line 5579 "configure"
5579 #include "confdefs.h"
5580
5581 #include <pthread.h>
5582 #ifndef NULL
5583 #define NULL (void*)0
5584 #endif
5585
5586 static void *task(p)
5587         void *p;
5588 {
5589         return (void *) (p == NULL);
5590 }
5591
5592 int main(argc, argv)
5593         int argc;
5594         char **argv;
5595 {
5596         pthread_t t;
5597 #if HAVE_PTHREADS_D4
5598         exit(pthread_create(&t, pthread_attr_default, task, NULL));
5599 #else
5600         exit(pthread_create(&t, NULL, task, NULL));
5601 #endif
5602 }
5603
5604 EOF
5605 if { (eval echo configure:5606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5606 then
5607   ol_cv_pthread_create_works=yes
5608 else
5609   echo "configure: failed program was:" >&5
5610   cat conftest.$ac_ext >&5
5611   rm -fr conftest*
5612   ol_cv_pthread_create_works=no
5613 fi
5614 rm -fr conftest*
5615 fi
5616
5617 fi
5618
5619                         echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
5620
5621                         if test $ol_cv_pthread_create_works = no ; then
5622                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
5623                         fi
5624
5625                                                 if test $ol_with_yielding_select = auto ; then
5626                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
5627 echo "configure:5628: checking if select yields when using pthreads" >&5
5628                                 if eval "test \"`echo '$''{'ol_cv_pthread_select_yields'+set}'`\" = set"; then
5629   echo $ac_n "(cached) $ac_c" 1>&6
5630 else
5631   
5632                                 if test "$cross_compiling" = yes; then
5633   
5634                                 { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
5635 else
5636   cat > conftest.$ac_ext <<EOF
5637 #line 5638 "configure"
5638 #include "confdefs.h"
5639
5640 #include <sys/types.h>
5641 #include <sys/time.h>
5642 #include <unistd.h>
5643 #include <pthread.h>
5644 #ifndef NULL
5645 #define NULL (void*) 0
5646 #endif
5647
5648 static int fildes[2];
5649
5650 static void *task(p)
5651         void *p;
5652 {
5653         int i;
5654         struct timeval tv;
5655
5656         fd_set rfds;
5657
5658         tv.tv_sec=10;
5659         tv.tv_usec=0;
5660
5661         FD_ZERO(&rfds);
5662         FD_SET(fildes[0], &rfds);
5663
5664         /* we're not interested in any fds */
5665         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
5666
5667         if(i < 0) {
5668                 perror("select");
5669                 exit(10);
5670         }
5671
5672         exit(0); /* if we exit here, the select blocked the whole process */
5673 }
5674
5675 int main(argc, argv)
5676         int argc;
5677         char **argv;
5678 {
5679         pthread_t t;
5680
5681         /* create a pipe to select */
5682         if(pipe(&fildes[0])) {
5683                 perror("select");
5684                 exit(1);
5685         }
5686
5687 #ifdef HAVE_PTHREAD_SETCONCURRENCY
5688         (void) pthread_setconcurrency(2);
5689 #else
5690 #ifdef HAVE_THR_SETCONCURRENCY
5691         /* Set Solaris LWP concurrency to 2 */
5692         thr_setconcurrency(2);
5693 #endif
5694 #endif
5695
5696 #if HAVE_PTHREADS_D4
5697         pthread_create(&t, pthread_attr_default, task, NULL);
5698 #else
5699         pthread_create(&t, NULL, task, NULL);
5700 #endif
5701
5702 #if HAVE_SCHED_YIELD
5703         sched_yield();  /* make sure task runs first */
5704 #else
5705 #ifdef HAVE_PTHREAD_YIELD
5706         pthread_yield();        /* make sure task runs first */
5707 #endif
5708 #endif
5709
5710         exit(2);
5711 }
5712 EOF
5713 if { (eval echo configure:5714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5714 then
5715   ol_cv_pthread_select_yields=no
5716 else
5717   echo "configure: failed program was:" >&5
5718   cat conftest.$ac_ext >&5
5719   rm -fr conftest*
5720   ol_cv_pthread_select_yields=yes
5721 fi
5722 rm -fr conftest*
5723 fi
5724
5725 fi
5726
5727                                 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
5728
5729                                 if test $ol_cv_pthread_select_yields = yes ; then
5730                                         ol_with_yielding_select=yes
5731                                 fi
5732                         fi
5733
5734                                                 CPPFLAGS="$save_CPPFLAGS"
5735                         LIBS="$save_LIBS"
5736                 else
5737                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
5738                 fi
5739         fi
5740
5741         if test $ol_with_threads = posix ; then
5742                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
5743         fi
5744 fi
5745
5746 if test $ol_with_threads = auto -o $ol_with_threads = yes \
5747         -o $ol_with_threads = mach ; then
5748
5749                 for ac_hdr in mach/cthreads.h
5750 do
5751 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5752 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5753 echo "configure:5754: checking for $ac_hdr" >&5
5754 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5755   echo $ac_n "(cached) $ac_c" 1>&6
5756 else
5757   cat > conftest.$ac_ext <<EOF
5758 #line 5759 "configure"
5759 #include "confdefs.h"
5760 #include <$ac_hdr>
5761 EOF
5762 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5763 { (eval echo configure:5764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5764 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5765 if test -z "$ac_err"; then
5766   rm -rf conftest*
5767   eval "ac_cv_header_$ac_safe=yes"
5768 else
5769   echo "$ac_err" >&5
5770   echo "configure: failed program was:" >&5
5771   cat conftest.$ac_ext >&5
5772   rm -rf conftest*
5773   eval "ac_cv_header_$ac_safe=no"
5774 fi
5775 rm -f conftest*
5776 fi
5777 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5778   echo "$ac_t""yes" 1>&6
5779     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5780   cat >> confdefs.h <<EOF
5781 #define $ac_tr_hdr 1
5782 EOF
5783  
5784 else
5785   echo "$ac_t""no" 1>&6
5786 fi
5787 done
5788
5789         if test $ac_cv_header_mach_cthreads_h = yes ; then
5790                 ol_with_threads=found
5791
5792                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
5793 echo "configure:5794: checking for cthread_fork" >&5
5794 if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
5795   echo $ac_n "(cached) $ac_c" 1>&6
5796 else
5797   cat > conftest.$ac_ext <<EOF
5798 #line 5799 "configure"
5799 #include "confdefs.h"
5800 /* System header to define __stub macros and hopefully few prototypes,
5801     which can conflict with char cthread_fork(); below.  */
5802 #include <assert.h>
5803 /* Override any gcc2 internal prototype to avoid an error.  */
5804 /* We use char because int might match the return type of a gcc2
5805     builtin and then its argument prototype would still apply.  */
5806 char cthread_fork();
5807
5808 int main() {
5809
5810 /* The GNU C library defines this for functions which it implements
5811     to always fail with ENOSYS.  Some functions are actually named
5812     something starting with __ and the normal name is an alias.  */
5813 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
5814 choke me
5815 #else
5816 cthread_fork();
5817 #endif
5818
5819 ; return 0; }
5820 EOF
5821 if { (eval echo configure:5822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5822   rm -rf conftest*
5823   eval "ac_cv_func_cthread_fork=yes"
5824 else
5825   echo "configure: failed program was:" >&5
5826   cat conftest.$ac_ext >&5
5827   rm -rf conftest*
5828   eval "ac_cv_func_cthread_fork=no"
5829 fi
5830 rm -f conftest*
5831 fi
5832
5833 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
5834   echo "$ac_t""yes" 1>&6
5835   ol_link_threads=yes
5836 else
5837   echo "$ac_t""no" 1>&6
5838 fi
5839
5840
5841                 if test $ol_link_threads = no ; then
5842                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
5843 echo "configure:5844: checking for cthread_fork with -all_load" >&5
5844 if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
5845   echo $ac_n "(cached) $ac_c" 1>&6
5846 else
5847   
5848                                                                 save_LIBS="$LIBS"
5849                                 LIBS="-all_load $LIBS"
5850                                 cat > conftest.$ac_ext <<EOF
5851 #line 5852 "configure"
5852 #include "confdefs.h"
5853 #include <mach/cthreads.h>
5854 int main() {
5855
5856                                         cthread_fork((void *)0, (void *)0);
5857                                         
5858 ; return 0; }
5859 EOF
5860 if { (eval echo configure:5861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5861   rm -rf conftest*
5862   ol_cv_cthread_all_load=yes
5863 else
5864   echo "configure: failed program was:" >&5
5865   cat conftest.$ac_ext >&5
5866   rm -rf conftest*
5867   ol_cv_cthread_all_load=no
5868 fi
5869 rm -f conftest*
5870                                                                 LIBS="$save_LIBS"
5871                         
5872 fi
5873
5874 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
5875
5876                         if test $ol_cv_cthread_all_load = yes ; then
5877                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
5878                                 ol_link_threads=mach
5879                         fi
5880                 fi
5881
5882                 if test $ol_link_threads != no ; then
5883                         : check for cthread specific functionality here
5884                         cat >> confdefs.h <<\EOF
5885 #define HAVE_MACH_CTHREADS 1
5886 EOF
5887
5888                 else
5889                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
5890                 fi
5891         fi
5892
5893         if test $ol_with_threads = mach ; then
5894                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
5895         fi
5896 fi
5897
5898 if test $ol_with_threads = auto -o $ol_with_threads = yes \
5899         -o $ol_with_threads = lwp ; then
5900
5901                 for ac_hdr in thread.h synch.h
5902 do
5903 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5904 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5905 echo "configure:5906: checking for $ac_hdr" >&5
5906 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5907   echo $ac_n "(cached) $ac_c" 1>&6
5908 else
5909   cat > conftest.$ac_ext <<EOF
5910 #line 5911 "configure"
5911 #include "confdefs.h"
5912 #include <$ac_hdr>
5913 EOF
5914 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5915 { (eval echo configure:5916: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5916 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5917 if test -z "$ac_err"; then
5918   rm -rf conftest*
5919   eval "ac_cv_header_$ac_safe=yes"
5920 else
5921   echo "$ac_err" >&5
5922   echo "configure: failed program was:" >&5
5923   cat conftest.$ac_ext >&5
5924   rm -rf conftest*
5925   eval "ac_cv_header_$ac_safe=no"
5926 fi
5927 rm -f conftest*
5928 fi
5929 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5930   echo "$ac_t""yes" 1>&6
5931     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5932   cat >> confdefs.h <<EOF
5933 #define $ac_tr_hdr 1
5934 EOF
5935  
5936 else
5937   echo "$ac_t""no" 1>&6
5938 fi
5939 done
5940
5941         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
5942                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
5943 echo "configure:5944: checking for thr_create in -lthread" >&5
5944 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
5945 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5946   echo $ac_n "(cached) $ac_c" 1>&6
5947 else
5948   ac_save_LIBS="$LIBS"
5949 LIBS="-lthread  $LIBS"
5950 cat > conftest.$ac_ext <<EOF
5951 #line 5952 "configure"
5952 #include "confdefs.h"
5953 /* Override any gcc2 internal prototype to avoid an error.  */
5954 /* We use char because int might match the return type of a gcc2
5955     builtin and then its argument prototype would still apply.  */
5956 char thr_create();
5957
5958 int main() {
5959 thr_create()
5960 ; return 0; }
5961 EOF
5962 if { (eval echo configure:5963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5963   rm -rf conftest*
5964   eval "ac_cv_lib_$ac_lib_var=yes"
5965 else
5966   echo "configure: failed program was:" >&5
5967   cat conftest.$ac_ext >&5
5968   rm -rf conftest*
5969   eval "ac_cv_lib_$ac_lib_var=no"
5970 fi
5971 rm -f conftest*
5972 LIBS="$ac_save_LIBS"
5973
5974 fi
5975 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5976   echo "$ac_t""yes" 1>&6
5977   have_thr=yes
5978 else
5979   echo "$ac_t""no" 1>&6
5980 have_thr=no
5981 fi
5982
5983
5984                 if test $have_thr = yes ; then
5985                         cat >> confdefs.h <<\EOF
5986 #define HAVE_THR 1
5987 EOF
5988
5989                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
5990                         ol_link_threads=thr
5991
5992                         if test $ol_with_yielding_select = auto ; then
5993                                 ol_with_yielding_select=yes
5994                         fi
5995
5996                                                 for ac_func in \
5997                                 thr_setconcurrency \
5998                                 thr_getconcurrency \
5999                         
6000 do
6001 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6002 echo "configure:6003: checking for $ac_func" >&5
6003 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6004   echo $ac_n "(cached) $ac_c" 1>&6
6005 else
6006   cat > conftest.$ac_ext <<EOF
6007 #line 6008 "configure"
6008 #include "confdefs.h"
6009 /* System header to define __stub macros and hopefully few prototypes,
6010     which can conflict with char $ac_func(); below.  */
6011 #include <assert.h>
6012 /* Override any gcc2 internal prototype to avoid an error.  */
6013 /* We use char because int might match the return type of a gcc2
6014     builtin and then its argument prototype would still apply.  */
6015 char $ac_func();
6016
6017 int main() {
6018
6019 /* The GNU C library defines this for functions which it implements
6020     to always fail with ENOSYS.  Some functions are actually named
6021     something starting with __ and the normal name is an alias.  */
6022 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6023 choke me
6024 #else
6025 $ac_func();
6026 #endif
6027
6028 ; return 0; }
6029 EOF
6030 if { (eval echo configure:6031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6031   rm -rf conftest*
6032   eval "ac_cv_func_$ac_func=yes"
6033 else
6034   echo "configure: failed program was:" >&5
6035   cat conftest.$ac_ext >&5
6036   rm -rf conftest*
6037   eval "ac_cv_func_$ac_func=no"
6038 fi
6039 rm -f conftest*
6040 fi
6041
6042 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6043   echo "$ac_t""yes" 1>&6
6044     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6045   cat >> confdefs.h <<EOF
6046 #define $ac_tr_func 1
6047 EOF
6048  
6049 else
6050   echo "$ac_t""no" 1>&6
6051 fi
6052 done
6053
6054                 fi
6055         fi
6056
6057                 for ac_hdr in lwp/lwp.h
6058 do
6059 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6060 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6061 echo "configure:6062: checking for $ac_hdr" >&5
6062 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6063   echo $ac_n "(cached) $ac_c" 1>&6
6064 else
6065   cat > conftest.$ac_ext <<EOF
6066 #line 6067 "configure"
6067 #include "confdefs.h"
6068 #include <$ac_hdr>
6069 EOF
6070 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6071 { (eval echo configure:6072: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6072 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6073 if test -z "$ac_err"; then
6074   rm -rf conftest*
6075   eval "ac_cv_header_$ac_safe=yes"
6076 else
6077   echo "$ac_err" >&5
6078   echo "configure: failed program was:" >&5
6079   cat conftest.$ac_ext >&5
6080   rm -rf conftest*
6081   eval "ac_cv_header_$ac_safe=no"
6082 fi
6083 rm -f conftest*
6084 fi
6085 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6086   echo "$ac_t""yes" 1>&6
6087     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6088   cat >> confdefs.h <<EOF
6089 #define $ac_tr_hdr 1
6090 EOF
6091  
6092 else
6093   echo "$ac_t""no" 1>&6
6094 fi
6095 done
6096
6097         if test $ac_cv_header_lwp_lwp_h = yes ; then
6098                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
6099 echo "configure:6100: checking for lwp_create in -llwp" >&5
6100 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
6101 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6102   echo $ac_n "(cached) $ac_c" 1>&6
6103 else
6104   ac_save_LIBS="$LIBS"
6105 LIBS="-llwp  $LIBS"
6106 cat > conftest.$ac_ext <<EOF
6107 #line 6108 "configure"
6108 #include "confdefs.h"
6109 /* Override any gcc2 internal prototype to avoid an error.  */
6110 /* We use char because int might match the return type of a gcc2
6111     builtin and then its argument prototype would still apply.  */
6112 char lwp_create();
6113
6114 int main() {
6115 lwp_create()
6116 ; return 0; }
6117 EOF
6118 if { (eval echo configure:6119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6119   rm -rf conftest*
6120   eval "ac_cv_lib_$ac_lib_var=yes"
6121 else
6122   echo "configure: failed program was:" >&5
6123   cat conftest.$ac_ext >&5
6124   rm -rf conftest*
6125   eval "ac_cv_lib_$ac_lib_var=no"
6126 fi
6127 rm -f conftest*
6128 LIBS="$ac_save_LIBS"
6129
6130 fi
6131 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6132   echo "$ac_t""yes" 1>&6
6133   have_lwp=yes
6134 else
6135   echo "$ac_t""no" 1>&6
6136 have_lwp=no
6137 fi
6138
6139
6140                 if test $have_lwp = yes ; then
6141                         cat >> confdefs.h <<\EOF
6142 #define HAVE_LWP 1
6143 EOF
6144
6145                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
6146                         ol_link_threads=lwp
6147
6148                         if test $ol_with_yielding_select = auto ; then
6149                                 ol_with_yielding_select=no
6150                         fi
6151                 fi
6152         fi
6153 fi
6154
6155 if test $ol_with_yielding_select = yes ; then
6156         cat >> confdefs.h <<\EOF
6157 #define HAVE_YIELDING_SELECT 1
6158 EOF
6159
6160 fi
6161
6162 if test $ol_with_threads = manual ; then
6163                 ol_link_threads=yes
6164
6165         echo "configure: warning: thread defines and link options must be set manually" 1>&2
6166
6167         for ac_hdr in pthread.h sched.h
6168 do
6169 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6170 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6171 echo "configure:6172: checking for $ac_hdr" >&5
6172 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6173   echo $ac_n "(cached) $ac_c" 1>&6
6174 else
6175   cat > conftest.$ac_ext <<EOF
6176 #line 6177 "configure"
6177 #include "confdefs.h"
6178 #include <$ac_hdr>
6179 EOF
6180 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6181 { (eval echo configure:6182: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6182 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6183 if test -z "$ac_err"; then
6184   rm -rf conftest*
6185   eval "ac_cv_header_$ac_safe=yes"
6186 else
6187   echo "$ac_err" >&5
6188   echo "configure: failed program was:" >&5
6189   cat conftest.$ac_ext >&5
6190   rm -rf conftest*
6191   eval "ac_cv_header_$ac_safe=no"
6192 fi
6193 rm -f conftest*
6194 fi
6195 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6196   echo "$ac_t""yes" 1>&6
6197     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6198   cat >> confdefs.h <<EOF
6199 #define $ac_tr_hdr 1
6200 EOF
6201  
6202 else
6203   echo "$ac_t""no" 1>&6
6204 fi
6205 done
6206
6207         for ac_func in sched_yield pthread_yield
6208 do
6209 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6210 echo "configure:6211: checking for $ac_func" >&5
6211 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6212   echo $ac_n "(cached) $ac_c" 1>&6
6213 else
6214   cat > conftest.$ac_ext <<EOF
6215 #line 6216 "configure"
6216 #include "confdefs.h"
6217 /* System header to define __stub macros and hopefully few prototypes,
6218     which can conflict with char $ac_func(); below.  */
6219 #include <assert.h>
6220 /* Override any gcc2 internal prototype to avoid an error.  */
6221 /* We use char because int might match the return type of a gcc2
6222     builtin and then its argument prototype would still apply.  */
6223 char $ac_func();
6224
6225 int main() {
6226
6227 /* The GNU C library defines this for functions which it implements
6228     to always fail with ENOSYS.  Some functions are actually named
6229     something starting with __ and the normal name is an alias.  */
6230 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6231 choke me
6232 #else
6233 $ac_func();
6234 #endif
6235
6236 ; return 0; }
6237 EOF
6238 if { (eval echo configure:6239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6239   rm -rf conftest*
6240   eval "ac_cv_func_$ac_func=yes"
6241 else
6242   echo "configure: failed program was:" >&5
6243   cat conftest.$ac_ext >&5
6244   rm -rf conftest*
6245   eval "ac_cv_func_$ac_func=no"
6246 fi
6247 rm -f conftest*
6248 fi
6249
6250 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6251   echo "$ac_t""yes" 1>&6
6252     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6253   cat >> confdefs.h <<EOF
6254 #define $ac_tr_func 1
6255 EOF
6256  
6257 else
6258   echo "$ac_t""no" 1>&6
6259 fi
6260 done
6261
6262         
6263 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
6264 echo "configure:6265: checking for LinuxThreads" >&5
6265 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
6266   echo $ac_n "(cached) $ac_c" 1>&6
6267 else
6268   
6269         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
6270         if test "$res" -gt 0 ; then
6271                 ol_cv_linux_threads=yes
6272         else
6273                 ol_cv_linux_threads=no
6274         fi
6275
6276 fi
6277
6278 echo "$ac_t""$ol_cv_linux_threads" 1>&6
6279
6280
6281         for ac_hdr in mach/cthreads.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_hdr in lwp/lwp.h
6322 do
6323 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6324 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6325 echo "configure:6326: checking for $ac_hdr" >&5
6326 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6327   echo $ac_n "(cached) $ac_c" 1>&6
6328 else
6329   cat > conftest.$ac_ext <<EOF
6330 #line 6331 "configure"
6331 #include "confdefs.h"
6332 #include <$ac_hdr>
6333 EOF
6334 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6335 { (eval echo configure:6336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6336 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6337 if test -z "$ac_err"; then
6338   rm -rf conftest*
6339   eval "ac_cv_header_$ac_safe=yes"
6340 else
6341   echo "$ac_err" >&5
6342   echo "configure: failed program was:" >&5
6343   cat conftest.$ac_ext >&5
6344   rm -rf conftest*
6345   eval "ac_cv_header_$ac_safe=no"
6346 fi
6347 rm -f conftest*
6348 fi
6349 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6350   echo "$ac_t""yes" 1>&6
6351     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6352   cat >> confdefs.h <<EOF
6353 #define $ac_tr_hdr 1
6354 EOF
6355  
6356 else
6357   echo "$ac_t""no" 1>&6
6358 fi
6359 done
6360
6361         for ac_hdr in thread.h synch.h
6362 do
6363 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6364 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6365 echo "configure:6366: checking for $ac_hdr" >&5
6366 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6367   echo $ac_n "(cached) $ac_c" 1>&6
6368 else
6369   cat > conftest.$ac_ext <<EOF
6370 #line 6371 "configure"
6371 #include "confdefs.h"
6372 #include <$ac_hdr>
6373 EOF
6374 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6375 { (eval echo configure:6376: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6376 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6377 if test -z "$ac_err"; then
6378   rm -rf conftest*
6379   eval "ac_cv_header_$ac_safe=yes"
6380 else
6381   echo "$ac_err" >&5
6382   echo "configure: failed program was:" >&5
6383   cat conftest.$ac_ext >&5
6384   rm -rf conftest*
6385   eval "ac_cv_header_$ac_safe=no"
6386 fi
6387 rm -f conftest*
6388 fi
6389 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6390   echo "$ac_t""yes" 1>&6
6391     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6392   cat >> confdefs.h <<EOF
6393 #define $ac_tr_hdr 1
6394 EOF
6395  
6396 else
6397   echo "$ac_t""no" 1>&6
6398 fi
6399 done
6400
6401 fi
6402
6403 if test $ol_link_threads != no ; then  
6404                         cat >> confdefs.h <<\EOF
6405 #define REENTRANT 1
6406 EOF
6407
6408         cat >> confdefs.h <<\EOF
6409 #define _REENTRANT 1
6410 EOF
6411
6412         cat >> confdefs.h <<\EOF
6413 #define THREAD_SAFE 1
6414 EOF
6415
6416         cat >> confdefs.h <<\EOF
6417 #define _THREAD_SAFE 1
6418 EOF
6419
6420         cat >> confdefs.h <<\EOF
6421 #define THREADSAFE 1
6422 EOF
6423
6424         cat >> confdefs.h <<\EOF
6425 #define _THREADSAFE 1
6426 EOF
6427
6428
6429                                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
6430 echo "configure:6431: checking for thread specific errno" >&5
6431 if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
6432   echo $ac_n "(cached) $ac_c" 1>&6
6433 else
6434   
6435                 cat > conftest.$ac_ext <<EOF
6436 #line 6437 "configure"
6437 #include "confdefs.h"
6438 #include <errno.h>
6439 int main() {
6440 int x = errno;
6441 ; return 0; }
6442 EOF
6443 if { (eval echo configure:6444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6444   rm -rf conftest*
6445   ol_cv_errno_thread_specific=yes
6446 else
6447   echo "configure: failed program was:" >&5
6448   cat conftest.$ac_ext >&5
6449   rm -rf conftest*
6450   ol_cv_errno_thread_specific=no
6451 fi
6452 rm -f conftest*
6453         
6454 fi
6455
6456 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
6457
6458         if test $ol_cv_errno_thread_specific != yes ; then
6459                 LIBS="$LTHREAD_LIBS $LIBS"
6460                 LTHREAD_LIBS=""
6461         fi
6462
6463 fi  
6464
6465
6466 if test $ol_link_threads = no ; then
6467         if test $ol_with_threads = yes ; then
6468                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
6469         fi
6470
6471         if test $ol_with_threads = auto ; then
6472                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
6473                 ol_with_threads=no
6474         fi
6475
6476         cat >> confdefs.h <<\EOF
6477 #define NO_THREADS 1
6478 EOF
6479
6480         LTHREAD_LIBS=""
6481 fi
6482
6483 ol_link_ldbm=no 
6484 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
6485         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
6486 echo "configure:6487: checking for DB2 library" >&5
6487 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
6488   echo $ac_n "(cached) $ac_c" 1>&6
6489 else
6490         ol_LIBS="$LIBS"
6491         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
6492 echo "configure:6493: checking for db_open in -ldb" >&5
6493 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
6494 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6495   echo $ac_n "(cached) $ac_c" 1>&6
6496 else
6497   ac_save_LIBS="$LIBS"
6498 LIBS="-ldb  $LIBS"
6499 cat > conftest.$ac_ext <<EOF
6500 #line 6501 "configure"
6501 #include "confdefs.h"
6502 /* Override any gcc2 internal prototype to avoid an error.  */
6503 /* We use char because int might match the return type of a gcc2
6504     builtin and then its argument prototype would still apply.  */
6505 char db_open();
6506
6507 int main() {
6508 db_open()
6509 ; return 0; }
6510 EOF
6511 if { (eval echo configure:6512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6512   rm -rf conftest*
6513   eval "ac_cv_lib_$ac_lib_var=yes"
6514 else
6515   echo "configure: failed program was:" >&5
6516   cat conftest.$ac_ext >&5
6517   rm -rf conftest*
6518   eval "ac_cv_lib_$ac_lib_var=no"
6519 fi
6520 rm -f conftest*
6521 LIBS="$ac_save_LIBS"
6522
6523 fi
6524 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6525   echo "$ac_t""yes" 1>&6
6526   ol_cv_lib_db2=-ldb
6527 else
6528   echo "$ac_t""no" 1>&6
6529 ol_cv_lib_db2=no
6530 fi
6531
6532         LIBS="$ol_LIBS"
6533
6534 fi
6535
6536 echo "$ac_t""$ol_cv_lib_db2" 1>&6
6537
6538 for ac_hdr in db.h
6539 do
6540 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6541 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6542 echo "configure:6543: checking for $ac_hdr" >&5
6543 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6544   echo $ac_n "(cached) $ac_c" 1>&6
6545 else
6546   cat > conftest.$ac_ext <<EOF
6547 #line 6548 "configure"
6548 #include "confdefs.h"
6549 #include <$ac_hdr>
6550 EOF
6551 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6552 { (eval echo configure:6553: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6553 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6554 if test -z "$ac_err"; then
6555   rm -rf conftest*
6556   eval "ac_cv_header_$ac_safe=yes"
6557 else
6558   echo "$ac_err" >&5
6559   echo "configure: failed program was:" >&5
6560   cat conftest.$ac_ext >&5
6561   rm -rf conftest*
6562   eval "ac_cv_header_$ac_safe=no"
6563 fi
6564 rm -f conftest*
6565 fi
6566 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6567   echo "$ac_t""yes" 1>&6
6568     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6569   cat >> confdefs.h <<EOF
6570 #define $ac_tr_hdr 1
6571 EOF
6572  
6573 else
6574   echo "$ac_t""no" 1>&6
6575 fi
6576 done
6577
6578 if test $ac_cv_header_db_h = yes ; then
6579         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
6580 echo "configure:6581: checking if db.h is DB2" >&5
6581 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
6582   echo $ac_n "(cached) $ac_c" 1>&6
6583 else
6584   
6585                 cat > conftest.$ac_ext <<EOF
6586 #line 6587 "configure"
6587 #include "confdefs.h"
6588
6589 #                       include <db.h>
6590                         /* this check could be improved */
6591 #                       ifdef DB_VERSION_MAJOR
6592 #                               if DB_VERSION_MAJOR == 2
6593                                         __db_version_2
6594 #                               endif
6595 #                       endif
6596                 
6597 EOF
6598 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6599   egrep "__db_version_2" >/dev/null 2>&1; then
6600   rm -rf conftest*
6601   ol_cv_header_db2=yes
6602 else
6603   rm -rf conftest*
6604   ol_cv_header_db2=no
6605 fi
6606 rm -f conftest*
6607
6608 fi
6609
6610 echo "$ac_t""$ol_cv_header_db2" 1>&6
6611 else
6612         ol_cv_header_db2=no
6613 fi
6614
6615
6616  
6617  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
6618 echo "configure:6619: checking for Berkeley DB2" >&5
6619 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
6620   echo $ac_n "(cached) $ac_c" 1>&6
6621 else
6622   
6623         if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then
6624                 ol_cv_berkeley_db2=no
6625         else
6626                 ol_cv_berkeley_db2=yes
6627         fi
6628
6629 fi
6630
6631 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
6632  if test $ol_cv_berkeley_db2 = yes ; then
6633         cat >> confdefs.h <<\EOF
6634 #define HAVE_BERKELEY_DB2 1
6635 EOF
6636
6637  fi
6638
6639
6640         if test $ol_cv_berkeley_db2 = yes ; then
6641                 ol_link_ldbm=db2
6642                 ol_with_ldbm_api=db2
6643
6644                 if test $ol_with_ldbm_type = hash ; then
6645                         cat >> confdefs.h <<\EOF
6646 #define LDBM_USE_DBHASH 1
6647 EOF
6648
6649                 else
6650                         cat >> confdefs.h <<\EOF
6651 #define LDBM_USE_DBBTREE 1
6652 EOF
6653
6654                 fi
6655
6656                                                 if test $ol_cv_lib_db2 != yes ; then
6657                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
6658                 fi
6659         fi
6660 fi
6661
6662 ol_link_bdb2=no
6663 if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
6664         ol_link_bdb2=yes
6665 fi
6666
6667 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
6668         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
6669 echo "configure:6670: checking for Berkeley DB library" >&5
6670 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
6671   echo $ac_n "(cached) $ac_c" 1>&6
6672 else
6673         ol_LIBS="$LIBS"
6674         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
6675 echo "configure:6676: checking for dbopen" >&5
6676 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
6677   echo $ac_n "(cached) $ac_c" 1>&6
6678 else
6679   cat > conftest.$ac_ext <<EOF
6680 #line 6681 "configure"
6681 #include "confdefs.h"
6682 /* System header to define __stub macros and hopefully few prototypes,
6683     which can conflict with char dbopen(); below.  */
6684 #include <assert.h>
6685 /* Override any gcc2 internal prototype to avoid an error.  */
6686 /* We use char because int might match the return type of a gcc2
6687     builtin and then its argument prototype would still apply.  */
6688 char dbopen();
6689
6690 int main() {
6691
6692 /* The GNU C library defines this for functions which it implements
6693     to always fail with ENOSYS.  Some functions are actually named
6694     something starting with __ and the normal name is an alias.  */
6695 #if defined (__stub_dbopen) || defined (__stub___dbopen)
6696 choke me
6697 #else
6698 dbopen();
6699 #endif
6700
6701 ; return 0; }
6702 EOF
6703 if { (eval echo configure:6704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6704   rm -rf conftest*
6705   eval "ac_cv_func_dbopen=yes"
6706 else
6707   echo "configure: failed program was:" >&5
6708   cat conftest.$ac_ext >&5
6709   rm -rf conftest*
6710   eval "ac_cv_func_dbopen=no"
6711 fi
6712 rm -f conftest*
6713 fi
6714
6715 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
6716   echo "$ac_t""yes" 1>&6
6717   ol_cv_lib_db=yes
6718 else
6719   echo "$ac_t""no" 1>&6
6720
6721                 echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
6722 echo "configure:6723: checking for dbopen in -ldb" >&5
6723 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
6724 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6725   echo $ac_n "(cached) $ac_c" 1>&6
6726 else
6727   ac_save_LIBS="$LIBS"
6728 LIBS="-ldb  $LIBS"
6729 cat > conftest.$ac_ext <<EOF
6730 #line 6731 "configure"
6731 #include "confdefs.h"
6732 /* Override any gcc2 internal prototype to avoid an error.  */
6733 /* We use char because int might match the return type of a gcc2
6734     builtin and then its argument prototype would still apply.  */
6735 char dbopen();
6736
6737 int main() {
6738 dbopen()
6739 ; return 0; }
6740 EOF
6741 if { (eval echo configure:6742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6742   rm -rf conftest*
6743   eval "ac_cv_lib_$ac_lib_var=yes"
6744 else
6745   echo "configure: failed program was:" >&5
6746   cat conftest.$ac_ext >&5
6747   rm -rf conftest*
6748   eval "ac_cv_lib_$ac_lib_var=no"
6749 fi
6750 rm -f conftest*
6751 LIBS="$ac_save_LIBS"
6752
6753 fi
6754 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6755   echo "$ac_t""yes" 1>&6
6756   ol_cv_lib_db=-ldb
6757 else
6758   echo "$ac_t""no" 1>&6
6759 ol_cv_lib_db=no
6760 fi
6761
6762         
6763 fi
6764
6765         LIBS="$ol_LIBS"
6766
6767 fi
6768
6769 echo "$ac_t""$ol_cv_lib_db" 1>&6
6770
6771
6772 for ac_hdr in db_185.h
6773 do
6774 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6775 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6776 echo "configure:6777: checking for $ac_hdr" >&5
6777 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6778   echo $ac_n "(cached) $ac_c" 1>&6
6779 else
6780   cat > conftest.$ac_ext <<EOF
6781 #line 6782 "configure"
6782 #include "confdefs.h"
6783 #include <$ac_hdr>
6784 EOF
6785 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6786 { (eval echo configure:6787: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6787 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6788 if test -z "$ac_err"; then
6789   rm -rf conftest*
6790   eval "ac_cv_header_$ac_safe=yes"
6791 else
6792   echo "$ac_err" >&5
6793   echo "configure: failed program was:" >&5
6794   cat conftest.$ac_ext >&5
6795   rm -rf conftest*
6796   eval "ac_cv_header_$ac_safe=no"
6797 fi
6798 rm -f conftest*
6799 fi
6800 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6801   echo "$ac_t""yes" 1>&6
6802     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6803   cat >> confdefs.h <<EOF
6804 #define $ac_tr_hdr 1
6805 EOF
6806  
6807 else
6808   echo "$ac_t""no" 1>&6
6809 fi
6810 done
6811
6812 if test "$ol_cv_header_db2" = yes ; then
6813         
6814         ol_cv_header_db=$ac_cv_header_db_185_h
6815 else
6816         ol_cv_header_db=$ac_cv_header_db_h
6817 fi
6818
6819
6820  
6821  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
6822 echo "configure:6823: checking for Berkeley DB" >&5
6823 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
6824   echo $ac_n "(cached) $ac_c" 1>&6
6825 else
6826   
6827         if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then
6828                 ol_cv_berkeley_db=no
6829         else
6830                 ol_cv_berkeley_db=yes
6831         fi
6832
6833 fi
6834
6835 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
6836  if test $ol_cv_berkeley_db = yes ; then
6837         cat >> confdefs.h <<\EOF
6838 #define HAVE_BERKELEY_DB 1
6839 EOF
6840
6841  fi
6842
6843
6844         if test $ol_cv_berkeley_db = yes ; then
6845                 ol_link_ldbm=db
6846                 ol_with_ldbm_api=db
6847
6848                 if test $ol_with_ldbm_type = hash ; then
6849                         cat >> confdefs.h <<\EOF
6850 #define LDBM_USE_DBHASH 1
6851 EOF
6852
6853                 else
6854                         cat >> confdefs.h <<\EOF
6855 #define LDBM_USE_DBBTREE 1
6856 EOF
6857
6858                 fi
6859
6860                                                 if test $ol_cv_lib_db != yes ; then
6861                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
6862                 fi
6863         fi
6864 fi
6865
6866 if test $ol_with_ldbm_api = manual ; then
6867                 ol_link_ldbm=yes
6868
6869         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
6870
6871         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
6872 do
6873 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6874 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6875 echo "configure:6876: checking for $ac_hdr" >&5
6876 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6877   echo $ac_n "(cached) $ac_c" 1>&6
6878 else
6879   cat > conftest.$ac_ext <<EOF
6880 #line 6881 "configure"
6881 #include "confdefs.h"
6882 #include <$ac_hdr>
6883 EOF
6884 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6885 { (eval echo configure:6886: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6886 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6887 if test -z "$ac_err"; then
6888   rm -rf conftest*
6889   eval "ac_cv_header_$ac_safe=yes"
6890 else
6891   echo "$ac_err" >&5
6892   echo "configure: failed program was:" >&5
6893   cat conftest.$ac_ext >&5
6894   rm -rf conftest*
6895   eval "ac_cv_header_$ac_safe=no"
6896 fi
6897 rm -f conftest*
6898 fi
6899 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6900   echo "$ac_t""yes" 1>&6
6901     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6902   cat >> confdefs.h <<EOF
6903 #define $ac_tr_hdr 1
6904 EOF
6905  
6906 else
6907   echo "$ac_t""no" 1>&6
6908 fi
6909 done
6910
6911 fi
6912
6913 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
6914         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
6915         ol_with_ldbm_api=none
6916 fi
6917
6918 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
6919         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
6920 echo "configure:6921: checking for GDBM library" >&5
6921 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
6922   echo $ac_n "(cached) $ac_c" 1>&6
6923 else
6924         ol_LIBS="$LIBS"
6925         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
6926 echo "configure:6927: checking for gdbm_open" >&5
6927 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
6928   echo $ac_n "(cached) $ac_c" 1>&6
6929 else
6930   cat > conftest.$ac_ext <<EOF
6931 #line 6932 "configure"
6932 #include "confdefs.h"
6933 /* System header to define __stub macros and hopefully few prototypes,
6934     which can conflict with char gdbm_open(); below.  */
6935 #include <assert.h>
6936 /* Override any gcc2 internal prototype to avoid an error.  */
6937 /* We use char because int might match the return type of a gcc2
6938     builtin and then its argument prototype would still apply.  */
6939 char gdbm_open();
6940
6941 int main() {
6942
6943 /* The GNU C library defines this for functions which it implements
6944     to always fail with ENOSYS.  Some functions are actually named
6945     something starting with __ and the normal name is an alias.  */
6946 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
6947 choke me
6948 #else
6949 gdbm_open();
6950 #endif
6951
6952 ; return 0; }
6953 EOF
6954 if { (eval echo configure:6955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6955   rm -rf conftest*
6956   eval "ac_cv_func_gdbm_open=yes"
6957 else
6958   echo "configure: failed program was:" >&5
6959   cat conftest.$ac_ext >&5
6960   rm -rf conftest*
6961   eval "ac_cv_func_gdbm_open=no"
6962 fi
6963 rm -f conftest*
6964 fi
6965
6966 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
6967   echo "$ac_t""yes" 1>&6
6968   ol_cv_lib_gdbm=yes
6969 else
6970   echo "$ac_t""no" 1>&6
6971
6972                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
6973 echo "configure:6974: checking for gdbm_open in -lgdbm" >&5
6974 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
6975 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6976   echo $ac_n "(cached) $ac_c" 1>&6
6977 else
6978   ac_save_LIBS="$LIBS"
6979 LIBS="-lgdbm  $LIBS"
6980 cat > conftest.$ac_ext <<EOF
6981 #line 6982 "configure"
6982 #include "confdefs.h"
6983 /* Override any gcc2 internal prototype to avoid an error.  */
6984 /* We use char because int might match the return type of a gcc2
6985     builtin and then its argument prototype would still apply.  */
6986 char gdbm_open();
6987
6988 int main() {
6989 gdbm_open()
6990 ; return 0; }
6991 EOF
6992 if { (eval echo configure:6993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6993   rm -rf conftest*
6994   eval "ac_cv_lib_$ac_lib_var=yes"
6995 else
6996   echo "configure: failed program was:" >&5
6997   cat conftest.$ac_ext >&5
6998   rm -rf conftest*
6999   eval "ac_cv_lib_$ac_lib_var=no"
7000 fi
7001 rm -f conftest*
7002 LIBS="$ac_save_LIBS"
7003
7004 fi
7005 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7006   echo "$ac_t""yes" 1>&6
7007   ol_cv_lib_gdbm=-lgdbm
7008 else
7009   echo "$ac_t""no" 1>&6
7010 ol_cv_lib_gdbm=no
7011 fi
7012
7013         
7014 fi
7015
7016         LIBS="$ol_LIBS"
7017
7018 fi
7019
7020 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
7021
7022
7023  for ac_hdr in gdbm.h
7024 do
7025 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7026 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7027 echo "configure:7028: checking for $ac_hdr" >&5
7028 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7029   echo $ac_n "(cached) $ac_c" 1>&6
7030 else
7031   cat > conftest.$ac_ext <<EOF
7032 #line 7033 "configure"
7033 #include "confdefs.h"
7034 #include <$ac_hdr>
7035 EOF
7036 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7037 { (eval echo configure:7038: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7038 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7039 if test -z "$ac_err"; then
7040   rm -rf conftest*
7041   eval "ac_cv_header_$ac_safe=yes"
7042 else
7043   echo "$ac_err" >&5
7044   echo "configure: failed program was:" >&5
7045   cat conftest.$ac_ext >&5
7046   rm -rf conftest*
7047   eval "ac_cv_header_$ac_safe=no"
7048 fi
7049 rm -f conftest*
7050 fi
7051 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7052   echo "$ac_t""yes" 1>&6
7053     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7054   cat >> confdefs.h <<EOF
7055 #define $ac_tr_hdr 1
7056 EOF
7057  
7058 else
7059   echo "$ac_t""no" 1>&6
7060 fi
7061 done
7062
7063  echo $ac_n "checking for db""... $ac_c" 1>&6
7064 echo "configure:7065: checking for db" >&5
7065 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
7066   echo $ac_n "(cached) $ac_c" 1>&6
7067 else
7068   
7069         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
7070                 ol_cv_gdbm=no
7071         else
7072                 ol_cv_gdbm=yes
7073         fi
7074
7075 fi
7076
7077 echo "$ac_t""$ol_cv_gdbm" 1>&6
7078  if test $ol_cv_gdbm = yes ; then
7079         cat >> confdefs.h <<\EOF
7080 #define HAVE_GDBM 1
7081 EOF
7082
7083  fi
7084
7085
7086         if test $ol_cv_gdbm = yes ; then
7087                 ol_link_ldbm=gdbm
7088                 ol_with_ldbm_api=gdbm
7089
7090                 if test $ol_cv_lib_gdbm != yes ; then
7091                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
7092                 fi
7093         fi
7094 fi
7095
7096 if test $ol_with_ldbm_api = auto ; then
7097         echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
7098 elif test $ol_with_ldbm_api = ndbm ; then
7099         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
7100 echo "configure:7101: checking for NDBM library" >&5
7101 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
7102   echo $ac_n "(cached) $ac_c" 1>&6
7103 else
7104         ol_LIBS="$LIBS"
7105         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
7106 echo "configure:7107: checking for dbm_open" >&5
7107 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
7108   echo $ac_n "(cached) $ac_c" 1>&6
7109 else
7110   cat > conftest.$ac_ext <<EOF
7111 #line 7112 "configure"
7112 #include "confdefs.h"
7113 /* System header to define __stub macros and hopefully few prototypes,
7114     which can conflict with char dbm_open(); below.  */
7115 #include <assert.h>
7116 /* Override any gcc2 internal prototype to avoid an error.  */
7117 /* We use char because int might match the return type of a gcc2
7118     builtin and then its argument prototype would still apply.  */
7119 char dbm_open();
7120
7121 int main() {
7122
7123 /* The GNU C library defines this for functions which it implements
7124     to always fail with ENOSYS.  Some functions are actually named
7125     something starting with __ and the normal name is an alias.  */
7126 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
7127 choke me
7128 #else
7129 dbm_open();
7130 #endif
7131
7132 ; return 0; }
7133 EOF
7134 if { (eval echo configure:7135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7135   rm -rf conftest*
7136   eval "ac_cv_func_dbm_open=yes"
7137 else
7138   echo "configure: failed program was:" >&5
7139   cat conftest.$ac_ext >&5
7140   rm -rf conftest*
7141   eval "ac_cv_func_dbm_open=no"
7142 fi
7143 rm -f conftest*
7144 fi
7145
7146 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
7147   echo "$ac_t""yes" 1>&6
7148   ol_cv_lib_ndbm=yes
7149 else
7150   echo "$ac_t""no" 1>&6
7151
7152                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
7153 echo "configure:7154: checking for dbm_open in -lndbm" >&5
7154 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
7155 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7156   echo $ac_n "(cached) $ac_c" 1>&6
7157 else
7158   ac_save_LIBS="$LIBS"
7159 LIBS="-lndbm  $LIBS"
7160 cat > conftest.$ac_ext <<EOF
7161 #line 7162 "configure"
7162 #include "confdefs.h"
7163 /* Override any gcc2 internal prototype to avoid an error.  */
7164 /* We use char because int might match the return type of a gcc2
7165     builtin and then its argument prototype would still apply.  */
7166 char dbm_open();
7167
7168 int main() {
7169 dbm_open()
7170 ; return 0; }
7171 EOF
7172 if { (eval echo configure:7173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7173   rm -rf conftest*
7174   eval "ac_cv_lib_$ac_lib_var=yes"
7175 else
7176   echo "configure: failed program was:" >&5
7177   cat conftest.$ac_ext >&5
7178   rm -rf conftest*
7179   eval "ac_cv_lib_$ac_lib_var=no"
7180 fi
7181 rm -f conftest*
7182 LIBS="$ac_save_LIBS"
7183
7184 fi
7185 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7186   echo "$ac_t""yes" 1>&6
7187   ol_cv_lib_ndbm=-lndbm
7188 else
7189   echo "$ac_t""no" 1>&6
7190
7191                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
7192 echo "configure:7193: checking for dbm_open in -ldbm" >&5
7193 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
7194 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7195   echo $ac_n "(cached) $ac_c" 1>&6
7196 else
7197   ac_save_LIBS="$LIBS"
7198 LIBS="-ldbm  $LIBS"
7199 cat > conftest.$ac_ext <<EOF
7200 #line 7201 "configure"
7201 #include "confdefs.h"
7202 /* Override any gcc2 internal prototype to avoid an error.  */
7203 /* We use char because int might match the return type of a gcc2
7204     builtin and then its argument prototype would still apply.  */
7205 char dbm_open();
7206
7207 int main() {
7208 dbm_open()
7209 ; return 0; }
7210 EOF
7211 if { (eval echo configure:7212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7212   rm -rf conftest*
7213   eval "ac_cv_lib_$ac_lib_var=yes"
7214 else
7215   echo "configure: failed program was:" >&5
7216   cat conftest.$ac_ext >&5
7217   rm -rf conftest*
7218   eval "ac_cv_lib_$ac_lib_var=no"
7219 fi
7220 rm -f conftest*
7221 LIBS="$ac_save_LIBS"
7222
7223 fi
7224 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7225   echo "$ac_t""yes" 1>&6
7226   ol_cv_lib_ndbm=-ldbm
7227 else
7228   echo "$ac_t""no" 1>&6
7229 ol_cv_lib_ndbm=no
7230 fi
7231                 
7232 fi
7233
7234         
7235 fi
7236
7237         LIBS="$ol_LIBS"
7238
7239 fi
7240
7241 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
7242
7243
7244  for ac_hdr in ndbm.h
7245 do
7246 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7247 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7248 echo "configure:7249: checking for $ac_hdr" >&5
7249 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7250   echo $ac_n "(cached) $ac_c" 1>&6
7251 else
7252   cat > conftest.$ac_ext <<EOF
7253 #line 7254 "configure"
7254 #include "confdefs.h"
7255 #include <$ac_hdr>
7256 EOF
7257 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7258 { (eval echo configure:7259: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7259 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7260 if test -z "$ac_err"; then
7261   rm -rf conftest*
7262   eval "ac_cv_header_$ac_safe=yes"
7263 else
7264   echo "$ac_err" >&5
7265   echo "configure: failed program was:" >&5
7266   cat conftest.$ac_ext >&5
7267   rm -rf conftest*
7268   eval "ac_cv_header_$ac_safe=no"
7269 fi
7270 rm -f conftest*
7271 fi
7272 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7273   echo "$ac_t""yes" 1>&6
7274     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7275   cat >> confdefs.h <<EOF
7276 #define $ac_tr_hdr 1
7277 EOF
7278  
7279 else
7280   echo "$ac_t""no" 1>&6
7281 fi
7282 done
7283
7284  echo $ac_n "checking for db""... $ac_c" 1>&6
7285 echo "configure:7286: checking for db" >&5
7286 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
7287   echo $ac_n "(cached) $ac_c" 1>&6
7288 else
7289   
7290         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
7291                 ol_cv_ndbm=no
7292         else
7293                 ol_cv_ndbm=yes
7294         fi
7295
7296 fi
7297
7298 echo "$ac_t""$ol_cv_ndbm" 1>&6
7299  if test $ol_cv_ndbm = yes ; then
7300         cat >> confdefs.h <<\EOF
7301 #define HAVE_NDBM 1
7302 EOF
7303
7304  fi
7305
7306
7307         if test $ol_cv_ndbm = yes ; then
7308                 ol_link_ldbm=ndbm
7309                 ol_with_ldbm_api=ndbm
7310
7311                 if test $ol_cv_lib_ndbm != yes ; then
7312                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
7313                 fi
7314         fi
7315 fi
7316
7317 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
7318         echo "configure: warning: could not find suitable LDBM backend" 1>&2
7319         if test $ol_enable_ldbm = yes ; then
7320                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
7321         fi
7322
7323         echo "configure: warning: disabling LDBM" 1>&2
7324         ol_enable_ldbm=no
7325 fi
7326
7327 if test $ol_enable_wrappers != no ; then
7328         for ac_hdr in tcpd.h
7329 do
7330 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7331 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7332 echo "configure:7333: checking for $ac_hdr" >&5
7333 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7334   echo $ac_n "(cached) $ac_c" 1>&6
7335 else
7336   cat > conftest.$ac_ext <<EOF
7337 #line 7338 "configure"
7338 #include "confdefs.h"
7339 #include <$ac_hdr>
7340 EOF
7341 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7342 { (eval echo configure:7343: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7343 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7344 if test -z "$ac_err"; then
7345   rm -rf conftest*
7346   eval "ac_cv_header_$ac_safe=yes"
7347 else
7348   echo "$ac_err" >&5
7349   echo "configure: failed program was:" >&5
7350   cat conftest.$ac_ext >&5
7351   rm -rf conftest*
7352   eval "ac_cv_header_$ac_safe=no"
7353 fi
7354 rm -f conftest*
7355 fi
7356 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7357   echo "$ac_t""yes" 1>&6
7358     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7359   cat >> confdefs.h <<EOF
7360 #define $ac_tr_hdr 1
7361 EOF
7362  
7363 else
7364   echo "$ac_t""no" 1>&6
7365 fi
7366 done
7367
7368
7369         if test $ac_cv_header_tcpd_h != yes ; then
7370                 have_wrappers=no
7371         else
7372                 echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
7373 echo "configure:7374: checking for main in -lwrap" >&5
7374 ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'`
7375 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7376   echo $ac_n "(cached) $ac_c" 1>&6
7377 else
7378   ac_save_LIBS="$LIBS"
7379 LIBS="-lwrap  $LIBS"
7380 cat > conftest.$ac_ext <<EOF
7381 #line 7382 "configure"
7382 #include "confdefs.h"
7383
7384 int main() {
7385 main()
7386 ; return 0; }
7387 EOF
7388 if { (eval echo configure:7389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7389   rm -rf conftest*
7390   eval "ac_cv_lib_$ac_lib_var=yes"
7391 else
7392   echo "configure: failed program was:" >&5
7393   cat conftest.$ac_ext >&5
7394   rm -rf conftest*
7395   eval "ac_cv_lib_$ac_lib_var=no"
7396 fi
7397 rm -f conftest*
7398 LIBS="$ac_save_LIBS"
7399
7400 fi
7401 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7402   echo "$ac_t""yes" 1>&6
7403   have_wrappers=yes
7404 else
7405   echo "$ac_t""no" 1>&6
7406 have_wrappers=no
7407 fi
7408
7409         fi
7410
7411         if test $have_wrappers = yes ; then
7412                 cat >> confdefs.h <<\EOF
7413 #define HAVE_TCPD 1
7414 EOF
7415
7416                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
7417         else
7418                 echo "configure: warning: could not find -lwrap" 1>&2
7419                 if test $ol_enable_wrappers = yes ; then
7420                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
7421                 fi
7422
7423                 echo "configure: warning: disabling wrappers support" 1>&2
7424                 ol_enable_wrappers=no
7425         fi
7426 fi
7427
7428 if test $ol_enable_syslog != no ; then
7429         echo $ac_n "checking for openlog""... $ac_c" 1>&6
7430 echo "configure:7431: checking for openlog" >&5
7431 if eval "test \"`echo '$''{'ac_cv_func_openlog'+set}'`\" = set"; then
7432   echo $ac_n "(cached) $ac_c" 1>&6
7433 else
7434   cat > conftest.$ac_ext <<EOF
7435 #line 7436 "configure"
7436 #include "confdefs.h"
7437 /* System header to define __stub macros and hopefully few prototypes,
7438     which can conflict with char openlog(); below.  */
7439 #include <assert.h>
7440 /* Override any gcc2 internal prototype to avoid an error.  */
7441 /* We use char because int might match the return type of a gcc2
7442     builtin and then its argument prototype would still apply.  */
7443 char openlog();
7444
7445 int main() {
7446
7447 /* The GNU C library defines this for functions which it implements
7448     to always fail with ENOSYS.  Some functions are actually named
7449     something starting with __ and the normal name is an alias.  */
7450 #if defined (__stub_openlog) || defined (__stub___openlog)
7451 choke me
7452 #else
7453 openlog();
7454 #endif
7455
7456 ; return 0; }
7457 EOF
7458 if { (eval echo configure:7459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7459   rm -rf conftest*
7460   eval "ac_cv_func_openlog=yes"
7461 else
7462   echo "configure: failed program was:" >&5
7463   cat conftest.$ac_ext >&5
7464   rm -rf conftest*
7465   eval "ac_cv_func_openlog=no"
7466 fi
7467 rm -f conftest*
7468 fi
7469
7470 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
7471   echo "$ac_t""yes" 1>&6
7472   :
7473 else
7474   echo "$ac_t""no" 1>&6
7475 fi
7476
7477         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
7478                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
7479         fi
7480         ol_enable_syslog=$ac_cv_func_openlog
7481 fi
7482
7483 if test $ol_enable_dmalloc != no ; then
7484         for ac_hdr in dmalloc.h
7485 do
7486 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7487 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7488 echo "configure:7489: checking for $ac_hdr" >&5
7489 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7490   echo $ac_n "(cached) $ac_c" 1>&6
7491 else
7492   cat > conftest.$ac_ext <<EOF
7493 #line 7494 "configure"
7494 #include "confdefs.h"
7495 #include <$ac_hdr>
7496 EOF
7497 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7498 { (eval echo configure:7499: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7499 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7500 if test -z "$ac_err"; then
7501   rm -rf conftest*
7502   eval "ac_cv_header_$ac_safe=yes"
7503 else
7504   echo "$ac_err" >&5
7505   echo "configure: failed program was:" >&5
7506   cat conftest.$ac_ext >&5
7507   rm -rf conftest*
7508   eval "ac_cv_header_$ac_safe=no"
7509 fi
7510 rm -f conftest*
7511 fi
7512 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7513   echo "$ac_t""yes" 1>&6
7514     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7515   cat >> confdefs.h <<EOF
7516 #define $ac_tr_hdr 1
7517 EOF
7518  
7519 else
7520   echo "$ac_t""no" 1>&6
7521 fi
7522 done
7523
7524         echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
7525 echo "configure:7526: checking for dmalloc_shutdown in -ldmalloc" >&5
7526 ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-%__p_%'`
7527 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7528   echo $ac_n "(cached) $ac_c" 1>&6
7529 else
7530   ac_save_LIBS="$LIBS"
7531 LIBS="-ldmalloc  $LIBS"
7532 cat > conftest.$ac_ext <<EOF
7533 #line 7534 "configure"
7534 #include "confdefs.h"
7535 /* Override any gcc2 internal prototype to avoid an error.  */
7536 /* We use char because int might match the return type of a gcc2
7537     builtin and then its argument prototype would still apply.  */
7538 char dmalloc_shutdown();
7539
7540 int main() {
7541 dmalloc_shutdown()
7542 ; return 0; }
7543 EOF
7544 if { (eval echo configure:7545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7545   rm -rf conftest*
7546   eval "ac_cv_lib_$ac_lib_var=yes"
7547 else
7548   echo "configure: failed program was:" >&5
7549   cat conftest.$ac_ext >&5
7550   rm -rf conftest*
7551   eval "ac_cv_lib_$ac_lib_var=no"
7552 fi
7553 rm -f conftest*
7554 LIBS="$ac_save_LIBS"
7555
7556 fi
7557 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7558   echo "$ac_t""yes" 1>&6
7559     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7560     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7561   cat >> confdefs.h <<EOF
7562 #define $ac_tr_lib 1
7563 EOF
7564
7565   LIBS="-ldmalloc $LIBS"
7566
7567 else
7568   echo "$ac_t""no" 1>&6
7569 fi
7570
7571 fi
7572
7573 if test $ol_enable_tcl != no ; then
7574         for ac_hdr in tcl.h
7575 do
7576 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7577 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7578 echo "configure:7579: checking for $ac_hdr" >&5
7579 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7580   echo $ac_n "(cached) $ac_c" 1>&6
7581 else
7582   cat > conftest.$ac_ext <<EOF
7583 #line 7584 "configure"
7584 #include "confdefs.h"
7585 #include <$ac_hdr>
7586 EOF
7587 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7588 { (eval echo configure:7589: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7589 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7590 if test -z "$ac_err"; then
7591   rm -rf conftest*
7592   eval "ac_cv_header_$ac_safe=yes"
7593 else
7594   echo "$ac_err" >&5
7595   echo "configure: failed program was:" >&5
7596   cat conftest.$ac_ext >&5
7597   rm -rf conftest*
7598   eval "ac_cv_header_$ac_safe=no"
7599 fi
7600 rm -f conftest*
7601 fi
7602 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7603   echo "$ac_t""yes" 1>&6
7604     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7605   cat >> confdefs.h <<EOF
7606 #define $ac_tr_hdr 1
7607 EOF
7608  
7609 else
7610   echo "$ac_t""no" 1>&6
7611 fi
7612 done
7613
7614
7615         if test $ac_cv_header_tcl_h != yes ; then
7616                 have_tcl=no
7617         else
7618                 echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6
7619 echo "configure:7620: checking for main in -ltcl" >&5
7620 ac_lib_var=`echo tcl'_'main | sed 'y%./+-%__p_%'`
7621 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7622   echo $ac_n "(cached) $ac_c" 1>&6
7623 else
7624   ac_save_LIBS="$LIBS"
7625 LIBS="-ltcl  $LIBS"
7626 cat > conftest.$ac_ext <<EOF
7627 #line 7628 "configure"
7628 #include "confdefs.h"
7629
7630 int main() {
7631 main()
7632 ; return 0; }
7633 EOF
7634 if { (eval echo configure:7635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7635   rm -rf conftest*
7636   eval "ac_cv_lib_$ac_lib_var=yes"
7637 else
7638   echo "configure: failed program was:" >&5
7639   cat conftest.$ac_ext >&5
7640   rm -rf conftest*
7641   eval "ac_cv_lib_$ac_lib_var=no"
7642 fi
7643 rm -f conftest*
7644 LIBS="$ac_save_LIBS"
7645
7646 fi
7647 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7648   echo "$ac_t""yes" 1>&6
7649   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"
7650 else
7651   echo "$ac_t""no" 1>&6
7652 have_tcl=no
7653 fi
7654
7655
7656                 if test $have_tcl != yes; then
7657                         echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6
7658 echo "configure:7659: checking for main in -ltcl7.6" >&5
7659 ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-%__p_%'`
7660 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7661   echo $ac_n "(cached) $ac_c" 1>&6
7662 else
7663   ac_save_LIBS="$LIBS"
7664 LIBS="-ltcl7.6  $LIBS"
7665 cat > conftest.$ac_ext <<EOF
7666 #line 7667 "configure"
7667 #include "confdefs.h"
7668
7669 int main() {
7670 main()
7671 ; return 0; }
7672 EOF
7673 if { (eval echo configure:7674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7674   rm -rf conftest*
7675   eval "ac_cv_lib_$ac_lib_var=yes"
7676 else
7677   echo "configure: failed program was:" >&5
7678   cat conftest.$ac_ext >&5
7679   rm -rf conftest*
7680   eval "ac_cv_lib_$ac_lib_var=no"
7681 fi
7682 rm -f conftest*
7683 LIBS="$ac_save_LIBS"
7684
7685 fi
7686 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7687   echo "$ac_t""yes" 1>&6
7688   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"
7689 else
7690   echo "$ac_t""no" 1>&6
7691 have_tcl=no
7692 fi
7693
7694                 fi
7695
7696                 if test $have_tcl != yes; then
7697                         echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6
7698 echo "configure:7699: checking for main in -ltcl8.0" >&5
7699 ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-%__p_%'`
7700 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7701   echo $ac_n "(cached) $ac_c" 1>&6
7702 else
7703   ac_save_LIBS="$LIBS"
7704 LIBS="-ltcl8.0  $LIBS"
7705 cat > conftest.$ac_ext <<EOF
7706 #line 7707 "configure"
7707 #include "confdefs.h"
7708
7709 int main() {
7710 main()
7711 ; return 0; }
7712 EOF
7713 if { (eval echo configure:7714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7714   rm -rf conftest*
7715   eval "ac_cv_lib_$ac_lib_var=yes"
7716 else
7717   echo "configure: failed program was:" >&5
7718   cat conftest.$ac_ext >&5
7719   rm -rf conftest*
7720   eval "ac_cv_lib_$ac_lib_var=no"
7721 fi
7722 rm -f conftest*
7723 LIBS="$ac_save_LIBS"
7724
7725 fi
7726 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7727   echo "$ac_t""yes" 1>&6
7728   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"
7729 else
7730   echo "$ac_t""no" 1>&6
7731 have_tcl=no
7732 fi
7733
7734                 fi
7735         fi
7736
7737         if test $have_tcl != yes ; then
7738                 echo "configure: warning: could not find -ltcl" 1>&2
7739                 if test $ol_enable_tcl = yes ; then
7740                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
7741                 fi
7742
7743                 ol_enable_tcl=no
7744         fi
7745 fi
7746
7747 # ud needs termcap (should insert check here)
7748 ol_link_termcap=no
7749 for ac_hdr in termcap.h ncurses.h
7750 do
7751 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7752 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7753 echo "configure:7754: checking for $ac_hdr" >&5
7754 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7755   echo $ac_n "(cached) $ac_c" 1>&6
7756 else
7757   cat > conftest.$ac_ext <<EOF
7758 #line 7759 "configure"
7759 #include "confdefs.h"
7760 #include <$ac_hdr>
7761 EOF
7762 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7763 { (eval echo configure:7764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7764 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7765 if test -z "$ac_err"; then
7766   rm -rf conftest*
7767   eval "ac_cv_header_$ac_safe=yes"
7768 else
7769   echo "$ac_err" >&5
7770   echo "configure: failed program was:" >&5
7771   cat conftest.$ac_ext >&5
7772   rm -rf conftest*
7773   eval "ac_cv_header_$ac_safe=no"
7774 fi
7775 rm -f conftest*
7776 fi
7777 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7778   echo "$ac_t""yes" 1>&6
7779     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7780   cat >> confdefs.h <<EOF
7781 #define $ac_tr_hdr 1
7782 EOF
7783  
7784 else
7785   echo "$ac_t""no" 1>&6
7786 fi
7787 done
7788
7789
7790 if test $ol_link_termcap = no ; then
7791         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
7792 echo "configure:7793: checking for tputs in -ltermcap" >&5
7793 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
7794 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7795   echo $ac_n "(cached) $ac_c" 1>&6
7796 else
7797   ac_save_LIBS="$LIBS"
7798 LIBS="-ltermcap  $LIBS"
7799 cat > conftest.$ac_ext <<EOF
7800 #line 7801 "configure"
7801 #include "confdefs.h"
7802 /* Override any gcc2 internal prototype to avoid an error.  */
7803 /* We use char because int might match the return type of a gcc2
7804     builtin and then its argument prototype would still apply.  */
7805 char tputs();
7806
7807 int main() {
7808 tputs()
7809 ; return 0; }
7810 EOF
7811 if { (eval echo configure:7812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7812   rm -rf conftest*
7813   eval "ac_cv_lib_$ac_lib_var=yes"
7814 else
7815   echo "configure: failed program was:" >&5
7816   cat conftest.$ac_ext >&5
7817   rm -rf conftest*
7818   eval "ac_cv_lib_$ac_lib_var=no"
7819 fi
7820 rm -f conftest*
7821 LIBS="$ac_save_LIBS"
7822
7823 fi
7824 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7825   echo "$ac_t""yes" 1>&6
7826   have_termcap=yes
7827 else
7828   echo "$ac_t""no" 1>&6
7829 have_termcap=no
7830 fi
7831
7832         if test $have_termcap = yes ; then
7833                 cat >> confdefs.h <<\EOF
7834 #define HAVE_TERMCAP 1
7835 EOF
7836
7837                 ol_link_termcap=yes
7838                 TERMCAP_LIBS=-ltermcap
7839         fi
7840 fi
7841
7842 if test $ol_link_termcap = no ; then
7843         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
7844 echo "configure:7845: checking for initscr in -lncurses" >&5
7845 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
7846 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7847   echo $ac_n "(cached) $ac_c" 1>&6
7848 else
7849   ac_save_LIBS="$LIBS"
7850 LIBS="-lncurses  $LIBS"
7851 cat > conftest.$ac_ext <<EOF
7852 #line 7853 "configure"
7853 #include "confdefs.h"
7854 /* Override any gcc2 internal prototype to avoid an error.  */
7855 /* We use char because int might match the return type of a gcc2
7856     builtin and then its argument prototype would still apply.  */
7857 char initscr();
7858
7859 int main() {
7860 initscr()
7861 ; return 0; }
7862 EOF
7863 if { (eval echo configure:7864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7864   rm -rf conftest*
7865   eval "ac_cv_lib_$ac_lib_var=yes"
7866 else
7867   echo "configure: failed program was:" >&5
7868   cat conftest.$ac_ext >&5
7869   rm -rf conftest*
7870   eval "ac_cv_lib_$ac_lib_var=no"
7871 fi
7872 rm -f conftest*
7873 LIBS="$ac_save_LIBS"
7874
7875 fi
7876 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7877   echo "$ac_t""yes" 1>&6
7878   have_ncurses=yes
7879 else
7880   echo "$ac_t""no" 1>&6
7881 have_ncurses=no
7882 fi
7883
7884         if test $have_ncurses = yes ; then
7885                 cat >> confdefs.h <<\EOF
7886 #define HAVE_NCURSES 1
7887 EOF
7888
7889                 ol_link_termcap=yes
7890                 TERMCAP_LIBS=-lncurses
7891         fi
7892 fi
7893
7894 if test $ol_link_termcap = no ; then
7895         cat >> confdefs.h <<\EOF
7896 #define NO_TERMCAP 1
7897 EOF
7898
7899         TERMCAP_LIBS=
7900 fi
7901
7902 # FreeBSD (and others) have crypt(3) in -lcrypt
7903 if test $ol_enable_crypt != no ; then
7904         echo $ac_n "checking for crypt""... $ac_c" 1>&6
7905 echo "configure:7906: checking for crypt" >&5
7906 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
7907   echo $ac_n "(cached) $ac_c" 1>&6
7908 else
7909   cat > conftest.$ac_ext <<EOF
7910 #line 7911 "configure"
7911 #include "confdefs.h"
7912 /* System header to define __stub macros and hopefully few prototypes,
7913     which can conflict with char crypt(); below.  */
7914 #include <assert.h>
7915 /* Override any gcc2 internal prototype to avoid an error.  */
7916 /* We use char because int might match the return type of a gcc2
7917     builtin and then its argument prototype would still apply.  */
7918 char crypt();
7919
7920 int main() {
7921
7922 /* The GNU C library defines this for functions which it implements
7923     to always fail with ENOSYS.  Some functions are actually named
7924     something starting with __ and the normal name is an alias.  */
7925 #if defined (__stub_crypt) || defined (__stub___crypt)
7926 choke me
7927 #else
7928 crypt();
7929 #endif
7930
7931 ; return 0; }
7932 EOF
7933 if { (eval echo configure:7934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7934   rm -rf conftest*
7935   eval "ac_cv_func_crypt=yes"
7936 else
7937   echo "configure: failed program was:" >&5
7938   cat conftest.$ac_ext >&5
7939   rm -rf conftest*
7940   eval "ac_cv_func_crypt=no"
7941 fi
7942 rm -f conftest*
7943 fi
7944
7945 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
7946   echo "$ac_t""yes" 1>&6
7947   have_crypt=yes
7948 else
7949   echo "$ac_t""no" 1>&6
7950
7951                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
7952 echo "configure:7953: checking for crypt in -lcrypt" >&5
7953 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
7954 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7955   echo $ac_n "(cached) $ac_c" 1>&6
7956 else
7957   ac_save_LIBS="$LIBS"
7958 LIBS="-lcrypt  $LIBS"
7959 cat > conftest.$ac_ext <<EOF
7960 #line 7961 "configure"
7961 #include "confdefs.h"
7962 /* Override any gcc2 internal prototype to avoid an error.  */
7963 /* We use char because int might match the return type of a gcc2
7964     builtin and then its argument prototype would still apply.  */
7965 char crypt();
7966
7967 int main() {
7968 crypt()
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   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
7987                         have_crypt=yes
7988 else
7989   echo "$ac_t""no" 1>&6
7990 have_crypt=no
7991 fi
7992
7993 fi
7994
7995
7996         if test $have_crypt = yes ; then
7997                 cat >> confdefs.h <<\EOF
7998 #define HAVE_CRYPT 1
7999 EOF
8000
8001         else
8002                 echo "configure: warning: could not find crypt" 1>&2
8003                 if test $ol_enable_crypt = yes ; then
8004                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
8005                 fi
8006
8007                 echo "configure: warning: disabling crypt support" 1>&2
8008                 ol_enable_crypt=no
8009         fi
8010 fi
8011
8012 # FreeBSD (and others) have setproctitle(3) in -lutil
8013 if test $ol_enable_proctitle != no ; then
8014         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
8015 echo "configure:8016: checking for setproctitle" >&5
8016 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
8017   echo $ac_n "(cached) $ac_c" 1>&6
8018 else
8019   cat > conftest.$ac_ext <<EOF
8020 #line 8021 "configure"
8021 #include "confdefs.h"
8022 /* System header to define __stub macros and hopefully few prototypes,
8023     which can conflict with char setproctitle(); below.  */
8024 #include <assert.h>
8025 /* Override any gcc2 internal prototype to avoid an error.  */
8026 /* We use char because int might match the return type of a gcc2
8027     builtin and then its argument prototype would still apply.  */
8028 char setproctitle();
8029
8030 int main() {
8031
8032 /* The GNU C library defines this for functions which it implements
8033     to always fail with ENOSYS.  Some functions are actually named
8034     something starting with __ and the normal name is an alias.  */
8035 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
8036 choke me
8037 #else
8038 setproctitle();
8039 #endif
8040
8041 ; return 0; }
8042 EOF
8043 if { (eval echo configure:8044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8044   rm -rf conftest*
8045   eval "ac_cv_func_setproctitle=yes"
8046 else
8047   echo "configure: failed program was:" >&5
8048   cat conftest.$ac_ext >&5
8049   rm -rf conftest*
8050   eval "ac_cv_func_setproctitle=no"
8051 fi
8052 rm -f conftest*
8053 fi
8054
8055 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
8056   echo "$ac_t""yes" 1>&6
8057   have_setproctitle=yes
8058 else
8059   echo "$ac_t""no" 1>&6
8060
8061                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
8062 echo "configure:8063: checking for setproctitle in -lutil" >&5
8063 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
8064 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8065   echo $ac_n "(cached) $ac_c" 1>&6
8066 else
8067   ac_save_LIBS="$LIBS"
8068 LIBS="-lutil  $LIBS"
8069 cat > conftest.$ac_ext <<EOF
8070 #line 8071 "configure"
8071 #include "confdefs.h"
8072 /* Override any gcc2 internal prototype to avoid an error.  */
8073 /* We use char because int might match the return type of a gcc2
8074     builtin and then its argument prototype would still apply.  */
8075 char setproctitle();
8076
8077 int main() {
8078 setproctitle()
8079 ; return 0; }
8080 EOF
8081 if { (eval echo configure:8082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8082   rm -rf conftest*
8083   eval "ac_cv_lib_$ac_lib_var=yes"
8084 else
8085   echo "configure: failed program was:" >&5
8086   cat conftest.$ac_ext >&5
8087   rm -rf conftest*
8088   eval "ac_cv_lib_$ac_lib_var=no"
8089 fi
8090 rm -f conftest*
8091 LIBS="$ac_save_LIBS"
8092
8093 fi
8094 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8095   echo "$ac_t""yes" 1>&6
8096   have_setproctitle=yes
8097                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
8098 else
8099   echo "$ac_t""no" 1>&6
8100 have_setproctitle=no
8101                         LIBOBJS="$LIBOBJS setproctitle.o"
8102 fi
8103
8104 fi
8105
8106
8107         if test $have_setproctitle = yes ; then
8108                 cat >> confdefs.h <<\EOF
8109 #define HAVE_SETPROCTITLE 1
8110 EOF
8111
8112         fi
8113 fi
8114
8115 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
8116 echo "configure:8117: checking for ANSI C header files" >&5
8117 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
8118   echo $ac_n "(cached) $ac_c" 1>&6
8119 else
8120   cat > conftest.$ac_ext <<EOF
8121 #line 8122 "configure"
8122 #include "confdefs.h"
8123 #include <stdlib.h>
8124 #include <stdarg.h>
8125 #include <string.h>
8126 #include <float.h>
8127 EOF
8128 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8129 { (eval echo configure:8130: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8130 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8131 if test -z "$ac_err"; then
8132   rm -rf conftest*
8133   ac_cv_header_stdc=yes
8134 else
8135   echo "$ac_err" >&5
8136   echo "configure: failed program was:" >&5
8137   cat conftest.$ac_ext >&5
8138   rm -rf conftest*
8139   ac_cv_header_stdc=no
8140 fi
8141 rm -f conftest*
8142
8143 if test $ac_cv_header_stdc = yes; then
8144   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
8145 cat > conftest.$ac_ext <<EOF
8146 #line 8147 "configure"
8147 #include "confdefs.h"
8148 #include <string.h>
8149 EOF
8150 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8151   egrep "memchr" >/dev/null 2>&1; then
8152   :
8153 else
8154   rm -rf conftest*
8155   ac_cv_header_stdc=no
8156 fi
8157 rm -f conftest*
8158
8159 fi
8160
8161 if test $ac_cv_header_stdc = yes; then
8162   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
8163 cat > conftest.$ac_ext <<EOF
8164 #line 8165 "configure"
8165 #include "confdefs.h"
8166 #include <stdlib.h>
8167 EOF
8168 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8169   egrep "free" >/dev/null 2>&1; then
8170   :
8171 else
8172   rm -rf conftest*
8173   ac_cv_header_stdc=no
8174 fi
8175 rm -f conftest*
8176
8177 fi
8178
8179 if test $ac_cv_header_stdc = yes; then
8180   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
8181 if test "$cross_compiling" = yes; then
8182   :
8183 else
8184   cat > conftest.$ac_ext <<EOF
8185 #line 8186 "configure"
8186 #include "confdefs.h"
8187 #include <ctype.h>
8188 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
8189 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
8190 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
8191 int main () { int i; for (i = 0; i < 256; i++)
8192 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
8193 exit (0); }
8194
8195 EOF
8196 if { (eval echo configure:8197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8197 then
8198   :
8199 else
8200   echo "configure: failed program was:" >&5
8201   cat conftest.$ac_ext >&5
8202   rm -fr conftest*
8203   ac_cv_header_stdc=no
8204 fi
8205 rm -fr conftest*
8206 fi
8207
8208 fi
8209 fi
8210
8211 echo "$ac_t""$ac_cv_header_stdc" 1>&6
8212 if test $ac_cv_header_stdc = yes; then
8213   cat >> confdefs.h <<\EOF
8214 #define STDC_HEADERS 1
8215 EOF
8216
8217 fi
8218
8219
8220 if test $ac_cv_header_stdc != yes; then
8221         echo "configure: warning: could not Standard C compliant headers" 1>&2
8222 fi
8223
8224 ac_header_dirent=no
8225 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
8226 do
8227 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8228 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
8229 echo "configure:8230: checking for $ac_hdr that defines DIR" >&5
8230 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
8231   echo $ac_n "(cached) $ac_c" 1>&6
8232 else
8233   cat > conftest.$ac_ext <<EOF
8234 #line 8235 "configure"
8235 #include "confdefs.h"
8236 #include <sys/types.h>
8237 #include <$ac_hdr>
8238 int main() {
8239 DIR *dirp = 0;
8240 ; return 0; }
8241 EOF
8242 if { (eval echo configure:8243: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8243   rm -rf conftest*
8244   eval "ac_cv_header_dirent_$ac_safe=yes"
8245 else
8246   echo "configure: failed program was:" >&5
8247   cat conftest.$ac_ext >&5
8248   rm -rf conftest*
8249   eval "ac_cv_header_dirent_$ac_safe=no"
8250 fi
8251 rm -f conftest*
8252 fi
8253 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
8254   echo "$ac_t""yes" 1>&6
8255     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8256   cat >> confdefs.h <<EOF
8257 #define $ac_tr_hdr 1
8258 EOF
8259  ac_header_dirent=$ac_hdr; break
8260 else
8261   echo "$ac_t""no" 1>&6
8262 fi
8263 done
8264 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
8265 if test $ac_header_dirent = dirent.h; then
8266 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
8267 echo "configure:8268: checking for opendir in -ldir" >&5
8268 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
8269 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8270   echo $ac_n "(cached) $ac_c" 1>&6
8271 else
8272   ac_save_LIBS="$LIBS"
8273 LIBS="-ldir  $LIBS"
8274 cat > conftest.$ac_ext <<EOF
8275 #line 8276 "configure"
8276 #include "confdefs.h"
8277 /* Override any gcc2 internal prototype to avoid an error.  */
8278 /* We use char because int might match the return type of a gcc2
8279     builtin and then its argument prototype would still apply.  */
8280 char opendir();
8281
8282 int main() {
8283 opendir()
8284 ; return 0; }
8285 EOF
8286 if { (eval echo configure:8287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8287   rm -rf conftest*
8288   eval "ac_cv_lib_$ac_lib_var=yes"
8289 else
8290   echo "configure: failed program was:" >&5
8291   cat conftest.$ac_ext >&5
8292   rm -rf conftest*
8293   eval "ac_cv_lib_$ac_lib_var=no"
8294 fi
8295 rm -f conftest*
8296 LIBS="$ac_save_LIBS"
8297
8298 fi
8299 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8300   echo "$ac_t""yes" 1>&6
8301   LIBS="$LIBS -ldir"
8302 else
8303   echo "$ac_t""no" 1>&6
8304 fi
8305
8306 else
8307 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
8308 echo "configure:8309: checking for opendir in -lx" >&5
8309 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
8310 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8311   echo $ac_n "(cached) $ac_c" 1>&6
8312 else
8313   ac_save_LIBS="$LIBS"
8314 LIBS="-lx  $LIBS"
8315 cat > conftest.$ac_ext <<EOF
8316 #line 8317 "configure"
8317 #include "confdefs.h"
8318 /* Override any gcc2 internal prototype to avoid an error.  */
8319 /* We use char because int might match the return type of a gcc2
8320     builtin and then its argument prototype would still apply.  */
8321 char opendir();
8322
8323 int main() {
8324 opendir()
8325 ; return 0; }
8326 EOF
8327 if { (eval echo configure:8328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8328   rm -rf conftest*
8329   eval "ac_cv_lib_$ac_lib_var=yes"
8330 else
8331   echo "configure: failed program was:" >&5
8332   cat conftest.$ac_ext >&5
8333   rm -rf conftest*
8334   eval "ac_cv_lib_$ac_lib_var=no"
8335 fi
8336 rm -f conftest*
8337 LIBS="$ac_save_LIBS"
8338
8339 fi
8340 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8341   echo "$ac_t""yes" 1>&6
8342   LIBS="$LIBS -lx"
8343 else
8344   echo "$ac_t""no" 1>&6
8345 fi
8346
8347 fi
8348
8349 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
8350 echo "configure:8351: checking for sys/wait.h that is POSIX.1 compatible" >&5
8351 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
8352   echo $ac_n "(cached) $ac_c" 1>&6
8353 else
8354   cat > conftest.$ac_ext <<EOF
8355 #line 8356 "configure"
8356 #include "confdefs.h"
8357 #include <sys/types.h>
8358 #include <sys/wait.h>
8359 #ifndef WEXITSTATUS
8360 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
8361 #endif
8362 #ifndef WIFEXITED
8363 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
8364 #endif
8365 int main() {
8366 int s;
8367 wait (&s);
8368 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
8369 ; return 0; }
8370 EOF
8371 if { (eval echo configure:8372: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8372   rm -rf conftest*
8373   ac_cv_header_sys_wait_h=yes
8374 else
8375   echo "configure: failed program was:" >&5
8376   cat conftest.$ac_ext >&5
8377   rm -rf conftest*
8378   ac_cv_header_sys_wait_h=no
8379 fi
8380 rm -f conftest*
8381 fi
8382
8383 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
8384 if test $ac_cv_header_sys_wait_h = yes; then
8385   cat >> confdefs.h <<\EOF
8386 #define HAVE_SYS_WAIT_H 1
8387 EOF
8388
8389 fi
8390
8391 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
8392 echo "configure:8393: checking POSIX termios" >&5
8393 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
8394   echo $ac_n "(cached) $ac_c" 1>&6
8395 else
8396   cat > conftest.$ac_ext <<EOF
8397 #line 8398 "configure"
8398 #include "confdefs.h"
8399 #include <sys/types.h>
8400 #include <unistd.h>
8401 #include <termios.h>
8402 int main() {
8403 /* SunOS 4.0.3 has termios.h but not the library calls.  */
8404    tcgetattr(0, 0);
8405 ; return 0; }
8406 EOF
8407 if { (eval echo configure:8408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8408   rm -rf conftest*
8409   am_cv_sys_posix_termios=yes
8410 else
8411   echo "configure: failed program was:" >&5
8412   cat conftest.$ac_ext >&5
8413   rm -rf conftest*
8414   am_cv_sys_posix_termios=no
8415 fi
8416 rm -f conftest*
8417 fi
8418
8419 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
8420
8421
8422  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
8423 echo "configure:8424: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
8424 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
8425   echo $ac_n "(cached) $ac_c" 1>&6
8426 else
8427   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
8428
8429   gwinsz_in_termios_h=no
8430   if test $am_cv_sys_posix_termios = yes; then
8431     cat > conftest.$ac_ext <<EOF
8432 #line 8433 "configure"
8433 #include "confdefs.h"
8434 #include <sys/types.h>
8435 #     include <termios.h>
8436 #     ifdef TIOCGWINSZ
8437         yes
8438 #     endif
8439     
8440 EOF
8441 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8442   egrep "yes" >/dev/null 2>&1; then
8443   rm -rf conftest*
8444   gwinsz_in_termios_h=yes
8445 fi
8446 rm -f conftest*
8447
8448   fi
8449
8450   if test $gwinsz_in_termios_h = no; then
8451     cat > conftest.$ac_ext <<EOF
8452 #line 8453 "configure"
8453 #include "confdefs.h"
8454 #include <sys/types.h>
8455 #     include <sys/ioctl.h>
8456 #     ifdef TIOCGWINSZ
8457         yes
8458 #     endif
8459     
8460 EOF
8461 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8462   egrep "yes" >/dev/null 2>&1; then
8463   rm -rf conftest*
8464   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
8465 fi
8466 rm -f conftest*
8467
8468   fi
8469   
8470 fi
8471
8472 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
8473   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
8474     cat >> confdefs.h <<\EOF
8475 #define GWINSZ_IN_SYS_IOCTL 1
8476 EOF
8477
8478   fi
8479
8480 if test $am_cv_sys_posix_termios = yes ; then
8481         cat >> confdefs.h <<\EOF
8482 #define HAVE_POSIX_TERMIOS 1
8483 EOF
8484
8485 fi
8486
8487 for ac_hdr in \
8488         arpa/nameser.h  \
8489         crypt.h                 \
8490         errno.h                 \
8491         fcntl.h                 \
8492         filio.h                 \
8493         getopt.h                \
8494         libutil.h               \
8495         limits.h                \
8496         locale.h                \
8497         malloc.h                \
8498         memory.h                \
8499         regex.h                 \
8500         psap.h                  \
8501         pwd.h                   \
8502         resolv.h                \
8503         sgtty.h                 \
8504         stdarg.h                \
8505         stddef.h                \
8506         string.h                \
8507         strings.h               \
8508         sysexits.h              \
8509         sys/file.h              \
8510         sys/filio.h             \
8511         sys/errno.h             \
8512         sys/ioctl.h             \
8513         sys/param.h             \
8514         sys/resource.h  \
8515         sys/socket.h    \
8516         sys/syslog.h    \
8517         sys/time.h              \
8518         sys/types.h             \
8519         syslog.h                \
8520         termios.h               \
8521         unistd.h                \
8522
8523 do
8524 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8525 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8526 echo "configure:8527: checking for $ac_hdr" >&5
8527 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8528   echo $ac_n "(cached) $ac_c" 1>&6
8529 else
8530   cat > conftest.$ac_ext <<EOF
8531 #line 8532 "configure"
8532 #include "confdefs.h"
8533 #include <$ac_hdr>
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   eval "ac_cv_header_$ac_safe=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   eval "ac_cv_header_$ac_safe=no"
8547 fi
8548 rm -f conftest*
8549 fi
8550 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8551   echo "$ac_t""yes" 1>&6
8552     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8553   cat >> confdefs.h <<EOF
8554 #define $ac_tr_hdr 1
8555 EOF
8556  
8557 else
8558   echo "$ac_t""no" 1>&6
8559 fi
8560 done
8561
8562
8563 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
8564 echo "configure:8565: checking for uid_t in sys/types.h" >&5
8565 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
8566   echo $ac_n "(cached) $ac_c" 1>&6
8567 else
8568   cat > conftest.$ac_ext <<EOF
8569 #line 8570 "configure"
8570 #include "confdefs.h"
8571 #include <sys/types.h>
8572 EOF
8573 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8574   egrep "uid_t" >/dev/null 2>&1; then
8575   rm -rf conftest*
8576   ac_cv_type_uid_t=yes
8577 else
8578   rm -rf conftest*
8579   ac_cv_type_uid_t=no
8580 fi
8581 rm -f conftest*
8582
8583 fi
8584
8585 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
8586 if test $ac_cv_type_uid_t = no; then
8587   cat >> confdefs.h <<\EOF
8588 #define uid_t int
8589 EOF
8590
8591   cat >> confdefs.h <<\EOF
8592 #define gid_t int
8593 EOF
8594
8595 fi
8596
8597 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
8598 echo "configure:8599: checking type of array argument to getgroups" >&5
8599 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
8600   echo $ac_n "(cached) $ac_c" 1>&6
8601 else
8602   if test "$cross_compiling" = yes; then
8603   ac_cv_type_getgroups=cross
8604 else
8605   cat > conftest.$ac_ext <<EOF
8606 #line 8607 "configure"
8607 #include "confdefs.h"
8608
8609 /* Thanks to Mike Rendell for this test.  */
8610 #include <sys/types.h>
8611 #define NGID 256
8612 #undef MAX
8613 #define MAX(x, y) ((x) > (y) ? (x) : (y))
8614 main()
8615 {
8616   gid_t gidset[NGID];
8617   int i, n;
8618   union { gid_t gval; long lval; }  val;
8619
8620   val.lval = -1;
8621   for (i = 0; i < NGID; i++)
8622     gidset[i] = val.gval;
8623   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
8624                  gidset);
8625   /* Exit non-zero if getgroups seems to require an array of ints.  This
8626      happens when gid_t is short but getgroups modifies an array of ints.  */
8627   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
8628 }
8629
8630 EOF
8631 if { (eval echo configure:8632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8632 then
8633     ac_cv_type_getgroups=gid_t
8634 else
8635   echo "configure: failed program was:" >&5
8636   cat conftest.$ac_ext >&5
8637   rm -fr conftest*
8638   ac_cv_type_getgroups=int
8639 fi
8640 rm -fr conftest*
8641 fi
8642
8643 if test $ac_cv_type_getgroups = cross; then
8644         cat > conftest.$ac_ext <<EOF
8645 #line 8646 "configure"
8646 #include "confdefs.h"
8647 #include <unistd.h>
8648 EOF
8649 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8650   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
8651   rm -rf conftest*
8652   ac_cv_type_getgroups=gid_t
8653 else
8654   rm -rf conftest*
8655   ac_cv_type_getgroups=int
8656 fi
8657 rm -f conftest*
8658
8659 fi
8660 fi
8661
8662 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
8663 cat >> confdefs.h <<EOF
8664 #define GETGROUPS_T $ac_cv_type_getgroups
8665 EOF
8666
8667  echo $ac_n "checking for mode_t""... $ac_c" 1>&6
8668 echo "configure:8669: checking for mode_t" >&5
8669 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
8670   echo $ac_n "(cached) $ac_c" 1>&6
8671 else
8672   cat > conftest.$ac_ext <<EOF
8673 #line 8674 "configure"
8674 #include "confdefs.h"
8675 #include <sys/types.h>
8676 #if STDC_HEADERS
8677 #include <stdlib.h>
8678 #include <stddef.h>
8679 #endif
8680 EOF
8681 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8682   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
8683   rm -rf conftest*
8684   ac_cv_type_mode_t=yes
8685 else
8686   rm -rf conftest*
8687   ac_cv_type_mode_t=no
8688 fi
8689 rm -f conftest*
8690
8691 fi
8692 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
8693 if test $ac_cv_type_mode_t = no; then
8694   cat >> confdefs.h <<\EOF
8695 #define mode_t int
8696 EOF
8697
8698 fi
8699
8700 echo $ac_n "checking for off_t""... $ac_c" 1>&6
8701 echo "configure:8702: checking for off_t" >&5
8702 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
8703   echo $ac_n "(cached) $ac_c" 1>&6
8704 else
8705   cat > conftest.$ac_ext <<EOF
8706 #line 8707 "configure"
8707 #include "confdefs.h"
8708 #include <sys/types.h>
8709 #if STDC_HEADERS
8710 #include <stdlib.h>
8711 #include <stddef.h>
8712 #endif
8713 EOF
8714 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8715   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
8716   rm -rf conftest*
8717   ac_cv_type_off_t=yes
8718 else
8719   rm -rf conftest*
8720   ac_cv_type_off_t=no
8721 fi
8722 rm -f conftest*
8723
8724 fi
8725 echo "$ac_t""$ac_cv_type_off_t" 1>&6
8726 if test $ac_cv_type_off_t = no; then
8727   cat >> confdefs.h <<\EOF
8728 #define off_t long
8729 EOF
8730
8731 fi
8732
8733 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
8734 echo "configure:8735: checking for pid_t" >&5
8735 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
8736   echo $ac_n "(cached) $ac_c" 1>&6
8737 else
8738   cat > conftest.$ac_ext <<EOF
8739 #line 8740 "configure"
8740 #include "confdefs.h"
8741 #include <sys/types.h>
8742 #if STDC_HEADERS
8743 #include <stdlib.h>
8744 #include <stddef.h>
8745 #endif
8746 EOF
8747 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8748   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
8749   rm -rf conftest*
8750   ac_cv_type_pid_t=yes
8751 else
8752   rm -rf conftest*
8753   ac_cv_type_pid_t=no
8754 fi
8755 rm -f conftest*
8756
8757 fi
8758 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
8759 if test $ac_cv_type_pid_t = no; then
8760   cat >> confdefs.h <<\EOF
8761 #define pid_t int
8762 EOF
8763
8764 fi
8765
8766 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
8767 echo "configure:8768: checking for ptrdiff_t" >&5
8768 if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then
8769   echo $ac_n "(cached) $ac_c" 1>&6
8770 else
8771   cat > conftest.$ac_ext <<EOF
8772 #line 8773 "configure"
8773 #include "confdefs.h"
8774 #include <stddef.h>
8775 int main() {
8776 ptrdiff_t p
8777 ; return 0; }
8778 EOF
8779 if { (eval echo configure:8780: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8780   rm -rf conftest*
8781   am_cv_type_ptrdiff_t=yes
8782 else
8783   echo "configure: failed program was:" >&5
8784   cat conftest.$ac_ext >&5
8785   rm -rf conftest*
8786   am_cv_type_ptrdiff_t=no
8787 fi
8788 rm -f conftest*
8789 fi
8790
8791 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
8792    if test $am_cv_type_ptrdiff_t = yes; then
8793      cat >> confdefs.h <<\EOF
8794 #define HAVE_PTRDIFF_T 1
8795 EOF
8796
8797    fi
8798
8799 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
8800 echo "configure:8801: checking return type of signal handlers" >&5
8801 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
8802   echo $ac_n "(cached) $ac_c" 1>&6
8803 else
8804   cat > conftest.$ac_ext <<EOF
8805 #line 8806 "configure"
8806 #include "confdefs.h"
8807 #include <sys/types.h>
8808 #include <signal.h>
8809 #ifdef signal
8810 #undef signal
8811 #endif
8812 #ifdef __cplusplus
8813 extern "C" void (*signal (int, void (*)(int)))(int);
8814 #else
8815 void (*signal ()) ();
8816 #endif
8817
8818 int main() {
8819 int i;
8820 ; return 0; }
8821 EOF
8822 if { (eval echo configure:8823: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8823   rm -rf conftest*
8824   ac_cv_type_signal=void
8825 else
8826   echo "configure: failed program was:" >&5
8827   cat conftest.$ac_ext >&5
8828   rm -rf conftest*
8829   ac_cv_type_signal=int
8830 fi
8831 rm -f conftest*
8832 fi
8833
8834 echo "$ac_t""$ac_cv_type_signal" 1>&6
8835 cat >> confdefs.h <<EOF
8836 #define RETSIGTYPE $ac_cv_type_signal
8837 EOF
8838
8839
8840 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
8841 echo "configure:8842: checking for sig_atomic_t" >&5
8842 if eval "test \"`echo '$''{'ol_cv_type_sig_atomic_t'+set}'`\" = set"; then
8843   echo $ac_n "(cached) $ac_c" 1>&6
8844 else
8845   cat > conftest.$ac_ext <<EOF
8846 #line 8847 "configure"
8847 #include "confdefs.h"
8848 #include <signal.h>
8849 int main() {
8850 sig_atomic_t atomic;
8851 ; return 0; }
8852 EOF
8853 if { (eval echo configure:8854: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8854   rm -rf conftest*
8855   ol_cv_type_sig_atomic_t=yes
8856 else
8857   echo "configure: failed program was:" >&5
8858   cat conftest.$ac_ext >&5
8859   rm -rf conftest*
8860   ol_cv_type_sig_atomic_t=no
8861 fi
8862 rm -f conftest*
8863 fi
8864
8865 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
8866   if test $ol_cv_type_sig_atomic_t = no; then
8867     cat >> confdefs.h <<\EOF
8868 #define sig_atomic_t int
8869 EOF
8870
8871   fi
8872  
8873 echo $ac_n "checking for size_t""... $ac_c" 1>&6
8874 echo "configure:8875: checking for size_t" >&5
8875 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
8876   echo $ac_n "(cached) $ac_c" 1>&6
8877 else
8878   cat > conftest.$ac_ext <<EOF
8879 #line 8880 "configure"
8880 #include "confdefs.h"
8881 #include <sys/types.h>
8882 #if STDC_HEADERS
8883 #include <stdlib.h>
8884 #include <stddef.h>
8885 #endif
8886 EOF
8887 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8888   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
8889   rm -rf conftest*
8890   ac_cv_type_size_t=yes
8891 else
8892   rm -rf conftest*
8893   ac_cv_type_size_t=no
8894 fi
8895 rm -f conftest*
8896
8897 fi
8898 echo "$ac_t""$ac_cv_type_size_t" 1>&6
8899 if test $ac_cv_type_size_t = no; then
8900   cat >> confdefs.h <<\EOF
8901 #define size_t unsigned
8902 EOF
8903
8904 fi
8905
8906 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
8907 echo "configure:8908: checking for st_blksize in struct stat" >&5
8908 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
8909   echo $ac_n "(cached) $ac_c" 1>&6
8910 else
8911   cat > conftest.$ac_ext <<EOF
8912 #line 8913 "configure"
8913 #include "confdefs.h"
8914 #include <sys/types.h>
8915 #include <sys/stat.h>
8916 int main() {
8917 struct stat s; s.st_blksize;
8918 ; return 0; }
8919 EOF
8920 if { (eval echo configure:8921: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8921   rm -rf conftest*
8922   ac_cv_struct_st_blksize=yes
8923 else
8924   echo "configure: failed program was:" >&5
8925   cat conftest.$ac_ext >&5
8926   rm -rf conftest*
8927   ac_cv_struct_st_blksize=no
8928 fi
8929 rm -f conftest*
8930 fi
8931
8932 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
8933 if test $ac_cv_struct_st_blksize = yes; then
8934   cat >> confdefs.h <<\EOF
8935 #define HAVE_ST_BLKSIZE 1
8936 EOF
8937
8938 fi
8939
8940 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
8941 echo "configure:8942: checking whether time.h and sys/time.h may both be included" >&5
8942 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
8943   echo $ac_n "(cached) $ac_c" 1>&6
8944 else
8945   cat > conftest.$ac_ext <<EOF
8946 #line 8947 "configure"
8947 #include "confdefs.h"
8948 #include <sys/types.h>
8949 #include <sys/time.h>
8950 #include <time.h>
8951 int main() {
8952 struct tm *tp;
8953 ; return 0; }
8954 EOF
8955 if { (eval echo configure:8956: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8956   rm -rf conftest*
8957   ac_cv_header_time=yes
8958 else
8959   echo "configure: failed program was:" >&5
8960   cat conftest.$ac_ext >&5
8961   rm -rf conftest*
8962   ac_cv_header_time=no
8963 fi
8964 rm -f conftest*
8965 fi
8966
8967 echo "$ac_t""$ac_cv_header_time" 1>&6
8968 if test $ac_cv_header_time = yes; then
8969   cat >> confdefs.h <<\EOF
8970 #define TIME_WITH_SYS_TIME 1
8971 EOF
8972
8973 fi
8974
8975 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
8976 echo "configure:8977: checking whether struct tm is in sys/time.h or time.h" >&5
8977 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
8978   echo $ac_n "(cached) $ac_c" 1>&6
8979 else
8980   cat > conftest.$ac_ext <<EOF
8981 #line 8982 "configure"
8982 #include "confdefs.h"
8983 #include <sys/types.h>
8984 #include <time.h>
8985 int main() {
8986 struct tm *tp; tp->tm_sec;
8987 ; return 0; }
8988 EOF
8989 if { (eval echo configure:8990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8990   rm -rf conftest*
8991   ac_cv_struct_tm=time.h
8992 else
8993   echo "configure: failed program was:" >&5
8994   cat conftest.$ac_ext >&5
8995   rm -rf conftest*
8996   ac_cv_struct_tm=sys/time.h
8997 fi
8998 rm -f conftest*
8999 fi
9000
9001 echo "$ac_t""$ac_cv_struct_tm" 1>&6
9002 if test $ac_cv_struct_tm = sys/time.h; then
9003   cat >> confdefs.h <<\EOF
9004 #define TM_IN_SYS_TIME 1
9005 EOF
9006
9007 fi
9008
9009
9010
9011 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
9012 echo "configure:9013: checking if toupper() requires islower()" >&5
9013 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
9014   echo $ac_n "(cached) $ac_c" 1>&6
9015 else
9016   
9017         if test "$cross_compiling" = yes; then
9018   ol_cv_c_upper_lower=safe
9019 else
9020   cat > conftest.$ac_ext <<EOF
9021 #line 9022 "configure"
9022 #include "confdefs.h"
9023
9024 #include <ctype.h>
9025 main()
9026 {
9027         if ('C' == toupper('C'))
9028                 exit(0);
9029         else
9030                 exit(1);
9031 }
9032 EOF
9033 if { (eval echo configure:9034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9034 then
9035   ol_cv_c_upper_lower=no
9036 else
9037   echo "configure: failed program was:" >&5
9038   cat conftest.$ac_ext >&5
9039   rm -fr conftest*
9040   ol_cv_c_upper_lower=yes
9041 fi
9042 rm -fr conftest*
9043 fi
9044
9045 fi
9046
9047 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
9048 if test $ol_cv_c_upper_lower != no ; then
9049         cat >> confdefs.h <<\EOF
9050 #define C_UPPER_LOWER 1
9051 EOF
9052
9053 fi
9054
9055 echo $ac_n "checking for working const""... $ac_c" 1>&6
9056 echo "configure:9057: checking for working const" >&5
9057 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
9058   echo $ac_n "(cached) $ac_c" 1>&6
9059 else
9060   cat > conftest.$ac_ext <<EOF
9061 #line 9062 "configure"
9062 #include "confdefs.h"
9063
9064 int main() {
9065
9066 /* Ultrix mips cc rejects this.  */
9067 typedef int charset[2]; const charset x;
9068 /* SunOS 4.1.1 cc rejects this.  */
9069 char const *const *ccp;
9070 char **p;
9071 /* NEC SVR4.0.2 mips cc rejects this.  */
9072 struct point {int x, y;};
9073 static struct point const zero = {0,0};
9074 /* AIX XL C 1.02.0.0 rejects this.
9075    It does not let you subtract one const X* pointer from another in an arm
9076    of an if-expression whose if-part is not a constant expression */
9077 const char *g = "string";
9078 ccp = &g + (g ? g-g : 0);
9079 /* HPUX 7.0 cc rejects these. */
9080 ++ccp;
9081 p = (char**) ccp;
9082 ccp = (char const *const *) p;
9083 { /* SCO 3.2v4 cc rejects this.  */
9084   char *t;
9085   char const *s = 0 ? (char *) 0 : (char const *) 0;
9086
9087   *t++ = 0;
9088 }
9089 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
9090   int x[] = {25, 17};
9091   const int *foo = &x[0];
9092   ++foo;
9093 }
9094 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
9095   typedef const int *iptr;
9096   iptr p = 0;
9097   ++p;
9098 }
9099 { /* AIX XL C 1.02.0.0 rejects this saying
9100      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
9101   struct s { int j; const int *ap[3]; };
9102   struct s *b; b->j = 5;
9103 }
9104 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
9105   const int foo = 10;
9106 }
9107
9108 ; return 0; }
9109 EOF
9110 if { (eval echo configure:9111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9111   rm -rf conftest*
9112   ac_cv_c_const=yes
9113 else
9114   echo "configure: failed program was:" >&5
9115   cat conftest.$ac_ext >&5
9116   rm -rf conftest*
9117   ac_cv_c_const=no
9118 fi
9119 rm -f conftest*
9120 fi
9121
9122 echo "$ac_t""$ac_cv_c_const" 1>&6
9123 if test $ac_cv_c_const = no; then
9124   cat >> confdefs.h <<\EOF
9125 #define const 
9126 EOF
9127
9128 fi
9129
9130 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
9131 echo "configure:9132: checking if compiler understands volatile" >&5
9132 if eval "test \"`echo '$''{'ol_cv_c_volatile'+set}'`\" = set"; then
9133   echo $ac_n "(cached) $ac_c" 1>&6
9134 else
9135   cat > conftest.$ac_ext <<EOF
9136 #line 9137 "configure"
9137 #include "confdefs.h"
9138 int x, y, z;
9139 int main() {
9140 volatile int a; int * volatile b = x ? &y : &z;
9141       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
9142       *b = 0;
9143 ; return 0; }
9144 EOF
9145 if { (eval echo configure:9146: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9146   rm -rf conftest*
9147   ol_cv_c_volatile=yes
9148 else
9149   echo "configure: failed program was:" >&5
9150   cat conftest.$ac_ext >&5
9151   rm -rf conftest*
9152   ol_cv_c_volatile=no
9153 fi
9154 rm -f conftest*
9155 fi
9156
9157 echo "$ac_t""$ol_cv_c_volatile" 1>&6
9158   if test $ol_cv_c_volatile = yes; then
9159     : 
9160   else
9161     cat >> confdefs.h <<\EOF
9162 #define volatile 
9163 EOF
9164
9165   fi
9166  
9167
9168 if test $cross_compiling = yes ; then
9169         cat >> confdefs.h <<\EOF
9170 #define CROSS_COMPILING 1
9171 EOF
9172
9173 else
9174         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
9175 echo "configure:9176: checking whether byte ordering is bigendian" >&5
9176 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
9177   echo $ac_n "(cached) $ac_c" 1>&6
9178 else
9179   ac_cv_c_bigendian=unknown
9180 # See if sys/param.h defines the BYTE_ORDER macro.
9181 cat > conftest.$ac_ext <<EOF
9182 #line 9183 "configure"
9183 #include "confdefs.h"
9184 #include <sys/types.h>
9185 #include <sys/param.h>
9186 int main() {
9187
9188 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
9189  bogus endian macros
9190 #endif
9191 ; return 0; }
9192 EOF
9193 if { (eval echo configure:9194: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9194   rm -rf conftest*
9195   # It does; now see whether it defined to BIG_ENDIAN or not.
9196 cat > conftest.$ac_ext <<EOF
9197 #line 9198 "configure"
9198 #include "confdefs.h"
9199 #include <sys/types.h>
9200 #include <sys/param.h>
9201 int main() {
9202
9203 #if BYTE_ORDER != BIG_ENDIAN
9204  not big endian
9205 #endif
9206 ; return 0; }
9207 EOF
9208 if { (eval echo configure:9209: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9209   rm -rf conftest*
9210   ac_cv_c_bigendian=yes
9211 else
9212   echo "configure: failed program was:" >&5
9213   cat conftest.$ac_ext >&5
9214   rm -rf conftest*
9215   ac_cv_c_bigendian=no
9216 fi
9217 rm -f conftest*
9218 else
9219   echo "configure: failed program was:" >&5
9220   cat conftest.$ac_ext >&5
9221 fi
9222 rm -f conftest*
9223 if test $ac_cv_c_bigendian = unknown; then
9224 if test "$cross_compiling" = yes; then
9225     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
9226 else
9227   cat > conftest.$ac_ext <<EOF
9228 #line 9229 "configure"
9229 #include "confdefs.h"
9230 main () {
9231   /* Are we little or big endian?  From Harbison&Steele.  */
9232   union
9233   {
9234     long l;
9235     char c[sizeof (long)];
9236   } u;
9237   u.l = 1;
9238   exit (u.c[sizeof (long) - 1] == 1);
9239 }
9240 EOF
9241 if { (eval echo configure:9242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9242 then
9243   ac_cv_c_bigendian=no
9244 else
9245   echo "configure: failed program was:" >&5
9246   cat conftest.$ac_ext >&5
9247   rm -fr conftest*
9248   ac_cv_c_bigendian=yes
9249 fi
9250 rm -fr conftest*
9251 fi
9252
9253 fi
9254 fi
9255
9256 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
9257 if test $ac_cv_c_bigendian = yes; then
9258   cat >> confdefs.h <<\EOF
9259 #define WORDS_BIGENDIAN 1
9260 EOF
9261
9262 fi
9263
9264         echo $ac_n "checking size of short""... $ac_c" 1>&6
9265 echo "configure:9266: checking size of short" >&5
9266 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
9267   echo $ac_n "(cached) $ac_c" 1>&6
9268 else
9269   if test "$cross_compiling" = yes; then
9270     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
9271 else
9272   cat > conftest.$ac_ext <<EOF
9273 #line 9274 "configure"
9274 #include "confdefs.h"
9275 #include <stdio.h>
9276 main()
9277 {
9278   FILE *f=fopen("conftestval", "w");
9279   if (!f) exit(1);
9280   fprintf(f, "%d\n", sizeof(short));
9281   exit(0);
9282 }
9283 EOF
9284 if { (eval echo configure:9285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9285 then
9286   ac_cv_sizeof_short=`cat conftestval`
9287 else
9288   echo "configure: failed program was:" >&5
9289   cat conftest.$ac_ext >&5
9290   rm -fr conftest*
9291   ac_cv_sizeof_short=0
9292 fi
9293 rm -fr conftest*
9294 fi
9295
9296 fi
9297 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
9298 cat >> confdefs.h <<EOF
9299 #define SIZEOF_SHORT $ac_cv_sizeof_short
9300 EOF
9301
9302  
9303         echo $ac_n "checking size of int""... $ac_c" 1>&6
9304 echo "configure:9305: checking size of int" >&5
9305 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
9306   echo $ac_n "(cached) $ac_c" 1>&6
9307 else
9308   if test "$cross_compiling" = yes; then
9309     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
9310 else
9311   cat > conftest.$ac_ext <<EOF
9312 #line 9313 "configure"
9313 #include "confdefs.h"
9314 #include <stdio.h>
9315 main()
9316 {
9317   FILE *f=fopen("conftestval", "w");
9318   if (!f) exit(1);
9319   fprintf(f, "%d\n", sizeof(int));
9320   exit(0);
9321 }
9322 EOF
9323 if { (eval echo configure:9324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9324 then
9325   ac_cv_sizeof_int=`cat conftestval`
9326 else
9327   echo "configure: failed program was:" >&5
9328   cat conftest.$ac_ext >&5
9329   rm -fr conftest*
9330   ac_cv_sizeof_int=0
9331 fi
9332 rm -fr conftest*
9333 fi
9334
9335 fi
9336 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
9337 cat >> confdefs.h <<EOF
9338 #define SIZEOF_INT $ac_cv_sizeof_int
9339 EOF
9340
9341  
9342         echo $ac_n "checking size of long""... $ac_c" 1>&6
9343 echo "configure:9344: checking size of long" >&5
9344 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
9345   echo $ac_n "(cached) $ac_c" 1>&6
9346 else
9347   if test "$cross_compiling" = yes; then
9348     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
9349 else
9350   cat > conftest.$ac_ext <<EOF
9351 #line 9352 "configure"
9352 #include "confdefs.h"
9353 #include <stdio.h>
9354 main()
9355 {
9356   FILE *f=fopen("conftestval", "w");
9357   if (!f) exit(1);
9358   fprintf(f, "%d\n", sizeof(long));
9359   exit(0);
9360 }
9361 EOF
9362 if { (eval echo configure:9363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9363 then
9364   ac_cv_sizeof_long=`cat conftestval`
9365 else
9366   echo "configure: failed program was:" >&5
9367   cat conftest.$ac_ext >&5
9368   rm -fr conftest*
9369   ac_cv_sizeof_long=0
9370 fi
9371 rm -fr conftest*
9372 fi
9373
9374 fi
9375 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
9376 cat >> confdefs.h <<EOF
9377 #define SIZEOF_LONG $ac_cv_sizeof_long
9378 EOF
9379
9380
9381 fi
9382
9383 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
9384 echo "configure:9385: checking for 8-bit clean memcmp" >&5
9385 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
9386   echo $ac_n "(cached) $ac_c" 1>&6
9387 else
9388   if test "$cross_compiling" = yes; then
9389   ac_cv_func_memcmp_clean=no
9390 else
9391   cat > conftest.$ac_ext <<EOF
9392 #line 9393 "configure"
9393 #include "confdefs.h"
9394
9395 main()
9396 {
9397   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
9398   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
9399 }
9400
9401 EOF
9402 if { (eval echo configure:9403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9403 then
9404   ac_cv_func_memcmp_clean=yes
9405 else
9406   echo "configure: failed program was:" >&5
9407   cat conftest.$ac_ext >&5
9408   rm -fr conftest*
9409   ac_cv_func_memcmp_clean=no
9410 fi
9411 rm -fr conftest*
9412 fi
9413
9414 fi
9415
9416 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
9417 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
9418
9419 echo $ac_n "checking for strftime""... $ac_c" 1>&6
9420 echo "configure:9421: checking for strftime" >&5
9421 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
9422   echo $ac_n "(cached) $ac_c" 1>&6
9423 else
9424   cat > conftest.$ac_ext <<EOF
9425 #line 9426 "configure"
9426 #include "confdefs.h"
9427 /* System header to define __stub macros and hopefully few prototypes,
9428     which can conflict with char strftime(); below.  */
9429 #include <assert.h>
9430 /* Override any gcc2 internal prototype to avoid an error.  */
9431 /* We use char because int might match the return type of a gcc2
9432     builtin and then its argument prototype would still apply.  */
9433 char strftime();
9434
9435 int main() {
9436
9437 /* The GNU C library defines this for functions which it implements
9438     to always fail with ENOSYS.  Some functions are actually named
9439     something starting with __ and the normal name is an alias.  */
9440 #if defined (__stub_strftime) || defined (__stub___strftime)
9441 choke me
9442 #else
9443 strftime();
9444 #endif
9445
9446 ; return 0; }
9447 EOF
9448 if { (eval echo configure:9449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9449   rm -rf conftest*
9450   eval "ac_cv_func_strftime=yes"
9451 else
9452   echo "configure: failed program was:" >&5
9453   cat conftest.$ac_ext >&5
9454   rm -rf conftest*
9455   eval "ac_cv_func_strftime=no"
9456 fi
9457 rm -f conftest*
9458 fi
9459
9460 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
9461   echo "$ac_t""yes" 1>&6
9462   cat >> confdefs.h <<\EOF
9463 #define HAVE_STRFTIME 1
9464 EOF
9465
9466 else
9467   echo "$ac_t""no" 1>&6
9468 # strftime is in -lintl on SCO UNIX.
9469 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
9470 echo "configure:9471: checking for strftime in -lintl" >&5
9471 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
9472 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9473   echo $ac_n "(cached) $ac_c" 1>&6
9474 else
9475   ac_save_LIBS="$LIBS"
9476 LIBS="-lintl  $LIBS"
9477 cat > conftest.$ac_ext <<EOF
9478 #line 9479 "configure"
9479 #include "confdefs.h"
9480 /* Override any gcc2 internal prototype to avoid an error.  */
9481 /* We use char because int might match the return type of a gcc2
9482     builtin and then its argument prototype would still apply.  */
9483 char strftime();
9484
9485 int main() {
9486 strftime()
9487 ; return 0; }
9488 EOF
9489 if { (eval echo configure:9490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9490   rm -rf conftest*
9491   eval "ac_cv_lib_$ac_lib_var=yes"
9492 else
9493   echo "configure: failed program was:" >&5
9494   cat conftest.$ac_ext >&5
9495   rm -rf conftest*
9496   eval "ac_cv_lib_$ac_lib_var=no"
9497 fi
9498 rm -f conftest*
9499 LIBS="$ac_save_LIBS"
9500
9501 fi
9502 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9503   echo "$ac_t""yes" 1>&6
9504   cat >> confdefs.h <<\EOF
9505 #define HAVE_STRFTIME 1
9506 EOF
9507
9508 LIBS="-lintl $LIBS"
9509 else
9510   echo "$ac_t""no" 1>&6
9511 fi
9512
9513 fi
9514
9515 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
9516 echo "configure:9517: checking for vprintf" >&5
9517 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
9518   echo $ac_n "(cached) $ac_c" 1>&6
9519 else
9520   cat > conftest.$ac_ext <<EOF
9521 #line 9522 "configure"
9522 #include "confdefs.h"
9523 /* System header to define __stub macros and hopefully few prototypes,
9524     which can conflict with char vprintf(); below.  */
9525 #include <assert.h>
9526 /* Override any gcc2 internal prototype to avoid an error.  */
9527 /* We use char because int might match the return type of a gcc2
9528     builtin and then its argument prototype would still apply.  */
9529 char vprintf();
9530
9531 int main() {
9532
9533 /* The GNU C library defines this for functions which it implements
9534     to always fail with ENOSYS.  Some functions are actually named
9535     something starting with __ and the normal name is an alias.  */
9536 #if defined (__stub_vprintf) || defined (__stub___vprintf)
9537 choke me
9538 #else
9539 vprintf();
9540 #endif
9541
9542 ; return 0; }
9543 EOF
9544 if { (eval echo configure:9545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9545   rm -rf conftest*
9546   eval "ac_cv_func_vprintf=yes"
9547 else
9548   echo "configure: failed program was:" >&5
9549   cat conftest.$ac_ext >&5
9550   rm -rf conftest*
9551   eval "ac_cv_func_vprintf=no"
9552 fi
9553 rm -f conftest*
9554 fi
9555
9556 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
9557   echo "$ac_t""yes" 1>&6
9558   cat >> confdefs.h <<\EOF
9559 #define HAVE_VPRINTF 1
9560 EOF
9561
9562 else
9563   echo "$ac_t""no" 1>&6
9564 fi
9565
9566 if test "$ac_cv_func_vprintf" != yes; then
9567 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
9568 echo "configure:9569: checking for _doprnt" >&5
9569 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
9570   echo $ac_n "(cached) $ac_c" 1>&6
9571 else
9572   cat > conftest.$ac_ext <<EOF
9573 #line 9574 "configure"
9574 #include "confdefs.h"
9575 /* System header to define __stub macros and hopefully few prototypes,
9576     which can conflict with char _doprnt(); below.  */
9577 #include <assert.h>
9578 /* Override any gcc2 internal prototype to avoid an error.  */
9579 /* We use char because int might match the return type of a gcc2
9580     builtin and then its argument prototype would still apply.  */
9581 char _doprnt();
9582
9583 int main() {
9584
9585 /* The GNU C library defines this for functions which it implements
9586     to always fail with ENOSYS.  Some functions are actually named
9587     something starting with __ and the normal name is an alias.  */
9588 #if defined (__stub__doprnt) || defined (__stub____doprnt)
9589 choke me
9590 #else
9591 _doprnt();
9592 #endif
9593
9594 ; return 0; }
9595 EOF
9596 if { (eval echo configure:9597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9597   rm -rf conftest*
9598   eval "ac_cv_func__doprnt=yes"
9599 else
9600   echo "configure: failed program was:" >&5
9601   cat conftest.$ac_ext >&5
9602   rm -rf conftest*
9603   eval "ac_cv_func__doprnt=no"
9604 fi
9605 rm -f conftest*
9606 fi
9607
9608 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
9609   echo "$ac_t""yes" 1>&6
9610   cat >> confdefs.h <<\EOF
9611 #define HAVE_DOPRNT 1
9612 EOF
9613
9614 else
9615   echo "$ac_t""no" 1>&6
9616 fi
9617
9618 fi
9619
9620
9621 if test $ac_cv_func_vprintf = yes ; then
9622                 for ac_func in vsnprintf vsprintf
9623 do
9624 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9625 echo "configure:9626: checking for $ac_func" >&5
9626 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
9627   echo $ac_n "(cached) $ac_c" 1>&6
9628 else
9629   cat > conftest.$ac_ext <<EOF
9630 #line 9631 "configure"
9631 #include "confdefs.h"
9632 /* System header to define __stub macros and hopefully few prototypes,
9633     which can conflict with char $ac_func(); below.  */
9634 #include <assert.h>
9635 /* Override any gcc2 internal prototype to avoid an error.  */
9636 /* We use char because int might match the return type of a gcc2
9637     builtin and then its argument prototype would still apply.  */
9638 char $ac_func();
9639
9640 int main() {
9641
9642 /* The GNU C library defines this for functions which it implements
9643     to always fail with ENOSYS.  Some functions are actually named
9644     something starting with __ and the normal name is an alias.  */
9645 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9646 choke me
9647 #else
9648 $ac_func();
9649 #endif
9650
9651 ; return 0; }
9652 EOF
9653 if { (eval echo configure:9654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9654   rm -rf conftest*
9655   eval "ac_cv_func_$ac_func=yes"
9656 else
9657   echo "configure: failed program was:" >&5
9658   cat conftest.$ac_ext >&5
9659   rm -rf conftest*
9660   eval "ac_cv_func_$ac_func=no"
9661 fi
9662 rm -f conftest*
9663 fi
9664
9665 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9666   echo "$ac_t""yes" 1>&6
9667     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9668   cat >> confdefs.h <<EOF
9669 #define $ac_tr_func 1
9670 EOF
9671  
9672 else
9673   echo "$ac_t""no" 1>&6
9674 fi
9675 done
9676
9677 fi
9678
9679 for ac_func in \
9680         bcopy                   \
9681         flock                   \
9682         getdtablesize   \
9683         gethostname             \
9684         getpwuid                \
9685         gettimeofday    \
9686         lockf                   \
9687         memcpy                  \
9688         memmove                 \
9689         mkstemp                 \
9690         select                  \
9691         setpwfile               \
9692         setsid                  \
9693         signal                  \
9694         sigset                  \
9695         snprintf                \
9696         socket                  \
9697         strdup                  \
9698         strerror                \
9699         strpbrk                 \
9700         strrchr                 \
9701         strsep                  \
9702         strstr                  \
9703         strtol                  \
9704         strtoul                 \
9705         strspn                  \
9706         sysconf                 \
9707         waitpid                 \
9708
9709 do
9710 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9711 echo "configure:9712: checking for $ac_func" >&5
9712 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
9713   echo $ac_n "(cached) $ac_c" 1>&6
9714 else
9715   cat > conftest.$ac_ext <<EOF
9716 #line 9717 "configure"
9717 #include "confdefs.h"
9718 /* System header to define __stub macros and hopefully few prototypes,
9719     which can conflict with char $ac_func(); below.  */
9720 #include <assert.h>
9721 /* Override any gcc2 internal prototype to avoid an error.  */
9722 /* We use char because int might match the return type of a gcc2
9723     builtin and then its argument prototype would still apply.  */
9724 char $ac_func();
9725
9726 int main() {
9727
9728 /* The GNU C library defines this for functions which it implements
9729     to always fail with ENOSYS.  Some functions are actually named
9730     something starting with __ and the normal name is an alias.  */
9731 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9732 choke me
9733 #else
9734 $ac_func();
9735 #endif
9736
9737 ; return 0; }
9738 EOF
9739 if { (eval echo configure:9740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9740   rm -rf conftest*
9741   eval "ac_cv_func_$ac_func=yes"
9742 else
9743   echo "configure: failed program was:" >&5
9744   cat conftest.$ac_ext >&5
9745   rm -rf conftest*
9746   eval "ac_cv_func_$ac_func=no"
9747 fi
9748 rm -f conftest*
9749 fi
9750
9751 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9752   echo "$ac_t""yes" 1>&6
9753     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9754   cat >> confdefs.h <<EOF
9755 #define $ac_tr_func 1
9756 EOF
9757  
9758 else
9759   echo "$ac_t""no" 1>&6
9760 fi
9761 done
9762
9763
9764 for ac_func in getopt tempnam
9765 do
9766 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9767 echo "configure:9768: checking for $ac_func" >&5
9768 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
9769   echo $ac_n "(cached) $ac_c" 1>&6
9770 else
9771   cat > conftest.$ac_ext <<EOF
9772 #line 9773 "configure"
9773 #include "confdefs.h"
9774 /* System header to define __stub macros and hopefully few prototypes,
9775     which can conflict with char $ac_func(); below.  */
9776 #include <assert.h>
9777 /* Override any gcc2 internal prototype to avoid an error.  */
9778 /* We use char because int might match the return type of a gcc2
9779     builtin and then its argument prototype would still apply.  */
9780 char $ac_func();
9781
9782 int main() {
9783
9784 /* The GNU C library defines this for functions which it implements
9785     to always fail with ENOSYS.  Some functions are actually named
9786     something starting with __ and the normal name is an alias.  */
9787 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9788 choke me
9789 #else
9790 $ac_func();
9791 #endif
9792
9793 ; return 0; }
9794 EOF
9795 if { (eval echo configure:9796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9796   rm -rf conftest*
9797   eval "ac_cv_func_$ac_func=yes"
9798 else
9799   echo "configure: failed program was:" >&5
9800   cat conftest.$ac_ext >&5
9801   rm -rf conftest*
9802   eval "ac_cv_func_$ac_func=no"
9803 fi
9804 rm -f conftest*
9805 fi
9806
9807 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9808   echo "$ac_t""yes" 1>&6
9809     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9810   cat >> confdefs.h <<EOF
9811 #define $ac_tr_func 1
9812 EOF
9813  
9814 else
9815   echo "$ac_t""no" 1>&6
9816 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
9817 fi
9818 done
9819
9820
9821
9822 # Check Configuration
9823
9824 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
9825 echo "configure:9826: checking declaration of sys_errlist" >&5
9826 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
9827   echo $ac_n "(cached) $ac_c" 1>&6
9828 else
9829   
9830         cat > conftest.$ac_ext <<EOF
9831 #line 9832 "configure"
9832 #include "confdefs.h"
9833
9834 #include <stdio.h>
9835 #include <sys/types.h>
9836 #include <errno.h> 
9837 int main() {
9838 char *c = (char *) *sys_errlist
9839 ; return 0; }
9840 EOF
9841 if { (eval echo configure:9842: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9842   rm -rf conftest*
9843   ol_cv_dcl_sys_errlist=yes
9844 else
9845   echo "configure: failed program was:" >&5
9846   cat conftest.$ac_ext >&5
9847   rm -rf conftest*
9848   ol_cv_dcl_sys_errlist=no
9849 fi
9850 rm -f conftest*
9851 fi
9852
9853 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
9854
9855 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
9856 if test $ol_cv_dcl_sys_errlist = no ; then
9857         cat >> confdefs.h <<\EOF
9858 #define DECL_SYS_ERRLIST 1
9859 EOF
9860
9861         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
9862 echo "configure:9863: checking existence of sys_errlist" >&5
9863         if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
9864   echo $ac_n "(cached) $ac_c" 1>&6
9865 else
9866   
9867                 cat > conftest.$ac_ext <<EOF
9868 #line 9869 "configure"
9869 #include "confdefs.h"
9870 #include <errno.h>
9871 int main() {
9872 char *c = (char *) *sys_errlist
9873 ; return 0; }
9874 EOF
9875 if { (eval echo configure:9876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9876   rm -rf conftest*
9877   ol_cv_have_sys_errlist=yes
9878 else
9879   echo "configure: failed program was:" >&5
9880   cat conftest.$ac_ext >&5
9881   rm -rf conftest*
9882   ol_cv_have_sys_errlist=no
9883 fi
9884 rm -f conftest*
9885 fi
9886
9887         echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
9888 fi
9889
9890
9891
9892 if test "$ol_enable_debug" != no ; then
9893         cat >> confdefs.h <<\EOF
9894 #define LDAP_DEBUG 1
9895 EOF
9896
9897 fi
9898 if test "$ol_enable_syslog" = yes ; then
9899         cat >> confdefs.h <<\EOF
9900 #define LDAP_SYSLOG 1
9901 EOF
9902
9903 fi
9904 if test "$ol_enable_libui" = yes ; then
9905         cat >> confdefs.h <<\EOF
9906 #define LDAP_LIBUI 1
9907 EOF
9908
9909 fi
9910 if test "$ol_enable_cache" = no ; then
9911         cat >> confdefs.h <<\EOF
9912 #define LDAP_NOCACHE 1
9913 EOF
9914
9915 fi
9916 if test "$ol_enable_dns" != no ; then
9917         cat >> confdefs.h <<\EOF
9918 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS LDAP_VENDOR_VERSION
9919 EOF
9920
9921 fi
9922 if test "$ol_enable_proctitle" != no ; then
9923         cat >> confdefs.h <<\EOF
9924 #define LDAP_PROCTITLE 1
9925 EOF
9926
9927 fi
9928 if test "$ol_enable_referrals" != no ; then
9929         cat >> confdefs.h <<\EOF
9930 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
9931 EOF
9932
9933 fi
9934 if test "$ol_enable_cldap" != no ; then
9935         cat >> confdefs.h <<\EOF
9936 #define LDAP_CONNECTIONLESS 1
9937 EOF
9938
9939 fi
9940
9941 if test "$ol_enable_aclgroups" != no ; then
9942         cat >> confdefs.h <<\EOF
9943 #define SLAPD_ACLGROUPS 1
9944 EOF
9945
9946 fi
9947 if test "$ol_enable_crypt" != no ; then
9948         cat >> confdefs.h <<\EOF
9949 #define SLAPD_CRYPT 1
9950 EOF
9951
9952 fi
9953 if test "$ol_enable_cleartext" != no ; then
9954         cat >> confdefs.h <<\EOF
9955 #define SLAPD_CLEARTEXT 1
9956 EOF
9957
9958 fi
9959 if test "$ol_enable_phonetic" != no ; then
9960         cat >> confdefs.h <<\EOF
9961 #define SLAPD_PHONETIC 1
9962 EOF
9963
9964 fi
9965 if test "$ol_enable_rlookups" != no ; then
9966         cat >> confdefs.h <<\EOF
9967 #define SLAPD_RLOOKUPS 1
9968 EOF
9969
9970 fi
9971
9972 if test "$ol_link_bdb2" != no ; then
9973         cat >> confdefs.h <<\EOF
9974 #define SLAPD_BDB2 1
9975 EOF
9976
9977         BUILD_SLAPD=yes
9978         BUILD_BDB2=yes
9979 fi
9980
9981 if test "$ol_link_ldbm" != no ; then
9982         cat >> confdefs.h <<\EOF
9983 #define SLAPD_LDBM 1
9984 EOF
9985
9986         BUILD_SLAPD=yes
9987         BUILD_LDBM=yes
9988 fi
9989
9990 if test "$ol_enable_passwd" != no ; then
9991         cat >> confdefs.h <<\EOF
9992 #define SLAPD_PASSWD 1
9993 EOF
9994
9995         BUILD_SLAPD=yes
9996         BUILD_PASSWD=yes
9997 fi
9998
9999 if test "$ol_enable_perl" != no ; then
10000         cat >> confdefs.h <<\EOF
10001 #define SLAPD_PERL 1
10002 EOF
10003
10004         BUILD_SLAPD=yes
10005         BUILD_PERL=yes
10006 fi
10007
10008 if test "$ol_enable_shell" != no ; then
10009         cat >> confdefs.h <<\EOF
10010 #define SLAPD_SHELL 1
10011 EOF
10012
10013         BUILD_SLAPD=yes
10014         BUILD_SHELL=yes
10015 fi
10016
10017 if test "$ol_enable_tcl" != no ; then
10018         cat >> confdefs.h <<\EOF
10019 #define SLAPD_TCL 1
10020 EOF
10021
10022         BUILD_SLAPD=yes
10023         BUILD_TCL=yes
10024 fi
10025
10026 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
10027         $BUILD_SLAPD = yes ; then
10028         BUILD_SLURPD=yes
10029 fi
10030
10031 if test "$ol_link_isode" != no ; then
10032         BUILD_LDAPD=yes
10033 fi
10034
10035
10036
10037
10038   
10039   
10040   
10041   
10042   
10043   
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062 trap '' 1 2 15
10063 cat > confcache <<\EOF
10064 # This file is a shell script that caches the results of configure
10065 # tests run on this system so they can be shared between configure
10066 # scripts and configure runs.  It is not useful on other systems.
10067 # If it contains results you don't want to keep, you may remove or edit it.
10068 #
10069 # By default, configure uses ./config.cache as the cache file,
10070 # creating it if it does not exist already.  You can give configure
10071 # the --cache-file=FILE option to use a different cache file; that is
10072 # what configure does when it calls configure scripts in
10073 # subdirectories, so they share the cache.
10074 # Giving --cache-file=/dev/null disables caching, for debugging configure.
10075 # config.status only pays attention to the cache file if you give it the
10076 # --recheck option to rerun configure.
10077 #
10078 EOF
10079 # The following way of writing the cache mishandles newlines in values,
10080 # but we know of no workaround that is simple, portable, and efficient.
10081 # So, don't put newlines in cache variables' values.
10082 # Ultrix sh set writes to stderr and can't be redirected directly,
10083 # and sets the high bit in the cache file unless we assign to the vars.
10084 (set) 2>&1 |
10085   case `(ac_space=' '; set | grep ac_space) 2>&1` in
10086   *ac_space=\ *)
10087     # `set' does not quote correctly, so add quotes (double-quote substitution
10088     # turns \\\\ into \\, and sed turns \\ into \).
10089     sed -n \
10090       -e "s/'/'\\\\''/g" \
10091       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
10092     ;;
10093   *)
10094     # `set' quotes correctly as required by POSIX, so do not add quotes.
10095     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
10096     ;;
10097   esac >> confcache
10098 if cmp -s $cache_file confcache; then
10099   :
10100 else
10101   if test -w $cache_file; then
10102     echo "updating cache $cache_file"
10103     cat confcache > $cache_file
10104   else
10105     echo "not updating unwritable cache $cache_file"
10106   fi
10107 fi
10108 rm -f confcache
10109
10110 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
10111
10112 test "x$prefix" = xNONE && prefix=$ac_default_prefix
10113 # Let make expand exec_prefix.
10114 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
10115
10116 # Any assignment to VPATH causes Sun make to only execute
10117 # the first set of double-colon rules, so remove it if not needed.
10118 # If there is a colon in the path, we need to keep it.
10119 if test "x$srcdir" = x.; then
10120   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
10121 fi
10122
10123 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
10124
10125 DEFS=-DHAVE_CONFIG_H
10126
10127 # Without the "./", some shells look in PATH for config.status.
10128 : ${CONFIG_STATUS=./config.status}
10129
10130 echo creating $CONFIG_STATUS
10131 rm -f $CONFIG_STATUS
10132 cat > $CONFIG_STATUS <<EOF
10133 #! /bin/sh
10134 # Generated automatically by configure.
10135 # Run this file to recreate the current configuration.
10136 # This directory was configured as follows,
10137 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
10138 #
10139 # $0 $ac_configure_args
10140 #
10141 # Compiler output produced by configure, useful for debugging
10142 # configure, is in ./config.log if it exists.
10143
10144 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
10145 for ac_option
10146 do
10147   case "\$ac_option" in
10148   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
10149     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
10150     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
10151   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
10152     echo "$CONFIG_STATUS generated by autoconf version 2.13"
10153     exit 0 ;;
10154   -help | --help | --hel | --he | --h)
10155     echo "\$ac_cs_usage"; exit 0 ;;
10156   *) echo "\$ac_cs_usage"; exit 1 ;;
10157   esac
10158 done
10159
10160 ac_given_srcdir=$srcdir
10161 ac_given_INSTALL="$INSTALL"
10162
10163 trap 'rm -fr `echo "\
10164 Makefile:build/top.mk:Makefile.in:build/dir.mk \
10165 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
10166 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
10167 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
10168 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
10169 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
10170 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
10171 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
10172 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
10173 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
10174 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
10175 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
10176 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
10177 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
10178 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
10179 include/Makefile:build/top.mk:include/Makefile.in \
10180 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
10181 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
10182 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
10183 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
10184 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
10185 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
10186 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
10187 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
10188 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
10189 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
10190 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
10191 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
10192 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
10193 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
10194 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
10195 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
10196 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
10197 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
10198 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
10199 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
10200 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
10201 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
10202  include/portable.h include/ldap_features.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
10203 EOF
10204 cat >> $CONFIG_STATUS <<EOF
10205
10206 # Protect against being on the right side of a sed subst in config.status.
10207 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
10208  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
10209 $ac_vpsub
10210 $extrasub
10211 s%@SHELL@%$SHELL%g
10212 s%@CFLAGS@%$CFLAGS%g
10213 s%@CPPFLAGS@%$CPPFLAGS%g
10214 s%@CXXFLAGS@%$CXXFLAGS%g
10215 s%@FFLAGS@%$FFLAGS%g
10216 s%@DEFS@%$DEFS%g
10217 s%@LDFLAGS@%$LDFLAGS%g
10218 s%@LIBS@%$LIBS%g
10219 s%@exec_prefix@%$exec_prefix%g
10220 s%@prefix@%$prefix%g
10221 s%@program_transform_name@%$program_transform_name%g
10222 s%@bindir@%$bindir%g
10223 s%@sbindir@%$sbindir%g
10224 s%@libexecdir@%$libexecdir%g
10225 s%@datadir@%$datadir%g
10226 s%@sysconfdir@%$sysconfdir%g
10227 s%@sharedstatedir@%$sharedstatedir%g
10228 s%@localstatedir@%$localstatedir%g
10229 s%@libdir@%$libdir%g
10230 s%@includedir@%$includedir%g
10231 s%@oldincludedir@%$oldincludedir%g
10232 s%@infodir@%$infodir%g
10233 s%@mandir@%$mandir%g
10234 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
10235 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
10236 s%@INSTALL_DATA@%$INSTALL_DATA%g
10237 s%@PACKAGE@%$PACKAGE%g
10238 s%@VERSION@%$VERSION%g
10239 s%@ACLOCAL@%$ACLOCAL%g
10240 s%@AUTOCONF@%$AUTOCONF%g
10241 s%@AUTOMAKE@%$AUTOMAKE%g
10242 s%@AUTOHEADER@%$AUTOHEADER%g
10243 s%@MAKEINFO@%$MAKEINFO%g
10244 s%@SET_MAKE@%$SET_MAKE%g
10245 s%@top_builddir@%$top_builddir%g
10246 s%@ldap_subdir@%$ldap_subdir%g
10247 s%@host@%$host%g
10248 s%@host_alias@%$host_alias%g
10249 s%@host_cpu@%$host_cpu%g
10250 s%@host_vendor@%$host_vendor%g
10251 s%@host_os@%$host_os%g
10252 s%@RANLIB@%$RANLIB%g
10253 s%@CC@%$CC%g
10254 s%@LD@%$LD%g
10255 s%@NM@%$NM%g
10256 s%@LN_S@%$LN_S%g
10257 s%@LIBTOOL@%$LIBTOOL%g
10258 s%@AWK@%$AWK%g
10259 s%@SENDMAIL@%$SENDMAIL%g
10260 s%@EDITOR@%$EDITOR%g
10261 s%@FINGER@%$FINGER%g
10262 s%@PERLBIN@%$PERLBIN%g
10263 s%@CPP@%$CPP%g
10264 s%@EXEEXT@%$EXEEXT%g
10265 s%@OBJEXT@%$OBJEXT%g
10266 s%@PEPSY@%$PEPSY%g
10267 s%@LIBOBJS@%$LIBOBJS%g
10268 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
10269 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
10270 s%@BUILD_BDB2@%$BUILD_BDB2%g
10271 s%@BUILD_LDBM@%$BUILD_LDBM%g
10272 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
10273 s%@BUILD_PERL@%$BUILD_PERL%g
10274 s%@BUILD_SHELL@%$BUILD_SHELL%g
10275 s%@BUILD_TCL@%$BUILD_TCL%g
10276 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
10277 s%@LDAP_LIBS@%$LDAP_LIBS%g
10278 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
10279 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
10280 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
10281 s%@LDBM_LIBS@%$LDBM_LIBS%g
10282 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
10283 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
10284 s%@SLAPD_PERL_CPPFLAGS@%$SLAPD_PERL_CPPFLAGS%g
10285 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
10286 s%@KRB_LIBS@%$KRB_LIBS%g
10287 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
10288 s%@TLS_LIBS@%$TLS_LIBS%g
10289
10290 CEOF
10291 EOF
10292
10293 cat >> $CONFIG_STATUS <<\EOF
10294
10295 # Split the substitutions into bite-sized pieces for seds with
10296 # small command number limits, like on Digital OSF/1 and HP-UX.
10297 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
10298 ac_file=1 # Number of current file.
10299 ac_beg=1 # First line for current file.
10300 ac_end=$ac_max_sed_cmds # Line after last line for current file.
10301 ac_more_lines=:
10302 ac_sed_cmds=""
10303 while $ac_more_lines; do
10304   if test $ac_beg -gt 1; then
10305     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
10306   else
10307     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
10308   fi
10309   if test ! -s conftest.s$ac_file; then
10310     ac_more_lines=false
10311     rm -f conftest.s$ac_file
10312   else
10313     if test -z "$ac_sed_cmds"; then
10314       ac_sed_cmds="sed -f conftest.s$ac_file"
10315     else
10316       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
10317     fi
10318     ac_file=`expr $ac_file + 1`
10319     ac_beg=$ac_end
10320     ac_end=`expr $ac_end + $ac_max_sed_cmds`
10321   fi
10322 done
10323 if test -z "$ac_sed_cmds"; then
10324   ac_sed_cmds=cat
10325 fi
10326 EOF
10327
10328 cat >> $CONFIG_STATUS <<EOF
10329
10330 CONFIG_FILES=\${CONFIG_FILES-"\
10331 Makefile:build/top.mk:Makefile.in:build/dir.mk \
10332 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
10333 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
10334 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
10335 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
10336 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
10337 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
10338 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
10339 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
10340 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
10341 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
10342 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
10343 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
10344 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
10345 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
10346 include/Makefile:build/top.mk:include/Makefile.in \
10347 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
10348 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
10349 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
10350 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
10351 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
10352 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
10353 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
10354 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
10355 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
10356 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
10357 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
10358 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
10359 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
10360 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
10361 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
10362 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
10363 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
10364 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
10365 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
10366 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
10367 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
10368 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
10369 "}
10370 EOF
10371 cat >> $CONFIG_STATUS <<\EOF
10372 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
10373   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
10374   case "$ac_file" in
10375   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
10376        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
10377   *) ac_file_in="${ac_file}.in" ;;
10378   esac
10379
10380   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
10381
10382   # Remove last slash and all that follows it.  Not all systems have dirname.
10383   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
10384   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
10385     # The file is in a subdirectory.
10386     test ! -d "$ac_dir" && mkdir "$ac_dir"
10387     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
10388     # A "../" for each directory in $ac_dir_suffix.
10389     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
10390   else
10391     ac_dir_suffix= ac_dots=
10392   fi
10393
10394   case "$ac_given_srcdir" in
10395   .)  srcdir=.
10396       if test -z "$ac_dots"; then top_srcdir=.
10397       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
10398   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
10399   *) # Relative path.
10400     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
10401     top_srcdir="$ac_dots$ac_given_srcdir" ;;
10402   esac
10403
10404   case "$ac_given_INSTALL" in
10405   [/$]*) INSTALL="$ac_given_INSTALL" ;;
10406   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
10407   esac
10408
10409   echo creating "$ac_file"
10410   rm -f "$ac_file"
10411   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
10412   case "$ac_file" in
10413   *Makefile*) ac_comsub="1i\\
10414 # $configure_input" ;;
10415   *) ac_comsub= ;;
10416   esac
10417
10418   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
10419   sed -e "$ac_comsub
10420 s%@configure_input@%$configure_input%g
10421 s%@srcdir@%$srcdir%g
10422 s%@top_srcdir@%$top_srcdir%g
10423 s%@INSTALL@%$INSTALL%g
10424 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
10425 fi; done
10426 rm -f conftest.s*
10427
10428 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
10429 # NAME is the cpp macro being defined and VALUE is the value it is being given.
10430 #
10431 # ac_d sets the value in "#define NAME VALUE" lines.
10432 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
10433 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
10434 ac_dC='\3'
10435 ac_dD='%g'
10436 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
10437 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
10438 ac_uB='\([      ]\)%\1#\2define\3'
10439 ac_uC=' '
10440 ac_uD='\4%g'
10441 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
10442 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
10443 ac_eB='$%\1#\2define\3'
10444 ac_eC=' '
10445 ac_eD='%g'
10446
10447 if test "${CONFIG_HEADERS+set}" != set; then
10448 EOF
10449 cat >> $CONFIG_STATUS <<EOF
10450   CONFIG_HEADERS="include/portable.h include/ldap_features.h"
10451 EOF
10452 cat >> $CONFIG_STATUS <<\EOF
10453 fi
10454 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
10455   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
10456   case "$ac_file" in
10457   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
10458        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
10459   *) ac_file_in="${ac_file}.in" ;;
10460   esac
10461
10462   echo creating $ac_file
10463
10464   rm -f conftest.frag conftest.in conftest.out
10465   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
10466   cat $ac_file_inputs > conftest.in
10467
10468 EOF
10469
10470 # Transform confdefs.h into a sed script conftest.vals that substitutes
10471 # the proper values into config.h.in to produce config.h.  And first:
10472 # Protect against being on the right side of a sed subst in config.status.
10473 # Protect against being in an unquoted here document in config.status.
10474 rm -f conftest.vals
10475 cat > conftest.hdr <<\EOF
10476 s/[\\&%]/\\&/g
10477 s%[\\$`]%\\&%g
10478 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
10479 s%ac_d%ac_u%gp
10480 s%ac_u%ac_e%gp
10481 EOF
10482 sed -n -f conftest.hdr confdefs.h > conftest.vals
10483 rm -f conftest.hdr
10484
10485 # This sed command replaces #undef with comments.  This is necessary, for
10486 # example, in the case of _POSIX_SOURCE, which is predefined and required
10487 # on some systems where configure will not decide to define it.
10488 cat >> conftest.vals <<\EOF
10489 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
10490 EOF
10491
10492 # Break up conftest.vals because some shells have a limit on
10493 # the size of here documents, and old seds have small limits too.
10494
10495 rm -f conftest.tail
10496 while :
10497 do
10498   ac_lines=`grep -c . conftest.vals`
10499   # grep -c gives empty output for an empty file on some AIX systems.
10500   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
10501   # Write a limited-size here document to conftest.frag.
10502   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
10503   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
10504   echo 'CEOF
10505   sed -f conftest.frag conftest.in > conftest.out
10506   rm -f conftest.in
10507   mv conftest.out conftest.in
10508 ' >> $CONFIG_STATUS
10509   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
10510   rm -f conftest.vals
10511   mv conftest.tail conftest.vals
10512 done
10513 rm -f conftest.vals
10514
10515 cat >> $CONFIG_STATUS <<\EOF
10516   rm -f conftest.frag conftest.h
10517   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
10518   cat conftest.in >> conftest.h
10519   rm -f conftest.in
10520   if cmp -s $ac_file conftest.h 2>/dev/null; then
10521     echo "$ac_file is unchanged"
10522     rm -f conftest.h
10523   else
10524     # Remove last slash and all that follows it.  Not all systems have dirname.
10525       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
10526       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
10527       # The file is in a subdirectory.
10528       test ! -d "$ac_dir" && mkdir "$ac_dir"
10529     fi
10530     rm -f $ac_file
10531     mv conftest.h $ac_file
10532   fi
10533 fi; done
10534
10535 EOF
10536 cat >> $CONFIG_STATUS <<EOF
10537
10538 EOF
10539 cat >> $CONFIG_STATUS <<\EOF
10540
10541 date > stamp-h
10542 echo Please \"make depend\" to build dependencies
10543
10544 exit 0
10545 EOF
10546 chmod +x $CONFIG_STATUS
10547 rm -fr confdefs* $ac_clean_files
10548 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
10549