]> git.sur5r.net Git - openldap/blob - configure
368ec1f5e08492fc74a1cd469527516f82e84d3f
[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   --enable-debug        enable debugging (yes)"
17 ac_help="$ac_help
18   --enable-libui        enable library user interface (yes)"
19 ac_help="$ac_help
20   --enable-cache        enable caching (yes)"
21 ac_help="$ac_help
22   --enable-dns  enable dns support (no)"
23 ac_help="$ac_help
24   --enable-referrals    enable referrals (yes)"
25 ac_help="$ac_help
26   --enable-clapd        enable connectionless ldap (no)"
27 ac_help="$ac_help
28   --with-kerberos       use Kerberos (auto)"
29 ac_help="$ac_help
30   --with-threads        use threads (auto)"
31 ac_help="$ac_help
32   --enable-ldapd        enable building ldapd (no)"
33 ac_help="$ac_help
34   --enable-slapd        enable building slapd (yes)"
35 ac_help="$ac_help
36     --enable-aclgroup   enable ACL group support (auto)"
37 ac_help="$ac_help
38     --enable-crypt      enable crypt(3) passwords (auto)"
39 ac_help="$ac_help
40     --enable-md5        enable MD5 passwords (auto)"
41 ac_help="$ac_help
42     --enable-sha1       enable SHA1 passwords (auto)"
43 ac_help="$ac_help
44     --enable-wrappers   enable tcp wrapper support (no)"
45 ac_help="$ac_help
46     --enable-phonetic   enable phonetic/soundex (no)"
47 ac_help="$ac_help
48     --enable-rlookups   enable reverse lookups (auto)"
49 ac_help="$ac_help
50     --enable-ldbm       enable ldbm backend (yes)"
51 ac_help="$ac_help
52       --with-ldbm-api   use LDBM API (auto)"
53 ac_help="$ac_help
54       --with-ldbm-type  use LDBM type (auto)"
55 ac_help="$ac_help
56     --enable-passwd     enable passwd backend (no)"
57 ac_help="$ac_help
58     --enable-shell      enable shell backend (no)"
59 ac_help="$ac_help
60   --enable-slurpd       enable building slurpd (auto)"
61
62 # Initialize some variables set by options.
63 # The variables have the same names as the options, with
64 # dashes changed to underlines.
65 build=NONE
66 cache_file=./config.cache
67 exec_prefix=NONE
68 host=NONE
69 no_create=
70 nonopt=NONE
71 no_recursion=
72 prefix=NONE
73 program_prefix=NONE
74 program_suffix=NONE
75 program_transform_name=s,x,x,
76 silent=
77 site=
78 srcdir=
79 target=NONE
80 verbose=
81 x_includes=NONE
82 x_libraries=NONE
83 bindir='${exec_prefix}/bin'
84 sbindir='${exec_prefix}/sbin'
85 libexecdir='${exec_prefix}/libexec'
86 datadir='${prefix}/share'
87 sysconfdir='${prefix}/etc'
88 sharedstatedir='${prefix}/com'
89 localstatedir='${prefix}/var'
90 libdir='${exec_prefix}/lib'
91 includedir='${prefix}/include'
92 oldincludedir='/usr/include'
93 infodir='${prefix}/info'
94 mandir='${prefix}/man'
95
96 # Initialize some other variables.
97 subdirs=
98 MFLAGS= MAKEFLAGS=
99 # Maximum number of lines to put in a shell here document.
100 ac_max_here_lines=12
101
102 ac_prev=
103 for ac_option
104 do
105
106   # If the previous option needs an argument, assign it.
107   if test -n "$ac_prev"; then
108     eval "$ac_prev=\$ac_option"
109     ac_prev=
110     continue
111   fi
112
113   case "$ac_option" in
114   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
115   *) ac_optarg= ;;
116   esac
117
118   # Accept the important Cygnus configure options, so we can diagnose typos.
119
120   case "$ac_option" in
121
122   -bindir | --bindir | --bindi | --bind | --bin | --bi)
123     ac_prev=bindir ;;
124   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
125     bindir="$ac_optarg" ;;
126
127   -build | --build | --buil | --bui | --bu)
128     ac_prev=build ;;
129   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
130     build="$ac_optarg" ;;
131
132   -cache-file | --cache-file | --cache-fil | --cache-fi \
133   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
134     ac_prev=cache_file ;;
135   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
136   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
137     cache_file="$ac_optarg" ;;
138
139   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
140     ac_prev=datadir ;;
141   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
142   | --da=*)
143     datadir="$ac_optarg" ;;
144
145   -disable-* | --disable-*)
146     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
147     # Reject names that are not valid shell variable names.
148     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
149       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
150     fi
151     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
152     eval "enable_${ac_feature}=no" ;;
153
154   -enable-* | --enable-*)
155     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
156     # Reject names that are not valid shell variable names.
157     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
158       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
159     fi
160     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
161     case "$ac_option" in
162       *=*) ;;
163       *) ac_optarg=yes ;;
164     esac
165     eval "enable_${ac_feature}='$ac_optarg'" ;;
166
167   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
168   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
169   | --exec | --exe | --ex)
170     ac_prev=exec_prefix ;;
171   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
172   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
173   | --exec=* | --exe=* | --ex=*)
174     exec_prefix="$ac_optarg" ;;
175
176   -gas | --gas | --ga | --g)
177     # Obsolete; use --with-gas.
178     with_gas=yes ;;
179
180   -help | --help | --hel | --he)
181     # Omit some internal or obsolete options to make the list less imposing.
182     # This message is too long to be a string in the A/UX 3.1 sh.
183     cat << EOF
184 Usage: configure [options] [host]
185 Options: [defaults in brackets after descriptions]
186 Configuration:
187   --cache-file=FILE       cache test results in FILE
188   --help                  print this message
189   --no-create             do not create output files
190   --quiet, --silent       do not print \`checking...' messages
191   --version               print the version of autoconf that created configure
192 Directory and file names:
193   --prefix=PREFIX         install architecture-independent files in PREFIX
194                           [$ac_default_prefix]
195   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
196                           [same as prefix]
197   --bindir=DIR            user executables in DIR [EPREFIX/bin]
198   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
199   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
200   --datadir=DIR           read-only architecture-independent data in DIR
201                           [PREFIX/share]
202   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
203   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
204                           [PREFIX/com]
205   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
206   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
207   --includedir=DIR        C header files in DIR [PREFIX/include]
208   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
209   --infodir=DIR           info documentation in DIR [PREFIX/info]
210   --mandir=DIR            man documentation in DIR [PREFIX/man]
211   --srcdir=DIR            find the sources in DIR [configure dir or ..]
212   --program-prefix=PREFIX prepend PREFIX to installed program names
213   --program-suffix=SUFFIX append SUFFIX to installed program names
214   --program-transform-name=PROGRAM
215                           run sed PROGRAM on installed program names
216 EOF
217     cat << EOF
218 Host type:
219   --build=BUILD           configure for building on BUILD [BUILD=HOST]
220   --host=HOST             configure for HOST [guessed]
221   --target=TARGET         configure for TARGET [TARGET=HOST]
222 Features and packages:
223   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
224   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
225   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
226   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
227   --x-includes=DIR        X include files are in DIR
228   --x-libraries=DIR       X library files are in DIR
229 EOF
230     if test -n "$ac_help"; then
231       echo "--enable and --with options recognized:$ac_help"
232     fi
233     exit 0 ;;
234
235   -host | --host | --hos | --ho)
236     ac_prev=host ;;
237   -host=* | --host=* | --hos=* | --ho=*)
238     host="$ac_optarg" ;;
239
240   -includedir | --includedir | --includedi | --included | --include \
241   | --includ | --inclu | --incl | --inc)
242     ac_prev=includedir ;;
243   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
244   | --includ=* | --inclu=* | --incl=* | --inc=*)
245     includedir="$ac_optarg" ;;
246
247   -infodir | --infodir | --infodi | --infod | --info | --inf)
248     ac_prev=infodir ;;
249   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
250     infodir="$ac_optarg" ;;
251
252   -libdir | --libdir | --libdi | --libd)
253     ac_prev=libdir ;;
254   -libdir=* | --libdir=* | --libdi=* | --libd=*)
255     libdir="$ac_optarg" ;;
256
257   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
258   | --libexe | --libex | --libe)
259     ac_prev=libexecdir ;;
260   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
261   | --libexe=* | --libex=* | --libe=*)
262     libexecdir="$ac_optarg" ;;
263
264   -localstatedir | --localstatedir | --localstatedi | --localstated \
265   | --localstate | --localstat | --localsta | --localst \
266   | --locals | --local | --loca | --loc | --lo)
267     ac_prev=localstatedir ;;
268   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
269   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
270   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
271     localstatedir="$ac_optarg" ;;
272
273   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
274     ac_prev=mandir ;;
275   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
276     mandir="$ac_optarg" ;;
277
278   -nfp | --nfp | --nf)
279     # Obsolete; use --without-fp.
280     with_fp=no ;;
281
282   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
283   | --no-cr | --no-c)
284     no_create=yes ;;
285
286   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
287   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
288     no_recursion=yes ;;
289
290   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
291   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
292   | --oldin | --oldi | --old | --ol | --o)
293     ac_prev=oldincludedir ;;
294   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
295   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
296   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
297     oldincludedir="$ac_optarg" ;;
298
299   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
300     ac_prev=prefix ;;
301   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
302     prefix="$ac_optarg" ;;
303
304   -program-prefix | --program-prefix | --program-prefi | --program-pref \
305   | --program-pre | --program-pr | --program-p)
306     ac_prev=program_prefix ;;
307   -program-prefix=* | --program-prefix=* | --program-prefi=* \
308   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
309     program_prefix="$ac_optarg" ;;
310
311   -program-suffix | --program-suffix | --program-suffi | --program-suff \
312   | --program-suf | --program-su | --program-s)
313     ac_prev=program_suffix ;;
314   -program-suffix=* | --program-suffix=* | --program-suffi=* \
315   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
316     program_suffix="$ac_optarg" ;;
317
318   -program-transform-name | --program-transform-name \
319   | --program-transform-nam | --program-transform-na \
320   | --program-transform-n | --program-transform- \
321   | --program-transform | --program-transfor \
322   | --program-transfo | --program-transf \
323   | --program-trans | --program-tran \
324   | --progr-tra | --program-tr | --program-t)
325     ac_prev=program_transform_name ;;
326   -program-transform-name=* | --program-transform-name=* \
327   | --program-transform-nam=* | --program-transform-na=* \
328   | --program-transform-n=* | --program-transform-=* \
329   | --program-transform=* | --program-transfor=* \
330   | --program-transfo=* | --program-transf=* \
331   | --program-trans=* | --program-tran=* \
332   | --progr-tra=* | --program-tr=* | --program-t=*)
333     program_transform_name="$ac_optarg" ;;
334
335   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
336   | -silent | --silent | --silen | --sile | --sil)
337     silent=yes ;;
338
339   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
340     ac_prev=sbindir ;;
341   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
342   | --sbi=* | --sb=*)
343     sbindir="$ac_optarg" ;;
344
345   -sharedstatedir | --sharedstatedir | --sharedstatedi \
346   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
347   | --sharedst | --shareds | --shared | --share | --shar \
348   | --sha | --sh)
349     ac_prev=sharedstatedir ;;
350   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
351   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
352   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
353   | --sha=* | --sh=*)
354     sharedstatedir="$ac_optarg" ;;
355
356   -site | --site | --sit)
357     ac_prev=site ;;
358   -site=* | --site=* | --sit=*)
359     site="$ac_optarg" ;;
360
361   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
362     ac_prev=srcdir ;;
363   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
364     srcdir="$ac_optarg" ;;
365
366   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
367   | --syscon | --sysco | --sysc | --sys | --sy)
368     ac_prev=sysconfdir ;;
369   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
370   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
371     sysconfdir="$ac_optarg" ;;
372
373   -target | --target | --targe | --targ | --tar | --ta | --t)
374     ac_prev=target ;;
375   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
376     target="$ac_optarg" ;;
377
378   -v | -verbose | --verbose | --verbos | --verbo | --verb)
379     verbose=yes ;;
380
381   -version | --version | --versio | --versi | --vers)
382     echo "configure generated by autoconf version 2.12"
383     exit 0 ;;
384
385   -with-* | --with-*)
386     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
387     # Reject names that are not valid shell variable names.
388     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
389       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
390     fi
391     ac_package=`echo $ac_package| sed 's/-/_/g'`
392     case "$ac_option" in
393       *=*) ;;
394       *) ac_optarg=yes ;;
395     esac
396     eval "with_${ac_package}='$ac_optarg'" ;;
397
398   -without-* | --without-*)
399     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
400     # Reject names that are not valid shell variable names.
401     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
402       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
403     fi
404     ac_package=`echo $ac_package| sed 's/-/_/g'`
405     eval "with_${ac_package}=no" ;;
406
407   --x)
408     # Obsolete; use --with-x.
409     with_x=yes ;;
410
411   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
412   | --x-incl | --x-inc | --x-in | --x-i)
413     ac_prev=x_includes ;;
414   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
415   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
416     x_includes="$ac_optarg" ;;
417
418   -x-libraries | --x-libraries | --x-librarie | --x-librari \
419   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
420     ac_prev=x_libraries ;;
421   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
422   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
423     x_libraries="$ac_optarg" ;;
424
425   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
426     ;;
427
428   *)
429     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
430       echo "configure: warning: $ac_option: invalid host type" 1>&2
431     fi
432     if test "x$nonopt" != xNONE; then
433       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
434     fi
435     nonopt="$ac_option"
436     ;;
437
438   esac
439 done
440
441 if test -n "$ac_prev"; then
442   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
443 fi
444
445 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
446
447 # File descriptor usage:
448 # 0 standard input
449 # 1 file creation
450 # 2 errors and warnings
451 # 3 some systems may open it to /dev/tty
452 # 4 used on the Kubota Titan
453 # 6 checking for... messages and results
454 # 5 compiler messages saved in config.log
455 if test "$silent" = yes; then
456   exec 6>/dev/null
457 else
458   exec 6>&1
459 fi
460 exec 5>./config.log
461
462 echo "\
463 This file contains any messages produced by compilers while
464 running configure, to aid debugging if configure makes a mistake.
465 " 1>&5
466
467 # Strip out --no-create and --no-recursion so they do not pile up.
468 # Also quote any args containing shell metacharacters.
469 ac_configure_args=
470 for ac_arg
471 do
472   case "$ac_arg" in
473   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
474   | --no-cr | --no-c) ;;
475   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
476   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
477   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
478   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
479   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
480   esac
481 done
482
483 # NLS nuisances.
484 # Only set these to C if already set.  These must not be set unconditionally
485 # because not all systems understand e.g. LANG=C (notably SCO).
486 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
487 # Non-C LC_CTYPE values break the ctype check.
488 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
489 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
490 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
491 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
492
493 # confdefs.h avoids OS command line length limits that DEFS can exceed.
494 rm -rf conftest* confdefs.h
495 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
496 echo > confdefs.h
497
498 # A filename unique to this package, relative to the directory that
499 # configure is in, which we can look for to find out if srcdir is correct.
500 ac_unique_file=include/ldap.h
501
502 # Find the source files, if location was not specified.
503 if test -z "$srcdir"; then
504   ac_srcdir_defaulted=yes
505   # Try the directory containing this script, then its parent.
506   ac_prog=$0
507   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
508   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
509   srcdir=$ac_confdir
510   if test ! -r $srcdir/$ac_unique_file; then
511     srcdir=..
512   fi
513 else
514   ac_srcdir_defaulted=no
515 fi
516 if test ! -r $srcdir/$ac_unique_file; then
517   if test "$ac_srcdir_defaulted" = yes; then
518     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
519   else
520     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
521   fi
522 fi
523 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
524
525 # Prefer explicitly selected file to automatically selected ones.
526 if test -z "$CONFIG_SITE"; then
527   if test "x$prefix" != xNONE; then
528     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
529   else
530     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
531   fi
532 fi
533 for ac_site_file in $CONFIG_SITE; do
534   if test -r "$ac_site_file"; then
535     echo "loading site script $ac_site_file"
536     . "$ac_site_file"
537   fi
538 done
539
540 if test -r "$cache_file"; then
541   echo "loading cache $cache_file"
542   . $cache_file
543 else
544   echo "creating cache $cache_file"
545   > $cache_file
546 fi
547
548 ac_ext=c
549 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
550 ac_cpp='$CPP $CPPFLAGS'
551 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
552 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
553 cross_compiling=$ac_cv_prog_cc_cross
554
555 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
556   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
557   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
558     ac_n= ac_c='
559 ' ac_t='        '
560   else
561     ac_n=-n ac_c= ac_t=
562   fi
563 else
564   ac_n= ac_c='\c' ac_t=
565 fi
566
567
568 ac_aux_dir=
569 for ac_dir in build $srcdir/build; do
570   if test -f $ac_dir/install-sh; then
571     ac_aux_dir=$ac_dir
572     ac_install_sh="$ac_aux_dir/install-sh -c"
573     break
574   elif test -f $ac_dir/install.sh; then
575     ac_aux_dir=$ac_dir
576     ac_install_sh="$ac_aux_dir/install.sh -c"
577     break
578   fi
579 done
580 if test -z "$ac_aux_dir"; then
581   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
582 fi
583 ac_config_guess=$ac_aux_dir/config.guess
584 ac_config_sub=$ac_aux_dir/config.sub
585 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
586
587 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
588 echo "configure:589: checking configure arguments" >&5
589
590
591 # OpenLDAP --enable-debug
592         # Check whether --enable-debug or --disable-debug was given.
593 if test "${enable_debug+set}" = set; then
594   enableval="$enable_debug"
595   
596         ol_arg=invalid
597         for ol_val in auto yes no ; do
598                 if test "$enableval" = "$ol_val" ; then
599                         ol_arg="$ol_val"
600                 fi
601         done
602         if test "$ol_arg" = "invalid" ; then
603                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
604         fi
605         ol_enable_debug="$ol_arg"
606
607 else
608         ol_enable_debug="yes"
609 fi
610 # end --enable-debug
611 # OpenLDAP --enable-libui
612         # Check whether --enable-libui or --disable-libui was given.
613 if test "${enable_libui+set}" = set; then
614   enableval="$enable_libui"
615   
616         ol_arg=invalid
617         for ol_val in auto yes no ; do
618                 if test "$enableval" = "$ol_val" ; then
619                         ol_arg="$ol_val"
620                 fi
621         done
622         if test "$ol_arg" = "invalid" ; then
623                 { echo "configure: error: bad value $enableval for --enable-libui" 1>&2; exit 1; }
624         fi
625         ol_enable_libui="$ol_arg"
626
627 else
628         ol_enable_libui="yes"
629 fi
630 # end --enable-libui
631 # OpenLDAP --enable-cache
632         # Check whether --enable-cache or --disable-cache was given.
633 if test "${enable_cache+set}" = set; then
634   enableval="$enable_cache"
635   
636         ol_arg=invalid
637         for ol_val in auto yes no ; do
638                 if test "$enableval" = "$ol_val" ; then
639                         ol_arg="$ol_val"
640                 fi
641         done
642         if test "$ol_arg" = "invalid" ; then
643                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
644         fi
645         ol_enable_cache="$ol_arg"
646
647 else
648         ol_enable_cache="yes"
649 fi
650 # end --enable-cache
651 # OpenLDAP --enable-dns
652         # Check whether --enable-dns or --disable-dns was given.
653 if test "${enable_dns+set}" = set; then
654   enableval="$enable_dns"
655   
656         ol_arg=invalid
657         for ol_val in auto yes no ; do
658                 if test "$enableval" = "$ol_val" ; then
659                         ol_arg="$ol_val"
660                 fi
661         done
662         if test "$ol_arg" = "invalid" ; then
663                 { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; }
664         fi
665         ol_enable_dns="$ol_arg"
666
667 else
668         ol_enable_dns="no"
669 fi
670 # end --enable-dns
671 # OpenLDAP --enable-referrals
672         # Check whether --enable-referrals or --disable-referrals was given.
673 if test "${enable_referrals+set}" = set; then
674   enableval="$enable_referrals"
675   
676         ol_arg=invalid
677         for ol_val in auto yes no ; do
678                 if test "$enableval" = "$ol_val" ; then
679                         ol_arg="$ol_val"
680                 fi
681         done
682         if test "$ol_arg" = "invalid" ; then
683                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
684         fi
685         ol_enable_referrals="$ol_arg"
686
687 else
688         ol_enable_referrals="yes"
689 fi
690 # end --enable-referrals
691 # OpenLDAP --enable-cldap
692         # Check whether --enable-cldap or --disable-cldap was given.
693 if test "${enable_cldap+set}" = set; then
694   enableval="$enable_cldap"
695   
696         ol_arg=invalid
697         for ol_val in auto yes no ; do
698                 if test "$enableval" = "$ol_val" ; then
699                         ol_arg="$ol_val"
700                 fi
701         done
702         if test "$ol_arg" = "invalid" ; then
703                 { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; }
704         fi
705         ol_enable_cldap="$ol_arg"
706
707 else
708         ol_enable_cldap="no"
709 fi
710 # end --enable-cldap
711
712 # OpenLDAP --with-kerberos
713         # Check whether --with-kerberos or --without-kerberos was given.
714 if test "${with_kerberos+set}" = set; then
715   withval="$with_kerberos"
716   
717         ol_arg=invalid
718         for ol_val in auto k5 k4 afs yes no ; do
719                 if test "$withval" = "$ol_val" ; then
720                         ol_arg="$ol_val"
721                 fi
722         done
723         if test "$ol_arg" = "invalid" ; then
724                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
725         fi
726         ol_with_kerberos="$ol_arg"
727
728 else
729         ol_with_kerberos="auto"
730 fi
731 # end --with-kerberos
732
733 # OpenLDAP --with-threads
734         # Check whether --with-threads or --without-threads was given.
735 if test "${with_threads+set}" = set; then
736   withval="$with_threads"
737   
738         ol_arg=invalid
739         for ol_val in auto posix dce mach yes no manual  ; do
740                 if test "$withval" = "$ol_val" ; then
741                         ol_arg="$ol_val"
742                 fi
743         done
744         if test "$ol_arg" = "invalid" ; then
745                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
746         fi
747         ol_with_threads="$ol_arg"
748
749 else
750         ol_with_threads="auto"
751 fi
752 # end --with-threads
753
754
755
756 # OpenLDAP --enable-ldapd
757         # Check whether --enable-ldapd or --disable-ldapd was given.
758 if test "${enable_ldapd+set}" = set; then
759   enableval="$enable_ldapd"
760   
761         ol_arg=invalid
762         for ol_val in auto yes no ; do
763                 if test "$enableval" = "$ol_val" ; then
764                         ol_arg="$ol_val"
765                 fi
766         done
767         if test "$ol_arg" = "invalid" ; then
768                 { echo "configure: error: bad value $enableval for --enable-ldapd" 1>&2; exit 1; }
769         fi
770         ol_enable_ldapd="$ol_arg"
771
772 else
773         ol_enable_ldapd="no"
774 fi
775 # end --enable-ldapd
776
777 # OpenLDAP --enable-slapd
778         # Check whether --enable-slapd or --disable-slapd was given.
779 if test "${enable_slapd+set}" = set; then
780   enableval="$enable_slapd"
781   
782         ol_arg=invalid
783         for ol_val in auto yes no ; do
784                 if test "$enableval" = "$ol_val" ; then
785                         ol_arg="$ol_val"
786                 fi
787         done
788         if test "$ol_arg" = "invalid" ; then
789                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
790         fi
791         ol_enable_slapd="$ol_arg"
792
793 else
794         ol_enable_slapd="yes"
795 fi
796 # end --enable-slapd
797 # OpenLDAP --enable-aclgroup
798         # Check whether --enable-aclgroup or --disable-aclgroup was given.
799 if test "${enable_aclgroup+set}" = set; then
800   enableval="$enable_aclgroup"
801   
802         ol_arg=invalid
803         for ol_val in auto yes no ; do
804                 if test "$enableval" = "$ol_val" ; then
805                         ol_arg="$ol_val"
806                 fi
807         done
808         if test "$ol_arg" = "invalid" ; then
809                 { echo "configure: error: bad value $enableval for --enable-aclgroup" 1>&2; exit 1; }
810         fi
811         ol_enable_aclgroup="$ol_arg"
812
813 else
814         ol_enable_aclgroup="auto"
815 fi
816 # end --enable-aclgroup
817 # OpenLDAP --enable-crypt
818         # Check whether --enable-crypt or --disable-crypt was given.
819 if test "${enable_crypt+set}" = set; then
820   enableval="$enable_crypt"
821   
822         ol_arg=invalid
823         for ol_val in auto yes no ; do
824                 if test "$enableval" = "$ol_val" ; then
825                         ol_arg="$ol_val"
826                 fi
827         done
828         if test "$ol_arg" = "invalid" ; then
829                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
830         fi
831         ol_enable_crypt="$ol_arg"
832
833 else
834         ol_enable_crypt="auto"
835 fi
836 # end --enable-crypt
837 # OpenLDAP --enable-md5
838         # Check whether --enable-md5 or --disable-md5 was given.
839 if test "${enable_md5+set}" = set; then
840   enableval="$enable_md5"
841   
842         ol_arg=invalid
843         for ol_val in auto yes no ; do
844                 if test "$enableval" = "$ol_val" ; then
845                         ol_arg="$ol_val"
846                 fi
847         done
848         if test "$ol_arg" = "invalid" ; then
849                 { echo "configure: error: bad value $enableval for --enable-md5" 1>&2; exit 1; }
850         fi
851         ol_enable_md5="$ol_arg"
852
853 else
854         ol_enable_md5="auto"
855 fi
856 # end --enable-md5
857 # OpenLDAP --enable-sha1
858         # Check whether --enable-sha1 or --disable-sha1 was given.
859 if test "${enable_sha1+set}" = set; then
860   enableval="$enable_sha1"
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-sha1" 1>&2; exit 1; }
870         fi
871         ol_enable_sha1="$ol_arg"
872
873 else
874         ol_enable_sha1="auto"
875 fi
876 # end --enable-sha1
877 # OpenLDAP --enable-wrappers
878         # Check whether --enable-wrappers or --disable-wrappers was given.
879 if test "${enable_wrappers+set}" = set; then
880   enableval="$enable_wrappers"
881   
882         ol_arg=invalid
883         for ol_val in auto yes no ; do
884                 if test "$enableval" = "$ol_val" ; then
885                         ol_arg="$ol_val"
886                 fi
887         done
888         if test "$ol_arg" = "invalid" ; then
889                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
890         fi
891         ol_enable_wrappers="$ol_arg"
892
893 else
894         ol_enable_wrappers="no"
895 fi
896 # end --enable-wrappers
897 # OpenLDAP --enable-phonetic
898         # Check whether --enable-phonetic or --disable-phonetic was given.
899 if test "${enable_phonetic+set}" = set; then
900   enableval="$enable_phonetic"
901   
902         ol_arg=invalid
903         for ol_val in auto yes no ; do
904                 if test "$enableval" = "$ol_val" ; then
905                         ol_arg="$ol_val"
906                 fi
907         done
908         if test "$ol_arg" = "invalid" ; then
909                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
910         fi
911         ol_enable_phonetic="$ol_arg"
912
913 else
914         ol_enable_phonetic="no"
915 fi
916 # end --enable-phonetic
917 # OpenLDAP --enable-rlookups
918         # Check whether --enable-rlookups or --disable-rlookups was given.
919 if test "${enable_rlookups+set}" = set; then
920   enableval="$enable_rlookups"
921   
922         ol_arg=invalid
923         for ol_val in auto yes no ; do
924                 if test "$enableval" = "$ol_val" ; then
925                         ol_arg="$ol_val"
926                 fi
927         done
928         if test "$ol_arg" = "invalid" ; then
929                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
930         fi
931         ol_enable_rlookups="$ol_arg"
932
933 else
934         ol_enable_rlookups="auto"
935 fi
936 # end --enable-rlookups
937
938 # OpenLDAP --enable-ldbm
939         # Check whether --enable-ldbm or --disable-ldbm was given.
940 if test "${enable_ldbm+set}" = set; then
941   enableval="$enable_ldbm"
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-ldbm" 1>&2; exit 1; }
951         fi
952         ol_enable_ldbm="$ol_arg"
953
954 else
955         ol_enable_ldbm="yes"
956 fi
957 # end --enable-ldbm
958 # OpenLDAP --with-ldbm_api
959         # Check whether --with-ldbm_api or --without-ldbm_api was given.
960 if test "${with_ldbm_api+set}" = set; then
961   withval="$with_ldbm_api"
962   
963         ol_arg=invalid
964         for ol_val in auto db2 db gdbm ndbm manual ; do
965                 if test "$withval" = "$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 $withval for --with-ldbm_api" 1>&2; exit 1; }
971         fi
972         ol_with_ldbm_api="$ol_arg"
973
974 else
975         ol_with_ldbm_api="auto"
976 fi
977 # end --with-ldbm_api
978
979 # OpenLDAP --with-ldbm_type
980         # Check whether --with-ldbm_type or --without-ldbm_type was given.
981 if test "${with_ldbm_type+set}" = set; then
982   withval="$with_ldbm_type"
983   
984         ol_arg=invalid
985         for ol_val in auto btree hash ; do
986                 if test "$withval" = "$ol_val" ; then
987                         ol_arg="$ol_val"
988                 fi
989         done
990         if test "$ol_arg" = "invalid" ; then
991                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
992         fi
993         ol_with_ldbm_type="$ol_arg"
994
995 else
996         ol_with_ldbm_type="auto"
997 fi
998 # end --with-ldbm_type
999
1000
1001 # OpenLDAP --enable-passwd
1002         # Check whether --enable-passwd or --disable-passwd was given.
1003 if test "${enable_passwd+set}" = set; then
1004   enableval="$enable_passwd"
1005   
1006         ol_arg=invalid
1007         for ol_val in auto yes no ; do
1008                 if test "$enableval" = "$ol_val" ; then
1009                         ol_arg="$ol_val"
1010                 fi
1011         done
1012         if test "$ol_arg" = "invalid" ; then
1013                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1014         fi
1015         ol_enable_passwd="$ol_arg"
1016
1017 else
1018         ol_enable_passwd="no"
1019 fi
1020 # end --enable-passwd
1021 # OpenLDAP --enable-shell
1022         # Check whether --enable-shell or --disable-shell was given.
1023 if test "${enable_shell+set}" = set; then
1024   enableval="$enable_shell"
1025   
1026         ol_arg=invalid
1027         for ol_val in auto yes no ; do
1028                 if test "$enableval" = "$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 $enableval for --enable-shell" 1>&2; exit 1; }
1034         fi
1035         ol_enable_shell="$ol_arg"
1036
1037 else
1038         ol_enable_shell="no"
1039 fi
1040 # end --enable-shell
1041
1042 # OpenLDAP --enable-slurpd
1043         # Check whether --enable-slurpd or --disable-slurpd was given.
1044 if test "${enable_slurpd+set}" = set; then
1045   enableval="$enable_slurpd"
1046   
1047         ol_arg=invalid
1048         for ol_val in auto yes no ; do
1049                 if test "$enableval" = "$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 $enableval for --enable-slurpd" 1>&2; exit 1; }
1055         fi
1056         ol_enable_slurpd="$ol_arg"
1057
1058 else
1059         ol_enable_slurpd="auto"
1060 fi
1061 # end --enable-slurpd
1062
1063 if test $ol_enable_slapd = no ; then
1064                 if test $ol_enable_ldbm = yes ; then
1065                 echo "configure: warning: slapd disabled, ignoring --enable_ldbm argument" 1>&2;
1066         fi
1067         if test $ol_enable_passwd = yes ; then
1068                 echo "configure: warning: slapd disabled, ignoring --enable_passwd argument" 1>&2;
1069         fi
1070         if test $ol_enable_shell = yes ; then
1071                 echo "configure: warning: slapd disabled, ignoring --enable_shell argument" 1>&2;
1072         fi
1073         if test $ol_enable_aclgroup = yes ; then
1074                 echo "configure: warning: slapd disabled, ignoring --enable_aclgroup argument" 1>&2;
1075         fi
1076         if test $ol_enable_crypt = yes ; then
1077                 echo "configure: warning: slapd disabled, ignoring --enable_crypt argument" 1>&2;
1078         fi
1079         if test $ol_enable_md5 = yes ; then
1080                 echo "configure: warning: slapd disabled, ignoring --enable_md5 argument" 1>&2;
1081         fi
1082         if test $ol_enable_sha1 = yes ; then
1083                 echo "configure: warning: slapd disabled, ignoring --enable_sha1 argument" 1>&2;
1084         fi
1085         if test $ol_enable_wrappers = yes ; then
1086                 echo "configure: warning: slapd disabled, ignoring --enable_wrappers argument" 1>&2;
1087         fi
1088         if test $ol_enable_phonetic = yes ; then
1089                 echo "configure: warning: slapd disabled, ignoring --enable_phonetic argument" 1>&2;
1090         fi
1091         if test $ol_enable_rlookups = yes ; then
1092                 echo "configure: warning: slapd disabled, ignoring --enable_rlookups argument" 1>&2;
1093         fi
1094         if test $ol_with_ldbm_api != auto ; then
1095                 echo "configure: warning: slapd disabled, ignoring --with_ldbm_api argument" 1>&2;
1096         fi
1097         if test $ol_with_ldbm_type != auto ; then
1098                 echo "configure: warning: slapd disabled, ignoring --with_ldbm_type argument" 1>&2;
1099         fi
1100         if test $ol_enable_slurpd = yes ; then
1101                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; };
1102         fi
1103
1104         # force settings to no
1105         ol_enable_ldbm=no
1106         ol_enable_shell=no
1107         ol_enable_passwd=no
1108         ol_enable_aclgroup=no
1109         ol_enable_crypt=no
1110         ol_enable_md5=no
1111         ol_enable_sha1=no
1112         ol_enable_wrappers=no
1113         ol_enable_phonetic=no
1114         ol_enable_rlookups=no
1115         ol_with_ldbm_api=no
1116         ol_with_ldbm_type=no
1117         ol_enable_slurpd=no
1118
1119 elif test $ol_enable_ldbm = no ; then
1120         
1121         if test $ol_with_ldbm_api != auto ; then
1122                 echo "configure: warning: LDBM disabled, ignoring --with_ldbm_api argument" 1>&2;
1123         fi
1124
1125         if test $ol_with_ldbm_type != auto ; then
1126                 echo "configure: warning: LDBM disabled, ignoring --with_ldbm_type argument" 1>&2;
1127         fi
1128
1129         if test $ol_enable_passwd = no -a $ol_enable_shell = no ; then
1130                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; };
1131         fi
1132
1133         ol_with_ldbm_api=no
1134         ol_with_ldbm_type=no
1135
1136 else
1137         
1138         if test $ol_with_ldbm_api = gdbm -a \
1139                 $ol_with_ldbm_type = btree ; then
1140                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; };
1141         fi
1142         if test $ol_with_ldbm_api = ndbm -a \
1143                 $ol_with_ldbm_type = btree ; then
1144                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; };
1145         fi
1146 fi
1147
1148 if test $ol_enable_slurpd = yes ; then
1149                 if test $ol_with_threads = no ; then
1150                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; };
1151         fi
1152 fi
1153
1154 echo "$ac_t""done" 1>&6
1155
1156 ## Initialize vars
1157 LDAP_DEFS=
1158 LDAP_LIBS=
1159 LDBM_DEFS=
1160 LDBM_LIBS=
1161 LTHREAD_DEFS=
1162 LTHREAD_LIBS=
1163 LUTIL_DEFS=
1164 LUTIL_LIBS=
1165
1166 LDAPD_DEFS=
1167 LDAPD_LIBS=
1168 SLAPD_DEFS=
1169 SLAPD_LIBS=
1170 SLURPD_DEFS=
1171 SLURPD_LIBS=
1172
1173 BUILD_LDAPD=no
1174 BUILD_SLAPD=no
1175 BUILD_SLURPD=no
1176
1177 BUILD_LDBM=no
1178 BUILD_PASSWD=no
1179 BUILD_SHELL=no
1180
1181
1182 # Extract the first word of "gcc", so it can be a program name with args.
1183 set dummy gcc; ac_word=$2
1184 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1185 echo "configure:1186: checking for $ac_word" >&5
1186 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1187   echo $ac_n "(cached) $ac_c" 1>&6
1188 else
1189   if test -n "$CC"; then
1190   ac_cv_prog_CC="$CC" # Let the user override the test.
1191 else
1192   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1193   for ac_dir in $PATH; do
1194     test -z "$ac_dir" && ac_dir=.
1195     if test -f $ac_dir/$ac_word; then
1196       ac_cv_prog_CC="gcc"
1197       break
1198     fi
1199   done
1200   IFS="$ac_save_ifs"
1201 fi
1202 fi
1203 CC="$ac_cv_prog_CC"
1204 if test -n "$CC"; then
1205   echo "$ac_t""$CC" 1>&6
1206 else
1207   echo "$ac_t""no" 1>&6
1208 fi
1209
1210 if test -z "$CC"; then
1211   # Extract the first word of "cc", so it can be a program name with args.
1212 set dummy cc; ac_word=$2
1213 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1214 echo "configure:1215: checking for $ac_word" >&5
1215 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1216   echo $ac_n "(cached) $ac_c" 1>&6
1217 else
1218   if test -n "$CC"; then
1219   ac_cv_prog_CC="$CC" # Let the user override the test.
1220 else
1221   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1222   ac_prog_rejected=no
1223   for ac_dir in $PATH; do
1224     test -z "$ac_dir" && ac_dir=.
1225     if test -f $ac_dir/$ac_word; then
1226       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1227         ac_prog_rejected=yes
1228         continue
1229       fi
1230       ac_cv_prog_CC="cc"
1231       break
1232     fi
1233   done
1234   IFS="$ac_save_ifs"
1235 if test $ac_prog_rejected = yes; then
1236   # We found a bogon in the path, so make sure we never use it.
1237   set dummy $ac_cv_prog_CC
1238   shift
1239   if test $# -gt 0; then
1240     # We chose a different compiler from the bogus one.
1241     # However, it has the same basename, so the bogon will be chosen
1242     # first if we set CC to just the basename; use the full file name.
1243     shift
1244     set dummy "$ac_dir/$ac_word" "$@"
1245     shift
1246     ac_cv_prog_CC="$@"
1247   fi
1248 fi
1249 fi
1250 fi
1251 CC="$ac_cv_prog_CC"
1252 if test -n "$CC"; then
1253   echo "$ac_t""$CC" 1>&6
1254 else
1255   echo "$ac_t""no" 1>&6
1256 fi
1257
1258   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1259 fi
1260
1261 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1262 echo "configure:1263: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1263
1264 ac_ext=c
1265 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1266 ac_cpp='$CPP $CPPFLAGS'
1267 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1268 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1269 cross_compiling=$ac_cv_prog_cc_cross
1270
1271 cat > conftest.$ac_ext <<EOF
1272 #line 1273 "configure"
1273 #include "confdefs.h"
1274 main(){return(0);}
1275 EOF
1276 if { (eval echo configure:1277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1277   ac_cv_prog_cc_works=yes
1278   # If we can't run a trivial program, we are probably using a cross compiler.
1279   if (./conftest; exit) 2>/dev/null; then
1280     ac_cv_prog_cc_cross=no
1281   else
1282     ac_cv_prog_cc_cross=yes
1283   fi
1284 else
1285   echo "configure: failed program was:" >&5
1286   cat conftest.$ac_ext >&5
1287   ac_cv_prog_cc_works=no
1288 fi
1289 rm -fr conftest*
1290
1291 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1292 if test $ac_cv_prog_cc_works = no; then
1293   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1294 fi
1295 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1296 echo "configure:1297: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1297 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1298 cross_compiling=$ac_cv_prog_cc_cross
1299
1300 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1301 echo "configure:1302: checking whether we are using GNU C" >&5
1302 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1303   echo $ac_n "(cached) $ac_c" 1>&6
1304 else
1305   cat > conftest.c <<EOF
1306 #ifdef __GNUC__
1307   yes;
1308 #endif
1309 EOF
1310 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1311: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1311   ac_cv_prog_gcc=yes
1312 else
1313   ac_cv_prog_gcc=no
1314 fi
1315 fi
1316
1317 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1318
1319 if test $ac_cv_prog_gcc = yes; then
1320   GCC=yes
1321   ac_test_CFLAGS="${CFLAGS+set}"
1322   ac_save_CFLAGS="$CFLAGS"
1323   CFLAGS=
1324   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1325 echo "configure:1326: checking whether ${CC-cc} accepts -g" >&5
1326 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1327   echo $ac_n "(cached) $ac_c" 1>&6
1328 else
1329   echo 'void f(){}' > conftest.c
1330 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1331   ac_cv_prog_cc_g=yes
1332 else
1333   ac_cv_prog_cc_g=no
1334 fi
1335 rm -f conftest*
1336
1337 fi
1338
1339 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1340   if test "$ac_test_CFLAGS" = set; then
1341     CFLAGS="$ac_save_CFLAGS"
1342   elif test $ac_cv_prog_cc_g = yes; then
1343     CFLAGS="-g -O2"
1344   else
1345     CFLAGS="-O2"
1346   fi
1347 else
1348   GCC=
1349   test "${CFLAGS+set}" = set || CFLAGS="-g"
1350 fi
1351
1352 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1353 echo "configure:1354: checking how to run the C preprocessor" >&5
1354 # On Suns, sometimes $CPP names a directory.
1355 if test -n "$CPP" && test -d "$CPP"; then
1356   CPP=
1357 fi
1358 if test -z "$CPP"; then
1359 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1360   echo $ac_n "(cached) $ac_c" 1>&6
1361 else
1362     # This must be in double quotes, not single quotes, because CPP may get
1363   # substituted into the Makefile and "${CC-cc}" will confuse make.
1364   CPP="${CC-cc} -E"
1365   # On the NeXT, cc -E runs the code through the compiler's parser,
1366   # not just through cpp.
1367   cat > conftest.$ac_ext <<EOF
1368 #line 1369 "configure"
1369 #include "confdefs.h"
1370 #include <assert.h>
1371 Syntax Error
1372 EOF
1373 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1374 { (eval echo configure:1375: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1375 ac_err=`grep -v '^ *+' conftest.out`
1376 if test -z "$ac_err"; then
1377   :
1378 else
1379   echo "$ac_err" >&5
1380   echo "configure: failed program was:" >&5
1381   cat conftest.$ac_ext >&5
1382   rm -rf conftest*
1383   CPP="${CC-cc} -E -traditional-cpp"
1384   cat > conftest.$ac_ext <<EOF
1385 #line 1386 "configure"
1386 #include "confdefs.h"
1387 #include <assert.h>
1388 Syntax Error
1389 EOF
1390 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1391 { (eval echo configure:1392: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1392 ac_err=`grep -v '^ *+' conftest.out`
1393 if test -z "$ac_err"; then
1394   :
1395 else
1396   echo "$ac_err" >&5
1397   echo "configure: failed program was:" >&5
1398   cat conftest.$ac_ext >&5
1399   rm -rf conftest*
1400   CPP=/lib/cpp
1401 fi
1402 rm -f conftest*
1403 fi
1404 rm -f conftest*
1405   ac_cv_prog_CPP="$CPP"
1406 fi
1407   CPP="$ac_cv_prog_CPP"
1408 else
1409   ac_cv_prog_CPP="$CPP"
1410 fi
1411 echo "$ac_t""$CPP" 1>&6
1412
1413 if test $ac_cv_prog_gcc = yes; then
1414     echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
1415 echo "configure:1416: checking whether ${CC-cc} needs -traditional" >&5
1416 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
1417   echo $ac_n "(cached) $ac_c" 1>&6
1418 else
1419     ac_pattern="Autoconf.*'x'"
1420   cat > conftest.$ac_ext <<EOF
1421 #line 1422 "configure"
1422 #include "confdefs.h"
1423 #include <sgtty.h>
1424 Autoconf TIOCGETP
1425 EOF
1426 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1427   egrep "$ac_pattern" >/dev/null 2>&1; then
1428   rm -rf conftest*
1429   ac_cv_prog_gcc_traditional=yes
1430 else
1431   rm -rf conftest*
1432   ac_cv_prog_gcc_traditional=no
1433 fi
1434 rm -f conftest*
1435
1436
1437   if test $ac_cv_prog_gcc_traditional = no; then
1438     cat > conftest.$ac_ext <<EOF
1439 #line 1440 "configure"
1440 #include "confdefs.h"
1441 #include <termio.h>
1442 Autoconf TCGETA
1443 EOF
1444 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1445   egrep "$ac_pattern" >/dev/null 2>&1; then
1446   rm -rf conftest*
1447   ac_cv_prog_gcc_traditional=yes
1448 fi
1449 rm -f conftest*
1450
1451   fi
1452 fi
1453
1454 echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
1455   if test $ac_cv_prog_gcc_traditional = yes; then
1456     CC="$CC -traditional"
1457   fi
1458 fi
1459
1460
1461 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
1462 echo "configure:1463: checking whether ln -s works" >&5
1463 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
1464   echo $ac_n "(cached) $ac_c" 1>&6
1465 else
1466   rm -f conftestdata
1467 if ln -s X conftestdata 2>/dev/null
1468 then
1469   rm -f conftestdata
1470   ac_cv_prog_LN_S="ln -s"
1471 else
1472   ac_cv_prog_LN_S=ln
1473 fi
1474 fi
1475 LN_S="$ac_cv_prog_LN_S"
1476 if test "$ac_cv_prog_LN_S" = "ln -s"; then
1477   echo "$ac_t""yes" 1>&6
1478 else
1479   echo "$ac_t""no" 1>&6
1480 fi
1481
1482 # Find a good install program.  We prefer a C program (faster),
1483 # so one script is as good as another.  But avoid the broken or
1484 # incompatible versions:
1485 # SysV /etc/install, /usr/sbin/install
1486 # SunOS /usr/etc/install
1487 # IRIX /sbin/install
1488 # AIX /bin/install
1489 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1490 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1491 # ./install, which can be erroneously created by make from ./install.sh.
1492 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1493 echo "configure:1494: checking for a BSD compatible install" >&5
1494 if test -z "$INSTALL"; then
1495 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1496   echo $ac_n "(cached) $ac_c" 1>&6
1497 else
1498     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
1499   for ac_dir in $PATH; do
1500     # Account for people who put trailing slashes in PATH elements.
1501     case "$ac_dir/" in
1502     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1503     *)
1504       # OSF1 and SCO ODT 3.0 have their own names for install.
1505       for ac_prog in ginstall installbsd scoinst install; do
1506         if test -f $ac_dir/$ac_prog; then
1507           if test $ac_prog = install &&
1508             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1509             # AIX install.  It has an incompatible calling convention.
1510             # OSF/1 installbsd also uses dspmsg, but is usable.
1511             :
1512           else
1513             ac_cv_path_install="$ac_dir/$ac_prog -c"
1514             break 2
1515           fi
1516         fi
1517       done
1518       ;;
1519     esac
1520   done
1521   IFS="$ac_save_IFS"
1522
1523 fi
1524   if test "${ac_cv_path_install+set}" = set; then
1525     INSTALL="$ac_cv_path_install"
1526   else
1527     # As a last resort, use the slow shell script.  We don't cache a
1528     # path for INSTALL within a source directory, because that will
1529     # break other packages using the cache if that directory is
1530     # removed, or if the path is relative.
1531     INSTALL="$ac_install_sh"
1532   fi
1533 fi
1534 echo "$ac_t""$INSTALL" 1>&6
1535
1536 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1537 # It thinks the first close brace ends the variable substitution.
1538 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1539
1540 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1541
1542 # Extract the first word of "ranlib", so it can be a program name with args.
1543 set dummy ranlib; ac_word=$2
1544 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1545 echo "configure:1546: checking for $ac_word" >&5
1546 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1547   echo $ac_n "(cached) $ac_c" 1>&6
1548 else
1549   if test -n "$RANLIB"; then
1550   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1551 else
1552   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1553   for ac_dir in $PATH; do
1554     test -z "$ac_dir" && ac_dir=.
1555     if test -f $ac_dir/$ac_word; then
1556       ac_cv_prog_RANLIB="ranlib"
1557       break
1558     fi
1559   done
1560   IFS="$ac_save_ifs"
1561   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1562 fi
1563 fi
1564 RANLIB="$ac_cv_prog_RANLIB"
1565 if test -n "$RANLIB"; then
1566   echo "$ac_t""$RANLIB" 1>&6
1567 else
1568   echo "$ac_t""no" 1>&6
1569 fi
1570
1571 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1572 echo "configure:1573: checking whether ${MAKE-make} sets \${MAKE}" >&5
1573 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1574 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
1575   echo $ac_n "(cached) $ac_c" 1>&6
1576 else
1577   cat > conftestmake <<\EOF
1578 all:
1579         @echo 'ac_maketemp="${MAKE}"'
1580 EOF
1581 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1582 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1583 if test -n "$ac_maketemp"; then
1584   eval ac_cv_prog_make_${ac_make}_set=yes
1585 else
1586   eval ac_cv_prog_make_${ac_make}_set=no
1587 fi
1588 rm -f conftestmake
1589 fi
1590 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1591   echo "$ac_t""yes" 1>&6
1592   SET_MAKE=
1593 else
1594   echo "$ac_t""no" 1>&6
1595   SET_MAKE="MAKE=${MAKE-make}"
1596 fi
1597
1598
1599 # Extract the first word of "sendmail", so it can be a program name with args.
1600 set dummy sendmail; ac_word=$2
1601 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1602 echo "configure:1603: checking for $ac_word" >&5
1603 if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then
1604   echo $ac_n "(cached) $ac_c" 1>&6
1605 else
1606   case "$SENDMAIL" in
1607   /*)
1608   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
1609   ;;
1610   *)
1611   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1612   for ac_dir in $PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc$ac_dummy; do
1613     test -z "$ac_dir" && ac_dir=.
1614     if test -f $ac_dir/$ac_word; then
1615       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
1616       break
1617     fi
1618   done
1619   IFS="$ac_save_ifs"
1620   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
1621   ;;
1622 esac
1623 fi
1624 SENDMAIL="$ac_cv_path_SENDMAIL"
1625 if test -n "$SENDMAIL"; then
1626   echo "$ac_t""$SENDMAIL" 1>&6
1627 else
1628   echo "$ac_t""no" 1>&6
1629 fi
1630
1631 # Extract the first word of "vi", so it can be a program name with args.
1632 set dummy vi; ac_word=$2
1633 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1634 echo "configure:1635: checking for $ac_word" >&5
1635 if eval "test \"`echo '$''{'ac_cv_path_EDITOR'+set}'`\" = set"; then
1636   echo $ac_n "(cached) $ac_c" 1>&6
1637 else
1638   case "$EDITOR" in
1639   /*)
1640   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
1641   ;;
1642   *)
1643   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1644   for ac_dir in $PATH:/usr/ucb$ac_dummy; do
1645     test -z "$ac_dir" && ac_dir=.
1646     if test -f $ac_dir/$ac_word; then
1647       ac_cv_path_EDITOR="$ac_dir/$ac_word"
1648       break
1649     fi
1650   done
1651   IFS="$ac_save_ifs"
1652   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
1653   ;;
1654 esac
1655 fi
1656 EDITOR="$ac_cv_path_EDITOR"
1657 if test -n "$EDITOR"; then
1658   echo "$ac_t""$EDITOR" 1>&6
1659 else
1660   echo "$ac_t""no" 1>&6
1661 fi
1662
1663 # Extract the first word of "finger", so it can be a program name with args.
1664 set dummy finger; ac_word=$2
1665 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1666 echo "configure:1667: checking for $ac_word" >&5
1667 if eval "test \"`echo '$''{'ac_cv_path_FINGER'+set}'`\" = set"; then
1668   echo $ac_n "(cached) $ac_c" 1>&6
1669 else
1670   case "$FINGER" in
1671   /*)
1672   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
1673   ;;
1674   *)
1675   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1676   for ac_dir in $PATH:/usr/ucb$ac_dummy; do
1677     test -z "$ac_dir" && ac_dir=.
1678     if test -f $ac_dir/$ac_word; then
1679       ac_cv_path_FINGER="$ac_dir/$ac_word"
1680       break
1681     fi
1682   done
1683   IFS="$ac_save_ifs"
1684   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
1685   ;;
1686 esac
1687 fi
1688 FINGER="$ac_cv_path_FINGER"
1689 if test -n "$FINGER"; then
1690   echo "$ac_t""$FINGER" 1>&6
1691 else
1692   echo "$ac_t""no" 1>&6
1693 fi
1694
1695
1696
1697 echo $ac_n "checking for socket""... $ac_c" 1>&6
1698 echo "configure:1699: checking for socket" >&5
1699 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
1700   echo $ac_n "(cached) $ac_c" 1>&6
1701 else
1702   cat > conftest.$ac_ext <<EOF
1703 #line 1704 "configure"
1704 #include "confdefs.h"
1705 /* System header to define __stub macros and hopefully few prototypes,
1706     which can conflict with char socket(); below.  */
1707 #include <assert.h>
1708 /* Override any gcc2 internal prototype to avoid an error.  */
1709 /* We use char because int might match the return type of a gcc2
1710     builtin and then its argument prototype would still apply.  */
1711 char socket();
1712
1713 int main() {
1714
1715 /* The GNU C library defines this for functions which it implements
1716     to always fail with ENOSYS.  Some functions are actually named
1717     something starting with __ and the normal name is an alias.  */
1718 #if defined (__stub_socket) || defined (__stub___socket)
1719 choke me
1720 #else
1721 socket();
1722 #endif
1723
1724 ; return 0; }
1725 EOF
1726 if { (eval echo configure:1727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1727   rm -rf conftest*
1728   eval "ac_cv_func_socket=yes"
1729 else
1730   echo "configure: failed program was:" >&5
1731   cat conftest.$ac_ext >&5
1732   rm -rf conftest*
1733   eval "ac_cv_func_socket=no"
1734 fi
1735 rm -f conftest*
1736 fi
1737
1738 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
1739   echo "$ac_t""yes" 1>&6
1740   :
1741 else
1742   echo "$ac_t""no" 1>&6
1743         echo $ac_n "checking for gethostname in -lnsl""... $ac_c" 1>&6
1744 echo "configure:1745: checking for gethostname in -lnsl" >&5
1745 ac_lib_var=`echo nsl'_'gethostname | sed 'y%./+-%__p_%'`
1746 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1747   echo $ac_n "(cached) $ac_c" 1>&6
1748 else
1749   ac_save_LIBS="$LIBS"
1750 LIBS="-lnsl  $LIBS"
1751 cat > conftest.$ac_ext <<EOF
1752 #line 1753 "configure"
1753 #include "confdefs.h"
1754 /* Override any gcc2 internal prototype to avoid an error.  */
1755 /* We use char because int might match the return type of a gcc2
1756     builtin and then its argument prototype would still apply.  */
1757 char gethostname();
1758
1759 int main() {
1760 gethostname()
1761 ; return 0; }
1762 EOF
1763 if { (eval echo configure:1764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1764   rm -rf conftest*
1765   eval "ac_cv_lib_$ac_lib_var=yes"
1766 else
1767   echo "configure: failed program was:" >&5
1768   cat conftest.$ac_ext >&5
1769   rm -rf conftest*
1770   eval "ac_cv_lib_$ac_lib_var=no"
1771 fi
1772 rm -f conftest*
1773 LIBS="$ac_save_LIBS"
1774
1775 fi
1776 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1777   echo "$ac_t""yes" 1>&6
1778     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1779     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1780   cat >> confdefs.h <<EOF
1781 #define $ac_tr_lib 1
1782 EOF
1783
1784   LIBS="-lnsl $LIBS"
1785
1786 else
1787   echo "$ac_t""no" 1>&6
1788 fi
1789
1790         echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
1791 echo "configure:1792: checking for socket in -lsocket" >&5
1792 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
1793 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1794   echo $ac_n "(cached) $ac_c" 1>&6
1795 else
1796   ac_save_LIBS="$LIBS"
1797 LIBS="-lsocket  $LIBS"
1798 cat > conftest.$ac_ext <<EOF
1799 #line 1800 "configure"
1800 #include "confdefs.h"
1801 /* Override any gcc2 internal prototype to avoid an error.  */
1802 /* We use char because int might match the return type of a gcc2
1803     builtin and then its argument prototype would still apply.  */
1804 char socket();
1805
1806 int main() {
1807 socket()
1808 ; return 0; }
1809 EOF
1810 if { (eval echo configure:1811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1811   rm -rf conftest*
1812   eval "ac_cv_lib_$ac_lib_var=yes"
1813 else
1814   echo "configure: failed program was:" >&5
1815   cat conftest.$ac_ext >&5
1816   rm -rf conftest*
1817   eval "ac_cv_lib_$ac_lib_var=no"
1818 fi
1819 rm -f conftest*
1820 LIBS="$ac_save_LIBS"
1821
1822 fi
1823 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1824   echo "$ac_t""yes" 1>&6
1825     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1826     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1827   cat >> confdefs.h <<EOF
1828 #define $ac_tr_lib 1
1829 EOF
1830
1831   LIBS="-lsocket $LIBS"
1832
1833 else
1834   echo "$ac_t""no" 1>&6
1835 fi
1836
1837         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
1838 echo "configure:1839: checking for socket in -linet" >&5
1839 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
1840 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1841   echo $ac_n "(cached) $ac_c" 1>&6
1842 else
1843   ac_save_LIBS="$LIBS"
1844 LIBS="-linet  $LIBS"
1845 cat > conftest.$ac_ext <<EOF
1846 #line 1847 "configure"
1847 #include "confdefs.h"
1848 /* Override any gcc2 internal prototype to avoid an error.  */
1849 /* We use char because int might match the return type of a gcc2
1850     builtin and then its argument prototype would still apply.  */
1851 char socket();
1852
1853 int main() {
1854 socket()
1855 ; return 0; }
1856 EOF
1857 if { (eval echo configure:1858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1858   rm -rf conftest*
1859   eval "ac_cv_lib_$ac_lib_var=yes"
1860 else
1861   echo "configure: failed program was:" >&5
1862   cat conftest.$ac_ext >&5
1863   rm -rf conftest*
1864   eval "ac_cv_lib_$ac_lib_var=no"
1865 fi
1866 rm -f conftest*
1867 LIBS="$ac_save_LIBS"
1868
1869 fi
1870 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1871   echo "$ac_t""yes" 1>&6
1872     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1873     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1874   cat >> confdefs.h <<EOF
1875 #define $ac_tr_lib 1
1876 EOF
1877
1878   LIBS="-linet $LIBS"
1879
1880 else
1881   echo "$ac_t""no" 1>&6
1882 fi
1883
1884
1885 fi
1886
1887
1888 ol_link_threads=no
1889 if test $ol_with_threads = auto -o $ol_with_threads = posix ; then
1890         for ac_hdr in pthread.h sched.h
1891 do
1892 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1893 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1894 echo "configure:1895: checking for $ac_hdr" >&5
1895 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1896   echo $ac_n "(cached) $ac_c" 1>&6
1897 else
1898   cat > conftest.$ac_ext <<EOF
1899 #line 1900 "configure"
1900 #include "confdefs.h"
1901 #include <$ac_hdr>
1902 EOF
1903 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1904 { (eval echo configure:1905: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1905 ac_err=`grep -v '^ *+' conftest.out`
1906 if test -z "$ac_err"; then
1907   rm -rf conftest*
1908   eval "ac_cv_header_$ac_safe=yes"
1909 else
1910   echo "$ac_err" >&5
1911   echo "configure: failed program was:" >&5
1912   cat conftest.$ac_ext >&5
1913   rm -rf conftest*
1914   eval "ac_cv_header_$ac_safe=no"
1915 fi
1916 rm -f conftest*
1917 fi
1918 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1919   echo "$ac_t""yes" 1>&6
1920     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1921   cat >> confdefs.h <<EOF
1922 #define $ac_tr_hdr 1
1923 EOF
1924  
1925 else
1926   echo "$ac_t""no" 1>&6
1927 fi
1928 done
1929
1930
1931         if test "$ac_cv_header_pthread_h" = yes ; then
1932                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
1933 echo "configure:1934: checking POSIX thread version" >&5
1934 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
1935   echo $ac_n "(cached) $ac_c" 1>&6
1936 else
1937   
1938         cat > conftest.$ac_ext <<EOF
1939 #line 1940 "configure"
1940 #include "confdefs.h"
1941
1942 #               include <pthread.h>
1943                 /* this check could be improved */
1944 #               ifdef PTHREAD_ONCE_INIT
1945                         final
1946 #               endif
1947         
1948 EOF
1949 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1950   egrep "final" >/dev/null 2>&1; then
1951   rm -rf conftest*
1952   ol_pthread_final=yes
1953 else
1954   rm -rf conftest*
1955   ol_pthread_final=no
1956 fi
1957 rm -f conftest*
1958
1959
1960         cat > conftest.$ac_ext <<EOF
1961 #line 1962 "configure"
1962 #include "confdefs.h"
1963
1964 #               include <pthread.h>
1965                 /* this check could be improved */
1966 #               ifdef pthread_once_init
1967                         draft4
1968 #               endif
1969         
1970 EOF
1971 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1972   egrep "draft4" >/dev/null 2>&1; then
1973   rm -rf conftest*
1974   ol_pthread_draft4=yes
1975 else
1976   rm -rf conftest*
1977   ol_pthread_draft4=no
1978 fi
1979 rm -f conftest*
1980
1981
1982         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
1983                 ol_cv_pthread_version=final
1984         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
1985                 ol_cv_pthread_version=draft4
1986         else
1987                 ol_cv_pthread_version=unknown
1988         fi
1989
1990 fi
1991
1992 echo "$ac_t""$ol_cv_pthread_version" 1>&6
1993
1994
1995                 if test $ol_cv_pthread_version = final ; then
1996                         LTHREAD_DEFS="$LTHREAD_DEFS -DPOSIX_THREADS"
1997                 elif test $ol_cv_pthread_version = draft4 ; then
1998                         LTHREAD_DEFS="$LTHREAD_DEFS -DTHREAD_MIT_PTHREADS"
1999                 else
2000                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
2001                 fi
2002
2003                 # consider threads found
2004                 ol_with_threads=found
2005
2006                 
2007 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
2008 echo "configure:2009: checking for LinuxThreads" >&5
2009 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
2010   echo $ac_n "(cached) $ac_c" 1>&6
2011 else
2012   
2013         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
2014         if test "$res" -gt 0 ; then
2015                 ol_cv_linux_threads=yes
2016         else
2017                 ol_cv_linux_threads=no
2018         fi
2019
2020 fi
2021
2022 echo "$ac_t""$ol_cv_linux_threads" 1>&6
2023
2024
2025                 if test $ol_cv_linux_threads = yes ; then
2026                         LTHREAD_DEFS="$LTHREAD_DEFS -DHAVE_LINUX_THREADS"
2027                 fi
2028
2029                 
2030                                 echo $ac_n "checking for pthread_create""... $ac_c" 1>&6
2031 echo "configure:2032: checking for pthread_create" >&5
2032 if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then
2033   echo $ac_n "(cached) $ac_c" 1>&6
2034 else
2035   cat > conftest.$ac_ext <<EOF
2036 #line 2037 "configure"
2037 #include "confdefs.h"
2038 /* System header to define __stub macros and hopefully few prototypes,
2039     which can conflict with char pthread_create(); below.  */
2040 #include <assert.h>
2041 /* Override any gcc2 internal prototype to avoid an error.  */
2042 /* We use char because int might match the return type of a gcc2
2043     builtin and then its argument prototype would still apply.  */
2044 char pthread_create();
2045
2046 int main() {
2047
2048 /* The GNU C library defines this for functions which it implements
2049     to always fail with ENOSYS.  Some functions are actually named
2050     something starting with __ and the normal name is an alias.  */
2051 #if defined (__stub_pthread_create) || defined (__stub___pthread_create)
2052 choke me
2053 #else
2054 pthread_create();
2055 #endif
2056
2057 ; return 0; }
2058 EOF
2059 if { (eval echo configure:2060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2060   rm -rf conftest*
2061   eval "ac_cv_func_pthread_create=yes"
2062 else
2063   echo "configure: failed program was:" >&5
2064   cat conftest.$ac_ext >&5
2065   rm -rf conftest*
2066   eval "ac_cv_func_pthread_create=no"
2067 fi
2068 rm -f conftest*
2069 fi
2070
2071 if eval "test \"`echo '$ac_cv_func_'pthread_create`\" = yes"; then
2072   echo "$ac_t""yes" 1>&6
2073   ol_link_threads=yes
2074 else
2075   echo "$ac_t""no" 1>&6
2076 fi
2077
2078
2079                 if test $ol_link_threads = no ; then
2080                                                 echo $ac_n "checking for pthread_create with -pthread""... $ac_c" 1>&6
2081 echo "configure:2082: checking for pthread_create with -pthread" >&5
2082 if eval "test \"`echo '$''{'ol_cv_pthread_flag'+set}'`\" = set"; then
2083   echo $ac_n "(cached) $ac_c" 1>&6
2084 else
2085   
2086                                                                 save_LIBS="$LIBS"
2087                                 LIBS="-pthread $LIBS"
2088                                 cat > conftest.$ac_ext <<EOF
2089 #line 2090 "configure"
2090 #include "confdefs.h"
2091 #include <pthread.h>
2092 int main() {
2093
2094                                         pthread_create((pthread_t*) 0,
2095                                                 (pthread_attr_t*) 0, 0, 0);
2096                                         
2097 ; return 0; }
2098 EOF
2099 if { (eval echo configure:2100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2100   rm -rf conftest*
2101   ol_cv_pthread_flag=yes
2102 else
2103   echo "configure: failed program was:" >&5
2104   cat conftest.$ac_ext >&5
2105   rm -rf conftest*
2106   ol_cv_pthread_flag=no
2107 fi
2108 rm -f conftest*
2109                                                                 LIBS="$save_LIBS"
2110                         
2111 fi
2112
2113 echo "$ac_t""$ol_cv_pthread_flag" 1>&6
2114
2115                         if test $ol_cv_pthread_flag = yes ; then
2116                                 LTHREAD_LIBS="$LTHREAD_LIBS -pthread"
2117                                 ol_link_threads=posix
2118                         fi
2119                 fi
2120
2121                 if test $ol_link_threads = no ; then
2122                                                 save_LIBS="$LIBS"
2123                         echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
2124 echo "configure:2125: checking for pthread_create in -lpthread" >&5
2125 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
2126 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2127   echo $ac_n "(cached) $ac_c" 1>&6
2128 else
2129   ac_save_LIBS="$LIBS"
2130 LIBS="-lpthread  $LIBS"
2131 cat > conftest.$ac_ext <<EOF
2132 #line 2133 "configure"
2133 #include "confdefs.h"
2134 /* Override any gcc2 internal prototype to avoid an error.  */
2135 /* We use char because int might match the return type of a gcc2
2136     builtin and then its argument prototype would still apply.  */
2137 char pthread_create();
2138
2139 int main() {
2140 pthread_create()
2141 ; return 0; }
2142 EOF
2143 if { (eval echo configure:2144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2144   rm -rf conftest*
2145   eval "ac_cv_lib_$ac_lib_var=yes"
2146 else
2147   echo "configure: failed program was:" >&5
2148   cat conftest.$ac_ext >&5
2149   rm -rf conftest*
2150   eval "ac_cv_lib_$ac_lib_var=no"
2151 fi
2152 rm -f conftest*
2153 LIBS="$ac_save_LIBS"
2154
2155 fi
2156 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2157   echo "$ac_t""yes" 1>&6
2158   
2159                                 ol_link_threads=posix
2160                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
2161 else
2162   echo "$ac_t""no" 1>&6
2163 fi
2164
2165                         LIBS="$save_LIBS"
2166                 fi
2167
2168                 if test $ol_link_threads = no ; then
2169                                                 save_LIBS="$LIBS"
2170                         echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
2171 echo "configure:2172: checking for pthread_create in -lc_r" >&5
2172 ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
2173 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2174   echo $ac_n "(cached) $ac_c" 1>&6
2175 else
2176   ac_save_LIBS="$LIBS"
2177 LIBS="-lc_r  $LIBS"
2178 cat > conftest.$ac_ext <<EOF
2179 #line 2180 "configure"
2180 #include "confdefs.h"
2181 /* Override any gcc2 internal prototype to avoid an error.  */
2182 /* We use char because int might match the return type of a gcc2
2183     builtin and then its argument prototype would still apply.  */
2184 char pthread_create();
2185
2186 int main() {
2187 pthread_create()
2188 ; return 0; }
2189 EOF
2190 if { (eval echo configure:2191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2191   rm -rf conftest*
2192   eval "ac_cv_lib_$ac_lib_var=yes"
2193 else
2194   echo "configure: failed program was:" >&5
2195   cat conftest.$ac_ext >&5
2196   rm -rf conftest*
2197   eval "ac_cv_lib_$ac_lib_var=no"
2198 fi
2199 rm -f conftest*
2200 LIBS="$ac_save_LIBS"
2201
2202 fi
2203 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2204   echo "$ac_t""yes" 1>&6
2205   
2206                                 ol_link_threads=posix
2207                                 LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"
2208 else
2209   echo "$ac_t""no" 1>&6
2210 fi
2211
2212                         LIBS="$save_LIBS"
2213                 fi
2214
2215                 if test $ol_link_threads = no ; then
2216                                                 save_LIBS="$LIBS"
2217                         echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
2218 echo "configure:2219: checking for pthread_create in -lpthread" >&5
2219 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
2220 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2221   echo $ac_n "(cached) $ac_c" 1>&6
2222 else
2223   ac_save_LIBS="$LIBS"
2224 LIBS="-lpthread -lmach -lexc -lc $LIBS"
2225 cat > conftest.$ac_ext <<EOF
2226 #line 2227 "configure"
2227 #include "confdefs.h"
2228 /* Override any gcc2 internal prototype to avoid an error.  */
2229 /* We use char because int might match the return type of a gcc2
2230     builtin and then its argument prototype would still apply.  */
2231 char pthread_create();
2232
2233 int main() {
2234 pthread_create()
2235 ; return 0; }
2236 EOF
2237 if { (eval echo configure:2238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2238   rm -rf conftest*
2239   eval "ac_cv_lib_$ac_lib_var=yes"
2240 else
2241   echo "configure: failed program was:" >&5
2242   cat conftest.$ac_ext >&5
2243   rm -rf conftest*
2244   eval "ac_cv_lib_$ac_lib_var=no"
2245 fi
2246 rm -f conftest*
2247 LIBS="$ac_save_LIBS"
2248
2249 fi
2250 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2251   echo "$ac_t""yes" 1>&6
2252   
2253                                 ol_link_threads=posix
2254                                 LTHREAD_DEFS="$LTHREAD_DEFS -DDEC_THREADS"
2255                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc -lc"
2256 else
2257   echo "$ac_t""no" 1>&6
2258 fi
2259
2260                         LIBS="$save_LIBS"
2261                 fi
2262
2263                 if test $ol_link_threads != no ; then
2264                                                                                                 for ac_func in sched_yield pthread_yield
2265 do
2266 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2267 echo "configure:2268: checking for $ac_func" >&5
2268 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2269   echo $ac_n "(cached) $ac_c" 1>&6
2270 else
2271   cat > conftest.$ac_ext <<EOF
2272 #line 2273 "configure"
2273 #include "confdefs.h"
2274 /* System header to define __stub macros and hopefully few prototypes,
2275     which can conflict with char $ac_func(); below.  */
2276 #include <assert.h>
2277 /* Override any gcc2 internal prototype to avoid an error.  */
2278 /* We use char because int might match the return type of a gcc2
2279     builtin and then its argument prototype would still apply.  */
2280 char $ac_func();
2281
2282 int main() {
2283
2284 /* The GNU C library defines this for functions which it implements
2285     to always fail with ENOSYS.  Some functions are actually named
2286     something starting with __ and the normal name is an alias.  */
2287 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2288 choke me
2289 #else
2290 $ac_func();
2291 #endif
2292
2293 ; return 0; }
2294 EOF
2295 if { (eval echo configure:2296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2296   rm -rf conftest*
2297   eval "ac_cv_func_$ac_func=yes"
2298 else
2299   echo "configure: failed program was:" >&5
2300   cat conftest.$ac_ext >&5
2301   rm -rf conftest*
2302   eval "ac_cv_func_$ac_func=no"
2303 fi
2304 rm -f conftest*
2305 fi
2306
2307 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2308   echo "$ac_t""yes" 1>&6
2309     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2310   cat >> confdefs.h <<EOF
2311 #define $ac_tr_func 1
2312 EOF
2313  
2314 else
2315   echo "$ac_t""no" 1>&6
2316 fi
2317 done
2318
2319
2320                         if test $ac_cv_func_sched_yield = no -a \
2321                                 $ac_cv_func_pthread_yield = no ; then
2322
2323                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
2324                                 { echo "configure: error: POSIX Threads are not usable" 1>&2; exit 1; }
2325                         fi
2326                 else
2327                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
2328                 fi
2329         fi
2330
2331         if test $ol_with_threads = posix ; then
2332                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
2333         fi
2334 fi
2335
2336 if test $ol_with_threads = manual ; then
2337                 $ol_link_threads=yes
2338
2339         echo "configure: warning: thread defines and link options must be set manually" 1>&2
2340
2341         for ac_hdr in pthread.h sched.h
2342 do
2343 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2344 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2345 echo "configure:2346: checking for $ac_hdr" >&5
2346 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2347   echo $ac_n "(cached) $ac_c" 1>&6
2348 else
2349   cat > conftest.$ac_ext <<EOF
2350 #line 2351 "configure"
2351 #include "confdefs.h"
2352 #include <$ac_hdr>
2353 EOF
2354 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2355 { (eval echo configure:2356: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2356 ac_err=`grep -v '^ *+' conftest.out`
2357 if test -z "$ac_err"; then
2358   rm -rf conftest*
2359   eval "ac_cv_header_$ac_safe=yes"
2360 else
2361   echo "$ac_err" >&5
2362   echo "configure: failed program was:" >&5
2363   cat conftest.$ac_ext >&5
2364   rm -rf conftest*
2365   eval "ac_cv_header_$ac_safe=no"
2366 fi
2367 rm -f conftest*
2368 fi
2369 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2370   echo "$ac_t""yes" 1>&6
2371     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2372   cat >> confdefs.h <<EOF
2373 #define $ac_tr_hdr 1
2374 EOF
2375  
2376 else
2377   echo "$ac_t""no" 1>&6
2378 fi
2379 done
2380
2381         for ac_func in sched_yield pthread_yield
2382 do
2383 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2384 echo "configure:2385: checking for $ac_func" >&5
2385 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2386   echo $ac_n "(cached) $ac_c" 1>&6
2387 else
2388   cat > conftest.$ac_ext <<EOF
2389 #line 2390 "configure"
2390 #include "confdefs.h"
2391 /* System header to define __stub macros and hopefully few prototypes,
2392     which can conflict with char $ac_func(); below.  */
2393 #include <assert.h>
2394 /* Override any gcc2 internal prototype to avoid an error.  */
2395 /* We use char because int might match the return type of a gcc2
2396     builtin and then its argument prototype would still apply.  */
2397 char $ac_func();
2398
2399 int main() {
2400
2401 /* The GNU C library defines this for functions which it implements
2402     to always fail with ENOSYS.  Some functions are actually named
2403     something starting with __ and the normal name is an alias.  */
2404 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2405 choke me
2406 #else
2407 $ac_func();
2408 #endif
2409
2410 ; return 0; }
2411 EOF
2412 if { (eval echo configure:2413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2413   rm -rf conftest*
2414   eval "ac_cv_func_$ac_func=yes"
2415 else
2416   echo "configure: failed program was:" >&5
2417   cat conftest.$ac_ext >&5
2418   rm -rf conftest*
2419   eval "ac_cv_func_$ac_func=no"
2420 fi
2421 rm -f conftest*
2422 fi
2423
2424 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2425   echo "$ac_t""yes" 1>&6
2426     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2427   cat >> confdefs.h <<EOF
2428 #define $ac_tr_func 1
2429 EOF
2430  
2431 else
2432   echo "$ac_t""no" 1>&6
2433 fi
2434 done
2435
2436         
2437 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
2438 echo "configure:2439: checking for LinuxThreads" >&5
2439 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
2440   echo $ac_n "(cached) $ac_c" 1>&6
2441 else
2442   
2443         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
2444         if test "$res" -gt 0 ; then
2445                 ol_cv_linux_threads=yes
2446         else
2447                 ol_cv_linux_threads=no
2448         fi
2449
2450 fi
2451
2452 echo "$ac_t""$ol_cv_linux_threads" 1>&6
2453
2454 fi
2455
2456 if test $ol_link_threads = no ; then
2457         if test $ol_with_threads = yes ; then
2458                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
2459         fi
2460
2461         if test $ol_with_threads = auto ; then
2462                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
2463                 $ol_with_threads = no
2464         fi
2465
2466         LTHREAD_DEFS="-DNO_THREADS"
2467         LTHREAD_LIBS=""
2468 fi
2469
2470 ol_link_ldbm=no 
2471 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
2472         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
2473 echo "configure:2474: checking for DB2 library" >&5
2474 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
2475   echo $ac_n "(cached) $ac_c" 1>&6
2476 else
2477         ol_LIBS="$LIBS"
2478         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
2479 echo "configure:2480: checking for db_open in -ldb" >&5
2480 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
2481 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2482   echo $ac_n "(cached) $ac_c" 1>&6
2483 else
2484   ac_save_LIBS="$LIBS"
2485 LIBS="-ldb  $LIBS"
2486 cat > conftest.$ac_ext <<EOF
2487 #line 2488 "configure"
2488 #include "confdefs.h"
2489 /* Override any gcc2 internal prototype to avoid an error.  */
2490 /* We use char because int might match the return type of a gcc2
2491     builtin and then its argument prototype would still apply.  */
2492 char db_open();
2493
2494 int main() {
2495 db_open()
2496 ; return 0; }
2497 EOF
2498 if { (eval echo configure:2499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2499   rm -rf conftest*
2500   eval "ac_cv_lib_$ac_lib_var=yes"
2501 else
2502   echo "configure: failed program was:" >&5
2503   cat conftest.$ac_ext >&5
2504   rm -rf conftest*
2505   eval "ac_cv_lib_$ac_lib_var=no"
2506 fi
2507 rm -f conftest*
2508 LIBS="$ac_save_LIBS"
2509
2510 fi
2511 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2512   echo "$ac_t""yes" 1>&6
2513   ol_cv_lib_db2=-ldb
2514 else
2515   echo "$ac_t""no" 1>&6
2516 ol_cv_lib_db2=no
2517 fi
2518
2519         LIBS="$ol_LIBS"
2520
2521 fi
2522
2523 echo "$ac_t""$ol_cv_lib_db2" 1>&6
2524
2525 for ac_hdr in db.h
2526 do
2527 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2528 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2529 echo "configure:2530: checking for $ac_hdr" >&5
2530 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2531   echo $ac_n "(cached) $ac_c" 1>&6
2532 else
2533   cat > conftest.$ac_ext <<EOF
2534 #line 2535 "configure"
2535 #include "confdefs.h"
2536 #include <$ac_hdr>
2537 EOF
2538 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2539 { (eval echo configure:2540: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2540 ac_err=`grep -v '^ *+' conftest.out`
2541 if test -z "$ac_err"; then
2542   rm -rf conftest*
2543   eval "ac_cv_header_$ac_safe=yes"
2544 else
2545   echo "$ac_err" >&5
2546   echo "configure: failed program was:" >&5
2547   cat conftest.$ac_ext >&5
2548   rm -rf conftest*
2549   eval "ac_cv_header_$ac_safe=no"
2550 fi
2551 rm -f conftest*
2552 fi
2553 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2554   echo "$ac_t""yes" 1>&6
2555     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2556   cat >> confdefs.h <<EOF
2557 #define $ac_tr_hdr 1
2558 EOF
2559  
2560 else
2561   echo "$ac_t""no" 1>&6
2562 fi
2563 done
2564
2565 if test $ac_cv_header_db_h = yes ; then
2566         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
2567 echo "configure:2568: checking if db.h is DB2" >&5
2568 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
2569   echo $ac_n "(cached) $ac_c" 1>&6
2570 else
2571   
2572                 cat > conftest.$ac_ext <<EOF
2573 #line 2574 "configure"
2574 #include "confdefs.h"
2575
2576 #                       include <db.h>
2577                         /* this check could be improved */
2578 #                       ifdef DB_VERSION_MAJOR
2579 #                               if DB_VERSION_MAJOR == 2
2580                                         __db_version_2
2581 #                               endif
2582 #                       endif
2583                 
2584 EOF
2585 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2586   egrep "__db_version_2" >/dev/null 2>&1; then
2587   rm -rf conftest*
2588   ol_cv_header_db2=yes
2589 else
2590   rm -rf conftest*
2591   ol_cv_header_db2=no
2592 fi
2593 rm -f conftest*
2594
2595 fi
2596
2597 echo "$ac_t""$ol_cv_header_db2" 1>&6
2598 else
2599         ol_cv_header_db2=no
2600 fi
2601
2602
2603  
2604  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
2605 echo "configure:2606: checking for Berkeley DB2" >&5
2606 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
2607   echo $ac_n "(cached) $ac_c" 1>&6
2608 else
2609   
2610         if test $ol_cv_lib_db2 = no -o $ol_cv_header_db2 = no ; then
2611                 ol_cv_berkeley_db2=no
2612         else
2613                 ol_cv_berkeley_db2=yes
2614         fi
2615
2616 fi
2617
2618 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
2619
2620
2621         if test $ol_cv_berkeley_db2 = yes ; then
2622                 ol_link_ldbm=db2
2623                 ol_with_ldbm_api=db2
2624
2625                 LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DB2"
2626
2627                 if test $ol_with_ldbm_type = hash ; then
2628                         LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DBHASH"
2629                 else
2630                         LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DBBTREE"
2631                 fi
2632
2633                                                 if test $ol_cv_lib_db2 != yes ; then
2634                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
2635                 fi
2636         fi
2637 fi
2638
2639 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
2640         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
2641 echo "configure:2642: checking for Berkeley DB library" >&5
2642 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
2643   echo $ac_n "(cached) $ac_c" 1>&6
2644 else
2645         ol_LIBS="$LIBS"
2646         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
2647 echo "configure:2648: checking for dbopen" >&5
2648 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
2649   echo $ac_n "(cached) $ac_c" 1>&6
2650 else
2651   cat > conftest.$ac_ext <<EOF
2652 #line 2653 "configure"
2653 #include "confdefs.h"
2654 /* System header to define __stub macros and hopefully few prototypes,
2655     which can conflict with char dbopen(); below.  */
2656 #include <assert.h>
2657 /* Override any gcc2 internal prototype to avoid an error.  */
2658 /* We use char because int might match the return type of a gcc2
2659     builtin and then its argument prototype would still apply.  */
2660 char dbopen();
2661
2662 int main() {
2663
2664 /* The GNU C library defines this for functions which it implements
2665     to always fail with ENOSYS.  Some functions are actually named
2666     something starting with __ and the normal name is an alias.  */
2667 #if defined (__stub_dbopen) || defined (__stub___dbopen)
2668 choke me
2669 #else
2670 dbopen();
2671 #endif
2672
2673 ; return 0; }
2674 EOF
2675 if { (eval echo configure:2676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2676   rm -rf conftest*
2677   eval "ac_cv_func_dbopen=yes"
2678 else
2679   echo "configure: failed program was:" >&5
2680   cat conftest.$ac_ext >&5
2681   rm -rf conftest*
2682   eval "ac_cv_func_dbopen=no"
2683 fi
2684 rm -f conftest*
2685 fi
2686
2687 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
2688   echo "$ac_t""yes" 1>&6
2689   ol_cv_lib_db=yes
2690 else
2691   echo "$ac_t""no" 1>&6
2692
2693                 echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
2694 echo "configure:2695: checking for dbopen in -ldb" >&5
2695 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
2696 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2697   echo $ac_n "(cached) $ac_c" 1>&6
2698 else
2699   ac_save_LIBS="$LIBS"
2700 LIBS="-ldb  $LIBS"
2701 cat > conftest.$ac_ext <<EOF
2702 #line 2703 "configure"
2703 #include "confdefs.h"
2704 /* Override any gcc2 internal prototype to avoid an error.  */
2705 /* We use char because int might match the return type of a gcc2
2706     builtin and then its argument prototype would still apply.  */
2707 char dbopen();
2708
2709 int main() {
2710 dbopen()
2711 ; return 0; }
2712 EOF
2713 if { (eval echo configure:2714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2714   rm -rf conftest*
2715   eval "ac_cv_lib_$ac_lib_var=yes"
2716 else
2717   echo "configure: failed program was:" >&5
2718   cat conftest.$ac_ext >&5
2719   rm -rf conftest*
2720   eval "ac_cv_lib_$ac_lib_var=no"
2721 fi
2722 rm -f conftest*
2723 LIBS="$ac_save_LIBS"
2724
2725 fi
2726 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2727   echo "$ac_t""yes" 1>&6
2728   ol_cv_lib_db=-ldb
2729 else
2730   echo "$ac_t""no" 1>&6
2731 ol_cv_lib_db=no
2732 fi
2733
2734         
2735 fi
2736
2737         LIBS="$ol_LIBS"
2738
2739 fi
2740
2741 echo "$ac_t""$ol_cv_lib_db" 1>&6
2742
2743
2744 for ac_hdr in db_185.h
2745 do
2746 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2747 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2748 echo "configure:2749: checking for $ac_hdr" >&5
2749 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2750   echo $ac_n "(cached) $ac_c" 1>&6
2751 else
2752   cat > conftest.$ac_ext <<EOF
2753 #line 2754 "configure"
2754 #include "confdefs.h"
2755 #include <$ac_hdr>
2756 EOF
2757 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2758 { (eval echo configure:2759: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2759 ac_err=`grep -v '^ *+' conftest.out`
2760 if test -z "$ac_err"; then
2761   rm -rf conftest*
2762   eval "ac_cv_header_$ac_safe=yes"
2763 else
2764   echo "$ac_err" >&5
2765   echo "configure: failed program was:" >&5
2766   cat conftest.$ac_ext >&5
2767   rm -rf conftest*
2768   eval "ac_cv_header_$ac_safe=no"
2769 fi
2770 rm -f conftest*
2771 fi
2772 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2773   echo "$ac_t""yes" 1>&6
2774     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2775   cat >> confdefs.h <<EOF
2776 #define $ac_tr_hdr 1
2777 EOF
2778  
2779 else
2780   echo "$ac_t""no" 1>&6
2781 fi
2782 done
2783
2784 if test $ol_cv_header_db2 = yes ; then
2785         
2786         ol_cv_header_db=$ac_cv_header_db_185_h
2787 else
2788         ol_cv_header_db=$ac_cv_header_db_h
2789 fi
2790
2791
2792  
2793  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
2794 echo "configure:2795: checking for Berkeley DB" >&5
2795 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
2796   echo $ac_n "(cached) $ac_c" 1>&6
2797 else
2798   
2799         if test $ol_cv_lib_db = no -o $ol_cv_header_db = no ; then
2800                 ol_cv_berkeley_db=no
2801         else
2802                 ol_cv_berkeley_db=yes
2803         fi
2804
2805 fi
2806
2807 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
2808
2809
2810         if test $ol_cv_berkeley_db = yes ; then
2811                 ol_link_ldbm=db
2812                 ol_with_ldbm_api=db
2813
2814                 if test $ac_cv_header_db_185_h = yes ; then
2815                         LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DB2_COMPAT185"
2816                 fi
2817
2818                 if test $ol_with_ldbm_type = hash ; then
2819                         LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DBHASH"
2820                 else
2821                         LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DBBTREE"
2822                 fi
2823
2824                                                 if test $ol_cv_lib_db != yes ; then
2825                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
2826                 fi
2827         fi
2828 fi
2829
2830 if test $ol_with_ldbm_api = manual ; then
2831                 $ol_link_ldbm=yes
2832
2833         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
2834
2835         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
2836 do
2837 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2838 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2839 echo "configure:2840: checking for $ac_hdr" >&5
2840 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2841   echo $ac_n "(cached) $ac_c" 1>&6
2842 else
2843   cat > conftest.$ac_ext <<EOF
2844 #line 2845 "configure"
2845 #include "confdefs.h"
2846 #include <$ac_hdr>
2847 EOF
2848 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2849 { (eval echo configure:2850: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2850 ac_err=`grep -v '^ *+' conftest.out`
2851 if test -z "$ac_err"; then
2852   rm -rf conftest*
2853   eval "ac_cv_header_$ac_safe=yes"
2854 else
2855   echo "$ac_err" >&5
2856   echo "configure: failed program was:" >&5
2857   cat conftest.$ac_ext >&5
2858   rm -rf conftest*
2859   eval "ac_cv_header_$ac_safe=no"
2860 fi
2861 rm -f conftest*
2862 fi
2863 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2864   echo "$ac_t""yes" 1>&6
2865     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2866   cat >> confdefs.h <<EOF
2867 #define $ac_tr_hdr 1
2868 EOF
2869  
2870 else
2871   echo "$ac_t""no" 1>&6
2872 fi
2873 done
2874
2875 fi
2876
2877 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
2878         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2;
2879         $ol_with_ldbm_api=none
2880 fi
2881
2882 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
2883         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
2884 echo "configure:2885: checking for GDBM library" >&5
2885 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
2886   echo $ac_n "(cached) $ac_c" 1>&6
2887 else
2888         ol_LIBS="$LIBS"
2889         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
2890 echo "configure:2891: checking for gdbm_open" >&5
2891 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
2892   echo $ac_n "(cached) $ac_c" 1>&6
2893 else
2894   cat > conftest.$ac_ext <<EOF
2895 #line 2896 "configure"
2896 #include "confdefs.h"
2897 /* System header to define __stub macros and hopefully few prototypes,
2898     which can conflict with char gdbm_open(); below.  */
2899 #include <assert.h>
2900 /* Override any gcc2 internal prototype to avoid an error.  */
2901 /* We use char because int might match the return type of a gcc2
2902     builtin and then its argument prototype would still apply.  */
2903 char gdbm_open();
2904
2905 int main() {
2906
2907 /* The GNU C library defines this for functions which it implements
2908     to always fail with ENOSYS.  Some functions are actually named
2909     something starting with __ and the normal name is an alias.  */
2910 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
2911 choke me
2912 #else
2913 gdbm_open();
2914 #endif
2915
2916 ; return 0; }
2917 EOF
2918 if { (eval echo configure:2919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2919   rm -rf conftest*
2920   eval "ac_cv_func_gdbm_open=yes"
2921 else
2922   echo "configure: failed program was:" >&5
2923   cat conftest.$ac_ext >&5
2924   rm -rf conftest*
2925   eval "ac_cv_func_gdbm_open=no"
2926 fi
2927 rm -f conftest*
2928 fi
2929
2930 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
2931   echo "$ac_t""yes" 1>&6
2932   ol_cv_lib_gdbm=yes
2933 else
2934   echo "$ac_t""no" 1>&6
2935
2936                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
2937 echo "configure:2938: checking for gdbm_open in -lgdbm" >&5
2938 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
2939 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2940   echo $ac_n "(cached) $ac_c" 1>&6
2941 else
2942   ac_save_LIBS="$LIBS"
2943 LIBS="-lgdbm  $LIBS"
2944 cat > conftest.$ac_ext <<EOF
2945 #line 2946 "configure"
2946 #include "confdefs.h"
2947 /* Override any gcc2 internal prototype to avoid an error.  */
2948 /* We use char because int might match the return type of a gcc2
2949     builtin and then its argument prototype would still apply.  */
2950 char gdbm_open();
2951
2952 int main() {
2953 gdbm_open()
2954 ; return 0; }
2955 EOF
2956 if { (eval echo configure:2957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2957   rm -rf conftest*
2958   eval "ac_cv_lib_$ac_lib_var=yes"
2959 else
2960   echo "configure: failed program was:" >&5
2961   cat conftest.$ac_ext >&5
2962   rm -rf conftest*
2963   eval "ac_cv_lib_$ac_lib_var=no"
2964 fi
2965 rm -f conftest*
2966 LIBS="$ac_save_LIBS"
2967
2968 fi
2969 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2970   echo "$ac_t""yes" 1>&6
2971   ol_cv_lib_gdbm=-lgdbm
2972 else
2973   echo "$ac_t""no" 1>&6
2974 ol_cv_lib_gdbm=no
2975 fi
2976
2977         
2978 fi
2979
2980         LIBS="$ol_LIBS"
2981
2982 fi
2983
2984 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
2985
2986
2987  for ac_hdr in gdbm.h
2988 do
2989 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2990 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2991 echo "configure:2992: checking for $ac_hdr" >&5
2992 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2993   echo $ac_n "(cached) $ac_c" 1>&6
2994 else
2995   cat > conftest.$ac_ext <<EOF
2996 #line 2997 "configure"
2997 #include "confdefs.h"
2998 #include <$ac_hdr>
2999 EOF
3000 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3001 { (eval echo configure:3002: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3002 ac_err=`grep -v '^ *+' conftest.out`
3003 if test -z "$ac_err"; then
3004   rm -rf conftest*
3005   eval "ac_cv_header_$ac_safe=yes"
3006 else
3007   echo "$ac_err" >&5
3008   echo "configure: failed program was:" >&5
3009   cat conftest.$ac_ext >&5
3010   rm -rf conftest*
3011   eval "ac_cv_header_$ac_safe=no"
3012 fi
3013 rm -f conftest*
3014 fi
3015 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3016   echo "$ac_t""yes" 1>&6
3017     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3018   cat >> confdefs.h <<EOF
3019 #define $ac_tr_hdr 1
3020 EOF
3021  
3022 else
3023   echo "$ac_t""no" 1>&6
3024 fi
3025 done
3026
3027  echo $ac_n "checking for db""... $ac_c" 1>&6
3028 echo "configure:3029: checking for db" >&5
3029 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
3030   echo $ac_n "(cached) $ac_c" 1>&6
3031 else
3032   
3033         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
3034                 ol_cv_gdbm=no
3035         else
3036                 ol_cv_gdbm=yes
3037         fi
3038
3039 fi
3040
3041 echo "$ac_t""$ol_cv_gdbm" 1>&6
3042
3043
3044         if test $ol_cv_gdbm = yes ; then
3045                 ol_link_ldbm=gdbm
3046                 ol_with_ldbm_api=gdbm
3047
3048                 LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_GDBM"
3049
3050                 if test $ol_cv_lib_gdbm != yes ; then
3051                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
3052                 fi
3053         fi
3054 fi
3055
3056 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = ndbm ; then
3057         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
3058 echo "configure:3059: checking for NDBM library" >&5
3059 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
3060   echo $ac_n "(cached) $ac_c" 1>&6
3061 else
3062         ol_LIBS="$LIBS"
3063         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
3064 echo "configure:3065: checking for dbm_open" >&5
3065 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
3066   echo $ac_n "(cached) $ac_c" 1>&6
3067 else
3068   cat > conftest.$ac_ext <<EOF
3069 #line 3070 "configure"
3070 #include "confdefs.h"
3071 /* System header to define __stub macros and hopefully few prototypes,
3072     which can conflict with char dbm_open(); below.  */
3073 #include <assert.h>
3074 /* Override any gcc2 internal prototype to avoid an error.  */
3075 /* We use char because int might match the return type of a gcc2
3076     builtin and then its argument prototype would still apply.  */
3077 char dbm_open();
3078
3079 int main() {
3080
3081 /* The GNU C library defines this for functions which it implements
3082     to always fail with ENOSYS.  Some functions are actually named
3083     something starting with __ and the normal name is an alias.  */
3084 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
3085 choke me
3086 #else
3087 dbm_open();
3088 #endif
3089
3090 ; return 0; }
3091 EOF
3092 if { (eval echo configure:3093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3093   rm -rf conftest*
3094   eval "ac_cv_func_dbm_open=yes"
3095 else
3096   echo "configure: failed program was:" >&5
3097   cat conftest.$ac_ext >&5
3098   rm -rf conftest*
3099   eval "ac_cv_func_dbm_open=no"
3100 fi
3101 rm -f conftest*
3102 fi
3103
3104 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
3105   echo "$ac_t""yes" 1>&6
3106   ol_cv_lib_ndbm=yes
3107 else
3108   echo "$ac_t""no" 1>&6
3109
3110                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
3111 echo "configure:3112: checking for dbm_open in -lndbm" >&5
3112 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
3113 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3114   echo $ac_n "(cached) $ac_c" 1>&6
3115 else
3116   ac_save_LIBS="$LIBS"
3117 LIBS="-lndbm  $LIBS"
3118 cat > conftest.$ac_ext <<EOF
3119 #line 3120 "configure"
3120 #include "confdefs.h"
3121 /* Override any gcc2 internal prototype to avoid an error.  */
3122 /* We use char because int might match the return type of a gcc2
3123     builtin and then its argument prototype would still apply.  */
3124 char dbm_open();
3125
3126 int main() {
3127 dbm_open()
3128 ; return 0; }
3129 EOF
3130 if { (eval echo configure:3131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3131   rm -rf conftest*
3132   eval "ac_cv_lib_$ac_lib_var=yes"
3133 else
3134   echo "configure: failed program was:" >&5
3135   cat conftest.$ac_ext >&5
3136   rm -rf conftest*
3137   eval "ac_cv_lib_$ac_lib_var=no"
3138 fi
3139 rm -f conftest*
3140 LIBS="$ac_save_LIBS"
3141
3142 fi
3143 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3144   echo "$ac_t""yes" 1>&6
3145   ol_cv_lib_ndbm=-lndbm
3146 else
3147   echo "$ac_t""no" 1>&6
3148
3149                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
3150 echo "configure:3151: checking for dbm_open in -ldbm" >&5
3151 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
3152 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3153   echo $ac_n "(cached) $ac_c" 1>&6
3154 else
3155   ac_save_LIBS="$LIBS"
3156 LIBS="-ldbm  $LIBS"
3157 cat > conftest.$ac_ext <<EOF
3158 #line 3159 "configure"
3159 #include "confdefs.h"
3160 /* Override any gcc2 internal prototype to avoid an error.  */
3161 /* We use char because int might match the return type of a gcc2
3162     builtin and then its argument prototype would still apply.  */
3163 char dbm_open();
3164
3165 int main() {
3166 dbm_open()
3167 ; return 0; }
3168 EOF
3169 if { (eval echo configure:3170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3170   rm -rf conftest*
3171   eval "ac_cv_lib_$ac_lib_var=yes"
3172 else
3173   echo "configure: failed program was:" >&5
3174   cat conftest.$ac_ext >&5
3175   rm -rf conftest*
3176   eval "ac_cv_lib_$ac_lib_var=no"
3177 fi
3178 rm -f conftest*
3179 LIBS="$ac_save_LIBS"
3180
3181 fi
3182 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3183   echo "$ac_t""yes" 1>&6
3184   ol_cv_lib_ndbm=-ldbm
3185 else
3186   echo "$ac_t""no" 1>&6
3187 ol_cv_lib_ndbm=no
3188 fi
3189                 
3190 fi
3191
3192         
3193 fi
3194
3195         LIBS="$ol_LIBS"
3196
3197 fi
3198
3199 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
3200
3201
3202  for ac_hdr in ndbm.h
3203 do
3204 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3205 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3206 echo "configure:3207: checking for $ac_hdr" >&5
3207 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3208   echo $ac_n "(cached) $ac_c" 1>&6
3209 else
3210   cat > conftest.$ac_ext <<EOF
3211 #line 3212 "configure"
3212 #include "confdefs.h"
3213 #include <$ac_hdr>
3214 EOF
3215 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3216 { (eval echo configure:3217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3217 ac_err=`grep -v '^ *+' conftest.out`
3218 if test -z "$ac_err"; then
3219   rm -rf conftest*
3220   eval "ac_cv_header_$ac_safe=yes"
3221 else
3222   echo "$ac_err" >&5
3223   echo "configure: failed program was:" >&5
3224   cat conftest.$ac_ext >&5
3225   rm -rf conftest*
3226   eval "ac_cv_header_$ac_safe=no"
3227 fi
3228 rm -f conftest*
3229 fi
3230 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3231   echo "$ac_t""yes" 1>&6
3232     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3233   cat >> confdefs.h <<EOF
3234 #define $ac_tr_hdr 1
3235 EOF
3236  
3237 else
3238   echo "$ac_t""no" 1>&6
3239 fi
3240 done
3241
3242  echo $ac_n "checking for db""... $ac_c" 1>&6
3243 echo "configure:3244: checking for db" >&5
3244 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
3245   echo $ac_n "(cached) $ac_c" 1>&6
3246 else
3247   
3248         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
3249                 ol_cv_ndbm=no
3250         else
3251                 ol_cv_ndbm=yes
3252         fi
3253
3254 fi
3255
3256 echo "$ac_t""$ol_cv_ndbm" 1>&6
3257
3258
3259         if test $ol_cv_ndbm = yes ; then
3260                 ol_link_ldbm=ndbm
3261                 ol_with_ldbm_api=ndbm
3262
3263                 if test $ol_with_ldbm_api = ndbm ; then
3264                         echo "configure: warning: Attempting to use NDBM.  Functionality will be limited." 1>&2
3265                 fi
3266
3267                 LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_NDBM"
3268
3269                 if test $ol_cv_lib_ndbm != yes ; then
3270                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
3271                 fi
3272         fi
3273 fi
3274
3275 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
3276         echo "configure: warning: could not find suitable LDBM backend" 1>&2
3277         if test $ol_enable_ldbm = yes ; then
3278                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
3279         fi
3280
3281         echo "configure: warning: disabling LDBM" 1>&2
3282         $ol_enable_ldbm=no
3283 fi
3284
3285 if test $ol_enable_wrappers = yes ; then
3286         echo $ac_n "checking for hosts_access in -lwrap""... $ac_c" 1>&6
3287 echo "configure:3288: checking for hosts_access in -lwrap" >&5
3288 ac_lib_var=`echo wrap'_'hosts_access | sed 'y%./+-%__p_%'`
3289 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3290   echo $ac_n "(cached) $ac_c" 1>&6
3291 else
3292   ac_save_LIBS="$LIBS"
3293 LIBS="-lwrap  $LIBS"
3294 cat > conftest.$ac_ext <<EOF
3295 #line 3296 "configure"
3296 #include "confdefs.h"
3297 /* Override any gcc2 internal prototype to avoid an error.  */
3298 /* We use char because int might match the return type of a gcc2
3299     builtin and then its argument prototype would still apply.  */
3300 char hosts_access();
3301
3302 int main() {
3303 hosts_access()
3304 ; return 0; }
3305 EOF
3306 if { (eval echo configure:3307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3307   rm -rf conftest*
3308   eval "ac_cv_lib_$ac_lib_var=yes"
3309 else
3310   echo "configure: failed program was:" >&5
3311   cat conftest.$ac_ext >&5
3312   rm -rf conftest*
3313   eval "ac_cv_lib_$ac_lib_var=no"
3314 fi
3315 rm -f conftest*
3316 LIBS="$ac_save_LIBS"
3317
3318 fi
3319 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3320   echo "$ac_t""yes" 1>&6
3321   have_wrappers=yes
3322 else
3323   echo "$ac_t""no" 1>&6
3324 have_wrappers=no
3325 fi
3326
3327
3328         if test $have_wrappers = yes ; then
3329                 SLAPD_DEFS="$SLAPD_DEFS -DTCP_WRAPPERS"
3330                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
3331         else
3332                 echo "configure: warning: could not find -lwrap" 1>&2
3333                 if test $ol_enable_wrappers = yes ; then
3334                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
3335                 fi
3336
3337                 echo "configure: warning: disabling wrappers support" 1>&2
3338                 ol_enable_wrappers=no
3339         fi
3340
3341 fi
3342
3343 # ud needs termcap (should insert check here)
3344 ol_link_termcap=no
3345
3346 TERMCAP_DEFS=
3347 TERMCAP_LIBS=
3348
3349 for ac_hdr in termcap.h ncurses.h
3350 do
3351 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3352 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3353 echo "configure:3354: checking for $ac_hdr" >&5
3354 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3355   echo $ac_n "(cached) $ac_c" 1>&6
3356 else
3357   cat > conftest.$ac_ext <<EOF
3358 #line 3359 "configure"
3359 #include "confdefs.h"
3360 #include <$ac_hdr>
3361 EOF
3362 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3363 { (eval echo configure:3364: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3364 ac_err=`grep -v '^ *+' conftest.out`
3365 if test -z "$ac_err"; then
3366   rm -rf conftest*
3367   eval "ac_cv_header_$ac_safe=yes"
3368 else
3369   echo "$ac_err" >&5
3370   echo "configure: failed program was:" >&5
3371   cat conftest.$ac_ext >&5
3372   rm -rf conftest*
3373   eval "ac_cv_header_$ac_safe=no"
3374 fi
3375 rm -f conftest*
3376 fi
3377 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3378   echo "$ac_t""yes" 1>&6
3379     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3380   cat >> confdefs.h <<EOF
3381 #define $ac_tr_hdr 1
3382 EOF
3383  
3384 else
3385   echo "$ac_t""no" 1>&6
3386 fi
3387 done
3388
3389
3390 if test $ol_link_termcap = no ; then
3391         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
3392 echo "configure:3393: checking for tputs in -ltermcap" >&5
3393 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
3394 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3395   echo $ac_n "(cached) $ac_c" 1>&6
3396 else
3397   ac_save_LIBS="$LIBS"
3398 LIBS="-ltermcap  $LIBS"
3399 cat > conftest.$ac_ext <<EOF
3400 #line 3401 "configure"
3401 #include "confdefs.h"
3402 /* Override any gcc2 internal prototype to avoid an error.  */
3403 /* We use char because int might match the return type of a gcc2
3404     builtin and then its argument prototype would still apply.  */
3405 char tputs();
3406
3407 int main() {
3408 tputs()
3409 ; return 0; }
3410 EOF
3411 if { (eval echo configure:3412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3412   rm -rf conftest*
3413   eval "ac_cv_lib_$ac_lib_var=yes"
3414 else
3415   echo "configure: failed program was:" >&5
3416   cat conftest.$ac_ext >&5
3417   rm -rf conftest*
3418   eval "ac_cv_lib_$ac_lib_var=no"
3419 fi
3420 rm -f conftest*
3421 LIBS="$ac_save_LIBS"
3422
3423 fi
3424 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3425   echo "$ac_t""yes" 1>&6
3426   have_termcap=yes
3427 else
3428   echo "$ac_t""no" 1>&6
3429 have_termcap=no
3430 fi
3431
3432         if test $have_termcap = yes ; then
3433                 ol_link_termcap=yes
3434                 TERMCAP_LIBS=-ltermcap
3435         fi
3436 fi
3437
3438 if test $ol_link_termcap = no ; then
3439         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
3440 echo "configure:3441: checking for initscr in -lncurses" >&5
3441 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
3442 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3443   echo $ac_n "(cached) $ac_c" 1>&6
3444 else
3445   ac_save_LIBS="$LIBS"
3446 LIBS="-lncurses  $LIBS"
3447 cat > conftest.$ac_ext <<EOF
3448 #line 3449 "configure"
3449 #include "confdefs.h"
3450 /* Override any gcc2 internal prototype to avoid an error.  */
3451 /* We use char because int might match the return type of a gcc2
3452     builtin and then its argument prototype would still apply.  */
3453 char initscr();
3454
3455 int main() {
3456 initscr()
3457 ; return 0; }
3458 EOF
3459 if { (eval echo configure:3460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3460   rm -rf conftest*
3461   eval "ac_cv_lib_$ac_lib_var=yes"
3462 else
3463   echo "configure: failed program was:" >&5
3464   cat conftest.$ac_ext >&5
3465   rm -rf conftest*
3466   eval "ac_cv_lib_$ac_lib_var=no"
3467 fi
3468 rm -f conftest*
3469 LIBS="$ac_save_LIBS"
3470
3471 fi
3472 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3473   echo "$ac_t""yes" 1>&6
3474   have_ncurses=yes
3475 else
3476   echo "$ac_t""no" 1>&6
3477 have_ncurses=no
3478 fi
3479
3480         if test $have_ncurses = yes ; then
3481                 ol_link_termcap=yes
3482                 TERMCAP_LIBS=-lncurses
3483         fi
3484 fi
3485
3486 if test $ol_link_termcap = no ; then
3487         TERMCAP_DEFS="-DNOTERMCAP"
3488         TERMCAP_LIBS=
3489 fi
3490
3491
3492
3493
3494 # FreeBSD (and others) have crypt(3) in -lcrypt
3495 if test $ol_enable_crypt != no ; then
3496         echo $ac_n "checking for crypt""... $ac_c" 1>&6
3497 echo "configure:3498: checking for crypt" >&5
3498 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
3499   echo $ac_n "(cached) $ac_c" 1>&6
3500 else
3501   cat > conftest.$ac_ext <<EOF
3502 #line 3503 "configure"
3503 #include "confdefs.h"
3504 /* System header to define __stub macros and hopefully few prototypes,
3505     which can conflict with char crypt(); below.  */
3506 #include <assert.h>
3507 /* Override any gcc2 internal prototype to avoid an error.  */
3508 /* We use char because int might match the return type of a gcc2
3509     builtin and then its argument prototype would still apply.  */
3510 char crypt();
3511
3512 int main() {
3513
3514 /* The GNU C library defines this for functions which it implements
3515     to always fail with ENOSYS.  Some functions are actually named
3516     something starting with __ and the normal name is an alias.  */
3517 #if defined (__stub_crypt) || defined (__stub___crypt)
3518 choke me
3519 #else
3520 crypt();
3521 #endif
3522
3523 ; return 0; }
3524 EOF
3525 if { (eval echo configure:3526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3526   rm -rf conftest*
3527   eval "ac_cv_func_crypt=yes"
3528 else
3529   echo "configure: failed program was:" >&5
3530   cat conftest.$ac_ext >&5
3531   rm -rf conftest*
3532   eval "ac_cv_func_crypt=no"
3533 fi
3534 rm -f conftest*
3535 fi
3536
3537 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
3538   echo "$ac_t""yes" 1>&6
3539   have_crypt=yes
3540 else
3541   echo "$ac_t""no" 1>&6
3542
3543                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
3544 echo "configure:3545: checking for crypt in -lcrypt" >&5
3545 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
3546 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3547   echo $ac_n "(cached) $ac_c" 1>&6
3548 else
3549   ac_save_LIBS="$LIBS"
3550 LIBS="-lcrypt  $LIBS"
3551 cat > conftest.$ac_ext <<EOF
3552 #line 3553 "configure"
3553 #include "confdefs.h"
3554 /* Override any gcc2 internal prototype to avoid an error.  */
3555 /* We use char because int might match the return type of a gcc2
3556     builtin and then its argument prototype would still apply.  */
3557 char crypt();
3558
3559 int main() {
3560 crypt()
3561 ; return 0; }
3562 EOF
3563 if { (eval echo configure:3564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3564   rm -rf conftest*
3565   eval "ac_cv_lib_$ac_lib_var=yes"
3566 else
3567   echo "configure: failed program was:" >&5
3568   cat conftest.$ac_ext >&5
3569   rm -rf conftest*
3570   eval "ac_cv_lib_$ac_lib_var=no"
3571 fi
3572 rm -f conftest*
3573 LIBS="$ac_save_LIBS"
3574
3575 fi
3576 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3577   echo "$ac_t""yes" 1>&6
3578   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
3579                         have_crypt=yes
3580 else
3581   echo "$ac_t""no" 1>&6
3582 have_crypt=no
3583 fi
3584
3585 fi
3586
3587
3588         if test $have_crypt = yes ; then
3589                 LUTIL_DEFS="$LUTIL_DEFS -DLDAP_CRYPT"
3590         else
3591                 echo "configure: warning: could not find crypt" 1>&2
3592                 if test $ol_enable_crypt = yes ; then
3593                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
3594                 fi
3595
3596                 echo "configure: warning: disabling crypt support" 1>&2
3597                 ol_enable_crypt=no
3598         fi
3599 fi
3600
3601 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3602 echo "configure:3603: checking for ANSI C header files" >&5
3603 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
3604   echo $ac_n "(cached) $ac_c" 1>&6
3605 else
3606   cat > conftest.$ac_ext <<EOF
3607 #line 3608 "configure"
3608 #include "confdefs.h"
3609 #include <stdlib.h>
3610 #include <stdarg.h>
3611 #include <string.h>
3612 #include <float.h>
3613 EOF
3614 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3615 { (eval echo configure:3616: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3616 ac_err=`grep -v '^ *+' conftest.out`
3617 if test -z "$ac_err"; then
3618   rm -rf conftest*
3619   ac_cv_header_stdc=yes
3620 else
3621   echo "$ac_err" >&5
3622   echo "configure: failed program was:" >&5
3623   cat conftest.$ac_ext >&5
3624   rm -rf conftest*
3625   ac_cv_header_stdc=no
3626 fi
3627 rm -f conftest*
3628
3629 if test $ac_cv_header_stdc = yes; then
3630   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3631 cat > conftest.$ac_ext <<EOF
3632 #line 3633 "configure"
3633 #include "confdefs.h"
3634 #include <string.h>
3635 EOF
3636 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3637   egrep "memchr" >/dev/null 2>&1; then
3638   :
3639 else
3640   rm -rf conftest*
3641   ac_cv_header_stdc=no
3642 fi
3643 rm -f conftest*
3644
3645 fi
3646
3647 if test $ac_cv_header_stdc = yes; then
3648   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3649 cat > conftest.$ac_ext <<EOF
3650 #line 3651 "configure"
3651 #include "confdefs.h"
3652 #include <stdlib.h>
3653 EOF
3654 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3655   egrep "free" >/dev/null 2>&1; then
3656   :
3657 else
3658   rm -rf conftest*
3659   ac_cv_header_stdc=no
3660 fi
3661 rm -f conftest*
3662
3663 fi
3664
3665 if test $ac_cv_header_stdc = yes; then
3666   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3667 if test "$cross_compiling" = yes; then
3668   :
3669 else
3670   cat > conftest.$ac_ext <<EOF
3671 #line 3672 "configure"
3672 #include "confdefs.h"
3673 #include <ctype.h>
3674 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3675 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3676 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3677 int main () { int i; for (i = 0; i < 256; i++)
3678 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
3679 exit (0); }
3680
3681 EOF
3682 if { (eval echo configure:3683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
3683 then
3684   :
3685 else
3686   echo "configure: failed program was:" >&5
3687   cat conftest.$ac_ext >&5
3688   rm -fr conftest*
3689   ac_cv_header_stdc=no
3690 fi
3691 rm -fr conftest*
3692 fi
3693
3694 fi
3695 fi
3696
3697 echo "$ac_t""$ac_cv_header_stdc" 1>&6
3698 if test $ac_cv_header_stdc = yes; then
3699   cat >> confdefs.h <<\EOF
3700 #define STDC_HEADERS 1
3701 EOF
3702
3703 fi
3704
3705 ac_header_dirent=no
3706 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
3707 do
3708 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3709 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
3710 echo "configure:3711: checking for $ac_hdr that defines DIR" >&5
3711 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
3712   echo $ac_n "(cached) $ac_c" 1>&6
3713 else
3714   cat > conftest.$ac_ext <<EOF
3715 #line 3716 "configure"
3716 #include "confdefs.h"
3717 #include <sys/types.h>
3718 #include <$ac_hdr>
3719 int main() {
3720 DIR *dirp = 0;
3721 ; return 0; }
3722 EOF
3723 if { (eval echo configure:3724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3724   rm -rf conftest*
3725   eval "ac_cv_header_dirent_$ac_safe=yes"
3726 else
3727   echo "configure: failed program was:" >&5
3728   cat conftest.$ac_ext >&5
3729   rm -rf conftest*
3730   eval "ac_cv_header_dirent_$ac_safe=no"
3731 fi
3732 rm -f conftest*
3733 fi
3734 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
3735   echo "$ac_t""yes" 1>&6
3736     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3737   cat >> confdefs.h <<EOF
3738 #define $ac_tr_hdr 1
3739 EOF
3740  ac_header_dirent=$ac_hdr; break
3741 else
3742   echo "$ac_t""no" 1>&6
3743 fi
3744 done
3745 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
3746 if test $ac_header_dirent = dirent.h; then
3747 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
3748 echo "configure:3749: checking for opendir in -ldir" >&5
3749 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
3750 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3751   echo $ac_n "(cached) $ac_c" 1>&6
3752 else
3753   ac_save_LIBS="$LIBS"
3754 LIBS="-ldir  $LIBS"
3755 cat > conftest.$ac_ext <<EOF
3756 #line 3757 "configure"
3757 #include "confdefs.h"
3758 /* Override any gcc2 internal prototype to avoid an error.  */
3759 /* We use char because int might match the return type of a gcc2
3760     builtin and then its argument prototype would still apply.  */
3761 char opendir();
3762
3763 int main() {
3764 opendir()
3765 ; return 0; }
3766 EOF
3767 if { (eval echo configure:3768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3768   rm -rf conftest*
3769   eval "ac_cv_lib_$ac_lib_var=yes"
3770 else
3771   echo "configure: failed program was:" >&5
3772   cat conftest.$ac_ext >&5
3773   rm -rf conftest*
3774   eval "ac_cv_lib_$ac_lib_var=no"
3775 fi
3776 rm -f conftest*
3777 LIBS="$ac_save_LIBS"
3778
3779 fi
3780 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3781   echo "$ac_t""yes" 1>&6
3782   LIBS="$LIBS -ldir"
3783 else
3784   echo "$ac_t""no" 1>&6
3785 fi
3786
3787 else
3788 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
3789 echo "configure:3790: checking for opendir in -lx" >&5
3790 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
3791 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3792   echo $ac_n "(cached) $ac_c" 1>&6
3793 else
3794   ac_save_LIBS="$LIBS"
3795 LIBS="-lx  $LIBS"
3796 cat > conftest.$ac_ext <<EOF
3797 #line 3798 "configure"
3798 #include "confdefs.h"
3799 /* Override any gcc2 internal prototype to avoid an error.  */
3800 /* We use char because int might match the return type of a gcc2
3801     builtin and then its argument prototype would still apply.  */
3802 char opendir();
3803
3804 int main() {
3805 opendir()
3806 ; return 0; }
3807 EOF
3808 if { (eval echo configure:3809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3809   rm -rf conftest*
3810   eval "ac_cv_lib_$ac_lib_var=yes"
3811 else
3812   echo "configure: failed program was:" >&5
3813   cat conftest.$ac_ext >&5
3814   rm -rf conftest*
3815   eval "ac_cv_lib_$ac_lib_var=no"
3816 fi
3817 rm -f conftest*
3818 LIBS="$ac_save_LIBS"
3819
3820 fi
3821 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3822   echo "$ac_t""yes" 1>&6
3823   LIBS="$LIBS -lx"
3824 else
3825   echo "$ac_t""no" 1>&6
3826 fi
3827
3828 fi
3829
3830 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
3831 echo "configure:3832: checking for sys/wait.h that is POSIX.1 compatible" >&5
3832 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
3833   echo $ac_n "(cached) $ac_c" 1>&6
3834 else
3835   cat > conftest.$ac_ext <<EOF
3836 #line 3837 "configure"
3837 #include "confdefs.h"
3838 #include <sys/types.h>
3839 #include <sys/wait.h>
3840 #ifndef WEXITSTATUS
3841 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
3842 #endif
3843 #ifndef WIFEXITED
3844 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
3845 #endif
3846 int main() {
3847 int s;
3848 wait (&s);
3849 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
3850 ; return 0; }
3851 EOF
3852 if { (eval echo configure:3853: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3853   rm -rf conftest*
3854   ac_cv_header_sys_wait_h=yes
3855 else
3856   echo "configure: failed program was:" >&5
3857   cat conftest.$ac_ext >&5
3858   rm -rf conftest*
3859   ac_cv_header_sys_wait_h=no
3860 fi
3861 rm -f conftest*
3862 fi
3863
3864 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
3865 if test $ac_cv_header_sys_wait_h = yes; then
3866   cat >> confdefs.h <<\EOF
3867 #define HAVE_SYS_WAIT_H 1
3868 EOF
3869
3870 fi
3871
3872 for ac_hdr in \
3873         stddef.h        \
3874         fcntl.h         \
3875         limits.h        \
3876         malloc.h        \
3877         sgtty.h         \
3878         sys/file.h      \
3879         sys/ioctl.h     \
3880         sys/time.h      \
3881         syslog.h        \
3882         termio.h        \
3883         unistd.h        \
3884
3885 do
3886 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3887 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3888 echo "configure:3889: checking for $ac_hdr" >&5
3889 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3890   echo $ac_n "(cached) $ac_c" 1>&6
3891 else
3892   cat > conftest.$ac_ext <<EOF
3893 #line 3894 "configure"
3894 #include "confdefs.h"
3895 #include <$ac_hdr>
3896 EOF
3897 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3898 { (eval echo configure:3899: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3899 ac_err=`grep -v '^ *+' conftest.out`
3900 if test -z "$ac_err"; then
3901   rm -rf conftest*
3902   eval "ac_cv_header_$ac_safe=yes"
3903 else
3904   echo "$ac_err" >&5
3905   echo "configure: failed program was:" >&5
3906   cat conftest.$ac_ext >&5
3907   rm -rf conftest*
3908   eval "ac_cv_header_$ac_safe=no"
3909 fi
3910 rm -f conftest*
3911 fi
3912 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3913   echo "$ac_t""yes" 1>&6
3914     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3915   cat >> confdefs.h <<EOF
3916 #define $ac_tr_hdr 1
3917 EOF
3918  
3919 else
3920   echo "$ac_t""no" 1>&6
3921 fi
3922 done
3923
3924
3925 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
3926 echo "configure:3927: checking for uid_t in sys/types.h" >&5
3927 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
3928   echo $ac_n "(cached) $ac_c" 1>&6
3929 else
3930   cat > conftest.$ac_ext <<EOF
3931 #line 3932 "configure"
3932 #include "confdefs.h"
3933 #include <sys/types.h>
3934 EOF
3935 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3936   egrep "uid_t" >/dev/null 2>&1; then
3937   rm -rf conftest*
3938   ac_cv_type_uid_t=yes
3939 else
3940   rm -rf conftest*
3941   ac_cv_type_uid_t=no
3942 fi
3943 rm -f conftest*
3944
3945 fi
3946
3947 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
3948 if test $ac_cv_type_uid_t = no; then
3949   cat >> confdefs.h <<\EOF
3950 #define uid_t int
3951 EOF
3952
3953   cat >> confdefs.h <<\EOF
3954 #define gid_t int
3955 EOF
3956
3957 fi
3958
3959 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
3960 echo "configure:3961: checking type of array argument to getgroups" >&5
3961 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
3962   echo $ac_n "(cached) $ac_c" 1>&6
3963 else
3964   if test "$cross_compiling" = yes; then
3965   ac_cv_type_getgroups=cross
3966 else
3967   cat > conftest.$ac_ext <<EOF
3968 #line 3969 "configure"
3969 #include "confdefs.h"
3970
3971 /* Thanks to Mike Rendell for this test.  */
3972 #include <sys/types.h>
3973 #define NGID 256
3974 #undef MAX
3975 #define MAX(x, y) ((x) > (y) ? (x) : (y))
3976 main()
3977 {
3978   gid_t gidset[NGID];
3979   int i, n;
3980   union { gid_t gval; long lval; }  val;
3981
3982   val.lval = -1;
3983   for (i = 0; i < NGID; i++)
3984     gidset[i] = val.gval;
3985   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
3986                  gidset);
3987   /* Exit non-zero if getgroups seems to require an array of ints.  This
3988      happens when gid_t is short but getgroups modifies an array of ints.  */
3989   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
3990 }
3991
3992 EOF
3993 if { (eval echo configure:3994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
3994 then
3995     ac_cv_type_getgroups=gid_t
3996 else
3997   echo "configure: failed program was:" >&5
3998   cat conftest.$ac_ext >&5
3999   rm -fr conftest*
4000   ac_cv_type_getgroups=int
4001 fi
4002 rm -fr conftest*
4003 fi
4004
4005 if test $ac_cv_type_getgroups = cross; then
4006         cat > conftest.$ac_ext <<EOF
4007 #line 4008 "configure"
4008 #include "confdefs.h"
4009 #include <unistd.h>
4010 EOF
4011 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4012   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
4013   rm -rf conftest*
4014   ac_cv_type_getgroups=gid_t
4015 else
4016   rm -rf conftest*
4017   ac_cv_type_getgroups=int
4018 fi
4019 rm -f conftest*
4020
4021 fi
4022 fi
4023
4024 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
4025 cat >> confdefs.h <<EOF
4026 #define GETGROUPS_T $ac_cv_type_getgroups
4027 EOF
4028
4029
4030 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
4031 echo "configure:4032: checking for mode_t" >&5
4032 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
4033   echo $ac_n "(cached) $ac_c" 1>&6
4034 else
4035   cat > conftest.$ac_ext <<EOF
4036 #line 4037 "configure"
4037 #include "confdefs.h"
4038 #include <sys/types.h>
4039 #if STDC_HEADERS
4040 #include <stdlib.h>
4041 #include <stddef.h>
4042 #endif
4043 EOF
4044 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4045   egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
4046   rm -rf conftest*
4047   ac_cv_type_mode_t=yes
4048 else
4049   rm -rf conftest*
4050   ac_cv_type_mode_t=no
4051 fi
4052 rm -f conftest*
4053
4054 fi
4055 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
4056 if test $ac_cv_type_mode_t = no; then
4057   cat >> confdefs.h <<\EOF
4058 #define mode_t int
4059 EOF
4060
4061 fi
4062
4063 echo $ac_n "checking for off_t""... $ac_c" 1>&6
4064 echo "configure:4065: checking for off_t" >&5
4065 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
4066   echo $ac_n "(cached) $ac_c" 1>&6
4067 else
4068   cat > conftest.$ac_ext <<EOF
4069 #line 4070 "configure"
4070 #include "confdefs.h"
4071 #include <sys/types.h>
4072 #if STDC_HEADERS
4073 #include <stdlib.h>
4074 #include <stddef.h>
4075 #endif
4076 EOF
4077 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4078   egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
4079   rm -rf conftest*
4080   ac_cv_type_off_t=yes
4081 else
4082   rm -rf conftest*
4083   ac_cv_type_off_t=no
4084 fi
4085 rm -f conftest*
4086
4087 fi
4088 echo "$ac_t""$ac_cv_type_off_t" 1>&6
4089 if test $ac_cv_type_off_t = no; then
4090   cat >> confdefs.h <<\EOF
4091 #define off_t long
4092 EOF
4093
4094 fi
4095
4096 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
4097 echo "configure:4098: checking for pid_t" >&5
4098 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
4099   echo $ac_n "(cached) $ac_c" 1>&6
4100 else
4101   cat > conftest.$ac_ext <<EOF
4102 #line 4103 "configure"
4103 #include "confdefs.h"
4104 #include <sys/types.h>
4105 #if STDC_HEADERS
4106 #include <stdlib.h>
4107 #include <stddef.h>
4108 #endif
4109 EOF
4110 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4111   egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
4112   rm -rf conftest*
4113   ac_cv_type_pid_t=yes
4114 else
4115   rm -rf conftest*
4116   ac_cv_type_pid_t=no
4117 fi
4118 rm -f conftest*
4119
4120 fi
4121 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
4122 if test $ac_cv_type_pid_t = no; then
4123   cat >> confdefs.h <<\EOF
4124 #define pid_t int
4125 EOF
4126
4127 fi
4128
4129 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
4130 echo "configure:4131: checking return type of signal handlers" >&5
4131 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
4132   echo $ac_n "(cached) $ac_c" 1>&6
4133 else
4134   cat > conftest.$ac_ext <<EOF
4135 #line 4136 "configure"
4136 #include "confdefs.h"
4137 #include <sys/types.h>
4138 #include <signal.h>
4139 #ifdef signal
4140 #undef signal
4141 #endif
4142 #ifdef __cplusplus
4143 extern "C" void (*signal (int, void (*)(int)))(int);
4144 #else
4145 void (*signal ()) ();
4146 #endif
4147
4148 int main() {
4149 int i;
4150 ; return 0; }
4151 EOF
4152 if { (eval echo configure:4153: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4153   rm -rf conftest*
4154   ac_cv_type_signal=void
4155 else
4156   echo "configure: failed program was:" >&5
4157   cat conftest.$ac_ext >&5
4158   rm -rf conftest*
4159   ac_cv_type_signal=int
4160 fi
4161 rm -f conftest*
4162 fi
4163
4164 echo "$ac_t""$ac_cv_type_signal" 1>&6
4165 cat >> confdefs.h <<EOF
4166 #define RETSIGTYPE $ac_cv_type_signal
4167 EOF
4168
4169
4170 echo $ac_n "checking for size_t""... $ac_c" 1>&6
4171 echo "configure:4172: checking for size_t" >&5
4172 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
4173   echo $ac_n "(cached) $ac_c" 1>&6
4174 else
4175   cat > conftest.$ac_ext <<EOF
4176 #line 4177 "configure"
4177 #include "confdefs.h"
4178 #include <sys/types.h>
4179 #if STDC_HEADERS
4180 #include <stdlib.h>
4181 #include <stddef.h>
4182 #endif
4183 EOF
4184 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4185   egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
4186   rm -rf conftest*
4187   ac_cv_type_size_t=yes
4188 else
4189   rm -rf conftest*
4190   ac_cv_type_size_t=no
4191 fi
4192 rm -f conftest*
4193
4194 fi
4195 echo "$ac_t""$ac_cv_type_size_t" 1>&6
4196 if test $ac_cv_type_size_t = no; then
4197   cat >> confdefs.h <<\EOF
4198 #define size_t unsigned
4199 EOF
4200
4201 fi
4202
4203 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
4204 echo "configure:4205: checking for uid_t in sys/types.h" >&5
4205 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
4206   echo $ac_n "(cached) $ac_c" 1>&6
4207 else
4208   cat > conftest.$ac_ext <<EOF
4209 #line 4210 "configure"
4210 #include "confdefs.h"
4211 #include <sys/types.h>
4212 EOF
4213 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4214   egrep "uid_t" >/dev/null 2>&1; then
4215   rm -rf conftest*
4216   ac_cv_type_uid_t=yes
4217 else
4218   rm -rf conftest*
4219   ac_cv_type_uid_t=no
4220 fi
4221 rm -f conftest*
4222
4223 fi
4224
4225 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
4226 if test $ac_cv_type_uid_t = no; then
4227   cat >> confdefs.h <<\EOF
4228 #define uid_t int
4229 EOF
4230
4231   cat >> confdefs.h <<\EOF
4232 #define gid_t int
4233 EOF
4234
4235 fi
4236
4237 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
4238 echo "configure:4239: checking for st_blksize in struct stat" >&5
4239 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
4240   echo $ac_n "(cached) $ac_c" 1>&6
4241 else
4242   cat > conftest.$ac_ext <<EOF
4243 #line 4244 "configure"
4244 #include "confdefs.h"
4245 #include <sys/types.h>
4246 #include <sys/stat.h>
4247 int main() {
4248 struct stat s; s.st_blksize;
4249 ; return 0; }
4250 EOF
4251 if { (eval echo configure:4252: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4252   rm -rf conftest*
4253   ac_cv_struct_st_blksize=yes
4254 else
4255   echo "configure: failed program was:" >&5
4256   cat conftest.$ac_ext >&5
4257   rm -rf conftest*
4258   ac_cv_struct_st_blksize=no
4259 fi
4260 rm -f conftest*
4261 fi
4262
4263 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
4264 if test $ac_cv_struct_st_blksize = yes; then
4265   cat >> confdefs.h <<\EOF
4266 #define HAVE_ST_BLKSIZE 1
4267 EOF
4268
4269 fi
4270
4271 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
4272 echo "configure:4273: checking whether time.h and sys/time.h may both be included" >&5
4273 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
4274   echo $ac_n "(cached) $ac_c" 1>&6
4275 else
4276   cat > conftest.$ac_ext <<EOF
4277 #line 4278 "configure"
4278 #include "confdefs.h"
4279 #include <sys/types.h>
4280 #include <sys/time.h>
4281 #include <time.h>
4282 int main() {
4283 struct tm *tp;
4284 ; return 0; }
4285 EOF
4286 if { (eval echo configure:4287: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4287   rm -rf conftest*
4288   ac_cv_header_time=yes
4289 else
4290   echo "configure: failed program was:" >&5
4291   cat conftest.$ac_ext >&5
4292   rm -rf conftest*
4293   ac_cv_header_time=no
4294 fi
4295 rm -f conftest*
4296 fi
4297
4298 echo "$ac_t""$ac_cv_header_time" 1>&6
4299 if test $ac_cv_header_time = yes; then
4300   cat >> confdefs.h <<\EOF
4301 #define TIME_WITH_SYS_TIME 1
4302 EOF
4303
4304 fi
4305
4306 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
4307 echo "configure:4308: checking whether struct tm is in sys/time.h or time.h" >&5
4308 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
4309   echo $ac_n "(cached) $ac_c" 1>&6
4310 else
4311   cat > conftest.$ac_ext <<EOF
4312 #line 4313 "configure"
4313 #include "confdefs.h"
4314 #include <sys/types.h>
4315 #include <time.h>
4316 int main() {
4317 struct tm *tp; tp->tm_sec;
4318 ; return 0; }
4319 EOF
4320 if { (eval echo configure:4321: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4321   rm -rf conftest*
4322   ac_cv_struct_tm=time.h
4323 else
4324   echo "configure: failed program was:" >&5
4325   cat conftest.$ac_ext >&5
4326   rm -rf conftest*
4327   ac_cv_struct_tm=sys/time.h
4328 fi
4329 rm -f conftest*
4330 fi
4331
4332 echo "$ac_t""$ac_cv_struct_tm" 1>&6
4333 if test $ac_cv_struct_tm = sys/time.h; then
4334   cat >> confdefs.h <<\EOF
4335 #define TM_IN_SYS_TIME 1
4336 EOF
4337
4338 fi
4339
4340
4341 echo $ac_n "checking for working const""... $ac_c" 1>&6
4342 echo "configure:4343: checking for working const" >&5
4343 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
4344   echo $ac_n "(cached) $ac_c" 1>&6
4345 else
4346   cat > conftest.$ac_ext <<EOF
4347 #line 4348 "configure"
4348 #include "confdefs.h"
4349
4350 int main() {
4351
4352 /* Ultrix mips cc rejects this.  */
4353 typedef int charset[2]; const charset x;
4354 /* SunOS 4.1.1 cc rejects this.  */
4355 char const *const *ccp;
4356 char **p;
4357 /* NEC SVR4.0.2 mips cc rejects this.  */
4358 struct point {int x, y;};
4359 static struct point const zero = {0,0};
4360 /* AIX XL C 1.02.0.0 rejects this.
4361    It does not let you subtract one const X* pointer from another in an arm
4362    of an if-expression whose if-part is not a constant expression */
4363 const char *g = "string";
4364 ccp = &g + (g ? g-g : 0);
4365 /* HPUX 7.0 cc rejects these. */
4366 ++ccp;
4367 p = (char**) ccp;
4368 ccp = (char const *const *) p;
4369 { /* SCO 3.2v4 cc rejects this.  */
4370   char *t;
4371   char const *s = 0 ? (char *) 0 : (char const *) 0;
4372
4373   *t++ = 0;
4374 }
4375 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
4376   int x[] = {25, 17};
4377   const int *foo = &x[0];
4378   ++foo;
4379 }
4380 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
4381   typedef const int *iptr;
4382   iptr p = 0;
4383   ++p;
4384 }
4385 { /* AIX XL C 1.02.0.0 rejects this saying
4386      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
4387   struct s { int j; const int *ap[3]; };
4388   struct s *b; b->j = 5;
4389 }
4390 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
4391   const int foo = 10;
4392 }
4393
4394 ; return 0; }
4395 EOF
4396 if { (eval echo configure:4397: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4397   rm -rf conftest*
4398   ac_cv_c_const=yes
4399 else
4400   echo "configure: failed program was:" >&5
4401   cat conftest.$ac_ext >&5
4402   rm -rf conftest*
4403   ac_cv_c_const=no
4404 fi
4405 rm -f conftest*
4406 fi
4407
4408 echo "$ac_t""$ac_cv_c_const" 1>&6
4409 if test $ac_cv_c_const = no; then
4410   cat >> confdefs.h <<\EOF
4411 #define const 
4412 EOF
4413
4414 fi
4415
4416
4417 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
4418 echo "configure:4419: checking for 8-bit clean memcmp" >&5
4419 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
4420   echo $ac_n "(cached) $ac_c" 1>&6
4421 else
4422   if test "$cross_compiling" = yes; then
4423   ac_cv_func_memcmp_clean=no
4424 else
4425   cat > conftest.$ac_ext <<EOF
4426 #line 4427 "configure"
4427 #include "confdefs.h"
4428
4429 main()
4430 {
4431   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
4432   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
4433 }
4434
4435 EOF
4436 if { (eval echo configure:4437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
4437 then
4438   ac_cv_func_memcmp_clean=yes
4439 else
4440   echo "configure: failed program was:" >&5
4441   cat conftest.$ac_ext >&5
4442   rm -fr conftest*
4443   ac_cv_func_memcmp_clean=no
4444 fi
4445 rm -fr conftest*
4446 fi
4447
4448 fi
4449
4450 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
4451 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o"
4452
4453 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
4454 echo "configure:4455: checking return type of signal handlers" >&5
4455 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
4456   echo $ac_n "(cached) $ac_c" 1>&6
4457 else
4458   cat > conftest.$ac_ext <<EOF
4459 #line 4460 "configure"
4460 #include "confdefs.h"
4461 #include <sys/types.h>
4462 #include <signal.h>
4463 #ifdef signal
4464 #undef signal
4465 #endif
4466 #ifdef __cplusplus
4467 extern "C" void (*signal (int, void (*)(int)))(int);
4468 #else
4469 void (*signal ()) ();
4470 #endif
4471
4472 int main() {
4473 int i;
4474 ; return 0; }
4475 EOF
4476 if { (eval echo configure:4477: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4477   rm -rf conftest*
4478   ac_cv_type_signal=void
4479 else
4480   echo "configure: failed program was:" >&5
4481   cat conftest.$ac_ext >&5
4482   rm -rf conftest*
4483   ac_cv_type_signal=int
4484 fi
4485 rm -f conftest*
4486 fi
4487
4488 echo "$ac_t""$ac_cv_type_signal" 1>&6
4489 cat >> confdefs.h <<EOF
4490 #define RETSIGTYPE $ac_cv_type_signal
4491 EOF
4492
4493
4494 echo $ac_n "checking for strftime""... $ac_c" 1>&6
4495 echo "configure:4496: checking for strftime" >&5
4496 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
4497   echo $ac_n "(cached) $ac_c" 1>&6
4498 else
4499   cat > conftest.$ac_ext <<EOF
4500 #line 4501 "configure"
4501 #include "confdefs.h"
4502 /* System header to define __stub macros and hopefully few prototypes,
4503     which can conflict with char strftime(); below.  */
4504 #include <assert.h>
4505 /* Override any gcc2 internal prototype to avoid an error.  */
4506 /* We use char because int might match the return type of a gcc2
4507     builtin and then its argument prototype would still apply.  */
4508 char strftime();
4509
4510 int main() {
4511
4512 /* The GNU C library defines this for functions which it implements
4513     to always fail with ENOSYS.  Some functions are actually named
4514     something starting with __ and the normal name is an alias.  */
4515 #if defined (__stub_strftime) || defined (__stub___strftime)
4516 choke me
4517 #else
4518 strftime();
4519 #endif
4520
4521 ; return 0; }
4522 EOF
4523 if { (eval echo configure:4524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4524   rm -rf conftest*
4525   eval "ac_cv_func_strftime=yes"
4526 else
4527   echo "configure: failed program was:" >&5
4528   cat conftest.$ac_ext >&5
4529   rm -rf conftest*
4530   eval "ac_cv_func_strftime=no"
4531 fi
4532 rm -f conftest*
4533 fi
4534
4535 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
4536   echo "$ac_t""yes" 1>&6
4537   cat >> confdefs.h <<\EOF
4538 #define HAVE_STRFTIME 1
4539 EOF
4540
4541 else
4542   echo "$ac_t""no" 1>&6
4543 # strftime is in -lintl on SCO UNIX.
4544 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
4545 echo "configure:4546: checking for strftime in -lintl" >&5
4546 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
4547 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4548   echo $ac_n "(cached) $ac_c" 1>&6
4549 else
4550   ac_save_LIBS="$LIBS"
4551 LIBS="-lintl  $LIBS"
4552 cat > conftest.$ac_ext <<EOF
4553 #line 4554 "configure"
4554 #include "confdefs.h"
4555 /* Override any gcc2 internal prototype to avoid an error.  */
4556 /* We use char because int might match the return type of a gcc2
4557     builtin and then its argument prototype would still apply.  */
4558 char strftime();
4559
4560 int main() {
4561 strftime()
4562 ; return 0; }
4563 EOF
4564 if { (eval echo configure:4565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4565   rm -rf conftest*
4566   eval "ac_cv_lib_$ac_lib_var=yes"
4567 else
4568   echo "configure: failed program was:" >&5
4569   cat conftest.$ac_ext >&5
4570   rm -rf conftest*
4571   eval "ac_cv_lib_$ac_lib_var=no"
4572 fi
4573 rm -f conftest*
4574 LIBS="$ac_save_LIBS"
4575
4576 fi
4577 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4578   echo "$ac_t""yes" 1>&6
4579   cat >> confdefs.h <<\EOF
4580 #define HAVE_STRFTIME 1
4581 EOF
4582
4583 LIBS="-lintl $LIBS"
4584 else
4585   echo "$ac_t""no" 1>&6
4586 fi
4587
4588 fi
4589
4590 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
4591 echo "configure:4592: checking for vprintf" >&5
4592 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
4593   echo $ac_n "(cached) $ac_c" 1>&6
4594 else
4595   cat > conftest.$ac_ext <<EOF
4596 #line 4597 "configure"
4597 #include "confdefs.h"
4598 /* System header to define __stub macros and hopefully few prototypes,
4599     which can conflict with char vprintf(); below.  */
4600 #include <assert.h>
4601 /* Override any gcc2 internal prototype to avoid an error.  */
4602 /* We use char because int might match the return type of a gcc2
4603     builtin and then its argument prototype would still apply.  */
4604 char vprintf();
4605
4606 int main() {
4607
4608 /* The GNU C library defines this for functions which it implements
4609     to always fail with ENOSYS.  Some functions are actually named
4610     something starting with __ and the normal name is an alias.  */
4611 #if defined (__stub_vprintf) || defined (__stub___vprintf)
4612 choke me
4613 #else
4614 vprintf();
4615 #endif
4616
4617 ; return 0; }
4618 EOF
4619 if { (eval echo configure:4620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4620   rm -rf conftest*
4621   eval "ac_cv_func_vprintf=yes"
4622 else
4623   echo "configure: failed program was:" >&5
4624   cat conftest.$ac_ext >&5
4625   rm -rf conftest*
4626   eval "ac_cv_func_vprintf=no"
4627 fi
4628 rm -f conftest*
4629 fi
4630
4631 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
4632   echo "$ac_t""yes" 1>&6
4633   cat >> confdefs.h <<\EOF
4634 #define HAVE_VPRINTF 1
4635 EOF
4636
4637 else
4638   echo "$ac_t""no" 1>&6
4639 fi
4640
4641 if test "$ac_cv_func_vprintf" != yes; then
4642 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
4643 echo "configure:4644: checking for _doprnt" >&5
4644 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
4645   echo $ac_n "(cached) $ac_c" 1>&6
4646 else
4647   cat > conftest.$ac_ext <<EOF
4648 #line 4649 "configure"
4649 #include "confdefs.h"
4650 /* System header to define __stub macros and hopefully few prototypes,
4651     which can conflict with char _doprnt(); below.  */
4652 #include <assert.h>
4653 /* Override any gcc2 internal prototype to avoid an error.  */
4654 /* We use char because int might match the return type of a gcc2
4655     builtin and then its argument prototype would still apply.  */
4656 char _doprnt();
4657
4658 int main() {
4659
4660 /* The GNU C library defines this for functions which it implements
4661     to always fail with ENOSYS.  Some functions are actually named
4662     something starting with __ and the normal name is an alias.  */
4663 #if defined (__stub__doprnt) || defined (__stub____doprnt)
4664 choke me
4665 #else
4666 _doprnt();
4667 #endif
4668
4669 ; return 0; }
4670 EOF
4671 if { (eval echo configure:4672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4672   rm -rf conftest*
4673   eval "ac_cv_func__doprnt=yes"
4674 else
4675   echo "configure: failed program was:" >&5
4676   cat conftest.$ac_ext >&5
4677   rm -rf conftest*
4678   eval "ac_cv_func__doprnt=no"
4679 fi
4680 rm -f conftest*
4681 fi
4682
4683 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
4684   echo "$ac_t""yes" 1>&6
4685   cat >> confdefs.h <<\EOF
4686 #define HAVE_DOPRNT 1
4687 EOF
4688
4689 else
4690   echo "$ac_t""no" 1>&6
4691 fi
4692
4693 fi
4694
4695 echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6
4696 echo "configure:4697: checking for wait3 that fills in rusage" >&5
4697 if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then
4698   echo $ac_n "(cached) $ac_c" 1>&6
4699 else
4700   if test "$cross_compiling" = yes; then
4701   ac_cv_func_wait3_rusage=no
4702 else
4703   cat > conftest.$ac_ext <<EOF
4704 #line 4705 "configure"
4705 #include "confdefs.h"
4706 #include <sys/types.h>
4707 #include <sys/time.h>
4708 #include <sys/resource.h>
4709 #include <stdio.h>
4710 /* HP-UX has wait3 but does not fill in rusage at all.  */
4711 main() {
4712   struct rusage r;
4713   int i;
4714   /* Use a field that we can force nonzero --
4715      voluntary context switches.
4716      For systems like NeXT and OSF/1 that don't set it,
4717      also use the system CPU time.  And page faults (I/O) for Linux.  */
4718   r.ru_nvcsw = 0;
4719   r.ru_stime.tv_sec = 0;
4720   r.ru_stime.tv_usec = 0;
4721   r.ru_majflt = r.ru_minflt = 0;
4722   switch (fork()) {
4723   case 0: /* Child.  */
4724     sleep(1); /* Give up the CPU.  */
4725     _exit(0);
4726   case -1: _exit(0); /* What can we do?  */
4727   default: /* Parent.  */
4728     wait3(&i, 0, &r);
4729     sleep(2); /* Avoid "text file busy" from rm on fast HP-UX machines.  */
4730     exit(r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0
4731          && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
4732   }
4733 }
4734 EOF
4735 if { (eval echo configure:4736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
4736 then
4737   ac_cv_func_wait3_rusage=yes
4738 else
4739   echo "configure: failed program was:" >&5
4740   cat conftest.$ac_ext >&5
4741   rm -fr conftest*
4742   ac_cv_func_wait3_rusage=no
4743 fi
4744 rm -fr conftest*
4745 fi
4746
4747 fi
4748
4749 echo "$ac_t""$ac_cv_func_wait3_rusage" 1>&6
4750 if test $ac_cv_func_wait3_rusage = yes; then
4751   cat >> confdefs.h <<\EOF
4752 #define HAVE_WAIT3 1
4753 EOF
4754
4755 fi
4756
4757
4758 for ac_func in \
4759         gethostname             \
4760         gettimeofday    \
4761         mktime                  \
4762         select                  \
4763         socket                  \
4764         strerror                \
4765         strstr                  \
4766         strrchr                 \
4767         strtod                  \
4768         strtol                  \
4769         strtoul                 \
4770         strsep                  \
4771         memcpy                  \
4772
4773 do
4774 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4775 echo "configure:4776: checking for $ac_func" >&5
4776 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4777   echo $ac_n "(cached) $ac_c" 1>&6
4778 else
4779   cat > conftest.$ac_ext <<EOF
4780 #line 4781 "configure"
4781 #include "confdefs.h"
4782 /* System header to define __stub macros and hopefully few prototypes,
4783     which can conflict with char $ac_func(); below.  */
4784 #include <assert.h>
4785 /* Override any gcc2 internal prototype to avoid an error.  */
4786 /* We use char because int might match the return type of a gcc2
4787     builtin and then its argument prototype would still apply.  */
4788 char $ac_func();
4789
4790 int main() {
4791
4792 /* The GNU C library defines this for functions which it implements
4793     to always fail with ENOSYS.  Some functions are actually named
4794     something starting with __ and the normal name is an alias.  */
4795 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4796 choke me
4797 #else
4798 $ac_func();
4799 #endif
4800
4801 ; return 0; }
4802 EOF
4803 if { (eval echo configure:4804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4804   rm -rf conftest*
4805   eval "ac_cv_func_$ac_func=yes"
4806 else
4807   echo "configure: failed program was:" >&5
4808   cat conftest.$ac_ext >&5
4809   rm -rf conftest*
4810   eval "ac_cv_func_$ac_func=no"
4811 fi
4812 rm -f conftest*
4813 fi
4814
4815 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4816   echo "$ac_t""yes" 1>&6
4817     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4818   cat >> confdefs.h <<EOF
4819 #define $ac_tr_func 1
4820 EOF
4821  
4822 else
4823   echo "$ac_t""no" 1>&6
4824 fi
4825 done
4826
4827
4828 for ac_func in strdup
4829 do
4830 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4831 echo "configure:4832: checking for $ac_func" >&5
4832 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4833   echo $ac_n "(cached) $ac_c" 1>&6
4834 else
4835   cat > conftest.$ac_ext <<EOF
4836 #line 4837 "configure"
4837 #include "confdefs.h"
4838 /* System header to define __stub macros and hopefully few prototypes,
4839     which can conflict with char $ac_func(); below.  */
4840 #include <assert.h>
4841 /* Override any gcc2 internal prototype to avoid an error.  */
4842 /* We use char because int might match the return type of a gcc2
4843     builtin and then its argument prototype would still apply.  */
4844 char $ac_func();
4845
4846 int main() {
4847
4848 /* The GNU C library defines this for functions which it implements
4849     to always fail with ENOSYS.  Some functions are actually named
4850     something starting with __ and the normal name is an alias.  */
4851 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4852 choke me
4853 #else
4854 $ac_func();
4855 #endif
4856
4857 ; return 0; }
4858 EOF
4859 if { (eval echo configure:4860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4860   rm -rf conftest*
4861   eval "ac_cv_func_$ac_func=yes"
4862 else
4863   echo "configure: failed program was:" >&5
4864   cat conftest.$ac_ext >&5
4865   rm -rf conftest*
4866   eval "ac_cv_func_$ac_func=no"
4867 fi
4868 rm -f conftest*
4869 fi
4870
4871 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4872   echo "$ac_t""yes" 1>&6
4873     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4874   cat >> confdefs.h <<EOF
4875 #define $ac_tr_func 1
4876 EOF
4877  
4878 else
4879   echo "$ac_t""no" 1>&6
4880 LIBOBJS="$LIBOBJS ${ac_func}.o"
4881 fi
4882 done
4883
4884
4885
4886 # Check Configuration
4887
4888 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
4889 echo "configure:4890: checking declaration of sys_errlist" >&5
4890 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
4891   echo $ac_n "(cached) $ac_c" 1>&6
4892 else
4893   
4894         cat > conftest.$ac_ext <<EOF
4895 #line 4896 "configure"
4896 #include "confdefs.h"
4897
4898 #include <stdio.h>
4899 #include <sys/types.h>
4900 #include <errno.h> 
4901 int main() {
4902 char *c = (char *) *sys_errlist
4903 ; return 0; }
4904 EOF
4905 if { (eval echo configure:4906: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4906   rm -rf conftest*
4907   ol_cv_dcl_sys_errlist=yes
4908 else
4909   echo "configure: failed program was:" >&5
4910   cat conftest.$ac_ext >&5
4911   rm -rf conftest*
4912   ol_cv_dcl_sys_errlist=no
4913 fi
4914 rm -f conftest*
4915 fi
4916
4917 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
4918
4919 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
4920 if test $ol_cv_dcl_sys_errlist = no ; then
4921         cat >> confdefs.h <<\EOF
4922 #define DECL_SYS_ERRLIST 1
4923 EOF
4924
4925         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
4926 echo "configure:4927: checking existence of sys_errlist" >&5
4927         if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
4928   echo $ac_n "(cached) $ac_c" 1>&6
4929 else
4930   
4931                 cat > conftest.$ac_ext <<EOF
4932 #line 4933 "configure"
4933 #include "confdefs.h"
4934 #include <errno.h>
4935 int main() {
4936 char *c = (char *) *sys_errlist
4937 ; return 0; }
4938 EOF
4939 if { (eval echo configure:4940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4940   rm -rf conftest*
4941   ol_cv_have_sys_errlist=yes
4942 else
4943   echo "configure: failed program was:" >&5
4944   cat conftest.$ac_ext >&5
4945   rm -rf conftest*
4946   ol_cv_have_sys_errlist=no
4947 fi
4948 rm -f conftest*
4949 fi
4950
4951         echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
4952 fi
4953
4954
4955
4956 if test $ol_enable_debug != no ; then
4957         LDAP_DEFS="$LDAP_DEFS -DLDAP_DEBUG"
4958 fi
4959 if test $ol_enable_libui = no ; then
4960         LDAP_DEFS="$LDAP_DEFS -DNO_USERINTERFACE"
4961 fi
4962 if test $ol_enable_cache = no ; then
4963         LDAP_DEFS="$LDAP_DEFS -DNO_CACHE"
4964 fi
4965 if test $ol_enable_dns != no ; then
4966         LDAP_DEFS="$LDAP_DEFS -DLDAP_DNS"
4967 fi
4968 if test $ol_enable_referrals != no ; then
4969         LDAP_DEFS="$LDAP_DEFS -DLDAP_REFERRALS"
4970 fi
4971 if test $ol_enable_cldap != no ; then
4972         LDAP_DEFS="$LDAP_DEFS -DCLDAP"
4973 fi
4974
4975 if test $ol_enable_aclgroup != no ; then
4976         cat >> confdefs.h <<\EOF
4977 #define SLAPD_ACLGROUP 1
4978 EOF
4979
4980         SLAPD_DEFS="$SLAPD_DEFS -DACLGROUP"
4981 fi
4982
4983 if test $ol_enable_md5 != no ; then
4984         LUTIL_DEFS="$LUTIL_DEFS -DLDAP_MD5"
4985 fi
4986
4987 if test $ol_enable_sha1 != no ; then
4988         LUTIL_DEFS="$LUTIL_DEFS -DLDAP_SHA1"
4989 fi
4990
4991 if test $ol_enable_phonetic != no ; then
4992         cat >> confdefs.h <<\EOF
4993 #define SLAPD_PHONETIC 1
4994 EOF
4995
4996         SLAPD_DEFS="$SLAPD_DEFS -DSOUNDEX"
4997 fi
4998
4999 if test $ol_enable_rlookups != no ; then
5000         cat >> confdefs.h <<\EOF
5001 #define SLAPD_RLOOKUPS 1
5002 EOF
5003
5004         SLAPD_DEFS="$SLAPD_DEFS -DREVERSE_LOOKUPS"
5005 fi
5006
5007 if test $ol_link_ldbm != no ; then
5008         BUILD_SLAPD=yes
5009         BUILD_LDBM=yes
5010         LDBM_DEFS="-DLDAP_LDBM $LDBM_DEFS"
5011 fi
5012
5013 if test $ol_enable_passwd != no ; then
5014         BUILD_SLAPD=yes
5015         BUILD_PASSWD=yes
5016         SLAPD_DEFS="-DLDAP_PASSWD $SLAPD_DEFS"
5017 fi
5018
5019 if test $ol_enable_shell != no ; then
5020         BUILD_SLAPD=yes
5021         BUILD_SHELL=yes
5022         SLAPD_DEFS="-DLDAP_SHELL $SLAPD_DEFS"
5023 fi
5024
5025 if test $ol_enable_slurpd != no -a $ol_link_threads != no -a \
5026         $BUILD_SLAPD = yes ; then
5027         BUILD_SLURPD=yes
5028 fi
5029
5030
5031
5032
5033   
5034   
5035   
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056 trap '' 1 2 15
5057 cat > confcache <<\EOF
5058 # This file is a shell script that caches the results of configure
5059 # tests run on this system so they can be shared between configure
5060 # scripts and configure runs.  It is not useful on other systems.
5061 # If it contains results you don't want to keep, you may remove or edit it.
5062 #
5063 # By default, configure uses ./config.cache as the cache file,
5064 # creating it if it does not exist already.  You can give configure
5065 # the --cache-file=FILE option to use a different cache file; that is
5066 # what configure does when it calls configure scripts in
5067 # subdirectories, so they share the cache.
5068 # Giving --cache-file=/dev/null disables caching, for debugging configure.
5069 # config.status only pays attention to the cache file if you give it the
5070 # --recheck option to rerun configure.
5071 #
5072 EOF
5073 # The following way of writing the cache mishandles newlines in values,
5074 # but we know of no workaround that is simple, portable, and efficient.
5075 # So, don't put newlines in cache variables' values.
5076 # Ultrix sh set writes to stderr and can't be redirected directly,
5077 # and sets the high bit in the cache file unless we assign to the vars.
5078 (set) 2>&1 |
5079   case `(ac_space=' '; set) 2>&1` in
5080   *ac_space=\ *)
5081     # `set' does not quote correctly, so add quotes (double-quote substitution
5082     # turns \\\\ into \\, and sed turns \\ into \).
5083     sed -n \
5084       -e "s/'/'\\\\''/g" \
5085       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
5086     ;;
5087   *)
5088     # `set' quotes correctly as required by POSIX, so do not add quotes.
5089     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
5090     ;;
5091   esac >> confcache
5092 if cmp -s $cache_file confcache; then
5093   :
5094 else
5095   if test -w $cache_file; then
5096     echo "updating cache $cache_file"
5097     cat confcache > $cache_file
5098   else
5099     echo "not updating unwritable cache $cache_file"
5100   fi
5101 fi
5102 rm -f confcache
5103
5104 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
5105
5106 test "x$prefix" = xNONE && prefix=$ac_default_prefix
5107 # Let make expand exec_prefix.
5108 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
5109
5110 # Any assignment to VPATH causes Sun make to only execute
5111 # the first set of double-colon rules, so remove it if not needed.
5112 # If there is a colon in the path, we need to keep it.
5113 if test "x$srcdir" = x.; then
5114   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
5115 fi
5116
5117 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
5118
5119 DEFS=-DHAVE_CONFIG_H
5120
5121 # Without the "./", some shells look in PATH for config.status.
5122 : ${CONFIG_STATUS=./config.status}
5123
5124 echo creating $CONFIG_STATUS
5125 rm -f $CONFIG_STATUS
5126 cat > $CONFIG_STATUS <<EOF
5127 #! /bin/sh
5128 # Generated automatically by configure.
5129 # Run this file to recreate the current configuration.
5130 # This directory was configured as follows,
5131 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
5132 #
5133 # $0 $ac_configure_args
5134 #
5135 # Compiler output produced by configure, useful for debugging
5136 # configure, is in ./config.log if it exists.
5137
5138 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
5139 for ac_option
5140 do
5141   case "\$ac_option" in
5142   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
5143     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
5144     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
5145   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
5146     echo "$CONFIG_STATUS generated by autoconf version 2.12"
5147     exit 0 ;;
5148   -help | --help | --hel | --he | --h)
5149     echo "\$ac_cs_usage"; exit 0 ;;
5150   *) echo "\$ac_cs_usage"; exit 1 ;;
5151   esac
5152 done
5153
5154 ac_given_srcdir=$srcdir
5155 ac_given_INSTALL="$INSTALL"
5156
5157 trap 'rm -fr `echo "\
5158 Makefile:build/top.mk:Makefile.in:build/dir.mk \
5159 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
5160 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
5161 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
5162 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
5163 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
5164 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
5165 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
5166 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
5167 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
5168 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
5169 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
5170 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
5171 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
5172 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
5173 include/Makefile:build/top.mk:include/Makefile.in \
5174 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
5175 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk \
5176 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk \
5177 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk \
5178 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk \
5179 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk \
5180 libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk \
5181 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk \
5182 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
5183 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
5184 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
5185 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
5186 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
5187 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
5188 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
5189 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
5190 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
5191 tests/Makefile:build/top.mk:tests/Makefile.in \
5192  include/portable.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
5193 EOF
5194 cat >> $CONFIG_STATUS <<EOF
5195
5196 # Protect against being on the right side of a sed subst in config.status.
5197 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
5198  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
5199 $ac_vpsub
5200 $extrasub
5201 s%@CFLAGS@%$CFLAGS%g
5202 s%@CPPFLAGS@%$CPPFLAGS%g
5203 s%@CXXFLAGS@%$CXXFLAGS%g
5204 s%@DEFS@%$DEFS%g
5205 s%@LDFLAGS@%$LDFLAGS%g
5206 s%@LIBS@%$LIBS%g
5207 s%@exec_prefix@%$exec_prefix%g
5208 s%@prefix@%$prefix%g
5209 s%@program_transform_name@%$program_transform_name%g
5210 s%@bindir@%$bindir%g
5211 s%@sbindir@%$sbindir%g
5212 s%@libexecdir@%$libexecdir%g
5213 s%@datadir@%$datadir%g
5214 s%@sysconfdir@%$sysconfdir%g
5215 s%@sharedstatedir@%$sharedstatedir%g
5216 s%@localstatedir@%$localstatedir%g
5217 s%@libdir@%$libdir%g
5218 s%@includedir@%$includedir%g
5219 s%@oldincludedir@%$oldincludedir%g
5220 s%@infodir@%$infodir%g
5221 s%@mandir@%$mandir%g
5222 s%@CC@%$CC%g
5223 s%@CPP@%$CPP%g
5224 s%@LN_S@%$LN_S%g
5225 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
5226 s%@INSTALL_DATA@%$INSTALL_DATA%g
5227 s%@RANLIB@%$RANLIB%g
5228 s%@SET_MAKE@%$SET_MAKE%g
5229 s%@SENDMAIL@%$SENDMAIL%g
5230 s%@EDITOR@%$EDITOR%g
5231 s%@FINGER@%$FINGER%g
5232 s%@TERMCAP_DEFS@%$TERMCAP_DEFS%g
5233 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
5234 s%@LIBOBJS@%$LIBOBJS%g
5235 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
5236 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
5237 s%@BUILD_LDBM@%$BUILD_LDBM%g
5238 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
5239 s%@BUILD_SHELL@%$BUILD_SHELL%g
5240 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
5241 s%@LDAP_DEFS@%$LDAP_DEFS%g
5242 s%@LDAP_LIBS@%$LDAP_LIBS%g
5243 s%@LDAPD_DEFS@%$LDAPD_DEFS%g
5244 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
5245 s%@SLAPD_DEFS@%$SLAPD_DEFS%g
5246 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
5247 s%@SLURPD_DEFS@%$SLURPD_DEFS%g
5248 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
5249 s%@LDBM_DEFS@%$LDBM_DEFS%g
5250 s%@LDBM_LIBS@%$LDBM_LIBS%g
5251 s%@LTHREAD_DEFS@%$LTHREAD_DEFS%g
5252 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
5253 s%@LUTIL_DEFS@%$LUTIL_DEFS%g
5254 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
5255
5256 CEOF
5257 EOF
5258
5259 cat >> $CONFIG_STATUS <<\EOF
5260
5261 # Split the substitutions into bite-sized pieces for seds with
5262 # small command number limits, like on Digital OSF/1 and HP-UX.
5263 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
5264 ac_file=1 # Number of current file.
5265 ac_beg=1 # First line for current file.
5266 ac_end=$ac_max_sed_cmds # Line after last line for current file.
5267 ac_more_lines=:
5268 ac_sed_cmds=""
5269 while $ac_more_lines; do
5270   if test $ac_beg -gt 1; then
5271     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
5272   else
5273     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
5274   fi
5275   if test ! -s conftest.s$ac_file; then
5276     ac_more_lines=false
5277     rm -f conftest.s$ac_file
5278   else
5279     if test -z "$ac_sed_cmds"; then
5280       ac_sed_cmds="sed -f conftest.s$ac_file"
5281     else
5282       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
5283     fi
5284     ac_file=`expr $ac_file + 1`
5285     ac_beg=$ac_end
5286     ac_end=`expr $ac_end + $ac_max_sed_cmds`
5287   fi
5288 done
5289 if test -z "$ac_sed_cmds"; then
5290   ac_sed_cmds=cat
5291 fi
5292 EOF
5293
5294 cat >> $CONFIG_STATUS <<EOF
5295
5296 CONFIG_FILES=\${CONFIG_FILES-"\
5297 Makefile:build/top.mk:Makefile.in:build/dir.mk \
5298 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
5299 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
5300 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
5301 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
5302 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
5303 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
5304 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
5305 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
5306 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
5307 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
5308 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
5309 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
5310 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
5311 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
5312 include/Makefile:build/top.mk:include/Makefile.in \
5313 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
5314 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk \
5315 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk \
5316 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk \
5317 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk \
5318 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk \
5319 libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk \
5320 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk \
5321 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
5322 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
5323 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
5324 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
5325 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
5326 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
5327 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
5328 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
5329 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
5330 tests/Makefile:build/top.mk:tests/Makefile.in \
5331 "}
5332 EOF
5333 cat >> $CONFIG_STATUS <<\EOF
5334 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
5335   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
5336   case "$ac_file" in
5337   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
5338        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
5339   *) ac_file_in="${ac_file}.in" ;;
5340   esac
5341
5342   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
5343
5344   # Remove last slash and all that follows it.  Not all systems have dirname.
5345   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
5346   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
5347     # The file is in a subdirectory.
5348     test ! -d "$ac_dir" && mkdir "$ac_dir"
5349     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
5350     # A "../" for each directory in $ac_dir_suffix.
5351     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
5352   else
5353     ac_dir_suffix= ac_dots=
5354   fi
5355
5356   case "$ac_given_srcdir" in
5357   .)  srcdir=.
5358       if test -z "$ac_dots"; then top_srcdir=.
5359       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
5360   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
5361   *) # Relative path.
5362     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
5363     top_srcdir="$ac_dots$ac_given_srcdir" ;;
5364   esac
5365
5366   case "$ac_given_INSTALL" in
5367   [/$]*) INSTALL="$ac_given_INSTALL" ;;
5368   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
5369   esac
5370
5371   echo creating "$ac_file"
5372   rm -f "$ac_file"
5373   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
5374   case "$ac_file" in
5375   *Makefile*) ac_comsub="1i\\
5376 # $configure_input" ;;
5377   *) ac_comsub= ;;
5378   esac
5379
5380   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
5381   sed -e "$ac_comsub
5382 s%@configure_input@%$configure_input%g
5383 s%@srcdir@%$srcdir%g
5384 s%@top_srcdir@%$top_srcdir%g
5385 s%@INSTALL@%$INSTALL%g
5386 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
5387 fi; done
5388 rm -f conftest.s*
5389
5390 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
5391 # NAME is the cpp macro being defined and VALUE is the value it is being given.
5392 #
5393 # ac_d sets the value in "#define NAME VALUE" lines.
5394 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
5395 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
5396 ac_dC='\3'
5397 ac_dD='%g'
5398 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
5399 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
5400 ac_uB='\([      ]\)%\1#\2define\3'
5401 ac_uC=' '
5402 ac_uD='\4%g'
5403 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
5404 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
5405 ac_eB='$%\1#\2define\3'
5406 ac_eC=' '
5407 ac_eD='%g'
5408
5409 if test "${CONFIG_HEADERS+set}" != set; then
5410 EOF
5411 cat >> $CONFIG_STATUS <<EOF
5412   CONFIG_HEADERS="include/portable.h"
5413 EOF
5414 cat >> $CONFIG_STATUS <<\EOF
5415 fi
5416 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
5417   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
5418   case "$ac_file" in
5419   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
5420        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
5421   *) ac_file_in="${ac_file}.in" ;;
5422   esac
5423
5424   echo creating $ac_file
5425
5426   rm -f conftest.frag conftest.in conftest.out
5427   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
5428   cat $ac_file_inputs > conftest.in
5429
5430 EOF
5431
5432 # Transform confdefs.h into a sed script conftest.vals that substitutes
5433 # the proper values into config.h.in to produce config.h.  And first:
5434 # Protect against being on the right side of a sed subst in config.status.
5435 # Protect against being in an unquoted here document in config.status.
5436 rm -f conftest.vals
5437 cat > conftest.hdr <<\EOF
5438 s/[\\&%]/\\&/g
5439 s%[\\$`]%\\&%g
5440 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
5441 s%ac_d%ac_u%gp
5442 s%ac_u%ac_e%gp
5443 EOF
5444 sed -n -f conftest.hdr confdefs.h > conftest.vals
5445 rm -f conftest.hdr
5446
5447 # This sed command replaces #undef with comments.  This is necessary, for
5448 # example, in the case of _POSIX_SOURCE, which is predefined and required
5449 # on some systems where configure will not decide to define it.
5450 cat >> conftest.vals <<\EOF
5451 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
5452 EOF
5453
5454 # Break up conftest.vals because some shells have a limit on
5455 # the size of here documents, and old seds have small limits too.
5456
5457 rm -f conftest.tail
5458 while :
5459 do
5460   ac_lines=`grep -c . conftest.vals`
5461   # grep -c gives empty output for an empty file on some AIX systems.
5462   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
5463   # Write a limited-size here document to conftest.frag.
5464   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
5465   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
5466   echo 'CEOF
5467   sed -f conftest.frag conftest.in > conftest.out
5468   rm -f conftest.in
5469   mv conftest.out conftest.in
5470 ' >> $CONFIG_STATUS
5471   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
5472   rm -f conftest.vals
5473   mv conftest.tail conftest.vals
5474 done
5475 rm -f conftest.vals
5476
5477 cat >> $CONFIG_STATUS <<\EOF
5478   rm -f conftest.frag conftest.h
5479   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
5480   cat conftest.in >> conftest.h
5481   rm -f conftest.in
5482   if cmp -s $ac_file conftest.h 2>/dev/null; then
5483     echo "$ac_file is unchanged"
5484     rm -f conftest.h
5485   else
5486     # Remove last slash and all that follows it.  Not all systems have dirname.
5487       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
5488       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
5489       # The file is in a subdirectory.
5490       test ! -d "$ac_dir" && mkdir "$ac_dir"
5491     fi
5492     rm -f $ac_file
5493     mv conftest.h $ac_file
5494   fi
5495 fi; done
5496
5497 EOF
5498 cat >> $CONFIG_STATUS <<EOF
5499
5500 EOF
5501 cat >> $CONFIG_STATUS <<\EOF
5502 date > stamp-h
5503 exit 0
5504 EOF
5505 chmod +x $CONFIG_STATUS
5506 rm -fr confdefs* $ac_clean_files
5507 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
5508