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