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