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