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