]> git.sur5r.net Git - openldap/blob - configure
Fixed missing comma in -ldb check
[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-ldbm       enable ldbm backend (yes)"
71 ac_help="$ac_help
72       --with-ldbm-api   use LDBM API (auto)"
73 ac_help="$ac_help
74       --with-ldbm-type  use LDBM type (auto)"
75 ac_help="$ac_help
76     --enable-passwd     enable passwd backend (no)"
77 ac_help="$ac_help
78     --enable-perl       enable perl backend (no)"
79 ac_help="$ac_help
80     --enable-shell      enable shell backend (no)"
81 ac_help="$ac_help
82     --enable-tcl        enable tcl backend (no)"
83 ac_help="$ac_help
84 SLURPD Options:"
85 ac_help="$ac_help
86   --enable-slurpd       enable building slurpd (auto)"
87 ac_help="$ac_help
88 Library Generation & Linking Options"
89 ac_help="$ac_help
90   --enable-static         build static libraries [default=yes]
91   --enable-static=PKGS    only build shared libraries if the current package
92                           appears as an element in the PKGS list"
93 ac_help="$ac_help
94   --enable-shared         build shared libraries [default=yes]
95   --enable-shared=PKGS    only build shared libraries if the current package
96                           appears as an element in the PKGS list"
97 ac_help="$ac_help
98   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
99
100 # Initialize some variables set by options.
101 # The variables have the same names as the options, with
102 # dashes changed to underlines.
103 build=NONE
104 cache_file=./config.cache
105 exec_prefix=NONE
106 host=NONE
107 no_create=
108 nonopt=NONE
109 no_recursion=
110 prefix=NONE
111 program_prefix=NONE
112 program_suffix=NONE
113 program_transform_name=s,x,x,
114 silent=
115 site=
116 srcdir=
117 target=NONE
118 verbose=
119 x_includes=NONE
120 x_libraries=NONE
121 bindir='${exec_prefix}/bin'
122 sbindir='${exec_prefix}/sbin'
123 libexecdir='${exec_prefix}/libexec'
124 datadir='${prefix}/share'
125 sysconfdir='${prefix}/etc'
126 sharedstatedir='${prefix}/com'
127 localstatedir='${prefix}/var'
128 libdir='${exec_prefix}/lib'
129 includedir='${prefix}/include'
130 oldincludedir='/usr/include'
131 infodir='${prefix}/info'
132 mandir='${prefix}/man'
133
134 # Initialize some other variables.
135 subdirs=
136 MFLAGS= MAKEFLAGS=
137 SHELL=${CONFIG_SHELL-/bin/sh}
138 # Maximum number of lines to put in a shell here document.
139 ac_max_here_lines=12
140
141 ac_prev=
142 for ac_option
143 do
144
145   # If the previous option needs an argument, assign it.
146   if test -n "$ac_prev"; then
147     eval "$ac_prev=\$ac_option"
148     ac_prev=
149     continue
150   fi
151
152   case "$ac_option" in
153   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
154   *) ac_optarg= ;;
155   esac
156
157   # Accept the important Cygnus configure options, so we can diagnose typos.
158
159   case "$ac_option" in
160
161   -bindir | --bindir | --bindi | --bind | --bin | --bi)
162     ac_prev=bindir ;;
163   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
164     bindir="$ac_optarg" ;;
165
166   -build | --build | --buil | --bui | --bu)
167     ac_prev=build ;;
168   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
169     build="$ac_optarg" ;;
170
171   -cache-file | --cache-file | --cache-fil | --cache-fi \
172   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
173     ac_prev=cache_file ;;
174   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
175   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
176     cache_file="$ac_optarg" ;;
177
178   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
179     ac_prev=datadir ;;
180   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
181   | --da=*)
182     datadir="$ac_optarg" ;;
183
184   -disable-* | --disable-*)
185     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
186     # Reject names that are not valid shell variable names.
187     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
188       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
189     fi
190     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
191     eval "enable_${ac_feature}=no" ;;
192
193   -enable-* | --enable-*)
194     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
195     # Reject names that are not valid shell variable names.
196     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
197       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
198     fi
199     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
200     case "$ac_option" in
201       *=*) ;;
202       *) ac_optarg=yes ;;
203     esac
204     eval "enable_${ac_feature}='$ac_optarg'" ;;
205
206   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
207   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
208   | --exec | --exe | --ex)
209     ac_prev=exec_prefix ;;
210   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
211   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
212   | --exec=* | --exe=* | --ex=*)
213     exec_prefix="$ac_optarg" ;;
214
215   -gas | --gas | --ga | --g)
216     # Obsolete; use --with-gas.
217     with_gas=yes ;;
218
219   -help | --help | --hel | --he)
220     # Omit some internal or obsolete options to make the list less imposing.
221     # This message is too long to be a string in the A/UX 3.1 sh.
222     cat << EOF
223 Usage: configure [options] [host]
224 Options: [defaults in brackets after descriptions]
225 Configuration:
226   --cache-file=FILE       cache test results in FILE
227   --help                  print this message
228   --no-create             do not create output files
229   --quiet, --silent       do not print \`checking...' messages
230   --version               print the version of autoconf that created configure
231 Directory and file names:
232   --prefix=PREFIX         install architecture-independent files in PREFIX
233                           [$ac_default_prefix]
234   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
235                           [same as prefix]
236   --bindir=DIR            user executables in DIR [EPREFIX/bin]
237   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
238   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
239   --datadir=DIR           read-only architecture-independent data in DIR
240                           [PREFIX/share]
241   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
242   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
243                           [PREFIX/com]
244   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
245   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
246   --includedir=DIR        C header files in DIR [PREFIX/include]
247   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
248   --infodir=DIR           info documentation in DIR [PREFIX/info]
249   --mandir=DIR            man documentation in DIR [PREFIX/man]
250   --srcdir=DIR            find the sources in DIR [configure dir or ..]
251   --program-prefix=PREFIX prepend PREFIX to installed program names
252   --program-suffix=SUFFIX append SUFFIX to installed program names
253   --program-transform-name=PROGRAM
254                           run sed PROGRAM on installed program names
255 EOF
256     cat << EOF
257 Host type:
258   --build=BUILD           configure for building on BUILD [BUILD=HOST]
259   --host=HOST             configure for HOST [guessed]
260   --target=TARGET         configure for TARGET [TARGET=HOST]
261 Features and packages:
262   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
263   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
264   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
265   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
266   --x-includes=DIR        X include files are in DIR
267   --x-libraries=DIR       X library files are in DIR
268 EOF
269     if test -n "$ac_help"; then
270       echo "--enable and --with options recognized:$ac_help"
271     fi
272     exit 0 ;;
273
274   -host | --host | --hos | --ho)
275     ac_prev=host ;;
276   -host=* | --host=* | --hos=* | --ho=*)
277     host="$ac_optarg" ;;
278
279   -includedir | --includedir | --includedi | --included | --include \
280   | --includ | --inclu | --incl | --inc)
281     ac_prev=includedir ;;
282   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
283   | --includ=* | --inclu=* | --incl=* | --inc=*)
284     includedir="$ac_optarg" ;;
285
286   -infodir | --infodir | --infodi | --infod | --info | --inf)
287     ac_prev=infodir ;;
288   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
289     infodir="$ac_optarg" ;;
290
291   -libdir | --libdir | --libdi | --libd)
292     ac_prev=libdir ;;
293   -libdir=* | --libdir=* | --libdi=* | --libd=*)
294     libdir="$ac_optarg" ;;
295
296   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
297   | --libexe | --libex | --libe)
298     ac_prev=libexecdir ;;
299   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
300   | --libexe=* | --libex=* | --libe=*)
301     libexecdir="$ac_optarg" ;;
302
303   -localstatedir | --localstatedir | --localstatedi | --localstated \
304   | --localstate | --localstat | --localsta | --localst \
305   | --locals | --local | --loca | --loc | --lo)
306     ac_prev=localstatedir ;;
307   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
308   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
309   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
310     localstatedir="$ac_optarg" ;;
311
312   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
313     ac_prev=mandir ;;
314   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
315     mandir="$ac_optarg" ;;
316
317   -nfp | --nfp | --nf)
318     # Obsolete; use --without-fp.
319     with_fp=no ;;
320
321   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
322   | --no-cr | --no-c)
323     no_create=yes ;;
324
325   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
326   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
327     no_recursion=yes ;;
328
329   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
330   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
331   | --oldin | --oldi | --old | --ol | --o)
332     ac_prev=oldincludedir ;;
333   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
334   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
335   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
336     oldincludedir="$ac_optarg" ;;
337
338   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
339     ac_prev=prefix ;;
340   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
341     prefix="$ac_optarg" ;;
342
343   -program-prefix | --program-prefix | --program-prefi | --program-pref \
344   | --program-pre | --program-pr | --program-p)
345     ac_prev=program_prefix ;;
346   -program-prefix=* | --program-prefix=* | --program-prefi=* \
347   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
348     program_prefix="$ac_optarg" ;;
349
350   -program-suffix | --program-suffix | --program-suffi | --program-suff \
351   | --program-suf | --program-su | --program-s)
352     ac_prev=program_suffix ;;
353   -program-suffix=* | --program-suffix=* | --program-suffi=* \
354   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
355     program_suffix="$ac_optarg" ;;
356
357   -program-transform-name | --program-transform-name \
358   | --program-transform-nam | --program-transform-na \
359   | --program-transform-n | --program-transform- \
360   | --program-transform | --program-transfor \
361   | --program-transfo | --program-transf \
362   | --program-trans | --program-tran \
363   | --progr-tra | --program-tr | --program-t)
364     ac_prev=program_transform_name ;;
365   -program-transform-name=* | --program-transform-name=* \
366   | --program-transform-nam=* | --program-transform-na=* \
367   | --program-transform-n=* | --program-transform-=* \
368   | --program-transform=* | --program-transfor=* \
369   | --program-transfo=* | --program-transf=* \
370   | --program-trans=* | --program-tran=* \
371   | --progr-tra=* | --program-tr=* | --program-t=*)
372     program_transform_name="$ac_optarg" ;;
373
374   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
375   | -silent | --silent | --silen | --sile | --sil)
376     silent=yes ;;
377
378   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
379     ac_prev=sbindir ;;
380   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
381   | --sbi=* | --sb=*)
382     sbindir="$ac_optarg" ;;
383
384   -sharedstatedir | --sharedstatedir | --sharedstatedi \
385   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
386   | --sharedst | --shareds | --shared | --share | --shar \
387   | --sha | --sh)
388     ac_prev=sharedstatedir ;;
389   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
390   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
391   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
392   | --sha=* | --sh=*)
393     sharedstatedir="$ac_optarg" ;;
394
395   -site | --site | --sit)
396     ac_prev=site ;;
397   -site=* | --site=* | --sit=*)
398     site="$ac_optarg" ;;
399
400   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
401     ac_prev=srcdir ;;
402   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
403     srcdir="$ac_optarg" ;;
404
405   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
406   | --syscon | --sysco | --sysc | --sys | --sy)
407     ac_prev=sysconfdir ;;
408   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
409   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
410     sysconfdir="$ac_optarg" ;;
411
412   -target | --target | --targe | --targ | --tar | --ta | --t)
413     ac_prev=target ;;
414   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
415     target="$ac_optarg" ;;
416
417   -v | -verbose | --verbose | --verbos | --verbo | --verb)
418     verbose=yes ;;
419
420   -version | --version | --versio | --versi | --vers)
421     echo "configure generated by autoconf version 2.13"
422     exit 0 ;;
423
424   -with-* | --with-*)
425     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
426     # Reject names that are not valid shell variable names.
427     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
428       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
429     fi
430     ac_package=`echo $ac_package| sed 's/-/_/g'`
431     case "$ac_option" in
432       *=*) ;;
433       *) ac_optarg=yes ;;
434     esac
435     eval "with_${ac_package}='$ac_optarg'" ;;
436
437   -without-* | --without-*)
438     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
439     # Reject names that are not valid shell variable names.
440     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
441       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
442     fi
443     ac_package=`echo $ac_package| sed 's/-/_/g'`
444     eval "with_${ac_package}=no" ;;
445
446   --x)
447     # Obsolete; use --with-x.
448     with_x=yes ;;
449
450   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
451   | --x-incl | --x-inc | --x-in | --x-i)
452     ac_prev=x_includes ;;
453   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
454   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
455     x_includes="$ac_optarg" ;;
456
457   -x-libraries | --x-libraries | --x-librarie | --x-librari \
458   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
459     ac_prev=x_libraries ;;
460   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
461   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
462     x_libraries="$ac_optarg" ;;
463
464   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
465     ;;
466
467   *)
468     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
469       echo "configure: warning: $ac_option: invalid host type" 1>&2
470     fi
471     if test "x$nonopt" != xNONE; then
472       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
473     fi
474     nonopt="$ac_option"
475     ;;
476
477   esac
478 done
479
480 if test -n "$ac_prev"; then
481   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
482 fi
483
484 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
485
486 # File descriptor usage:
487 # 0 standard input
488 # 1 file creation
489 # 2 errors and warnings
490 # 3 some systems may open it to /dev/tty
491 # 4 used on the Kubota Titan
492 # 6 checking for... messages and results
493 # 5 compiler messages saved in config.log
494 if test "$silent" = yes; then
495   exec 6>/dev/null
496 else
497   exec 6>&1
498 fi
499 exec 5>./config.log
500
501 echo "\
502 This file contains any messages produced by compilers while
503 running configure, to aid debugging if configure makes a mistake.
504 " 1>&5
505
506 # Strip out --no-create and --no-recursion so they do not pile up.
507 # Also quote any args containing shell metacharacters.
508 ac_configure_args=
509 for ac_arg
510 do
511   case "$ac_arg" in
512   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
513   | --no-cr | --no-c) ;;
514   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
515   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
516   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
517   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
518   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
519   esac
520 done
521
522 # NLS nuisances.
523 # Only set these to C if already set.  These must not be set unconditionally
524 # because not all systems understand e.g. LANG=C (notably SCO).
525 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
526 # Non-C LC_CTYPE values break the ctype check.
527 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
528 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
529 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
530 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
531
532 # confdefs.h avoids OS command line length limits that DEFS can exceed.
533 rm -rf conftest* confdefs.h
534 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
535 echo > confdefs.h
536
537 # A filename unique to this package, relative to the directory that
538 # configure is in, which we can look for to find out if srcdir is correct.
539 ac_unique_file=include/ldap.h
540
541 # Find the source files, if location was not specified.
542 if test -z "$srcdir"; then
543   ac_srcdir_defaulted=yes
544   # Try the directory containing this script, then its parent.
545   ac_prog=$0
546   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
547   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
548   srcdir=$ac_confdir
549   if test ! -r $srcdir/$ac_unique_file; then
550     srcdir=..
551   fi
552 else
553   ac_srcdir_defaulted=no
554 fi
555 if test ! -r $srcdir/$ac_unique_file; then
556   if test "$ac_srcdir_defaulted" = yes; then
557     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
558   else
559     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
560   fi
561 fi
562 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
563
564 # Prefer explicitly selected file to automatically selected ones.
565 if test -z "$CONFIG_SITE"; then
566   if test "x$prefix" != xNONE; then
567     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
568   else
569     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
570   fi
571 fi
572 for ac_site_file in $CONFIG_SITE; do
573   if test -r "$ac_site_file"; then
574     echo "loading site script $ac_site_file"
575     . "$ac_site_file"
576   fi
577 done
578
579
580 ac_ext=c
581 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
582 ac_cpp='$CPP $CPPFLAGS'
583 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
584 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
585 cross_compiling=$ac_cv_prog_cc_cross
586
587 ac_exeext=
588 ac_objext=o
589 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
590   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
591   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
592     ac_n= ac_c='
593 ' ac_t='        '
594   else
595     ac_n=-n ac_c= ac_t=
596   fi
597 else
598   ac_n= ac_c='\c' ac_t=
599 fi
600
601 ac_aux_dir=
602 for ac_dir in build $srcdir/build; do
603   if test -f $ac_dir/install-sh; then
604     ac_aux_dir=$ac_dir
605     ac_install_sh="$ac_aux_dir/install-sh -c"
606     break
607   elif test -f $ac_dir/install.sh; then
608     ac_aux_dir=$ac_dir
609     ac_install_sh="$ac_aux_dir/install.sh -c"
610     break
611   fi
612 done
613 if test -z "$ac_aux_dir"; then
614   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
615 fi
616 ac_config_guess=$ac_aux_dir/config.guess
617 ac_config_sub=$ac_aux_dir/config.sub
618 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
619 # Find a good install program.  We prefer a C program (faster),
620 # so one script is as good as another.  But avoid the broken or
621 # incompatible versions:
622 # SysV /etc/install, /usr/sbin/install
623 # SunOS /usr/etc/install
624 # IRIX /sbin/install
625 # AIX /bin/install
626 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
627 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
628 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
629 # ./install, which can be erroneously created by make from ./install.sh.
630 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
631 echo "configure:632: checking for a BSD compatible install" >&5
632 if test -z "$INSTALL"; then
633 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
634   echo $ac_n "(cached) $ac_c" 1>&6
635 else
636     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
637   for ac_dir in $PATH; do
638     # Account for people who put trailing slashes in PATH elements.
639     case "$ac_dir/" in
640     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
641     *)
642       # OSF1 and SCO ODT 3.0 have their own names for install.
643       # Don't use installbsd from OSF since it installs stuff as root
644       # by default.
645       for ac_prog in ginstall scoinst install; do
646         if test -f $ac_dir/$ac_prog; then
647           if test $ac_prog = install &&
648             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
649             # AIX install.  It has an incompatible calling convention.
650             :
651           else
652             ac_cv_path_install="$ac_dir/$ac_prog -c"
653             break 2
654           fi
655         fi
656       done
657       ;;
658     esac
659   done
660   IFS="$ac_save_IFS"
661
662 fi
663   if test "${ac_cv_path_install+set}" = set; then
664     INSTALL="$ac_cv_path_install"
665   else
666     # As a last resort, use the slow shell script.  We don't cache a
667     # path for INSTALL within a source directory, because that will
668     # break other packages using the cache if that directory is
669     # removed, or if the path is relative.
670     INSTALL="$ac_install_sh"
671   fi
672 fi
673 echo "$ac_t""$INSTALL" 1>&6
674
675 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
676 # It thinks the first close brace ends the variable substitution.
677 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
678
679 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
680
681 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
682
683 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
684 echo "configure:685: checking whether build environment is sane" >&5
685 # Just in case
686 sleep 1
687 echo timestamp > conftestfile
688 # Do `set' in a subshell so we don't clobber the current shell's
689 # arguments.  Must try -L first in case configure is actually a
690 # symlink; some systems play weird games with the mod time of symlinks
691 # (eg FreeBSD returns the mod time of the symlink's containing
692 # directory).
693 if (
694    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
695    if test "$*" = "X"; then
696       # -L didn't work.
697       set X `ls -t $srcdir/configure conftestfile`
698    fi
699    if test "$*" != "X $srcdir/configure conftestfile" \
700       && test "$*" != "X conftestfile $srcdir/configure"; then
701
702       # If neither matched, then we have a broken ls.  This can happen
703       # if, for instance, CONFIG_SHELL is bash and it inherits a
704       # broken ls alias from the environment.  This has actually
705       # happened.  Such a system could not be considered "sane".
706       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
707 alias in your environment" 1>&2; exit 1; }
708    fi
709
710    test "$2" = conftestfile
711    )
712 then
713    # Ok.
714    :
715 else
716    { echo "configure: error: newly created file is older than distributed files!
717 Check your system clock" 1>&2; exit 1; }
718 fi
719 rm -f conftest*
720 echo "$ac_t""yes" 1>&6
721 if test "$program_transform_name" = s,x,x,; then
722   program_transform_name=
723 else
724   # Double any \ or $.  echo might interpret backslashes.
725   cat <<\EOF_SED > conftestsed
726 s,\\,\\\\,g; s,\$,$$,g
727 EOF_SED
728   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
729   rm -f conftestsed
730 fi
731 test "$program_prefix" != NONE &&
732   program_transform_name="s,^,${program_prefix},; $program_transform_name"
733 # Use a double $ so make ignores it.
734 test "$program_suffix" != NONE &&
735   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
736
737 # sed with no file args requires a program.
738 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
739
740 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
741 echo "configure:742: checking whether ${MAKE-make} sets \${MAKE}" >&5
742 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
743 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
744   echo $ac_n "(cached) $ac_c" 1>&6
745 else
746   cat > conftestmake <<\EOF
747 all:
748         @echo 'ac_maketemp="${MAKE}"'
749 EOF
750 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
751 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
752 if test -n "$ac_maketemp"; then
753   eval ac_cv_prog_make_${ac_make}_set=yes
754 else
755   eval ac_cv_prog_make_${ac_make}_set=no
756 fi
757 rm -f conftestmake
758 fi
759 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
760   echo "$ac_t""yes" 1>&6
761   SET_MAKE=
762 else
763   echo "$ac_t""no" 1>&6
764   SET_MAKE="MAKE=${MAKE-make}"
765 fi
766
767
768 PACKAGE=OpenLDAP
769
770 VERSION=2.0-devel
771
772 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
773   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
774 fi
775 cat >> confdefs.h <<EOF
776 #define PACKAGE "$PACKAGE"
777 EOF
778
779 cat >> confdefs.h <<EOF
780 #define VERSION "$VERSION"
781 EOF
782
783
784
785 missing_dir=`cd $ac_aux_dir && pwd`
786 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
787 echo "configure:788: checking for working aclocal" >&5
788 # Run test in a subshell; some versions of sh will print an error if
789 # an executable is not found, even if stderr is redirected.
790 # Redirect stdin to placate older versions of autoconf.  Sigh.
791 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
792    ACLOCAL=aclocal
793    echo "$ac_t""found" 1>&6
794 else
795    ACLOCAL="$missing_dir/missing aclocal"
796    echo "$ac_t""missing" 1>&6
797 fi
798
799 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
800 echo "configure:801: checking for working autoconf" >&5
801 # Run test in a subshell; some versions of sh will print an error if
802 # an executable is not found, even if stderr is redirected.
803 # Redirect stdin to placate older versions of autoconf.  Sigh.
804 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
805    AUTOCONF=autoconf
806    echo "$ac_t""found" 1>&6
807 else
808    AUTOCONF="$missing_dir/missing autoconf"
809    echo "$ac_t""missing" 1>&6
810 fi
811
812 echo $ac_n "checking for working automake""... $ac_c" 1>&6
813 echo "configure:814: checking for working automake" >&5
814 # Run test in a subshell; some versions of sh will print an error if
815 # an executable is not found, even if stderr is redirected.
816 # Redirect stdin to placate older versions of autoconf.  Sigh.
817 if (automake --version) < /dev/null > /dev/null 2>&1; then
818    AUTOMAKE=automake
819    echo "$ac_t""found" 1>&6
820 else
821    AUTOMAKE="$missing_dir/missing automake"
822    echo "$ac_t""missing" 1>&6
823 fi
824
825 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
826 echo "configure:827: checking for working autoheader" >&5
827 # Run test in a subshell; some versions of sh will print an error if
828 # an executable is not found, even if stderr is redirected.
829 # Redirect stdin to placate older versions of autoconf.  Sigh.
830 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
831    AUTOHEADER=autoheader
832    echo "$ac_t""found" 1>&6
833 else
834    AUTOHEADER="$missing_dir/missing autoheader"
835    echo "$ac_t""missing" 1>&6
836 fi
837
838 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
839 echo "configure:840: checking for working makeinfo" >&5
840 # Run test in a subshell; some versions of sh will print an error if
841 # an executable is not found, even if stderr is redirected.
842 # Redirect stdin to placate older versions of autoconf.  Sigh.
843 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
844    MAKEINFO=makeinfo
845    echo "$ac_t""found" 1>&6
846 else
847    MAKEINFO="$missing_dir/missing makeinfo"
848    echo "$ac_t""missing" 1>&6
849 fi
850
851
852
853
854
855
856 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
857 echo "configure:858: checking configure arguments" >&5
858
859
860 top_builddir=`pwd`
861
862 cat >> confdefs.h <<\EOF
863 #define HAVE_MKVERSION 1
864 EOF
865
866
867 ldap_subdir="openldap"
868
869 # Check whether --with-subdir or --without-subdir was given.
870 if test "${with_subdir+set}" = set; then
871   withval="$with_subdir"
872   
873         if test "$withval" = "no"; then
874                 ldap_subdir=""
875         elif test "$withval" != "yes"; then
876                 ldap_subdir="$withval"
877         fi
878
879 fi
880
881
882 # OpenLDAP --enable-debug
883         # Check whether --enable-debug or --disable-debug was given.
884 if test "${enable_debug+set}" = set; then
885   enableval="$enable_debug"
886   
887         ol_arg=invalid
888         for ol_val in auto yes no ; do
889                 if test "$enableval" = "$ol_val" ; then
890                         ol_arg="$ol_val"
891                 fi
892         done
893         if test "$ol_arg" = "invalid" ; then
894                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
895         fi
896         ol_enable_debug="$ol_arg"
897
898 else
899         ol_enable_debug="yes"
900 fi
901 # end --enable-debug
902 # OpenLDAP --enable-syslog
903         # Check whether --enable-syslog or --disable-syslog was given.
904 if test "${enable_syslog+set}" = set; then
905   enableval="$enable_syslog"
906   
907         ol_arg=invalid
908         for ol_val in auto yes no ; do
909                 if test "$enableval" = "$ol_val" ; then
910                         ol_arg="$ol_val"
911                 fi
912         done
913         if test "$ol_arg" = "invalid" ; then
914                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
915         fi
916         ol_enable_syslog="$ol_arg"
917
918 else
919         ol_enable_syslog="auto"
920 fi
921 # end --enable-syslog
922 # OpenLDAP --enable-proctitle
923         # Check whether --enable-proctitle or --disable-proctitle was given.
924 if test "${enable_proctitle+set}" = set; then
925   enableval="$enable_proctitle"
926   
927         ol_arg=invalid
928         for ol_val in auto yes no ; do
929                 if test "$enableval" = "$ol_val" ; then
930                         ol_arg="$ol_val"
931                 fi
932         done
933         if test "$ol_arg" = "invalid" ; then
934                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
935         fi
936         ol_enable_proctitle="$ol_arg"
937
938 else
939         ol_enable_proctitle="yes"
940 fi
941 # end --enable-proctitle
942 # OpenLDAP --enable-cache
943         # Check whether --enable-cache or --disable-cache was given.
944 if test "${enable_cache+set}" = set; then
945   enableval="$enable_cache"
946   
947         ol_arg=invalid
948         for ol_val in auto yes no ; do
949                 if test "$enableval" = "$ol_val" ; then
950                         ol_arg="$ol_val"
951                 fi
952         done
953         if test "$ol_arg" = "invalid" ; then
954                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
955         fi
956         ol_enable_cache="$ol_arg"
957
958 else
959         ol_enable_cache="yes"
960 fi
961 # end --enable-cache
962 # OpenLDAP --enable-dns
963         # Check whether --enable-dns or --disable-dns was given.
964 if test "${enable_dns+set}" = set; then
965   enableval="$enable_dns"
966   
967         ol_arg=invalid
968         for ol_val in auto yes no ; do
969                 if test "$enableval" = "$ol_val" ; then
970                         ol_arg="$ol_val"
971                 fi
972         done
973         if test "$ol_arg" = "invalid" ; then
974                 { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; }
975         fi
976         ol_enable_dns="$ol_arg"
977
978 else
979         ol_enable_dns="no"
980 fi
981 # end --enable-dns
982 # OpenLDAP --enable-referrals
983         # Check whether --enable-referrals or --disable-referrals was given.
984 if test "${enable_referrals+set}" = set; then
985   enableval="$enable_referrals"
986   
987         ol_arg=invalid
988         for ol_val in auto yes no ; do
989                 if test "$enableval" = "$ol_val" ; then
990                         ol_arg="$ol_val"
991                 fi
992         done
993         if test "$ol_arg" = "invalid" ; then
994                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
995         fi
996         ol_enable_referrals="$ol_arg"
997
998 else
999         ol_enable_referrals="yes"
1000 fi
1001 # end --enable-referrals
1002 # OpenLDAP --enable-cldap
1003         # Check whether --enable-cldap or --disable-cldap was given.
1004 if test "${enable_cldap+set}" = set; then
1005   enableval="$enable_cldap"
1006   
1007         ol_arg=invalid
1008         for ol_val in auto yes no ; do
1009                 if test "$enableval" = "$ol_val" ; then
1010                         ol_arg="$ol_val"
1011                 fi
1012         done
1013         if test "$ol_arg" = "invalid" ; then
1014                 { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; }
1015         fi
1016         ol_enable_cldap="$ol_arg"
1017
1018 else
1019         ol_enable_cldap="no"
1020 fi
1021 # end --enable-cldap
1022 # OpenLDAP --enable-x_compile
1023         # Check whether --enable-x_compile or --disable-x_compile was given.
1024 if test "${enable_x_compile+set}" = set; then
1025   enableval="$enable_x_compile"
1026   
1027         ol_arg=invalid
1028         for ol_val in yes no ; do
1029                 if test "$enableval" = "$ol_val" ; then
1030                         ol_arg="$ol_val"
1031                 fi
1032         done
1033         if test "$ol_arg" = "invalid" ; then
1034                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1035         fi
1036         ol_enable_x_compile="$ol_arg"
1037
1038 else
1039         ol_enable_x_compile="no"
1040 fi
1041 # end --enable-x_compile
1042
1043 # OpenLDAP --enable-dmalloc
1044         # Check whether --enable-dmalloc or --disable-dmalloc was given.
1045 if test "${enable_dmalloc+set}" = set; then
1046   enableval="$enable_dmalloc"
1047   
1048         ol_arg=invalid
1049         for ol_val in auto yes no ; do
1050                 if test "$enableval" = "$ol_val" ; then
1051                         ol_arg="$ol_val"
1052                 fi
1053         done
1054         if test "$ol_arg" = "invalid" ; then
1055                 { echo "configure: error: bad value $enableval for --enable-dmalloc" 1>&2; exit 1; }
1056         fi
1057         ol_enable_dmalloc="$ol_arg"
1058
1059 else
1060         ol_enable_dmalloc="no"
1061 fi
1062 # end --enable-dmalloc
1063
1064 # OpenLDAP --with-kerberos
1065         # Check whether --with-kerberos or --without-kerberos was given.
1066 if test "${with_kerberos+set}" = set; then
1067   withval="$with_kerberos"
1068   
1069         ol_arg=invalid
1070         for ol_val in auto k5 k4 afs yes no ; do
1071                 if test "$withval" = "$ol_val" ; then
1072                         ol_arg="$ol_val"
1073                 fi
1074         done
1075         if test "$ol_arg" = "invalid" ; then
1076                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1077         fi
1078         ol_with_kerberos="$ol_arg"
1079
1080 else
1081         ol_with_kerberos="auto"
1082 fi
1083 # end --with-kerberos
1084
1085 # OpenLDAP --with-readline
1086         # Check whether --with-readline or --without-readline was given.
1087 if test "${with_readline+set}" = set; then
1088   withval="$with_readline"
1089   
1090         ol_arg=invalid
1091         for ol_val in auto yes no  ; do
1092                 if test "$withval" = "$ol_val" ; then
1093                         ol_arg="$ol_val"
1094                 fi
1095         done
1096         if test "$ol_arg" = "invalid" ; then
1097                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1098         fi
1099         ol_with_readline="$ol_arg"
1100
1101 else
1102         ol_with_readline="auto"
1103 fi
1104 # end --with-readline
1105
1106 # OpenLDAP --with-threads
1107         # Check whether --with-threads or --without-threads was given.
1108 if test "${with_threads+set}" = set; then
1109   withval="$with_threads"
1110   
1111         ol_arg=invalid
1112         for ol_val in auto posix mach lwp yes no manual  ; do
1113                 if test "$withval" = "$ol_val" ; then
1114                         ol_arg="$ol_val"
1115                 fi
1116         done
1117         if test "$ol_arg" = "invalid" ; then
1118                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1119         fi
1120         ol_with_threads="$ol_arg"
1121
1122 else
1123         ol_with_threads="auto"
1124 fi
1125 # end --with-threads
1126
1127 # OpenLDAP --with-tls
1128         # Check whether --with-tls or --without-tls was given.
1129 if test "${with_tls+set}" = set; then
1130   withval="$with_tls"
1131   
1132         ol_arg=invalid
1133         for ol_val in auto ssleay openssl yes no  ; do
1134                 if test "$withval" = "$ol_val" ; then
1135                         ol_arg="$ol_val"
1136                 fi
1137         done
1138         if test "$ol_arg" = "invalid" ; then
1139                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1140         fi
1141         ol_with_tls="$ol_arg"
1142
1143 else
1144         ol_with_tls="auto"
1145 fi
1146 # end --with-tls
1147
1148 # OpenLDAP --with-yielding_select
1149         # Check whether --with-yielding_select or --without-yielding_select was given.
1150 if test "${with_yielding_select+set}" = set; then
1151   withval="$with_yielding_select"
1152   
1153         ol_arg=invalid
1154         for ol_val in auto yes no manual  ; do
1155                 if test "$withval" = "$ol_val" ; then
1156                         ol_arg="$ol_val"
1157                 fi
1158         done
1159         if test "$ol_arg" = "invalid" ; then
1160                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1161         fi
1162         ol_with_yielding_select="$ol_arg"
1163
1164 else
1165         ol_with_yielding_select="auto"
1166 fi
1167 # end --with-yielding_select
1168
1169
1170
1171 # Check whether --with-xxldapdoptions or --without-xxldapdoptions was given.
1172 if test "${with_xxldapdoptions+set}" = set; then
1173   withval="$with_xxldapdoptions"
1174   :
1175 fi
1176
1177 # OpenLDAP --enable-ldapd
1178         # Check whether --enable-ldapd or --disable-ldapd was given.
1179 if test "${enable_ldapd+set}" = set; then
1180   enableval="$enable_ldapd"
1181   
1182         ol_arg=invalid
1183         for ol_val in auto yes no ; do
1184                 if test "$enableval" = "$ol_val" ; then
1185                         ol_arg="$ol_val"
1186                 fi
1187         done
1188         if test "$ol_arg" = "invalid" ; then
1189                 { echo "configure: error: bad value $enableval for --enable-ldapd" 1>&2; exit 1; }
1190         fi
1191         ol_enable_ldapd="$ol_arg"
1192
1193 else
1194         ol_enable_ldapd="no"
1195 fi
1196 # end --enable-ldapd
1197
1198 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1199 if test "${with_xxslapdoptions+set}" = set; then
1200   withval="$with_xxslapdoptions"
1201   :
1202 fi
1203
1204 # OpenLDAP --enable-slapd
1205         # Check whether --enable-slapd or --disable-slapd was given.
1206 if test "${enable_slapd+set}" = set; then
1207   enableval="$enable_slapd"
1208   
1209         ol_arg=invalid
1210         for ol_val in auto yes no ; do
1211                 if test "$enableval" = "$ol_val" ; then
1212                         ol_arg="$ol_val"
1213                 fi
1214         done
1215         if test "$ol_arg" = "invalid" ; then
1216                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1217         fi
1218         ol_enable_slapd="$ol_arg"
1219
1220 else
1221         ol_enable_slapd="yes"
1222 fi
1223 # end --enable-slapd
1224 # OpenLDAP --enable-aclgroups
1225         # Check whether --enable-aclgroups or --disable-aclgroups was given.
1226 if test "${enable_aclgroups+set}" = set; then
1227   enableval="$enable_aclgroups"
1228   
1229         ol_arg=invalid
1230         for ol_val in auto yes no ; do
1231                 if test "$enableval" = "$ol_val" ; then
1232                         ol_arg="$ol_val"
1233                 fi
1234         done
1235         if test "$ol_arg" = "invalid" ; then
1236                 { echo "configure: error: bad value $enableval for --enable-aclgroups" 1>&2; exit 1; }
1237         fi
1238         ol_enable_aclgroups="$ol_arg"
1239
1240 else
1241         ol_enable_aclgroups="auto"
1242 fi
1243 # end --enable-aclgroups
1244 # OpenLDAP --enable-cleartext
1245         # Check whether --enable-cleartext or --disable-cleartext was given.
1246 if test "${enable_cleartext+set}" = set; then
1247   enableval="$enable_cleartext"
1248   
1249         ol_arg=invalid
1250         for ol_val in auto yes no ; do
1251                 if test "$enableval" = "$ol_val" ; then
1252                         ol_arg="$ol_val"
1253                 fi
1254         done
1255         if test "$ol_arg" = "invalid" ; then
1256                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1257         fi
1258         ol_enable_cleartext="$ol_arg"
1259
1260 else
1261         ol_enable_cleartext="yes"
1262 fi
1263 # end --enable-cleartext
1264 # OpenLDAP --enable-crypt
1265         # Check whether --enable-crypt or --disable-crypt was given.
1266 if test "${enable_crypt+set}" = set; then
1267   enableval="$enable_crypt"
1268   
1269         ol_arg=invalid
1270         for ol_val in auto yes no ; do
1271                 if test "$enableval" = "$ol_val" ; then
1272                         ol_arg="$ol_val"
1273                 fi
1274         done
1275         if test "$ol_arg" = "invalid" ; then
1276                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1277         fi
1278         ol_enable_crypt="$ol_arg"
1279
1280 else
1281         ol_enable_crypt="auto"
1282 fi
1283 # end --enable-crypt
1284 # OpenLDAP --enable-modules
1285         # Check whether --enable-modules or --disable-modules was given.
1286 if test "${enable_modules+set}" = set; then
1287   enableval="$enable_modules"
1288   
1289         ol_arg=invalid
1290         for ol_val in auto yes no ; do
1291                 if test "$enableval" = "$ol_val" ; then
1292                         ol_arg="$ol_val"
1293                 fi
1294         done
1295         if test "$ol_arg" = "invalid" ; then
1296                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1297         fi
1298         ol_enable_modules="$ol_arg"
1299
1300 else
1301         ol_enable_modules="no"
1302 fi
1303 # end --enable-modules
1304 # OpenLDAP --enable-phonetic
1305         # Check whether --enable-phonetic or --disable-phonetic was given.
1306 if test "${enable_phonetic+set}" = set; then
1307   enableval="$enable_phonetic"
1308   
1309         ol_arg=invalid
1310         for ol_val in auto yes no ; do
1311                 if test "$enableval" = "$ol_val" ; then
1312                         ol_arg="$ol_val"
1313                 fi
1314         done
1315         if test "$ol_arg" = "invalid" ; then
1316                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1317         fi
1318         ol_enable_phonetic="$ol_arg"
1319
1320 else
1321         ol_enable_phonetic="no"
1322 fi
1323 # end --enable-phonetic
1324 # OpenLDAP --enable-rlookups
1325         # Check whether --enable-rlookups or --disable-rlookups was given.
1326 if test "${enable_rlookups+set}" = set; then
1327   enableval="$enable_rlookups"
1328   
1329         ol_arg=invalid
1330         for ol_val in auto yes no ; do
1331                 if test "$enableval" = "$ol_val" ; then
1332                         ol_arg="$ol_val"
1333                 fi
1334         done
1335         if test "$ol_arg" = "invalid" ; then
1336                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1337         fi
1338         ol_enable_rlookups="$ol_arg"
1339
1340 else
1341         ol_enable_rlookups="auto"
1342 fi
1343 # end --enable-rlookups
1344 # OpenLDAP --enable-wrappers
1345         # Check whether --enable-wrappers or --disable-wrappers was given.
1346 if test "${enable_wrappers+set}" = set; then
1347   enableval="$enable_wrappers"
1348   
1349         ol_arg=invalid
1350         for ol_val in auto yes no ; do
1351                 if test "$enableval" = "$ol_val" ; then
1352                         ol_arg="$ol_val"
1353                 fi
1354         done
1355         if test "$ol_arg" = "invalid" ; then
1356                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1357         fi
1358         ol_enable_wrappers="$ol_arg"
1359
1360 else
1361         ol_enable_wrappers="no"
1362 fi
1363 # end --enable-wrappers
1364
1365 # OpenLDAP --enable-bdb2
1366         # Check whether --enable-bdb2 or --disable-bdb2 was given.
1367 if test "${enable_bdb2+set}" = set; then
1368   enableval="$enable_bdb2"
1369   
1370         ol_arg=invalid
1371         for ol_val in auto yes no ; do
1372                 if test "$enableval" = "$ol_val" ; then
1373                         ol_arg="$ol_val"
1374                 fi
1375         done
1376         if test "$ol_arg" = "invalid" ; then
1377                 { echo "configure: error: bad value $enableval for --enable-bdb2" 1>&2; exit 1; }
1378         fi
1379         ol_enable_bdb2="$ol_arg"
1380
1381 else
1382         ol_enable_bdb2="no"
1383 fi
1384 # end --enable-bdb2
1385 # OpenLDAP --enable-ldbm
1386         # Check whether --enable-ldbm or --disable-ldbm was given.
1387 if test "${enable_ldbm+set}" = set; then
1388   enableval="$enable_ldbm"
1389   
1390         ol_arg=invalid
1391         for ol_val in auto yes no ; do
1392                 if test "$enableval" = "$ol_val" ; then
1393                         ol_arg="$ol_val"
1394                 fi
1395         done
1396         if test "$ol_arg" = "invalid" ; then
1397                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1398         fi
1399         ol_enable_ldbm="$ol_arg"
1400
1401 else
1402         ol_enable_ldbm="yes"
1403 fi
1404 # end --enable-ldbm
1405 # OpenLDAP --with-ldbm_api
1406         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1407 if test "${with_ldbm_api+set}" = set; then
1408   withval="$with_ldbm_api"
1409   
1410         ol_arg=invalid
1411         for ol_val in auto db2 db mdbm gdbm ndbm manual ; do
1412                 if test "$withval" = "$ol_val" ; then
1413                         ol_arg="$ol_val"
1414                 fi
1415         done
1416         if test "$ol_arg" = "invalid" ; then
1417                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1418         fi
1419         ol_with_ldbm_api="$ol_arg"
1420
1421 else
1422         ol_with_ldbm_api="auto"
1423 fi
1424 # end --with-ldbm_api
1425
1426 # OpenLDAP --with-ldbm_type
1427         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1428 if test "${with_ldbm_type+set}" = set; then
1429   withval="$with_ldbm_type"
1430   
1431         ol_arg=invalid
1432         for ol_val in auto btree hash ; do
1433                 if test "$withval" = "$ol_val" ; then
1434                         ol_arg="$ol_val"
1435                 fi
1436         done
1437         if test "$ol_arg" = "invalid" ; then
1438                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1439         fi
1440         ol_with_ldbm_type="$ol_arg"
1441
1442 else
1443         ol_with_ldbm_type="auto"
1444 fi
1445 # end --with-ldbm_type
1446
1447
1448 # OpenLDAP --enable-passwd
1449         # Check whether --enable-passwd or --disable-passwd was given.
1450 if test "${enable_passwd+set}" = set; then
1451   enableval="$enable_passwd"
1452   
1453         ol_arg=invalid
1454         for ol_val in auto yes no ; do
1455                 if test "$enableval" = "$ol_val" ; then
1456                         ol_arg="$ol_val"
1457                 fi
1458         done
1459         if test "$ol_arg" = "invalid" ; then
1460                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1461         fi
1462         ol_enable_passwd="$ol_arg"
1463
1464 else
1465         ol_enable_passwd="no"
1466 fi
1467 # end --enable-passwd
1468 # OpenLDAP --enable-perl
1469         # Check whether --enable-perl or --disable-perl was given.
1470 if test "${enable_perl+set}" = set; then
1471   enableval="$enable_perl"
1472   
1473         ol_arg=invalid
1474         for ol_val in auto yes no ; do
1475                 if test "$enableval" = "$ol_val" ; then
1476                         ol_arg="$ol_val"
1477                 fi
1478         done
1479         if test "$ol_arg" = "invalid" ; then
1480                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
1481         fi
1482         ol_enable_perl="$ol_arg"
1483
1484 else
1485         ol_enable_perl="no"
1486 fi
1487 # end --enable-perl
1488 # OpenLDAP --enable-shell
1489         # Check whether --enable-shell or --disable-shell was given.
1490 if test "${enable_shell+set}" = set; then
1491   enableval="$enable_shell"
1492   
1493         ol_arg=invalid
1494         for ol_val in auto yes no ; do
1495                 if test "$enableval" = "$ol_val" ; then
1496                         ol_arg="$ol_val"
1497                 fi
1498         done
1499         if test "$ol_arg" = "invalid" ; then
1500                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
1501         fi
1502         ol_enable_shell="$ol_arg"
1503
1504 else
1505         ol_enable_shell="no"
1506 fi
1507 # end --enable-shell
1508 # OpenLDAP --enable-tcl
1509         # Check whether --enable-tcl or --disable-tcl was given.
1510 if test "${enable_tcl+set}" = set; then
1511   enableval="$enable_tcl"
1512   
1513         ol_arg=invalid
1514         for ol_val in auto yes no ; do
1515                 if test "$enableval" = "$ol_val" ; then
1516                         ol_arg="$ol_val"
1517                 fi
1518         done
1519         if test "$ol_arg" = "invalid" ; then
1520                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
1521         fi
1522         ol_enable_tcl="$ol_arg"
1523
1524 else
1525         ol_enable_tcl="no"
1526 fi
1527 # end --enable-tcl
1528
1529 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
1530 if test "${with_xxslurpdoptions+set}" = set; then
1531   withval="$with_xxslurpdoptions"
1532   :
1533 fi
1534
1535 # OpenLDAP --enable-slurpd
1536         # Check whether --enable-slurpd or --disable-slurpd was given.
1537 if test "${enable_slurpd+set}" = set; then
1538   enableval="$enable_slurpd"
1539   
1540         ol_arg=invalid
1541         for ol_val in auto yes no ; do
1542                 if test "$enableval" = "$ol_val" ; then
1543                         ol_arg="$ol_val"
1544                 fi
1545         done
1546         if test "$ol_arg" = "invalid" ; then
1547                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
1548         fi
1549         ol_enable_slurpd="$ol_arg"
1550
1551 else
1552         ol_enable_slurpd="auto"
1553 fi
1554 # end --enable-slurpd
1555
1556 # Check whether --with-xxliboptions or --without-xxliboptions was given.
1557 if test "${with_xxliboptions+set}" = set; then
1558   withval="$with_xxliboptions"
1559   :
1560 fi
1561
1562 # Check whether --enable-static or --disable-static was given.
1563 if test "${enable_static+set}" = set; then
1564   enableval="$enable_static"
1565   p=${PACKAGE-default}
1566 case "$enableval" in
1567 yes) enable_static=yes ;;
1568 no) enable_static=no ;;
1569 *)
1570   enable_static=no
1571   # Look at the argument we got.  We use all the common list separators.
1572   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1573   for pkg in $enableval; do
1574     if test "X$pkg" = "X$p"; then
1575       enable_static=yes
1576     fi
1577   done
1578   IFS="$ac_save_ifs"
1579   ;;
1580 esac
1581 else
1582   enable_static=yes
1583 fi
1584
1585 # Check whether --enable-shared or --disable-shared was given.
1586 if test "${enable_shared+set}" = set; then
1587   enableval="$enable_shared"
1588   p=${PACKAGE-default}
1589 case "$enableval" in
1590 yes) enable_shared=yes ;;
1591 no) enable_shared=no ;;
1592 *)
1593   enable_shared=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_shared=yes
1599     fi
1600   done
1601   IFS="$ac_save_ifs"
1602   ;;
1603 esac
1604 else
1605   enable_shared=yes
1606 fi
1607
1608
1609 # validate options
1610 if test $ol_enable_dns = yes ; then
1611         if test $ol_enable_referrals = no ; then
1612                 { echo "configure: error: DNS requires --enable-referrals" 1>&2; exit 1; }
1613         fi
1614         if test $ol_enable_referrals = auto ; then
1615                 echo "configure: warning: DNS requires referrals, adding --enable-referrals" 1>&2
1616                 ol_enable_referrals=yes
1617         fi
1618 fi
1619
1620 if test $ol_enable_slapd = no ; then
1621                 if test $ol_enable_bdb2 = yes ; then
1622                 echo "configure: warning: slapd disabled, ignoring --enable_bdb2 argument" 1>&2
1623         fi
1624         if test $ol_enable_ldbm = yes ; then
1625                 echo "configure: warning: slapd disabled, ignoring --enable_ldbm argument" 1>&2
1626         fi
1627         if test $ol_enable_passwd = yes ; then
1628                 echo "configure: warning: slapd disabled, ignoring --enable_passwd argument" 1>&2
1629         fi
1630         if test $ol_enable_perl = yes ; then
1631                 echo "configure: warning: slapd disabled, ignoring --enable_perl argument" 1>&2
1632         fi
1633         if test $ol_enable_shell = yes ; then
1634                 echo "configure: warning: slapd disabled, ignoring --enable_shell argument" 1>&2
1635         fi
1636         if test $ol_enable_tcl = yes ; then
1637                 echo "configure: warning: slapd disabled, ignoring --enable_tcl argument" 1>&2
1638         fi
1639         if test $ol_enable_aclgroups = yes ; then
1640                 echo "configure: warning: slapd disabled, ignoring --enable_aclgroups argument" 1>&2
1641         fi
1642         if test $ol_enable_modules = yes ; then
1643                 echo "configure: warning: slapd disabled, ignoring --enable_modules argument" 1>&2
1644         fi
1645         if test $ol_enable_wrappers = yes ; then
1646                 echo "configure: warning: slapd disabled, ignoring --enable_wrappers argument" 1>&2
1647         fi
1648         if test $ol_enable_phonetic = yes ; then
1649                 echo "configure: warning: slapd disabled, ignoring --enable_phonetic argument" 1>&2
1650         fi
1651         if test $ol_enable_rlookups = yes ; then
1652                 echo "configure: warning: slapd disabled, ignoring --enable_rlookups argument" 1>&2
1653         fi
1654         if test $ol_with_ldbm_api != auto ; then
1655                 echo "configure: warning: slapd disabled, ignoring --with_ldbm_api argument" 1>&2
1656         fi
1657         if test $ol_with_ldbm_type != auto ; then
1658                 echo "configure: warning: slapd disabled, ignoring --with_ldbm_type argument" 1>&2
1659         fi
1660         if test $ol_enable_slurpd = yes ; then
1661                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
1662         fi
1663
1664         # force settings to no
1665         ol_enable_bdb2=no
1666         ol_enable_ldbm=no
1667         ol_enable_passwd=no
1668         ol_enable_perl=no
1669         ol_enable_shell=no
1670         ol_enable_tcl=no
1671
1672         ol_enable_aclgroups=no
1673         ol_enable_modules=no
1674         ol_enable_phonetic=no
1675         ol_enable_rlookups=no
1676         ol_enable_wrappers=no
1677
1678         ol_with_ldbm_api=no
1679         ol_with_ldbm_type=no
1680
1681         ol_enable_slurpd=no
1682
1683 elif test $ol_enable_ldbm = no ; then
1684         
1685         if test $ol_with_ldbm_api != auto ; then
1686                 echo "configure: warning: LDBM disabled, ignoring --with_ldbm_api argument" 1>&2
1687         fi
1688
1689         if test $ol_with_ldbm_type != auto ; then
1690                 echo "configure: warning: LDBM disabled, ignoring --with_ldbm_type argument" 1>&2
1691         fi
1692
1693         if test $ol_enable_bdb2 = yes ; then
1694                 { echo "configure: error: BDB2 requires --enable-ldbm" 1>&2; exit 1; }
1695         fi
1696
1697         if test $ol_enable_modules != yes -a \
1698                 $ol_enable_passwd = no -a \
1699                 $ol_enable_perl = no -a \
1700                 $ol_enable_shell = no -a \
1701                 $ol_enable_tcl = no ; then
1702                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
1703         fi
1704
1705         ol_with_ldbm_api=no
1706         ol_with_ldbm_type=no
1707
1708 elif test $ol_enable_bdb2 = yes ; then
1709         
1710         if test $ol_with_ldbm_api != auto -a \
1711                 $ol_with_ldbm_api != db2 ; then
1712                 { echo "configure: error: BDB2 requires LDBM API DB2" 1>&2; exit 1; }
1713         fi
1714
1715         ol_with_ldbm_api=db2
1716
1717 else
1718         
1719         if test $ol_enable_bdb2 != no ; then
1720                 if test $ol_with_ldbm_api != auto -a \
1721                         $ol_with_ldbm_api != db2 ; then
1722                         echo "configure: warning: BDB2 requires LDBM api db2 or auto" 1>&2
1723                         ol_enable_bdb2=no
1724                 fi
1725         fi
1726
1727         if test $ol_with_ldbm_api = gdbm -a \
1728                 $ol_with_ldbm_type = btree ; then
1729                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
1730         fi
1731         if test $ol_with_ldbm_api = mdbm -a \
1732                 $ol_with_ldbm_type = btree ; then
1733                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
1734         fi
1735         if test $ol_with_ldbm_api = ndbm -a \
1736                 $ol_with_ldbm_type = btree ; then
1737                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
1738         fi
1739 fi
1740
1741 if test $ol_enable_slurpd = yes ; then
1742                 if test $ol_with_threads = no ; then
1743                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
1744         fi
1745 fi
1746
1747 echo "$ac_t""done" 1>&6
1748
1749 ## Initialize vars
1750 LDAP_LIBS=
1751 LDBM_LIBS=
1752 LTHREAD_LIBS=
1753 LUTIL_LIBS=
1754
1755 LDAPD_LIBS=
1756 SLAPD_LIBS=
1757 SLURPD_LIBS=
1758
1759 BUILD_LDAPD=no
1760 BUILD_SLAPD=no
1761 BUILD_SLURPD=no
1762
1763 BUILD_BDB2=no
1764 BUILD_LDBM=no
1765 BUILD_PASSWD=no
1766 BUILD_PERL=no
1767 BUILD_SHELL=no
1768 BUILD_TCL=no
1769 BUILD_THREAD=no
1770
1771 SLAPD_MODULES_LDFLAGS=
1772 SLAPD_MODULES_CPPFLAGS=
1773
1774 SLAPD_PERL_LDFLAGS=
1775 SLAPD_PERL_CPPFLAGS=
1776
1777 KRB_LIBS=
1778 READLINE_LIBS=
1779 TERMCAP_LIBS=
1780 TLS_LIBS=
1781
1782
1783 # Find a good install program.  We prefer a C program (faster),
1784 # so one script is as good as another.  But avoid the broken or
1785 # incompatible versions:
1786 # SysV /etc/install, /usr/sbin/install
1787 # SunOS /usr/etc/install
1788 # IRIX /sbin/install
1789 # AIX /bin/install
1790 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1791 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1792 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1793 # ./install, which can be erroneously created by make from ./install.sh.
1794 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1795 echo "configure:1796: checking for a BSD compatible install" >&5
1796 if test -z "$INSTALL"; then
1797 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1798   echo $ac_n "(cached) $ac_c" 1>&6
1799 else
1800     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1801   for ac_dir in $PATH; do
1802     # Account for people who put trailing slashes in PATH elements.
1803     case "$ac_dir/" in
1804     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1805     *)
1806       # OSF1 and SCO ODT 3.0 have their own names for install.
1807       # Don't use installbsd from OSF since it installs stuff as root
1808       # by default.
1809       for ac_prog in ginstall scoinst install; do
1810         if test -f $ac_dir/$ac_prog; then
1811           if test $ac_prog = install &&
1812             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1813             # AIX install.  It has an incompatible calling convention.
1814             :
1815           else
1816             ac_cv_path_install="$ac_dir/$ac_prog -c"
1817             break 2
1818           fi
1819         fi
1820       done
1821       ;;
1822     esac
1823   done
1824   IFS="$ac_save_IFS"
1825
1826 fi
1827   if test "${ac_cv_path_install+set}" = set; then
1828     INSTALL="$ac_cv_path_install"
1829   else
1830     # As a last resort, use the slow shell script.  We don't cache a
1831     # path for INSTALL within a source directory, because that will
1832     # break other packages using the cache if that directory is
1833     # removed, or if the path is relative.
1834     INSTALL="$ac_install_sh"
1835   fi
1836 fi
1837 echo "$ac_t""$INSTALL" 1>&6
1838
1839 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1840 # It thinks the first close brace ends the variable substitution.
1841 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1842
1843 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1844
1845 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1846
1847
1848 CC=${CC-"cc"}
1849
1850
1851 # Make sure we can run config.sub.
1852 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
1853 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
1854 fi
1855
1856 echo $ac_n "checking host system type""... $ac_c" 1>&6
1857 echo "configure:1858: checking host system type" >&5
1858
1859 host_alias=$host
1860 case "$host_alias" in
1861 NONE)
1862   case $nonopt in
1863   NONE)
1864     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
1865     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
1866     fi ;;
1867   *) host_alias=$nonopt ;;
1868   esac ;;
1869 esac
1870
1871 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
1872 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1873 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1874 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1875 echo "$ac_t""$host" 1>&6
1876
1877 # Extract the first word of "ranlib", so it can be a program name with args.
1878 set dummy ranlib; ac_word=$2
1879 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1880 echo "configure:1881: checking for $ac_word" >&5
1881 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1882   echo $ac_n "(cached) $ac_c" 1>&6
1883 else
1884   if test -n "$RANLIB"; then
1885   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1886 else
1887   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1888   ac_dummy="$PATH"
1889   for ac_dir in $ac_dummy; do
1890     test -z "$ac_dir" && ac_dir=.
1891     if test -f $ac_dir/$ac_word; then
1892       ac_cv_prog_RANLIB="ranlib"
1893       break
1894     fi
1895   done
1896   IFS="$ac_save_ifs"
1897   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1898 fi
1899 fi
1900 RANLIB="$ac_cv_prog_RANLIB"
1901 if test -n "$RANLIB"; then
1902   echo "$ac_t""$RANLIB" 1>&6
1903 else
1904   echo "$ac_t""no" 1>&6
1905 fi
1906
1907 # Extract the first word of "gcc", so it can be a program name with args.
1908 set dummy gcc; ac_word=$2
1909 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1910 echo "configure:1911: checking for $ac_word" >&5
1911 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1912   echo $ac_n "(cached) $ac_c" 1>&6
1913 else
1914   if test -n "$CC"; then
1915   ac_cv_prog_CC="$CC" # Let the user override the test.
1916 else
1917   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1918   ac_dummy="$PATH"
1919   for ac_dir in $ac_dummy; do
1920     test -z "$ac_dir" && ac_dir=.
1921     if test -f $ac_dir/$ac_word; then
1922       ac_cv_prog_CC="gcc"
1923       break
1924     fi
1925   done
1926   IFS="$ac_save_ifs"
1927 fi
1928 fi
1929 CC="$ac_cv_prog_CC"
1930 if test -n "$CC"; then
1931   echo "$ac_t""$CC" 1>&6
1932 else
1933   echo "$ac_t""no" 1>&6
1934 fi
1935
1936 if test -z "$CC"; then
1937   # Extract the first word of "cc", so it can be a program name with args.
1938 set dummy cc; ac_word=$2
1939 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1940 echo "configure:1941: checking for $ac_word" >&5
1941 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1942   echo $ac_n "(cached) $ac_c" 1>&6
1943 else
1944   if test -n "$CC"; then
1945   ac_cv_prog_CC="$CC" # Let the user override the test.
1946 else
1947   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1948   ac_prog_rejected=no
1949   ac_dummy="$PATH"
1950   for ac_dir in $ac_dummy; do
1951     test -z "$ac_dir" && ac_dir=.
1952     if test -f $ac_dir/$ac_word; then
1953       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1954         ac_prog_rejected=yes
1955         continue
1956       fi
1957       ac_cv_prog_CC="cc"
1958       break
1959     fi
1960   done
1961   IFS="$ac_save_ifs"
1962 if test $ac_prog_rejected = yes; then
1963   # We found a bogon in the path, so make sure we never use it.
1964   set dummy $ac_cv_prog_CC
1965   shift
1966   if test $# -gt 0; then
1967     # We chose a different compiler from the bogus one.
1968     # However, it has the same basename, so the bogon will be chosen
1969     # first if we set CC to just the basename; use the full file name.
1970     shift
1971     set dummy "$ac_dir/$ac_word" "$@"
1972     shift
1973     ac_cv_prog_CC="$@"
1974   fi
1975 fi
1976 fi
1977 fi
1978 CC="$ac_cv_prog_CC"
1979 if test -n "$CC"; then
1980   echo "$ac_t""$CC" 1>&6
1981 else
1982   echo "$ac_t""no" 1>&6
1983 fi
1984
1985   if test -z "$CC"; then
1986     case "`uname -s`" in
1987     *win32* | *WIN32*)
1988       # Extract the first word of "cl", so it can be a program name with args.
1989 set dummy cl; ac_word=$2
1990 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1991 echo "configure:1992: checking for $ac_word" >&5
1992 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1993   echo $ac_n "(cached) $ac_c" 1>&6
1994 else
1995   if test -n "$CC"; then
1996   ac_cv_prog_CC="$CC" # Let the user override the test.
1997 else
1998   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1999   ac_dummy="$PATH"
2000   for ac_dir in $ac_dummy; do
2001     test -z "$ac_dir" && ac_dir=.
2002     if test -f $ac_dir/$ac_word; then
2003       ac_cv_prog_CC="cl"
2004       break
2005     fi
2006   done
2007   IFS="$ac_save_ifs"
2008 fi
2009 fi
2010 CC="$ac_cv_prog_CC"
2011 if test -n "$CC"; then
2012   echo "$ac_t""$CC" 1>&6
2013 else
2014   echo "$ac_t""no" 1>&6
2015 fi
2016  ;;
2017     esac
2018   fi
2019   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2020 fi
2021
2022 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2023 echo "configure:2024: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
2024
2025 ac_ext=c
2026 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2027 ac_cpp='$CPP $CPPFLAGS'
2028 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2029 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2030 cross_compiling=$ac_cv_prog_cc_cross
2031
2032 cat > conftest.$ac_ext << EOF
2033
2034 #line 2035 "configure"
2035 #include "confdefs.h"
2036
2037 main(){return(0);}
2038 EOF
2039 if { (eval echo configure:2040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2040   ac_cv_prog_cc_works=yes
2041   # If we can't run a trivial program, we are probably using a cross compiler.
2042   if (./conftest; exit) 2>/dev/null; then
2043     ac_cv_prog_cc_cross=no
2044   else
2045     ac_cv_prog_cc_cross=yes
2046   fi
2047 else
2048   echo "configure: failed program was:" >&5
2049   cat conftest.$ac_ext >&5
2050   ac_cv_prog_cc_works=no
2051 fi
2052 rm -fr conftest*
2053 ac_ext=c
2054 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2055 ac_cpp='$CPP $CPPFLAGS'
2056 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2057 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2058 cross_compiling=$ac_cv_prog_cc_cross
2059
2060 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2061 if test $ac_cv_prog_cc_works = no; then
2062   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2063 fi
2064 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2065 echo "configure:2066: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
2066 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2067 cross_compiling=$ac_cv_prog_cc_cross
2068
2069 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2070 echo "configure:2071: checking whether we are using GNU C" >&5
2071 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
2072   echo $ac_n "(cached) $ac_c" 1>&6
2073 else
2074   cat > conftest.c <<EOF
2075 #ifdef __GNUC__
2076   yes;
2077 #endif
2078 EOF
2079 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2080: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2080   ac_cv_prog_gcc=yes
2081 else
2082   ac_cv_prog_gcc=no
2083 fi
2084 fi
2085
2086 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2087
2088 if test $ac_cv_prog_gcc = yes; then
2089   GCC=yes
2090 else
2091   GCC=
2092 fi
2093
2094 ac_test_CFLAGS="${CFLAGS+set}"
2095 ac_save_CFLAGS="$CFLAGS"
2096 CFLAGS=
2097 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2098 echo "configure:2099: checking whether ${CC-cc} accepts -g" >&5
2099 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
2100   echo $ac_n "(cached) $ac_c" 1>&6
2101 else
2102   echo 'void f(){}' > conftest.c
2103 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2104   ac_cv_prog_cc_g=yes
2105 else
2106   ac_cv_prog_cc_g=no
2107 fi
2108 rm -f conftest*
2109
2110 fi
2111
2112 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2113 if test "$ac_test_CFLAGS" = set; then
2114   CFLAGS="$ac_save_CFLAGS"
2115 elif test $ac_cv_prog_cc_g = yes; then
2116   if test "$GCC" = yes; then
2117     CFLAGS="-g -O2"
2118   else
2119     CFLAGS="-g"
2120   fi
2121 else
2122   if test "$GCC" = yes; then
2123     CFLAGS="-O2"
2124   else
2125     CFLAGS=
2126   fi
2127 fi
2128
2129 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2130 if test "${with_gnu_ld+set}" = set; then
2131   withval="$with_gnu_ld"
2132   test "$withval" = no || with_gnu_ld=yes
2133 else
2134   with_gnu_ld=no
2135 fi
2136
2137
2138 ac_prog=ld
2139 if test "$ac_cv_prog_gcc" = yes; then
2140   # Check if gcc -print-prog-name=ld gives a path.
2141   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2142 echo "configure:2143: checking for ld used by GCC" >&5
2143   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2144   case "$ac_prog" in
2145   # Accept absolute paths.
2146   /* | A-Za-z:\\*)
2147     test -z "$LD" && LD="$ac_prog"
2148     ;;
2149   "")
2150     # If it fails, then pretend we aren't using GCC.
2151     ac_prog=ld
2152     ;;
2153   *)
2154     # If it is relative, then search for the first ld in PATH.
2155     with_gnu_ld=unknown
2156     ;;
2157   esac
2158 elif test "$with_gnu_ld" = yes; then
2159   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2160 echo "configure:2161: checking for GNU ld" >&5
2161 else
2162   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2163 echo "configure:2164: checking for non-GNU ld" >&5
2164 fi
2165 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
2166   echo $ac_n "(cached) $ac_c" 1>&6
2167 else
2168   if test -z "$LD"; then
2169   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2170   for ac_dir in $PATH; do
2171     test -z "$ac_dir" && ac_dir=.
2172     if test -f "$ac_dir/$ac_prog"; then
2173       ac_cv_path_LD="$ac_dir/$ac_prog"
2174       # Check to see if the program is GNU ld.  I'd rather use --version,
2175       # but apparently some GNU ld's only accept -v.
2176       # Break only if it was the GNU/non-GNU ld that we prefer.
2177       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2178         test "$with_gnu_ld" != no && break
2179       else
2180         test "$with_gnu_ld" != yes && break
2181       fi
2182     fi
2183   done
2184   IFS="$ac_save_ifs"
2185 else
2186   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2187 fi
2188 fi
2189
2190 LD="$ac_cv_path_LD"
2191 if test -n "$LD"; then
2192   echo "$ac_t""$LD" 1>&6
2193 else
2194   echo "$ac_t""no" 1>&6
2195 fi
2196 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2197
2198 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2199 echo "configure:2200: checking if the linker ($LD) is GNU ld" >&5
2200 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
2201   echo $ac_n "(cached) $ac_c" 1>&6
2202 else
2203   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2204 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2205   ac_cv_prog_gnu_ld=yes
2206 else
2207   ac_cv_prog_gnu_ld=no
2208 fi
2209 fi
2210
2211 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2212
2213
2214 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2215 echo "configure:2216: checking for BSD-compatible nm" >&5
2216 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
2217   echo $ac_n "(cached) $ac_c" 1>&6
2218 else
2219   case "$NM" in
2220 /* | A-Za-z:\\*)
2221   ac_cv_path_NM="$NM" # Let the user override the test with a path.
2222   ;;
2223 *)
2224   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2225   for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
2226     test -z "$ac_dir" && ac_dir=.
2227     if test -f $ac_dir/nm; then
2228       # Check to see if the nm accepts a BSD-compat flag.
2229       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2230       #   nm: unknown option "B" ignored
2231       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2232         ac_cv_path_NM="$ac_dir/nm -B"
2233       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2234         ac_cv_path_NM="$ac_dir/nm -p"
2235       else
2236         ac_cv_path_NM="$ac_dir/nm"
2237       fi
2238       break
2239     fi
2240   done
2241   IFS="$ac_save_ifs"
2242   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2243   ;;
2244 esac
2245 fi
2246
2247 NM="$ac_cv_path_NM"
2248 echo "$ac_t""$NM" 1>&6
2249
2250
2251 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2252 echo "configure:2253: checking whether ln -s works" >&5
2253 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2254   echo $ac_n "(cached) $ac_c" 1>&6
2255 else
2256   rm -f conftestdata
2257 if ln -s X conftestdata 2>/dev/null
2258 then
2259   rm -f conftestdata
2260   ac_cv_prog_LN_S="ln -s"
2261 else
2262   ac_cv_prog_LN_S=ln
2263 fi
2264 fi
2265 LN_S="$ac_cv_prog_LN_S"
2266 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2267   echo "$ac_t""yes" 1>&6
2268 else
2269   echo "$ac_t""no" 1>&6
2270 fi
2271
2272 # Always use our own libtool.
2273 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
2274
2275 # Check for any special flags to pass to ltconfig.
2276 libtool_flags=
2277 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2278 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2279 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
2280 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2281 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2282
2283 # Some flags need to be propagated to the compiler or linker for good
2284 # libtool support.
2285 case "$host" in
2286 *-*-irix6*)
2287   # Find out which ABI we are using.
2288   echo '#line 2289 "configure"' > conftest.$ac_ext
2289   if { (eval echo configure:2290: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2290     case "`/usr/bin/file conftest.o`" in
2291     *32-bit*)
2292       LD="${LD-ld} -32"
2293       ;;
2294     *N32*)
2295       LD="${LD-ld} -n32"
2296       ;;
2297     *64-bit*)
2298       LD="${LD-ld} -64"
2299       ;;
2300     esac
2301   fi
2302   rm -rf conftest*
2303   ;;
2304
2305 *-*-sco3.2v5*)
2306   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2307   CFLAGS="$CFLAGS -belf"
2308   ;;
2309 esac
2310
2311 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
2312 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
2313 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
2314 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
2315 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
2316 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
2317
2318
2319 for ac_prog in mawk gawk nawk awk
2320 do
2321 # Extract the first word of "$ac_prog", so it can be a program name with args.
2322 set dummy $ac_prog; ac_word=$2
2323 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2324 echo "configure:2325: checking for $ac_word" >&5
2325 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
2326   echo $ac_n "(cached) $ac_c" 1>&6
2327 else
2328   if test -n "$AWK"; then
2329   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2330 else
2331   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2332   ac_dummy="$PATH"
2333   for ac_dir in $ac_dummy; do
2334     test -z "$ac_dir" && ac_dir=.
2335     if test -f $ac_dir/$ac_word; then
2336       ac_cv_prog_AWK="$ac_prog"
2337       break
2338     fi
2339   done
2340   IFS="$ac_save_ifs"
2341 fi
2342 fi
2343 AWK="$ac_cv_prog_AWK"
2344 if test -n "$AWK"; then
2345   echo "$ac_t""$AWK" 1>&6
2346 else
2347   echo "$ac_t""no" 1>&6
2348 fi
2349
2350 test -n "$AWK" && break
2351 done
2352
2353 # test for ln hardlink support
2354 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
2355 echo "configure:2356: checking whether ln works" >&5
2356 if eval "test \"`echo '$''{'ol_cv_prog_LN_H'+set}'`\" = set"; then
2357   echo $ac_n "(cached) $ac_c" 1>&6
2358 else
2359   rm -f conftest.src conftest.dst
2360 echo "conftest" > conftest.src
2361 if ln conftest.src conftest.dst 2>/dev/null
2362 then
2363   ol_cv_prog_LN_H="ln"
2364 else
2365   ol_cv_prog_LN_H="cp"
2366 fi
2367 rm -f conftest.src conftest.dst
2368
2369 fi
2370 LN_H="$ol_cv_prog_LN_H"
2371 if test "$ol_cv_prog_LN_H" = "ln"; then
2372         echo "$ac_t""yes" 1>&6
2373 else
2374         echo "$ac_t""no" 1>&6
2375 fi
2376
2377 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2378 echo "configure:2379: checking whether ln -s works" >&5
2379 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2380   echo $ac_n "(cached) $ac_c" 1>&6
2381 else
2382   rm -f conftestdata
2383 if ln -s X conftestdata 2>/dev/null
2384 then
2385   rm -f conftestdata
2386   ac_cv_prog_LN_S="ln -s"
2387 else
2388   ac_cv_prog_LN_S=ln
2389 fi
2390 fi
2391 LN_S="$ac_cv_prog_LN_S"
2392 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2393   echo "$ac_t""yes" 1>&6
2394 else
2395   echo "$ac_t""no" 1>&6
2396 fi
2397
2398
2399 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
2400         LN_S="$LN_H"
2401 fi
2402
2403 # Extract the first word of "sendmail", so it can be a program name with args.
2404 set dummy sendmail; ac_word=$2
2405 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2406 echo "configure:2407: checking for $ac_word" >&5
2407 if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then
2408   echo $ac_n "(cached) $ac_c" 1>&6
2409 else
2410   case "$SENDMAIL" in
2411   /*)
2412   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
2413   ;;
2414   ?:/*)                  
2415   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
2416   ;;
2417   *)
2418   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2419   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
2420   for ac_dir in $ac_dummy; do 
2421     test -z "$ac_dir" && ac_dir=.
2422     if test -f $ac_dir/$ac_word; then
2423       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
2424       break
2425     fi
2426   done
2427   IFS="$ac_save_ifs"
2428   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
2429   ;;
2430 esac
2431 fi
2432 SENDMAIL="$ac_cv_path_SENDMAIL"
2433 if test -n "$SENDMAIL"; then
2434   echo "$ac_t""$SENDMAIL" 1>&6
2435 else
2436   echo "$ac_t""no" 1>&6
2437 fi
2438
2439 # Extract the first word of "vi", so it can be a program name with args.
2440 set dummy vi; ac_word=$2
2441 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2442 echo "configure:2443: checking for $ac_word" >&5
2443 if eval "test \"`echo '$''{'ac_cv_path_EDITOR'+set}'`\" = set"; then
2444   echo $ac_n "(cached) $ac_c" 1>&6
2445 else
2446   case "$EDITOR" in
2447   /*)
2448   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
2449   ;;
2450   ?:/*)                  
2451   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
2452   ;;
2453   *)
2454   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2455   ac_dummy="$PATH:/usr/ucb"
2456   for ac_dir in $ac_dummy; do 
2457     test -z "$ac_dir" && ac_dir=.
2458     if test -f $ac_dir/$ac_word; then
2459       ac_cv_path_EDITOR="$ac_dir/$ac_word"
2460       break
2461     fi
2462   done
2463   IFS="$ac_save_ifs"
2464   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
2465   ;;
2466 esac
2467 fi
2468 EDITOR="$ac_cv_path_EDITOR"
2469 if test -n "$EDITOR"; then
2470   echo "$ac_t""$EDITOR" 1>&6
2471 else
2472   echo "$ac_t""no" 1>&6
2473 fi
2474
2475 # Extract the first word of "finger", so it can be a program name with args.
2476 set dummy finger; ac_word=$2
2477 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2478 echo "configure:2479: checking for $ac_word" >&5
2479 if eval "test \"`echo '$''{'ac_cv_path_FINGER'+set}'`\" = set"; then
2480   echo $ac_n "(cached) $ac_c" 1>&6
2481 else
2482   case "$FINGER" in
2483   /*)
2484   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
2485   ;;
2486   ?:/*)                  
2487   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
2488   ;;
2489   *)
2490   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2491   ac_dummy="$PATH:/usr/ucb"
2492   for ac_dir in $ac_dummy; do 
2493     test -z "$ac_dir" && ac_dir=.
2494     if test -f $ac_dir/$ac_word; then
2495       ac_cv_path_FINGER="$ac_dir/$ac_word"
2496       break
2497     fi
2498   done
2499   IFS="$ac_save_ifs"
2500   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
2501   ;;
2502 esac
2503 fi
2504 FINGER="$ac_cv_path_FINGER"
2505 if test -n "$FINGER"; then
2506   echo "$ac_t""$FINGER" 1>&6
2507 else
2508   echo "$ac_t""no" 1>&6
2509 fi
2510
2511
2512 ol_link_modules=no
2513 if test $ol_enable_modules != no ; then
2514         # Extract the first word of "glib-config", so it can be a program name with args.
2515 set dummy glib-config; ac_word=$2
2516 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2517 echo "configure:2518: checking for $ac_word" >&5
2518 if eval "test \"`echo '$''{'ac_cv_path_GLIBCONFIG'+set}'`\" = set"; then
2519   echo $ac_n "(cached) $ac_c" 1>&6
2520 else
2521   case "$GLIBCONFIG" in
2522   /*)
2523   ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a path.
2524   ;;
2525   ?:/*)                  
2526   ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a dos path.
2527   ;;
2528   *)
2529   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2530   ac_dummy="$PATH"
2531   for ac_dir in $ac_dummy; do 
2532     test -z "$ac_dir" && ac_dir=.
2533     if test -f $ac_dir/$ac_word; then
2534       ac_cv_path_GLIBCONFIG="$ac_dir/$ac_word"
2535       break
2536     fi
2537   done
2538   IFS="$ac_save_ifs"
2539   ;;
2540 esac
2541 fi
2542 GLIBCONFIG="$ac_cv_path_GLIBCONFIG"
2543 if test -n "$GLIBCONFIG"; then
2544   echo "$ac_t""$GLIBCONFIG" 1>&6
2545 else
2546   echo "$ac_t""no" 1>&6
2547 fi
2548
2549
2550         if test "no$GLIBCONFIG" = "no" ; then
2551                 if test $ol_enable_modules = yes ; then
2552                         { echo "configure: error: could not locate glib-config" 1>&2; exit 1; }
2553                 fi
2554
2555         else
2556                 SLAPD_MODULES_VERSION="`$GLIBCONFIG --version gmodule`"
2557                 SLAPD_MODULES_CPPFLAGS="`$GLIBCONFIG --cflags gmodule`"
2558                 SLAPD_MODULES_LDFLAGS="`$GLIBCONFIG --libs gmodule`"
2559
2560                                 ol_link_modules=yes
2561         fi
2562 fi
2563
2564 ol_link_perl=no
2565 if test $ol_enable_perl != no ; then
2566         # Extract the first word of "perl", so it can be a program name with args.
2567 set dummy perl; ac_word=$2
2568 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2569 echo "configure:2570: checking for $ac_word" >&5
2570 if eval "test \"`echo '$''{'ac_cv_path_PERLBIN'+set}'`\" = set"; then
2571   echo $ac_n "(cached) $ac_c" 1>&6
2572 else
2573   case "$PERLBIN" in
2574   /*)
2575   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
2576   ;;
2577   ?:/*)                  
2578   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
2579   ;;
2580   *)
2581   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2582   ac_dummy="$PATH"
2583   for ac_dir in $ac_dummy; do 
2584     test -z "$ac_dir" && ac_dir=.
2585     if test -f $ac_dir/$ac_word; then
2586       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
2587       break
2588     fi
2589   done
2590   IFS="$ac_save_ifs"
2591   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
2592   ;;
2593 esac
2594 fi
2595 PERLBIN="$ac_cv_path_PERLBIN"
2596 if test -n "$PERLBIN"; then
2597   echo "$ac_t""$PERLBIN" 1>&6
2598 else
2599   echo "$ac_t""no" 1>&6
2600 fi
2601
2602
2603         if test "no$PERLBIN" = "no" ; then
2604                 if test $ol_enable_perl = yes ; then
2605                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
2606                 fi
2607
2608         else
2609                 SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
2610                 SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
2611
2612                                 ol_link_perl=yes
2613         fi
2614 fi
2615
2616 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2617 echo "configure:2618: checking how to run the C preprocessor" >&5
2618 # On Suns, sometimes $CPP names a directory.
2619 if test -n "$CPP" && test -d "$CPP"; then
2620   CPP=
2621 fi
2622 if test -z "$CPP"; then
2623 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
2624   echo $ac_n "(cached) $ac_c" 1>&6
2625 else
2626     # This must be in double quotes, not single quotes, because CPP may get
2627   # substituted into the Makefile and "${CC-cc}" will confuse make.
2628   CPP="${CC-cc} -E"
2629   # On the NeXT, cc -E runs the code through the compiler's parser,
2630   # not just through cpp.
2631   cat > conftest.$ac_ext <<EOF
2632 #line 2633 "configure"
2633 #include "confdefs.h"
2634 #include <assert.h>
2635 Syntax Error
2636 EOF
2637 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2638 { (eval echo configure:2639: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2639 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2640 if test -z "$ac_err"; then
2641   :
2642 else
2643   echo "$ac_err" >&5
2644   echo "configure: failed program was:" >&5
2645   cat conftest.$ac_ext >&5
2646   rm -rf conftest*
2647   CPP="${CC-cc} -E -traditional-cpp"
2648   cat > conftest.$ac_ext <<EOF
2649 #line 2650 "configure"
2650 #include "confdefs.h"
2651 #include <assert.h>
2652 Syntax Error
2653 EOF
2654 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2655 { (eval echo configure:2656: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2656 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2657 if test -z "$ac_err"; then
2658   :
2659 else
2660   echo "$ac_err" >&5
2661   echo "configure: failed program was:" >&5
2662   cat conftest.$ac_ext >&5
2663   rm -rf conftest*
2664   CPP="${CC-cc} -nologo -E"
2665   cat > conftest.$ac_ext <<EOF
2666 #line 2667 "configure"
2667 #include "confdefs.h"
2668 #include <assert.h>
2669 Syntax Error
2670 EOF
2671 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2672 { (eval echo configure:2673: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2673 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2674 if test -z "$ac_err"; then
2675   :
2676 else
2677   echo "$ac_err" >&5
2678   echo "configure: failed program was:" >&5
2679   cat conftest.$ac_ext >&5
2680   rm -rf conftest*
2681   CPP=/lib/cpp
2682 fi
2683 rm -f conftest*
2684 fi
2685 rm -f conftest*
2686 fi
2687 rm -f conftest*
2688   ac_cv_prog_CPP="$CPP"
2689 fi
2690   CPP="$ac_cv_prog_CPP"
2691 else
2692   ac_cv_prog_CPP="$CPP"
2693 fi
2694 echo "$ac_t""$CPP" 1>&6
2695
2696
2697 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
2698         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
2699
2700 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
2701         echo "configure: warning: programs compiled here do run here..." 1>&2
2702         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
2703
2704 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
2705         echo "configure: warning: programs compiled here do not run here..." 1>&2
2706         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
2707 fi
2708
2709 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2710 echo "configure:2711: checking for AIX" >&5
2711 cat > conftest.$ac_ext <<EOF
2712 #line 2713 "configure"
2713 #include "confdefs.h"
2714 #ifdef _AIX
2715   yes
2716 #endif
2717
2718 EOF
2719 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2720   egrep "yes" >/dev/null 2>&1; then
2721   rm -rf conftest*
2722   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
2723 #define _ALL_SOURCE 1
2724 EOF
2725
2726 else
2727   rm -rf conftest*
2728   echo "$ac_t""no" 1>&6
2729 fi
2730 rm -f conftest*
2731
2732
2733 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
2734 echo "configure:2735: checking for POSIXized ISC" >&5
2735 if test -d /etc/conf/kconfig.d &&
2736   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
2737 then
2738   echo "$ac_t""yes" 1>&6
2739   ISC=yes # If later tests want to check for ISC.
2740   cat >> confdefs.h <<\EOF
2741 #define _POSIX_SOURCE 1
2742 EOF
2743
2744   if test "$GCC" = yes; then
2745     CC="$CC -posix"
2746   else
2747     CC="$CC -Xp"
2748   fi
2749 else
2750   echo "$ac_t""no" 1>&6
2751   ISC=
2752 fi
2753
2754 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
2755 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
2756 echo "configure:2757: checking for minix/config.h" >&5
2757 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2758   echo $ac_n "(cached) $ac_c" 1>&6
2759 else
2760   cat > conftest.$ac_ext <<EOF
2761 #line 2762 "configure"
2762 #include "confdefs.h"
2763 #include <minix/config.h>
2764 EOF
2765 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2766 { (eval echo configure:2767: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2767 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2768 if test -z "$ac_err"; then
2769   rm -rf conftest*
2770   eval "ac_cv_header_$ac_safe=yes"
2771 else
2772   echo "$ac_err" >&5
2773   echo "configure: failed program was:" >&5
2774   cat conftest.$ac_ext >&5
2775   rm -rf conftest*
2776   eval "ac_cv_header_$ac_safe=no"
2777 fi
2778 rm -f conftest*
2779 fi
2780 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2781   echo "$ac_t""yes" 1>&6
2782   MINIX=yes
2783 else
2784   echo "$ac_t""no" 1>&6
2785 MINIX=
2786 fi
2787
2788 if test "$MINIX" = yes; then
2789   cat >> confdefs.h <<\EOF
2790 #define _POSIX_SOURCE 1
2791 EOF
2792
2793   cat >> confdefs.h <<\EOF
2794 #define _POSIX_1_SOURCE 2
2795 EOF
2796
2797   cat >> confdefs.h <<\EOF
2798 #define _MINIX 1
2799 EOF
2800
2801 fi
2802
2803
2804 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
2805 echo "configure:2806: checking for be_app in -lbe" >&5
2806 ac_lib_var=`echo be'_'be_app | sed 'y%./+-%__p_%'`
2807 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2808   echo $ac_n "(cached) $ac_c" 1>&6
2809 else
2810   ac_save_LIBS="$LIBS"
2811 LIBS="-lbe -lroot $LIBS"
2812 cat > conftest.$ac_ext <<EOF
2813 #line 2814 "configure"
2814 #include "confdefs.h"
2815 /* Override any gcc2 internal prototype to avoid an error.  */
2816 /* We use char because int might match the return type of a gcc2
2817     builtin and then its argument prototype would still apply.  */
2818 char be_app();
2819
2820 int main() {
2821 be_app()
2822 ; return 0; }
2823 EOF
2824 if { (eval echo configure:2825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2825   rm -rf conftest*
2826   eval "ac_cv_lib_$ac_lib_var=yes"
2827 else
2828   echo "configure: failed program was:" >&5
2829   cat conftest.$ac_ext >&5
2830   rm -rf conftest*
2831   eval "ac_cv_lib_$ac_lib_var=no"
2832 fi
2833 rm -f conftest*
2834 LIBS="$ac_save_LIBS"
2835
2836 fi
2837 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2838   echo "$ac_t""yes" 1>&6
2839   LIBS="$LIBS -lbe -lroot"
2840 else
2841   echo "$ac_t""no" 1>&6
2842 :
2843 fi
2844
2845
2846 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
2847 echo "configure:2848: checking for Cygwin environment" >&5
2848 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
2849   echo $ac_n "(cached) $ac_c" 1>&6
2850 else
2851   cat > conftest.$ac_ext <<EOF
2852 #line 2853 "configure"
2853 #include "confdefs.h"
2854
2855 int main() {
2856
2857 #ifndef __CYGWIN__
2858 #define __CYGWIN__ __CYGWIN32__
2859 #endif
2860 return __CYGWIN__;
2861 ; return 0; }
2862 EOF
2863 if { (eval echo configure:2864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2864   rm -rf conftest*
2865   ac_cv_cygwin=yes
2866 else
2867   echo "configure: failed program was:" >&5
2868   cat conftest.$ac_ext >&5
2869   rm -rf conftest*
2870   ac_cv_cygwin=no
2871 fi
2872 rm -f conftest*
2873 rm -f conftest*
2874 fi
2875
2876 echo "$ac_t""$ac_cv_cygwin" 1>&6
2877 CYGWIN=
2878 test "$ac_cv_cygwin" = yes && CYGWIN=yes
2879 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
2880 echo "configure:2881: checking for mingw32 environment" >&5
2881 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
2882   echo $ac_n "(cached) $ac_c" 1>&6
2883 else
2884   cat > conftest.$ac_ext <<EOF
2885 #line 2886 "configure"
2886 #include "confdefs.h"
2887
2888 int main() {
2889 return __MINGW32__;
2890 ; return 0; }
2891 EOF
2892 if { (eval echo configure:2893: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2893   rm -rf conftest*
2894   ac_cv_mingw32=yes
2895 else
2896   echo "configure: failed program was:" >&5
2897   cat conftest.$ac_ext >&5
2898   rm -rf conftest*
2899   ac_cv_mingw32=no
2900 fi
2901 rm -f conftest*
2902 rm -f conftest*
2903 fi
2904
2905 echo "$ac_t""$ac_cv_mingw32" 1>&6
2906 MINGW32=
2907 test "$ac_cv_mingw32" = yes && MINGW32=yes
2908
2909
2910 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
2911 echo "configure:2912: checking for executable suffix" >&5
2912 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
2913   echo $ac_n "(cached) $ac_c" 1>&6
2914 else
2915   if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
2916   ac_cv_exeext=.exe
2917 else
2918   rm -f conftest*
2919   echo 'int main () { return 0; }' > conftest.$ac_ext
2920   ac_cv_exeext=
2921   if { (eval echo configure:2922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
2922     for file in conftest.*; do
2923       case $file in
2924       *.c | *.o | *.obj) ;;
2925       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
2926       esac
2927     done
2928   else
2929     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
2930   fi
2931   rm -f conftest*
2932   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
2933 fi
2934 fi
2935
2936 EXEEXT=""
2937 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
2938 echo "$ac_t""${ac_cv_exeext}" 1>&6
2939 ac_exeext=$EXEEXT
2940
2941 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
2942 echo "configure:2943: checking for object suffix" >&5
2943 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
2944   echo $ac_n "(cached) $ac_c" 1>&6
2945 else
2946   rm -f conftest*
2947 echo 'int i = 1;' > conftest.$ac_ext
2948 if { (eval echo configure:2949: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2949   for ac_file in conftest.*; do
2950     case $ac_file in
2951     *.c) ;;
2952     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
2953     esac
2954   done
2955 else
2956   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
2957 fi
2958 rm -f conftest*
2959 fi
2960
2961 echo "$ac_t""$ac_cv_objext" 1>&6
2962 OBJEXT=$ac_cv_objext
2963 ac_objext=$ac_cv_objext
2964
2965
2966 cat >> confdefs.h <<EOF
2967 #define EXEEXT "${EXEEXT}"
2968 EOF
2969
2970
2971
2972
2973
2974 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
2975 echo "configure:2976: checking for ${CC-cc} option to accept ANSI C" >&5
2976 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
2977   echo $ac_n "(cached) $ac_c" 1>&6
2978 else
2979   am_cv_prog_cc_stdc=no
2980 ac_save_CC="$CC"
2981 # Don't try gcc -ansi; that turns off useful extensions and
2982 # breaks some systems' header files.
2983 # AIX                   -qlanglvl=ansi
2984 # Ultrix and OSF/1      -std1
2985 # HP-UX                 -Aa -D_HPUX_SOURCE
2986 # SVR4                  -Xc -D__EXTENSIONS__
2987 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2988 do
2989   CC="$ac_save_CC $ac_arg"
2990   cat > conftest.$ac_ext <<EOF
2991 #line 2992 "configure"
2992 #include "confdefs.h"
2993 #include <stdarg.h>
2994 #include <stdio.h>
2995 #include <sys/types.h>
2996 #include <sys/stat.h>
2997 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2998 struct buf { int x; };
2999 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3000 static char *e (p, i)
3001      char **p;
3002      int i;
3003 {
3004   return p[i];
3005 }
3006 static char *f (char * (*g) (char **, int), char **p, ...)
3007 {
3008   char *s;
3009   va_list v;
3010   va_start (v,p);
3011   s = g (p, va_arg (v,int));
3012   va_end (v);
3013   return s;
3014 }
3015 int test (int i, double x);
3016 struct s1 {int (*f) (int a);};
3017 struct s2 {int (*f) (double a);};
3018 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3019 int argc;
3020 char **argv;
3021
3022 int main() {
3023
3024 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3025
3026 ; return 0; }
3027 EOF
3028 if { (eval echo configure:3029: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3029   rm -rf conftest*
3030   am_cv_prog_cc_stdc="$ac_arg"; break
3031 else
3032   echo "configure: failed program was:" >&5
3033   cat conftest.$ac_ext >&5
3034 fi
3035 rm -f conftest*
3036 done
3037 CC="$ac_save_CC"
3038
3039 fi
3040
3041 if test -z "$am_cv_prog_cc_stdc"; then
3042   echo "$ac_t""none needed" 1>&6
3043 else
3044   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
3045 fi
3046 case "x$am_cv_prog_cc_stdc" in
3047   x|xno) ;;
3048   *) CC="$CC $am_cv_prog_cc_stdc" ;;
3049 esac
3050
3051 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
3052         { echo "configure: error: OpenLDAP requires compiler to support STDC prototypes." 1>&2; exit 1; }
3053 fi
3054
3055
3056
3057
3058 echo $ac_n "checking for socket""... $ac_c" 1>&6
3059 echo "configure:3060: checking for socket" >&5
3060 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
3061   echo $ac_n "(cached) $ac_c" 1>&6
3062 else
3063   cat > conftest.$ac_ext <<EOF
3064 #line 3065 "configure"
3065 #include "confdefs.h"
3066 /* System header to define __stub macros and hopefully few prototypes,
3067     which can conflict with char socket(); below.  */
3068 #include <assert.h>
3069 /* Override any gcc2 internal prototype to avoid an error.  */
3070 /* We use char because int might match the return type of a gcc2
3071     builtin and then its argument prototype would still apply.  */
3072 char socket();
3073
3074 int main() {
3075
3076 /* The GNU C library defines this for functions which it implements
3077     to always fail with ENOSYS.  Some functions are actually named
3078     something starting with __ and the normal name is an alias.  */
3079 #if defined (__stub_socket) || defined (__stub___socket)
3080 choke me
3081 #else
3082 socket();
3083 #endif
3084
3085 ; return 0; }
3086 EOF
3087 if { (eval echo configure:3088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3088   rm -rf conftest*
3089   eval "ac_cv_func_socket=yes"
3090 else
3091   echo "configure: failed program was:" >&5
3092   cat conftest.$ac_ext >&5
3093   rm -rf conftest*
3094   eval "ac_cv_func_socket=no"
3095 fi
3096 rm -f conftest*
3097 fi
3098
3099 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
3100   echo "$ac_t""yes" 1>&6
3101   :
3102 else
3103   echo "$ac_t""no" 1>&6
3104         
3105         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
3106 echo "configure:3107: checking for main in -lsocket" >&5
3107 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
3108 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3109   echo $ac_n "(cached) $ac_c" 1>&6
3110 else
3111   ac_save_LIBS="$LIBS"
3112 LIBS="-lsocket  $LIBS"
3113 cat > conftest.$ac_ext <<EOF
3114 #line 3115 "configure"
3115 #include "confdefs.h"
3116
3117 int main() {
3118 main()
3119 ; return 0; }
3120 EOF
3121 if { (eval echo configure:3122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3122   rm -rf conftest*
3123   eval "ac_cv_lib_$ac_lib_var=yes"
3124 else
3125   echo "configure: failed program was:" >&5
3126   cat conftest.$ac_ext >&5
3127   rm -rf conftest*
3128   eval "ac_cv_lib_$ac_lib_var=no"
3129 fi
3130 rm -f conftest*
3131 LIBS="$ac_save_LIBS"
3132
3133 fi
3134 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3135   echo "$ac_t""yes" 1>&6
3136     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3137     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3138   cat >> confdefs.h <<EOF
3139 #define $ac_tr_lib 1
3140 EOF
3141
3142   LIBS="-lsocket $LIBS"
3143
3144 else
3145   echo "$ac_t""no" 1>&6
3146 fi
3147
3148         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
3149 echo "configure:3150: checking for main in -lnet" >&5
3150 ac_lib_var=`echo net'_'main | sed 'y%./+-%__p_%'`
3151 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3152   echo $ac_n "(cached) $ac_c" 1>&6
3153 else
3154   ac_save_LIBS="$LIBS"
3155 LIBS="-lnet  $LIBS"
3156 cat > conftest.$ac_ext <<EOF
3157 #line 3158 "configure"
3158 #include "confdefs.h"
3159
3160 int main() {
3161 main()
3162 ; return 0; }
3163 EOF
3164 if { (eval echo configure:3165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3165   rm -rf conftest*
3166   eval "ac_cv_lib_$ac_lib_var=yes"
3167 else
3168   echo "configure: failed program was:" >&5
3169   cat conftest.$ac_ext >&5
3170   rm -rf conftest*
3171   eval "ac_cv_lib_$ac_lib_var=no"
3172 fi
3173 rm -f conftest*
3174 LIBS="$ac_save_LIBS"
3175
3176 fi
3177 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3178   echo "$ac_t""yes" 1>&6
3179     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3180     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3181   cat >> confdefs.h <<EOF
3182 #define $ac_tr_lib 1
3183 EOF
3184
3185   LIBS="-lnet $LIBS"
3186
3187 else
3188   echo "$ac_t""no" 1>&6
3189 fi
3190
3191         echo $ac_n "checking for socket in -lnet""... $ac_c" 1>&6
3192 echo "configure:3193: checking for socket in -lnet" >&5
3193 ac_lib_var=`echo net'_'socket | sed 'y%./+-%__p_%'`
3194 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3195   echo $ac_n "(cached) $ac_c" 1>&6
3196 else
3197   ac_save_LIBS="$LIBS"
3198 LIBS="-lnet  $LIBS"
3199 cat > conftest.$ac_ext <<EOF
3200 #line 3201 "configure"
3201 #include "confdefs.h"
3202 /* Override any gcc2 internal prototype to avoid an error.  */
3203 /* We use char because int might match the return type of a gcc2
3204     builtin and then its argument prototype would still apply.  */
3205 char socket();
3206
3207 int main() {
3208 socket()
3209 ; return 0; }
3210 EOF
3211 if { (eval echo configure:3212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3212   rm -rf conftest*
3213   eval "ac_cv_lib_$ac_lib_var=yes"
3214 else
3215   echo "configure: failed program was:" >&5
3216   cat conftest.$ac_ext >&5
3217   rm -rf conftest*
3218   eval "ac_cv_lib_$ac_lib_var=no"
3219 fi
3220 rm -f conftest*
3221 LIBS="$ac_save_LIBS"
3222
3223 fi
3224 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3225   echo "$ac_t""yes" 1>&6
3226     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3227     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3228   cat >> confdefs.h <<EOF
3229 #define $ac_tr_lib 1
3230 EOF
3231
3232   LIBS="-lnet $LIBS"
3233
3234 else
3235   echo "$ac_t""no" 1>&6
3236 fi
3237
3238         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
3239 echo "configure:3240: checking for main in -lnsl_s" >&5
3240 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-%__p_%'`
3241 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3242   echo $ac_n "(cached) $ac_c" 1>&6
3243 else
3244   ac_save_LIBS="$LIBS"
3245 LIBS="-lnsl_s  $LIBS"
3246 cat > conftest.$ac_ext <<EOF
3247 #line 3248 "configure"
3248 #include "confdefs.h"
3249
3250 int main() {
3251 main()
3252 ; return 0; }
3253 EOF
3254 if { (eval echo configure:3255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3255   rm -rf conftest*
3256   eval "ac_cv_lib_$ac_lib_var=yes"
3257 else
3258   echo "configure: failed program was:" >&5
3259   cat conftest.$ac_ext >&5
3260   rm -rf conftest*
3261   eval "ac_cv_lib_$ac_lib_var=no"
3262 fi
3263 rm -f conftest*
3264 LIBS="$ac_save_LIBS"
3265
3266 fi
3267 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3268   echo "$ac_t""yes" 1>&6
3269     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3270     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3271   cat >> confdefs.h <<EOF
3272 #define $ac_tr_lib 1
3273 EOF
3274
3275   LIBS="-lnsl_s $LIBS"
3276
3277 else
3278   echo "$ac_t""no" 1>&6
3279 fi
3280
3281         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
3282 echo "configure:3283: checking for main in -lnsl" >&5
3283 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
3284 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3285   echo $ac_n "(cached) $ac_c" 1>&6
3286 else
3287   ac_save_LIBS="$LIBS"
3288 LIBS="-lnsl  $LIBS"
3289 cat > conftest.$ac_ext <<EOF
3290 #line 3291 "configure"
3291 #include "confdefs.h"
3292
3293 int main() {
3294 main()
3295 ; return 0; }
3296 EOF
3297 if { (eval echo configure:3298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3298   rm -rf conftest*
3299   eval "ac_cv_lib_$ac_lib_var=yes"
3300 else
3301   echo "configure: failed program was:" >&5
3302   cat conftest.$ac_ext >&5
3303   rm -rf conftest*
3304   eval "ac_cv_lib_$ac_lib_var=no"
3305 fi
3306 rm -f conftest*
3307 LIBS="$ac_save_LIBS"
3308
3309 fi
3310 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3311   echo "$ac_t""yes" 1>&6
3312     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3313     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3314   cat >> confdefs.h <<EOF
3315 #define $ac_tr_lib 1
3316 EOF
3317
3318   LIBS="-lnsl $LIBS"
3319
3320 else
3321   echo "$ac_t""no" 1>&6
3322 fi
3323
3324         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
3325 echo "configure:3326: checking for socket in -linet" >&5
3326 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
3327 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3328   echo $ac_n "(cached) $ac_c" 1>&6
3329 else
3330   ac_save_LIBS="$LIBS"
3331 LIBS="-linet  $LIBS"
3332 cat > conftest.$ac_ext <<EOF
3333 #line 3334 "configure"
3334 #include "confdefs.h"
3335 /* Override any gcc2 internal prototype to avoid an error.  */
3336 /* We use char because int might match the return type of a gcc2
3337     builtin and then its argument prototype would still apply.  */
3338 char socket();
3339
3340 int main() {
3341 socket()
3342 ; return 0; }
3343 EOF
3344 if { (eval echo configure:3345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3345   rm -rf conftest*
3346   eval "ac_cv_lib_$ac_lib_var=yes"
3347 else
3348   echo "configure: failed program was:" >&5
3349   cat conftest.$ac_ext >&5
3350   rm -rf conftest*
3351   eval "ac_cv_lib_$ac_lib_var=no"
3352 fi
3353 rm -f conftest*
3354 LIBS="$ac_save_LIBS"
3355
3356 fi
3357 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3358   echo "$ac_t""yes" 1>&6
3359     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3360     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3361   cat >> confdefs.h <<EOF
3362 #define $ac_tr_lib 1
3363 EOF
3364
3365   LIBS="-linet $LIBS"
3366
3367 else
3368   echo "$ac_t""no" 1>&6
3369 fi
3370
3371         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
3372 echo "configure:3373: checking for main in -lgen" >&5
3373 ac_lib_var=`echo gen'_'main | sed 'y%./+-%__p_%'`
3374 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3375   echo $ac_n "(cached) $ac_c" 1>&6
3376 else
3377   ac_save_LIBS="$LIBS"
3378 LIBS="-lgen  $LIBS"
3379 cat > conftest.$ac_ext <<EOF
3380 #line 3381 "configure"
3381 #include "confdefs.h"
3382
3383 int main() {
3384 main()
3385 ; return 0; }
3386 EOF
3387 if { (eval echo configure:3388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3388   rm -rf conftest*
3389   eval "ac_cv_lib_$ac_lib_var=yes"
3390 else
3391   echo "configure: failed program was:" >&5
3392   cat conftest.$ac_ext >&5
3393   rm -rf conftest*
3394   eval "ac_cv_lib_$ac_lib_var=no"
3395 fi
3396 rm -f conftest*
3397 LIBS="$ac_save_LIBS"
3398
3399 fi
3400 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3401   echo "$ac_t""yes" 1>&6
3402     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3403     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3404   cat >> confdefs.h <<EOF
3405 #define $ac_tr_lib 1
3406 EOF
3407
3408   LIBS="-lgen $LIBS"
3409
3410 else
3411   echo "$ac_t""no" 1>&6
3412 fi
3413
3414
3415 fi
3416
3417
3418 for ac_func in res_search
3419 do
3420 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3421 echo "configure:3422: checking for $ac_func" >&5
3422 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3423   echo $ac_n "(cached) $ac_c" 1>&6
3424 else
3425   cat > conftest.$ac_ext <<EOF
3426 #line 3427 "configure"
3427 #include "confdefs.h"
3428 /* System header to define __stub macros and hopefully few prototypes,
3429     which can conflict with char $ac_func(); below.  */
3430 #include <assert.h>
3431 /* Override any gcc2 internal prototype to avoid an error.  */
3432 /* We use char because int might match the return type of a gcc2
3433     builtin and then its argument prototype would still apply.  */
3434 char $ac_func();
3435
3436 int main() {
3437
3438 /* The GNU C library defines this for functions which it implements
3439     to always fail with ENOSYS.  Some functions are actually named
3440     something starting with __ and the normal name is an alias.  */
3441 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3442 choke me
3443 #else
3444 $ac_func();
3445 #endif
3446
3447 ; return 0; }
3448 EOF
3449 if { (eval echo configure:3450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3450   rm -rf conftest*
3451   eval "ac_cv_func_$ac_func=yes"
3452 else
3453   echo "configure: failed program was:" >&5
3454   cat conftest.$ac_ext >&5
3455   rm -rf conftest*
3456   eval "ac_cv_func_$ac_func=no"
3457 fi
3458 rm -f conftest*
3459 fi
3460
3461 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3462   echo "$ac_t""yes" 1>&6
3463     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3464   cat >> confdefs.h <<EOF
3465 #define $ac_tr_func 1
3466 EOF
3467  
3468 else
3469   echo "$ac_t""no" 1>&6
3470 fi
3471 done
3472
3473 if test $ac_cv_func_res_search = "no" ; then 
3474         echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
3475 echo "configure:3476: checking for res_search in -lbind" >&5
3476 ac_lib_var=`echo bind'_'res_search | sed 'y%./+-%__p_%'`
3477 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3478   echo $ac_n "(cached) $ac_c" 1>&6
3479 else
3480   ac_save_LIBS="$LIBS"
3481 LIBS="-lbind  $LIBS"
3482 cat > conftest.$ac_ext <<EOF
3483 #line 3484 "configure"
3484 #include "confdefs.h"
3485 /* Override any gcc2 internal prototype to avoid an error.  */
3486 /* We use char because int might match the return type of a gcc2
3487     builtin and then its argument prototype would still apply.  */
3488 char res_search();
3489
3490 int main() {
3491 res_search()
3492 ; return 0; }
3493 EOF
3494 if { (eval echo configure:3495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3495   rm -rf conftest*
3496   eval "ac_cv_lib_$ac_lib_var=yes"
3497 else
3498   echo "configure: failed program was:" >&5
3499   cat conftest.$ac_ext >&5
3500   rm -rf conftest*
3501   eval "ac_cv_lib_$ac_lib_var=no"
3502 fi
3503 rm -f conftest*
3504 LIBS="$ac_save_LIBS"
3505
3506 fi
3507 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3508   echo "$ac_t""yes" 1>&6
3509     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3510     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3511   cat >> confdefs.h <<EOF
3512 #define $ac_tr_lib 1
3513 EOF
3514
3515   LIBS="-lbind $LIBS"
3516
3517 else
3518   echo "$ac_t""no" 1>&6
3519 fi
3520
3521         if test "$ac_cv_lib_bind_res_search" = "yes" ; then
3522                 cat >> confdefs.h <<\EOF
3523 #define HAVE_RES_SEARCH 1
3524 EOF
3525
3526         else
3527                 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
3528 echo "configure:3529: checking for res_search in -lresolv" >&5
3529 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
3530 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3531   echo $ac_n "(cached) $ac_c" 1>&6
3532 else
3533   ac_save_LIBS="$LIBS"
3534 LIBS="-lresolv  $LIBS"
3535 cat > conftest.$ac_ext <<EOF
3536 #line 3537 "configure"
3537 #include "confdefs.h"
3538 /* Override any gcc2 internal prototype to avoid an error.  */
3539 /* We use char because int might match the return type of a gcc2
3540     builtin and then its argument prototype would still apply.  */
3541 char res_search();
3542
3543 int main() {
3544 res_search()
3545 ; return 0; }
3546 EOF
3547 if { (eval echo configure:3548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3548   rm -rf conftest*
3549   eval "ac_cv_lib_$ac_lib_var=yes"
3550 else
3551   echo "configure: failed program was:" >&5
3552   cat conftest.$ac_ext >&5
3553   rm -rf conftest*
3554   eval "ac_cv_lib_$ac_lib_var=no"
3555 fi
3556 rm -f conftest*
3557 LIBS="$ac_save_LIBS"
3558
3559 fi
3560 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3561   echo "$ac_t""yes" 1>&6
3562     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3563     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3564   cat >> confdefs.h <<EOF
3565 #define $ac_tr_lib 1
3566 EOF
3567
3568   LIBS="-lresolv $LIBS"
3569
3570 else
3571   echo "$ac_t""no" 1>&6
3572 fi
3573
3574                 if test "$ac_cv_lib_resolv_res_search" = "yes" ; then
3575                         cat >> confdefs.h <<\EOF
3576 #define HAVE_RES_SEARCH 1
3577 EOF
3578
3579                 fi
3580         fi
3581 fi
3582
3583 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
3584 echo "configure:3585: checking for sigset in -lV3" >&5
3585 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-%__p_%'`
3586 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3587   echo $ac_n "(cached) $ac_c" 1>&6
3588 else
3589   ac_save_LIBS="$LIBS"
3590 LIBS="-lV3  $LIBS"
3591 cat > conftest.$ac_ext <<EOF
3592 #line 3593 "configure"
3593 #include "confdefs.h"
3594 /* Override any gcc2 internal prototype to avoid an error.  */
3595 /* We use char because int might match the return type of a gcc2
3596     builtin and then its argument prototype would still apply.  */
3597 char sigset();
3598
3599 int main() {
3600 sigset()
3601 ; return 0; }
3602 EOF
3603 if { (eval echo configure:3604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3604   rm -rf conftest*
3605   eval "ac_cv_lib_$ac_lib_var=yes"
3606 else
3607   echo "configure: failed program was:" >&5
3608   cat conftest.$ac_ext >&5
3609   rm -rf conftest*
3610   eval "ac_cv_lib_$ac_lib_var=no"
3611 fi
3612 rm -f conftest*
3613 LIBS="$ac_save_LIBS"
3614
3615 fi
3616 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3617   echo "$ac_t""yes" 1>&6
3618     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3619     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3620   cat >> confdefs.h <<EOF
3621 #define $ac_tr_lib 1
3622 EOF
3623
3624   LIBS="-lV3 $LIBS"
3625
3626 else
3627   echo "$ac_t""no" 1>&6
3628 fi
3629
3630
3631 echo $ac_n "checking for select""... $ac_c" 1>&6
3632 echo "configure:3633: checking for select" >&5
3633 if eval "test \"`echo '$''{'ac_cv_func_select'+set}'`\" = set"; then
3634   echo $ac_n "(cached) $ac_c" 1>&6
3635 else
3636   cat > conftest.$ac_ext <<EOF
3637 #line 3638 "configure"
3638 #include "confdefs.h"
3639 /* System header to define __stub macros and hopefully few prototypes,
3640     which can conflict with char select(); below.  */
3641 #include <assert.h>
3642 /* Override any gcc2 internal prototype to avoid an error.  */
3643 /* We use char because int might match the return type of a gcc2
3644     builtin and then its argument prototype would still apply.  */
3645 char select();
3646
3647 int main() {
3648
3649 /* The GNU C library defines this for functions which it implements
3650     to always fail with ENOSYS.  Some functions are actually named
3651     something starting with __ and the normal name is an alias.  */
3652 #if defined (__stub_select) || defined (__stub___select)
3653 choke me
3654 #else
3655 select();
3656 #endif
3657
3658 ; return 0; }
3659 EOF
3660 if { (eval echo configure:3661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3661   rm -rf conftest*
3662   eval "ac_cv_func_select=yes"
3663 else
3664   echo "configure: failed program was:" >&5
3665   cat conftest.$ac_ext >&5
3666   rm -rf conftest*
3667   eval "ac_cv_func_select=no"
3668 fi
3669 rm -f conftest*
3670 fi
3671
3672 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
3673   echo "$ac_t""yes" 1>&6
3674   :
3675 else
3676   echo "$ac_t""no" 1>&6
3677 { echo "configure: error: select() required." 1>&2; exit 1; }
3678 fi
3679
3680
3681 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
3682 echo "configure:3683: checking types of arguments for select()" >&5
3683  if eval "test \"`echo '$''{'ac_cv_func_select_arg234'+set}'`\" = set"; then
3684   echo $ac_n "(cached) $ac_c" 1>&6
3685 else
3686    if eval "test \"`echo '$''{'ac_cv_func_select_arg1'+set}'`\" = set"; then
3687   echo $ac_n "(cached) $ac_c" 1>&6
3688 else
3689     if eval "test \"`echo '$''{'ac_cv_func_select_arg5'+set}'`\" = set"; then
3690   echo $ac_n "(cached) $ac_c" 1>&6
3691 else
3692      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
3693      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
3694       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
3695        cat > conftest.$ac_ext <<EOF
3696 #line 3697 "configure"
3697 #include "confdefs.h"
3698 #ifdef HAVE_SYS_TYPES_H
3699 #include <sys/types.h>
3700 #endif
3701 #ifdef HAVE_SYS_TIME_H
3702 #include <sys/time.h>
3703 #endif
3704 #ifdef HAVE_SYS_SELECT_H
3705 #include <sys/select.h>
3706 #endif
3707 #ifdef HAVE_SYS_SOCKET_H
3708 #include <sys/socket.h>
3709 #endif
3710 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);
3711 int main() {
3712
3713 ; return 0; }
3714 EOF
3715 if { (eval echo configure:3716: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3716   rm -rf conftest*
3717           ac_not_found=no ; break 3
3718 else
3719   echo "configure: failed program was:" >&5
3720   cat conftest.$ac_ext >&5
3721   rm -rf conftest*
3722   ac_not_found=yes
3723 fi
3724 rm -f conftest*
3725       done
3726      done
3727     done
3728    
3729 fi
3730   
3731 fi
3732  
3733 fi
3734  if test "$ac_not_found" = yes; then
3735   ac_cv_func_select_arg1=int 
3736   ac_cv_func_select_arg234='int *' 
3737   ac_cv_func_select_arg5='struct timeval *'
3738  fi
3739  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
3740  cat >> confdefs.h <<EOF
3741 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
3742 EOF
3743
3744  cat >> confdefs.h <<EOF
3745 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
3746 EOF
3747
3748  cat >> confdefs.h <<EOF
3749 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
3750 EOF
3751
3752
3753
3754 # ISODE tests
3755 ol_link_isode=no
3756 if test $ol_enable_ldapd != no ; then
3757                 echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
3758 echo "configure:3759: checking for main in -lxtpp" >&5
3759 ac_lib_var=`echo xtpp'_'main | sed 'y%./+-%__p_%'`
3760 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3761   echo $ac_n "(cached) $ac_c" 1>&6
3762 else
3763   ac_save_LIBS="$LIBS"
3764 LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
3765 cat > conftest.$ac_ext <<EOF
3766 #line 3767 "configure"
3767 #include "confdefs.h"
3768
3769 int main() {
3770 main()
3771 ; return 0; }
3772 EOF
3773 if { (eval echo configure:3774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3774   rm -rf conftest*
3775   eval "ac_cv_lib_$ac_lib_var=yes"
3776 else
3777   echo "configure: failed program was:" >&5
3778   cat conftest.$ac_ext >&5
3779   rm -rf conftest*
3780   eval "ac_cv_lib_$ac_lib_var=no"
3781 fi
3782 rm -f conftest*
3783 LIBS="$ac_save_LIBS"
3784
3785 fi
3786 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3787   echo "$ac_t""yes" 1>&6
3788   
3789                 ol_link_isode=yes
3790                 cat >> confdefs.h <<\EOF
3791 #define HAVE_XTPP 1
3792 EOF
3793
3794                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
3795                 
3796 else
3797   echo "$ac_t""no" 1>&6
3798 :
3799 fi
3800
3801         echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
3802 echo "configure:3803: checking for main in -ldsap" >&5
3803 ac_lib_var=`echo dsap'_'main | sed 'y%./+-%__p_%'`
3804 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3805   echo $ac_n "(cached) $ac_c" 1>&6
3806 else
3807   ac_save_LIBS="$LIBS"
3808 LIBS="-ldsap -lisode $LIBS"
3809 cat > conftest.$ac_ext <<EOF
3810 #line 3811 "configure"
3811 #include "confdefs.h"
3812
3813 int main() {
3814 main()
3815 ; return 0; }
3816 EOF
3817 if { (eval echo configure:3818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3818   rm -rf conftest*
3819   eval "ac_cv_lib_$ac_lib_var=yes"
3820 else
3821   echo "configure: failed program was:" >&5
3822   cat conftest.$ac_ext >&5
3823   rm -rf conftest*
3824   eval "ac_cv_lib_$ac_lib_var=no"
3825 fi
3826 rm -f conftest*
3827 LIBS="$ac_save_LIBS"
3828
3829 fi
3830 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3831   echo "$ac_t""yes" 1>&6
3832   
3833                 ol_link_isode=yes
3834                 cat >> confdefs.h <<\EOF
3835 #define HAVE_DSAP 1
3836 EOF
3837
3838                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
3839                 
3840 else
3841   echo "$ac_t""no" 1>&6
3842 :
3843 fi
3844
3845         echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
3846 echo "configure:3847: checking for main in -lisode" >&5
3847 ac_lib_var=`echo isode'_'main | sed 'y%./+-%__p_%'`
3848 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3849   echo $ac_n "(cached) $ac_c" 1>&6
3850 else
3851   ac_save_LIBS="$LIBS"
3852 LIBS="-lisode  $LIBS"
3853 cat > conftest.$ac_ext <<EOF
3854 #line 3855 "configure"
3855 #include "confdefs.h"
3856
3857 int main() {
3858 main()
3859 ; return 0; }
3860 EOF
3861 if { (eval echo configure:3862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3862   rm -rf conftest*
3863   eval "ac_cv_lib_$ac_lib_var=yes"
3864 else
3865   echo "configure: failed program was:" >&5
3866   cat conftest.$ac_ext >&5
3867   rm -rf conftest*
3868   eval "ac_cv_lib_$ac_lib_var=no"
3869 fi
3870 rm -f conftest*
3871 LIBS="$ac_save_LIBS"
3872
3873 fi
3874 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3875   echo "$ac_t""yes" 1>&6
3876   
3877                 ol_link_isode=yes
3878                 cat >> confdefs.h <<\EOF
3879 #define HAVE_ISODE 1
3880 EOF
3881
3882                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
3883                 
3884 else
3885   echo "$ac_t""no" 1>&6
3886 :
3887 fi
3888
3889 fi
3890
3891 if test $ol_link_isode != no; then
3892         echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
3893 echo "configure:3894: checking for main in -lpp" >&5
3894 ac_lib_var=`echo pp'_'main | sed 'y%./+-%__p_%'`
3895 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3896   echo $ac_n "(cached) $ac_c" 1>&6
3897 else
3898   ac_save_LIBS="$LIBS"
3899 LIBS="-lpp  $LIBS"
3900 cat > conftest.$ac_ext <<EOF
3901 #line 3902 "configure"
3902 #include "confdefs.h"
3903
3904 int main() {
3905 main()
3906 ; return 0; }
3907 EOF
3908 if { (eval echo configure:3909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3909   rm -rf conftest*
3910   eval "ac_cv_lib_$ac_lib_var=yes"
3911 else
3912   echo "configure: failed program was:" >&5
3913   cat conftest.$ac_ext >&5
3914   rm -rf conftest*
3915   eval "ac_cv_lib_$ac_lib_var=no"
3916 fi
3917 rm -f conftest*
3918 LIBS="$ac_save_LIBS"
3919
3920 fi
3921 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3922   echo "$ac_t""yes" 1>&6
3923   
3924                 cat >> confdefs.h <<\EOF
3925 #define HAVE_PP 1
3926 EOF
3927
3928                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
3929                 
3930 else
3931   echo "$ac_t""no" 1>&6
3932 :
3933 fi
3934
3935
3936         # Extract the first word of "pepsy", so it can be a program name with args.
3937 set dummy pepsy; ac_word=$2
3938 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3939 echo "configure:3940: checking for $ac_word" >&5
3940 if eval "test \"`echo '$''{'ac_cv_path_PEPSY'+set}'`\" = set"; then
3941   echo $ac_n "(cached) $ac_c" 1>&6
3942 else
3943   case "$PEPSY" in
3944   /*)
3945   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a path.
3946   ;;
3947   ?:/*)                  
3948   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a dos path.
3949   ;;
3950   *)
3951   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3952   ac_dummy="$PATH"
3953   for ac_dir in $ac_dummy; do 
3954     test -z "$ac_dir" && ac_dir=.
3955     if test -f $ac_dir/$ac_word; then
3956       ac_cv_path_PEPSY="$ac_dir/$ac_word"
3957       break
3958     fi
3959   done
3960   IFS="$ac_save_ifs"
3961   ;;
3962 esac
3963 fi
3964 PEPSY="$ac_cv_path_PEPSY"
3965 if test -n "$PEPSY"; then
3966   echo "$ac_t""$PEPSY" 1>&6
3967 else
3968   echo "$ac_t""no" 1>&6
3969 fi
3970
3971 fi
3972
3973 ol_link_kerberos=no
3974
3975 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
3976         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
3977 do
3978 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3979 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3980 echo "configure:3981: checking for $ac_hdr" >&5
3981 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3982   echo $ac_n "(cached) $ac_c" 1>&6
3983 else
3984   cat > conftest.$ac_ext <<EOF
3985 #line 3986 "configure"
3986 #include "confdefs.h"
3987 #include <$ac_hdr>
3988 EOF
3989 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3990 { (eval echo configure:3991: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3991 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3992 if test -z "$ac_err"; then
3993   rm -rf conftest*
3994   eval "ac_cv_header_$ac_safe=yes"
3995 else
3996   echo "$ac_err" >&5
3997   echo "configure: failed program was:" >&5
3998   cat conftest.$ac_ext >&5
3999   rm -rf conftest*
4000   eval "ac_cv_header_$ac_safe=no"
4001 fi
4002 rm -f conftest*
4003 fi
4004 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4005   echo "$ac_t""yes" 1>&6
4006     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4007   cat >> confdefs.h <<EOF
4008 #define $ac_tr_hdr 1
4009 EOF
4010  
4011 else
4012   echo "$ac_t""no" 1>&6
4013 fi
4014 done
4015
4016
4017         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
4018                 echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
4019 echo "configure:4020: checking for main in -lkrb4" >&5
4020 ac_lib_var=`echo krb4'_'main | sed 'y%./+-%__p_%'`
4021 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4022   echo $ac_n "(cached) $ac_c" 1>&6
4023 else
4024   ac_save_LIBS="$LIBS"
4025 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
4026 cat > conftest.$ac_ext <<EOF
4027 #line 4028 "configure"
4028 #include "confdefs.h"
4029
4030 int main() {
4031 main()
4032 ; return 0; }
4033 EOF
4034 if { (eval echo configure:4035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4035   rm -rf conftest*
4036   eval "ac_cv_lib_$ac_lib_var=yes"
4037 else
4038   echo "configure: failed program was:" >&5
4039   cat conftest.$ac_ext >&5
4040   rm -rf conftest*
4041   eval "ac_cv_lib_$ac_lib_var=no"
4042 fi
4043 rm -f conftest*
4044 LIBS="$ac_save_LIBS"
4045
4046 fi
4047 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4048   echo "$ac_t""yes" 1>&6
4049   have_k5=yes
4050 else
4051   echo "$ac_t""no" 1>&6
4052 have_k5=no
4053 fi
4054
4055
4056                 if test $have_k5 = yes ; then
4057                         ol_with_kerberos=found
4058                         ol_link_kerberos=yes
4059
4060                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
4061
4062                         LIBS="$KRB_LIBS $LIBS"
4063
4064                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
4065 echo "configure:4066: checking for des_debug in Kerberos libraries" >&5
4066 if eval "test \"`echo '$''{'ol_cv_var_des_debug'+set}'`\" = set"; then
4067   echo $ac_n "(cached) $ac_c" 1>&6
4068 else
4069   
4070                                                                 save_LIBS="$LIBS"
4071                                 LIBS="$KRB_LIBS $LIBS"
4072                                 cat > conftest.$ac_ext <<EOF
4073 #line 4074 "configure"
4074 #include "confdefs.h"
4075
4076 #include <kerberosIV/krb.h>
4077 #include <kerberosIV/des.h>
4078 extern int des_debug;
4079
4080 int main() {
4081
4082 des_debug = 1;
4083
4084 ; return 0; }
4085 EOF
4086 if { (eval echo configure:4087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4087   rm -rf conftest*
4088   ol_cv_var_des_debug=yes
4089 else
4090   echo "configure: failed program was:" >&5
4091   cat conftest.$ac_ext >&5
4092   rm -rf conftest*
4093   ol_cv_var_des_debug=no
4094 fi
4095 rm -f conftest*
4096                                                                 LIBS="$save_LIBS"
4097                         
4098 fi
4099
4100 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
4101
4102                         if test $ol_cv_var_des_debug = yes ; then
4103                                 cat >> confdefs.h <<\EOF
4104 #define HAVE_DES_DEBUG 1
4105 EOF
4106
4107                         fi
4108
4109                         LIBS="$save_LIBS"
4110                 fi
4111         fi
4112 fi
4113
4114 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
4115         for ac_hdr in krb.h des.h
4116 do
4117 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4118 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4119 echo "configure:4120: checking for $ac_hdr" >&5
4120 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4121   echo $ac_n "(cached) $ac_c" 1>&6
4122 else
4123   cat > conftest.$ac_ext <<EOF
4124 #line 4125 "configure"
4125 #include "confdefs.h"
4126 #include <$ac_hdr>
4127 EOF
4128 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4129 { (eval echo configure:4130: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4130 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4131 if test -z "$ac_err"; then
4132   rm -rf conftest*
4133   eval "ac_cv_header_$ac_safe=yes"
4134 else
4135   echo "$ac_err" >&5
4136   echo "configure: failed program was:" >&5
4137   cat conftest.$ac_ext >&5
4138   rm -rf conftest*
4139   eval "ac_cv_header_$ac_safe=no"
4140 fi
4141 rm -f conftest*
4142 fi
4143 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4144   echo "$ac_t""yes" 1>&6
4145     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4146   cat >> confdefs.h <<EOF
4147 #define $ac_tr_hdr 1
4148 EOF
4149  
4150 else
4151   echo "$ac_t""no" 1>&6
4152 fi
4153 done
4154
4155
4156         if test $ac_cv_header_krb_h = yes ; then
4157                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
4158 echo "configure:4159: checking for main in -lkrb" >&5
4159 ac_lib_var=`echo krb'_'main | sed 'y%./+-%__p_%'`
4160 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4161   echo $ac_n "(cached) $ac_c" 1>&6
4162 else
4163   ac_save_LIBS="$LIBS"
4164 LIBS="-lkrb -ldes $LIBS"
4165 cat > conftest.$ac_ext <<EOF
4166 #line 4167 "configure"
4167 #include "confdefs.h"
4168
4169 int main() {
4170 main()
4171 ; return 0; }
4172 EOF
4173 if { (eval echo configure:4174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4174   rm -rf conftest*
4175   eval "ac_cv_lib_$ac_lib_var=yes"
4176 else
4177   echo "configure: failed program was:" >&5
4178   cat conftest.$ac_ext >&5
4179   rm -rf conftest*
4180   eval "ac_cv_lib_$ac_lib_var=no"
4181 fi
4182 rm -f conftest*
4183 LIBS="$ac_save_LIBS"
4184
4185 fi
4186 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4187   echo "$ac_t""yes" 1>&6
4188   have_k4=yes
4189 else
4190   echo "$ac_t""no" 1>&6
4191 have_k4=no
4192 fi
4193
4194
4195                 if test $have_k4 = yes ; then
4196                         ol_with_kerberos=found
4197                         ol_link_kerberos=yes
4198
4199                         KRB_LIBS="-lkrb -ldes"
4200                 fi
4201         fi
4202 fi
4203
4204 if test $ol_link_kerberos = yes ; then
4205         cat >> confdefs.h <<\EOF
4206 #define HAVE_KERBEROS 1
4207 EOF
4208
4209 fi
4210
4211 ol_link_tls=no
4212 if test $ol_with_tls != no ; then
4213         
4214         for ac_hdr in ssl.h
4215 do
4216 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4217 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4218 echo "configure:4219: checking for $ac_hdr" >&5
4219 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4220   echo $ac_n "(cached) $ac_c" 1>&6
4221 else
4222   cat > conftest.$ac_ext <<EOF
4223 #line 4224 "configure"
4224 #include "confdefs.h"
4225 #include <$ac_hdr>
4226 EOF
4227 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4228 { (eval echo configure:4229: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4229 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4230 if test -z "$ac_err"; then
4231   rm -rf conftest*
4232   eval "ac_cv_header_$ac_safe=yes"
4233 else
4234   echo "$ac_err" >&5
4235   echo "configure: failed program was:" >&5
4236   cat conftest.$ac_ext >&5
4237   rm -rf conftest*
4238   eval "ac_cv_header_$ac_safe=no"
4239 fi
4240 rm -f conftest*
4241 fi
4242 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4243   echo "$ac_t""yes" 1>&6
4244     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4245   cat >> confdefs.h <<EOF
4246 #define $ac_tr_hdr 1
4247 EOF
4248  
4249 else
4250   echo "$ac_t""no" 1>&6
4251 fi
4252 done
4253
4254         
4255         if test $ac_cv_header_ssl_h = yes ; then
4256                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
4257 echo "configure:4258: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
4258 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-%__p_%'`
4259 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4260   echo $ac_n "(cached) $ac_c" 1>&6
4261 else
4262   ac_save_LIBS="$LIBS"
4263 LIBS="-lssl -lcrypto $LIBS"
4264 cat > conftest.$ac_ext <<EOF
4265 #line 4266 "configure"
4266 #include "confdefs.h"
4267 /* Override any gcc2 internal prototype to avoid an error.  */
4268 /* We use char because int might match the return type of a gcc2
4269     builtin and then its argument prototype would still apply.  */
4270 char SSLeay_add_ssl_algorithms();
4271
4272 int main() {
4273 SSLeay_add_ssl_algorithms()
4274 ; return 0; }
4275 EOF
4276 if { (eval echo configure:4277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4277   rm -rf conftest*
4278   eval "ac_cv_lib_$ac_lib_var=yes"
4279 else
4280   echo "configure: failed program was:" >&5
4281   cat conftest.$ac_ext >&5
4282   rm -rf conftest*
4283   eval "ac_cv_lib_$ac_lib_var=no"
4284 fi
4285 rm -f conftest*
4286 LIBS="$ac_save_LIBS"
4287
4288 fi
4289 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4290   echo "$ac_t""yes" 1>&6
4291   have_ssleay=yes
4292                         need_rsaref=no
4293 else
4294   echo "$ac_t""no" 1>&6
4295 have_ssleay=no
4296 fi
4297
4298                         
4299                 if test $have_ssleay = no ; then
4300                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
4301 echo "configure:4302: checking for ssl3_accept in -lssl" >&5
4302 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-%__p_%'`
4303 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4304   echo $ac_n "(cached) $ac_c" 1>&6
4305 else
4306   ac_save_LIBS="$LIBS"
4307 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
4308 cat > conftest.$ac_ext <<EOF
4309 #line 4310 "configure"
4310 #include "confdefs.h"
4311 /* Override any gcc2 internal prototype to avoid an error.  */
4312 /* We use char because int might match the return type of a gcc2
4313     builtin and then its argument prototype would still apply.  */
4314 char ssl3_accept();
4315
4316 int main() {
4317 ssl3_accept()
4318 ; return 0; }
4319 EOF
4320 if { (eval echo configure:4321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4321   rm -rf conftest*
4322   eval "ac_cv_lib_$ac_lib_var=yes"
4323 else
4324   echo "configure: failed program was:" >&5
4325   cat conftest.$ac_ext >&5
4326   rm -rf conftest*
4327   eval "ac_cv_lib_$ac_lib_var=no"
4328 fi
4329 rm -f conftest*
4330 LIBS="$ac_save_LIBS"
4331
4332 fi
4333 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4334   echo "$ac_t""yes" 1>&6
4335   have_ssleay=yes
4336                                 need_rsaref=yes
4337 else
4338   echo "$ac_t""no" 1>&6
4339 have_ssleay=no
4340 fi
4341
4342                 fi
4343
4344                 if test $have_ssleay = yes ; then
4345                         ol_with_tls=found
4346                         ol_link_tls=yes
4347
4348                         cat >> confdefs.h <<\EOF
4349 #define HAVE_SSLEAY 1
4350 EOF
4351
4352
4353                         if test $need_rsaref = yes; then
4354                                 cat >> confdefs.h <<\EOF
4355 #define HAVE_RSAREF 1
4356 EOF
4357
4358
4359                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
4360                         else
4361                                 TLS_LIBS="-lssl -lcrypto"
4362                         fi
4363                 fi
4364         fi
4365 fi
4366
4367 if test $ol_link_tls = yes ; then
4368         cat >> confdefs.h <<\EOF
4369 #define HAVE_TLS 1
4370 EOF
4371
4372 fi      
4373
4374 for ac_func in \
4375         ctime_r                 \
4376         gethostbyname_r gethostbyaddr_r \
4377
4378 do
4379 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4380 echo "configure:4381: checking for $ac_func" >&5
4381 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4382   echo $ac_n "(cached) $ac_c" 1>&6
4383 else
4384   cat > conftest.$ac_ext <<EOF
4385 #line 4386 "configure"
4386 #include "confdefs.h"
4387 /* System header to define __stub macros and hopefully few prototypes,
4388     which can conflict with char $ac_func(); below.  */
4389 #include <assert.h>
4390 /* Override any gcc2 internal prototype to avoid an error.  */
4391 /* We use char because int might match the return type of a gcc2
4392     builtin and then its argument prototype would still apply.  */
4393 char $ac_func();
4394
4395 int main() {
4396
4397 /* The GNU C library defines this for functions which it implements
4398     to always fail with ENOSYS.  Some functions are actually named
4399     something starting with __ and the normal name is an alias.  */
4400 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4401 choke me
4402 #else
4403 $ac_func();
4404 #endif
4405
4406 ; return 0; }
4407 EOF
4408 if { (eval echo configure:4409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4409   rm -rf conftest*
4410   eval "ac_cv_func_$ac_func=yes"
4411 else
4412   echo "configure: failed program was:" >&5
4413   cat conftest.$ac_ext >&5
4414   rm -rf conftest*
4415   eval "ac_cv_func_$ac_func=no"
4416 fi
4417 rm -f conftest*
4418 fi
4419
4420 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4421   echo "$ac_t""yes" 1>&6
4422     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4423   cat >> confdefs.h <<EOF
4424 #define $ac_tr_func 1
4425 EOF
4426  
4427 else
4428   echo "$ac_t""no" 1>&6
4429 fi
4430 done
4431
4432
4433 if test "$ac_cv_func_ctime_r" = no ; then
4434         ol_cv_func_ctime_r_nargs=0
4435 else
4436         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
4437 echo "configure:4438: checking number of arguments of ctime_r" >&5
4438 if eval "test \"`echo '$''{'ol_cv_func_ctime_r_nargs'+set}'`\" = set"; then
4439   echo $ac_n "(cached) $ac_c" 1>&6
4440 else
4441   cat > conftest.$ac_ext <<EOF
4442 #line 4443 "configure"
4443 #include "confdefs.h"
4444 #include <time.h>
4445 int main() {
4446 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
4447 ; return 0; }
4448 EOF
4449 if { (eval echo configure:4450: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4450   rm -rf conftest*
4451   ol_cv_func_ctime_r_nargs=3
4452 else
4453   echo "configure: failed program was:" >&5
4454   cat conftest.$ac_ext >&5
4455   rm -rf conftest*
4456   cat > conftest.$ac_ext <<EOF
4457 #line 4458 "configure"
4458 #include "confdefs.h"
4459 #include <time.h>
4460 int main() {
4461 time_t ti; char *buffer; ctime_r(&ti,buffer);
4462 ; return 0; }
4463 EOF
4464 if { (eval echo configure:4465: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4465   rm -rf conftest*
4466   ol_cv_func_ctime_r_nargs=2
4467 else
4468   echo "configure: failed program was:" >&5
4469   cat conftest.$ac_ext >&5
4470   rm -rf conftest*
4471   ol_cv_func_ctime_r_nargs=0
4472 fi
4473 rm -f conftest*
4474 fi
4475 rm -f conftest*
4476 fi
4477
4478 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
4479   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
4480     cat >> confdefs.h <<EOF
4481 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
4482 EOF
4483
4484   fi
4485
4486 fi
4487
4488 if test "$ac_cv_func_gethostbyname_r" = yes ; then
4489         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
4490 echo "configure:4491: checking number of arguments of gethostbyname_r" >&5
4491 if eval "test \"`echo '$''{'ol_cv_func_gethostbyname_r_nargs'+set}'`\" = set"; then
4492   echo $ac_n "(cached) $ac_c" 1>&6
4493 else
4494   cat > conftest.$ac_ext <<EOF
4495 #line 4496 "configure"
4496 #include "confdefs.h"
4497 #include <sys/types.h>
4498 #include <sys/socket.h>
4499 #include <netinet/in.h>
4500 #include <netdb.h>
4501 #define BUFSIZE (sizeof(struct hostent)+10)
4502 int main() {
4503 struct hostent hent; char buffer[BUFSIZE];
4504                 int bufsize=BUFSIZE;int h_errno;
4505                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
4506                         buffer, bufsize, &h_errno);
4507 ; return 0; }
4508 EOF
4509 if { (eval echo configure:4510: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4510   rm -rf conftest*
4511   ol_cv_func_gethostbyname_r_nargs=5
4512 else
4513   echo "configure: failed program was:" >&5
4514   cat conftest.$ac_ext >&5
4515   rm -rf conftest*
4516   cat > conftest.$ac_ext <<EOF
4517 #line 4518 "configure"
4518 #include "confdefs.h"
4519 #include <sys/types.h>
4520 #include <sys/socket.h>
4521 #include <netinet/in.h>
4522 #include <netdb.h>
4523 #define BUFSIZE (sizeof(struct hostent)+10)
4524 int main() {
4525 struct hostent hent;struct hostent *rhent;
4526                         char buffer[BUFSIZE];
4527                         int bufsize=BUFSIZE;int h_errno;
4528                         (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
4529                                 &rhent, &h_errno);
4530 ; return 0; }
4531 EOF
4532 if { (eval echo configure:4533: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4533   rm -rf conftest*
4534   ol_cv_func_gethostbyname_r_nargs=6
4535 else
4536   echo "configure: failed program was:" >&5
4537   cat conftest.$ac_ext >&5
4538   rm -rf conftest*
4539   ol_cv_func_gethostbyname_r_nargs=0
4540 fi
4541 rm -f conftest*
4542 fi
4543 rm -f conftest*
4544 fi
4545
4546 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
4547   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
4548         cat >> confdefs.h <<EOF
4549 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
4550 EOF
4551
4552   fi
4553
4554 else
4555         ol_cv_func_gethostbyname_r_nargs=0
4556 fi
4557  
4558 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
4559         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
4560 echo "configure:4561: checking number of arguments of gethostbyaddr_r" >&5
4561 if eval "test \"`echo '$''{'ol_cv_func_gethostbyaddr_r_nargs'+set}'`\" = set"; then
4562   echo $ac_n "(cached) $ac_c" 1>&6
4563 else
4564   cat > conftest.$ac_ext <<EOF
4565 #line 4566 "configure"
4566 #include "confdefs.h"
4567 #include <sys/types.h>
4568 #include <sys/socket.h>
4569 #include <netinet/in.h>
4570 #include <netdb.h>
4571 #define BUFSIZE (sizeof(struct hostent)+10)
4572 int main() {
4573 struct hostent hent; char buffer[BUFSIZE]; 
4574             struct in_addr add;
4575             size_t alen=sizeof(struct in_addr);
4576             int bufsize=BUFSIZE;int h_errno;
4577                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
4578                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
4579 ; return 0; }
4580 EOF
4581 if { (eval echo configure:4582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4582   rm -rf conftest*
4583   ol_cv_func_gethostbyaddr_r_nargs=7
4584 else
4585   echo "configure: failed program was:" >&5
4586   cat conftest.$ac_ext >&5
4587   rm -rf conftest*
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;
4598                         struct hostent *rhent; char buffer[BUFSIZE]; 
4599                         struct in_addr add;
4600                         size_t alen=sizeof(struct in_addr);
4601                         int bufsize=BUFSIZE;int h_errno;
4602                         (void)gethostbyaddr_r( (void *)&(add.s_addr),
4603                                 alen, AF_INET, &hent, buffer, bufsize, 
4604                                 &rhent, &h_errno);
4605 ; return 0; }
4606 EOF
4607 if { (eval echo configure:4608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4608   rm -rf conftest*
4609   ol_cv_func_gethostbyaddr_r_nargs=8
4610 else
4611   echo "configure: failed program was:" >&5
4612   cat conftest.$ac_ext >&5
4613   rm -rf conftest*
4614   ol_cv_func_gethostbyaddr_r_nargs=0
4615 fi
4616 rm -f conftest*
4617 fi
4618 rm -f conftest*
4619 fi
4620
4621 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
4622   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
4623     cat >> confdefs.h <<EOF
4624 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
4625 EOF
4626
4627   fi
4628
4629 else
4630         ol_cv_func_gethostbyaddr_r_nargs=0
4631 fi
4632
4633 if test "$ac_cv_func_ctime_r" = yes \
4634         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
4635         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
4636         -a "$ac_cv_func_gethostbyname_r" = yes \
4637         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
4638         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
4639         -a "$ac_cv_func_gethostbyaddr_r" = yes \
4640         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
4641         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
4642         ; then
4643  
4644         cat >> confdefs.h <<\EOF
4645 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
4646 EOF
4647
4648 fi
4649
4650 ol_link_threads=no
4651 if test $ol_with_threads = auto -o $ol_with_threads = yes \
4652         -o $ol_with_threads = posix ; then
4653
4654         for ac_hdr in pthread.h sched.h
4655 do
4656 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4657 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4658 echo "configure:4659: checking for $ac_hdr" >&5
4659 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4660   echo $ac_n "(cached) $ac_c" 1>&6
4661 else
4662   cat > conftest.$ac_ext <<EOF
4663 #line 4664 "configure"
4664 #include "confdefs.h"
4665 #include <$ac_hdr>
4666 EOF
4667 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4668 { (eval echo configure:4669: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4669 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4670 if test -z "$ac_err"; then
4671   rm -rf conftest*
4672   eval "ac_cv_header_$ac_safe=yes"
4673 else
4674   echo "$ac_err" >&5
4675   echo "configure: failed program was:" >&5
4676   cat conftest.$ac_ext >&5
4677   rm -rf conftest*
4678   eval "ac_cv_header_$ac_safe=no"
4679 fi
4680 rm -f conftest*
4681 fi
4682 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4683   echo "$ac_t""yes" 1>&6
4684     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4685   cat >> confdefs.h <<EOF
4686 #define $ac_tr_hdr 1
4687 EOF
4688  
4689 else
4690   echo "$ac_t""no" 1>&6
4691 fi
4692 done
4693
4694
4695         if test $ac_cv_header_pthread_h = yes ; then
4696                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
4697 echo "configure:4698: checking POSIX thread version" >&5
4698 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
4699   echo $ac_n "(cached) $ac_c" 1>&6
4700 else
4701   
4702         cat > conftest.$ac_ext <<EOF
4703 #line 4704 "configure"
4704 #include "confdefs.h"
4705
4706 #               include <pthread.h>
4707                 /* this check could be improved */
4708 #               ifdef PTHREAD_ONCE_INIT
4709                         pthread_version_final
4710 #               endif
4711         
4712 EOF
4713 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4714   egrep "pthread_version_final" >/dev/null 2>&1; then
4715   rm -rf conftest*
4716   ol_pthread_final=yes
4717 else
4718   rm -rf conftest*
4719   ol_pthread_final=no
4720 fi
4721 rm -f conftest*
4722
4723
4724         cat > conftest.$ac_ext <<EOF
4725 #line 4726 "configure"
4726 #include "confdefs.h"
4727
4728 #               include <pthread.h>
4729                 /* this check could be improved */
4730 #               ifdef pthread_once_init
4731                         pthread_version_draft4
4732 #               endif
4733         
4734 EOF
4735 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4736   egrep "pthread_version_draft4" >/dev/null 2>&1; then
4737   rm -rf conftest*
4738   ol_pthread_draft4=yes
4739 else
4740   rm -rf conftest*
4741   ol_pthread_draft4=no
4742 fi
4743 rm -f conftest*
4744
4745
4746         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
4747                 ol_cv_pthread_version=final
4748         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
4749                 ol_cv_pthread_version=draft4
4750         else
4751                 ol_cv_pthread_version=unknown
4752         fi
4753
4754 fi
4755
4756 echo "$ac_t""$ol_cv_pthread_version" 1>&6
4757
4758
4759                 if test $ol_cv_pthread_version = final ; then
4760                         cat >> confdefs.h <<\EOF
4761 #define HAVE_PTHREADS_FINAL 1
4762 EOF
4763
4764                 elif test $ol_cv_pthread_version = draft4 ; then
4765                         cat >> confdefs.h <<\EOF
4766 #define HAVE_PTHREADS_D4 1
4767 EOF
4768
4769                 else
4770                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
4771                 fi
4772
4773                 # consider threads found
4774                 ol_with_threads=found
4775
4776                 
4777         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
4778 echo "configure:4779: checking for LinuxThreads pthread.h" >&5
4779 if eval "test \"`echo '$''{'ol_cv_header_linux_threads'+set}'`\" = set"; then
4780   echo $ac_n "(cached) $ac_c" 1>&6
4781 else
4782   cat > conftest.$ac_ext <<EOF
4783 #line 4784 "configure"
4784 #include "confdefs.h"
4785 #include <pthread.h>
4786 EOF
4787 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4788   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
4789   rm -rf conftest*
4790   ol_cv_header_linux_threads=yes
4791 else
4792   rm -rf conftest*
4793   ol_cv_header_linux_threads=no
4794 fi
4795 rm -f conftest*
4796
4797                 
4798 fi
4799
4800 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
4801         if test $ol_cv_header_linux_threads = yes; then
4802                 cat >> confdefs.h <<\EOF
4803 #define HAVE_LINUX_THREADS 1
4804 EOF
4805
4806         fi
4807
4808
4809                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
4810                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
4811 echo "configure:4812: checking for pthread_create in default libraries" >&5
4812                 if eval "test \"`echo '$''{'ol_cv_pthread_create'+set}'`\" = set"; then
4813   echo $ac_n "(cached) $ac_c" 1>&6
4814 else
4815   
4816                 if test "$cross_compiling" = yes; then
4817                         ol_cv_pthread_create=yes
4818 else
4819   cat > conftest.$ac_ext <<EOF
4820 #line 4821 "configure"
4821 #include "confdefs.h"
4822
4823 #include <pthread.h>
4824 #ifndef NULL
4825 #define NULL (void*)0
4826 #endif
4827
4828 static void *task(p)
4829         void *p;
4830 {
4831         return (void *) (p == NULL);
4832 }
4833
4834 int main(argc, argv)
4835         int argc;
4836         char **argv;
4837 {
4838         pthread_t t;
4839         int status;
4840
4841         /* make sure pthread_create() isn't just a stub */
4842 #if HAVE_PTHREADS_D4
4843         status = pthread_create(&t, pthread_attr_default, task, NULL);
4844 #else
4845         status = pthread_create(&t, NULL, task, NULL);
4846 #endif
4847
4848         if( status ) return status;
4849
4850         /* make sure pthread_detach() isn't just a stub */
4851 #if HAVE_PTHREADS_D4
4852         status = pthread_detach( &t );
4853 #else
4854         status = pthread_detach( t );
4855 #endif
4856
4857         if( status ) return status;
4858
4859         return status;
4860 }
4861
4862 EOF
4863 if { (eval echo configure:4864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4864 then
4865   ol_cv_pthread_create=yes
4866 else
4867   echo "configure: failed program was:" >&5
4868   cat conftest.$ac_ext >&5
4869   rm -fr conftest*
4870   ol_cv_pthread_create=no
4871 fi
4872 rm -fr conftest*
4873 fi
4874
4875 fi
4876
4877                 echo "$ac_t""$ol_cv_pthread_create" 1>&6
4878
4879                 if test $ol_cv_pthread_create != no ; then
4880                         ol_link_threads=posix
4881                         ol_link_pthreads=""
4882                 fi
4883                 
4884                 # Pthread try link: -mt (ol_cv_pthread_mt)
4885         if test "$ol_link_threads" = no ; then
4886                 # try -mt
4887                 echo $ac_n "checking for pthread link with -mt""... $ac_c" 1>&6
4888 echo "configure:4889: checking for pthread link with -mt" >&5
4889 if eval "test \"`echo '$''{'ol_cv_pthread_mt'+set}'`\" = set"; then
4890   echo $ac_n "(cached) $ac_c" 1>&6
4891 else
4892   
4893                         # save the flags
4894                         ol_LIBS="$LIBS"
4895                         LIBS="-mt $LIBS"
4896
4897                         cat > conftest.$ac_ext <<EOF
4898 #line 4899 "configure"
4899 #include "confdefs.h"
4900
4901 #include <pthread.h>
4902 #ifndef NULL
4903 #define NULL (void*)0
4904 #endif
4905
4906 int main() {
4907
4908         pthread_t t;
4909
4910 #if HAVE_PTHREADS_D4
4911         pthread_create(&t, pthread_attr_default, NULL, NULL);
4912         pthread_detach( &t );
4913 #else
4914         pthread_create(&t, NULL, NULL, NULL);
4915         pthread_detach( t );
4916 #endif
4917 #ifdef HAVE_LINUX_THREADS
4918         pthread_kill_other_threads_np();
4919 #endif
4920
4921 ; return 0; }
4922 EOF
4923 if { (eval echo configure:4924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4924   rm -rf conftest*
4925   ol_cv_pthread_mt=yes
4926 else
4927   echo "configure: failed program was:" >&5
4928   cat conftest.$ac_ext >&5
4929   rm -rf conftest*
4930   ol_cv_pthread_mt=no
4931 fi
4932 rm -f conftest*
4933
4934                 # restore the LIBS
4935                 LIBS="$ol_LIBS"
4936                 
4937 fi
4938
4939 echo "$ac_t""$ol_cv_pthread_mt" 1>&6
4940
4941                 if test $ol_cv_pthread_mt = yes ; then
4942                         ol_link_pthreads="-mt"
4943                         ol_link_threads=posix
4944                 fi
4945         fi
4946
4947                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
4948         if test "$ol_link_threads" = no ; then
4949                 # try -kthread
4950                 echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
4951 echo "configure:4952: checking for pthread link with -kthread" >&5
4952 if eval "test \"`echo '$''{'ol_cv_pthread_kthread'+set}'`\" = set"; then
4953   echo $ac_n "(cached) $ac_c" 1>&6
4954 else
4955   
4956                         # save the flags
4957                         ol_LIBS="$LIBS"
4958                         LIBS="-kthread $LIBS"
4959
4960                         cat > conftest.$ac_ext <<EOF
4961 #line 4962 "configure"
4962 #include "confdefs.h"
4963
4964 #include <pthread.h>
4965 #ifndef NULL
4966 #define NULL (void*)0
4967 #endif
4968
4969 int main() {
4970
4971         pthread_t t;
4972
4973 #if HAVE_PTHREADS_D4
4974         pthread_create(&t, pthread_attr_default, NULL, NULL);
4975         pthread_detach( &t );
4976 #else
4977         pthread_create(&t, NULL, NULL, NULL);
4978         pthread_detach( t );
4979 #endif
4980 #ifdef HAVE_LINUX_THREADS
4981         pthread_kill_other_threads_np();
4982 #endif
4983
4984 ; return 0; }
4985 EOF
4986 if { (eval echo configure:4987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4987   rm -rf conftest*
4988   ol_cv_pthread_kthread=yes
4989 else
4990   echo "configure: failed program was:" >&5
4991   cat conftest.$ac_ext >&5
4992   rm -rf conftest*
4993   ol_cv_pthread_kthread=no
4994 fi
4995 rm -f conftest*
4996
4997                 # restore the LIBS
4998                 LIBS="$ol_LIBS"
4999                 
5000 fi
5001
5002 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
5003
5004                 if test $ol_cv_pthread_kthread = yes ; then
5005                         ol_link_pthreads="-kthread"
5006                         ol_link_threads=posix
5007                 fi
5008         fi
5009
5010                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
5011         if test "$ol_link_threads" = no ; then
5012                 # try -pthread
5013                 echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
5014 echo "configure:5015: checking for pthread link with -pthread" >&5
5015 if eval "test \"`echo '$''{'ol_cv_pthread_pthread'+set}'`\" = set"; then
5016   echo $ac_n "(cached) $ac_c" 1>&6
5017 else
5018   
5019                         # save the flags
5020                         ol_LIBS="$LIBS"
5021                         LIBS="-pthread $LIBS"
5022
5023                         cat > conftest.$ac_ext <<EOF
5024 #line 5025 "configure"
5025 #include "confdefs.h"
5026
5027 #include <pthread.h>
5028 #ifndef NULL
5029 #define NULL (void*)0
5030 #endif
5031
5032 int main() {
5033
5034         pthread_t t;
5035
5036 #if HAVE_PTHREADS_D4
5037         pthread_create(&t, pthread_attr_default, NULL, NULL);
5038         pthread_detach( &t );
5039 #else
5040         pthread_create(&t, NULL, NULL, NULL);
5041         pthread_detach( t );
5042 #endif
5043 #ifdef HAVE_LINUX_THREADS
5044         pthread_kill_other_threads_np();
5045 #endif
5046
5047 ; return 0; }
5048 EOF
5049 if { (eval echo configure:5050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5050   rm -rf conftest*
5051   ol_cv_pthread_pthread=yes
5052 else
5053   echo "configure: failed program was:" >&5
5054   cat conftest.$ac_ext >&5
5055   rm -rf conftest*
5056   ol_cv_pthread_pthread=no
5057 fi
5058 rm -f conftest*
5059
5060                 # restore the LIBS
5061                 LIBS="$ol_LIBS"
5062                 
5063 fi
5064
5065 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
5066
5067                 if test $ol_cv_pthread_pthread = yes ; then
5068                         ol_link_pthreads="-pthread"
5069                         ol_link_threads=posix
5070                 fi
5071         fi
5072
5073                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
5074         if test "$ol_link_threads" = no ; then
5075                 # try -pthreads
5076                 echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
5077 echo "configure:5078: checking for pthread link with -pthreads" >&5
5078 if eval "test \"`echo '$''{'ol_cv_pthread_pthreads'+set}'`\" = set"; then
5079   echo $ac_n "(cached) $ac_c" 1>&6
5080 else
5081   
5082                         # save the flags
5083                         ol_LIBS="$LIBS"
5084                         LIBS="-pthreads $LIBS"
5085
5086                         cat > conftest.$ac_ext <<EOF
5087 #line 5088 "configure"
5088 #include "confdefs.h"
5089
5090 #include <pthread.h>
5091 #ifndef NULL
5092 #define NULL (void*)0
5093 #endif
5094
5095 int main() {
5096
5097         pthread_t t;
5098
5099 #if HAVE_PTHREADS_D4
5100         pthread_create(&t, pthread_attr_default, NULL, NULL);
5101         pthread_detach( &t );
5102 #else
5103         pthread_create(&t, NULL, NULL, NULL);
5104         pthread_detach( t );
5105 #endif
5106 #ifdef HAVE_LINUX_THREADS
5107         pthread_kill_other_threads_np();
5108 #endif
5109
5110 ; return 0; }
5111 EOF
5112 if { (eval echo configure:5113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5113   rm -rf conftest*
5114   ol_cv_pthread_pthreads=yes
5115 else
5116   echo "configure: failed program was:" >&5
5117   cat conftest.$ac_ext >&5
5118   rm -rf conftest*
5119   ol_cv_pthread_pthreads=no
5120 fi
5121 rm -f conftest*
5122
5123                 # restore the LIBS
5124                 LIBS="$ol_LIBS"
5125                 
5126 fi
5127
5128 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
5129
5130                 if test $ol_cv_pthread_pthreads = yes ; then
5131                         ol_link_pthreads="-pthreads"
5132                         ol_link_threads=posix
5133                 fi
5134         fi
5135
5136                 # Pthread try link: -thread (ol_cv_pthread_thread)
5137         if test "$ol_link_threads" = no ; then
5138                 # try -thread
5139                 echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
5140 echo "configure:5141: checking for pthread link with -thread" >&5
5141 if eval "test \"`echo '$''{'ol_cv_pthread_thread'+set}'`\" = set"; then
5142   echo $ac_n "(cached) $ac_c" 1>&6
5143 else
5144   
5145                         # save the flags
5146                         ol_LIBS="$LIBS"
5147                         LIBS="-thread $LIBS"
5148
5149                         cat > conftest.$ac_ext <<EOF
5150 #line 5151 "configure"
5151 #include "confdefs.h"
5152
5153 #include <pthread.h>
5154 #ifndef NULL
5155 #define NULL (void*)0
5156 #endif
5157
5158 int main() {
5159
5160         pthread_t t;
5161
5162 #if HAVE_PTHREADS_D4
5163         pthread_create(&t, pthread_attr_default, NULL, NULL);
5164         pthread_detach( &t );
5165 #else
5166         pthread_create(&t, NULL, NULL, NULL);
5167         pthread_detach( t );
5168 #endif
5169 #ifdef HAVE_LINUX_THREADS
5170         pthread_kill_other_threads_np();
5171 #endif
5172
5173 ; return 0; }
5174 EOF
5175 if { (eval echo configure:5176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5176   rm -rf conftest*
5177   ol_cv_pthread_thread=yes
5178 else
5179   echo "configure: failed program was:" >&5
5180   cat conftest.$ac_ext >&5
5181   rm -rf conftest*
5182   ol_cv_pthread_thread=no
5183 fi
5184 rm -f conftest*
5185
5186                 # restore the LIBS
5187                 LIBS="$ol_LIBS"
5188                 
5189 fi
5190
5191 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
5192
5193                 if test $ol_cv_pthread_thread = yes ; then
5194                         ol_link_pthreads="-thread"
5195                         ol_link_threads=posix
5196                 fi
5197         fi
5198
5199
5200                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
5201         if test "$ol_link_threads" = no ; then
5202                 # try -lpthread -lmach -lexc -lc_r
5203                 echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
5204 echo "configure:5205: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
5205 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread_lmach_lexc_lc_r'+set}'`\" = set"; then
5206   echo $ac_n "(cached) $ac_c" 1>&6
5207 else
5208   
5209                         # save the flags
5210                         ol_LIBS="$LIBS"
5211                         LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
5212
5213                         cat > conftest.$ac_ext <<EOF
5214 #line 5215 "configure"
5215 #include "confdefs.h"
5216
5217 #include <pthread.h>
5218 #ifndef NULL
5219 #define NULL (void*)0
5220 #endif
5221
5222 int main() {
5223
5224         pthread_t t;
5225
5226 #if HAVE_PTHREADS_D4
5227         pthread_create(&t, pthread_attr_default, NULL, NULL);
5228         pthread_detach( &t );
5229 #else
5230         pthread_create(&t, NULL, NULL, NULL);
5231         pthread_detach( t );
5232 #endif
5233 #ifdef HAVE_LINUX_THREADS
5234         pthread_kill_other_threads_np();
5235 #endif
5236
5237 ; return 0; }
5238 EOF
5239 if { (eval echo configure:5240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5240   rm -rf conftest*
5241   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
5242 else
5243   echo "configure: failed program was:" >&5
5244   cat conftest.$ac_ext >&5
5245   rm -rf conftest*
5246   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
5247 fi
5248 rm -f conftest*
5249
5250                 # restore the LIBS
5251                 LIBS="$ol_LIBS"
5252                 
5253 fi
5254
5255 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
5256
5257                 if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
5258                         ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
5259                         ol_link_threads=posix
5260                 fi
5261         fi
5262
5263                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
5264         if test "$ol_link_threads" = no ; then
5265                 # try -lpthread -lmach -lexc
5266                 echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
5267 echo "configure:5268: checking for pthread link with -lpthread -lmach -lexc" >&5
5268 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread_lmach_lexc'+set}'`\" = set"; then
5269   echo $ac_n "(cached) $ac_c" 1>&6
5270 else
5271   
5272                         # save the flags
5273                         ol_LIBS="$LIBS"
5274                         LIBS="-lpthread -lmach -lexc $LIBS"
5275
5276                         cat > conftest.$ac_ext <<EOF
5277 #line 5278 "configure"
5278 #include "confdefs.h"
5279
5280 #include <pthread.h>
5281 #ifndef NULL
5282 #define NULL (void*)0
5283 #endif
5284
5285 int main() {
5286
5287         pthread_t t;
5288
5289 #if HAVE_PTHREADS_D4
5290         pthread_create(&t, pthread_attr_default, NULL, NULL);
5291         pthread_detach( &t );
5292 #else
5293         pthread_create(&t, NULL, NULL, NULL);
5294         pthread_detach( t );
5295 #endif
5296 #ifdef HAVE_LINUX_THREADS
5297         pthread_kill_other_threads_np();
5298 #endif
5299
5300 ; return 0; }
5301 EOF
5302 if { (eval echo configure:5303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5303   rm -rf conftest*
5304   ol_cv_pthread_lpthread_lmach_lexc=yes
5305 else
5306   echo "configure: failed program was:" >&5
5307   cat conftest.$ac_ext >&5
5308   rm -rf conftest*
5309   ol_cv_pthread_lpthread_lmach_lexc=no
5310 fi
5311 rm -f conftest*
5312
5313                 # restore the LIBS
5314                 LIBS="$ol_LIBS"
5315                 
5316 fi
5317
5318 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
5319
5320                 if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
5321                         ol_link_pthreads="-lpthread -lmach -lexc"
5322                         ol_link_threads=posix
5323                 fi
5324         fi
5325
5326
5327                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
5328         if test "$ol_link_threads" = no ; then
5329                 # try -lpthread -Wl,-woff,85
5330                 echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
5331 echo "configure:5332: checking for pthread link with -lpthread -Wl,-woff,85" >&5
5332 if eval "test \"`echo '$''{'ol_cv_pthread_lib_lpthread_woff'+set}'`\" = set"; then
5333   echo $ac_n "(cached) $ac_c" 1>&6
5334 else
5335   
5336                         # save the flags
5337                         ol_LIBS="$LIBS"
5338                         LIBS="-lpthread -Wl,-woff,85 $LIBS"
5339
5340                         cat > conftest.$ac_ext <<EOF
5341 #line 5342 "configure"
5342 #include "confdefs.h"
5343
5344 #include <pthread.h>
5345 #ifndef NULL
5346 #define NULL (void*)0
5347 #endif
5348
5349 int main() {
5350
5351         pthread_t t;
5352
5353 #if HAVE_PTHREADS_D4
5354         pthread_create(&t, pthread_attr_default, NULL, NULL);
5355         pthread_detach( &t );
5356 #else
5357         pthread_create(&t, NULL, NULL, NULL);
5358         pthread_detach( t );
5359 #endif
5360 #ifdef HAVE_LINUX_THREADS
5361         pthread_kill_other_threads_np();
5362 #endif
5363
5364 ; return 0; }
5365 EOF
5366 if { (eval echo configure:5367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5367   rm -rf conftest*
5368   ol_cv_pthread_lib_lpthread_woff=yes
5369 else
5370   echo "configure: failed program was:" >&5
5371   cat conftest.$ac_ext >&5
5372   rm -rf conftest*
5373   ol_cv_pthread_lib_lpthread_woff=no
5374 fi
5375 rm -f conftest*
5376
5377                 # restore the LIBS
5378                 LIBS="$ol_LIBS"
5379                 
5380 fi
5381
5382 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
5383
5384                 if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
5385                         ol_link_pthreads="-lpthread -Wl,-woff,85"
5386                         ol_link_threads=posix
5387                 fi
5388         fi
5389
5390
5391                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
5392         if test "$ol_link_threads" = no ; then
5393                 # try -lpthread
5394                 echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
5395 echo "configure:5396: checking for pthread link with -lpthread" >&5
5396 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread'+set}'`\" = set"; then
5397   echo $ac_n "(cached) $ac_c" 1>&6
5398 else
5399   
5400                         # save the flags
5401                         ol_LIBS="$LIBS"
5402                         LIBS="-lpthread $LIBS"
5403
5404                         cat > conftest.$ac_ext <<EOF
5405 #line 5406 "configure"
5406 #include "confdefs.h"
5407
5408 #include <pthread.h>
5409 #ifndef NULL
5410 #define NULL (void*)0
5411 #endif
5412
5413 int main() {
5414
5415         pthread_t t;
5416
5417 #if HAVE_PTHREADS_D4
5418         pthread_create(&t, pthread_attr_default, NULL, NULL);
5419         pthread_detach( &t );
5420 #else
5421         pthread_create(&t, NULL, NULL, NULL);
5422         pthread_detach( t );
5423 #endif
5424 #ifdef HAVE_LINUX_THREADS
5425         pthread_kill_other_threads_np();
5426 #endif
5427
5428 ; return 0; }
5429 EOF
5430 if { (eval echo configure:5431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5431   rm -rf conftest*
5432   ol_cv_pthread_lpthread=yes
5433 else
5434   echo "configure: failed program was:" >&5
5435   cat conftest.$ac_ext >&5
5436   rm -rf conftest*
5437   ol_cv_pthread_lpthread=no
5438 fi
5439 rm -f conftest*
5440
5441                 # restore the LIBS
5442                 LIBS="$ol_LIBS"
5443                 
5444 fi
5445
5446 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
5447
5448                 if test $ol_cv_pthread_lpthread = yes ; then
5449                         ol_link_pthreads="-lpthread"
5450                         ol_link_threads=posix
5451                 fi
5452         fi
5453
5454                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
5455         if test "$ol_link_threads" = no ; then
5456                 # try -lc_r
5457                 echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
5458 echo "configure:5459: checking for pthread link with -lc_r" >&5
5459 if eval "test \"`echo '$''{'ol_cv_pthread_lc_r'+set}'`\" = set"; then
5460   echo $ac_n "(cached) $ac_c" 1>&6
5461 else
5462   
5463                         # save the flags
5464                         ol_LIBS="$LIBS"
5465                         LIBS="-lc_r $LIBS"
5466
5467                         cat > conftest.$ac_ext <<EOF
5468 #line 5469 "configure"
5469 #include "confdefs.h"
5470
5471 #include <pthread.h>
5472 #ifndef NULL
5473 #define NULL (void*)0
5474 #endif
5475
5476 int main() {
5477
5478         pthread_t t;
5479
5480 #if HAVE_PTHREADS_D4
5481         pthread_create(&t, pthread_attr_default, NULL, NULL);
5482         pthread_detach( &t );
5483 #else
5484         pthread_create(&t, NULL, NULL, NULL);
5485         pthread_detach( t );
5486 #endif
5487 #ifdef HAVE_LINUX_THREADS
5488         pthread_kill_other_threads_np();
5489 #endif
5490
5491 ; return 0; }
5492 EOF
5493 if { (eval echo configure:5494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5494   rm -rf conftest*
5495   ol_cv_pthread_lc_r=yes
5496 else
5497   echo "configure: failed program was:" >&5
5498   cat conftest.$ac_ext >&5
5499   rm -rf conftest*
5500   ol_cv_pthread_lc_r=no
5501 fi
5502 rm -f conftest*
5503
5504                 # restore the LIBS
5505                 LIBS="$ol_LIBS"
5506                 
5507 fi
5508
5509 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
5510
5511                 if test $ol_cv_pthread_lc_r = yes ; then
5512                         ol_link_pthreads="-lc_r"
5513                         ol_link_threads=posix
5514                 fi
5515         fi
5516
5517
5518                 # Pthread try link: -threads (ol_cv_pthread_threads)
5519         if test "$ol_link_threads" = no ; then
5520                 # try -threads
5521                 echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
5522 echo "configure:5523: checking for pthread link with -threads" >&5
5523 if eval "test \"`echo '$''{'ol_cv_pthread_threads'+set}'`\" = set"; then
5524   echo $ac_n "(cached) $ac_c" 1>&6
5525 else
5526   
5527                         # save the flags
5528                         ol_LIBS="$LIBS"
5529                         LIBS="-threads $LIBS"
5530
5531                         cat > conftest.$ac_ext <<EOF
5532 #line 5533 "configure"
5533 #include "confdefs.h"
5534
5535 #include <pthread.h>
5536 #ifndef NULL
5537 #define NULL (void*)0
5538 #endif
5539
5540 int main() {
5541
5542         pthread_t t;
5543
5544 #if HAVE_PTHREADS_D4
5545         pthread_create(&t, pthread_attr_default, NULL, NULL);
5546         pthread_detach( &t );
5547 #else
5548         pthread_create(&t, NULL, NULL, NULL);
5549         pthread_detach( t );
5550 #endif
5551 #ifdef HAVE_LINUX_THREADS
5552         pthread_kill_other_threads_np();
5553 #endif
5554
5555 ; return 0; }
5556 EOF
5557 if { (eval echo configure:5558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5558   rm -rf conftest*
5559   ol_cv_pthread_threads=yes
5560 else
5561   echo "configure: failed program was:" >&5
5562   cat conftest.$ac_ext >&5
5563   rm -rf conftest*
5564   ol_cv_pthread_threads=no
5565 fi
5566 rm -f conftest*
5567
5568                 # restore the LIBS
5569                 LIBS="$ol_LIBS"
5570                 
5571 fi
5572
5573 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
5574
5575                 if test $ol_cv_pthread_threads = yes ; then
5576                         ol_link_pthreads="-threads"
5577                         ol_link_threads=posix
5578                 fi
5579         fi
5580
5581
5582                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
5583         if test "$ol_link_threads" = no ; then
5584                 # try -lpthreads -lmach -lexc -lc_r
5585                 echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
5586 echo "configure:5587: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
5587 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lmach_lexc_lc_r'+set}'`\" = set"; then
5588   echo $ac_n "(cached) $ac_c" 1>&6
5589 else
5590   
5591                         # save the flags
5592                         ol_LIBS="$LIBS"
5593                         LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
5594
5595                         cat > conftest.$ac_ext <<EOF
5596 #line 5597 "configure"
5597 #include "confdefs.h"
5598
5599 #include <pthread.h>
5600 #ifndef NULL
5601 #define NULL (void*)0
5602 #endif
5603
5604 int main() {
5605
5606         pthread_t t;
5607
5608 #if HAVE_PTHREADS_D4
5609         pthread_create(&t, pthread_attr_default, NULL, NULL);
5610         pthread_detach( &t );
5611 #else
5612         pthread_create(&t, NULL, NULL, NULL);
5613         pthread_detach( t );
5614 #endif
5615 #ifdef HAVE_LINUX_THREADS
5616         pthread_kill_other_threads_np();
5617 #endif
5618
5619 ; return 0; }
5620 EOF
5621 if { (eval echo configure:5622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5622   rm -rf conftest*
5623   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
5624 else
5625   echo "configure: failed program was:" >&5
5626   cat conftest.$ac_ext >&5
5627   rm -rf conftest*
5628   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
5629 fi
5630 rm -f conftest*
5631
5632                 # restore the LIBS
5633                 LIBS="$ol_LIBS"
5634                 
5635 fi
5636
5637 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
5638
5639                 if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
5640                         ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
5641                         ol_link_threads=posix
5642                 fi
5643         fi
5644
5645                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
5646         if test "$ol_link_threads" = no ; then
5647                 # try -lpthreads -lmach -lexc
5648                 echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
5649 echo "configure:5650: checking for pthread link with -lpthreads -lmach -lexc" >&5
5650 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lmach_lexc'+set}'`\" = set"; then
5651   echo $ac_n "(cached) $ac_c" 1>&6
5652 else
5653   
5654                         # save the flags
5655                         ol_LIBS="$LIBS"
5656                         LIBS="-lpthreads -lmach -lexc $LIBS"
5657
5658                         cat > conftest.$ac_ext <<EOF
5659 #line 5660 "configure"
5660 #include "confdefs.h"
5661
5662 #include <pthread.h>
5663 #ifndef NULL
5664 #define NULL (void*)0
5665 #endif
5666
5667 int main() {
5668
5669         pthread_t t;
5670
5671 #if HAVE_PTHREADS_D4
5672         pthread_create(&t, pthread_attr_default, NULL, NULL);
5673         pthread_detach( &t );
5674 #else
5675         pthread_create(&t, NULL, NULL, NULL);
5676         pthread_detach( t );
5677 #endif
5678 #ifdef HAVE_LINUX_THREADS
5679         pthread_kill_other_threads_np();
5680 #endif
5681
5682 ; return 0; }
5683 EOF
5684 if { (eval echo configure:5685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5685   rm -rf conftest*
5686   ol_cv_pthread_lpthreads_lmach_lexc=yes
5687 else
5688   echo "configure: failed program was:" >&5
5689   cat conftest.$ac_ext >&5
5690   rm -rf conftest*
5691   ol_cv_pthread_lpthreads_lmach_lexc=no
5692 fi
5693 rm -f conftest*
5694
5695                 # restore the LIBS
5696                 LIBS="$ol_LIBS"
5697                 
5698 fi
5699
5700 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
5701
5702                 if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
5703                         ol_link_pthreads="-lpthreads -lmach -lexc"
5704                         ol_link_threads=posix
5705                 fi
5706         fi
5707
5708                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
5709         if test "$ol_link_threads" = no ; then
5710                 # try -lpthreads -lexc
5711                 echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
5712 echo "configure:5713: checking for pthread link with -lpthreads -lexc" >&5
5713 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lexc'+set}'`\" = set"; then
5714   echo $ac_n "(cached) $ac_c" 1>&6
5715 else
5716   
5717                         # save the flags
5718                         ol_LIBS="$LIBS"
5719                         LIBS="-lpthreads -lexc $LIBS"
5720
5721                         cat > conftest.$ac_ext <<EOF
5722 #line 5723 "configure"
5723 #include "confdefs.h"
5724
5725 #include <pthread.h>
5726 #ifndef NULL
5727 #define NULL (void*)0
5728 #endif
5729
5730 int main() {
5731
5732         pthread_t t;
5733
5734 #if HAVE_PTHREADS_D4
5735         pthread_create(&t, pthread_attr_default, NULL, NULL);
5736         pthread_detach( &t );
5737 #else
5738         pthread_create(&t, NULL, NULL, NULL);
5739         pthread_detach( t );
5740 #endif
5741 #ifdef HAVE_LINUX_THREADS
5742         pthread_kill_other_threads_np();
5743 #endif
5744
5745 ; return 0; }
5746 EOF
5747 if { (eval echo configure:5748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5748   rm -rf conftest*
5749   ol_cv_pthread_lpthreads_lexc=yes
5750 else
5751   echo "configure: failed program was:" >&5
5752   cat conftest.$ac_ext >&5
5753   rm -rf conftest*
5754   ol_cv_pthread_lpthreads_lexc=no
5755 fi
5756 rm -f conftest*
5757
5758                 # restore the LIBS
5759                 LIBS="$ol_LIBS"
5760                 
5761 fi
5762
5763 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
5764
5765                 if test $ol_cv_pthread_lpthreads_lexc = yes ; then
5766                         ol_link_pthreads="-lpthreads -lexc"
5767                         ol_link_threads=posix
5768                 fi
5769         fi
5770
5771
5772                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
5773         if test "$ol_link_threads" = no ; then
5774                 # try -lpthreads
5775                 echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
5776 echo "configure:5777: checking for pthread link with -lpthreads" >&5
5777 if eval "test \"`echo '$''{'ol_cv_pthread_lib_lpthreads'+set}'`\" = set"; then
5778   echo $ac_n "(cached) $ac_c" 1>&6
5779 else
5780   
5781                         # save the flags
5782                         ol_LIBS="$LIBS"
5783                         LIBS="-lpthreads $LIBS"
5784
5785                         cat > conftest.$ac_ext <<EOF
5786 #line 5787 "configure"
5787 #include "confdefs.h"
5788
5789 #include <pthread.h>
5790 #ifndef NULL
5791 #define NULL (void*)0
5792 #endif
5793
5794 int main() {
5795
5796         pthread_t t;
5797
5798 #if HAVE_PTHREADS_D4
5799         pthread_create(&t, pthread_attr_default, NULL, NULL);
5800         pthread_detach( &t );
5801 #else
5802         pthread_create(&t, NULL, NULL, NULL);
5803         pthread_detach( t );
5804 #endif
5805 #ifdef HAVE_LINUX_THREADS
5806         pthread_kill_other_threads_np();
5807 #endif
5808
5809 ; return 0; }
5810 EOF
5811 if { (eval echo configure:5812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5812   rm -rf conftest*
5813   ol_cv_pthread_lib_lpthreads=yes
5814 else
5815   echo "configure: failed program was:" >&5
5816   cat conftest.$ac_ext >&5
5817   rm -rf conftest*
5818   ol_cv_pthread_lib_lpthreads=no
5819 fi
5820 rm -f conftest*
5821
5822                 # restore the LIBS
5823                 LIBS="$ol_LIBS"
5824                 
5825 fi
5826
5827 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
5828
5829                 if test $ol_cv_pthread_lib_lpthreads = yes ; then
5830                         ol_link_pthreads="-lpthreads"
5831                         ol_link_threads=posix
5832                 fi
5833         fi
5834
5835
5836                 if test $ol_link_threads != no ; then
5837                         cat >> confdefs.h <<\EOF
5838 #define HAVE_PTHREADS 1
5839 EOF
5840
5841
5842                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
5843
5844                                                 save_CPPFLAGS="$CPPFLAGS"
5845                         save_LIBS="$LIBS"
5846                         LIBS="$LTHREAD_LIBS $LIBS"
5847
5848                                                                                                 for ac_func in sched_yield pthread_yield
5849 do
5850 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5851 echo "configure:5852: checking for $ac_func" >&5
5852 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5853   echo $ac_n "(cached) $ac_c" 1>&6
5854 else
5855   cat > conftest.$ac_ext <<EOF
5856 #line 5857 "configure"
5857 #include "confdefs.h"
5858 /* System header to define __stub macros and hopefully few prototypes,
5859     which can conflict with char $ac_func(); below.  */
5860 #include <assert.h>
5861 /* Override any gcc2 internal prototype to avoid an error.  */
5862 /* We use char because int might match the return type of a gcc2
5863     builtin and then its argument prototype would still apply.  */
5864 char $ac_func();
5865
5866 int main() {
5867
5868 /* The GNU C library defines this for functions which it implements
5869     to always fail with ENOSYS.  Some functions are actually named
5870     something starting with __ and the normal name is an alias.  */
5871 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5872 choke me
5873 #else
5874 $ac_func();
5875 #endif
5876
5877 ; return 0; }
5878 EOF
5879 if { (eval echo configure:5880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5880   rm -rf conftest*
5881   eval "ac_cv_func_$ac_func=yes"
5882 else
5883   echo "configure: failed program was:" >&5
5884   cat conftest.$ac_ext >&5
5885   rm -rf conftest*
5886   eval "ac_cv_func_$ac_func=no"
5887 fi
5888 rm -f conftest*
5889 fi
5890
5891 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5892   echo "$ac_t""yes" 1>&6
5893     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5894   cat >> confdefs.h <<EOF
5895 #define $ac_tr_func 1
5896 EOF
5897  
5898 else
5899   echo "$ac_t""no" 1>&6
5900 fi
5901 done
5902
5903
5904                         if test $ac_cv_func_sched_yield = no -a \
5905                                 $ac_cv_func_pthread_yield = no ; then
5906                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
5907 echo "configure:5908: checking for sched_yield in -lrt" >&5
5908 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
5909 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5910   echo $ac_n "(cached) $ac_c" 1>&6
5911 else
5912   ac_save_LIBS="$LIBS"
5913 LIBS="-lrt  $LIBS"
5914 cat > conftest.$ac_ext <<EOF
5915 #line 5916 "configure"
5916 #include "confdefs.h"
5917 /* Override any gcc2 internal prototype to avoid an error.  */
5918 /* We use char because int might match the return type of a gcc2
5919     builtin and then its argument prototype would still apply.  */
5920 char sched_yield();
5921
5922 int main() {
5923 sched_yield()
5924 ; return 0; }
5925 EOF
5926 if { (eval echo configure:5927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5927   rm -rf conftest*
5928   eval "ac_cv_lib_$ac_lib_var=yes"
5929 else
5930   echo "configure: failed program was:" >&5
5931   cat conftest.$ac_ext >&5
5932   rm -rf conftest*
5933   eval "ac_cv_lib_$ac_lib_var=no"
5934 fi
5935 rm -f conftest*
5936 LIBS="$ac_save_LIBS"
5937
5938 fi
5939 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5940   echo "$ac_t""yes" 1>&6
5941   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
5942                                         cat >> confdefs.h <<\EOF
5943 #define HAVE_SCHED_YIELD 1
5944 EOF
5945
5946                                         ac_cv_func_sched_yield=yes
5947 else
5948   echo "$ac_t""no" 1>&6
5949 ac_cv_func_sched_yield=no
5950 fi
5951
5952                         fi
5953                         if test $ac_cv_func_sched_yield = no -a \
5954                                 $ac_cv_func_pthread_yield = no ; then
5955                                                                                                 for ac_func in thr_yield
5956 do
5957 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5958 echo "configure:5959: checking for $ac_func" >&5
5959 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5960   echo $ac_n "(cached) $ac_c" 1>&6
5961 else
5962   cat > conftest.$ac_ext <<EOF
5963 #line 5964 "configure"
5964 #include "confdefs.h"
5965 /* System header to define __stub macros and hopefully few prototypes,
5966     which can conflict with char $ac_func(); below.  */
5967 #include <assert.h>
5968 /* Override any gcc2 internal prototype to avoid an error.  */
5969 /* We use char because int might match the return type of a gcc2
5970     builtin and then its argument prototype would still apply.  */
5971 char $ac_func();
5972
5973 int main() {
5974
5975 /* The GNU C library defines this for functions which it implements
5976     to always fail with ENOSYS.  Some functions are actually named
5977     something starting with __ and the normal name is an alias.  */
5978 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5979 choke me
5980 #else
5981 $ac_func();
5982 #endif
5983
5984 ; return 0; }
5985 EOF
5986 if { (eval echo configure:5987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5987   rm -rf conftest*
5988   eval "ac_cv_func_$ac_func=yes"
5989 else
5990   echo "configure: failed program was:" >&5
5991   cat conftest.$ac_ext >&5
5992   rm -rf conftest*
5993   eval "ac_cv_func_$ac_func=no"
5994 fi
5995 rm -f conftest*
5996 fi
5997
5998 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5999   echo "$ac_t""yes" 1>&6
6000     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6001   cat >> confdefs.h <<EOF
6002 #define $ac_tr_func 1
6003 EOF
6004  
6005 else
6006   echo "$ac_t""no" 1>&6
6007 fi
6008 done
6009
6010                         fi
6011                         if test $ac_cv_func_sched_yield = no -a \
6012                                 $ac_cv_func_pthread_yield = no -a \
6013                                 "$ac_cv_func_thr_yield" = no ; then
6014                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
6015                         fi
6016
6017                                                 for ac_func in pthread_kill
6018 do
6019 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6020 echo "configure:6021: checking for $ac_func" >&5
6021 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6022   echo $ac_n "(cached) $ac_c" 1>&6
6023 else
6024   cat > conftest.$ac_ext <<EOF
6025 #line 6026 "configure"
6026 #include "confdefs.h"
6027 /* System header to define __stub macros and hopefully few prototypes,
6028     which can conflict with char $ac_func(); below.  */
6029 #include <assert.h>
6030 /* Override any gcc2 internal prototype to avoid an error.  */
6031 /* We use char because int might match the return type of a gcc2
6032     builtin and then its argument prototype would still apply.  */
6033 char $ac_func();
6034
6035 int main() {
6036
6037 /* The GNU C library defines this for functions which it implements
6038     to always fail with ENOSYS.  Some functions are actually named
6039     something starting with __ and the normal name is an alias.  */
6040 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6041 choke me
6042 #else
6043 $ac_func();
6044 #endif
6045
6046 ; return 0; }
6047 EOF
6048 if { (eval echo configure:6049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6049   rm -rf conftest*
6050   eval "ac_cv_func_$ac_func=yes"
6051 else
6052   echo "configure: failed program was:" >&5
6053   cat conftest.$ac_ext >&5
6054   rm -rf conftest*
6055   eval "ac_cv_func_$ac_func=no"
6056 fi
6057 rm -f conftest*
6058 fi
6059
6060 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6061   echo "$ac_t""yes" 1>&6
6062     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6063   cat >> confdefs.h <<EOF
6064 #define $ac_tr_func 1
6065 EOF
6066  
6067 else
6068   echo "$ac_t""no" 1>&6
6069 fi
6070 done
6071
6072
6073                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
6074 echo "configure:6075: checking for pthread_detach with <pthread.h>" >&5
6075 if eval "test \"`echo '$''{'ol_cv_func_pthread_detach'+set}'`\" = set"; then
6076   echo $ac_n "(cached) $ac_c" 1>&6
6077 else
6078   
6079                                                                 cat > conftest.$ac_ext <<EOF
6080 #line 6081 "configure"
6081 #include "confdefs.h"
6082
6083 #include <pthread.h>
6084 #ifndef NULL
6085 #define NULL (void*)0
6086 #endif
6087
6088 int main() {
6089 pthread_detach(NULL);
6090 ; return 0; }
6091 EOF
6092 if { (eval echo configure:6093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6093   rm -rf conftest*
6094   ol_cv_func_pthread_detach=yes
6095 else
6096   echo "configure: failed program was:" >&5
6097   cat conftest.$ac_ext >&5
6098   rm -rf conftest*
6099   ol_cv_func_pthread_detach=no
6100 fi
6101 rm -f conftest*
6102                         
6103 fi
6104
6105 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
6106
6107                         if test $ol_cv_func_pthread_detach = no ; then
6108                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
6109                         fi
6110
6111                         cat >> confdefs.h <<\EOF
6112 #define HAVE_PTHREAD_DETACH 1
6113 EOF
6114
6115
6116                                                 for ac_func in \
6117                                 pthread_setconcurrency \
6118                                 pthread_getconcurrency \
6119                                 thr_setconcurrency \
6120                                 thr_getconcurrency \
6121                         
6122 do
6123 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6124 echo "configure:6125: checking for $ac_func" >&5
6125 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6126   echo $ac_n "(cached) $ac_c" 1>&6
6127 else
6128   cat > conftest.$ac_ext <<EOF
6129 #line 6130 "configure"
6130 #include "confdefs.h"
6131 /* System header to define __stub macros and hopefully few prototypes,
6132     which can conflict with char $ac_func(); below.  */
6133 #include <assert.h>
6134 /* Override any gcc2 internal prototype to avoid an error.  */
6135 /* We use char because int might match the return type of a gcc2
6136     builtin and then its argument prototype would still apply.  */
6137 char $ac_func();
6138
6139 int main() {
6140
6141 /* The GNU C library defines this for functions which it implements
6142     to always fail with ENOSYS.  Some functions are actually named
6143     something starting with __ and the normal name is an alias.  */
6144 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6145 choke me
6146 #else
6147 $ac_func();
6148 #endif
6149
6150 ; return 0; }
6151 EOF
6152 if { (eval echo configure:6153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6153   rm -rf conftest*
6154   eval "ac_cv_func_$ac_func=yes"
6155 else
6156   echo "configure: failed program was:" >&5
6157   cat conftest.$ac_ext >&5
6158   rm -rf conftest*
6159   eval "ac_cv_func_$ac_func=no"
6160 fi
6161 rm -f conftest*
6162 fi
6163
6164 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6165   echo "$ac_t""yes" 1>&6
6166     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6167   cat >> confdefs.h <<EOF
6168 #define $ac_tr_func 1
6169 EOF
6170  
6171 else
6172   echo "$ac_t""no" 1>&6
6173 fi
6174 done
6175
6176
6177                         
6178         echo $ac_n "checking for pthread_kill_other_threads_np""... $ac_c" 1>&6
6179 echo "configure:6180: checking for pthread_kill_other_threads_np" >&5
6180 if eval "test \"`echo '$''{'ac_cv_func_pthread_kill_other_threads_np'+set}'`\" = set"; then
6181   echo $ac_n "(cached) $ac_c" 1>&6
6182 else
6183   cat > conftest.$ac_ext <<EOF
6184 #line 6185 "configure"
6185 #include "confdefs.h"
6186 /* System header to define __stub macros and hopefully few prototypes,
6187     which can conflict with char pthread_kill_other_threads_np(); below.  */
6188 #include <assert.h>
6189 /* Override any gcc2 internal prototype to avoid an error.  */
6190 /* We use char because int might match the return type of a gcc2
6191     builtin and then its argument prototype would still apply.  */
6192 char pthread_kill_other_threads_np();
6193
6194 int main() {
6195
6196 /* The GNU C library defines this for functions which it implements
6197     to always fail with ENOSYS.  Some functions are actually named
6198     something starting with __ and the normal name is an alias.  */
6199 #if defined (__stub_pthread_kill_other_threads_np) || defined (__stub___pthread_kill_other_threads_np)
6200 choke me
6201 #else
6202 pthread_kill_other_threads_np();
6203 #endif
6204
6205 ; return 0; }
6206 EOF
6207 if { (eval echo configure:6208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6208   rm -rf conftest*
6209   eval "ac_cv_func_pthread_kill_other_threads_np=yes"
6210 else
6211   echo "configure: failed program was:" >&5
6212   cat conftest.$ac_ext >&5
6213   rm -rf conftest*
6214   eval "ac_cv_func_pthread_kill_other_threads_np=no"
6215 fi
6216 rm -f conftest*
6217 fi
6218
6219 if eval "test \"`echo '$ac_cv_func_'pthread_kill_other_threads_np`\" = yes"; then
6220   echo "$ac_t""yes" 1>&6
6221   :
6222 else
6223   echo "$ac_t""no" 1>&6
6224 fi
6225
6226         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
6227 echo "configure:6228: checking for LinuxThreads implementation" >&5
6228 if eval "test \"`echo '$''{'ol_cv_sys_linux_threads'+set}'`\" = set"; then
6229   echo $ac_n "(cached) $ac_c" 1>&6
6230 else
6231   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
6232 fi
6233
6234 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
6235
6236                         
6237         
6238         
6239         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
6240 echo "configure:6241: checking for LinuxThreads consistency" >&5
6241 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
6242   echo $ac_n "(cached) $ac_c" 1>&6
6243 else
6244   
6245                 if test $ol_cv_header_linux_threads = yes -a \
6246                         $ol_cv_sys_linux_threads = yes; then
6247                         ol_cv_linux_threads=yes
6248                 elif test $ol_cv_header_linux_threads = no -a \
6249                         $ol_cv_sys_linux_threads = no; then
6250                         ol_cv_linux_threads=no
6251                 else
6252                         ol_cv_linux_threads=error
6253                 fi
6254         
6255 fi
6256
6257 echo "$ac_t""$ol_cv_linux_threads" 1>&6
6258
6259
6260                         if test $ol_cv_linux_threads = error; then
6261                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
6262                         fi
6263
6264                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
6265 echo "configure:6266: checking if pthread_create() works" >&5
6266                         if eval "test \"`echo '$''{'ol_cv_pthread_create_works'+set}'`\" = set"; then
6267   echo $ac_n "(cached) $ac_c" 1>&6
6268 else
6269   
6270                         if test "$cross_compiling" = yes; then
6271                                 ol_cv_pthread_create_works=yes
6272 else
6273   cat > conftest.$ac_ext <<EOF
6274 #line 6275 "configure"
6275 #include "confdefs.h"
6276
6277 #include <pthread.h>
6278 #ifndef NULL
6279 #define NULL (void*)0
6280 #endif
6281
6282 static void *task(p)
6283         void *p;
6284 {
6285         return (void *) (p == NULL);
6286 }
6287
6288 int main(argc, argv)
6289         int argc;
6290         char **argv;
6291 {
6292         pthread_t t;
6293 #if HAVE_PTHREADS_D4
6294         exit(pthread_create(&t, pthread_attr_default, task, NULL));
6295 #else
6296         exit(pthread_create(&t, NULL, task, NULL));
6297 #endif
6298 }
6299
6300 EOF
6301 if { (eval echo configure:6302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6302 then
6303   ol_cv_pthread_create_works=yes
6304 else
6305   echo "configure: failed program was:" >&5
6306   cat conftest.$ac_ext >&5
6307   rm -fr conftest*
6308   ol_cv_pthread_create_works=no
6309 fi
6310 rm -fr conftest*
6311 fi
6312
6313 fi
6314
6315                         echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
6316
6317                         if test $ol_cv_pthread_create_works = no ; then
6318                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
6319                         fi
6320
6321                                                 if test $ol_with_yielding_select = auto ; then
6322                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
6323 echo "configure:6324: checking if select yields when using pthreads" >&5
6324                                 if eval "test \"`echo '$''{'ol_cv_pthread_select_yields'+set}'`\" = set"; then
6325   echo $ac_n "(cached) $ac_c" 1>&6
6326 else
6327   
6328                                 if test "$cross_compiling" = yes; then
6329   
6330                                 { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
6331 else
6332   cat > conftest.$ac_ext <<EOF
6333 #line 6334 "configure"
6334 #include "confdefs.h"
6335
6336 #include <sys/types.h>
6337 #include <sys/time.h>
6338 #include <unistd.h>
6339 #include <pthread.h>
6340 #ifndef NULL
6341 #define NULL (void*) 0
6342 #endif
6343
6344 static int fildes[2];
6345
6346 static void *task(p)
6347         void *p;
6348 {
6349         int i;
6350         struct timeval tv;
6351
6352         fd_set rfds;
6353
6354         tv.tv_sec=10;
6355         tv.tv_usec=0;
6356
6357         FD_ZERO(&rfds);
6358         FD_SET(fildes[0], &rfds);
6359
6360         /* we're not interested in any fds */
6361         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
6362
6363         if(i < 0) {
6364                 perror("select");
6365                 exit(10);
6366         }
6367
6368         exit(0); /* if we exit here, the select blocked the whole process */
6369 }
6370
6371 int main(argc, argv)
6372         int argc;
6373         char **argv;
6374 {
6375         pthread_t t;
6376
6377         /* create a pipe to select */
6378         if(pipe(&fildes[0])) {
6379                 perror("select");
6380                 exit(1);
6381         }
6382
6383 #ifdef HAVE_PTHREAD_SETCONCURRENCY
6384         (void) pthread_setconcurrency(2);
6385 #else
6386 #ifdef HAVE_THR_SETCONCURRENCY
6387         /* Set Solaris LWP concurrency to 2 */
6388         thr_setconcurrency(2);
6389 #endif
6390 #endif
6391
6392 #if HAVE_PTHREADS_D4
6393         pthread_create(&t, pthread_attr_default, task, NULL);
6394 #else
6395         pthread_create(&t, NULL, task, NULL);
6396 #endif
6397
6398 #if HAVE_SCHED_YIELD
6399         sched_yield();  /* make sure task runs first */
6400 #else
6401 #ifdef HAVE_PTHREAD_YIELD
6402         pthread_yield();        /* make sure task runs first */
6403 #endif
6404 #endif
6405
6406         exit(2);
6407 }
6408 EOF
6409 if { (eval echo configure:6410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6410 then
6411   ol_cv_pthread_select_yields=no
6412 else
6413   echo "configure: failed program was:" >&5
6414   cat conftest.$ac_ext >&5
6415   rm -fr conftest*
6416   ol_cv_pthread_select_yields=yes
6417 fi
6418 rm -fr conftest*
6419 fi
6420
6421 fi
6422
6423                                 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
6424
6425                                 if test $ol_cv_pthread_select_yields = yes ; then
6426                                         ol_with_yielding_select=yes
6427                                 fi
6428                         fi
6429
6430                                                 CPPFLAGS="$save_CPPFLAGS"
6431                         LIBS="$save_LIBS"
6432                 else
6433                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
6434                 fi
6435         fi
6436
6437         if test $ol_with_threads = posix ; then
6438                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
6439         fi
6440 fi
6441
6442 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6443         -o $ol_with_threads = mach ; then
6444
6445                 for ac_hdr in mach/cthreads.h
6446 do
6447 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6448 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6449 echo "configure:6450: checking for $ac_hdr" >&5
6450 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6451   echo $ac_n "(cached) $ac_c" 1>&6
6452 else
6453   cat > conftest.$ac_ext <<EOF
6454 #line 6455 "configure"
6455 #include "confdefs.h"
6456 #include <$ac_hdr>
6457 EOF
6458 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6459 { (eval echo configure:6460: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6460 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6461 if test -z "$ac_err"; then
6462   rm -rf conftest*
6463   eval "ac_cv_header_$ac_safe=yes"
6464 else
6465   echo "$ac_err" >&5
6466   echo "configure: failed program was:" >&5
6467   cat conftest.$ac_ext >&5
6468   rm -rf conftest*
6469   eval "ac_cv_header_$ac_safe=no"
6470 fi
6471 rm -f conftest*
6472 fi
6473 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6474   echo "$ac_t""yes" 1>&6
6475     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6476   cat >> confdefs.h <<EOF
6477 #define $ac_tr_hdr 1
6478 EOF
6479  
6480 else
6481   echo "$ac_t""no" 1>&6
6482 fi
6483 done
6484
6485         if test $ac_cv_header_mach_cthreads_h = yes ; then
6486                 ol_with_threads=found
6487
6488                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
6489 echo "configure:6490: checking for cthread_fork" >&5
6490 if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
6491   echo $ac_n "(cached) $ac_c" 1>&6
6492 else
6493   cat > conftest.$ac_ext <<EOF
6494 #line 6495 "configure"
6495 #include "confdefs.h"
6496 /* System header to define __stub macros and hopefully few prototypes,
6497     which can conflict with char cthread_fork(); below.  */
6498 #include <assert.h>
6499 /* Override any gcc2 internal prototype to avoid an error.  */
6500 /* We use char because int might match the return type of a gcc2
6501     builtin and then its argument prototype would still apply.  */
6502 char cthread_fork();
6503
6504 int main() {
6505
6506 /* The GNU C library defines this for functions which it implements
6507     to always fail with ENOSYS.  Some functions are actually named
6508     something starting with __ and the normal name is an alias.  */
6509 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
6510 choke me
6511 #else
6512 cthread_fork();
6513 #endif
6514
6515 ; return 0; }
6516 EOF
6517 if { (eval echo configure:6518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6518   rm -rf conftest*
6519   eval "ac_cv_func_cthread_fork=yes"
6520 else
6521   echo "configure: failed program was:" >&5
6522   cat conftest.$ac_ext >&5
6523   rm -rf conftest*
6524   eval "ac_cv_func_cthread_fork=no"
6525 fi
6526 rm -f conftest*
6527 fi
6528
6529 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
6530   echo "$ac_t""yes" 1>&6
6531   ol_link_threads=yes
6532 else
6533   echo "$ac_t""no" 1>&6
6534 fi
6535
6536
6537                 if test $ol_link_threads = no ; then
6538                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
6539 echo "configure:6540: checking for cthread_fork with -all_load" >&5
6540 if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
6541   echo $ac_n "(cached) $ac_c" 1>&6
6542 else
6543   
6544                                                                 save_LIBS="$LIBS"
6545                                 LIBS="-all_load $LIBS"
6546                                 cat > conftest.$ac_ext <<EOF
6547 #line 6548 "configure"
6548 #include "confdefs.h"
6549 #include <mach/cthreads.h>
6550 int main() {
6551
6552                                         cthread_fork((void *)0, (void *)0);
6553                                         
6554 ; return 0; }
6555 EOF
6556 if { (eval echo configure:6557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6557   rm -rf conftest*
6558   ol_cv_cthread_all_load=yes
6559 else
6560   echo "configure: failed program was:" >&5
6561   cat conftest.$ac_ext >&5
6562   rm -rf conftest*
6563   ol_cv_cthread_all_load=no
6564 fi
6565 rm -f conftest*
6566                                                                 LIBS="$save_LIBS"
6567                         
6568 fi
6569
6570 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
6571
6572                         if test $ol_cv_cthread_all_load = yes ; then
6573                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
6574                                 ol_link_threads=mach
6575                         fi
6576                 fi
6577
6578                 if test $ol_link_threads != no ; then
6579                         : check for cthread specific functionality here
6580                         cat >> confdefs.h <<\EOF
6581 #define HAVE_MACH_CTHREADS 1
6582 EOF
6583
6584                 else
6585                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
6586                 fi
6587         fi
6588
6589         if test $ol_with_threads = mach ; then
6590                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
6591         fi
6592 fi
6593
6594 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6595         -o $ol_with_threads = lwp ; then
6596
6597                 for ac_hdr in thread.h synch.h
6598 do
6599 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6600 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6601 echo "configure:6602: checking for $ac_hdr" >&5
6602 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6603   echo $ac_n "(cached) $ac_c" 1>&6
6604 else
6605   cat > conftest.$ac_ext <<EOF
6606 #line 6607 "configure"
6607 #include "confdefs.h"
6608 #include <$ac_hdr>
6609 EOF
6610 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6611 { (eval echo configure:6612: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6612 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6613 if test -z "$ac_err"; then
6614   rm -rf conftest*
6615   eval "ac_cv_header_$ac_safe=yes"
6616 else
6617   echo "$ac_err" >&5
6618   echo "configure: failed program was:" >&5
6619   cat conftest.$ac_ext >&5
6620   rm -rf conftest*
6621   eval "ac_cv_header_$ac_safe=no"
6622 fi
6623 rm -f conftest*
6624 fi
6625 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6626   echo "$ac_t""yes" 1>&6
6627     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6628   cat >> confdefs.h <<EOF
6629 #define $ac_tr_hdr 1
6630 EOF
6631  
6632 else
6633   echo "$ac_t""no" 1>&6
6634 fi
6635 done
6636
6637         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
6638                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
6639 echo "configure:6640: checking for thr_create in -lthread" >&5
6640 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
6641 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6642   echo $ac_n "(cached) $ac_c" 1>&6
6643 else
6644   ac_save_LIBS="$LIBS"
6645 LIBS="-lthread  $LIBS"
6646 cat > conftest.$ac_ext <<EOF
6647 #line 6648 "configure"
6648 #include "confdefs.h"
6649 /* Override any gcc2 internal prototype to avoid an error.  */
6650 /* We use char because int might match the return type of a gcc2
6651     builtin and then its argument prototype would still apply.  */
6652 char thr_create();
6653
6654 int main() {
6655 thr_create()
6656 ; return 0; }
6657 EOF
6658 if { (eval echo configure:6659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6659   rm -rf conftest*
6660   eval "ac_cv_lib_$ac_lib_var=yes"
6661 else
6662   echo "configure: failed program was:" >&5
6663   cat conftest.$ac_ext >&5
6664   rm -rf conftest*
6665   eval "ac_cv_lib_$ac_lib_var=no"
6666 fi
6667 rm -f conftest*
6668 LIBS="$ac_save_LIBS"
6669
6670 fi
6671 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6672   echo "$ac_t""yes" 1>&6
6673   have_thr=yes
6674 else
6675   echo "$ac_t""no" 1>&6
6676 have_thr=no
6677 fi
6678
6679
6680                 if test $have_thr = yes ; then
6681                         cat >> confdefs.h <<\EOF
6682 #define HAVE_THR 1
6683 EOF
6684
6685                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
6686                         ol_link_threads=thr
6687
6688                         if test $ol_with_yielding_select = auto ; then
6689                                 ol_with_yielding_select=yes
6690                         fi
6691
6692                                                 for ac_func in \
6693                                 thr_setconcurrency \
6694                                 thr_getconcurrency \
6695                         
6696 do
6697 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6698 echo "configure:6699: checking for $ac_func" >&5
6699 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6700   echo $ac_n "(cached) $ac_c" 1>&6
6701 else
6702   cat > conftest.$ac_ext <<EOF
6703 #line 6704 "configure"
6704 #include "confdefs.h"
6705 /* System header to define __stub macros and hopefully few prototypes,
6706     which can conflict with char $ac_func(); below.  */
6707 #include <assert.h>
6708 /* Override any gcc2 internal prototype to avoid an error.  */
6709 /* We use char because int might match the return type of a gcc2
6710     builtin and then its argument prototype would still apply.  */
6711 char $ac_func();
6712
6713 int main() {
6714
6715 /* The GNU C library defines this for functions which it implements
6716     to always fail with ENOSYS.  Some functions are actually named
6717     something starting with __ and the normal name is an alias.  */
6718 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6719 choke me
6720 #else
6721 $ac_func();
6722 #endif
6723
6724 ; return 0; }
6725 EOF
6726 if { (eval echo configure:6727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6727   rm -rf conftest*
6728   eval "ac_cv_func_$ac_func=yes"
6729 else
6730   echo "configure: failed program was:" >&5
6731   cat conftest.$ac_ext >&5
6732   rm -rf conftest*
6733   eval "ac_cv_func_$ac_func=no"
6734 fi
6735 rm -f conftest*
6736 fi
6737
6738 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6739   echo "$ac_t""yes" 1>&6
6740     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6741   cat >> confdefs.h <<EOF
6742 #define $ac_tr_func 1
6743 EOF
6744  
6745 else
6746   echo "$ac_t""no" 1>&6
6747 fi
6748 done
6749
6750                 fi
6751         fi
6752
6753                 for ac_hdr in lwp/lwp.h
6754 do
6755 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6756 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6757 echo "configure:6758: checking for $ac_hdr" >&5
6758 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6759   echo $ac_n "(cached) $ac_c" 1>&6
6760 else
6761   cat > conftest.$ac_ext <<EOF
6762 #line 6763 "configure"
6763 #include "confdefs.h"
6764 #include <$ac_hdr>
6765 EOF
6766 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6767 { (eval echo configure:6768: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6768 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6769 if test -z "$ac_err"; then
6770   rm -rf conftest*
6771   eval "ac_cv_header_$ac_safe=yes"
6772 else
6773   echo "$ac_err" >&5
6774   echo "configure: failed program was:" >&5
6775   cat conftest.$ac_ext >&5
6776   rm -rf conftest*
6777   eval "ac_cv_header_$ac_safe=no"
6778 fi
6779 rm -f conftest*
6780 fi
6781 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6782   echo "$ac_t""yes" 1>&6
6783     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6784   cat >> confdefs.h <<EOF
6785 #define $ac_tr_hdr 1
6786 EOF
6787  
6788 else
6789   echo "$ac_t""no" 1>&6
6790 fi
6791 done
6792
6793         if test $ac_cv_header_lwp_lwp_h = yes ; then
6794                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
6795 echo "configure:6796: checking for lwp_create in -llwp" >&5
6796 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
6797 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6798   echo $ac_n "(cached) $ac_c" 1>&6
6799 else
6800   ac_save_LIBS="$LIBS"
6801 LIBS="-llwp  $LIBS"
6802 cat > conftest.$ac_ext <<EOF
6803 #line 6804 "configure"
6804 #include "confdefs.h"
6805 /* Override any gcc2 internal prototype to avoid an error.  */
6806 /* We use char because int might match the return type of a gcc2
6807     builtin and then its argument prototype would still apply.  */
6808 char lwp_create();
6809
6810 int main() {
6811 lwp_create()
6812 ; return 0; }
6813 EOF
6814 if { (eval echo configure:6815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6815   rm -rf conftest*
6816   eval "ac_cv_lib_$ac_lib_var=yes"
6817 else
6818   echo "configure: failed program was:" >&5
6819   cat conftest.$ac_ext >&5
6820   rm -rf conftest*
6821   eval "ac_cv_lib_$ac_lib_var=no"
6822 fi
6823 rm -f conftest*
6824 LIBS="$ac_save_LIBS"
6825
6826 fi
6827 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6828   echo "$ac_t""yes" 1>&6
6829   have_lwp=yes
6830 else
6831   echo "$ac_t""no" 1>&6
6832 have_lwp=no
6833 fi
6834
6835
6836                 if test $have_lwp = yes ; then
6837                         cat >> confdefs.h <<\EOF
6838 #define HAVE_LWP 1
6839 EOF
6840
6841                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
6842                         ol_link_threads=lwp
6843
6844                         if test $ol_with_yielding_select = auto ; then
6845                                 ol_with_yielding_select=no
6846                         fi
6847                 fi
6848         fi
6849 fi
6850
6851 if test $ol_with_yielding_select = yes ; then
6852         cat >> confdefs.h <<\EOF
6853 #define HAVE_YIELDING_SELECT 1
6854 EOF
6855
6856 fi
6857
6858 if test $ol_with_threads = manual ; then
6859                 ol_link_threads=yes
6860
6861         echo "configure: warning: thread defines and link options must be set manually" 1>&2
6862
6863         for ac_hdr in pthread.h sched.h
6864 do
6865 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6866 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6867 echo "configure:6868: checking for $ac_hdr" >&5
6868 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6869   echo $ac_n "(cached) $ac_c" 1>&6
6870 else
6871   cat > conftest.$ac_ext <<EOF
6872 #line 6873 "configure"
6873 #include "confdefs.h"
6874 #include <$ac_hdr>
6875 EOF
6876 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6877 { (eval echo configure:6878: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6878 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6879 if test -z "$ac_err"; then
6880   rm -rf conftest*
6881   eval "ac_cv_header_$ac_safe=yes"
6882 else
6883   echo "$ac_err" >&5
6884   echo "configure: failed program was:" >&5
6885   cat conftest.$ac_ext >&5
6886   rm -rf conftest*
6887   eval "ac_cv_header_$ac_safe=no"
6888 fi
6889 rm -f conftest*
6890 fi
6891 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6892   echo "$ac_t""yes" 1>&6
6893     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6894   cat >> confdefs.h <<EOF
6895 #define $ac_tr_hdr 1
6896 EOF
6897  
6898 else
6899   echo "$ac_t""no" 1>&6
6900 fi
6901 done
6902
6903         for ac_func in sched_yield pthread_yield
6904 do
6905 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6906 echo "configure:6907: checking for $ac_func" >&5
6907 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6908   echo $ac_n "(cached) $ac_c" 1>&6
6909 else
6910   cat > conftest.$ac_ext <<EOF
6911 #line 6912 "configure"
6912 #include "confdefs.h"
6913 /* System header to define __stub macros and hopefully few prototypes,
6914     which can conflict with char $ac_func(); below.  */
6915 #include <assert.h>
6916 /* Override any gcc2 internal prototype to avoid an error.  */
6917 /* We use char because int might match the return type of a gcc2
6918     builtin and then its argument prototype would still apply.  */
6919 char $ac_func();
6920
6921 int main() {
6922
6923 /* The GNU C library defines this for functions which it implements
6924     to always fail with ENOSYS.  Some functions are actually named
6925     something starting with __ and the normal name is an alias.  */
6926 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6927 choke me
6928 #else
6929 $ac_func();
6930 #endif
6931
6932 ; return 0; }
6933 EOF
6934 if { (eval echo configure:6935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6935   rm -rf conftest*
6936   eval "ac_cv_func_$ac_func=yes"
6937 else
6938   echo "configure: failed program was:" >&5
6939   cat conftest.$ac_ext >&5
6940   rm -rf conftest*
6941   eval "ac_cv_func_$ac_func=no"
6942 fi
6943 rm -f conftest*
6944 fi
6945
6946 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6947   echo "$ac_t""yes" 1>&6
6948     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6949   cat >> confdefs.h <<EOF
6950 #define $ac_tr_func 1
6951 EOF
6952  
6953 else
6954   echo "$ac_t""no" 1>&6
6955 fi
6956 done
6957
6958         
6959         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
6960 echo "configure:6961: checking for LinuxThreads pthread.h" >&5
6961 if eval "test \"`echo '$''{'ol_cv_header_linux_threads'+set}'`\" = set"; then
6962   echo $ac_n "(cached) $ac_c" 1>&6
6963 else
6964   cat > conftest.$ac_ext <<EOF
6965 #line 6966 "configure"
6966 #include "confdefs.h"
6967 #include <pthread.h>
6968 EOF
6969 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6970   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
6971   rm -rf conftest*
6972   ol_cv_header_linux_threads=yes
6973 else
6974   rm -rf conftest*
6975   ol_cv_header_linux_threads=no
6976 fi
6977 rm -f conftest*
6978
6979                 
6980 fi
6981
6982 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
6983         if test $ol_cv_header_linux_threads = yes; then
6984                 cat >> confdefs.h <<\EOF
6985 #define HAVE_LINUX_THREADS 1
6986 EOF
6987
6988         fi
6989
6990
6991         for ac_hdr in mach/cthreads.h
6992 do
6993 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6994 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6995 echo "configure:6996: checking for $ac_hdr" >&5
6996 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6997   echo $ac_n "(cached) $ac_c" 1>&6
6998 else
6999   cat > conftest.$ac_ext <<EOF
7000 #line 7001 "configure"
7001 #include "confdefs.h"
7002 #include <$ac_hdr>
7003 EOF
7004 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7005 { (eval echo configure:7006: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7006 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7007 if test -z "$ac_err"; then
7008   rm -rf conftest*
7009   eval "ac_cv_header_$ac_safe=yes"
7010 else
7011   echo "$ac_err" >&5
7012   echo "configure: failed program was:" >&5
7013   cat conftest.$ac_ext >&5
7014   rm -rf conftest*
7015   eval "ac_cv_header_$ac_safe=no"
7016 fi
7017 rm -f conftest*
7018 fi
7019 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7020   echo "$ac_t""yes" 1>&6
7021     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7022   cat >> confdefs.h <<EOF
7023 #define $ac_tr_hdr 1
7024 EOF
7025  
7026 else
7027   echo "$ac_t""no" 1>&6
7028 fi
7029 done
7030
7031         for ac_hdr in lwp/lwp.h
7032 do
7033 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7034 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7035 echo "configure:7036: checking for $ac_hdr" >&5
7036 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7037   echo $ac_n "(cached) $ac_c" 1>&6
7038 else
7039   cat > conftest.$ac_ext <<EOF
7040 #line 7041 "configure"
7041 #include "confdefs.h"
7042 #include <$ac_hdr>
7043 EOF
7044 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7045 { (eval echo configure:7046: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7046 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7047 if test -z "$ac_err"; then
7048   rm -rf conftest*
7049   eval "ac_cv_header_$ac_safe=yes"
7050 else
7051   echo "$ac_err" >&5
7052   echo "configure: failed program was:" >&5
7053   cat conftest.$ac_ext >&5
7054   rm -rf conftest*
7055   eval "ac_cv_header_$ac_safe=no"
7056 fi
7057 rm -f conftest*
7058 fi
7059 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7060   echo "$ac_t""yes" 1>&6
7061     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7062   cat >> confdefs.h <<EOF
7063 #define $ac_tr_hdr 1
7064 EOF
7065  
7066 else
7067   echo "$ac_t""no" 1>&6
7068 fi
7069 done
7070
7071         for ac_hdr in thread.h synch.h
7072 do
7073 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7074 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7075 echo "configure:7076: checking for $ac_hdr" >&5
7076 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7077   echo $ac_n "(cached) $ac_c" 1>&6
7078 else
7079   cat > conftest.$ac_ext <<EOF
7080 #line 7081 "configure"
7081 #include "confdefs.h"
7082 #include <$ac_hdr>
7083 EOF
7084 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7085 { (eval echo configure:7086: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7086 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7087 if test -z "$ac_err"; then
7088   rm -rf conftest*
7089   eval "ac_cv_header_$ac_safe=yes"
7090 else
7091   echo "$ac_err" >&5
7092   echo "configure: failed program was:" >&5
7093   cat conftest.$ac_ext >&5
7094   rm -rf conftest*
7095   eval "ac_cv_header_$ac_safe=no"
7096 fi
7097 rm -f conftest*
7098 fi
7099 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7100   echo "$ac_t""yes" 1>&6
7101     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7102   cat >> confdefs.h <<EOF
7103 #define $ac_tr_hdr 1
7104 EOF
7105  
7106 else
7107   echo "$ac_t""no" 1>&6
7108 fi
7109 done
7110
7111 fi
7112
7113 if test $ol_link_threads != no ; then  
7114                         cat >> confdefs.h <<\EOF
7115 #define REENTRANT 1
7116 EOF
7117
7118         cat >> confdefs.h <<\EOF
7119 #define _REENTRANT 1
7120 EOF
7121
7122         cat >> confdefs.h <<\EOF
7123 #define THREAD_SAFE 1
7124 EOF
7125
7126         cat >> confdefs.h <<\EOF
7127 #define _THREAD_SAFE 1
7128 EOF
7129
7130         cat >> confdefs.h <<\EOF
7131 #define THREADSAFE 1
7132 EOF
7133
7134         cat >> confdefs.h <<\EOF
7135 #define _THREADSAFE 1
7136 EOF
7137
7138
7139                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
7140 echo "configure:7141: checking for thread specific errno" >&5
7141 if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
7142   echo $ac_n "(cached) $ac_c" 1>&6
7143 else
7144   
7145                 cat > conftest.$ac_ext <<EOF
7146 #line 7147 "configure"
7147 #include "confdefs.h"
7148 #include <errno.h>
7149 int main() {
7150 errno = 0;
7151 ; return 0; }
7152 EOF
7153 if { (eval echo configure:7154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7154   rm -rf conftest*
7155   ol_cv_errno_thread_specific=yes
7156 else
7157   echo "configure: failed program was:" >&5
7158   cat conftest.$ac_ext >&5
7159   rm -rf conftest*
7160   ol_cv_errno_thread_specific=no
7161 fi
7162 rm -f conftest*
7163         
7164 fi
7165
7166 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
7167
7168         if test $ol_cv_errno_thread_specific != yes ; then
7169                 LIBS="$LTHREAD_LIBS $LIBS"
7170                 LTHREAD_LIBS=""
7171         fi
7172
7173 fi  
7174
7175 if test $ol_link_threads = no ; then
7176         if test $ol_with_threads = yes ; then
7177                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
7178         fi
7179
7180         if test $ol_with_threads = auto ; then
7181                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
7182                 ol_with_threads=no
7183         fi
7184
7185         cat >> confdefs.h <<\EOF
7186 #define NO_THREADS 1
7187 EOF
7188
7189         LTHREAD_LIBS=""
7190 fi
7191
7192 if test $ol_link_threads != no ; then
7193         cat >> confdefs.h <<\EOF
7194 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
7195 EOF
7196
7197 fi
7198
7199
7200 ol_link_ldbm=no 
7201 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
7202         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
7203 echo "configure:7204: checking for DB2 library" >&5
7204 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
7205   echo $ac_n "(cached) $ac_c" 1>&6
7206 else
7207         ol_LIBS="$LIBS"
7208         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
7209 echo "configure:7210: checking for db_open in -ldb" >&5
7210 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
7211 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7212   echo $ac_n "(cached) $ac_c" 1>&6
7213 else
7214   ac_save_LIBS="$LIBS"
7215 LIBS="-ldb  $LIBS"
7216 cat > conftest.$ac_ext <<EOF
7217 #line 7218 "configure"
7218 #include "confdefs.h"
7219 /* Override any gcc2 internal prototype to avoid an error.  */
7220 /* We use char because int might match the return type of a gcc2
7221     builtin and then its argument prototype would still apply.  */
7222 char db_open();
7223
7224 int main() {
7225 db_open()
7226 ; return 0; }
7227 EOF
7228 if { (eval echo configure:7229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7229   rm -rf conftest*
7230   eval "ac_cv_lib_$ac_lib_var=yes"
7231 else
7232   echo "configure: failed program was:" >&5
7233   cat conftest.$ac_ext >&5
7234   rm -rf conftest*
7235   eval "ac_cv_lib_$ac_lib_var=no"
7236 fi
7237 rm -f conftest*
7238 LIBS="$ac_save_LIBS"
7239
7240 fi
7241 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7242   echo "$ac_t""yes" 1>&6
7243   ol_cv_lib_db2=-ldb
7244 else
7245   echo "$ac_t""no" 1>&6
7246 ol_cv_lib_db2=no
7247 fi
7248
7249         LIBS="$ol_LIBS"
7250
7251 fi
7252
7253 echo "$ac_t""$ol_cv_lib_db2" 1>&6
7254
7255 for ac_hdr in db.h
7256 do
7257 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7258 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7259 echo "configure:7260: checking for $ac_hdr" >&5
7260 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7261   echo $ac_n "(cached) $ac_c" 1>&6
7262 else
7263   cat > conftest.$ac_ext <<EOF
7264 #line 7265 "configure"
7265 #include "confdefs.h"
7266 #include <$ac_hdr>
7267 EOF
7268 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7269 { (eval echo configure:7270: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7270 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7271 if test -z "$ac_err"; then
7272   rm -rf conftest*
7273   eval "ac_cv_header_$ac_safe=yes"
7274 else
7275   echo "$ac_err" >&5
7276   echo "configure: failed program was:" >&5
7277   cat conftest.$ac_ext >&5
7278   rm -rf conftest*
7279   eval "ac_cv_header_$ac_safe=no"
7280 fi
7281 rm -f conftest*
7282 fi
7283 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7284   echo "$ac_t""yes" 1>&6
7285     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7286   cat >> confdefs.h <<EOF
7287 #define $ac_tr_hdr 1
7288 EOF
7289  
7290 else
7291   echo "$ac_t""no" 1>&6
7292 fi
7293 done
7294
7295 if test $ac_cv_header_db_h = yes ; then
7296         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
7297 echo "configure:7298: checking if db.h is DB2" >&5
7298 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
7299   echo $ac_n "(cached) $ac_c" 1>&6
7300 else
7301   
7302                 cat > conftest.$ac_ext <<EOF
7303 #line 7304 "configure"
7304 #include "confdefs.h"
7305
7306 #                       include <db.h>
7307                         /* this check could be improved */
7308 #                       ifdef DB_VERSION_MAJOR
7309 #                               if DB_VERSION_MAJOR == 2
7310                                         __db_version_2
7311 #                               endif
7312 #                       endif
7313                 
7314 EOF
7315 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7316   egrep "__db_version_2" >/dev/null 2>&1; then
7317   rm -rf conftest*
7318   ol_cv_header_db2=yes
7319 else
7320   rm -rf conftest*
7321   ol_cv_header_db2=no
7322 fi
7323 rm -f conftest*
7324
7325 fi
7326
7327 echo "$ac_t""$ol_cv_header_db2" 1>&6
7328 else
7329         ol_cv_header_db2=no
7330 fi
7331
7332
7333  
7334  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
7335 echo "configure:7336: checking for Berkeley DB2" >&5
7336 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
7337   echo $ac_n "(cached) $ac_c" 1>&6
7338 else
7339   
7340         if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then
7341                 ol_cv_berkeley_db2=no
7342         else
7343                 ol_cv_berkeley_db2=yes
7344         fi
7345
7346 fi
7347
7348 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
7349  if test $ol_cv_berkeley_db2 = yes ; then
7350         cat >> confdefs.h <<\EOF
7351 #define HAVE_BERKELEY_DB2 1
7352 EOF
7353
7354  fi
7355
7356
7357         if test $ol_cv_berkeley_db2 = yes ; then
7358                 ol_link_ldbm=db2
7359                 ol_with_ldbm_api=db2
7360
7361                 if test $ol_with_ldbm_type = hash ; then
7362                         cat >> confdefs.h <<\EOF
7363 #define LDBM_USE_DBHASH 1
7364 EOF
7365
7366                 else
7367                         cat >> confdefs.h <<\EOF
7368 #define LDBM_USE_DBBTREE 1
7369 EOF
7370
7371                 fi
7372
7373                                                 if test $ol_cv_lib_db2 != yes ; then
7374                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
7375                 fi
7376         fi
7377 fi
7378
7379 ol_link_bdb2=no
7380 if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
7381         ol_link_bdb2=yes
7382 fi
7383
7384 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
7385         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
7386 echo "configure:7387: checking for Berkeley DB library" >&5
7387 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
7388   echo $ac_n "(cached) $ac_c" 1>&6
7389 else
7390   
7391         for ac_hdr in db1/db.h
7392 do
7393 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7394 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7395 echo "configure:7396: checking for $ac_hdr" >&5
7396 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7397   echo $ac_n "(cached) $ac_c" 1>&6
7398 else
7399   cat > conftest.$ac_ext <<EOF
7400 #line 7401 "configure"
7401 #include "confdefs.h"
7402 #include <$ac_hdr>
7403 EOF
7404 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7405 { (eval echo configure:7406: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7406 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7407 if test -z "$ac_err"; then
7408   rm -rf conftest*
7409   eval "ac_cv_header_$ac_safe=yes"
7410 else
7411   echo "$ac_err" >&5
7412   echo "configure: failed program was:" >&5
7413   cat conftest.$ac_ext >&5
7414   rm -rf conftest*
7415   eval "ac_cv_header_$ac_safe=no"
7416 fi
7417 rm -f conftest*
7418 fi
7419 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7420   echo "$ac_t""yes" 1>&6
7421     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7422   cat >> confdefs.h <<EOF
7423 #define $ac_tr_hdr 1
7424 EOF
7425  
7426 else
7427   echo "$ac_t""no" 1>&6
7428 fi
7429 done
7430
7431         ol_LIBS="$LIBS"
7432         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
7433 echo "configure:7434: checking for dbopen" >&5
7434 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
7435   echo $ac_n "(cached) $ac_c" 1>&6
7436 else
7437   cat > conftest.$ac_ext <<EOF
7438 #line 7439 "configure"
7439 #include "confdefs.h"
7440 /* System header to define __stub macros and hopefully few prototypes,
7441     which can conflict with char dbopen(); below.  */
7442 #include <assert.h>
7443 /* Override any gcc2 internal prototype to avoid an error.  */
7444 /* We use char because int might match the return type of a gcc2
7445     builtin and then its argument prototype would still apply.  */
7446 char dbopen();
7447
7448 int main() {
7449
7450 /* The GNU C library defines this for functions which it implements
7451     to always fail with ENOSYS.  Some functions are actually named
7452     something starting with __ and the normal name is an alias.  */
7453 #if defined (__stub_dbopen) || defined (__stub___dbopen)
7454 choke me
7455 #else
7456 dbopen();
7457 #endif
7458
7459 ; return 0; }
7460 EOF
7461 if { (eval echo configure:7462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7462   rm -rf conftest*
7463   eval "ac_cv_func_dbopen=yes"
7464 else
7465   echo "configure: failed program was:" >&5
7466   cat conftest.$ac_ext >&5
7467   rm -rf conftest*
7468   eval "ac_cv_func_dbopen=no"
7469 fi
7470 rm -f conftest*
7471 fi
7472
7473 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
7474   echo "$ac_t""yes" 1>&6
7475   ol_cv_lib_db=yes
7476 else
7477   echo "$ac_t""no" 1>&6
7478
7479                 echo $ac_n "checking for dbopen in -ldb1""... $ac_c" 1>&6
7480 echo "configure:7481: checking for dbopen in -ldb1" >&5
7481 ac_lib_var=`echo db1'_'dbopen | sed 'y%./+-%__p_%'`
7482 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7483   echo $ac_n "(cached) $ac_c" 1>&6
7484 else
7485   ac_save_LIBS="$LIBS"
7486 LIBS="-ldb1  $LIBS"
7487 cat > conftest.$ac_ext <<EOF
7488 #line 7489 "configure"
7489 #include "confdefs.h"
7490 /* Override any gcc2 internal prototype to avoid an error.  */
7491 /* We use char because int might match the return type of a gcc2
7492     builtin and then its argument prototype would still apply.  */
7493 char dbopen();
7494
7495 int main() {
7496 dbopen()
7497 ; return 0; }
7498 EOF
7499 if { (eval echo configure:7500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7500   rm -rf conftest*
7501   eval "ac_cv_lib_$ac_lib_var=yes"
7502 else
7503   echo "configure: failed program was:" >&5
7504   cat conftest.$ac_ext >&5
7505   rm -rf conftest*
7506   eval "ac_cv_lib_$ac_lib_var=no"
7507 fi
7508 rm -f conftest*
7509 LIBS="$ac_save_LIBS"
7510
7511 fi
7512 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7513   echo "$ac_t""yes" 1>&6
7514   ol_cv_lib_db=-ldb1
7515 else
7516   echo "$ac_t""no" 1>&6
7517
7518                         echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
7519 echo "configure:7520: checking for dbopen in -ldb" >&5
7520 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
7521 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7522   echo $ac_n "(cached) $ac_c" 1>&6
7523 else
7524   ac_save_LIBS="$LIBS"
7525 LIBS="-ldb  $LIBS"
7526 cat > conftest.$ac_ext <<EOF
7527 #line 7528 "configure"
7528 #include "confdefs.h"
7529 /* Override any gcc2 internal prototype to avoid an error.  */
7530 /* We use char because int might match the return type of a gcc2
7531     builtin and then its argument prototype would still apply.  */
7532 char dbopen();
7533
7534 int main() {
7535 dbopen()
7536 ; return 0; }
7537 EOF
7538 if { (eval echo configure:7539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7539   rm -rf conftest*
7540   eval "ac_cv_lib_$ac_lib_var=yes"
7541 else
7542   echo "configure: failed program was:" >&5
7543   cat conftest.$ac_ext >&5
7544   rm -rf conftest*
7545   eval "ac_cv_lib_$ac_lib_var=no"
7546 fi
7547 rm -f conftest*
7548 LIBS="$ac_save_LIBS"
7549
7550 fi
7551 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7552   echo "$ac_t""yes" 1>&6
7553   ol_cv_lib_db=-ldb
7554                         ol_cv_lib_db=no
7555 else
7556   echo "$ac_t""no" 1>&6
7557 fi
7558
7559                 
7560 fi
7561
7562         
7563 fi
7564
7565         LIBS="$ol_LIBS"
7566
7567 fi
7568
7569 echo "$ac_t""$ol_cv_lib_db" 1>&6
7570
7571
7572 for ac_hdr in db_185.h
7573 do
7574 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7575 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7576 echo "configure:7577: checking for $ac_hdr" >&5
7577 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7578   echo $ac_n "(cached) $ac_c" 1>&6
7579 else
7580   cat > conftest.$ac_ext <<EOF
7581 #line 7582 "configure"
7582 #include "confdefs.h"
7583 #include <$ac_hdr>
7584 EOF
7585 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7586 { (eval echo configure:7587: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7587 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7588 if test -z "$ac_err"; then
7589   rm -rf conftest*
7590   eval "ac_cv_header_$ac_safe=yes"
7591 else
7592   echo "$ac_err" >&5
7593   echo "configure: failed program was:" >&5
7594   cat conftest.$ac_ext >&5
7595   rm -rf conftest*
7596   eval "ac_cv_header_$ac_safe=no"
7597 fi
7598 rm -f conftest*
7599 fi
7600 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7601   echo "$ac_t""yes" 1>&6
7602     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7603   cat >> confdefs.h <<EOF
7604 #define $ac_tr_hdr 1
7605 EOF
7606  
7607 else
7608   echo "$ac_t""no" 1>&6
7609 fi
7610 done
7611
7612 if test "$ol_cv_header_db2" = yes ; then
7613         
7614         ol_cv_header_db=$ac_cv_header_db_185_h
7615 else
7616         ol_cv_header_db=$ac_cv_header_db_h
7617 fi
7618
7619
7620  
7621  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
7622 echo "configure:7623: checking for Berkeley DB" >&5
7623 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
7624   echo $ac_n "(cached) $ac_c" 1>&6
7625 else
7626   
7627         if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then
7628                 ol_cv_berkeley_db=no
7629         else
7630                 ol_cv_berkeley_db=yes
7631         fi
7632
7633 fi
7634
7635 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
7636  if test $ol_cv_berkeley_db = yes ; then
7637         cat >> confdefs.h <<\EOF
7638 #define HAVE_BERKELEY_DB 1
7639 EOF
7640
7641  fi
7642
7643
7644         if test $ol_cv_berkeley_db = yes ; then
7645                 ol_link_ldbm=db
7646                 ol_with_ldbm_api=db
7647
7648                 if test $ol_with_ldbm_type = hash ; then
7649                         cat >> confdefs.h <<\EOF
7650 #define LDBM_USE_DBHASH 1
7651 EOF
7652
7653                 else
7654                         cat >> confdefs.h <<\EOF
7655 #define LDBM_USE_DBBTREE 1
7656 EOF
7657
7658                 fi
7659
7660                                                 if test $ol_cv_lib_db != yes ; then
7661                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
7662                 fi
7663         fi
7664 fi
7665
7666 if test $ol_with_ldbm_api = manual ; then
7667                 ol_link_ldbm=yes
7668
7669         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
7670
7671         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
7672 do
7673 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7674 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7675 echo "configure:7676: checking for $ac_hdr" >&5
7676 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7677   echo $ac_n "(cached) $ac_c" 1>&6
7678 else
7679   cat > conftest.$ac_ext <<EOF
7680 #line 7681 "configure"
7681 #include "confdefs.h"
7682 #include <$ac_hdr>
7683 EOF
7684 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7685 { (eval echo configure:7686: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7686 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7687 if test -z "$ac_err"; then
7688   rm -rf conftest*
7689   eval "ac_cv_header_$ac_safe=yes"
7690 else
7691   echo "$ac_err" >&5
7692   echo "configure: failed program was:" >&5
7693   cat conftest.$ac_ext >&5
7694   rm -rf conftest*
7695   eval "ac_cv_header_$ac_safe=no"
7696 fi
7697 rm -f conftest*
7698 fi
7699 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7700   echo "$ac_t""yes" 1>&6
7701     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7702   cat >> confdefs.h <<EOF
7703 #define $ac_tr_hdr 1
7704 EOF
7705  
7706 else
7707   echo "$ac_t""no" 1>&6
7708 fi
7709 done
7710
7711 fi
7712
7713 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
7714         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
7715         ol_with_ldbm_api=none
7716 fi
7717
7718 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
7719         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
7720 echo "configure:7721: checking for MDBM library" >&5
7721 if eval "test \"`echo '$''{'ol_cv_lib_mdbm'+set}'`\" = set"; then
7722   echo $ac_n "(cached) $ac_c" 1>&6
7723 else
7724         ol_LIBS="$LIBS"
7725         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
7726 echo "configure:7727: checking for mdbm_set_chain" >&5
7727 if eval "test \"`echo '$''{'ac_cv_func_mdbm_set_chain'+set}'`\" = set"; then
7728   echo $ac_n "(cached) $ac_c" 1>&6
7729 else
7730   cat > conftest.$ac_ext <<EOF
7731 #line 7732 "configure"
7732 #include "confdefs.h"
7733 /* System header to define __stub macros and hopefully few prototypes,
7734     which can conflict with char mdbm_set_chain(); below.  */
7735 #include <assert.h>
7736 /* Override any gcc2 internal prototype to avoid an error.  */
7737 /* We use char because int might match the return type of a gcc2
7738     builtin and then its argument prototype would still apply.  */
7739 char mdbm_set_chain();
7740
7741 int main() {
7742
7743 /* The GNU C library defines this for functions which it implements
7744     to always fail with ENOSYS.  Some functions are actually named
7745     something starting with __ and the normal name is an alias.  */
7746 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
7747 choke me
7748 #else
7749 mdbm_set_chain();
7750 #endif
7751
7752 ; return 0; }
7753 EOF
7754 if { (eval echo configure:7755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7755   rm -rf conftest*
7756   eval "ac_cv_func_mdbm_set_chain=yes"
7757 else
7758   echo "configure: failed program was:" >&5
7759   cat conftest.$ac_ext >&5
7760   rm -rf conftest*
7761   eval "ac_cv_func_mdbm_set_chain=no"
7762 fi
7763 rm -f conftest*
7764 fi
7765
7766 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
7767   echo "$ac_t""yes" 1>&6
7768   ol_cv_lib_mdbm=yes
7769 else
7770   echo "$ac_t""no" 1>&6
7771
7772                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
7773 echo "configure:7774: checking for mdbm_set_chain in -lmdbm" >&5
7774 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-%__p_%'`
7775 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7776   echo $ac_n "(cached) $ac_c" 1>&6
7777 else
7778   ac_save_LIBS="$LIBS"
7779 LIBS="-lmdbm  $LIBS"
7780 cat > conftest.$ac_ext <<EOF
7781 #line 7782 "configure"
7782 #include "confdefs.h"
7783 /* Override any gcc2 internal prototype to avoid an error.  */
7784 /* We use char because int might match the return type of a gcc2
7785     builtin and then its argument prototype would still apply.  */
7786 char mdbm_set_chain();
7787
7788 int main() {
7789 mdbm_set_chain()
7790 ; return 0; }
7791 EOF
7792 if { (eval echo configure:7793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7793   rm -rf conftest*
7794   eval "ac_cv_lib_$ac_lib_var=yes"
7795 else
7796   echo "configure: failed program was:" >&5
7797   cat conftest.$ac_ext >&5
7798   rm -rf conftest*
7799   eval "ac_cv_lib_$ac_lib_var=no"
7800 fi
7801 rm -f conftest*
7802 LIBS="$ac_save_LIBS"
7803
7804 fi
7805 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7806   echo "$ac_t""yes" 1>&6
7807   ol_cv_lib_mdbm=-lmdbm
7808 else
7809   echo "$ac_t""no" 1>&6
7810 ol_cv_lib_mdbm=no
7811 fi
7812
7813         
7814 fi
7815
7816         LIBS="$ol_LIBS"
7817
7818 fi
7819
7820 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
7821
7822
7823  for ac_hdr in mdbm.h
7824 do
7825 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7826 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7827 echo "configure:7828: checking for $ac_hdr" >&5
7828 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7829   echo $ac_n "(cached) $ac_c" 1>&6
7830 else
7831   cat > conftest.$ac_ext <<EOF
7832 #line 7833 "configure"
7833 #include "confdefs.h"
7834 #include <$ac_hdr>
7835 EOF
7836 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7837 { (eval echo configure:7838: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7838 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7839 if test -z "$ac_err"; then
7840   rm -rf conftest*
7841   eval "ac_cv_header_$ac_safe=yes"
7842 else
7843   echo "$ac_err" >&5
7844   echo "configure: failed program was:" >&5
7845   cat conftest.$ac_ext >&5
7846   rm -rf conftest*
7847   eval "ac_cv_header_$ac_safe=no"
7848 fi
7849 rm -f conftest*
7850 fi
7851 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7852   echo "$ac_t""yes" 1>&6
7853     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7854   cat >> confdefs.h <<EOF
7855 #define $ac_tr_hdr 1
7856 EOF
7857  
7858 else
7859   echo "$ac_t""no" 1>&6
7860 fi
7861 done
7862
7863  echo $ac_n "checking for db""... $ac_c" 1>&6
7864 echo "configure:7865: checking for db" >&5
7865 if eval "test \"`echo '$''{'ol_cv_mdbm'+set}'`\" = set"; then
7866   echo $ac_n "(cached) $ac_c" 1>&6
7867 else
7868   
7869         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
7870                 ol_cv_mdbm=no
7871         else
7872                 ol_cv_mdbm=yes
7873         fi
7874
7875 fi
7876
7877 echo "$ac_t""$ol_cv_mdbm" 1>&6
7878  if test $ol_cv_mdbm = yes ; then
7879         cat >> confdefs.h <<\EOF
7880 #define HAVE_MDBM 1
7881 EOF
7882
7883  fi
7884
7885
7886         if test $ol_cv_mdbm = yes ; then
7887                 ol_link_ldbm=mdbm
7888                 ol_with_ldbm_api=mdbm
7889                 if test $ol_cv_lib_mdbm != yes ; then
7890                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
7891                 fi
7892         fi
7893 fi
7894
7895 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
7896         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
7897 echo "configure:7898: checking for GDBM library" >&5
7898 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
7899   echo $ac_n "(cached) $ac_c" 1>&6
7900 else
7901         ol_LIBS="$LIBS"
7902         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
7903 echo "configure:7904: checking for gdbm_open" >&5
7904 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
7905   echo $ac_n "(cached) $ac_c" 1>&6
7906 else
7907   cat > conftest.$ac_ext <<EOF
7908 #line 7909 "configure"
7909 #include "confdefs.h"
7910 /* System header to define __stub macros and hopefully few prototypes,
7911     which can conflict with char gdbm_open(); below.  */
7912 #include <assert.h>
7913 /* Override any gcc2 internal prototype to avoid an error.  */
7914 /* We use char because int might match the return type of a gcc2
7915     builtin and then its argument prototype would still apply.  */
7916 char gdbm_open();
7917
7918 int main() {
7919
7920 /* The GNU C library defines this for functions which it implements
7921     to always fail with ENOSYS.  Some functions are actually named
7922     something starting with __ and the normal name is an alias.  */
7923 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
7924 choke me
7925 #else
7926 gdbm_open();
7927 #endif
7928
7929 ; return 0; }
7930 EOF
7931 if { (eval echo configure:7932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7932   rm -rf conftest*
7933   eval "ac_cv_func_gdbm_open=yes"
7934 else
7935   echo "configure: failed program was:" >&5
7936   cat conftest.$ac_ext >&5
7937   rm -rf conftest*
7938   eval "ac_cv_func_gdbm_open=no"
7939 fi
7940 rm -f conftest*
7941 fi
7942
7943 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
7944   echo "$ac_t""yes" 1>&6
7945   ol_cv_lib_gdbm=yes
7946 else
7947   echo "$ac_t""no" 1>&6
7948
7949                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
7950 echo "configure:7951: checking for gdbm_open in -lgdbm" >&5
7951 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
7952 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7953   echo $ac_n "(cached) $ac_c" 1>&6
7954 else
7955   ac_save_LIBS="$LIBS"
7956 LIBS="-lgdbm  $LIBS"
7957 cat > conftest.$ac_ext <<EOF
7958 #line 7959 "configure"
7959 #include "confdefs.h"
7960 /* Override any gcc2 internal prototype to avoid an error.  */
7961 /* We use char because int might match the return type of a gcc2
7962     builtin and then its argument prototype would still apply.  */
7963 char gdbm_open();
7964
7965 int main() {
7966 gdbm_open()
7967 ; return 0; }
7968 EOF
7969 if { (eval echo configure:7970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7970   rm -rf conftest*
7971   eval "ac_cv_lib_$ac_lib_var=yes"
7972 else
7973   echo "configure: failed program was:" >&5
7974   cat conftest.$ac_ext >&5
7975   rm -rf conftest*
7976   eval "ac_cv_lib_$ac_lib_var=no"
7977 fi
7978 rm -f conftest*
7979 LIBS="$ac_save_LIBS"
7980
7981 fi
7982 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7983   echo "$ac_t""yes" 1>&6
7984   ol_cv_lib_gdbm=-lgdbm
7985 else
7986   echo "$ac_t""no" 1>&6
7987 ol_cv_lib_gdbm=no
7988 fi
7989
7990         
7991 fi
7992
7993         LIBS="$ol_LIBS"
7994
7995 fi
7996
7997 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
7998
7999
8000  for ac_hdr in gdbm.h
8001 do
8002 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8003 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8004 echo "configure:8005: checking for $ac_hdr" >&5
8005 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8006   echo $ac_n "(cached) $ac_c" 1>&6
8007 else
8008   cat > conftest.$ac_ext <<EOF
8009 #line 8010 "configure"
8010 #include "confdefs.h"
8011 #include <$ac_hdr>
8012 EOF
8013 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8014 { (eval echo configure:8015: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8015 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8016 if test -z "$ac_err"; then
8017   rm -rf conftest*
8018   eval "ac_cv_header_$ac_safe=yes"
8019 else
8020   echo "$ac_err" >&5
8021   echo "configure: failed program was:" >&5
8022   cat conftest.$ac_ext >&5
8023   rm -rf conftest*
8024   eval "ac_cv_header_$ac_safe=no"
8025 fi
8026 rm -f conftest*
8027 fi
8028 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8029   echo "$ac_t""yes" 1>&6
8030     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8031   cat >> confdefs.h <<EOF
8032 #define $ac_tr_hdr 1
8033 EOF
8034  
8035 else
8036   echo "$ac_t""no" 1>&6
8037 fi
8038 done
8039
8040  echo $ac_n "checking for db""... $ac_c" 1>&6
8041 echo "configure:8042: checking for db" >&5
8042 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
8043   echo $ac_n "(cached) $ac_c" 1>&6
8044 else
8045   
8046         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
8047                 ol_cv_gdbm=no
8048         else
8049                 ol_cv_gdbm=yes
8050         fi
8051
8052 fi
8053
8054 echo "$ac_t""$ol_cv_gdbm" 1>&6
8055  if test $ol_cv_gdbm = yes ; then
8056         cat >> confdefs.h <<\EOF
8057 #define HAVE_GDBM 1
8058 EOF
8059
8060  fi
8061
8062
8063         if test $ol_cv_gdbm = yes ; then
8064                 ol_link_ldbm=gdbm
8065                 ol_with_ldbm_api=gdbm
8066
8067                 if test $ol_cv_lib_gdbm != yes ; then
8068                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
8069                 fi
8070         fi
8071 fi
8072
8073 if test $ol_with_ldbm_api = auto ; then
8074         echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
8075 elif test $ol_with_ldbm_api = ndbm ; then
8076         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
8077 echo "configure:8078: checking for NDBM library" >&5
8078 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
8079   echo $ac_n "(cached) $ac_c" 1>&6
8080 else
8081         ol_LIBS="$LIBS"
8082         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
8083 echo "configure:8084: checking for dbm_open" >&5
8084 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
8085   echo $ac_n "(cached) $ac_c" 1>&6
8086 else
8087   cat > conftest.$ac_ext <<EOF
8088 #line 8089 "configure"
8089 #include "confdefs.h"
8090 /* System header to define __stub macros and hopefully few prototypes,
8091     which can conflict with char dbm_open(); below.  */
8092 #include <assert.h>
8093 /* Override any gcc2 internal prototype to avoid an error.  */
8094 /* We use char because int might match the return type of a gcc2
8095     builtin and then its argument prototype would still apply.  */
8096 char dbm_open();
8097
8098 int main() {
8099
8100 /* The GNU C library defines this for functions which it implements
8101     to always fail with ENOSYS.  Some functions are actually named
8102     something starting with __ and the normal name is an alias.  */
8103 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
8104 choke me
8105 #else
8106 dbm_open();
8107 #endif
8108
8109 ; return 0; }
8110 EOF
8111 if { (eval echo configure:8112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8112   rm -rf conftest*
8113   eval "ac_cv_func_dbm_open=yes"
8114 else
8115   echo "configure: failed program was:" >&5
8116   cat conftest.$ac_ext >&5
8117   rm -rf conftest*
8118   eval "ac_cv_func_dbm_open=no"
8119 fi
8120 rm -f conftest*
8121 fi
8122
8123 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
8124   echo "$ac_t""yes" 1>&6
8125   ol_cv_lib_ndbm=yes
8126 else
8127   echo "$ac_t""no" 1>&6
8128
8129                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
8130 echo "configure:8131: checking for dbm_open in -lndbm" >&5
8131 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
8132 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8133   echo $ac_n "(cached) $ac_c" 1>&6
8134 else
8135   ac_save_LIBS="$LIBS"
8136 LIBS="-lndbm  $LIBS"
8137 cat > conftest.$ac_ext <<EOF
8138 #line 8139 "configure"
8139 #include "confdefs.h"
8140 /* Override any gcc2 internal prototype to avoid an error.  */
8141 /* We use char because int might match the return type of a gcc2
8142     builtin and then its argument prototype would still apply.  */
8143 char dbm_open();
8144
8145 int main() {
8146 dbm_open()
8147 ; return 0; }
8148 EOF
8149 if { (eval echo configure:8150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8150   rm -rf conftest*
8151   eval "ac_cv_lib_$ac_lib_var=yes"
8152 else
8153   echo "configure: failed program was:" >&5
8154   cat conftest.$ac_ext >&5
8155   rm -rf conftest*
8156   eval "ac_cv_lib_$ac_lib_var=no"
8157 fi
8158 rm -f conftest*
8159 LIBS="$ac_save_LIBS"
8160
8161 fi
8162 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8163   echo "$ac_t""yes" 1>&6
8164   ol_cv_lib_ndbm=-lndbm
8165 else
8166   echo "$ac_t""no" 1>&6
8167
8168                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
8169 echo "configure:8170: checking for dbm_open in -ldbm" >&5
8170 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
8171 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8172   echo $ac_n "(cached) $ac_c" 1>&6
8173 else
8174   ac_save_LIBS="$LIBS"
8175 LIBS="-ldbm  $LIBS"
8176 cat > conftest.$ac_ext <<EOF
8177 #line 8178 "configure"
8178 #include "confdefs.h"
8179 /* Override any gcc2 internal prototype to avoid an error.  */
8180 /* We use char because int might match the return type of a gcc2
8181     builtin and then its argument prototype would still apply.  */
8182 char dbm_open();
8183
8184 int main() {
8185 dbm_open()
8186 ; return 0; }
8187 EOF
8188 if { (eval echo configure:8189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8189   rm -rf conftest*
8190   eval "ac_cv_lib_$ac_lib_var=yes"
8191 else
8192   echo "configure: failed program was:" >&5
8193   cat conftest.$ac_ext >&5
8194   rm -rf conftest*
8195   eval "ac_cv_lib_$ac_lib_var=no"
8196 fi
8197 rm -f conftest*
8198 LIBS="$ac_save_LIBS"
8199
8200 fi
8201 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8202   echo "$ac_t""yes" 1>&6
8203   ol_cv_lib_ndbm=-ldbm
8204 else
8205   echo "$ac_t""no" 1>&6
8206 ol_cv_lib_ndbm=no
8207 fi
8208                 
8209 fi
8210
8211         
8212 fi
8213
8214         LIBS="$ol_LIBS"
8215
8216 fi
8217
8218 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
8219
8220
8221  for ac_hdr in ndbm.h
8222 do
8223 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8224 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8225 echo "configure:8226: checking for $ac_hdr" >&5
8226 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8227   echo $ac_n "(cached) $ac_c" 1>&6
8228 else
8229   cat > conftest.$ac_ext <<EOF
8230 #line 8231 "configure"
8231 #include "confdefs.h"
8232 #include <$ac_hdr>
8233 EOF
8234 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8235 { (eval echo configure:8236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8236 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8237 if test -z "$ac_err"; then
8238   rm -rf conftest*
8239   eval "ac_cv_header_$ac_safe=yes"
8240 else
8241   echo "$ac_err" >&5
8242   echo "configure: failed program was:" >&5
8243   cat conftest.$ac_ext >&5
8244   rm -rf conftest*
8245   eval "ac_cv_header_$ac_safe=no"
8246 fi
8247 rm -f conftest*
8248 fi
8249 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8250   echo "$ac_t""yes" 1>&6
8251     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8252   cat >> confdefs.h <<EOF
8253 #define $ac_tr_hdr 1
8254 EOF
8255  
8256 else
8257   echo "$ac_t""no" 1>&6
8258 fi
8259 done
8260
8261  echo $ac_n "checking for db""... $ac_c" 1>&6
8262 echo "configure:8263: checking for db" >&5
8263 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
8264   echo $ac_n "(cached) $ac_c" 1>&6
8265 else
8266   
8267         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
8268                 ol_cv_ndbm=no
8269         else
8270                 ol_cv_ndbm=yes
8271         fi
8272
8273 fi
8274
8275 echo "$ac_t""$ol_cv_ndbm" 1>&6
8276  if test $ol_cv_ndbm = yes ; then
8277         cat >> confdefs.h <<\EOF
8278 #define HAVE_NDBM 1
8279 EOF
8280
8281  fi
8282
8283
8284         if test $ol_cv_ndbm = yes ; then
8285                 ol_link_ldbm=ndbm
8286                 ol_with_ldbm_api=ndbm
8287
8288                 if test $ol_cv_lib_ndbm != yes ; then
8289                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
8290                 fi
8291         fi
8292 fi
8293
8294 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
8295         echo "configure: warning: could not find suitable LDBM backend" 1>&2
8296         if test $ol_enable_ldbm = yes ; then
8297                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
8298         fi
8299
8300         echo "configure: warning: disabling LDBM" 1>&2
8301         ol_enable_ldbm=no
8302 fi
8303
8304 if test $ol_enable_wrappers != no ; then
8305         for ac_hdr in tcpd.h
8306 do
8307 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8308 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8309 echo "configure:8310: checking for $ac_hdr" >&5
8310 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8311   echo $ac_n "(cached) $ac_c" 1>&6
8312 else
8313   cat > conftest.$ac_ext <<EOF
8314 #line 8315 "configure"
8315 #include "confdefs.h"
8316 #include <$ac_hdr>
8317 EOF
8318 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8319 { (eval echo configure:8320: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8320 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8321 if test -z "$ac_err"; then
8322   rm -rf conftest*
8323   eval "ac_cv_header_$ac_safe=yes"
8324 else
8325   echo "$ac_err" >&5
8326   echo "configure: failed program was:" >&5
8327   cat conftest.$ac_ext >&5
8328   rm -rf conftest*
8329   eval "ac_cv_header_$ac_safe=no"
8330 fi
8331 rm -f conftest*
8332 fi
8333 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8334   echo "$ac_t""yes" 1>&6
8335     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8336   cat >> confdefs.h <<EOF
8337 #define $ac_tr_hdr 1
8338 EOF
8339  
8340 else
8341   echo "$ac_t""no" 1>&6
8342 fi
8343 done
8344
8345
8346         if test $ac_cv_header_tcpd_h != yes ; then
8347                 have_wrappers=no
8348         else
8349                 echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
8350 echo "configure:8351: checking for main in -lwrap" >&5
8351 ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'`
8352 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8353   echo $ac_n "(cached) $ac_c" 1>&6
8354 else
8355   ac_save_LIBS="$LIBS"
8356 LIBS="-lwrap  $LIBS"
8357 cat > conftest.$ac_ext <<EOF
8358 #line 8359 "configure"
8359 #include "confdefs.h"
8360
8361 int main() {
8362 main()
8363 ; return 0; }
8364 EOF
8365 if { (eval echo configure:8366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8366   rm -rf conftest*
8367   eval "ac_cv_lib_$ac_lib_var=yes"
8368 else
8369   echo "configure: failed program was:" >&5
8370   cat conftest.$ac_ext >&5
8371   rm -rf conftest*
8372   eval "ac_cv_lib_$ac_lib_var=no"
8373 fi
8374 rm -f conftest*
8375 LIBS="$ac_save_LIBS"
8376
8377 fi
8378 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8379   echo "$ac_t""yes" 1>&6
8380   have_wrappers=yes
8381 else
8382   echo "$ac_t""no" 1>&6
8383 have_wrappers=no
8384 fi
8385
8386         fi
8387
8388         if test $have_wrappers = yes ; then
8389                 cat >> confdefs.h <<\EOF
8390 #define HAVE_TCPD 1
8391 EOF
8392
8393                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
8394
8395                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
8396 echo "configure:8397: checking for main in -lnsl" >&5
8397 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
8398 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8399   echo $ac_n "(cached) $ac_c" 1>&6
8400 else
8401   ac_save_LIBS="$LIBS"
8402 LIBS="-lnsl  $LIBS"
8403 cat > conftest.$ac_ext <<EOF
8404 #line 8405 "configure"
8405 #include "confdefs.h"
8406
8407 int main() {
8408 main()
8409 ; return 0; }
8410 EOF
8411 if { (eval echo configure:8412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8412   rm -rf conftest*
8413   eval "ac_cv_lib_$ac_lib_var=yes"
8414 else
8415   echo "configure: failed program was:" >&5
8416   cat conftest.$ac_ext >&5
8417   rm -rf conftest*
8418   eval "ac_cv_lib_$ac_lib_var=no"
8419 fi
8420 rm -f conftest*
8421 LIBS="$ac_save_LIBS"
8422
8423 fi
8424 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8425   echo "$ac_t""yes" 1>&6
8426     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8427     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8428   cat >> confdefs.h <<EOF
8429 #define $ac_tr_lib 1
8430 EOF
8431
8432   LIBS="-lnsl $LIBS"
8433
8434 else
8435   echo "$ac_t""no" 1>&6
8436 fi
8437
8438         else
8439                 echo "configure: warning: could not find -lwrap" 1>&2
8440                 if test $ol_enable_wrappers = yes ; then
8441                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
8442                 fi
8443
8444                 echo "configure: warning: disabling wrappers support" 1>&2
8445                 ol_enable_wrappers=no
8446         fi
8447 fi
8448
8449 if test $ol_enable_syslog != no ; then
8450         echo $ac_n "checking for openlog""... $ac_c" 1>&6
8451 echo "configure:8452: checking for openlog" >&5
8452 if eval "test \"`echo '$''{'ac_cv_func_openlog'+set}'`\" = set"; then
8453   echo $ac_n "(cached) $ac_c" 1>&6
8454 else
8455   cat > conftest.$ac_ext <<EOF
8456 #line 8457 "configure"
8457 #include "confdefs.h"
8458 /* System header to define __stub macros and hopefully few prototypes,
8459     which can conflict with char openlog(); below.  */
8460 #include <assert.h>
8461 /* Override any gcc2 internal prototype to avoid an error.  */
8462 /* We use char because int might match the return type of a gcc2
8463     builtin and then its argument prototype would still apply.  */
8464 char openlog();
8465
8466 int main() {
8467
8468 /* The GNU C library defines this for functions which it implements
8469     to always fail with ENOSYS.  Some functions are actually named
8470     something starting with __ and the normal name is an alias.  */
8471 #if defined (__stub_openlog) || defined (__stub___openlog)
8472 choke me
8473 #else
8474 openlog();
8475 #endif
8476
8477 ; return 0; }
8478 EOF
8479 if { (eval echo configure:8480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8480   rm -rf conftest*
8481   eval "ac_cv_func_openlog=yes"
8482 else
8483   echo "configure: failed program was:" >&5
8484   cat conftest.$ac_ext >&5
8485   rm -rf conftest*
8486   eval "ac_cv_func_openlog=no"
8487 fi
8488 rm -f conftest*
8489 fi
8490
8491 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
8492   echo "$ac_t""yes" 1>&6
8493   :
8494 else
8495   echo "$ac_t""no" 1>&6
8496 fi
8497
8498         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
8499                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
8500         fi
8501         ol_enable_syslog=$ac_cv_func_openlog
8502 fi
8503
8504 if test $ol_enable_dmalloc != no ; then
8505         for ac_hdr in dmalloc.h
8506 do
8507 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8508 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8509 echo "configure:8510: checking for $ac_hdr" >&5
8510 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8511   echo $ac_n "(cached) $ac_c" 1>&6
8512 else
8513   cat > conftest.$ac_ext <<EOF
8514 #line 8515 "configure"
8515 #include "confdefs.h"
8516 #include <$ac_hdr>
8517 EOF
8518 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8519 { (eval echo configure:8520: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8520 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8521 if test -z "$ac_err"; then
8522   rm -rf conftest*
8523   eval "ac_cv_header_$ac_safe=yes"
8524 else
8525   echo "$ac_err" >&5
8526   echo "configure: failed program was:" >&5
8527   cat conftest.$ac_ext >&5
8528   rm -rf conftest*
8529   eval "ac_cv_header_$ac_safe=no"
8530 fi
8531 rm -f conftest*
8532 fi
8533 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8534   echo "$ac_t""yes" 1>&6
8535     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8536   cat >> confdefs.h <<EOF
8537 #define $ac_tr_hdr 1
8538 EOF
8539  
8540 else
8541   echo "$ac_t""no" 1>&6
8542 fi
8543 done
8544
8545         echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
8546 echo "configure:8547: checking for dmalloc_shutdown in -ldmalloc" >&5
8547 ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-%__p_%'`
8548 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8549   echo $ac_n "(cached) $ac_c" 1>&6
8550 else
8551   ac_save_LIBS="$LIBS"
8552 LIBS="-ldmalloc  $LIBS"
8553 cat > conftest.$ac_ext <<EOF
8554 #line 8555 "configure"
8555 #include "confdefs.h"
8556 /* Override any gcc2 internal prototype to avoid an error.  */
8557 /* We use char because int might match the return type of a gcc2
8558     builtin and then its argument prototype would still apply.  */
8559 char dmalloc_shutdown();
8560
8561 int main() {
8562 dmalloc_shutdown()
8563 ; return 0; }
8564 EOF
8565 if { (eval echo configure:8566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8566   rm -rf conftest*
8567   eval "ac_cv_lib_$ac_lib_var=yes"
8568 else
8569   echo "configure: failed program was:" >&5
8570   cat conftest.$ac_ext >&5
8571   rm -rf conftest*
8572   eval "ac_cv_lib_$ac_lib_var=no"
8573 fi
8574 rm -f conftest*
8575 LIBS="$ac_save_LIBS"
8576
8577 fi
8578 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8579   echo "$ac_t""yes" 1>&6
8580     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8581     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8582   cat >> confdefs.h <<EOF
8583 #define $ac_tr_lib 1
8584 EOF
8585
8586   LIBS="-ldmalloc $LIBS"
8587
8588 else
8589   echo "$ac_t""no" 1>&6
8590 fi
8591
8592 fi
8593
8594 if test $ol_enable_tcl != no ; then
8595         for ac_hdr in tcl.h
8596 do
8597 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8598 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8599 echo "configure:8600: checking for $ac_hdr" >&5
8600 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8601   echo $ac_n "(cached) $ac_c" 1>&6
8602 else
8603   cat > conftest.$ac_ext <<EOF
8604 #line 8605 "configure"
8605 #include "confdefs.h"
8606 #include <$ac_hdr>
8607 EOF
8608 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8609 { (eval echo configure:8610: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8610 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8611 if test -z "$ac_err"; then
8612   rm -rf conftest*
8613   eval "ac_cv_header_$ac_safe=yes"
8614 else
8615   echo "$ac_err" >&5
8616   echo "configure: failed program was:" >&5
8617   cat conftest.$ac_ext >&5
8618   rm -rf conftest*
8619   eval "ac_cv_header_$ac_safe=no"
8620 fi
8621 rm -f conftest*
8622 fi
8623 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8624   echo "$ac_t""yes" 1>&6
8625     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8626   cat >> confdefs.h <<EOF
8627 #define $ac_tr_hdr 1
8628 EOF
8629  
8630 else
8631   echo "$ac_t""no" 1>&6
8632 fi
8633 done
8634
8635
8636         if test $ac_cv_header_tcl_h != yes ; then
8637                 have_tcl=no
8638         else
8639                 echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6
8640 echo "configure:8641: checking for main in -ltcl" >&5
8641 ac_lib_var=`echo tcl'_'main | sed 'y%./+-%__p_%'`
8642 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8643   echo $ac_n "(cached) $ac_c" 1>&6
8644 else
8645   ac_save_LIBS="$LIBS"
8646 LIBS="-ltcl  $LIBS"
8647 cat > conftest.$ac_ext <<EOF
8648 #line 8649 "configure"
8649 #include "confdefs.h"
8650
8651 int main() {
8652 main()
8653 ; return 0; }
8654 EOF
8655 if { (eval echo configure:8656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8656   rm -rf conftest*
8657   eval "ac_cv_lib_$ac_lib_var=yes"
8658 else
8659   echo "configure: failed program was:" >&5
8660   cat conftest.$ac_ext >&5
8661   rm -rf conftest*
8662   eval "ac_cv_lib_$ac_lib_var=no"
8663 fi
8664 rm -f conftest*
8665 LIBS="$ac_save_LIBS"
8666
8667 fi
8668 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8669   echo "$ac_t""yes" 1>&6
8670   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"
8671 else
8672   echo "$ac_t""no" 1>&6
8673 have_tcl=no
8674 fi
8675
8676
8677                 if test $have_tcl != yes; then
8678                         echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6
8679 echo "configure:8680: checking for main in -ltcl7.6" >&5
8680 ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-%__p_%'`
8681 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8682   echo $ac_n "(cached) $ac_c" 1>&6
8683 else
8684   ac_save_LIBS="$LIBS"
8685 LIBS="-ltcl7.6  $LIBS"
8686 cat > conftest.$ac_ext <<EOF
8687 #line 8688 "configure"
8688 #include "confdefs.h"
8689
8690 int main() {
8691 main()
8692 ; return 0; }
8693 EOF
8694 if { (eval echo configure:8695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8695   rm -rf conftest*
8696   eval "ac_cv_lib_$ac_lib_var=yes"
8697 else
8698   echo "configure: failed program was:" >&5
8699   cat conftest.$ac_ext >&5
8700   rm -rf conftest*
8701   eval "ac_cv_lib_$ac_lib_var=no"
8702 fi
8703 rm -f conftest*
8704 LIBS="$ac_save_LIBS"
8705
8706 fi
8707 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8708   echo "$ac_t""yes" 1>&6
8709   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"
8710 else
8711   echo "$ac_t""no" 1>&6
8712 have_tcl=no
8713 fi
8714
8715                 fi
8716
8717                 if test $have_tcl != yes; then
8718                         echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6
8719 echo "configure:8720: checking for main in -ltcl8.0" >&5
8720 ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-%__p_%'`
8721 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8722   echo $ac_n "(cached) $ac_c" 1>&6
8723 else
8724   ac_save_LIBS="$LIBS"
8725 LIBS="-ltcl8.0  $LIBS"
8726 cat > conftest.$ac_ext <<EOF
8727 #line 8728 "configure"
8728 #include "confdefs.h"
8729
8730 int main() {
8731 main()
8732 ; return 0; }
8733 EOF
8734 if { (eval echo configure:8735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8735   rm -rf conftest*
8736   eval "ac_cv_lib_$ac_lib_var=yes"
8737 else
8738   echo "configure: failed program was:" >&5
8739   cat conftest.$ac_ext >&5
8740   rm -rf conftest*
8741   eval "ac_cv_lib_$ac_lib_var=no"
8742 fi
8743 rm -f conftest*
8744 LIBS="$ac_save_LIBS"
8745
8746 fi
8747 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8748   echo "$ac_t""yes" 1>&6
8749   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"
8750 else
8751   echo "$ac_t""no" 1>&6
8752 have_tcl=no
8753 fi
8754
8755                 fi
8756         fi
8757
8758         if test $have_tcl != yes ; then
8759                 echo "configure: warning: could not find -ltcl" 1>&2
8760                 if test $ol_enable_tcl = yes ; then
8761                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
8762                 fi
8763
8764                 ol_enable_tcl=no
8765         fi
8766 fi
8767
8768 # ud needs termcap (should insert check here)
8769 ol_link_termcap=no
8770 for ac_hdr in termcap.h ncurses.h
8771 do
8772 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8773 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8774 echo "configure:8775: checking for $ac_hdr" >&5
8775 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8776   echo $ac_n "(cached) $ac_c" 1>&6
8777 else
8778   cat > conftest.$ac_ext <<EOF
8779 #line 8780 "configure"
8780 #include "confdefs.h"
8781 #include <$ac_hdr>
8782 EOF
8783 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8784 { (eval echo configure:8785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8785 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8786 if test -z "$ac_err"; then
8787   rm -rf conftest*
8788   eval "ac_cv_header_$ac_safe=yes"
8789 else
8790   echo "$ac_err" >&5
8791   echo "configure: failed program was:" >&5
8792   cat conftest.$ac_ext >&5
8793   rm -rf conftest*
8794   eval "ac_cv_header_$ac_safe=no"
8795 fi
8796 rm -f conftest*
8797 fi
8798 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8799   echo "$ac_t""yes" 1>&6
8800     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8801   cat >> confdefs.h <<EOF
8802 #define $ac_tr_hdr 1
8803 EOF
8804  
8805 else
8806   echo "$ac_t""no" 1>&6
8807 fi
8808 done
8809
8810
8811 if test $ol_link_termcap = no ; then
8812         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
8813 echo "configure:8814: checking for tputs in -ltermcap" >&5
8814 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
8815 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8816   echo $ac_n "(cached) $ac_c" 1>&6
8817 else
8818   ac_save_LIBS="$LIBS"
8819 LIBS="-ltermcap  $LIBS"
8820 cat > conftest.$ac_ext <<EOF
8821 #line 8822 "configure"
8822 #include "confdefs.h"
8823 /* Override any gcc2 internal prototype to avoid an error.  */
8824 /* We use char because int might match the return type of a gcc2
8825     builtin and then its argument prototype would still apply.  */
8826 char tputs();
8827
8828 int main() {
8829 tputs()
8830 ; return 0; }
8831 EOF
8832 if { (eval echo configure:8833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8833   rm -rf conftest*
8834   eval "ac_cv_lib_$ac_lib_var=yes"
8835 else
8836   echo "configure: failed program was:" >&5
8837   cat conftest.$ac_ext >&5
8838   rm -rf conftest*
8839   eval "ac_cv_lib_$ac_lib_var=no"
8840 fi
8841 rm -f conftest*
8842 LIBS="$ac_save_LIBS"
8843
8844 fi
8845 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8846   echo "$ac_t""yes" 1>&6
8847   have_termcap=yes
8848 else
8849   echo "$ac_t""no" 1>&6
8850 have_termcap=no
8851 fi
8852
8853         if test $have_termcap = yes ; then
8854                 cat >> confdefs.h <<\EOF
8855 #define HAVE_TERMCAP 1
8856 EOF
8857
8858                 ol_link_termcap=yes
8859                 TERMCAP_LIBS=-ltermcap
8860         fi
8861 fi
8862
8863 if test $ol_link_termcap = no ; then
8864         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
8865 echo "configure:8866: checking for initscr in -lncurses" >&5
8866 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
8867 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8868   echo $ac_n "(cached) $ac_c" 1>&6
8869 else
8870   ac_save_LIBS="$LIBS"
8871 LIBS="-lncurses  $LIBS"
8872 cat > conftest.$ac_ext <<EOF
8873 #line 8874 "configure"
8874 #include "confdefs.h"
8875 /* Override any gcc2 internal prototype to avoid an error.  */
8876 /* We use char because int might match the return type of a gcc2
8877     builtin and then its argument prototype would still apply.  */
8878 char initscr();
8879
8880 int main() {
8881 initscr()
8882 ; return 0; }
8883 EOF
8884 if { (eval echo configure:8885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8885   rm -rf conftest*
8886   eval "ac_cv_lib_$ac_lib_var=yes"
8887 else
8888   echo "configure: failed program was:" >&5
8889   cat conftest.$ac_ext >&5
8890   rm -rf conftest*
8891   eval "ac_cv_lib_$ac_lib_var=no"
8892 fi
8893 rm -f conftest*
8894 LIBS="$ac_save_LIBS"
8895
8896 fi
8897 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8898   echo "$ac_t""yes" 1>&6
8899   have_ncurses=yes
8900 else
8901   echo "$ac_t""no" 1>&6
8902 have_ncurses=no
8903 fi
8904
8905         if test $have_ncurses = yes ; then
8906                 cat >> confdefs.h <<\EOF
8907 #define HAVE_NCURSES 1
8908 EOF
8909
8910                 ol_link_termcap=yes
8911                 TERMCAP_LIBS=-lncurses
8912         fi
8913 fi
8914
8915 if test $ol_link_termcap = no ; then
8916         cat >> confdefs.h <<\EOF
8917 #define NO_TERMCAP 1
8918 EOF
8919
8920         TERMCAP_LIBS=
8921 fi
8922
8923 ol_link_readline=no
8924 if test $ol_with_readline != no ; then
8925         for ac_hdr in readline/readline.h readline/history.h
8926 do
8927 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8928 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8929 echo "configure:8930: checking for $ac_hdr" >&5
8930 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8931   echo $ac_n "(cached) $ac_c" 1>&6
8932 else
8933   cat > conftest.$ac_ext <<EOF
8934 #line 8935 "configure"
8935 #include "confdefs.h"
8936 #include <$ac_hdr>
8937 EOF
8938 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8939 { (eval echo configure:8940: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8940 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8941 if test -z "$ac_err"; then
8942   rm -rf conftest*
8943   eval "ac_cv_header_$ac_safe=yes"
8944 else
8945   echo "$ac_err" >&5
8946   echo "configure: failed program was:" >&5
8947   cat conftest.$ac_ext >&5
8948   rm -rf conftest*
8949   eval "ac_cv_header_$ac_safe=no"
8950 fi
8951 rm -f conftest*
8952 fi
8953 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8954   echo "$ac_t""yes" 1>&6
8955     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8956   cat >> confdefs.h <<EOF
8957 #define $ac_tr_hdr 1
8958 EOF
8959  
8960 else
8961   echo "$ac_t""no" 1>&6
8962 fi
8963 done
8964
8965
8966         if test $ac_cv_header_readline_readline_h = yes ; then
8967                 save_LIBS="$LIBS"
8968                 LIBS="$TERMCAP_LIBS $LIBS"
8969                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
8970 echo "configure:8971: checking for readline in -lreadline" >&5
8971 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`
8972 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8973   echo $ac_n "(cached) $ac_c" 1>&6
8974 else
8975   ac_save_LIBS="$LIBS"
8976 LIBS="-lreadline  $LIBS"
8977 cat > conftest.$ac_ext <<EOF
8978 #line 8979 "configure"
8979 #include "confdefs.h"
8980 /* Override any gcc2 internal prototype to avoid an error.  */
8981 /* We use char because int might match the return type of a gcc2
8982     builtin and then its argument prototype would still apply.  */
8983 char readline();
8984
8985 int main() {
8986 readline()
8987 ; return 0; }
8988 EOF
8989 if { (eval echo configure:8990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8990   rm -rf conftest*
8991   eval "ac_cv_lib_$ac_lib_var=yes"
8992 else
8993   echo "configure: failed program was:" >&5
8994   cat conftest.$ac_ext >&5
8995   rm -rf conftest*
8996   eval "ac_cv_lib_$ac_lib_var=no"
8997 fi
8998 rm -f conftest*
8999 LIBS="$ac_save_LIBS"
9000
9001 fi
9002 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9003   echo "$ac_t""yes" 1>&6
9004   have_readline=yes
9005 else
9006   echo "$ac_t""no" 1>&6
9007 have_readline=no
9008 fi
9009
9010                 LIBS="$save_LIBS"
9011                         
9012                 if test $have_readline = yes ; then
9013                         ol_with_readline=found
9014                         ol_link_readline=yes
9015
9016                         READLINE_LIBS="-lreadline"
9017                 fi
9018         fi
9019 fi
9020
9021 if test $ol_link_readline = yes ; then
9022         cat >> confdefs.h <<\EOF
9023 #define HAVE_READLINE 1
9024 EOF
9025
9026 fi
9027
9028
9029 # FreeBSD (and others) have crypt(3) in -lcrypt
9030 if test $ol_enable_crypt != no ; then
9031         echo $ac_n "checking for crypt""... $ac_c" 1>&6
9032 echo "configure:9033: checking for crypt" >&5
9033 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
9034   echo $ac_n "(cached) $ac_c" 1>&6
9035 else
9036   cat > conftest.$ac_ext <<EOF
9037 #line 9038 "configure"
9038 #include "confdefs.h"
9039 /* System header to define __stub macros and hopefully few prototypes,
9040     which can conflict with char crypt(); below.  */
9041 #include <assert.h>
9042 /* Override any gcc2 internal prototype to avoid an error.  */
9043 /* We use char because int might match the return type of a gcc2
9044     builtin and then its argument prototype would still apply.  */
9045 char crypt();
9046
9047 int main() {
9048
9049 /* The GNU C library defines this for functions which it implements
9050     to always fail with ENOSYS.  Some functions are actually named
9051     something starting with __ and the normal name is an alias.  */
9052 #if defined (__stub_crypt) || defined (__stub___crypt)
9053 choke me
9054 #else
9055 crypt();
9056 #endif
9057
9058 ; return 0; }
9059 EOF
9060 if { (eval echo configure:9061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9061   rm -rf conftest*
9062   eval "ac_cv_func_crypt=yes"
9063 else
9064   echo "configure: failed program was:" >&5
9065   cat conftest.$ac_ext >&5
9066   rm -rf conftest*
9067   eval "ac_cv_func_crypt=no"
9068 fi
9069 rm -f conftest*
9070 fi
9071
9072 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
9073   echo "$ac_t""yes" 1>&6
9074   have_crypt=yes
9075 else
9076   echo "$ac_t""no" 1>&6
9077
9078                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
9079 echo "configure:9080: checking for crypt in -lcrypt" >&5
9080 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
9081 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9082   echo $ac_n "(cached) $ac_c" 1>&6
9083 else
9084   ac_save_LIBS="$LIBS"
9085 LIBS="-lcrypt  $LIBS"
9086 cat > conftest.$ac_ext <<EOF
9087 #line 9088 "configure"
9088 #include "confdefs.h"
9089 /* Override any gcc2 internal prototype to avoid an error.  */
9090 /* We use char because int might match the return type of a gcc2
9091     builtin and then its argument prototype would still apply.  */
9092 char crypt();
9093
9094 int main() {
9095 crypt()
9096 ; return 0; }
9097 EOF
9098 if { (eval echo configure:9099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9099   rm -rf conftest*
9100   eval "ac_cv_lib_$ac_lib_var=yes"
9101 else
9102   echo "configure: failed program was:" >&5
9103   cat conftest.$ac_ext >&5
9104   rm -rf conftest*
9105   eval "ac_cv_lib_$ac_lib_var=no"
9106 fi
9107 rm -f conftest*
9108 LIBS="$ac_save_LIBS"
9109
9110 fi
9111 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9112   echo "$ac_t""yes" 1>&6
9113   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
9114                         have_crypt=yes
9115 else
9116   echo "$ac_t""no" 1>&6
9117 have_crypt=no
9118 fi
9119
9120 fi
9121
9122
9123         if test $have_crypt = yes ; then
9124                 cat >> confdefs.h <<\EOF
9125 #define HAVE_CRYPT 1
9126 EOF
9127
9128         else
9129                 echo "configure: warning: could not find crypt" 1>&2
9130                 if test $ol_enable_crypt = yes ; then
9131                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
9132                 fi
9133
9134                 echo "configure: warning: disabling crypt support" 1>&2
9135                 ol_enable_crypt=no
9136         fi
9137 fi
9138
9139 # FreeBSD (and others) have setproctitle(3) in -lutil
9140 if test $ol_enable_proctitle != no ; then
9141         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
9142 echo "configure:9143: checking for setproctitle" >&5
9143 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
9144   echo $ac_n "(cached) $ac_c" 1>&6
9145 else
9146   cat > conftest.$ac_ext <<EOF
9147 #line 9148 "configure"
9148 #include "confdefs.h"
9149 /* System header to define __stub macros and hopefully few prototypes,
9150     which can conflict with char setproctitle(); below.  */
9151 #include <assert.h>
9152 /* Override any gcc2 internal prototype to avoid an error.  */
9153 /* We use char because int might match the return type of a gcc2
9154     builtin and then its argument prototype would still apply.  */
9155 char setproctitle();
9156
9157 int main() {
9158
9159 /* The GNU C library defines this for functions which it implements
9160     to always fail with ENOSYS.  Some functions are actually named
9161     something starting with __ and the normal name is an alias.  */
9162 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
9163 choke me
9164 #else
9165 setproctitle();
9166 #endif
9167
9168 ; return 0; }
9169 EOF
9170 if { (eval echo configure:9171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9171   rm -rf conftest*
9172   eval "ac_cv_func_setproctitle=yes"
9173 else
9174   echo "configure: failed program was:" >&5
9175   cat conftest.$ac_ext >&5
9176   rm -rf conftest*
9177   eval "ac_cv_func_setproctitle=no"
9178 fi
9179 rm -f conftest*
9180 fi
9181
9182 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
9183   echo "$ac_t""yes" 1>&6
9184   have_setproctitle=yes
9185 else
9186   echo "$ac_t""no" 1>&6
9187
9188                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
9189 echo "configure:9190: checking for setproctitle in -lutil" >&5
9190 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
9191 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9192   echo $ac_n "(cached) $ac_c" 1>&6
9193 else
9194   ac_save_LIBS="$LIBS"
9195 LIBS="-lutil  $LIBS"
9196 cat > conftest.$ac_ext <<EOF
9197 #line 9198 "configure"
9198 #include "confdefs.h"
9199 /* Override any gcc2 internal prototype to avoid an error.  */
9200 /* We use char because int might match the return type of a gcc2
9201     builtin and then its argument prototype would still apply.  */
9202 char setproctitle();
9203
9204 int main() {
9205 setproctitle()
9206 ; return 0; }
9207 EOF
9208 if { (eval echo configure:9209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9209   rm -rf conftest*
9210   eval "ac_cv_lib_$ac_lib_var=yes"
9211 else
9212   echo "configure: failed program was:" >&5
9213   cat conftest.$ac_ext >&5
9214   rm -rf conftest*
9215   eval "ac_cv_lib_$ac_lib_var=no"
9216 fi
9217 rm -f conftest*
9218 LIBS="$ac_save_LIBS"
9219
9220 fi
9221 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9222   echo "$ac_t""yes" 1>&6
9223   have_setproctitle=yes
9224                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
9225 else
9226   echo "$ac_t""no" 1>&6
9227 have_setproctitle=no
9228                         LIBOBJS="$LIBOBJS setproctitle.o"
9229 fi
9230
9231 fi
9232
9233
9234         if test $have_setproctitle = yes ; then
9235                 cat >> confdefs.h <<\EOF
9236 #define HAVE_SETPROCTITLE 1
9237 EOF
9238
9239         fi
9240 fi
9241
9242 # test for EBCDIC
9243 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
9244 echo "configure:9245: checking for EBCDIC" >&5
9245 if eval "test \"`echo '$''{'ol_cv_cpp_ebcdic'+set}'`\" = set"; then
9246   echo $ac_n "(cached) $ac_c" 1>&6
9247 else
9248   
9249         cat > conftest.$ac_ext <<EOF
9250 #line 9251 "configure"
9251 #include "confdefs.h"
9252
9253 #if !('M' == 0xd4)
9254 #include <__ASCII__/generate_error.h>
9255 #endif
9256
9257 EOF
9258 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9259 { (eval echo configure:9260: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9260 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9261 if test -z "$ac_err"; then
9262   rm -rf conftest*
9263   ol_cv_cpp_ebcdic=yes
9264 else
9265   echo "$ac_err" >&5
9266   echo "configure: failed program was:" >&5
9267   cat conftest.$ac_ext >&5
9268   rm -rf conftest*
9269   ol_cv_cpp_ebcdic=no
9270 fi
9271 rm -f conftest*
9272 fi
9273
9274 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
9275 if test $ol_cv_cpp_ebcdic = yes ; then
9276         cat >> confdefs.h <<\EOF
9277 #define HAVE_EBCDIC 1
9278 EOF
9279
9280 fi
9281
9282 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
9283 echo "configure:9284: checking for ANSI C header files" >&5
9284 if eval "test \"`echo '$''{'ol_cv_header_stdc'+set}'`\" = set"; then
9285   echo $ac_n "(cached) $ac_c" 1>&6
9286 else
9287   cat > conftest.$ac_ext <<EOF
9288 #line 9289 "configure"
9289 #include "confdefs.h"
9290 #include <stdlib.h>
9291 #include <stdarg.h>
9292 #include <string.h>
9293 #include <float.h>
9294 EOF
9295 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9296 { (eval echo configure:9297: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9297 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9298 if test -z "$ac_err"; then
9299   rm -rf conftest*
9300   ol_cv_header_stdc=yes
9301 else
9302   echo "$ac_err" >&5
9303   echo "configure: failed program was:" >&5
9304   cat conftest.$ac_ext >&5
9305   rm -rf conftest*
9306   ol_cv_header_stdc=no
9307 fi
9308 rm -f conftest*
9309
9310 if test $ol_cv_header_stdc = yes; then
9311   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
9312 cat > conftest.$ac_ext <<EOF
9313 #line 9314 "configure"
9314 #include "confdefs.h"
9315 #include <string.h>
9316 EOF
9317 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9318   egrep "memchr" >/dev/null 2>&1; then
9319   :
9320 else
9321   rm -rf conftest*
9322   ol_cv_header_stdc=no
9323 fi
9324 rm -f conftest*
9325
9326 fi
9327
9328 if test $ol_cv_header_stdc = yes; then
9329   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
9330 cat > conftest.$ac_ext <<EOF
9331 #line 9332 "configure"
9332 #include "confdefs.h"
9333 #include <stdlib.h>
9334 EOF
9335 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9336   egrep "free" >/dev/null 2>&1; then
9337   :
9338 else
9339   rm -rf conftest*
9340   ol_cv_header_stdc=no
9341 fi
9342 rm -f conftest*
9343
9344 fi
9345
9346 if test $ol_cv_header_stdc = yes; then
9347   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
9348 if test "$cross_compiling" = yes; then
9349   :
9350 else
9351   cat > conftest.$ac_ext <<EOF
9352 #line 9353 "configure"
9353 #include "confdefs.h"
9354 #include <ctype.h>
9355 #ifndef HAVE_EBCDIC
9356 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
9357 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
9358 #else
9359 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
9360                 || ('j' <= (c) && (c) <= 'r') \
9361                 || ('s' <= (c) && (c) <= 'z'))
9362 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
9363 #endif
9364 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
9365 int main () { int i; for (i = 0; i < 256; i++)
9366 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
9367 exit (0); }
9368
9369 EOF
9370 if { (eval echo configure:9371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9371 then
9372   :
9373 else
9374   echo "configure: failed program was:" >&5
9375   cat conftest.$ac_ext >&5
9376   rm -fr conftest*
9377   ol_cv_header_stdc=no
9378 fi
9379 rm -fr conftest*
9380 fi
9381
9382 fi
9383 fi
9384
9385 echo "$ac_t""$ol_cv_header_stdc" 1>&6
9386 if test $ol_cv_header_stdc = yes; then
9387   cat >> confdefs.h <<\EOF
9388 #define STDC_HEADERS 1
9389 EOF
9390
9391 fi
9392 ac_cv_header_stdc=disable
9393
9394
9395 if test $ol_cv_header_stdc != yes; then
9396         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
9397 fi
9398
9399 ac_header_dirent=no
9400 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
9401 do
9402 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9403 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
9404 echo "configure:9405: checking for $ac_hdr that defines DIR" >&5
9405 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
9406   echo $ac_n "(cached) $ac_c" 1>&6
9407 else
9408   cat > conftest.$ac_ext <<EOF
9409 #line 9410 "configure"
9410 #include "confdefs.h"
9411 #include <sys/types.h>
9412 #include <$ac_hdr>
9413 int main() {
9414 DIR *dirp = 0;
9415 ; return 0; }
9416 EOF
9417 if { (eval echo configure:9418: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9418   rm -rf conftest*
9419   eval "ac_cv_header_dirent_$ac_safe=yes"
9420 else
9421   echo "configure: failed program was:" >&5
9422   cat conftest.$ac_ext >&5
9423   rm -rf conftest*
9424   eval "ac_cv_header_dirent_$ac_safe=no"
9425 fi
9426 rm -f conftest*
9427 fi
9428 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
9429   echo "$ac_t""yes" 1>&6
9430     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9431   cat >> confdefs.h <<EOF
9432 #define $ac_tr_hdr 1
9433 EOF
9434  ac_header_dirent=$ac_hdr; break
9435 else
9436   echo "$ac_t""no" 1>&6
9437 fi
9438 done
9439 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
9440 if test $ac_header_dirent = dirent.h; then
9441 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
9442 echo "configure:9443: checking for opendir in -ldir" >&5
9443 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
9444 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9445   echo $ac_n "(cached) $ac_c" 1>&6
9446 else
9447   ac_save_LIBS="$LIBS"
9448 LIBS="-ldir  $LIBS"
9449 cat > conftest.$ac_ext <<EOF
9450 #line 9451 "configure"
9451 #include "confdefs.h"
9452 /* Override any gcc2 internal prototype to avoid an error.  */
9453 /* We use char because int might match the return type of a gcc2
9454     builtin and then its argument prototype would still apply.  */
9455 char opendir();
9456
9457 int main() {
9458 opendir()
9459 ; return 0; }
9460 EOF
9461 if { (eval echo configure:9462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9462   rm -rf conftest*
9463   eval "ac_cv_lib_$ac_lib_var=yes"
9464 else
9465   echo "configure: failed program was:" >&5
9466   cat conftest.$ac_ext >&5
9467   rm -rf conftest*
9468   eval "ac_cv_lib_$ac_lib_var=no"
9469 fi
9470 rm -f conftest*
9471 LIBS="$ac_save_LIBS"
9472
9473 fi
9474 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9475   echo "$ac_t""yes" 1>&6
9476   LIBS="$LIBS -ldir"
9477 else
9478   echo "$ac_t""no" 1>&6
9479 fi
9480
9481 else
9482 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
9483 echo "configure:9484: checking for opendir in -lx" >&5
9484 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
9485 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9486   echo $ac_n "(cached) $ac_c" 1>&6
9487 else
9488   ac_save_LIBS="$LIBS"
9489 LIBS="-lx  $LIBS"
9490 cat > conftest.$ac_ext <<EOF
9491 #line 9492 "configure"
9492 #include "confdefs.h"
9493 /* Override any gcc2 internal prototype to avoid an error.  */
9494 /* We use char because int might match the return type of a gcc2
9495     builtin and then its argument prototype would still apply.  */
9496 char opendir();
9497
9498 int main() {
9499 opendir()
9500 ; return 0; }
9501 EOF
9502 if { (eval echo configure:9503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9503   rm -rf conftest*
9504   eval "ac_cv_lib_$ac_lib_var=yes"
9505 else
9506   echo "configure: failed program was:" >&5
9507   cat conftest.$ac_ext >&5
9508   rm -rf conftest*
9509   eval "ac_cv_lib_$ac_lib_var=no"
9510 fi
9511 rm -f conftest*
9512 LIBS="$ac_save_LIBS"
9513
9514 fi
9515 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9516   echo "$ac_t""yes" 1>&6
9517   LIBS="$LIBS -lx"
9518 else
9519   echo "$ac_t""no" 1>&6
9520 fi
9521
9522 fi
9523
9524 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
9525 echo "configure:9526: checking for sys/wait.h that is POSIX.1 compatible" >&5
9526 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
9527   echo $ac_n "(cached) $ac_c" 1>&6
9528 else
9529   cat > conftest.$ac_ext <<EOF
9530 #line 9531 "configure"
9531 #include "confdefs.h"
9532 #include <sys/types.h>
9533 #include <sys/wait.h>
9534 #ifndef WEXITSTATUS
9535 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
9536 #endif
9537 #ifndef WIFEXITED
9538 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
9539 #endif
9540 int main() {
9541 int s;
9542 wait (&s);
9543 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
9544 ; return 0; }
9545 EOF
9546 if { (eval echo configure:9547: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9547   rm -rf conftest*
9548   ac_cv_header_sys_wait_h=yes
9549 else
9550   echo "configure: failed program was:" >&5
9551   cat conftest.$ac_ext >&5
9552   rm -rf conftest*
9553   ac_cv_header_sys_wait_h=no
9554 fi
9555 rm -f conftest*
9556 fi
9557
9558 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
9559 if test $ac_cv_header_sys_wait_h = yes; then
9560   cat >> confdefs.h <<\EOF
9561 #define HAVE_SYS_WAIT_H 1
9562 EOF
9563
9564 fi
9565
9566 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
9567 echo "configure:9568: checking POSIX termios" >&5
9568 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
9569   echo $ac_n "(cached) $ac_c" 1>&6
9570 else
9571   cat > conftest.$ac_ext <<EOF
9572 #line 9573 "configure"
9573 #include "confdefs.h"
9574 #include <sys/types.h>
9575 #include <unistd.h>
9576 #include <termios.h>
9577 int main() {
9578 /* SunOS 4.0.3 has termios.h but not the library calls.  */
9579    tcgetattr(0, 0);
9580 ; return 0; }
9581 EOF
9582 if { (eval echo configure:9583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9583   rm -rf conftest*
9584   am_cv_sys_posix_termios=yes
9585 else
9586   echo "configure: failed program was:" >&5
9587   cat conftest.$ac_ext >&5
9588   rm -rf conftest*
9589   am_cv_sys_posix_termios=no
9590 fi
9591 rm -f conftest*
9592 fi
9593
9594 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
9595
9596
9597  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
9598 echo "configure:9599: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
9599 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
9600   echo $ac_n "(cached) $ac_c" 1>&6
9601 else
9602   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
9603
9604   gwinsz_in_termios_h=no
9605   if test $am_cv_sys_posix_termios = yes; then
9606     cat > conftest.$ac_ext <<EOF
9607 #line 9608 "configure"
9608 #include "confdefs.h"
9609 #include <sys/types.h>
9610 #     include <termios.h>
9611 #     ifdef TIOCGWINSZ
9612         yes
9613 #     endif
9614     
9615 EOF
9616 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9617   egrep "yes" >/dev/null 2>&1; then
9618   rm -rf conftest*
9619   gwinsz_in_termios_h=yes
9620 fi
9621 rm -f conftest*
9622
9623   fi
9624
9625   if test $gwinsz_in_termios_h = no; then
9626     cat > conftest.$ac_ext <<EOF
9627 #line 9628 "configure"
9628 #include "confdefs.h"
9629 #include <sys/types.h>
9630 #     include <sys/ioctl.h>
9631 #     ifdef TIOCGWINSZ
9632         yes
9633 #     endif
9634     
9635 EOF
9636 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9637   egrep "yes" >/dev/null 2>&1; then
9638   rm -rf conftest*
9639   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
9640 fi
9641 rm -f conftest*
9642
9643   fi
9644   
9645 fi
9646
9647 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
9648   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
9649     cat >> confdefs.h <<\EOF
9650 #define GWINSZ_IN_SYS_IOCTL 1
9651 EOF
9652
9653   fi
9654
9655 if test $am_cv_sys_posix_termios = yes ; then
9656         cat >> confdefs.h <<\EOF
9657 #define HAVE_POSIX_TERMIOS 1
9658 EOF
9659
9660 fi
9661
9662 for ac_hdr in \
9663         arpa/inet.h             \
9664         arpa/nameser.h  \
9665         assert.h                \
9666         crypt.h                 \
9667         errno.h                 \
9668         fcntl.h                 \
9669         filio.h                 \
9670         getopt.h                \
9671         grp.h                   \
9672         libutil.h               \
9673         limits.h                \
9674         locale.h                \
9675         malloc.h                \
9676         memory.h                \
9677         regex.h                 \
9678         psap.h                  \
9679         pwd.h                   \
9680         resolv.h                \
9681         sgtty.h                 \
9682         stdarg.h                \
9683         stddef.h                \
9684         string.h                \
9685         strings.h               \
9686         sysexits.h              \
9687         sys/file.h              \
9688         sys/filio.h             \
9689         sys/errno.h             \
9690         sys/ioctl.h             \
9691         sys/param.h             \
9692         sys/resource.h  \
9693         sys/select.h    \
9694         sys/socket.h    \
9695         sys/syslog.h    \
9696         sys/time.h              \
9697         sys/types.h             \
9698         syslog.h                \
9699         termios.h               \
9700         unistd.h                \
9701
9702 do
9703 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9704 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9705 echo "configure:9706: checking for $ac_hdr" >&5
9706 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9707   echo $ac_n "(cached) $ac_c" 1>&6
9708 else
9709   cat > conftest.$ac_ext <<EOF
9710 #line 9711 "configure"
9711 #include "confdefs.h"
9712 #include <$ac_hdr>
9713 EOF
9714 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9715 { (eval echo configure:9716: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9716 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9717 if test -z "$ac_err"; then
9718   rm -rf conftest*
9719   eval "ac_cv_header_$ac_safe=yes"
9720 else
9721   echo "$ac_err" >&5
9722   echo "configure: failed program was:" >&5
9723   cat conftest.$ac_ext >&5
9724   rm -rf conftest*
9725   eval "ac_cv_header_$ac_safe=no"
9726 fi
9727 rm -f conftest*
9728 fi
9729 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9730   echo "$ac_t""yes" 1>&6
9731     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9732   cat >> confdefs.h <<EOF
9733 #define $ac_tr_hdr 1
9734 EOF
9735  
9736 else
9737   echo "$ac_t""no" 1>&6
9738 fi
9739 done
9740
9741
9742 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
9743 echo "configure:9744: checking for uid_t in sys/types.h" >&5
9744 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
9745   echo $ac_n "(cached) $ac_c" 1>&6
9746 else
9747   cat > conftest.$ac_ext <<EOF
9748 #line 9749 "configure"
9749 #include "confdefs.h"
9750 #include <sys/types.h>
9751 EOF
9752 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9753   egrep "uid_t" >/dev/null 2>&1; then
9754   rm -rf conftest*
9755   ac_cv_type_uid_t=yes
9756 else
9757   rm -rf conftest*
9758   ac_cv_type_uid_t=no
9759 fi
9760 rm -f conftest*
9761
9762 fi
9763
9764 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
9765 if test $ac_cv_type_uid_t = no; then
9766   cat >> confdefs.h <<\EOF
9767 #define uid_t int
9768 EOF
9769
9770   cat >> confdefs.h <<\EOF
9771 #define gid_t int
9772 EOF
9773
9774 fi
9775
9776 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
9777 echo "configure:9778: checking type of array argument to getgroups" >&5
9778 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
9779   echo $ac_n "(cached) $ac_c" 1>&6
9780 else
9781   if test "$cross_compiling" = yes; then
9782   ac_cv_type_getgroups=cross
9783 else
9784   cat > conftest.$ac_ext <<EOF
9785 #line 9786 "configure"
9786 #include "confdefs.h"
9787
9788 /* Thanks to Mike Rendell for this test.  */
9789 #include <sys/types.h>
9790 #define NGID 256
9791 #undef MAX
9792 #define MAX(x, y) ((x) > (y) ? (x) : (y))
9793 main()
9794 {
9795   gid_t gidset[NGID];
9796   int i, n;
9797   union { gid_t gval; long lval; }  val;
9798
9799   val.lval = -1;
9800   for (i = 0; i < NGID; i++)
9801     gidset[i] = val.gval;
9802   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
9803                  gidset);
9804   /* Exit non-zero if getgroups seems to require an array of ints.  This
9805      happens when gid_t is short but getgroups modifies an array of ints.  */
9806   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
9807 }
9808
9809 EOF
9810 if { (eval echo configure:9811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9811 then
9812     ac_cv_type_getgroups=gid_t
9813 else
9814   echo "configure: failed program was:" >&5
9815   cat conftest.$ac_ext >&5
9816   rm -fr conftest*
9817   ac_cv_type_getgroups=int
9818 fi
9819 rm -fr conftest*
9820 fi
9821
9822 if test $ac_cv_type_getgroups = cross; then
9823         cat > conftest.$ac_ext <<EOF
9824 #line 9825 "configure"
9825 #include "confdefs.h"
9826 #include <unistd.h>
9827 EOF
9828 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9829   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
9830   rm -rf conftest*
9831   ac_cv_type_getgroups=gid_t
9832 else
9833   rm -rf conftest*
9834   ac_cv_type_getgroups=int
9835 fi
9836 rm -f conftest*
9837
9838 fi
9839 fi
9840
9841 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
9842 cat >> confdefs.h <<EOF
9843 #define GETGROUPS_T $ac_cv_type_getgroups
9844 EOF
9845
9846  echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
9847 echo "configure:9848: checking for ANSI C header files" >&5
9848 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
9849   echo $ac_n "(cached) $ac_c" 1>&6
9850 else
9851   cat > conftest.$ac_ext <<EOF
9852 #line 9853 "configure"
9853 #include "confdefs.h"
9854 #include <stdlib.h>
9855 #include <stdarg.h>
9856 #include <string.h>
9857 #include <float.h>
9858 EOF
9859 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9860 { (eval echo configure:9861: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9861 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9862 if test -z "$ac_err"; then
9863   rm -rf conftest*
9864   ac_cv_header_stdc=yes
9865 else
9866   echo "$ac_err" >&5
9867   echo "configure: failed program was:" >&5
9868   cat conftest.$ac_ext >&5
9869   rm -rf conftest*
9870   ac_cv_header_stdc=no
9871 fi
9872 rm -f conftest*
9873
9874 if test $ac_cv_header_stdc = yes; then
9875   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
9876 cat > conftest.$ac_ext <<EOF
9877 #line 9878 "configure"
9878 #include "confdefs.h"
9879 #include <string.h>
9880 EOF
9881 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9882   egrep "memchr" >/dev/null 2>&1; then
9883   :
9884 else
9885   rm -rf conftest*
9886   ac_cv_header_stdc=no
9887 fi
9888 rm -f conftest*
9889
9890 fi
9891
9892 if test $ac_cv_header_stdc = yes; then
9893   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
9894 cat > conftest.$ac_ext <<EOF
9895 #line 9896 "configure"
9896 #include "confdefs.h"
9897 #include <stdlib.h>
9898 EOF
9899 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9900   egrep "free" >/dev/null 2>&1; then
9901   :
9902 else
9903   rm -rf conftest*
9904   ac_cv_header_stdc=no
9905 fi
9906 rm -f conftest*
9907
9908 fi
9909
9910 if test $ac_cv_header_stdc = yes; then
9911   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
9912 if test "$cross_compiling" = yes; then
9913   :
9914 else
9915   cat > conftest.$ac_ext <<EOF
9916 #line 9917 "configure"
9917 #include "confdefs.h"
9918 #include <ctype.h>
9919 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
9920 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
9921 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
9922 int main () { int i; for (i = 0; i < 256; i++)
9923 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
9924 exit (0); }
9925
9926 EOF
9927 if { (eval echo configure:9928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9928 then
9929   :
9930 else
9931   echo "configure: failed program was:" >&5
9932   cat conftest.$ac_ext >&5
9933   rm -fr conftest*
9934   ac_cv_header_stdc=no
9935 fi
9936 rm -fr conftest*
9937 fi
9938
9939 fi
9940 fi
9941
9942 echo "$ac_t""$ac_cv_header_stdc" 1>&6
9943 if test $ac_cv_header_stdc = yes; then
9944   cat >> confdefs.h <<\EOF
9945 #define STDC_HEADERS 1
9946 EOF
9947
9948 fi
9949
9950 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
9951 echo "configure:9952: checking for mode_t" >&5
9952 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
9953   echo $ac_n "(cached) $ac_c" 1>&6
9954 else
9955   cat > conftest.$ac_ext <<EOF
9956 #line 9957 "configure"
9957 #include "confdefs.h"
9958 #include <sys/types.h>
9959 #if STDC_HEADERS
9960 #include <stdlib.h>
9961 #include <stddef.h>
9962 #endif
9963 EOF
9964 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9965   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
9966   rm -rf conftest*
9967   ac_cv_type_mode_t=yes
9968 else
9969   rm -rf conftest*
9970   ac_cv_type_mode_t=no
9971 fi
9972 rm -f conftest*
9973
9974 fi
9975 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
9976 if test $ac_cv_type_mode_t = no; then
9977   cat >> confdefs.h <<\EOF
9978 #define mode_t int
9979 EOF
9980
9981 fi
9982
9983 echo $ac_n "checking for off_t""... $ac_c" 1>&6
9984 echo "configure:9985: checking for off_t" >&5
9985 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
9986   echo $ac_n "(cached) $ac_c" 1>&6
9987 else
9988   cat > conftest.$ac_ext <<EOF
9989 #line 9990 "configure"
9990 #include "confdefs.h"
9991 #include <sys/types.h>
9992 #if STDC_HEADERS
9993 #include <stdlib.h>
9994 #include <stddef.h>
9995 #endif
9996 EOF
9997 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9998   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
9999   rm -rf conftest*
10000   ac_cv_type_off_t=yes
10001 else
10002   rm -rf conftest*
10003   ac_cv_type_off_t=no
10004 fi
10005 rm -f conftest*
10006
10007 fi
10008 echo "$ac_t""$ac_cv_type_off_t" 1>&6
10009 if test $ac_cv_type_off_t = no; then
10010   cat >> confdefs.h <<\EOF
10011 #define off_t long
10012 EOF
10013
10014 fi
10015
10016 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
10017 echo "configure:10018: checking for pid_t" >&5
10018 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
10019   echo $ac_n "(cached) $ac_c" 1>&6
10020 else
10021   cat > conftest.$ac_ext <<EOF
10022 #line 10023 "configure"
10023 #include "confdefs.h"
10024 #include <sys/types.h>
10025 #if STDC_HEADERS
10026 #include <stdlib.h>
10027 #include <stddef.h>
10028 #endif
10029 EOF
10030 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10031   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10032   rm -rf conftest*
10033   ac_cv_type_pid_t=yes
10034 else
10035   rm -rf conftest*
10036   ac_cv_type_pid_t=no
10037 fi
10038 rm -f conftest*
10039
10040 fi
10041 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
10042 if test $ac_cv_type_pid_t = no; then
10043   cat >> confdefs.h <<\EOF
10044 #define pid_t int
10045 EOF
10046
10047 fi
10048
10049 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
10050 echo "configure:10051: checking for ptrdiff_t" >&5
10051 if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then
10052   echo $ac_n "(cached) $ac_c" 1>&6
10053 else
10054   cat > conftest.$ac_ext <<EOF
10055 #line 10056 "configure"
10056 #include "confdefs.h"
10057 #include <stddef.h>
10058 int main() {
10059 ptrdiff_t p
10060 ; return 0; }
10061 EOF
10062 if { (eval echo configure:10063: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10063   rm -rf conftest*
10064   am_cv_type_ptrdiff_t=yes
10065 else
10066   echo "configure: failed program was:" >&5
10067   cat conftest.$ac_ext >&5
10068   rm -rf conftest*
10069   am_cv_type_ptrdiff_t=no
10070 fi
10071 rm -f conftest*
10072 fi
10073
10074 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
10075    if test $am_cv_type_ptrdiff_t = yes; then
10076      cat >> confdefs.h <<\EOF
10077 #define HAVE_PTRDIFF_T 1
10078 EOF
10079
10080    fi
10081
10082 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
10083 echo "configure:10084: checking return type of signal handlers" >&5
10084 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
10085   echo $ac_n "(cached) $ac_c" 1>&6
10086 else
10087   cat > conftest.$ac_ext <<EOF
10088 #line 10089 "configure"
10089 #include "confdefs.h"
10090 #include <sys/types.h>
10091 #include <signal.h>
10092 #ifdef signal
10093 #undef signal
10094 #endif
10095 #ifdef __cplusplus
10096 extern "C" void (*signal (int, void (*)(int)))(int);
10097 #else
10098 void (*signal ()) ();
10099 #endif
10100
10101 int main() {
10102 int i;
10103 ; return 0; }
10104 EOF
10105 if { (eval echo configure:10106: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10106   rm -rf conftest*
10107   ac_cv_type_signal=void
10108 else
10109   echo "configure: failed program was:" >&5
10110   cat conftest.$ac_ext >&5
10111   rm -rf conftest*
10112   ac_cv_type_signal=int
10113 fi
10114 rm -f conftest*
10115 fi
10116
10117 echo "$ac_t""$ac_cv_type_signal" 1>&6
10118 cat >> confdefs.h <<EOF
10119 #define RETSIGTYPE $ac_cv_type_signal
10120 EOF
10121
10122
10123 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
10124 echo "configure:10125: checking for sig_atomic_t" >&5
10125 if eval "test \"`echo '$''{'ol_cv_type_sig_atomic_t'+set}'`\" = set"; then
10126   echo $ac_n "(cached) $ac_c" 1>&6
10127 else
10128   cat > conftest.$ac_ext <<EOF
10129 #line 10130 "configure"
10130 #include "confdefs.h"
10131 #include <signal.h>
10132 int main() {
10133 sig_atomic_t atomic;
10134 ; return 0; }
10135 EOF
10136 if { (eval echo configure:10137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10137   rm -rf conftest*
10138   ol_cv_type_sig_atomic_t=yes
10139 else
10140   echo "configure: failed program was:" >&5
10141   cat conftest.$ac_ext >&5
10142   rm -rf conftest*
10143   ol_cv_type_sig_atomic_t=no
10144 fi
10145 rm -f conftest*
10146 fi
10147
10148 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
10149   if test $ol_cv_type_sig_atomic_t = no; then
10150     cat >> confdefs.h <<\EOF
10151 #define sig_atomic_t int
10152 EOF
10153
10154   fi
10155  
10156 echo $ac_n "checking for size_t""... $ac_c" 1>&6
10157 echo "configure:10158: checking for size_t" >&5
10158 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
10159   echo $ac_n "(cached) $ac_c" 1>&6
10160 else
10161   cat > conftest.$ac_ext <<EOF
10162 #line 10163 "configure"
10163 #include "confdefs.h"
10164 #include <sys/types.h>
10165 #if STDC_HEADERS
10166 #include <stdlib.h>
10167 #include <stddef.h>
10168 #endif
10169 EOF
10170 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10171   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10172   rm -rf conftest*
10173   ac_cv_type_size_t=yes
10174 else
10175   rm -rf conftest*
10176   ac_cv_type_size_t=no
10177 fi
10178 rm -f conftest*
10179
10180 fi
10181 echo "$ac_t""$ac_cv_type_size_t" 1>&6
10182 if test $ac_cv_type_size_t = no; then
10183   cat >> confdefs.h <<\EOF
10184 #define size_t unsigned
10185 EOF
10186
10187 fi
10188
10189 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
10190 echo "configure:10191: checking for st_blksize in struct stat" >&5
10191 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
10192   echo $ac_n "(cached) $ac_c" 1>&6
10193 else
10194   cat > conftest.$ac_ext <<EOF
10195 #line 10196 "configure"
10196 #include "confdefs.h"
10197 #include <sys/types.h>
10198 #include <sys/stat.h>
10199 int main() {
10200 struct stat s; s.st_blksize;
10201 ; return 0; }
10202 EOF
10203 if { (eval echo configure:10204: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10204   rm -rf conftest*
10205   ac_cv_struct_st_blksize=yes
10206 else
10207   echo "configure: failed program was:" >&5
10208   cat conftest.$ac_ext >&5
10209   rm -rf conftest*
10210   ac_cv_struct_st_blksize=no
10211 fi
10212 rm -f conftest*
10213 fi
10214
10215 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
10216 if test $ac_cv_struct_st_blksize = yes; then
10217   cat >> confdefs.h <<\EOF
10218 #define HAVE_ST_BLKSIZE 1
10219 EOF
10220
10221 fi
10222
10223 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
10224 echo "configure:10225: checking whether time.h and sys/time.h may both be included" >&5
10225 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
10226   echo $ac_n "(cached) $ac_c" 1>&6
10227 else
10228   cat > conftest.$ac_ext <<EOF
10229 #line 10230 "configure"
10230 #include "confdefs.h"
10231 #include <sys/types.h>
10232 #include <sys/time.h>
10233 #include <time.h>
10234 int main() {
10235 struct tm *tp;
10236 ; return 0; }
10237 EOF
10238 if { (eval echo configure:10239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10239   rm -rf conftest*
10240   ac_cv_header_time=yes
10241 else
10242   echo "configure: failed program was:" >&5
10243   cat conftest.$ac_ext >&5
10244   rm -rf conftest*
10245   ac_cv_header_time=no
10246 fi
10247 rm -f conftest*
10248 fi
10249
10250 echo "$ac_t""$ac_cv_header_time" 1>&6
10251 if test $ac_cv_header_time = yes; then
10252   cat >> confdefs.h <<\EOF
10253 #define TIME_WITH_SYS_TIME 1
10254 EOF
10255
10256 fi
10257
10258 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
10259 echo "configure:10260: checking whether struct tm is in sys/time.h or time.h" >&5
10260 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
10261   echo $ac_n "(cached) $ac_c" 1>&6
10262 else
10263   cat > conftest.$ac_ext <<EOF
10264 #line 10265 "configure"
10265 #include "confdefs.h"
10266 #include <sys/types.h>
10267 #include <time.h>
10268 int main() {
10269 struct tm *tp; tp->tm_sec;
10270 ; return 0; }
10271 EOF
10272 if { (eval echo configure:10273: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10273   rm -rf conftest*
10274   ac_cv_struct_tm=time.h
10275 else
10276   echo "configure: failed program was:" >&5
10277   cat conftest.$ac_ext >&5
10278   rm -rf conftest*
10279   ac_cv_struct_tm=sys/time.h
10280 fi
10281 rm -f conftest*
10282 fi
10283
10284 echo "$ac_t""$ac_cv_struct_tm" 1>&6
10285 if test $ac_cv_struct_tm = sys/time.h; then
10286   cat >> confdefs.h <<\EOF
10287 #define TM_IN_SYS_TIME 1
10288 EOF
10289
10290 fi
10291
10292 # test for pw_gecos in struct passwd
10293 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
10294 echo "configure:10295: checking struct passwd for pw_gecos" >&5
10295 if eval "test \"`echo '$''{'ol_cv_struct_passwd_pw_gecos'+set}'`\" = set"; then
10296   echo $ac_n "(cached) $ac_c" 1>&6
10297 else
10298   
10299         cat > conftest.$ac_ext <<EOF
10300 #line 10301 "configure"
10301 #include "confdefs.h"
10302 #include <pwd.h>
10303 int main() {
10304
10305         struct passwd pwd;
10306         pwd.pw_gecos = pwd.pw_name;
10307
10308 ; return 0; }
10309 EOF
10310 if { (eval echo configure:10311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10311   rm -rf conftest*
10312   ol_cv_struct_passwd_pw_gecos=yes
10313 else
10314   echo "configure: failed program was:" >&5
10315   cat conftest.$ac_ext >&5
10316   rm -rf conftest*
10317   ol_cv_struct_passwd_pw_gecos=no
10318 fi
10319 rm -f conftest*
10320 fi
10321
10322 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
10323 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
10324         cat >> confdefs.h <<\EOF
10325 #define HAVE_PW_GECOS 1
10326 EOF
10327
10328 fi
10329
10330
10331
10332 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
10333 echo "configure:10334: checking if toupper() requires islower()" >&5
10334 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
10335   echo $ac_n "(cached) $ac_c" 1>&6
10336 else
10337   
10338         if test "$cross_compiling" = yes; then
10339   ol_cv_c_upper_lower=safe
10340 else
10341   cat > conftest.$ac_ext <<EOF
10342 #line 10343 "configure"
10343 #include "confdefs.h"
10344
10345 #include <ctype.h>
10346 main()
10347 {
10348         if ('C' == toupper('C'))
10349                 exit(0);
10350         else
10351                 exit(1);
10352 }
10353 EOF
10354 if { (eval echo configure:10355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10355 then
10356   ol_cv_c_upper_lower=no
10357 else
10358   echo "configure: failed program was:" >&5
10359   cat conftest.$ac_ext >&5
10360   rm -fr conftest*
10361   ol_cv_c_upper_lower=yes
10362 fi
10363 rm -fr conftest*
10364 fi
10365
10366 fi
10367
10368 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
10369 if test $ol_cv_c_upper_lower != no ; then
10370         cat >> confdefs.h <<\EOF
10371 #define C_UPPER_LOWER 1
10372 EOF
10373
10374 fi
10375
10376 echo $ac_n "checking for working const""... $ac_c" 1>&6
10377 echo "configure:10378: checking for working const" >&5
10378 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
10379   echo $ac_n "(cached) $ac_c" 1>&6
10380 else
10381   cat > conftest.$ac_ext <<EOF
10382 #line 10383 "configure"
10383 #include "confdefs.h"
10384
10385 int main() {
10386
10387 /* Ultrix mips cc rejects this.  */
10388 typedef int charset[2]; const charset x;
10389 /* SunOS 4.1.1 cc rejects this.  */
10390 char const *const *ccp;
10391 char **p;
10392 /* NEC SVR4.0.2 mips cc rejects this.  */
10393 struct point {int x, y;};
10394 static struct point const zero = {0,0};
10395 /* AIX XL C 1.02.0.0 rejects this.
10396    It does not let you subtract one const X* pointer from another in an arm
10397    of an if-expression whose if-part is not a constant expression */
10398 const char *g = "string";
10399 ccp = &g + (g ? g-g : 0);
10400 /* HPUX 7.0 cc rejects these. */
10401 ++ccp;
10402 p = (char**) ccp;
10403 ccp = (char const *const *) p;
10404 { /* SCO 3.2v4 cc rejects this.  */
10405   char *t;
10406   char const *s = 0 ? (char *) 0 : (char const *) 0;
10407
10408   *t++ = 0;
10409 }
10410 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
10411   int x[] = {25, 17};
10412   const int *foo = &x[0];
10413   ++foo;
10414 }
10415 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
10416   typedef const int *iptr;
10417   iptr p = 0;
10418   ++p;
10419 }
10420 { /* AIX XL C 1.02.0.0 rejects this saying
10421      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
10422   struct s { int j; const int *ap[3]; };
10423   struct s *b; b->j = 5;
10424 }
10425 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
10426   const int foo = 10;
10427 }
10428
10429 ; return 0; }
10430 EOF
10431 if { (eval echo configure:10432: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10432   rm -rf conftest*
10433   ac_cv_c_const=yes
10434 else
10435   echo "configure: failed program was:" >&5
10436   cat conftest.$ac_ext >&5
10437   rm -rf conftest*
10438   ac_cv_c_const=no
10439 fi
10440 rm -f conftest*
10441 fi
10442
10443 echo "$ac_t""$ac_cv_c_const" 1>&6
10444 if test $ac_cv_c_const = no; then
10445   cat >> confdefs.h <<\EOF
10446 #define const 
10447 EOF
10448
10449 fi
10450
10451 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
10452 echo "configure:10453: checking if compiler understands volatile" >&5
10453 if eval "test \"`echo '$''{'ol_cv_c_volatile'+set}'`\" = set"; then
10454   echo $ac_n "(cached) $ac_c" 1>&6
10455 else
10456   cat > conftest.$ac_ext <<EOF
10457 #line 10458 "configure"
10458 #include "confdefs.h"
10459 int x, y, z;
10460 int main() {
10461 volatile int a; int * volatile b = x ? &y : &z;
10462       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
10463       *b = 0;
10464 ; return 0; }
10465 EOF
10466 if { (eval echo configure:10467: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10467   rm -rf conftest*
10468   ol_cv_c_volatile=yes
10469 else
10470   echo "configure: failed program was:" >&5
10471   cat conftest.$ac_ext >&5
10472   rm -rf conftest*
10473   ol_cv_c_volatile=no
10474 fi
10475 rm -f conftest*
10476 fi
10477
10478 echo "$ac_t""$ol_cv_c_volatile" 1>&6
10479   if test $ol_cv_c_volatile = yes; then
10480     : 
10481   else
10482     cat >> confdefs.h <<\EOF
10483 #define volatile 
10484 EOF
10485
10486   fi
10487  
10488
10489 if test $cross_compiling = yes ; then
10490         cat >> confdefs.h <<\EOF
10491 #define CROSS_COMPILING 1
10492 EOF
10493
10494 else
10495         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
10496 echo "configure:10497: checking whether byte ordering is bigendian" >&5
10497 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
10498   echo $ac_n "(cached) $ac_c" 1>&6
10499 else
10500   ac_cv_c_bigendian=unknown
10501 # See if sys/param.h defines the BYTE_ORDER macro.
10502 cat > conftest.$ac_ext <<EOF
10503 #line 10504 "configure"
10504 #include "confdefs.h"
10505 #include <sys/types.h>
10506 #include <sys/param.h>
10507 int main() {
10508
10509 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
10510  bogus endian macros
10511 #endif
10512 ; return 0; }
10513 EOF
10514 if { (eval echo configure:10515: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10515   rm -rf conftest*
10516   # It does; now see whether it defined to BIG_ENDIAN or not.
10517 cat > conftest.$ac_ext <<EOF
10518 #line 10519 "configure"
10519 #include "confdefs.h"
10520 #include <sys/types.h>
10521 #include <sys/param.h>
10522 int main() {
10523
10524 #if BYTE_ORDER != BIG_ENDIAN
10525  not big endian
10526 #endif
10527 ; return 0; }
10528 EOF
10529 if { (eval echo configure:10530: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10530   rm -rf conftest*
10531   ac_cv_c_bigendian=yes
10532 else
10533   echo "configure: failed program was:" >&5
10534   cat conftest.$ac_ext >&5
10535   rm -rf conftest*
10536   ac_cv_c_bigendian=no
10537 fi
10538 rm -f conftest*
10539 else
10540   echo "configure: failed program was:" >&5
10541   cat conftest.$ac_ext >&5
10542 fi
10543 rm -f conftest*
10544 if test $ac_cv_c_bigendian = unknown; then
10545 if test "$cross_compiling" = yes; then
10546     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10547 else
10548   cat > conftest.$ac_ext <<EOF
10549 #line 10550 "configure"
10550 #include "confdefs.h"
10551 main () {
10552   /* Are we little or big endian?  From Harbison&Steele.  */
10553   union
10554   {
10555     long l;
10556     char c[sizeof (long)];
10557   } u;
10558   u.l = 1;
10559   exit (u.c[sizeof (long) - 1] == 1);
10560 }
10561 EOF
10562 if { (eval echo configure:10563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10563 then
10564   ac_cv_c_bigendian=no
10565 else
10566   echo "configure: failed program was:" >&5
10567   cat conftest.$ac_ext >&5
10568   rm -fr conftest*
10569   ac_cv_c_bigendian=yes
10570 fi
10571 rm -fr conftest*
10572 fi
10573
10574 fi
10575 fi
10576
10577 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
10578 if test $ac_cv_c_bigendian = yes; then
10579   cat >> confdefs.h <<\EOF
10580 #define WORDS_BIGENDIAN 1
10581 EOF
10582
10583 fi
10584
10585         echo $ac_n "checking size of short""... $ac_c" 1>&6
10586 echo "configure:10587: checking size of short" >&5
10587 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
10588   echo $ac_n "(cached) $ac_c" 1>&6
10589 else
10590   if test "$cross_compiling" = yes; then
10591     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10592 else
10593   cat > conftest.$ac_ext <<EOF
10594 #line 10595 "configure"
10595 #include "confdefs.h"
10596 #include <stdio.h>
10597 main()
10598 {
10599   FILE *f=fopen("conftestval", "w");
10600   if (!f) exit(1);
10601   fprintf(f, "%d\n", sizeof(short));
10602   exit(0);
10603 }
10604 EOF
10605 if { (eval echo configure:10606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10606 then
10607   ac_cv_sizeof_short=`cat conftestval`
10608 else
10609   echo "configure: failed program was:" >&5
10610   cat conftest.$ac_ext >&5
10611   rm -fr conftest*
10612   ac_cv_sizeof_short=0
10613 fi
10614 rm -fr conftest*
10615 fi
10616
10617 fi
10618 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
10619 cat >> confdefs.h <<EOF
10620 #define SIZEOF_SHORT $ac_cv_sizeof_short
10621 EOF
10622
10623  
10624         echo $ac_n "checking size of int""... $ac_c" 1>&6
10625 echo "configure:10626: checking size of int" >&5
10626 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
10627   echo $ac_n "(cached) $ac_c" 1>&6
10628 else
10629   if test "$cross_compiling" = yes; then
10630     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10631 else
10632   cat > conftest.$ac_ext <<EOF
10633 #line 10634 "configure"
10634 #include "confdefs.h"
10635 #include <stdio.h>
10636 main()
10637 {
10638   FILE *f=fopen("conftestval", "w");
10639   if (!f) exit(1);
10640   fprintf(f, "%d\n", sizeof(int));
10641   exit(0);
10642 }
10643 EOF
10644 if { (eval echo configure:10645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10645 then
10646   ac_cv_sizeof_int=`cat conftestval`
10647 else
10648   echo "configure: failed program was:" >&5
10649   cat conftest.$ac_ext >&5
10650   rm -fr conftest*
10651   ac_cv_sizeof_int=0
10652 fi
10653 rm -fr conftest*
10654 fi
10655
10656 fi
10657 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
10658 cat >> confdefs.h <<EOF
10659 #define SIZEOF_INT $ac_cv_sizeof_int
10660 EOF
10661
10662  
10663         echo $ac_n "checking size of long""... $ac_c" 1>&6
10664 echo "configure:10665: checking size of long" >&5
10665 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
10666   echo $ac_n "(cached) $ac_c" 1>&6
10667 else
10668   if test "$cross_compiling" = yes; then
10669     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10670 else
10671   cat > conftest.$ac_ext <<EOF
10672 #line 10673 "configure"
10673 #include "confdefs.h"
10674 #include <stdio.h>
10675 main()
10676 {
10677   FILE *f=fopen("conftestval", "w");
10678   if (!f) exit(1);
10679   fprintf(f, "%d\n", sizeof(long));
10680   exit(0);
10681 }
10682 EOF
10683 if { (eval echo configure:10684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10684 then
10685   ac_cv_sizeof_long=`cat conftestval`
10686 else
10687   echo "configure: failed program was:" >&5
10688   cat conftest.$ac_ext >&5
10689   rm -fr conftest*
10690   ac_cv_sizeof_long=0
10691 fi
10692 rm -fr conftest*
10693 fi
10694
10695 fi
10696 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
10697 cat >> confdefs.h <<EOF
10698 #define SIZEOF_LONG $ac_cv_sizeof_long
10699 EOF
10700
10701
10702 fi
10703
10704 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
10705 echo "configure:10706: checking for 8-bit clean memcmp" >&5
10706 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
10707   echo $ac_n "(cached) $ac_c" 1>&6
10708 else
10709   if test "$cross_compiling" = yes; then
10710   ac_cv_func_memcmp_clean=no
10711 else
10712   cat > conftest.$ac_ext <<EOF
10713 #line 10714 "configure"
10714 #include "confdefs.h"
10715
10716 main()
10717 {
10718   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
10719   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
10720 }
10721
10722 EOF
10723 if { (eval echo configure:10724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10724 then
10725   ac_cv_func_memcmp_clean=yes
10726 else
10727   echo "configure: failed program was:" >&5
10728   cat conftest.$ac_ext >&5
10729   rm -fr conftest*
10730   ac_cv_func_memcmp_clean=no
10731 fi
10732 rm -fr conftest*
10733 fi
10734
10735 fi
10736
10737 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
10738 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
10739
10740 echo $ac_n "checking for strftime""... $ac_c" 1>&6
10741 echo "configure:10742: checking for strftime" >&5
10742 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
10743   echo $ac_n "(cached) $ac_c" 1>&6
10744 else
10745   cat > conftest.$ac_ext <<EOF
10746 #line 10747 "configure"
10747 #include "confdefs.h"
10748 /* System header to define __stub macros and hopefully few prototypes,
10749     which can conflict with char strftime(); below.  */
10750 #include <assert.h>
10751 /* Override any gcc2 internal prototype to avoid an error.  */
10752 /* We use char because int might match the return type of a gcc2
10753     builtin and then its argument prototype would still apply.  */
10754 char strftime();
10755
10756 int main() {
10757
10758 /* The GNU C library defines this for functions which it implements
10759     to always fail with ENOSYS.  Some functions are actually named
10760     something starting with __ and the normal name is an alias.  */
10761 #if defined (__stub_strftime) || defined (__stub___strftime)
10762 choke me
10763 #else
10764 strftime();
10765 #endif
10766
10767 ; return 0; }
10768 EOF
10769 if { (eval echo configure:10770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10770   rm -rf conftest*
10771   eval "ac_cv_func_strftime=yes"
10772 else
10773   echo "configure: failed program was:" >&5
10774   cat conftest.$ac_ext >&5
10775   rm -rf conftest*
10776   eval "ac_cv_func_strftime=no"
10777 fi
10778 rm -f conftest*
10779 fi
10780
10781 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
10782   echo "$ac_t""yes" 1>&6
10783   cat >> confdefs.h <<\EOF
10784 #define HAVE_STRFTIME 1
10785 EOF
10786
10787 else
10788   echo "$ac_t""no" 1>&6
10789 # strftime is in -lintl on SCO UNIX.
10790 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
10791 echo "configure:10792: checking for strftime in -lintl" >&5
10792 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
10793 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
10794   echo $ac_n "(cached) $ac_c" 1>&6
10795 else
10796   ac_save_LIBS="$LIBS"
10797 LIBS="-lintl  $LIBS"
10798 cat > conftest.$ac_ext <<EOF
10799 #line 10800 "configure"
10800 #include "confdefs.h"
10801 /* Override any gcc2 internal prototype to avoid an error.  */
10802 /* We use char because int might match the return type of a gcc2
10803     builtin and then its argument prototype would still apply.  */
10804 char strftime();
10805
10806 int main() {
10807 strftime()
10808 ; return 0; }
10809 EOF
10810 if { (eval echo configure:10811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10811   rm -rf conftest*
10812   eval "ac_cv_lib_$ac_lib_var=yes"
10813 else
10814   echo "configure: failed program was:" >&5
10815   cat conftest.$ac_ext >&5
10816   rm -rf conftest*
10817   eval "ac_cv_lib_$ac_lib_var=no"
10818 fi
10819 rm -f conftest*
10820 LIBS="$ac_save_LIBS"
10821
10822 fi
10823 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10824   echo "$ac_t""yes" 1>&6
10825   cat >> confdefs.h <<\EOF
10826 #define HAVE_STRFTIME 1
10827 EOF
10828
10829 LIBS="-lintl $LIBS"
10830 else
10831   echo "$ac_t""no" 1>&6
10832 fi
10833
10834 fi
10835
10836
10837 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
10838 echo "configure:10839: checking for vprintf" >&5
10839 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
10840   echo $ac_n "(cached) $ac_c" 1>&6
10841 else
10842   cat > conftest.$ac_ext <<EOF
10843 #line 10844 "configure"
10844 #include "confdefs.h"
10845 /* System header to define __stub macros and hopefully few prototypes,
10846     which can conflict with char vprintf(); below.  */
10847 #include <assert.h>
10848 /* Override any gcc2 internal prototype to avoid an error.  */
10849 /* We use char because int might match the return type of a gcc2
10850     builtin and then its argument prototype would still apply.  */
10851 char vprintf();
10852
10853 int main() {
10854
10855 /* The GNU C library defines this for functions which it implements
10856     to always fail with ENOSYS.  Some functions are actually named
10857     something starting with __ and the normal name is an alias.  */
10858 #if defined (__stub_vprintf) || defined (__stub___vprintf)
10859 choke me
10860 #else
10861 vprintf();
10862 #endif
10863
10864 ; return 0; }
10865 EOF
10866 if { (eval echo configure:10867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10867   rm -rf conftest*
10868   eval "ac_cv_func_vprintf=yes"
10869 else
10870   echo "configure: failed program was:" >&5
10871   cat conftest.$ac_ext >&5
10872   rm -rf conftest*
10873   eval "ac_cv_func_vprintf=no"
10874 fi
10875 rm -f conftest*
10876 fi
10877
10878 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
10879   echo "$ac_t""yes" 1>&6
10880   cat >> confdefs.h <<\EOF
10881 #define HAVE_VPRINTF 1
10882 EOF
10883
10884 else
10885   echo "$ac_t""no" 1>&6
10886 fi
10887
10888 if test "$ac_cv_func_vprintf" != yes; then
10889 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
10890 echo "configure:10891: checking for _doprnt" >&5
10891 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
10892   echo $ac_n "(cached) $ac_c" 1>&6
10893 else
10894   cat > conftest.$ac_ext <<EOF
10895 #line 10896 "configure"
10896 #include "confdefs.h"
10897 /* System header to define __stub macros and hopefully few prototypes,
10898     which can conflict with char _doprnt(); below.  */
10899 #include <assert.h>
10900 /* Override any gcc2 internal prototype to avoid an error.  */
10901 /* We use char because int might match the return type of a gcc2
10902     builtin and then its argument prototype would still apply.  */
10903 char _doprnt();
10904
10905 int main() {
10906
10907 /* The GNU C library defines this for functions which it implements
10908     to always fail with ENOSYS.  Some functions are actually named
10909     something starting with __ and the normal name is an alias.  */
10910 #if defined (__stub__doprnt) || defined (__stub____doprnt)
10911 choke me
10912 #else
10913 _doprnt();
10914 #endif
10915
10916 ; return 0; }
10917 EOF
10918 if { (eval echo configure:10919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10919   rm -rf conftest*
10920   eval "ac_cv_func__doprnt=yes"
10921 else
10922   echo "configure: failed program was:" >&5
10923   cat conftest.$ac_ext >&5
10924   rm -rf conftest*
10925   eval "ac_cv_func__doprnt=no"
10926 fi
10927 rm -f conftest*
10928 fi
10929
10930 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
10931   echo "$ac_t""yes" 1>&6
10932   cat >> confdefs.h <<\EOF
10933 #define HAVE_DOPRNT 1
10934 EOF
10935
10936 else
10937   echo "$ac_t""no" 1>&6
10938 fi
10939
10940 fi
10941
10942
10943 if test $ac_cv_func_vprintf = yes ; then
10944                 for ac_func in vsnprintf vsprintf
10945 do
10946 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10947 echo "configure:10948: checking for $ac_func" >&5
10948 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
10949   echo $ac_n "(cached) $ac_c" 1>&6
10950 else
10951   cat > conftest.$ac_ext <<EOF
10952 #line 10953 "configure"
10953 #include "confdefs.h"
10954 /* System header to define __stub macros and hopefully few prototypes,
10955     which can conflict with char $ac_func(); below.  */
10956 #include <assert.h>
10957 /* Override any gcc2 internal prototype to avoid an error.  */
10958 /* We use char because int might match the return type of a gcc2
10959     builtin and then its argument prototype would still apply.  */
10960 char $ac_func();
10961
10962 int main() {
10963
10964 /* The GNU C library defines this for functions which it implements
10965     to always fail with ENOSYS.  Some functions are actually named
10966     something starting with __ and the normal name is an alias.  */
10967 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10968 choke me
10969 #else
10970 $ac_func();
10971 #endif
10972
10973 ; return 0; }
10974 EOF
10975 if { (eval echo configure:10976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10976   rm -rf conftest*
10977   eval "ac_cv_func_$ac_func=yes"
10978 else
10979   echo "configure: failed program was:" >&5
10980   cat conftest.$ac_ext >&5
10981   rm -rf conftest*
10982   eval "ac_cv_func_$ac_func=no"
10983 fi
10984 rm -f conftest*
10985 fi
10986
10987 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10988   echo "$ac_t""yes" 1>&6
10989     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10990   cat >> confdefs.h <<EOF
10991 #define $ac_tr_func 1
10992 EOF
10993  
10994 else
10995   echo "$ac_t""no" 1>&6
10996 fi
10997 done
10998
10999 fi
11000
11001 for ac_func in \
11002         bcopy                   \
11003         endgrent                \
11004         endpwent                \
11005         flock                   \
11006         getdtablesize   \
11007         getgrgid                \
11008         gethostname             \
11009         getpass                 \
11010         getpwuid                \
11011         gettimeofday    \
11012         initgroups              \
11013         lockf                   \
11014         memcpy                  \
11015         memmove                 \
11016         mkstemp                 \
11017         recv                    \
11018         recvfrom                \
11019         setpwfile               \
11020         setgid                  \
11021         setegid                 \
11022         setsid                  \
11023         setuid                  \
11024         seteuid                 \
11025         signal                  \
11026         sigset                  \
11027         snprintf                \
11028         strdup                  \
11029         strerror                \
11030         strpbrk                 \
11031         strrchr                 \
11032         strsep                  \
11033         strstr                  \
11034         strtol                  \
11035         strtoul                 \
11036         strspn                  \
11037         sysconf                 \
11038         waitpid                 \
11039         wait4                   \
11040
11041 do
11042 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11043 echo "configure:11044: checking for $ac_func" >&5
11044 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11045   echo $ac_n "(cached) $ac_c" 1>&6
11046 else
11047   cat > conftest.$ac_ext <<EOF
11048 #line 11049 "configure"
11049 #include "confdefs.h"
11050 /* System header to define __stub macros and hopefully few prototypes,
11051     which can conflict with char $ac_func(); below.  */
11052 #include <assert.h>
11053 /* Override any gcc2 internal prototype to avoid an error.  */
11054 /* We use char because int might match the return type of a gcc2
11055     builtin and then its argument prototype would still apply.  */
11056 char $ac_func();
11057
11058 int main() {
11059
11060 /* The GNU C library defines this for functions which it implements
11061     to always fail with ENOSYS.  Some functions are actually named
11062     something starting with __ and the normal name is an alias.  */
11063 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11064 choke me
11065 #else
11066 $ac_func();
11067 #endif
11068
11069 ; return 0; }
11070 EOF
11071 if { (eval echo configure:11072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11072   rm -rf conftest*
11073   eval "ac_cv_func_$ac_func=yes"
11074 else
11075   echo "configure: failed program was:" >&5
11076   cat conftest.$ac_ext >&5
11077   rm -rf conftest*
11078   eval "ac_cv_func_$ac_func=no"
11079 fi
11080 rm -f conftest*
11081 fi
11082
11083 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11084   echo "$ac_t""yes" 1>&6
11085     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11086   cat >> confdefs.h <<EOF
11087 #define $ac_tr_func 1
11088 EOF
11089  
11090 else
11091   echo "$ac_t""no" 1>&6
11092 fi
11093 done
11094
11095
11096 for ac_func in getopt tempnam
11097 do
11098 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11099 echo "configure:11100: checking for $ac_func" >&5
11100 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11101   echo $ac_n "(cached) $ac_c" 1>&6
11102 else
11103   cat > conftest.$ac_ext <<EOF
11104 #line 11105 "configure"
11105 #include "confdefs.h"
11106 /* System header to define __stub macros and hopefully few prototypes,
11107     which can conflict with char $ac_func(); below.  */
11108 #include <assert.h>
11109 /* Override any gcc2 internal prototype to avoid an error.  */
11110 /* We use char because int might match the return type of a gcc2
11111     builtin and then its argument prototype would still apply.  */
11112 char $ac_func();
11113
11114 int main() {
11115
11116 /* The GNU C library defines this for functions which it implements
11117     to always fail with ENOSYS.  Some functions are actually named
11118     something starting with __ and the normal name is an alias.  */
11119 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11120 choke me
11121 #else
11122 $ac_func();
11123 #endif
11124
11125 ; return 0; }
11126 EOF
11127 if { (eval echo configure:11128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11128   rm -rf conftest*
11129   eval "ac_cv_func_$ac_func=yes"
11130 else
11131   echo "configure: failed program was:" >&5
11132   cat conftest.$ac_ext >&5
11133   rm -rf conftest*
11134   eval "ac_cv_func_$ac_func=no"
11135 fi
11136 rm -f conftest*
11137 fi
11138
11139 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11140   echo "$ac_t""yes" 1>&6
11141     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11142   cat >> confdefs.h <<EOF
11143 #define $ac_tr_func 1
11144 EOF
11145  
11146 else
11147   echo "$ac_t""no" 1>&6
11148 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
11149 fi
11150 done
11151
11152
11153
11154 # Check Configuration
11155
11156 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
11157 echo "configure:11158: checking declaration of sys_errlist" >&5
11158 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
11159   echo $ac_n "(cached) $ac_c" 1>&6
11160 else
11161   
11162         cat > conftest.$ac_ext <<EOF
11163 #line 11164 "configure"
11164 #include "confdefs.h"
11165
11166 #include <stdio.h>
11167 #include <sys/types.h>
11168 #include <errno.h> 
11169 int main() {
11170 char *c = (char *) *sys_errlist
11171 ; return 0; }
11172 EOF
11173 if { (eval echo configure:11174: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11174   rm -rf conftest*
11175   ol_cv_dcl_sys_errlist=yes
11176 else
11177   echo "configure: failed program was:" >&5
11178   cat conftest.$ac_ext >&5
11179   rm -rf conftest*
11180   ol_cv_dcl_sys_errlist=no
11181 fi
11182 rm -f conftest*
11183 fi
11184
11185 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
11186 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
11187 if test $ol_cv_dcl_sys_errlist = no ; then
11188         cat >> confdefs.h <<\EOF
11189 #define DECL_SYS_ERRLIST 1
11190 EOF
11191
11192         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
11193 echo "configure:11194: checking existence of sys_errlist" >&5
11194         if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
11195   echo $ac_n "(cached) $ac_c" 1>&6
11196 else
11197   
11198                 cat > conftest.$ac_ext <<EOF
11199 #line 11200 "configure"
11200 #include "confdefs.h"
11201 #include <errno.h>
11202 int main() {
11203 char *c = (char *) *sys_errlist
11204 ; return 0; }
11205 EOF
11206 if { (eval echo configure:11207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11207   rm -rf conftest*
11208   ol_cv_have_sys_errlist=yes
11209 else
11210   echo "configure: failed program was:" >&5
11211   cat conftest.$ac_ext >&5
11212   rm -rf conftest*
11213   ol_cv_have_sys_errlist=no
11214 fi
11215 rm -f conftest*
11216 fi
11217
11218         echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
11219         if test $ol_cv_have_sys_errlist = yes ; then
11220                 cat >> confdefs.h <<\EOF
11221 #define HAVE_SYS_ERRLIST 1
11222 EOF
11223
11224         fi
11225 fi
11226
11227
11228
11229 echo $ac_n "checking strdup declaration""... $ac_c" 1>&6
11230 echo "configure:11231: checking strdup declaration" >&5
11231 if eval "test \"`echo '$''{'ol_cv_dcl_strdup'+set}'`\" = set"; then
11232   echo $ac_n "(cached) $ac_c" 1>&6
11233 else
11234   
11235         cat > conftest.$ac_ext <<EOF
11236 #line 11237 "configure"
11237 #include "confdefs.h"
11238
11239 #include <string.h> 
11240 int main() {
11241 extern char *strdup();
11242 ; return 0; }
11243 EOF
11244 if { (eval echo configure:11245: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11245   rm -rf conftest*
11246   ol_cv_dcl_strdup=yes
11247 else
11248   echo "configure: failed program was:" >&5
11249   cat conftest.$ac_ext >&5
11250   rm -rf conftest*
11251   ol_cv_dcl_strdup=no
11252 fi
11253 rm -f conftest*
11254 fi
11255
11256 echo "$ac_t""$ol_cv_dcl_strdup" 1>&6
11257 if test $ol_cv_dcl_strdup = yes ; then
11258         cat >> confdefs.h <<\EOF
11259 #define DECL_STRDUP 1
11260 EOF
11261
11262 fi
11263
11264
11265
11266 if test "$ol_enable_debug" != no ; then
11267         cat >> confdefs.h <<\EOF
11268 #define LDAP_DEBUG 1
11269 EOF
11270
11271 fi
11272 if test "$ol_enable_syslog" = yes ; then
11273         cat >> confdefs.h <<\EOF
11274 #define LDAP_SYSLOG 1
11275 EOF
11276
11277 fi
11278 if test "$ol_enable_libui" = yes ; then
11279         cat >> confdefs.h <<\EOF
11280 #define LDAP_LIBUI 1
11281 EOF
11282
11283 fi
11284 if test "$ol_enable_cache" = no ; then
11285         cat >> confdefs.h <<\EOF
11286 #define LDAP_NOCACHE 1
11287 EOF
11288
11289 fi
11290 if test "$ol_enable_dns" != no ; then
11291         cat >> confdefs.h <<\EOF
11292 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS LDAP_VENDOR_VERSION
11293 EOF
11294
11295 fi
11296 if test "$ol_enable_proctitle" != no ; then
11297         cat >> confdefs.h <<\EOF
11298 #define LDAP_PROCTITLE 1
11299 EOF
11300
11301 fi
11302 if test "$ol_enable_referrals" != no ; then
11303         cat >> confdefs.h <<\EOF
11304 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
11305 EOF
11306
11307 fi
11308 if test "$ol_enable_cldap" != no ; then
11309         cat >> confdefs.h <<\EOF
11310 #define LDAP_CONNECTIONLESS 1
11311 EOF
11312
11313 fi
11314
11315 if test "$ol_enable_aclgroups" != no ; then
11316         cat >> confdefs.h <<\EOF
11317 #define SLAPD_ACLGROUPS 1
11318 EOF
11319
11320 fi
11321 if test "$ol_enable_crypt" != no ; then
11322         cat >> confdefs.h <<\EOF
11323 #define SLAPD_CRYPT 1
11324 EOF
11325
11326 fi
11327 if test "$ol_enable_cleartext" != no ; then
11328         cat >> confdefs.h <<\EOF
11329 #define SLAPD_CLEARTEXT 1
11330 EOF
11331
11332 fi
11333 if test "$ol_enable_phonetic" != no ; then
11334         cat >> confdefs.h <<\EOF
11335 #define SLAPD_PHONETIC 1
11336 EOF
11337
11338 fi
11339 if test "$ol_enable_rlookups" != no ; then
11340         cat >> confdefs.h <<\EOF
11341 #define SLAPD_RLOOKUPS 1
11342 EOF
11343
11344 fi
11345
11346 if test "$ol_link_modules" != no ; then
11347         cat >> confdefs.h <<\EOF
11348 #define SLAPD_MODULES 1
11349 EOF
11350
11351         BUILD_SLAPD=yes
11352 fi
11353
11354 if test "$ol_link_bdb2" != no ; then
11355         cat >> confdefs.h <<\EOF
11356 #define SLAPD_BDB2 1
11357 EOF
11358
11359         BUILD_SLAPD=yes
11360         BUILD_BDB2=yes
11361 fi
11362
11363 if test "$ol_link_ldbm" != no ; then
11364         cat >> confdefs.h <<\EOF
11365 #define SLAPD_LDBM 1
11366 EOF
11367
11368         BUILD_SLAPD=yes
11369         BUILD_LDBM=yes
11370 fi
11371
11372 if test "$ol_enable_passwd" != no ; then
11373         cat >> confdefs.h <<\EOF
11374 #define SLAPD_PASSWD 1
11375 EOF
11376
11377         BUILD_SLAPD=yes
11378         BUILD_PASSWD=yes
11379 fi
11380
11381 if test "$ol_link_perl" != no ; then
11382         cat >> confdefs.h <<\EOF
11383 #define SLAPD_PERL 1
11384 EOF
11385
11386         BUILD_SLAPD=yes
11387         BUILD_PERL=yes
11388 fi
11389
11390 if test "$ol_enable_shell" != no ; then
11391         cat >> confdefs.h <<\EOF
11392 #define SLAPD_SHELL 1
11393 EOF
11394
11395         BUILD_SLAPD=yes
11396         BUILD_SHELL=yes
11397 fi
11398
11399 if test "$ol_enable_tcl" != no ; then
11400         cat >> confdefs.h <<\EOF
11401 #define SLAPD_TCL 1
11402 EOF
11403
11404         BUILD_SLAPD=yes
11405         BUILD_TCL=yes
11406 fi
11407
11408 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
11409         $BUILD_SLAPD = yes ; then
11410         BUILD_SLURPD=yes
11411 fi
11412
11413 if test "$ol_link_isode" != no ; then
11414         BUILD_LDAPD=yes
11415 fi
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
11446
11447
11448 trap '' 1 2 15
11449
11450 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
11451
11452 test "x$prefix" = xNONE && prefix=$ac_default_prefix
11453 # Let make expand exec_prefix.
11454 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
11455
11456 # Any assignment to VPATH causes Sun make to only execute
11457 # the first set of double-colon rules, so remove it if not needed.
11458 # If there is a colon in the path, we need to keep it.
11459 if test "x$srcdir" = x.; then
11460   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
11461 fi
11462
11463 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
11464
11465 DEFS=-DHAVE_CONFIG_H
11466
11467 # Without the "./", some shells look in PATH for config.status.
11468 : ${CONFIG_STATUS=./config.status}
11469
11470 echo creating $CONFIG_STATUS
11471 rm -f $CONFIG_STATUS
11472 cat > $CONFIG_STATUS <<EOF
11473 #! /bin/sh
11474 # Generated automatically by configure.
11475 # Run this file to recreate the current configuration.
11476 # This directory was configured as follows,
11477 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
11478 #
11479 # $0 $ac_configure_args
11480 #
11481 # Compiler output produced by configure, useful for debugging
11482 # configure, is in ./config.log if it exists.
11483
11484 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
11485 for ac_option
11486 do
11487   case "\$ac_option" in
11488   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
11489     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
11490     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
11491   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
11492     echo "$CONFIG_STATUS generated by autoconf version 2.13"
11493     exit 0 ;;
11494   -help | --help | --hel | --he | --h)
11495     echo "\$ac_cs_usage"; exit 0 ;;
11496   *) echo "\$ac_cs_usage"; exit 1 ;;
11497   esac
11498 done
11499
11500 ac_given_srcdir=$srcdir
11501 ac_given_INSTALL="$INSTALL"
11502
11503 trap 'rm -fr `echo "\
11504 Makefile:build/top.mk:Makefile.in:build/dir.mk \
11505 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
11506 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
11507 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
11508 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
11509 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
11510 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
11511 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
11512 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
11513 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
11514 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
11515 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
11516 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
11517 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
11518 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
11519 include/Makefile:build/top.mk:include/Makefile.in \
11520 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
11521 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
11522 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11523 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11524 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
11525 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
11526 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
11527 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
11528 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
11529 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
11530 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
11531 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
11532 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
11533 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
11534 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
11535 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
11536 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
11537 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
11538 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
11539 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
11540 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
11541 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
11542 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
11543 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
11544 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
11545  include/portable.h include/ldap_features.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
11546 EOF
11547 cat >> $CONFIG_STATUS <<EOF
11548
11549 # Protect against being on the right side of a sed subst in config.status.
11550 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
11551  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
11552 $ac_vpsub
11553 $extrasub
11554 s%@SHELL@%$SHELL%g
11555 s%@CFLAGS@%$CFLAGS%g
11556 s%@CPPFLAGS@%$CPPFLAGS%g
11557 s%@CXXFLAGS@%$CXXFLAGS%g
11558 s%@FFLAGS@%$FFLAGS%g
11559 s%@DEFS@%$DEFS%g
11560 s%@LDFLAGS@%$LDFLAGS%g
11561 s%@LIBS@%$LIBS%g
11562 s%@exec_prefix@%$exec_prefix%g
11563 s%@prefix@%$prefix%g
11564 s%@program_transform_name@%$program_transform_name%g
11565 s%@bindir@%$bindir%g
11566 s%@sbindir@%$sbindir%g
11567 s%@libexecdir@%$libexecdir%g
11568 s%@datadir@%$datadir%g
11569 s%@sysconfdir@%$sysconfdir%g
11570 s%@sharedstatedir@%$sharedstatedir%g
11571 s%@localstatedir@%$localstatedir%g
11572 s%@libdir@%$libdir%g
11573 s%@includedir@%$includedir%g
11574 s%@oldincludedir@%$oldincludedir%g
11575 s%@infodir@%$infodir%g
11576 s%@mandir@%$mandir%g
11577 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
11578 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
11579 s%@INSTALL_DATA@%$INSTALL_DATA%g
11580 s%@PACKAGE@%$PACKAGE%g
11581 s%@VERSION@%$VERSION%g
11582 s%@ACLOCAL@%$ACLOCAL%g
11583 s%@AUTOCONF@%$AUTOCONF%g
11584 s%@AUTOMAKE@%$AUTOMAKE%g
11585 s%@AUTOHEADER@%$AUTOHEADER%g
11586 s%@MAKEINFO@%$MAKEINFO%g
11587 s%@SET_MAKE@%$SET_MAKE%g
11588 s%@top_builddir@%$top_builddir%g
11589 s%@ldap_subdir@%$ldap_subdir%g
11590 s%@host@%$host%g
11591 s%@host_alias@%$host_alias%g
11592 s%@host_cpu@%$host_cpu%g
11593 s%@host_vendor@%$host_vendor%g
11594 s%@host_os@%$host_os%g
11595 s%@RANLIB@%$RANLIB%g
11596 s%@CC@%$CC%g
11597 s%@LD@%$LD%g
11598 s%@NM@%$NM%g
11599 s%@LN_S@%$LN_S%g
11600 s%@LIBTOOL@%$LIBTOOL%g
11601 s%@AWK@%$AWK%g
11602 s%@LN_H@%$LN_H%g
11603 s%@SENDMAIL@%$SENDMAIL%g
11604 s%@EDITOR@%$EDITOR%g
11605 s%@FINGER@%$FINGER%g
11606 s%@GLIBCONFIG@%$GLIBCONFIG%g
11607 s%@PERLBIN@%$PERLBIN%g
11608 s%@CPP@%$CPP%g
11609 s%@EXEEXT@%$EXEEXT%g
11610 s%@OBJEXT@%$OBJEXT%g
11611 s%@PEPSY@%$PEPSY%g
11612 s%@LIBOBJS@%$LIBOBJS%g
11613 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
11614 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
11615 s%@BUILD_BDB2@%$BUILD_BDB2%g
11616 s%@BUILD_LDBM@%$BUILD_LDBM%g
11617 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
11618 s%@BUILD_PERL@%$BUILD_PERL%g
11619 s%@BUILD_SHELL@%$BUILD_SHELL%g
11620 s%@BUILD_TCL@%$BUILD_TCL%g
11621 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
11622 s%@LDAP_LIBS@%$LDAP_LIBS%g
11623 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
11624 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
11625 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
11626 s%@LDBM_LIBS@%$LDBM_LIBS%g
11627 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
11628 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
11629 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
11630 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
11631 s%@SLAPD_PERL_CPPFLAGS@%$SLAPD_PERL_CPPFLAGS%g
11632 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
11633 s%@KRB_LIBS@%$KRB_LIBS%g
11634 s%@READLINE_LIBS@%$READLINE_LIBS%g
11635 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
11636 s%@TLS_LIBS@%$TLS_LIBS%g
11637
11638 CEOF
11639 EOF
11640
11641 cat >> $CONFIG_STATUS <<\EOF
11642
11643 # Split the substitutions into bite-sized pieces for seds with
11644 # small command number limits, like on Digital OSF/1 and HP-UX.
11645 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
11646 ac_file=1 # Number of current file.
11647 ac_beg=1 # First line for current file.
11648 ac_end=$ac_max_sed_cmds # Line after last line for current file.
11649 ac_more_lines=:
11650 ac_sed_cmds=""
11651 while $ac_more_lines; do
11652   if test $ac_beg -gt 1; then
11653     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
11654   else
11655     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
11656   fi
11657   if test ! -s conftest.s$ac_file; then
11658     ac_more_lines=false
11659     rm -f conftest.s$ac_file
11660   else
11661     if test -z "$ac_sed_cmds"; then
11662       ac_sed_cmds="sed -f conftest.s$ac_file"
11663     else
11664       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
11665     fi
11666     ac_file=`expr $ac_file + 1`
11667     ac_beg=$ac_end
11668     ac_end=`expr $ac_end + $ac_max_sed_cmds`
11669   fi
11670 done
11671 if test -z "$ac_sed_cmds"; then
11672   ac_sed_cmds=cat
11673 fi
11674 EOF
11675
11676 cat >> $CONFIG_STATUS <<EOF
11677
11678 CONFIG_FILES=\${CONFIG_FILES-"\
11679 Makefile:build/top.mk:Makefile.in:build/dir.mk \
11680 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
11681 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
11682 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
11683 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
11684 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
11685 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
11686 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
11687 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
11688 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
11689 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
11690 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
11691 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
11692 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
11693 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
11694 include/Makefile:build/top.mk:include/Makefile.in \
11695 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
11696 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
11697 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11698 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11699 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
11700 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
11701 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
11702 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
11703 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
11704 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
11705 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
11706 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/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