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