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