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