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