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