]> git.sur5r.net Git - openldap/blob - configure
Relocate regex.h test to near top and die if it fails.
[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-syslog       enable syslog support (auto)"
21 ac_help="$ac_help
22   --enable-proctitle    enable proctitle support (yes)"
23 ac_help="$ac_help
24   --enable-cache        enable caching (yes)"
25 ac_help="$ac_help
26   --enable-dns          enable V2 DNS  extension (no)"
27 ac_help="$ac_help
28   --enable-referrals    enable V2 Referrals extension (yes)"
29 ac_help="$ac_help
30   --enable-cldap        enable connectionless ldap (no)"
31 ac_help="$ac_help
32   --enable-x-compile    enable cross compiling (no)"
33 ac_help="$ac_help
34   --enable-dmalloc      enable debug malloc support (no)"
35 ac_help="$ac_help
36   --with-kerberos       with Kerberos support (auto)"
37 ac_help="$ac_help
38   --with-readline  with readline support (auto)"
39 ac_help="$ac_help
40   --with-threads        use threads (auto)"
41 ac_help="$ac_help
42   --with-tls  with TLS/SSL support (auto)"
43 ac_help="$ac_help
44   --with-yielding-select        with implicitly yielding select (auto)"
45 ac_help="$ac_help
46 LDAPD Options:"
47 ac_help="$ac_help
48   --enable-ldapd        enable building ldapd (no)"
49 ac_help="$ac_help
50 SLAPD Options:"
51 ac_help="$ac_help
52   --enable-slapd        enable building slapd (yes)"
53 ac_help="$ac_help
54     --enable-aclgroups  enable ACL group support (auto)"
55 ac_help="$ac_help
56     --enable-cleartext  enable cleartext passwords (yes)"
57 ac_help="$ac_help
58     --enable-crypt      enable crypt(3) passwords (auto)"
59 ac_help="$ac_help
60     --enable-modules    enable dynamic module support (no)"
61 ac_help="$ac_help
62     --enable-phonetic   enable phonetic/soundex (no)"
63 ac_help="$ac_help
64     --enable-rlookups   enable reverse lookups (auto)"
65 ac_help="$ac_help
66     --enable-wrappers   enable tcp wrapper support (no)"
67 ac_help="$ac_help
68     --enable-bdb2       enable bdb2 backend (no)"
69 ac_help="$ac_help
70     --enable-ldap       enable ldap backend (no)"
71 ac_help="$ac_help
72     --enable-ldbm       enable ldbm backend (yes)"
73 ac_help="$ac_help
74       --with-ldbm-api   use LDBM API (auto)"
75 ac_help="$ac_help
76       --with-ldbm-type  use LDBM type (auto)"
77 ac_help="$ac_help
78     --enable-passwd     enable passwd backend (no)"
79 ac_help="$ac_help
80     --enable-perl       enable perl backend (no)"
81 ac_help="$ac_help
82     --enable-shell      enable shell backend (no)"
83 ac_help="$ac_help
84     --enable-tcl        enable tcl backend (no)"
85 ac_help="$ac_help
86 SLURPD Options:"
87 ac_help="$ac_help
88   --enable-slurpd       enable building slurpd (auto)"
89 ac_help="$ac_help
90 Library Generation & Linking Options"
91 ac_help="$ac_help
92   --enable-static         build static libraries [default=yes]
93   --enable-static=PKGS    only build shared libraries if the current package
94                           appears as an element in the PKGS list"
95 ac_help="$ac_help
96   --enable-shared         build shared libraries [default=yes]
97   --enable-shared=PKGS    only build shared libraries if the current package
98                           appears as an element in the PKGS list"
99 ac_help="$ac_help
100   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
101
102 # Initialize some variables set by options.
103 # The variables have the same names as the options, with
104 # dashes changed to underlines.
105 build=NONE
106 cache_file=./config.cache
107 exec_prefix=NONE
108 host=NONE
109 no_create=
110 nonopt=NONE
111 no_recursion=
112 prefix=NONE
113 program_prefix=NONE
114 program_suffix=NONE
115 program_transform_name=s,x,x,
116 silent=
117 site=
118 srcdir=
119 target=NONE
120 verbose=
121 x_includes=NONE
122 x_libraries=NONE
123 bindir='${exec_prefix}/bin'
124 sbindir='${exec_prefix}/sbin'
125 libexecdir='${exec_prefix}/libexec'
126 datadir='${prefix}/share'
127 sysconfdir='${prefix}/etc'
128 sharedstatedir='${prefix}/com'
129 localstatedir='${prefix}/var'
130 libdir='${exec_prefix}/lib'
131 includedir='${prefix}/include'
132 oldincludedir='/usr/include'
133 infodir='${prefix}/info'
134 mandir='${prefix}/man'
135
136 # Initialize some other variables.
137 subdirs=
138 MFLAGS= MAKEFLAGS=
139 SHELL=${CONFIG_SHELL-/bin/sh}
140 # Maximum number of lines to put in a shell here document.
141 ac_max_here_lines=12
142
143 ac_prev=
144 for ac_option
145 do
146
147   # If the previous option needs an argument, assign it.
148   if test -n "$ac_prev"; then
149     eval "$ac_prev=\$ac_option"
150     ac_prev=
151     continue
152   fi
153
154   case "$ac_option" in
155   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
156   *) ac_optarg= ;;
157   esac
158
159   # Accept the important Cygnus configure options, so we can diagnose typos.
160
161   case "$ac_option" in
162
163   -bindir | --bindir | --bindi | --bind | --bin | --bi)
164     ac_prev=bindir ;;
165   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
166     bindir="$ac_optarg" ;;
167
168   -build | --build | --buil | --bui | --bu)
169     ac_prev=build ;;
170   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
171     build="$ac_optarg" ;;
172
173   -cache-file | --cache-file | --cache-fil | --cache-fi \
174   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
175     ac_prev=cache_file ;;
176   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
177   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
178     cache_file="$ac_optarg" ;;
179
180   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
181     ac_prev=datadir ;;
182   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
183   | --da=*)
184     datadir="$ac_optarg" ;;
185
186   -disable-* | --disable-*)
187     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
188     # Reject names that are not valid shell variable names.
189     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
190       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
191     fi
192     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
193     eval "enable_${ac_feature}=no" ;;
194
195   -enable-* | --enable-*)
196     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
197     # Reject names that are not valid shell variable names.
198     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
199       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
200     fi
201     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
202     case "$ac_option" in
203       *=*) ;;
204       *) ac_optarg=yes ;;
205     esac
206     eval "enable_${ac_feature}='$ac_optarg'" ;;
207
208   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
209   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
210   | --exec | --exe | --ex)
211     ac_prev=exec_prefix ;;
212   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
213   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
214   | --exec=* | --exe=* | --ex=*)
215     exec_prefix="$ac_optarg" ;;
216
217   -gas | --gas | --ga | --g)
218     # Obsolete; use --with-gas.
219     with_gas=yes ;;
220
221   -help | --help | --hel | --he)
222     # Omit some internal or obsolete options to make the list less imposing.
223     # This message is too long to be a string in the A/UX 3.1 sh.
224     cat << EOF
225 Usage: configure [options] [host]
226 Options: [defaults in brackets after descriptions]
227 Configuration:
228   --cache-file=FILE       cache test results in FILE
229   --help                  print this message
230   --no-create             do not create output files
231   --quiet, --silent       do not print \`checking...' messages
232   --version               print the version of autoconf that created configure
233 Directory and file names:
234   --prefix=PREFIX         install architecture-independent files in PREFIX
235                           [$ac_default_prefix]
236   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
237                           [same as prefix]
238   --bindir=DIR            user executables in DIR [EPREFIX/bin]
239   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
240   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
241   --datadir=DIR           read-only architecture-independent data in DIR
242                           [PREFIX/share]
243   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
244   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
245                           [PREFIX/com]
246   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
247   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
248   --includedir=DIR        C header files in DIR [PREFIX/include]
249   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
250   --infodir=DIR           info documentation in DIR [PREFIX/info]
251   --mandir=DIR            man documentation in DIR [PREFIX/man]
252   --srcdir=DIR            find the sources in DIR [configure dir or ..]
253   --program-prefix=PREFIX prepend PREFIX to installed program names
254   --program-suffix=SUFFIX append SUFFIX to installed program names
255   --program-transform-name=PROGRAM
256                           run sed PROGRAM on installed program names
257 EOF
258     cat << EOF
259 Host type:
260   --build=BUILD           configure for building on BUILD [BUILD=HOST]
261   --host=HOST             configure for HOST [guessed]
262   --target=TARGET         configure for TARGET [TARGET=HOST]
263 Features and packages:
264   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
265   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
266   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
267   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
268   --x-includes=DIR        X include files are in DIR
269   --x-libraries=DIR       X library files are in DIR
270 EOF
271     if test -n "$ac_help"; then
272       echo "--enable and --with options recognized:$ac_help"
273     fi
274     exit 0 ;;
275
276   -host | --host | --hos | --ho)
277     ac_prev=host ;;
278   -host=* | --host=* | --hos=* | --ho=*)
279     host="$ac_optarg" ;;
280
281   -includedir | --includedir | --includedi | --included | --include \
282   | --includ | --inclu | --incl | --inc)
283     ac_prev=includedir ;;
284   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
285   | --includ=* | --inclu=* | --incl=* | --inc=*)
286     includedir="$ac_optarg" ;;
287
288   -infodir | --infodir | --infodi | --infod | --info | --inf)
289     ac_prev=infodir ;;
290   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
291     infodir="$ac_optarg" ;;
292
293   -libdir | --libdir | --libdi | --libd)
294     ac_prev=libdir ;;
295   -libdir=* | --libdir=* | --libdi=* | --libd=*)
296     libdir="$ac_optarg" ;;
297
298   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
299   | --libexe | --libex | --libe)
300     ac_prev=libexecdir ;;
301   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
302   | --libexe=* | --libex=* | --libe=*)
303     libexecdir="$ac_optarg" ;;
304
305   -localstatedir | --localstatedir | --localstatedi | --localstated \
306   | --localstate | --localstat | --localsta | --localst \
307   | --locals | --local | --loca | --loc | --lo)
308     ac_prev=localstatedir ;;
309   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
310   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
311   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
312     localstatedir="$ac_optarg" ;;
313
314   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
315     ac_prev=mandir ;;
316   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
317     mandir="$ac_optarg" ;;
318
319   -nfp | --nfp | --nf)
320     # Obsolete; use --without-fp.
321     with_fp=no ;;
322
323   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
324   | --no-cr | --no-c)
325     no_create=yes ;;
326
327   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
328   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
329     no_recursion=yes ;;
330
331   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
332   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
333   | --oldin | --oldi | --old | --ol | --o)
334     ac_prev=oldincludedir ;;
335   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
336   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
337   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
338     oldincludedir="$ac_optarg" ;;
339
340   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
341     ac_prev=prefix ;;
342   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
343     prefix="$ac_optarg" ;;
344
345   -program-prefix | --program-prefix | --program-prefi | --program-pref \
346   | --program-pre | --program-pr | --program-p)
347     ac_prev=program_prefix ;;
348   -program-prefix=* | --program-prefix=* | --program-prefi=* \
349   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
350     program_prefix="$ac_optarg" ;;
351
352   -program-suffix | --program-suffix | --program-suffi | --program-suff \
353   | --program-suf | --program-su | --program-s)
354     ac_prev=program_suffix ;;
355   -program-suffix=* | --program-suffix=* | --program-suffi=* \
356   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
357     program_suffix="$ac_optarg" ;;
358
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     ac_prev=program_transform_name ;;
367   -program-transform-name=* | --program-transform-name=* \
368   | --program-transform-nam=* | --program-transform-na=* \
369   | --program-transform-n=* | --program-transform-=* \
370   | --program-transform=* | --program-transfor=* \
371   | --program-transfo=* | --program-transf=* \
372   | --program-trans=* | --program-tran=* \
373   | --progr-tra=* | --program-tr=* | --program-t=*)
374     program_transform_name="$ac_optarg" ;;
375
376   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
377   | -silent | --silent | --silen | --sile | --sil)
378     silent=yes ;;
379
380   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
381     ac_prev=sbindir ;;
382   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
383   | --sbi=* | --sb=*)
384     sbindir="$ac_optarg" ;;
385
386   -sharedstatedir | --sharedstatedir | --sharedstatedi \
387   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
388   | --sharedst | --shareds | --shared | --share | --shar \
389   | --sha | --sh)
390     ac_prev=sharedstatedir ;;
391   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
392   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
393   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
394   | --sha=* | --sh=*)
395     sharedstatedir="$ac_optarg" ;;
396
397   -site | --site | --sit)
398     ac_prev=site ;;
399   -site=* | --site=* | --sit=*)
400     site="$ac_optarg" ;;
401
402   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
403     ac_prev=srcdir ;;
404   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
405     srcdir="$ac_optarg" ;;
406
407   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
408   | --syscon | --sysco | --sysc | --sys | --sy)
409     ac_prev=sysconfdir ;;
410   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
411   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
412     sysconfdir="$ac_optarg" ;;
413
414   -target | --target | --targe | --targ | --tar | --ta | --t)
415     ac_prev=target ;;
416   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
417     target="$ac_optarg" ;;
418
419   -v | -verbose | --verbose | --verbos | --verbo | --verb)
420     verbose=yes ;;
421
422   -version | --version | --versio | --versi | --vers)
423     echo "configure generated by autoconf version 2.13"
424     exit 0 ;;
425
426   -with-* | --with-*)
427     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
428     # Reject names that are not valid shell variable names.
429     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
430       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
431     fi
432     ac_package=`echo $ac_package| sed 's/-/_/g'`
433     case "$ac_option" in
434       *=*) ;;
435       *) ac_optarg=yes ;;
436     esac
437     eval "with_${ac_package}='$ac_optarg'" ;;
438
439   -without-* | --without-*)
440     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
441     # Reject names that are not valid shell variable names.
442     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
443       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
444     fi
445     ac_package=`echo $ac_package| sed 's/-/_/g'`
446     eval "with_${ac_package}=no" ;;
447
448   --x)
449     # Obsolete; use --with-x.
450     with_x=yes ;;
451
452   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
453   | --x-incl | --x-inc | --x-in | --x-i)
454     ac_prev=x_includes ;;
455   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
456   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
457     x_includes="$ac_optarg" ;;
458
459   -x-libraries | --x-libraries | --x-librarie | --x-librari \
460   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
461     ac_prev=x_libraries ;;
462   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
463   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
464     x_libraries="$ac_optarg" ;;
465
466   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
467     ;;
468
469   *)
470     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
471       echo "configure: warning: $ac_option: invalid host type" 1>&2
472     fi
473     if test "x$nonopt" != xNONE; then
474       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
475     fi
476     nonopt="$ac_option"
477     ;;
478
479   esac
480 done
481
482 if test -n "$ac_prev"; then
483   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
484 fi
485
486 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
487
488 # File descriptor usage:
489 # 0 standard input
490 # 1 file creation
491 # 2 errors and warnings
492 # 3 some systems may open it to /dev/tty
493 # 4 used on the Kubota Titan
494 # 6 checking for... messages and results
495 # 5 compiler messages saved in config.log
496 if test "$silent" = yes; then
497   exec 6>/dev/null
498 else
499   exec 6>&1
500 fi
501 exec 5>./config.log
502
503 echo "\
504 This file contains any messages produced by compilers while
505 running configure, to aid debugging if configure makes a mistake.
506 " 1>&5
507
508 # Strip out --no-create and --no-recursion so they do not pile up.
509 # Also quote any args containing shell metacharacters.
510 ac_configure_args=
511 for ac_arg
512 do
513   case "$ac_arg" in
514   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
515   | --no-cr | --no-c) ;;
516   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
517   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
518   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
519   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
520   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
521   esac
522 done
523
524 # NLS nuisances.
525 # Only set these to C if already set.  These must not be set unconditionally
526 # because not all systems understand e.g. LANG=C (notably SCO).
527 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
528 # Non-C LC_CTYPE values break the ctype check.
529 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
530 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
531 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
532 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
533
534 # confdefs.h avoids OS command line length limits that DEFS can exceed.
535 rm -rf conftest* confdefs.h
536 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
537 echo > confdefs.h
538
539 # A filename unique to this package, relative to the directory that
540 # configure is in, which we can look for to find out if srcdir is correct.
541 ac_unique_file=build/version
542
543 # Find the source files, if location was not specified.
544 if test -z "$srcdir"; then
545   ac_srcdir_defaulted=yes
546   # Try the directory containing this script, then its parent.
547   ac_prog=$0
548   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
549   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
550   srcdir=$ac_confdir
551   if test ! -r $srcdir/$ac_unique_file; then
552     srcdir=..
553   fi
554 else
555   ac_srcdir_defaulted=no
556 fi
557 if test ! -r $srcdir/$ac_unique_file; then
558   if test "$ac_srcdir_defaulted" = yes; then
559     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
560   else
561     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
562   fi
563 fi
564 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
565
566 # Prefer explicitly selected file to automatically selected ones.
567 if test -z "$CONFIG_SITE"; then
568   if test "x$prefix" != xNONE; then
569     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
570   else
571     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
572   fi
573 fi
574 for ac_site_file in $CONFIG_SITE; do
575   if test -r "$ac_site_file"; then
576     echo "loading site script $ac_site_file"
577     . "$ac_site_file"
578   fi
579 done
580
581
582 ac_ext=c
583 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
584 ac_cpp='$CPP $CPPFLAGS'
585 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
586 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
587 cross_compiling=$ac_cv_prog_cc_cross
588
589 ac_exeext=
590 ac_objext=o
591 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
592   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
593   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
594     ac_n= ac_c='
595 ' ac_t='        '
596   else
597     ac_n=-n ac_c= ac_t=
598   fi
599 else
600   ac_n= ac_c='\c' ac_t=
601 fi
602
603 ac_aux_dir=
604 for ac_dir in build $srcdir/build; do
605   if test -f $ac_dir/install-sh; then
606     ac_aux_dir=$ac_dir
607     ac_install_sh="$ac_aux_dir/install-sh -c"
608     break
609   elif test -f $ac_dir/install.sh; then
610     ac_aux_dir=$ac_dir
611     ac_install_sh="$ac_aux_dir/install.sh -c"
612     break
613   fi
614 done
615 if test -z "$ac_aux_dir"; then
616   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
617 fi
618 ac_config_guess=$ac_aux_dir/config.guess
619 ac_config_sub=$ac_aux_dir/config.sub
620 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
621
622 OL_VERSION=`cat $ac_aux_dir/version`
623 if test -z "$OL_VERSION"; then
624         { echo "configure: error: could not determine version" 1>&2; exit 1; }
625 fi
626
627 # Find a good install program.  We prefer a C program (faster),
628 # so one script is as good as another.  But avoid the broken or
629 # incompatible versions:
630 # SysV /etc/install, /usr/sbin/install
631 # SunOS /usr/etc/install
632 # IRIX /sbin/install
633 # AIX /bin/install
634 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
635 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
636 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
637 # ./install, which can be erroneously created by make from ./install.sh.
638 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
639 echo "configure:640: checking for a BSD compatible install" >&5
640 if test -z "$INSTALL"; then
641 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
642   echo $ac_n "(cached) $ac_c" 1>&6
643 else
644     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
645   for ac_dir in $PATH; do
646     # Account for people who put trailing slashes in PATH elements.
647     case "$ac_dir/" in
648     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
649     *)
650       # OSF1 and SCO ODT 3.0 have their own names for install.
651       # Don't use installbsd from OSF since it installs stuff as root
652       # by default.
653       for ac_prog in ginstall scoinst install; do
654         if test -f $ac_dir/$ac_prog; then
655           if test $ac_prog = install &&
656             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
657             # AIX install.  It has an incompatible calling convention.
658             :
659           else
660             ac_cv_path_install="$ac_dir/$ac_prog -c"
661             break 2
662           fi
663         fi
664       done
665       ;;
666     esac
667   done
668   IFS="$ac_save_IFS"
669
670 fi
671   if test "${ac_cv_path_install+set}" = set; then
672     INSTALL="$ac_cv_path_install"
673   else
674     # As a last resort, use the slow shell script.  We don't cache a
675     # path for INSTALL within a source directory, because that will
676     # break other packages using the cache if that directory is
677     # removed, or if the path is relative.
678     INSTALL="$ac_install_sh"
679   fi
680 fi
681 echo "$ac_t""$INSTALL" 1>&6
682
683 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
684 # It thinks the first close brace ends the variable substitution.
685 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
686
687 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
688
689 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
690
691 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
692 echo "configure:693: checking whether build environment is sane" >&5
693 # Just in case
694 sleep 1
695 echo timestamp > conftestfile
696 # Do `set' in a subshell so we don't clobber the current shell's
697 # arguments.  Must try -L first in case configure is actually a
698 # symlink; some systems play weird games with the mod time of symlinks
699 # (eg FreeBSD returns the mod time of the symlink's containing
700 # directory).
701 if (
702    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
703    if test "$*" = "X"; then
704       # -L didn't work.
705       set X `ls -t $srcdir/configure conftestfile`
706    fi
707    if test "$*" != "X $srcdir/configure conftestfile" \
708       && test "$*" != "X conftestfile $srcdir/configure"; then
709
710       # If neither matched, then we have a broken ls.  This can happen
711       # if, for instance, CONFIG_SHELL is bash and it inherits a
712       # broken ls alias from the environment.  This has actually
713       # happened.  Such a system could not be considered "sane".
714       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
715 alias in your environment" 1>&2; exit 1; }
716    fi
717
718    test "$2" = conftestfile
719    )
720 then
721    # Ok.
722    :
723 else
724    { echo "configure: error: newly created file is older than distributed files!
725 Check your system clock" 1>&2; exit 1; }
726 fi
727 rm -f conftest*
728 echo "$ac_t""yes" 1>&6
729 if test "$program_transform_name" = s,x,x,; then
730   program_transform_name=
731 else
732   # Double any \ or $.  echo might interpret backslashes.
733   cat <<\EOF_SED > conftestsed
734 s,\\,\\\\,g; s,\$,$$,g
735 EOF_SED
736   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
737   rm -f conftestsed
738 fi
739 test "$program_prefix" != NONE &&
740   program_transform_name="s,^,${program_prefix},; $program_transform_name"
741 # Use a double $ so make ignores it.
742 test "$program_suffix" != NONE &&
743   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
744
745 # sed with no file args requires a program.
746 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
747
748 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
749 echo "configure:750: checking whether ${MAKE-make} sets \${MAKE}" >&5
750 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
751 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
752   echo $ac_n "(cached) $ac_c" 1>&6
753 else
754   cat > conftestmake <<\EOF
755 all:
756         @echo 'ac_maketemp="${MAKE}"'
757 EOF
758 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
759 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
760 if test -n "$ac_maketemp"; then
761   eval ac_cv_prog_make_${ac_make}_set=yes
762 else
763   eval ac_cv_prog_make_${ac_make}_set=no
764 fi
765 rm -f conftestmake
766 fi
767 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
768   echo "$ac_t""yes" 1>&6
769   SET_MAKE=
770 else
771   echo "$ac_t""no" 1>&6
772   SET_MAKE="MAKE=${MAKE-make}"
773 fi
774
775
776 PACKAGE=OpenLDAP
777
778 VERSION=$OL_VERSION
779
780 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
781   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
782 fi
783
784
785
786 missing_dir=`cd $ac_aux_dir && pwd`
787 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
788 echo "configure:789: checking for working aclocal" >&5
789 # Run test in a subshell; some versions of sh will print an error if
790 # an executable is not found, even if stderr is redirected.
791 # Redirect stdin to placate older versions of autoconf.  Sigh.
792 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
793    ACLOCAL=aclocal
794    echo "$ac_t""found" 1>&6
795 else
796    ACLOCAL="$missing_dir/missing aclocal"
797    echo "$ac_t""missing" 1>&6
798 fi
799
800 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
801 echo "configure:802: checking for working autoconf" >&5
802 # Run test in a subshell; some versions of sh will print an error if
803 # an executable is not found, even if stderr is redirected.
804 # Redirect stdin to placate older versions of autoconf.  Sigh.
805 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
806    AUTOCONF=autoconf
807    echo "$ac_t""found" 1>&6
808 else
809    AUTOCONF="$missing_dir/missing autoconf"
810    echo "$ac_t""missing" 1>&6
811 fi
812
813 echo $ac_n "checking for working automake""... $ac_c" 1>&6
814 echo "configure:815: checking for working automake" >&5
815 # Run test in a subshell; some versions of sh will print an error if
816 # an executable is not found, even if stderr is redirected.
817 # Redirect stdin to placate older versions of autoconf.  Sigh.
818 if (automake --version) < /dev/null > /dev/null 2>&1; then
819    AUTOMAKE=automake
820    echo "$ac_t""found" 1>&6
821 else
822    AUTOMAKE="$missing_dir/missing automake"
823    echo "$ac_t""missing" 1>&6
824 fi
825
826 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
827 echo "configure:828: checking for working autoheader" >&5
828 # Run test in a subshell; some versions of sh will print an error if
829 # an executable is not found, even if stderr is redirected.
830 # Redirect stdin to placate older versions of autoconf.  Sigh.
831 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
832    AUTOHEADER=autoheader
833    echo "$ac_t""found" 1>&6
834 else
835    AUTOHEADER="$missing_dir/missing autoheader"
836    echo "$ac_t""missing" 1>&6
837 fi
838
839 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
840 echo "configure:841: checking for working makeinfo" >&5
841 # Run test in a subshell; some versions of sh will print an error if
842 # an executable is not found, even if stderr is redirected.
843 # Redirect stdin to placate older versions of autoconf.  Sigh.
844 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
845    MAKEINFO=makeinfo
846    echo "$ac_t""found" 1>&6
847 else
848    MAKEINFO="$missing_dir/missing makeinfo"
849    echo "$ac_t""missing" 1>&6
850 fi
851
852
853
854 cat >> confdefs.h <<EOF
855 #define OPENLDAP_PACKAGE "$PACKAGE"
856 EOF
857
858 cat >> confdefs.h <<EOF
859 #define OPENLDAP_VERSION "$VERSION"
860 EOF
861
862
863
864
865 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
866 echo "configure:867: checking configure arguments" >&5
867
868
869 top_builddir=`pwd`
870
871 cat >> confdefs.h <<\EOF
872 #define HAVE_MKVERSION 1
873 EOF
874
875
876 ldap_subdir="openldap"
877
878 # Check whether --with-subdir or --without-subdir was given.
879 if test "${with_subdir+set}" = set; then
880   withval="$with_subdir"
881   
882         if test "$withval" = "no"; then
883                 ldap_subdir=""
884         elif test "$withval" != "yes"; then
885                 ldap_subdir="$withval"
886         fi
887
888 fi
889
890
891 # OpenLDAP --enable-debug
892         # Check whether --enable-debug or --disable-debug was given.
893 if test "${enable_debug+set}" = set; then
894   enableval="$enable_debug"
895   
896         ol_arg=invalid
897         for ol_val in auto yes no ; do
898                 if test "$enableval" = "$ol_val" ; then
899                         ol_arg="$ol_val"
900                 fi
901         done
902         if test "$ol_arg" = "invalid" ; then
903                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
904         fi
905         ol_enable_debug="$ol_arg"
906
907 else
908         ol_enable_debug="yes"
909 fi
910 # end --enable-debug
911 # OpenLDAP --enable-syslog
912         # Check whether --enable-syslog or --disable-syslog was given.
913 if test "${enable_syslog+set}" = set; then
914   enableval="$enable_syslog"
915   
916         ol_arg=invalid
917         for ol_val in auto yes no ; do
918                 if test "$enableval" = "$ol_val" ; then
919                         ol_arg="$ol_val"
920                 fi
921         done
922         if test "$ol_arg" = "invalid" ; then
923                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
924         fi
925         ol_enable_syslog="$ol_arg"
926
927 else
928         ol_enable_syslog="auto"
929 fi
930 # end --enable-syslog
931 # OpenLDAP --enable-proctitle
932         # Check whether --enable-proctitle or --disable-proctitle was given.
933 if test "${enable_proctitle+set}" = set; then
934   enableval="$enable_proctitle"
935   
936         ol_arg=invalid
937         for ol_val in auto yes no ; do
938                 if test "$enableval" = "$ol_val" ; then
939                         ol_arg="$ol_val"
940                 fi
941         done
942         if test "$ol_arg" = "invalid" ; then
943                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
944         fi
945         ol_enable_proctitle="$ol_arg"
946
947 else
948         ol_enable_proctitle="yes"
949 fi
950 # end --enable-proctitle
951 # OpenLDAP --enable-cache
952         # Check whether --enable-cache or --disable-cache was given.
953 if test "${enable_cache+set}" = set; then
954   enableval="$enable_cache"
955   
956         ol_arg=invalid
957         for ol_val in auto yes no ; do
958                 if test "$enableval" = "$ol_val" ; then
959                         ol_arg="$ol_val"
960                 fi
961         done
962         if test "$ol_arg" = "invalid" ; then
963                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
964         fi
965         ol_enable_cache="$ol_arg"
966
967 else
968         ol_enable_cache="yes"
969 fi
970 # end --enable-cache
971 # OpenLDAP --enable-dns
972         # Check whether --enable-dns or --disable-dns was given.
973 if test "${enable_dns+set}" = set; then
974   enableval="$enable_dns"
975   
976         ol_arg=invalid
977         for ol_val in auto yes no ; do
978                 if test "$enableval" = "$ol_val" ; then
979                         ol_arg="$ol_val"
980                 fi
981         done
982         if test "$ol_arg" = "invalid" ; then
983                 { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; }
984         fi
985         ol_enable_dns="$ol_arg"
986
987 else
988         ol_enable_dns="no"
989 fi
990 # end --enable-dns
991 # OpenLDAP --enable-referrals
992         # Check whether --enable-referrals or --disable-referrals was given.
993 if test "${enable_referrals+set}" = set; then
994   enableval="$enable_referrals"
995   
996         ol_arg=invalid
997         for ol_val in auto yes no ; do
998                 if test "$enableval" = "$ol_val" ; then
999                         ol_arg="$ol_val"
1000                 fi
1001         done
1002         if test "$ol_arg" = "invalid" ; then
1003                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1004         fi
1005         ol_enable_referrals="$ol_arg"
1006
1007 else
1008         ol_enable_referrals="yes"
1009 fi
1010 # end --enable-referrals
1011 # OpenLDAP --enable-cldap
1012         # Check whether --enable-cldap or --disable-cldap was given.
1013 if test "${enable_cldap+set}" = set; then
1014   enableval="$enable_cldap"
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-cldap" 1>&2; exit 1; }
1024         fi
1025         ol_enable_cldap="$ol_arg"
1026
1027 else
1028         ol_enable_cldap="no"
1029 fi
1030 # end --enable-cldap
1031 # OpenLDAP --enable-x_compile
1032         # Check whether --enable-x_compile or --disable-x_compile was given.
1033 if test "${enable_x_compile+set}" = set; then
1034   enableval="$enable_x_compile"
1035   
1036         ol_arg=invalid
1037         for ol_val in yes no ; do
1038                 if test "$enableval" = "$ol_val" ; then
1039                         ol_arg="$ol_val"
1040                 fi
1041         done
1042         if test "$ol_arg" = "invalid" ; then
1043                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1044         fi
1045         ol_enable_x_compile="$ol_arg"
1046
1047 else
1048         ol_enable_x_compile="no"
1049 fi
1050 # end --enable-x_compile
1051
1052 # OpenLDAP --enable-dmalloc
1053         # Check whether --enable-dmalloc or --disable-dmalloc was given.
1054 if test "${enable_dmalloc+set}" = set; then
1055   enableval="$enable_dmalloc"
1056   
1057         ol_arg=invalid
1058         for ol_val in auto yes no ; do
1059                 if test "$enableval" = "$ol_val" ; then
1060                         ol_arg="$ol_val"
1061                 fi
1062         done
1063         if test "$ol_arg" = "invalid" ; then
1064                 { echo "configure: error: bad value $enableval for --enable-dmalloc" 1>&2; exit 1; }
1065         fi
1066         ol_enable_dmalloc="$ol_arg"
1067
1068 else
1069         ol_enable_dmalloc="no"
1070 fi
1071 # end --enable-dmalloc
1072
1073 # OpenLDAP --with-kerberos
1074         # Check whether --with-kerberos or --without-kerberos was given.
1075 if test "${with_kerberos+set}" = set; then
1076   withval="$with_kerberos"
1077   
1078         ol_arg=invalid
1079         for ol_val in auto k5 k4 afs yes no ; do
1080                 if test "$withval" = "$ol_val" ; then
1081                         ol_arg="$ol_val"
1082                 fi
1083         done
1084         if test "$ol_arg" = "invalid" ; then
1085                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1086         fi
1087         ol_with_kerberos="$ol_arg"
1088
1089 else
1090         ol_with_kerberos="auto"
1091 fi
1092 # end --with-kerberos
1093
1094 # OpenLDAP --with-readline
1095         # Check whether --with-readline or --without-readline was given.
1096 if test "${with_readline+set}" = set; then
1097   withval="$with_readline"
1098   
1099         ol_arg=invalid
1100         for ol_val in auto yes no  ; do
1101                 if test "$withval" = "$ol_val" ; then
1102                         ol_arg="$ol_val"
1103                 fi
1104         done
1105         if test "$ol_arg" = "invalid" ; then
1106                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1107         fi
1108         ol_with_readline="$ol_arg"
1109
1110 else
1111         ol_with_readline="auto"
1112 fi
1113 # end --with-readline
1114
1115 # OpenLDAP --with-threads
1116         # Check whether --with-threads or --without-threads was given.
1117 if test "${with_threads+set}" = set; then
1118   withval="$with_threads"
1119   
1120         ol_arg=invalid
1121         for ol_val in auto posix mach lwp yes no manual  ; do
1122                 if test "$withval" = "$ol_val" ; then
1123                         ol_arg="$ol_val"
1124                 fi
1125         done
1126         if test "$ol_arg" = "invalid" ; then
1127                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1128         fi
1129         ol_with_threads="$ol_arg"
1130
1131 else
1132         ol_with_threads="auto"
1133 fi
1134 # end --with-threads
1135
1136 # OpenLDAP --with-tls
1137         # Check whether --with-tls or --without-tls was given.
1138 if test "${with_tls+set}" = set; then
1139   withval="$with_tls"
1140   
1141         ol_arg=invalid
1142         for ol_val in auto ssleay openssl yes no  ; do
1143                 if test "$withval" = "$ol_val" ; then
1144                         ol_arg="$ol_val"
1145                 fi
1146         done
1147         if test "$ol_arg" = "invalid" ; then
1148                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1149         fi
1150         ol_with_tls="$ol_arg"
1151
1152 else
1153         ol_with_tls="auto"
1154 fi
1155 # end --with-tls
1156
1157 # OpenLDAP --with-yielding_select
1158         # Check whether --with-yielding_select or --without-yielding_select was given.
1159 if test "${with_yielding_select+set}" = set; then
1160   withval="$with_yielding_select"
1161   
1162         ol_arg=invalid
1163         for ol_val in auto yes no manual  ; do
1164                 if test "$withval" = "$ol_val" ; then
1165                         ol_arg="$ol_val"
1166                 fi
1167         done
1168         if test "$ol_arg" = "invalid" ; then
1169                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1170         fi
1171         ol_with_yielding_select="$ol_arg"
1172
1173 else
1174         ol_with_yielding_select="auto"
1175 fi
1176 # end --with-yielding_select
1177
1178
1179
1180 # Check whether --with-xxldapdoptions or --without-xxldapdoptions was given.
1181 if test "${with_xxldapdoptions+set}" = set; then
1182   withval="$with_xxldapdoptions"
1183   :
1184 fi
1185
1186 # OpenLDAP --enable-ldapd
1187         # Check whether --enable-ldapd or --disable-ldapd was given.
1188 if test "${enable_ldapd+set}" = set; then
1189   enableval="$enable_ldapd"
1190   
1191         ol_arg=invalid
1192         for ol_val in auto yes no ; do
1193                 if test "$enableval" = "$ol_val" ; then
1194                         ol_arg="$ol_val"
1195                 fi
1196         done
1197         if test "$ol_arg" = "invalid" ; then
1198                 { echo "configure: error: bad value $enableval for --enable-ldapd" 1>&2; exit 1; }
1199         fi
1200         ol_enable_ldapd="$ol_arg"
1201
1202 else
1203         ol_enable_ldapd="no"
1204 fi
1205 # end --enable-ldapd
1206
1207 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1208 if test "${with_xxslapdoptions+set}" = set; then
1209   withval="$with_xxslapdoptions"
1210   :
1211 fi
1212
1213 # OpenLDAP --enable-slapd
1214         # Check whether --enable-slapd or --disable-slapd was given.
1215 if test "${enable_slapd+set}" = set; then
1216   enableval="$enable_slapd"
1217   
1218         ol_arg=invalid
1219         for ol_val in auto yes no ; do
1220                 if test "$enableval" = "$ol_val" ; then
1221                         ol_arg="$ol_val"
1222                 fi
1223         done
1224         if test "$ol_arg" = "invalid" ; then
1225                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1226         fi
1227         ol_enable_slapd="$ol_arg"
1228
1229 else
1230         ol_enable_slapd="yes"
1231 fi
1232 # end --enable-slapd
1233 # OpenLDAP --enable-aclgroups
1234         # Check whether --enable-aclgroups or --disable-aclgroups was given.
1235 if test "${enable_aclgroups+set}" = set; then
1236   enableval="$enable_aclgroups"
1237   
1238         ol_arg=invalid
1239         for ol_val in auto yes no ; do
1240                 if test "$enableval" = "$ol_val" ; then
1241                         ol_arg="$ol_val"
1242                 fi
1243         done
1244         if test "$ol_arg" = "invalid" ; then
1245                 { echo "configure: error: bad value $enableval for --enable-aclgroups" 1>&2; exit 1; }
1246         fi
1247         ol_enable_aclgroups="$ol_arg"
1248
1249 else
1250         ol_enable_aclgroups="auto"
1251 fi
1252 # end --enable-aclgroups
1253 # OpenLDAP --enable-cleartext
1254         # Check whether --enable-cleartext or --disable-cleartext was given.
1255 if test "${enable_cleartext+set}" = set; then
1256   enableval="$enable_cleartext"
1257   
1258         ol_arg=invalid
1259         for ol_val in auto yes no ; do
1260                 if test "$enableval" = "$ol_val" ; then
1261                         ol_arg="$ol_val"
1262                 fi
1263         done
1264         if test "$ol_arg" = "invalid" ; then
1265                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1266         fi
1267         ol_enable_cleartext="$ol_arg"
1268
1269 else
1270         ol_enable_cleartext="yes"
1271 fi
1272 # end --enable-cleartext
1273 # OpenLDAP --enable-crypt
1274         # Check whether --enable-crypt or --disable-crypt was given.
1275 if test "${enable_crypt+set}" = set; then
1276   enableval="$enable_crypt"
1277   
1278         ol_arg=invalid
1279         for ol_val in auto yes no ; do
1280                 if test "$enableval" = "$ol_val" ; then
1281                         ol_arg="$ol_val"
1282                 fi
1283         done
1284         if test "$ol_arg" = "invalid" ; then
1285                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1286         fi
1287         ol_enable_crypt="$ol_arg"
1288
1289 else
1290         ol_enable_crypt="auto"
1291 fi
1292 # end --enable-crypt
1293 # OpenLDAP --enable-modules
1294         # Check whether --enable-modules or --disable-modules was given.
1295 if test "${enable_modules+set}" = set; then
1296   enableval="$enable_modules"
1297   
1298         ol_arg=invalid
1299         for ol_val in auto yes no ; do
1300                 if test "$enableval" = "$ol_val" ; then
1301                         ol_arg="$ol_val"
1302                 fi
1303         done
1304         if test "$ol_arg" = "invalid" ; then
1305                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1306         fi
1307         ol_enable_modules="$ol_arg"
1308
1309 else
1310         ol_enable_modules="no"
1311 fi
1312 # end --enable-modules
1313 # OpenLDAP --enable-phonetic
1314         # Check whether --enable-phonetic or --disable-phonetic was given.
1315 if test "${enable_phonetic+set}" = set; then
1316   enableval="$enable_phonetic"
1317   
1318         ol_arg=invalid
1319         for ol_val in auto yes no ; do
1320                 if test "$enableval" = "$ol_val" ; then
1321                         ol_arg="$ol_val"
1322                 fi
1323         done
1324         if test "$ol_arg" = "invalid" ; then
1325                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1326         fi
1327         ol_enable_phonetic="$ol_arg"
1328
1329 else
1330         ol_enable_phonetic="no"
1331 fi
1332 # end --enable-phonetic
1333 # OpenLDAP --enable-rlookups
1334         # Check whether --enable-rlookups or --disable-rlookups was given.
1335 if test "${enable_rlookups+set}" = set; then
1336   enableval="$enable_rlookups"
1337   
1338         ol_arg=invalid
1339         for ol_val in auto yes no ; do
1340                 if test "$enableval" = "$ol_val" ; then
1341                         ol_arg="$ol_val"
1342                 fi
1343         done
1344         if test "$ol_arg" = "invalid" ; then
1345                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1346         fi
1347         ol_enable_rlookups="$ol_arg"
1348
1349 else
1350         ol_enable_rlookups="auto"
1351 fi
1352 # end --enable-rlookups
1353 # OpenLDAP --enable-wrappers
1354         # Check whether --enable-wrappers or --disable-wrappers was given.
1355 if test "${enable_wrappers+set}" = set; then
1356   enableval="$enable_wrappers"
1357   
1358         ol_arg=invalid
1359         for ol_val in auto yes no ; do
1360                 if test "$enableval" = "$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 $enableval for --enable-wrappers" 1>&2; exit 1; }
1366         fi
1367         ol_enable_wrappers="$ol_arg"
1368
1369 else
1370         ol_enable_wrappers="no"
1371 fi
1372 # end --enable-wrappers
1373
1374 # OpenLDAP --enable-bdb2
1375         # Check whether --enable-bdb2 or --disable-bdb2 was given.
1376 if test "${enable_bdb2+set}" = set; then
1377   enableval="$enable_bdb2"
1378   
1379         ol_arg=invalid
1380         for ol_val in auto yes no ; do
1381                 if test "$enableval" = "$ol_val" ; then
1382                         ol_arg="$ol_val"
1383                 fi
1384         done
1385         if test "$ol_arg" = "invalid" ; then
1386                 { echo "configure: error: bad value $enableval for --enable-bdb2" 1>&2; exit 1; }
1387         fi
1388         ol_enable_bdb2="$ol_arg"
1389
1390 else
1391         ol_enable_bdb2="no"
1392 fi
1393 # end --enable-bdb2
1394 # OpenLDAP --enable-ldap
1395         # Check whether --enable-ldap or --disable-ldap was given.
1396 if test "${enable_ldap+set}" = set; then
1397   enableval="$enable_ldap"
1398   
1399         ol_arg=invalid
1400         for ol_val in auto yes no ; do
1401                 if test "$enableval" = "$ol_val" ; then
1402                         ol_arg="$ol_val"
1403                 fi
1404         done
1405         if test "$ol_arg" = "invalid" ; then
1406                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1407         fi
1408         ol_enable_ldap="$ol_arg"
1409
1410 else
1411         ol_enable_ldap="no"
1412 fi
1413 # end --enable-ldap
1414 # OpenLDAP --enable-ldbm
1415         # Check whether --enable-ldbm or --disable-ldbm was given.
1416 if test "${enable_ldbm+set}" = set; then
1417   enableval="$enable_ldbm"
1418   
1419         ol_arg=invalid
1420         for ol_val in auto yes no ; do
1421                 if test "$enableval" = "$ol_val" ; then
1422                         ol_arg="$ol_val"
1423                 fi
1424         done
1425         if test "$ol_arg" = "invalid" ; then
1426                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1427         fi
1428         ol_enable_ldbm="$ol_arg"
1429
1430 else
1431         ol_enable_ldbm="yes"
1432 fi
1433 # end --enable-ldbm
1434 # OpenLDAP --with-ldbm_api
1435         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1436 if test "${with_ldbm_api+set}" = set; then
1437   withval="$with_ldbm_api"
1438   
1439         ol_arg=invalid
1440         for ol_val in auto db2 db mdbm gdbm ndbm manual ; do
1441                 if test "$withval" = "$ol_val" ; then
1442                         ol_arg="$ol_val"
1443                 fi
1444         done
1445         if test "$ol_arg" = "invalid" ; then
1446                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1447         fi
1448         ol_with_ldbm_api="$ol_arg"
1449
1450 else
1451         ol_with_ldbm_api="auto"
1452 fi
1453 # end --with-ldbm_api
1454
1455 # OpenLDAP --with-ldbm_type
1456         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1457 if test "${with_ldbm_type+set}" = set; then
1458   withval="$with_ldbm_type"
1459   
1460         ol_arg=invalid
1461         for ol_val in auto btree hash ; do
1462                 if test "$withval" = "$ol_val" ; then
1463                         ol_arg="$ol_val"
1464                 fi
1465         done
1466         if test "$ol_arg" = "invalid" ; then
1467                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1468         fi
1469         ol_with_ldbm_type="$ol_arg"
1470
1471 else
1472         ol_with_ldbm_type="auto"
1473 fi
1474 # end --with-ldbm_type
1475
1476
1477 # OpenLDAP --enable-passwd
1478         # Check whether --enable-passwd or --disable-passwd was given.
1479 if test "${enable_passwd+set}" = set; then
1480   enableval="$enable_passwd"
1481   
1482         ol_arg=invalid
1483         for ol_val in auto yes no ; do
1484                 if test "$enableval" = "$ol_val" ; then
1485                         ol_arg="$ol_val"
1486                 fi
1487         done
1488         if test "$ol_arg" = "invalid" ; then
1489                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1490         fi
1491         ol_enable_passwd="$ol_arg"
1492
1493 else
1494         ol_enable_passwd="no"
1495 fi
1496 # end --enable-passwd
1497 # OpenLDAP --enable-perl
1498         # Check whether --enable-perl or --disable-perl was given.
1499 if test "${enable_perl+set}" = set; then
1500   enableval="$enable_perl"
1501   
1502         ol_arg=invalid
1503         for ol_val in auto yes no ; do
1504                 if test "$enableval" = "$ol_val" ; then
1505                         ol_arg="$ol_val"
1506                 fi
1507         done
1508         if test "$ol_arg" = "invalid" ; then
1509                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
1510         fi
1511         ol_enable_perl="$ol_arg"
1512
1513 else
1514         ol_enable_perl="no"
1515 fi
1516 # end --enable-perl
1517 # OpenLDAP --enable-shell
1518         # Check whether --enable-shell or --disable-shell was given.
1519 if test "${enable_shell+set}" = set; then
1520   enableval="$enable_shell"
1521   
1522         ol_arg=invalid
1523         for ol_val in auto yes no ; do
1524                 if test "$enableval" = "$ol_val" ; then
1525                         ol_arg="$ol_val"
1526                 fi
1527         done
1528         if test "$ol_arg" = "invalid" ; then
1529                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
1530         fi
1531         ol_enable_shell="$ol_arg"
1532
1533 else
1534         ol_enable_shell="no"
1535 fi
1536 # end --enable-shell
1537 # OpenLDAP --enable-tcl
1538         # Check whether --enable-tcl or --disable-tcl was given.
1539 if test "${enable_tcl+set}" = set; then
1540   enableval="$enable_tcl"
1541   
1542         ol_arg=invalid
1543         for ol_val in auto yes no ; do
1544                 if test "$enableval" = "$ol_val" ; then
1545                         ol_arg="$ol_val"
1546                 fi
1547         done
1548         if test "$ol_arg" = "invalid" ; then
1549                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
1550         fi
1551         ol_enable_tcl="$ol_arg"
1552
1553 else
1554         ol_enable_tcl="no"
1555 fi
1556 # end --enable-tcl
1557
1558 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
1559 if test "${with_xxslurpdoptions+set}" = set; then
1560   withval="$with_xxslurpdoptions"
1561   :
1562 fi
1563
1564 # OpenLDAP --enable-slurpd
1565         # Check whether --enable-slurpd or --disable-slurpd was given.
1566 if test "${enable_slurpd+set}" = set; then
1567   enableval="$enable_slurpd"
1568   
1569         ol_arg=invalid
1570         for ol_val in auto yes no ; do
1571                 if test "$enableval" = "$ol_val" ; then
1572                         ol_arg="$ol_val"
1573                 fi
1574         done
1575         if test "$ol_arg" = "invalid" ; then
1576                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
1577         fi
1578         ol_enable_slurpd="$ol_arg"
1579
1580 else
1581         ol_enable_slurpd="auto"
1582 fi
1583 # end --enable-slurpd
1584
1585 # Check whether --with-xxliboptions or --without-xxliboptions was given.
1586 if test "${with_xxliboptions+set}" = set; then
1587   withval="$with_xxliboptions"
1588   :
1589 fi
1590
1591 # Check whether --enable-static or --disable-static was given.
1592 if test "${enable_static+set}" = set; then
1593   enableval="$enable_static"
1594   p=${PACKAGE-default}
1595 case "$enableval" in
1596 yes) enable_static=yes ;;
1597 no) enable_static=no ;;
1598 *)
1599   enable_static=no
1600   # Look at the argument we got.  We use all the common list separators.
1601   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1602   for pkg in $enableval; do
1603     if test "X$pkg" = "X$p"; then
1604       enable_static=yes
1605     fi
1606   done
1607   IFS="$ac_save_ifs"
1608   ;;
1609 esac
1610 else
1611   enable_static=yes
1612 fi
1613
1614 # Check whether --enable-shared or --disable-shared was given.
1615 if test "${enable_shared+set}" = set; then
1616   enableval="$enable_shared"
1617   p=${PACKAGE-default}
1618 case "$enableval" in
1619 yes) enable_shared=yes ;;
1620 no) enable_shared=no ;;
1621 *)
1622   enable_shared=no
1623   # Look at the argument we got.  We use all the common list separators.
1624   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1625   for pkg in $enableval; do
1626     if test "X$pkg" = "X$p"; then
1627       enable_shared=yes
1628     fi
1629   done
1630   IFS="$ac_save_ifs"
1631   ;;
1632 esac
1633 else
1634   enable_shared=yes
1635 fi
1636
1637
1638 # validate options
1639 if test $ol_enable_dns = yes ; then
1640         if test $ol_enable_referrals = no ; then
1641                 { echo "configure: error: DNS requires --enable-referrals" 1>&2; exit 1; }
1642         fi
1643         if test $ol_enable_referrals = auto ; then
1644                 echo "configure: warning: DNS requires referrals, adding --enable-referrals" 1>&2
1645                 ol_enable_referrals=yes
1646         fi
1647 fi
1648
1649 if test $ol_enable_slapd = no ; then
1650                 if test $ol_enable_bdb2 = yes ; then
1651                 echo "configure: warning: slapd disabled, ignoring --enable-bdb2 argument" 1>&2
1652         fi
1653         if test $ol_enable_ldap = yes ; then
1654                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
1655         fi
1656         if test $ol_enable_ldbm = yes ; then
1657                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
1658         fi
1659         if test $ol_enable_passwd = yes ; then
1660                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
1661         fi
1662         if test $ol_enable_perl = yes ; then
1663                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
1664         fi
1665         if test $ol_enable_shell = yes ; then
1666                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
1667         fi
1668         if test $ol_enable_tcl = yes ; then
1669                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
1670         fi
1671         if test $ol_enable_aclgroups = yes ; then
1672                 echo "configure: warning: slapd disabled, ignoring --enable-aclgroups argument" 1>&2
1673         fi
1674         if test $ol_enable_modules = yes ; then
1675                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
1676         fi
1677         if test $ol_enable_wrappers = yes ; then
1678                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
1679         fi
1680         if test $ol_enable_phonetic = yes ; then
1681                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
1682         fi
1683         if test $ol_enable_rlookups = yes ; then
1684                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
1685         fi
1686         if test $ol_with_ldbm_api != auto ; then
1687                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
1688         fi
1689         if test $ol_with_ldbm_type != auto ; then
1690                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
1691         fi
1692         if test $ol_enable_slurpd = yes ; then
1693                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
1694         fi
1695
1696         # force settings to no
1697         ol_enable_bdb2=no
1698         ol_enable_ldap=no
1699         ol_enable_ldbm=no
1700         ol_enable_passwd=no
1701         ol_enable_perl=no
1702         ol_enable_shell=no
1703         ol_enable_tcl=no
1704
1705         ol_enable_aclgroups=no
1706         ol_enable_modules=no
1707         ol_enable_phonetic=no
1708         ol_enable_rlookups=no
1709         ol_enable_wrappers=no
1710
1711         ol_with_ldbm_api=no
1712         ol_with_ldbm_type=no
1713
1714         ol_enable_slurpd=no
1715
1716 elif test $ol_enable_ldbm = no ; then
1717         
1718         if test $ol_with_ldbm_api != auto ; then
1719                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
1720         fi
1721
1722         if test $ol_with_ldbm_type != auto ; then
1723                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
1724         fi
1725
1726         if test $ol_enable_bdb2 = yes ; then
1727                 { echo "configure: error: BDB2 requires --enable-ldbm" 1>&2; exit 1; }
1728         fi
1729
1730         if test $ol_enable_modules != yes -a \
1731                 $ol_enable_ldap = no -a \
1732                 $ol_enable_passwd = no -a \
1733                 $ol_enable_perl = no -a \
1734                 $ol_enable_shell = no -a \
1735                 $ol_enable_tcl = no ; then
1736                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
1737         fi
1738
1739         ol_with_ldbm_api=no
1740         ol_with_ldbm_type=no
1741
1742 elif test $ol_enable_bdb2 = yes ; then
1743         
1744         if test $ol_with_ldbm_api != auto -a \
1745                 $ol_with_ldbm_api != db2 ; then
1746                 { echo "configure: error: BDB2 requires LDBM API DB2" 1>&2; exit 1; }
1747         fi
1748
1749         ol_with_ldbm_api=db2
1750
1751 else
1752         
1753         if test $ol_enable_bdb2 != no ; then
1754                 if test $ol_with_ldbm_api != auto -a \
1755                         $ol_with_ldbm_api != db2 ; then
1756                         echo "configure: warning: BDB2 requires LDBM api db2 or auto" 1>&2
1757                         ol_enable_bdb2=no
1758                 fi
1759         fi
1760
1761         if test $ol_with_ldbm_api = gdbm -a \
1762                 $ol_with_ldbm_type = btree ; then
1763                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
1764         fi
1765         if test $ol_with_ldbm_api = mdbm -a \
1766                 $ol_with_ldbm_type = btree ; then
1767                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
1768         fi
1769         if test $ol_with_ldbm_api = ndbm -a \
1770                 $ol_with_ldbm_type = btree ; then
1771                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
1772         fi
1773 fi
1774
1775 if test $ol_enable_slurpd = yes ; then
1776                 if test $ol_with_threads = no ; then
1777                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
1778         fi
1779 fi
1780
1781 echo "$ac_t""done" 1>&6
1782
1783 ## Initialize vars
1784 LDAP_LIBS=
1785 LDBM_LIBS=
1786 LTHREAD_LIBS=
1787 LUTIL_LIBS=
1788
1789 LDAPD_LIBS=
1790 SLAPD_LIBS=
1791 SLURPD_LIBS=
1792
1793 BUILD_LDAPD=no
1794 BUILD_SLAPD=no
1795 BUILD_SLURPD=no
1796
1797 BUILD_BDB2=no
1798 BUILD_LDAP=no
1799 BUILD_LDBM=no
1800 BUILD_PASSWD=no
1801 BUILD_PERL=no
1802 BUILD_SHELL=no
1803 BUILD_TCL=no
1804 BUILD_THREAD=no
1805
1806 SLAPD_MODULES_LDFLAGS=
1807 SLAPD_MODULES_CPPFLAGS=
1808
1809 SLAPD_PERL_LDFLAGS=
1810 SLAPD_PERL_CPPFLAGS=
1811
1812 KRB_LIBS=
1813 READLINE_LIBS=
1814 TERMCAP_LIBS=
1815 TLS_LIBS=
1816
1817
1818
1819 CC=${CC-"cc"}
1820
1821
1822 # Make sure we can run config.sub.
1823 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
1824 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
1825 fi
1826
1827 echo $ac_n "checking host system type""... $ac_c" 1>&6
1828 echo "configure:1829: checking host system type" >&5
1829
1830 host_alias=$host
1831 case "$host_alias" in
1832 NONE)
1833   case $nonopt in
1834   NONE)
1835     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
1836     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
1837     fi ;;
1838   *) host_alias=$nonopt ;;
1839   esac ;;
1840 esac
1841
1842 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
1843 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1844 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1845 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1846 echo "$ac_t""$host" 1>&6
1847
1848 # Extract the first word of "ranlib", so it can be a program name with args.
1849 set dummy ranlib; ac_word=$2
1850 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1851 echo "configure:1852: checking for $ac_word" >&5
1852 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1853   echo $ac_n "(cached) $ac_c" 1>&6
1854 else
1855   if test -n "$RANLIB"; then
1856   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1857 else
1858   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1859   ac_dummy="$PATH"
1860   for ac_dir in $ac_dummy; do
1861     test -z "$ac_dir" && ac_dir=.
1862     if test -f $ac_dir/$ac_word; then
1863       ac_cv_prog_RANLIB="ranlib"
1864       break
1865     fi
1866   done
1867   IFS="$ac_save_ifs"
1868   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1869 fi
1870 fi
1871 RANLIB="$ac_cv_prog_RANLIB"
1872 if test -n "$RANLIB"; then
1873   echo "$ac_t""$RANLIB" 1>&6
1874 else
1875   echo "$ac_t""no" 1>&6
1876 fi
1877
1878 # Extract the first word of "gcc", so it can be a program name with args.
1879 set dummy gcc; ac_word=$2
1880 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1881 echo "configure:1882: checking for $ac_word" >&5
1882 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1883   echo $ac_n "(cached) $ac_c" 1>&6
1884 else
1885   if test -n "$CC"; then
1886   ac_cv_prog_CC="$CC" # Let the user override the test.
1887 else
1888   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1889   ac_dummy="$PATH"
1890   for ac_dir in $ac_dummy; do
1891     test -z "$ac_dir" && ac_dir=.
1892     if test -f $ac_dir/$ac_word; then
1893       ac_cv_prog_CC="gcc"
1894       break
1895     fi
1896   done
1897   IFS="$ac_save_ifs"
1898 fi
1899 fi
1900 CC="$ac_cv_prog_CC"
1901 if test -n "$CC"; then
1902   echo "$ac_t""$CC" 1>&6
1903 else
1904   echo "$ac_t""no" 1>&6
1905 fi
1906
1907 if test -z "$CC"; then
1908   # Extract the first word of "cc", so it can be a program name with args.
1909 set dummy cc; ac_word=$2
1910 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1911 echo "configure:1912: checking for $ac_word" >&5
1912 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1913   echo $ac_n "(cached) $ac_c" 1>&6
1914 else
1915   if test -n "$CC"; then
1916   ac_cv_prog_CC="$CC" # Let the user override the test.
1917 else
1918   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1919   ac_prog_rejected=no
1920   ac_dummy="$PATH"
1921   for ac_dir in $ac_dummy; do
1922     test -z "$ac_dir" && ac_dir=.
1923     if test -f $ac_dir/$ac_word; then
1924       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1925         ac_prog_rejected=yes
1926         continue
1927       fi
1928       ac_cv_prog_CC="cc"
1929       break
1930     fi
1931   done
1932   IFS="$ac_save_ifs"
1933 if test $ac_prog_rejected = yes; then
1934   # We found a bogon in the path, so make sure we never use it.
1935   set dummy $ac_cv_prog_CC
1936   shift
1937   if test $# -gt 0; then
1938     # We chose a different compiler from the bogus one.
1939     # However, it has the same basename, so the bogon will be chosen
1940     # first if we set CC to just the basename; use the full file name.
1941     shift
1942     set dummy "$ac_dir/$ac_word" "$@"
1943     shift
1944     ac_cv_prog_CC="$@"
1945   fi
1946 fi
1947 fi
1948 fi
1949 CC="$ac_cv_prog_CC"
1950 if test -n "$CC"; then
1951   echo "$ac_t""$CC" 1>&6
1952 else
1953   echo "$ac_t""no" 1>&6
1954 fi
1955
1956   if test -z "$CC"; then
1957     case "`uname -s`" in
1958     *win32* | *WIN32*)
1959       # Extract the first word of "cl", so it can be a program name with args.
1960 set dummy cl; ac_word=$2
1961 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1962 echo "configure:1963: checking for $ac_word" >&5
1963 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1964   echo $ac_n "(cached) $ac_c" 1>&6
1965 else
1966   if test -n "$CC"; then
1967   ac_cv_prog_CC="$CC" # Let the user override the test.
1968 else
1969   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1970   ac_dummy="$PATH"
1971   for ac_dir in $ac_dummy; do
1972     test -z "$ac_dir" && ac_dir=.
1973     if test -f $ac_dir/$ac_word; then
1974       ac_cv_prog_CC="cl"
1975       break
1976     fi
1977   done
1978   IFS="$ac_save_ifs"
1979 fi
1980 fi
1981 CC="$ac_cv_prog_CC"
1982 if test -n "$CC"; then
1983   echo "$ac_t""$CC" 1>&6
1984 else
1985   echo "$ac_t""no" 1>&6
1986 fi
1987  ;;
1988     esac
1989   fi
1990   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1991 fi
1992
1993 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1994 echo "configure:1995: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1995
1996 ac_ext=c
1997 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1998 ac_cpp='$CPP $CPPFLAGS'
1999 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2000 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2001 cross_compiling=$ac_cv_prog_cc_cross
2002
2003 cat > conftest.$ac_ext << EOF
2004
2005 #line 2006 "configure"
2006 #include "confdefs.h"
2007
2008 main(){return(0);}
2009 EOF
2010 if { (eval echo configure:2011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2011   ac_cv_prog_cc_works=yes
2012   # If we can't run a trivial program, we are probably using a cross compiler.
2013   if (./conftest; exit) 2>/dev/null; then
2014     ac_cv_prog_cc_cross=no
2015   else
2016     ac_cv_prog_cc_cross=yes
2017   fi
2018 else
2019   echo "configure: failed program was:" >&5
2020   cat conftest.$ac_ext >&5
2021   ac_cv_prog_cc_works=no
2022 fi
2023 rm -fr conftest*
2024 ac_ext=c
2025 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2026 ac_cpp='$CPP $CPPFLAGS'
2027 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2028 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2029 cross_compiling=$ac_cv_prog_cc_cross
2030
2031 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2032 if test $ac_cv_prog_cc_works = no; then
2033   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2034 fi
2035 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2036 echo "configure:2037: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
2037 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2038 cross_compiling=$ac_cv_prog_cc_cross
2039
2040 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2041 echo "configure:2042: checking whether we are using GNU C" >&5
2042 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
2043   echo $ac_n "(cached) $ac_c" 1>&6
2044 else
2045   cat > conftest.c <<EOF
2046 #ifdef __GNUC__
2047   yes;
2048 #endif
2049 EOF
2050 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2051: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2051   ac_cv_prog_gcc=yes
2052 else
2053   ac_cv_prog_gcc=no
2054 fi
2055 fi
2056
2057 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2058
2059 if test $ac_cv_prog_gcc = yes; then
2060   GCC=yes
2061 else
2062   GCC=
2063 fi
2064
2065 ac_test_CFLAGS="${CFLAGS+set}"
2066 ac_save_CFLAGS="$CFLAGS"
2067 CFLAGS=
2068 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2069 echo "configure:2070: checking whether ${CC-cc} accepts -g" >&5
2070 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
2071   echo $ac_n "(cached) $ac_c" 1>&6
2072 else
2073   echo 'void f(){}' > conftest.c
2074 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2075   ac_cv_prog_cc_g=yes
2076 else
2077   ac_cv_prog_cc_g=no
2078 fi
2079 rm -f conftest*
2080
2081 fi
2082
2083 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2084 if test "$ac_test_CFLAGS" = set; then
2085   CFLAGS="$ac_save_CFLAGS"
2086 elif test $ac_cv_prog_cc_g = yes; then
2087   if test "$GCC" = yes; then
2088     CFLAGS="-g -O2"
2089   else
2090     CFLAGS="-g"
2091   fi
2092 else
2093   if test "$GCC" = yes; then
2094     CFLAGS="-O2"
2095   else
2096     CFLAGS=
2097   fi
2098 fi
2099
2100 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2101 if test "${with_gnu_ld+set}" = set; then
2102   withval="$with_gnu_ld"
2103   test "$withval" = no || with_gnu_ld=yes
2104 else
2105   with_gnu_ld=no
2106 fi
2107
2108
2109 ac_prog=ld
2110 if test "$ac_cv_prog_gcc" = yes; then
2111   # Check if gcc -print-prog-name=ld gives a path.
2112   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2113 echo "configure:2114: checking for ld used by GCC" >&5
2114   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2115   case "$ac_prog" in
2116   # Accept absolute paths.
2117   /* | A-Za-z:\\*)
2118     test -z "$LD" && LD="$ac_prog"
2119     ;;
2120   "")
2121     # If it fails, then pretend we aren't using GCC.
2122     ac_prog=ld
2123     ;;
2124   *)
2125     # If it is relative, then search for the first ld in PATH.
2126     with_gnu_ld=unknown
2127     ;;
2128   esac
2129 elif test "$with_gnu_ld" = yes; then
2130   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2131 echo "configure:2132: checking for GNU ld" >&5
2132 else
2133   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2134 echo "configure:2135: checking for non-GNU ld" >&5
2135 fi
2136 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
2137   echo $ac_n "(cached) $ac_c" 1>&6
2138 else
2139   if test -z "$LD"; then
2140   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2141   for ac_dir in $PATH; do
2142     test -z "$ac_dir" && ac_dir=.
2143     if test -f "$ac_dir/$ac_prog"; then
2144       ac_cv_path_LD="$ac_dir/$ac_prog"
2145       # Check to see if the program is GNU ld.  I'd rather use --version,
2146       # but apparently some GNU ld's only accept -v.
2147       # Break only if it was the GNU/non-GNU ld that we prefer.
2148       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2149         test "$with_gnu_ld" != no && break
2150       else
2151         test "$with_gnu_ld" != yes && break
2152       fi
2153     fi
2154   done
2155   IFS="$ac_save_ifs"
2156 else
2157   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2158 fi
2159 fi
2160
2161 LD="$ac_cv_path_LD"
2162 if test -n "$LD"; then
2163   echo "$ac_t""$LD" 1>&6
2164 else
2165   echo "$ac_t""no" 1>&6
2166 fi
2167 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2168
2169 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2170 echo "configure:2171: checking if the linker ($LD) is GNU ld" >&5
2171 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
2172   echo $ac_n "(cached) $ac_c" 1>&6
2173 else
2174   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2175 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2176   ac_cv_prog_gnu_ld=yes
2177 else
2178   ac_cv_prog_gnu_ld=no
2179 fi
2180 fi
2181
2182 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2183
2184
2185 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2186 echo "configure:2187: checking for BSD-compatible nm" >&5
2187 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
2188   echo $ac_n "(cached) $ac_c" 1>&6
2189 else
2190   case "$NM" in
2191 /* | A-Za-z:\\*)
2192   ac_cv_path_NM="$NM" # Let the user override the test with a path.
2193   ;;
2194 *)
2195   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2196   for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
2197     test -z "$ac_dir" && ac_dir=.
2198     if test -f $ac_dir/nm; then
2199       # Check to see if the nm accepts a BSD-compat flag.
2200       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2201       #   nm: unknown option "B" ignored
2202       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2203         ac_cv_path_NM="$ac_dir/nm -B"
2204       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2205         ac_cv_path_NM="$ac_dir/nm -p"
2206       else
2207         ac_cv_path_NM="$ac_dir/nm"
2208       fi
2209       break
2210     fi
2211   done
2212   IFS="$ac_save_ifs"
2213   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2214   ;;
2215 esac
2216 fi
2217
2218 NM="$ac_cv_path_NM"
2219 echo "$ac_t""$NM" 1>&6
2220
2221
2222 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2223 echo "configure:2224: checking whether ln -s works" >&5
2224 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2225   echo $ac_n "(cached) $ac_c" 1>&6
2226 else
2227   rm -f conftestdata
2228 if ln -s X conftestdata 2>/dev/null
2229 then
2230   rm -f conftestdata
2231   ac_cv_prog_LN_S="ln -s"
2232 else
2233   ac_cv_prog_LN_S=ln
2234 fi
2235 fi
2236 LN_S="$ac_cv_prog_LN_S"
2237 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2238   echo "$ac_t""yes" 1>&6
2239 else
2240   echo "$ac_t""no" 1>&6
2241 fi
2242
2243 # Always use our own libtool.
2244 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
2245
2246 # Check for any special flags to pass to ltconfig.
2247 libtool_flags=
2248 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2249 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2250 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
2251 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2252 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2253
2254 # Some flags need to be propagated to the compiler or linker for good
2255 # libtool support.
2256 case "$host" in
2257 *-*-irix6*)
2258   # Find out which ABI we are using.
2259   echo '#line 2260 "configure"' > conftest.$ac_ext
2260   if { (eval echo configure:2261: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2261     case "`/usr/bin/file conftest.o`" in
2262     *32-bit*)
2263       LD="${LD-ld} -32"
2264       ;;
2265     *N32*)
2266       LD="${LD-ld} -n32"
2267       ;;
2268     *64-bit*)
2269       LD="${LD-ld} -64"
2270       ;;
2271     esac
2272   fi
2273   rm -rf conftest*
2274   ;;
2275
2276 *-*-sco3.2v5*)
2277   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2278   CFLAGS="$CFLAGS -belf"
2279   ;;
2280 esac
2281
2282 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
2283 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
2284 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
2285 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
2286 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
2287 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
2288
2289
2290 for ac_prog in mawk gawk nawk awk
2291 do
2292 # Extract the first word of "$ac_prog", so it can be a program name with args.
2293 set dummy $ac_prog; ac_word=$2
2294 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2295 echo "configure:2296: checking for $ac_word" >&5
2296 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
2297   echo $ac_n "(cached) $ac_c" 1>&6
2298 else
2299   if test -n "$AWK"; then
2300   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2301 else
2302   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2303   ac_dummy="$PATH"
2304   for ac_dir in $ac_dummy; do
2305     test -z "$ac_dir" && ac_dir=.
2306     if test -f $ac_dir/$ac_word; then
2307       ac_cv_prog_AWK="$ac_prog"
2308       break
2309     fi
2310   done
2311   IFS="$ac_save_ifs"
2312 fi
2313 fi
2314 AWK="$ac_cv_prog_AWK"
2315 if test -n "$AWK"; then
2316   echo "$ac_t""$AWK" 1>&6
2317 else
2318   echo "$ac_t""no" 1>&6
2319 fi
2320
2321 test -n "$AWK" && break
2322 done
2323
2324 # test for ln hardlink support
2325 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
2326 echo "configure:2327: checking whether ln works" >&5
2327 if eval "test \"`echo '$''{'ol_cv_prog_LN_H'+set}'`\" = set"; then
2328   echo $ac_n "(cached) $ac_c" 1>&6
2329 else
2330   rm -f conftest.src conftest.dst
2331 echo "conftest" > conftest.src
2332 if ln conftest.src conftest.dst 2>/dev/null
2333 then
2334   ol_cv_prog_LN_H="ln"
2335 else
2336   ol_cv_prog_LN_H="cp"
2337 fi
2338 rm -f conftest.src conftest.dst
2339
2340 fi
2341 LN_H="$ol_cv_prog_LN_H"
2342 if test "$ol_cv_prog_LN_H" = "ln"; then
2343         echo "$ac_t""yes" 1>&6
2344 else
2345         echo "$ac_t""no" 1>&6
2346 fi
2347
2348 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2349 echo "configure:2350: checking whether ln -s works" >&5
2350 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2351   echo $ac_n "(cached) $ac_c" 1>&6
2352 else
2353   rm -f conftestdata
2354 if ln -s X conftestdata 2>/dev/null
2355 then
2356   rm -f conftestdata
2357   ac_cv_prog_LN_S="ln -s"
2358 else
2359   ac_cv_prog_LN_S=ln
2360 fi
2361 fi
2362 LN_S="$ac_cv_prog_LN_S"
2363 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2364   echo "$ac_t""yes" 1>&6
2365 else
2366   echo "$ac_t""no" 1>&6
2367 fi
2368
2369
2370 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
2371         LN_S="$LN_H"
2372 fi
2373
2374 # Extract the first word of "sendmail", so it can be a program name with args.
2375 set dummy sendmail; ac_word=$2
2376 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2377 echo "configure:2378: checking for $ac_word" >&5
2378 if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then
2379   echo $ac_n "(cached) $ac_c" 1>&6
2380 else
2381   case "$SENDMAIL" in
2382   /*)
2383   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
2384   ;;
2385   ?:/*)                  
2386   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
2387   ;;
2388   *)
2389   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2390   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
2391   for ac_dir in $ac_dummy; do 
2392     test -z "$ac_dir" && ac_dir=.
2393     if test -f $ac_dir/$ac_word; then
2394       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
2395       break
2396     fi
2397   done
2398   IFS="$ac_save_ifs"
2399   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
2400   ;;
2401 esac
2402 fi
2403 SENDMAIL="$ac_cv_path_SENDMAIL"
2404 if test -n "$SENDMAIL"; then
2405   echo "$ac_t""$SENDMAIL" 1>&6
2406 else
2407   echo "$ac_t""no" 1>&6
2408 fi
2409
2410 # Extract the first word of "vi", so it can be a program name with args.
2411 set dummy vi; ac_word=$2
2412 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2413 echo "configure:2414: checking for $ac_word" >&5
2414 if eval "test \"`echo '$''{'ac_cv_path_EDITOR'+set}'`\" = set"; then
2415   echo $ac_n "(cached) $ac_c" 1>&6
2416 else
2417   case "$EDITOR" in
2418   /*)
2419   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
2420   ;;
2421   ?:/*)                  
2422   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
2423   ;;
2424   *)
2425   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2426   ac_dummy="$PATH:/usr/ucb"
2427   for ac_dir in $ac_dummy; do 
2428     test -z "$ac_dir" && ac_dir=.
2429     if test -f $ac_dir/$ac_word; then
2430       ac_cv_path_EDITOR="$ac_dir/$ac_word"
2431       break
2432     fi
2433   done
2434   IFS="$ac_save_ifs"
2435   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
2436   ;;
2437 esac
2438 fi
2439 EDITOR="$ac_cv_path_EDITOR"
2440 if test -n "$EDITOR"; then
2441   echo "$ac_t""$EDITOR" 1>&6
2442 else
2443   echo "$ac_t""no" 1>&6
2444 fi
2445
2446 # Extract the first word of "finger", so it can be a program name with args.
2447 set dummy finger; ac_word=$2
2448 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2449 echo "configure:2450: checking for $ac_word" >&5
2450 if eval "test \"`echo '$''{'ac_cv_path_FINGER'+set}'`\" = set"; then
2451   echo $ac_n "(cached) $ac_c" 1>&6
2452 else
2453   case "$FINGER" in
2454   /*)
2455   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
2456   ;;
2457   ?:/*)                  
2458   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
2459   ;;
2460   *)
2461   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2462   ac_dummy="$PATH:/usr/ucb"
2463   for ac_dir in $ac_dummy; do 
2464     test -z "$ac_dir" && ac_dir=.
2465     if test -f $ac_dir/$ac_word; then
2466       ac_cv_path_FINGER="$ac_dir/$ac_word"
2467       break
2468     fi
2469   done
2470   IFS="$ac_save_ifs"
2471   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
2472   ;;
2473 esac
2474 fi
2475 FINGER="$ac_cv_path_FINGER"
2476 if test -n "$FINGER"; then
2477   echo "$ac_t""$FINGER" 1>&6
2478 else
2479   echo "$ac_t""no" 1>&6
2480 fi
2481
2482
2483 ol_link_modules=no
2484 if test $ol_enable_modules != no ; then
2485         # Extract the first word of "glib-config", so it can be a program name with args.
2486 set dummy glib-config; ac_word=$2
2487 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2488 echo "configure:2489: checking for $ac_word" >&5
2489 if eval "test \"`echo '$''{'ac_cv_path_GLIBCONFIG'+set}'`\" = set"; then
2490   echo $ac_n "(cached) $ac_c" 1>&6
2491 else
2492   case "$GLIBCONFIG" in
2493   /*)
2494   ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a path.
2495   ;;
2496   ?:/*)                  
2497   ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a dos path.
2498   ;;
2499   *)
2500   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2501   ac_dummy="$PATH"
2502   for ac_dir in $ac_dummy; do 
2503     test -z "$ac_dir" && ac_dir=.
2504     if test -f $ac_dir/$ac_word; then
2505       ac_cv_path_GLIBCONFIG="$ac_dir/$ac_word"
2506       break
2507     fi
2508   done
2509   IFS="$ac_save_ifs"
2510   ;;
2511 esac
2512 fi
2513 GLIBCONFIG="$ac_cv_path_GLIBCONFIG"
2514 if test -n "$GLIBCONFIG"; then
2515   echo "$ac_t""$GLIBCONFIG" 1>&6
2516 else
2517   echo "$ac_t""no" 1>&6
2518 fi
2519
2520
2521         if test "no$GLIBCONFIG" = "no" ; then
2522                 if test $ol_enable_modules = yes ; then
2523                         { echo "configure: error: could not locate glib-config" 1>&2; exit 1; }
2524                 fi
2525
2526         else
2527                 SLAPD_MODULES_VERSION="`$GLIBCONFIG --version gmodule`"
2528                 SLAPD_MODULES_CPPFLAGS="`$GLIBCONFIG --cflags gmodule`"
2529                 SLAPD_MODULES_LDFLAGS="`$GLIBCONFIG --libs gmodule`"
2530
2531                                 ol_link_modules=yes
2532         fi
2533 fi
2534
2535 ol_link_perl=no
2536 if test $ol_enable_perl != no ; then
2537         # Extract the first word of "perl", so it can be a program name with args.
2538 set dummy perl; ac_word=$2
2539 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2540 echo "configure:2541: checking for $ac_word" >&5
2541 if eval "test \"`echo '$''{'ac_cv_path_PERLBIN'+set}'`\" = set"; then
2542   echo $ac_n "(cached) $ac_c" 1>&6
2543 else
2544   case "$PERLBIN" in
2545   /*)
2546   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
2547   ;;
2548   ?:/*)                  
2549   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
2550   ;;
2551   *)
2552   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2553   ac_dummy="$PATH"
2554   for ac_dir in $ac_dummy; do 
2555     test -z "$ac_dir" && ac_dir=.
2556     if test -f $ac_dir/$ac_word; then
2557       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
2558       break
2559     fi
2560   done
2561   IFS="$ac_save_ifs"
2562   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
2563   ;;
2564 esac
2565 fi
2566 PERLBIN="$ac_cv_path_PERLBIN"
2567 if test -n "$PERLBIN"; then
2568   echo "$ac_t""$PERLBIN" 1>&6
2569 else
2570   echo "$ac_t""no" 1>&6
2571 fi
2572
2573
2574         if test "no$PERLBIN" = "no" ; then
2575                 if test $ol_enable_perl = yes ; then
2576                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
2577                 fi
2578
2579         else
2580                 SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
2581                 SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
2582
2583                                 ol_link_perl=yes
2584         fi
2585 fi
2586
2587 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2588 echo "configure:2589: checking how to run the C preprocessor" >&5
2589 # On Suns, sometimes $CPP names a directory.
2590 if test -n "$CPP" && test -d "$CPP"; then
2591   CPP=
2592 fi
2593 if test -z "$CPP"; then
2594 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
2595   echo $ac_n "(cached) $ac_c" 1>&6
2596 else
2597     # This must be in double quotes, not single quotes, because CPP may get
2598   # substituted into the Makefile and "${CC-cc}" will confuse make.
2599   CPP="${CC-cc} -E"
2600   # On the NeXT, cc -E runs the code through the compiler's parser,
2601   # not just through cpp.
2602   cat > conftest.$ac_ext <<EOF
2603 #line 2604 "configure"
2604 #include "confdefs.h"
2605 #include <assert.h>
2606 Syntax Error
2607 EOF
2608 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2609 { (eval echo configure:2610: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2610 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2611 if test -z "$ac_err"; then
2612   :
2613 else
2614   echo "$ac_err" >&5
2615   echo "configure: failed program was:" >&5
2616   cat conftest.$ac_ext >&5
2617   rm -rf conftest*
2618   CPP="${CC-cc} -E -traditional-cpp"
2619   cat > conftest.$ac_ext <<EOF
2620 #line 2621 "configure"
2621 #include "confdefs.h"
2622 #include <assert.h>
2623 Syntax Error
2624 EOF
2625 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2626 { (eval echo configure:2627: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2627 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2628 if test -z "$ac_err"; then
2629   :
2630 else
2631   echo "$ac_err" >&5
2632   echo "configure: failed program was:" >&5
2633   cat conftest.$ac_ext >&5
2634   rm -rf conftest*
2635   CPP="${CC-cc} -nologo -E"
2636   cat > conftest.$ac_ext <<EOF
2637 #line 2638 "configure"
2638 #include "confdefs.h"
2639 #include <assert.h>
2640 Syntax Error
2641 EOF
2642 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2643 { (eval echo configure:2644: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2644 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2645 if test -z "$ac_err"; then
2646   :
2647 else
2648   echo "$ac_err" >&5
2649   echo "configure: failed program was:" >&5
2650   cat conftest.$ac_ext >&5
2651   rm -rf conftest*
2652   CPP=/lib/cpp
2653 fi
2654 rm -f conftest*
2655 fi
2656 rm -f conftest*
2657 fi
2658 rm -f conftest*
2659   ac_cv_prog_CPP="$CPP"
2660 fi
2661   CPP="$ac_cv_prog_CPP"
2662 else
2663   ac_cv_prog_CPP="$CPP"
2664 fi
2665 echo "$ac_t""$CPP" 1>&6
2666
2667
2668 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
2669         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
2670
2671 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
2672         echo "configure: warning: programs compiled here do run here..." 1>&2
2673         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
2674
2675 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
2676         echo "configure: warning: programs compiled here do not run here..." 1>&2
2677         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
2678 fi
2679
2680 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2681 echo "configure:2682: checking for AIX" >&5
2682 cat > conftest.$ac_ext <<EOF
2683 #line 2684 "configure"
2684 #include "confdefs.h"
2685 #ifdef _AIX
2686   yes
2687 #endif
2688
2689 EOF
2690 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2691   egrep "yes" >/dev/null 2>&1; then
2692   rm -rf conftest*
2693   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
2694 #define _ALL_SOURCE 1
2695 EOF
2696
2697 else
2698   rm -rf conftest*
2699   echo "$ac_t""no" 1>&6
2700 fi
2701 rm -f conftest*
2702
2703
2704 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
2705 echo "configure:2706: checking for POSIXized ISC" >&5
2706 if test -d /etc/conf/kconfig.d &&
2707   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
2708 then
2709   echo "$ac_t""yes" 1>&6
2710   ISC=yes # If later tests want to check for ISC.
2711   cat >> confdefs.h <<\EOF
2712 #define _POSIX_SOURCE 1
2713 EOF
2714
2715   if test "$GCC" = yes; then
2716     CC="$CC -posix"
2717   else
2718     CC="$CC -Xp"
2719   fi
2720 else
2721   echo "$ac_t""no" 1>&6
2722   ISC=
2723 fi
2724
2725 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
2726 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
2727 echo "configure:2728: checking for minix/config.h" >&5
2728 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2729   echo $ac_n "(cached) $ac_c" 1>&6
2730 else
2731   cat > conftest.$ac_ext <<EOF
2732 #line 2733 "configure"
2733 #include "confdefs.h"
2734 #include <minix/config.h>
2735 EOF
2736 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2737 { (eval echo configure:2738: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2738 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2739 if test -z "$ac_err"; then
2740   rm -rf conftest*
2741   eval "ac_cv_header_$ac_safe=yes"
2742 else
2743   echo "$ac_err" >&5
2744   echo "configure: failed program was:" >&5
2745   cat conftest.$ac_ext >&5
2746   rm -rf conftest*
2747   eval "ac_cv_header_$ac_safe=no"
2748 fi
2749 rm -f conftest*
2750 fi
2751 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2752   echo "$ac_t""yes" 1>&6
2753   MINIX=yes
2754 else
2755   echo "$ac_t""no" 1>&6
2756 MINIX=
2757 fi
2758
2759 if test "$MINIX" = yes; then
2760   cat >> confdefs.h <<\EOF
2761 #define _POSIX_SOURCE 1
2762 EOF
2763
2764   cat >> confdefs.h <<\EOF
2765 #define _POSIX_1_SOURCE 2
2766 EOF
2767
2768   cat >> confdefs.h <<\EOF
2769 #define _MINIX 1
2770 EOF
2771
2772 fi
2773
2774
2775 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
2776 echo "configure:2777: checking for be_app in -lbe" >&5
2777 ac_lib_var=`echo be'_'be_app | sed 'y%./+-%__p_%'`
2778 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2779   echo $ac_n "(cached) $ac_c" 1>&6
2780 else
2781   ac_save_LIBS="$LIBS"
2782 LIBS="-lbe -lroot -lnet $LIBS"
2783 cat > conftest.$ac_ext <<EOF
2784 #line 2785 "configure"
2785 #include "confdefs.h"
2786 /* Override any gcc2 internal prototype to avoid an error.  */
2787 /* We use char because int might match the return type of a gcc2
2788     builtin and then its argument prototype would still apply.  */
2789 char be_app();
2790
2791 int main() {
2792 be_app()
2793 ; return 0; }
2794 EOF
2795 if { (eval echo configure:2796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2796   rm -rf conftest*
2797   eval "ac_cv_lib_$ac_lib_var=yes"
2798 else
2799   echo "configure: failed program was:" >&5
2800   cat conftest.$ac_ext >&5
2801   rm -rf conftest*
2802   eval "ac_cv_lib_$ac_lib_var=no"
2803 fi
2804 rm -f conftest*
2805 LIBS="$ac_save_LIBS"
2806
2807 fi
2808 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2809   echo "$ac_t""yes" 1>&6
2810   LIBS="$LIBS -lbe -lroot -lnet"
2811 else
2812   echo "$ac_t""no" 1>&6
2813 :
2814 fi
2815
2816
2817 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
2818 echo "configure:2819: checking for Cygwin environment" >&5
2819 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
2820   echo $ac_n "(cached) $ac_c" 1>&6
2821 else
2822   cat > conftest.$ac_ext <<EOF
2823 #line 2824 "configure"
2824 #include "confdefs.h"
2825
2826 int main() {
2827
2828 #ifndef __CYGWIN__
2829 #define __CYGWIN__ __CYGWIN32__
2830 #endif
2831 return __CYGWIN__;
2832 ; return 0; }
2833 EOF
2834 if { (eval echo configure:2835: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2835   rm -rf conftest*
2836   ac_cv_cygwin=yes
2837 else
2838   echo "configure: failed program was:" >&5
2839   cat conftest.$ac_ext >&5
2840   rm -rf conftest*
2841   ac_cv_cygwin=no
2842 fi
2843 rm -f conftest*
2844 rm -f conftest*
2845 fi
2846
2847 echo "$ac_t""$ac_cv_cygwin" 1>&6
2848 CYGWIN=
2849 test "$ac_cv_cygwin" = yes && CYGWIN=yes
2850 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
2851 echo "configure:2852: checking for mingw32 environment" >&5
2852 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
2853   echo $ac_n "(cached) $ac_c" 1>&6
2854 else
2855   cat > conftest.$ac_ext <<EOF
2856 #line 2857 "configure"
2857 #include "confdefs.h"
2858
2859 int main() {
2860 return __MINGW32__;
2861 ; return 0; }
2862 EOF
2863 if { (eval echo configure:2864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2864   rm -rf conftest*
2865   ac_cv_mingw32=yes
2866 else
2867   echo "configure: failed program was:" >&5
2868   cat conftest.$ac_ext >&5
2869   rm -rf conftest*
2870   ac_cv_mingw32=no
2871 fi
2872 rm -f conftest*
2873 rm -f conftest*
2874 fi
2875
2876 echo "$ac_t""$ac_cv_mingw32" 1>&6
2877 MINGW32=
2878 test "$ac_cv_mingw32" = yes && MINGW32=yes
2879
2880
2881 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
2882 echo "configure:2883: checking for executable suffix" >&5
2883 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
2884   echo $ac_n "(cached) $ac_c" 1>&6
2885 else
2886   if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
2887   ac_cv_exeext=.exe
2888 else
2889   rm -f conftest*
2890   echo 'int main () { return 0; }' > conftest.$ac_ext
2891   ac_cv_exeext=
2892   if { (eval echo configure:2893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
2893     for file in conftest.*; do
2894       case $file in
2895       *.c | *.o | *.obj) ;;
2896       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
2897       esac
2898     done
2899   else
2900     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
2901   fi
2902   rm -f conftest*
2903   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
2904 fi
2905 fi
2906
2907 EXEEXT=""
2908 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
2909 echo "$ac_t""${ac_cv_exeext}" 1>&6
2910 ac_exeext=$EXEEXT
2911
2912 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
2913 echo "configure:2914: checking for object suffix" >&5
2914 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
2915   echo $ac_n "(cached) $ac_c" 1>&6
2916 else
2917   rm -f conftest*
2918 echo 'int i = 1;' > conftest.$ac_ext
2919 if { (eval echo configure:2920: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2920   for ac_file in conftest.*; do
2921     case $ac_file in
2922     *.c) ;;
2923     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
2924     esac
2925   done
2926 else
2927   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
2928 fi
2929 rm -f conftest*
2930 fi
2931
2932 echo "$ac_t""$ac_cv_objext" 1>&6
2933 OBJEXT=$ac_cv_objext
2934 ac_objext=$ac_cv_objext
2935
2936
2937 cat >> confdefs.h <<EOF
2938 #define EXEEXT "${EXEEXT}"
2939 EOF
2940
2941
2942
2943
2944
2945 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
2946 echo "configure:2947: checking for ${CC-cc} option to accept ANSI C" >&5
2947 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
2948   echo $ac_n "(cached) $ac_c" 1>&6
2949 else
2950   am_cv_prog_cc_stdc=no
2951 ac_save_CC="$CC"
2952 # Don't try gcc -ansi; that turns off useful extensions and
2953 # breaks some systems' header files.
2954 # AIX                   -qlanglvl=ansi
2955 # Ultrix and OSF/1      -std1
2956 # HP-UX                 -Aa -D_HPUX_SOURCE
2957 # SVR4                  -Xc -D__EXTENSIONS__
2958 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2959 do
2960   CC="$ac_save_CC $ac_arg"
2961   cat > conftest.$ac_ext <<EOF
2962 #line 2963 "configure"
2963 #include "confdefs.h"
2964 #include <stdarg.h>
2965 #include <stdio.h>
2966 #include <sys/types.h>
2967 #include <sys/stat.h>
2968 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2969 struct buf { int x; };
2970 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2971 static char *e (p, i)
2972      char **p;
2973      int i;
2974 {
2975   return p[i];
2976 }
2977 static char *f (char * (*g) (char **, int), char **p, ...)
2978 {
2979   char *s;
2980   va_list v;
2981   va_start (v,p);
2982   s = g (p, va_arg (v,int));
2983   va_end (v);
2984   return s;
2985 }
2986 int test (int i, double x);
2987 struct s1 {int (*f) (int a);};
2988 struct s2 {int (*f) (double a);};
2989 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2990 int argc;
2991 char **argv;
2992
2993 int main() {
2994
2995 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2996
2997 ; return 0; }
2998 EOF
2999 if { (eval echo configure:3000: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3000   rm -rf conftest*
3001   am_cv_prog_cc_stdc="$ac_arg"; break
3002 else
3003   echo "configure: failed program was:" >&5
3004   cat conftest.$ac_ext >&5
3005 fi
3006 rm -f conftest*
3007 done
3008 CC="$ac_save_CC"
3009
3010 fi
3011
3012 if test -z "$am_cv_prog_cc_stdc"; then
3013   echo "$ac_t""none needed" 1>&6
3014 else
3015   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
3016 fi
3017 case "x$am_cv_prog_cc_stdc" in
3018   x|xno) ;;
3019   *) CC="$CC $am_cv_prog_cc_stdc" ;;
3020 esac
3021
3022 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
3023         { echo "configure: error: OpenLDAP requires compiler to support STDC prototypes." 1>&2; exit 1; }
3024 fi
3025
3026
3027
3028
3029 echo $ac_n "checking for socket""... $ac_c" 1>&6
3030 echo "configure:3031: checking for socket" >&5
3031 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
3032   echo $ac_n "(cached) $ac_c" 1>&6
3033 else
3034   cat > conftest.$ac_ext <<EOF
3035 #line 3036 "configure"
3036 #include "confdefs.h"
3037 /* System header to define __stub macros and hopefully few prototypes,
3038     which can conflict with char socket(); below.  */
3039 #include <assert.h>
3040 /* Override any gcc2 internal prototype to avoid an error.  */
3041 /* We use char because int might match the return type of a gcc2
3042     builtin and then its argument prototype would still apply.  */
3043 char socket();
3044
3045 int main() {
3046
3047 /* The GNU C library defines this for functions which it implements
3048     to always fail with ENOSYS.  Some functions are actually named
3049     something starting with __ and the normal name is an alias.  */
3050 #if defined (__stub_socket) || defined (__stub___socket)
3051 choke me
3052 #else
3053 socket();
3054 #endif
3055
3056 ; return 0; }
3057 EOF
3058 if { (eval echo configure:3059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3059   rm -rf conftest*
3060   eval "ac_cv_func_socket=yes"
3061 else
3062   echo "configure: failed program was:" >&5
3063   cat conftest.$ac_ext >&5
3064   rm -rf conftest*
3065   eval "ac_cv_func_socket=no"
3066 fi
3067 rm -f conftest*
3068 fi
3069
3070 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
3071   echo "$ac_t""yes" 1>&6
3072   :
3073 else
3074   echo "$ac_t""no" 1>&6
3075         
3076         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
3077 echo "configure:3078: checking for main in -lsocket" >&5
3078 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
3079 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3080   echo $ac_n "(cached) $ac_c" 1>&6
3081 else
3082   ac_save_LIBS="$LIBS"
3083 LIBS="-lsocket  $LIBS"
3084 cat > conftest.$ac_ext <<EOF
3085 #line 3086 "configure"
3086 #include "confdefs.h"
3087
3088 int main() {
3089 main()
3090 ; return 0; }
3091 EOF
3092 if { (eval echo configure:3093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3093   rm -rf conftest*
3094   eval "ac_cv_lib_$ac_lib_var=yes"
3095 else
3096   echo "configure: failed program was:" >&5
3097   cat conftest.$ac_ext >&5
3098   rm -rf conftest*
3099   eval "ac_cv_lib_$ac_lib_var=no"
3100 fi
3101 rm -f conftest*
3102 LIBS="$ac_save_LIBS"
3103
3104 fi
3105 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3106   echo "$ac_t""yes" 1>&6
3107     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3108     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3109   cat >> confdefs.h <<EOF
3110 #define $ac_tr_lib 1
3111 EOF
3112
3113   LIBS="-lsocket $LIBS"
3114
3115 else
3116   echo "$ac_t""no" 1>&6
3117 fi
3118
3119         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
3120 echo "configure:3121: checking for main in -lnet" >&5
3121 ac_lib_var=`echo net'_'main | sed 'y%./+-%__p_%'`
3122 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3123   echo $ac_n "(cached) $ac_c" 1>&6
3124 else
3125   ac_save_LIBS="$LIBS"
3126 LIBS="-lnet  $LIBS"
3127 cat > conftest.$ac_ext <<EOF
3128 #line 3129 "configure"
3129 #include "confdefs.h"
3130
3131 int main() {
3132 main()
3133 ; return 0; }
3134 EOF
3135 if { (eval echo configure:3136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3136   rm -rf conftest*
3137   eval "ac_cv_lib_$ac_lib_var=yes"
3138 else
3139   echo "configure: failed program was:" >&5
3140   cat conftest.$ac_ext >&5
3141   rm -rf conftest*
3142   eval "ac_cv_lib_$ac_lib_var=no"
3143 fi
3144 rm -f conftest*
3145 LIBS="$ac_save_LIBS"
3146
3147 fi
3148 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3149   echo "$ac_t""yes" 1>&6
3150     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3151     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3152   cat >> confdefs.h <<EOF
3153 #define $ac_tr_lib 1
3154 EOF
3155
3156   LIBS="-lnet $LIBS"
3157
3158 else
3159   echo "$ac_t""no" 1>&6
3160 fi
3161
3162         echo $ac_n "checking for socket in -lnet""... $ac_c" 1>&6
3163 echo "configure:3164: checking for socket in -lnet" >&5
3164 ac_lib_var=`echo net'_'socket | sed 'y%./+-%__p_%'`
3165 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3166   echo $ac_n "(cached) $ac_c" 1>&6
3167 else
3168   ac_save_LIBS="$LIBS"
3169 LIBS="-lnet  $LIBS"
3170 cat > conftest.$ac_ext <<EOF
3171 #line 3172 "configure"
3172 #include "confdefs.h"
3173 /* Override any gcc2 internal prototype to avoid an error.  */
3174 /* We use char because int might match the return type of a gcc2
3175     builtin and then its argument prototype would still apply.  */
3176 char socket();
3177
3178 int main() {
3179 socket()
3180 ; return 0; }
3181 EOF
3182 if { (eval echo configure:3183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3183   rm -rf conftest*
3184   eval "ac_cv_lib_$ac_lib_var=yes"
3185 else
3186   echo "configure: failed program was:" >&5
3187   cat conftest.$ac_ext >&5
3188   rm -rf conftest*
3189   eval "ac_cv_lib_$ac_lib_var=no"
3190 fi
3191 rm -f conftest*
3192 LIBS="$ac_save_LIBS"
3193
3194 fi
3195 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3196   echo "$ac_t""yes" 1>&6
3197     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3198     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3199   cat >> confdefs.h <<EOF
3200 #define $ac_tr_lib 1
3201 EOF
3202
3203   LIBS="-lnet $LIBS"
3204
3205 else
3206   echo "$ac_t""no" 1>&6
3207 fi
3208
3209         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
3210 echo "configure:3211: checking for main in -lnsl_s" >&5
3211 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-%__p_%'`
3212 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3213   echo $ac_n "(cached) $ac_c" 1>&6
3214 else
3215   ac_save_LIBS="$LIBS"
3216 LIBS="-lnsl_s  $LIBS"
3217 cat > conftest.$ac_ext <<EOF
3218 #line 3219 "configure"
3219 #include "confdefs.h"
3220
3221 int main() {
3222 main()
3223 ; return 0; }
3224 EOF
3225 if { (eval echo configure:3226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3226   rm -rf conftest*
3227   eval "ac_cv_lib_$ac_lib_var=yes"
3228 else
3229   echo "configure: failed program was:" >&5
3230   cat conftest.$ac_ext >&5
3231   rm -rf conftest*
3232   eval "ac_cv_lib_$ac_lib_var=no"
3233 fi
3234 rm -f conftest*
3235 LIBS="$ac_save_LIBS"
3236
3237 fi
3238 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3239   echo "$ac_t""yes" 1>&6
3240     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3241     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3242   cat >> confdefs.h <<EOF
3243 #define $ac_tr_lib 1
3244 EOF
3245
3246   LIBS="-lnsl_s $LIBS"
3247
3248 else
3249   echo "$ac_t""no" 1>&6
3250 fi
3251
3252         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
3253 echo "configure:3254: checking for main in -lnsl" >&5
3254 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
3255 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3256   echo $ac_n "(cached) $ac_c" 1>&6
3257 else
3258   ac_save_LIBS="$LIBS"
3259 LIBS="-lnsl  $LIBS"
3260 cat > conftest.$ac_ext <<EOF
3261 #line 3262 "configure"
3262 #include "confdefs.h"
3263
3264 int main() {
3265 main()
3266 ; return 0; }
3267 EOF
3268 if { (eval echo configure:3269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3269   rm -rf conftest*
3270   eval "ac_cv_lib_$ac_lib_var=yes"
3271 else
3272   echo "configure: failed program was:" >&5
3273   cat conftest.$ac_ext >&5
3274   rm -rf conftest*
3275   eval "ac_cv_lib_$ac_lib_var=no"
3276 fi
3277 rm -f conftest*
3278 LIBS="$ac_save_LIBS"
3279
3280 fi
3281 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3282   echo "$ac_t""yes" 1>&6
3283     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3284     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3285   cat >> confdefs.h <<EOF
3286 #define $ac_tr_lib 1
3287 EOF
3288
3289   LIBS="-lnsl $LIBS"
3290
3291 else
3292   echo "$ac_t""no" 1>&6
3293 fi
3294
3295         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
3296 echo "configure:3297: checking for socket in -linet" >&5
3297 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
3298 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3299   echo $ac_n "(cached) $ac_c" 1>&6
3300 else
3301   ac_save_LIBS="$LIBS"
3302 LIBS="-linet  $LIBS"
3303 cat > conftest.$ac_ext <<EOF
3304 #line 3305 "configure"
3305 #include "confdefs.h"
3306 /* Override any gcc2 internal prototype to avoid an error.  */
3307 /* We use char because int might match the return type of a gcc2
3308     builtin and then its argument prototype would still apply.  */
3309 char socket();
3310
3311 int main() {
3312 socket()
3313 ; return 0; }
3314 EOF
3315 if { (eval echo configure:3316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3316   rm -rf conftest*
3317   eval "ac_cv_lib_$ac_lib_var=yes"
3318 else
3319   echo "configure: failed program was:" >&5
3320   cat conftest.$ac_ext >&5
3321   rm -rf conftest*
3322   eval "ac_cv_lib_$ac_lib_var=no"
3323 fi
3324 rm -f conftest*
3325 LIBS="$ac_save_LIBS"
3326
3327 fi
3328 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3329   echo "$ac_t""yes" 1>&6
3330     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3331     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3332   cat >> confdefs.h <<EOF
3333 #define $ac_tr_lib 1
3334 EOF
3335
3336   LIBS="-linet $LIBS"
3337
3338 else
3339   echo "$ac_t""no" 1>&6
3340 fi
3341
3342         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
3343 echo "configure:3344: checking for main in -lgen" >&5
3344 ac_lib_var=`echo gen'_'main | sed 'y%./+-%__p_%'`
3345 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3346   echo $ac_n "(cached) $ac_c" 1>&6
3347 else
3348   ac_save_LIBS="$LIBS"
3349 LIBS="-lgen  $LIBS"
3350 cat > conftest.$ac_ext <<EOF
3351 #line 3352 "configure"
3352 #include "confdefs.h"
3353
3354 int main() {
3355 main()
3356 ; return 0; }
3357 EOF
3358 if { (eval echo configure:3359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3359   rm -rf conftest*
3360   eval "ac_cv_lib_$ac_lib_var=yes"
3361 else
3362   echo "configure: failed program was:" >&5
3363   cat conftest.$ac_ext >&5
3364   rm -rf conftest*
3365   eval "ac_cv_lib_$ac_lib_var=no"
3366 fi
3367 rm -f conftest*
3368 LIBS="$ac_save_LIBS"
3369
3370 fi
3371 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3372   echo "$ac_t""yes" 1>&6
3373     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3374     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3375   cat >> confdefs.h <<EOF
3376 #define $ac_tr_lib 1
3377 EOF
3378
3379   LIBS="-lgen $LIBS"
3380
3381 else
3382   echo "$ac_t""no" 1>&6
3383 fi
3384
3385
3386 fi
3387
3388
3389 for ac_func in res_search
3390 do
3391 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3392 echo "configure:3393: checking for $ac_func" >&5
3393 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3394   echo $ac_n "(cached) $ac_c" 1>&6
3395 else
3396   cat > conftest.$ac_ext <<EOF
3397 #line 3398 "configure"
3398 #include "confdefs.h"
3399 /* System header to define __stub macros and hopefully few prototypes,
3400     which can conflict with char $ac_func(); below.  */
3401 #include <assert.h>
3402 /* Override any gcc2 internal prototype to avoid an error.  */
3403 /* We use char because int might match the return type of a gcc2
3404     builtin and then its argument prototype would still apply.  */
3405 char $ac_func();
3406
3407 int main() {
3408
3409 /* The GNU C library defines this for functions which it implements
3410     to always fail with ENOSYS.  Some functions are actually named
3411     something starting with __ and the normal name is an alias.  */
3412 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3413 choke me
3414 #else
3415 $ac_func();
3416 #endif
3417
3418 ; return 0; }
3419 EOF
3420 if { (eval echo configure:3421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3421   rm -rf conftest*
3422   eval "ac_cv_func_$ac_func=yes"
3423 else
3424   echo "configure: failed program was:" >&5
3425   cat conftest.$ac_ext >&5
3426   rm -rf conftest*
3427   eval "ac_cv_func_$ac_func=no"
3428 fi
3429 rm -f conftest*
3430 fi
3431
3432 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3433   echo "$ac_t""yes" 1>&6
3434     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3435   cat >> confdefs.h <<EOF
3436 #define $ac_tr_func 1
3437 EOF
3438  
3439 else
3440   echo "$ac_t""no" 1>&6
3441 fi
3442 done
3443
3444 if test $ac_cv_func_res_search = "no" ; then 
3445         echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
3446 echo "configure:3447: checking for res_search in -lbind" >&5
3447 ac_lib_var=`echo bind'_'res_search | sed 'y%./+-%__p_%'`
3448 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3449   echo $ac_n "(cached) $ac_c" 1>&6
3450 else
3451   ac_save_LIBS="$LIBS"
3452 LIBS="-lbind  $LIBS"
3453 cat > conftest.$ac_ext <<EOF
3454 #line 3455 "configure"
3455 #include "confdefs.h"
3456 /* Override any gcc2 internal prototype to avoid an error.  */
3457 /* We use char because int might match the return type of a gcc2
3458     builtin and then its argument prototype would still apply.  */
3459 char res_search();
3460
3461 int main() {
3462 res_search()
3463 ; return 0; }
3464 EOF
3465 if { (eval echo configure:3466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3466   rm -rf conftest*
3467   eval "ac_cv_lib_$ac_lib_var=yes"
3468 else
3469   echo "configure: failed program was:" >&5
3470   cat conftest.$ac_ext >&5
3471   rm -rf conftest*
3472   eval "ac_cv_lib_$ac_lib_var=no"
3473 fi
3474 rm -f conftest*
3475 LIBS="$ac_save_LIBS"
3476
3477 fi
3478 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3479   echo "$ac_t""yes" 1>&6
3480     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3481     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3482   cat >> confdefs.h <<EOF
3483 #define $ac_tr_lib 1
3484 EOF
3485
3486   LIBS="-lbind $LIBS"
3487
3488 else
3489   echo "$ac_t""no" 1>&6
3490 fi
3491
3492         if test "$ac_cv_lib_bind_res_search" = "yes" ; then
3493                 cat >> confdefs.h <<\EOF
3494 #define HAVE_RES_SEARCH 1
3495 EOF
3496
3497         else
3498                 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
3499 echo "configure:3500: checking for res_search in -lresolv" >&5
3500 ac_lib_var=`echo resolv'_'res_search | 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="-lresolv  $LIBS"
3506 cat > conftest.$ac_ext <<EOF
3507 #line 3508 "configure"
3508 #include "confdefs.h"
3509 /* Override any gcc2 internal prototype to avoid an error.  */
3510 /* We use char because int might match the return type of a gcc2
3511     builtin and then its argument prototype would still apply.  */
3512 char res_search();
3513
3514 int main() {
3515 res_search()
3516 ; return 0; }
3517 EOF
3518 if { (eval echo configure:3519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3519   rm -rf conftest*
3520   eval "ac_cv_lib_$ac_lib_var=yes"
3521 else
3522   echo "configure: failed program was:" >&5
3523   cat conftest.$ac_ext >&5
3524   rm -rf conftest*
3525   eval "ac_cv_lib_$ac_lib_var=no"
3526 fi
3527 rm -f conftest*
3528 LIBS="$ac_save_LIBS"
3529
3530 fi
3531 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3532   echo "$ac_t""yes" 1>&6
3533     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3534     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3535   cat >> confdefs.h <<EOF
3536 #define $ac_tr_lib 1
3537 EOF
3538
3539   LIBS="-lresolv $LIBS"
3540
3541 else
3542   echo "$ac_t""no" 1>&6
3543 fi
3544
3545                 if test "$ac_cv_lib_resolv_res_search" = "yes" ; then
3546                         cat >> confdefs.h <<\EOF
3547 #define HAVE_RES_SEARCH 1
3548 EOF
3549
3550                 fi
3551         fi
3552 fi
3553
3554 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
3555 echo "configure:3556: checking for sigset in -lV3" >&5
3556 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-%__p_%'`
3557 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3558   echo $ac_n "(cached) $ac_c" 1>&6
3559 else
3560   ac_save_LIBS="$LIBS"
3561 LIBS="-lV3  $LIBS"
3562 cat > conftest.$ac_ext <<EOF
3563 #line 3564 "configure"
3564 #include "confdefs.h"
3565 /* Override any gcc2 internal prototype to avoid an error.  */
3566 /* We use char because int might match the return type of a gcc2
3567     builtin and then its argument prototype would still apply.  */
3568 char sigset();
3569
3570 int main() {
3571 sigset()
3572 ; return 0; }
3573 EOF
3574 if { (eval echo configure:3575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3575   rm -rf conftest*
3576   eval "ac_cv_lib_$ac_lib_var=yes"
3577 else
3578   echo "configure: failed program was:" >&5
3579   cat conftest.$ac_ext >&5
3580   rm -rf conftest*
3581   eval "ac_cv_lib_$ac_lib_var=no"
3582 fi
3583 rm -f conftest*
3584 LIBS="$ac_save_LIBS"
3585
3586 fi
3587 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3588   echo "$ac_t""yes" 1>&6
3589     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3590     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3591   cat >> confdefs.h <<EOF
3592 #define $ac_tr_lib 1
3593 EOF
3594
3595   LIBS="-lV3 $LIBS"
3596
3597 else
3598   echo "$ac_t""no" 1>&6
3599 fi
3600
3601
3602 for ac_hdr in regex.h 
3603 do
3604 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3605 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3606 echo "configure:3607: checking for $ac_hdr" >&5
3607 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3608   echo $ac_n "(cached) $ac_c" 1>&6
3609 else
3610   cat > conftest.$ac_ext <<EOF
3611 #line 3612 "configure"
3612 #include "confdefs.h"
3613 #include <$ac_hdr>
3614 EOF
3615 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3616 { (eval echo configure:3617: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3617 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3618 if test -z "$ac_err"; then
3619   rm -rf conftest*
3620   eval "ac_cv_header_$ac_safe=yes"
3621 else
3622   echo "$ac_err" >&5
3623   echo "configure: failed program was:" >&5
3624   cat conftest.$ac_ext >&5
3625   rm -rf conftest*
3626   eval "ac_cv_header_$ac_safe=no"
3627 fi
3628 rm -f conftest*
3629 fi
3630 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3631   echo "$ac_t""yes" 1>&6
3632     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3633   cat >> confdefs.h <<EOF
3634 #define $ac_tr_hdr 1
3635 EOF
3636  
3637 else
3638   echo "$ac_t""no" 1>&6
3639 fi
3640 done
3641
3642 if test "$ac_cv_header_regex_h" != yes ; then
3643         { echo "configure: error: POSIX REGEX required." 1>&2; exit 1; }
3644 fi
3645
3646 echo $ac_n "checking for select""... $ac_c" 1>&6
3647 echo "configure:3648: checking for select" >&5
3648 if eval "test \"`echo '$''{'ac_cv_func_select'+set}'`\" = set"; then
3649   echo $ac_n "(cached) $ac_c" 1>&6
3650 else
3651   cat > conftest.$ac_ext <<EOF
3652 #line 3653 "configure"
3653 #include "confdefs.h"
3654 /* System header to define __stub macros and hopefully few prototypes,
3655     which can conflict with char select(); below.  */
3656 #include <assert.h>
3657 /* Override any gcc2 internal prototype to avoid an error.  */
3658 /* We use char because int might match the return type of a gcc2
3659     builtin and then its argument prototype would still apply.  */
3660 char select();
3661
3662 int main() {
3663
3664 /* The GNU C library defines this for functions which it implements
3665     to always fail with ENOSYS.  Some functions are actually named
3666     something starting with __ and the normal name is an alias.  */
3667 #if defined (__stub_select) || defined (__stub___select)
3668 choke me
3669 #else
3670 select();
3671 #endif
3672
3673 ; return 0; }
3674 EOF
3675 if { (eval echo configure:3676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3676   rm -rf conftest*
3677   eval "ac_cv_func_select=yes"
3678 else
3679   echo "configure: failed program was:" >&5
3680   cat conftest.$ac_ext >&5
3681   rm -rf conftest*
3682   eval "ac_cv_func_select=no"
3683 fi
3684 rm -f conftest*
3685 fi
3686
3687 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
3688   echo "$ac_t""yes" 1>&6
3689   :
3690 else
3691   echo "$ac_t""no" 1>&6
3692 { echo "configure: error: select() required." 1>&2; exit 1; }
3693 fi
3694
3695
3696 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
3697 echo "configure:3698: checking types of arguments for select()" >&5
3698  if eval "test \"`echo '$''{'ac_cv_func_select_arg234'+set}'`\" = set"; then
3699   echo $ac_n "(cached) $ac_c" 1>&6
3700 else
3701    if eval "test \"`echo '$''{'ac_cv_func_select_arg1'+set}'`\" = set"; then
3702   echo $ac_n "(cached) $ac_c" 1>&6
3703 else
3704     if eval "test \"`echo '$''{'ac_cv_func_select_arg5'+set}'`\" = set"; then
3705   echo $ac_n "(cached) $ac_c" 1>&6
3706 else
3707      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
3708      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
3709       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
3710        cat > conftest.$ac_ext <<EOF
3711 #line 3712 "configure"
3712 #include "confdefs.h"
3713 #ifdef HAVE_SYS_TYPES_H
3714 #include <sys/types.h>
3715 #endif
3716 #ifdef HAVE_SYS_TIME_H
3717 #include <sys/time.h>
3718 #endif
3719 #ifdef HAVE_SYS_SELECT_H
3720 #include <sys/select.h>
3721 #endif
3722 #ifdef HAVE_SYS_SOCKET_H
3723 #include <sys/socket.h>
3724 #endif
3725 extern select ($ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5);
3726 int main() {
3727
3728 ; return 0; }
3729 EOF
3730 if { (eval echo configure:3731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3731   rm -rf conftest*
3732           ac_not_found=no ; break 3
3733 else
3734   echo "configure: failed program was:" >&5
3735   cat conftest.$ac_ext >&5
3736   rm -rf conftest*
3737   ac_not_found=yes
3738 fi
3739 rm -f conftest*
3740       done
3741      done
3742     done
3743    
3744 fi
3745   
3746 fi
3747  
3748 fi
3749  if test "$ac_not_found" = yes; then
3750   ac_cv_func_select_arg1=int 
3751   ac_cv_func_select_arg234='int *' 
3752   ac_cv_func_select_arg5='struct timeval *'
3753  fi
3754  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
3755  cat >> confdefs.h <<EOF
3756 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
3757 EOF
3758
3759  cat >> confdefs.h <<EOF
3760 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
3761 EOF
3762
3763  cat >> confdefs.h <<EOF
3764 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
3765 EOF
3766
3767
3768
3769 # ISODE tests
3770 ol_link_isode=no
3771 if test $ol_enable_ldapd != no ; then
3772         echo "configure: warning: ldapd support deprecated.  Manual intervention required." 1>&2
3773
3774                 echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
3775 echo "configure:3776: checking for main in -lxtpp" >&5
3776 ac_lib_var=`echo xtpp'_'main | sed 'y%./+-%__p_%'`
3777 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3778   echo $ac_n "(cached) $ac_c" 1>&6
3779 else
3780   ac_save_LIBS="$LIBS"
3781 LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
3782 cat > conftest.$ac_ext <<EOF
3783 #line 3784 "configure"
3784 #include "confdefs.h"
3785
3786 int main() {
3787 main()
3788 ; return 0; }
3789 EOF
3790 if { (eval echo configure:3791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3791   rm -rf conftest*
3792   eval "ac_cv_lib_$ac_lib_var=yes"
3793 else
3794   echo "configure: failed program was:" >&5
3795   cat conftest.$ac_ext >&5
3796   rm -rf conftest*
3797   eval "ac_cv_lib_$ac_lib_var=no"
3798 fi
3799 rm -f conftest*
3800 LIBS="$ac_save_LIBS"
3801
3802 fi
3803 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3804   echo "$ac_t""yes" 1>&6
3805   
3806                 ol_link_isode=yes
3807                 cat >> confdefs.h <<\EOF
3808 #define HAVE_XTPP 1
3809 EOF
3810
3811                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
3812                 
3813 else
3814   echo "$ac_t""no" 1>&6
3815 :
3816 fi
3817
3818         echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
3819 echo "configure:3820: checking for main in -ldsap" >&5
3820 ac_lib_var=`echo dsap'_'main | sed 'y%./+-%__p_%'`
3821 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3822   echo $ac_n "(cached) $ac_c" 1>&6
3823 else
3824   ac_save_LIBS="$LIBS"
3825 LIBS="-ldsap -lisode $LIBS"
3826 cat > conftest.$ac_ext <<EOF
3827 #line 3828 "configure"
3828 #include "confdefs.h"
3829
3830 int main() {
3831 main()
3832 ; return 0; }
3833 EOF
3834 if { (eval echo configure:3835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3835   rm -rf conftest*
3836   eval "ac_cv_lib_$ac_lib_var=yes"
3837 else
3838   echo "configure: failed program was:" >&5
3839   cat conftest.$ac_ext >&5
3840   rm -rf conftest*
3841   eval "ac_cv_lib_$ac_lib_var=no"
3842 fi
3843 rm -f conftest*
3844 LIBS="$ac_save_LIBS"
3845
3846 fi
3847 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3848   echo "$ac_t""yes" 1>&6
3849   
3850                 ol_link_isode=yes
3851                 cat >> confdefs.h <<\EOF
3852 #define HAVE_DSAP 1
3853 EOF
3854
3855                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
3856                 
3857 else
3858   echo "$ac_t""no" 1>&6
3859 :
3860 fi
3861
3862         echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
3863 echo "configure:3864: checking for main in -lisode" >&5
3864 ac_lib_var=`echo isode'_'main | 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="-lisode  $LIBS"
3870 cat > conftest.$ac_ext <<EOF
3871 #line 3872 "configure"
3872 #include "confdefs.h"
3873
3874 int main() {
3875 main()
3876 ; return 0; }
3877 EOF
3878 if { (eval echo configure:3879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3879   rm -rf conftest*
3880   eval "ac_cv_lib_$ac_lib_var=yes"
3881 else
3882   echo "configure: failed program was:" >&5
3883   cat conftest.$ac_ext >&5
3884   rm -rf conftest*
3885   eval "ac_cv_lib_$ac_lib_var=no"
3886 fi
3887 rm -f conftest*
3888 LIBS="$ac_save_LIBS"
3889
3890 fi
3891 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3892   echo "$ac_t""yes" 1>&6
3893   
3894                 ol_link_isode=yes
3895                 cat >> confdefs.h <<\EOF
3896 #define HAVE_ISODE 1
3897 EOF
3898
3899                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
3900                 
3901 else
3902   echo "$ac_t""no" 1>&6
3903 :
3904 fi
3905
3906 fi
3907
3908 if test $ol_link_isode != no; then
3909         echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
3910 echo "configure:3911: checking for main in -lpp" >&5
3911 ac_lib_var=`echo pp'_'main | sed 'y%./+-%__p_%'`
3912 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3913   echo $ac_n "(cached) $ac_c" 1>&6
3914 else
3915   ac_save_LIBS="$LIBS"
3916 LIBS="-lpp  $LIBS"
3917 cat > conftest.$ac_ext <<EOF
3918 #line 3919 "configure"
3919 #include "confdefs.h"
3920
3921 int main() {
3922 main()
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   
3941                 cat >> confdefs.h <<\EOF
3942 #define HAVE_PP 1
3943 EOF
3944
3945                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
3946                 
3947 else
3948   echo "$ac_t""no" 1>&6
3949 :
3950 fi
3951
3952
3953         # Extract the first word of "pepsy", so it can be a program name with args.
3954 set dummy pepsy; ac_word=$2
3955 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3956 echo "configure:3957: checking for $ac_word" >&5
3957 if eval "test \"`echo '$''{'ac_cv_path_PEPSY'+set}'`\" = set"; then
3958   echo $ac_n "(cached) $ac_c" 1>&6
3959 else
3960   case "$PEPSY" in
3961   /*)
3962   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a path.
3963   ;;
3964   ?:/*)                  
3965   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a dos path.
3966   ;;
3967   *)
3968   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3969   ac_dummy="$PATH"
3970   for ac_dir in $ac_dummy; do 
3971     test -z "$ac_dir" && ac_dir=.
3972     if test -f $ac_dir/$ac_word; then
3973       ac_cv_path_PEPSY="$ac_dir/$ac_word"
3974       break
3975     fi
3976   done
3977   IFS="$ac_save_ifs"
3978   ;;
3979 esac
3980 fi
3981 PEPSY="$ac_cv_path_PEPSY"
3982 if test -n "$PEPSY"; then
3983   echo "$ac_t""$PEPSY" 1>&6
3984 else
3985   echo "$ac_t""no" 1>&6
3986 fi
3987
3988 fi
3989
3990 ol_link_kerberos=no
3991
3992 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
3993         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
3994 do
3995 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3996 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3997 echo "configure:3998: checking for $ac_hdr" >&5
3998 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3999   echo $ac_n "(cached) $ac_c" 1>&6
4000 else
4001   cat > conftest.$ac_ext <<EOF
4002 #line 4003 "configure"
4003 #include "confdefs.h"
4004 #include <$ac_hdr>
4005 EOF
4006 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4007 { (eval echo configure:4008: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4008 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4009 if test -z "$ac_err"; then
4010   rm -rf conftest*
4011   eval "ac_cv_header_$ac_safe=yes"
4012 else
4013   echo "$ac_err" >&5
4014   echo "configure: failed program was:" >&5
4015   cat conftest.$ac_ext >&5
4016   rm -rf conftest*
4017   eval "ac_cv_header_$ac_safe=no"
4018 fi
4019 rm -f conftest*
4020 fi
4021 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4022   echo "$ac_t""yes" 1>&6
4023     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4024   cat >> confdefs.h <<EOF
4025 #define $ac_tr_hdr 1
4026 EOF
4027  
4028 else
4029   echo "$ac_t""no" 1>&6
4030 fi
4031 done
4032
4033
4034         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
4035                 echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
4036 echo "configure:4037: checking for main in -lkrb4" >&5
4037 ac_lib_var=`echo krb4'_'main | sed 'y%./+-%__p_%'`
4038 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4039   echo $ac_n "(cached) $ac_c" 1>&6
4040 else
4041   ac_save_LIBS="$LIBS"
4042 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
4043 cat > conftest.$ac_ext <<EOF
4044 #line 4045 "configure"
4045 #include "confdefs.h"
4046
4047 int main() {
4048 main()
4049 ; return 0; }
4050 EOF
4051 if { (eval echo configure:4052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4052   rm -rf conftest*
4053   eval "ac_cv_lib_$ac_lib_var=yes"
4054 else
4055   echo "configure: failed program was:" >&5
4056   cat conftest.$ac_ext >&5
4057   rm -rf conftest*
4058   eval "ac_cv_lib_$ac_lib_var=no"
4059 fi
4060 rm -f conftest*
4061 LIBS="$ac_save_LIBS"
4062
4063 fi
4064 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4065   echo "$ac_t""yes" 1>&6
4066   have_k5=yes
4067 else
4068   echo "$ac_t""no" 1>&6
4069 have_k5=no
4070 fi
4071
4072
4073                 if test $have_k5 = yes ; then
4074                         ol_with_kerberos=found
4075                         ol_link_kerberos=yes
4076
4077                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
4078
4079                         LIBS="$KRB_LIBS $LIBS"
4080
4081                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
4082 echo "configure:4083: checking for des_debug in Kerberos libraries" >&5
4083 if eval "test \"`echo '$''{'ol_cv_var_des_debug'+set}'`\" = set"; then
4084   echo $ac_n "(cached) $ac_c" 1>&6
4085 else
4086   
4087                                                                 save_LIBS="$LIBS"
4088                                 LIBS="$KRB_LIBS $LIBS"
4089                                 cat > conftest.$ac_ext <<EOF
4090 #line 4091 "configure"
4091 #include "confdefs.h"
4092
4093 #include <kerberosIV/krb.h>
4094 #include <kerberosIV/des.h>
4095 extern int des_debug;
4096
4097 int main() {
4098
4099 des_debug = 1;
4100
4101 ; return 0; }
4102 EOF
4103 if { (eval echo configure:4104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4104   rm -rf conftest*
4105   ol_cv_var_des_debug=yes
4106 else
4107   echo "configure: failed program was:" >&5
4108   cat conftest.$ac_ext >&5
4109   rm -rf conftest*
4110   ol_cv_var_des_debug=no
4111 fi
4112 rm -f conftest*
4113                                                                 LIBS="$save_LIBS"
4114                         
4115 fi
4116
4117 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
4118
4119                         if test $ol_cv_var_des_debug = yes ; then
4120                                 cat >> confdefs.h <<\EOF
4121 #define HAVE_DES_DEBUG 1
4122 EOF
4123
4124                         fi
4125
4126                         LIBS="$save_LIBS"
4127                 fi
4128         fi
4129 fi
4130
4131 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
4132         for ac_hdr in krb.h des.h
4133 do
4134 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4135 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4136 echo "configure:4137: checking for $ac_hdr" >&5
4137 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4138   echo $ac_n "(cached) $ac_c" 1>&6
4139 else
4140   cat > conftest.$ac_ext <<EOF
4141 #line 4142 "configure"
4142 #include "confdefs.h"
4143 #include <$ac_hdr>
4144 EOF
4145 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4146 { (eval echo configure:4147: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4147 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4148 if test -z "$ac_err"; then
4149   rm -rf conftest*
4150   eval "ac_cv_header_$ac_safe=yes"
4151 else
4152   echo "$ac_err" >&5
4153   echo "configure: failed program was:" >&5
4154   cat conftest.$ac_ext >&5
4155   rm -rf conftest*
4156   eval "ac_cv_header_$ac_safe=no"
4157 fi
4158 rm -f conftest*
4159 fi
4160 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4161   echo "$ac_t""yes" 1>&6
4162     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4163   cat >> confdefs.h <<EOF
4164 #define $ac_tr_hdr 1
4165 EOF
4166  
4167 else
4168   echo "$ac_t""no" 1>&6
4169 fi
4170 done
4171
4172
4173         if test $ac_cv_header_krb_h = yes ; then
4174                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
4175 echo "configure:4176: checking for main in -lkrb" >&5
4176 ac_lib_var=`echo krb'_'main | sed 'y%./+-%__p_%'`
4177 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4178   echo $ac_n "(cached) $ac_c" 1>&6
4179 else
4180   ac_save_LIBS="$LIBS"
4181 LIBS="-lkrb -ldes $LIBS"
4182 cat > conftest.$ac_ext <<EOF
4183 #line 4184 "configure"
4184 #include "confdefs.h"
4185
4186 int main() {
4187 main()
4188 ; return 0; }
4189 EOF
4190 if { (eval echo configure:4191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4191   rm -rf conftest*
4192   eval "ac_cv_lib_$ac_lib_var=yes"
4193 else
4194   echo "configure: failed program was:" >&5
4195   cat conftest.$ac_ext >&5
4196   rm -rf conftest*
4197   eval "ac_cv_lib_$ac_lib_var=no"
4198 fi
4199 rm -f conftest*
4200 LIBS="$ac_save_LIBS"
4201
4202 fi
4203 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4204   echo "$ac_t""yes" 1>&6
4205   have_k4=yes
4206 else
4207   echo "$ac_t""no" 1>&6
4208 have_k4=no
4209 fi
4210
4211
4212                 if test $have_k4 = yes ; then
4213                         ol_with_kerberos=found
4214                         ol_link_kerberos=yes
4215
4216                         KRB_LIBS="-lkrb -ldes"
4217                 fi
4218         fi
4219 fi
4220
4221 if test $ol_link_kerberos = yes ; then
4222         cat >> confdefs.h <<\EOF
4223 #define HAVE_KERBEROS 1
4224 EOF
4225
4226 fi
4227
4228 ol_link_tls=no
4229 if test $ol_with_tls != no ; then
4230         
4231         for ac_hdr in ssl.h
4232 do
4233 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4234 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4235 echo "configure:4236: checking for $ac_hdr" >&5
4236 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4237   echo $ac_n "(cached) $ac_c" 1>&6
4238 else
4239   cat > conftest.$ac_ext <<EOF
4240 #line 4241 "configure"
4241 #include "confdefs.h"
4242 #include <$ac_hdr>
4243 EOF
4244 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4245 { (eval echo configure:4246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4246 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4247 if test -z "$ac_err"; then
4248   rm -rf conftest*
4249   eval "ac_cv_header_$ac_safe=yes"
4250 else
4251   echo "$ac_err" >&5
4252   echo "configure: failed program was:" >&5
4253   cat conftest.$ac_ext >&5
4254   rm -rf conftest*
4255   eval "ac_cv_header_$ac_safe=no"
4256 fi
4257 rm -f conftest*
4258 fi
4259 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4260   echo "$ac_t""yes" 1>&6
4261     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4262   cat >> confdefs.h <<EOF
4263 #define $ac_tr_hdr 1
4264 EOF
4265  
4266 else
4267   echo "$ac_t""no" 1>&6
4268 fi
4269 done
4270
4271         
4272         if test $ac_cv_header_ssl_h = yes ; then
4273                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
4274 echo "configure:4275: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
4275 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-%__p_%'`
4276 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4277   echo $ac_n "(cached) $ac_c" 1>&6
4278 else
4279   ac_save_LIBS="$LIBS"
4280 LIBS="-lssl -lcrypto $LIBS"
4281 cat > conftest.$ac_ext <<EOF
4282 #line 4283 "configure"
4283 #include "confdefs.h"
4284 /* Override any gcc2 internal prototype to avoid an error.  */
4285 /* We use char because int might match the return type of a gcc2
4286     builtin and then its argument prototype would still apply.  */
4287 char SSLeay_add_ssl_algorithms();
4288
4289 int main() {
4290 SSLeay_add_ssl_algorithms()
4291 ; return 0; }
4292 EOF
4293 if { (eval echo configure:4294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4294   rm -rf conftest*
4295   eval "ac_cv_lib_$ac_lib_var=yes"
4296 else
4297   echo "configure: failed program was:" >&5
4298   cat conftest.$ac_ext >&5
4299   rm -rf conftest*
4300   eval "ac_cv_lib_$ac_lib_var=no"
4301 fi
4302 rm -f conftest*
4303 LIBS="$ac_save_LIBS"
4304
4305 fi
4306 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4307   echo "$ac_t""yes" 1>&6
4308   have_ssleay=yes
4309                         need_rsaref=no
4310 else
4311   echo "$ac_t""no" 1>&6
4312 have_ssleay=no
4313 fi
4314
4315                         
4316                 if test $have_ssleay = no ; then
4317                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
4318 echo "configure:4319: checking for ssl3_accept in -lssl" >&5
4319 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-%__p_%'`
4320 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4321   echo $ac_n "(cached) $ac_c" 1>&6
4322 else
4323   ac_save_LIBS="$LIBS"
4324 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
4325 cat > conftest.$ac_ext <<EOF
4326 #line 4327 "configure"
4327 #include "confdefs.h"
4328 /* Override any gcc2 internal prototype to avoid an error.  */
4329 /* We use char because int might match the return type of a gcc2
4330     builtin and then its argument prototype would still apply.  */
4331 char ssl3_accept();
4332
4333 int main() {
4334 ssl3_accept()
4335 ; return 0; }
4336 EOF
4337 if { (eval echo configure:4338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4338   rm -rf conftest*
4339   eval "ac_cv_lib_$ac_lib_var=yes"
4340 else
4341   echo "configure: failed program was:" >&5
4342   cat conftest.$ac_ext >&5
4343   rm -rf conftest*
4344   eval "ac_cv_lib_$ac_lib_var=no"
4345 fi
4346 rm -f conftest*
4347 LIBS="$ac_save_LIBS"
4348
4349 fi
4350 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4351   echo "$ac_t""yes" 1>&6
4352   have_ssleay=yes
4353                                 need_rsaref=yes
4354 else
4355   echo "$ac_t""no" 1>&6
4356 have_ssleay=no
4357 fi
4358
4359                 fi
4360
4361                 if test $have_ssleay = yes ; then
4362                         ol_with_tls=found
4363                         ol_link_tls=yes
4364
4365                         cat >> confdefs.h <<\EOF
4366 #define HAVE_SSLEAY 1
4367 EOF
4368
4369
4370                         if test $need_rsaref = yes; then
4371                                 cat >> confdefs.h <<\EOF
4372 #define HAVE_RSAREF 1
4373 EOF
4374
4375
4376                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
4377                         else
4378                                 TLS_LIBS="-lssl -lcrypto"
4379                         fi
4380                 fi
4381         fi
4382 fi
4383
4384 if test $ol_link_tls = yes ; then
4385         cat >> confdefs.h <<\EOF
4386 #define HAVE_TLS 1
4387 EOF
4388
4389 fi      
4390
4391 for ac_func in \
4392         ctime_r                 \
4393         gethostbyname_r gethostbyaddr_r \
4394
4395 do
4396 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4397 echo "configure:4398: checking for $ac_func" >&5
4398 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4399   echo $ac_n "(cached) $ac_c" 1>&6
4400 else
4401   cat > conftest.$ac_ext <<EOF
4402 #line 4403 "configure"
4403 #include "confdefs.h"
4404 /* System header to define __stub macros and hopefully few prototypes,
4405     which can conflict with char $ac_func(); below.  */
4406 #include <assert.h>
4407 /* Override any gcc2 internal prototype to avoid an error.  */
4408 /* We use char because int might match the return type of a gcc2
4409     builtin and then its argument prototype would still apply.  */
4410 char $ac_func();
4411
4412 int main() {
4413
4414 /* The GNU C library defines this for functions which it implements
4415     to always fail with ENOSYS.  Some functions are actually named
4416     something starting with __ and the normal name is an alias.  */
4417 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4418 choke me
4419 #else
4420 $ac_func();
4421 #endif
4422
4423 ; return 0; }
4424 EOF
4425 if { (eval echo configure:4426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4426   rm -rf conftest*
4427   eval "ac_cv_func_$ac_func=yes"
4428 else
4429   echo "configure: failed program was:" >&5
4430   cat conftest.$ac_ext >&5
4431   rm -rf conftest*
4432   eval "ac_cv_func_$ac_func=no"
4433 fi
4434 rm -f conftest*
4435 fi
4436
4437 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4438   echo "$ac_t""yes" 1>&6
4439     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4440   cat >> confdefs.h <<EOF
4441 #define $ac_tr_func 1
4442 EOF
4443  
4444 else
4445   echo "$ac_t""no" 1>&6
4446 fi
4447 done
4448
4449
4450 if test "$ac_cv_func_ctime_r" = no ; then
4451         ol_cv_func_ctime_r_nargs=0
4452 else
4453         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
4454 echo "configure:4455: checking number of arguments of ctime_r" >&5
4455 if eval "test \"`echo '$''{'ol_cv_func_ctime_r_nargs'+set}'`\" = set"; then
4456   echo $ac_n "(cached) $ac_c" 1>&6
4457 else
4458   cat > conftest.$ac_ext <<EOF
4459 #line 4460 "configure"
4460 #include "confdefs.h"
4461 #include <time.h>
4462 int main() {
4463 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
4464 ; return 0; }
4465 EOF
4466 if { (eval echo configure:4467: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4467   rm -rf conftest*
4468   ol_cv_func_ctime_r_nargs=3
4469 else
4470   echo "configure: failed program was:" >&5
4471   cat conftest.$ac_ext >&5
4472   rm -rf conftest*
4473   cat > conftest.$ac_ext <<EOF
4474 #line 4475 "configure"
4475 #include "confdefs.h"
4476 #include <time.h>
4477 int main() {
4478 time_t ti; char *buffer; ctime_r(&ti,buffer);
4479 ; return 0; }
4480 EOF
4481 if { (eval echo configure:4482: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4482   rm -rf conftest*
4483   ol_cv_func_ctime_r_nargs=2
4484 else
4485   echo "configure: failed program was:" >&5
4486   cat conftest.$ac_ext >&5
4487   rm -rf conftest*
4488   ol_cv_func_ctime_r_nargs=0
4489 fi
4490 rm -f conftest*
4491 fi
4492 rm -f conftest*
4493 fi
4494
4495 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
4496   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
4497     cat >> confdefs.h <<EOF
4498 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
4499 EOF
4500
4501   fi
4502
4503 fi
4504
4505 if test "$ac_cv_func_gethostbyname_r" = yes ; then
4506         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
4507 echo "configure:4508: checking number of arguments of gethostbyname_r" >&5
4508 if eval "test \"`echo '$''{'ol_cv_func_gethostbyname_r_nargs'+set}'`\" = set"; then
4509   echo $ac_n "(cached) $ac_c" 1>&6
4510 else
4511   cat > conftest.$ac_ext <<EOF
4512 #line 4513 "configure"
4513 #include "confdefs.h"
4514 #include <sys/types.h>
4515 #include <sys/socket.h>
4516 #include <netinet/in.h>
4517 #include <netdb.h>
4518 #define BUFSIZE (sizeof(struct hostent)+10)
4519 int main() {
4520 struct hostent hent; char buffer[BUFSIZE];
4521                 int bufsize=BUFSIZE;int h_errno;
4522                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
4523                         buffer, bufsize, &h_errno);
4524 ; return 0; }
4525 EOF
4526 if { (eval echo configure:4527: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4527   rm -rf conftest*
4528   ol_cv_func_gethostbyname_r_nargs=5
4529 else
4530   echo "configure: failed program was:" >&5
4531   cat conftest.$ac_ext >&5
4532   rm -rf conftest*
4533   cat > conftest.$ac_ext <<EOF
4534 #line 4535 "configure"
4535 #include "confdefs.h"
4536 #include <sys/types.h>
4537 #include <sys/socket.h>
4538 #include <netinet/in.h>
4539 #include <netdb.h>
4540 #define BUFSIZE (sizeof(struct hostent)+10)
4541 int main() {
4542 struct hostent hent;struct hostent *rhent;
4543                         char buffer[BUFSIZE];
4544                         int bufsize=BUFSIZE;int h_errno;
4545                         (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
4546                                 &rhent, &h_errno);
4547 ; return 0; }
4548 EOF
4549 if { (eval echo configure:4550: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4550   rm -rf conftest*
4551   ol_cv_func_gethostbyname_r_nargs=6
4552 else
4553   echo "configure: failed program was:" >&5
4554   cat conftest.$ac_ext >&5
4555   rm -rf conftest*
4556   ol_cv_func_gethostbyname_r_nargs=0
4557 fi
4558 rm -f conftest*
4559 fi
4560 rm -f conftest*
4561 fi
4562
4563 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
4564   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
4565         cat >> confdefs.h <<EOF
4566 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
4567 EOF
4568
4569   fi
4570
4571 else
4572         ol_cv_func_gethostbyname_r_nargs=0
4573 fi
4574  
4575 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
4576         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
4577 echo "configure:4578: checking number of arguments of gethostbyaddr_r" >&5
4578 if eval "test \"`echo '$''{'ol_cv_func_gethostbyaddr_r_nargs'+set}'`\" = set"; then
4579   echo $ac_n "(cached) $ac_c" 1>&6
4580 else
4581   cat > conftest.$ac_ext <<EOF
4582 #line 4583 "configure"
4583 #include "confdefs.h"
4584 #include <sys/types.h>
4585 #include <sys/socket.h>
4586 #include <netinet/in.h>
4587 #include <netdb.h>
4588 #define BUFSIZE (sizeof(struct hostent)+10)
4589 int main() {
4590 struct hostent hent; char buffer[BUFSIZE]; 
4591             struct in_addr add;
4592             size_t alen=sizeof(struct in_addr);
4593             int bufsize=BUFSIZE;int h_errno;
4594                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
4595                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
4596 ; return 0; }
4597 EOF
4598 if { (eval echo configure:4599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4599   rm -rf conftest*
4600   ol_cv_func_gethostbyaddr_r_nargs=7
4601 else
4602   echo "configure: failed program was:" >&5
4603   cat conftest.$ac_ext >&5
4604   rm -rf conftest*
4605   cat > conftest.$ac_ext <<EOF
4606 #line 4607 "configure"
4607 #include "confdefs.h"
4608 #include <sys/types.h>
4609 #include <sys/socket.h>
4610 #include <netinet/in.h>
4611 #include <netdb.h>
4612 #define BUFSIZE (sizeof(struct hostent)+10)
4613 int main() {
4614 struct hostent hent;
4615                         struct hostent *rhent; char buffer[BUFSIZE]; 
4616                         struct in_addr add;
4617                         size_t alen=sizeof(struct in_addr);
4618                         int bufsize=BUFSIZE;int h_errno;
4619                         (void)gethostbyaddr_r( (void *)&(add.s_addr),
4620                                 alen, AF_INET, &hent, buffer, bufsize, 
4621                                 &rhent, &h_errno);
4622 ; return 0; }
4623 EOF
4624 if { (eval echo configure:4625: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4625   rm -rf conftest*
4626   ol_cv_func_gethostbyaddr_r_nargs=8
4627 else
4628   echo "configure: failed program was:" >&5
4629   cat conftest.$ac_ext >&5
4630   rm -rf conftest*
4631   ol_cv_func_gethostbyaddr_r_nargs=0
4632 fi
4633 rm -f conftest*
4634 fi
4635 rm -f conftest*
4636 fi
4637
4638 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
4639   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
4640     cat >> confdefs.h <<EOF
4641 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
4642 EOF
4643
4644   fi
4645
4646 else
4647         ol_cv_func_gethostbyaddr_r_nargs=0
4648 fi
4649
4650 if test "$ac_cv_func_ctime_r" = yes \
4651         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
4652         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
4653         -a "$ac_cv_func_gethostbyname_r" = yes \
4654         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
4655         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
4656         -a "$ac_cv_func_gethostbyaddr_r" = yes \
4657         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
4658         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
4659         ; then
4660  
4661         cat >> confdefs.h <<\EOF
4662 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
4663 EOF
4664
4665 fi
4666
4667 ol_link_threads=no
4668 if test $ol_with_threads = auto -o $ol_with_threads = yes \
4669         -o $ol_with_threads = posix ; then
4670
4671         for ac_hdr in pthread.h sched.h
4672 do
4673 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4674 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4675 echo "configure:4676: checking for $ac_hdr" >&5
4676 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4677   echo $ac_n "(cached) $ac_c" 1>&6
4678 else
4679   cat > conftest.$ac_ext <<EOF
4680 #line 4681 "configure"
4681 #include "confdefs.h"
4682 #include <$ac_hdr>
4683 EOF
4684 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4685 { (eval echo configure:4686: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4686 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4687 if test -z "$ac_err"; then
4688   rm -rf conftest*
4689   eval "ac_cv_header_$ac_safe=yes"
4690 else
4691   echo "$ac_err" >&5
4692   echo "configure: failed program was:" >&5
4693   cat conftest.$ac_ext >&5
4694   rm -rf conftest*
4695   eval "ac_cv_header_$ac_safe=no"
4696 fi
4697 rm -f conftest*
4698 fi
4699 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4700   echo "$ac_t""yes" 1>&6
4701     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4702   cat >> confdefs.h <<EOF
4703 #define $ac_tr_hdr 1
4704 EOF
4705  
4706 else
4707   echo "$ac_t""no" 1>&6
4708 fi
4709 done
4710
4711
4712         if test $ac_cv_header_pthread_h = yes ; then
4713                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
4714 echo "configure:4715: checking POSIX thread version" >&5
4715 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
4716   echo $ac_n "(cached) $ac_c" 1>&6
4717 else
4718   
4719         cat > conftest.$ac_ext <<EOF
4720 #line 4721 "configure"
4721 #include "confdefs.h"
4722
4723 #               include <pthread.h>
4724                 /* this check could be improved */
4725 #               ifdef PTHREAD_ONCE_INIT
4726                         pthread_version_final
4727 #               endif
4728         
4729 EOF
4730 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4731   egrep "pthread_version_final" >/dev/null 2>&1; then
4732   rm -rf conftest*
4733   ol_pthread_final=yes
4734 else
4735   rm -rf conftest*
4736   ol_pthread_final=no
4737 fi
4738 rm -f conftest*
4739
4740
4741         cat > conftest.$ac_ext <<EOF
4742 #line 4743 "configure"
4743 #include "confdefs.h"
4744
4745 #               include <pthread.h>
4746                 /* this check could be improved */
4747 #               ifdef pthread_once_init
4748                         pthread_version_draft4
4749 #               endif
4750         
4751 EOF
4752 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4753   egrep "pthread_version_draft4" >/dev/null 2>&1; then
4754   rm -rf conftest*
4755   ol_pthread_draft4=yes
4756 else
4757   rm -rf conftest*
4758   ol_pthread_draft4=no
4759 fi
4760 rm -f conftest*
4761
4762
4763         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
4764                 ol_cv_pthread_version=final
4765         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
4766                 ol_cv_pthread_version=draft4
4767         else
4768                 ol_cv_pthread_version=unknown
4769         fi
4770
4771 fi
4772
4773 echo "$ac_t""$ol_cv_pthread_version" 1>&6
4774
4775
4776                 if test $ol_cv_pthread_version = final ; then
4777                         cat >> confdefs.h <<\EOF
4778 #define HAVE_PTHREADS_FINAL 1
4779 EOF
4780
4781                 elif test $ol_cv_pthread_version = draft4 ; then
4782                         cat >> confdefs.h <<\EOF
4783 #define HAVE_PTHREADS_D4 1
4784 EOF
4785
4786                 else
4787                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
4788                 fi
4789
4790                 # consider threads found
4791                 ol_with_threads=found
4792
4793                 
4794         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
4795 echo "configure:4796: checking for LinuxThreads pthread.h" >&5
4796 if eval "test \"`echo '$''{'ol_cv_header_linux_threads'+set}'`\" = set"; then
4797   echo $ac_n "(cached) $ac_c" 1>&6
4798 else
4799   cat > conftest.$ac_ext <<EOF
4800 #line 4801 "configure"
4801 #include "confdefs.h"
4802 #include <pthread.h>
4803 EOF
4804 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4805   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
4806   rm -rf conftest*
4807   ol_cv_header_linux_threads=yes
4808 else
4809   rm -rf conftest*
4810   ol_cv_header_linux_threads=no
4811 fi
4812 rm -f conftest*
4813
4814                 
4815 fi
4816
4817 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
4818         if test $ol_cv_header_linux_threads = yes; then
4819                 cat >> confdefs.h <<\EOF
4820 #define HAVE_LINUX_THREADS 1
4821 EOF
4822
4823         fi
4824
4825
4826                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
4827                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
4828 echo "configure:4829: checking for pthread_create in default libraries" >&5
4829                 if eval "test \"`echo '$''{'ol_cv_pthread_create'+set}'`\" = set"; then
4830   echo $ac_n "(cached) $ac_c" 1>&6
4831 else
4832   
4833                 if test "$cross_compiling" = yes; then
4834                         ol_cv_pthread_create=yes
4835 else
4836   cat > conftest.$ac_ext <<EOF
4837 #line 4838 "configure"
4838 #include "confdefs.h"
4839
4840 #include <pthread.h>
4841 #ifndef NULL
4842 #define NULL (void*)0
4843 #endif
4844
4845 static void *task(p)
4846         void *p;
4847 {
4848         return (void *) (p == NULL);
4849 }
4850
4851 int main(argc, argv)
4852         int argc;
4853         char **argv;
4854 {
4855         pthread_t t;
4856         int status;
4857
4858         /* make sure pthread_create() isn't just a stub */
4859 #if HAVE_PTHREADS_D4
4860         status = pthread_create(&t, pthread_attr_default, task, NULL);
4861 #else
4862         status = pthread_create(&t, NULL, task, NULL);
4863 #endif
4864
4865         if( status ) return status;
4866
4867         /* make sure pthread_detach() isn't just a stub */
4868 #if HAVE_PTHREADS_D4
4869         status = pthread_detach( &t );
4870 #else
4871         status = pthread_detach( t );
4872 #endif
4873
4874         if( status ) return status;
4875
4876         return status;
4877 }
4878
4879 EOF
4880 if { (eval echo configure:4881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4881 then
4882   ol_cv_pthread_create=yes
4883 else
4884   echo "configure: failed program was:" >&5
4885   cat conftest.$ac_ext >&5
4886   rm -fr conftest*
4887   ol_cv_pthread_create=no
4888 fi
4889 rm -fr conftest*
4890 fi
4891
4892 fi
4893
4894                 echo "$ac_t""$ol_cv_pthread_create" 1>&6
4895
4896                 if test $ol_cv_pthread_create != no ; then
4897                         ol_link_threads=posix
4898                         ol_link_pthreads=""
4899                 fi
4900                 
4901                 # Pthread try link: -mt (ol_cv_pthread_mt)
4902         if test "$ol_link_threads" = no ; then
4903                 # try -mt
4904                 echo $ac_n "checking for pthread link with -mt""... $ac_c" 1>&6
4905 echo "configure:4906: checking for pthread link with -mt" >&5
4906 if eval "test \"`echo '$''{'ol_cv_pthread_mt'+set}'`\" = set"; then
4907   echo $ac_n "(cached) $ac_c" 1>&6
4908 else
4909   
4910                         # save the flags
4911                         ol_LIBS="$LIBS"
4912                         LIBS="-mt $LIBS"
4913
4914                         cat > conftest.$ac_ext <<EOF
4915 #line 4916 "configure"
4916 #include "confdefs.h"
4917
4918 #include <pthread.h>
4919 #ifndef NULL
4920 #define NULL (void*)0
4921 #endif
4922
4923 int main() {
4924
4925         pthread_t t;
4926
4927 #if HAVE_PTHREADS_D4
4928         pthread_create(&t, pthread_attr_default, NULL, NULL);
4929         pthread_detach( &t );
4930 #else
4931         pthread_create(&t, NULL, NULL, NULL);
4932         pthread_detach( t );
4933 #endif
4934 #ifdef HAVE_LINUX_THREADS
4935         pthread_kill_other_threads_np();
4936 #endif
4937
4938 ; return 0; }
4939 EOF
4940 if { (eval echo configure:4941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4941   rm -rf conftest*
4942   ol_cv_pthread_mt=yes
4943 else
4944   echo "configure: failed program was:" >&5
4945   cat conftest.$ac_ext >&5
4946   rm -rf conftest*
4947   ol_cv_pthread_mt=no
4948 fi
4949 rm -f conftest*
4950
4951                 # restore the LIBS
4952                 LIBS="$ol_LIBS"
4953                 
4954 fi
4955
4956 echo "$ac_t""$ol_cv_pthread_mt" 1>&6
4957
4958                 if test $ol_cv_pthread_mt = yes ; then
4959                         ol_link_pthreads="-mt"
4960                         ol_link_threads=posix
4961                 fi
4962         fi
4963
4964                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
4965         if test "$ol_link_threads" = no ; then
4966                 # try -kthread
4967                 echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
4968 echo "configure:4969: checking for pthread link with -kthread" >&5
4969 if eval "test \"`echo '$''{'ol_cv_pthread_kthread'+set}'`\" = set"; then
4970   echo $ac_n "(cached) $ac_c" 1>&6
4971 else
4972   
4973                         # save the flags
4974                         ol_LIBS="$LIBS"
4975                         LIBS="-kthread $LIBS"
4976
4977                         cat > conftest.$ac_ext <<EOF
4978 #line 4979 "configure"
4979 #include "confdefs.h"
4980
4981 #include <pthread.h>
4982 #ifndef NULL
4983 #define NULL (void*)0
4984 #endif
4985
4986 int main() {
4987
4988         pthread_t t;
4989
4990 #if HAVE_PTHREADS_D4
4991         pthread_create(&t, pthread_attr_default, NULL, NULL);
4992         pthread_detach( &t );
4993 #else
4994         pthread_create(&t, NULL, NULL, NULL);
4995         pthread_detach( t );
4996 #endif
4997 #ifdef HAVE_LINUX_THREADS
4998         pthread_kill_other_threads_np();
4999 #endif
5000
5001 ; return 0; }
5002 EOF
5003 if { (eval echo configure:5004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5004   rm -rf conftest*
5005   ol_cv_pthread_kthread=yes
5006 else
5007   echo "configure: failed program was:" >&5
5008   cat conftest.$ac_ext >&5
5009   rm -rf conftest*
5010   ol_cv_pthread_kthread=no
5011 fi
5012 rm -f conftest*
5013
5014                 # restore the LIBS
5015                 LIBS="$ol_LIBS"
5016                 
5017 fi
5018
5019 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
5020
5021                 if test $ol_cv_pthread_kthread = yes ; then
5022                         ol_link_pthreads="-kthread"
5023                         ol_link_threads=posix
5024                 fi
5025         fi
5026
5027                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
5028         if test "$ol_link_threads" = no ; then
5029                 # try -pthread
5030                 echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
5031 echo "configure:5032: checking for pthread link with -pthread" >&5
5032 if eval "test \"`echo '$''{'ol_cv_pthread_pthread'+set}'`\" = set"; then
5033   echo $ac_n "(cached) $ac_c" 1>&6
5034 else
5035   
5036                         # save the flags
5037                         ol_LIBS="$LIBS"
5038                         LIBS="-pthread $LIBS"
5039
5040                         cat > conftest.$ac_ext <<EOF
5041 #line 5042 "configure"
5042 #include "confdefs.h"
5043
5044 #include <pthread.h>
5045 #ifndef NULL
5046 #define NULL (void*)0
5047 #endif
5048
5049 int main() {
5050
5051         pthread_t t;
5052
5053 #if HAVE_PTHREADS_D4
5054         pthread_create(&t, pthread_attr_default, NULL, NULL);
5055         pthread_detach( &t );
5056 #else
5057         pthread_create(&t, NULL, NULL, NULL);
5058         pthread_detach( t );
5059 #endif
5060 #ifdef HAVE_LINUX_THREADS
5061         pthread_kill_other_threads_np();
5062 #endif
5063
5064 ; return 0; }
5065 EOF
5066 if { (eval echo configure:5067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5067   rm -rf conftest*
5068   ol_cv_pthread_pthread=yes
5069 else
5070   echo "configure: failed program was:" >&5
5071   cat conftest.$ac_ext >&5
5072   rm -rf conftest*
5073   ol_cv_pthread_pthread=no
5074 fi
5075 rm -f conftest*
5076
5077                 # restore the LIBS
5078                 LIBS="$ol_LIBS"
5079                 
5080 fi
5081
5082 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
5083
5084                 if test $ol_cv_pthread_pthread = yes ; then
5085                         ol_link_pthreads="-pthread"
5086                         ol_link_threads=posix
5087                 fi
5088         fi
5089
5090                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
5091         if test "$ol_link_threads" = no ; then
5092                 # try -pthreads
5093                 echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
5094 echo "configure:5095: checking for pthread link with -pthreads" >&5
5095 if eval "test \"`echo '$''{'ol_cv_pthread_pthreads'+set}'`\" = set"; then
5096   echo $ac_n "(cached) $ac_c" 1>&6
5097 else
5098   
5099                         # save the flags
5100                         ol_LIBS="$LIBS"
5101                         LIBS="-pthreads $LIBS"
5102
5103                         cat > conftest.$ac_ext <<EOF
5104 #line 5105 "configure"
5105 #include "confdefs.h"
5106
5107 #include <pthread.h>
5108 #ifndef NULL
5109 #define NULL (void*)0
5110 #endif
5111
5112 int main() {
5113
5114         pthread_t t;
5115
5116 #if HAVE_PTHREADS_D4
5117         pthread_create(&t, pthread_attr_default, NULL, NULL);
5118         pthread_detach( &t );
5119 #else
5120         pthread_create(&t, NULL, NULL, NULL);
5121         pthread_detach( t );
5122 #endif
5123 #ifdef HAVE_LINUX_THREADS
5124         pthread_kill_other_threads_np();
5125 #endif
5126
5127 ; return 0; }
5128 EOF
5129 if { (eval echo configure:5130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5130   rm -rf conftest*
5131   ol_cv_pthread_pthreads=yes
5132 else
5133   echo "configure: failed program was:" >&5
5134   cat conftest.$ac_ext >&5
5135   rm -rf conftest*
5136   ol_cv_pthread_pthreads=no
5137 fi
5138 rm -f conftest*
5139
5140                 # restore the LIBS
5141                 LIBS="$ol_LIBS"
5142                 
5143 fi
5144
5145 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
5146
5147                 if test $ol_cv_pthread_pthreads = yes ; then
5148                         ol_link_pthreads="-pthreads"
5149                         ol_link_threads=posix
5150                 fi
5151         fi
5152
5153                 # Pthread try link: -thread (ol_cv_pthread_thread)
5154         if test "$ol_link_threads" = no ; then
5155                 # try -thread
5156                 echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
5157 echo "configure:5158: checking for pthread link with -thread" >&5
5158 if eval "test \"`echo '$''{'ol_cv_pthread_thread'+set}'`\" = set"; then
5159   echo $ac_n "(cached) $ac_c" 1>&6
5160 else
5161   
5162                         # save the flags
5163                         ol_LIBS="$LIBS"
5164                         LIBS="-thread $LIBS"
5165
5166                         cat > conftest.$ac_ext <<EOF
5167 #line 5168 "configure"
5168 #include "confdefs.h"
5169
5170 #include <pthread.h>
5171 #ifndef NULL
5172 #define NULL (void*)0
5173 #endif
5174
5175 int main() {
5176
5177         pthread_t t;
5178
5179 #if HAVE_PTHREADS_D4
5180         pthread_create(&t, pthread_attr_default, NULL, NULL);
5181         pthread_detach( &t );
5182 #else
5183         pthread_create(&t, NULL, NULL, NULL);
5184         pthread_detach( t );
5185 #endif
5186 #ifdef HAVE_LINUX_THREADS
5187         pthread_kill_other_threads_np();
5188 #endif
5189
5190 ; return 0; }
5191 EOF
5192 if { (eval echo configure:5193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5193   rm -rf conftest*
5194   ol_cv_pthread_thread=yes
5195 else
5196   echo "configure: failed program was:" >&5
5197   cat conftest.$ac_ext >&5
5198   rm -rf conftest*
5199   ol_cv_pthread_thread=no
5200 fi
5201 rm -f conftest*
5202
5203                 # restore the LIBS
5204                 LIBS="$ol_LIBS"
5205                 
5206 fi
5207
5208 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
5209
5210                 if test $ol_cv_pthread_thread = yes ; then
5211                         ol_link_pthreads="-thread"
5212                         ol_link_threads=posix
5213                 fi
5214         fi
5215
5216
5217                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
5218         if test "$ol_link_threads" = no ; then
5219                 # try -lpthread -lmach -lexc -lc_r
5220                 echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
5221 echo "configure:5222: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
5222 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread_lmach_lexc_lc_r'+set}'`\" = set"; then
5223   echo $ac_n "(cached) $ac_c" 1>&6
5224 else
5225   
5226                         # save the flags
5227                         ol_LIBS="$LIBS"
5228                         LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
5229
5230                         cat > conftest.$ac_ext <<EOF
5231 #line 5232 "configure"
5232 #include "confdefs.h"
5233
5234 #include <pthread.h>
5235 #ifndef NULL
5236 #define NULL (void*)0
5237 #endif
5238
5239 int main() {
5240
5241         pthread_t t;
5242
5243 #if HAVE_PTHREADS_D4
5244         pthread_create(&t, pthread_attr_default, NULL, NULL);
5245         pthread_detach( &t );
5246 #else
5247         pthread_create(&t, NULL, NULL, NULL);
5248         pthread_detach( t );
5249 #endif
5250 #ifdef HAVE_LINUX_THREADS
5251         pthread_kill_other_threads_np();
5252 #endif
5253
5254 ; return 0; }
5255 EOF
5256 if { (eval echo configure:5257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5257   rm -rf conftest*
5258   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
5259 else
5260   echo "configure: failed program was:" >&5
5261   cat conftest.$ac_ext >&5
5262   rm -rf conftest*
5263   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
5264 fi
5265 rm -f conftest*
5266
5267                 # restore the LIBS
5268                 LIBS="$ol_LIBS"
5269                 
5270 fi
5271
5272 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
5273
5274                 if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
5275                         ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
5276                         ol_link_threads=posix
5277                 fi
5278         fi
5279
5280                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
5281         if test "$ol_link_threads" = no ; then
5282                 # try -lpthread -lmach -lexc
5283                 echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
5284 echo "configure:5285: checking for pthread link with -lpthread -lmach -lexc" >&5
5285 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread_lmach_lexc'+set}'`\" = set"; then
5286   echo $ac_n "(cached) $ac_c" 1>&6
5287 else
5288   
5289                         # save the flags
5290                         ol_LIBS="$LIBS"
5291                         LIBS="-lpthread -lmach -lexc $LIBS"
5292
5293                         cat > conftest.$ac_ext <<EOF
5294 #line 5295 "configure"
5295 #include "confdefs.h"
5296
5297 #include <pthread.h>
5298 #ifndef NULL
5299 #define NULL (void*)0
5300 #endif
5301
5302 int main() {
5303
5304         pthread_t t;
5305
5306 #if HAVE_PTHREADS_D4
5307         pthread_create(&t, pthread_attr_default, NULL, NULL);
5308         pthread_detach( &t );
5309 #else
5310         pthread_create(&t, NULL, NULL, NULL);
5311         pthread_detach( t );
5312 #endif
5313 #ifdef HAVE_LINUX_THREADS
5314         pthread_kill_other_threads_np();
5315 #endif
5316
5317 ; return 0; }
5318 EOF
5319 if { (eval echo configure:5320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5320   rm -rf conftest*
5321   ol_cv_pthread_lpthread_lmach_lexc=yes
5322 else
5323   echo "configure: failed program was:" >&5
5324   cat conftest.$ac_ext >&5
5325   rm -rf conftest*
5326   ol_cv_pthread_lpthread_lmach_lexc=no
5327 fi
5328 rm -f conftest*
5329
5330                 # restore the LIBS
5331                 LIBS="$ol_LIBS"
5332                 
5333 fi
5334
5335 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
5336
5337                 if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
5338                         ol_link_pthreads="-lpthread -lmach -lexc"
5339                         ol_link_threads=posix
5340                 fi
5341         fi
5342
5343
5344                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
5345         if test "$ol_link_threads" = no ; then
5346                 # try -lpthread -Wl,-woff,85
5347                 echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
5348 echo "configure:5349: checking for pthread link with -lpthread -Wl,-woff,85" >&5
5349 if eval "test \"`echo '$''{'ol_cv_pthread_lib_lpthread_woff'+set}'`\" = set"; then
5350   echo $ac_n "(cached) $ac_c" 1>&6
5351 else
5352   
5353                         # save the flags
5354                         ol_LIBS="$LIBS"
5355                         LIBS="-lpthread -Wl,-woff,85 $LIBS"
5356
5357                         cat > conftest.$ac_ext <<EOF
5358 #line 5359 "configure"
5359 #include "confdefs.h"
5360
5361 #include <pthread.h>
5362 #ifndef NULL
5363 #define NULL (void*)0
5364 #endif
5365
5366 int main() {
5367
5368         pthread_t t;
5369
5370 #if HAVE_PTHREADS_D4
5371         pthread_create(&t, pthread_attr_default, NULL, NULL);
5372         pthread_detach( &t );
5373 #else
5374         pthread_create(&t, NULL, NULL, NULL);
5375         pthread_detach( t );
5376 #endif
5377 #ifdef HAVE_LINUX_THREADS
5378         pthread_kill_other_threads_np();
5379 #endif
5380
5381 ; return 0; }
5382 EOF
5383 if { (eval echo configure:5384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5384   rm -rf conftest*
5385   ol_cv_pthread_lib_lpthread_woff=yes
5386 else
5387   echo "configure: failed program was:" >&5
5388   cat conftest.$ac_ext >&5
5389   rm -rf conftest*
5390   ol_cv_pthread_lib_lpthread_woff=no
5391 fi
5392 rm -f conftest*
5393
5394                 # restore the LIBS
5395                 LIBS="$ol_LIBS"
5396                 
5397 fi
5398
5399 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
5400
5401                 if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
5402                         ol_link_pthreads="-lpthread -Wl,-woff,85"
5403                         ol_link_threads=posix
5404                 fi
5405         fi
5406
5407
5408                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
5409         if test "$ol_link_threads" = no ; then
5410                 # try -lpthread
5411                 echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
5412 echo "configure:5413: checking for pthread link with -lpthread" >&5
5413 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread'+set}'`\" = set"; then
5414   echo $ac_n "(cached) $ac_c" 1>&6
5415 else
5416   
5417                         # save the flags
5418                         ol_LIBS="$LIBS"
5419                         LIBS="-lpthread $LIBS"
5420
5421                         cat > conftest.$ac_ext <<EOF
5422 #line 5423 "configure"
5423 #include "confdefs.h"
5424
5425 #include <pthread.h>
5426 #ifndef NULL
5427 #define NULL (void*)0
5428 #endif
5429
5430 int main() {
5431
5432         pthread_t t;
5433
5434 #if HAVE_PTHREADS_D4
5435         pthread_create(&t, pthread_attr_default, NULL, NULL);
5436         pthread_detach( &t );
5437 #else
5438         pthread_create(&t, NULL, NULL, NULL);
5439         pthread_detach( t );
5440 #endif
5441 #ifdef HAVE_LINUX_THREADS
5442         pthread_kill_other_threads_np();
5443 #endif
5444
5445 ; return 0; }
5446 EOF
5447 if { (eval echo configure:5448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5448   rm -rf conftest*
5449   ol_cv_pthread_lpthread=yes
5450 else
5451   echo "configure: failed program was:" >&5
5452   cat conftest.$ac_ext >&5
5453   rm -rf conftest*
5454   ol_cv_pthread_lpthread=no
5455 fi
5456 rm -f conftest*
5457
5458                 # restore the LIBS
5459                 LIBS="$ol_LIBS"
5460                 
5461 fi
5462
5463 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
5464
5465                 if test $ol_cv_pthread_lpthread = yes ; then
5466                         ol_link_pthreads="-lpthread"
5467                         ol_link_threads=posix
5468                 fi
5469         fi
5470
5471                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
5472         if test "$ol_link_threads" = no ; then
5473                 # try -lc_r
5474                 echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
5475 echo "configure:5476: checking for pthread link with -lc_r" >&5
5476 if eval "test \"`echo '$''{'ol_cv_pthread_lc_r'+set}'`\" = set"; then
5477   echo $ac_n "(cached) $ac_c" 1>&6
5478 else
5479   
5480                         # save the flags
5481                         ol_LIBS="$LIBS"
5482                         LIBS="-lc_r $LIBS"
5483
5484                         cat > conftest.$ac_ext <<EOF
5485 #line 5486 "configure"
5486 #include "confdefs.h"
5487
5488 #include <pthread.h>
5489 #ifndef NULL
5490 #define NULL (void*)0
5491 #endif
5492
5493 int main() {
5494
5495         pthread_t t;
5496
5497 #if HAVE_PTHREADS_D4
5498         pthread_create(&t, pthread_attr_default, NULL, NULL);
5499         pthread_detach( &t );
5500 #else
5501         pthread_create(&t, NULL, NULL, NULL);
5502         pthread_detach( t );
5503 #endif
5504 #ifdef HAVE_LINUX_THREADS
5505         pthread_kill_other_threads_np();
5506 #endif
5507
5508 ; return 0; }
5509 EOF
5510 if { (eval echo configure:5511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5511   rm -rf conftest*
5512   ol_cv_pthread_lc_r=yes
5513 else
5514   echo "configure: failed program was:" >&5
5515   cat conftest.$ac_ext >&5
5516   rm -rf conftest*
5517   ol_cv_pthread_lc_r=no
5518 fi
5519 rm -f conftest*
5520
5521                 # restore the LIBS
5522                 LIBS="$ol_LIBS"
5523                 
5524 fi
5525
5526 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
5527
5528                 if test $ol_cv_pthread_lc_r = yes ; then
5529                         ol_link_pthreads="-lc_r"
5530                         ol_link_threads=posix
5531                 fi
5532         fi
5533
5534
5535                 # Pthread try link: -threads (ol_cv_pthread_threads)
5536         if test "$ol_link_threads" = no ; then
5537                 # try -threads
5538                 echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
5539 echo "configure:5540: checking for pthread link with -threads" >&5
5540 if eval "test \"`echo '$''{'ol_cv_pthread_threads'+set}'`\" = set"; then
5541   echo $ac_n "(cached) $ac_c" 1>&6
5542 else
5543   
5544                         # save the flags
5545                         ol_LIBS="$LIBS"
5546                         LIBS="-threads $LIBS"
5547
5548                         cat > conftest.$ac_ext <<EOF
5549 #line 5550 "configure"
5550 #include "confdefs.h"
5551
5552 #include <pthread.h>
5553 #ifndef NULL
5554 #define NULL (void*)0
5555 #endif
5556
5557 int main() {
5558
5559         pthread_t t;
5560
5561 #if HAVE_PTHREADS_D4
5562         pthread_create(&t, pthread_attr_default, NULL, NULL);
5563         pthread_detach( &t );
5564 #else
5565         pthread_create(&t, NULL, NULL, NULL);
5566         pthread_detach( t );
5567 #endif
5568 #ifdef HAVE_LINUX_THREADS
5569         pthread_kill_other_threads_np();
5570 #endif
5571
5572 ; return 0; }
5573 EOF
5574 if { (eval echo configure:5575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5575   rm -rf conftest*
5576   ol_cv_pthread_threads=yes
5577 else
5578   echo "configure: failed program was:" >&5
5579   cat conftest.$ac_ext >&5
5580   rm -rf conftest*
5581   ol_cv_pthread_threads=no
5582 fi
5583 rm -f conftest*
5584
5585                 # restore the LIBS
5586                 LIBS="$ol_LIBS"
5587                 
5588 fi
5589
5590 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
5591
5592                 if test $ol_cv_pthread_threads = yes ; then
5593                         ol_link_pthreads="-threads"
5594                         ol_link_threads=posix
5595                 fi
5596         fi
5597
5598
5599                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
5600         if test "$ol_link_threads" = no ; then
5601                 # try -lpthreads -lmach -lexc -lc_r
5602                 echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
5603 echo "configure:5604: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
5604 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lmach_lexc_lc_r'+set}'`\" = set"; then
5605   echo $ac_n "(cached) $ac_c" 1>&6
5606 else
5607   
5608                         # save the flags
5609                         ol_LIBS="$LIBS"
5610                         LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
5611
5612                         cat > conftest.$ac_ext <<EOF
5613 #line 5614 "configure"
5614 #include "confdefs.h"
5615
5616 #include <pthread.h>
5617 #ifndef NULL
5618 #define NULL (void*)0
5619 #endif
5620
5621 int main() {
5622
5623         pthread_t t;
5624
5625 #if HAVE_PTHREADS_D4
5626         pthread_create(&t, pthread_attr_default, NULL, NULL);
5627         pthread_detach( &t );
5628 #else
5629         pthread_create(&t, NULL, NULL, NULL);
5630         pthread_detach( t );
5631 #endif
5632 #ifdef HAVE_LINUX_THREADS
5633         pthread_kill_other_threads_np();
5634 #endif
5635
5636 ; return 0; }
5637 EOF
5638 if { (eval echo configure:5639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5639   rm -rf conftest*
5640   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
5641 else
5642   echo "configure: failed program was:" >&5
5643   cat conftest.$ac_ext >&5
5644   rm -rf conftest*
5645   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
5646 fi
5647 rm -f conftest*
5648
5649                 # restore the LIBS
5650                 LIBS="$ol_LIBS"
5651                 
5652 fi
5653
5654 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
5655
5656                 if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
5657                         ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
5658                         ol_link_threads=posix
5659                 fi
5660         fi
5661
5662                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
5663         if test "$ol_link_threads" = no ; then
5664                 # try -lpthreads -lmach -lexc
5665                 echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
5666 echo "configure:5667: checking for pthread link with -lpthreads -lmach -lexc" >&5
5667 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lmach_lexc'+set}'`\" = set"; then
5668   echo $ac_n "(cached) $ac_c" 1>&6
5669 else
5670   
5671                         # save the flags
5672                         ol_LIBS="$LIBS"
5673                         LIBS="-lpthreads -lmach -lexc $LIBS"
5674
5675                         cat > conftest.$ac_ext <<EOF
5676 #line 5677 "configure"
5677 #include "confdefs.h"
5678
5679 #include <pthread.h>
5680 #ifndef NULL
5681 #define NULL (void*)0
5682 #endif
5683
5684 int main() {
5685
5686         pthread_t t;
5687
5688 #if HAVE_PTHREADS_D4
5689         pthread_create(&t, pthread_attr_default, NULL, NULL);
5690         pthread_detach( &t );
5691 #else
5692         pthread_create(&t, NULL, NULL, NULL);
5693         pthread_detach( t );
5694 #endif
5695 #ifdef HAVE_LINUX_THREADS
5696         pthread_kill_other_threads_np();
5697 #endif
5698
5699 ; return 0; }
5700 EOF
5701 if { (eval echo configure:5702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5702   rm -rf conftest*
5703   ol_cv_pthread_lpthreads_lmach_lexc=yes
5704 else
5705   echo "configure: failed program was:" >&5
5706   cat conftest.$ac_ext >&5
5707   rm -rf conftest*
5708   ol_cv_pthread_lpthreads_lmach_lexc=no
5709 fi
5710 rm -f conftest*
5711
5712                 # restore the LIBS
5713                 LIBS="$ol_LIBS"
5714                 
5715 fi
5716
5717 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
5718
5719                 if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
5720                         ol_link_pthreads="-lpthreads -lmach -lexc"
5721                         ol_link_threads=posix
5722                 fi
5723         fi
5724
5725                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
5726         if test "$ol_link_threads" = no ; then
5727                 # try -lpthreads -lexc
5728                 echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
5729 echo "configure:5730: checking for pthread link with -lpthreads -lexc" >&5
5730 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lexc'+set}'`\" = set"; then
5731   echo $ac_n "(cached) $ac_c" 1>&6
5732 else
5733   
5734                         # save the flags
5735                         ol_LIBS="$LIBS"
5736                         LIBS="-lpthreads -lexc $LIBS"
5737
5738                         cat > conftest.$ac_ext <<EOF
5739 #line 5740 "configure"
5740 #include "confdefs.h"
5741
5742 #include <pthread.h>
5743 #ifndef NULL
5744 #define NULL (void*)0
5745 #endif
5746
5747 int main() {
5748
5749         pthread_t t;
5750
5751 #if HAVE_PTHREADS_D4
5752         pthread_create(&t, pthread_attr_default, NULL, NULL);
5753         pthread_detach( &t );
5754 #else
5755         pthread_create(&t, NULL, NULL, NULL);
5756         pthread_detach( t );
5757 #endif
5758 #ifdef HAVE_LINUX_THREADS
5759         pthread_kill_other_threads_np();
5760 #endif
5761
5762 ; return 0; }
5763 EOF
5764 if { (eval echo configure:5765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5765   rm -rf conftest*
5766   ol_cv_pthread_lpthreads_lexc=yes
5767 else
5768   echo "configure: failed program was:" >&5
5769   cat conftest.$ac_ext >&5
5770   rm -rf conftest*
5771   ol_cv_pthread_lpthreads_lexc=no
5772 fi
5773 rm -f conftest*
5774
5775                 # restore the LIBS
5776                 LIBS="$ol_LIBS"
5777                 
5778 fi
5779
5780 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
5781
5782                 if test $ol_cv_pthread_lpthreads_lexc = yes ; then
5783                         ol_link_pthreads="-lpthreads -lexc"
5784                         ol_link_threads=posix
5785                 fi
5786         fi
5787
5788
5789                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
5790         if test "$ol_link_threads" = no ; then
5791                 # try -lpthreads
5792                 echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
5793 echo "configure:5794: checking for pthread link with -lpthreads" >&5
5794 if eval "test \"`echo '$''{'ol_cv_pthread_lib_lpthreads'+set}'`\" = set"; then
5795   echo $ac_n "(cached) $ac_c" 1>&6
5796 else
5797   
5798                         # save the flags
5799                         ol_LIBS="$LIBS"
5800                         LIBS="-lpthreads $LIBS"
5801
5802                         cat > conftest.$ac_ext <<EOF
5803 #line 5804 "configure"
5804 #include "confdefs.h"
5805
5806 #include <pthread.h>
5807 #ifndef NULL
5808 #define NULL (void*)0
5809 #endif
5810
5811 int main() {
5812
5813         pthread_t t;
5814
5815 #if HAVE_PTHREADS_D4
5816         pthread_create(&t, pthread_attr_default, NULL, NULL);
5817         pthread_detach( &t );
5818 #else
5819         pthread_create(&t, NULL, NULL, NULL);
5820         pthread_detach( t );
5821 #endif
5822 #ifdef HAVE_LINUX_THREADS
5823         pthread_kill_other_threads_np();
5824 #endif
5825
5826 ; return 0; }
5827 EOF
5828 if { (eval echo configure:5829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5829   rm -rf conftest*
5830   ol_cv_pthread_lib_lpthreads=yes
5831 else
5832   echo "configure: failed program was:" >&5
5833   cat conftest.$ac_ext >&5
5834   rm -rf conftest*
5835   ol_cv_pthread_lib_lpthreads=no
5836 fi
5837 rm -f conftest*
5838
5839                 # restore the LIBS
5840                 LIBS="$ol_LIBS"
5841                 
5842 fi
5843
5844 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
5845
5846                 if test $ol_cv_pthread_lib_lpthreads = yes ; then
5847                         ol_link_pthreads="-lpthreads"
5848                         ol_link_threads=posix
5849                 fi
5850         fi
5851
5852
5853                 if test $ol_link_threads != no ; then
5854                         cat >> confdefs.h <<\EOF
5855 #define HAVE_PTHREADS 1
5856 EOF
5857
5858
5859                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
5860
5861                                                 save_CPPFLAGS="$CPPFLAGS"
5862                         save_LIBS="$LIBS"
5863                         LIBS="$LTHREAD_LIBS $LIBS"
5864
5865                                                                                                 for ac_func in sched_yield pthread_yield
5866 do
5867 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5868 echo "configure:5869: checking for $ac_func" >&5
5869 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5870   echo $ac_n "(cached) $ac_c" 1>&6
5871 else
5872   cat > conftest.$ac_ext <<EOF
5873 #line 5874 "configure"
5874 #include "confdefs.h"
5875 /* System header to define __stub macros and hopefully few prototypes,
5876     which can conflict with char $ac_func(); below.  */
5877 #include <assert.h>
5878 /* Override any gcc2 internal prototype to avoid an error.  */
5879 /* We use char because int might match the return type of a gcc2
5880     builtin and then its argument prototype would still apply.  */
5881 char $ac_func();
5882
5883 int main() {
5884
5885 /* The GNU C library defines this for functions which it implements
5886     to always fail with ENOSYS.  Some functions are actually named
5887     something starting with __ and the normal name is an alias.  */
5888 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5889 choke me
5890 #else
5891 $ac_func();
5892 #endif
5893
5894 ; return 0; }
5895 EOF
5896 if { (eval echo configure:5897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5897   rm -rf conftest*
5898   eval "ac_cv_func_$ac_func=yes"
5899 else
5900   echo "configure: failed program was:" >&5
5901   cat conftest.$ac_ext >&5
5902   rm -rf conftest*
5903   eval "ac_cv_func_$ac_func=no"
5904 fi
5905 rm -f conftest*
5906 fi
5907
5908 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5909   echo "$ac_t""yes" 1>&6
5910     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5911   cat >> confdefs.h <<EOF
5912 #define $ac_tr_func 1
5913 EOF
5914  
5915 else
5916   echo "$ac_t""no" 1>&6
5917 fi
5918 done
5919
5920
5921                         if test $ac_cv_func_sched_yield = no -a \
5922                                 $ac_cv_func_pthread_yield = no ; then
5923                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
5924 echo "configure:5925: checking for sched_yield in -lrt" >&5
5925 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
5926 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5927   echo $ac_n "(cached) $ac_c" 1>&6
5928 else
5929   ac_save_LIBS="$LIBS"
5930 LIBS="-lrt  $LIBS"
5931 cat > conftest.$ac_ext <<EOF
5932 #line 5933 "configure"
5933 #include "confdefs.h"
5934 /* Override any gcc2 internal prototype to avoid an error.  */
5935 /* We use char because int might match the return type of a gcc2
5936     builtin and then its argument prototype would still apply.  */
5937 char sched_yield();
5938
5939 int main() {
5940 sched_yield()
5941 ; return 0; }
5942 EOF
5943 if { (eval echo configure:5944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5944   rm -rf conftest*
5945   eval "ac_cv_lib_$ac_lib_var=yes"
5946 else
5947   echo "configure: failed program was:" >&5
5948   cat conftest.$ac_ext >&5
5949   rm -rf conftest*
5950   eval "ac_cv_lib_$ac_lib_var=no"
5951 fi
5952 rm -f conftest*
5953 LIBS="$ac_save_LIBS"
5954
5955 fi
5956 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5957   echo "$ac_t""yes" 1>&6
5958   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
5959                                         cat >> confdefs.h <<\EOF
5960 #define HAVE_SCHED_YIELD 1
5961 EOF
5962
5963                                         ac_cv_func_sched_yield=yes
5964 else
5965   echo "$ac_t""no" 1>&6
5966 ac_cv_func_sched_yield=no
5967 fi
5968
5969                         fi
5970                         if test $ac_cv_func_sched_yield = no -a \
5971                                 $ac_cv_func_pthread_yield = no ; then
5972                                                                                                 for ac_func in thr_yield
5973 do
5974 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5975 echo "configure:5976: checking for $ac_func" >&5
5976 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5977   echo $ac_n "(cached) $ac_c" 1>&6
5978 else
5979   cat > conftest.$ac_ext <<EOF
5980 #line 5981 "configure"
5981 #include "confdefs.h"
5982 /* System header to define __stub macros and hopefully few prototypes,
5983     which can conflict with char $ac_func(); below.  */
5984 #include <assert.h>
5985 /* Override any gcc2 internal prototype to avoid an error.  */
5986 /* We use char because int might match the return type of a gcc2
5987     builtin and then its argument prototype would still apply.  */
5988 char $ac_func();
5989
5990 int main() {
5991
5992 /* The GNU C library defines this for functions which it implements
5993     to always fail with ENOSYS.  Some functions are actually named
5994     something starting with __ and the normal name is an alias.  */
5995 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5996 choke me
5997 #else
5998 $ac_func();
5999 #endif
6000
6001 ; return 0; }
6002 EOF
6003 if { (eval echo configure:6004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6004   rm -rf conftest*
6005   eval "ac_cv_func_$ac_func=yes"
6006 else
6007   echo "configure: failed program was:" >&5
6008   cat conftest.$ac_ext >&5
6009   rm -rf conftest*
6010   eval "ac_cv_func_$ac_func=no"
6011 fi
6012 rm -f conftest*
6013 fi
6014
6015 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6016   echo "$ac_t""yes" 1>&6
6017     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6018   cat >> confdefs.h <<EOF
6019 #define $ac_tr_func 1
6020 EOF
6021  
6022 else
6023   echo "$ac_t""no" 1>&6
6024 fi
6025 done
6026
6027                         fi
6028                         if test $ac_cv_func_sched_yield = no -a \
6029                                 $ac_cv_func_pthread_yield = no -a \
6030                                 "$ac_cv_func_thr_yield" = no ; then
6031                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
6032                         fi
6033
6034                                                 for ac_func in pthread_kill
6035 do
6036 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6037 echo "configure:6038: checking for $ac_func" >&5
6038 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6039   echo $ac_n "(cached) $ac_c" 1>&6
6040 else
6041   cat > conftest.$ac_ext <<EOF
6042 #line 6043 "configure"
6043 #include "confdefs.h"
6044 /* System header to define __stub macros and hopefully few prototypes,
6045     which can conflict with char $ac_func(); below.  */
6046 #include <assert.h>
6047 /* Override any gcc2 internal prototype to avoid an error.  */
6048 /* We use char because int might match the return type of a gcc2
6049     builtin and then its argument prototype would still apply.  */
6050 char $ac_func();
6051
6052 int main() {
6053
6054 /* The GNU C library defines this for functions which it implements
6055     to always fail with ENOSYS.  Some functions are actually named
6056     something starting with __ and the normal name is an alias.  */
6057 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6058 choke me
6059 #else
6060 $ac_func();
6061 #endif
6062
6063 ; return 0; }
6064 EOF
6065 if { (eval echo configure:6066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6066   rm -rf conftest*
6067   eval "ac_cv_func_$ac_func=yes"
6068 else
6069   echo "configure: failed program was:" >&5
6070   cat conftest.$ac_ext >&5
6071   rm -rf conftest*
6072   eval "ac_cv_func_$ac_func=no"
6073 fi
6074 rm -f conftest*
6075 fi
6076
6077 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6078   echo "$ac_t""yes" 1>&6
6079     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6080   cat >> confdefs.h <<EOF
6081 #define $ac_tr_func 1
6082 EOF
6083  
6084 else
6085   echo "$ac_t""no" 1>&6
6086 fi
6087 done
6088
6089
6090                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
6091 echo "configure:6092: checking for pthread_detach with <pthread.h>" >&5
6092 if eval "test \"`echo '$''{'ol_cv_func_pthread_detach'+set}'`\" = set"; then
6093   echo $ac_n "(cached) $ac_c" 1>&6
6094 else
6095   
6096                                                                 cat > conftest.$ac_ext <<EOF
6097 #line 6098 "configure"
6098 #include "confdefs.h"
6099
6100 #include <pthread.h>
6101 #ifndef NULL
6102 #define NULL (void*)0
6103 #endif
6104
6105 int main() {
6106 pthread_detach(NULL);
6107 ; return 0; }
6108 EOF
6109 if { (eval echo configure:6110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6110   rm -rf conftest*
6111   ol_cv_func_pthread_detach=yes
6112 else
6113   echo "configure: failed program was:" >&5
6114   cat conftest.$ac_ext >&5
6115   rm -rf conftest*
6116   ol_cv_func_pthread_detach=no
6117 fi
6118 rm -f conftest*
6119                         
6120 fi
6121
6122 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
6123
6124                         if test $ol_cv_func_pthread_detach = no ; then
6125                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
6126                         fi
6127
6128                         cat >> confdefs.h <<\EOF
6129 #define HAVE_PTHREAD_DETACH 1
6130 EOF
6131
6132
6133                                                 for ac_func in \
6134                                 pthread_setconcurrency \
6135                                 pthread_getconcurrency \
6136                                 thr_setconcurrency \
6137                                 thr_getconcurrency \
6138                         
6139 do
6140 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6141 echo "configure:6142: checking for $ac_func" >&5
6142 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6143   echo $ac_n "(cached) $ac_c" 1>&6
6144 else
6145   cat > conftest.$ac_ext <<EOF
6146 #line 6147 "configure"
6147 #include "confdefs.h"
6148 /* System header to define __stub macros and hopefully few prototypes,
6149     which can conflict with char $ac_func(); below.  */
6150 #include <assert.h>
6151 /* Override any gcc2 internal prototype to avoid an error.  */
6152 /* We use char because int might match the return type of a gcc2
6153     builtin and then its argument prototype would still apply.  */
6154 char $ac_func();
6155
6156 int main() {
6157
6158 /* The GNU C library defines this for functions which it implements
6159     to always fail with ENOSYS.  Some functions are actually named
6160     something starting with __ and the normal name is an alias.  */
6161 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6162 choke me
6163 #else
6164 $ac_func();
6165 #endif
6166
6167 ; return 0; }
6168 EOF
6169 if { (eval echo configure:6170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6170   rm -rf conftest*
6171   eval "ac_cv_func_$ac_func=yes"
6172 else
6173   echo "configure: failed program was:" >&5
6174   cat conftest.$ac_ext >&5
6175   rm -rf conftest*
6176   eval "ac_cv_func_$ac_func=no"
6177 fi
6178 rm -f conftest*
6179 fi
6180
6181 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6182   echo "$ac_t""yes" 1>&6
6183     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6184   cat >> confdefs.h <<EOF
6185 #define $ac_tr_func 1
6186 EOF
6187  
6188 else
6189   echo "$ac_t""no" 1>&6
6190 fi
6191 done
6192
6193
6194                         
6195         echo $ac_n "checking for pthread_kill_other_threads_np""... $ac_c" 1>&6
6196 echo "configure:6197: checking for pthread_kill_other_threads_np" >&5
6197 if eval "test \"`echo '$''{'ac_cv_func_pthread_kill_other_threads_np'+set}'`\" = set"; then
6198   echo $ac_n "(cached) $ac_c" 1>&6
6199 else
6200   cat > conftest.$ac_ext <<EOF
6201 #line 6202 "configure"
6202 #include "confdefs.h"
6203 /* System header to define __stub macros and hopefully few prototypes,
6204     which can conflict with char pthread_kill_other_threads_np(); below.  */
6205 #include <assert.h>
6206 /* Override any gcc2 internal prototype to avoid an error.  */
6207 /* We use char because int might match the return type of a gcc2
6208     builtin and then its argument prototype would still apply.  */
6209 char pthread_kill_other_threads_np();
6210
6211 int main() {
6212
6213 /* The GNU C library defines this for functions which it implements
6214     to always fail with ENOSYS.  Some functions are actually named
6215     something starting with __ and the normal name is an alias.  */
6216 #if defined (__stub_pthread_kill_other_threads_np) || defined (__stub___pthread_kill_other_threads_np)
6217 choke me
6218 #else
6219 pthread_kill_other_threads_np();
6220 #endif
6221
6222 ; return 0; }
6223 EOF
6224 if { (eval echo configure:6225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6225   rm -rf conftest*
6226   eval "ac_cv_func_pthread_kill_other_threads_np=yes"
6227 else
6228   echo "configure: failed program was:" >&5
6229   cat conftest.$ac_ext >&5
6230   rm -rf conftest*
6231   eval "ac_cv_func_pthread_kill_other_threads_np=no"
6232 fi
6233 rm -f conftest*
6234 fi
6235
6236 if eval "test \"`echo '$ac_cv_func_'pthread_kill_other_threads_np`\" = yes"; then
6237   echo "$ac_t""yes" 1>&6
6238   :
6239 else
6240   echo "$ac_t""no" 1>&6
6241 fi
6242
6243         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
6244 echo "configure:6245: checking for LinuxThreads implementation" >&5
6245 if eval "test \"`echo '$''{'ol_cv_sys_linux_threads'+set}'`\" = set"; then
6246   echo $ac_n "(cached) $ac_c" 1>&6
6247 else
6248   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
6249 fi
6250
6251 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
6252
6253                         
6254         
6255         
6256         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
6257 echo "configure:6258: checking for LinuxThreads consistency" >&5
6258 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
6259   echo $ac_n "(cached) $ac_c" 1>&6
6260 else
6261   
6262                 if test $ol_cv_header_linux_threads = yes -a \
6263                         $ol_cv_sys_linux_threads = yes; then
6264                         ol_cv_linux_threads=yes
6265                 elif test $ol_cv_header_linux_threads = no -a \
6266                         $ol_cv_sys_linux_threads = no; then
6267                         ol_cv_linux_threads=no
6268                 else
6269                         ol_cv_linux_threads=error
6270                 fi
6271         
6272 fi
6273
6274 echo "$ac_t""$ol_cv_linux_threads" 1>&6
6275
6276
6277                         if test $ol_cv_linux_threads = error; then
6278                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
6279                         fi
6280
6281                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
6282 echo "configure:6283: checking if pthread_create() works" >&5
6283                         if eval "test \"`echo '$''{'ol_cv_pthread_create_works'+set}'`\" = set"; then
6284   echo $ac_n "(cached) $ac_c" 1>&6
6285 else
6286   
6287                         if test "$cross_compiling" = yes; then
6288                                 ol_cv_pthread_create_works=yes
6289 else
6290   cat > conftest.$ac_ext <<EOF
6291 #line 6292 "configure"
6292 #include "confdefs.h"
6293
6294 #include <pthread.h>
6295 #ifndef NULL
6296 #define NULL (void*)0
6297 #endif
6298
6299 static void *task(p)
6300         void *p;
6301 {
6302         return (void *) (p == NULL);
6303 }
6304
6305 int main(argc, argv)
6306         int argc;
6307         char **argv;
6308 {
6309         pthread_t t;
6310 #if HAVE_PTHREADS_D4
6311         exit(pthread_create(&t, pthread_attr_default, task, NULL));
6312 #else
6313         exit(pthread_create(&t, NULL, task, NULL));
6314 #endif
6315 }
6316
6317 EOF
6318 if { (eval echo configure:6319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6319 then
6320   ol_cv_pthread_create_works=yes
6321 else
6322   echo "configure: failed program was:" >&5
6323   cat conftest.$ac_ext >&5
6324   rm -fr conftest*
6325   ol_cv_pthread_create_works=no
6326 fi
6327 rm -fr conftest*
6328 fi
6329
6330 fi
6331
6332                         echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
6333
6334                         if test $ol_cv_pthread_create_works = no ; then
6335                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
6336                         fi
6337
6338                                                 if test $ol_with_yielding_select = auto ; then
6339                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
6340 echo "configure:6341: checking if select yields when using pthreads" >&5
6341                                 if eval "test \"`echo '$''{'ol_cv_pthread_select_yields'+set}'`\" = set"; then
6342   echo $ac_n "(cached) $ac_c" 1>&6
6343 else
6344   
6345                                 if test "$cross_compiling" = yes; then
6346   
6347                                 { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
6348 else
6349   cat > conftest.$ac_ext <<EOF
6350 #line 6351 "configure"
6351 #include "confdefs.h"
6352
6353 #include <sys/types.h>
6354 #include <sys/time.h>
6355 #include <unistd.h>
6356 #include <pthread.h>
6357 #ifndef NULL
6358 #define NULL (void*) 0
6359 #endif
6360
6361 static int fildes[2];
6362
6363 static void *task(p)
6364         void *p;
6365 {
6366         int i;
6367         struct timeval tv;
6368
6369         fd_set rfds;
6370
6371         tv.tv_sec=10;
6372         tv.tv_usec=0;
6373
6374         FD_ZERO(&rfds);
6375         FD_SET(fildes[0], &rfds);
6376
6377         /* we're not interested in any fds */
6378         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
6379
6380         if(i < 0) {
6381                 perror("select");
6382                 exit(10);
6383         }
6384
6385         exit(0); /* if we exit here, the select blocked the whole process */
6386 }
6387
6388 int main(argc, argv)
6389         int argc;
6390         char **argv;
6391 {
6392         pthread_t t;
6393
6394         /* create a pipe to select */
6395         if(pipe(&fildes[0])) {
6396                 perror("select");
6397                 exit(1);
6398         }
6399
6400 #ifdef HAVE_PTHREAD_SETCONCURRENCY
6401         (void) pthread_setconcurrency(2);
6402 #else
6403 #ifdef HAVE_THR_SETCONCURRENCY
6404         /* Set Solaris LWP concurrency to 2 */
6405         thr_setconcurrency(2);
6406 #endif
6407 #endif
6408
6409 #if HAVE_PTHREADS_D4
6410         pthread_create(&t, pthread_attr_default, task, NULL);
6411 #else
6412         pthread_create(&t, NULL, task, NULL);
6413 #endif
6414
6415 #if HAVE_SCHED_YIELD
6416         sched_yield();  /* make sure task runs first */
6417 #else
6418 #ifdef HAVE_PTHREAD_YIELD
6419         pthread_yield();        /* make sure task runs first */
6420 #endif
6421 #endif
6422
6423         exit(2);
6424 }
6425 EOF
6426 if { (eval echo configure:6427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6427 then
6428   ol_cv_pthread_select_yields=no
6429 else
6430   echo "configure: failed program was:" >&5
6431   cat conftest.$ac_ext >&5
6432   rm -fr conftest*
6433   ol_cv_pthread_select_yields=yes
6434 fi
6435 rm -fr conftest*
6436 fi
6437
6438 fi
6439
6440                                 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
6441
6442                                 if test $ol_cv_pthread_select_yields = yes ; then
6443                                         ol_with_yielding_select=yes
6444                                 fi
6445                         fi
6446
6447                                                 CPPFLAGS="$save_CPPFLAGS"
6448                         LIBS="$save_LIBS"
6449                 else
6450                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
6451                 fi
6452         fi
6453
6454         if test $ol_with_threads = posix ; then
6455                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
6456         fi
6457 fi
6458
6459 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6460         -o $ol_with_threads = mach ; then
6461
6462                 for ac_hdr in mach/cthreads.h
6463 do
6464 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6465 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6466 echo "configure:6467: checking for $ac_hdr" >&5
6467 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6468   echo $ac_n "(cached) $ac_c" 1>&6
6469 else
6470   cat > conftest.$ac_ext <<EOF
6471 #line 6472 "configure"
6472 #include "confdefs.h"
6473 #include <$ac_hdr>
6474 EOF
6475 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6476 { (eval echo configure:6477: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6477 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6478 if test -z "$ac_err"; then
6479   rm -rf conftest*
6480   eval "ac_cv_header_$ac_safe=yes"
6481 else
6482   echo "$ac_err" >&5
6483   echo "configure: failed program was:" >&5
6484   cat conftest.$ac_ext >&5
6485   rm -rf conftest*
6486   eval "ac_cv_header_$ac_safe=no"
6487 fi
6488 rm -f conftest*
6489 fi
6490 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6491   echo "$ac_t""yes" 1>&6
6492     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6493   cat >> confdefs.h <<EOF
6494 #define $ac_tr_hdr 1
6495 EOF
6496  
6497 else
6498   echo "$ac_t""no" 1>&6
6499 fi
6500 done
6501
6502         if test $ac_cv_header_mach_cthreads_h = yes ; then
6503                 ol_with_threads=found
6504
6505                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
6506 echo "configure:6507: checking for cthread_fork" >&5
6507 if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
6508   echo $ac_n "(cached) $ac_c" 1>&6
6509 else
6510   cat > conftest.$ac_ext <<EOF
6511 #line 6512 "configure"
6512 #include "confdefs.h"
6513 /* System header to define __stub macros and hopefully few prototypes,
6514     which can conflict with char cthread_fork(); below.  */
6515 #include <assert.h>
6516 /* Override any gcc2 internal prototype to avoid an error.  */
6517 /* We use char because int might match the return type of a gcc2
6518     builtin and then its argument prototype would still apply.  */
6519 char cthread_fork();
6520
6521 int main() {
6522
6523 /* The GNU C library defines this for functions which it implements
6524     to always fail with ENOSYS.  Some functions are actually named
6525     something starting with __ and the normal name is an alias.  */
6526 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
6527 choke me
6528 #else
6529 cthread_fork();
6530 #endif
6531
6532 ; return 0; }
6533 EOF
6534 if { (eval echo configure:6535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6535   rm -rf conftest*
6536   eval "ac_cv_func_cthread_fork=yes"
6537 else
6538   echo "configure: failed program was:" >&5
6539   cat conftest.$ac_ext >&5
6540   rm -rf conftest*
6541   eval "ac_cv_func_cthread_fork=no"
6542 fi
6543 rm -f conftest*
6544 fi
6545
6546 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
6547   echo "$ac_t""yes" 1>&6
6548   ol_link_threads=yes
6549 else
6550   echo "$ac_t""no" 1>&6
6551 fi
6552
6553
6554                 if test $ol_link_threads = no ; then
6555                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
6556 echo "configure:6557: checking for cthread_fork with -all_load" >&5
6557 if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
6558   echo $ac_n "(cached) $ac_c" 1>&6
6559 else
6560   
6561                                                                 save_LIBS="$LIBS"
6562                                 LIBS="-all_load $LIBS"
6563                                 cat > conftest.$ac_ext <<EOF
6564 #line 6565 "configure"
6565 #include "confdefs.h"
6566 #include <mach/cthreads.h>
6567 int main() {
6568
6569                                         cthread_fork((void *)0, (void *)0);
6570                                         
6571 ; return 0; }
6572 EOF
6573 if { (eval echo configure:6574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6574   rm -rf conftest*
6575   ol_cv_cthread_all_load=yes
6576 else
6577   echo "configure: failed program was:" >&5
6578   cat conftest.$ac_ext >&5
6579   rm -rf conftest*
6580   ol_cv_cthread_all_load=no
6581 fi
6582 rm -f conftest*
6583                                                                 LIBS="$save_LIBS"
6584                         
6585 fi
6586
6587 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
6588
6589                         if test $ol_cv_cthread_all_load = yes ; then
6590                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
6591                                 ol_link_threads=mach
6592                         fi
6593                 fi
6594
6595                 if test $ol_link_threads != no ; then
6596                         : check for cthread specific functionality here
6597                         cat >> confdefs.h <<\EOF
6598 #define HAVE_MACH_CTHREADS 1
6599 EOF
6600
6601                 else
6602                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
6603                 fi
6604         fi
6605
6606         if test $ol_with_threads = mach ; then
6607                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
6608         fi
6609 fi
6610
6611 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6612         -o $ol_with_threads = lwp ; then
6613
6614                 for ac_hdr in thread.h synch.h
6615 do
6616 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6617 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6618 echo "configure:6619: checking for $ac_hdr" >&5
6619 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6620   echo $ac_n "(cached) $ac_c" 1>&6
6621 else
6622   cat > conftest.$ac_ext <<EOF
6623 #line 6624 "configure"
6624 #include "confdefs.h"
6625 #include <$ac_hdr>
6626 EOF
6627 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6628 { (eval echo configure:6629: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6629 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6630 if test -z "$ac_err"; then
6631   rm -rf conftest*
6632   eval "ac_cv_header_$ac_safe=yes"
6633 else
6634   echo "$ac_err" >&5
6635   echo "configure: failed program was:" >&5
6636   cat conftest.$ac_ext >&5
6637   rm -rf conftest*
6638   eval "ac_cv_header_$ac_safe=no"
6639 fi
6640 rm -f conftest*
6641 fi
6642 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6643   echo "$ac_t""yes" 1>&6
6644     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6645   cat >> confdefs.h <<EOF
6646 #define $ac_tr_hdr 1
6647 EOF
6648  
6649 else
6650   echo "$ac_t""no" 1>&6
6651 fi
6652 done
6653
6654         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
6655                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
6656 echo "configure:6657: checking for thr_create in -lthread" >&5
6657 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
6658 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6659   echo $ac_n "(cached) $ac_c" 1>&6
6660 else
6661   ac_save_LIBS="$LIBS"
6662 LIBS="-lthread  $LIBS"
6663 cat > conftest.$ac_ext <<EOF
6664 #line 6665 "configure"
6665 #include "confdefs.h"
6666 /* Override any gcc2 internal prototype to avoid an error.  */
6667 /* We use char because int might match the return type of a gcc2
6668     builtin and then its argument prototype would still apply.  */
6669 char thr_create();
6670
6671 int main() {
6672 thr_create()
6673 ; return 0; }
6674 EOF
6675 if { (eval echo configure:6676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6676   rm -rf conftest*
6677   eval "ac_cv_lib_$ac_lib_var=yes"
6678 else
6679   echo "configure: failed program was:" >&5
6680   cat conftest.$ac_ext >&5
6681   rm -rf conftest*
6682   eval "ac_cv_lib_$ac_lib_var=no"
6683 fi
6684 rm -f conftest*
6685 LIBS="$ac_save_LIBS"
6686
6687 fi
6688 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6689   echo "$ac_t""yes" 1>&6
6690   have_thr=yes
6691 else
6692   echo "$ac_t""no" 1>&6
6693 have_thr=no
6694 fi
6695
6696
6697                 if test $have_thr = yes ; then
6698                         cat >> confdefs.h <<\EOF
6699 #define HAVE_THR 1
6700 EOF
6701
6702                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
6703                         ol_link_threads=thr
6704
6705                         if test $ol_with_yielding_select = auto ; then
6706                                 ol_with_yielding_select=yes
6707                         fi
6708
6709                                                 for ac_func in \
6710                                 thr_setconcurrency \
6711                                 thr_getconcurrency \
6712                         
6713 do
6714 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6715 echo "configure:6716: checking for $ac_func" >&5
6716 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6717   echo $ac_n "(cached) $ac_c" 1>&6
6718 else
6719   cat > conftest.$ac_ext <<EOF
6720 #line 6721 "configure"
6721 #include "confdefs.h"
6722 /* System header to define __stub macros and hopefully few prototypes,
6723     which can conflict with char $ac_func(); below.  */
6724 #include <assert.h>
6725 /* Override any gcc2 internal prototype to avoid an error.  */
6726 /* We use char because int might match the return type of a gcc2
6727     builtin and then its argument prototype would still apply.  */
6728 char $ac_func();
6729
6730 int main() {
6731
6732 /* The GNU C library defines this for functions which it implements
6733     to always fail with ENOSYS.  Some functions are actually named
6734     something starting with __ and the normal name is an alias.  */
6735 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6736 choke me
6737 #else
6738 $ac_func();
6739 #endif
6740
6741 ; return 0; }
6742 EOF
6743 if { (eval echo configure:6744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6744   rm -rf conftest*
6745   eval "ac_cv_func_$ac_func=yes"
6746 else
6747   echo "configure: failed program was:" >&5
6748   cat conftest.$ac_ext >&5
6749   rm -rf conftest*
6750   eval "ac_cv_func_$ac_func=no"
6751 fi
6752 rm -f conftest*
6753 fi
6754
6755 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6756   echo "$ac_t""yes" 1>&6
6757     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6758   cat >> confdefs.h <<EOF
6759 #define $ac_tr_func 1
6760 EOF
6761  
6762 else
6763   echo "$ac_t""no" 1>&6
6764 fi
6765 done
6766
6767                 fi
6768         fi
6769
6770                 for ac_hdr in lwp/lwp.h
6771 do
6772 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6773 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6774 echo "configure:6775: checking for $ac_hdr" >&5
6775 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6776   echo $ac_n "(cached) $ac_c" 1>&6
6777 else
6778   cat > conftest.$ac_ext <<EOF
6779 #line 6780 "configure"
6780 #include "confdefs.h"
6781 #include <$ac_hdr>
6782 EOF
6783 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6784 { (eval echo configure:6785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6785 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6786 if test -z "$ac_err"; then
6787   rm -rf conftest*
6788   eval "ac_cv_header_$ac_safe=yes"
6789 else
6790   echo "$ac_err" >&5
6791   echo "configure: failed program was:" >&5
6792   cat conftest.$ac_ext >&5
6793   rm -rf conftest*
6794   eval "ac_cv_header_$ac_safe=no"
6795 fi
6796 rm -f conftest*
6797 fi
6798 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6799   echo "$ac_t""yes" 1>&6
6800     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6801   cat >> confdefs.h <<EOF
6802 #define $ac_tr_hdr 1
6803 EOF
6804  
6805 else
6806   echo "$ac_t""no" 1>&6
6807 fi
6808 done
6809
6810         if test $ac_cv_header_lwp_lwp_h = yes ; then
6811                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
6812 echo "configure:6813: checking for lwp_create in -llwp" >&5
6813 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
6814 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6815   echo $ac_n "(cached) $ac_c" 1>&6
6816 else
6817   ac_save_LIBS="$LIBS"
6818 LIBS="-llwp  $LIBS"
6819 cat > conftest.$ac_ext <<EOF
6820 #line 6821 "configure"
6821 #include "confdefs.h"
6822 /* Override any gcc2 internal prototype to avoid an error.  */
6823 /* We use char because int might match the return type of a gcc2
6824     builtin and then its argument prototype would still apply.  */
6825 char lwp_create();
6826
6827 int main() {
6828 lwp_create()
6829 ; return 0; }
6830 EOF
6831 if { (eval echo configure:6832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6832   rm -rf conftest*
6833   eval "ac_cv_lib_$ac_lib_var=yes"
6834 else
6835   echo "configure: failed program was:" >&5
6836   cat conftest.$ac_ext >&5
6837   rm -rf conftest*
6838   eval "ac_cv_lib_$ac_lib_var=no"
6839 fi
6840 rm -f conftest*
6841 LIBS="$ac_save_LIBS"
6842
6843 fi
6844 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6845   echo "$ac_t""yes" 1>&6
6846   have_lwp=yes
6847 else
6848   echo "$ac_t""no" 1>&6
6849 have_lwp=no
6850 fi
6851
6852
6853                 if test $have_lwp = yes ; then
6854                         cat >> confdefs.h <<\EOF
6855 #define HAVE_LWP 1
6856 EOF
6857
6858                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
6859                         ol_link_threads=lwp
6860
6861                         if test $ol_with_yielding_select = auto ; then
6862                                 ol_with_yielding_select=no
6863                         fi
6864                 fi
6865         fi
6866 fi
6867
6868 if test $ol_with_yielding_select = yes ; then
6869         cat >> confdefs.h <<\EOF
6870 #define HAVE_YIELDING_SELECT 1
6871 EOF
6872
6873 fi
6874
6875 if test $ol_with_threads = manual ; then
6876                 ol_link_threads=yes
6877
6878         echo "configure: warning: thread defines and link options must be set manually" 1>&2
6879
6880         for ac_hdr in pthread.h sched.h
6881 do
6882 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6883 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6884 echo "configure:6885: checking for $ac_hdr" >&5
6885 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6886   echo $ac_n "(cached) $ac_c" 1>&6
6887 else
6888   cat > conftest.$ac_ext <<EOF
6889 #line 6890 "configure"
6890 #include "confdefs.h"
6891 #include <$ac_hdr>
6892 EOF
6893 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6894 { (eval echo configure:6895: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6895 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6896 if test -z "$ac_err"; then
6897   rm -rf conftest*
6898   eval "ac_cv_header_$ac_safe=yes"
6899 else
6900   echo "$ac_err" >&5
6901   echo "configure: failed program was:" >&5
6902   cat conftest.$ac_ext >&5
6903   rm -rf conftest*
6904   eval "ac_cv_header_$ac_safe=no"
6905 fi
6906 rm -f conftest*
6907 fi
6908 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6909   echo "$ac_t""yes" 1>&6
6910     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6911   cat >> confdefs.h <<EOF
6912 #define $ac_tr_hdr 1
6913 EOF
6914  
6915 else
6916   echo "$ac_t""no" 1>&6
6917 fi
6918 done
6919
6920         for ac_func in sched_yield pthread_yield
6921 do
6922 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6923 echo "configure:6924: checking for $ac_func" >&5
6924 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6925   echo $ac_n "(cached) $ac_c" 1>&6
6926 else
6927   cat > conftest.$ac_ext <<EOF
6928 #line 6929 "configure"
6929 #include "confdefs.h"
6930 /* System header to define __stub macros and hopefully few prototypes,
6931     which can conflict with char $ac_func(); below.  */
6932 #include <assert.h>
6933 /* Override any gcc2 internal prototype to avoid an error.  */
6934 /* We use char because int might match the return type of a gcc2
6935     builtin and then its argument prototype would still apply.  */
6936 char $ac_func();
6937
6938 int main() {
6939
6940 /* The GNU C library defines this for functions which it implements
6941     to always fail with ENOSYS.  Some functions are actually named
6942     something starting with __ and the normal name is an alias.  */
6943 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6944 choke me
6945 #else
6946 $ac_func();
6947 #endif
6948
6949 ; return 0; }
6950 EOF
6951 if { (eval echo configure:6952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6952   rm -rf conftest*
6953   eval "ac_cv_func_$ac_func=yes"
6954 else
6955   echo "configure: failed program was:" >&5
6956   cat conftest.$ac_ext >&5
6957   rm -rf conftest*
6958   eval "ac_cv_func_$ac_func=no"
6959 fi
6960 rm -f conftest*
6961 fi
6962
6963 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6964   echo "$ac_t""yes" 1>&6
6965     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6966   cat >> confdefs.h <<EOF
6967 #define $ac_tr_func 1
6968 EOF
6969  
6970 else
6971   echo "$ac_t""no" 1>&6
6972 fi
6973 done
6974
6975         
6976         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
6977 echo "configure:6978: checking for LinuxThreads pthread.h" >&5
6978 if eval "test \"`echo '$''{'ol_cv_header_linux_threads'+set}'`\" = set"; then
6979   echo $ac_n "(cached) $ac_c" 1>&6
6980 else
6981   cat > conftest.$ac_ext <<EOF
6982 #line 6983 "configure"
6983 #include "confdefs.h"
6984 #include <pthread.h>
6985 EOF
6986 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6987   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
6988   rm -rf conftest*
6989   ol_cv_header_linux_threads=yes
6990 else
6991   rm -rf conftest*
6992   ol_cv_header_linux_threads=no
6993 fi
6994 rm -f conftest*
6995
6996                 
6997 fi
6998
6999 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
7000         if test $ol_cv_header_linux_threads = yes; then
7001                 cat >> confdefs.h <<\EOF
7002 #define HAVE_LINUX_THREADS 1
7003 EOF
7004
7005         fi
7006
7007
7008         for ac_hdr in mach/cthreads.h
7009 do
7010 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7011 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7012 echo "configure:7013: checking for $ac_hdr" >&5
7013 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7014   echo $ac_n "(cached) $ac_c" 1>&6
7015 else
7016   cat > conftest.$ac_ext <<EOF
7017 #line 7018 "configure"
7018 #include "confdefs.h"
7019 #include <$ac_hdr>
7020 EOF
7021 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7022 { (eval echo configure:7023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7023 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7024 if test -z "$ac_err"; then
7025   rm -rf conftest*
7026   eval "ac_cv_header_$ac_safe=yes"
7027 else
7028   echo "$ac_err" >&5
7029   echo "configure: failed program was:" >&5
7030   cat conftest.$ac_ext >&5
7031   rm -rf conftest*
7032   eval "ac_cv_header_$ac_safe=no"
7033 fi
7034 rm -f conftest*
7035 fi
7036 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7037   echo "$ac_t""yes" 1>&6
7038     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7039   cat >> confdefs.h <<EOF
7040 #define $ac_tr_hdr 1
7041 EOF
7042  
7043 else
7044   echo "$ac_t""no" 1>&6
7045 fi
7046 done
7047
7048         for ac_hdr in lwp/lwp.h
7049 do
7050 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7051 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7052 echo "configure:7053: checking for $ac_hdr" >&5
7053 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7054   echo $ac_n "(cached) $ac_c" 1>&6
7055 else
7056   cat > conftest.$ac_ext <<EOF
7057 #line 7058 "configure"
7058 #include "confdefs.h"
7059 #include <$ac_hdr>
7060 EOF
7061 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7062 { (eval echo configure:7063: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7063 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7064 if test -z "$ac_err"; then
7065   rm -rf conftest*
7066   eval "ac_cv_header_$ac_safe=yes"
7067 else
7068   echo "$ac_err" >&5
7069   echo "configure: failed program was:" >&5
7070   cat conftest.$ac_ext >&5
7071   rm -rf conftest*
7072   eval "ac_cv_header_$ac_safe=no"
7073 fi
7074 rm -f conftest*
7075 fi
7076 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7077   echo "$ac_t""yes" 1>&6
7078     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7079   cat >> confdefs.h <<EOF
7080 #define $ac_tr_hdr 1
7081 EOF
7082  
7083 else
7084   echo "$ac_t""no" 1>&6
7085 fi
7086 done
7087
7088         for ac_hdr in thread.h synch.h
7089 do
7090 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7091 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7092 echo "configure:7093: checking for $ac_hdr" >&5
7093 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7094   echo $ac_n "(cached) $ac_c" 1>&6
7095 else
7096   cat > conftest.$ac_ext <<EOF
7097 #line 7098 "configure"
7098 #include "confdefs.h"
7099 #include <$ac_hdr>
7100 EOF
7101 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7102 { (eval echo configure:7103: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7103 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7104 if test -z "$ac_err"; then
7105   rm -rf conftest*
7106   eval "ac_cv_header_$ac_safe=yes"
7107 else
7108   echo "$ac_err" >&5
7109   echo "configure: failed program was:" >&5
7110   cat conftest.$ac_ext >&5
7111   rm -rf conftest*
7112   eval "ac_cv_header_$ac_safe=no"
7113 fi
7114 rm -f conftest*
7115 fi
7116 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7117   echo "$ac_t""yes" 1>&6
7118     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7119   cat >> confdefs.h <<EOF
7120 #define $ac_tr_hdr 1
7121 EOF
7122  
7123 else
7124   echo "$ac_t""no" 1>&6
7125 fi
7126 done
7127
7128 fi
7129
7130 if test $ol_link_threads != no ; then  
7131                         cat >> confdefs.h <<\EOF
7132 #define REENTRANT 1
7133 EOF
7134
7135         cat >> confdefs.h <<\EOF
7136 #define _REENTRANT 1
7137 EOF
7138
7139         cat >> confdefs.h <<\EOF
7140 #define THREAD_SAFE 1
7141 EOF
7142
7143         cat >> confdefs.h <<\EOF
7144 #define _THREAD_SAFE 1
7145 EOF
7146
7147         cat >> confdefs.h <<\EOF
7148 #define THREADSAFE 1
7149 EOF
7150
7151         cat >> confdefs.h <<\EOF
7152 #define _THREADSAFE 1
7153 EOF
7154
7155
7156                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
7157 echo "configure:7158: checking for thread specific errno" >&5
7158 if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
7159   echo $ac_n "(cached) $ac_c" 1>&6
7160 else
7161   
7162                 cat > conftest.$ac_ext <<EOF
7163 #line 7164 "configure"
7164 #include "confdefs.h"
7165 #include <errno.h>
7166 int main() {
7167 errno = 0;
7168 ; return 0; }
7169 EOF
7170 if { (eval echo configure:7171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7171   rm -rf conftest*
7172   ol_cv_errno_thread_specific=yes
7173 else
7174   echo "configure: failed program was:" >&5
7175   cat conftest.$ac_ext >&5
7176   rm -rf conftest*
7177   ol_cv_errno_thread_specific=no
7178 fi
7179 rm -f conftest*
7180         
7181 fi
7182
7183 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
7184
7185         if test $ol_cv_errno_thread_specific != yes ; then
7186                 LIBS="$LTHREAD_LIBS $LIBS"
7187                 LTHREAD_LIBS=""
7188         fi
7189
7190 fi  
7191
7192 if test $ol_link_threads = no ; then
7193         if test $ol_with_threads = yes ; then
7194                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
7195         fi
7196
7197         if test $ol_with_threads = auto ; then
7198                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
7199                 ol_with_threads=no
7200         fi
7201
7202         cat >> confdefs.h <<\EOF
7203 #define NO_THREADS 1
7204 EOF
7205
7206         LTHREAD_LIBS=""
7207 fi
7208
7209 if test $ol_link_threads != no ; then
7210         cat >> confdefs.h <<\EOF
7211 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
7212 EOF
7213
7214 fi
7215
7216
7217 ol_link_ldbm=no 
7218 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
7219         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
7220 echo "configure:7221: checking for DB2 library" >&5
7221 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
7222   echo $ac_n "(cached) $ac_c" 1>&6
7223 else
7224         ol_LIBS="$LIBS"
7225         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
7226 echo "configure:7227: checking for db_open in -ldb" >&5
7227 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
7228 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7229   echo $ac_n "(cached) $ac_c" 1>&6
7230 else
7231   ac_save_LIBS="$LIBS"
7232 LIBS="-ldb  $LIBS"
7233 cat > conftest.$ac_ext <<EOF
7234 #line 7235 "configure"
7235 #include "confdefs.h"
7236 /* Override any gcc2 internal prototype to avoid an error.  */
7237 /* We use char because int might match the return type of a gcc2
7238     builtin and then its argument prototype would still apply.  */
7239 char db_open();
7240
7241 int main() {
7242 db_open()
7243 ; return 0; }
7244 EOF
7245 if { (eval echo configure:7246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7246   rm -rf conftest*
7247   eval "ac_cv_lib_$ac_lib_var=yes"
7248 else
7249   echo "configure: failed program was:" >&5
7250   cat conftest.$ac_ext >&5
7251   rm -rf conftest*
7252   eval "ac_cv_lib_$ac_lib_var=no"
7253 fi
7254 rm -f conftest*
7255 LIBS="$ac_save_LIBS"
7256
7257 fi
7258 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7259   echo "$ac_t""yes" 1>&6
7260   ol_cv_lib_db2=-ldb
7261 else
7262   echo "$ac_t""no" 1>&6
7263 ol_cv_lib_db2=no
7264 fi
7265
7266         LIBS="$ol_LIBS"
7267
7268 fi
7269
7270 echo "$ac_t""$ol_cv_lib_db2" 1>&6
7271
7272 for ac_hdr in db.h
7273 do
7274 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7275 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7276 echo "configure:7277: checking for $ac_hdr" >&5
7277 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7278   echo $ac_n "(cached) $ac_c" 1>&6
7279 else
7280   cat > conftest.$ac_ext <<EOF
7281 #line 7282 "configure"
7282 #include "confdefs.h"
7283 #include <$ac_hdr>
7284 EOF
7285 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7286 { (eval echo configure:7287: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7287 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7288 if test -z "$ac_err"; then
7289   rm -rf conftest*
7290   eval "ac_cv_header_$ac_safe=yes"
7291 else
7292   echo "$ac_err" >&5
7293   echo "configure: failed program was:" >&5
7294   cat conftest.$ac_ext >&5
7295   rm -rf conftest*
7296   eval "ac_cv_header_$ac_safe=no"
7297 fi
7298 rm -f conftest*
7299 fi
7300 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7301   echo "$ac_t""yes" 1>&6
7302     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7303   cat >> confdefs.h <<EOF
7304 #define $ac_tr_hdr 1
7305 EOF
7306  
7307 else
7308   echo "$ac_t""no" 1>&6
7309 fi
7310 done
7311
7312 if test $ac_cv_header_db_h = yes ; then
7313         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
7314 echo "configure:7315: checking if db.h is DB2" >&5
7315 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
7316   echo $ac_n "(cached) $ac_c" 1>&6
7317 else
7318   
7319                 cat > conftest.$ac_ext <<EOF
7320 #line 7321 "configure"
7321 #include "confdefs.h"
7322
7323 #                       include <db.h>
7324                         /* this check could be improved */
7325 #                       ifdef DB_VERSION_MAJOR
7326 #                               if DB_VERSION_MAJOR == 2
7327                                         __db_version_2
7328 #                               endif
7329 #                       endif
7330                 
7331 EOF
7332 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7333   egrep "__db_version_2" >/dev/null 2>&1; then
7334   rm -rf conftest*
7335   ol_cv_header_db2=yes
7336 else
7337   rm -rf conftest*
7338   ol_cv_header_db2=no
7339 fi
7340 rm -f conftest*
7341
7342 fi
7343
7344 echo "$ac_t""$ol_cv_header_db2" 1>&6
7345 else
7346         ol_cv_header_db2=no
7347 fi
7348
7349
7350  
7351  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
7352 echo "configure:7353: checking for Berkeley DB2" >&5
7353 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
7354   echo $ac_n "(cached) $ac_c" 1>&6
7355 else
7356   
7357         if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then
7358                 ol_cv_berkeley_db2=no
7359         else
7360                 ol_cv_berkeley_db2=yes
7361         fi
7362
7363 fi
7364
7365 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
7366  if test $ol_cv_berkeley_db2 = yes ; then
7367         cat >> confdefs.h <<\EOF
7368 #define HAVE_BERKELEY_DB2 1
7369 EOF
7370
7371  fi
7372
7373
7374         if test $ol_cv_berkeley_db2 = yes ; then
7375                 ol_link_ldbm=db2
7376                 ol_with_ldbm_api=db2
7377
7378                 if test $ol_with_ldbm_type = hash ; then
7379                         cat >> confdefs.h <<\EOF
7380 #define LDBM_USE_DBHASH 1
7381 EOF
7382
7383                 else
7384                         cat >> confdefs.h <<\EOF
7385 #define LDBM_USE_DBBTREE 1
7386 EOF
7387
7388                 fi
7389
7390                                                 if test $ol_cv_lib_db2 != yes ; then
7391                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
7392                 fi
7393         fi
7394 fi
7395
7396 ol_link_bdb2=no
7397 if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
7398         ol_link_bdb2=yes
7399 fi
7400
7401 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
7402         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
7403 echo "configure:7404: checking for Berkeley DB library" >&5
7404 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
7405   echo $ac_n "(cached) $ac_c" 1>&6
7406 else
7407   
7408         for ac_hdr in db1/db.h
7409 do
7410 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7411 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7412 echo "configure:7413: checking for $ac_hdr" >&5
7413 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7414   echo $ac_n "(cached) $ac_c" 1>&6
7415 else
7416   cat > conftest.$ac_ext <<EOF
7417 #line 7418 "configure"
7418 #include "confdefs.h"
7419 #include <$ac_hdr>
7420 EOF
7421 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7422 { (eval echo configure:7423: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7423 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7424 if test -z "$ac_err"; then
7425   rm -rf conftest*
7426   eval "ac_cv_header_$ac_safe=yes"
7427 else
7428   echo "$ac_err" >&5
7429   echo "configure: failed program was:" >&5
7430   cat conftest.$ac_ext >&5
7431   rm -rf conftest*
7432   eval "ac_cv_header_$ac_safe=no"
7433 fi
7434 rm -f conftest*
7435 fi
7436 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7437   echo "$ac_t""yes" 1>&6
7438     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7439   cat >> confdefs.h <<EOF
7440 #define $ac_tr_hdr 1
7441 EOF
7442  
7443 else
7444   echo "$ac_t""no" 1>&6
7445 fi
7446 done
7447
7448         ol_LIBS="$LIBS"
7449         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
7450 echo "configure:7451: checking for dbopen" >&5
7451 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
7452   echo $ac_n "(cached) $ac_c" 1>&6
7453 else
7454   cat > conftest.$ac_ext <<EOF
7455 #line 7456 "configure"
7456 #include "confdefs.h"
7457 /* System header to define __stub macros and hopefully few prototypes,
7458     which can conflict with char dbopen(); below.  */
7459 #include <assert.h>
7460 /* Override any gcc2 internal prototype to avoid an error.  */
7461 /* We use char because int might match the return type of a gcc2
7462     builtin and then its argument prototype would still apply.  */
7463 char dbopen();
7464
7465 int main() {
7466
7467 /* The GNU C library defines this for functions which it implements
7468     to always fail with ENOSYS.  Some functions are actually named
7469     something starting with __ and the normal name is an alias.  */
7470 #if defined (__stub_dbopen) || defined (__stub___dbopen)
7471 choke me
7472 #else
7473 dbopen();
7474 #endif
7475
7476 ; return 0; }
7477 EOF
7478 if { (eval echo configure:7479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7479   rm -rf conftest*
7480   eval "ac_cv_func_dbopen=yes"
7481 else
7482   echo "configure: failed program was:" >&5
7483   cat conftest.$ac_ext >&5
7484   rm -rf conftest*
7485   eval "ac_cv_func_dbopen=no"
7486 fi
7487 rm -f conftest*
7488 fi
7489
7490 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
7491   echo "$ac_t""yes" 1>&6
7492   ol_cv_lib_db=yes
7493 else
7494   echo "$ac_t""no" 1>&6
7495
7496                 echo $ac_n "checking for dbopen in -ldb1""... $ac_c" 1>&6
7497 echo "configure:7498: checking for dbopen in -ldb1" >&5
7498 ac_lib_var=`echo db1'_'dbopen | sed 'y%./+-%__p_%'`
7499 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7500   echo $ac_n "(cached) $ac_c" 1>&6
7501 else
7502   ac_save_LIBS="$LIBS"
7503 LIBS="-ldb1  $LIBS"
7504 cat > conftest.$ac_ext <<EOF
7505 #line 7506 "configure"
7506 #include "confdefs.h"
7507 /* Override any gcc2 internal prototype to avoid an error.  */
7508 /* We use char because int might match the return type of a gcc2
7509     builtin and then its argument prototype would still apply.  */
7510 char dbopen();
7511
7512 int main() {
7513 dbopen()
7514 ; return 0; }
7515 EOF
7516 if { (eval echo configure:7517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7517   rm -rf conftest*
7518   eval "ac_cv_lib_$ac_lib_var=yes"
7519 else
7520   echo "configure: failed program was:" >&5
7521   cat conftest.$ac_ext >&5
7522   rm -rf conftest*
7523   eval "ac_cv_lib_$ac_lib_var=no"
7524 fi
7525 rm -f conftest*
7526 LIBS="$ac_save_LIBS"
7527
7528 fi
7529 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7530   echo "$ac_t""yes" 1>&6
7531   ol_cv_lib_db=-ldb1
7532 else
7533   echo "$ac_t""no" 1>&6
7534
7535                         echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
7536 echo "configure:7537: checking for dbopen in -ldb" >&5
7537 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
7538 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7539   echo $ac_n "(cached) $ac_c" 1>&6
7540 else
7541   ac_save_LIBS="$LIBS"
7542 LIBS="-ldb  $LIBS"
7543 cat > conftest.$ac_ext <<EOF
7544 #line 7545 "configure"
7545 #include "confdefs.h"
7546 /* Override any gcc2 internal prototype to avoid an error.  */
7547 /* We use char because int might match the return type of a gcc2
7548     builtin and then its argument prototype would still apply.  */
7549 char dbopen();
7550
7551 int main() {
7552 dbopen()
7553 ; return 0; }
7554 EOF
7555 if { (eval echo configure:7556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7556   rm -rf conftest*
7557   eval "ac_cv_lib_$ac_lib_var=yes"
7558 else
7559   echo "configure: failed program was:" >&5
7560   cat conftest.$ac_ext >&5
7561   rm -rf conftest*
7562   eval "ac_cv_lib_$ac_lib_var=no"
7563 fi
7564 rm -f conftest*
7565 LIBS="$ac_save_LIBS"
7566
7567 fi
7568 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7569   echo "$ac_t""yes" 1>&6
7570   ol_cv_lib_db=-ldb
7571 else
7572   echo "$ac_t""no" 1>&6
7573 ol_cv_lib_db=no
7574 fi
7575
7576                 
7577 fi
7578
7579         
7580 fi
7581
7582         LIBS="$ol_LIBS"
7583
7584 fi
7585
7586 echo "$ac_t""$ol_cv_lib_db" 1>&6
7587
7588
7589 for ac_hdr in db_185.h
7590 do
7591 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7592 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7593 echo "configure:7594: checking for $ac_hdr" >&5
7594 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7595   echo $ac_n "(cached) $ac_c" 1>&6
7596 else
7597   cat > conftest.$ac_ext <<EOF
7598 #line 7599 "configure"
7599 #include "confdefs.h"
7600 #include <$ac_hdr>
7601 EOF
7602 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7603 { (eval echo configure:7604: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7604 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7605 if test -z "$ac_err"; then
7606   rm -rf conftest*
7607   eval "ac_cv_header_$ac_safe=yes"
7608 else
7609   echo "$ac_err" >&5
7610   echo "configure: failed program was:" >&5
7611   cat conftest.$ac_ext >&5
7612   rm -rf conftest*
7613   eval "ac_cv_header_$ac_safe=no"
7614 fi
7615 rm -f conftest*
7616 fi
7617 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7618   echo "$ac_t""yes" 1>&6
7619     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7620   cat >> confdefs.h <<EOF
7621 #define $ac_tr_hdr 1
7622 EOF
7623  
7624 else
7625   echo "$ac_t""no" 1>&6
7626 fi
7627 done
7628
7629 if test "$ol_cv_header_db2" = yes ; then
7630         
7631         ol_cv_header_db=$ac_cv_header_db_185_h
7632 else
7633         ol_cv_header_db=$ac_cv_header_db_h
7634 fi
7635
7636
7637  
7638  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
7639 echo "configure:7640: checking for Berkeley DB" >&5
7640 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
7641   echo $ac_n "(cached) $ac_c" 1>&6
7642 else
7643   
7644         if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then
7645                 ol_cv_berkeley_db=no
7646         else
7647                 ol_cv_berkeley_db=yes
7648         fi
7649
7650 fi
7651
7652 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
7653  if test $ol_cv_berkeley_db = yes ; then
7654         cat >> confdefs.h <<\EOF
7655 #define HAVE_BERKELEY_DB 1
7656 EOF
7657
7658  fi
7659
7660
7661         if test $ol_cv_berkeley_db = yes ; then
7662                 ol_link_ldbm=db
7663                 ol_with_ldbm_api=db
7664
7665                 if test $ol_with_ldbm_type = hash ; then
7666                         cat >> confdefs.h <<\EOF
7667 #define LDBM_USE_DBHASH 1
7668 EOF
7669
7670                 else
7671                         cat >> confdefs.h <<\EOF
7672 #define LDBM_USE_DBBTREE 1
7673 EOF
7674
7675                 fi
7676
7677                                                 if test $ol_cv_lib_db != yes ; then
7678                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
7679                 fi
7680         fi
7681 fi
7682
7683 if test $ol_with_ldbm_api = manual ; then
7684                 ol_link_ldbm=yes
7685
7686         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
7687
7688         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
7689 do
7690 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7691 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7692 echo "configure:7693: checking for $ac_hdr" >&5
7693 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7694   echo $ac_n "(cached) $ac_c" 1>&6
7695 else
7696   cat > conftest.$ac_ext <<EOF
7697 #line 7698 "configure"
7698 #include "confdefs.h"
7699 #include <$ac_hdr>
7700 EOF
7701 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7702 { (eval echo configure:7703: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7703 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7704 if test -z "$ac_err"; then
7705   rm -rf conftest*
7706   eval "ac_cv_header_$ac_safe=yes"
7707 else
7708   echo "$ac_err" >&5
7709   echo "configure: failed program was:" >&5
7710   cat conftest.$ac_ext >&5
7711   rm -rf conftest*
7712   eval "ac_cv_header_$ac_safe=no"
7713 fi
7714 rm -f conftest*
7715 fi
7716 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7717   echo "$ac_t""yes" 1>&6
7718     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7719   cat >> confdefs.h <<EOF
7720 #define $ac_tr_hdr 1
7721 EOF
7722  
7723 else
7724   echo "$ac_t""no" 1>&6
7725 fi
7726 done
7727
7728 fi
7729
7730 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
7731         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
7732         ol_with_ldbm_api=none
7733 fi
7734
7735 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
7736         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
7737 echo "configure:7738: checking for MDBM library" >&5
7738 if eval "test \"`echo '$''{'ol_cv_lib_mdbm'+set}'`\" = set"; then
7739   echo $ac_n "(cached) $ac_c" 1>&6
7740 else
7741         ol_LIBS="$LIBS"
7742         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
7743 echo "configure:7744: checking for mdbm_set_chain" >&5
7744 if eval "test \"`echo '$''{'ac_cv_func_mdbm_set_chain'+set}'`\" = set"; then
7745   echo $ac_n "(cached) $ac_c" 1>&6
7746 else
7747   cat > conftest.$ac_ext <<EOF
7748 #line 7749 "configure"
7749 #include "confdefs.h"
7750 /* System header to define __stub macros and hopefully few prototypes,
7751     which can conflict with char mdbm_set_chain(); below.  */
7752 #include <assert.h>
7753 /* Override any gcc2 internal prototype to avoid an error.  */
7754 /* We use char because int might match the return type of a gcc2
7755     builtin and then its argument prototype would still apply.  */
7756 char mdbm_set_chain();
7757
7758 int main() {
7759
7760 /* The GNU C library defines this for functions which it implements
7761     to always fail with ENOSYS.  Some functions are actually named
7762     something starting with __ and the normal name is an alias.  */
7763 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
7764 choke me
7765 #else
7766 mdbm_set_chain();
7767 #endif
7768
7769 ; return 0; }
7770 EOF
7771 if { (eval echo configure:7772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7772   rm -rf conftest*
7773   eval "ac_cv_func_mdbm_set_chain=yes"
7774 else
7775   echo "configure: failed program was:" >&5
7776   cat conftest.$ac_ext >&5
7777   rm -rf conftest*
7778   eval "ac_cv_func_mdbm_set_chain=no"
7779 fi
7780 rm -f conftest*
7781 fi
7782
7783 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
7784   echo "$ac_t""yes" 1>&6
7785   ol_cv_lib_mdbm=yes
7786 else
7787   echo "$ac_t""no" 1>&6
7788
7789                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
7790 echo "configure:7791: checking for mdbm_set_chain in -lmdbm" >&5
7791 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-%__p_%'`
7792 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7793   echo $ac_n "(cached) $ac_c" 1>&6
7794 else
7795   ac_save_LIBS="$LIBS"
7796 LIBS="-lmdbm  $LIBS"
7797 cat > conftest.$ac_ext <<EOF
7798 #line 7799 "configure"
7799 #include "confdefs.h"
7800 /* Override any gcc2 internal prototype to avoid an error.  */
7801 /* We use char because int might match the return type of a gcc2
7802     builtin and then its argument prototype would still apply.  */
7803 char mdbm_set_chain();
7804
7805 int main() {
7806 mdbm_set_chain()
7807 ; return 0; }
7808 EOF
7809 if { (eval echo configure:7810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7810   rm -rf conftest*
7811   eval "ac_cv_lib_$ac_lib_var=yes"
7812 else
7813   echo "configure: failed program was:" >&5
7814   cat conftest.$ac_ext >&5
7815   rm -rf conftest*
7816   eval "ac_cv_lib_$ac_lib_var=no"
7817 fi
7818 rm -f conftest*
7819 LIBS="$ac_save_LIBS"
7820
7821 fi
7822 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7823   echo "$ac_t""yes" 1>&6
7824   ol_cv_lib_mdbm=-lmdbm
7825 else
7826   echo "$ac_t""no" 1>&6
7827 ol_cv_lib_mdbm=no
7828 fi
7829
7830         
7831 fi
7832
7833         LIBS="$ol_LIBS"
7834
7835 fi
7836
7837 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
7838
7839
7840  for ac_hdr in mdbm.h
7841 do
7842 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7843 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7844 echo "configure:7845: checking for $ac_hdr" >&5
7845 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7846   echo $ac_n "(cached) $ac_c" 1>&6
7847 else
7848   cat > conftest.$ac_ext <<EOF
7849 #line 7850 "configure"
7850 #include "confdefs.h"
7851 #include <$ac_hdr>
7852 EOF
7853 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7854 { (eval echo configure:7855: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7855 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7856 if test -z "$ac_err"; then
7857   rm -rf conftest*
7858   eval "ac_cv_header_$ac_safe=yes"
7859 else
7860   echo "$ac_err" >&5
7861   echo "configure: failed program was:" >&5
7862   cat conftest.$ac_ext >&5
7863   rm -rf conftest*
7864   eval "ac_cv_header_$ac_safe=no"
7865 fi
7866 rm -f conftest*
7867 fi
7868 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7869   echo "$ac_t""yes" 1>&6
7870     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7871   cat >> confdefs.h <<EOF
7872 #define $ac_tr_hdr 1
7873 EOF
7874  
7875 else
7876   echo "$ac_t""no" 1>&6
7877 fi
7878 done
7879
7880  echo $ac_n "checking for db""... $ac_c" 1>&6
7881 echo "configure:7882: checking for db" >&5
7882 if eval "test \"`echo '$''{'ol_cv_mdbm'+set}'`\" = set"; then
7883   echo $ac_n "(cached) $ac_c" 1>&6
7884 else
7885   
7886         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
7887                 ol_cv_mdbm=no
7888         else
7889                 ol_cv_mdbm=yes
7890         fi
7891
7892 fi
7893
7894 echo "$ac_t""$ol_cv_mdbm" 1>&6
7895  if test $ol_cv_mdbm = yes ; then
7896         cat >> confdefs.h <<\EOF
7897 #define HAVE_MDBM 1
7898 EOF
7899
7900  fi
7901
7902
7903         if test $ol_cv_mdbm = yes ; then
7904                 ol_link_ldbm=mdbm
7905                 ol_with_ldbm_api=mdbm
7906                 if test $ol_cv_lib_mdbm != yes ; then
7907                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
7908                 fi
7909         fi
7910 fi
7911
7912 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
7913         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
7914 echo "configure:7915: checking for GDBM library" >&5
7915 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
7916   echo $ac_n "(cached) $ac_c" 1>&6
7917 else
7918         ol_LIBS="$LIBS"
7919         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
7920 echo "configure:7921: checking for gdbm_open" >&5
7921 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
7922   echo $ac_n "(cached) $ac_c" 1>&6
7923 else
7924   cat > conftest.$ac_ext <<EOF
7925 #line 7926 "configure"
7926 #include "confdefs.h"
7927 /* System header to define __stub macros and hopefully few prototypes,
7928     which can conflict with char gdbm_open(); below.  */
7929 #include <assert.h>
7930 /* Override any gcc2 internal prototype to avoid an error.  */
7931 /* We use char because int might match the return type of a gcc2
7932     builtin and then its argument prototype would still apply.  */
7933 char gdbm_open();
7934
7935 int main() {
7936
7937 /* The GNU C library defines this for functions which it implements
7938     to always fail with ENOSYS.  Some functions are actually named
7939     something starting with __ and the normal name is an alias.  */
7940 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
7941 choke me
7942 #else
7943 gdbm_open();
7944 #endif
7945
7946 ; return 0; }
7947 EOF
7948 if { (eval echo configure:7949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7949   rm -rf conftest*
7950   eval "ac_cv_func_gdbm_open=yes"
7951 else
7952   echo "configure: failed program was:" >&5
7953   cat conftest.$ac_ext >&5
7954   rm -rf conftest*
7955   eval "ac_cv_func_gdbm_open=no"
7956 fi
7957 rm -f conftest*
7958 fi
7959
7960 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
7961   echo "$ac_t""yes" 1>&6
7962   ol_cv_lib_gdbm=yes
7963 else
7964   echo "$ac_t""no" 1>&6
7965
7966                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
7967 echo "configure:7968: checking for gdbm_open in -lgdbm" >&5
7968 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
7969 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7970   echo $ac_n "(cached) $ac_c" 1>&6
7971 else
7972   ac_save_LIBS="$LIBS"
7973 LIBS="-lgdbm  $LIBS"
7974 cat > conftest.$ac_ext <<EOF
7975 #line 7976 "configure"
7976 #include "confdefs.h"
7977 /* Override any gcc2 internal prototype to avoid an error.  */
7978 /* We use char because int might match the return type of a gcc2
7979     builtin and then its argument prototype would still apply.  */
7980 char gdbm_open();
7981
7982 int main() {
7983 gdbm_open()
7984 ; return 0; }
7985 EOF
7986 if { (eval echo configure:7987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7987   rm -rf conftest*
7988   eval "ac_cv_lib_$ac_lib_var=yes"
7989 else
7990   echo "configure: failed program was:" >&5
7991   cat conftest.$ac_ext >&5
7992   rm -rf conftest*
7993   eval "ac_cv_lib_$ac_lib_var=no"
7994 fi
7995 rm -f conftest*
7996 LIBS="$ac_save_LIBS"
7997
7998 fi
7999 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8000   echo "$ac_t""yes" 1>&6
8001   ol_cv_lib_gdbm=-lgdbm
8002 else
8003   echo "$ac_t""no" 1>&6
8004 ol_cv_lib_gdbm=no
8005 fi
8006
8007         
8008 fi
8009
8010         LIBS="$ol_LIBS"
8011
8012 fi
8013
8014 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
8015
8016
8017  for ac_hdr in gdbm.h
8018 do
8019 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8020 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8021 echo "configure:8022: checking for $ac_hdr" >&5
8022 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8023   echo $ac_n "(cached) $ac_c" 1>&6
8024 else
8025   cat > conftest.$ac_ext <<EOF
8026 #line 8027 "configure"
8027 #include "confdefs.h"
8028 #include <$ac_hdr>
8029 EOF
8030 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8031 { (eval echo configure:8032: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8032 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8033 if test -z "$ac_err"; then
8034   rm -rf conftest*
8035   eval "ac_cv_header_$ac_safe=yes"
8036 else
8037   echo "$ac_err" >&5
8038   echo "configure: failed program was:" >&5
8039   cat conftest.$ac_ext >&5
8040   rm -rf conftest*
8041   eval "ac_cv_header_$ac_safe=no"
8042 fi
8043 rm -f conftest*
8044 fi
8045 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8046   echo "$ac_t""yes" 1>&6
8047     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8048   cat >> confdefs.h <<EOF
8049 #define $ac_tr_hdr 1
8050 EOF
8051  
8052 else
8053   echo "$ac_t""no" 1>&6
8054 fi
8055 done
8056
8057  echo $ac_n "checking for db""... $ac_c" 1>&6
8058 echo "configure:8059: checking for db" >&5
8059 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
8060   echo $ac_n "(cached) $ac_c" 1>&6
8061 else
8062   
8063         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
8064                 ol_cv_gdbm=no
8065         else
8066                 ol_cv_gdbm=yes
8067         fi
8068
8069 fi
8070
8071 echo "$ac_t""$ol_cv_gdbm" 1>&6
8072  if test $ol_cv_gdbm = yes ; then
8073         cat >> confdefs.h <<\EOF
8074 #define HAVE_GDBM 1
8075 EOF
8076
8077  fi
8078
8079
8080         if test $ol_cv_gdbm = yes ; then
8081                 ol_link_ldbm=gdbm
8082                 ol_with_ldbm_api=gdbm
8083
8084                 if test $ol_cv_lib_gdbm != yes ; then
8085                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
8086                 fi
8087         fi
8088 fi
8089
8090 if test $ol_with_ldbm_api = auto ; then
8091         echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
8092 elif test $ol_with_ldbm_api = ndbm ; then
8093         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
8094 echo "configure:8095: checking for NDBM library" >&5
8095 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
8096   echo $ac_n "(cached) $ac_c" 1>&6
8097 else
8098         ol_LIBS="$LIBS"
8099         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
8100 echo "configure:8101: checking for dbm_open" >&5
8101 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
8102   echo $ac_n "(cached) $ac_c" 1>&6
8103 else
8104   cat > conftest.$ac_ext <<EOF
8105 #line 8106 "configure"
8106 #include "confdefs.h"
8107 /* System header to define __stub macros and hopefully few prototypes,
8108     which can conflict with char dbm_open(); below.  */
8109 #include <assert.h>
8110 /* Override any gcc2 internal prototype to avoid an error.  */
8111 /* We use char because int might match the return type of a gcc2
8112     builtin and then its argument prototype would still apply.  */
8113 char dbm_open();
8114
8115 int main() {
8116
8117 /* The GNU C library defines this for functions which it implements
8118     to always fail with ENOSYS.  Some functions are actually named
8119     something starting with __ and the normal name is an alias.  */
8120 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
8121 choke me
8122 #else
8123 dbm_open();
8124 #endif
8125
8126 ; return 0; }
8127 EOF
8128 if { (eval echo configure:8129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8129   rm -rf conftest*
8130   eval "ac_cv_func_dbm_open=yes"
8131 else
8132   echo "configure: failed program was:" >&5
8133   cat conftest.$ac_ext >&5
8134   rm -rf conftest*
8135   eval "ac_cv_func_dbm_open=no"
8136 fi
8137 rm -f conftest*
8138 fi
8139
8140 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
8141   echo "$ac_t""yes" 1>&6
8142   ol_cv_lib_ndbm=yes
8143 else
8144   echo "$ac_t""no" 1>&6
8145
8146                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
8147 echo "configure:8148: checking for dbm_open in -lndbm" >&5
8148 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
8149 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8150   echo $ac_n "(cached) $ac_c" 1>&6
8151 else
8152   ac_save_LIBS="$LIBS"
8153 LIBS="-lndbm  $LIBS"
8154 cat > conftest.$ac_ext <<EOF
8155 #line 8156 "configure"
8156 #include "confdefs.h"
8157 /* Override any gcc2 internal prototype to avoid an error.  */
8158 /* We use char because int might match the return type of a gcc2
8159     builtin and then its argument prototype would still apply.  */
8160 char dbm_open();
8161
8162 int main() {
8163 dbm_open()
8164 ; return 0; }
8165 EOF
8166 if { (eval echo configure:8167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8167   rm -rf conftest*
8168   eval "ac_cv_lib_$ac_lib_var=yes"
8169 else
8170   echo "configure: failed program was:" >&5
8171   cat conftest.$ac_ext >&5
8172   rm -rf conftest*
8173   eval "ac_cv_lib_$ac_lib_var=no"
8174 fi
8175 rm -f conftest*
8176 LIBS="$ac_save_LIBS"
8177
8178 fi
8179 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8180   echo "$ac_t""yes" 1>&6
8181   ol_cv_lib_ndbm=-lndbm
8182 else
8183   echo "$ac_t""no" 1>&6
8184
8185                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
8186 echo "configure:8187: checking for dbm_open in -ldbm" >&5
8187 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
8188 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8189   echo $ac_n "(cached) $ac_c" 1>&6
8190 else
8191   ac_save_LIBS="$LIBS"
8192 LIBS="-ldbm  $LIBS"
8193 cat > conftest.$ac_ext <<EOF
8194 #line 8195 "configure"
8195 #include "confdefs.h"
8196 /* Override any gcc2 internal prototype to avoid an error.  */
8197 /* We use char because int might match the return type of a gcc2
8198     builtin and then its argument prototype would still apply.  */
8199 char dbm_open();
8200
8201 int main() {
8202 dbm_open()
8203 ; return 0; }
8204 EOF
8205 if { (eval echo configure:8206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8206   rm -rf conftest*
8207   eval "ac_cv_lib_$ac_lib_var=yes"
8208 else
8209   echo "configure: failed program was:" >&5
8210   cat conftest.$ac_ext >&5
8211   rm -rf conftest*
8212   eval "ac_cv_lib_$ac_lib_var=no"
8213 fi
8214 rm -f conftest*
8215 LIBS="$ac_save_LIBS"
8216
8217 fi
8218 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8219   echo "$ac_t""yes" 1>&6
8220   ol_cv_lib_ndbm=-ldbm
8221 else
8222   echo "$ac_t""no" 1>&6
8223 ol_cv_lib_ndbm=no
8224 fi
8225                 
8226 fi
8227
8228         
8229 fi
8230
8231         LIBS="$ol_LIBS"
8232
8233 fi
8234
8235 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
8236
8237
8238  for ac_hdr in ndbm.h
8239 do
8240 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8241 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8242 echo "configure:8243: checking for $ac_hdr" >&5
8243 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8244   echo $ac_n "(cached) $ac_c" 1>&6
8245 else
8246   cat > conftest.$ac_ext <<EOF
8247 #line 8248 "configure"
8248 #include "confdefs.h"
8249 #include <$ac_hdr>
8250 EOF
8251 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8252 { (eval echo configure:8253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8253 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8254 if test -z "$ac_err"; then
8255   rm -rf conftest*
8256   eval "ac_cv_header_$ac_safe=yes"
8257 else
8258   echo "$ac_err" >&5
8259   echo "configure: failed program was:" >&5
8260   cat conftest.$ac_ext >&5
8261   rm -rf conftest*
8262   eval "ac_cv_header_$ac_safe=no"
8263 fi
8264 rm -f conftest*
8265 fi
8266 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8267   echo "$ac_t""yes" 1>&6
8268     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8269   cat >> confdefs.h <<EOF
8270 #define $ac_tr_hdr 1
8271 EOF
8272  
8273 else
8274   echo "$ac_t""no" 1>&6
8275 fi
8276 done
8277
8278  echo $ac_n "checking for db""... $ac_c" 1>&6
8279 echo "configure:8280: checking for db" >&5
8280 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
8281   echo $ac_n "(cached) $ac_c" 1>&6
8282 else
8283   
8284         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
8285                 ol_cv_ndbm=no
8286         else
8287                 ol_cv_ndbm=yes
8288         fi
8289
8290 fi
8291
8292 echo "$ac_t""$ol_cv_ndbm" 1>&6
8293  if test $ol_cv_ndbm = yes ; then
8294         cat >> confdefs.h <<\EOF
8295 #define HAVE_NDBM 1
8296 EOF
8297
8298  fi
8299
8300
8301         if test $ol_cv_ndbm = yes ; then
8302                 ol_link_ldbm=ndbm
8303                 ol_with_ldbm_api=ndbm
8304
8305                 if test $ol_cv_lib_ndbm != yes ; then
8306                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
8307                 fi
8308         fi
8309 fi
8310
8311 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
8312         echo "configure: warning: could not find suitable LDBM backend" 1>&2
8313         if test $ol_enable_ldbm = yes ; then
8314                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
8315         fi
8316
8317         echo "configure: warning: disabling LDBM" 1>&2
8318         ol_enable_ldbm=no
8319 fi
8320
8321 if test $ol_enable_wrappers != no ; then
8322         for ac_hdr in tcpd.h
8323 do
8324 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8325 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8326 echo "configure:8327: checking for $ac_hdr" >&5
8327 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8328   echo $ac_n "(cached) $ac_c" 1>&6
8329 else
8330   cat > conftest.$ac_ext <<EOF
8331 #line 8332 "configure"
8332 #include "confdefs.h"
8333 #include <$ac_hdr>
8334 EOF
8335 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8336 { (eval echo configure:8337: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8337 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8338 if test -z "$ac_err"; then
8339   rm -rf conftest*
8340   eval "ac_cv_header_$ac_safe=yes"
8341 else
8342   echo "$ac_err" >&5
8343   echo "configure: failed program was:" >&5
8344   cat conftest.$ac_ext >&5
8345   rm -rf conftest*
8346   eval "ac_cv_header_$ac_safe=no"
8347 fi
8348 rm -f conftest*
8349 fi
8350 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8351   echo "$ac_t""yes" 1>&6
8352     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8353   cat >> confdefs.h <<EOF
8354 #define $ac_tr_hdr 1
8355 EOF
8356  
8357 else
8358   echo "$ac_t""no" 1>&6
8359 fi
8360 done
8361
8362
8363         if test $ac_cv_header_tcpd_h != yes ; then
8364                 have_wrappers=no
8365         else
8366                 echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
8367 echo "configure:8368: checking for main in -lwrap" >&5
8368 ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'`
8369 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8370   echo $ac_n "(cached) $ac_c" 1>&6
8371 else
8372   ac_save_LIBS="$LIBS"
8373 LIBS="-lwrap  $LIBS"
8374 cat > conftest.$ac_ext <<EOF
8375 #line 8376 "configure"
8376 #include "confdefs.h"
8377
8378 int main() {
8379 main()
8380 ; return 0; }
8381 EOF
8382 if { (eval echo configure:8383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8383   rm -rf conftest*
8384   eval "ac_cv_lib_$ac_lib_var=yes"
8385 else
8386   echo "configure: failed program was:" >&5
8387   cat conftest.$ac_ext >&5
8388   rm -rf conftest*
8389   eval "ac_cv_lib_$ac_lib_var=no"
8390 fi
8391 rm -f conftest*
8392 LIBS="$ac_save_LIBS"
8393
8394 fi
8395 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8396   echo "$ac_t""yes" 1>&6
8397   have_wrappers=yes
8398 else
8399   echo "$ac_t""no" 1>&6
8400 have_wrappers=no
8401 fi
8402
8403         fi
8404
8405         if test $have_wrappers = yes ; then
8406                 cat >> confdefs.h <<\EOF
8407 #define HAVE_TCPD 1
8408 EOF
8409
8410                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
8411
8412                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
8413 echo "configure:8414: checking for main in -lnsl" >&5
8414 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
8415 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8416   echo $ac_n "(cached) $ac_c" 1>&6
8417 else
8418   ac_save_LIBS="$LIBS"
8419 LIBS="-lnsl  $LIBS"
8420 cat > conftest.$ac_ext <<EOF
8421 #line 8422 "configure"
8422 #include "confdefs.h"
8423
8424 int main() {
8425 main()
8426 ; return 0; }
8427 EOF
8428 if { (eval echo configure:8429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8429   rm -rf conftest*
8430   eval "ac_cv_lib_$ac_lib_var=yes"
8431 else
8432   echo "configure: failed program was:" >&5
8433   cat conftest.$ac_ext >&5
8434   rm -rf conftest*
8435   eval "ac_cv_lib_$ac_lib_var=no"
8436 fi
8437 rm -f conftest*
8438 LIBS="$ac_save_LIBS"
8439
8440 fi
8441 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8442   echo "$ac_t""yes" 1>&6
8443     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8444     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8445   cat >> confdefs.h <<EOF
8446 #define $ac_tr_lib 1
8447 EOF
8448
8449   LIBS="-lnsl $LIBS"
8450
8451 else
8452   echo "$ac_t""no" 1>&6
8453 fi
8454
8455         else
8456                 echo "configure: warning: could not find -lwrap" 1>&2
8457                 if test $ol_enable_wrappers = yes ; then
8458                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
8459                 fi
8460
8461                 echo "configure: warning: disabling wrappers support" 1>&2
8462                 ol_enable_wrappers=no
8463         fi
8464 fi
8465
8466 if test $ol_enable_syslog != no ; then
8467         echo $ac_n "checking for openlog""... $ac_c" 1>&6
8468 echo "configure:8469: checking for openlog" >&5
8469 if eval "test \"`echo '$''{'ac_cv_func_openlog'+set}'`\" = set"; then
8470   echo $ac_n "(cached) $ac_c" 1>&6
8471 else
8472   cat > conftest.$ac_ext <<EOF
8473 #line 8474 "configure"
8474 #include "confdefs.h"
8475 /* System header to define __stub macros and hopefully few prototypes,
8476     which can conflict with char openlog(); below.  */
8477 #include <assert.h>
8478 /* Override any gcc2 internal prototype to avoid an error.  */
8479 /* We use char because int might match the return type of a gcc2
8480     builtin and then its argument prototype would still apply.  */
8481 char openlog();
8482
8483 int main() {
8484
8485 /* The GNU C library defines this for functions which it implements
8486     to always fail with ENOSYS.  Some functions are actually named
8487     something starting with __ and the normal name is an alias.  */
8488 #if defined (__stub_openlog) || defined (__stub___openlog)
8489 choke me
8490 #else
8491 openlog();
8492 #endif
8493
8494 ; return 0; }
8495 EOF
8496 if { (eval echo configure:8497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8497   rm -rf conftest*
8498   eval "ac_cv_func_openlog=yes"
8499 else
8500   echo "configure: failed program was:" >&5
8501   cat conftest.$ac_ext >&5
8502   rm -rf conftest*
8503   eval "ac_cv_func_openlog=no"
8504 fi
8505 rm -f conftest*
8506 fi
8507
8508 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
8509   echo "$ac_t""yes" 1>&6
8510   :
8511 else
8512   echo "$ac_t""no" 1>&6
8513 fi
8514
8515         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
8516                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
8517         fi
8518         ol_enable_syslog=$ac_cv_func_openlog
8519 fi
8520
8521 if test $ol_enable_dmalloc != no ; then
8522         for ac_hdr in dmalloc.h
8523 do
8524 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8525 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8526 echo "configure:8527: checking for $ac_hdr" >&5
8527 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8528   echo $ac_n "(cached) $ac_c" 1>&6
8529 else
8530   cat > conftest.$ac_ext <<EOF
8531 #line 8532 "configure"
8532 #include "confdefs.h"
8533 #include <$ac_hdr>
8534 EOF
8535 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8536 { (eval echo configure:8537: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8537 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8538 if test -z "$ac_err"; then
8539   rm -rf conftest*
8540   eval "ac_cv_header_$ac_safe=yes"
8541 else
8542   echo "$ac_err" >&5
8543   echo "configure: failed program was:" >&5
8544   cat conftest.$ac_ext >&5
8545   rm -rf conftest*
8546   eval "ac_cv_header_$ac_safe=no"
8547 fi
8548 rm -f conftest*
8549 fi
8550 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8551   echo "$ac_t""yes" 1>&6
8552     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8553   cat >> confdefs.h <<EOF
8554 #define $ac_tr_hdr 1
8555 EOF
8556  
8557 else
8558   echo "$ac_t""no" 1>&6
8559 fi
8560 done
8561
8562         echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
8563 echo "configure:8564: checking for dmalloc_shutdown in -ldmalloc" >&5
8564 ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-%__p_%'`
8565 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8566   echo $ac_n "(cached) $ac_c" 1>&6
8567 else
8568   ac_save_LIBS="$LIBS"
8569 LIBS="-ldmalloc  $LIBS"
8570 cat > conftest.$ac_ext <<EOF
8571 #line 8572 "configure"
8572 #include "confdefs.h"
8573 /* Override any gcc2 internal prototype to avoid an error.  */
8574 /* We use char because int might match the return type of a gcc2
8575     builtin and then its argument prototype would still apply.  */
8576 char dmalloc_shutdown();
8577
8578 int main() {
8579 dmalloc_shutdown()
8580 ; return 0; }
8581 EOF
8582 if { (eval echo configure:8583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8583   rm -rf conftest*
8584   eval "ac_cv_lib_$ac_lib_var=yes"
8585 else
8586   echo "configure: failed program was:" >&5
8587   cat conftest.$ac_ext >&5
8588   rm -rf conftest*
8589   eval "ac_cv_lib_$ac_lib_var=no"
8590 fi
8591 rm -f conftest*
8592 LIBS="$ac_save_LIBS"
8593
8594 fi
8595 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8596   echo "$ac_t""yes" 1>&6
8597     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8598     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8599   cat >> confdefs.h <<EOF
8600 #define $ac_tr_lib 1
8601 EOF
8602
8603   LIBS="-ldmalloc $LIBS"
8604
8605 else
8606   echo "$ac_t""no" 1>&6
8607 fi
8608
8609 fi
8610
8611 if test $ol_enable_tcl != no ; then
8612         for ac_hdr in tcl.h
8613 do
8614 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8615 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8616 echo "configure:8617: checking for $ac_hdr" >&5
8617 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8618   echo $ac_n "(cached) $ac_c" 1>&6
8619 else
8620   cat > conftest.$ac_ext <<EOF
8621 #line 8622 "configure"
8622 #include "confdefs.h"
8623 #include <$ac_hdr>
8624 EOF
8625 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8626 { (eval echo configure:8627: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8627 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8628 if test -z "$ac_err"; then
8629   rm -rf conftest*
8630   eval "ac_cv_header_$ac_safe=yes"
8631 else
8632   echo "$ac_err" >&5
8633   echo "configure: failed program was:" >&5
8634   cat conftest.$ac_ext >&5
8635   rm -rf conftest*
8636   eval "ac_cv_header_$ac_safe=no"
8637 fi
8638 rm -f conftest*
8639 fi
8640 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8641   echo "$ac_t""yes" 1>&6
8642     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8643   cat >> confdefs.h <<EOF
8644 #define $ac_tr_hdr 1
8645 EOF
8646  
8647 else
8648   echo "$ac_t""no" 1>&6
8649 fi
8650 done
8651
8652
8653         if test $ac_cv_header_tcl_h != yes ; then
8654                 have_tcl=no
8655         else
8656                 echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6
8657 echo "configure:8658: checking for main in -ltcl" >&5
8658 ac_lib_var=`echo tcl'_'main | sed 'y%./+-%__p_%'`
8659 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8660   echo $ac_n "(cached) $ac_c" 1>&6
8661 else
8662   ac_save_LIBS="$LIBS"
8663 LIBS="-ltcl  $LIBS"
8664 cat > conftest.$ac_ext <<EOF
8665 #line 8666 "configure"
8666 #include "confdefs.h"
8667
8668 int main() {
8669 main()
8670 ; return 0; }
8671 EOF
8672 if { (eval echo configure:8673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8673   rm -rf conftest*
8674   eval "ac_cv_lib_$ac_lib_var=yes"
8675 else
8676   echo "configure: failed program was:" >&5
8677   cat conftest.$ac_ext >&5
8678   rm -rf conftest*
8679   eval "ac_cv_lib_$ac_lib_var=no"
8680 fi
8681 rm -f conftest*
8682 LIBS="$ac_save_LIBS"
8683
8684 fi
8685 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8686   echo "$ac_t""yes" 1>&6
8687   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"
8688 else
8689   echo "$ac_t""no" 1>&6
8690 have_tcl=no
8691 fi
8692
8693
8694                 if test $have_tcl != yes; then
8695                         echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6
8696 echo "configure:8697: checking for main in -ltcl7.6" >&5
8697 ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-%__p_%'`
8698 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8699   echo $ac_n "(cached) $ac_c" 1>&6
8700 else
8701   ac_save_LIBS="$LIBS"
8702 LIBS="-ltcl7.6  $LIBS"
8703 cat > conftest.$ac_ext <<EOF
8704 #line 8705 "configure"
8705 #include "confdefs.h"
8706
8707 int main() {
8708 main()
8709 ; return 0; }
8710 EOF
8711 if { (eval echo configure:8712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8712   rm -rf conftest*
8713   eval "ac_cv_lib_$ac_lib_var=yes"
8714 else
8715   echo "configure: failed program was:" >&5
8716   cat conftest.$ac_ext >&5
8717   rm -rf conftest*
8718   eval "ac_cv_lib_$ac_lib_var=no"
8719 fi
8720 rm -f conftest*
8721 LIBS="$ac_save_LIBS"
8722
8723 fi
8724 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8725   echo "$ac_t""yes" 1>&6
8726   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"
8727 else
8728   echo "$ac_t""no" 1>&6
8729 have_tcl=no
8730 fi
8731
8732                 fi
8733
8734                 if test $have_tcl != yes; then
8735                         echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6
8736 echo "configure:8737: checking for main in -ltcl8.0" >&5
8737 ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-%__p_%'`
8738 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8739   echo $ac_n "(cached) $ac_c" 1>&6
8740 else
8741   ac_save_LIBS="$LIBS"
8742 LIBS="-ltcl8.0  $LIBS"
8743 cat > conftest.$ac_ext <<EOF
8744 #line 8745 "configure"
8745 #include "confdefs.h"
8746
8747 int main() {
8748 main()
8749 ; return 0; }
8750 EOF
8751 if { (eval echo configure:8752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8752   rm -rf conftest*
8753   eval "ac_cv_lib_$ac_lib_var=yes"
8754 else
8755   echo "configure: failed program was:" >&5
8756   cat conftest.$ac_ext >&5
8757   rm -rf conftest*
8758   eval "ac_cv_lib_$ac_lib_var=no"
8759 fi
8760 rm -f conftest*
8761 LIBS="$ac_save_LIBS"
8762
8763 fi
8764 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8765   echo "$ac_t""yes" 1>&6
8766   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"
8767 else
8768   echo "$ac_t""no" 1>&6
8769 have_tcl=no
8770 fi
8771
8772                 fi
8773         fi
8774
8775         if test $have_tcl != yes ; then
8776                 echo "configure: warning: could not find -ltcl" 1>&2
8777                 if test $ol_enable_tcl = yes ; then
8778                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
8779                 fi
8780
8781                 ol_enable_tcl=no
8782         fi
8783 fi
8784
8785 # ud needs termcap (should insert check here)
8786 ol_link_termcap=no
8787 for ac_hdr in termcap.h ncurses.h
8788 do
8789 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8790 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8791 echo "configure:8792: checking for $ac_hdr" >&5
8792 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8793   echo $ac_n "(cached) $ac_c" 1>&6
8794 else
8795   cat > conftest.$ac_ext <<EOF
8796 #line 8797 "configure"
8797 #include "confdefs.h"
8798 #include <$ac_hdr>
8799 EOF
8800 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8801 { (eval echo configure:8802: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8802 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8803 if test -z "$ac_err"; then
8804   rm -rf conftest*
8805   eval "ac_cv_header_$ac_safe=yes"
8806 else
8807   echo "$ac_err" >&5
8808   echo "configure: failed program was:" >&5
8809   cat conftest.$ac_ext >&5
8810   rm -rf conftest*
8811   eval "ac_cv_header_$ac_safe=no"
8812 fi
8813 rm -f conftest*
8814 fi
8815 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8816   echo "$ac_t""yes" 1>&6
8817     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8818   cat >> confdefs.h <<EOF
8819 #define $ac_tr_hdr 1
8820 EOF
8821  
8822 else
8823   echo "$ac_t""no" 1>&6
8824 fi
8825 done
8826
8827
8828 if test $ol_link_termcap = no ; then
8829         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
8830 echo "configure:8831: checking for tputs in -ltermcap" >&5
8831 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
8832 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8833   echo $ac_n "(cached) $ac_c" 1>&6
8834 else
8835   ac_save_LIBS="$LIBS"
8836 LIBS="-ltermcap  $LIBS"
8837 cat > conftest.$ac_ext <<EOF
8838 #line 8839 "configure"
8839 #include "confdefs.h"
8840 /* Override any gcc2 internal prototype to avoid an error.  */
8841 /* We use char because int might match the return type of a gcc2
8842     builtin and then its argument prototype would still apply.  */
8843 char tputs();
8844
8845 int main() {
8846 tputs()
8847 ; return 0; }
8848 EOF
8849 if { (eval echo configure:8850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8850   rm -rf conftest*
8851   eval "ac_cv_lib_$ac_lib_var=yes"
8852 else
8853   echo "configure: failed program was:" >&5
8854   cat conftest.$ac_ext >&5
8855   rm -rf conftest*
8856   eval "ac_cv_lib_$ac_lib_var=no"
8857 fi
8858 rm -f conftest*
8859 LIBS="$ac_save_LIBS"
8860
8861 fi
8862 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8863   echo "$ac_t""yes" 1>&6
8864   have_termcap=yes
8865 else
8866   echo "$ac_t""no" 1>&6
8867 have_termcap=no
8868 fi
8869
8870         if test $have_termcap = yes ; then
8871                 cat >> confdefs.h <<\EOF
8872 #define HAVE_TERMCAP 1
8873 EOF
8874
8875                 ol_link_termcap=yes
8876                 TERMCAP_LIBS=-ltermcap
8877         fi
8878 fi
8879
8880 if test $ol_link_termcap = no ; then
8881         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
8882 echo "configure:8883: checking for initscr in -lncurses" >&5
8883 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
8884 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8885   echo $ac_n "(cached) $ac_c" 1>&6
8886 else
8887   ac_save_LIBS="$LIBS"
8888 LIBS="-lncurses  $LIBS"
8889 cat > conftest.$ac_ext <<EOF
8890 #line 8891 "configure"
8891 #include "confdefs.h"
8892 /* Override any gcc2 internal prototype to avoid an error.  */
8893 /* We use char because int might match the return type of a gcc2
8894     builtin and then its argument prototype would still apply.  */
8895 char initscr();
8896
8897 int main() {
8898 initscr()
8899 ; return 0; }
8900 EOF
8901 if { (eval echo configure:8902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8902   rm -rf conftest*
8903   eval "ac_cv_lib_$ac_lib_var=yes"
8904 else
8905   echo "configure: failed program was:" >&5
8906   cat conftest.$ac_ext >&5
8907   rm -rf conftest*
8908   eval "ac_cv_lib_$ac_lib_var=no"
8909 fi
8910 rm -f conftest*
8911 LIBS="$ac_save_LIBS"
8912
8913 fi
8914 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8915   echo "$ac_t""yes" 1>&6
8916   have_ncurses=yes
8917 else
8918   echo "$ac_t""no" 1>&6
8919 have_ncurses=no
8920 fi
8921
8922         if test $have_ncurses = yes ; then
8923                 cat >> confdefs.h <<\EOF
8924 #define HAVE_NCURSES 1
8925 EOF
8926
8927                 ol_link_termcap=yes
8928                 TERMCAP_LIBS=-lncurses
8929         fi
8930 fi
8931
8932 if test $ol_link_termcap = no ; then
8933         cat >> confdefs.h <<\EOF
8934 #define NO_TERMCAP 1
8935 EOF
8936
8937         TERMCAP_LIBS=
8938 fi
8939
8940 ol_link_readline=no
8941 if test $ol_with_readline != no ; then
8942         for ac_hdr in readline/readline.h readline/history.h
8943 do
8944 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8945 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8946 echo "configure:8947: checking for $ac_hdr" >&5
8947 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8948   echo $ac_n "(cached) $ac_c" 1>&6
8949 else
8950   cat > conftest.$ac_ext <<EOF
8951 #line 8952 "configure"
8952 #include "confdefs.h"
8953 #include <$ac_hdr>
8954 EOF
8955 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8956 { (eval echo configure:8957: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8957 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8958 if test -z "$ac_err"; then
8959   rm -rf conftest*
8960   eval "ac_cv_header_$ac_safe=yes"
8961 else
8962   echo "$ac_err" >&5
8963   echo "configure: failed program was:" >&5
8964   cat conftest.$ac_ext >&5
8965   rm -rf conftest*
8966   eval "ac_cv_header_$ac_safe=no"
8967 fi
8968 rm -f conftest*
8969 fi
8970 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8971   echo "$ac_t""yes" 1>&6
8972     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8973   cat >> confdefs.h <<EOF
8974 #define $ac_tr_hdr 1
8975 EOF
8976  
8977 else
8978   echo "$ac_t""no" 1>&6
8979 fi
8980 done
8981
8982
8983         if test $ac_cv_header_readline_readline_h = yes ; then
8984                 save_LIBS="$LIBS"
8985                 LIBS="$TERMCAP_LIBS $LIBS"
8986                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
8987 echo "configure:8988: checking for readline in -lreadline" >&5
8988 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`
8989 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8990   echo $ac_n "(cached) $ac_c" 1>&6
8991 else
8992   ac_save_LIBS="$LIBS"
8993 LIBS="-lreadline  $LIBS"
8994 cat > conftest.$ac_ext <<EOF
8995 #line 8996 "configure"
8996 #include "confdefs.h"
8997 /* Override any gcc2 internal prototype to avoid an error.  */
8998 /* We use char because int might match the return type of a gcc2
8999     builtin and then its argument prototype would still apply.  */
9000 char readline();
9001
9002 int main() {
9003 readline()
9004 ; return 0; }
9005 EOF
9006 if { (eval echo configure:9007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9007   rm -rf conftest*
9008   eval "ac_cv_lib_$ac_lib_var=yes"
9009 else
9010   echo "configure: failed program was:" >&5
9011   cat conftest.$ac_ext >&5
9012   rm -rf conftest*
9013   eval "ac_cv_lib_$ac_lib_var=no"
9014 fi
9015 rm -f conftest*
9016 LIBS="$ac_save_LIBS"
9017
9018 fi
9019 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9020   echo "$ac_t""yes" 1>&6
9021   have_readline=yes
9022 else
9023   echo "$ac_t""no" 1>&6
9024 have_readline=no
9025 fi
9026
9027                 LIBS="$save_LIBS"
9028                         
9029                 if test $have_readline = yes ; then
9030                         ol_with_readline=found
9031                         ol_link_readline=yes
9032
9033                         READLINE_LIBS="-lreadline"
9034                 fi
9035         fi
9036 fi
9037
9038 if test $ol_link_readline = yes ; then
9039         cat >> confdefs.h <<\EOF
9040 #define HAVE_READLINE 1
9041 EOF
9042
9043 fi
9044
9045
9046 # FreeBSD (and others) have crypt(3) in -lcrypt
9047 if test $ol_enable_crypt != no ; then
9048         echo $ac_n "checking for crypt""... $ac_c" 1>&6
9049 echo "configure:9050: checking for crypt" >&5
9050 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
9051   echo $ac_n "(cached) $ac_c" 1>&6
9052 else
9053   cat > conftest.$ac_ext <<EOF
9054 #line 9055 "configure"
9055 #include "confdefs.h"
9056 /* System header to define __stub macros and hopefully few prototypes,
9057     which can conflict with char crypt(); below.  */
9058 #include <assert.h>
9059 /* Override any gcc2 internal prototype to avoid an error.  */
9060 /* We use char because int might match the return type of a gcc2
9061     builtin and then its argument prototype would still apply.  */
9062 char crypt();
9063
9064 int main() {
9065
9066 /* The GNU C library defines this for functions which it implements
9067     to always fail with ENOSYS.  Some functions are actually named
9068     something starting with __ and the normal name is an alias.  */
9069 #if defined (__stub_crypt) || defined (__stub___crypt)
9070 choke me
9071 #else
9072 crypt();
9073 #endif
9074
9075 ; return 0; }
9076 EOF
9077 if { (eval echo configure:9078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9078   rm -rf conftest*
9079   eval "ac_cv_func_crypt=yes"
9080 else
9081   echo "configure: failed program was:" >&5
9082   cat conftest.$ac_ext >&5
9083   rm -rf conftest*
9084   eval "ac_cv_func_crypt=no"
9085 fi
9086 rm -f conftest*
9087 fi
9088
9089 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
9090   echo "$ac_t""yes" 1>&6
9091   have_crypt=yes
9092 else
9093   echo "$ac_t""no" 1>&6
9094
9095                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
9096 echo "configure:9097: checking for crypt in -lcrypt" >&5
9097 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
9098 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9099   echo $ac_n "(cached) $ac_c" 1>&6
9100 else
9101   ac_save_LIBS="$LIBS"
9102 LIBS="-lcrypt  $LIBS"
9103 cat > conftest.$ac_ext <<EOF
9104 #line 9105 "configure"
9105 #include "confdefs.h"
9106 /* Override any gcc2 internal prototype to avoid an error.  */
9107 /* We use char because int might match the return type of a gcc2
9108     builtin and then its argument prototype would still apply.  */
9109 char crypt();
9110
9111 int main() {
9112 crypt()
9113 ; return 0; }
9114 EOF
9115 if { (eval echo configure:9116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9116   rm -rf conftest*
9117   eval "ac_cv_lib_$ac_lib_var=yes"
9118 else
9119   echo "configure: failed program was:" >&5
9120   cat conftest.$ac_ext >&5
9121   rm -rf conftest*
9122   eval "ac_cv_lib_$ac_lib_var=no"
9123 fi
9124 rm -f conftest*
9125 LIBS="$ac_save_LIBS"
9126
9127 fi
9128 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9129   echo "$ac_t""yes" 1>&6
9130   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
9131                         have_crypt=yes
9132 else
9133   echo "$ac_t""no" 1>&6
9134 have_crypt=no
9135 fi
9136
9137 fi
9138
9139
9140         if test $have_crypt = yes ; then
9141                 cat >> confdefs.h <<\EOF
9142 #define HAVE_CRYPT 1
9143 EOF
9144
9145         else
9146                 echo "configure: warning: could not find crypt" 1>&2
9147                 if test $ol_enable_crypt = yes ; then
9148                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
9149                 fi
9150
9151                 echo "configure: warning: disabling crypt support" 1>&2
9152                 ol_enable_crypt=no
9153         fi
9154 fi
9155
9156 # FreeBSD (and others) have setproctitle(3) in -lutil
9157 if test $ol_enable_proctitle != no ; then
9158         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
9159 echo "configure:9160: checking for setproctitle" >&5
9160 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
9161   echo $ac_n "(cached) $ac_c" 1>&6
9162 else
9163   cat > conftest.$ac_ext <<EOF
9164 #line 9165 "configure"
9165 #include "confdefs.h"
9166 /* System header to define __stub macros and hopefully few prototypes,
9167     which can conflict with char setproctitle(); below.  */
9168 #include <assert.h>
9169 /* Override any gcc2 internal prototype to avoid an error.  */
9170 /* We use char because int might match the return type of a gcc2
9171     builtin and then its argument prototype would still apply.  */
9172 char setproctitle();
9173
9174 int main() {
9175
9176 /* The GNU C library defines this for functions which it implements
9177     to always fail with ENOSYS.  Some functions are actually named
9178     something starting with __ and the normal name is an alias.  */
9179 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
9180 choke me
9181 #else
9182 setproctitle();
9183 #endif
9184
9185 ; return 0; }
9186 EOF
9187 if { (eval echo configure:9188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9188   rm -rf conftest*
9189   eval "ac_cv_func_setproctitle=yes"
9190 else
9191   echo "configure: failed program was:" >&5
9192   cat conftest.$ac_ext >&5
9193   rm -rf conftest*
9194   eval "ac_cv_func_setproctitle=no"
9195 fi
9196 rm -f conftest*
9197 fi
9198
9199 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
9200   echo "$ac_t""yes" 1>&6
9201   have_setproctitle=yes
9202 else
9203   echo "$ac_t""no" 1>&6
9204
9205                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
9206 echo "configure:9207: checking for setproctitle in -lutil" >&5
9207 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
9208 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9209   echo $ac_n "(cached) $ac_c" 1>&6
9210 else
9211   ac_save_LIBS="$LIBS"
9212 LIBS="-lutil  $LIBS"
9213 cat > conftest.$ac_ext <<EOF
9214 #line 9215 "configure"
9215 #include "confdefs.h"
9216 /* Override any gcc2 internal prototype to avoid an error.  */
9217 /* We use char because int might match the return type of a gcc2
9218     builtin and then its argument prototype would still apply.  */
9219 char setproctitle();
9220
9221 int main() {
9222 setproctitle()
9223 ; return 0; }
9224 EOF
9225 if { (eval echo configure:9226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9226   rm -rf conftest*
9227   eval "ac_cv_lib_$ac_lib_var=yes"
9228 else
9229   echo "configure: failed program was:" >&5
9230   cat conftest.$ac_ext >&5
9231   rm -rf conftest*
9232   eval "ac_cv_lib_$ac_lib_var=no"
9233 fi
9234 rm -f conftest*
9235 LIBS="$ac_save_LIBS"
9236
9237 fi
9238 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9239   echo "$ac_t""yes" 1>&6
9240   have_setproctitle=yes
9241                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
9242 else
9243   echo "$ac_t""no" 1>&6
9244 have_setproctitle=no
9245                         LIBOBJS="$LIBOBJS setproctitle.o"
9246 fi
9247
9248 fi
9249
9250
9251         if test $have_setproctitle = yes ; then
9252                 cat >> confdefs.h <<\EOF
9253 #define HAVE_SETPROCTITLE 1
9254 EOF
9255
9256         fi
9257 fi
9258
9259 # test for EBCDIC
9260 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
9261 echo "configure:9262: checking for EBCDIC" >&5
9262 if eval "test \"`echo '$''{'ol_cv_cpp_ebcdic'+set}'`\" = set"; then
9263   echo $ac_n "(cached) $ac_c" 1>&6
9264 else
9265   
9266         cat > conftest.$ac_ext <<EOF
9267 #line 9268 "configure"
9268 #include "confdefs.h"
9269
9270 #if !('M' == 0xd4)
9271 #include <__ASCII__/generate_error.h>
9272 #endif
9273
9274 EOF
9275 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9276 { (eval echo configure:9277: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9277 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9278 if test -z "$ac_err"; then
9279   rm -rf conftest*
9280   ol_cv_cpp_ebcdic=yes
9281 else
9282   echo "$ac_err" >&5
9283   echo "configure: failed program was:" >&5
9284   cat conftest.$ac_ext >&5
9285   rm -rf conftest*
9286   ol_cv_cpp_ebcdic=no
9287 fi
9288 rm -f conftest*
9289 fi
9290
9291 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
9292 if test $ol_cv_cpp_ebcdic = yes ; then
9293         cat >> confdefs.h <<\EOF
9294 #define HAVE_EBCDIC 1
9295 EOF
9296
9297 fi
9298
9299 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
9300 echo "configure:9301: checking for ANSI C header files" >&5
9301 if eval "test \"`echo '$''{'ol_cv_header_stdc'+set}'`\" = set"; then
9302   echo $ac_n "(cached) $ac_c" 1>&6
9303 else
9304   cat > conftest.$ac_ext <<EOF
9305 #line 9306 "configure"
9306 #include "confdefs.h"
9307 #include <stdlib.h>
9308 #include <stdarg.h>
9309 #include <string.h>
9310 #include <float.h>
9311 EOF
9312 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9313 { (eval echo configure:9314: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9314 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9315 if test -z "$ac_err"; then
9316   rm -rf conftest*
9317   ol_cv_header_stdc=yes
9318 else
9319   echo "$ac_err" >&5
9320   echo "configure: failed program was:" >&5
9321   cat conftest.$ac_ext >&5
9322   rm -rf conftest*
9323   ol_cv_header_stdc=no
9324 fi
9325 rm -f conftest*
9326
9327 if test $ol_cv_header_stdc = yes; then
9328   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
9329 cat > conftest.$ac_ext <<EOF
9330 #line 9331 "configure"
9331 #include "confdefs.h"
9332 #include <string.h>
9333 EOF
9334 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9335   egrep "memchr" >/dev/null 2>&1; then
9336   :
9337 else
9338   rm -rf conftest*
9339   ol_cv_header_stdc=no
9340 fi
9341 rm -f conftest*
9342
9343 fi
9344
9345 if test $ol_cv_header_stdc = yes; then
9346   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
9347 cat > conftest.$ac_ext <<EOF
9348 #line 9349 "configure"
9349 #include "confdefs.h"
9350 #include <stdlib.h>
9351 EOF
9352 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9353   egrep "free" >/dev/null 2>&1; then
9354   :
9355 else
9356   rm -rf conftest*
9357   ol_cv_header_stdc=no
9358 fi
9359 rm -f conftest*
9360
9361 fi
9362
9363 if test $ol_cv_header_stdc = yes; then
9364   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
9365 if test "$cross_compiling" = yes; then
9366   :
9367 else
9368   cat > conftest.$ac_ext <<EOF
9369 #line 9370 "configure"
9370 #include "confdefs.h"
9371 #include <ctype.h>
9372 #ifndef HAVE_EBCDIC
9373 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
9374 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
9375 #else
9376 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
9377                 || ('j' <= (c) && (c) <= 'r') \
9378                 || ('s' <= (c) && (c) <= 'z'))
9379 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
9380 #endif
9381 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
9382 int main () { int i; for (i = 0; i < 256; i++)
9383 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
9384 exit (0); }
9385
9386 EOF
9387 if { (eval echo configure:9388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9388 then
9389   :
9390 else
9391   echo "configure: failed program was:" >&5
9392   cat conftest.$ac_ext >&5
9393   rm -fr conftest*
9394   ol_cv_header_stdc=no
9395 fi
9396 rm -fr conftest*
9397 fi
9398
9399 fi
9400 fi
9401
9402 echo "$ac_t""$ol_cv_header_stdc" 1>&6
9403 if test $ol_cv_header_stdc = yes; then
9404   cat >> confdefs.h <<\EOF
9405 #define STDC_HEADERS 1
9406 EOF
9407
9408 fi
9409 ac_cv_header_stdc=disable
9410
9411
9412 if test $ol_cv_header_stdc != yes; then
9413         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
9414 fi
9415
9416 ac_header_dirent=no
9417 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
9418 do
9419 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9420 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
9421 echo "configure:9422: checking for $ac_hdr that defines DIR" >&5
9422 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
9423   echo $ac_n "(cached) $ac_c" 1>&6
9424 else
9425   cat > conftest.$ac_ext <<EOF
9426 #line 9427 "configure"
9427 #include "confdefs.h"
9428 #include <sys/types.h>
9429 #include <$ac_hdr>
9430 int main() {
9431 DIR *dirp = 0;
9432 ; return 0; }
9433 EOF
9434 if { (eval echo configure:9435: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9435   rm -rf conftest*
9436   eval "ac_cv_header_dirent_$ac_safe=yes"
9437 else
9438   echo "configure: failed program was:" >&5
9439   cat conftest.$ac_ext >&5
9440   rm -rf conftest*
9441   eval "ac_cv_header_dirent_$ac_safe=no"
9442 fi
9443 rm -f conftest*
9444 fi
9445 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
9446   echo "$ac_t""yes" 1>&6
9447     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9448   cat >> confdefs.h <<EOF
9449 #define $ac_tr_hdr 1
9450 EOF
9451  ac_header_dirent=$ac_hdr; break
9452 else
9453   echo "$ac_t""no" 1>&6
9454 fi
9455 done
9456 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
9457 if test $ac_header_dirent = dirent.h; then
9458 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
9459 echo "configure:9460: checking for opendir in -ldir" >&5
9460 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
9461 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9462   echo $ac_n "(cached) $ac_c" 1>&6
9463 else
9464   ac_save_LIBS="$LIBS"
9465 LIBS="-ldir  $LIBS"
9466 cat > conftest.$ac_ext <<EOF
9467 #line 9468 "configure"
9468 #include "confdefs.h"
9469 /* Override any gcc2 internal prototype to avoid an error.  */
9470 /* We use char because int might match the return type of a gcc2
9471     builtin and then its argument prototype would still apply.  */
9472 char opendir();
9473
9474 int main() {
9475 opendir()
9476 ; return 0; }
9477 EOF
9478 if { (eval echo configure:9479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9479   rm -rf conftest*
9480   eval "ac_cv_lib_$ac_lib_var=yes"
9481 else
9482   echo "configure: failed program was:" >&5
9483   cat conftest.$ac_ext >&5
9484   rm -rf conftest*
9485   eval "ac_cv_lib_$ac_lib_var=no"
9486 fi
9487 rm -f conftest*
9488 LIBS="$ac_save_LIBS"
9489
9490 fi
9491 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9492   echo "$ac_t""yes" 1>&6
9493   LIBS="$LIBS -ldir"
9494 else
9495   echo "$ac_t""no" 1>&6
9496 fi
9497
9498 else
9499 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
9500 echo "configure:9501: checking for opendir in -lx" >&5
9501 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
9502 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9503   echo $ac_n "(cached) $ac_c" 1>&6
9504 else
9505   ac_save_LIBS="$LIBS"
9506 LIBS="-lx  $LIBS"
9507 cat > conftest.$ac_ext <<EOF
9508 #line 9509 "configure"
9509 #include "confdefs.h"
9510 /* Override any gcc2 internal prototype to avoid an error.  */
9511 /* We use char because int might match the return type of a gcc2
9512     builtin and then its argument prototype would still apply.  */
9513 char opendir();
9514
9515 int main() {
9516 opendir()
9517 ; return 0; }
9518 EOF
9519 if { (eval echo configure:9520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9520   rm -rf conftest*
9521   eval "ac_cv_lib_$ac_lib_var=yes"
9522 else
9523   echo "configure: failed program was:" >&5
9524   cat conftest.$ac_ext >&5
9525   rm -rf conftest*
9526   eval "ac_cv_lib_$ac_lib_var=no"
9527 fi
9528 rm -f conftest*
9529 LIBS="$ac_save_LIBS"
9530
9531 fi
9532 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9533   echo "$ac_t""yes" 1>&6
9534   LIBS="$LIBS -lx"
9535 else
9536   echo "$ac_t""no" 1>&6
9537 fi
9538
9539 fi
9540
9541 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
9542 echo "configure:9543: checking for sys/wait.h that is POSIX.1 compatible" >&5
9543 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
9544   echo $ac_n "(cached) $ac_c" 1>&6
9545 else
9546   cat > conftest.$ac_ext <<EOF
9547 #line 9548 "configure"
9548 #include "confdefs.h"
9549 #include <sys/types.h>
9550 #include <sys/wait.h>
9551 #ifndef WEXITSTATUS
9552 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
9553 #endif
9554 #ifndef WIFEXITED
9555 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
9556 #endif
9557 int main() {
9558 int s;
9559 wait (&s);
9560 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
9561 ; return 0; }
9562 EOF
9563 if { (eval echo configure:9564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9564   rm -rf conftest*
9565   ac_cv_header_sys_wait_h=yes
9566 else
9567   echo "configure: failed program was:" >&5
9568   cat conftest.$ac_ext >&5
9569   rm -rf conftest*
9570   ac_cv_header_sys_wait_h=no
9571 fi
9572 rm -f conftest*
9573 fi
9574
9575 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
9576 if test $ac_cv_header_sys_wait_h = yes; then
9577   cat >> confdefs.h <<\EOF
9578 #define HAVE_SYS_WAIT_H 1
9579 EOF
9580
9581 fi
9582
9583 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
9584 echo "configure:9585: checking POSIX termios" >&5
9585 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
9586   echo $ac_n "(cached) $ac_c" 1>&6
9587 else
9588   cat > conftest.$ac_ext <<EOF
9589 #line 9590 "configure"
9590 #include "confdefs.h"
9591 #include <sys/types.h>
9592 #include <unistd.h>
9593 #include <termios.h>
9594 int main() {
9595 /* SunOS 4.0.3 has termios.h but not the library calls.  */
9596    tcgetattr(0, 0);
9597 ; return 0; }
9598 EOF
9599 if { (eval echo configure:9600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9600   rm -rf conftest*
9601   am_cv_sys_posix_termios=yes
9602 else
9603   echo "configure: failed program was:" >&5
9604   cat conftest.$ac_ext >&5
9605   rm -rf conftest*
9606   am_cv_sys_posix_termios=no
9607 fi
9608 rm -f conftest*
9609 fi
9610
9611 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
9612
9613
9614  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
9615 echo "configure:9616: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
9616 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
9617   echo $ac_n "(cached) $ac_c" 1>&6
9618 else
9619   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
9620
9621   gwinsz_in_termios_h=no
9622   if test $am_cv_sys_posix_termios = yes; then
9623     cat > conftest.$ac_ext <<EOF
9624 #line 9625 "configure"
9625 #include "confdefs.h"
9626 #include <sys/types.h>
9627 #     include <termios.h>
9628 #     ifdef TIOCGWINSZ
9629         yes
9630 #     endif
9631     
9632 EOF
9633 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9634   egrep "yes" >/dev/null 2>&1; then
9635   rm -rf conftest*
9636   gwinsz_in_termios_h=yes
9637 fi
9638 rm -f conftest*
9639
9640   fi
9641
9642   if test $gwinsz_in_termios_h = no; then
9643     cat > conftest.$ac_ext <<EOF
9644 #line 9645 "configure"
9645 #include "confdefs.h"
9646 #include <sys/types.h>
9647 #     include <sys/ioctl.h>
9648 #     ifdef TIOCGWINSZ
9649         yes
9650 #     endif
9651     
9652 EOF
9653 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9654   egrep "yes" >/dev/null 2>&1; then
9655   rm -rf conftest*
9656   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
9657 fi
9658 rm -f conftest*
9659
9660   fi
9661   
9662 fi
9663
9664 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
9665   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
9666     cat >> confdefs.h <<\EOF
9667 #define GWINSZ_IN_SYS_IOCTL 1
9668 EOF
9669
9670   fi
9671
9672 if test $am_cv_sys_posix_termios = yes ; then
9673         cat >> confdefs.h <<\EOF
9674 #define HAVE_POSIX_TERMIOS 1
9675 EOF
9676
9677 fi
9678
9679 for ac_hdr in \
9680         arpa/inet.h             \
9681         arpa/nameser.h  \
9682         assert.h                \
9683         crypt.h                 \
9684         errno.h                 \
9685         fcntl.h                 \
9686         filio.h                 \
9687         getopt.h                \
9688         grp.h                   \
9689         libutil.h               \
9690         limits.h                \
9691         locale.h                \
9692         malloc.h                \
9693         memory.h                \
9694         psap.h                  \
9695         pwd.h                   \
9696         resolv.h                \
9697         sgtty.h                 \
9698         stdarg.h                \
9699         stddef.h                \
9700         string.h                \
9701         strings.h               \
9702         sysexits.h              \
9703         sys/file.h              \
9704         sys/filio.h             \
9705         sys/errno.h             \
9706         sys/ioctl.h             \
9707         sys/param.h             \
9708         sys/resource.h  \
9709         sys/select.h    \
9710         sys/socket.h    \
9711         sys/syslog.h    \
9712         sys/time.h              \
9713         sys/types.h             \
9714         syslog.h                \
9715         termios.h               \
9716         unistd.h                \
9717
9718 do
9719 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9720 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9721 echo "configure:9722: checking for $ac_hdr" >&5
9722 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9723   echo $ac_n "(cached) $ac_c" 1>&6
9724 else
9725   cat > conftest.$ac_ext <<EOF
9726 #line 9727 "configure"
9727 #include "confdefs.h"
9728 #include <$ac_hdr>
9729 EOF
9730 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9731 { (eval echo configure:9732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9732 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9733 if test -z "$ac_err"; then
9734   rm -rf conftest*
9735   eval "ac_cv_header_$ac_safe=yes"
9736 else
9737   echo "$ac_err" >&5
9738   echo "configure: failed program was:" >&5
9739   cat conftest.$ac_ext >&5
9740   rm -rf conftest*
9741   eval "ac_cv_header_$ac_safe=no"
9742 fi
9743 rm -f conftest*
9744 fi
9745 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9746   echo "$ac_t""yes" 1>&6
9747     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9748   cat >> confdefs.h <<EOF
9749 #define $ac_tr_hdr 1
9750 EOF
9751  
9752 else
9753   echo "$ac_t""no" 1>&6
9754 fi
9755 done
9756
9757
9758 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
9759 echo "configure:9760: checking for uid_t in sys/types.h" >&5
9760 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
9761   echo $ac_n "(cached) $ac_c" 1>&6
9762 else
9763   cat > conftest.$ac_ext <<EOF
9764 #line 9765 "configure"
9765 #include "confdefs.h"
9766 #include <sys/types.h>
9767 EOF
9768 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9769   egrep "uid_t" >/dev/null 2>&1; then
9770   rm -rf conftest*
9771   ac_cv_type_uid_t=yes
9772 else
9773   rm -rf conftest*
9774   ac_cv_type_uid_t=no
9775 fi
9776 rm -f conftest*
9777
9778 fi
9779
9780 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
9781 if test $ac_cv_type_uid_t = no; then
9782   cat >> confdefs.h <<\EOF
9783 #define uid_t int
9784 EOF
9785
9786   cat >> confdefs.h <<\EOF
9787 #define gid_t int
9788 EOF
9789
9790 fi
9791
9792 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
9793 echo "configure:9794: checking type of array argument to getgroups" >&5
9794 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
9795   echo $ac_n "(cached) $ac_c" 1>&6
9796 else
9797   if test "$cross_compiling" = yes; then
9798   ac_cv_type_getgroups=cross
9799 else
9800   cat > conftest.$ac_ext <<EOF
9801 #line 9802 "configure"
9802 #include "confdefs.h"
9803
9804 /* Thanks to Mike Rendell for this test.  */
9805 #include <sys/types.h>
9806 #define NGID 256
9807 #undef MAX
9808 #define MAX(x, y) ((x) > (y) ? (x) : (y))
9809 main()
9810 {
9811   gid_t gidset[NGID];
9812   int i, n;
9813   union { gid_t gval; long lval; }  val;
9814
9815   val.lval = -1;
9816   for (i = 0; i < NGID; i++)
9817     gidset[i] = val.gval;
9818   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
9819                  gidset);
9820   /* Exit non-zero if getgroups seems to require an array of ints.  This
9821      happens when gid_t is short but getgroups modifies an array of ints.  */
9822   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
9823 }
9824
9825 EOF
9826 if { (eval echo configure:9827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9827 then
9828     ac_cv_type_getgroups=gid_t
9829 else
9830   echo "configure: failed program was:" >&5
9831   cat conftest.$ac_ext >&5
9832   rm -fr conftest*
9833   ac_cv_type_getgroups=int
9834 fi
9835 rm -fr conftest*
9836 fi
9837
9838 if test $ac_cv_type_getgroups = cross; then
9839         cat > conftest.$ac_ext <<EOF
9840 #line 9841 "configure"
9841 #include "confdefs.h"
9842 #include <unistd.h>
9843 EOF
9844 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9845   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
9846   rm -rf conftest*
9847   ac_cv_type_getgroups=gid_t
9848 else
9849   rm -rf conftest*
9850   ac_cv_type_getgroups=int
9851 fi
9852 rm -f conftest*
9853
9854 fi
9855 fi
9856
9857 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
9858 cat >> confdefs.h <<EOF
9859 #define GETGROUPS_T $ac_cv_type_getgroups
9860 EOF
9861
9862  echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
9863 echo "configure:9864: checking for ANSI C header files" >&5
9864 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
9865   echo $ac_n "(cached) $ac_c" 1>&6
9866 else
9867   cat > conftest.$ac_ext <<EOF
9868 #line 9869 "configure"
9869 #include "confdefs.h"
9870 #include <stdlib.h>
9871 #include <stdarg.h>
9872 #include <string.h>
9873 #include <float.h>
9874 EOF
9875 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9876 { (eval echo configure:9877: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9877 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9878 if test -z "$ac_err"; then
9879   rm -rf conftest*
9880   ac_cv_header_stdc=yes
9881 else
9882   echo "$ac_err" >&5
9883   echo "configure: failed program was:" >&5
9884   cat conftest.$ac_ext >&5
9885   rm -rf conftest*
9886   ac_cv_header_stdc=no
9887 fi
9888 rm -f conftest*
9889
9890 if test $ac_cv_header_stdc = yes; then
9891   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
9892 cat > conftest.$ac_ext <<EOF
9893 #line 9894 "configure"
9894 #include "confdefs.h"
9895 #include <string.h>
9896 EOF
9897 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9898   egrep "memchr" >/dev/null 2>&1; then
9899   :
9900 else
9901   rm -rf conftest*
9902   ac_cv_header_stdc=no
9903 fi
9904 rm -f conftest*
9905
9906 fi
9907
9908 if test $ac_cv_header_stdc = yes; then
9909   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
9910 cat > conftest.$ac_ext <<EOF
9911 #line 9912 "configure"
9912 #include "confdefs.h"
9913 #include <stdlib.h>
9914 EOF
9915 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9916   egrep "free" >/dev/null 2>&1; then
9917   :
9918 else
9919   rm -rf conftest*
9920   ac_cv_header_stdc=no
9921 fi
9922 rm -f conftest*
9923
9924 fi
9925
9926 if test $ac_cv_header_stdc = yes; then
9927   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
9928 if test "$cross_compiling" = yes; then
9929   :
9930 else
9931   cat > conftest.$ac_ext <<EOF
9932 #line 9933 "configure"
9933 #include "confdefs.h"
9934 #include <ctype.h>
9935 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
9936 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
9937 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
9938 int main () { int i; for (i = 0; i < 256; i++)
9939 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
9940 exit (0); }
9941
9942 EOF
9943 if { (eval echo configure:9944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9944 then
9945   :
9946 else
9947   echo "configure: failed program was:" >&5
9948   cat conftest.$ac_ext >&5
9949   rm -fr conftest*
9950   ac_cv_header_stdc=no
9951 fi
9952 rm -fr conftest*
9953 fi
9954
9955 fi
9956 fi
9957
9958 echo "$ac_t""$ac_cv_header_stdc" 1>&6
9959 if test $ac_cv_header_stdc = yes; then
9960   cat >> confdefs.h <<\EOF
9961 #define STDC_HEADERS 1
9962 EOF
9963
9964 fi
9965
9966 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
9967 echo "configure:9968: checking for mode_t" >&5
9968 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
9969   echo $ac_n "(cached) $ac_c" 1>&6
9970 else
9971   cat > conftest.$ac_ext <<EOF
9972 #line 9973 "configure"
9973 #include "confdefs.h"
9974 #include <sys/types.h>
9975 #if STDC_HEADERS
9976 #include <stdlib.h>
9977 #include <stddef.h>
9978 #endif
9979 EOF
9980 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9981   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
9982   rm -rf conftest*
9983   ac_cv_type_mode_t=yes
9984 else
9985   rm -rf conftest*
9986   ac_cv_type_mode_t=no
9987 fi
9988 rm -f conftest*
9989
9990 fi
9991 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
9992 if test $ac_cv_type_mode_t = no; then
9993   cat >> confdefs.h <<\EOF
9994 #define mode_t int
9995 EOF
9996
9997 fi
9998
9999 echo $ac_n "checking for off_t""... $ac_c" 1>&6
10000 echo "configure:10001: checking for off_t" >&5
10001 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
10002   echo $ac_n "(cached) $ac_c" 1>&6
10003 else
10004   cat > conftest.$ac_ext <<EOF
10005 #line 10006 "configure"
10006 #include "confdefs.h"
10007 #include <sys/types.h>
10008 #if STDC_HEADERS
10009 #include <stdlib.h>
10010 #include <stddef.h>
10011 #endif
10012 EOF
10013 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10014   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10015   rm -rf conftest*
10016   ac_cv_type_off_t=yes
10017 else
10018   rm -rf conftest*
10019   ac_cv_type_off_t=no
10020 fi
10021 rm -f conftest*
10022
10023 fi
10024 echo "$ac_t""$ac_cv_type_off_t" 1>&6
10025 if test $ac_cv_type_off_t = no; then
10026   cat >> confdefs.h <<\EOF
10027 #define off_t long
10028 EOF
10029
10030 fi
10031
10032 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
10033 echo "configure:10034: checking for pid_t" >&5
10034 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
10035   echo $ac_n "(cached) $ac_c" 1>&6
10036 else
10037   cat > conftest.$ac_ext <<EOF
10038 #line 10039 "configure"
10039 #include "confdefs.h"
10040 #include <sys/types.h>
10041 #if STDC_HEADERS
10042 #include <stdlib.h>
10043 #include <stddef.h>
10044 #endif
10045 EOF
10046 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10047   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10048   rm -rf conftest*
10049   ac_cv_type_pid_t=yes
10050 else
10051   rm -rf conftest*
10052   ac_cv_type_pid_t=no
10053 fi
10054 rm -f conftest*
10055
10056 fi
10057 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
10058 if test $ac_cv_type_pid_t = no; then
10059   cat >> confdefs.h <<\EOF
10060 #define pid_t int
10061 EOF
10062
10063 fi
10064
10065 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
10066 echo "configure:10067: checking for ptrdiff_t" >&5
10067 if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then
10068   echo $ac_n "(cached) $ac_c" 1>&6
10069 else
10070   cat > conftest.$ac_ext <<EOF
10071 #line 10072 "configure"
10072 #include "confdefs.h"
10073 #include <stddef.h>
10074 int main() {
10075 ptrdiff_t p
10076 ; return 0; }
10077 EOF
10078 if { (eval echo configure:10079: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10079   rm -rf conftest*
10080   am_cv_type_ptrdiff_t=yes
10081 else
10082   echo "configure: failed program was:" >&5
10083   cat conftest.$ac_ext >&5
10084   rm -rf conftest*
10085   am_cv_type_ptrdiff_t=no
10086 fi
10087 rm -f conftest*
10088 fi
10089
10090 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
10091    if test $am_cv_type_ptrdiff_t = yes; then
10092      cat >> confdefs.h <<\EOF
10093 #define HAVE_PTRDIFF_T 1
10094 EOF
10095
10096    fi
10097
10098 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
10099 echo "configure:10100: checking return type of signal handlers" >&5
10100 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
10101   echo $ac_n "(cached) $ac_c" 1>&6
10102 else
10103   cat > conftest.$ac_ext <<EOF
10104 #line 10105 "configure"
10105 #include "confdefs.h"
10106 #include <sys/types.h>
10107 #include <signal.h>
10108 #ifdef signal
10109 #undef signal
10110 #endif
10111 #ifdef __cplusplus
10112 extern "C" void (*signal (int, void (*)(int)))(int);
10113 #else
10114 void (*signal ()) ();
10115 #endif
10116
10117 int main() {
10118 int i;
10119 ; return 0; }
10120 EOF
10121 if { (eval echo configure:10122: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10122   rm -rf conftest*
10123   ac_cv_type_signal=void
10124 else
10125   echo "configure: failed program was:" >&5
10126   cat conftest.$ac_ext >&5
10127   rm -rf conftest*
10128   ac_cv_type_signal=int
10129 fi
10130 rm -f conftest*
10131 fi
10132
10133 echo "$ac_t""$ac_cv_type_signal" 1>&6
10134 cat >> confdefs.h <<EOF
10135 #define RETSIGTYPE $ac_cv_type_signal
10136 EOF
10137
10138
10139 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
10140 echo "configure:10141: checking for sig_atomic_t" >&5
10141 if eval "test \"`echo '$''{'ol_cv_type_sig_atomic_t'+set}'`\" = set"; then
10142   echo $ac_n "(cached) $ac_c" 1>&6
10143 else
10144   cat > conftest.$ac_ext <<EOF
10145 #line 10146 "configure"
10146 #include "confdefs.h"
10147 #include <signal.h>
10148 int main() {
10149 sig_atomic_t atomic;
10150 ; return 0; }
10151 EOF
10152 if { (eval echo configure:10153: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10153   rm -rf conftest*
10154   ol_cv_type_sig_atomic_t=yes
10155 else
10156   echo "configure: failed program was:" >&5
10157   cat conftest.$ac_ext >&5
10158   rm -rf conftest*
10159   ol_cv_type_sig_atomic_t=no
10160 fi
10161 rm -f conftest*
10162 fi
10163
10164 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
10165   if test $ol_cv_type_sig_atomic_t = no; then
10166     cat >> confdefs.h <<\EOF
10167 #define sig_atomic_t int
10168 EOF
10169
10170   fi
10171  
10172 echo $ac_n "checking for size_t""... $ac_c" 1>&6
10173 echo "configure:10174: checking for size_t" >&5
10174 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
10175   echo $ac_n "(cached) $ac_c" 1>&6
10176 else
10177   cat > conftest.$ac_ext <<EOF
10178 #line 10179 "configure"
10179 #include "confdefs.h"
10180 #include <sys/types.h>
10181 #if STDC_HEADERS
10182 #include <stdlib.h>
10183 #include <stddef.h>
10184 #endif
10185 EOF
10186 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10187   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10188   rm -rf conftest*
10189   ac_cv_type_size_t=yes
10190 else
10191   rm -rf conftest*
10192   ac_cv_type_size_t=no
10193 fi
10194 rm -f conftest*
10195
10196 fi
10197 echo "$ac_t""$ac_cv_type_size_t" 1>&6
10198 if test $ac_cv_type_size_t = no; then
10199   cat >> confdefs.h <<\EOF
10200 #define size_t unsigned
10201 EOF
10202
10203 fi
10204
10205 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
10206 echo "configure:10207: checking for st_blksize in struct stat" >&5
10207 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
10208   echo $ac_n "(cached) $ac_c" 1>&6
10209 else
10210   cat > conftest.$ac_ext <<EOF
10211 #line 10212 "configure"
10212 #include "confdefs.h"
10213 #include <sys/types.h>
10214 #include <sys/stat.h>
10215 int main() {
10216 struct stat s; s.st_blksize;
10217 ; return 0; }
10218 EOF
10219 if { (eval echo configure:10220: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10220   rm -rf conftest*
10221   ac_cv_struct_st_blksize=yes
10222 else
10223   echo "configure: failed program was:" >&5
10224   cat conftest.$ac_ext >&5
10225   rm -rf conftest*
10226   ac_cv_struct_st_blksize=no
10227 fi
10228 rm -f conftest*
10229 fi
10230
10231 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
10232 if test $ac_cv_struct_st_blksize = yes; then
10233   cat >> confdefs.h <<\EOF
10234 #define HAVE_ST_BLKSIZE 1
10235 EOF
10236
10237 fi
10238
10239 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
10240 echo "configure:10241: checking whether time.h and sys/time.h may both be included" >&5
10241 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
10242   echo $ac_n "(cached) $ac_c" 1>&6
10243 else
10244   cat > conftest.$ac_ext <<EOF
10245 #line 10246 "configure"
10246 #include "confdefs.h"
10247 #include <sys/types.h>
10248 #include <sys/time.h>
10249 #include <time.h>
10250 int main() {
10251 struct tm *tp;
10252 ; return 0; }
10253 EOF
10254 if { (eval echo configure:10255: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10255   rm -rf conftest*
10256   ac_cv_header_time=yes
10257 else
10258   echo "configure: failed program was:" >&5
10259   cat conftest.$ac_ext >&5
10260   rm -rf conftest*
10261   ac_cv_header_time=no
10262 fi
10263 rm -f conftest*
10264 fi
10265
10266 echo "$ac_t""$ac_cv_header_time" 1>&6
10267 if test $ac_cv_header_time = yes; then
10268   cat >> confdefs.h <<\EOF
10269 #define TIME_WITH_SYS_TIME 1
10270 EOF
10271
10272 fi
10273
10274 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
10275 echo "configure:10276: checking whether struct tm is in sys/time.h or time.h" >&5
10276 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
10277   echo $ac_n "(cached) $ac_c" 1>&6
10278 else
10279   cat > conftest.$ac_ext <<EOF
10280 #line 10281 "configure"
10281 #include "confdefs.h"
10282 #include <sys/types.h>
10283 #include <time.h>
10284 int main() {
10285 struct tm *tp; tp->tm_sec;
10286 ; return 0; }
10287 EOF
10288 if { (eval echo configure:10289: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10289   rm -rf conftest*
10290   ac_cv_struct_tm=time.h
10291 else
10292   echo "configure: failed program was:" >&5
10293   cat conftest.$ac_ext >&5
10294   rm -rf conftest*
10295   ac_cv_struct_tm=sys/time.h
10296 fi
10297 rm -f conftest*
10298 fi
10299
10300 echo "$ac_t""$ac_cv_struct_tm" 1>&6
10301 if test $ac_cv_struct_tm = sys/time.h; then
10302   cat >> confdefs.h <<\EOF
10303 #define TM_IN_SYS_TIME 1
10304 EOF
10305
10306 fi
10307
10308 # test for pw_gecos in struct passwd
10309 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
10310 echo "configure:10311: checking struct passwd for pw_gecos" >&5
10311 if eval "test \"`echo '$''{'ol_cv_struct_passwd_pw_gecos'+set}'`\" = set"; then
10312   echo $ac_n "(cached) $ac_c" 1>&6
10313 else
10314   
10315         cat > conftest.$ac_ext <<EOF
10316 #line 10317 "configure"
10317 #include "confdefs.h"
10318 #include <pwd.h>
10319 int main() {
10320
10321         struct passwd pwd;
10322         pwd.pw_gecos = pwd.pw_name;
10323
10324 ; return 0; }
10325 EOF
10326 if { (eval echo configure:10327: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10327   rm -rf conftest*
10328   ol_cv_struct_passwd_pw_gecos=yes
10329 else
10330   echo "configure: failed program was:" >&5
10331   cat conftest.$ac_ext >&5
10332   rm -rf conftest*
10333   ol_cv_struct_passwd_pw_gecos=no
10334 fi
10335 rm -f conftest*
10336 fi
10337
10338 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
10339 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
10340         cat >> confdefs.h <<\EOF
10341 #define HAVE_PW_GECOS 1
10342 EOF
10343
10344 fi
10345
10346
10347
10348 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
10349 echo "configure:10350: checking if toupper() requires islower()" >&5
10350 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
10351   echo $ac_n "(cached) $ac_c" 1>&6
10352 else
10353   
10354         if test "$cross_compiling" = yes; then
10355   ol_cv_c_upper_lower=safe
10356 else
10357   cat > conftest.$ac_ext <<EOF
10358 #line 10359 "configure"
10359 #include "confdefs.h"
10360
10361 #include <ctype.h>
10362 main()
10363 {
10364         if ('C' == toupper('C'))
10365                 exit(0);
10366         else
10367                 exit(1);
10368 }
10369 EOF
10370 if { (eval echo configure:10371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10371 then
10372   ol_cv_c_upper_lower=no
10373 else
10374   echo "configure: failed program was:" >&5
10375   cat conftest.$ac_ext >&5
10376   rm -fr conftest*
10377   ol_cv_c_upper_lower=yes
10378 fi
10379 rm -fr conftest*
10380 fi
10381
10382 fi
10383
10384 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
10385 if test $ol_cv_c_upper_lower != no ; then
10386         cat >> confdefs.h <<\EOF
10387 #define C_UPPER_LOWER 1
10388 EOF
10389
10390 fi
10391
10392 echo $ac_n "checking for working const""... $ac_c" 1>&6
10393 echo "configure:10394: checking for working const" >&5
10394 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
10395   echo $ac_n "(cached) $ac_c" 1>&6
10396 else
10397   cat > conftest.$ac_ext <<EOF
10398 #line 10399 "configure"
10399 #include "confdefs.h"
10400
10401 int main() {
10402
10403 /* Ultrix mips cc rejects this.  */
10404 typedef int charset[2]; const charset x;
10405 /* SunOS 4.1.1 cc rejects this.  */
10406 char const *const *ccp;
10407 char **p;
10408 /* NEC SVR4.0.2 mips cc rejects this.  */
10409 struct point {int x, y;};
10410 static struct point const zero = {0,0};
10411 /* AIX XL C 1.02.0.0 rejects this.
10412    It does not let you subtract one const X* pointer from another in an arm
10413    of an if-expression whose if-part is not a constant expression */
10414 const char *g = "string";
10415 ccp = &g + (g ? g-g : 0);
10416 /* HPUX 7.0 cc rejects these. */
10417 ++ccp;
10418 p = (char**) ccp;
10419 ccp = (char const *const *) p;
10420 { /* SCO 3.2v4 cc rejects this.  */
10421   char *t;
10422   char const *s = 0 ? (char *) 0 : (char const *) 0;
10423
10424   *t++ = 0;
10425 }
10426 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
10427   int x[] = {25, 17};
10428   const int *foo = &x[0];
10429   ++foo;
10430 }
10431 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
10432   typedef const int *iptr;
10433   iptr p = 0;
10434   ++p;
10435 }
10436 { /* AIX XL C 1.02.0.0 rejects this saying
10437      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
10438   struct s { int j; const int *ap[3]; };
10439   struct s *b; b->j = 5;
10440 }
10441 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
10442   const int foo = 10;
10443 }
10444
10445 ; return 0; }
10446 EOF
10447 if { (eval echo configure:10448: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10448   rm -rf conftest*
10449   ac_cv_c_const=yes
10450 else
10451   echo "configure: failed program was:" >&5
10452   cat conftest.$ac_ext >&5
10453   rm -rf conftest*
10454   ac_cv_c_const=no
10455 fi
10456 rm -f conftest*
10457 fi
10458
10459 echo "$ac_t""$ac_cv_c_const" 1>&6
10460 if test $ac_cv_c_const = no; then
10461   cat >> confdefs.h <<\EOF
10462 #define const 
10463 EOF
10464
10465 fi
10466
10467 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
10468 echo "configure:10469: checking if compiler understands volatile" >&5
10469 if eval "test \"`echo '$''{'ol_cv_c_volatile'+set}'`\" = set"; then
10470   echo $ac_n "(cached) $ac_c" 1>&6
10471 else
10472   cat > conftest.$ac_ext <<EOF
10473 #line 10474 "configure"
10474 #include "confdefs.h"
10475 int x, y, z;
10476 int main() {
10477 volatile int a; int * volatile b = x ? &y : &z;
10478       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
10479       *b = 0;
10480 ; return 0; }
10481 EOF
10482 if { (eval echo configure:10483: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10483   rm -rf conftest*
10484   ol_cv_c_volatile=yes
10485 else
10486   echo "configure: failed program was:" >&5
10487   cat conftest.$ac_ext >&5
10488   rm -rf conftest*
10489   ol_cv_c_volatile=no
10490 fi
10491 rm -f conftest*
10492 fi
10493
10494 echo "$ac_t""$ol_cv_c_volatile" 1>&6
10495   if test $ol_cv_c_volatile = yes; then
10496     : 
10497   else
10498     cat >> confdefs.h <<\EOF
10499 #define volatile 
10500 EOF
10501
10502   fi
10503  
10504
10505 if test $cross_compiling = yes ; then
10506         cat >> confdefs.h <<\EOF
10507 #define CROSS_COMPILING 1
10508 EOF
10509
10510 else
10511         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
10512 echo "configure:10513: checking whether byte ordering is bigendian" >&5
10513 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
10514   echo $ac_n "(cached) $ac_c" 1>&6
10515 else
10516   ac_cv_c_bigendian=unknown
10517 # See if sys/param.h defines the BYTE_ORDER macro.
10518 cat > conftest.$ac_ext <<EOF
10519 #line 10520 "configure"
10520 #include "confdefs.h"
10521 #include <sys/types.h>
10522 #include <sys/param.h>
10523 int main() {
10524
10525 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
10526  bogus endian macros
10527 #endif
10528 ; return 0; }
10529 EOF
10530 if { (eval echo configure:10531: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10531   rm -rf conftest*
10532   # It does; now see whether it defined to BIG_ENDIAN or not.
10533 cat > conftest.$ac_ext <<EOF
10534 #line 10535 "configure"
10535 #include "confdefs.h"
10536 #include <sys/types.h>
10537 #include <sys/param.h>
10538 int main() {
10539
10540 #if BYTE_ORDER != BIG_ENDIAN
10541  not big endian
10542 #endif
10543 ; return 0; }
10544 EOF
10545 if { (eval echo configure:10546: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10546   rm -rf conftest*
10547   ac_cv_c_bigendian=yes
10548 else
10549   echo "configure: failed program was:" >&5
10550   cat conftest.$ac_ext >&5
10551   rm -rf conftest*
10552   ac_cv_c_bigendian=no
10553 fi
10554 rm -f conftest*
10555 else
10556   echo "configure: failed program was:" >&5
10557   cat conftest.$ac_ext >&5
10558 fi
10559 rm -f conftest*
10560 if test $ac_cv_c_bigendian = unknown; then
10561 if test "$cross_compiling" = yes; then
10562     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10563 else
10564   cat > conftest.$ac_ext <<EOF
10565 #line 10566 "configure"
10566 #include "confdefs.h"
10567 main () {
10568   /* Are we little or big endian?  From Harbison&Steele.  */
10569   union
10570   {
10571     long l;
10572     char c[sizeof (long)];
10573   } u;
10574   u.l = 1;
10575   exit (u.c[sizeof (long) - 1] == 1);
10576 }
10577 EOF
10578 if { (eval echo configure:10579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10579 then
10580   ac_cv_c_bigendian=no
10581 else
10582   echo "configure: failed program was:" >&5
10583   cat conftest.$ac_ext >&5
10584   rm -fr conftest*
10585   ac_cv_c_bigendian=yes
10586 fi
10587 rm -fr conftest*
10588 fi
10589
10590 fi
10591 fi
10592
10593 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
10594 if test $ac_cv_c_bigendian = yes; then
10595   cat >> confdefs.h <<\EOF
10596 #define WORDS_BIGENDIAN 1
10597 EOF
10598
10599 fi
10600
10601         echo $ac_n "checking size of short""... $ac_c" 1>&6
10602 echo "configure:10603: checking size of short" >&5
10603 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
10604   echo $ac_n "(cached) $ac_c" 1>&6
10605 else
10606   if test "$cross_compiling" = yes; then
10607     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10608 else
10609   cat > conftest.$ac_ext <<EOF
10610 #line 10611 "configure"
10611 #include "confdefs.h"
10612 #include <stdio.h>
10613 main()
10614 {
10615   FILE *f=fopen("conftestval", "w");
10616   if (!f) exit(1);
10617   fprintf(f, "%d\n", sizeof(short));
10618   exit(0);
10619 }
10620 EOF
10621 if { (eval echo configure:10622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10622 then
10623   ac_cv_sizeof_short=`cat conftestval`
10624 else
10625   echo "configure: failed program was:" >&5
10626   cat conftest.$ac_ext >&5
10627   rm -fr conftest*
10628   ac_cv_sizeof_short=0
10629 fi
10630 rm -fr conftest*
10631 fi
10632
10633 fi
10634 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
10635 cat >> confdefs.h <<EOF
10636 #define SIZEOF_SHORT $ac_cv_sizeof_short
10637 EOF
10638
10639  
10640         echo $ac_n "checking size of int""... $ac_c" 1>&6
10641 echo "configure:10642: checking size of int" >&5
10642 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
10643   echo $ac_n "(cached) $ac_c" 1>&6
10644 else
10645   if test "$cross_compiling" = yes; then
10646     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10647 else
10648   cat > conftest.$ac_ext <<EOF
10649 #line 10650 "configure"
10650 #include "confdefs.h"
10651 #include <stdio.h>
10652 main()
10653 {
10654   FILE *f=fopen("conftestval", "w");
10655   if (!f) exit(1);
10656   fprintf(f, "%d\n", sizeof(int));
10657   exit(0);
10658 }
10659 EOF
10660 if { (eval echo configure:10661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10661 then
10662   ac_cv_sizeof_int=`cat conftestval`
10663 else
10664   echo "configure: failed program was:" >&5
10665   cat conftest.$ac_ext >&5
10666   rm -fr conftest*
10667   ac_cv_sizeof_int=0
10668 fi
10669 rm -fr conftest*
10670 fi
10671
10672 fi
10673 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
10674 cat >> confdefs.h <<EOF
10675 #define SIZEOF_INT $ac_cv_sizeof_int
10676 EOF
10677
10678  
10679         echo $ac_n "checking size of long""... $ac_c" 1>&6
10680 echo "configure:10681: checking size of long" >&5
10681 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
10682   echo $ac_n "(cached) $ac_c" 1>&6
10683 else
10684   if test "$cross_compiling" = yes; then
10685     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10686 else
10687   cat > conftest.$ac_ext <<EOF
10688 #line 10689 "configure"
10689 #include "confdefs.h"
10690 #include <stdio.h>
10691 main()
10692 {
10693   FILE *f=fopen("conftestval", "w");
10694   if (!f) exit(1);
10695   fprintf(f, "%d\n", sizeof(long));
10696   exit(0);
10697 }
10698 EOF
10699 if { (eval echo configure:10700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10700 then
10701   ac_cv_sizeof_long=`cat conftestval`
10702 else
10703   echo "configure: failed program was:" >&5
10704   cat conftest.$ac_ext >&5
10705   rm -fr conftest*
10706   ac_cv_sizeof_long=0
10707 fi
10708 rm -fr conftest*
10709 fi
10710
10711 fi
10712 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
10713 cat >> confdefs.h <<EOF
10714 #define SIZEOF_LONG $ac_cv_sizeof_long
10715 EOF
10716
10717
10718 fi
10719
10720 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
10721 echo "configure:10722: checking for 8-bit clean memcmp" >&5
10722 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
10723   echo $ac_n "(cached) $ac_c" 1>&6
10724 else
10725   if test "$cross_compiling" = yes; then
10726   ac_cv_func_memcmp_clean=no
10727 else
10728   cat > conftest.$ac_ext <<EOF
10729 #line 10730 "configure"
10730 #include "confdefs.h"
10731
10732 main()
10733 {
10734   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
10735   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
10736 }
10737
10738 EOF
10739 if { (eval echo configure:10740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10740 then
10741   ac_cv_func_memcmp_clean=yes
10742 else
10743   echo "configure: failed program was:" >&5
10744   cat conftest.$ac_ext >&5
10745   rm -fr conftest*
10746   ac_cv_func_memcmp_clean=no
10747 fi
10748 rm -fr conftest*
10749 fi
10750
10751 fi
10752
10753 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
10754 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
10755
10756 echo $ac_n "checking for strftime""... $ac_c" 1>&6
10757 echo "configure:10758: checking for strftime" >&5
10758 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
10759   echo $ac_n "(cached) $ac_c" 1>&6
10760 else
10761   cat > conftest.$ac_ext <<EOF
10762 #line 10763 "configure"
10763 #include "confdefs.h"
10764 /* System header to define __stub macros and hopefully few prototypes,
10765     which can conflict with char strftime(); below.  */
10766 #include <assert.h>
10767 /* Override any gcc2 internal prototype to avoid an error.  */
10768 /* We use char because int might match the return type of a gcc2
10769     builtin and then its argument prototype would still apply.  */
10770 char strftime();
10771
10772 int main() {
10773
10774 /* The GNU C library defines this for functions which it implements
10775     to always fail with ENOSYS.  Some functions are actually named
10776     something starting with __ and the normal name is an alias.  */
10777 #if defined (__stub_strftime) || defined (__stub___strftime)
10778 choke me
10779 #else
10780 strftime();
10781 #endif
10782
10783 ; return 0; }
10784 EOF
10785 if { (eval echo configure:10786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10786   rm -rf conftest*
10787   eval "ac_cv_func_strftime=yes"
10788 else
10789   echo "configure: failed program was:" >&5
10790   cat conftest.$ac_ext >&5
10791   rm -rf conftest*
10792   eval "ac_cv_func_strftime=no"
10793 fi
10794 rm -f conftest*
10795 fi
10796
10797 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
10798   echo "$ac_t""yes" 1>&6
10799   cat >> confdefs.h <<\EOF
10800 #define HAVE_STRFTIME 1
10801 EOF
10802
10803 else
10804   echo "$ac_t""no" 1>&6
10805 # strftime is in -lintl on SCO UNIX.
10806 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
10807 echo "configure:10808: checking for strftime in -lintl" >&5
10808 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
10809 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
10810   echo $ac_n "(cached) $ac_c" 1>&6
10811 else
10812   ac_save_LIBS="$LIBS"
10813 LIBS="-lintl  $LIBS"
10814 cat > conftest.$ac_ext <<EOF
10815 #line 10816 "configure"
10816 #include "confdefs.h"
10817 /* Override any gcc2 internal prototype to avoid an error.  */
10818 /* We use char because int might match the return type of a gcc2
10819     builtin and then its argument prototype would still apply.  */
10820 char strftime();
10821
10822 int main() {
10823 strftime()
10824 ; return 0; }
10825 EOF
10826 if { (eval echo configure:10827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10827   rm -rf conftest*
10828   eval "ac_cv_lib_$ac_lib_var=yes"
10829 else
10830   echo "configure: failed program was:" >&5
10831   cat conftest.$ac_ext >&5
10832   rm -rf conftest*
10833   eval "ac_cv_lib_$ac_lib_var=no"
10834 fi
10835 rm -f conftest*
10836 LIBS="$ac_save_LIBS"
10837
10838 fi
10839 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10840   echo "$ac_t""yes" 1>&6
10841   cat >> confdefs.h <<\EOF
10842 #define HAVE_STRFTIME 1
10843 EOF
10844
10845 LIBS="-lintl $LIBS"
10846 else
10847   echo "$ac_t""no" 1>&6
10848 fi
10849
10850 fi
10851
10852
10853 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
10854 echo "configure:10855: checking for vprintf" >&5
10855 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
10856   echo $ac_n "(cached) $ac_c" 1>&6
10857 else
10858   cat > conftest.$ac_ext <<EOF
10859 #line 10860 "configure"
10860 #include "confdefs.h"
10861 /* System header to define __stub macros and hopefully few prototypes,
10862     which can conflict with char vprintf(); below.  */
10863 #include <assert.h>
10864 /* Override any gcc2 internal prototype to avoid an error.  */
10865 /* We use char because int might match the return type of a gcc2
10866     builtin and then its argument prototype would still apply.  */
10867 char vprintf();
10868
10869 int main() {
10870
10871 /* The GNU C library defines this for functions which it implements
10872     to always fail with ENOSYS.  Some functions are actually named
10873     something starting with __ and the normal name is an alias.  */
10874 #if defined (__stub_vprintf) || defined (__stub___vprintf)
10875 choke me
10876 #else
10877 vprintf();
10878 #endif
10879
10880 ; return 0; }
10881 EOF
10882 if { (eval echo configure:10883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10883   rm -rf conftest*
10884   eval "ac_cv_func_vprintf=yes"
10885 else
10886   echo "configure: failed program was:" >&5
10887   cat conftest.$ac_ext >&5
10888   rm -rf conftest*
10889   eval "ac_cv_func_vprintf=no"
10890 fi
10891 rm -f conftest*
10892 fi
10893
10894 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
10895   echo "$ac_t""yes" 1>&6
10896   cat >> confdefs.h <<\EOF
10897 #define HAVE_VPRINTF 1
10898 EOF
10899
10900 else
10901   echo "$ac_t""no" 1>&6
10902 fi
10903
10904 if test "$ac_cv_func_vprintf" != yes; then
10905 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
10906 echo "configure:10907: checking for _doprnt" >&5
10907 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
10908   echo $ac_n "(cached) $ac_c" 1>&6
10909 else
10910   cat > conftest.$ac_ext <<EOF
10911 #line 10912 "configure"
10912 #include "confdefs.h"
10913 /* System header to define __stub macros and hopefully few prototypes,
10914     which can conflict with char _doprnt(); below.  */
10915 #include <assert.h>
10916 /* Override any gcc2 internal prototype to avoid an error.  */
10917 /* We use char because int might match the return type of a gcc2
10918     builtin and then its argument prototype would still apply.  */
10919 char _doprnt();
10920
10921 int main() {
10922
10923 /* The GNU C library defines this for functions which it implements
10924     to always fail with ENOSYS.  Some functions are actually named
10925     something starting with __ and the normal name is an alias.  */
10926 #if defined (__stub__doprnt) || defined (__stub____doprnt)
10927 choke me
10928 #else
10929 _doprnt();
10930 #endif
10931
10932 ; return 0; }
10933 EOF
10934 if { (eval echo configure:10935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10935   rm -rf conftest*
10936   eval "ac_cv_func__doprnt=yes"
10937 else
10938   echo "configure: failed program was:" >&5
10939   cat conftest.$ac_ext >&5
10940   rm -rf conftest*
10941   eval "ac_cv_func__doprnt=no"
10942 fi
10943 rm -f conftest*
10944 fi
10945
10946 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
10947   echo "$ac_t""yes" 1>&6
10948   cat >> confdefs.h <<\EOF
10949 #define HAVE_DOPRNT 1
10950 EOF
10951
10952 else
10953   echo "$ac_t""no" 1>&6
10954 fi
10955
10956 fi
10957
10958
10959 if test $ac_cv_func_vprintf = yes ; then
10960                 for ac_func in vsnprintf vsprintf
10961 do
10962 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10963 echo "configure:10964: checking for $ac_func" >&5
10964 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
10965   echo $ac_n "(cached) $ac_c" 1>&6
10966 else
10967   cat > conftest.$ac_ext <<EOF
10968 #line 10969 "configure"
10969 #include "confdefs.h"
10970 /* System header to define __stub macros and hopefully few prototypes,
10971     which can conflict with char $ac_func(); below.  */
10972 #include <assert.h>
10973 /* Override any gcc2 internal prototype to avoid an error.  */
10974 /* We use char because int might match the return type of a gcc2
10975     builtin and then its argument prototype would still apply.  */
10976 char $ac_func();
10977
10978 int main() {
10979
10980 /* The GNU C library defines this for functions which it implements
10981     to always fail with ENOSYS.  Some functions are actually named
10982     something starting with __ and the normal name is an alias.  */
10983 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10984 choke me
10985 #else
10986 $ac_func();
10987 #endif
10988
10989 ; return 0; }
10990 EOF
10991 if { (eval echo configure:10992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10992   rm -rf conftest*
10993   eval "ac_cv_func_$ac_func=yes"
10994 else
10995   echo "configure: failed program was:" >&5
10996   cat conftest.$ac_ext >&5
10997   rm -rf conftest*
10998   eval "ac_cv_func_$ac_func=no"
10999 fi
11000 rm -f conftest*
11001 fi
11002
11003 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11004   echo "$ac_t""yes" 1>&6
11005     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11006   cat >> confdefs.h <<EOF
11007 #define $ac_tr_func 1
11008 EOF
11009  
11010 else
11011   echo "$ac_t""no" 1>&6
11012 fi
11013 done
11014
11015 fi
11016
11017 for ac_func in \
11018         bcopy                   \
11019         endgrent                \
11020         endpwent                \
11021         flock                   \
11022         getdtablesize   \
11023         getgrgid                \
11024         gethostname             \
11025         getpass                 \
11026         getpwuid                \
11027         gettimeofday    \
11028         initgroups              \
11029         lockf                   \
11030         memcpy                  \
11031         memmove                 \
11032         mkstemp                 \
11033         recv                    \
11034         recvfrom                \
11035         setpwfile               \
11036         setgid                  \
11037         setegid                 \
11038         setsid                  \
11039         setuid                  \
11040         seteuid                 \
11041         signal                  \
11042         sigset                  \
11043         snprintf                \
11044         strdup                  \
11045         strerror                \
11046         strpbrk                 \
11047         strrchr                 \
11048         strsep                  \
11049         strstr                  \
11050         strtol                  \
11051         strtoul                 \
11052         strspn                  \
11053         sysconf                 \
11054         waitpid                 \
11055         wait4                   \
11056
11057 do
11058 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11059 echo "configure:11060: checking for $ac_func" >&5
11060 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11061   echo $ac_n "(cached) $ac_c" 1>&6
11062 else
11063   cat > conftest.$ac_ext <<EOF
11064 #line 11065 "configure"
11065 #include "confdefs.h"
11066 /* System header to define __stub macros and hopefully few prototypes,
11067     which can conflict with char $ac_func(); below.  */
11068 #include <assert.h>
11069 /* Override any gcc2 internal prototype to avoid an error.  */
11070 /* We use char because int might match the return type of a gcc2
11071     builtin and then its argument prototype would still apply.  */
11072 char $ac_func();
11073
11074 int main() {
11075
11076 /* The GNU C library defines this for functions which it implements
11077     to always fail with ENOSYS.  Some functions are actually named
11078     something starting with __ and the normal name is an alias.  */
11079 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11080 choke me
11081 #else
11082 $ac_func();
11083 #endif
11084
11085 ; return 0; }
11086 EOF
11087 if { (eval echo configure:11088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11088   rm -rf conftest*
11089   eval "ac_cv_func_$ac_func=yes"
11090 else
11091   echo "configure: failed program was:" >&5
11092   cat conftest.$ac_ext >&5
11093   rm -rf conftest*
11094   eval "ac_cv_func_$ac_func=no"
11095 fi
11096 rm -f conftest*
11097 fi
11098
11099 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11100   echo "$ac_t""yes" 1>&6
11101     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11102   cat >> confdefs.h <<EOF
11103 #define $ac_tr_func 1
11104 EOF
11105  
11106 else
11107   echo "$ac_t""no" 1>&6
11108 fi
11109 done
11110
11111
11112 for ac_func in getopt tempnam
11113 do
11114 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11115 echo "configure:11116: checking for $ac_func" >&5
11116 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11117   echo $ac_n "(cached) $ac_c" 1>&6
11118 else
11119   cat > conftest.$ac_ext <<EOF
11120 #line 11121 "configure"
11121 #include "confdefs.h"
11122 /* System header to define __stub macros and hopefully few prototypes,
11123     which can conflict with char $ac_func(); below.  */
11124 #include <assert.h>
11125 /* Override any gcc2 internal prototype to avoid an error.  */
11126 /* We use char because int might match the return type of a gcc2
11127     builtin and then its argument prototype would still apply.  */
11128 char $ac_func();
11129
11130 int main() {
11131
11132 /* The GNU C library defines this for functions which it implements
11133     to always fail with ENOSYS.  Some functions are actually named
11134     something starting with __ and the normal name is an alias.  */
11135 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11136 choke me
11137 #else
11138 $ac_func();
11139 #endif
11140
11141 ; return 0; }
11142 EOF
11143 if { (eval echo configure:11144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11144   rm -rf conftest*
11145   eval "ac_cv_func_$ac_func=yes"
11146 else
11147   echo "configure: failed program was:" >&5
11148   cat conftest.$ac_ext >&5
11149   rm -rf conftest*
11150   eval "ac_cv_func_$ac_func=no"
11151 fi
11152 rm -f conftest*
11153 fi
11154
11155 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11156   echo "$ac_t""yes" 1>&6
11157     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11158   cat >> confdefs.h <<EOF
11159 #define $ac_tr_func 1
11160 EOF
11161  
11162 else
11163   echo "$ac_t""no" 1>&6
11164 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
11165 fi
11166 done
11167
11168
11169
11170 # Check Configuration
11171
11172 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
11173 echo "configure:11174: checking declaration of sys_errlist" >&5
11174 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
11175   echo $ac_n "(cached) $ac_c" 1>&6
11176 else
11177   
11178         cat > conftest.$ac_ext <<EOF
11179 #line 11180 "configure"
11180 #include "confdefs.h"
11181
11182 #include <stdio.h>
11183 #include <sys/types.h>
11184 #include <errno.h> 
11185 int main() {
11186 char *c = (char *) *sys_errlist
11187 ; return 0; }
11188 EOF
11189 if { (eval echo configure:11190: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11190   rm -rf conftest*
11191   ol_cv_dcl_sys_errlist=yes
11192 else
11193   echo "configure: failed program was:" >&5
11194   cat conftest.$ac_ext >&5
11195   rm -rf conftest*
11196   ol_cv_dcl_sys_errlist=no
11197 fi
11198 rm -f conftest*
11199 fi
11200
11201 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
11202 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
11203 if test $ol_cv_dcl_sys_errlist = no ; then
11204         cat >> confdefs.h <<\EOF
11205 #define DECL_SYS_ERRLIST 1
11206 EOF
11207
11208         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
11209 echo "configure:11210: checking existence of sys_errlist" >&5
11210         if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
11211   echo $ac_n "(cached) $ac_c" 1>&6
11212 else
11213   
11214                 cat > conftest.$ac_ext <<EOF
11215 #line 11216 "configure"
11216 #include "confdefs.h"
11217 #include <errno.h>
11218 int main() {
11219 char *c = (char *) *sys_errlist
11220 ; return 0; }
11221 EOF
11222 if { (eval echo configure:11223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11223   rm -rf conftest*
11224   ol_cv_have_sys_errlist=yes
11225 else
11226   echo "configure: failed program was:" >&5
11227   cat conftest.$ac_ext >&5
11228   rm -rf conftest*
11229   ol_cv_have_sys_errlist=no
11230 fi
11231 rm -f conftest*
11232 fi
11233
11234         echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
11235         if test $ol_cv_have_sys_errlist = yes ; then
11236                 cat >> confdefs.h <<\EOF
11237 #define HAVE_SYS_ERRLIST 1
11238 EOF
11239
11240         fi
11241 fi
11242
11243
11244
11245 if test "$ol_enable_debug" != no ; then
11246         cat >> confdefs.h <<\EOF
11247 #define LDAP_DEBUG 1
11248 EOF
11249
11250 fi
11251 if test "$ol_enable_syslog" = yes ; then
11252         cat >> confdefs.h <<\EOF
11253 #define LDAP_SYSLOG 1
11254 EOF
11255
11256 fi
11257 if test "$ol_enable_libui" = yes ; then
11258         cat >> confdefs.h <<\EOF
11259 #define LDAP_LIBUI 1
11260 EOF
11261
11262 fi
11263 if test "$ol_enable_cache" = no ; then
11264         cat >> confdefs.h <<\EOF
11265 #define LDAP_NOCACHE 1
11266 EOF
11267
11268 fi
11269 if test "$ol_enable_dns" != no ; then
11270         cat >> confdefs.h <<\EOF
11271 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS LDAP_VENDOR_VERSION
11272 EOF
11273
11274 fi
11275 if test "$ol_enable_proctitle" != no ; then
11276         cat >> confdefs.h <<\EOF
11277 #define LDAP_PROCTITLE 1
11278 EOF
11279
11280 fi
11281 if test "$ol_enable_referrals" != no ; then
11282         cat >> confdefs.h <<\EOF
11283 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
11284 EOF
11285
11286 fi
11287 if test "$ol_enable_cldap" != no ; then
11288         cat >> confdefs.h <<\EOF
11289 #define LDAP_CONNECTIONLESS 1
11290 EOF
11291
11292 fi
11293
11294 if test "$ol_enable_aclgroups" != no ; then
11295         cat >> confdefs.h <<\EOF
11296 #define SLAPD_ACLGROUPS 1
11297 EOF
11298
11299 fi
11300 if test "$ol_enable_crypt" != no ; then
11301         cat >> confdefs.h <<\EOF
11302 #define SLAPD_CRYPT 1
11303 EOF
11304
11305 fi
11306 if test "$ol_enable_cleartext" != no ; then
11307         cat >> confdefs.h <<\EOF
11308 #define SLAPD_CLEARTEXT 1
11309 EOF
11310
11311 fi
11312 if test "$ol_enable_phonetic" != no ; then
11313         cat >> confdefs.h <<\EOF
11314 #define SLAPD_PHONETIC 1
11315 EOF
11316
11317 fi
11318 if test "$ol_enable_rlookups" != no ; then
11319         cat >> confdefs.h <<\EOF
11320 #define SLAPD_RLOOKUPS 1
11321 EOF
11322
11323 fi
11324
11325 if test "$ol_link_modules" != no ; then
11326         cat >> confdefs.h <<\EOF
11327 #define SLAPD_MODULES 1
11328 EOF
11329
11330         BUILD_SLAPD=yes
11331 fi
11332
11333 if test "$ol_link_bdb2" != no ; then
11334         cat >> confdefs.h <<\EOF
11335 #define SLAPD_BDB2 1
11336 EOF
11337
11338         BUILD_SLAPD=yes
11339         BUILD_BDB2=yes
11340 fi
11341
11342 if test "$ol_enable_ldap" != no ; then
11343         cat >> confdefs.h <<\EOF
11344 #define SLAPD_LDAP 1
11345 EOF
11346
11347         BUILD_SLAPD=yes
11348         BUILD_LDAP=yes
11349 fi
11350
11351 if test "$ol_link_ldbm" != no ; then
11352         cat >> confdefs.h <<\EOF
11353 #define SLAPD_LDBM 1
11354 EOF
11355
11356         BUILD_SLAPD=yes
11357         BUILD_LDBM=yes
11358 fi
11359
11360 if test "$ol_enable_passwd" != no ; then
11361         cat >> confdefs.h <<\EOF
11362 #define SLAPD_PASSWD 1
11363 EOF
11364
11365         BUILD_SLAPD=yes
11366         BUILD_PASSWD=yes
11367 fi
11368
11369 if test "$ol_link_perl" != no ; then
11370         cat >> confdefs.h <<\EOF
11371 #define SLAPD_PERL 1
11372 EOF
11373
11374         BUILD_SLAPD=yes
11375         BUILD_PERL=yes
11376 fi
11377
11378 if test "$ol_enable_shell" != no ; then
11379         cat >> confdefs.h <<\EOF
11380 #define SLAPD_SHELL 1
11381 EOF
11382
11383         BUILD_SLAPD=yes
11384         BUILD_SHELL=yes
11385 fi
11386
11387 if test "$ol_enable_tcl" != no ; then
11388         cat >> confdefs.h <<\EOF
11389 #define SLAPD_TCL 1
11390 EOF
11391
11392         BUILD_SLAPD=yes
11393         BUILD_TCL=yes
11394 fi
11395
11396 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
11397         $BUILD_SLAPD = yes ; then
11398         BUILD_SLURPD=yes
11399 fi
11400
11401 if test "$ol_link_isode" != no ; then
11402         BUILD_LDAPD=yes
11403 fi
11404
11405
11406
11407
11408   
11409   
11410   
11411   
11412   
11413   
11414   
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437 trap '' 1 2 15
11438
11439 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
11440
11441 test "x$prefix" = xNONE && prefix=$ac_default_prefix
11442 # Let make expand exec_prefix.
11443 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
11444
11445 # Any assignment to VPATH causes Sun make to only execute
11446 # the first set of double-colon rules, so remove it if not needed.
11447 # If there is a colon in the path, we need to keep it.
11448 if test "x$srcdir" = x.; then
11449   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
11450 fi
11451
11452 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
11453
11454 DEFS=-DHAVE_CONFIG_H
11455
11456 # Without the "./", some shells look in PATH for config.status.
11457 : ${CONFIG_STATUS=./config.status}
11458
11459 echo creating $CONFIG_STATUS
11460 rm -f $CONFIG_STATUS
11461 cat > $CONFIG_STATUS <<EOF
11462 #! /bin/sh
11463 # Generated automatically by configure.
11464 # Run this file to recreate the current configuration.
11465 # This directory was configured as follows,
11466 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
11467 #
11468 # $0 $ac_configure_args
11469 #
11470 # Compiler output produced by configure, useful for debugging
11471 # configure, is in ./config.log if it exists.
11472
11473 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
11474 for ac_option
11475 do
11476   case "\$ac_option" in
11477   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
11478     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
11479     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
11480   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
11481     echo "$CONFIG_STATUS generated by autoconf version 2.13"
11482     exit 0 ;;
11483   -help | --help | --hel | --he | --h)
11484     echo "\$ac_cs_usage"; exit 0 ;;
11485   *) echo "\$ac_cs_usage"; exit 1 ;;
11486   esac
11487 done
11488
11489 ac_given_srcdir=$srcdir
11490 ac_given_INSTALL="$INSTALL"
11491
11492 trap 'rm -fr `echo "\
11493 Makefile:build/top.mk:Makefile.in:build/dir.mk \
11494 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
11495 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
11496 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
11497 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
11498 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
11499 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
11500 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
11501 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
11502 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
11503 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
11504 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
11505 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
11506 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
11507 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
11508 include/Makefile:build/top.mk:include/Makefile.in \
11509 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
11510 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
11511 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11512 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11513 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
11514 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
11515 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
11516 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
11517 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
11518 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
11519 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
11520 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
11521 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \
11522 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
11523 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
11524 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
11525 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
11526 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
11527 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
11528 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
11529 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
11530 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
11531 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
11532 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
11533 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
11534 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
11535  include/portable.h include/ldap_features.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
11536 EOF
11537 cat >> $CONFIG_STATUS <<EOF
11538
11539 # Protect against being on the right side of a sed subst in config.status.
11540 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
11541  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
11542 $ac_vpsub
11543 $extrasub
11544 s%@SHELL@%$SHELL%g
11545 s%@CFLAGS@%$CFLAGS%g
11546 s%@CPPFLAGS@%$CPPFLAGS%g
11547 s%@CXXFLAGS@%$CXXFLAGS%g
11548 s%@FFLAGS@%$FFLAGS%g
11549 s%@DEFS@%$DEFS%g
11550 s%@LDFLAGS@%$LDFLAGS%g
11551 s%@LIBS@%$LIBS%g
11552 s%@exec_prefix@%$exec_prefix%g
11553 s%@prefix@%$prefix%g
11554 s%@program_transform_name@%$program_transform_name%g
11555 s%@bindir@%$bindir%g
11556 s%@sbindir@%$sbindir%g
11557 s%@libexecdir@%$libexecdir%g
11558 s%@datadir@%$datadir%g
11559 s%@sysconfdir@%$sysconfdir%g
11560 s%@sharedstatedir@%$sharedstatedir%g
11561 s%@localstatedir@%$localstatedir%g
11562 s%@libdir@%$libdir%g
11563 s%@includedir@%$includedir%g
11564 s%@oldincludedir@%$oldincludedir%g
11565 s%@infodir@%$infodir%g
11566 s%@mandir@%$mandir%g
11567 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
11568 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
11569 s%@INSTALL_DATA@%$INSTALL_DATA%g
11570 s%@PACKAGE@%$PACKAGE%g
11571 s%@VERSION@%$VERSION%g
11572 s%@ACLOCAL@%$ACLOCAL%g
11573 s%@AUTOCONF@%$AUTOCONF%g
11574 s%@AUTOMAKE@%$AUTOMAKE%g
11575 s%@AUTOHEADER@%$AUTOHEADER%g
11576 s%@MAKEINFO@%$MAKEINFO%g
11577 s%@SET_MAKE@%$SET_MAKE%g
11578 s%@top_builddir@%$top_builddir%g
11579 s%@ldap_subdir@%$ldap_subdir%g
11580 s%@host@%$host%g
11581 s%@host_alias@%$host_alias%g
11582 s%@host_cpu@%$host_cpu%g
11583 s%@host_vendor@%$host_vendor%g
11584 s%@host_os@%$host_os%g
11585 s%@RANLIB@%$RANLIB%g
11586 s%@CC@%$CC%g
11587 s%@LD@%$LD%g
11588 s%@NM@%$NM%g
11589 s%@LN_S@%$LN_S%g
11590 s%@LIBTOOL@%$LIBTOOL%g
11591 s%@AWK@%$AWK%g
11592 s%@LN_H@%$LN_H%g
11593 s%@SENDMAIL@%$SENDMAIL%g
11594 s%@EDITOR@%$EDITOR%g
11595 s%@FINGER@%$FINGER%g
11596 s%@GLIBCONFIG@%$GLIBCONFIG%g
11597 s%@PERLBIN@%$PERLBIN%g
11598 s%@CPP@%$CPP%g
11599 s%@EXEEXT@%$EXEEXT%g
11600 s%@OBJEXT@%$OBJEXT%g
11601 s%@PEPSY@%$PEPSY%g
11602 s%@LIBOBJS@%$LIBOBJS%g
11603 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
11604 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
11605 s%@BUILD_BDB2@%$BUILD_BDB2%g
11606 s%@BUILD_LDAP@%$BUILD_LDAP%g
11607 s%@BUILD_LDBM@%$BUILD_LDBM%g
11608 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
11609 s%@BUILD_PERL@%$BUILD_PERL%g
11610 s%@BUILD_SHELL@%$BUILD_SHELL%g
11611 s%@BUILD_TCL@%$BUILD_TCL%g
11612 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
11613 s%@LDAP_LIBS@%$LDAP_LIBS%g
11614 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
11615 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
11616 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
11617 s%@LDBM_LIBS@%$LDBM_LIBS%g
11618 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
11619 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
11620 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
11621 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
11622 s%@SLAPD_PERL_CPPFLAGS@%$SLAPD_PERL_CPPFLAGS%g
11623 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
11624 s%@KRB_LIBS@%$KRB_LIBS%g
11625 s%@READLINE_LIBS@%$READLINE_LIBS%g
11626 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
11627 s%@TLS_LIBS@%$TLS_LIBS%g
11628
11629 CEOF
11630 EOF
11631
11632 cat >> $CONFIG_STATUS <<\EOF
11633
11634 # Split the substitutions into bite-sized pieces for seds with
11635 # small command number limits, like on Digital OSF/1 and HP-UX.
11636 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
11637 ac_file=1 # Number of current file.
11638 ac_beg=1 # First line for current file.
11639 ac_end=$ac_max_sed_cmds # Line after last line for current file.
11640 ac_more_lines=:
11641 ac_sed_cmds=""
11642 while $ac_more_lines; do
11643   if test $ac_beg -gt 1; then
11644     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
11645   else
11646     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
11647   fi
11648   if test ! -s conftest.s$ac_file; then
11649     ac_more_lines=false
11650     rm -f conftest.s$ac_file
11651   else
11652     if test -z "$ac_sed_cmds"; then
11653       ac_sed_cmds="sed -f conftest.s$ac_file"
11654     else
11655       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
11656     fi
11657     ac_file=`expr $ac_file + 1`
11658     ac_beg=$ac_end
11659     ac_end=`expr $ac_end + $ac_max_sed_cmds`
11660   fi
11661 done
11662 if test -z "$ac_sed_cmds"; then
11663   ac_sed_cmds=cat
11664 fi
11665 EOF
11666
11667 cat >> $CONFIG_STATUS <<EOF
11668
11669 CONFIG_FILES=\${CONFIG_FILES-"\
11670 Makefile:build/top.mk:Makefile.in:build/dir.mk \
11671 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
11672 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
11673 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
11674 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
11675 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
11676 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
11677 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
11678 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
11679 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
11680 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
11681 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
11682 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
11683 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
11684 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
11685 include/Makefile:build/top.mk:include/Makefile.in \
11686 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
11687 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
11688 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11689 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11690 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
11691 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
11692 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
11693 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
11694 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
11695 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
11696 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
11697 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
11698 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \
11699 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
11700 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
11701 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
11702 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
11703 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
11704 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
11705 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
11706 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
11707 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
11708 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
11709 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
11710 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
11711 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
11712 "}
11713 EOF
11714 cat >> $CONFIG_STATUS <<\EOF
11715 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
11716   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
11717   case "$ac_file" in
11718   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
11719        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
11720   *) ac_file_in="${ac_file}.in" ;;
11721   esac
11722
11723   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
11724
11725   # Remove last slash and all that follows it.  Not all systems have dirname.
11726   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
11727   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
11728     # The file is in a subdirectory.
11729     test ! -d "$ac_dir" && mkdir "$ac_dir"
11730     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
11731     # A "../" for each directory in $ac_dir_suffix.
11732     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
11733   else
11734     ac_dir_suffix= ac_dots=
11735   fi
11736
11737   case "$ac_given_srcdir" in
11738   .)  srcdir=.
11739       if test -z "$ac_dots"; then top_srcdir=.
11740       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
11741   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
11742   *) # Relative path.
11743     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
11744     top_srcdir="$ac_dots$ac_given_srcdir" ;;
11745   esac
11746
11747   case "$ac_given_INSTALL" in
11748   [/$]*) INSTALL="$ac_given_INSTALL" ;;
11749   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
11750   esac
11751
11752   echo creating "$ac_file"
11753   rm -f "$ac_file"
11754   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
11755   case "$ac_file" in
11756   *Makefile*) ac_comsub="1i\\
11757 # $configure_input" ;;
11758   *) ac_comsub= ;;
11759   esac
11760
11761   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
11762   sed -e "$ac_comsub
11763 s%@configure_input@%$configure_input%g
11764 s%@srcdir@%$srcdir%g
11765 s%@top_srcdir@%$top_srcdir%g
11766 s%@INSTALL@%$INSTALL%g
11767 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
11768 fi; done
11769 rm -f conftest.s*
11770
11771 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
11772 # NAME is the cpp macro being defined and VALUE is the value it is being given.
11773 #
11774 # ac_d sets the value in "#define NAME VALUE" lines.
11775 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
11776 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
11777 ac_dC='\3'
11778 ac_dD='%g'
11779 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
11780 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
11781 ac_uB='\([      ]\)%\1#\2define\3'
11782 ac_uC=' '
11783 ac_uD='\4%g'
11784 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
11785 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
11786 ac_eB='$%\1#\2define\3'
11787 ac_eC=' '
11788 ac_eD='%g'
11789
11790 if test "${CONFIG_HEADERS+set}" != set; then
11791 EOF
11792 cat >> $CONFIG_STATUS <<EOF
11793   CONFIG_HEADERS="include/portable.h include/ldap_features.h"
11794 EOF
11795 cat >> $CONFIG_STATUS <<\EOF
11796 fi
11797 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
11798   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
11799   case "$ac_file" in
11800   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
11801        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
11802   *) ac_file_in="${ac_file}.in" ;;
11803   esac
11804
11805   echo creating $ac_file
11806
11807   rm -f conftest.frag conftest.in conftest.out
11808   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
11809   cat $ac_file_inputs > conftest.in
11810
11811 EOF
11812
11813 # Transform confdefs.h into a sed script conftest.vals that substitutes
11814 # the proper values into config.h.in to produce config.h.  And first:
11815 # Protect against being on the right side of a sed subst in config.status.
11816 # Protect against being in an unquoted here document in config.status.
11817 rm -f conftest.vals
11818 cat > conftest.hdr <<\EOF
11819 s/[\\&%]/\\&/g
11820 s%[\\$`]%\\&%g
11821 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
11822 s%ac_d%ac_u%gp
11823 s%ac_u%ac_e%gp
11824 EOF
11825 sed -n -f conftest.hdr confdefs.h > conftest.vals
11826 rm -f conftest.hdr
11827
11828 # This sed command replaces #undef with comments.  This is necessary, for
11829 # example, in the case of _POSIX_SOURCE, which is predefined and required
11830 # on some systems where configure will not decide to define it.
11831 cat >> conftest.vals <<\EOF
11832 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
11833 EOF
11834
11835 # Break up conftest.vals because some shells have a limit on
11836 # the size of here documents, and old seds have small limits too.
11837
11838 rm -f conftest.tail
11839 while :
11840 do
11841   ac_lines=`grep -c . conftest.vals`
11842   # grep -c gives empty output for an empty file on some AIX systems.
11843   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
11844   # Write a limited-size here document to conftest.frag.
11845   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
11846   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
11847   echo 'CEOF
11848   sed -f conftest.frag conftest.in > conftest.out
11849   rm -f conftest.in
11850   mv conftest.out conftest.in
11851 ' >> $CONFIG_STATUS
11852   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
11853   rm -f conftest.vals
11854   mv conftest.tail conftest.vals
11855 done
11856 rm -f conftest.vals
11857
11858 cat >> $CONFIG_STATUS <<\EOF
11859   rm -f conftest.frag conftest.h
11860   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
11861   cat conftest.in >> conftest.h
11862   rm -f conftest.in
11863   if cmp -s $ac_file conftest.h 2>/dev/null; then
11864     echo "$ac_file is unchanged"
11865     rm -f conftest.h
11866   else
11867     # Remove last slash and all that follows it.  Not all systems have dirname.
11868       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
11869       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
11870       # The file is in a subdirectory.
11871       test ! -d "$ac_dir" && mkdir "$ac_dir"
11872     fi
11873     rm -f $ac_file
11874     mv conftest.h $ac_file
11875   fi
11876 fi; done
11877
11878 EOF
11879 cat >> $CONFIG_STATUS <<EOF
11880
11881 EOF
11882 cat >> $CONFIG_STATUS <<\EOF
11883
11884 date > stamp-h
11885 echo Please \"make depend\" to build dependencies
11886
11887 exit 0
11888 EOF
11889 chmod +x $CONFIG_STATUS
11890 rm -fr confdefs* $ac_clean_files
11891 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
11892