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