]> git.sur5r.net Git - openldap/blob - configure
96fbeaf6f67c9200f3ab8bc3870b4b23127a4599
[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 -lresolv""... $ac_c" 1>&6
2701 echo "configure:2702: checking for res_search in -lresolv" >&5
2702 ac_lib_var=`echo resolv'_'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="-lresolv  $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 resolv | 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="-lresolv $LIBS"
2742
2743 else
2744   echo "$ac_t""no" 1>&6
2745 fi
2746
2747
2748 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
2749 echo "configure:2750: checking for sigset in -lV3" >&5
2750 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-%__p_%'`
2751 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2752   echo $ac_n "(cached) $ac_c" 1>&6
2753 else
2754   ac_save_LIBS="$LIBS"
2755 LIBS="-lV3  $LIBS"
2756 cat > conftest.$ac_ext <<EOF
2757 #line 2758 "configure"
2758 #include "confdefs.h"
2759 /* Override any gcc2 internal prototype to avoid an error.  */
2760 /* We use char because int might match the return type of a gcc2
2761     builtin and then its argument prototype would still apply.  */
2762 char sigset();
2763
2764 int main() {
2765 sigset()
2766 ; return 0; }
2767 EOF
2768 if { (eval echo configure:2769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2769   rm -rf conftest*
2770   eval "ac_cv_lib_$ac_lib_var=yes"
2771 else
2772   echo "configure: failed program was:" >&5
2773   cat conftest.$ac_ext >&5
2774   rm -rf conftest*
2775   eval "ac_cv_lib_$ac_lib_var=no"
2776 fi
2777 rm -f conftest*
2778 LIBS="$ac_save_LIBS"
2779
2780 fi
2781 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2782   echo "$ac_t""yes" 1>&6
2783     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2784     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2785   cat >> confdefs.h <<EOF
2786 #define $ac_tr_lib 1
2787 EOF
2788
2789   LIBS="-lV3 $LIBS"
2790
2791 else
2792   echo "$ac_t""no" 1>&6
2793 fi
2794
2795
2796 # ISODE tests
2797 ol_link_isode=no
2798 if test $ol_enable_ldapd != no ; then
2799                 echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
2800 echo "configure:2801: checking for main in -lxtpp" >&5
2801 ac_lib_var=`echo xtpp'_'main | sed 'y%./+-%__p_%'`
2802 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2803   echo $ac_n "(cached) $ac_c" 1>&6
2804 else
2805   ac_save_LIBS="$LIBS"
2806 LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
2807 cat > conftest.$ac_ext <<EOF
2808 #line 2809 "configure"
2809 #include "confdefs.h"
2810
2811 int main() {
2812 main()
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   
2831                 ol_link_isode=yes
2832                 cat >> confdefs.h <<\EOF
2833 #define HAVE_XTPP 1
2834 EOF
2835
2836                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
2837                 
2838 else
2839   echo "$ac_t""no" 1>&6
2840 :
2841 fi
2842
2843         echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
2844 echo "configure:2845: checking for main in -ldsap" >&5
2845 ac_lib_var=`echo dsap'_'main | sed 'y%./+-%__p_%'`
2846 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2847   echo $ac_n "(cached) $ac_c" 1>&6
2848 else
2849   ac_save_LIBS="$LIBS"
2850 LIBS="-ldsap -lisode $LIBS"
2851 cat > conftest.$ac_ext <<EOF
2852 #line 2853 "configure"
2853 #include "confdefs.h"
2854
2855 int main() {
2856 main()
2857 ; return 0; }
2858 EOF
2859 if { (eval echo configure:2860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2860   rm -rf conftest*
2861   eval "ac_cv_lib_$ac_lib_var=yes"
2862 else
2863   echo "configure: failed program was:" >&5
2864   cat conftest.$ac_ext >&5
2865   rm -rf conftest*
2866   eval "ac_cv_lib_$ac_lib_var=no"
2867 fi
2868 rm -f conftest*
2869 LIBS="$ac_save_LIBS"
2870
2871 fi
2872 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2873   echo "$ac_t""yes" 1>&6
2874   
2875                 ol_link_isode=yes
2876                 cat >> confdefs.h <<\EOF
2877 #define HAVE_DSAP 1
2878 EOF
2879
2880                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
2881                 
2882 else
2883   echo "$ac_t""no" 1>&6
2884 :
2885 fi
2886
2887         echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
2888 echo "configure:2889: checking for main in -lisode" >&5
2889 ac_lib_var=`echo isode'_'main | sed 'y%./+-%__p_%'`
2890 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2891   echo $ac_n "(cached) $ac_c" 1>&6
2892 else
2893   ac_save_LIBS="$LIBS"
2894 LIBS="-lisode  $LIBS"
2895 cat > conftest.$ac_ext <<EOF
2896 #line 2897 "configure"
2897 #include "confdefs.h"
2898
2899 int main() {
2900 main()
2901 ; return 0; }
2902 EOF
2903 if { (eval echo configure:2904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2904   rm -rf conftest*
2905   eval "ac_cv_lib_$ac_lib_var=yes"
2906 else
2907   echo "configure: failed program was:" >&5
2908   cat conftest.$ac_ext >&5
2909   rm -rf conftest*
2910   eval "ac_cv_lib_$ac_lib_var=no"
2911 fi
2912 rm -f conftest*
2913 LIBS="$ac_save_LIBS"
2914
2915 fi
2916 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2917   echo "$ac_t""yes" 1>&6
2918   
2919                 ol_link_isode=yes
2920                 cat >> confdefs.h <<\EOF
2921 #define HAVE_ISODE 1
2922 EOF
2923
2924                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
2925                 
2926 else
2927   echo "$ac_t""no" 1>&6
2928 :
2929 fi
2930
2931 fi
2932
2933 if test $ol_link_isode != no; then
2934         echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
2935 echo "configure:2936: checking for main in -lpp" >&5
2936 ac_lib_var=`echo pp'_'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="-lpp  $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                 cat >> confdefs.h <<\EOF
2967 #define HAVE_PP 1
2968 EOF
2969
2970                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
2971                 
2972 else
2973   echo "$ac_t""no" 1>&6
2974 :
2975 fi
2976
2977
2978         # Extract the first word of "pepsy", so it can be a program name with args.
2979 set dummy pepsy; ac_word=$2
2980 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2981 echo "configure:2982: checking for $ac_word" >&5
2982 if eval "test \"`echo '$''{'ac_cv_path_PEPSY'+set}'`\" = set"; then
2983   echo $ac_n "(cached) $ac_c" 1>&6
2984 else
2985   case "$PEPSY" in
2986   /*)
2987   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a path.
2988   ;;
2989   *)
2990   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2991   for ac_dir in $PATH; do
2992     test -z "$ac_dir" && ac_dir=.
2993     if test -f $ac_dir/$ac_word; then
2994       ac_cv_path_PEPSY="$ac_dir/$ac_word"
2995       break
2996     fi
2997   done
2998   IFS="$ac_save_ifs"
2999   ;;
3000 esac
3001 fi
3002 PEPSY="$ac_cv_path_PEPSY"
3003 if test -n "$PEPSY"; then
3004   echo "$ac_t""$PEPSY" 1>&6
3005 else
3006   echo "$ac_t""no" 1>&6
3007 fi
3008
3009 fi
3010
3011 ol_link_kerberos=no
3012
3013 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
3014         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
3015 do
3016 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3017 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3018 echo "configure:3019: checking for $ac_hdr" >&5
3019 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3020   echo $ac_n "(cached) $ac_c" 1>&6
3021 else
3022   cat > conftest.$ac_ext <<EOF
3023 #line 3024 "configure"
3024 #include "confdefs.h"
3025 #include <$ac_hdr>
3026 EOF
3027 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3028 { (eval echo configure:3029: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3029 ac_err=`grep -v '^ *+' conftest.out`
3030 if test -z "$ac_err"; then
3031   rm -rf conftest*
3032   eval "ac_cv_header_$ac_safe=yes"
3033 else
3034   echo "$ac_err" >&5
3035   echo "configure: failed program was:" >&5
3036   cat conftest.$ac_ext >&5
3037   rm -rf conftest*
3038   eval "ac_cv_header_$ac_safe=no"
3039 fi
3040 rm -f conftest*
3041 fi
3042 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3043   echo "$ac_t""yes" 1>&6
3044     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3045   cat >> confdefs.h <<EOF
3046 #define $ac_tr_hdr 1
3047 EOF
3048  
3049 else
3050   echo "$ac_t""no" 1>&6
3051 fi
3052 done
3053
3054
3055         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
3056                 echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
3057 echo "configure:3058: checking for main in -lkrb4" >&5
3058 ac_lib_var=`echo krb4'_'main | sed 'y%./+-%__p_%'`
3059 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3060   echo $ac_n "(cached) $ac_c" 1>&6
3061 else
3062   ac_save_LIBS="$LIBS"
3063 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
3064 cat > conftest.$ac_ext <<EOF
3065 #line 3066 "configure"
3066 #include "confdefs.h"
3067
3068 int main() {
3069 main()
3070 ; return 0; }
3071 EOF
3072 if { (eval echo configure:3073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3073   rm -rf conftest*
3074   eval "ac_cv_lib_$ac_lib_var=yes"
3075 else
3076   echo "configure: failed program was:" >&5
3077   cat conftest.$ac_ext >&5
3078   rm -rf conftest*
3079   eval "ac_cv_lib_$ac_lib_var=no"
3080 fi
3081 rm -f conftest*
3082 LIBS="$ac_save_LIBS"
3083
3084 fi
3085 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3086   echo "$ac_t""yes" 1>&6
3087   have_k5=yes
3088 else
3089   echo "$ac_t""no" 1>&6
3090 have_k5=no
3091 fi
3092
3093
3094                 if test $have_k5 = yes ; then
3095                         ol_with_kerberos=found
3096                         ol_link_kerberos=yes
3097
3098                         cat >> confdefs.h <<\EOF
3099 #define HAVE_KERBEROS 1
3100 EOF
3101
3102                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
3103                 fi
3104         fi
3105 fi
3106
3107 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
3108         for ac_hdr in krb.h des.h
3109 do
3110 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3111 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3112 echo "configure:3113: checking for $ac_hdr" >&5
3113 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3114   echo $ac_n "(cached) $ac_c" 1>&6
3115 else
3116   cat > conftest.$ac_ext <<EOF
3117 #line 3118 "configure"
3118 #include "confdefs.h"
3119 #include <$ac_hdr>
3120 EOF
3121 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3122 { (eval echo configure:3123: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3123 ac_err=`grep -v '^ *+' conftest.out`
3124 if test -z "$ac_err"; then
3125   rm -rf conftest*
3126   eval "ac_cv_header_$ac_safe=yes"
3127 else
3128   echo "$ac_err" >&5
3129   echo "configure: failed program was:" >&5
3130   cat conftest.$ac_ext >&5
3131   rm -rf conftest*
3132   eval "ac_cv_header_$ac_safe=no"
3133 fi
3134 rm -f conftest*
3135 fi
3136 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3137   echo "$ac_t""yes" 1>&6
3138     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3139   cat >> confdefs.h <<EOF
3140 #define $ac_tr_hdr 1
3141 EOF
3142  
3143 else
3144   echo "$ac_t""no" 1>&6
3145 fi
3146 done
3147
3148
3149         if test $ac_cv_header_krb_h = yes ; then
3150                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
3151 echo "configure:3152: checking for main in -lkrb" >&5
3152 ac_lib_var=`echo krb'_'main | sed 'y%./+-%__p_%'`
3153 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3154   echo $ac_n "(cached) $ac_c" 1>&6
3155 else
3156   ac_save_LIBS="$LIBS"
3157 LIBS="-lkrb -ldes $LIBS"
3158 cat > conftest.$ac_ext <<EOF
3159 #line 3160 "configure"
3160 #include "confdefs.h"
3161
3162 int main() {
3163 main()
3164 ; return 0; }
3165 EOF
3166 if { (eval echo configure:3167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3167   rm -rf conftest*
3168   eval "ac_cv_lib_$ac_lib_var=yes"
3169 else
3170   echo "configure: failed program was:" >&5
3171   cat conftest.$ac_ext >&5
3172   rm -rf conftest*
3173   eval "ac_cv_lib_$ac_lib_var=no"
3174 fi
3175 rm -f conftest*
3176 LIBS="$ac_save_LIBS"
3177
3178 fi
3179 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3180   echo "$ac_t""yes" 1>&6
3181   have_k4=yes
3182 else
3183   echo "$ac_t""no" 1>&6
3184 have_k4=no
3185 fi
3186
3187
3188                 if test $have_k4 = yes ; then
3189                         ol_with_kerberos=found
3190                         ol_link_kerberos=yes
3191
3192                         cat >> confdefs.h <<\EOF
3193 #define HAVE_KERBEROS 1
3194 EOF
3195
3196                         KRB_LIBS="-lkrb -ldes"
3197                 fi
3198         fi
3199 fi
3200
3201
3202 ol_link_threads=no
3203 if test $ol_with_threads = auto -o $ol_with_threads = yes \
3204         -o $ol_with_threads = posix ; then
3205
3206         for ac_hdr in pthread.h sched.h
3207 do
3208 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3209 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3210 echo "configure:3211: checking for $ac_hdr" >&5
3211 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3212   echo $ac_n "(cached) $ac_c" 1>&6
3213 else
3214   cat > conftest.$ac_ext <<EOF
3215 #line 3216 "configure"
3216 #include "confdefs.h"
3217 #include <$ac_hdr>
3218 EOF
3219 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3220 { (eval echo configure:3221: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3221 ac_err=`grep -v '^ *+' conftest.out`
3222 if test -z "$ac_err"; then
3223   rm -rf conftest*
3224   eval "ac_cv_header_$ac_safe=yes"
3225 else
3226   echo "$ac_err" >&5
3227   echo "configure: failed program was:" >&5
3228   cat conftest.$ac_ext >&5
3229   rm -rf conftest*
3230   eval "ac_cv_header_$ac_safe=no"
3231 fi
3232 rm -f conftest*
3233 fi
3234 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3235   echo "$ac_t""yes" 1>&6
3236     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3237   cat >> confdefs.h <<EOF
3238 #define $ac_tr_hdr 1
3239 EOF
3240  
3241 else
3242   echo "$ac_t""no" 1>&6
3243 fi
3244 done
3245
3246
3247         if test $ac_cv_header_pthread_h = yes ; then
3248                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
3249 echo "configure:3250: checking POSIX thread version" >&5
3250 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
3251   echo $ac_n "(cached) $ac_c" 1>&6
3252 else
3253   
3254         cat > conftest.$ac_ext <<EOF
3255 #line 3256 "configure"
3256 #include "confdefs.h"
3257
3258 #               include <pthread.h>
3259                 /* this check could be improved */
3260 #               ifdef PTHREAD_ONCE_INIT
3261                         pthread_version_final
3262 #               endif
3263         
3264 EOF
3265 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3266   egrep "pthread_version_final" >/dev/null 2>&1; then
3267   rm -rf conftest*
3268   ol_pthread_final=yes
3269 else
3270   rm -rf conftest*
3271   ol_pthread_final=no
3272 fi
3273 rm -f conftest*
3274
3275
3276         cat > conftest.$ac_ext <<EOF
3277 #line 3278 "configure"
3278 #include "confdefs.h"
3279
3280 #               include <pthread.h>
3281                 /* this check could be improved */
3282 #               ifdef pthread_once_init
3283                         pthread_version_draft4
3284 #               endif
3285         
3286 EOF
3287 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3288   egrep "pthread_version_draft4" >/dev/null 2>&1; then
3289   rm -rf conftest*
3290   ol_pthread_draft4=yes
3291 else
3292   rm -rf conftest*
3293   ol_pthread_draft4=no
3294 fi
3295 rm -f conftest*
3296
3297
3298         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
3299                 ol_cv_pthread_version=final
3300         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
3301                 ol_cv_pthread_version=draft4
3302         else
3303                 ol_cv_pthread_version=unknown
3304         fi
3305
3306 fi
3307
3308 echo "$ac_t""$ol_cv_pthread_version" 1>&6
3309
3310
3311                 if test $ol_cv_pthread_version = final ; then
3312                         cat >> confdefs.h <<\EOF
3313 #define HAVE_PTHREADS_FINAL 1
3314 EOF
3315
3316                 elif test $ol_cv_pthread_version = draft4 ; then
3317                         cat >> confdefs.h <<\EOF
3318 #define HAVE_PTHREADS_D4 1
3319 EOF
3320
3321                 else
3322                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
3323                 fi
3324
3325                 # consider threads found
3326                 ol_with_threads=found
3327
3328                 
3329 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
3330 echo "configure:3331: checking for LinuxThreads" >&5
3331 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
3332   echo $ac_n "(cached) $ac_c" 1>&6
3333 else
3334   
3335         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
3336         if test "$res" -gt 0 ; then
3337                 ol_cv_linux_threads=yes
3338         else
3339                 ol_cv_linux_threads=no
3340         fi
3341
3342 fi
3343
3344 echo "$ac_t""$ol_cv_linux_threads" 1>&6
3345
3346
3347                 if test $ol_cv_linux_threads = yes ; then
3348                         cat >> confdefs.h <<\EOF
3349 #define HAVE_LINUX_THREADS 1
3350 EOF
3351
3352                 fi
3353
3354                 
3355                                 echo $ac_n "checking for pthread_create""... $ac_c" 1>&6
3356 echo "configure:3357: checking for pthread_create" >&5
3357 if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then
3358   echo $ac_n "(cached) $ac_c" 1>&6
3359 else
3360   cat > conftest.$ac_ext <<EOF
3361 #line 3362 "configure"
3362 #include "confdefs.h"
3363 /* System header to define __stub macros and hopefully few prototypes,
3364     which can conflict with char pthread_create(); below.  */
3365 #include <assert.h>
3366 /* Override any gcc2 internal prototype to avoid an error.  */
3367 /* We use char because int might match the return type of a gcc2
3368     builtin and then its argument prototype would still apply.  */
3369 char pthread_create();
3370
3371 int main() {
3372
3373 /* The GNU C library defines this for functions which it implements
3374     to always fail with ENOSYS.  Some functions are actually named
3375     something starting with __ and the normal name is an alias.  */
3376 #if defined (__stub_pthread_create) || defined (__stub___pthread_create)
3377 choke me
3378 #else
3379 pthread_create();
3380 #endif
3381
3382 ; return 0; }
3383 EOF
3384 if { (eval echo configure:3385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3385   rm -rf conftest*
3386   eval "ac_cv_func_pthread_create=yes"
3387 else
3388   echo "configure: failed program was:" >&5
3389   cat conftest.$ac_ext >&5
3390   rm -rf conftest*
3391   eval "ac_cv_func_pthread_create=no"
3392 fi
3393 rm -f conftest*
3394 fi
3395
3396 if eval "test \"`echo '$ac_cv_func_'pthread_create`\" = yes"; then
3397   echo "$ac_t""yes" 1>&6
3398   ol_link_threads=yes
3399 else
3400   echo "$ac_t""no" 1>&6
3401 fi
3402
3403
3404                 if test $ol_link_threads = no ; then
3405                                                 echo $ac_n "checking for pthread_create with -pthread""... $ac_c" 1>&6
3406 echo "configure:3407: checking for pthread_create with -pthread" >&5
3407 if eval "test \"`echo '$''{'ol_cv_pthread_flag'+set}'`\" = set"; then
3408   echo $ac_n "(cached) $ac_c" 1>&6
3409 else
3410   
3411                                                                 save_LIBS="$LIBS"
3412                                 LIBS="-pthread $LIBS"
3413                                 cat > conftest.$ac_ext <<EOF
3414 #line 3415 "configure"
3415 #include "confdefs.h"
3416 char pthread();
3417 int main() {
3418
3419                                         pthread_create();
3420                                         
3421 ; return 0; }
3422 EOF
3423 if { (eval echo configure:3424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3424   rm -rf conftest*
3425   ol_cv_pthread_flag=yes
3426 else
3427   echo "configure: failed program was:" >&5
3428   cat conftest.$ac_ext >&5
3429   rm -rf conftest*
3430   ol_cv_pthread_flag=no
3431 fi
3432 rm -f conftest*
3433                                                                 LIBS="$save_LIBS"
3434                         
3435 fi
3436
3437 echo "$ac_t""$ol_cv_pthread_flag" 1>&6
3438
3439                         if test $ol_cv_pthread_flag = yes ; then
3440                                 LTHREAD_LIBS="$LTHREAD_LIBS -pthread"
3441                                 ol_link_threads=posix
3442                         fi
3443                 fi
3444
3445                 if test $ol_link_threads = no ; then
3446                                                 echo $ac_n "checking for pthread_create with -pthreads""... $ac_c" 1>&6
3447 echo "configure:3448: checking for pthread_create with -pthreads" >&5
3448 if eval "test \"`echo '$''{'ol_cv_pthreads_flag'+set}'`\" = set"; then
3449   echo $ac_n "(cached) $ac_c" 1>&6
3450 else
3451   
3452                                                                 save_LIBS="$LIBS"
3453                                 LIBS="-pthreads $LIBS"
3454                                 cat > conftest.$ac_ext <<EOF
3455 #line 3456 "configure"
3456 #include "confdefs.h"
3457 char pthread();
3458 int main() {
3459
3460                                         pthread_create();
3461                                         
3462 ; return 0; }
3463 EOF
3464 if { (eval echo configure:3465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3465   rm -rf conftest*
3466   ol_cv_pthreads_flag=yes
3467 else
3468   echo "configure: failed program was:" >&5
3469   cat conftest.$ac_ext >&5
3470   rm -rf conftest*
3471   ol_cv_pthreads_flag=no
3472 fi
3473 rm -f conftest*
3474                                                                 LIBS="$save_LIBS"
3475                         
3476 fi
3477
3478 echo "$ac_t""$ol_cv_pthreads_flag" 1>&6
3479
3480                         if test $ol_cv_pthreads_flag = yes ; then
3481                                 LTHREAD_LIBS="$LTHREAD_LIBS -pthreads"
3482                                 ol_link_threads=posix
3483                         fi
3484                 fi
3485
3486                 if test $ol_link_threads = no ; then
3487                                                 echo $ac_n "checking for pthread_create with -thread""... $ac_c" 1>&6
3488 echo "configure:3489: checking for pthread_create with -thread" >&5
3489 if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
3490   echo $ac_n "(cached) $ac_c" 1>&6
3491 else
3492   
3493                                                                 save_LIBS="$LIBS"
3494                                 LIBS="-thread $LIBS"
3495                                 cat > conftest.$ac_ext <<EOF
3496 #line 3497 "configure"
3497 #include "confdefs.h"
3498 char pthread();
3499 int main() {
3500
3501                                         pthread_create();
3502                                         
3503 ; return 0; }
3504 EOF
3505 if { (eval echo configure:3506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3506   rm -rf conftest*
3507   ol_cv_thread_flag=yes
3508 else
3509   echo "configure: failed program was:" >&5
3510   cat conftest.$ac_ext >&5
3511   rm -rf conftest*
3512   ol_cv_thread_flag=no
3513 fi
3514 rm -f conftest*
3515                                                                 LIBS="$save_LIBS"
3516                         
3517 fi
3518
3519 echo "$ac_t""$ol_cv_thread_flag" 1>&6
3520
3521                         if test $ol_cv_thread_flag = yes ; then
3522                                 LTHREAD_LIBS="$LTHREAD_LIBS -thread"
3523                                 ol_link_threads=posix
3524                         fi
3525                 fi
3526
3527                 if test $ol_link_threads = no ; then
3528                                                 save_LIBS="$LIBS"
3529                         echo $ac_n "checking for pthread_mutex_lock in -lpthread""... $ac_c" 1>&6
3530 echo "configure:3531: checking for pthread_mutex_lock in -lpthread" >&5
3531 ac_lib_var=`echo pthread'_'pthread_mutex_lock | sed 'y%./+-%__p_%'`
3532 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3533   echo $ac_n "(cached) $ac_c" 1>&6
3534 else
3535   ac_save_LIBS="$LIBS"
3536 LIBS="-lpthread -lexc $LIBS"
3537 cat > conftest.$ac_ext <<EOF
3538 #line 3539 "configure"
3539 #include "confdefs.h"
3540 /* Override any gcc2 internal prototype to avoid an error.  */
3541 /* We use char because int might match the return type of a gcc2
3542     builtin and then its argument prototype would still apply.  */
3543 char pthread_mutex_lock();
3544
3545 int main() {
3546 pthread_mutex_lock()
3547 ; return 0; }
3548 EOF
3549 if { (eval echo configure:3550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3550   rm -rf conftest*
3551   eval "ac_cv_lib_$ac_lib_var=yes"
3552 else
3553   echo "configure: failed program was:" >&5
3554   cat conftest.$ac_ext >&5
3555   rm -rf conftest*
3556   eval "ac_cv_lib_$ac_lib_var=no"
3557 fi
3558 rm -f conftest*
3559 LIBS="$ac_save_LIBS"
3560
3561 fi
3562 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3563   echo "$ac_t""yes" 1>&6
3564   
3565                                 ol_link_threads=posix
3566                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lexc"
3567                                 if test $ol_with_yielding_select = auto ; then
3568                                         ol_with_yielding_select=yes
3569                                 fi
3570                                 
3571 else
3572   echo "$ac_t""no" 1>&6
3573 fi
3574
3575                         LIBS="$save_LIBS"
3576                 fi
3577
3578                 if test $ol_link_threads = no ; then
3579                                                 save_LIBS="$LIBS"
3580                         echo $ac_n "checking for pthread_mutex_unlock in -lpthreads""... $ac_c" 1>&6
3581 echo "configure:3582: checking for pthread_mutex_unlock in -lpthreads" >&5
3582 ac_lib_var=`echo pthreads'_'pthread_mutex_unlock | sed 'y%./+-%__p_%'`
3583 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3584   echo $ac_n "(cached) $ac_c" 1>&6
3585 else
3586   ac_save_LIBS="$LIBS"
3587 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
3588 cat > conftest.$ac_ext <<EOF
3589 #line 3590 "configure"
3590 #include "confdefs.h"
3591 /* Override any gcc2 internal prototype to avoid an error.  */
3592 /* We use char because int might match the return type of a gcc2
3593     builtin and then its argument prototype would still apply.  */
3594 char pthread_mutex_unlock();
3595
3596 int main() {
3597 pthread_mutex_unlock()
3598 ; return 0; }
3599 EOF
3600 if { (eval echo configure:3601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3601   rm -rf conftest*
3602   eval "ac_cv_lib_$ac_lib_var=yes"
3603 else
3604   echo "configure: failed program was:" >&5
3605   cat conftest.$ac_ext >&5
3606   rm -rf conftest*
3607   eval "ac_cv_lib_$ac_lib_var=no"
3608 fi
3609 rm -f conftest*
3610 LIBS="$ac_save_LIBS"
3611
3612 fi
3613 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3614   echo "$ac_t""yes" 1>&6
3615   
3616                                 ol_link_threads=posix
3617                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc -lc_r"
3618                                 if test $ol_with_yielding_select = auto ; then
3619                                         ol_with_yielding_select=yes
3620                                 fi
3621                                 
3622 else
3623   echo "$ac_t""no" 1>&6
3624 fi
3625
3626                         LIBS="$save_LIBS"
3627                 fi
3628
3629                 if test $ol_link_threads = no ; then
3630                                                 save_LIBS="$LIBS"
3631                         echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
3632 echo "configure:3633: checking for pthread_create in -lpthread" >&5
3633 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
3634 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3635   echo $ac_n "(cached) $ac_c" 1>&6
3636 else
3637   ac_save_LIBS="$LIBS"
3638 LIBS="-lpthread  $LIBS"
3639 cat > conftest.$ac_ext <<EOF
3640 #line 3641 "configure"
3641 #include "confdefs.h"
3642 /* Override any gcc2 internal prototype to avoid an error.  */
3643 /* We use char because int might match the return type of a gcc2
3644     builtin and then its argument prototype would still apply.  */
3645 char pthread_create();
3646
3647 int main() {
3648 pthread_create()
3649 ; return 0; }
3650 EOF
3651 if { (eval echo configure:3652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3652   rm -rf conftest*
3653   eval "ac_cv_lib_$ac_lib_var=yes"
3654 else
3655   echo "configure: failed program was:" >&5
3656   cat conftest.$ac_ext >&5
3657   rm -rf conftest*
3658   eval "ac_cv_lib_$ac_lib_var=no"
3659 fi
3660 rm -f conftest*
3661 LIBS="$ac_save_LIBS"
3662
3663 fi
3664 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3665   echo "$ac_t""yes" 1>&6
3666   
3667                                 ol_link_threads=posix
3668                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
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 -lc_r""... $ac_c" 1>&6
3679 echo "configure:3680: checking for pthread_create in -lc_r" >&5
3680 ac_lib_var=`echo c_r'_'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="-lc_r  $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 -lc_r"
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 -lpthreads""... $ac_c" 1>&6
3726 echo "configure:3727: checking for pthread_create in -lpthreads" >&5
3727 ac_lib_var=`echo pthreads'_'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="-lpthreads  $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 -lpthreads"
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_join in -lpthreads""... $ac_c" 1>&6
3773 echo "configure:3774: checking for pthread_join in -lpthreads" >&5
3774 ac_lib_var=`echo pthreads'_'pthread_join | 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_join();
3787
3788 int main() {
3789 pthread_join()
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                                 
3811 else
3812   echo "$ac_t""no" 1>&6
3813 -Wl,-woff,85
3814 fi
3815
3816                         LIBS="$save_LIBS"
3817                 fi
3818
3819                                 if test $ol_link_threads = no; then
3820                         save_LIBS="$LIBS"
3821                         LIBS="$LIBS -lpthread"
3822                         echo $ac_n "checking for pthread_create() in HP-UX -lpthread""... $ac_c" 1>&6
3823 echo "configure:3824: checking for pthread_create() in HP-UX -lpthread" >&5
3824                         ol_try_pthread_hpux_11=no
3825                         if eval "test \"`echo '$''{'ol_cv_pthread_hpux_11'+set}'`\" = set"; then
3826   echo $ac_n "(cached) $ac_c" 1>&6
3827 else
3828   
3829                                 cat > conftest.$ac_ext <<EOF
3830 #line 3831 "configure"
3831 #include "confdefs.h"
3832
3833 #include <pthread.h>
3834 #include <elf.h>
3835 #ifndef ELFABI_HPUX_REL11
3836         die horribly
3837 #endif
3838                                 
3839 int main() {
3840 pthread_create(NULL, NULL, NULL, NULL);
3841 ; return 0; }
3842 EOF
3843 if { (eval echo configure:3844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3844   rm -rf conftest*
3845   ol_try_pthread_hpux_11=yes
3846                                         ol_cv_pthread_hpux_11=yes
3847 else
3848   echo "configure: failed program was:" >&5
3849   cat conftest.$ac_ext >&5
3850   rm -rf conftest*
3851   ol_cv_pthread_hpux_11=no
3852 fi
3853 rm -f conftest*
3854 fi
3855
3856                         echo "$ac_t""yes" 1>&6
3857                         LIBS="$save_LIBS"
3858
3859                         if test $ol_cv_pthread_hpux_11=yes ; then
3860                                 ol_link_threads=posix
3861                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
3862                                 if test $ol_try_pthread_hpux_11=yes ; then
3863                                                                                                                         ac_cv_func_pthread_attr_init=yes
3864                                 fi
3865                         fi
3866                 fi
3867
3868                 if test $ol_link_threads != no ; then
3869                         cat >> confdefs.h <<\EOF
3870 #define HAVE_PTHREADS 1
3871 EOF
3872
3873
3874                                                 save_CPPFLAGS="$CPPFLAGS"
3875                         save_LIBS="$LIBS"
3876                         LIBS="$LTHREAD_LIBS $LIBS"
3877
3878                                                                                                 for ac_func in sched_yield pthread_yield
3879 do
3880 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3881 echo "configure:3882: checking for $ac_func" >&5
3882 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3883   echo $ac_n "(cached) $ac_c" 1>&6
3884 else
3885   cat > conftest.$ac_ext <<EOF
3886 #line 3887 "configure"
3887 #include "confdefs.h"
3888 /* System header to define __stub macros and hopefully few prototypes,
3889     which can conflict with char $ac_func(); below.  */
3890 #include <assert.h>
3891 /* Override any gcc2 internal prototype to avoid an error.  */
3892 /* We use char because int might match the return type of a gcc2
3893     builtin and then its argument prototype would still apply.  */
3894 char $ac_func();
3895
3896 int main() {
3897
3898 /* The GNU C library defines this for functions which it implements
3899     to always fail with ENOSYS.  Some functions are actually named
3900     something starting with __ and the normal name is an alias.  */
3901 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3902 choke me
3903 #else
3904 $ac_func();
3905 #endif
3906
3907 ; return 0; }
3908 EOF
3909 if { (eval echo configure:3910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3910   rm -rf conftest*
3911   eval "ac_cv_func_$ac_func=yes"
3912 else
3913   echo "configure: failed program was:" >&5
3914   cat conftest.$ac_ext >&5
3915   rm -rf conftest*
3916   eval "ac_cv_func_$ac_func=no"
3917 fi
3918 rm -f conftest*
3919 fi
3920
3921 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3922   echo "$ac_t""yes" 1>&6
3923     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3924   cat >> confdefs.h <<EOF
3925 #define $ac_tr_func 1
3926 EOF
3927  
3928 else
3929   echo "$ac_t""no" 1>&6
3930 fi
3931 done
3932
3933
3934                         if test $ac_cv_func_sched_yield = no -a \
3935                                 $ac_cv_func_pthread_yield = no ; then
3936                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
3937 echo "configure:3938: checking for sched_yield in -lrt" >&5
3938 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
3939 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3940   echo $ac_n "(cached) $ac_c" 1>&6
3941 else
3942   ac_save_LIBS="$LIBS"
3943 LIBS="-lrt  $LIBS"
3944 cat > conftest.$ac_ext <<EOF
3945 #line 3946 "configure"
3946 #include "confdefs.h"
3947 /* Override any gcc2 internal prototype to avoid an error.  */
3948 /* We use char because int might match the return type of a gcc2
3949     builtin and then its argument prototype would still apply.  */
3950 char sched_yield();
3951
3952 int main() {
3953 sched_yield()
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_lib_$ac_lib_var=yes"
3959 else
3960   echo "configure: failed program was:" >&5
3961   cat conftest.$ac_ext >&5
3962   rm -rf conftest*
3963   eval "ac_cv_lib_$ac_lib_var=no"
3964 fi
3965 rm -f conftest*
3966 LIBS="$ac_save_LIBS"
3967
3968 fi
3969 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3970   echo "$ac_t""yes" 1>&6
3971   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
3972                                         cat >> confdefs.h <<\EOF
3973 #define HAVE_SCHED_YIELD 1
3974 EOF
3975
3976                                         ac_cv_func_sched_yield=yes
3977 else
3978   echo "$ac_t""no" 1>&6
3979 ac_cv_func_sched_yield=no
3980 fi
3981
3982                         fi
3983                         if test $ac_cv_func_sched_yield = no -a \
3984                                 $ac_cv_func_pthread_yield = no ; then
3985                                                                 echo $ac_n "checking for sched_yield in -lposix4""... $ac_c" 1>&6
3986 echo "configure:3987: checking for sched_yield in -lposix4" >&5
3987 ac_lib_var=`echo posix4'_'sched_yield | sed 'y%./+-%__p_%'`
3988 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3989   echo $ac_n "(cached) $ac_c" 1>&6
3990 else
3991   ac_save_LIBS="$LIBS"
3992 LIBS="-lposix4  $LIBS"
3993 cat > conftest.$ac_ext <<EOF
3994 #line 3995 "configure"
3995 #include "confdefs.h"
3996 /* Override any gcc2 internal prototype to avoid an error.  */
3997 /* We use char because int might match the return type of a gcc2
3998     builtin and then its argument prototype would still apply.  */
3999 char sched_yield();
4000
4001 int main() {
4002 sched_yield()
4003 ; return 0; }
4004 EOF
4005 if { (eval echo configure:4006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4006   rm -rf conftest*
4007   eval "ac_cv_lib_$ac_lib_var=yes"
4008 else
4009   echo "configure: failed program was:" >&5
4010   cat conftest.$ac_ext >&5
4011   rm -rf conftest*
4012   eval "ac_cv_lib_$ac_lib_var=no"
4013 fi
4014 rm -f conftest*
4015 LIBS="$ac_save_LIBS"
4016
4017 fi
4018 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4019   echo "$ac_t""yes" 1>&6
4020   LTHREAD_LIBS="$LTHREAD_LIBS -lposix4"
4021                                         cat >> confdefs.h <<\EOF
4022 #define HAVE_SCHED_YIELD 1
4023 EOF
4024
4025                                         ac_cv_func_sched_yield=yes
4026 else
4027   echo "$ac_t""no" 1>&6
4028 ac_cv_func_sched_yield=no
4029 fi
4030
4031                         fi
4032                         if test $ac_cv_func_sched_yield = no -a \
4033                                 $ac_cv_func_pthread_yield = no ; then
4034                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
4035                                 { echo "configure: error: POSIX Threads are not usable" 1>&2; exit 1; }
4036                         fi
4037
4038                                                 for ac_func in pthread_kill
4039 do
4040 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4041 echo "configure:4042: checking for $ac_func" >&5
4042 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4043   echo $ac_n "(cached) $ac_c" 1>&6
4044 else
4045   cat > conftest.$ac_ext <<EOF
4046 #line 4047 "configure"
4047 #include "confdefs.h"
4048 /* System header to define __stub macros and hopefully few prototypes,
4049     which can conflict with char $ac_func(); below.  */
4050 #include <assert.h>
4051 /* Override any gcc2 internal prototype to avoid an error.  */
4052 /* We use char because int might match the return type of a gcc2
4053     builtin and then its argument prototype would still apply.  */
4054 char $ac_func();
4055
4056 int main() {
4057
4058 /* The GNU C library defines this for functions which it implements
4059     to always fail with ENOSYS.  Some functions are actually named
4060     something starting with __ and the normal name is an alias.  */
4061 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4062 choke me
4063 #else
4064 $ac_func();
4065 #endif
4066
4067 ; return 0; }
4068 EOF
4069 if { (eval echo configure:4070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4070   rm -rf conftest*
4071   eval "ac_cv_func_$ac_func=yes"
4072 else
4073   echo "configure: failed program was:" >&5
4074   cat conftest.$ac_ext >&5
4075   rm -rf conftest*
4076   eval "ac_cv_func_$ac_func=no"
4077 fi
4078 rm -f conftest*
4079 fi
4080
4081 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4082   echo "$ac_t""yes" 1>&6
4083     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4084   cat >> confdefs.h <<EOF
4085 #define $ac_tr_func 1
4086 EOF
4087  
4088 else
4089   echo "$ac_t""no" 1>&6
4090 fi
4091 done
4092
4093                         for ac_func in \
4094                                 pthread_attr_create pthread_attr_init \
4095                                 pthread_attr_destroy pthread_attr_delete \
4096                                 pthread_attr_setdetachstate pthread_attr_setdetach_np \
4097                         
4098 do
4099 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4100 echo "configure:4101: checking for $ac_func" >&5
4101 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4102   echo $ac_n "(cached) $ac_c" 1>&6
4103 else
4104   cat > conftest.$ac_ext <<EOF
4105 #line 4106 "configure"
4106 #include "confdefs.h"
4107 /* System header to define __stub macros and hopefully few prototypes,
4108     which can conflict with char $ac_func(); below.  */
4109 #include <assert.h>
4110 /* Override any gcc2 internal prototype to avoid an error.  */
4111 /* We use char because int might match the return type of a gcc2
4112     builtin and then its argument prototype would still apply.  */
4113 char $ac_func();
4114
4115 int main() {
4116
4117 /* The GNU C library defines this for functions which it implements
4118     to always fail with ENOSYS.  Some functions are actually named
4119     something starting with __ and the normal name is an alias.  */
4120 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4121 choke me
4122 #else
4123 $ac_func();
4124 #endif
4125
4126 ; return 0; }
4127 EOF
4128 if { (eval echo configure:4129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4129   rm -rf conftest*
4130   eval "ac_cv_func_$ac_func=yes"
4131 else
4132   echo "configure: failed program was:" >&5
4133   cat conftest.$ac_ext >&5
4134   rm -rf conftest*
4135   eval "ac_cv_func_$ac_func=no"
4136 fi
4137 rm -f conftest*
4138 fi
4139
4140 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4141   echo "$ac_t""yes" 1>&6
4142     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4143   cat >> confdefs.h <<EOF
4144 #define $ac_tr_func 1
4145 EOF
4146  
4147 else
4148   echo "$ac_t""no" 1>&6
4149 fi
4150 done
4151
4152
4153                                                 for ac_func in \
4154                                 pthread_setconcurrency \
4155                                 thr_setconcurrency \
4156                         
4157 do
4158 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4159 echo "configure:4160: checking for $ac_func" >&5
4160 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4161   echo $ac_n "(cached) $ac_c" 1>&6
4162 else
4163   cat > conftest.$ac_ext <<EOF
4164 #line 4165 "configure"
4165 #include "confdefs.h"
4166 /* System header to define __stub macros and hopefully few prototypes,
4167     which can conflict with char $ac_func(); below.  */
4168 #include <assert.h>
4169 /* Override any gcc2 internal prototype to avoid an error.  */
4170 /* We use char because int might match the return type of a gcc2
4171     builtin and then its argument prototype would still apply.  */
4172 char $ac_func();
4173
4174 int main() {
4175
4176 /* The GNU C library defines this for functions which it implements
4177     to always fail with ENOSYS.  Some functions are actually named
4178     something starting with __ and the normal name is an alias.  */
4179 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4180 choke me
4181 #else
4182 $ac_func();
4183 #endif
4184
4185 ; return 0; }
4186 EOF
4187 if { (eval echo configure:4188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4188   rm -rf conftest*
4189   eval "ac_cv_func_$ac_func=yes"
4190 else
4191   echo "configure: failed program was:" >&5
4192   cat conftest.$ac_ext >&5
4193   rm -rf conftest*
4194   eval "ac_cv_func_$ac_func=no"
4195 fi
4196 rm -f conftest*
4197 fi
4198
4199 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4200   echo "$ac_t""yes" 1>&6
4201     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4202   cat >> confdefs.h <<EOF
4203 #define $ac_tr_func 1
4204 EOF
4205  
4206 else
4207   echo "$ac_t""no" 1>&6
4208 fi
4209 done
4210
4211
4212                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
4213 echo "configure:4214: checking if pthread_create() works" >&5
4214                         if eval "test \"`echo '$''{'ol_cv_pthread_create_works'+set}'`\" = set"; then
4215   echo $ac_n "(cached) $ac_c" 1>&6
4216 else
4217   
4218                         if test "$cross_compiling" = yes; then
4219                                 ol_cv_pthread_create_works=yes
4220 else
4221   cat > conftest.$ac_ext <<EOF
4222 #line 4223 "configure"
4223 #include "confdefs.h"
4224
4225 #include <pthread.h>
4226 #ifndef NULL
4227 #define NULL (void*)0
4228 #endif
4229
4230 static void *task(p)
4231         void *p;
4232 {
4233         return (void *) (p == NULL);
4234 }
4235
4236 int main(argc, argv)
4237         int argc;
4238         char **argv;
4239 {
4240         pthread_t t;
4241         exit(pthread_create(&t, NULL, task, NULL));
4242 }
4243
4244 EOF
4245 if { (eval echo configure:4246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
4246 then
4247   ol_cv_pthread_create_works=yes
4248 else
4249   echo "configure: failed program was:" >&5
4250   cat conftest.$ac_ext >&5
4251   rm -fr conftest*
4252   ol_cv_pthread_create_works=no
4253 fi
4254 rm -fr conftest*
4255 fi
4256
4257 fi
4258
4259                         echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
4260
4261                         if test $ol_cv_pthread_create_works = no ; then
4262                                 { echo "configure: error: pthread.h and pthread_create are not compatible" 1>&2; exit 1; }
4263                         fi
4264
4265                                                 if test $ol_with_yielding_select = auto ; then
4266                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
4267 echo "configure:4268: checking if select yields when using pthreads" >&5
4268                                 if eval "test \"`echo '$''{'ol_cv_pthread_select_yields'+set}'`\" = set"; then
4269   echo $ac_n "(cached) $ac_c" 1>&6
4270 else
4271   
4272                                 if test "$cross_compiling" = yes; then
4273   
4274                                 { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
4275 else
4276   cat > conftest.$ac_ext <<EOF
4277 #line 4278 "configure"
4278 #include "confdefs.h"
4279
4280 #include <sys/types.h>
4281 #include <sys/time.h>
4282 #include <unistd.h>
4283 #include <pthread.h>
4284 #ifndef NULL
4285 #define NULL (void*) 0
4286 #endif
4287
4288 static int fildes[2];
4289
4290 static void *task(p)
4291         void *p;
4292 {
4293         int i;
4294         struct timeval tv;
4295
4296         fd_set rfds;
4297
4298         tv.tv_sec=10;
4299         tv.tv_usec=0;
4300
4301         FD_ZERO(&rfds);
4302         FD_SET(fildes[0], &rfds);
4303
4304         /* we're not interested in any fds */
4305         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
4306
4307         if(i < 0) {
4308                 perror("select");
4309                 exit(10);
4310         }
4311
4312         exit(0); /* if we exit here, the select blocked the whole process */
4313 }
4314
4315 int main(argc, argv)
4316         int argc;
4317         char **argv;
4318 {
4319         pthread_t t;
4320
4321         /* create a pipe to select */
4322         if(pipe(&fildes[0])) {
4323                 perror("select");
4324                 exit(1);
4325         }
4326
4327 #ifdef HAVE_PTHREAD_SETCONCURRENCY
4328         (void) pthread_setconcurrency(2);
4329 #else
4330 #ifdef HAVE_THR_SETCONCURRENCY
4331         /* Set Solaris LWP concurrency to 2 */
4332         thr_setconcurrency(2);
4333 #endif
4334 #endif
4335
4336         pthread_create(&t, NULL, task, NULL);
4337
4338 #if HAVE_SCHED_YIELD
4339         sched_yield();  /* make sure task runs first */
4340 #else
4341 #ifdef HAVE_PTHREAD_YIELD
4342         pthread_yield();        /* make sure task runs first */
4343 #endif
4344 #endif
4345
4346         exit(2);
4347 }
4348 EOF
4349 if { (eval echo configure:4350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
4350 then
4351   ol_cv_pthread_select_yields=no
4352 else
4353   echo "configure: failed program was:" >&5
4354   cat conftest.$ac_ext >&5
4355   rm -fr conftest*
4356   ol_cv_pthread_select_yields=yes
4357 fi
4358 rm -fr conftest*
4359 fi
4360
4361 fi
4362
4363                                 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
4364
4365                                 if test $ol_cv_pthread_select_yields = yes ; then
4366                                         ol_with_yielding_select=yes
4367                                 fi
4368                         fi
4369
4370                                                 CPPFLAGS="$save_CPPFLAGS"
4371                         LIBS="$save_LIBS"
4372                 else
4373                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
4374                 fi
4375         fi
4376
4377         if test $ol_with_threads = posix ; then
4378                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
4379         fi
4380 fi
4381
4382 if test $ol_with_threads = auto -o $ol_with_threads = yes \
4383         -o $ol_with_threads = mach ; then
4384
4385                 for ac_hdr in mach/cthreads.h
4386 do
4387 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4388 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4389 echo "configure:4390: checking for $ac_hdr" >&5
4390 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4391   echo $ac_n "(cached) $ac_c" 1>&6
4392 else
4393   cat > conftest.$ac_ext <<EOF
4394 #line 4395 "configure"
4395 #include "confdefs.h"
4396 #include <$ac_hdr>
4397 EOF
4398 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4399 { (eval echo configure:4400: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4400 ac_err=`grep -v '^ *+' conftest.out`
4401 if test -z "$ac_err"; then
4402   rm -rf conftest*
4403   eval "ac_cv_header_$ac_safe=yes"
4404 else
4405   echo "$ac_err" >&5
4406   echo "configure: failed program was:" >&5
4407   cat conftest.$ac_ext >&5
4408   rm -rf conftest*
4409   eval "ac_cv_header_$ac_safe=no"
4410 fi
4411 rm -f conftest*
4412 fi
4413 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4414   echo "$ac_t""yes" 1>&6
4415     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4416   cat >> confdefs.h <<EOF
4417 #define $ac_tr_hdr 1
4418 EOF
4419  
4420 else
4421   echo "$ac_t""no" 1>&6
4422 fi
4423 done
4424
4425         if test $ac_cv_header_mach_cthreads_h = yes ; then
4426                 ol_with_threads=found
4427
4428                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
4429 echo "configure:4430: checking for cthread_fork" >&5
4430 if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
4431   echo $ac_n "(cached) $ac_c" 1>&6
4432 else
4433   cat > conftest.$ac_ext <<EOF
4434 #line 4435 "configure"
4435 #include "confdefs.h"
4436 /* System header to define __stub macros and hopefully few prototypes,
4437     which can conflict with char cthread_fork(); below.  */
4438 #include <assert.h>
4439 /* Override any gcc2 internal prototype to avoid an error.  */
4440 /* We use char because int might match the return type of a gcc2
4441     builtin and then its argument prototype would still apply.  */
4442 char cthread_fork();
4443
4444 int main() {
4445
4446 /* The GNU C library defines this for functions which it implements
4447     to always fail with ENOSYS.  Some functions are actually named
4448     something starting with __ and the normal name is an alias.  */
4449 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
4450 choke me
4451 #else
4452 cthread_fork();
4453 #endif
4454
4455 ; return 0; }
4456 EOF
4457 if { (eval echo configure:4458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4458   rm -rf conftest*
4459   eval "ac_cv_func_cthread_fork=yes"
4460 else
4461   echo "configure: failed program was:" >&5
4462   cat conftest.$ac_ext >&5
4463   rm -rf conftest*
4464   eval "ac_cv_func_cthread_fork=no"
4465 fi
4466 rm -f conftest*
4467 fi
4468
4469 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
4470   echo "$ac_t""yes" 1>&6
4471   ol_link_threads=yes
4472 else
4473   echo "$ac_t""no" 1>&6
4474 fi
4475
4476
4477                 if test $ol_link_threads = no ; then
4478                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
4479 echo "configure:4480: checking for cthread_fork with -all_load" >&5
4480 if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
4481   echo $ac_n "(cached) $ac_c" 1>&6
4482 else
4483   
4484                                                                 save_LIBS="$LIBS"
4485                                 LIBS="-all_load $LIBS"
4486                                 cat > conftest.$ac_ext <<EOF
4487 #line 4488 "configure"
4488 #include "confdefs.h"
4489 #include <mach/cthreads.h>
4490 int main() {
4491
4492                                         cthread_fork((void *)0, (void *)0);
4493                                         
4494 ; return 0; }
4495 EOF
4496 if { (eval echo configure:4497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4497   rm -rf conftest*
4498   ol_cv_cthread_all_load=yes
4499 else
4500   echo "configure: failed program was:" >&5
4501   cat conftest.$ac_ext >&5
4502   rm -rf conftest*
4503   ol_cv_cthread_all_load=no
4504 fi
4505 rm -f conftest*
4506                                                                 LIBS="$save_LIBS"
4507                         
4508 fi
4509
4510 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
4511
4512                         if test $ol_cv_cthread_all_load = yes ; then
4513                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
4514                                 ol_link_threads=mach
4515                         fi
4516                 fi
4517
4518                 if test $ol_link_threads != no ; then
4519                         : check for cthread specific functionality here
4520                         cat >> confdefs.h <<\EOF
4521 #define HAVE_MACH_CTHREADS 1
4522 EOF
4523
4524                 else
4525                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
4526                 fi
4527         fi
4528
4529         if test $ol_with_threads = mach ; then
4530                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
4531         fi
4532 fi
4533
4534 if test $ol_with_threads = auto -o $ol_with_threads = yes \
4535         -o $ol_with_threads = lwp ; then
4536
4537                 for ac_hdr in thread.h synch.h
4538 do
4539 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4540 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4541 echo "configure:4542: checking for $ac_hdr" >&5
4542 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4543   echo $ac_n "(cached) $ac_c" 1>&6
4544 else
4545   cat > conftest.$ac_ext <<EOF
4546 #line 4547 "configure"
4547 #include "confdefs.h"
4548 #include <$ac_hdr>
4549 EOF
4550 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4551 { (eval echo configure:4552: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4552 ac_err=`grep -v '^ *+' conftest.out`
4553 if test -z "$ac_err"; then
4554   rm -rf conftest*
4555   eval "ac_cv_header_$ac_safe=yes"
4556 else
4557   echo "$ac_err" >&5
4558   echo "configure: failed program was:" >&5
4559   cat conftest.$ac_ext >&5
4560   rm -rf conftest*
4561   eval "ac_cv_header_$ac_safe=no"
4562 fi
4563 rm -f conftest*
4564 fi
4565 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4566   echo "$ac_t""yes" 1>&6
4567     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4568   cat >> confdefs.h <<EOF
4569 #define $ac_tr_hdr 1
4570 EOF
4571  
4572 else
4573   echo "$ac_t""no" 1>&6
4574 fi
4575 done
4576
4577         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
4578                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
4579 echo "configure:4580: checking for thr_create in -lthread" >&5
4580 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
4581 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4582   echo $ac_n "(cached) $ac_c" 1>&6
4583 else
4584   ac_save_LIBS="$LIBS"
4585 LIBS="-lthread  $LIBS"
4586 cat > conftest.$ac_ext <<EOF
4587 #line 4588 "configure"
4588 #include "confdefs.h"
4589 /* Override any gcc2 internal prototype to avoid an error.  */
4590 /* We use char because int might match the return type of a gcc2
4591     builtin and then its argument prototype would still apply.  */
4592 char thr_create();
4593
4594 int main() {
4595 thr_create()
4596 ; return 0; }
4597 EOF
4598 if { (eval echo configure:4599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4599   rm -rf conftest*
4600   eval "ac_cv_lib_$ac_lib_var=yes"
4601 else
4602   echo "configure: failed program was:" >&5
4603   cat conftest.$ac_ext >&5
4604   rm -rf conftest*
4605   eval "ac_cv_lib_$ac_lib_var=no"
4606 fi
4607 rm -f conftest*
4608 LIBS="$ac_save_LIBS"
4609
4610 fi
4611 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4612   echo "$ac_t""yes" 1>&6
4613   have_thr=yes
4614 else
4615   echo "$ac_t""no" 1>&6
4616 have_thr=no
4617 fi
4618
4619
4620                 if test $have_thr = yes ; then
4621                         cat >> confdefs.h <<\EOF
4622 #define HAVE_THR 1
4623 EOF
4624
4625                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
4626                         ol_link_threads=thr
4627
4628                         if test $ol_with_yielding_select = auto ; then
4629                                 ol_with_yielding_select=yes
4630                         fi
4631                 fi
4632         fi
4633
4634                 for ac_hdr in lwp/lwp.h
4635 do
4636 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4637 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4638 echo "configure:4639: checking for $ac_hdr" >&5
4639 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4640   echo $ac_n "(cached) $ac_c" 1>&6
4641 else
4642   cat > conftest.$ac_ext <<EOF
4643 #line 4644 "configure"
4644 #include "confdefs.h"
4645 #include <$ac_hdr>
4646 EOF
4647 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4648 { (eval echo configure:4649: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4649 ac_err=`grep -v '^ *+' conftest.out`
4650 if test -z "$ac_err"; then
4651   rm -rf conftest*
4652   eval "ac_cv_header_$ac_safe=yes"
4653 else
4654   echo "$ac_err" >&5
4655   echo "configure: failed program was:" >&5
4656   cat conftest.$ac_ext >&5
4657   rm -rf conftest*
4658   eval "ac_cv_header_$ac_safe=no"
4659 fi
4660 rm -f conftest*
4661 fi
4662 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4663   echo "$ac_t""yes" 1>&6
4664     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4665   cat >> confdefs.h <<EOF
4666 #define $ac_tr_hdr 1
4667 EOF
4668  
4669 else
4670   echo "$ac_t""no" 1>&6
4671 fi
4672 done
4673
4674         if test $ac_cv_header_lwp_lwp_h = yes ; then
4675                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
4676 echo "configure:4677: checking for lwp_create in -llwp" >&5
4677 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
4678 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4679   echo $ac_n "(cached) $ac_c" 1>&6
4680 else
4681   ac_save_LIBS="$LIBS"
4682 LIBS="-llwp  $LIBS"
4683 cat > conftest.$ac_ext <<EOF
4684 #line 4685 "configure"
4685 #include "confdefs.h"
4686 /* Override any gcc2 internal prototype to avoid an error.  */
4687 /* We use char because int might match the return type of a gcc2
4688     builtin and then its argument prototype would still apply.  */
4689 char lwp_create();
4690
4691 int main() {
4692 lwp_create()
4693 ; return 0; }
4694 EOF
4695 if { (eval echo configure:4696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4696   rm -rf conftest*
4697   eval "ac_cv_lib_$ac_lib_var=yes"
4698 else
4699   echo "configure: failed program was:" >&5
4700   cat conftest.$ac_ext >&5
4701   rm -rf conftest*
4702   eval "ac_cv_lib_$ac_lib_var=no"
4703 fi
4704 rm -f conftest*
4705 LIBS="$ac_save_LIBS"
4706
4707 fi
4708 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4709   echo "$ac_t""yes" 1>&6
4710   have_lwp=yes
4711 else
4712   echo "$ac_t""no" 1>&6
4713 have_lwp=no
4714 fi
4715
4716
4717                 if test $have_lwp = yes ; then
4718                         cat >> confdefs.h <<\EOF
4719 #define HAVE_LWP 1
4720 EOF
4721
4722                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
4723                         ol_link_threads=lwp
4724
4725                         if test $ol_with_yielding_select = auto ; then
4726                                 ol_with_yielding_select=no
4727                         fi
4728                 fi
4729         fi
4730 fi
4731
4732 if test $ol_with_yielding_select = yes ; then
4733         cat >> confdefs.h <<\EOF
4734 #define HAVE_YIELDING_SELECT 1
4735 EOF
4736
4737 fi
4738
4739 if test $ol_with_threads = manual ; then
4740                 ol_link_threads=yes
4741
4742         echo "configure: warning: thread defines and link options must be set manually" 1>&2
4743
4744         for ac_hdr in pthread.h sched.h
4745 do
4746 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4747 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4748 echo "configure:4749: checking for $ac_hdr" >&5
4749 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4750   echo $ac_n "(cached) $ac_c" 1>&6
4751 else
4752   cat > conftest.$ac_ext <<EOF
4753 #line 4754 "configure"
4754 #include "confdefs.h"
4755 #include <$ac_hdr>
4756 EOF
4757 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4758 { (eval echo configure:4759: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4759 ac_err=`grep -v '^ *+' conftest.out`
4760 if test -z "$ac_err"; then
4761   rm -rf conftest*
4762   eval "ac_cv_header_$ac_safe=yes"
4763 else
4764   echo "$ac_err" >&5
4765   echo "configure: failed program was:" >&5
4766   cat conftest.$ac_ext >&5
4767   rm -rf conftest*
4768   eval "ac_cv_header_$ac_safe=no"
4769 fi
4770 rm -f conftest*
4771 fi
4772 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4773   echo "$ac_t""yes" 1>&6
4774     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4775   cat >> confdefs.h <<EOF
4776 #define $ac_tr_hdr 1
4777 EOF
4778  
4779 else
4780   echo "$ac_t""no" 1>&6
4781 fi
4782 done
4783
4784         for ac_func in sched_yield pthread_yield
4785 do
4786 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4787 echo "configure:4788: checking for $ac_func" >&5
4788 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4789   echo $ac_n "(cached) $ac_c" 1>&6
4790 else
4791   cat > conftest.$ac_ext <<EOF
4792 #line 4793 "configure"
4793 #include "confdefs.h"
4794 /* System header to define __stub macros and hopefully few prototypes,
4795     which can conflict with char $ac_func(); below.  */
4796 #include <assert.h>
4797 /* Override any gcc2 internal prototype to avoid an error.  */
4798 /* We use char because int might match the return type of a gcc2
4799     builtin and then its argument prototype would still apply.  */
4800 char $ac_func();
4801
4802 int main() {
4803
4804 /* The GNU C library defines this for functions which it implements
4805     to always fail with ENOSYS.  Some functions are actually named
4806     something starting with __ and the normal name is an alias.  */
4807 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4808 choke me
4809 #else
4810 $ac_func();
4811 #endif
4812
4813 ; return 0; }
4814 EOF
4815 if { (eval echo configure:4816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4816   rm -rf conftest*
4817   eval "ac_cv_func_$ac_func=yes"
4818 else
4819   echo "configure: failed program was:" >&5
4820   cat conftest.$ac_ext >&5
4821   rm -rf conftest*
4822   eval "ac_cv_func_$ac_func=no"
4823 fi
4824 rm -f conftest*
4825 fi
4826
4827 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4828   echo "$ac_t""yes" 1>&6
4829     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4830   cat >> confdefs.h <<EOF
4831 #define $ac_tr_func 1
4832 EOF
4833  
4834 else
4835   echo "$ac_t""no" 1>&6
4836 fi
4837 done
4838
4839         
4840 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
4841 echo "configure:4842: checking for LinuxThreads" >&5
4842 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
4843   echo $ac_n "(cached) $ac_c" 1>&6
4844 else
4845   
4846         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
4847         if test "$res" -gt 0 ; then
4848                 ol_cv_linux_threads=yes
4849         else
4850                 ol_cv_linux_threads=no
4851         fi
4852
4853 fi
4854
4855 echo "$ac_t""$ol_cv_linux_threads" 1>&6
4856
4857
4858         for ac_hdr in mach/cthreads.h
4859 do
4860 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4861 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4862 echo "configure:4863: checking for $ac_hdr" >&5
4863 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4864   echo $ac_n "(cached) $ac_c" 1>&6
4865 else
4866   cat > conftest.$ac_ext <<EOF
4867 #line 4868 "configure"
4868 #include "confdefs.h"
4869 #include <$ac_hdr>
4870 EOF
4871 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4872 { (eval echo configure:4873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4873 ac_err=`grep -v '^ *+' conftest.out`
4874 if test -z "$ac_err"; then
4875   rm -rf conftest*
4876   eval "ac_cv_header_$ac_safe=yes"
4877 else
4878   echo "$ac_err" >&5
4879   echo "configure: failed program was:" >&5
4880   cat conftest.$ac_ext >&5
4881   rm -rf conftest*
4882   eval "ac_cv_header_$ac_safe=no"
4883 fi
4884 rm -f conftest*
4885 fi
4886 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4887   echo "$ac_t""yes" 1>&6
4888     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4889   cat >> confdefs.h <<EOF
4890 #define $ac_tr_hdr 1
4891 EOF
4892  
4893 else
4894   echo "$ac_t""no" 1>&6
4895 fi
4896 done
4897
4898         for ac_hdr in lwp/lwp.h
4899 do
4900 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4901 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4902 echo "configure:4903: checking for $ac_hdr" >&5
4903 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4904   echo $ac_n "(cached) $ac_c" 1>&6
4905 else
4906   cat > conftest.$ac_ext <<EOF
4907 #line 4908 "configure"
4908 #include "confdefs.h"
4909 #include <$ac_hdr>
4910 EOF
4911 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4912 { (eval echo configure:4913: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4913 ac_err=`grep -v '^ *+' conftest.out`
4914 if test -z "$ac_err"; then
4915   rm -rf conftest*
4916   eval "ac_cv_header_$ac_safe=yes"
4917 else
4918   echo "$ac_err" >&5
4919   echo "configure: failed program was:" >&5
4920   cat conftest.$ac_ext >&5
4921   rm -rf conftest*
4922   eval "ac_cv_header_$ac_safe=no"
4923 fi
4924 rm -f conftest*
4925 fi
4926 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4927   echo "$ac_t""yes" 1>&6
4928     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4929   cat >> confdefs.h <<EOF
4930 #define $ac_tr_hdr 1
4931 EOF
4932  
4933 else
4934   echo "$ac_t""no" 1>&6
4935 fi
4936 done
4937
4938         for ac_hdr in thread.h synch.h
4939 do
4940 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4941 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4942 echo "configure:4943: checking for $ac_hdr" >&5
4943 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4944   echo $ac_n "(cached) $ac_c" 1>&6
4945 else
4946   cat > conftest.$ac_ext <<EOF
4947 #line 4948 "configure"
4948 #include "confdefs.h"
4949 #include <$ac_hdr>
4950 EOF
4951 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4952 { (eval echo configure:4953: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4953 ac_err=`grep -v '^ *+' conftest.out`
4954 if test -z "$ac_err"; then
4955   rm -rf conftest*
4956   eval "ac_cv_header_$ac_safe=yes"
4957 else
4958   echo "$ac_err" >&5
4959   echo "configure: failed program was:" >&5
4960   cat conftest.$ac_ext >&5
4961   rm -rf conftest*
4962   eval "ac_cv_header_$ac_safe=no"
4963 fi
4964 rm -f conftest*
4965 fi
4966 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4967   echo "$ac_t""yes" 1>&6
4968     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4969   cat >> confdefs.h <<EOF
4970 #define $ac_tr_hdr 1
4971 EOF
4972  
4973 else
4974   echo "$ac_t""no" 1>&6
4975 fi
4976 done
4977
4978 fi
4979
4980 if test $ol_link_threads != no ; then  
4981                         cat >> confdefs.h <<\EOF
4982 #define REENTRANT 1
4983 EOF
4984
4985         cat >> confdefs.h <<\EOF
4986 #define _REENTRANT 1
4987 EOF
4988
4989         cat >> confdefs.h <<\EOF
4990 #define THREAD_SAFE 1
4991 EOF
4992
4993         cat >> confdefs.h <<\EOF
4994 #define _THREAD_SAFE 1
4995 EOF
4996
4997         cat >> confdefs.h <<\EOF
4998 #define THREADSAFE 1
4999 EOF
5000
5001         cat >> confdefs.h <<\EOF
5002 #define _THREADSAFE 1
5003 EOF
5004
5005
5006                                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
5007 echo "configure:5008: checking for thread specific errno" >&5
5008 if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
5009   echo $ac_n "(cached) $ac_c" 1>&6
5010 else
5011   
5012                 cat > conftest.$ac_ext <<EOF
5013 #line 5014 "configure"
5014 #include "confdefs.h"
5015
5016 #include <errno.h>
5017                         
5018 int main() {
5019
5020 int x = errno;
5021                         
5022 ; return 0; }
5023 EOF
5024 if { (eval echo configure:5025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5025   rm -rf conftest*
5026   ol_cv_errno_thread_specific=yes
5027 else
5028   echo "configure: failed program was:" >&5
5029   cat conftest.$ac_ext >&5
5030   rm -rf conftest*
5031   ol_cv_errno_thread_specific=no
5032 fi
5033 rm -f conftest*
5034         
5035 fi
5036
5037 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
5038
5039         if test $ol_cv_errno_thread_specific != yes ; then
5040                 LIBS="$LTHREAD_LIBS $LIBS"
5041                 LTHREAD_LIBS=""
5042         fi
5043
5044 fi  
5045
5046
5047 if test $ol_link_threads = no ; then
5048         if test $ol_with_threads = yes ; then
5049                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
5050         fi
5051
5052         if test $ol_with_threads = auto ; then
5053                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
5054                 ol_with_threads=no
5055         fi
5056
5057         cat >> confdefs.h <<\EOF
5058 #define NO_THREADS 1
5059 EOF
5060
5061         LTHREAD_LIBS=""
5062 fi
5063
5064 ol_link_ldbm=no 
5065 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
5066         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
5067 echo "configure:5068: checking for DB2 library" >&5
5068 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
5069   echo $ac_n "(cached) $ac_c" 1>&6
5070 else
5071         ol_LIBS="$LIBS"
5072         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
5073 echo "configure:5074: checking for db_open in -ldb" >&5
5074 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
5075 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5076   echo $ac_n "(cached) $ac_c" 1>&6
5077 else
5078   ac_save_LIBS="$LIBS"
5079 LIBS="-ldb  $LIBS"
5080 cat > conftest.$ac_ext <<EOF
5081 #line 5082 "configure"
5082 #include "confdefs.h"
5083 /* Override any gcc2 internal prototype to avoid an error.  */
5084 /* We use char because int might match the return type of a gcc2
5085     builtin and then its argument prototype would still apply.  */
5086 char db_open();
5087
5088 int main() {
5089 db_open()
5090 ; return 0; }
5091 EOF
5092 if { (eval echo configure:5093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5093   rm -rf conftest*
5094   eval "ac_cv_lib_$ac_lib_var=yes"
5095 else
5096   echo "configure: failed program was:" >&5
5097   cat conftest.$ac_ext >&5
5098   rm -rf conftest*
5099   eval "ac_cv_lib_$ac_lib_var=no"
5100 fi
5101 rm -f conftest*
5102 LIBS="$ac_save_LIBS"
5103
5104 fi
5105 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5106   echo "$ac_t""yes" 1>&6
5107   ol_cv_lib_db2=-ldb
5108 else
5109   echo "$ac_t""no" 1>&6
5110 ol_cv_lib_db2=no
5111 fi
5112
5113         LIBS="$ol_LIBS"
5114
5115 fi
5116
5117 echo "$ac_t""$ol_cv_lib_db2" 1>&6
5118
5119 for ac_hdr in db.h
5120 do
5121 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5122 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5123 echo "configure:5124: checking for $ac_hdr" >&5
5124 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5125   echo $ac_n "(cached) $ac_c" 1>&6
5126 else
5127   cat > conftest.$ac_ext <<EOF
5128 #line 5129 "configure"
5129 #include "confdefs.h"
5130 #include <$ac_hdr>
5131 EOF
5132 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5133 { (eval echo configure:5134: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5134 ac_err=`grep -v '^ *+' conftest.out`
5135 if test -z "$ac_err"; then
5136   rm -rf conftest*
5137   eval "ac_cv_header_$ac_safe=yes"
5138 else
5139   echo "$ac_err" >&5
5140   echo "configure: failed program was:" >&5
5141   cat conftest.$ac_ext >&5
5142   rm -rf conftest*
5143   eval "ac_cv_header_$ac_safe=no"
5144 fi
5145 rm -f conftest*
5146 fi
5147 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5148   echo "$ac_t""yes" 1>&6
5149     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5150   cat >> confdefs.h <<EOF
5151 #define $ac_tr_hdr 1
5152 EOF
5153  
5154 else
5155   echo "$ac_t""no" 1>&6
5156 fi
5157 done
5158
5159 if test $ac_cv_header_db_h = yes ; then
5160         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
5161 echo "configure:5162: checking if db.h is DB2" >&5
5162 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
5163   echo $ac_n "(cached) $ac_c" 1>&6
5164 else
5165   
5166                 cat > conftest.$ac_ext <<EOF
5167 #line 5168 "configure"
5168 #include "confdefs.h"
5169
5170 #                       include <db.h>
5171                         /* this check could be improved */
5172 #                       ifdef DB_VERSION_MAJOR
5173 #                               if DB_VERSION_MAJOR == 2
5174                                         __db_version_2
5175 #                               endif
5176 #                       endif
5177                 
5178 EOF
5179 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5180   egrep "__db_version_2" >/dev/null 2>&1; then
5181   rm -rf conftest*
5182   ol_cv_header_db2=yes
5183 else
5184   rm -rf conftest*
5185   ol_cv_header_db2=no
5186 fi
5187 rm -f conftest*
5188
5189 fi
5190
5191 echo "$ac_t""$ol_cv_header_db2" 1>&6
5192 else
5193         ol_cv_header_db2=no
5194 fi
5195
5196
5197  
5198  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
5199 echo "configure:5200: checking for Berkeley DB2" >&5
5200 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
5201   echo $ac_n "(cached) $ac_c" 1>&6
5202 else
5203   
5204         if test $ol_cv_lib_db2 = no -o $ol_cv_header_db2 = no ; then
5205                 ol_cv_berkeley_db2=no
5206         else
5207                 ol_cv_berkeley_db2=yes
5208         fi
5209
5210 fi
5211
5212 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
5213  if test $ol_cv_berkeley_db2 = yes ; then
5214         cat >> confdefs.h <<\EOF
5215 #define HAVE_BERKELEY_DB2 1
5216 EOF
5217
5218  fi
5219
5220
5221         if test $ol_cv_berkeley_db2 = yes ; then
5222                 ol_link_ldbm=db2
5223                 ol_with_ldbm_api=db2
5224
5225                 if test $ol_with_ldbm_type = hash ; then
5226                         cat >> confdefs.h <<\EOF
5227 #define LDBM_USE_DBHASH 1
5228 EOF
5229
5230                 else
5231                         cat >> confdefs.h <<\EOF
5232 #define LDBM_USE_DBBTREE 1
5233 EOF
5234
5235                 fi
5236
5237                                                 if test $ol_cv_lib_db2 != yes ; then
5238                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
5239                 fi
5240         fi
5241 fi
5242
5243 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
5244         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
5245 echo "configure:5246: checking for Berkeley DB library" >&5
5246 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
5247   echo $ac_n "(cached) $ac_c" 1>&6
5248 else
5249         ol_LIBS="$LIBS"
5250         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
5251 echo "configure:5252: checking for dbopen" >&5
5252 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
5253   echo $ac_n "(cached) $ac_c" 1>&6
5254 else
5255   cat > conftest.$ac_ext <<EOF
5256 #line 5257 "configure"
5257 #include "confdefs.h"
5258 /* System header to define __stub macros and hopefully few prototypes,
5259     which can conflict with char dbopen(); below.  */
5260 #include <assert.h>
5261 /* Override any gcc2 internal prototype to avoid an error.  */
5262 /* We use char because int might match the return type of a gcc2
5263     builtin and then its argument prototype would still apply.  */
5264 char dbopen();
5265
5266 int main() {
5267
5268 /* The GNU C library defines this for functions which it implements
5269     to always fail with ENOSYS.  Some functions are actually named
5270     something starting with __ and the normal name is an alias.  */
5271 #if defined (__stub_dbopen) || defined (__stub___dbopen)
5272 choke me
5273 #else
5274 dbopen();
5275 #endif
5276
5277 ; return 0; }
5278 EOF
5279 if { (eval echo configure:5280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5280   rm -rf conftest*
5281   eval "ac_cv_func_dbopen=yes"
5282 else
5283   echo "configure: failed program was:" >&5
5284   cat conftest.$ac_ext >&5
5285   rm -rf conftest*
5286   eval "ac_cv_func_dbopen=no"
5287 fi
5288 rm -f conftest*
5289 fi
5290
5291 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
5292   echo "$ac_t""yes" 1>&6
5293   ol_cv_lib_db=yes
5294 else
5295   echo "$ac_t""no" 1>&6
5296
5297                 echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
5298 echo "configure:5299: checking for dbopen in -ldb" >&5
5299 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
5300 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5301   echo $ac_n "(cached) $ac_c" 1>&6
5302 else
5303   ac_save_LIBS="$LIBS"
5304 LIBS="-ldb  $LIBS"
5305 cat > conftest.$ac_ext <<EOF
5306 #line 5307 "configure"
5307 #include "confdefs.h"
5308 /* Override any gcc2 internal prototype to avoid an error.  */
5309 /* We use char because int might match the return type of a gcc2
5310     builtin and then its argument prototype would still apply.  */
5311 char dbopen();
5312
5313 int main() {
5314 dbopen()
5315 ; return 0; }
5316 EOF
5317 if { (eval echo configure:5318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5318   rm -rf conftest*
5319   eval "ac_cv_lib_$ac_lib_var=yes"
5320 else
5321   echo "configure: failed program was:" >&5
5322   cat conftest.$ac_ext >&5
5323   rm -rf conftest*
5324   eval "ac_cv_lib_$ac_lib_var=no"
5325 fi
5326 rm -f conftest*
5327 LIBS="$ac_save_LIBS"
5328
5329 fi
5330 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5331   echo "$ac_t""yes" 1>&6
5332   ol_cv_lib_db=-ldb
5333 else
5334   echo "$ac_t""no" 1>&6
5335 ol_cv_lib_db=no
5336 fi
5337
5338         
5339 fi
5340
5341         LIBS="$ol_LIBS"
5342
5343 fi
5344
5345 echo "$ac_t""$ol_cv_lib_db" 1>&6
5346
5347
5348 for ac_hdr in db_185.h
5349 do
5350 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5351 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5352 echo "configure:5353: checking for $ac_hdr" >&5
5353 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5354   echo $ac_n "(cached) $ac_c" 1>&6
5355 else
5356   cat > conftest.$ac_ext <<EOF
5357 #line 5358 "configure"
5358 #include "confdefs.h"
5359 #include <$ac_hdr>
5360 EOF
5361 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5362 { (eval echo configure:5363: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5363 ac_err=`grep -v '^ *+' conftest.out`
5364 if test -z "$ac_err"; then
5365   rm -rf conftest*
5366   eval "ac_cv_header_$ac_safe=yes"
5367 else
5368   echo "$ac_err" >&5
5369   echo "configure: failed program was:" >&5
5370   cat conftest.$ac_ext >&5
5371   rm -rf conftest*
5372   eval "ac_cv_header_$ac_safe=no"
5373 fi
5374 rm -f conftest*
5375 fi
5376 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5377   echo "$ac_t""yes" 1>&6
5378     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5379   cat >> confdefs.h <<EOF
5380 #define $ac_tr_hdr 1
5381 EOF
5382  
5383 else
5384   echo "$ac_t""no" 1>&6
5385 fi
5386 done
5387
5388 if test $ol_cv_header_db2 = yes ; then
5389         
5390         ol_cv_header_db=$ac_cv_header_db_185_h
5391 else
5392         ol_cv_header_db=$ac_cv_header_db_h
5393 fi
5394
5395
5396  
5397  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
5398 echo "configure:5399: checking for Berkeley DB" >&5
5399 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
5400   echo $ac_n "(cached) $ac_c" 1>&6
5401 else
5402   
5403         if test $ol_cv_lib_db = no -o $ol_cv_header_db = no ; then
5404                 ol_cv_berkeley_db=no
5405         else
5406                 ol_cv_berkeley_db=yes
5407         fi
5408
5409 fi
5410
5411 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
5412  if test $ol_cv_berkeley_db = yes ; then
5413         cat >> confdefs.h <<\EOF
5414 #define HAVE_BERKELEY_DB 1
5415 EOF
5416
5417  fi
5418
5419
5420         if test $ol_cv_berkeley_db = yes ; then
5421                 ol_link_ldbm=db
5422                 ol_with_ldbm_api=db
5423
5424                 if test $ol_with_ldbm_type = hash ; then
5425                         cat >> confdefs.h <<\EOF
5426 #define LDBM_USE_DBHASH 1
5427 EOF
5428
5429                 else
5430                         cat >> confdefs.h <<\EOF
5431 #define LDBM_USE_DBBTREE 1
5432 EOF
5433
5434                 fi
5435
5436                                                 if test $ol_cv_lib_db != yes ; then
5437                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
5438                 fi
5439         fi
5440 fi
5441
5442 if test $ol_with_ldbm_api = manual ; then
5443                 ol_link_ldbm=yes
5444
5445         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
5446
5447         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
5448 do
5449 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5450 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5451 echo "configure:5452: checking for $ac_hdr" >&5
5452 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5453   echo $ac_n "(cached) $ac_c" 1>&6
5454 else
5455   cat > conftest.$ac_ext <<EOF
5456 #line 5457 "configure"
5457 #include "confdefs.h"
5458 #include <$ac_hdr>
5459 EOF
5460 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5461 { (eval echo configure:5462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5462 ac_err=`grep -v '^ *+' conftest.out`
5463 if test -z "$ac_err"; then
5464   rm -rf conftest*
5465   eval "ac_cv_header_$ac_safe=yes"
5466 else
5467   echo "$ac_err" >&5
5468   echo "configure: failed program was:" >&5
5469   cat conftest.$ac_ext >&5
5470   rm -rf conftest*
5471   eval "ac_cv_header_$ac_safe=no"
5472 fi
5473 rm -f conftest*
5474 fi
5475 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5476   echo "$ac_t""yes" 1>&6
5477     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5478   cat >> confdefs.h <<EOF
5479 #define $ac_tr_hdr 1
5480 EOF
5481  
5482 else
5483   echo "$ac_t""no" 1>&6
5484 fi
5485 done
5486
5487 fi
5488
5489 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
5490         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
5491         ol_with_ldbm_api=none
5492 fi
5493
5494 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
5495         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
5496 echo "configure:5497: checking for GDBM library" >&5
5497 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
5498   echo $ac_n "(cached) $ac_c" 1>&6
5499 else
5500         ol_LIBS="$LIBS"
5501         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
5502 echo "configure:5503: checking for gdbm_open" >&5
5503 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
5504   echo $ac_n "(cached) $ac_c" 1>&6
5505 else
5506   cat > conftest.$ac_ext <<EOF
5507 #line 5508 "configure"
5508 #include "confdefs.h"
5509 /* System header to define __stub macros and hopefully few prototypes,
5510     which can conflict with char gdbm_open(); below.  */
5511 #include <assert.h>
5512 /* Override any gcc2 internal prototype to avoid an error.  */
5513 /* We use char because int might match the return type of a gcc2
5514     builtin and then its argument prototype would still apply.  */
5515 char gdbm_open();
5516
5517 int main() {
5518
5519 /* The GNU C library defines this for functions which it implements
5520     to always fail with ENOSYS.  Some functions are actually named
5521     something starting with __ and the normal name is an alias.  */
5522 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
5523 choke me
5524 #else
5525 gdbm_open();
5526 #endif
5527
5528 ; return 0; }
5529 EOF
5530 if { (eval echo configure:5531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5531   rm -rf conftest*
5532   eval "ac_cv_func_gdbm_open=yes"
5533 else
5534   echo "configure: failed program was:" >&5
5535   cat conftest.$ac_ext >&5
5536   rm -rf conftest*
5537   eval "ac_cv_func_gdbm_open=no"
5538 fi
5539 rm -f conftest*
5540 fi
5541
5542 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
5543   echo "$ac_t""yes" 1>&6
5544   ol_cv_lib_gdbm=yes
5545 else
5546   echo "$ac_t""no" 1>&6
5547
5548                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
5549 echo "configure:5550: checking for gdbm_open in -lgdbm" >&5
5550 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
5551 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5552   echo $ac_n "(cached) $ac_c" 1>&6
5553 else
5554   ac_save_LIBS="$LIBS"
5555 LIBS="-lgdbm  $LIBS"
5556 cat > conftest.$ac_ext <<EOF
5557 #line 5558 "configure"
5558 #include "confdefs.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 gdbm_open()
5566 ; return 0; }
5567 EOF
5568 if { (eval echo configure:5569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5569   rm -rf conftest*
5570   eval "ac_cv_lib_$ac_lib_var=yes"
5571 else
5572   echo "configure: failed program was:" >&5
5573   cat conftest.$ac_ext >&5
5574   rm -rf conftest*
5575   eval "ac_cv_lib_$ac_lib_var=no"
5576 fi
5577 rm -f conftest*
5578 LIBS="$ac_save_LIBS"
5579
5580 fi
5581 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5582   echo "$ac_t""yes" 1>&6
5583   ol_cv_lib_gdbm=-lgdbm
5584 else
5585   echo "$ac_t""no" 1>&6
5586 ol_cv_lib_gdbm=no
5587 fi
5588
5589         
5590 fi
5591
5592         LIBS="$ol_LIBS"
5593
5594 fi
5595
5596 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
5597
5598
5599  for ac_hdr in gdbm.h
5600 do
5601 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5602 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5603 echo "configure:5604: checking for $ac_hdr" >&5
5604 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5605   echo $ac_n "(cached) $ac_c" 1>&6
5606 else
5607   cat > conftest.$ac_ext <<EOF
5608 #line 5609 "configure"
5609 #include "confdefs.h"
5610 #include <$ac_hdr>
5611 EOF
5612 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5613 { (eval echo configure:5614: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5614 ac_err=`grep -v '^ *+' conftest.out`
5615 if test -z "$ac_err"; then
5616   rm -rf conftest*
5617   eval "ac_cv_header_$ac_safe=yes"
5618 else
5619   echo "$ac_err" >&5
5620   echo "configure: failed program was:" >&5
5621   cat conftest.$ac_ext >&5
5622   rm -rf conftest*
5623   eval "ac_cv_header_$ac_safe=no"
5624 fi
5625 rm -f conftest*
5626 fi
5627 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5628   echo "$ac_t""yes" 1>&6
5629     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5630   cat >> confdefs.h <<EOF
5631 #define $ac_tr_hdr 1
5632 EOF
5633  
5634 else
5635   echo "$ac_t""no" 1>&6
5636 fi
5637 done
5638
5639  echo $ac_n "checking for db""... $ac_c" 1>&6
5640 echo "configure:5641: checking for db" >&5
5641 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
5642   echo $ac_n "(cached) $ac_c" 1>&6
5643 else
5644   
5645         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
5646                 ol_cv_gdbm=no
5647         else
5648                 ol_cv_gdbm=yes
5649         fi
5650
5651 fi
5652
5653 echo "$ac_t""$ol_cv_gdbm" 1>&6
5654  if test $ol_cv_gdbm = yes ; then
5655         cat >> confdefs.h <<\EOF
5656 #define HAVE_GDBM 1
5657 EOF
5658
5659  fi
5660
5661
5662         if test $ol_cv_gdbm = yes ; then
5663                 ol_link_ldbm=gdbm
5664                 ol_with_ldbm_api=gdbm
5665
5666                 if test $ol_cv_lib_gdbm != yes ; then
5667                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
5668                 fi
5669         fi
5670 fi
5671
5672 if test $ol_with_ldbm_api = auto ; then
5673         echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
5674 elif test $ol_with_ldbm_api = ndbm ; then
5675         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
5676 echo "configure:5677: checking for NDBM library" >&5
5677 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
5678   echo $ac_n "(cached) $ac_c" 1>&6
5679 else
5680         ol_LIBS="$LIBS"
5681         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
5682 echo "configure:5683: checking for dbm_open" >&5
5683 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
5684   echo $ac_n "(cached) $ac_c" 1>&6
5685 else
5686   cat > conftest.$ac_ext <<EOF
5687 #line 5688 "configure"
5688 #include "confdefs.h"
5689 /* System header to define __stub macros and hopefully few prototypes,
5690     which can conflict with char dbm_open(); below.  */
5691 #include <assert.h>
5692 /* Override any gcc2 internal prototype to avoid an error.  */
5693 /* We use char because int might match the return type of a gcc2
5694     builtin and then its argument prototype would still apply.  */
5695 char dbm_open();
5696
5697 int main() {
5698
5699 /* The GNU C library defines this for functions which it implements
5700     to always fail with ENOSYS.  Some functions are actually named
5701     something starting with __ and the normal name is an alias.  */
5702 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
5703 choke me
5704 #else
5705 dbm_open();
5706 #endif
5707
5708 ; return 0; }
5709 EOF
5710 if { (eval echo configure:5711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5711   rm -rf conftest*
5712   eval "ac_cv_func_dbm_open=yes"
5713 else
5714   echo "configure: failed program was:" >&5
5715   cat conftest.$ac_ext >&5
5716   rm -rf conftest*
5717   eval "ac_cv_func_dbm_open=no"
5718 fi
5719 rm -f conftest*
5720 fi
5721
5722 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
5723   echo "$ac_t""yes" 1>&6
5724   ol_cv_lib_ndbm=yes
5725 else
5726   echo "$ac_t""no" 1>&6
5727
5728                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
5729 echo "configure:5730: checking for dbm_open in -lndbm" >&5
5730 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
5731 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5732   echo $ac_n "(cached) $ac_c" 1>&6
5733 else
5734   ac_save_LIBS="$LIBS"
5735 LIBS="-lndbm  $LIBS"
5736 cat > conftest.$ac_ext <<EOF
5737 #line 5738 "configure"
5738 #include "confdefs.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 dbm_open()
5746 ; return 0; }
5747 EOF
5748 if { (eval echo configure:5749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5749   rm -rf conftest*
5750   eval "ac_cv_lib_$ac_lib_var=yes"
5751 else
5752   echo "configure: failed program was:" >&5
5753   cat conftest.$ac_ext >&5
5754   rm -rf conftest*
5755   eval "ac_cv_lib_$ac_lib_var=no"
5756 fi
5757 rm -f conftest*
5758 LIBS="$ac_save_LIBS"
5759
5760 fi
5761 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5762   echo "$ac_t""yes" 1>&6
5763   ol_cv_lib_ndbm=-lndbm
5764 else
5765   echo "$ac_t""no" 1>&6
5766
5767                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
5768 echo "configure:5769: checking for dbm_open in -ldbm" >&5
5769 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
5770 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5771   echo $ac_n "(cached) $ac_c" 1>&6
5772 else
5773   ac_save_LIBS="$LIBS"
5774 LIBS="-ldbm  $LIBS"
5775 cat > conftest.$ac_ext <<EOF
5776 #line 5777 "configure"
5777 #include "confdefs.h"
5778 /* Override any gcc2 internal prototype to avoid an error.  */
5779 /* We use char because int might match the return type of a gcc2
5780     builtin and then its argument prototype would still apply.  */
5781 char dbm_open();
5782
5783 int main() {
5784 dbm_open()
5785 ; return 0; }
5786 EOF
5787 if { (eval echo configure:5788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5788   rm -rf conftest*
5789   eval "ac_cv_lib_$ac_lib_var=yes"
5790 else
5791   echo "configure: failed program was:" >&5
5792   cat conftest.$ac_ext >&5
5793   rm -rf conftest*
5794   eval "ac_cv_lib_$ac_lib_var=no"
5795 fi
5796 rm -f conftest*
5797 LIBS="$ac_save_LIBS"
5798
5799 fi
5800 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5801   echo "$ac_t""yes" 1>&6
5802   ol_cv_lib_ndbm=-ldbm
5803 else
5804   echo "$ac_t""no" 1>&6
5805 ol_cv_lib_ndbm=no
5806 fi
5807                 
5808 fi
5809
5810         
5811 fi
5812
5813         LIBS="$ol_LIBS"
5814
5815 fi
5816
5817 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
5818
5819
5820  for ac_hdr in ndbm.h
5821 do
5822 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5823 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5824 echo "configure:5825: checking for $ac_hdr" >&5
5825 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5826   echo $ac_n "(cached) $ac_c" 1>&6
5827 else
5828   cat > conftest.$ac_ext <<EOF
5829 #line 5830 "configure"
5830 #include "confdefs.h"
5831 #include <$ac_hdr>
5832 EOF
5833 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5834 { (eval echo configure:5835: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5835 ac_err=`grep -v '^ *+' conftest.out`
5836 if test -z "$ac_err"; then
5837   rm -rf conftest*
5838   eval "ac_cv_header_$ac_safe=yes"
5839 else
5840   echo "$ac_err" >&5
5841   echo "configure: failed program was:" >&5
5842   cat conftest.$ac_ext >&5
5843   rm -rf conftest*
5844   eval "ac_cv_header_$ac_safe=no"
5845 fi
5846 rm -f conftest*
5847 fi
5848 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5849   echo "$ac_t""yes" 1>&6
5850     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5851   cat >> confdefs.h <<EOF
5852 #define $ac_tr_hdr 1
5853 EOF
5854  
5855 else
5856   echo "$ac_t""no" 1>&6
5857 fi
5858 done
5859
5860  echo $ac_n "checking for db""... $ac_c" 1>&6
5861 echo "configure:5862: checking for db" >&5
5862 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
5863   echo $ac_n "(cached) $ac_c" 1>&6
5864 else
5865   
5866         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
5867                 ol_cv_ndbm=no
5868         else
5869                 ol_cv_ndbm=yes
5870         fi
5871
5872 fi
5873
5874 echo "$ac_t""$ol_cv_ndbm" 1>&6
5875  if test $ol_cv_ndbm = yes ; then
5876         cat >> confdefs.h <<\EOF
5877 #define HAVE_NDBM 1
5878 EOF
5879
5880  fi
5881
5882
5883         if test $ol_cv_ndbm = yes ; then
5884                 ol_link_ldbm=ndbm
5885                 ol_with_ldbm_api=ndbm
5886
5887                 if test $ol_cv_lib_ndbm != yes ; then
5888                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
5889                 fi
5890         fi
5891 fi
5892
5893 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
5894         echo "configure: warning: could not find suitable LDBM backend" 1>&2
5895         if test $ol_enable_ldbm = yes ; then
5896                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
5897         fi
5898
5899         echo "configure: warning: disabling LDBM" 1>&2
5900         ol_enable_ldbm=no
5901 fi
5902
5903 if test $ol_enable_wrappers != no ; then
5904         echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
5905 echo "configure:5906: checking for main in -lwrap" >&5
5906 ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'`
5907 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5908   echo $ac_n "(cached) $ac_c" 1>&6
5909 else
5910   ac_save_LIBS="$LIBS"
5911 LIBS="-lwrap  $LIBS"
5912 cat > conftest.$ac_ext <<EOF
5913 #line 5914 "configure"
5914 #include "confdefs.h"
5915
5916 int main() {
5917 main()
5918 ; return 0; }
5919 EOF
5920 if { (eval echo configure:5921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5921   rm -rf conftest*
5922   eval "ac_cv_lib_$ac_lib_var=yes"
5923 else
5924   echo "configure: failed program was:" >&5
5925   cat conftest.$ac_ext >&5
5926   rm -rf conftest*
5927   eval "ac_cv_lib_$ac_lib_var=no"
5928 fi
5929 rm -f conftest*
5930 LIBS="$ac_save_LIBS"
5931
5932 fi
5933 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5934   echo "$ac_t""yes" 1>&6
5935   have_wrappers=yes
5936 else
5937   echo "$ac_t""no" 1>&6
5938 have_wrappers=no
5939 fi
5940
5941
5942         if test $have_wrappers = yes ; then
5943                 cat >> confdefs.h <<\EOF
5944 #define HAVE_TCPD 1
5945 EOF
5946
5947                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
5948         else
5949                 echo "configure: warning: could not find -lwrap" 1>&2
5950                 if test $ol_enable_wrappers = yes ; then
5951                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
5952                 fi
5953
5954                 echo "configure: warning: disabling wrappers support" 1>&2
5955                 ol_enable_wrappers=no
5956         fi
5957
5958 fi
5959
5960 if test $ol_enable_syslog != no ; then
5961         echo $ac_n "checking for openlog""... $ac_c" 1>&6
5962 echo "configure:5963: checking for openlog" >&5
5963 if eval "test \"`echo '$''{'ac_cv_func_openlog'+set}'`\" = set"; then
5964   echo $ac_n "(cached) $ac_c" 1>&6
5965 else
5966   cat > conftest.$ac_ext <<EOF
5967 #line 5968 "configure"
5968 #include "confdefs.h"
5969 /* System header to define __stub macros and hopefully few prototypes,
5970     which can conflict with char openlog(); below.  */
5971 #include <assert.h>
5972 /* Override any gcc2 internal prototype to avoid an error.  */
5973 /* We use char because int might match the return type of a gcc2
5974     builtin and then its argument prototype would still apply.  */
5975 char openlog();
5976
5977 int main() {
5978
5979 /* The GNU C library defines this for functions which it implements
5980     to always fail with ENOSYS.  Some functions are actually named
5981     something starting with __ and the normal name is an alias.  */
5982 #if defined (__stub_openlog) || defined (__stub___openlog)
5983 choke me
5984 #else
5985 openlog();
5986 #endif
5987
5988 ; return 0; }
5989 EOF
5990 if { (eval echo configure:5991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5991   rm -rf conftest*
5992   eval "ac_cv_func_openlog=yes"
5993 else
5994   echo "configure: failed program was:" >&5
5995   cat conftest.$ac_ext >&5
5996   rm -rf conftest*
5997   eval "ac_cv_func_openlog=no"
5998 fi
5999 rm -f conftest*
6000 fi
6001
6002 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
6003   echo "$ac_t""yes" 1>&6
6004   :
6005 else
6006   echo "$ac_t""no" 1>&6
6007 fi
6008
6009         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
6010                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
6011         fi
6012         ol_enable_syslog=$ac_cv_func_openlog
6013 fi
6014
6015 if test $ol_enable_dmalloc != no ; then
6016         for ac_hdr in dmalloc.h
6017 do
6018 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6019 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6020 echo "configure:6021: checking for $ac_hdr" >&5
6021 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6022   echo $ac_n "(cached) $ac_c" 1>&6
6023 else
6024   cat > conftest.$ac_ext <<EOF
6025 #line 6026 "configure"
6026 #include "confdefs.h"
6027 #include <$ac_hdr>
6028 EOF
6029 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6030 { (eval echo configure:6031: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6031 ac_err=`grep -v '^ *+' conftest.out`
6032 if test -z "$ac_err"; then
6033   rm -rf conftest*
6034   eval "ac_cv_header_$ac_safe=yes"
6035 else
6036   echo "$ac_err" >&5
6037   echo "configure: failed program was:" >&5
6038   cat conftest.$ac_ext >&5
6039   rm -rf conftest*
6040   eval "ac_cv_header_$ac_safe=no"
6041 fi
6042 rm -f conftest*
6043 fi
6044 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6045   echo "$ac_t""yes" 1>&6
6046     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6047   cat >> confdefs.h <<EOF
6048 #define $ac_tr_hdr 1
6049 EOF
6050  
6051 else
6052   echo "$ac_t""no" 1>&6
6053 fi
6054 done
6055
6056         echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
6057 echo "configure:6058: checking for dmalloc_shutdown in -ldmalloc" >&5
6058 ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-%__p_%'`
6059 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6060   echo $ac_n "(cached) $ac_c" 1>&6
6061 else
6062   ac_save_LIBS="$LIBS"
6063 LIBS="-ldmalloc  $LIBS"
6064 cat > conftest.$ac_ext <<EOF
6065 #line 6066 "configure"
6066 #include "confdefs.h"
6067 /* Override any gcc2 internal prototype to avoid an error.  */
6068 /* We use char because int might match the return type of a gcc2
6069     builtin and then its argument prototype would still apply.  */
6070 char dmalloc_shutdown();
6071
6072 int main() {
6073 dmalloc_shutdown()
6074 ; return 0; }
6075 EOF
6076 if { (eval echo configure:6077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6077   rm -rf conftest*
6078   eval "ac_cv_lib_$ac_lib_var=yes"
6079 else
6080   echo "configure: failed program was:" >&5
6081   cat conftest.$ac_ext >&5
6082   rm -rf conftest*
6083   eval "ac_cv_lib_$ac_lib_var=no"
6084 fi
6085 rm -f conftest*
6086 LIBS="$ac_save_LIBS"
6087
6088 fi
6089 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6090   echo "$ac_t""yes" 1>&6
6091     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6092     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6093   cat >> confdefs.h <<EOF
6094 #define $ac_tr_lib 1
6095 EOF
6096
6097   LIBS="-ldmalloc $LIBS"
6098
6099 else
6100   echo "$ac_t""no" 1>&6
6101 fi
6102
6103 fi
6104
6105 # ud needs termcap (should insert check here)
6106 ol_link_termcap=no
6107 for ac_hdr in termcap.h ncurses.h
6108 do
6109 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6110 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6111 echo "configure:6112: checking for $ac_hdr" >&5
6112 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6113   echo $ac_n "(cached) $ac_c" 1>&6
6114 else
6115   cat > conftest.$ac_ext <<EOF
6116 #line 6117 "configure"
6117 #include "confdefs.h"
6118 #include <$ac_hdr>
6119 EOF
6120 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6121 { (eval echo configure:6122: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6122 ac_err=`grep -v '^ *+' conftest.out`
6123 if test -z "$ac_err"; then
6124   rm -rf conftest*
6125   eval "ac_cv_header_$ac_safe=yes"
6126 else
6127   echo "$ac_err" >&5
6128   echo "configure: failed program was:" >&5
6129   cat conftest.$ac_ext >&5
6130   rm -rf conftest*
6131   eval "ac_cv_header_$ac_safe=no"
6132 fi
6133 rm -f conftest*
6134 fi
6135 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6136   echo "$ac_t""yes" 1>&6
6137     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6138   cat >> confdefs.h <<EOF
6139 #define $ac_tr_hdr 1
6140 EOF
6141  
6142 else
6143   echo "$ac_t""no" 1>&6
6144 fi
6145 done
6146
6147
6148 if test $ol_link_termcap = no ; then
6149         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
6150 echo "configure:6151: checking for tputs in -ltermcap" >&5
6151 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
6152 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6153   echo $ac_n "(cached) $ac_c" 1>&6
6154 else
6155   ac_save_LIBS="$LIBS"
6156 LIBS="-ltermcap  $LIBS"
6157 cat > conftest.$ac_ext <<EOF
6158 #line 6159 "configure"
6159 #include "confdefs.h"
6160 /* Override any gcc2 internal prototype to avoid an error.  */
6161 /* We use char because int might match the return type of a gcc2
6162     builtin and then its argument prototype would still apply.  */
6163 char tputs();
6164
6165 int main() {
6166 tputs()
6167 ; return 0; }
6168 EOF
6169 if { (eval echo configure:6170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6170   rm -rf conftest*
6171   eval "ac_cv_lib_$ac_lib_var=yes"
6172 else
6173   echo "configure: failed program was:" >&5
6174   cat conftest.$ac_ext >&5
6175   rm -rf conftest*
6176   eval "ac_cv_lib_$ac_lib_var=no"
6177 fi
6178 rm -f conftest*
6179 LIBS="$ac_save_LIBS"
6180
6181 fi
6182 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6183   echo "$ac_t""yes" 1>&6
6184   have_termcap=yes
6185 else
6186   echo "$ac_t""no" 1>&6
6187 have_termcap=no
6188 fi
6189
6190         if test $have_termcap = yes ; then
6191                 cat >> confdefs.h <<\EOF
6192 #define HAVE_TERMCAP 1
6193 EOF
6194
6195                 ol_link_termcap=yes
6196                 TERMCAP_LIBS=-ltermcap
6197         fi
6198 fi
6199
6200 if test $ol_link_termcap = no ; then
6201         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
6202 echo "configure:6203: checking for initscr in -lncurses" >&5
6203 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
6204 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6205   echo $ac_n "(cached) $ac_c" 1>&6
6206 else
6207   ac_save_LIBS="$LIBS"
6208 LIBS="-lncurses  $LIBS"
6209 cat > conftest.$ac_ext <<EOF
6210 #line 6211 "configure"
6211 #include "confdefs.h"
6212 /* Override any gcc2 internal prototype to avoid an error.  */
6213 /* We use char because int might match the return type of a gcc2
6214     builtin and then its argument prototype would still apply.  */
6215 char initscr();
6216
6217 int main() {
6218 initscr()
6219 ; return 0; }
6220 EOF
6221 if { (eval echo configure:6222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6222   rm -rf conftest*
6223   eval "ac_cv_lib_$ac_lib_var=yes"
6224 else
6225   echo "configure: failed program was:" >&5
6226   cat conftest.$ac_ext >&5
6227   rm -rf conftest*
6228   eval "ac_cv_lib_$ac_lib_var=no"
6229 fi
6230 rm -f conftest*
6231 LIBS="$ac_save_LIBS"
6232
6233 fi
6234 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6235   echo "$ac_t""yes" 1>&6
6236   have_ncurses=yes
6237 else
6238   echo "$ac_t""no" 1>&6
6239 have_ncurses=no
6240 fi
6241
6242         if test $have_ncurses = yes ; then
6243                 cat >> confdefs.h <<\EOF
6244 #define HAVE_NCURSES 1
6245 EOF
6246
6247                 ol_link_termcap=yes
6248                 TERMCAP_LIBS=-lncurses
6249         fi
6250 fi
6251
6252 if test $ol_link_termcap = no ; then
6253         cat >> confdefs.h <<\EOF
6254 #define NO_TERMCAP 1
6255 EOF
6256
6257         TERMCAP_LIBS=
6258 fi
6259
6260 # FreeBSD (and others) have crypt(3) in -lcrypt
6261 if test $ol_enable_crypt != no ; then
6262         echo $ac_n "checking for crypt""... $ac_c" 1>&6
6263 echo "configure:6264: checking for crypt" >&5
6264 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
6265   echo $ac_n "(cached) $ac_c" 1>&6
6266 else
6267   cat > conftest.$ac_ext <<EOF
6268 #line 6269 "configure"
6269 #include "confdefs.h"
6270 /* System header to define __stub macros and hopefully few prototypes,
6271     which can conflict with char crypt(); below.  */
6272 #include <assert.h>
6273 /* Override any gcc2 internal prototype to avoid an error.  */
6274 /* We use char because int might match the return type of a gcc2
6275     builtin and then its argument prototype would still apply.  */
6276 char crypt();
6277
6278 int main() {
6279
6280 /* The GNU C library defines this for functions which it implements
6281     to always fail with ENOSYS.  Some functions are actually named
6282     something starting with __ and the normal name is an alias.  */
6283 #if defined (__stub_crypt) || defined (__stub___crypt)
6284 choke me
6285 #else
6286 crypt();
6287 #endif
6288
6289 ; return 0; }
6290 EOF
6291 if { (eval echo configure:6292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6292   rm -rf conftest*
6293   eval "ac_cv_func_crypt=yes"
6294 else
6295   echo "configure: failed program was:" >&5
6296   cat conftest.$ac_ext >&5
6297   rm -rf conftest*
6298   eval "ac_cv_func_crypt=no"
6299 fi
6300 rm -f conftest*
6301 fi
6302
6303 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
6304   echo "$ac_t""yes" 1>&6
6305   have_crypt=yes
6306 else
6307   echo "$ac_t""no" 1>&6
6308
6309                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
6310 echo "configure:6311: checking for crypt in -lcrypt" >&5
6311 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
6312 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6313   echo $ac_n "(cached) $ac_c" 1>&6
6314 else
6315   ac_save_LIBS="$LIBS"
6316 LIBS="-lcrypt  $LIBS"
6317 cat > conftest.$ac_ext <<EOF
6318 #line 6319 "configure"
6319 #include "confdefs.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 crypt()
6327 ; return 0; }
6328 EOF
6329 if { (eval echo configure:6330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6330   rm -rf conftest*
6331   eval "ac_cv_lib_$ac_lib_var=yes"
6332 else
6333   echo "configure: failed program was:" >&5
6334   cat conftest.$ac_ext >&5
6335   rm -rf conftest*
6336   eval "ac_cv_lib_$ac_lib_var=no"
6337 fi
6338 rm -f conftest*
6339 LIBS="$ac_save_LIBS"
6340
6341 fi
6342 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6343   echo "$ac_t""yes" 1>&6
6344   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
6345                         have_crypt=yes
6346 else
6347   echo "$ac_t""no" 1>&6
6348 have_crypt=no
6349 fi
6350
6351 fi
6352
6353
6354         if test $have_crypt = yes ; then
6355                 cat >> confdefs.h <<\EOF
6356 #define HAVE_CRYPT 1
6357 EOF
6358
6359         else
6360                 echo "configure: warning: could not find crypt" 1>&2
6361                 if test $ol_enable_crypt = yes ; then
6362                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
6363                 fi
6364
6365                 echo "configure: warning: disabling crypt support" 1>&2
6366                 ol_enable_crypt=no
6367         fi
6368 fi
6369
6370 # FreeBSD (and others) have setproctitle(3) in -lutil
6371 if test $ol_enable_proctitle != no ; then
6372         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
6373 echo "configure:6374: checking for setproctitle" >&5
6374 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
6375   echo $ac_n "(cached) $ac_c" 1>&6
6376 else
6377   cat > conftest.$ac_ext <<EOF
6378 #line 6379 "configure"
6379 #include "confdefs.h"
6380 /* System header to define __stub macros and hopefully few prototypes,
6381     which can conflict with char setproctitle(); below.  */
6382 #include <assert.h>
6383 /* Override any gcc2 internal prototype to avoid an error.  */
6384 /* We use char because int might match the return type of a gcc2
6385     builtin and then its argument prototype would still apply.  */
6386 char setproctitle();
6387
6388 int main() {
6389
6390 /* The GNU C library defines this for functions which it implements
6391     to always fail with ENOSYS.  Some functions are actually named
6392     something starting with __ and the normal name is an alias.  */
6393 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
6394 choke me
6395 #else
6396 setproctitle();
6397 #endif
6398
6399 ; return 0; }
6400 EOF
6401 if { (eval echo configure:6402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6402   rm -rf conftest*
6403   eval "ac_cv_func_setproctitle=yes"
6404 else
6405   echo "configure: failed program was:" >&5
6406   cat conftest.$ac_ext >&5
6407   rm -rf conftest*
6408   eval "ac_cv_func_setproctitle=no"
6409 fi
6410 rm -f conftest*
6411 fi
6412
6413 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
6414   echo "$ac_t""yes" 1>&6
6415   have_setproctitle=yes
6416 else
6417   echo "$ac_t""no" 1>&6
6418
6419                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
6420 echo "configure:6421: checking for setproctitle in -lutil" >&5
6421 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
6422 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6423   echo $ac_n "(cached) $ac_c" 1>&6
6424 else
6425   ac_save_LIBS="$LIBS"
6426 LIBS="-lutil  $LIBS"
6427 cat > conftest.$ac_ext <<EOF
6428 #line 6429 "configure"
6429 #include "confdefs.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 setproctitle()
6437 ; return 0; }
6438 EOF
6439 if { (eval echo configure:6440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6440   rm -rf conftest*
6441   eval "ac_cv_lib_$ac_lib_var=yes"
6442 else
6443   echo "configure: failed program was:" >&5
6444   cat conftest.$ac_ext >&5
6445   rm -rf conftest*
6446   eval "ac_cv_lib_$ac_lib_var=no"
6447 fi
6448 rm -f conftest*
6449 LIBS="$ac_save_LIBS"
6450
6451 fi
6452 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6453   echo "$ac_t""yes" 1>&6
6454   have_setproctitle=yes
6455                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
6456 else
6457   echo "$ac_t""no" 1>&6
6458 have_setproctitle=no
6459                         LIBOBJS="$LIBOBJS setproctitle.o"
6460 fi
6461
6462 fi
6463
6464
6465         if test $have_setproctitle = yes ; then
6466                 cat >> confdefs.h <<\EOF
6467 #define HAVE_SETPROCTITLE 1
6468 EOF
6469
6470         fi
6471 fi
6472
6473 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
6474 echo "configure:6475: checking for ANSI C header files" >&5
6475 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
6476   echo $ac_n "(cached) $ac_c" 1>&6
6477 else
6478   cat > conftest.$ac_ext <<EOF
6479 #line 6480 "configure"
6480 #include "confdefs.h"
6481 #include <stdlib.h>
6482 #include <stdarg.h>
6483 #include <string.h>
6484 #include <float.h>
6485 EOF
6486 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6487 { (eval echo configure:6488: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6488 ac_err=`grep -v '^ *+' conftest.out`
6489 if test -z "$ac_err"; then
6490   rm -rf conftest*
6491   ac_cv_header_stdc=yes
6492 else
6493   echo "$ac_err" >&5
6494   echo "configure: failed program was:" >&5
6495   cat conftest.$ac_ext >&5
6496   rm -rf conftest*
6497   ac_cv_header_stdc=no
6498 fi
6499 rm -f conftest*
6500
6501 if test $ac_cv_header_stdc = yes; then
6502   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
6503 cat > conftest.$ac_ext <<EOF
6504 #line 6505 "configure"
6505 #include "confdefs.h"
6506 #include <string.h>
6507 EOF
6508 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6509   egrep "memchr" >/dev/null 2>&1; then
6510   :
6511 else
6512   rm -rf conftest*
6513   ac_cv_header_stdc=no
6514 fi
6515 rm -f conftest*
6516
6517 fi
6518
6519 if test $ac_cv_header_stdc = yes; then
6520   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
6521 cat > conftest.$ac_ext <<EOF
6522 #line 6523 "configure"
6523 #include "confdefs.h"
6524 #include <stdlib.h>
6525 EOF
6526 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6527   egrep "free" >/dev/null 2>&1; then
6528   :
6529 else
6530   rm -rf conftest*
6531   ac_cv_header_stdc=no
6532 fi
6533 rm -f conftest*
6534
6535 fi
6536
6537 if test $ac_cv_header_stdc = yes; then
6538   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
6539 if test "$cross_compiling" = yes; then
6540   :
6541 else
6542   cat > conftest.$ac_ext <<EOF
6543 #line 6544 "configure"
6544 #include "confdefs.h"
6545 #include <ctype.h>
6546 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
6547 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
6548 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
6549 int main () { int i; for (i = 0; i < 256; i++)
6550 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
6551 exit (0); }
6552
6553 EOF
6554 if { (eval echo configure:6555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
6555 then
6556   :
6557 else
6558   echo "configure: failed program was:" >&5
6559   cat conftest.$ac_ext >&5
6560   rm -fr conftest*
6561   ac_cv_header_stdc=no
6562 fi
6563 rm -fr conftest*
6564 fi
6565
6566 fi
6567 fi
6568
6569 echo "$ac_t""$ac_cv_header_stdc" 1>&6
6570 if test $ac_cv_header_stdc = yes; then
6571   cat >> confdefs.h <<\EOF
6572 #define STDC_HEADERS 1
6573 EOF
6574
6575 fi
6576
6577
6578 if test $ac_cv_header_stdc != yes; then
6579         echo "configure: warning: could not Standard C compliant headers" 1>&2
6580 fi
6581
6582 ac_header_dirent=no
6583 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
6584 do
6585 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6586 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
6587 echo "configure:6588: checking for $ac_hdr that defines DIR" >&5
6588 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
6589   echo $ac_n "(cached) $ac_c" 1>&6
6590 else
6591   cat > conftest.$ac_ext <<EOF
6592 #line 6593 "configure"
6593 #include "confdefs.h"
6594 #include <sys/types.h>
6595 #include <$ac_hdr>
6596 int main() {
6597 DIR *dirp = 0;
6598 ; return 0; }
6599 EOF
6600 if { (eval echo configure:6601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6601   rm -rf conftest*
6602   eval "ac_cv_header_dirent_$ac_safe=yes"
6603 else
6604   echo "configure: failed program was:" >&5
6605   cat conftest.$ac_ext >&5
6606   rm -rf conftest*
6607   eval "ac_cv_header_dirent_$ac_safe=no"
6608 fi
6609 rm -f conftest*
6610 fi
6611 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
6612   echo "$ac_t""yes" 1>&6
6613     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6614   cat >> confdefs.h <<EOF
6615 #define $ac_tr_hdr 1
6616 EOF
6617  ac_header_dirent=$ac_hdr; break
6618 else
6619   echo "$ac_t""no" 1>&6
6620 fi
6621 done
6622 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
6623 if test $ac_header_dirent = dirent.h; then
6624 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
6625 echo "configure:6626: checking for opendir in -ldir" >&5
6626 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
6627 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6628   echo $ac_n "(cached) $ac_c" 1>&6
6629 else
6630   ac_save_LIBS="$LIBS"
6631 LIBS="-ldir  $LIBS"
6632 cat > conftest.$ac_ext <<EOF
6633 #line 6634 "configure"
6634 #include "confdefs.h"
6635 /* Override any gcc2 internal prototype to avoid an error.  */
6636 /* We use char because int might match the return type of a gcc2
6637     builtin and then its argument prototype would still apply.  */
6638 char opendir();
6639
6640 int main() {
6641 opendir()
6642 ; return 0; }
6643 EOF
6644 if { (eval echo configure:6645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6645   rm -rf conftest*
6646   eval "ac_cv_lib_$ac_lib_var=yes"
6647 else
6648   echo "configure: failed program was:" >&5
6649   cat conftest.$ac_ext >&5
6650   rm -rf conftest*
6651   eval "ac_cv_lib_$ac_lib_var=no"
6652 fi
6653 rm -f conftest*
6654 LIBS="$ac_save_LIBS"
6655
6656 fi
6657 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6658   echo "$ac_t""yes" 1>&6
6659   LIBS="$LIBS -ldir"
6660 else
6661   echo "$ac_t""no" 1>&6
6662 fi
6663
6664 else
6665 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
6666 echo "configure:6667: checking for opendir in -lx" >&5
6667 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
6668 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6669   echo $ac_n "(cached) $ac_c" 1>&6
6670 else
6671   ac_save_LIBS="$LIBS"
6672 LIBS="-lx  $LIBS"
6673 cat > conftest.$ac_ext <<EOF
6674 #line 6675 "configure"
6675 #include "confdefs.h"
6676 /* Override any gcc2 internal prototype to avoid an error.  */
6677 /* We use char because int might match the return type of a gcc2
6678     builtin and then its argument prototype would still apply.  */
6679 char opendir();
6680
6681 int main() {
6682 opendir()
6683 ; return 0; }
6684 EOF
6685 if { (eval echo configure:6686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6686   rm -rf conftest*
6687   eval "ac_cv_lib_$ac_lib_var=yes"
6688 else
6689   echo "configure: failed program was:" >&5
6690   cat conftest.$ac_ext >&5
6691   rm -rf conftest*
6692   eval "ac_cv_lib_$ac_lib_var=no"
6693 fi
6694 rm -f conftest*
6695 LIBS="$ac_save_LIBS"
6696
6697 fi
6698 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6699   echo "$ac_t""yes" 1>&6
6700   LIBS="$LIBS -lx"
6701 else
6702   echo "$ac_t""no" 1>&6
6703 fi
6704
6705 fi
6706
6707 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
6708 echo "configure:6709: checking for sys/wait.h that is POSIX.1 compatible" >&5
6709 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
6710   echo $ac_n "(cached) $ac_c" 1>&6
6711 else
6712   cat > conftest.$ac_ext <<EOF
6713 #line 6714 "configure"
6714 #include "confdefs.h"
6715 #include <sys/types.h>
6716 #include <sys/wait.h>
6717 #ifndef WEXITSTATUS
6718 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
6719 #endif
6720 #ifndef WIFEXITED
6721 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
6722 #endif
6723 int main() {
6724 int s;
6725 wait (&s);
6726 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
6727 ; return 0; }
6728 EOF
6729 if { (eval echo configure:6730: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6730   rm -rf conftest*
6731   ac_cv_header_sys_wait_h=yes
6732 else
6733   echo "configure: failed program was:" >&5
6734   cat conftest.$ac_ext >&5
6735   rm -rf conftest*
6736   ac_cv_header_sys_wait_h=no
6737 fi
6738 rm -f conftest*
6739 fi
6740
6741 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
6742 if test $ac_cv_header_sys_wait_h = yes; then
6743   cat >> confdefs.h <<\EOF
6744 #define HAVE_SYS_WAIT_H 1
6745 EOF
6746
6747 fi
6748
6749 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
6750 echo "configure:6751: checking POSIX termios" >&5
6751 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
6752   echo $ac_n "(cached) $ac_c" 1>&6
6753 else
6754   cat > conftest.$ac_ext <<EOF
6755 #line 6756 "configure"
6756 #include "confdefs.h"
6757 #include <sys/types.h>
6758 #include <unistd.h>
6759 #include <termios.h>
6760 int main() {
6761 /* SunOS 4.0.3 has termios.h but not the library calls.  */
6762    tcgetattr(0, 0);
6763 ; return 0; }
6764 EOF
6765 if { (eval echo configure:6766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6766   rm -rf conftest*
6767   am_cv_sys_posix_termios=yes
6768 else
6769   echo "configure: failed program was:" >&5
6770   cat conftest.$ac_ext >&5
6771   rm -rf conftest*
6772   am_cv_sys_posix_termios=no
6773 fi
6774 rm -f conftest*
6775 fi
6776
6777 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
6778
6779
6780  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
6781 echo "configure:6782: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
6782 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
6783   echo $ac_n "(cached) $ac_c" 1>&6
6784 else
6785   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
6786
6787   gwinsz_in_termios_h=no
6788   if test $am_cv_sys_posix_termios = yes; then
6789     cat > conftest.$ac_ext <<EOF
6790 #line 6791 "configure"
6791 #include "confdefs.h"
6792 #include <sys/types.h>
6793 #     include <termios.h>
6794 #     ifdef TIOCGWINSZ
6795         yes
6796 #     endif
6797     
6798 EOF
6799 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6800   egrep "yes" >/dev/null 2>&1; then
6801   rm -rf conftest*
6802   gwinsz_in_termios_h=yes
6803 fi
6804 rm -f conftest*
6805
6806   fi
6807
6808   if test $gwinsz_in_termios_h = no; then
6809     cat > conftest.$ac_ext <<EOF
6810 #line 6811 "configure"
6811 #include "confdefs.h"
6812 #include <sys/types.h>
6813 #     include <sys/ioctl.h>
6814 #     ifdef TIOCGWINSZ
6815         yes
6816 #     endif
6817     
6818 EOF
6819 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6820   egrep "yes" >/dev/null 2>&1; then
6821   rm -rf conftest*
6822   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
6823 fi
6824 rm -f conftest*
6825
6826   fi
6827   
6828 fi
6829
6830 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
6831   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
6832     cat >> confdefs.h <<\EOF
6833 #define GWINSZ_IN_SYS_IOCTL 1
6834 EOF
6835
6836   fi
6837
6838 if test $am_cv_sys_posix_termios = yes ; then
6839         cat >> confdefs.h <<\EOF
6840 #define HAVE_POSIX_TERMIOS 1
6841 EOF
6842
6843 fi
6844
6845 for ac_hdr in \
6846         crypt.h                 \
6847         errno.h                 \
6848         fcntl.h                 \
6849         filio.h                 \
6850         getopt.h                \
6851         libutil.h               \
6852         limits.h                \
6853         malloc.h                \
6854         memory.h                \
6855         regex.h                 \
6856         psap.h                  \
6857         pwd.h                   \
6858         sgtty.h                 \
6859         stdarg.h                \
6860         stddef.h                \
6861         string.h                \
6862         strings.h               \
6863         sys/file.h              \
6864         sys/filio.h             \
6865         sys/errno.h             \
6866         sys/ioctl.h             \
6867         sys/param.h             \
6868         sys/resource.h  \
6869         sys/socket.h    \
6870         sys/syslog.h    \
6871         sys/time.h              \
6872         sys/types.h             \
6873         syslog.h                \
6874         termios.h               \
6875         unistd.h                \
6876
6877 do
6878 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6879 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6880 echo "configure:6881: checking for $ac_hdr" >&5
6881 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6882   echo $ac_n "(cached) $ac_c" 1>&6
6883 else
6884   cat > conftest.$ac_ext <<EOF
6885 #line 6886 "configure"
6886 #include "confdefs.h"
6887 #include <$ac_hdr>
6888 EOF
6889 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6890 { (eval echo configure:6891: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6891 ac_err=`grep -v '^ *+' conftest.out`
6892 if test -z "$ac_err"; then
6893   rm -rf conftest*
6894   eval "ac_cv_header_$ac_safe=yes"
6895 else
6896   echo "$ac_err" >&5
6897   echo "configure: failed program was:" >&5
6898   cat conftest.$ac_ext >&5
6899   rm -rf conftest*
6900   eval "ac_cv_header_$ac_safe=no"
6901 fi
6902 rm -f conftest*
6903 fi
6904 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6905   echo "$ac_t""yes" 1>&6
6906     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6907   cat >> confdefs.h <<EOF
6908 #define $ac_tr_hdr 1
6909 EOF
6910  
6911 else
6912   echo "$ac_t""no" 1>&6
6913 fi
6914 done
6915
6916
6917 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
6918 echo "configure:6919: checking for uid_t in sys/types.h" >&5
6919 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
6920   echo $ac_n "(cached) $ac_c" 1>&6
6921 else
6922   cat > conftest.$ac_ext <<EOF
6923 #line 6924 "configure"
6924 #include "confdefs.h"
6925 #include <sys/types.h>
6926 EOF
6927 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6928   egrep "uid_t" >/dev/null 2>&1; then
6929   rm -rf conftest*
6930   ac_cv_type_uid_t=yes
6931 else
6932   rm -rf conftest*
6933   ac_cv_type_uid_t=no
6934 fi
6935 rm -f conftest*
6936
6937 fi
6938
6939 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
6940 if test $ac_cv_type_uid_t = no; then
6941   cat >> confdefs.h <<\EOF
6942 #define uid_t int
6943 EOF
6944
6945   cat >> confdefs.h <<\EOF
6946 #define gid_t int
6947 EOF
6948
6949 fi
6950
6951 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
6952 echo "configure:6953: checking type of array argument to getgroups" >&5
6953 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
6954   echo $ac_n "(cached) $ac_c" 1>&6
6955 else
6956   if test "$cross_compiling" = yes; then
6957   ac_cv_type_getgroups=cross
6958 else
6959   cat > conftest.$ac_ext <<EOF
6960 #line 6961 "configure"
6961 #include "confdefs.h"
6962
6963 /* Thanks to Mike Rendell for this test.  */
6964 #include <sys/types.h>
6965 #define NGID 256
6966 #undef MAX
6967 #define MAX(x, y) ((x) > (y) ? (x) : (y))
6968 main()
6969 {
6970   gid_t gidset[NGID];
6971   int i, n;
6972   union { gid_t gval; long lval; }  val;
6973
6974   val.lval = -1;
6975   for (i = 0; i < NGID; i++)
6976     gidset[i] = val.gval;
6977   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
6978                  gidset);
6979   /* Exit non-zero if getgroups seems to require an array of ints.  This
6980      happens when gid_t is short but getgroups modifies an array of ints.  */
6981   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
6982 }
6983
6984 EOF
6985 if { (eval echo configure:6986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
6986 then
6987     ac_cv_type_getgroups=gid_t
6988 else
6989   echo "configure: failed program was:" >&5
6990   cat conftest.$ac_ext >&5
6991   rm -fr conftest*
6992   ac_cv_type_getgroups=int
6993 fi
6994 rm -fr conftest*
6995 fi
6996
6997 if test $ac_cv_type_getgroups = cross; then
6998         cat > conftest.$ac_ext <<EOF
6999 #line 7000 "configure"
7000 #include "confdefs.h"
7001 #include <unistd.h>
7002 EOF
7003 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7004   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
7005   rm -rf conftest*
7006   ac_cv_type_getgroups=gid_t
7007 else
7008   rm -rf conftest*
7009   ac_cv_type_getgroups=int
7010 fi
7011 rm -f conftest*
7012
7013 fi
7014 fi
7015
7016 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
7017 cat >> confdefs.h <<EOF
7018 #define GETGROUPS_T $ac_cv_type_getgroups
7019 EOF
7020
7021  echo $ac_n "checking for mode_t""... $ac_c" 1>&6
7022 echo "configure:7023: checking for mode_t" >&5
7023 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
7024   echo $ac_n "(cached) $ac_c" 1>&6
7025 else
7026   cat > conftest.$ac_ext <<EOF
7027 #line 7028 "configure"
7028 #include "confdefs.h"
7029 #include <sys/types.h>
7030 #if STDC_HEADERS
7031 #include <stdlib.h>
7032 #include <stddef.h>
7033 #endif
7034 EOF
7035 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7036   egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
7037   rm -rf conftest*
7038   ac_cv_type_mode_t=yes
7039 else
7040   rm -rf conftest*
7041   ac_cv_type_mode_t=no
7042 fi
7043 rm -f conftest*
7044
7045 fi
7046 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
7047 if test $ac_cv_type_mode_t = no; then
7048   cat >> confdefs.h <<\EOF
7049 #define mode_t int
7050 EOF
7051
7052 fi
7053
7054 echo $ac_n "checking for off_t""... $ac_c" 1>&6
7055 echo "configure:7056: checking for off_t" >&5
7056 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
7057   echo $ac_n "(cached) $ac_c" 1>&6
7058 else
7059   cat > conftest.$ac_ext <<EOF
7060 #line 7061 "configure"
7061 #include "confdefs.h"
7062 #include <sys/types.h>
7063 #if STDC_HEADERS
7064 #include <stdlib.h>
7065 #include <stddef.h>
7066 #endif
7067 EOF
7068 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7069   egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
7070   rm -rf conftest*
7071   ac_cv_type_off_t=yes
7072 else
7073   rm -rf conftest*
7074   ac_cv_type_off_t=no
7075 fi
7076 rm -f conftest*
7077
7078 fi
7079 echo "$ac_t""$ac_cv_type_off_t" 1>&6
7080 if test $ac_cv_type_off_t = no; then
7081   cat >> confdefs.h <<\EOF
7082 #define off_t long
7083 EOF
7084
7085 fi
7086
7087 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
7088 echo "configure:7089: checking for pid_t" >&5
7089 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
7090   echo $ac_n "(cached) $ac_c" 1>&6
7091 else
7092   cat > conftest.$ac_ext <<EOF
7093 #line 7094 "configure"
7094 #include "confdefs.h"
7095 #include <sys/types.h>
7096 #if STDC_HEADERS
7097 #include <stdlib.h>
7098 #include <stddef.h>
7099 #endif
7100 EOF
7101 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7102   egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
7103   rm -rf conftest*
7104   ac_cv_type_pid_t=yes
7105 else
7106   rm -rf conftest*
7107   ac_cv_type_pid_t=no
7108 fi
7109 rm -f conftest*
7110
7111 fi
7112 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
7113 if test $ac_cv_type_pid_t = no; then
7114   cat >> confdefs.h <<\EOF
7115 #define pid_t int
7116 EOF
7117
7118 fi
7119
7120 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
7121 echo "configure:7122: checking for ptrdiff_t" >&5
7122 if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then
7123   echo $ac_n "(cached) $ac_c" 1>&6
7124 else
7125   cat > conftest.$ac_ext <<EOF
7126 #line 7127 "configure"
7127 #include "confdefs.h"
7128 #include <stddef.h>
7129 int main() {
7130 ptrdiff_t p
7131 ; return 0; }
7132 EOF
7133 if { (eval echo configure:7134: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7134   rm -rf conftest*
7135   am_cv_type_ptrdiff_t=yes
7136 else
7137   echo "configure: failed program was:" >&5
7138   cat conftest.$ac_ext >&5
7139   rm -rf conftest*
7140   am_cv_type_ptrdiff_t=no
7141 fi
7142 rm -f conftest*
7143 fi
7144
7145 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
7146    if test $am_cv_type_ptrdiff_t = yes; then
7147      cat >> confdefs.h <<\EOF
7148 #define HAVE_PTRDIFF_T 1
7149 EOF
7150
7151    fi
7152
7153 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
7154 echo "configure:7155: checking return type of signal handlers" >&5
7155 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
7156   echo $ac_n "(cached) $ac_c" 1>&6
7157 else
7158   cat > conftest.$ac_ext <<EOF
7159 #line 7160 "configure"
7160 #include "confdefs.h"
7161 #include <sys/types.h>
7162 #include <signal.h>
7163 #ifdef signal
7164 #undef signal
7165 #endif
7166 #ifdef __cplusplus
7167 extern "C" void (*signal (int, void (*)(int)))(int);
7168 #else
7169 void (*signal ()) ();
7170 #endif
7171
7172 int main() {
7173 int i;
7174 ; return 0; }
7175 EOF
7176 if { (eval echo configure:7177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7177   rm -rf conftest*
7178   ac_cv_type_signal=void
7179 else
7180   echo "configure: failed program was:" >&5
7181   cat conftest.$ac_ext >&5
7182   rm -rf conftest*
7183   ac_cv_type_signal=int
7184 fi
7185 rm -f conftest*
7186 fi
7187
7188 echo "$ac_t""$ac_cv_type_signal" 1>&6
7189 cat >> confdefs.h <<EOF
7190 #define RETSIGTYPE $ac_cv_type_signal
7191 EOF
7192
7193
7194 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
7195 echo "configure:7196: checking for sig_atomic_t" >&5
7196 if eval "test \"`echo '$''{'ol_cv_type_sig_atomic_t'+set}'`\" = set"; then
7197   echo $ac_n "(cached) $ac_c" 1>&6
7198 else
7199   cat > conftest.$ac_ext <<EOF
7200 #line 7201 "configure"
7201 #include "confdefs.h"
7202 #include <signal.h>
7203 int main() {
7204 sig_atomic_t atomic;
7205 ; return 0; }
7206 EOF
7207 if { (eval echo configure:7208: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7208   rm -rf conftest*
7209   ol_cv_type_sig_atomic_t=yes
7210 else
7211   echo "configure: failed program was:" >&5
7212   cat conftest.$ac_ext >&5
7213   rm -rf conftest*
7214   ol_cv_type_sig_atomic_t=no
7215 fi
7216 rm -f conftest*
7217 fi
7218
7219 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
7220   if test $ol_cv_type_sig_atomic_t = no; then
7221     cat >> confdefs.h <<\EOF
7222 #define sig_atomic_t int
7223 EOF
7224
7225   fi
7226  
7227 echo $ac_n "checking for size_t""... $ac_c" 1>&6
7228 echo "configure:7229: checking for size_t" >&5
7229 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
7230   echo $ac_n "(cached) $ac_c" 1>&6
7231 else
7232   cat > conftest.$ac_ext <<EOF
7233 #line 7234 "configure"
7234 #include "confdefs.h"
7235 #include <sys/types.h>
7236 #if STDC_HEADERS
7237 #include <stdlib.h>
7238 #include <stddef.h>
7239 #endif
7240 EOF
7241 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7242   egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
7243   rm -rf conftest*
7244   ac_cv_type_size_t=yes
7245 else
7246   rm -rf conftest*
7247   ac_cv_type_size_t=no
7248 fi
7249 rm -f conftest*
7250
7251 fi
7252 echo "$ac_t""$ac_cv_type_size_t" 1>&6
7253 if test $ac_cv_type_size_t = no; then
7254   cat >> confdefs.h <<\EOF
7255 #define size_t unsigned
7256 EOF
7257
7258 fi
7259
7260 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
7261 echo "configure:7262: checking for st_blksize in struct stat" >&5
7262 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
7263   echo $ac_n "(cached) $ac_c" 1>&6
7264 else
7265   cat > conftest.$ac_ext <<EOF
7266 #line 7267 "configure"
7267 #include "confdefs.h"
7268 #include <sys/types.h>
7269 #include <sys/stat.h>
7270 int main() {
7271 struct stat s; s.st_blksize;
7272 ; return 0; }
7273 EOF
7274 if { (eval echo configure:7275: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7275   rm -rf conftest*
7276   ac_cv_struct_st_blksize=yes
7277 else
7278   echo "configure: failed program was:" >&5
7279   cat conftest.$ac_ext >&5
7280   rm -rf conftest*
7281   ac_cv_struct_st_blksize=no
7282 fi
7283 rm -f conftest*
7284 fi
7285
7286 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
7287 if test $ac_cv_struct_st_blksize = yes; then
7288   cat >> confdefs.h <<\EOF
7289 #define HAVE_ST_BLKSIZE 1
7290 EOF
7291
7292 fi
7293
7294 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
7295 echo "configure:7296: checking whether time.h and sys/time.h may both be included" >&5
7296 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
7297   echo $ac_n "(cached) $ac_c" 1>&6
7298 else
7299   cat > conftest.$ac_ext <<EOF
7300 #line 7301 "configure"
7301 #include "confdefs.h"
7302 #include <sys/types.h>
7303 #include <sys/time.h>
7304 #include <time.h>
7305 int main() {
7306 struct tm *tp;
7307 ; return 0; }
7308 EOF
7309 if { (eval echo configure:7310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7310   rm -rf conftest*
7311   ac_cv_header_time=yes
7312 else
7313   echo "configure: failed program was:" >&5
7314   cat conftest.$ac_ext >&5
7315   rm -rf conftest*
7316   ac_cv_header_time=no
7317 fi
7318 rm -f conftest*
7319 fi
7320
7321 echo "$ac_t""$ac_cv_header_time" 1>&6
7322 if test $ac_cv_header_time = yes; then
7323   cat >> confdefs.h <<\EOF
7324 #define TIME_WITH_SYS_TIME 1
7325 EOF
7326
7327 fi
7328
7329 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
7330 echo "configure:7331: checking whether struct tm is in sys/time.h or time.h" >&5
7331 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
7332   echo $ac_n "(cached) $ac_c" 1>&6
7333 else
7334   cat > conftest.$ac_ext <<EOF
7335 #line 7336 "configure"
7336 #include "confdefs.h"
7337 #include <sys/types.h>
7338 #include <time.h>
7339 int main() {
7340 struct tm *tp; tp->tm_sec;
7341 ; return 0; }
7342 EOF
7343 if { (eval echo configure:7344: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7344   rm -rf conftest*
7345   ac_cv_struct_tm=time.h
7346 else
7347   echo "configure: failed program was:" >&5
7348   cat conftest.$ac_ext >&5
7349   rm -rf conftest*
7350   ac_cv_struct_tm=sys/time.h
7351 fi
7352 rm -f conftest*
7353 fi
7354
7355 echo "$ac_t""$ac_cv_struct_tm" 1>&6
7356 if test $ac_cv_struct_tm = sys/time.h; then
7357   cat >> confdefs.h <<\EOF
7358 #define TM_IN_SYS_TIME 1
7359 EOF
7360
7361 fi
7362
7363
7364
7365 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
7366 echo "configure:7367: checking if toupper() requires islower()" >&5
7367 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
7368   echo $ac_n "(cached) $ac_c" 1>&6
7369 else
7370   
7371         if test "$cross_compiling" = yes; then
7372   ol_cv_c_upper_lower=safe
7373 else
7374   cat > conftest.$ac_ext <<EOF
7375 #line 7376 "configure"
7376 #include "confdefs.h"
7377
7378 #include <ctype.h>
7379 main()
7380 {
7381         if ('C' == toupper('C'))
7382                 exit(0);
7383         else
7384                 exit(1);
7385 }
7386 EOF
7387 if { (eval echo configure:7388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
7388 then
7389   ol_cv_c_upper_lower=no
7390 else
7391   echo "configure: failed program was:" >&5
7392   cat conftest.$ac_ext >&5
7393   rm -fr conftest*
7394   ol_cv_c_upper_lower=yes
7395 fi
7396 rm -fr conftest*
7397 fi
7398
7399 fi
7400
7401 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
7402 if test $ol_cv_c_upper_lower != no ; then
7403         cat >> confdefs.h <<\EOF
7404 #define C_UPPER_LOWER 1
7405 EOF
7406
7407 fi
7408
7409 echo $ac_n "checking for working const""... $ac_c" 1>&6
7410 echo "configure:7411: checking for working const" >&5
7411 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
7412   echo $ac_n "(cached) $ac_c" 1>&6
7413 else
7414   cat > conftest.$ac_ext <<EOF
7415 #line 7416 "configure"
7416 #include "confdefs.h"
7417
7418 int main() {
7419
7420 /* Ultrix mips cc rejects this.  */
7421 typedef int charset[2]; const charset x;
7422 /* SunOS 4.1.1 cc rejects this.  */
7423 char const *const *ccp;
7424 char **p;
7425 /* NEC SVR4.0.2 mips cc rejects this.  */
7426 struct point {int x, y;};
7427 static struct point const zero = {0,0};
7428 /* AIX XL C 1.02.0.0 rejects this.
7429    It does not let you subtract one const X* pointer from another in an arm
7430    of an if-expression whose if-part is not a constant expression */
7431 const char *g = "string";
7432 ccp = &g + (g ? g-g : 0);
7433 /* HPUX 7.0 cc rejects these. */
7434 ++ccp;
7435 p = (char**) ccp;
7436 ccp = (char const *const *) p;
7437 { /* SCO 3.2v4 cc rejects this.  */
7438   char *t;
7439   char const *s = 0 ? (char *) 0 : (char const *) 0;
7440
7441   *t++ = 0;
7442 }
7443 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
7444   int x[] = {25, 17};
7445   const int *foo = &x[0];
7446   ++foo;
7447 }
7448 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
7449   typedef const int *iptr;
7450   iptr p = 0;
7451   ++p;
7452 }
7453 { /* AIX XL C 1.02.0.0 rejects this saying
7454      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
7455   struct s { int j; const int *ap[3]; };
7456   struct s *b; b->j = 5;
7457 }
7458 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
7459   const int foo = 10;
7460 }
7461
7462 ; return 0; }
7463 EOF
7464 if { (eval echo configure:7465: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7465   rm -rf conftest*
7466   ac_cv_c_const=yes
7467 else
7468   echo "configure: failed program was:" >&5
7469   cat conftest.$ac_ext >&5
7470   rm -rf conftest*
7471   ac_cv_c_const=no
7472 fi
7473 rm -f conftest*
7474 fi
7475
7476 echo "$ac_t""$ac_cv_c_const" 1>&6
7477 if test $ac_cv_c_const = no; then
7478   cat >> confdefs.h <<\EOF
7479 #define const 
7480 EOF
7481
7482 fi
7483
7484 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
7485 echo "configure:7486: checking if compiler understands volatile" >&5
7486 if eval "test \"`echo '$''{'ol_cv_c_volatile'+set}'`\" = set"; then
7487   echo $ac_n "(cached) $ac_c" 1>&6
7488 else
7489   cat > conftest.$ac_ext <<EOF
7490 #line 7491 "configure"
7491 #include "confdefs.h"
7492 int x, y, z;
7493 int main() {
7494 volatile int a; int * volatile b = x ? &y : &z;
7495       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
7496       *b = 0;
7497 ; return 0; }
7498 EOF
7499 if { (eval echo configure:7500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7500   rm -rf conftest*
7501   ol_cv_c_volatile=yes
7502 else
7503   echo "configure: failed program was:" >&5
7504   cat conftest.$ac_ext >&5
7505   rm -rf conftest*
7506   ol_cv_c_volatile=no
7507 fi
7508 rm -f conftest*
7509 fi
7510
7511 echo "$ac_t""$ol_cv_c_volatile" 1>&6
7512   if test $ol_cv_c_volatile = yes; then
7513     : 
7514   else
7515     cat >> confdefs.h <<\EOF
7516 #define volatile 
7517 EOF
7518
7519   fi
7520  
7521
7522 if test $cross_compiling = yes ; then
7523         cat >> confdefs.h <<\EOF
7524 #define CROSS_COMPILING 1
7525 EOF
7526
7527 else
7528         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
7529 echo "configure:7530: checking whether byte ordering is bigendian" >&5
7530 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
7531   echo $ac_n "(cached) $ac_c" 1>&6
7532 else
7533   ac_cv_c_bigendian=unknown
7534 # See if sys/param.h defines the BYTE_ORDER macro.
7535 cat > conftest.$ac_ext <<EOF
7536 #line 7537 "configure"
7537 #include "confdefs.h"
7538 #include <sys/types.h>
7539 #include <sys/param.h>
7540 int main() {
7541
7542 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
7543  bogus endian macros
7544 #endif
7545 ; return 0; }
7546 EOF
7547 if { (eval echo configure:7548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7548   rm -rf conftest*
7549   # It does; now see whether it defined to BIG_ENDIAN or not.
7550 cat > conftest.$ac_ext <<EOF
7551 #line 7552 "configure"
7552 #include "confdefs.h"
7553 #include <sys/types.h>
7554 #include <sys/param.h>
7555 int main() {
7556
7557 #if BYTE_ORDER != BIG_ENDIAN
7558  not big endian
7559 #endif
7560 ; return 0; }
7561 EOF
7562 if { (eval echo configure:7563: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7563   rm -rf conftest*
7564   ac_cv_c_bigendian=yes
7565 else
7566   echo "configure: failed program was:" >&5
7567   cat conftest.$ac_ext >&5
7568   rm -rf conftest*
7569   ac_cv_c_bigendian=no
7570 fi
7571 rm -f conftest*
7572 else
7573   echo "configure: failed program was:" >&5
7574   cat conftest.$ac_ext >&5
7575 fi
7576 rm -f conftest*
7577 if test $ac_cv_c_bigendian = unknown; then
7578 if test "$cross_compiling" = yes; then
7579     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
7580 else
7581   cat > conftest.$ac_ext <<EOF
7582 #line 7583 "configure"
7583 #include "confdefs.h"
7584 main () {
7585   /* Are we little or big endian?  From Harbison&Steele.  */
7586   union
7587   {
7588     long l;
7589     char c[sizeof (long)];
7590   } u;
7591   u.l = 1;
7592   exit (u.c[sizeof (long) - 1] == 1);
7593 }
7594 EOF
7595 if { (eval echo configure:7596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
7596 then
7597   ac_cv_c_bigendian=no
7598 else
7599   echo "configure: failed program was:" >&5
7600   cat conftest.$ac_ext >&5
7601   rm -fr conftest*
7602   ac_cv_c_bigendian=yes
7603 fi
7604 rm -fr conftest*
7605 fi
7606
7607 fi
7608 fi
7609
7610 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
7611 if test $ac_cv_c_bigendian = yes; then
7612   cat >> confdefs.h <<\EOF
7613 #define WORDS_BIGENDIAN 1
7614 EOF
7615
7616 fi
7617
7618         echo $ac_n "checking size of short""... $ac_c" 1>&6
7619 echo "configure:7620: checking size of short" >&5
7620 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
7621   echo $ac_n "(cached) $ac_c" 1>&6
7622 else
7623   if test "$cross_compiling" = yes; then
7624     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
7625 else
7626   cat > conftest.$ac_ext <<EOF
7627 #line 7628 "configure"
7628 #include "confdefs.h"
7629 #include <stdio.h>
7630 main()
7631 {
7632   FILE *f=fopen("conftestval", "w");
7633   if (!f) exit(1);
7634   fprintf(f, "%d\n", sizeof(short));
7635   exit(0);
7636 }
7637 EOF
7638 if { (eval echo configure:7639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
7639 then
7640   ac_cv_sizeof_short=`cat conftestval`
7641 else
7642   echo "configure: failed program was:" >&5
7643   cat conftest.$ac_ext >&5
7644   rm -fr conftest*
7645   ac_cv_sizeof_short=0
7646 fi
7647 rm -fr conftest*
7648 fi
7649
7650 fi
7651 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
7652 cat >> confdefs.h <<EOF
7653 #define SIZEOF_SHORT $ac_cv_sizeof_short
7654 EOF
7655
7656  
7657         echo $ac_n "checking size of int""... $ac_c" 1>&6
7658 echo "configure:7659: checking size of int" >&5
7659 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
7660   echo $ac_n "(cached) $ac_c" 1>&6
7661 else
7662   if test "$cross_compiling" = yes; then
7663     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
7664 else
7665   cat > conftest.$ac_ext <<EOF
7666 #line 7667 "configure"
7667 #include "confdefs.h"
7668 #include <stdio.h>
7669 main()
7670 {
7671   FILE *f=fopen("conftestval", "w");
7672   if (!f) exit(1);
7673   fprintf(f, "%d\n", sizeof(int));
7674   exit(0);
7675 }
7676 EOF
7677 if { (eval echo configure:7678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
7678 then
7679   ac_cv_sizeof_int=`cat conftestval`
7680 else
7681   echo "configure: failed program was:" >&5
7682   cat conftest.$ac_ext >&5
7683   rm -fr conftest*
7684   ac_cv_sizeof_int=0
7685 fi
7686 rm -fr conftest*
7687 fi
7688
7689 fi
7690 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
7691 cat >> confdefs.h <<EOF
7692 #define SIZEOF_INT $ac_cv_sizeof_int
7693 EOF
7694
7695  
7696         echo $ac_n "checking size of long""... $ac_c" 1>&6
7697 echo "configure:7698: checking size of long" >&5
7698 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
7699   echo $ac_n "(cached) $ac_c" 1>&6
7700 else
7701   if test "$cross_compiling" = yes; then
7702     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
7703 else
7704   cat > conftest.$ac_ext <<EOF
7705 #line 7706 "configure"
7706 #include "confdefs.h"
7707 #include <stdio.h>
7708 main()
7709 {
7710   FILE *f=fopen("conftestval", "w");
7711   if (!f) exit(1);
7712   fprintf(f, "%d\n", sizeof(long));
7713   exit(0);
7714 }
7715 EOF
7716 if { (eval echo configure:7717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
7717 then
7718   ac_cv_sizeof_long=`cat conftestval`
7719 else
7720   echo "configure: failed program was:" >&5
7721   cat conftest.$ac_ext >&5
7722   rm -fr conftest*
7723   ac_cv_sizeof_long=0
7724 fi
7725 rm -fr conftest*
7726 fi
7727
7728 fi
7729 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
7730 cat >> confdefs.h <<EOF
7731 #define SIZEOF_LONG $ac_cv_sizeof_long
7732 EOF
7733
7734
7735 fi
7736
7737 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
7738 echo "configure:7739: checking for 8-bit clean memcmp" >&5
7739 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
7740   echo $ac_n "(cached) $ac_c" 1>&6
7741 else
7742   if test "$cross_compiling" = yes; then
7743   ac_cv_func_memcmp_clean=no
7744 else
7745   cat > conftest.$ac_ext <<EOF
7746 #line 7747 "configure"
7747 #include "confdefs.h"
7748
7749 main()
7750 {
7751   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
7752   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
7753 }
7754
7755 EOF
7756 if { (eval echo configure:7757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
7757 then
7758   ac_cv_func_memcmp_clean=yes
7759 else
7760   echo "configure: failed program was:" >&5
7761   cat conftest.$ac_ext >&5
7762   rm -fr conftest*
7763   ac_cv_func_memcmp_clean=no
7764 fi
7765 rm -fr conftest*
7766 fi
7767
7768 fi
7769
7770 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
7771 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o"
7772
7773 echo $ac_n "checking for strftime""... $ac_c" 1>&6
7774 echo "configure:7775: checking for strftime" >&5
7775 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
7776   echo $ac_n "(cached) $ac_c" 1>&6
7777 else
7778   cat > conftest.$ac_ext <<EOF
7779 #line 7780 "configure"
7780 #include "confdefs.h"
7781 /* System header to define __stub macros and hopefully few prototypes,
7782     which can conflict with char strftime(); below.  */
7783 #include <assert.h>
7784 /* Override any gcc2 internal prototype to avoid an error.  */
7785 /* We use char because int might match the return type of a gcc2
7786     builtin and then its argument prototype would still apply.  */
7787 char strftime();
7788
7789 int main() {
7790
7791 /* The GNU C library defines this for functions which it implements
7792     to always fail with ENOSYS.  Some functions are actually named
7793     something starting with __ and the normal name is an alias.  */
7794 #if defined (__stub_strftime) || defined (__stub___strftime)
7795 choke me
7796 #else
7797 strftime();
7798 #endif
7799
7800 ; return 0; }
7801 EOF
7802 if { (eval echo configure:7803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7803   rm -rf conftest*
7804   eval "ac_cv_func_strftime=yes"
7805 else
7806   echo "configure: failed program was:" >&5
7807   cat conftest.$ac_ext >&5
7808   rm -rf conftest*
7809   eval "ac_cv_func_strftime=no"
7810 fi
7811 rm -f conftest*
7812 fi
7813
7814 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
7815   echo "$ac_t""yes" 1>&6
7816   cat >> confdefs.h <<\EOF
7817 #define HAVE_STRFTIME 1
7818 EOF
7819
7820 else
7821   echo "$ac_t""no" 1>&6
7822 # strftime is in -lintl on SCO UNIX.
7823 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
7824 echo "configure:7825: checking for strftime in -lintl" >&5
7825 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
7826 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7827   echo $ac_n "(cached) $ac_c" 1>&6
7828 else
7829   ac_save_LIBS="$LIBS"
7830 LIBS="-lintl  $LIBS"
7831 cat > conftest.$ac_ext <<EOF
7832 #line 7833 "configure"
7833 #include "confdefs.h"
7834 /* Override any gcc2 internal prototype to avoid an error.  */
7835 /* We use char because int might match the return type of a gcc2
7836     builtin and then its argument prototype would still apply.  */
7837 char strftime();
7838
7839 int main() {
7840 strftime()
7841 ; return 0; }
7842 EOF
7843 if { (eval echo configure:7844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7844   rm -rf conftest*
7845   eval "ac_cv_lib_$ac_lib_var=yes"
7846 else
7847   echo "configure: failed program was:" >&5
7848   cat conftest.$ac_ext >&5
7849   rm -rf conftest*
7850   eval "ac_cv_lib_$ac_lib_var=no"
7851 fi
7852 rm -f conftest*
7853 LIBS="$ac_save_LIBS"
7854
7855 fi
7856 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7857   echo "$ac_t""yes" 1>&6
7858   cat >> confdefs.h <<\EOF
7859 #define HAVE_STRFTIME 1
7860 EOF
7861
7862 LIBS="-lintl $LIBS"
7863 else
7864   echo "$ac_t""no" 1>&6
7865 fi
7866
7867 fi
7868
7869 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
7870 echo "configure:7871: checking for vprintf" >&5
7871 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
7872   echo $ac_n "(cached) $ac_c" 1>&6
7873 else
7874   cat > conftest.$ac_ext <<EOF
7875 #line 7876 "configure"
7876 #include "confdefs.h"
7877 /* System header to define __stub macros and hopefully few prototypes,
7878     which can conflict with char vprintf(); below.  */
7879 #include <assert.h>
7880 /* Override any gcc2 internal prototype to avoid an error.  */
7881 /* We use char because int might match the return type of a gcc2
7882     builtin and then its argument prototype would still apply.  */
7883 char vprintf();
7884
7885 int main() {
7886
7887 /* The GNU C library defines this for functions which it implements
7888     to always fail with ENOSYS.  Some functions are actually named
7889     something starting with __ and the normal name is an alias.  */
7890 #if defined (__stub_vprintf) || defined (__stub___vprintf)
7891 choke me
7892 #else
7893 vprintf();
7894 #endif
7895
7896 ; return 0; }
7897 EOF
7898 if { (eval echo configure:7899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7899   rm -rf conftest*
7900   eval "ac_cv_func_vprintf=yes"
7901 else
7902   echo "configure: failed program was:" >&5
7903   cat conftest.$ac_ext >&5
7904   rm -rf conftest*
7905   eval "ac_cv_func_vprintf=no"
7906 fi
7907 rm -f conftest*
7908 fi
7909
7910 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
7911   echo "$ac_t""yes" 1>&6
7912   cat >> confdefs.h <<\EOF
7913 #define HAVE_VPRINTF 1
7914 EOF
7915
7916 else
7917   echo "$ac_t""no" 1>&6
7918 fi
7919
7920 if test "$ac_cv_func_vprintf" != yes; then
7921 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
7922 echo "configure:7923: checking for _doprnt" >&5
7923 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
7924   echo $ac_n "(cached) $ac_c" 1>&6
7925 else
7926   cat > conftest.$ac_ext <<EOF
7927 #line 7928 "configure"
7928 #include "confdefs.h"
7929 /* System header to define __stub macros and hopefully few prototypes,
7930     which can conflict with char _doprnt(); below.  */
7931 #include <assert.h>
7932 /* Override any gcc2 internal prototype to avoid an error.  */
7933 /* We use char because int might match the return type of a gcc2
7934     builtin and then its argument prototype would still apply.  */
7935 char _doprnt();
7936
7937 int main() {
7938
7939 /* The GNU C library defines this for functions which it implements
7940     to always fail with ENOSYS.  Some functions are actually named
7941     something starting with __ and the normal name is an alias.  */
7942 #if defined (__stub__doprnt) || defined (__stub____doprnt)
7943 choke me
7944 #else
7945 _doprnt();
7946 #endif
7947
7948 ; return 0; }
7949 EOF
7950 if { (eval echo configure:7951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7951   rm -rf conftest*
7952   eval "ac_cv_func__doprnt=yes"
7953 else
7954   echo "configure: failed program was:" >&5
7955   cat conftest.$ac_ext >&5
7956   rm -rf conftest*
7957   eval "ac_cv_func__doprnt=no"
7958 fi
7959 rm -f conftest*
7960 fi
7961
7962 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
7963   echo "$ac_t""yes" 1>&6
7964   cat >> confdefs.h <<\EOF
7965 #define HAVE_DOPRNT 1
7966 EOF
7967
7968 else
7969   echo "$ac_t""no" 1>&6
7970 fi
7971
7972 fi
7973
7974
7975 if test $ac_cv_func_vprintf = yes ; then
7976                 for ac_func in vsnprintf vsprintf
7977 do
7978 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7979 echo "configure:7980: checking for $ac_func" >&5
7980 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
7981   echo $ac_n "(cached) $ac_c" 1>&6
7982 else
7983   cat > conftest.$ac_ext <<EOF
7984 #line 7985 "configure"
7985 #include "confdefs.h"
7986 /* System header to define __stub macros and hopefully few prototypes,
7987     which can conflict with char $ac_func(); below.  */
7988 #include <assert.h>
7989 /* Override any gcc2 internal prototype to avoid an error.  */
7990 /* We use char because int might match the return type of a gcc2
7991     builtin and then its argument prototype would still apply.  */
7992 char $ac_func();
7993
7994 int main() {
7995
7996 /* The GNU C library defines this for functions which it implements
7997     to always fail with ENOSYS.  Some functions are actually named
7998     something starting with __ and the normal name is an alias.  */
7999 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8000 choke me
8001 #else
8002 $ac_func();
8003 #endif
8004
8005 ; return 0; }
8006 EOF
8007 if { (eval echo configure:8008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8008   rm -rf conftest*
8009   eval "ac_cv_func_$ac_func=yes"
8010 else
8011   echo "configure: failed program was:" >&5
8012   cat conftest.$ac_ext >&5
8013   rm -rf conftest*
8014   eval "ac_cv_func_$ac_func=no"
8015 fi
8016 rm -f conftest*
8017 fi
8018
8019 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8020   echo "$ac_t""yes" 1>&6
8021     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8022   cat >> confdefs.h <<EOF
8023 #define $ac_tr_func 1
8024 EOF
8025  
8026 else
8027   echo "$ac_t""no" 1>&6
8028 fi
8029 done
8030
8031 fi
8032
8033 echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6
8034 echo "configure:8035: checking for wait3 that fills in rusage" >&5
8035 if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then
8036   echo $ac_n "(cached) $ac_c" 1>&6
8037 else
8038   if test "$cross_compiling" = yes; then
8039   ac_cv_func_wait3_rusage=no
8040 else
8041   cat > conftest.$ac_ext <<EOF
8042 #line 8043 "configure"
8043 #include "confdefs.h"
8044 #include <sys/types.h>
8045 #include <sys/time.h>
8046 #include <sys/resource.h>
8047 #include <stdio.h>
8048 /* HP-UX has wait3 but does not fill in rusage at all.  */
8049 main() {
8050   struct rusage r;
8051   int i;
8052   /* Use a field that we can force nonzero --
8053      voluntary context switches.
8054      For systems like NeXT and OSF/1 that don't set it,
8055      also use the system CPU time.  And page faults (I/O) for Linux.  */
8056   r.ru_nvcsw = 0;
8057   r.ru_stime.tv_sec = 0;
8058   r.ru_stime.tv_usec = 0;
8059   r.ru_majflt = r.ru_minflt = 0;
8060   switch (fork()) {
8061   case 0: /* Child.  */
8062     sleep(1); /* Give up the CPU.  */
8063     _exit(0);
8064   case -1: _exit(0); /* What can we do?  */
8065   default: /* Parent.  */
8066     wait3(&i, 0, &r);
8067     sleep(2); /* Avoid "text file busy" from rm on fast HP-UX machines.  */
8068     exit(r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0
8069          && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
8070   }
8071 }
8072 EOF
8073 if { (eval echo configure:8074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
8074 then
8075   ac_cv_func_wait3_rusage=yes
8076 else
8077   echo "configure: failed program was:" >&5
8078   cat conftest.$ac_ext >&5
8079   rm -fr conftest*
8080   ac_cv_func_wait3_rusage=no
8081 fi
8082 rm -fr conftest*
8083 fi
8084
8085 fi
8086
8087 echo "$ac_t""$ac_cv_func_wait3_rusage" 1>&6
8088 if test $ac_cv_func_wait3_rusage = yes; then
8089   cat >> confdefs.h <<\EOF
8090 #define HAVE_WAIT3 1
8091 EOF
8092
8093 fi
8094
8095
8096 for ac_func in \
8097         bcopy                   \
8098         flock                   \
8099         getdtablesize   \
8100         gethostname             \
8101         getpwuid                \
8102         gettimeofday    \
8103         lockf                   \
8104         memcpy                  \
8105         memmove                 \
8106         mkstemp                 \
8107         res_search              \
8108         select                  \
8109         setpwfile               \
8110         setsid                  \
8111         signal                  \
8112         sigset                  \
8113         snprintf                \
8114         socket                  \
8115         strerror                \
8116         strpbrk                 \
8117         strrchr                 \
8118         strsep                  \
8119         strstr                  \
8120         strtok                  \
8121         strtol                  \
8122         strtoul                 \
8123         sysconf                 \
8124         waitpid                 \
8125
8126 do
8127 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8128 echo "configure:8129: checking for $ac_func" >&5
8129 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
8130   echo $ac_n "(cached) $ac_c" 1>&6
8131 else
8132   cat > conftest.$ac_ext <<EOF
8133 #line 8134 "configure"
8134 #include "confdefs.h"
8135 /* System header to define __stub macros and hopefully few prototypes,
8136     which can conflict with char $ac_func(); below.  */
8137 #include <assert.h>
8138 /* Override any gcc2 internal prototype to avoid an error.  */
8139 /* We use char because int might match the return type of a gcc2
8140     builtin and then its argument prototype would still apply.  */
8141 char $ac_func();
8142
8143 int main() {
8144
8145 /* The GNU C library defines this for functions which it implements
8146     to always fail with ENOSYS.  Some functions are actually named
8147     something starting with __ and the normal name is an alias.  */
8148 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8149 choke me
8150 #else
8151 $ac_func();
8152 #endif
8153
8154 ; return 0; }
8155 EOF
8156 if { (eval echo configure:8157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8157   rm -rf conftest*
8158   eval "ac_cv_func_$ac_func=yes"
8159 else
8160   echo "configure: failed program was:" >&5
8161   cat conftest.$ac_ext >&5
8162   rm -rf conftest*
8163   eval "ac_cv_func_$ac_func=no"
8164 fi
8165 rm -f conftest*
8166 fi
8167
8168 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8169   echo "$ac_t""yes" 1>&6
8170     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8171   cat >> confdefs.h <<EOF
8172 #define $ac_tr_func 1
8173 EOF
8174  
8175 else
8176   echo "$ac_t""no" 1>&6
8177 fi
8178 done
8179
8180
8181 # these functions are required to build a thread_safe -lldap
8182 for ac_func in \
8183         strtok_r                \
8184         ctime_r                 \
8185         gethostbyaddr_r \
8186         gethostbyname_r \
8187
8188 do
8189 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8190 echo "configure:8191: checking for $ac_func" >&5
8191 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
8192   echo $ac_n "(cached) $ac_c" 1>&6
8193 else
8194   cat > conftest.$ac_ext <<EOF
8195 #line 8196 "configure"
8196 #include "confdefs.h"
8197 /* System header to define __stub macros and hopefully few prototypes,
8198     which can conflict with char $ac_func(); below.  */
8199 #include <assert.h>
8200 /* Override any gcc2 internal prototype to avoid an error.  */
8201 /* We use char because int might match the return type of a gcc2
8202     builtin and then its argument prototype would still apply.  */
8203 char $ac_func();
8204
8205 int main() {
8206
8207 /* The GNU C library defines this for functions which it implements
8208     to always fail with ENOSYS.  Some functions are actually named
8209     something starting with __ and the normal name is an alias.  */
8210 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8211 choke me
8212 #else
8213 $ac_func();
8214 #endif
8215
8216 ; return 0; }
8217 EOF
8218 if { (eval echo configure:8219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8219   rm -rf conftest*
8220   eval "ac_cv_func_$ac_func=yes"
8221 else
8222   echo "configure: failed program was:" >&5
8223   cat conftest.$ac_ext >&5
8224   rm -rf conftest*
8225   eval "ac_cv_func_$ac_func=no"
8226 fi
8227 rm -f conftest*
8228 fi
8229
8230 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8231   echo "$ac_t""yes" 1>&6
8232     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8233   cat >> confdefs.h <<EOF
8234 #define $ac_tr_func 1
8235 EOF
8236  
8237 else
8238   echo "$ac_t""no" 1>&6
8239 fi
8240 done
8241
8242
8243 echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
8244 echo "configure:8245: checking number of arguments of ctime_r" >&5
8245 if eval "test \"`echo '$''{'ol_cv_func_ctime_r_nargs'+set}'`\" = set"; then
8246   echo $ac_n "(cached) $ac_c" 1>&6
8247 else
8248   cat > conftest.$ac_ext <<EOF
8249 #line 8250 "configure"
8250 #include "confdefs.h"
8251 #include <time.h>
8252 int main() {
8253 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
8254 ; return 0; }
8255 EOF
8256 if { (eval echo configure:8257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8257   rm -rf conftest*
8258   ol_cv_func_ctime_r_nargs=3
8259 else
8260   echo "configure: failed program was:" >&5
8261   cat conftest.$ac_ext >&5
8262   rm -rf conftest*
8263   ol_cv_func_ctime_r_nargs=0
8264 fi
8265 rm -f conftest*
8266                 if test $ol_cv_func_ctime_r_nargs = 0 ; then
8267                         cat > conftest.$ac_ext <<EOF
8268 #line 8269 "configure"
8269 #include "confdefs.h"
8270 #include <time.h>
8271 int main() {
8272 time_t ti; char *buffer;
8273                                         ctime_r(&ti,buffer);
8274 ; return 0; }
8275 EOF
8276 if { (eval echo configure:8277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8277   rm -rf conftest*
8278   ol_cv_func_ctime_r_nargs=2
8279 else
8280   echo "configure: failed program was:" >&5
8281   cat conftest.$ac_ext >&5
8282   rm -rf conftest*
8283   ol_cv_func_ctime_r_nargs=0
8284 fi
8285 rm -f conftest*
8286                 fi
8287         
8288 fi
8289
8290 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
8291   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
8292     cat >> confdefs.h <<EOF
8293 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
8294 EOF
8295
8296   fi
8297
8298
8299 if test $ac_cv_func_strtok_r = yes \
8300         -a $ac_cv_func_ctime_r = yes \
8301         -a $ol_cv_func_ctime_r_nargs -ge 2 -a $ol_cv_func_ctime_r_nargs -le 3 \
8302         -a $ac_cv_func_gethostbyaddr_r = yes \
8303         -a $ac_cv_func_gethostbyname_r = yes \
8304         ; then
8305
8306         cat >> confdefs.h <<\EOF
8307 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
8308 EOF
8309
8310 fi
8311
8312 if test $ol_link_threads != no ; then
8313         cat >> confdefs.h <<\EOF
8314 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
8315 EOF
8316
8317 fi
8318
8319 for ac_func in getopt strdup tempnam
8320 do
8321 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8322 echo "configure:8323: checking for $ac_func" >&5
8323 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
8324   echo $ac_n "(cached) $ac_c" 1>&6
8325 else
8326   cat > conftest.$ac_ext <<EOF
8327 #line 8328 "configure"
8328 #include "confdefs.h"
8329 /* System header to define __stub macros and hopefully few prototypes,
8330     which can conflict with char $ac_func(); below.  */
8331 #include <assert.h>
8332 /* Override any gcc2 internal prototype to avoid an error.  */
8333 /* We use char because int might match the return type of a gcc2
8334     builtin and then its argument prototype would still apply.  */
8335 char $ac_func();
8336
8337 int main() {
8338
8339 /* The GNU C library defines this for functions which it implements
8340     to always fail with ENOSYS.  Some functions are actually named
8341     something starting with __ and the normal name is an alias.  */
8342 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8343 choke me
8344 #else
8345 $ac_func();
8346 #endif
8347
8348 ; return 0; }
8349 EOF
8350 if { (eval echo configure:8351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8351   rm -rf conftest*
8352   eval "ac_cv_func_$ac_func=yes"
8353 else
8354   echo "configure: failed program was:" >&5
8355   cat conftest.$ac_ext >&5
8356   rm -rf conftest*
8357   eval "ac_cv_func_$ac_func=no"
8358 fi
8359 rm -f conftest*
8360 fi
8361
8362 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8363   echo "$ac_t""yes" 1>&6
8364     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8365   cat >> confdefs.h <<EOF
8366 #define $ac_tr_func 1
8367 EOF
8368  
8369 else
8370   echo "$ac_t""no" 1>&6
8371 LIBOBJS="$LIBOBJS ${ac_func}.o"
8372 fi
8373 done
8374
8375
8376
8377 # Check Configuration
8378
8379 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
8380 echo "configure:8381: checking declaration of sys_errlist" >&5
8381 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
8382   echo $ac_n "(cached) $ac_c" 1>&6
8383 else
8384   
8385         cat > conftest.$ac_ext <<EOF
8386 #line 8387 "configure"
8387 #include "confdefs.h"
8388
8389 #include <stdio.h>
8390 #include <sys/types.h>
8391 #include <errno.h> 
8392 int main() {
8393 char *c = (char *) *sys_errlist
8394 ; return 0; }
8395 EOF
8396 if { (eval echo configure:8397: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8397   rm -rf conftest*
8398   ol_cv_dcl_sys_errlist=yes
8399 else
8400   echo "configure: failed program was:" >&5
8401   cat conftest.$ac_ext >&5
8402   rm -rf conftest*
8403   ol_cv_dcl_sys_errlist=no
8404 fi
8405 rm -f conftest*
8406 fi
8407
8408 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
8409
8410 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
8411 if test $ol_cv_dcl_sys_errlist = no ; then
8412         cat >> confdefs.h <<\EOF
8413 #define DECL_SYS_ERRLIST 1
8414 EOF
8415
8416         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
8417 echo "configure:8418: checking existence of sys_errlist" >&5
8418         if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
8419   echo $ac_n "(cached) $ac_c" 1>&6
8420 else
8421   
8422                 cat > conftest.$ac_ext <<EOF
8423 #line 8424 "configure"
8424 #include "confdefs.h"
8425 #include <errno.h>
8426 int main() {
8427 char *c = (char *) *sys_errlist
8428 ; return 0; }
8429 EOF
8430 if { (eval echo configure:8431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8431   rm -rf conftest*
8432   ol_cv_have_sys_errlist=yes
8433 else
8434   echo "configure: failed program was:" >&5
8435   cat conftest.$ac_ext >&5
8436   rm -rf conftest*
8437   ol_cv_have_sys_errlist=no
8438 fi
8439 rm -f conftest*
8440 fi
8441
8442         echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
8443 fi
8444
8445
8446
8447 if test "$ol_enable_debug" != no ; then
8448         cat >> confdefs.h <<\EOF
8449 #define LDAP_DEBUG 1
8450 EOF
8451
8452 fi
8453 if test "$ol_enable_syslog" = yes ; then
8454         cat >> confdefs.h <<\EOF
8455 #define LDAP_SYSLOG 1
8456 EOF
8457
8458 fi
8459 if test "$ol_enable_libui" = yes ; then
8460         cat >> confdefs.h <<\EOF
8461 #define LDAP_LIBUI 1
8462 EOF
8463
8464 fi
8465 if test "$ol_enable_cache" = no ; then
8466         cat >> confdefs.h <<\EOF
8467 #define LDAP_NOCACHE 1
8468 EOF
8469
8470 fi
8471 if test "$ol_enable_dns" != no ; then
8472         cat >> confdefs.h <<\EOF
8473 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS 1
8474 EOF
8475
8476 fi
8477 if test "$ol_enable_proctitle" != no ; then
8478         cat >> confdefs.h <<\EOF
8479 #define LDAP_PROCTITLE 1
8480 EOF
8481
8482 fi
8483 if test "$ol_enable_referrals" != no ; then
8484         cat >> confdefs.h <<\EOF
8485 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS 1
8486 EOF
8487
8488 fi
8489 if test "$ol_enable_cldap" != no ; then
8490         cat >> confdefs.h <<\EOF
8491 #define LDAP_CONNECTIONLESS 1
8492 EOF
8493
8494 fi
8495
8496 if test "$ol_enable_aclgroups" != no ; then
8497         cat >> confdefs.h <<\EOF
8498 #define SLAPD_ACLGROUPS 1
8499 EOF
8500
8501 fi
8502 if test "$ol_enable_crypt" != no ; then
8503         cat >> confdefs.h <<\EOF
8504 #define SLAPD_CRYPT 1
8505 EOF
8506
8507 fi
8508 if test "$ol_enable_cleartext" != no ; then
8509         cat >> confdefs.h <<\EOF
8510 #define SLAPD_CLEARTEXT 1
8511 EOF
8512
8513 fi
8514 if test "$ol_enable_phonetic" != no ; then
8515         cat >> confdefs.h <<\EOF
8516 #define SLAPD_PHONETIC 1
8517 EOF
8518
8519 fi
8520 if test "$ol_enable_rlookups" != no ; then
8521         cat >> confdefs.h <<\EOF
8522 #define SLAPD_RLOOKUPS 1
8523 EOF
8524
8525 fi
8526
8527 if test "$ol_link_ldbm" != no ; then
8528         cat >> confdefs.h <<\EOF
8529 #define SLAPD_LDBM 1
8530 EOF
8531
8532         BUILD_SLAPD=yes
8533         BUILD_LDBM=yes
8534 fi
8535
8536 if test "$ol_enable_passwd" != no ; then
8537         cat >> confdefs.h <<\EOF
8538 #define SLAPD_PASSWD 1
8539 EOF
8540
8541         BUILD_SLAPD=yes
8542         BUILD_PASSWD=yes
8543 fi
8544
8545 if test "$ol_enable_shell" != no ; then
8546         cat >> confdefs.h <<\EOF
8547 #define SLAPD_SHELL 1
8548 EOF
8549
8550         BUILD_SLAPD=yes
8551         BUILD_SHELL=yes
8552 fi
8553
8554 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
8555         $BUILD_SLAPD = yes ; then
8556         BUILD_SLURPD=yes
8557 fi
8558
8559 if test "$ol_link_isode" != no ; then
8560         BUILD_LDAPD=yes
8561 fi
8562
8563
8564
8565
8566   
8567   
8568   
8569   
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586 trap '' 1 2 15
8587 cat > confcache <<\EOF
8588 # This file is a shell script that caches the results of configure
8589 # tests run on this system so they can be shared between configure
8590 # scripts and configure runs.  It is not useful on other systems.
8591 # If it contains results you don't want to keep, you may remove or edit it.
8592 #
8593 # By default, configure uses ./config.cache as the cache file,
8594 # creating it if it does not exist already.  You can give configure
8595 # the --cache-file=FILE option to use a different cache file; that is
8596 # what configure does when it calls configure scripts in
8597 # subdirectories, so they share the cache.
8598 # Giving --cache-file=/dev/null disables caching, for debugging configure.
8599 # config.status only pays attention to the cache file if you give it the
8600 # --recheck option to rerun configure.
8601 #
8602 EOF
8603 # The following way of writing the cache mishandles newlines in values,
8604 # but we know of no workaround that is simple, portable, and efficient.
8605 # So, don't put newlines in cache variables' values.
8606 # Ultrix sh set writes to stderr and can't be redirected directly,
8607 # and sets the high bit in the cache file unless we assign to the vars.
8608 (set) 2>&1 |
8609   case `(ac_space=' '; set) 2>&1` in
8610   *ac_space=\ *)
8611     # `set' does not quote correctly, so add quotes (double-quote substitution
8612     # turns \\\\ into \\, and sed turns \\ into \).
8613     sed -n \
8614       -e "s/'/'\\\\''/g" \
8615       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
8616     ;;
8617   *)
8618     # `set' quotes correctly as required by POSIX, so do not add quotes.
8619     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
8620     ;;
8621   esac >> confcache
8622 if cmp -s $cache_file confcache; then
8623   :
8624 else
8625   if test -w $cache_file; then
8626     echo "updating cache $cache_file"
8627     cat confcache > $cache_file
8628   else
8629     echo "not updating unwritable cache $cache_file"
8630   fi
8631 fi
8632 rm -f confcache
8633
8634 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
8635
8636 test "x$prefix" = xNONE && prefix=$ac_default_prefix
8637 # Let make expand exec_prefix.
8638 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
8639
8640 # Any assignment to VPATH causes Sun make to only execute
8641 # the first set of double-colon rules, so remove it if not needed.
8642 # If there is a colon in the path, we need to keep it.
8643 if test "x$srcdir" = x.; then
8644   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
8645 fi
8646
8647 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
8648
8649 DEFS=-DHAVE_CONFIG_H
8650
8651 # Without the "./", some shells look in PATH for config.status.
8652 : ${CONFIG_STATUS=./config.status}
8653
8654 echo creating $CONFIG_STATUS
8655 rm -f $CONFIG_STATUS
8656 cat > $CONFIG_STATUS <<EOF
8657 #! /bin/sh
8658 # Generated automatically by configure.
8659 # Run this file to recreate the current configuration.
8660 # This directory was configured as follows,
8661 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
8662 #
8663 # $0 $ac_configure_args
8664 #
8665 # Compiler output produced by configure, useful for debugging
8666 # configure, is in ./config.log if it exists.
8667
8668 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
8669 for ac_option
8670 do
8671   case "\$ac_option" in
8672   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
8673     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
8674     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
8675   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
8676     echo "$CONFIG_STATUS generated by autoconf version 2.12"
8677     exit 0 ;;
8678   -help | --help | --hel | --he | --h)
8679     echo "\$ac_cs_usage"; exit 0 ;;
8680   *) echo "\$ac_cs_usage"; exit 1 ;;
8681   esac
8682 done
8683
8684 ac_given_srcdir=$srcdir
8685 ac_given_INSTALL="$INSTALL"
8686
8687 trap 'rm -fr `echo "\
8688 Makefile:build/top.mk:Makefile.in:build/dir.mk \
8689 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
8690 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
8691 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
8692 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
8693 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
8694 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
8695 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
8696 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
8697 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
8698 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
8699 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
8700 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
8701 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
8702 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
8703 include/Makefile:build/top.mk:include/Makefile.in \
8704 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
8705 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
8706 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
8707 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
8708 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
8709 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
8710 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
8711 libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk:build/lib-static.mk    \
8712 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
8713 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
8714 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
8715 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
8716 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
8717 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
8718 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
8719 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
8720 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
8721 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
8722 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
8723 tests/Makefile:build/top.mk:tests/Makefile.in \
8724  include/portable.h include/ldap_features.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
8725 EOF
8726 cat >> $CONFIG_STATUS <<EOF
8727
8728 # Protect against being on the right side of a sed subst in config.status.
8729 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
8730  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
8731 $ac_vpsub
8732 $extrasub
8733 s%@CFLAGS@%$CFLAGS%g
8734 s%@CPPFLAGS@%$CPPFLAGS%g
8735 s%@CXXFLAGS@%$CXXFLAGS%g
8736 s%@DEFS@%$DEFS%g
8737 s%@LDFLAGS@%$LDFLAGS%g
8738 s%@LIBS@%$LIBS%g
8739 s%@exec_prefix@%$exec_prefix%g
8740 s%@prefix@%$prefix%g
8741 s%@program_transform_name@%$program_transform_name%g
8742 s%@bindir@%$bindir%g
8743 s%@sbindir@%$sbindir%g
8744 s%@libexecdir@%$libexecdir%g
8745 s%@datadir@%$datadir%g
8746 s%@sysconfdir@%$sysconfdir%g
8747 s%@sharedstatedir@%$sharedstatedir%g
8748 s%@localstatedir@%$localstatedir%g
8749 s%@libdir@%$libdir%g
8750 s%@includedir@%$includedir%g
8751 s%@oldincludedir@%$oldincludedir%g
8752 s%@infodir@%$infodir%g
8753 s%@mandir@%$mandir%g
8754 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
8755 s%@INSTALL_DATA@%$INSTALL_DATA%g
8756 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
8757 s%@PACKAGE@%$PACKAGE%g
8758 s%@VERSION@%$VERSION%g
8759 s%@ACLOCAL@%$ACLOCAL%g
8760 s%@AUTOCONF@%$AUTOCONF%g
8761 s%@AUTOMAKE@%$AUTOMAKE%g
8762 s%@AUTOHEADER@%$AUTOHEADER%g
8763 s%@MAKEINFO@%$MAKEINFO%g
8764 s%@SET_MAKE@%$SET_MAKE%g
8765 s%@top_builddir@%$top_builddir%g
8766 s%@ldap_subdir@%$ldap_subdir%g
8767 s%@host@%$host%g
8768 s%@host_alias@%$host_alias%g
8769 s%@host_cpu@%$host_cpu%g
8770 s%@host_vendor@%$host_vendor%g
8771 s%@host_os@%$host_os%g
8772 s%@RANLIB@%$RANLIB%g
8773 s%@CC@%$CC%g
8774 s%@LD@%$LD%g
8775 s%@NM@%$NM%g
8776 s%@LN_S@%$LN_S%g
8777 s%@LIBTOOL@%$LIBTOOL%g
8778 s%@SENDMAIL@%$SENDMAIL%g
8779 s%@EDITOR@%$EDITOR%g
8780 s%@FINGER@%$FINGER%g
8781 s%@CPP@%$CPP%g
8782 s%@PEPSY@%$PEPSY%g
8783 s%@LIBOBJS@%$LIBOBJS%g
8784 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
8785 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
8786 s%@BUILD_LDBM@%$BUILD_LDBM%g
8787 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
8788 s%@BUILD_SHELL@%$BUILD_SHELL%g
8789 s%@BUILD_PERL@%$BUILD_PERL%g
8790 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
8791 s%@LDAP_LIBS@%$LDAP_LIBS%g
8792 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
8793 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
8794 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
8795 s%@SLAPD_PERL_CPPFLAGS@%$SLAPD_PERL_CPPFLAGS%g
8796 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
8797 s%@LDBM_LIBS@%$LDBM_LIBS%g
8798 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
8799 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
8800 s%@KRB_LIBS@%$KRB_LIBS%g
8801 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
8802
8803 CEOF
8804 EOF
8805
8806 cat >> $CONFIG_STATUS <<\EOF
8807
8808 # Split the substitutions into bite-sized pieces for seds with
8809 # small command number limits, like on Digital OSF/1 and HP-UX.
8810 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
8811 ac_file=1 # Number of current file.
8812 ac_beg=1 # First line for current file.
8813 ac_end=$ac_max_sed_cmds # Line after last line for current file.
8814 ac_more_lines=:
8815 ac_sed_cmds=""
8816 while $ac_more_lines; do
8817   if test $ac_beg -gt 1; then
8818     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
8819   else
8820     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
8821   fi
8822   if test ! -s conftest.s$ac_file; then
8823     ac_more_lines=false
8824     rm -f conftest.s$ac_file
8825   else
8826     if test -z "$ac_sed_cmds"; then
8827       ac_sed_cmds="sed -f conftest.s$ac_file"
8828     else
8829       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
8830     fi
8831     ac_file=`expr $ac_file + 1`
8832     ac_beg=$ac_end
8833     ac_end=`expr $ac_end + $ac_max_sed_cmds`
8834   fi
8835 done
8836 if test -z "$ac_sed_cmds"; then
8837   ac_sed_cmds=cat
8838 fi
8839 EOF
8840
8841 cat >> $CONFIG_STATUS <<EOF
8842
8843 CONFIG_FILES=\${CONFIG_FILES-"\
8844 Makefile:build/top.mk:Makefile.in:build/dir.mk \
8845 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
8846 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
8847 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
8848 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
8849 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
8850 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
8851 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
8852 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
8853 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
8854 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
8855 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
8856 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
8857 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
8858 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
8859 include/Makefile:build/top.mk:include/Makefile.in \
8860 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
8861 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
8862 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
8863 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
8864 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
8865 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
8866 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
8867 libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk:build/lib-static.mk    \
8868 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
8869 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
8870 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
8871 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
8872 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
8873 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
8874 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
8875 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
8876 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
8877 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
8878 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
8879 tests/Makefile:build/top.mk:tests/Makefile.in \
8880 "}
8881 EOF
8882 cat >> $CONFIG_STATUS <<\EOF
8883 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
8884   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
8885   case "$ac_file" in
8886   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
8887        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
8888   *) ac_file_in="${ac_file}.in" ;;
8889   esac
8890
8891   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
8892
8893   # Remove last slash and all that follows it.  Not all systems have dirname.
8894   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
8895   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
8896     # The file is in a subdirectory.
8897     test ! -d "$ac_dir" && mkdir "$ac_dir"
8898     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
8899     # A "../" for each directory in $ac_dir_suffix.
8900     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
8901   else
8902     ac_dir_suffix= ac_dots=
8903   fi
8904
8905   case "$ac_given_srcdir" in
8906   .)  srcdir=.
8907       if test -z "$ac_dots"; then top_srcdir=.
8908       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
8909   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
8910   *) # Relative path.
8911     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
8912     top_srcdir="$ac_dots$ac_given_srcdir" ;;
8913   esac
8914
8915   case "$ac_given_INSTALL" in
8916   [/$]*) INSTALL="$ac_given_INSTALL" ;;
8917   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
8918   esac
8919
8920   echo creating "$ac_file"
8921   rm -f "$ac_file"
8922   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
8923   case "$ac_file" in
8924   *Makefile*) ac_comsub="1i\\
8925 # $configure_input" ;;
8926   *) ac_comsub= ;;
8927   esac
8928
8929   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
8930   sed -e "$ac_comsub
8931 s%@configure_input@%$configure_input%g
8932 s%@srcdir@%$srcdir%g
8933 s%@top_srcdir@%$top_srcdir%g
8934 s%@INSTALL@%$INSTALL%g
8935 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
8936 fi; done
8937 rm -f conftest.s*
8938
8939 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
8940 # NAME is the cpp macro being defined and VALUE is the value it is being given.
8941 #
8942 # ac_d sets the value in "#define NAME VALUE" lines.
8943 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
8944 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
8945 ac_dC='\3'
8946 ac_dD='%g'
8947 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
8948 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
8949 ac_uB='\([      ]\)%\1#\2define\3'
8950 ac_uC=' '
8951 ac_uD='\4%g'
8952 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
8953 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
8954 ac_eB='$%\1#\2define\3'
8955 ac_eC=' '
8956 ac_eD='%g'
8957
8958 if test "${CONFIG_HEADERS+set}" != set; then
8959 EOF
8960 cat >> $CONFIG_STATUS <<EOF
8961   CONFIG_HEADERS="include/portable.h include/ldap_features.h"
8962 EOF
8963 cat >> $CONFIG_STATUS <<\EOF
8964 fi
8965 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
8966   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
8967   case "$ac_file" in
8968   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
8969        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
8970   *) ac_file_in="${ac_file}.in" ;;
8971   esac
8972
8973   echo creating $ac_file
8974
8975   rm -f conftest.frag conftest.in conftest.out
8976   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
8977   cat $ac_file_inputs > conftest.in
8978
8979 EOF
8980
8981 # Transform confdefs.h into a sed script conftest.vals that substitutes
8982 # the proper values into config.h.in to produce config.h.  And first:
8983 # Protect against being on the right side of a sed subst in config.status.
8984 # Protect against being in an unquoted here document in config.status.
8985 rm -f conftest.vals
8986 cat > conftest.hdr <<\EOF
8987 s/[\\&%]/\\&/g
8988 s%[\\$`]%\\&%g
8989 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
8990 s%ac_d%ac_u%gp
8991 s%ac_u%ac_e%gp
8992 EOF
8993 sed -n -f conftest.hdr confdefs.h > conftest.vals
8994 rm -f conftest.hdr
8995
8996 # This sed command replaces #undef with comments.  This is necessary, for
8997 # example, in the case of _POSIX_SOURCE, which is predefined and required
8998 # on some systems where configure will not decide to define it.
8999 cat >> conftest.vals <<\EOF
9000 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
9001 EOF
9002
9003 # Break up conftest.vals because some shells have a limit on
9004 # the size of here documents, and old seds have small limits too.
9005
9006 rm -f conftest.tail
9007 while :
9008 do
9009   ac_lines=`grep -c . conftest.vals`
9010   # grep -c gives empty output for an empty file on some AIX systems.
9011   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
9012   # Write a limited-size here document to conftest.frag.
9013   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
9014   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
9015   echo 'CEOF
9016   sed -f conftest.frag conftest.in > conftest.out
9017   rm -f conftest.in
9018   mv conftest.out conftest.in
9019 ' >> $CONFIG_STATUS
9020   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
9021   rm -f conftest.vals
9022   mv conftest.tail conftest.vals
9023 done
9024 rm -f conftest.vals
9025
9026 cat >> $CONFIG_STATUS <<\EOF
9027   rm -f conftest.frag conftest.h
9028   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
9029   cat conftest.in >> conftest.h
9030   rm -f conftest.in
9031   if cmp -s $ac_file conftest.h 2>/dev/null; then
9032     echo "$ac_file is unchanged"
9033     rm -f conftest.h
9034   else
9035     # Remove last slash and all that follows it.  Not all systems have dirname.
9036       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
9037       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
9038       # The file is in a subdirectory.
9039       test ! -d "$ac_dir" && mkdir "$ac_dir"
9040     fi
9041     rm -f $ac_file
9042     mv conftest.h $ac_file
9043   fi
9044 fi; done
9045
9046 EOF
9047 cat >> $CONFIG_STATUS <<EOF
9048
9049 EOF
9050 cat >> $CONFIG_STATUS <<\EOF
9051
9052 date > stamp-h
9053 echo Please \"make depend\" to build dependencies
9054
9055 exit 0
9056 EOF
9057 chmod +x $CONFIG_STATUS
9058 rm -fr confdefs* $ac_clean_files
9059 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
9060