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