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