]> git.sur5r.net Git - openldap/blob - configure
Obtain version name from build/version (re-add build/version).
[openldap] / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13 
5 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
6 #
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Defaults:
11 ac_help=
12 ac_default_prefix=/usr/local
13 # Any additions from configure.in:
14 ac_default_prefix=/usr/local
15 ac_help="$ac_help
16   --with-subdir=DIR change default subdirectory used for installs"
17 ac_help="$ac_help
18   --enable-debug        enable debugging (yes)"
19 ac_help="$ac_help
20   --enable-syslog       enable syslog support (auto)"
21 ac_help="$ac_help
22   --enable-proctitle    enable proctitle support (yes)"
23 ac_help="$ac_help
24   --enable-cache        enable caching (yes)"
25 ac_help="$ac_help
26   --enable-dns          enable V2 DNS  extension (no)"
27 ac_help="$ac_help
28   --enable-referrals    enable V2 Referrals extension (yes)"
29 ac_help="$ac_help
30   --enable-cldap        enable connectionless ldap (no)"
31 ac_help="$ac_help
32   --enable-x-compile    enable cross compiling (no)"
33 ac_help="$ac_help
34   --enable-dmalloc      enable debug malloc support (no)"
35 ac_help="$ac_help
36   --with-kerberos       with Kerberos support (auto)"
37 ac_help="$ac_help
38   --with-readline  with readline support (auto)"
39 ac_help="$ac_help
40   --with-threads        use threads (auto)"
41 ac_help="$ac_help
42   --with-tls  with TLS/SSL support (auto)"
43 ac_help="$ac_help
44   --with-yielding-select        with implicitly yielding select (auto)"
45 ac_help="$ac_help
46 LDAPD Options:"
47 ac_help="$ac_help
48   --enable-ldapd        enable building ldapd (no)"
49 ac_help="$ac_help
50 SLAPD Options:"
51 ac_help="$ac_help
52   --enable-slapd        enable building slapd (yes)"
53 ac_help="$ac_help
54     --enable-aclgroups  enable ACL group support (auto)"
55 ac_help="$ac_help
56     --enable-cleartext  enable cleartext passwords (yes)"
57 ac_help="$ac_help
58     --enable-crypt      enable crypt(3) passwords (auto)"
59 ac_help="$ac_help
60     --enable-modules    enable dynamic module support (no)"
61 ac_help="$ac_help
62     --enable-phonetic   enable phonetic/soundex (no)"
63 ac_help="$ac_help
64     --enable-rlookups   enable reverse lookups (auto)"
65 ac_help="$ac_help
66     --enable-wrappers   enable tcp wrapper support (no)"
67 ac_help="$ac_help
68     --enable-bdb2       enable bdb2 backend (no)"
69 ac_help="$ac_help
70     --enable-ldap       enable ldap backend (no)"
71 ac_help="$ac_help
72     --enable-ldbm       enable ldbm backend (yes)"
73 ac_help="$ac_help
74       --with-ldbm-api   use LDBM API (auto)"
75 ac_help="$ac_help
76       --with-ldbm-type  use LDBM type (auto)"
77 ac_help="$ac_help
78     --enable-passwd     enable passwd backend (no)"
79 ac_help="$ac_help
80     --enable-perl       enable perl backend (no)"
81 ac_help="$ac_help
82     --enable-shell      enable shell backend (no)"
83 ac_help="$ac_help
84     --enable-tcl        enable tcl backend (no)"
85 ac_help="$ac_help
86 SLURPD Options:"
87 ac_help="$ac_help
88   --enable-slurpd       enable building slurpd (auto)"
89 ac_help="$ac_help
90 Library Generation & Linking Options"
91 ac_help="$ac_help
92   --enable-static         build static libraries [default=yes]
93   --enable-static=PKGS    only build shared libraries if the current package
94                           appears as an element in the PKGS list"
95 ac_help="$ac_help
96   --enable-shared         build shared libraries [default=yes]
97   --enable-shared=PKGS    only build shared libraries if the current package
98                           appears as an element in the PKGS list"
99 ac_help="$ac_help
100   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
101
102 # Initialize some variables set by options.
103 # The variables have the same names as the options, with
104 # dashes changed to underlines.
105 build=NONE
106 cache_file=./config.cache
107 exec_prefix=NONE
108 host=NONE
109 no_create=
110 nonopt=NONE
111 no_recursion=
112 prefix=NONE
113 program_prefix=NONE
114 program_suffix=NONE
115 program_transform_name=s,x,x,
116 silent=
117 site=
118 srcdir=
119 target=NONE
120 verbose=
121 x_includes=NONE
122 x_libraries=NONE
123 bindir='${exec_prefix}/bin'
124 sbindir='${exec_prefix}/sbin'
125 libexecdir='${exec_prefix}/libexec'
126 datadir='${prefix}/share'
127 sysconfdir='${prefix}/etc'
128 sharedstatedir='${prefix}/com'
129 localstatedir='${prefix}/var'
130 libdir='${exec_prefix}/lib'
131 includedir='${prefix}/include'
132 oldincludedir='/usr/include'
133 infodir='${prefix}/info'
134 mandir='${prefix}/man'
135
136 # Initialize some other variables.
137 subdirs=
138 MFLAGS= MAKEFLAGS=
139 SHELL=${CONFIG_SHELL-/bin/sh}
140 # Maximum number of lines to put in a shell here document.
141 ac_max_here_lines=12
142
143 ac_prev=
144 for ac_option
145 do
146
147   # If the previous option needs an argument, assign it.
148   if test -n "$ac_prev"; then
149     eval "$ac_prev=\$ac_option"
150     ac_prev=
151     continue
152   fi
153
154   case "$ac_option" in
155   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
156   *) ac_optarg= ;;
157   esac
158
159   # Accept the important Cygnus configure options, so we can diagnose typos.
160
161   case "$ac_option" in
162
163   -bindir | --bindir | --bindi | --bind | --bin | --bi)
164     ac_prev=bindir ;;
165   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
166     bindir="$ac_optarg" ;;
167
168   -build | --build | --buil | --bui | --bu)
169     ac_prev=build ;;
170   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
171     build="$ac_optarg" ;;
172
173   -cache-file | --cache-file | --cache-fil | --cache-fi \
174   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
175     ac_prev=cache_file ;;
176   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
177   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
178     cache_file="$ac_optarg" ;;
179
180   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
181     ac_prev=datadir ;;
182   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
183   | --da=*)
184     datadir="$ac_optarg" ;;
185
186   -disable-* | --disable-*)
187     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
188     # Reject names that are not valid shell variable names.
189     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
190       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
191     fi
192     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
193     eval "enable_${ac_feature}=no" ;;
194
195   -enable-* | --enable-*)
196     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
197     # Reject names that are not valid shell variable names.
198     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
199       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
200     fi
201     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
202     case "$ac_option" in
203       *=*) ;;
204       *) ac_optarg=yes ;;
205     esac
206     eval "enable_${ac_feature}='$ac_optarg'" ;;
207
208   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
209   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
210   | --exec | --exe | --ex)
211     ac_prev=exec_prefix ;;
212   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
213   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
214   | --exec=* | --exe=* | --ex=*)
215     exec_prefix="$ac_optarg" ;;
216
217   -gas | --gas | --ga | --g)
218     # Obsolete; use --with-gas.
219     with_gas=yes ;;
220
221   -help | --help | --hel | --he)
222     # Omit some internal or obsolete options to make the list less imposing.
223     # This message is too long to be a string in the A/UX 3.1 sh.
224     cat << EOF
225 Usage: configure [options] [host]
226 Options: [defaults in brackets after descriptions]
227 Configuration:
228   --cache-file=FILE       cache test results in FILE
229   --help                  print this message
230   --no-create             do not create output files
231   --quiet, --silent       do not print \`checking...' messages
232   --version               print the version of autoconf that created configure
233 Directory and file names:
234   --prefix=PREFIX         install architecture-independent files in PREFIX
235                           [$ac_default_prefix]
236   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
237                           [same as prefix]
238   --bindir=DIR            user executables in DIR [EPREFIX/bin]
239   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
240   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
241   --datadir=DIR           read-only architecture-independent data in DIR
242                           [PREFIX/share]
243   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
244   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
245                           [PREFIX/com]
246   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
247   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
248   --includedir=DIR        C header files in DIR [PREFIX/include]
249   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
250   --infodir=DIR           info documentation in DIR [PREFIX/info]
251   --mandir=DIR            man documentation in DIR [PREFIX/man]
252   --srcdir=DIR            find the sources in DIR [configure dir or ..]
253   --program-prefix=PREFIX prepend PREFIX to installed program names
254   --program-suffix=SUFFIX append SUFFIX to installed program names
255   --program-transform-name=PROGRAM
256                           run sed PROGRAM on installed program names
257 EOF
258     cat << EOF
259 Host type:
260   --build=BUILD           configure for building on BUILD [BUILD=HOST]
261   --host=HOST             configure for HOST [guessed]
262   --target=TARGET         configure for TARGET [TARGET=HOST]
263 Features and packages:
264   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
265   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
266   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
267   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
268   --x-includes=DIR        X include files are in DIR
269   --x-libraries=DIR       X library files are in DIR
270 EOF
271     if test -n "$ac_help"; then
272       echo "--enable and --with options recognized:$ac_help"
273     fi
274     exit 0 ;;
275
276   -host | --host | --hos | --ho)
277     ac_prev=host ;;
278   -host=* | --host=* | --hos=* | --ho=*)
279     host="$ac_optarg" ;;
280
281   -includedir | --includedir | --includedi | --included | --include \
282   | --includ | --inclu | --incl | --inc)
283     ac_prev=includedir ;;
284   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
285   | --includ=* | --inclu=* | --incl=* | --inc=*)
286     includedir="$ac_optarg" ;;
287
288   -infodir | --infodir | --infodi | --infod | --info | --inf)
289     ac_prev=infodir ;;
290   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
291     infodir="$ac_optarg" ;;
292
293   -libdir | --libdir | --libdi | --libd)
294     ac_prev=libdir ;;
295   -libdir=* | --libdir=* | --libdi=* | --libd=*)
296     libdir="$ac_optarg" ;;
297
298   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
299   | --libexe | --libex | --libe)
300     ac_prev=libexecdir ;;
301   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
302   | --libexe=* | --libex=* | --libe=*)
303     libexecdir="$ac_optarg" ;;
304
305   -localstatedir | --localstatedir | --localstatedi | --localstated \
306   | --localstate | --localstat | --localsta | --localst \
307   | --locals | --local | --loca | --loc | --lo)
308     ac_prev=localstatedir ;;
309   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
310   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
311   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
312     localstatedir="$ac_optarg" ;;
313
314   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
315     ac_prev=mandir ;;
316   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
317     mandir="$ac_optarg" ;;
318
319   -nfp | --nfp | --nf)
320     # Obsolete; use --without-fp.
321     with_fp=no ;;
322
323   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
324   | --no-cr | --no-c)
325     no_create=yes ;;
326
327   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
328   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
329     no_recursion=yes ;;
330
331   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
332   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
333   | --oldin | --oldi | --old | --ol | --o)
334     ac_prev=oldincludedir ;;
335   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
336   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
337   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
338     oldincludedir="$ac_optarg" ;;
339
340   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
341     ac_prev=prefix ;;
342   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
343     prefix="$ac_optarg" ;;
344
345   -program-prefix | --program-prefix | --program-prefi | --program-pref \
346   | --program-pre | --program-pr | --program-p)
347     ac_prev=program_prefix ;;
348   -program-prefix=* | --program-prefix=* | --program-prefi=* \
349   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
350     program_prefix="$ac_optarg" ;;
351
352   -program-suffix | --program-suffix | --program-suffi | --program-suff \
353   | --program-suf | --program-su | --program-s)
354     ac_prev=program_suffix ;;
355   -program-suffix=* | --program-suffix=* | --program-suffi=* \
356   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
357     program_suffix="$ac_optarg" ;;
358
359   -program-transform-name | --program-transform-name \
360   | --program-transform-nam | --program-transform-na \
361   | --program-transform-n | --program-transform- \
362   | --program-transform | --program-transfor \
363   | --program-transfo | --program-transf \
364   | --program-trans | --program-tran \
365   | --progr-tra | --program-tr | --program-t)
366     ac_prev=program_transform_name ;;
367   -program-transform-name=* | --program-transform-name=* \
368   | --program-transform-nam=* | --program-transform-na=* \
369   | --program-transform-n=* | --program-transform-=* \
370   | --program-transform=* | --program-transfor=* \
371   | --program-transfo=* | --program-transf=* \
372   | --program-trans=* | --program-tran=* \
373   | --progr-tra=* | --program-tr=* | --program-t=*)
374     program_transform_name="$ac_optarg" ;;
375
376   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
377   | -silent | --silent | --silen | --sile | --sil)
378     silent=yes ;;
379
380   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
381     ac_prev=sbindir ;;
382   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
383   | --sbi=* | --sb=*)
384     sbindir="$ac_optarg" ;;
385
386   -sharedstatedir | --sharedstatedir | --sharedstatedi \
387   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
388   | --sharedst | --shareds | --shared | --share | --shar \
389   | --sha | --sh)
390     ac_prev=sharedstatedir ;;
391   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
392   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
393   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
394   | --sha=* | --sh=*)
395     sharedstatedir="$ac_optarg" ;;
396
397   -site | --site | --sit)
398     ac_prev=site ;;
399   -site=* | --site=* | --sit=*)
400     site="$ac_optarg" ;;
401
402   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
403     ac_prev=srcdir ;;
404   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
405     srcdir="$ac_optarg" ;;
406
407   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
408   | --syscon | --sysco | --sysc | --sys | --sy)
409     ac_prev=sysconfdir ;;
410   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
411   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
412     sysconfdir="$ac_optarg" ;;
413
414   -target | --target | --targe | --targ | --tar | --ta | --t)
415     ac_prev=target ;;
416   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
417     target="$ac_optarg" ;;
418
419   -v | -verbose | --verbose | --verbos | --verbo | --verb)
420     verbose=yes ;;
421
422   -version | --version | --versio | --versi | --vers)
423     echo "configure generated by autoconf version 2.13"
424     exit 0 ;;
425
426   -with-* | --with-*)
427     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
428     # Reject names that are not valid shell variable names.
429     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
430       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
431     fi
432     ac_package=`echo $ac_package| sed 's/-/_/g'`
433     case "$ac_option" in
434       *=*) ;;
435       *) ac_optarg=yes ;;
436     esac
437     eval "with_${ac_package}='$ac_optarg'" ;;
438
439   -without-* | --without-*)
440     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
441     # Reject names that are not valid shell variable names.
442     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
443       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
444     fi
445     ac_package=`echo $ac_package| sed 's/-/_/g'`
446     eval "with_${ac_package}=no" ;;
447
448   --x)
449     # Obsolete; use --with-x.
450     with_x=yes ;;
451
452   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
453   | --x-incl | --x-inc | --x-in | --x-i)
454     ac_prev=x_includes ;;
455   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
456   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
457     x_includes="$ac_optarg" ;;
458
459   -x-libraries | --x-libraries | --x-librarie | --x-librari \
460   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
461     ac_prev=x_libraries ;;
462   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
463   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
464     x_libraries="$ac_optarg" ;;
465
466   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
467     ;;
468
469   *)
470     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
471       echo "configure: warning: $ac_option: invalid host type" 1>&2
472     fi
473     if test "x$nonopt" != xNONE; then
474       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
475     fi
476     nonopt="$ac_option"
477     ;;
478
479   esac
480 done
481
482 if test -n "$ac_prev"; then
483   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
484 fi
485
486 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
487
488 # File descriptor usage:
489 # 0 standard input
490 # 1 file creation
491 # 2 errors and warnings
492 # 3 some systems may open it to /dev/tty
493 # 4 used on the Kubota Titan
494 # 6 checking for... messages and results
495 # 5 compiler messages saved in config.log
496 if test "$silent" = yes; then
497   exec 6>/dev/null
498 else
499   exec 6>&1
500 fi
501 exec 5>./config.log
502
503 echo "\
504 This file contains any messages produced by compilers while
505 running configure, to aid debugging if configure makes a mistake.
506 " 1>&5
507
508 # Strip out --no-create and --no-recursion so they do not pile up.
509 # Also quote any args containing shell metacharacters.
510 ac_configure_args=
511 for ac_arg
512 do
513   case "$ac_arg" in
514   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
515   | --no-cr | --no-c) ;;
516   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
517   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
518   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
519   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
520   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
521   esac
522 done
523
524 # NLS nuisances.
525 # Only set these to C if already set.  These must not be set unconditionally
526 # because not all systems understand e.g. LANG=C (notably SCO).
527 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
528 # Non-C LC_CTYPE values break the ctype check.
529 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
530 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
531 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
532 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
533
534 # confdefs.h avoids OS command line length limits that DEFS can exceed.
535 rm -rf conftest* confdefs.h
536 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
537 echo > confdefs.h
538
539 # A filename unique to this package, relative to the directory that
540 # configure is in, which we can look for to find out if srcdir is correct.
541 ac_unique_file=build/version
542
543 # Find the source files, if location was not specified.
544 if test -z "$srcdir"; then
545   ac_srcdir_defaulted=yes
546   # Try the directory containing this script, then its parent.
547   ac_prog=$0
548   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
549   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
550   srcdir=$ac_confdir
551   if test ! -r $srcdir/$ac_unique_file; then
552     srcdir=..
553   fi
554 else
555   ac_srcdir_defaulted=no
556 fi
557 if test ! -r $srcdir/$ac_unique_file; then
558   if test "$ac_srcdir_defaulted" = yes; then
559     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
560   else
561     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
562   fi
563 fi
564 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
565
566 # Prefer explicitly selected file to automatically selected ones.
567 if test -z "$CONFIG_SITE"; then
568   if test "x$prefix" != xNONE; then
569     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
570   else
571     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
572   fi
573 fi
574 for ac_site_file in $CONFIG_SITE; do
575   if test -r "$ac_site_file"; then
576     echo "loading site script $ac_site_file"
577     . "$ac_site_file"
578   fi
579 done
580
581
582 ac_ext=c
583 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
584 ac_cpp='$CPP $CPPFLAGS'
585 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
586 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
587 cross_compiling=$ac_cv_prog_cc_cross
588
589 ac_exeext=
590 ac_objext=o
591 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
592   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
593   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
594     ac_n= ac_c='
595 ' ac_t='        '
596   else
597     ac_n=-n ac_c= ac_t=
598   fi
599 else
600   ac_n= ac_c='\c' ac_t=
601 fi
602
603 ac_aux_dir=
604 for ac_dir in build $srcdir/build; do
605   if test -f $ac_dir/install-sh; then
606     ac_aux_dir=$ac_dir
607     ac_install_sh="$ac_aux_dir/install-sh -c"
608     break
609   elif test -f $ac_dir/install.sh; then
610     ac_aux_dir=$ac_dir
611     ac_install_sh="$ac_aux_dir/install.sh -c"
612     break
613   fi
614 done
615 if test -z "$ac_aux_dir"; then
616   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
617 fi
618 ac_config_guess=$ac_aux_dir/config.guess
619 ac_config_sub=$ac_aux_dir/config.sub
620 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
621
622 OL_VERSION=`cat $ac_aux_dir/version`
623 if test -z "$OL_VERSION"; then
624         { echo "configure: error: could not determine version" 1>&2; exit 1; }
625 fi
626
627 # Find a good install program.  We prefer a C program (faster),
628 # so one script is as good as another.  But avoid the broken or
629 # incompatible versions:
630 # SysV /etc/install, /usr/sbin/install
631 # SunOS /usr/etc/install
632 # IRIX /sbin/install
633 # AIX /bin/install
634 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
635 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
636 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
637 # ./install, which can be erroneously created by make from ./install.sh.
638 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
639 echo "configure:640: checking for a BSD compatible install" >&5
640 if test -z "$INSTALL"; then
641 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
642   echo $ac_n "(cached) $ac_c" 1>&6
643 else
644     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
645   for ac_dir in $PATH; do
646     # Account for people who put trailing slashes in PATH elements.
647     case "$ac_dir/" in
648     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
649     *)
650       # OSF1 and SCO ODT 3.0 have their own names for install.
651       # Don't use installbsd from OSF since it installs stuff as root
652       # by default.
653       for ac_prog in ginstall scoinst install; do
654         if test -f $ac_dir/$ac_prog; then
655           if test $ac_prog = install &&
656             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
657             # AIX install.  It has an incompatible calling convention.
658             :
659           else
660             ac_cv_path_install="$ac_dir/$ac_prog -c"
661             break 2
662           fi
663         fi
664       done
665       ;;
666     esac
667   done
668   IFS="$ac_save_IFS"
669
670 fi
671   if test "${ac_cv_path_install+set}" = set; then
672     INSTALL="$ac_cv_path_install"
673   else
674     # As a last resort, use the slow shell script.  We don't cache a
675     # path for INSTALL within a source directory, because that will
676     # break other packages using the cache if that directory is
677     # removed, or if the path is relative.
678     INSTALL="$ac_install_sh"
679   fi
680 fi
681 echo "$ac_t""$INSTALL" 1>&6
682
683 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
684 # It thinks the first close brace ends the variable substitution.
685 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
686
687 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
688
689 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
690
691 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
692 echo "configure:693: checking whether build environment is sane" >&5
693 # Just in case
694 sleep 1
695 echo timestamp > conftestfile
696 # Do `set' in a subshell so we don't clobber the current shell's
697 # arguments.  Must try -L first in case configure is actually a
698 # symlink; some systems play weird games with the mod time of symlinks
699 # (eg FreeBSD returns the mod time of the symlink's containing
700 # directory).
701 if (
702    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
703    if test "$*" = "X"; then
704       # -L didn't work.
705       set X `ls -t $srcdir/configure conftestfile`
706    fi
707    if test "$*" != "X $srcdir/configure conftestfile" \
708       && test "$*" != "X conftestfile $srcdir/configure"; then
709
710       # If neither matched, then we have a broken ls.  This can happen
711       # if, for instance, CONFIG_SHELL is bash and it inherits a
712       # broken ls alias from the environment.  This has actually
713       # happened.  Such a system could not be considered "sane".
714       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
715 alias in your environment" 1>&2; exit 1; }
716    fi
717
718    test "$2" = conftestfile
719    )
720 then
721    # Ok.
722    :
723 else
724    { echo "configure: error: newly created file is older than distributed files!
725 Check your system clock" 1>&2; exit 1; }
726 fi
727 rm -f conftest*
728 echo "$ac_t""yes" 1>&6
729 if test "$program_transform_name" = s,x,x,; then
730   program_transform_name=
731 else
732   # Double any \ or $.  echo might interpret backslashes.
733   cat <<\EOF_SED > conftestsed
734 s,\\,\\\\,g; s,\$,$$,g
735 EOF_SED
736   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
737   rm -f conftestsed
738 fi
739 test "$program_prefix" != NONE &&
740   program_transform_name="s,^,${program_prefix},; $program_transform_name"
741 # Use a double $ so make ignores it.
742 test "$program_suffix" != NONE &&
743   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
744
745 # sed with no file args requires a program.
746 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
747
748 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
749 echo "configure:750: checking whether ${MAKE-make} sets \${MAKE}" >&5
750 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
751 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
752   echo $ac_n "(cached) $ac_c" 1>&6
753 else
754   cat > conftestmake <<\EOF
755 all:
756         @echo 'ac_maketemp="${MAKE}"'
757 EOF
758 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
759 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
760 if test -n "$ac_maketemp"; then
761   eval ac_cv_prog_make_${ac_make}_set=yes
762 else
763   eval ac_cv_prog_make_${ac_make}_set=no
764 fi
765 rm -f conftestmake
766 fi
767 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
768   echo "$ac_t""yes" 1>&6
769   SET_MAKE=
770 else
771   echo "$ac_t""no" 1>&6
772   SET_MAKE="MAKE=${MAKE-make}"
773 fi
774
775
776 PACKAGE=OpenLDAP
777
778 VERSION=$OL_VERSION
779
780 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
781   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
782 fi
783
784
785
786 missing_dir=`cd $ac_aux_dir && pwd`
787 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
788 echo "configure:789: checking for working aclocal" >&5
789 # Run test in a subshell; some versions of sh will print an error if
790 # an executable is not found, even if stderr is redirected.
791 # Redirect stdin to placate older versions of autoconf.  Sigh.
792 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
793    ACLOCAL=aclocal
794    echo "$ac_t""found" 1>&6
795 else
796    ACLOCAL="$missing_dir/missing aclocal"
797    echo "$ac_t""missing" 1>&6
798 fi
799
800 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
801 echo "configure:802: checking for working autoconf" >&5
802 # Run test in a subshell; some versions of sh will print an error if
803 # an executable is not found, even if stderr is redirected.
804 # Redirect stdin to placate older versions of autoconf.  Sigh.
805 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
806    AUTOCONF=autoconf
807    echo "$ac_t""found" 1>&6
808 else
809    AUTOCONF="$missing_dir/missing autoconf"
810    echo "$ac_t""missing" 1>&6
811 fi
812
813 echo $ac_n "checking for working automake""... $ac_c" 1>&6
814 echo "configure:815: checking for working automake" >&5
815 # Run test in a subshell; some versions of sh will print an error if
816 # an executable is not found, even if stderr is redirected.
817 # Redirect stdin to placate older versions of autoconf.  Sigh.
818 if (automake --version) < /dev/null > /dev/null 2>&1; then
819    AUTOMAKE=automake
820    echo "$ac_t""found" 1>&6
821 else
822    AUTOMAKE="$missing_dir/missing automake"
823    echo "$ac_t""missing" 1>&6
824 fi
825
826 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
827 echo "configure:828: checking for working autoheader" >&5
828 # Run test in a subshell; some versions of sh will print an error if
829 # an executable is not found, even if stderr is redirected.
830 # Redirect stdin to placate older versions of autoconf.  Sigh.
831 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
832    AUTOHEADER=autoheader
833    echo "$ac_t""found" 1>&6
834 else
835    AUTOHEADER="$missing_dir/missing autoheader"
836    echo "$ac_t""missing" 1>&6
837 fi
838
839 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
840 echo "configure:841: checking for working makeinfo" >&5
841 # Run test in a subshell; some versions of sh will print an error if
842 # an executable is not found, even if stderr is redirected.
843 # Redirect stdin to placate older versions of autoconf.  Sigh.
844 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
845    MAKEINFO=makeinfo
846    echo "$ac_t""found" 1>&6
847 else
848    MAKEINFO="$missing_dir/missing makeinfo"
849    echo "$ac_t""missing" 1>&6
850 fi
851
852
853
854 cat >> confdefs.h <<EOF
855 #define OPENLDAP_PACKAGE "$PACKAGE"
856 EOF
857
858 cat >> confdefs.h <<EOF
859 #define OPENLDAP_VERSION "$VERSION"
860 EOF
861
862
863
864
865 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
866 echo "configure:867: checking configure arguments" >&5
867
868
869 top_builddir=`pwd`
870
871 cat >> confdefs.h <<\EOF
872 #define HAVE_MKVERSION 1
873 EOF
874
875
876 ldap_subdir="openldap"
877
878 # Check whether --with-subdir or --without-subdir was given.
879 if test "${with_subdir+set}" = set; then
880   withval="$with_subdir"
881   
882         if test "$withval" = "no"; then
883                 ldap_subdir=""
884         elif test "$withval" != "yes"; then
885                 ldap_subdir="$withval"
886         fi
887
888 fi
889
890
891 # OpenLDAP --enable-debug
892         # Check whether --enable-debug or --disable-debug was given.
893 if test "${enable_debug+set}" = set; then
894   enableval="$enable_debug"
895   
896         ol_arg=invalid
897         for ol_val in auto yes no ; do
898                 if test "$enableval" = "$ol_val" ; then
899                         ol_arg="$ol_val"
900                 fi
901         done
902         if test "$ol_arg" = "invalid" ; then
903                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
904         fi
905         ol_enable_debug="$ol_arg"
906
907 else
908         ol_enable_debug="yes"
909 fi
910 # end --enable-debug
911 # OpenLDAP --enable-syslog
912         # Check whether --enable-syslog or --disable-syslog was given.
913 if test "${enable_syslog+set}" = set; then
914   enableval="$enable_syslog"
915   
916         ol_arg=invalid
917         for ol_val in auto yes no ; do
918                 if test "$enableval" = "$ol_val" ; then
919                         ol_arg="$ol_val"
920                 fi
921         done
922         if test "$ol_arg" = "invalid" ; then
923                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
924         fi
925         ol_enable_syslog="$ol_arg"
926
927 else
928         ol_enable_syslog="auto"
929 fi
930 # end --enable-syslog
931 # OpenLDAP --enable-proctitle
932         # Check whether --enable-proctitle or --disable-proctitle was given.
933 if test "${enable_proctitle+set}" = set; then
934   enableval="$enable_proctitle"
935   
936         ol_arg=invalid
937         for ol_val in auto yes no ; do
938                 if test "$enableval" = "$ol_val" ; then
939                         ol_arg="$ol_val"
940                 fi
941         done
942         if test "$ol_arg" = "invalid" ; then
943                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
944         fi
945         ol_enable_proctitle="$ol_arg"
946
947 else
948         ol_enable_proctitle="yes"
949 fi
950 # end --enable-proctitle
951 # OpenLDAP --enable-cache
952         # Check whether --enable-cache or --disable-cache was given.
953 if test "${enable_cache+set}" = set; then
954   enableval="$enable_cache"
955   
956         ol_arg=invalid
957         for ol_val in auto yes no ; do
958                 if test "$enableval" = "$ol_val" ; then
959                         ol_arg="$ol_val"
960                 fi
961         done
962         if test "$ol_arg" = "invalid" ; then
963                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
964         fi
965         ol_enable_cache="$ol_arg"
966
967 else
968         ol_enable_cache="yes"
969 fi
970 # end --enable-cache
971 # OpenLDAP --enable-dns
972         # Check whether --enable-dns or --disable-dns was given.
973 if test "${enable_dns+set}" = set; then
974   enableval="$enable_dns"
975   
976         ol_arg=invalid
977         for ol_val in auto yes no ; do
978                 if test "$enableval" = "$ol_val" ; then
979                         ol_arg="$ol_val"
980                 fi
981         done
982         if test "$ol_arg" = "invalid" ; then
983                 { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; }
984         fi
985         ol_enable_dns="$ol_arg"
986
987 else
988         ol_enable_dns="no"
989 fi
990 # end --enable-dns
991 # OpenLDAP --enable-referrals
992         # Check whether --enable-referrals or --disable-referrals was given.
993 if test "${enable_referrals+set}" = set; then
994   enableval="$enable_referrals"
995   
996         ol_arg=invalid
997         for ol_val in auto yes no ; do
998                 if test "$enableval" = "$ol_val" ; then
999                         ol_arg="$ol_val"
1000                 fi
1001         done
1002         if test "$ol_arg" = "invalid" ; then
1003                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1004         fi
1005         ol_enable_referrals="$ol_arg"
1006
1007 else
1008         ol_enable_referrals="yes"
1009 fi
1010 # end --enable-referrals
1011 # OpenLDAP --enable-cldap
1012         # Check whether --enable-cldap or --disable-cldap was given.
1013 if test "${enable_cldap+set}" = set; then
1014   enableval="$enable_cldap"
1015   
1016         ol_arg=invalid
1017         for ol_val in auto yes no ; do
1018                 if test "$enableval" = "$ol_val" ; then
1019                         ol_arg="$ol_val"
1020                 fi
1021         done
1022         if test "$ol_arg" = "invalid" ; then
1023                 { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; }
1024         fi
1025         ol_enable_cldap="$ol_arg"
1026
1027 else
1028         ol_enable_cldap="no"
1029 fi
1030 # end --enable-cldap
1031 # OpenLDAP --enable-x_compile
1032         # Check whether --enable-x_compile or --disable-x_compile was given.
1033 if test "${enable_x_compile+set}" = set; then
1034   enableval="$enable_x_compile"
1035   
1036         ol_arg=invalid
1037         for ol_val in yes no ; do
1038                 if test "$enableval" = "$ol_val" ; then
1039                         ol_arg="$ol_val"
1040                 fi
1041         done
1042         if test "$ol_arg" = "invalid" ; then
1043                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1044         fi
1045         ol_enable_x_compile="$ol_arg"
1046
1047 else
1048         ol_enable_x_compile="no"
1049 fi
1050 # end --enable-x_compile
1051
1052 # OpenLDAP --enable-dmalloc
1053         # Check whether --enable-dmalloc or --disable-dmalloc was given.
1054 if test "${enable_dmalloc+set}" = set; then
1055   enableval="$enable_dmalloc"
1056   
1057         ol_arg=invalid
1058         for ol_val in auto yes no ; do
1059                 if test "$enableval" = "$ol_val" ; then
1060                         ol_arg="$ol_val"
1061                 fi
1062         done
1063         if test "$ol_arg" = "invalid" ; then
1064                 { echo "configure: error: bad value $enableval for --enable-dmalloc" 1>&2; exit 1; }
1065         fi
1066         ol_enable_dmalloc="$ol_arg"
1067
1068 else
1069         ol_enable_dmalloc="no"
1070 fi
1071 # end --enable-dmalloc
1072
1073 # OpenLDAP --with-kerberos
1074         # Check whether --with-kerberos or --without-kerberos was given.
1075 if test "${with_kerberos+set}" = set; then
1076   withval="$with_kerberos"
1077   
1078         ol_arg=invalid
1079         for ol_val in auto k5 k4 afs yes no ; do
1080                 if test "$withval" = "$ol_val" ; then
1081                         ol_arg="$ol_val"
1082                 fi
1083         done
1084         if test "$ol_arg" = "invalid" ; then
1085                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1086         fi
1087         ol_with_kerberos="$ol_arg"
1088
1089 else
1090         ol_with_kerberos="auto"
1091 fi
1092 # end --with-kerberos
1093
1094 # OpenLDAP --with-readline
1095         # Check whether --with-readline or --without-readline was given.
1096 if test "${with_readline+set}" = set; then
1097   withval="$with_readline"
1098   
1099         ol_arg=invalid
1100         for ol_val in auto yes no  ; do
1101                 if test "$withval" = "$ol_val" ; then
1102                         ol_arg="$ol_val"
1103                 fi
1104         done
1105         if test "$ol_arg" = "invalid" ; then
1106                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1107         fi
1108         ol_with_readline="$ol_arg"
1109
1110 else
1111         ol_with_readline="auto"
1112 fi
1113 # end --with-readline
1114
1115 # OpenLDAP --with-threads
1116         # Check whether --with-threads or --without-threads was given.
1117 if test "${with_threads+set}" = set; then
1118   withval="$with_threads"
1119   
1120         ol_arg=invalid
1121         for ol_val in auto posix mach lwp yes no manual  ; do
1122                 if test "$withval" = "$ol_val" ; then
1123                         ol_arg="$ol_val"
1124                 fi
1125         done
1126         if test "$ol_arg" = "invalid" ; then
1127                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1128         fi
1129         ol_with_threads="$ol_arg"
1130
1131 else
1132         ol_with_threads="auto"
1133 fi
1134 # end --with-threads
1135
1136 # OpenLDAP --with-tls
1137         # Check whether --with-tls or --without-tls was given.
1138 if test "${with_tls+set}" = set; then
1139   withval="$with_tls"
1140   
1141         ol_arg=invalid
1142         for ol_val in auto ssleay openssl yes no  ; do
1143                 if test "$withval" = "$ol_val" ; then
1144                         ol_arg="$ol_val"
1145                 fi
1146         done
1147         if test "$ol_arg" = "invalid" ; then
1148                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1149         fi
1150         ol_with_tls="$ol_arg"
1151
1152 else
1153         ol_with_tls="auto"
1154 fi
1155 # end --with-tls
1156
1157 # OpenLDAP --with-yielding_select
1158         # Check whether --with-yielding_select or --without-yielding_select was given.
1159 if test "${with_yielding_select+set}" = set; then
1160   withval="$with_yielding_select"
1161   
1162         ol_arg=invalid
1163         for ol_val in auto yes no manual  ; do
1164                 if test "$withval" = "$ol_val" ; then
1165                         ol_arg="$ol_val"
1166                 fi
1167         done
1168         if test "$ol_arg" = "invalid" ; then
1169                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1170         fi
1171         ol_with_yielding_select="$ol_arg"
1172
1173 else
1174         ol_with_yielding_select="auto"
1175 fi
1176 # end --with-yielding_select
1177
1178
1179
1180 # Check whether --with-xxldapdoptions or --without-xxldapdoptions was given.
1181 if test "${with_xxldapdoptions+set}" = set; then
1182   withval="$with_xxldapdoptions"
1183   :
1184 fi
1185
1186 # OpenLDAP --enable-ldapd
1187         # Check whether --enable-ldapd or --disable-ldapd was given.
1188 if test "${enable_ldapd+set}" = set; then
1189   enableval="$enable_ldapd"
1190   
1191         ol_arg=invalid
1192         for ol_val in auto yes no ; do
1193                 if test "$enableval" = "$ol_val" ; then
1194                         ol_arg="$ol_val"
1195                 fi
1196         done
1197         if test "$ol_arg" = "invalid" ; then
1198                 { echo "configure: error: bad value $enableval for --enable-ldapd" 1>&2; exit 1; }
1199         fi
1200         ol_enable_ldapd="$ol_arg"
1201
1202 else
1203         ol_enable_ldapd="no"
1204 fi
1205 # end --enable-ldapd
1206
1207 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1208 if test "${with_xxslapdoptions+set}" = set; then
1209   withval="$with_xxslapdoptions"
1210   :
1211 fi
1212
1213 # OpenLDAP --enable-slapd
1214         # Check whether --enable-slapd or --disable-slapd was given.
1215 if test "${enable_slapd+set}" = set; then
1216   enableval="$enable_slapd"
1217   
1218         ol_arg=invalid
1219         for ol_val in auto yes no ; do
1220                 if test "$enableval" = "$ol_val" ; then
1221                         ol_arg="$ol_val"
1222                 fi
1223         done
1224         if test "$ol_arg" = "invalid" ; then
1225                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1226         fi
1227         ol_enable_slapd="$ol_arg"
1228
1229 else
1230         ol_enable_slapd="yes"
1231 fi
1232 # end --enable-slapd
1233 # OpenLDAP --enable-aclgroups
1234         # Check whether --enable-aclgroups or --disable-aclgroups was given.
1235 if test "${enable_aclgroups+set}" = set; then
1236   enableval="$enable_aclgroups"
1237   
1238         ol_arg=invalid
1239         for ol_val in auto yes no ; do
1240                 if test "$enableval" = "$ol_val" ; then
1241                         ol_arg="$ol_val"
1242                 fi
1243         done
1244         if test "$ol_arg" = "invalid" ; then
1245                 { echo "configure: error: bad value $enableval for --enable-aclgroups" 1>&2; exit 1; }
1246         fi
1247         ol_enable_aclgroups="$ol_arg"
1248
1249 else
1250         ol_enable_aclgroups="auto"
1251 fi
1252 # end --enable-aclgroups
1253 # OpenLDAP --enable-cleartext
1254         # Check whether --enable-cleartext or --disable-cleartext was given.
1255 if test "${enable_cleartext+set}" = set; then
1256   enableval="$enable_cleartext"
1257   
1258         ol_arg=invalid
1259         for ol_val in auto yes no ; do
1260                 if test "$enableval" = "$ol_val" ; then
1261                         ol_arg="$ol_val"
1262                 fi
1263         done
1264         if test "$ol_arg" = "invalid" ; then
1265                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1266         fi
1267         ol_enable_cleartext="$ol_arg"
1268
1269 else
1270         ol_enable_cleartext="yes"
1271 fi
1272 # end --enable-cleartext
1273 # OpenLDAP --enable-crypt
1274         # Check whether --enable-crypt or --disable-crypt was given.
1275 if test "${enable_crypt+set}" = set; then
1276   enableval="$enable_crypt"
1277   
1278         ol_arg=invalid
1279         for ol_val in auto yes no ; do
1280                 if test "$enableval" = "$ol_val" ; then
1281                         ol_arg="$ol_val"
1282                 fi
1283         done
1284         if test "$ol_arg" = "invalid" ; then
1285                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1286         fi
1287         ol_enable_crypt="$ol_arg"
1288
1289 else
1290         ol_enable_crypt="auto"
1291 fi
1292 # end --enable-crypt
1293 # OpenLDAP --enable-modules
1294         # Check whether --enable-modules or --disable-modules was given.
1295 if test "${enable_modules+set}" = set; then
1296   enableval="$enable_modules"
1297   
1298         ol_arg=invalid
1299         for ol_val in auto yes no ; do
1300                 if test "$enableval" = "$ol_val" ; then
1301                         ol_arg="$ol_val"
1302                 fi
1303         done
1304         if test "$ol_arg" = "invalid" ; then
1305                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1306         fi
1307         ol_enable_modules="$ol_arg"
1308
1309 else
1310         ol_enable_modules="no"
1311 fi
1312 # end --enable-modules
1313 # OpenLDAP --enable-phonetic
1314         # Check whether --enable-phonetic or --disable-phonetic was given.
1315 if test "${enable_phonetic+set}" = set; then
1316   enableval="$enable_phonetic"
1317   
1318         ol_arg=invalid
1319         for ol_val in auto yes no ; do
1320                 if test "$enableval" = "$ol_val" ; then
1321                         ol_arg="$ol_val"
1322                 fi
1323         done
1324         if test "$ol_arg" = "invalid" ; then
1325                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1326         fi
1327         ol_enable_phonetic="$ol_arg"
1328
1329 else
1330         ol_enable_phonetic="no"
1331 fi
1332 # end --enable-phonetic
1333 # OpenLDAP --enable-rlookups
1334         # Check whether --enable-rlookups or --disable-rlookups was given.
1335 if test "${enable_rlookups+set}" = set; then
1336   enableval="$enable_rlookups"
1337   
1338         ol_arg=invalid
1339         for ol_val in auto yes no ; do
1340                 if test "$enableval" = "$ol_val" ; then
1341                         ol_arg="$ol_val"
1342                 fi
1343         done
1344         if test "$ol_arg" = "invalid" ; then
1345                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1346         fi
1347         ol_enable_rlookups="$ol_arg"
1348
1349 else
1350         ol_enable_rlookups="auto"
1351 fi
1352 # end --enable-rlookups
1353 # OpenLDAP --enable-wrappers
1354         # Check whether --enable-wrappers or --disable-wrappers was given.
1355 if test "${enable_wrappers+set}" = set; then
1356   enableval="$enable_wrappers"
1357   
1358         ol_arg=invalid
1359         for ol_val in auto yes no ; do
1360                 if test "$enableval" = "$ol_val" ; then
1361                         ol_arg="$ol_val"
1362                 fi
1363         done
1364         if test "$ol_arg" = "invalid" ; then
1365                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1366         fi
1367         ol_enable_wrappers="$ol_arg"
1368
1369 else
1370         ol_enable_wrappers="no"
1371 fi
1372 # end --enable-wrappers
1373
1374 # OpenLDAP --enable-bdb2
1375         # Check whether --enable-bdb2 or --disable-bdb2 was given.
1376 if test "${enable_bdb2+set}" = set; then
1377   enableval="$enable_bdb2"
1378   
1379         ol_arg=invalid
1380         for ol_val in auto yes no ; do
1381                 if test "$enableval" = "$ol_val" ; then
1382                         ol_arg="$ol_val"
1383                 fi
1384         done
1385         if test "$ol_arg" = "invalid" ; then
1386                 { echo "configure: error: bad value $enableval for --enable-bdb2" 1>&2; exit 1; }
1387         fi
1388         ol_enable_bdb2="$ol_arg"
1389
1390 else
1391         ol_enable_bdb2="no"
1392 fi
1393 # end --enable-bdb2
1394 # OpenLDAP --enable-ldap
1395         # Check whether --enable-ldap or --disable-ldap was given.
1396 if test "${enable_ldap+set}" = set; then
1397   enableval="$enable_ldap"
1398   
1399         ol_arg=invalid
1400         for ol_val in auto yes no ; do
1401                 if test "$enableval" = "$ol_val" ; then
1402                         ol_arg="$ol_val"
1403                 fi
1404         done
1405         if test "$ol_arg" = "invalid" ; then
1406                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1407         fi
1408         ol_enable_ldap="$ol_arg"
1409
1410 else
1411         ol_enable_ldap="no"
1412 fi
1413 # end --enable-ldap
1414 # OpenLDAP --enable-ldbm
1415         # Check whether --enable-ldbm or --disable-ldbm was given.
1416 if test "${enable_ldbm+set}" = set; then
1417   enableval="$enable_ldbm"
1418   
1419         ol_arg=invalid
1420         for ol_val in auto yes no ; do
1421                 if test "$enableval" = "$ol_val" ; then
1422                         ol_arg="$ol_val"
1423                 fi
1424         done
1425         if test "$ol_arg" = "invalid" ; then
1426                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1427         fi
1428         ol_enable_ldbm="$ol_arg"
1429
1430 else
1431         ol_enable_ldbm="yes"
1432 fi
1433 # end --enable-ldbm
1434 # OpenLDAP --with-ldbm_api
1435         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1436 if test "${with_ldbm_api+set}" = set; then
1437   withval="$with_ldbm_api"
1438   
1439         ol_arg=invalid
1440         for ol_val in auto db2 db mdbm gdbm ndbm manual ; do
1441                 if test "$withval" = "$ol_val" ; then
1442                         ol_arg="$ol_val"
1443                 fi
1444         done
1445         if test "$ol_arg" = "invalid" ; then
1446                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1447         fi
1448         ol_with_ldbm_api="$ol_arg"
1449
1450 else
1451         ol_with_ldbm_api="auto"
1452 fi
1453 # end --with-ldbm_api
1454
1455 # OpenLDAP --with-ldbm_type
1456         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1457 if test "${with_ldbm_type+set}" = set; then
1458   withval="$with_ldbm_type"
1459   
1460         ol_arg=invalid
1461         for ol_val in auto btree hash ; do
1462                 if test "$withval" = "$ol_val" ; then
1463                         ol_arg="$ol_val"
1464                 fi
1465         done
1466         if test "$ol_arg" = "invalid" ; then
1467                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1468         fi
1469         ol_with_ldbm_type="$ol_arg"
1470
1471 else
1472         ol_with_ldbm_type="auto"
1473 fi
1474 # end --with-ldbm_type
1475
1476
1477 # OpenLDAP --enable-passwd
1478         # Check whether --enable-passwd or --disable-passwd was given.
1479 if test "${enable_passwd+set}" = set; then
1480   enableval="$enable_passwd"
1481   
1482         ol_arg=invalid
1483         for ol_val in auto yes no ; do
1484                 if test "$enableval" = "$ol_val" ; then
1485                         ol_arg="$ol_val"
1486                 fi
1487         done
1488         if test "$ol_arg" = "invalid" ; then
1489                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1490         fi
1491         ol_enable_passwd="$ol_arg"
1492
1493 else
1494         ol_enable_passwd="no"
1495 fi
1496 # end --enable-passwd
1497 # OpenLDAP --enable-perl
1498         # Check whether --enable-perl or --disable-perl was given.
1499 if test "${enable_perl+set}" = set; then
1500   enableval="$enable_perl"
1501   
1502         ol_arg=invalid
1503         for ol_val in auto yes no ; do
1504                 if test "$enableval" = "$ol_val" ; then
1505                         ol_arg="$ol_val"
1506                 fi
1507         done
1508         if test "$ol_arg" = "invalid" ; then
1509                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
1510         fi
1511         ol_enable_perl="$ol_arg"
1512
1513 else
1514         ol_enable_perl="no"
1515 fi
1516 # end --enable-perl
1517 # OpenLDAP --enable-shell
1518         # Check whether --enable-shell or --disable-shell was given.
1519 if test "${enable_shell+set}" = set; then
1520   enableval="$enable_shell"
1521   
1522         ol_arg=invalid
1523         for ol_val in auto yes no ; do
1524                 if test "$enableval" = "$ol_val" ; then
1525                         ol_arg="$ol_val"
1526                 fi
1527         done
1528         if test "$ol_arg" = "invalid" ; then
1529                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
1530         fi
1531         ol_enable_shell="$ol_arg"
1532
1533 else
1534         ol_enable_shell="no"
1535 fi
1536 # end --enable-shell
1537 # OpenLDAP --enable-tcl
1538         # Check whether --enable-tcl or --disable-tcl was given.
1539 if test "${enable_tcl+set}" = set; then
1540   enableval="$enable_tcl"
1541   
1542         ol_arg=invalid
1543         for ol_val in auto yes no ; do
1544                 if test "$enableval" = "$ol_val" ; then
1545                         ol_arg="$ol_val"
1546                 fi
1547         done
1548         if test "$ol_arg" = "invalid" ; then
1549                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
1550         fi
1551         ol_enable_tcl="$ol_arg"
1552
1553 else
1554         ol_enable_tcl="no"
1555 fi
1556 # end --enable-tcl
1557
1558 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
1559 if test "${with_xxslurpdoptions+set}" = set; then
1560   withval="$with_xxslurpdoptions"
1561   :
1562 fi
1563
1564 # OpenLDAP --enable-slurpd
1565         # Check whether --enable-slurpd or --disable-slurpd was given.
1566 if test "${enable_slurpd+set}" = set; then
1567   enableval="$enable_slurpd"
1568   
1569         ol_arg=invalid
1570         for ol_val in auto yes no ; do
1571                 if test "$enableval" = "$ol_val" ; then
1572                         ol_arg="$ol_val"
1573                 fi
1574         done
1575         if test "$ol_arg" = "invalid" ; then
1576                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
1577         fi
1578         ol_enable_slurpd="$ol_arg"
1579
1580 else
1581         ol_enable_slurpd="auto"
1582 fi
1583 # end --enable-slurpd
1584
1585 # Check whether --with-xxliboptions or --without-xxliboptions was given.
1586 if test "${with_xxliboptions+set}" = set; then
1587   withval="$with_xxliboptions"
1588   :
1589 fi
1590
1591 # Check whether --enable-static or --disable-static was given.
1592 if test "${enable_static+set}" = set; then
1593   enableval="$enable_static"
1594   p=${PACKAGE-default}
1595 case "$enableval" in
1596 yes) enable_static=yes ;;
1597 no) enable_static=no ;;
1598 *)
1599   enable_static=no
1600   # Look at the argument we got.  We use all the common list separators.
1601   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1602   for pkg in $enableval; do
1603     if test "X$pkg" = "X$p"; then
1604       enable_static=yes
1605     fi
1606   done
1607   IFS="$ac_save_ifs"
1608   ;;
1609 esac
1610 else
1611   enable_static=yes
1612 fi
1613
1614 # Check whether --enable-shared or --disable-shared was given.
1615 if test "${enable_shared+set}" = set; then
1616   enableval="$enable_shared"
1617   p=${PACKAGE-default}
1618 case "$enableval" in
1619 yes) enable_shared=yes ;;
1620 no) enable_shared=no ;;
1621 *)
1622   enable_shared=no
1623   # Look at the argument we got.  We use all the common list separators.
1624   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1625   for pkg in $enableval; do
1626     if test "X$pkg" = "X$p"; then
1627       enable_shared=yes
1628     fi
1629   done
1630   IFS="$ac_save_ifs"
1631   ;;
1632 esac
1633 else
1634   enable_shared=yes
1635 fi
1636
1637
1638 # validate options
1639 if test $ol_enable_dns = yes ; then
1640         if test $ol_enable_referrals = no ; then
1641                 { echo "configure: error: DNS requires --enable-referrals" 1>&2; exit 1; }
1642         fi
1643         if test $ol_enable_referrals = auto ; then
1644                 echo "configure: warning: DNS requires referrals, adding --enable-referrals" 1>&2
1645                 ol_enable_referrals=yes
1646         fi
1647 fi
1648
1649 if test $ol_enable_slapd = no ; then
1650                 if test $ol_enable_bdb2 = yes ; then
1651                 echo "configure: warning: slapd disabled, ignoring --enable_bdb2 argument" 1>&2
1652         fi
1653         if test $ol_enable_ldbm = yes ; then
1654                 echo "configure: warning: slapd disabled, ignoring --enable_ldbm argument" 1>&2
1655         fi
1656         if test $ol_enable_passwd = yes ; then
1657                 echo "configure: warning: slapd disabled, ignoring --enable_passwd argument" 1>&2
1658         fi
1659         if test $ol_enable_perl = yes ; then
1660                 echo "configure: warning: slapd disabled, ignoring --enable_perl argument" 1>&2
1661         fi
1662         if test $ol_enable_shell = yes ; then
1663                 echo "configure: warning: slapd disabled, ignoring --enable_shell argument" 1>&2
1664         fi
1665         if test $ol_enable_tcl = yes ; then
1666                 echo "configure: warning: slapd disabled, ignoring --enable_tcl argument" 1>&2
1667         fi
1668         if test $ol_enable_aclgroups = yes ; then
1669                 echo "configure: warning: slapd disabled, ignoring --enable_aclgroups argument" 1>&2
1670         fi
1671         if test $ol_enable_modules = yes ; then
1672                 echo "configure: warning: slapd disabled, ignoring --enable_modules argument" 1>&2
1673         fi
1674         if test $ol_enable_wrappers = yes ; then
1675                 echo "configure: warning: slapd disabled, ignoring --enable_wrappers argument" 1>&2
1676         fi
1677         if test $ol_enable_phonetic = yes ; then
1678                 echo "configure: warning: slapd disabled, ignoring --enable_phonetic argument" 1>&2
1679         fi
1680         if test $ol_enable_rlookups = yes ; then
1681                 echo "configure: warning: slapd disabled, ignoring --enable_rlookups argument" 1>&2
1682         fi
1683         if test $ol_with_ldbm_api != auto ; then
1684                 echo "configure: warning: slapd disabled, ignoring --with_ldbm_api argument" 1>&2
1685         fi
1686         if test $ol_with_ldbm_type != auto ; then
1687                 echo "configure: warning: slapd disabled, ignoring --with_ldbm_type argument" 1>&2
1688         fi
1689         if test $ol_enable_slurpd = yes ; then
1690                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
1691         fi
1692
1693         # force settings to no
1694         ol_enable_bdb2=no
1695         ol_enable_ldbm=no
1696         ol_enable_passwd=no
1697         ol_enable_perl=no
1698         ol_enable_shell=no
1699         ol_enable_tcl=no
1700
1701         ol_enable_aclgroups=no
1702         ol_enable_modules=no
1703         ol_enable_phonetic=no
1704         ol_enable_rlookups=no
1705         ol_enable_wrappers=no
1706
1707         ol_with_ldbm_api=no
1708         ol_with_ldbm_type=no
1709
1710         ol_enable_slurpd=no
1711
1712 elif test $ol_enable_ldbm = no ; then
1713         
1714         if test $ol_with_ldbm_api != auto ; then
1715                 echo "configure: warning: LDBM disabled, ignoring --with_ldbm_api argument" 1>&2
1716         fi
1717
1718         if test $ol_with_ldbm_type != auto ; then
1719                 echo "configure: warning: LDBM disabled, ignoring --with_ldbm_type argument" 1>&2
1720         fi
1721
1722         if test $ol_enable_bdb2 = yes ; then
1723                 { echo "configure: error: BDB2 requires --enable-ldbm" 1>&2; exit 1; }
1724         fi
1725
1726         if test $ol_enable_modules != yes -a \
1727                 $ol_enable_passwd = no -a \
1728                 $ol_enable_perl = no -a \
1729                 $ol_enable_shell = no -a \
1730                 $ol_enable_tcl = no ; then
1731                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
1732         fi
1733
1734         ol_with_ldbm_api=no
1735         ol_with_ldbm_type=no
1736
1737 elif test $ol_enable_bdb2 = yes ; then
1738         
1739         if test $ol_with_ldbm_api != auto -a \
1740                 $ol_with_ldbm_api != db2 ; then
1741                 { echo "configure: error: BDB2 requires LDBM API DB2" 1>&2; exit 1; }
1742         fi
1743
1744         ol_with_ldbm_api=db2
1745
1746 else
1747         
1748         if test $ol_enable_bdb2 != no ; then
1749                 if test $ol_with_ldbm_api != auto -a \
1750                         $ol_with_ldbm_api != db2 ; then
1751                         echo "configure: warning: BDB2 requires LDBM api db2 or auto" 1>&2
1752                         ol_enable_bdb2=no
1753                 fi
1754         fi
1755
1756         if test $ol_with_ldbm_api = gdbm -a \
1757                 $ol_with_ldbm_type = btree ; then
1758                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
1759         fi
1760         if test $ol_with_ldbm_api = mdbm -a \
1761                 $ol_with_ldbm_type = btree ; then
1762                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
1763         fi
1764         if test $ol_with_ldbm_api = ndbm -a \
1765                 $ol_with_ldbm_type = btree ; then
1766                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
1767         fi
1768 fi
1769
1770 if test $ol_enable_slurpd = yes ; then
1771                 if test $ol_with_threads = no ; then
1772                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
1773         fi
1774 fi
1775
1776 echo "$ac_t""done" 1>&6
1777
1778 ## Initialize vars
1779 LDAP_LIBS=
1780 LDBM_LIBS=
1781 LTHREAD_LIBS=
1782 LUTIL_LIBS=
1783
1784 LDAPD_LIBS=
1785 SLAPD_LIBS=
1786 SLURPD_LIBS=
1787
1788 BUILD_LDAPD=no
1789 BUILD_SLAPD=no
1790 BUILD_SLURPD=no
1791
1792 BUILD_BDB2=no
1793 BUILD_LDAP=no
1794 BUILD_LDBM=no
1795 BUILD_PASSWD=no
1796 BUILD_PERL=no
1797 BUILD_SHELL=no
1798 BUILD_TCL=no
1799 BUILD_THREAD=no
1800
1801 SLAPD_MODULES_LDFLAGS=
1802 SLAPD_MODULES_CPPFLAGS=
1803
1804 SLAPD_PERL_LDFLAGS=
1805 SLAPD_PERL_CPPFLAGS=
1806
1807 KRB_LIBS=
1808 READLINE_LIBS=
1809 TERMCAP_LIBS=
1810 TLS_LIBS=
1811
1812
1813
1814 CC=${CC-"cc"}
1815
1816
1817 # Make sure we can run config.sub.
1818 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
1819 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
1820 fi
1821
1822 echo $ac_n "checking host system type""... $ac_c" 1>&6
1823 echo "configure:1824: checking host system type" >&5
1824
1825 host_alias=$host
1826 case "$host_alias" in
1827 NONE)
1828   case $nonopt in
1829   NONE)
1830     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
1831     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
1832     fi ;;
1833   *) host_alias=$nonopt ;;
1834   esac ;;
1835 esac
1836
1837 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
1838 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1839 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1840 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1841 echo "$ac_t""$host" 1>&6
1842
1843 # Extract the first word of "ranlib", so it can be a program name with args.
1844 set dummy ranlib; ac_word=$2
1845 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1846 echo "configure:1847: checking for $ac_word" >&5
1847 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1848   echo $ac_n "(cached) $ac_c" 1>&6
1849 else
1850   if test -n "$RANLIB"; then
1851   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1852 else
1853   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1854   ac_dummy="$PATH"
1855   for ac_dir in $ac_dummy; do
1856     test -z "$ac_dir" && ac_dir=.
1857     if test -f $ac_dir/$ac_word; then
1858       ac_cv_prog_RANLIB="ranlib"
1859       break
1860     fi
1861   done
1862   IFS="$ac_save_ifs"
1863   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1864 fi
1865 fi
1866 RANLIB="$ac_cv_prog_RANLIB"
1867 if test -n "$RANLIB"; then
1868   echo "$ac_t""$RANLIB" 1>&6
1869 else
1870   echo "$ac_t""no" 1>&6
1871 fi
1872
1873 # Extract the first word of "gcc", so it can be a program name with args.
1874 set dummy gcc; ac_word=$2
1875 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1876 echo "configure:1877: checking for $ac_word" >&5
1877 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1878   echo $ac_n "(cached) $ac_c" 1>&6
1879 else
1880   if test -n "$CC"; then
1881   ac_cv_prog_CC="$CC" # Let the user override the test.
1882 else
1883   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1884   ac_dummy="$PATH"
1885   for ac_dir in $ac_dummy; do
1886     test -z "$ac_dir" && ac_dir=.
1887     if test -f $ac_dir/$ac_word; then
1888       ac_cv_prog_CC="gcc"
1889       break
1890     fi
1891   done
1892   IFS="$ac_save_ifs"
1893 fi
1894 fi
1895 CC="$ac_cv_prog_CC"
1896 if test -n "$CC"; then
1897   echo "$ac_t""$CC" 1>&6
1898 else
1899   echo "$ac_t""no" 1>&6
1900 fi
1901
1902 if test -z "$CC"; then
1903   # Extract the first word of "cc", so it can be a program name with args.
1904 set dummy cc; ac_word=$2
1905 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1906 echo "configure:1907: checking for $ac_word" >&5
1907 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1908   echo $ac_n "(cached) $ac_c" 1>&6
1909 else
1910   if test -n "$CC"; then
1911   ac_cv_prog_CC="$CC" # Let the user override the test.
1912 else
1913   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1914   ac_prog_rejected=no
1915   ac_dummy="$PATH"
1916   for ac_dir in $ac_dummy; do
1917     test -z "$ac_dir" && ac_dir=.
1918     if test -f $ac_dir/$ac_word; then
1919       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1920         ac_prog_rejected=yes
1921         continue
1922       fi
1923       ac_cv_prog_CC="cc"
1924       break
1925     fi
1926   done
1927   IFS="$ac_save_ifs"
1928 if test $ac_prog_rejected = yes; then
1929   # We found a bogon in the path, so make sure we never use it.
1930   set dummy $ac_cv_prog_CC
1931   shift
1932   if test $# -gt 0; then
1933     # We chose a different compiler from the bogus one.
1934     # However, it has the same basename, so the bogon will be chosen
1935     # first if we set CC to just the basename; use the full file name.
1936     shift
1937     set dummy "$ac_dir/$ac_word" "$@"
1938     shift
1939     ac_cv_prog_CC="$@"
1940   fi
1941 fi
1942 fi
1943 fi
1944 CC="$ac_cv_prog_CC"
1945 if test -n "$CC"; then
1946   echo "$ac_t""$CC" 1>&6
1947 else
1948   echo "$ac_t""no" 1>&6
1949 fi
1950
1951   if test -z "$CC"; then
1952     case "`uname -s`" in
1953     *win32* | *WIN32*)
1954       # Extract the first word of "cl", so it can be a program name with args.
1955 set dummy cl; ac_word=$2
1956 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1957 echo "configure:1958: checking for $ac_word" >&5
1958 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1959   echo $ac_n "(cached) $ac_c" 1>&6
1960 else
1961   if test -n "$CC"; then
1962   ac_cv_prog_CC="$CC" # Let the user override the test.
1963 else
1964   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1965   ac_dummy="$PATH"
1966   for ac_dir in $ac_dummy; do
1967     test -z "$ac_dir" && ac_dir=.
1968     if test -f $ac_dir/$ac_word; then
1969       ac_cv_prog_CC="cl"
1970       break
1971     fi
1972   done
1973   IFS="$ac_save_ifs"
1974 fi
1975 fi
1976 CC="$ac_cv_prog_CC"
1977 if test -n "$CC"; then
1978   echo "$ac_t""$CC" 1>&6
1979 else
1980   echo "$ac_t""no" 1>&6
1981 fi
1982  ;;
1983     esac
1984   fi
1985   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1986 fi
1987
1988 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1989 echo "configure:1990: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1990
1991 ac_ext=c
1992 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1993 ac_cpp='$CPP $CPPFLAGS'
1994 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1995 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1996 cross_compiling=$ac_cv_prog_cc_cross
1997
1998 cat > conftest.$ac_ext << EOF
1999
2000 #line 2001 "configure"
2001 #include "confdefs.h"
2002
2003 main(){return(0);}
2004 EOF
2005 if { (eval echo configure:2006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2006   ac_cv_prog_cc_works=yes
2007   # If we can't run a trivial program, we are probably using a cross compiler.
2008   if (./conftest; exit) 2>/dev/null; then
2009     ac_cv_prog_cc_cross=no
2010   else
2011     ac_cv_prog_cc_cross=yes
2012   fi
2013 else
2014   echo "configure: failed program was:" >&5
2015   cat conftest.$ac_ext >&5
2016   ac_cv_prog_cc_works=no
2017 fi
2018 rm -fr conftest*
2019 ac_ext=c
2020 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2021 ac_cpp='$CPP $CPPFLAGS'
2022 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2023 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2024 cross_compiling=$ac_cv_prog_cc_cross
2025
2026 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2027 if test $ac_cv_prog_cc_works = no; then
2028   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2029 fi
2030 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2031 echo "configure:2032: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
2032 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2033 cross_compiling=$ac_cv_prog_cc_cross
2034
2035 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2036 echo "configure:2037: checking whether we are using GNU C" >&5
2037 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
2038   echo $ac_n "(cached) $ac_c" 1>&6
2039 else
2040   cat > conftest.c <<EOF
2041 #ifdef __GNUC__
2042   yes;
2043 #endif
2044 EOF
2045 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2046: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2046   ac_cv_prog_gcc=yes
2047 else
2048   ac_cv_prog_gcc=no
2049 fi
2050 fi
2051
2052 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2053
2054 if test $ac_cv_prog_gcc = yes; then
2055   GCC=yes
2056 else
2057   GCC=
2058 fi
2059
2060 ac_test_CFLAGS="${CFLAGS+set}"
2061 ac_save_CFLAGS="$CFLAGS"
2062 CFLAGS=
2063 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2064 echo "configure:2065: checking whether ${CC-cc} accepts -g" >&5
2065 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
2066   echo $ac_n "(cached) $ac_c" 1>&6
2067 else
2068   echo 'void f(){}' > conftest.c
2069 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2070   ac_cv_prog_cc_g=yes
2071 else
2072   ac_cv_prog_cc_g=no
2073 fi
2074 rm -f conftest*
2075
2076 fi
2077
2078 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2079 if test "$ac_test_CFLAGS" = set; then
2080   CFLAGS="$ac_save_CFLAGS"
2081 elif test $ac_cv_prog_cc_g = yes; then
2082   if test "$GCC" = yes; then
2083     CFLAGS="-g -O2"
2084   else
2085     CFLAGS="-g"
2086   fi
2087 else
2088   if test "$GCC" = yes; then
2089     CFLAGS="-O2"
2090   else
2091     CFLAGS=
2092   fi
2093 fi
2094
2095 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2096 if test "${with_gnu_ld+set}" = set; then
2097   withval="$with_gnu_ld"
2098   test "$withval" = no || with_gnu_ld=yes
2099 else
2100   with_gnu_ld=no
2101 fi
2102
2103
2104 ac_prog=ld
2105 if test "$ac_cv_prog_gcc" = yes; then
2106   # Check if gcc -print-prog-name=ld gives a path.
2107   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2108 echo "configure:2109: checking for ld used by GCC" >&5
2109   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2110   case "$ac_prog" in
2111   # Accept absolute paths.
2112   /* | A-Za-z:\\*)
2113     test -z "$LD" && LD="$ac_prog"
2114     ;;
2115   "")
2116     # If it fails, then pretend we aren't using GCC.
2117     ac_prog=ld
2118     ;;
2119   *)
2120     # If it is relative, then search for the first ld in PATH.
2121     with_gnu_ld=unknown
2122     ;;
2123   esac
2124 elif test "$with_gnu_ld" = yes; then
2125   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2126 echo "configure:2127: checking for GNU ld" >&5
2127 else
2128   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2129 echo "configure:2130: checking for non-GNU ld" >&5
2130 fi
2131 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
2132   echo $ac_n "(cached) $ac_c" 1>&6
2133 else
2134   if test -z "$LD"; then
2135   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2136   for ac_dir in $PATH; do
2137     test -z "$ac_dir" && ac_dir=.
2138     if test -f "$ac_dir/$ac_prog"; then
2139       ac_cv_path_LD="$ac_dir/$ac_prog"
2140       # Check to see if the program is GNU ld.  I'd rather use --version,
2141       # but apparently some GNU ld's only accept -v.
2142       # Break only if it was the GNU/non-GNU ld that we prefer.
2143       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2144         test "$with_gnu_ld" != no && break
2145       else
2146         test "$with_gnu_ld" != yes && break
2147       fi
2148     fi
2149   done
2150   IFS="$ac_save_ifs"
2151 else
2152   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2153 fi
2154 fi
2155
2156 LD="$ac_cv_path_LD"
2157 if test -n "$LD"; then
2158   echo "$ac_t""$LD" 1>&6
2159 else
2160   echo "$ac_t""no" 1>&6
2161 fi
2162 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2163
2164 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2165 echo "configure:2166: checking if the linker ($LD) is GNU ld" >&5
2166 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
2167   echo $ac_n "(cached) $ac_c" 1>&6
2168 else
2169   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2170 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2171   ac_cv_prog_gnu_ld=yes
2172 else
2173   ac_cv_prog_gnu_ld=no
2174 fi
2175 fi
2176
2177 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2178
2179
2180 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2181 echo "configure:2182: checking for BSD-compatible nm" >&5
2182 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
2183   echo $ac_n "(cached) $ac_c" 1>&6
2184 else
2185   case "$NM" in
2186 /* | A-Za-z:\\*)
2187   ac_cv_path_NM="$NM" # Let the user override the test with a path.
2188   ;;
2189 *)
2190   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2191   for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
2192     test -z "$ac_dir" && ac_dir=.
2193     if test -f $ac_dir/nm; then
2194       # Check to see if the nm accepts a BSD-compat flag.
2195       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2196       #   nm: unknown option "B" ignored
2197       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2198         ac_cv_path_NM="$ac_dir/nm -B"
2199       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2200         ac_cv_path_NM="$ac_dir/nm -p"
2201       else
2202         ac_cv_path_NM="$ac_dir/nm"
2203       fi
2204       break
2205     fi
2206   done
2207   IFS="$ac_save_ifs"
2208   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2209   ;;
2210 esac
2211 fi
2212
2213 NM="$ac_cv_path_NM"
2214 echo "$ac_t""$NM" 1>&6
2215
2216
2217 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2218 echo "configure:2219: checking whether ln -s works" >&5
2219 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2220   echo $ac_n "(cached) $ac_c" 1>&6
2221 else
2222   rm -f conftestdata
2223 if ln -s X conftestdata 2>/dev/null
2224 then
2225   rm -f conftestdata
2226   ac_cv_prog_LN_S="ln -s"
2227 else
2228   ac_cv_prog_LN_S=ln
2229 fi
2230 fi
2231 LN_S="$ac_cv_prog_LN_S"
2232 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2233   echo "$ac_t""yes" 1>&6
2234 else
2235   echo "$ac_t""no" 1>&6
2236 fi
2237
2238 # Always use our own libtool.
2239 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
2240
2241 # Check for any special flags to pass to ltconfig.
2242 libtool_flags=
2243 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2244 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2245 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
2246 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2247 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2248
2249 # Some flags need to be propagated to the compiler or linker for good
2250 # libtool support.
2251 case "$host" in
2252 *-*-irix6*)
2253   # Find out which ABI we are using.
2254   echo '#line 2255 "configure"' > conftest.$ac_ext
2255   if { (eval echo configure:2256: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2256     case "`/usr/bin/file conftest.o`" in
2257     *32-bit*)
2258       LD="${LD-ld} -32"
2259       ;;
2260     *N32*)
2261       LD="${LD-ld} -n32"
2262       ;;
2263     *64-bit*)
2264       LD="${LD-ld} -64"
2265       ;;
2266     esac
2267   fi
2268   rm -rf conftest*
2269   ;;
2270
2271 *-*-sco3.2v5*)
2272   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2273   CFLAGS="$CFLAGS -belf"
2274   ;;
2275 esac
2276
2277 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
2278 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
2279 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
2280 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
2281 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
2282 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
2283
2284
2285 for ac_prog in mawk gawk nawk awk
2286 do
2287 # Extract the first word of "$ac_prog", so it can be a program name with args.
2288 set dummy $ac_prog; ac_word=$2
2289 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2290 echo "configure:2291: checking for $ac_word" >&5
2291 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
2292   echo $ac_n "(cached) $ac_c" 1>&6
2293 else
2294   if test -n "$AWK"; then
2295   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2296 else
2297   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2298   ac_dummy="$PATH"
2299   for ac_dir in $ac_dummy; do
2300     test -z "$ac_dir" && ac_dir=.
2301     if test -f $ac_dir/$ac_word; then
2302       ac_cv_prog_AWK="$ac_prog"
2303       break
2304     fi
2305   done
2306   IFS="$ac_save_ifs"
2307 fi
2308 fi
2309 AWK="$ac_cv_prog_AWK"
2310 if test -n "$AWK"; then
2311   echo "$ac_t""$AWK" 1>&6
2312 else
2313   echo "$ac_t""no" 1>&6
2314 fi
2315
2316 test -n "$AWK" && break
2317 done
2318
2319 # test for ln hardlink support
2320 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
2321 echo "configure:2322: checking whether ln works" >&5
2322 if eval "test \"`echo '$''{'ol_cv_prog_LN_H'+set}'`\" = set"; then
2323   echo $ac_n "(cached) $ac_c" 1>&6
2324 else
2325   rm -f conftest.src conftest.dst
2326 echo "conftest" > conftest.src
2327 if ln conftest.src conftest.dst 2>/dev/null
2328 then
2329   ol_cv_prog_LN_H="ln"
2330 else
2331   ol_cv_prog_LN_H="cp"
2332 fi
2333 rm -f conftest.src conftest.dst
2334
2335 fi
2336 LN_H="$ol_cv_prog_LN_H"
2337 if test "$ol_cv_prog_LN_H" = "ln"; then
2338         echo "$ac_t""yes" 1>&6
2339 else
2340         echo "$ac_t""no" 1>&6
2341 fi
2342
2343 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2344 echo "configure:2345: checking whether ln -s works" >&5
2345 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2346   echo $ac_n "(cached) $ac_c" 1>&6
2347 else
2348   rm -f conftestdata
2349 if ln -s X conftestdata 2>/dev/null
2350 then
2351   rm -f conftestdata
2352   ac_cv_prog_LN_S="ln -s"
2353 else
2354   ac_cv_prog_LN_S=ln
2355 fi
2356 fi
2357 LN_S="$ac_cv_prog_LN_S"
2358 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2359   echo "$ac_t""yes" 1>&6
2360 else
2361   echo "$ac_t""no" 1>&6
2362 fi
2363
2364
2365 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
2366         LN_S="$LN_H"
2367 fi
2368
2369 # Extract the first word of "sendmail", so it can be a program name with args.
2370 set dummy sendmail; ac_word=$2
2371 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2372 echo "configure:2373: checking for $ac_word" >&5
2373 if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then
2374   echo $ac_n "(cached) $ac_c" 1>&6
2375 else
2376   case "$SENDMAIL" in
2377   /*)
2378   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
2379   ;;
2380   ?:/*)                  
2381   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
2382   ;;
2383   *)
2384   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2385   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
2386   for ac_dir in $ac_dummy; do 
2387     test -z "$ac_dir" && ac_dir=.
2388     if test -f $ac_dir/$ac_word; then
2389       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
2390       break
2391     fi
2392   done
2393   IFS="$ac_save_ifs"
2394   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
2395   ;;
2396 esac
2397 fi
2398 SENDMAIL="$ac_cv_path_SENDMAIL"
2399 if test -n "$SENDMAIL"; then
2400   echo "$ac_t""$SENDMAIL" 1>&6
2401 else
2402   echo "$ac_t""no" 1>&6
2403 fi
2404
2405 # Extract the first word of "vi", so it can be a program name with args.
2406 set dummy vi; ac_word=$2
2407 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2408 echo "configure:2409: checking for $ac_word" >&5
2409 if eval "test \"`echo '$''{'ac_cv_path_EDITOR'+set}'`\" = set"; then
2410   echo $ac_n "(cached) $ac_c" 1>&6
2411 else
2412   case "$EDITOR" in
2413   /*)
2414   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
2415   ;;
2416   ?:/*)                  
2417   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
2418   ;;
2419   *)
2420   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2421   ac_dummy="$PATH:/usr/ucb"
2422   for ac_dir in $ac_dummy; do 
2423     test -z "$ac_dir" && ac_dir=.
2424     if test -f $ac_dir/$ac_word; then
2425       ac_cv_path_EDITOR="$ac_dir/$ac_word"
2426       break
2427     fi
2428   done
2429   IFS="$ac_save_ifs"
2430   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
2431   ;;
2432 esac
2433 fi
2434 EDITOR="$ac_cv_path_EDITOR"
2435 if test -n "$EDITOR"; then
2436   echo "$ac_t""$EDITOR" 1>&6
2437 else
2438   echo "$ac_t""no" 1>&6
2439 fi
2440
2441 # Extract the first word of "finger", so it can be a program name with args.
2442 set dummy finger; ac_word=$2
2443 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2444 echo "configure:2445: checking for $ac_word" >&5
2445 if eval "test \"`echo '$''{'ac_cv_path_FINGER'+set}'`\" = set"; then
2446   echo $ac_n "(cached) $ac_c" 1>&6
2447 else
2448   case "$FINGER" in
2449   /*)
2450   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
2451   ;;
2452   ?:/*)                  
2453   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
2454   ;;
2455   *)
2456   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2457   ac_dummy="$PATH:/usr/ucb"
2458   for ac_dir in $ac_dummy; do 
2459     test -z "$ac_dir" && ac_dir=.
2460     if test -f $ac_dir/$ac_word; then
2461       ac_cv_path_FINGER="$ac_dir/$ac_word"
2462       break
2463     fi
2464   done
2465   IFS="$ac_save_ifs"
2466   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
2467   ;;
2468 esac
2469 fi
2470 FINGER="$ac_cv_path_FINGER"
2471 if test -n "$FINGER"; then
2472   echo "$ac_t""$FINGER" 1>&6
2473 else
2474   echo "$ac_t""no" 1>&6
2475 fi
2476
2477
2478 ol_link_modules=no
2479 if test $ol_enable_modules != no ; then
2480         # Extract the first word of "glib-config", so it can be a program name with args.
2481 set dummy glib-config; ac_word=$2
2482 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2483 echo "configure:2484: checking for $ac_word" >&5
2484 if eval "test \"`echo '$''{'ac_cv_path_GLIBCONFIG'+set}'`\" = set"; then
2485   echo $ac_n "(cached) $ac_c" 1>&6
2486 else
2487   case "$GLIBCONFIG" in
2488   /*)
2489   ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a path.
2490   ;;
2491   ?:/*)                  
2492   ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a dos path.
2493   ;;
2494   *)
2495   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2496   ac_dummy="$PATH"
2497   for ac_dir in $ac_dummy; do 
2498     test -z "$ac_dir" && ac_dir=.
2499     if test -f $ac_dir/$ac_word; then
2500       ac_cv_path_GLIBCONFIG="$ac_dir/$ac_word"
2501       break
2502     fi
2503   done
2504   IFS="$ac_save_ifs"
2505   ;;
2506 esac
2507 fi
2508 GLIBCONFIG="$ac_cv_path_GLIBCONFIG"
2509 if test -n "$GLIBCONFIG"; then
2510   echo "$ac_t""$GLIBCONFIG" 1>&6
2511 else
2512   echo "$ac_t""no" 1>&6
2513 fi
2514
2515
2516         if test "no$GLIBCONFIG" = "no" ; then
2517                 if test $ol_enable_modules = yes ; then
2518                         { echo "configure: error: could not locate glib-config" 1>&2; exit 1; }
2519                 fi
2520
2521         else
2522                 SLAPD_MODULES_VERSION="`$GLIBCONFIG --version gmodule`"
2523                 SLAPD_MODULES_CPPFLAGS="`$GLIBCONFIG --cflags gmodule`"
2524                 SLAPD_MODULES_LDFLAGS="`$GLIBCONFIG --libs gmodule`"
2525
2526                                 ol_link_modules=yes
2527         fi
2528 fi
2529
2530 ol_link_perl=no
2531 if test $ol_enable_perl != no ; then
2532         # Extract the first word of "perl", so it can be a program name with args.
2533 set dummy perl; ac_word=$2
2534 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2535 echo "configure:2536: checking for $ac_word" >&5
2536 if eval "test \"`echo '$''{'ac_cv_path_PERLBIN'+set}'`\" = set"; then
2537   echo $ac_n "(cached) $ac_c" 1>&6
2538 else
2539   case "$PERLBIN" in
2540   /*)
2541   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
2542   ;;
2543   ?:/*)                  
2544   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
2545   ;;
2546   *)
2547   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2548   ac_dummy="$PATH"
2549   for ac_dir in $ac_dummy; do 
2550     test -z "$ac_dir" && ac_dir=.
2551     if test -f $ac_dir/$ac_word; then
2552       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
2553       break
2554     fi
2555   done
2556   IFS="$ac_save_ifs"
2557   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
2558   ;;
2559 esac
2560 fi
2561 PERLBIN="$ac_cv_path_PERLBIN"
2562 if test -n "$PERLBIN"; then
2563   echo "$ac_t""$PERLBIN" 1>&6
2564 else
2565   echo "$ac_t""no" 1>&6
2566 fi
2567
2568
2569         if test "no$PERLBIN" = "no" ; then
2570                 if test $ol_enable_perl = yes ; then
2571                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
2572                 fi
2573
2574         else
2575                 SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
2576                 SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
2577
2578                                 ol_link_perl=yes
2579         fi
2580 fi
2581
2582 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2583 echo "configure:2584: checking how to run the C preprocessor" >&5
2584 # On Suns, sometimes $CPP names a directory.
2585 if test -n "$CPP" && test -d "$CPP"; then
2586   CPP=
2587 fi
2588 if test -z "$CPP"; then
2589 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
2590   echo $ac_n "(cached) $ac_c" 1>&6
2591 else
2592     # This must be in double quotes, not single quotes, because CPP may get
2593   # substituted into the Makefile and "${CC-cc}" will confuse make.
2594   CPP="${CC-cc} -E"
2595   # On the NeXT, cc -E runs the code through the compiler's parser,
2596   # not just through cpp.
2597   cat > conftest.$ac_ext <<EOF
2598 #line 2599 "configure"
2599 #include "confdefs.h"
2600 #include <assert.h>
2601 Syntax Error
2602 EOF
2603 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2604 { (eval echo configure:2605: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2605 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2606 if test -z "$ac_err"; then
2607   :
2608 else
2609   echo "$ac_err" >&5
2610   echo "configure: failed program was:" >&5
2611   cat conftest.$ac_ext >&5
2612   rm -rf conftest*
2613   CPP="${CC-cc} -E -traditional-cpp"
2614   cat > conftest.$ac_ext <<EOF
2615 #line 2616 "configure"
2616 #include "confdefs.h"
2617 #include <assert.h>
2618 Syntax Error
2619 EOF
2620 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2621 { (eval echo configure:2622: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2622 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2623 if test -z "$ac_err"; then
2624   :
2625 else
2626   echo "$ac_err" >&5
2627   echo "configure: failed program was:" >&5
2628   cat conftest.$ac_ext >&5
2629   rm -rf conftest*
2630   CPP="${CC-cc} -nologo -E"
2631   cat > conftest.$ac_ext <<EOF
2632 #line 2633 "configure"
2633 #include "confdefs.h"
2634 #include <assert.h>
2635 Syntax Error
2636 EOF
2637 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2638 { (eval echo configure:2639: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2639 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2640 if test -z "$ac_err"; then
2641   :
2642 else
2643   echo "$ac_err" >&5
2644   echo "configure: failed program was:" >&5
2645   cat conftest.$ac_ext >&5
2646   rm -rf conftest*
2647   CPP=/lib/cpp
2648 fi
2649 rm -f conftest*
2650 fi
2651 rm -f conftest*
2652 fi
2653 rm -f conftest*
2654   ac_cv_prog_CPP="$CPP"
2655 fi
2656   CPP="$ac_cv_prog_CPP"
2657 else
2658   ac_cv_prog_CPP="$CPP"
2659 fi
2660 echo "$ac_t""$CPP" 1>&6
2661
2662
2663 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
2664         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
2665
2666 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
2667         echo "configure: warning: programs compiled here do run here..." 1>&2
2668         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
2669
2670 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
2671         echo "configure: warning: programs compiled here do not run here..." 1>&2
2672         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
2673 fi
2674
2675 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2676 echo "configure:2677: checking for AIX" >&5
2677 cat > conftest.$ac_ext <<EOF
2678 #line 2679 "configure"
2679 #include "confdefs.h"
2680 #ifdef _AIX
2681   yes
2682 #endif
2683
2684 EOF
2685 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2686   egrep "yes" >/dev/null 2>&1; then
2687   rm -rf conftest*
2688   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
2689 #define _ALL_SOURCE 1
2690 EOF
2691
2692 else
2693   rm -rf conftest*
2694   echo "$ac_t""no" 1>&6
2695 fi
2696 rm -f conftest*
2697
2698
2699 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
2700 echo "configure:2701: checking for POSIXized ISC" >&5
2701 if test -d /etc/conf/kconfig.d &&
2702   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
2703 then
2704   echo "$ac_t""yes" 1>&6
2705   ISC=yes # If later tests want to check for ISC.
2706   cat >> confdefs.h <<\EOF
2707 #define _POSIX_SOURCE 1
2708 EOF
2709
2710   if test "$GCC" = yes; then
2711     CC="$CC -posix"
2712   else
2713     CC="$CC -Xp"
2714   fi
2715 else
2716   echo "$ac_t""no" 1>&6
2717   ISC=
2718 fi
2719
2720 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
2721 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
2722 echo "configure:2723: checking for minix/config.h" >&5
2723 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2724   echo $ac_n "(cached) $ac_c" 1>&6
2725 else
2726   cat > conftest.$ac_ext <<EOF
2727 #line 2728 "configure"
2728 #include "confdefs.h"
2729 #include <minix/config.h>
2730 EOF
2731 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2732 { (eval echo configure:2733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2733 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2734 if test -z "$ac_err"; then
2735   rm -rf conftest*
2736   eval "ac_cv_header_$ac_safe=yes"
2737 else
2738   echo "$ac_err" >&5
2739   echo "configure: failed program was:" >&5
2740   cat conftest.$ac_ext >&5
2741   rm -rf conftest*
2742   eval "ac_cv_header_$ac_safe=no"
2743 fi
2744 rm -f conftest*
2745 fi
2746 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2747   echo "$ac_t""yes" 1>&6
2748   MINIX=yes
2749 else
2750   echo "$ac_t""no" 1>&6
2751 MINIX=
2752 fi
2753
2754 if test "$MINIX" = yes; then
2755   cat >> confdefs.h <<\EOF
2756 #define _POSIX_SOURCE 1
2757 EOF
2758
2759   cat >> confdefs.h <<\EOF
2760 #define _POSIX_1_SOURCE 2
2761 EOF
2762
2763   cat >> confdefs.h <<\EOF
2764 #define _MINIX 1
2765 EOF
2766
2767 fi
2768
2769
2770 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
2771 echo "configure:2772: checking for be_app in -lbe" >&5
2772 ac_lib_var=`echo be'_'be_app | sed 'y%./+-%__p_%'`
2773 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2774   echo $ac_n "(cached) $ac_c" 1>&6
2775 else
2776   ac_save_LIBS="$LIBS"
2777 LIBS="-lbe -lroot -lnet $LIBS"
2778 cat > conftest.$ac_ext <<EOF
2779 #line 2780 "configure"
2780 #include "confdefs.h"
2781 /* Override any gcc2 internal prototype to avoid an error.  */
2782 /* We use char because int might match the return type of a gcc2
2783     builtin and then its argument prototype would still apply.  */
2784 char be_app();
2785
2786 int main() {
2787 be_app()
2788 ; return 0; }
2789 EOF
2790 if { (eval echo configure:2791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2791   rm -rf conftest*
2792   eval "ac_cv_lib_$ac_lib_var=yes"
2793 else
2794   echo "configure: failed program was:" >&5
2795   cat conftest.$ac_ext >&5
2796   rm -rf conftest*
2797   eval "ac_cv_lib_$ac_lib_var=no"
2798 fi
2799 rm -f conftest*
2800 LIBS="$ac_save_LIBS"
2801
2802 fi
2803 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2804   echo "$ac_t""yes" 1>&6
2805   LIBS="$LIBS -lbe -lroot -lnet"
2806 else
2807   echo "$ac_t""no" 1>&6
2808 :
2809 fi
2810
2811
2812 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
2813 echo "configure:2814: checking for Cygwin environment" >&5
2814 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
2815   echo $ac_n "(cached) $ac_c" 1>&6
2816 else
2817   cat > conftest.$ac_ext <<EOF
2818 #line 2819 "configure"
2819 #include "confdefs.h"
2820
2821 int main() {
2822
2823 #ifndef __CYGWIN__
2824 #define __CYGWIN__ __CYGWIN32__
2825 #endif
2826 return __CYGWIN__;
2827 ; return 0; }
2828 EOF
2829 if { (eval echo configure:2830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2830   rm -rf conftest*
2831   ac_cv_cygwin=yes
2832 else
2833   echo "configure: failed program was:" >&5
2834   cat conftest.$ac_ext >&5
2835   rm -rf conftest*
2836   ac_cv_cygwin=no
2837 fi
2838 rm -f conftest*
2839 rm -f conftest*
2840 fi
2841
2842 echo "$ac_t""$ac_cv_cygwin" 1>&6
2843 CYGWIN=
2844 test "$ac_cv_cygwin" = yes && CYGWIN=yes
2845 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
2846 echo "configure:2847: checking for mingw32 environment" >&5
2847 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
2848   echo $ac_n "(cached) $ac_c" 1>&6
2849 else
2850   cat > conftest.$ac_ext <<EOF
2851 #line 2852 "configure"
2852 #include "confdefs.h"
2853
2854 int main() {
2855 return __MINGW32__;
2856 ; return 0; }
2857 EOF
2858 if { (eval echo configure:2859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2859   rm -rf conftest*
2860   ac_cv_mingw32=yes
2861 else
2862   echo "configure: failed program was:" >&5
2863   cat conftest.$ac_ext >&5
2864   rm -rf conftest*
2865   ac_cv_mingw32=no
2866 fi
2867 rm -f conftest*
2868 rm -f conftest*
2869 fi
2870
2871 echo "$ac_t""$ac_cv_mingw32" 1>&6
2872 MINGW32=
2873 test "$ac_cv_mingw32" = yes && MINGW32=yes
2874
2875
2876 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
2877 echo "configure:2878: checking for executable suffix" >&5
2878 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
2879   echo $ac_n "(cached) $ac_c" 1>&6
2880 else
2881   if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
2882   ac_cv_exeext=.exe
2883 else
2884   rm -f conftest*
2885   echo 'int main () { return 0; }' > conftest.$ac_ext
2886   ac_cv_exeext=
2887   if { (eval echo configure:2888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
2888     for file in conftest.*; do
2889       case $file in
2890       *.c | *.o | *.obj) ;;
2891       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
2892       esac
2893     done
2894   else
2895     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
2896   fi
2897   rm -f conftest*
2898   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
2899 fi
2900 fi
2901
2902 EXEEXT=""
2903 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
2904 echo "$ac_t""${ac_cv_exeext}" 1>&6
2905 ac_exeext=$EXEEXT
2906
2907 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
2908 echo "configure:2909: checking for object suffix" >&5
2909 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
2910   echo $ac_n "(cached) $ac_c" 1>&6
2911 else
2912   rm -f conftest*
2913 echo 'int i = 1;' > conftest.$ac_ext
2914 if { (eval echo configure:2915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2915   for ac_file in conftest.*; do
2916     case $ac_file in
2917     *.c) ;;
2918     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
2919     esac
2920   done
2921 else
2922   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
2923 fi
2924 rm -f conftest*
2925 fi
2926
2927 echo "$ac_t""$ac_cv_objext" 1>&6
2928 OBJEXT=$ac_cv_objext
2929 ac_objext=$ac_cv_objext
2930
2931
2932 cat >> confdefs.h <<EOF
2933 #define EXEEXT "${EXEEXT}"
2934 EOF
2935
2936
2937
2938
2939
2940 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
2941 echo "configure:2942: checking for ${CC-cc} option to accept ANSI C" >&5
2942 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
2943   echo $ac_n "(cached) $ac_c" 1>&6
2944 else
2945   am_cv_prog_cc_stdc=no
2946 ac_save_CC="$CC"
2947 # Don't try gcc -ansi; that turns off useful extensions and
2948 # breaks some systems' header files.
2949 # AIX                   -qlanglvl=ansi
2950 # Ultrix and OSF/1      -std1
2951 # HP-UX                 -Aa -D_HPUX_SOURCE
2952 # SVR4                  -Xc -D__EXTENSIONS__
2953 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2954 do
2955   CC="$ac_save_CC $ac_arg"
2956   cat > conftest.$ac_ext <<EOF
2957 #line 2958 "configure"
2958 #include "confdefs.h"
2959 #include <stdarg.h>
2960 #include <stdio.h>
2961 #include <sys/types.h>
2962 #include <sys/stat.h>
2963 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2964 struct buf { int x; };
2965 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2966 static char *e (p, i)
2967      char **p;
2968      int i;
2969 {
2970   return p[i];
2971 }
2972 static char *f (char * (*g) (char **, int), char **p, ...)
2973 {
2974   char *s;
2975   va_list v;
2976   va_start (v,p);
2977   s = g (p, va_arg (v,int));
2978   va_end (v);
2979   return s;
2980 }
2981 int test (int i, double x);
2982 struct s1 {int (*f) (int a);};
2983 struct s2 {int (*f) (double a);};
2984 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2985 int argc;
2986 char **argv;
2987
2988 int main() {
2989
2990 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2991
2992 ; return 0; }
2993 EOF
2994 if { (eval echo configure:2995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2995   rm -rf conftest*
2996   am_cv_prog_cc_stdc="$ac_arg"; break
2997 else
2998   echo "configure: failed program was:" >&5
2999   cat conftest.$ac_ext >&5
3000 fi
3001 rm -f conftest*
3002 done
3003 CC="$ac_save_CC"
3004
3005 fi
3006
3007 if test -z "$am_cv_prog_cc_stdc"; then
3008   echo "$ac_t""none needed" 1>&6
3009 else
3010   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
3011 fi
3012 case "x$am_cv_prog_cc_stdc" in
3013   x|xno) ;;
3014   *) CC="$CC $am_cv_prog_cc_stdc" ;;
3015 esac
3016
3017 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
3018         { echo "configure: error: OpenLDAP requires compiler to support STDC prototypes." 1>&2; exit 1; }
3019 fi
3020
3021
3022
3023
3024 echo $ac_n "checking for socket""... $ac_c" 1>&6
3025 echo "configure:3026: checking for socket" >&5
3026 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
3027   echo $ac_n "(cached) $ac_c" 1>&6
3028 else
3029   cat > conftest.$ac_ext <<EOF
3030 #line 3031 "configure"
3031 #include "confdefs.h"
3032 /* System header to define __stub macros and hopefully few prototypes,
3033     which can conflict with char socket(); below.  */
3034 #include <assert.h>
3035 /* Override any gcc2 internal prototype to avoid an error.  */
3036 /* We use char because int might match the return type of a gcc2
3037     builtin and then its argument prototype would still apply.  */
3038 char socket();
3039
3040 int main() {
3041
3042 /* The GNU C library defines this for functions which it implements
3043     to always fail with ENOSYS.  Some functions are actually named
3044     something starting with __ and the normal name is an alias.  */
3045 #if defined (__stub_socket) || defined (__stub___socket)
3046 choke me
3047 #else
3048 socket();
3049 #endif
3050
3051 ; return 0; }
3052 EOF
3053 if { (eval echo configure:3054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3054   rm -rf conftest*
3055   eval "ac_cv_func_socket=yes"
3056 else
3057   echo "configure: failed program was:" >&5
3058   cat conftest.$ac_ext >&5
3059   rm -rf conftest*
3060   eval "ac_cv_func_socket=no"
3061 fi
3062 rm -f conftest*
3063 fi
3064
3065 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
3066   echo "$ac_t""yes" 1>&6
3067   :
3068 else
3069   echo "$ac_t""no" 1>&6
3070         
3071         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
3072 echo "configure:3073: checking for main in -lsocket" >&5
3073 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
3074 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3075   echo $ac_n "(cached) $ac_c" 1>&6
3076 else
3077   ac_save_LIBS="$LIBS"
3078 LIBS="-lsocket  $LIBS"
3079 cat > conftest.$ac_ext <<EOF
3080 #line 3081 "configure"
3081 #include "confdefs.h"
3082
3083 int main() {
3084 main()
3085 ; return 0; }
3086 EOF
3087 if { (eval echo configure:3088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3088   rm -rf conftest*
3089   eval "ac_cv_lib_$ac_lib_var=yes"
3090 else
3091   echo "configure: failed program was:" >&5
3092   cat conftest.$ac_ext >&5
3093   rm -rf conftest*
3094   eval "ac_cv_lib_$ac_lib_var=no"
3095 fi
3096 rm -f conftest*
3097 LIBS="$ac_save_LIBS"
3098
3099 fi
3100 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3101   echo "$ac_t""yes" 1>&6
3102     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3103     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3104   cat >> confdefs.h <<EOF
3105 #define $ac_tr_lib 1
3106 EOF
3107
3108   LIBS="-lsocket $LIBS"
3109
3110 else
3111   echo "$ac_t""no" 1>&6
3112 fi
3113
3114         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
3115 echo "configure:3116: checking for main in -lnet" >&5
3116 ac_lib_var=`echo net'_'main | sed 'y%./+-%__p_%'`
3117 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3118   echo $ac_n "(cached) $ac_c" 1>&6
3119 else
3120   ac_save_LIBS="$LIBS"
3121 LIBS="-lnet  $LIBS"
3122 cat > conftest.$ac_ext <<EOF
3123 #line 3124 "configure"
3124 #include "confdefs.h"
3125
3126 int main() {
3127 main()
3128 ; return 0; }
3129 EOF
3130 if { (eval echo configure:3131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3131   rm -rf conftest*
3132   eval "ac_cv_lib_$ac_lib_var=yes"
3133 else
3134   echo "configure: failed program was:" >&5
3135   cat conftest.$ac_ext >&5
3136   rm -rf conftest*
3137   eval "ac_cv_lib_$ac_lib_var=no"
3138 fi
3139 rm -f conftest*
3140 LIBS="$ac_save_LIBS"
3141
3142 fi
3143 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3144   echo "$ac_t""yes" 1>&6
3145     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3146     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3147   cat >> confdefs.h <<EOF
3148 #define $ac_tr_lib 1
3149 EOF
3150
3151   LIBS="-lnet $LIBS"
3152
3153 else
3154   echo "$ac_t""no" 1>&6
3155 fi
3156
3157         echo $ac_n "checking for socket in -lnet""... $ac_c" 1>&6
3158 echo "configure:3159: checking for socket in -lnet" >&5
3159 ac_lib_var=`echo net'_'socket | sed 'y%./+-%__p_%'`
3160 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3161   echo $ac_n "(cached) $ac_c" 1>&6
3162 else
3163   ac_save_LIBS="$LIBS"
3164 LIBS="-lnet  $LIBS"
3165 cat > conftest.$ac_ext <<EOF
3166 #line 3167 "configure"
3167 #include "confdefs.h"
3168 /* Override any gcc2 internal prototype to avoid an error.  */
3169 /* We use char because int might match the return type of a gcc2
3170     builtin and then its argument prototype would still apply.  */
3171 char socket();
3172
3173 int main() {
3174 socket()
3175 ; return 0; }
3176 EOF
3177 if { (eval echo configure:3178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3178   rm -rf conftest*
3179   eval "ac_cv_lib_$ac_lib_var=yes"
3180 else
3181   echo "configure: failed program was:" >&5
3182   cat conftest.$ac_ext >&5
3183   rm -rf conftest*
3184   eval "ac_cv_lib_$ac_lib_var=no"
3185 fi
3186 rm -f conftest*
3187 LIBS="$ac_save_LIBS"
3188
3189 fi
3190 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3191   echo "$ac_t""yes" 1>&6
3192     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3193     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3194   cat >> confdefs.h <<EOF
3195 #define $ac_tr_lib 1
3196 EOF
3197
3198   LIBS="-lnet $LIBS"
3199
3200 else
3201   echo "$ac_t""no" 1>&6
3202 fi
3203
3204         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
3205 echo "configure:3206: checking for main in -lnsl_s" >&5
3206 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-%__p_%'`
3207 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3208   echo $ac_n "(cached) $ac_c" 1>&6
3209 else
3210   ac_save_LIBS="$LIBS"
3211 LIBS="-lnsl_s  $LIBS"
3212 cat > conftest.$ac_ext <<EOF
3213 #line 3214 "configure"
3214 #include "confdefs.h"
3215
3216 int main() {
3217 main()
3218 ; return 0; }
3219 EOF
3220 if { (eval echo configure:3221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3221   rm -rf conftest*
3222   eval "ac_cv_lib_$ac_lib_var=yes"
3223 else
3224   echo "configure: failed program was:" >&5
3225   cat conftest.$ac_ext >&5
3226   rm -rf conftest*
3227   eval "ac_cv_lib_$ac_lib_var=no"
3228 fi
3229 rm -f conftest*
3230 LIBS="$ac_save_LIBS"
3231
3232 fi
3233 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3234   echo "$ac_t""yes" 1>&6
3235     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3236     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3237   cat >> confdefs.h <<EOF
3238 #define $ac_tr_lib 1
3239 EOF
3240
3241   LIBS="-lnsl_s $LIBS"
3242
3243 else
3244   echo "$ac_t""no" 1>&6
3245 fi
3246
3247         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
3248 echo "configure:3249: checking for main in -lnsl" >&5
3249 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
3250 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3251   echo $ac_n "(cached) $ac_c" 1>&6
3252 else
3253   ac_save_LIBS="$LIBS"
3254 LIBS="-lnsl  $LIBS"
3255 cat > conftest.$ac_ext <<EOF
3256 #line 3257 "configure"
3257 #include "confdefs.h"
3258
3259 int main() {
3260 main()
3261 ; return 0; }
3262 EOF
3263 if { (eval echo configure:3264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3264   rm -rf conftest*
3265   eval "ac_cv_lib_$ac_lib_var=yes"
3266 else
3267   echo "configure: failed program was:" >&5
3268   cat conftest.$ac_ext >&5
3269   rm -rf conftest*
3270   eval "ac_cv_lib_$ac_lib_var=no"
3271 fi
3272 rm -f conftest*
3273 LIBS="$ac_save_LIBS"
3274
3275 fi
3276 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3277   echo "$ac_t""yes" 1>&6
3278     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3279     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3280   cat >> confdefs.h <<EOF
3281 #define $ac_tr_lib 1
3282 EOF
3283
3284   LIBS="-lnsl $LIBS"
3285
3286 else
3287   echo "$ac_t""no" 1>&6
3288 fi
3289
3290         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
3291 echo "configure:3292: checking for socket in -linet" >&5
3292 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
3293 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3294   echo $ac_n "(cached) $ac_c" 1>&6
3295 else
3296   ac_save_LIBS="$LIBS"
3297 LIBS="-linet  $LIBS"
3298 cat > conftest.$ac_ext <<EOF
3299 #line 3300 "configure"
3300 #include "confdefs.h"
3301 /* Override any gcc2 internal prototype to avoid an error.  */
3302 /* We use char because int might match the return type of a gcc2
3303     builtin and then its argument prototype would still apply.  */
3304 char socket();
3305
3306 int main() {
3307 socket()
3308 ; return 0; }
3309 EOF
3310 if { (eval echo configure:3311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3311   rm -rf conftest*
3312   eval "ac_cv_lib_$ac_lib_var=yes"
3313 else
3314   echo "configure: failed program was:" >&5
3315   cat conftest.$ac_ext >&5
3316   rm -rf conftest*
3317   eval "ac_cv_lib_$ac_lib_var=no"
3318 fi
3319 rm -f conftest*
3320 LIBS="$ac_save_LIBS"
3321
3322 fi
3323 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3324   echo "$ac_t""yes" 1>&6
3325     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3326     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3327   cat >> confdefs.h <<EOF
3328 #define $ac_tr_lib 1
3329 EOF
3330
3331   LIBS="-linet $LIBS"
3332
3333 else
3334   echo "$ac_t""no" 1>&6
3335 fi
3336
3337         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
3338 echo "configure:3339: checking for main in -lgen" >&5
3339 ac_lib_var=`echo gen'_'main | sed 'y%./+-%__p_%'`
3340 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3341   echo $ac_n "(cached) $ac_c" 1>&6
3342 else
3343   ac_save_LIBS="$LIBS"
3344 LIBS="-lgen  $LIBS"
3345 cat > conftest.$ac_ext <<EOF
3346 #line 3347 "configure"
3347 #include "confdefs.h"
3348
3349 int main() {
3350 main()
3351 ; return 0; }
3352 EOF
3353 if { (eval echo configure:3354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3354   rm -rf conftest*
3355   eval "ac_cv_lib_$ac_lib_var=yes"
3356 else
3357   echo "configure: failed program was:" >&5
3358   cat conftest.$ac_ext >&5
3359   rm -rf conftest*
3360   eval "ac_cv_lib_$ac_lib_var=no"
3361 fi
3362 rm -f conftest*
3363 LIBS="$ac_save_LIBS"
3364
3365 fi
3366 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3367   echo "$ac_t""yes" 1>&6
3368     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3369     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3370   cat >> confdefs.h <<EOF
3371 #define $ac_tr_lib 1
3372 EOF
3373
3374   LIBS="-lgen $LIBS"
3375
3376 else
3377   echo "$ac_t""no" 1>&6
3378 fi
3379
3380
3381 fi
3382
3383
3384 for ac_func in res_search
3385 do
3386 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3387 echo "configure:3388: checking for $ac_func" >&5
3388 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3389   echo $ac_n "(cached) $ac_c" 1>&6
3390 else
3391   cat > conftest.$ac_ext <<EOF
3392 #line 3393 "configure"
3393 #include "confdefs.h"
3394 /* System header to define __stub macros and hopefully few prototypes,
3395     which can conflict with char $ac_func(); below.  */
3396 #include <assert.h>
3397 /* Override any gcc2 internal prototype to avoid an error.  */
3398 /* We use char because int might match the return type of a gcc2
3399     builtin and then its argument prototype would still apply.  */
3400 char $ac_func();
3401
3402 int main() {
3403
3404 /* The GNU C library defines this for functions which it implements
3405     to always fail with ENOSYS.  Some functions are actually named
3406     something starting with __ and the normal name is an alias.  */
3407 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3408 choke me
3409 #else
3410 $ac_func();
3411 #endif
3412
3413 ; return 0; }
3414 EOF
3415 if { (eval echo configure:3416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3416   rm -rf conftest*
3417   eval "ac_cv_func_$ac_func=yes"
3418 else
3419   echo "configure: failed program was:" >&5
3420   cat conftest.$ac_ext >&5
3421   rm -rf conftest*
3422   eval "ac_cv_func_$ac_func=no"
3423 fi
3424 rm -f conftest*
3425 fi
3426
3427 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3428   echo "$ac_t""yes" 1>&6
3429     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3430   cat >> confdefs.h <<EOF
3431 #define $ac_tr_func 1
3432 EOF
3433  
3434 else
3435   echo "$ac_t""no" 1>&6
3436 fi
3437 done
3438
3439 if test $ac_cv_func_res_search = "no" ; then 
3440         echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
3441 echo "configure:3442: checking for res_search in -lbind" >&5
3442 ac_lib_var=`echo bind'_'res_search | sed 'y%./+-%__p_%'`
3443 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3444   echo $ac_n "(cached) $ac_c" 1>&6
3445 else
3446   ac_save_LIBS="$LIBS"
3447 LIBS="-lbind  $LIBS"
3448 cat > conftest.$ac_ext <<EOF
3449 #line 3450 "configure"
3450 #include "confdefs.h"
3451 /* Override any gcc2 internal prototype to avoid an error.  */
3452 /* We use char because int might match the return type of a gcc2
3453     builtin and then its argument prototype would still apply.  */
3454 char res_search();
3455
3456 int main() {
3457 res_search()
3458 ; return 0; }
3459 EOF
3460 if { (eval echo configure:3461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3461   rm -rf conftest*
3462   eval "ac_cv_lib_$ac_lib_var=yes"
3463 else
3464   echo "configure: failed program was:" >&5
3465   cat conftest.$ac_ext >&5
3466   rm -rf conftest*
3467   eval "ac_cv_lib_$ac_lib_var=no"
3468 fi
3469 rm -f conftest*
3470 LIBS="$ac_save_LIBS"
3471
3472 fi
3473 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3474   echo "$ac_t""yes" 1>&6
3475     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3476     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3477   cat >> confdefs.h <<EOF
3478 #define $ac_tr_lib 1
3479 EOF
3480
3481   LIBS="-lbind $LIBS"
3482
3483 else
3484   echo "$ac_t""no" 1>&6
3485 fi
3486
3487         if test "$ac_cv_lib_bind_res_search" = "yes" ; then
3488                 cat >> confdefs.h <<\EOF
3489 #define HAVE_RES_SEARCH 1
3490 EOF
3491
3492         else
3493                 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
3494 echo "configure:3495: checking for res_search in -lresolv" >&5
3495 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
3496 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3497   echo $ac_n "(cached) $ac_c" 1>&6
3498 else
3499   ac_save_LIBS="$LIBS"
3500 LIBS="-lresolv  $LIBS"
3501 cat > conftest.$ac_ext <<EOF
3502 #line 3503 "configure"
3503 #include "confdefs.h"
3504 /* Override any gcc2 internal prototype to avoid an error.  */
3505 /* We use char because int might match the return type of a gcc2
3506     builtin and then its argument prototype would still apply.  */
3507 char res_search();
3508
3509 int main() {
3510 res_search()
3511 ; return 0; }
3512 EOF
3513 if { (eval echo configure:3514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3514   rm -rf conftest*
3515   eval "ac_cv_lib_$ac_lib_var=yes"
3516 else
3517   echo "configure: failed program was:" >&5
3518   cat conftest.$ac_ext >&5
3519   rm -rf conftest*
3520   eval "ac_cv_lib_$ac_lib_var=no"
3521 fi
3522 rm -f conftest*
3523 LIBS="$ac_save_LIBS"
3524
3525 fi
3526 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3527   echo "$ac_t""yes" 1>&6
3528     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3529     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3530   cat >> confdefs.h <<EOF
3531 #define $ac_tr_lib 1
3532 EOF
3533
3534   LIBS="-lresolv $LIBS"
3535
3536 else
3537   echo "$ac_t""no" 1>&6
3538 fi
3539
3540                 if test "$ac_cv_lib_resolv_res_search" = "yes" ; then
3541                         cat >> confdefs.h <<\EOF
3542 #define HAVE_RES_SEARCH 1
3543 EOF
3544
3545                 fi
3546         fi
3547 fi
3548
3549 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
3550 echo "configure:3551: checking for sigset in -lV3" >&5
3551 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-%__p_%'`
3552 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3553   echo $ac_n "(cached) $ac_c" 1>&6
3554 else
3555   ac_save_LIBS="$LIBS"
3556 LIBS="-lV3  $LIBS"
3557 cat > conftest.$ac_ext <<EOF
3558 #line 3559 "configure"
3559 #include "confdefs.h"
3560 /* Override any gcc2 internal prototype to avoid an error.  */
3561 /* We use char because int might match the return type of a gcc2
3562     builtin and then its argument prototype would still apply.  */
3563 char sigset();
3564
3565 int main() {
3566 sigset()
3567 ; return 0; }
3568 EOF
3569 if { (eval echo configure:3570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3570   rm -rf conftest*
3571   eval "ac_cv_lib_$ac_lib_var=yes"
3572 else
3573   echo "configure: failed program was:" >&5
3574   cat conftest.$ac_ext >&5
3575   rm -rf conftest*
3576   eval "ac_cv_lib_$ac_lib_var=no"
3577 fi
3578 rm -f conftest*
3579 LIBS="$ac_save_LIBS"
3580
3581 fi
3582 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3583   echo "$ac_t""yes" 1>&6
3584     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3585     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3586   cat >> confdefs.h <<EOF
3587 #define $ac_tr_lib 1
3588 EOF
3589
3590   LIBS="-lV3 $LIBS"
3591
3592 else
3593   echo "$ac_t""no" 1>&6
3594 fi
3595
3596
3597 echo $ac_n "checking for select""... $ac_c" 1>&6
3598 echo "configure:3599: checking for select" >&5
3599 if eval "test \"`echo '$''{'ac_cv_func_select'+set}'`\" = set"; then
3600   echo $ac_n "(cached) $ac_c" 1>&6
3601 else
3602   cat > conftest.$ac_ext <<EOF
3603 #line 3604 "configure"
3604 #include "confdefs.h"
3605 /* System header to define __stub macros and hopefully few prototypes,
3606     which can conflict with char select(); below.  */
3607 #include <assert.h>
3608 /* Override any gcc2 internal prototype to avoid an error.  */
3609 /* We use char because int might match the return type of a gcc2
3610     builtin and then its argument prototype would still apply.  */
3611 char select();
3612
3613 int main() {
3614
3615 /* The GNU C library defines this for functions which it implements
3616     to always fail with ENOSYS.  Some functions are actually named
3617     something starting with __ and the normal name is an alias.  */
3618 #if defined (__stub_select) || defined (__stub___select)
3619 choke me
3620 #else
3621 select();
3622 #endif
3623
3624 ; return 0; }
3625 EOF
3626 if { (eval echo configure:3627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3627   rm -rf conftest*
3628   eval "ac_cv_func_select=yes"
3629 else
3630   echo "configure: failed program was:" >&5
3631   cat conftest.$ac_ext >&5
3632   rm -rf conftest*
3633   eval "ac_cv_func_select=no"
3634 fi
3635 rm -f conftest*
3636 fi
3637
3638 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
3639   echo "$ac_t""yes" 1>&6
3640   :
3641 else
3642   echo "$ac_t""no" 1>&6
3643 { echo "configure: error: select() required." 1>&2; exit 1; }
3644 fi
3645
3646
3647 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
3648 echo "configure:3649: checking types of arguments for select()" >&5
3649  if eval "test \"`echo '$''{'ac_cv_func_select_arg234'+set}'`\" = set"; then
3650   echo $ac_n "(cached) $ac_c" 1>&6
3651 else
3652    if eval "test \"`echo '$''{'ac_cv_func_select_arg1'+set}'`\" = set"; then
3653   echo $ac_n "(cached) $ac_c" 1>&6
3654 else
3655     if eval "test \"`echo '$''{'ac_cv_func_select_arg5'+set}'`\" = set"; then
3656   echo $ac_n "(cached) $ac_c" 1>&6
3657 else
3658      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
3659      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
3660       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
3661        cat > conftest.$ac_ext <<EOF
3662 #line 3663 "configure"
3663 #include "confdefs.h"
3664 #ifdef HAVE_SYS_TYPES_H
3665 #include <sys/types.h>
3666 #endif
3667 #ifdef HAVE_SYS_TIME_H
3668 #include <sys/time.h>
3669 #endif
3670 #ifdef HAVE_SYS_SELECT_H
3671 #include <sys/select.h>
3672 #endif
3673 #ifdef HAVE_SYS_SOCKET_H
3674 #include <sys/socket.h>
3675 #endif
3676 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);
3677 int main() {
3678
3679 ; return 0; }
3680 EOF
3681 if { (eval echo configure:3682: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3682   rm -rf conftest*
3683           ac_not_found=no ; break 3
3684 else
3685   echo "configure: failed program was:" >&5
3686   cat conftest.$ac_ext >&5
3687   rm -rf conftest*
3688   ac_not_found=yes
3689 fi
3690 rm -f conftest*
3691       done
3692      done
3693     done
3694    
3695 fi
3696   
3697 fi
3698  
3699 fi
3700  if test "$ac_not_found" = yes; then
3701   ac_cv_func_select_arg1=int 
3702   ac_cv_func_select_arg234='int *' 
3703   ac_cv_func_select_arg5='struct timeval *'
3704  fi
3705  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
3706  cat >> confdefs.h <<EOF
3707 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
3708 EOF
3709
3710  cat >> confdefs.h <<EOF
3711 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
3712 EOF
3713
3714  cat >> confdefs.h <<EOF
3715 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
3716 EOF
3717
3718
3719
3720 # ISODE tests
3721 ol_link_isode=no
3722 if test $ol_enable_ldapd != no ; then
3723                 echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
3724 echo "configure:3725: checking for main in -lxtpp" >&5
3725 ac_lib_var=`echo xtpp'_'main | sed 'y%./+-%__p_%'`
3726 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3727   echo $ac_n "(cached) $ac_c" 1>&6
3728 else
3729   ac_save_LIBS="$LIBS"
3730 LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
3731 cat > conftest.$ac_ext <<EOF
3732 #line 3733 "configure"
3733 #include "confdefs.h"
3734
3735 int main() {
3736 main()
3737 ; return 0; }
3738 EOF
3739 if { (eval echo configure:3740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3740   rm -rf conftest*
3741   eval "ac_cv_lib_$ac_lib_var=yes"
3742 else
3743   echo "configure: failed program was:" >&5
3744   cat conftest.$ac_ext >&5
3745   rm -rf conftest*
3746   eval "ac_cv_lib_$ac_lib_var=no"
3747 fi
3748 rm -f conftest*
3749 LIBS="$ac_save_LIBS"
3750
3751 fi
3752 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3753   echo "$ac_t""yes" 1>&6
3754   
3755                 ol_link_isode=yes
3756                 cat >> confdefs.h <<\EOF
3757 #define HAVE_XTPP 1
3758 EOF
3759
3760                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
3761                 
3762 else
3763   echo "$ac_t""no" 1>&6
3764 :
3765 fi
3766
3767         echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
3768 echo "configure:3769: checking for main in -ldsap" >&5
3769 ac_lib_var=`echo dsap'_'main | sed 'y%./+-%__p_%'`
3770 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3771   echo $ac_n "(cached) $ac_c" 1>&6
3772 else
3773   ac_save_LIBS="$LIBS"
3774 LIBS="-ldsap -lisode $LIBS"
3775 cat > conftest.$ac_ext <<EOF
3776 #line 3777 "configure"
3777 #include "confdefs.h"
3778
3779 int main() {
3780 main()
3781 ; return 0; }
3782 EOF
3783 if { (eval echo configure:3784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3784   rm -rf conftest*
3785   eval "ac_cv_lib_$ac_lib_var=yes"
3786 else
3787   echo "configure: failed program was:" >&5
3788   cat conftest.$ac_ext >&5
3789   rm -rf conftest*
3790   eval "ac_cv_lib_$ac_lib_var=no"
3791 fi
3792 rm -f conftest*
3793 LIBS="$ac_save_LIBS"
3794
3795 fi
3796 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3797   echo "$ac_t""yes" 1>&6
3798   
3799                 ol_link_isode=yes
3800                 cat >> confdefs.h <<\EOF
3801 #define HAVE_DSAP 1
3802 EOF
3803
3804                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
3805                 
3806 else
3807   echo "$ac_t""no" 1>&6
3808 :
3809 fi
3810
3811         echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
3812 echo "configure:3813: checking for main in -lisode" >&5
3813 ac_lib_var=`echo isode'_'main | sed 'y%./+-%__p_%'`
3814 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3815   echo $ac_n "(cached) $ac_c" 1>&6
3816 else
3817   ac_save_LIBS="$LIBS"
3818 LIBS="-lisode  $LIBS"
3819 cat > conftest.$ac_ext <<EOF
3820 #line 3821 "configure"
3821 #include "confdefs.h"
3822
3823 int main() {
3824 main()
3825 ; return 0; }
3826 EOF
3827 if { (eval echo configure:3828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3828   rm -rf conftest*
3829   eval "ac_cv_lib_$ac_lib_var=yes"
3830 else
3831   echo "configure: failed program was:" >&5
3832   cat conftest.$ac_ext >&5
3833   rm -rf conftest*
3834   eval "ac_cv_lib_$ac_lib_var=no"
3835 fi
3836 rm -f conftest*
3837 LIBS="$ac_save_LIBS"
3838
3839 fi
3840 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3841   echo "$ac_t""yes" 1>&6
3842   
3843                 ol_link_isode=yes
3844                 cat >> confdefs.h <<\EOF
3845 #define HAVE_ISODE 1
3846 EOF
3847
3848                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
3849                 
3850 else
3851   echo "$ac_t""no" 1>&6
3852 :
3853 fi
3854
3855 fi
3856
3857 if test $ol_link_isode != no; then
3858         echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
3859 echo "configure:3860: checking for main in -lpp" >&5
3860 ac_lib_var=`echo pp'_'main | sed 'y%./+-%__p_%'`
3861 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3862   echo $ac_n "(cached) $ac_c" 1>&6
3863 else
3864   ac_save_LIBS="$LIBS"
3865 LIBS="-lpp  $LIBS"
3866 cat > conftest.$ac_ext <<EOF
3867 #line 3868 "configure"
3868 #include "confdefs.h"
3869
3870 int main() {
3871 main()
3872 ; return 0; }
3873 EOF
3874 if { (eval echo configure:3875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3875   rm -rf conftest*
3876   eval "ac_cv_lib_$ac_lib_var=yes"
3877 else
3878   echo "configure: failed program was:" >&5
3879   cat conftest.$ac_ext >&5
3880   rm -rf conftest*
3881   eval "ac_cv_lib_$ac_lib_var=no"
3882 fi
3883 rm -f conftest*
3884 LIBS="$ac_save_LIBS"
3885
3886 fi
3887 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3888   echo "$ac_t""yes" 1>&6
3889   
3890                 cat >> confdefs.h <<\EOF
3891 #define HAVE_PP 1
3892 EOF
3893
3894                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
3895                 
3896 else
3897   echo "$ac_t""no" 1>&6
3898 :
3899 fi
3900
3901
3902         # Extract the first word of "pepsy", so it can be a program name with args.
3903 set dummy pepsy; ac_word=$2
3904 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3905 echo "configure:3906: checking for $ac_word" >&5
3906 if eval "test \"`echo '$''{'ac_cv_path_PEPSY'+set}'`\" = set"; then
3907   echo $ac_n "(cached) $ac_c" 1>&6
3908 else
3909   case "$PEPSY" in
3910   /*)
3911   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a path.
3912   ;;
3913   ?:/*)                  
3914   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a dos path.
3915   ;;
3916   *)
3917   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3918   ac_dummy="$PATH"
3919   for ac_dir in $ac_dummy; do 
3920     test -z "$ac_dir" && ac_dir=.
3921     if test -f $ac_dir/$ac_word; then
3922       ac_cv_path_PEPSY="$ac_dir/$ac_word"
3923       break
3924     fi
3925   done
3926   IFS="$ac_save_ifs"
3927   ;;
3928 esac
3929 fi
3930 PEPSY="$ac_cv_path_PEPSY"
3931 if test -n "$PEPSY"; then
3932   echo "$ac_t""$PEPSY" 1>&6
3933 else
3934   echo "$ac_t""no" 1>&6
3935 fi
3936
3937 fi
3938
3939 ol_link_kerberos=no
3940
3941 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
3942         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
3943 do
3944 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3945 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3946 echo "configure:3947: checking for $ac_hdr" >&5
3947 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3948   echo $ac_n "(cached) $ac_c" 1>&6
3949 else
3950   cat > conftest.$ac_ext <<EOF
3951 #line 3952 "configure"
3952 #include "confdefs.h"
3953 #include <$ac_hdr>
3954 EOF
3955 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3956 { (eval echo configure:3957: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3957 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3958 if test -z "$ac_err"; then
3959   rm -rf conftest*
3960   eval "ac_cv_header_$ac_safe=yes"
3961 else
3962   echo "$ac_err" >&5
3963   echo "configure: failed program was:" >&5
3964   cat conftest.$ac_ext >&5
3965   rm -rf conftest*
3966   eval "ac_cv_header_$ac_safe=no"
3967 fi
3968 rm -f conftest*
3969 fi
3970 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3971   echo "$ac_t""yes" 1>&6
3972     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3973   cat >> confdefs.h <<EOF
3974 #define $ac_tr_hdr 1
3975 EOF
3976  
3977 else
3978   echo "$ac_t""no" 1>&6
3979 fi
3980 done
3981
3982
3983         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
3984                 echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
3985 echo "configure:3986: checking for main in -lkrb4" >&5
3986 ac_lib_var=`echo krb4'_'main | sed 'y%./+-%__p_%'`
3987 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3988   echo $ac_n "(cached) $ac_c" 1>&6
3989 else
3990   ac_save_LIBS="$LIBS"
3991 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
3992 cat > conftest.$ac_ext <<EOF
3993 #line 3994 "configure"
3994 #include "confdefs.h"
3995
3996 int main() {
3997 main()
3998 ; return 0; }
3999 EOF
4000 if { (eval echo configure:4001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4001   rm -rf conftest*
4002   eval "ac_cv_lib_$ac_lib_var=yes"
4003 else
4004   echo "configure: failed program was:" >&5
4005   cat conftest.$ac_ext >&5
4006   rm -rf conftest*
4007   eval "ac_cv_lib_$ac_lib_var=no"
4008 fi
4009 rm -f conftest*
4010 LIBS="$ac_save_LIBS"
4011
4012 fi
4013 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4014   echo "$ac_t""yes" 1>&6
4015   have_k5=yes
4016 else
4017   echo "$ac_t""no" 1>&6
4018 have_k5=no
4019 fi
4020
4021
4022                 if test $have_k5 = yes ; then
4023                         ol_with_kerberos=found
4024                         ol_link_kerberos=yes
4025
4026                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
4027
4028                         LIBS="$KRB_LIBS $LIBS"
4029
4030                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
4031 echo "configure:4032: checking for des_debug in Kerberos libraries" >&5
4032 if eval "test \"`echo '$''{'ol_cv_var_des_debug'+set}'`\" = set"; then
4033   echo $ac_n "(cached) $ac_c" 1>&6
4034 else
4035   
4036                                                                 save_LIBS="$LIBS"
4037                                 LIBS="$KRB_LIBS $LIBS"
4038                                 cat > conftest.$ac_ext <<EOF
4039 #line 4040 "configure"
4040 #include "confdefs.h"
4041
4042 #include <kerberosIV/krb.h>
4043 #include <kerberosIV/des.h>
4044 extern int des_debug;
4045
4046 int main() {
4047
4048 des_debug = 1;
4049
4050 ; return 0; }
4051 EOF
4052 if { (eval echo configure:4053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4053   rm -rf conftest*
4054   ol_cv_var_des_debug=yes
4055 else
4056   echo "configure: failed program was:" >&5
4057   cat conftest.$ac_ext >&5
4058   rm -rf conftest*
4059   ol_cv_var_des_debug=no
4060 fi
4061 rm -f conftest*
4062                                                                 LIBS="$save_LIBS"
4063                         
4064 fi
4065
4066 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
4067
4068                         if test $ol_cv_var_des_debug = yes ; then
4069                                 cat >> confdefs.h <<\EOF
4070 #define HAVE_DES_DEBUG 1
4071 EOF
4072
4073                         fi
4074
4075                         LIBS="$save_LIBS"
4076                 fi
4077         fi
4078 fi
4079
4080 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
4081         for ac_hdr in krb.h des.h
4082 do
4083 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4084 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4085 echo "configure:4086: checking for $ac_hdr" >&5
4086 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4087   echo $ac_n "(cached) $ac_c" 1>&6
4088 else
4089   cat > conftest.$ac_ext <<EOF
4090 #line 4091 "configure"
4091 #include "confdefs.h"
4092 #include <$ac_hdr>
4093 EOF
4094 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4095 { (eval echo configure:4096: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4096 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4097 if test -z "$ac_err"; then
4098   rm -rf conftest*
4099   eval "ac_cv_header_$ac_safe=yes"
4100 else
4101   echo "$ac_err" >&5
4102   echo "configure: failed program was:" >&5
4103   cat conftest.$ac_ext >&5
4104   rm -rf conftest*
4105   eval "ac_cv_header_$ac_safe=no"
4106 fi
4107 rm -f conftest*
4108 fi
4109 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4110   echo "$ac_t""yes" 1>&6
4111     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4112   cat >> confdefs.h <<EOF
4113 #define $ac_tr_hdr 1
4114 EOF
4115  
4116 else
4117   echo "$ac_t""no" 1>&6
4118 fi
4119 done
4120
4121
4122         if test $ac_cv_header_krb_h = yes ; then
4123                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
4124 echo "configure:4125: checking for main in -lkrb" >&5
4125 ac_lib_var=`echo krb'_'main | sed 'y%./+-%__p_%'`
4126 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4127   echo $ac_n "(cached) $ac_c" 1>&6
4128 else
4129   ac_save_LIBS="$LIBS"
4130 LIBS="-lkrb -ldes $LIBS"
4131 cat > conftest.$ac_ext <<EOF
4132 #line 4133 "configure"
4133 #include "confdefs.h"
4134
4135 int main() {
4136 main()
4137 ; return 0; }
4138 EOF
4139 if { (eval echo configure:4140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4140   rm -rf conftest*
4141   eval "ac_cv_lib_$ac_lib_var=yes"
4142 else
4143   echo "configure: failed program was:" >&5
4144   cat conftest.$ac_ext >&5
4145   rm -rf conftest*
4146   eval "ac_cv_lib_$ac_lib_var=no"
4147 fi
4148 rm -f conftest*
4149 LIBS="$ac_save_LIBS"
4150
4151 fi
4152 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4153   echo "$ac_t""yes" 1>&6
4154   have_k4=yes
4155 else
4156   echo "$ac_t""no" 1>&6
4157 have_k4=no
4158 fi
4159
4160
4161                 if test $have_k4 = yes ; then
4162                         ol_with_kerberos=found
4163                         ol_link_kerberos=yes
4164
4165                         KRB_LIBS="-lkrb -ldes"
4166                 fi
4167         fi
4168 fi
4169
4170 if test $ol_link_kerberos = yes ; then
4171         cat >> confdefs.h <<\EOF
4172 #define HAVE_KERBEROS 1
4173 EOF
4174
4175 fi
4176
4177 ol_link_tls=no
4178 if test $ol_with_tls != no ; then
4179         
4180         for ac_hdr in ssl.h
4181 do
4182 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4183 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4184 echo "configure:4185: checking for $ac_hdr" >&5
4185 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4186   echo $ac_n "(cached) $ac_c" 1>&6
4187 else
4188   cat > conftest.$ac_ext <<EOF
4189 #line 4190 "configure"
4190 #include "confdefs.h"
4191 #include <$ac_hdr>
4192 EOF
4193 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4194 { (eval echo configure:4195: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4195 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4196 if test -z "$ac_err"; then
4197   rm -rf conftest*
4198   eval "ac_cv_header_$ac_safe=yes"
4199 else
4200   echo "$ac_err" >&5
4201   echo "configure: failed program was:" >&5
4202   cat conftest.$ac_ext >&5
4203   rm -rf conftest*
4204   eval "ac_cv_header_$ac_safe=no"
4205 fi
4206 rm -f conftest*
4207 fi
4208 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4209   echo "$ac_t""yes" 1>&6
4210     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4211   cat >> confdefs.h <<EOF
4212 #define $ac_tr_hdr 1
4213 EOF
4214  
4215 else
4216   echo "$ac_t""no" 1>&6
4217 fi
4218 done
4219
4220         
4221         if test $ac_cv_header_ssl_h = yes ; then
4222                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
4223 echo "configure:4224: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
4224 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-%__p_%'`
4225 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4226   echo $ac_n "(cached) $ac_c" 1>&6
4227 else
4228   ac_save_LIBS="$LIBS"
4229 LIBS="-lssl -lcrypto $LIBS"
4230 cat > conftest.$ac_ext <<EOF
4231 #line 4232 "configure"
4232 #include "confdefs.h"
4233 /* Override any gcc2 internal prototype to avoid an error.  */
4234 /* We use char because int might match the return type of a gcc2
4235     builtin and then its argument prototype would still apply.  */
4236 char SSLeay_add_ssl_algorithms();
4237
4238 int main() {
4239 SSLeay_add_ssl_algorithms()
4240 ; return 0; }
4241 EOF
4242 if { (eval echo configure:4243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4243   rm -rf conftest*
4244   eval "ac_cv_lib_$ac_lib_var=yes"
4245 else
4246   echo "configure: failed program was:" >&5
4247   cat conftest.$ac_ext >&5
4248   rm -rf conftest*
4249   eval "ac_cv_lib_$ac_lib_var=no"
4250 fi
4251 rm -f conftest*
4252 LIBS="$ac_save_LIBS"
4253
4254 fi
4255 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4256   echo "$ac_t""yes" 1>&6
4257   have_ssleay=yes
4258                         need_rsaref=no
4259 else
4260   echo "$ac_t""no" 1>&6
4261 have_ssleay=no
4262 fi
4263
4264                         
4265                 if test $have_ssleay = no ; then
4266                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
4267 echo "configure:4268: checking for ssl3_accept in -lssl" >&5
4268 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-%__p_%'`
4269 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4270   echo $ac_n "(cached) $ac_c" 1>&6
4271 else
4272   ac_save_LIBS="$LIBS"
4273 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
4274 cat > conftest.$ac_ext <<EOF
4275 #line 4276 "configure"
4276 #include "confdefs.h"
4277 /* Override any gcc2 internal prototype to avoid an error.  */
4278 /* We use char because int might match the return type of a gcc2
4279     builtin and then its argument prototype would still apply.  */
4280 char ssl3_accept();
4281
4282 int main() {
4283 ssl3_accept()
4284 ; return 0; }
4285 EOF
4286 if { (eval echo configure:4287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4287   rm -rf conftest*
4288   eval "ac_cv_lib_$ac_lib_var=yes"
4289 else
4290   echo "configure: failed program was:" >&5
4291   cat conftest.$ac_ext >&5
4292   rm -rf conftest*
4293   eval "ac_cv_lib_$ac_lib_var=no"
4294 fi
4295 rm -f conftest*
4296 LIBS="$ac_save_LIBS"
4297
4298 fi
4299 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4300   echo "$ac_t""yes" 1>&6
4301   have_ssleay=yes
4302                                 need_rsaref=yes
4303 else
4304   echo "$ac_t""no" 1>&6
4305 have_ssleay=no
4306 fi
4307
4308                 fi
4309
4310                 if test $have_ssleay = yes ; then
4311                         ol_with_tls=found
4312                         ol_link_tls=yes
4313
4314                         cat >> confdefs.h <<\EOF
4315 #define HAVE_SSLEAY 1
4316 EOF
4317
4318
4319                         if test $need_rsaref = yes; then
4320                                 cat >> confdefs.h <<\EOF
4321 #define HAVE_RSAREF 1
4322 EOF
4323
4324
4325                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
4326                         else
4327                                 TLS_LIBS="-lssl -lcrypto"
4328                         fi
4329                 fi
4330         fi
4331 fi
4332
4333 if test $ol_link_tls = yes ; then
4334         cat >> confdefs.h <<\EOF
4335 #define HAVE_TLS 1
4336 EOF
4337
4338 fi      
4339
4340 for ac_func in \
4341         ctime_r                 \
4342         gethostbyname_r gethostbyaddr_r \
4343
4344 do
4345 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4346 echo "configure:4347: checking for $ac_func" >&5
4347 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4348   echo $ac_n "(cached) $ac_c" 1>&6
4349 else
4350   cat > conftest.$ac_ext <<EOF
4351 #line 4352 "configure"
4352 #include "confdefs.h"
4353 /* System header to define __stub macros and hopefully few prototypes,
4354     which can conflict with char $ac_func(); below.  */
4355 #include <assert.h>
4356 /* Override any gcc2 internal prototype to avoid an error.  */
4357 /* We use char because int might match the return type of a gcc2
4358     builtin and then its argument prototype would still apply.  */
4359 char $ac_func();
4360
4361 int main() {
4362
4363 /* The GNU C library defines this for functions which it implements
4364     to always fail with ENOSYS.  Some functions are actually named
4365     something starting with __ and the normal name is an alias.  */
4366 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4367 choke me
4368 #else
4369 $ac_func();
4370 #endif
4371
4372 ; return 0; }
4373 EOF
4374 if { (eval echo configure:4375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4375   rm -rf conftest*
4376   eval "ac_cv_func_$ac_func=yes"
4377 else
4378   echo "configure: failed program was:" >&5
4379   cat conftest.$ac_ext >&5
4380   rm -rf conftest*
4381   eval "ac_cv_func_$ac_func=no"
4382 fi
4383 rm -f conftest*
4384 fi
4385
4386 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4387   echo "$ac_t""yes" 1>&6
4388     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4389   cat >> confdefs.h <<EOF
4390 #define $ac_tr_func 1
4391 EOF
4392  
4393 else
4394   echo "$ac_t""no" 1>&6
4395 fi
4396 done
4397
4398
4399 if test "$ac_cv_func_ctime_r" = no ; then
4400         ol_cv_func_ctime_r_nargs=0
4401 else
4402         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
4403 echo "configure:4404: checking number of arguments of ctime_r" >&5
4404 if eval "test \"`echo '$''{'ol_cv_func_ctime_r_nargs'+set}'`\" = set"; then
4405   echo $ac_n "(cached) $ac_c" 1>&6
4406 else
4407   cat > conftest.$ac_ext <<EOF
4408 #line 4409 "configure"
4409 #include "confdefs.h"
4410 #include <time.h>
4411 int main() {
4412 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
4413 ; return 0; }
4414 EOF
4415 if { (eval echo configure:4416: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4416   rm -rf conftest*
4417   ol_cv_func_ctime_r_nargs=3
4418 else
4419   echo "configure: failed program was:" >&5
4420   cat conftest.$ac_ext >&5
4421   rm -rf conftest*
4422   cat > conftest.$ac_ext <<EOF
4423 #line 4424 "configure"
4424 #include "confdefs.h"
4425 #include <time.h>
4426 int main() {
4427 time_t ti; char *buffer; ctime_r(&ti,buffer);
4428 ; return 0; }
4429 EOF
4430 if { (eval echo configure:4431: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4431   rm -rf conftest*
4432   ol_cv_func_ctime_r_nargs=2
4433 else
4434   echo "configure: failed program was:" >&5
4435   cat conftest.$ac_ext >&5
4436   rm -rf conftest*
4437   ol_cv_func_ctime_r_nargs=0
4438 fi
4439 rm -f conftest*
4440 fi
4441 rm -f conftest*
4442 fi
4443
4444 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
4445   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
4446     cat >> confdefs.h <<EOF
4447 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
4448 EOF
4449
4450   fi
4451
4452 fi
4453
4454 if test "$ac_cv_func_gethostbyname_r" = yes ; then
4455         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
4456 echo "configure:4457: checking number of arguments of gethostbyname_r" >&5
4457 if eval "test \"`echo '$''{'ol_cv_func_gethostbyname_r_nargs'+set}'`\" = set"; then
4458   echo $ac_n "(cached) $ac_c" 1>&6
4459 else
4460   cat > conftest.$ac_ext <<EOF
4461 #line 4462 "configure"
4462 #include "confdefs.h"
4463 #include <sys/types.h>
4464 #include <sys/socket.h>
4465 #include <netinet/in.h>
4466 #include <netdb.h>
4467 #define BUFSIZE (sizeof(struct hostent)+10)
4468 int main() {
4469 struct hostent hent; char buffer[BUFSIZE];
4470                 int bufsize=BUFSIZE;int h_errno;
4471                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
4472                         buffer, bufsize, &h_errno);
4473 ; return 0; }
4474 EOF
4475 if { (eval echo configure:4476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4476   rm -rf conftest*
4477   ol_cv_func_gethostbyname_r_nargs=5
4478 else
4479   echo "configure: failed program was:" >&5
4480   cat conftest.$ac_ext >&5
4481   rm -rf conftest*
4482   cat > conftest.$ac_ext <<EOF
4483 #line 4484 "configure"
4484 #include "confdefs.h"
4485 #include <sys/types.h>
4486 #include <sys/socket.h>
4487 #include <netinet/in.h>
4488 #include <netdb.h>
4489 #define BUFSIZE (sizeof(struct hostent)+10)
4490 int main() {
4491 struct hostent hent;struct hostent *rhent;
4492                         char buffer[BUFSIZE];
4493                         int bufsize=BUFSIZE;int h_errno;
4494                         (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
4495                                 &rhent, &h_errno);
4496 ; return 0; }
4497 EOF
4498 if { (eval echo configure:4499: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4499   rm -rf conftest*
4500   ol_cv_func_gethostbyname_r_nargs=6
4501 else
4502   echo "configure: failed program was:" >&5
4503   cat conftest.$ac_ext >&5
4504   rm -rf conftest*
4505   ol_cv_func_gethostbyname_r_nargs=0
4506 fi
4507 rm -f conftest*
4508 fi
4509 rm -f conftest*
4510 fi
4511
4512 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
4513   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
4514         cat >> confdefs.h <<EOF
4515 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
4516 EOF
4517
4518   fi
4519
4520 else
4521         ol_cv_func_gethostbyname_r_nargs=0
4522 fi
4523  
4524 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
4525         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
4526 echo "configure:4527: checking number of arguments of gethostbyaddr_r" >&5
4527 if eval "test \"`echo '$''{'ol_cv_func_gethostbyaddr_r_nargs'+set}'`\" = set"; then
4528   echo $ac_n "(cached) $ac_c" 1>&6
4529 else
4530   cat > conftest.$ac_ext <<EOF
4531 #line 4532 "configure"
4532 #include "confdefs.h"
4533 #include <sys/types.h>
4534 #include <sys/socket.h>
4535 #include <netinet/in.h>
4536 #include <netdb.h>
4537 #define BUFSIZE (sizeof(struct hostent)+10)
4538 int main() {
4539 struct hostent hent; char buffer[BUFSIZE]; 
4540             struct in_addr add;
4541             size_t alen=sizeof(struct in_addr);
4542             int bufsize=BUFSIZE;int h_errno;
4543                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
4544                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
4545 ; return 0; }
4546 EOF
4547 if { (eval echo configure:4548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4548   rm -rf conftest*
4549   ol_cv_func_gethostbyaddr_r_nargs=7
4550 else
4551   echo "configure: failed program was:" >&5
4552   cat conftest.$ac_ext >&5
4553   rm -rf conftest*
4554   cat > conftest.$ac_ext <<EOF
4555 #line 4556 "configure"
4556 #include "confdefs.h"
4557 #include <sys/types.h>
4558 #include <sys/socket.h>
4559 #include <netinet/in.h>
4560 #include <netdb.h>
4561 #define BUFSIZE (sizeof(struct hostent)+10)
4562 int main() {
4563 struct hostent hent;
4564                         struct hostent *rhent; char buffer[BUFSIZE]; 
4565                         struct in_addr add;
4566                         size_t alen=sizeof(struct in_addr);
4567                         int bufsize=BUFSIZE;int h_errno;
4568                         (void)gethostbyaddr_r( (void *)&(add.s_addr),
4569                                 alen, AF_INET, &hent, buffer, bufsize, 
4570                                 &rhent, &h_errno);
4571 ; return 0; }
4572 EOF
4573 if { (eval echo configure:4574: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4574   rm -rf conftest*
4575   ol_cv_func_gethostbyaddr_r_nargs=8
4576 else
4577   echo "configure: failed program was:" >&5
4578   cat conftest.$ac_ext >&5
4579   rm -rf conftest*
4580   ol_cv_func_gethostbyaddr_r_nargs=0
4581 fi
4582 rm -f conftest*
4583 fi
4584 rm -f conftest*
4585 fi
4586
4587 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
4588   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
4589     cat >> confdefs.h <<EOF
4590 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
4591 EOF
4592
4593   fi
4594
4595 else
4596         ol_cv_func_gethostbyaddr_r_nargs=0
4597 fi
4598
4599 if test "$ac_cv_func_ctime_r" = yes \
4600         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
4601         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
4602         -a "$ac_cv_func_gethostbyname_r" = yes \
4603         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
4604         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
4605         -a "$ac_cv_func_gethostbyaddr_r" = yes \
4606         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
4607         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
4608         ; then
4609  
4610         cat >> confdefs.h <<\EOF
4611 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
4612 EOF
4613
4614 fi
4615
4616 ol_link_threads=no
4617 if test $ol_with_threads = auto -o $ol_with_threads = yes \
4618         -o $ol_with_threads = posix ; then
4619
4620         for ac_hdr in pthread.h sched.h
4621 do
4622 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4623 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4624 echo "configure:4625: checking for $ac_hdr" >&5
4625 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4626   echo $ac_n "(cached) $ac_c" 1>&6
4627 else
4628   cat > conftest.$ac_ext <<EOF
4629 #line 4630 "configure"
4630 #include "confdefs.h"
4631 #include <$ac_hdr>
4632 EOF
4633 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4634 { (eval echo configure:4635: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4635 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4636 if test -z "$ac_err"; then
4637   rm -rf conftest*
4638   eval "ac_cv_header_$ac_safe=yes"
4639 else
4640   echo "$ac_err" >&5
4641   echo "configure: failed program was:" >&5
4642   cat conftest.$ac_ext >&5
4643   rm -rf conftest*
4644   eval "ac_cv_header_$ac_safe=no"
4645 fi
4646 rm -f conftest*
4647 fi
4648 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4649   echo "$ac_t""yes" 1>&6
4650     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4651   cat >> confdefs.h <<EOF
4652 #define $ac_tr_hdr 1
4653 EOF
4654  
4655 else
4656   echo "$ac_t""no" 1>&6
4657 fi
4658 done
4659
4660
4661         if test $ac_cv_header_pthread_h = yes ; then
4662                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
4663 echo "configure:4664: checking POSIX thread version" >&5
4664 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
4665   echo $ac_n "(cached) $ac_c" 1>&6
4666 else
4667   
4668         cat > conftest.$ac_ext <<EOF
4669 #line 4670 "configure"
4670 #include "confdefs.h"
4671
4672 #               include <pthread.h>
4673                 /* this check could be improved */
4674 #               ifdef PTHREAD_ONCE_INIT
4675                         pthread_version_final
4676 #               endif
4677         
4678 EOF
4679 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4680   egrep "pthread_version_final" >/dev/null 2>&1; then
4681   rm -rf conftest*
4682   ol_pthread_final=yes
4683 else
4684   rm -rf conftest*
4685   ol_pthread_final=no
4686 fi
4687 rm -f conftest*
4688
4689
4690         cat > conftest.$ac_ext <<EOF
4691 #line 4692 "configure"
4692 #include "confdefs.h"
4693
4694 #               include <pthread.h>
4695                 /* this check could be improved */
4696 #               ifdef pthread_once_init
4697                         pthread_version_draft4
4698 #               endif
4699         
4700 EOF
4701 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4702   egrep "pthread_version_draft4" >/dev/null 2>&1; then
4703   rm -rf conftest*
4704   ol_pthread_draft4=yes
4705 else
4706   rm -rf conftest*
4707   ol_pthread_draft4=no
4708 fi
4709 rm -f conftest*
4710
4711
4712         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
4713                 ol_cv_pthread_version=final
4714         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
4715                 ol_cv_pthread_version=draft4
4716         else
4717                 ol_cv_pthread_version=unknown
4718         fi
4719
4720 fi
4721
4722 echo "$ac_t""$ol_cv_pthread_version" 1>&6
4723
4724
4725                 if test $ol_cv_pthread_version = final ; then
4726                         cat >> confdefs.h <<\EOF
4727 #define HAVE_PTHREADS_FINAL 1
4728 EOF
4729
4730                 elif test $ol_cv_pthread_version = draft4 ; then
4731                         cat >> confdefs.h <<\EOF
4732 #define HAVE_PTHREADS_D4 1
4733 EOF
4734
4735                 else
4736                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
4737                 fi
4738
4739                 # consider threads found
4740                 ol_with_threads=found
4741
4742                 
4743         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
4744 echo "configure:4745: checking for LinuxThreads pthread.h" >&5
4745 if eval "test \"`echo '$''{'ol_cv_header_linux_threads'+set}'`\" = set"; then
4746   echo $ac_n "(cached) $ac_c" 1>&6
4747 else
4748   cat > conftest.$ac_ext <<EOF
4749 #line 4750 "configure"
4750 #include "confdefs.h"
4751 #include <pthread.h>
4752 EOF
4753 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4754   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
4755   rm -rf conftest*
4756   ol_cv_header_linux_threads=yes
4757 else
4758   rm -rf conftest*
4759   ol_cv_header_linux_threads=no
4760 fi
4761 rm -f conftest*
4762
4763                 
4764 fi
4765
4766 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
4767         if test $ol_cv_header_linux_threads = yes; then
4768                 cat >> confdefs.h <<\EOF
4769 #define HAVE_LINUX_THREADS 1
4770 EOF
4771
4772         fi
4773
4774
4775                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
4776                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
4777 echo "configure:4778: checking for pthread_create in default libraries" >&5
4778                 if eval "test \"`echo '$''{'ol_cv_pthread_create'+set}'`\" = set"; then
4779   echo $ac_n "(cached) $ac_c" 1>&6
4780 else
4781   
4782                 if test "$cross_compiling" = yes; then
4783                         ol_cv_pthread_create=yes
4784 else
4785   cat > conftest.$ac_ext <<EOF
4786 #line 4787 "configure"
4787 #include "confdefs.h"
4788
4789 #include <pthread.h>
4790 #ifndef NULL
4791 #define NULL (void*)0
4792 #endif
4793
4794 static void *task(p)
4795         void *p;
4796 {
4797         return (void *) (p == NULL);
4798 }
4799
4800 int main(argc, argv)
4801         int argc;
4802         char **argv;
4803 {
4804         pthread_t t;
4805         int status;
4806
4807         /* make sure pthread_create() isn't just a stub */
4808 #if HAVE_PTHREADS_D4
4809         status = pthread_create(&t, pthread_attr_default, task, NULL);
4810 #else
4811         status = pthread_create(&t, NULL, task, NULL);
4812 #endif
4813
4814         if( status ) return status;
4815
4816         /* make sure pthread_detach() isn't just a stub */
4817 #if HAVE_PTHREADS_D4
4818         status = pthread_detach( &t );
4819 #else
4820         status = pthread_detach( t );
4821 #endif
4822
4823         if( status ) return status;
4824
4825         return status;
4826 }
4827
4828 EOF
4829 if { (eval echo configure:4830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4830 then
4831   ol_cv_pthread_create=yes
4832 else
4833   echo "configure: failed program was:" >&5
4834   cat conftest.$ac_ext >&5
4835   rm -fr conftest*
4836   ol_cv_pthread_create=no
4837 fi
4838 rm -fr conftest*
4839 fi
4840
4841 fi
4842
4843                 echo "$ac_t""$ol_cv_pthread_create" 1>&6
4844
4845                 if test $ol_cv_pthread_create != no ; then
4846                         ol_link_threads=posix
4847                         ol_link_pthreads=""
4848                 fi
4849                 
4850                 # Pthread try link: -mt (ol_cv_pthread_mt)
4851         if test "$ol_link_threads" = no ; then
4852                 # try -mt
4853                 echo $ac_n "checking for pthread link with -mt""... $ac_c" 1>&6
4854 echo "configure:4855: checking for pthread link with -mt" >&5
4855 if eval "test \"`echo '$''{'ol_cv_pthread_mt'+set}'`\" = set"; then
4856   echo $ac_n "(cached) $ac_c" 1>&6
4857 else
4858   
4859                         # save the flags
4860                         ol_LIBS="$LIBS"
4861                         LIBS="-mt $LIBS"
4862
4863                         cat > conftest.$ac_ext <<EOF
4864 #line 4865 "configure"
4865 #include "confdefs.h"
4866
4867 #include <pthread.h>
4868 #ifndef NULL
4869 #define NULL (void*)0
4870 #endif
4871
4872 int main() {
4873
4874         pthread_t t;
4875
4876 #if HAVE_PTHREADS_D4
4877         pthread_create(&t, pthread_attr_default, NULL, NULL);
4878         pthread_detach( &t );
4879 #else
4880         pthread_create(&t, NULL, NULL, NULL);
4881         pthread_detach( t );
4882 #endif
4883 #ifdef HAVE_LINUX_THREADS
4884         pthread_kill_other_threads_np();
4885 #endif
4886
4887 ; return 0; }
4888 EOF
4889 if { (eval echo configure:4890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4890   rm -rf conftest*
4891   ol_cv_pthread_mt=yes
4892 else
4893   echo "configure: failed program was:" >&5
4894   cat conftest.$ac_ext >&5
4895   rm -rf conftest*
4896   ol_cv_pthread_mt=no
4897 fi
4898 rm -f conftest*
4899
4900                 # restore the LIBS
4901                 LIBS="$ol_LIBS"
4902                 
4903 fi
4904
4905 echo "$ac_t""$ol_cv_pthread_mt" 1>&6
4906
4907                 if test $ol_cv_pthread_mt = yes ; then
4908                         ol_link_pthreads="-mt"
4909                         ol_link_threads=posix
4910                 fi
4911         fi
4912
4913                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
4914         if test "$ol_link_threads" = no ; then
4915                 # try -kthread
4916                 echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
4917 echo "configure:4918: checking for pthread link with -kthread" >&5
4918 if eval "test \"`echo '$''{'ol_cv_pthread_kthread'+set}'`\" = set"; then
4919   echo $ac_n "(cached) $ac_c" 1>&6
4920 else
4921   
4922                         # save the flags
4923                         ol_LIBS="$LIBS"
4924                         LIBS="-kthread $LIBS"
4925
4926                         cat > conftest.$ac_ext <<EOF
4927 #line 4928 "configure"
4928 #include "confdefs.h"
4929
4930 #include <pthread.h>
4931 #ifndef NULL
4932 #define NULL (void*)0
4933 #endif
4934
4935 int main() {
4936
4937         pthread_t t;
4938
4939 #if HAVE_PTHREADS_D4
4940         pthread_create(&t, pthread_attr_default, NULL, NULL);
4941         pthread_detach( &t );
4942 #else
4943         pthread_create(&t, NULL, NULL, NULL);
4944         pthread_detach( t );
4945 #endif
4946 #ifdef HAVE_LINUX_THREADS
4947         pthread_kill_other_threads_np();
4948 #endif
4949
4950 ; return 0; }
4951 EOF
4952 if { (eval echo configure:4953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4953   rm -rf conftest*
4954   ol_cv_pthread_kthread=yes
4955 else
4956   echo "configure: failed program was:" >&5
4957   cat conftest.$ac_ext >&5
4958   rm -rf conftest*
4959   ol_cv_pthread_kthread=no
4960 fi
4961 rm -f conftest*
4962
4963                 # restore the LIBS
4964                 LIBS="$ol_LIBS"
4965                 
4966 fi
4967
4968 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
4969
4970                 if test $ol_cv_pthread_kthread = yes ; then
4971                         ol_link_pthreads="-kthread"
4972                         ol_link_threads=posix
4973                 fi
4974         fi
4975
4976                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
4977         if test "$ol_link_threads" = no ; then
4978                 # try -pthread
4979                 echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
4980 echo "configure:4981: checking for pthread link with -pthread" >&5
4981 if eval "test \"`echo '$''{'ol_cv_pthread_pthread'+set}'`\" = set"; then
4982   echo $ac_n "(cached) $ac_c" 1>&6
4983 else
4984   
4985                         # save the flags
4986                         ol_LIBS="$LIBS"
4987                         LIBS="-pthread $LIBS"
4988
4989                         cat > conftest.$ac_ext <<EOF
4990 #line 4991 "configure"
4991 #include "confdefs.h"
4992
4993 #include <pthread.h>
4994 #ifndef NULL
4995 #define NULL (void*)0
4996 #endif
4997
4998 int main() {
4999
5000         pthread_t t;
5001
5002 #if HAVE_PTHREADS_D4
5003         pthread_create(&t, pthread_attr_default, NULL, NULL);
5004         pthread_detach( &t );
5005 #else
5006         pthread_create(&t, NULL, NULL, NULL);
5007         pthread_detach( t );
5008 #endif
5009 #ifdef HAVE_LINUX_THREADS
5010         pthread_kill_other_threads_np();
5011 #endif
5012
5013 ; return 0; }
5014 EOF
5015 if { (eval echo configure:5016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5016   rm -rf conftest*
5017   ol_cv_pthread_pthread=yes
5018 else
5019   echo "configure: failed program was:" >&5
5020   cat conftest.$ac_ext >&5
5021   rm -rf conftest*
5022   ol_cv_pthread_pthread=no
5023 fi
5024 rm -f conftest*
5025
5026                 # restore the LIBS
5027                 LIBS="$ol_LIBS"
5028                 
5029 fi
5030
5031 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
5032
5033                 if test $ol_cv_pthread_pthread = yes ; then
5034                         ol_link_pthreads="-pthread"
5035                         ol_link_threads=posix
5036                 fi
5037         fi
5038
5039                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
5040         if test "$ol_link_threads" = no ; then
5041                 # try -pthreads
5042                 echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
5043 echo "configure:5044: checking for pthread link with -pthreads" >&5
5044 if eval "test \"`echo '$''{'ol_cv_pthread_pthreads'+set}'`\" = set"; then
5045   echo $ac_n "(cached) $ac_c" 1>&6
5046 else
5047   
5048                         # save the flags
5049                         ol_LIBS="$LIBS"
5050                         LIBS="-pthreads $LIBS"
5051
5052                         cat > conftest.$ac_ext <<EOF
5053 #line 5054 "configure"
5054 #include "confdefs.h"
5055
5056 #include <pthread.h>
5057 #ifndef NULL
5058 #define NULL (void*)0
5059 #endif
5060
5061 int main() {
5062
5063         pthread_t t;
5064
5065 #if HAVE_PTHREADS_D4
5066         pthread_create(&t, pthread_attr_default, NULL, NULL);
5067         pthread_detach( &t );
5068 #else
5069         pthread_create(&t, NULL, NULL, NULL);
5070         pthread_detach( t );
5071 #endif
5072 #ifdef HAVE_LINUX_THREADS
5073         pthread_kill_other_threads_np();
5074 #endif
5075
5076 ; return 0; }
5077 EOF
5078 if { (eval echo configure:5079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5079   rm -rf conftest*
5080   ol_cv_pthread_pthreads=yes
5081 else
5082   echo "configure: failed program was:" >&5
5083   cat conftest.$ac_ext >&5
5084   rm -rf conftest*
5085   ol_cv_pthread_pthreads=no
5086 fi
5087 rm -f conftest*
5088
5089                 # restore the LIBS
5090                 LIBS="$ol_LIBS"
5091                 
5092 fi
5093
5094 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
5095
5096                 if test $ol_cv_pthread_pthreads = yes ; then
5097                         ol_link_pthreads="-pthreads"
5098                         ol_link_threads=posix
5099                 fi
5100         fi
5101
5102                 # Pthread try link: -thread (ol_cv_pthread_thread)
5103         if test "$ol_link_threads" = no ; then
5104                 # try -thread
5105                 echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
5106 echo "configure:5107: checking for pthread link with -thread" >&5
5107 if eval "test \"`echo '$''{'ol_cv_pthread_thread'+set}'`\" = set"; then
5108   echo $ac_n "(cached) $ac_c" 1>&6
5109 else
5110   
5111                         # save the flags
5112                         ol_LIBS="$LIBS"
5113                         LIBS="-thread $LIBS"
5114
5115                         cat > conftest.$ac_ext <<EOF
5116 #line 5117 "configure"
5117 #include "confdefs.h"
5118
5119 #include <pthread.h>
5120 #ifndef NULL
5121 #define NULL (void*)0
5122 #endif
5123
5124 int main() {
5125
5126         pthread_t t;
5127
5128 #if HAVE_PTHREADS_D4
5129         pthread_create(&t, pthread_attr_default, NULL, NULL);
5130         pthread_detach( &t );
5131 #else
5132         pthread_create(&t, NULL, NULL, NULL);
5133         pthread_detach( t );
5134 #endif
5135 #ifdef HAVE_LINUX_THREADS
5136         pthread_kill_other_threads_np();
5137 #endif
5138
5139 ; return 0; }
5140 EOF
5141 if { (eval echo configure:5142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5142   rm -rf conftest*
5143   ol_cv_pthread_thread=yes
5144 else
5145   echo "configure: failed program was:" >&5
5146   cat conftest.$ac_ext >&5
5147   rm -rf conftest*
5148   ol_cv_pthread_thread=no
5149 fi
5150 rm -f conftest*
5151
5152                 # restore the LIBS
5153                 LIBS="$ol_LIBS"
5154                 
5155 fi
5156
5157 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
5158
5159                 if test $ol_cv_pthread_thread = yes ; then
5160                         ol_link_pthreads="-thread"
5161                         ol_link_threads=posix
5162                 fi
5163         fi
5164
5165
5166                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
5167         if test "$ol_link_threads" = no ; then
5168                 # try -lpthread -lmach -lexc -lc_r
5169                 echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
5170 echo "configure:5171: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
5171 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread_lmach_lexc_lc_r'+set}'`\" = set"; then
5172   echo $ac_n "(cached) $ac_c" 1>&6
5173 else
5174   
5175                         # save the flags
5176                         ol_LIBS="$LIBS"
5177                         LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
5178
5179                         cat > conftest.$ac_ext <<EOF
5180 #line 5181 "configure"
5181 #include "confdefs.h"
5182
5183 #include <pthread.h>
5184 #ifndef NULL
5185 #define NULL (void*)0
5186 #endif
5187
5188 int main() {
5189
5190         pthread_t t;
5191
5192 #if HAVE_PTHREADS_D4
5193         pthread_create(&t, pthread_attr_default, NULL, NULL);
5194         pthread_detach( &t );
5195 #else
5196         pthread_create(&t, NULL, NULL, NULL);
5197         pthread_detach( t );
5198 #endif
5199 #ifdef HAVE_LINUX_THREADS
5200         pthread_kill_other_threads_np();
5201 #endif
5202
5203 ; return 0; }
5204 EOF
5205 if { (eval echo configure:5206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5206   rm -rf conftest*
5207   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
5208 else
5209   echo "configure: failed program was:" >&5
5210   cat conftest.$ac_ext >&5
5211   rm -rf conftest*
5212   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
5213 fi
5214 rm -f conftest*
5215
5216                 # restore the LIBS
5217                 LIBS="$ol_LIBS"
5218                 
5219 fi
5220
5221 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
5222
5223                 if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
5224                         ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
5225                         ol_link_threads=posix
5226                 fi
5227         fi
5228
5229                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
5230         if test "$ol_link_threads" = no ; then
5231                 # try -lpthread -lmach -lexc
5232                 echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
5233 echo "configure:5234: checking for pthread link with -lpthread -lmach -lexc" >&5
5234 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread_lmach_lexc'+set}'`\" = set"; then
5235   echo $ac_n "(cached) $ac_c" 1>&6
5236 else
5237   
5238                         # save the flags
5239                         ol_LIBS="$LIBS"
5240                         LIBS="-lpthread -lmach -lexc $LIBS"
5241
5242                         cat > conftest.$ac_ext <<EOF
5243 #line 5244 "configure"
5244 #include "confdefs.h"
5245
5246 #include <pthread.h>
5247 #ifndef NULL
5248 #define NULL (void*)0
5249 #endif
5250
5251 int main() {
5252
5253         pthread_t t;
5254
5255 #if HAVE_PTHREADS_D4
5256         pthread_create(&t, pthread_attr_default, NULL, NULL);
5257         pthread_detach( &t );
5258 #else
5259         pthread_create(&t, NULL, NULL, NULL);
5260         pthread_detach( t );
5261 #endif
5262 #ifdef HAVE_LINUX_THREADS
5263         pthread_kill_other_threads_np();
5264 #endif
5265
5266 ; return 0; }
5267 EOF
5268 if { (eval echo configure:5269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5269   rm -rf conftest*
5270   ol_cv_pthread_lpthread_lmach_lexc=yes
5271 else
5272   echo "configure: failed program was:" >&5
5273   cat conftest.$ac_ext >&5
5274   rm -rf conftest*
5275   ol_cv_pthread_lpthread_lmach_lexc=no
5276 fi
5277 rm -f conftest*
5278
5279                 # restore the LIBS
5280                 LIBS="$ol_LIBS"
5281                 
5282 fi
5283
5284 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
5285
5286                 if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
5287                         ol_link_pthreads="-lpthread -lmach -lexc"
5288                         ol_link_threads=posix
5289                 fi
5290         fi
5291
5292
5293                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
5294         if test "$ol_link_threads" = no ; then
5295                 # try -lpthread -Wl,-woff,85
5296                 echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
5297 echo "configure:5298: checking for pthread link with -lpthread -Wl,-woff,85" >&5
5298 if eval "test \"`echo '$''{'ol_cv_pthread_lib_lpthread_woff'+set}'`\" = set"; then
5299   echo $ac_n "(cached) $ac_c" 1>&6
5300 else
5301   
5302                         # save the flags
5303                         ol_LIBS="$LIBS"
5304                         LIBS="-lpthread -Wl,-woff,85 $LIBS"
5305
5306                         cat > conftest.$ac_ext <<EOF
5307 #line 5308 "configure"
5308 #include "confdefs.h"
5309
5310 #include <pthread.h>
5311 #ifndef NULL
5312 #define NULL (void*)0
5313 #endif
5314
5315 int main() {
5316
5317         pthread_t t;
5318
5319 #if HAVE_PTHREADS_D4
5320         pthread_create(&t, pthread_attr_default, NULL, NULL);
5321         pthread_detach( &t );
5322 #else
5323         pthread_create(&t, NULL, NULL, NULL);
5324         pthread_detach( t );
5325 #endif
5326 #ifdef HAVE_LINUX_THREADS
5327         pthread_kill_other_threads_np();
5328 #endif
5329
5330 ; return 0; }
5331 EOF
5332 if { (eval echo configure:5333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5333   rm -rf conftest*
5334   ol_cv_pthread_lib_lpthread_woff=yes
5335 else
5336   echo "configure: failed program was:" >&5
5337   cat conftest.$ac_ext >&5
5338   rm -rf conftest*
5339   ol_cv_pthread_lib_lpthread_woff=no
5340 fi
5341 rm -f conftest*
5342
5343                 # restore the LIBS
5344                 LIBS="$ol_LIBS"
5345                 
5346 fi
5347
5348 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
5349
5350                 if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
5351                         ol_link_pthreads="-lpthread -Wl,-woff,85"
5352                         ol_link_threads=posix
5353                 fi
5354         fi
5355
5356
5357                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
5358         if test "$ol_link_threads" = no ; then
5359                 # try -lpthread
5360                 echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
5361 echo "configure:5362: checking for pthread link with -lpthread" >&5
5362 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread'+set}'`\" = set"; then
5363   echo $ac_n "(cached) $ac_c" 1>&6
5364 else
5365   
5366                         # save the flags
5367                         ol_LIBS="$LIBS"
5368                         LIBS="-lpthread $LIBS"
5369
5370                         cat > conftest.$ac_ext <<EOF
5371 #line 5372 "configure"
5372 #include "confdefs.h"
5373
5374 #include <pthread.h>
5375 #ifndef NULL
5376 #define NULL (void*)0
5377 #endif
5378
5379 int main() {
5380
5381         pthread_t t;
5382
5383 #if HAVE_PTHREADS_D4
5384         pthread_create(&t, pthread_attr_default, NULL, NULL);
5385         pthread_detach( &t );
5386 #else
5387         pthread_create(&t, NULL, NULL, NULL);
5388         pthread_detach( t );
5389 #endif
5390 #ifdef HAVE_LINUX_THREADS
5391         pthread_kill_other_threads_np();
5392 #endif
5393
5394 ; return 0; }
5395 EOF
5396 if { (eval echo configure:5397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5397   rm -rf conftest*
5398   ol_cv_pthread_lpthread=yes
5399 else
5400   echo "configure: failed program was:" >&5
5401   cat conftest.$ac_ext >&5
5402   rm -rf conftest*
5403   ol_cv_pthread_lpthread=no
5404 fi
5405 rm -f conftest*
5406
5407                 # restore the LIBS
5408                 LIBS="$ol_LIBS"
5409                 
5410 fi
5411
5412 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
5413
5414                 if test $ol_cv_pthread_lpthread = yes ; then
5415                         ol_link_pthreads="-lpthread"
5416                         ol_link_threads=posix
5417                 fi
5418         fi
5419
5420                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
5421         if test "$ol_link_threads" = no ; then
5422                 # try -lc_r
5423                 echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
5424 echo "configure:5425: checking for pthread link with -lc_r" >&5
5425 if eval "test \"`echo '$''{'ol_cv_pthread_lc_r'+set}'`\" = set"; then
5426   echo $ac_n "(cached) $ac_c" 1>&6
5427 else
5428   
5429                         # save the flags
5430                         ol_LIBS="$LIBS"
5431                         LIBS="-lc_r $LIBS"
5432
5433                         cat > conftest.$ac_ext <<EOF
5434 #line 5435 "configure"
5435 #include "confdefs.h"
5436
5437 #include <pthread.h>
5438 #ifndef NULL
5439 #define NULL (void*)0
5440 #endif
5441
5442 int main() {
5443
5444         pthread_t t;
5445
5446 #if HAVE_PTHREADS_D4
5447         pthread_create(&t, pthread_attr_default, NULL, NULL);
5448         pthread_detach( &t );
5449 #else
5450         pthread_create(&t, NULL, NULL, NULL);
5451         pthread_detach( t );
5452 #endif
5453 #ifdef HAVE_LINUX_THREADS
5454         pthread_kill_other_threads_np();
5455 #endif
5456
5457 ; return 0; }
5458 EOF
5459 if { (eval echo configure:5460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5460   rm -rf conftest*
5461   ol_cv_pthread_lc_r=yes
5462 else
5463   echo "configure: failed program was:" >&5
5464   cat conftest.$ac_ext >&5
5465   rm -rf conftest*
5466   ol_cv_pthread_lc_r=no
5467 fi
5468 rm -f conftest*
5469
5470                 # restore the LIBS
5471                 LIBS="$ol_LIBS"
5472                 
5473 fi
5474
5475 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
5476
5477                 if test $ol_cv_pthread_lc_r = yes ; then
5478                         ol_link_pthreads="-lc_r"
5479                         ol_link_threads=posix
5480                 fi
5481         fi
5482
5483
5484                 # Pthread try link: -threads (ol_cv_pthread_threads)
5485         if test "$ol_link_threads" = no ; then
5486                 # try -threads
5487                 echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
5488 echo "configure:5489: checking for pthread link with -threads" >&5
5489 if eval "test \"`echo '$''{'ol_cv_pthread_threads'+set}'`\" = set"; then
5490   echo $ac_n "(cached) $ac_c" 1>&6
5491 else
5492   
5493                         # save the flags
5494                         ol_LIBS="$LIBS"
5495                         LIBS="-threads $LIBS"
5496
5497                         cat > conftest.$ac_ext <<EOF
5498 #line 5499 "configure"
5499 #include "confdefs.h"
5500
5501 #include <pthread.h>
5502 #ifndef NULL
5503 #define NULL (void*)0
5504 #endif
5505
5506 int main() {
5507
5508         pthread_t t;
5509
5510 #if HAVE_PTHREADS_D4
5511         pthread_create(&t, pthread_attr_default, NULL, NULL);
5512         pthread_detach( &t );
5513 #else
5514         pthread_create(&t, NULL, NULL, NULL);
5515         pthread_detach( t );
5516 #endif
5517 #ifdef HAVE_LINUX_THREADS
5518         pthread_kill_other_threads_np();
5519 #endif
5520
5521 ; return 0; }
5522 EOF
5523 if { (eval echo configure:5524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5524   rm -rf conftest*
5525   ol_cv_pthread_threads=yes
5526 else
5527   echo "configure: failed program was:" >&5
5528   cat conftest.$ac_ext >&5
5529   rm -rf conftest*
5530   ol_cv_pthread_threads=no
5531 fi
5532 rm -f conftest*
5533
5534                 # restore the LIBS
5535                 LIBS="$ol_LIBS"
5536                 
5537 fi
5538
5539 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
5540
5541                 if test $ol_cv_pthread_threads = yes ; then
5542                         ol_link_pthreads="-threads"
5543                         ol_link_threads=posix
5544                 fi
5545         fi
5546
5547
5548                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
5549         if test "$ol_link_threads" = no ; then
5550                 # try -lpthreads -lmach -lexc -lc_r
5551                 echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
5552 echo "configure:5553: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
5553 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lmach_lexc_lc_r'+set}'`\" = set"; then
5554   echo $ac_n "(cached) $ac_c" 1>&6
5555 else
5556   
5557                         # save the flags
5558                         ol_LIBS="$LIBS"
5559                         LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
5560
5561                         cat > conftest.$ac_ext <<EOF
5562 #line 5563 "configure"
5563 #include "confdefs.h"
5564
5565 #include <pthread.h>
5566 #ifndef NULL
5567 #define NULL (void*)0
5568 #endif
5569
5570 int main() {
5571
5572         pthread_t t;
5573
5574 #if HAVE_PTHREADS_D4
5575         pthread_create(&t, pthread_attr_default, NULL, NULL);
5576         pthread_detach( &t );
5577 #else
5578         pthread_create(&t, NULL, NULL, NULL);
5579         pthread_detach( t );
5580 #endif
5581 #ifdef HAVE_LINUX_THREADS
5582         pthread_kill_other_threads_np();
5583 #endif
5584
5585 ; return 0; }
5586 EOF
5587 if { (eval echo configure:5588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5588   rm -rf conftest*
5589   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
5590 else
5591   echo "configure: failed program was:" >&5
5592   cat conftest.$ac_ext >&5
5593   rm -rf conftest*
5594   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
5595 fi
5596 rm -f conftest*
5597
5598                 # restore the LIBS
5599                 LIBS="$ol_LIBS"
5600                 
5601 fi
5602
5603 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
5604
5605                 if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
5606                         ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
5607                         ol_link_threads=posix
5608                 fi
5609         fi
5610
5611                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
5612         if test "$ol_link_threads" = no ; then
5613                 # try -lpthreads -lmach -lexc
5614                 echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
5615 echo "configure:5616: checking for pthread link with -lpthreads -lmach -lexc" >&5
5616 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lmach_lexc'+set}'`\" = set"; then
5617   echo $ac_n "(cached) $ac_c" 1>&6
5618 else
5619   
5620                         # save the flags
5621                         ol_LIBS="$LIBS"
5622                         LIBS="-lpthreads -lmach -lexc $LIBS"
5623
5624                         cat > conftest.$ac_ext <<EOF
5625 #line 5626 "configure"
5626 #include "confdefs.h"
5627
5628 #include <pthread.h>
5629 #ifndef NULL
5630 #define NULL (void*)0
5631 #endif
5632
5633 int main() {
5634
5635         pthread_t t;
5636
5637 #if HAVE_PTHREADS_D4
5638         pthread_create(&t, pthread_attr_default, NULL, NULL);
5639         pthread_detach( &t );
5640 #else
5641         pthread_create(&t, NULL, NULL, NULL);
5642         pthread_detach( t );
5643 #endif
5644 #ifdef HAVE_LINUX_THREADS
5645         pthread_kill_other_threads_np();
5646 #endif
5647
5648 ; return 0; }
5649 EOF
5650 if { (eval echo configure:5651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5651   rm -rf conftest*
5652   ol_cv_pthread_lpthreads_lmach_lexc=yes
5653 else
5654   echo "configure: failed program was:" >&5
5655   cat conftest.$ac_ext >&5
5656   rm -rf conftest*
5657   ol_cv_pthread_lpthreads_lmach_lexc=no
5658 fi
5659 rm -f conftest*
5660
5661                 # restore the LIBS
5662                 LIBS="$ol_LIBS"
5663                 
5664 fi
5665
5666 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
5667
5668                 if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
5669                         ol_link_pthreads="-lpthreads -lmach -lexc"
5670                         ol_link_threads=posix
5671                 fi
5672         fi
5673
5674                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
5675         if test "$ol_link_threads" = no ; then
5676                 # try -lpthreads -lexc
5677                 echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
5678 echo "configure:5679: checking for pthread link with -lpthreads -lexc" >&5
5679 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lexc'+set}'`\" = set"; then
5680   echo $ac_n "(cached) $ac_c" 1>&6
5681 else
5682   
5683                         # save the flags
5684                         ol_LIBS="$LIBS"
5685                         LIBS="-lpthreads -lexc $LIBS"
5686
5687                         cat > conftest.$ac_ext <<EOF
5688 #line 5689 "configure"
5689 #include "confdefs.h"
5690
5691 #include <pthread.h>
5692 #ifndef NULL
5693 #define NULL (void*)0
5694 #endif
5695
5696 int main() {
5697
5698         pthread_t t;
5699
5700 #if HAVE_PTHREADS_D4
5701         pthread_create(&t, pthread_attr_default, NULL, NULL);
5702         pthread_detach( &t );
5703 #else
5704         pthread_create(&t, NULL, NULL, NULL);
5705         pthread_detach( t );
5706 #endif
5707 #ifdef HAVE_LINUX_THREADS
5708         pthread_kill_other_threads_np();
5709 #endif
5710
5711 ; return 0; }
5712 EOF
5713 if { (eval echo configure:5714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5714   rm -rf conftest*
5715   ol_cv_pthread_lpthreads_lexc=yes
5716 else
5717   echo "configure: failed program was:" >&5
5718   cat conftest.$ac_ext >&5
5719   rm -rf conftest*
5720   ol_cv_pthread_lpthreads_lexc=no
5721 fi
5722 rm -f conftest*
5723
5724                 # restore the LIBS
5725                 LIBS="$ol_LIBS"
5726                 
5727 fi
5728
5729 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
5730
5731                 if test $ol_cv_pthread_lpthreads_lexc = yes ; then
5732                         ol_link_pthreads="-lpthreads -lexc"
5733                         ol_link_threads=posix
5734                 fi
5735         fi
5736
5737
5738                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
5739         if test "$ol_link_threads" = no ; then
5740                 # try -lpthreads
5741                 echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
5742 echo "configure:5743: checking for pthread link with -lpthreads" >&5
5743 if eval "test \"`echo '$''{'ol_cv_pthread_lib_lpthreads'+set}'`\" = set"; then
5744   echo $ac_n "(cached) $ac_c" 1>&6
5745 else
5746   
5747                         # save the flags
5748                         ol_LIBS="$LIBS"
5749                         LIBS="-lpthreads $LIBS"
5750
5751                         cat > conftest.$ac_ext <<EOF
5752 #line 5753 "configure"
5753 #include "confdefs.h"
5754
5755 #include <pthread.h>
5756 #ifndef NULL
5757 #define NULL (void*)0
5758 #endif
5759
5760 int main() {
5761
5762         pthread_t t;
5763
5764 #if HAVE_PTHREADS_D4
5765         pthread_create(&t, pthread_attr_default, NULL, NULL);
5766         pthread_detach( &t );
5767 #else
5768         pthread_create(&t, NULL, NULL, NULL);
5769         pthread_detach( t );
5770 #endif
5771 #ifdef HAVE_LINUX_THREADS
5772         pthread_kill_other_threads_np();
5773 #endif
5774
5775 ; return 0; }
5776 EOF
5777 if { (eval echo configure:5778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5778   rm -rf conftest*
5779   ol_cv_pthread_lib_lpthreads=yes
5780 else
5781   echo "configure: failed program was:" >&5
5782   cat conftest.$ac_ext >&5
5783   rm -rf conftest*
5784   ol_cv_pthread_lib_lpthreads=no
5785 fi
5786 rm -f conftest*
5787
5788                 # restore the LIBS
5789                 LIBS="$ol_LIBS"
5790                 
5791 fi
5792
5793 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
5794
5795                 if test $ol_cv_pthread_lib_lpthreads = yes ; then
5796                         ol_link_pthreads="-lpthreads"
5797                         ol_link_threads=posix
5798                 fi
5799         fi
5800
5801
5802                 if test $ol_link_threads != no ; then
5803                         cat >> confdefs.h <<\EOF
5804 #define HAVE_PTHREADS 1
5805 EOF
5806
5807
5808                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
5809
5810                                                 save_CPPFLAGS="$CPPFLAGS"
5811                         save_LIBS="$LIBS"
5812                         LIBS="$LTHREAD_LIBS $LIBS"
5813
5814                                                                                                 for ac_func in sched_yield pthread_yield
5815 do
5816 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5817 echo "configure:5818: checking for $ac_func" >&5
5818 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5819   echo $ac_n "(cached) $ac_c" 1>&6
5820 else
5821   cat > conftest.$ac_ext <<EOF
5822 #line 5823 "configure"
5823 #include "confdefs.h"
5824 /* System header to define __stub macros and hopefully few prototypes,
5825     which can conflict with char $ac_func(); below.  */
5826 #include <assert.h>
5827 /* Override any gcc2 internal prototype to avoid an error.  */
5828 /* We use char because int might match the return type of a gcc2
5829     builtin and then its argument prototype would still apply.  */
5830 char $ac_func();
5831
5832 int main() {
5833
5834 /* The GNU C library defines this for functions which it implements
5835     to always fail with ENOSYS.  Some functions are actually named
5836     something starting with __ and the normal name is an alias.  */
5837 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5838 choke me
5839 #else
5840 $ac_func();
5841 #endif
5842
5843 ; return 0; }
5844 EOF
5845 if { (eval echo configure:5846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5846   rm -rf conftest*
5847   eval "ac_cv_func_$ac_func=yes"
5848 else
5849   echo "configure: failed program was:" >&5
5850   cat conftest.$ac_ext >&5
5851   rm -rf conftest*
5852   eval "ac_cv_func_$ac_func=no"
5853 fi
5854 rm -f conftest*
5855 fi
5856
5857 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5858   echo "$ac_t""yes" 1>&6
5859     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5860   cat >> confdefs.h <<EOF
5861 #define $ac_tr_func 1
5862 EOF
5863  
5864 else
5865   echo "$ac_t""no" 1>&6
5866 fi
5867 done
5868
5869
5870                         if test $ac_cv_func_sched_yield = no -a \
5871                                 $ac_cv_func_pthread_yield = no ; then
5872                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
5873 echo "configure:5874: checking for sched_yield in -lrt" >&5
5874 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
5875 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5876   echo $ac_n "(cached) $ac_c" 1>&6
5877 else
5878   ac_save_LIBS="$LIBS"
5879 LIBS="-lrt  $LIBS"
5880 cat > conftest.$ac_ext <<EOF
5881 #line 5882 "configure"
5882 #include "confdefs.h"
5883 /* Override any gcc2 internal prototype to avoid an error.  */
5884 /* We use char because int might match the return type of a gcc2
5885     builtin and then its argument prototype would still apply.  */
5886 char sched_yield();
5887
5888 int main() {
5889 sched_yield()
5890 ; return 0; }
5891 EOF
5892 if { (eval echo configure:5893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5893   rm -rf conftest*
5894   eval "ac_cv_lib_$ac_lib_var=yes"
5895 else
5896   echo "configure: failed program was:" >&5
5897   cat conftest.$ac_ext >&5
5898   rm -rf conftest*
5899   eval "ac_cv_lib_$ac_lib_var=no"
5900 fi
5901 rm -f conftest*
5902 LIBS="$ac_save_LIBS"
5903
5904 fi
5905 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5906   echo "$ac_t""yes" 1>&6
5907   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
5908                                         cat >> confdefs.h <<\EOF
5909 #define HAVE_SCHED_YIELD 1
5910 EOF
5911
5912                                         ac_cv_func_sched_yield=yes
5913 else
5914   echo "$ac_t""no" 1>&6
5915 ac_cv_func_sched_yield=no
5916 fi
5917
5918                         fi
5919                         if test $ac_cv_func_sched_yield = no -a \
5920                                 $ac_cv_func_pthread_yield = no ; then
5921                                                                                                 for ac_func in thr_yield
5922 do
5923 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5924 echo "configure:5925: checking for $ac_func" >&5
5925 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5926   echo $ac_n "(cached) $ac_c" 1>&6
5927 else
5928   cat > conftest.$ac_ext <<EOF
5929 #line 5930 "configure"
5930 #include "confdefs.h"
5931 /* System header to define __stub macros and hopefully few prototypes,
5932     which can conflict with char $ac_func(); below.  */
5933 #include <assert.h>
5934 /* Override any gcc2 internal prototype to avoid an error.  */
5935 /* We use char because int might match the return type of a gcc2
5936     builtin and then its argument prototype would still apply.  */
5937 char $ac_func();
5938
5939 int main() {
5940
5941 /* The GNU C library defines this for functions which it implements
5942     to always fail with ENOSYS.  Some functions are actually named
5943     something starting with __ and the normal name is an alias.  */
5944 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5945 choke me
5946 #else
5947 $ac_func();
5948 #endif
5949
5950 ; return 0; }
5951 EOF
5952 if { (eval echo configure:5953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5953   rm -rf conftest*
5954   eval "ac_cv_func_$ac_func=yes"
5955 else
5956   echo "configure: failed program was:" >&5
5957   cat conftest.$ac_ext >&5
5958   rm -rf conftest*
5959   eval "ac_cv_func_$ac_func=no"
5960 fi
5961 rm -f conftest*
5962 fi
5963
5964 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5965   echo "$ac_t""yes" 1>&6
5966     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5967   cat >> confdefs.h <<EOF
5968 #define $ac_tr_func 1
5969 EOF
5970  
5971 else
5972   echo "$ac_t""no" 1>&6
5973 fi
5974 done
5975
5976                         fi
5977                         if test $ac_cv_func_sched_yield = no -a \
5978                                 $ac_cv_func_pthread_yield = no -a \
5979                                 "$ac_cv_func_thr_yield" = no ; then
5980                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
5981                         fi
5982
5983                                                 for ac_func in pthread_kill
5984 do
5985 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5986 echo "configure:5987: checking for $ac_func" >&5
5987 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5988   echo $ac_n "(cached) $ac_c" 1>&6
5989 else
5990   cat > conftest.$ac_ext <<EOF
5991 #line 5992 "configure"
5992 #include "confdefs.h"
5993 /* System header to define __stub macros and hopefully few prototypes,
5994     which can conflict with char $ac_func(); below.  */
5995 #include <assert.h>
5996 /* Override any gcc2 internal prototype to avoid an error.  */
5997 /* We use char because int might match the return type of a gcc2
5998     builtin and then its argument prototype would still apply.  */
5999 char $ac_func();
6000
6001 int main() {
6002
6003 /* The GNU C library defines this for functions which it implements
6004     to always fail with ENOSYS.  Some functions are actually named
6005     something starting with __ and the normal name is an alias.  */
6006 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6007 choke me
6008 #else
6009 $ac_func();
6010 #endif
6011
6012 ; return 0; }
6013 EOF
6014 if { (eval echo configure:6015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6015   rm -rf conftest*
6016   eval "ac_cv_func_$ac_func=yes"
6017 else
6018   echo "configure: failed program was:" >&5
6019   cat conftest.$ac_ext >&5
6020   rm -rf conftest*
6021   eval "ac_cv_func_$ac_func=no"
6022 fi
6023 rm -f conftest*
6024 fi
6025
6026 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6027   echo "$ac_t""yes" 1>&6
6028     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6029   cat >> confdefs.h <<EOF
6030 #define $ac_tr_func 1
6031 EOF
6032  
6033 else
6034   echo "$ac_t""no" 1>&6
6035 fi
6036 done
6037
6038
6039                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
6040 echo "configure:6041: checking for pthread_detach with <pthread.h>" >&5
6041 if eval "test \"`echo '$''{'ol_cv_func_pthread_detach'+set}'`\" = set"; then
6042   echo $ac_n "(cached) $ac_c" 1>&6
6043 else
6044   
6045                                                                 cat > conftest.$ac_ext <<EOF
6046 #line 6047 "configure"
6047 #include "confdefs.h"
6048
6049 #include <pthread.h>
6050 #ifndef NULL
6051 #define NULL (void*)0
6052 #endif
6053
6054 int main() {
6055 pthread_detach(NULL);
6056 ; return 0; }
6057 EOF
6058 if { (eval echo configure:6059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6059   rm -rf conftest*
6060   ol_cv_func_pthread_detach=yes
6061 else
6062   echo "configure: failed program was:" >&5
6063   cat conftest.$ac_ext >&5
6064   rm -rf conftest*
6065   ol_cv_func_pthread_detach=no
6066 fi
6067 rm -f conftest*
6068                         
6069 fi
6070
6071 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
6072
6073                         if test $ol_cv_func_pthread_detach = no ; then
6074                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
6075                         fi
6076
6077                         cat >> confdefs.h <<\EOF
6078 #define HAVE_PTHREAD_DETACH 1
6079 EOF
6080
6081
6082                                                 for ac_func in \
6083                                 pthread_setconcurrency \
6084                                 pthread_getconcurrency \
6085                                 thr_setconcurrency \
6086                                 thr_getconcurrency \
6087                         
6088 do
6089 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6090 echo "configure:6091: checking for $ac_func" >&5
6091 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6092   echo $ac_n "(cached) $ac_c" 1>&6
6093 else
6094   cat > conftest.$ac_ext <<EOF
6095 #line 6096 "configure"
6096 #include "confdefs.h"
6097 /* System header to define __stub macros and hopefully few prototypes,
6098     which can conflict with char $ac_func(); below.  */
6099 #include <assert.h>
6100 /* Override any gcc2 internal prototype to avoid an error.  */
6101 /* We use char because int might match the return type of a gcc2
6102     builtin and then its argument prototype would still apply.  */
6103 char $ac_func();
6104
6105 int main() {
6106
6107 /* The GNU C library defines this for functions which it implements
6108     to always fail with ENOSYS.  Some functions are actually named
6109     something starting with __ and the normal name is an alias.  */
6110 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6111 choke me
6112 #else
6113 $ac_func();
6114 #endif
6115
6116 ; return 0; }
6117 EOF
6118 if { (eval echo configure:6119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6119   rm -rf conftest*
6120   eval "ac_cv_func_$ac_func=yes"
6121 else
6122   echo "configure: failed program was:" >&5
6123   cat conftest.$ac_ext >&5
6124   rm -rf conftest*
6125   eval "ac_cv_func_$ac_func=no"
6126 fi
6127 rm -f conftest*
6128 fi
6129
6130 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6131   echo "$ac_t""yes" 1>&6
6132     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6133   cat >> confdefs.h <<EOF
6134 #define $ac_tr_func 1
6135 EOF
6136  
6137 else
6138   echo "$ac_t""no" 1>&6
6139 fi
6140 done
6141
6142
6143                         
6144         echo $ac_n "checking for pthread_kill_other_threads_np""... $ac_c" 1>&6
6145 echo "configure:6146: checking for pthread_kill_other_threads_np" >&5
6146 if eval "test \"`echo '$''{'ac_cv_func_pthread_kill_other_threads_np'+set}'`\" = set"; then
6147   echo $ac_n "(cached) $ac_c" 1>&6
6148 else
6149   cat > conftest.$ac_ext <<EOF
6150 #line 6151 "configure"
6151 #include "confdefs.h"
6152 /* System header to define __stub macros and hopefully few prototypes,
6153     which can conflict with char pthread_kill_other_threads_np(); below.  */
6154 #include <assert.h>
6155 /* Override any gcc2 internal prototype to avoid an error.  */
6156 /* We use char because int might match the return type of a gcc2
6157     builtin and then its argument prototype would still apply.  */
6158 char pthread_kill_other_threads_np();
6159
6160 int main() {
6161
6162 /* The GNU C library defines this for functions which it implements
6163     to always fail with ENOSYS.  Some functions are actually named
6164     something starting with __ and the normal name is an alias.  */
6165 #if defined (__stub_pthread_kill_other_threads_np) || defined (__stub___pthread_kill_other_threads_np)
6166 choke me
6167 #else
6168 pthread_kill_other_threads_np();
6169 #endif
6170
6171 ; return 0; }
6172 EOF
6173 if { (eval echo configure:6174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6174   rm -rf conftest*
6175   eval "ac_cv_func_pthread_kill_other_threads_np=yes"
6176 else
6177   echo "configure: failed program was:" >&5
6178   cat conftest.$ac_ext >&5
6179   rm -rf conftest*
6180   eval "ac_cv_func_pthread_kill_other_threads_np=no"
6181 fi
6182 rm -f conftest*
6183 fi
6184
6185 if eval "test \"`echo '$ac_cv_func_'pthread_kill_other_threads_np`\" = yes"; then
6186   echo "$ac_t""yes" 1>&6
6187   :
6188 else
6189   echo "$ac_t""no" 1>&6
6190 fi
6191
6192         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
6193 echo "configure:6194: checking for LinuxThreads implementation" >&5
6194 if eval "test \"`echo '$''{'ol_cv_sys_linux_threads'+set}'`\" = set"; then
6195   echo $ac_n "(cached) $ac_c" 1>&6
6196 else
6197   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
6198 fi
6199
6200 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
6201
6202                         
6203         
6204         
6205         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
6206 echo "configure:6207: checking for LinuxThreads consistency" >&5
6207 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
6208   echo $ac_n "(cached) $ac_c" 1>&6
6209 else
6210   
6211                 if test $ol_cv_header_linux_threads = yes -a \
6212                         $ol_cv_sys_linux_threads = yes; then
6213                         ol_cv_linux_threads=yes
6214                 elif test $ol_cv_header_linux_threads = no -a \
6215                         $ol_cv_sys_linux_threads = no; then
6216                         ol_cv_linux_threads=no
6217                 else
6218                         ol_cv_linux_threads=error
6219                 fi
6220         
6221 fi
6222
6223 echo "$ac_t""$ol_cv_linux_threads" 1>&6
6224
6225
6226                         if test $ol_cv_linux_threads = error; then
6227                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
6228                         fi
6229
6230                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
6231 echo "configure:6232: checking if pthread_create() works" >&5
6232                         if eval "test \"`echo '$''{'ol_cv_pthread_create_works'+set}'`\" = set"; then
6233   echo $ac_n "(cached) $ac_c" 1>&6
6234 else
6235   
6236                         if test "$cross_compiling" = yes; then
6237                                 ol_cv_pthread_create_works=yes
6238 else
6239   cat > conftest.$ac_ext <<EOF
6240 #line 6241 "configure"
6241 #include "confdefs.h"
6242
6243 #include <pthread.h>
6244 #ifndef NULL
6245 #define NULL (void*)0
6246 #endif
6247
6248 static void *task(p)
6249         void *p;
6250 {
6251         return (void *) (p == NULL);
6252 }
6253
6254 int main(argc, argv)
6255         int argc;
6256         char **argv;
6257 {
6258         pthread_t t;
6259 #if HAVE_PTHREADS_D4
6260         exit(pthread_create(&t, pthread_attr_default, task, NULL));
6261 #else
6262         exit(pthread_create(&t, NULL, task, NULL));
6263 #endif
6264 }
6265
6266 EOF
6267 if { (eval echo configure:6268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6268 then
6269   ol_cv_pthread_create_works=yes
6270 else
6271   echo "configure: failed program was:" >&5
6272   cat conftest.$ac_ext >&5
6273   rm -fr conftest*
6274   ol_cv_pthread_create_works=no
6275 fi
6276 rm -fr conftest*
6277 fi
6278
6279 fi
6280
6281                         echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
6282
6283                         if test $ol_cv_pthread_create_works = no ; then
6284                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
6285                         fi
6286
6287                                                 if test $ol_with_yielding_select = auto ; then
6288                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
6289 echo "configure:6290: checking if select yields when using pthreads" >&5
6290                                 if eval "test \"`echo '$''{'ol_cv_pthread_select_yields'+set}'`\" = set"; then
6291   echo $ac_n "(cached) $ac_c" 1>&6
6292 else
6293   
6294                                 if test "$cross_compiling" = yes; then
6295   
6296                                 { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
6297 else
6298   cat > conftest.$ac_ext <<EOF
6299 #line 6300 "configure"
6300 #include "confdefs.h"
6301
6302 #include <sys/types.h>
6303 #include <sys/time.h>
6304 #include <unistd.h>
6305 #include <pthread.h>
6306 #ifndef NULL
6307 #define NULL (void*) 0
6308 #endif
6309
6310 static int fildes[2];
6311
6312 static void *task(p)
6313         void *p;
6314 {
6315         int i;
6316         struct timeval tv;
6317
6318         fd_set rfds;
6319
6320         tv.tv_sec=10;
6321         tv.tv_usec=0;
6322
6323         FD_ZERO(&rfds);
6324         FD_SET(fildes[0], &rfds);
6325
6326         /* we're not interested in any fds */
6327         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
6328
6329         if(i < 0) {
6330                 perror("select");
6331                 exit(10);
6332         }
6333
6334         exit(0); /* if we exit here, the select blocked the whole process */
6335 }
6336
6337 int main(argc, argv)
6338         int argc;
6339         char **argv;
6340 {
6341         pthread_t t;
6342
6343         /* create a pipe to select */
6344         if(pipe(&fildes[0])) {
6345                 perror("select");
6346                 exit(1);
6347         }
6348
6349 #ifdef HAVE_PTHREAD_SETCONCURRENCY
6350         (void) pthread_setconcurrency(2);
6351 #else
6352 #ifdef HAVE_THR_SETCONCURRENCY
6353         /* Set Solaris LWP concurrency to 2 */
6354         thr_setconcurrency(2);
6355 #endif
6356 #endif
6357
6358 #if HAVE_PTHREADS_D4
6359         pthread_create(&t, pthread_attr_default, task, NULL);
6360 #else
6361         pthread_create(&t, NULL, task, NULL);
6362 #endif
6363
6364 #if HAVE_SCHED_YIELD
6365         sched_yield();  /* make sure task runs first */
6366 #else
6367 #ifdef HAVE_PTHREAD_YIELD
6368         pthread_yield();        /* make sure task runs first */
6369 #endif
6370 #endif
6371
6372         exit(2);
6373 }
6374 EOF
6375 if { (eval echo configure:6376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6376 then
6377   ol_cv_pthread_select_yields=no
6378 else
6379   echo "configure: failed program was:" >&5
6380   cat conftest.$ac_ext >&5
6381   rm -fr conftest*
6382   ol_cv_pthread_select_yields=yes
6383 fi
6384 rm -fr conftest*
6385 fi
6386
6387 fi
6388
6389                                 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
6390
6391                                 if test $ol_cv_pthread_select_yields = yes ; then
6392                                         ol_with_yielding_select=yes
6393                                 fi
6394                         fi
6395
6396                                                 CPPFLAGS="$save_CPPFLAGS"
6397                         LIBS="$save_LIBS"
6398                 else
6399                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
6400                 fi
6401         fi
6402
6403         if test $ol_with_threads = posix ; then
6404                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
6405         fi
6406 fi
6407
6408 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6409         -o $ol_with_threads = mach ; then
6410
6411                 for ac_hdr in mach/cthreads.h
6412 do
6413 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6414 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6415 echo "configure:6416: checking for $ac_hdr" >&5
6416 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6417   echo $ac_n "(cached) $ac_c" 1>&6
6418 else
6419   cat > conftest.$ac_ext <<EOF
6420 #line 6421 "configure"
6421 #include "confdefs.h"
6422 #include <$ac_hdr>
6423 EOF
6424 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6425 { (eval echo configure:6426: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6426 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6427 if test -z "$ac_err"; then
6428   rm -rf conftest*
6429   eval "ac_cv_header_$ac_safe=yes"
6430 else
6431   echo "$ac_err" >&5
6432   echo "configure: failed program was:" >&5
6433   cat conftest.$ac_ext >&5
6434   rm -rf conftest*
6435   eval "ac_cv_header_$ac_safe=no"
6436 fi
6437 rm -f conftest*
6438 fi
6439 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6440   echo "$ac_t""yes" 1>&6
6441     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6442   cat >> confdefs.h <<EOF
6443 #define $ac_tr_hdr 1
6444 EOF
6445  
6446 else
6447   echo "$ac_t""no" 1>&6
6448 fi
6449 done
6450
6451         if test $ac_cv_header_mach_cthreads_h = yes ; then
6452                 ol_with_threads=found
6453
6454                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
6455 echo "configure:6456: checking for cthread_fork" >&5
6456 if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
6457   echo $ac_n "(cached) $ac_c" 1>&6
6458 else
6459   cat > conftest.$ac_ext <<EOF
6460 #line 6461 "configure"
6461 #include "confdefs.h"
6462 /* System header to define __stub macros and hopefully few prototypes,
6463     which can conflict with char cthread_fork(); below.  */
6464 #include <assert.h>
6465 /* Override any gcc2 internal prototype to avoid an error.  */
6466 /* We use char because int might match the return type of a gcc2
6467     builtin and then its argument prototype would still apply.  */
6468 char cthread_fork();
6469
6470 int main() {
6471
6472 /* The GNU C library defines this for functions which it implements
6473     to always fail with ENOSYS.  Some functions are actually named
6474     something starting with __ and the normal name is an alias.  */
6475 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
6476 choke me
6477 #else
6478 cthread_fork();
6479 #endif
6480
6481 ; return 0; }
6482 EOF
6483 if { (eval echo configure:6484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6484   rm -rf conftest*
6485   eval "ac_cv_func_cthread_fork=yes"
6486 else
6487   echo "configure: failed program was:" >&5
6488   cat conftest.$ac_ext >&5
6489   rm -rf conftest*
6490   eval "ac_cv_func_cthread_fork=no"
6491 fi
6492 rm -f conftest*
6493 fi
6494
6495 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
6496   echo "$ac_t""yes" 1>&6
6497   ol_link_threads=yes
6498 else
6499   echo "$ac_t""no" 1>&6
6500 fi
6501
6502
6503                 if test $ol_link_threads = no ; then
6504                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
6505 echo "configure:6506: checking for cthread_fork with -all_load" >&5
6506 if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
6507   echo $ac_n "(cached) $ac_c" 1>&6
6508 else
6509   
6510                                                                 save_LIBS="$LIBS"
6511                                 LIBS="-all_load $LIBS"
6512                                 cat > conftest.$ac_ext <<EOF
6513 #line 6514 "configure"
6514 #include "confdefs.h"
6515 #include <mach/cthreads.h>
6516 int main() {
6517
6518                                         cthread_fork((void *)0, (void *)0);
6519                                         
6520 ; return 0; }
6521 EOF
6522 if { (eval echo configure:6523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6523   rm -rf conftest*
6524   ol_cv_cthread_all_load=yes
6525 else
6526   echo "configure: failed program was:" >&5
6527   cat conftest.$ac_ext >&5
6528   rm -rf conftest*
6529   ol_cv_cthread_all_load=no
6530 fi
6531 rm -f conftest*
6532                                                                 LIBS="$save_LIBS"
6533                         
6534 fi
6535
6536 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
6537
6538                         if test $ol_cv_cthread_all_load = yes ; then
6539                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
6540                                 ol_link_threads=mach
6541                         fi
6542                 fi
6543
6544                 if test $ol_link_threads != no ; then
6545                         : check for cthread specific functionality here
6546                         cat >> confdefs.h <<\EOF
6547 #define HAVE_MACH_CTHREADS 1
6548 EOF
6549
6550                 else
6551                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
6552                 fi
6553         fi
6554
6555         if test $ol_with_threads = mach ; then
6556                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
6557         fi
6558 fi
6559
6560 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6561         -o $ol_with_threads = lwp ; then
6562
6563                 for ac_hdr in thread.h synch.h
6564 do
6565 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6566 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6567 echo "configure:6568: checking for $ac_hdr" >&5
6568 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6569   echo $ac_n "(cached) $ac_c" 1>&6
6570 else
6571   cat > conftest.$ac_ext <<EOF
6572 #line 6573 "configure"
6573 #include "confdefs.h"
6574 #include <$ac_hdr>
6575 EOF
6576 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6577 { (eval echo configure:6578: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6578 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6579 if test -z "$ac_err"; then
6580   rm -rf conftest*
6581   eval "ac_cv_header_$ac_safe=yes"
6582 else
6583   echo "$ac_err" >&5
6584   echo "configure: failed program was:" >&5
6585   cat conftest.$ac_ext >&5
6586   rm -rf conftest*
6587   eval "ac_cv_header_$ac_safe=no"
6588 fi
6589 rm -f conftest*
6590 fi
6591 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6592   echo "$ac_t""yes" 1>&6
6593     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6594   cat >> confdefs.h <<EOF
6595 #define $ac_tr_hdr 1
6596 EOF
6597  
6598 else
6599   echo "$ac_t""no" 1>&6
6600 fi
6601 done
6602
6603         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
6604                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
6605 echo "configure:6606: checking for thr_create in -lthread" >&5
6606 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
6607 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6608   echo $ac_n "(cached) $ac_c" 1>&6
6609 else
6610   ac_save_LIBS="$LIBS"
6611 LIBS="-lthread  $LIBS"
6612 cat > conftest.$ac_ext <<EOF
6613 #line 6614 "configure"
6614 #include "confdefs.h"
6615 /* Override any gcc2 internal prototype to avoid an error.  */
6616 /* We use char because int might match the return type of a gcc2
6617     builtin and then its argument prototype would still apply.  */
6618 char thr_create();
6619
6620 int main() {
6621 thr_create()
6622 ; return 0; }
6623 EOF
6624 if { (eval echo configure:6625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6625   rm -rf conftest*
6626   eval "ac_cv_lib_$ac_lib_var=yes"
6627 else
6628   echo "configure: failed program was:" >&5
6629   cat conftest.$ac_ext >&5
6630   rm -rf conftest*
6631   eval "ac_cv_lib_$ac_lib_var=no"
6632 fi
6633 rm -f conftest*
6634 LIBS="$ac_save_LIBS"
6635
6636 fi
6637 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6638   echo "$ac_t""yes" 1>&6
6639   have_thr=yes
6640 else
6641   echo "$ac_t""no" 1>&6
6642 have_thr=no
6643 fi
6644
6645
6646                 if test $have_thr = yes ; then
6647                         cat >> confdefs.h <<\EOF
6648 #define HAVE_THR 1
6649 EOF
6650
6651                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
6652                         ol_link_threads=thr
6653
6654                         if test $ol_with_yielding_select = auto ; then
6655                                 ol_with_yielding_select=yes
6656                         fi
6657
6658                                                 for ac_func in \
6659                                 thr_setconcurrency \
6660                                 thr_getconcurrency \
6661                         
6662 do
6663 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6664 echo "configure:6665: checking for $ac_func" >&5
6665 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6666   echo $ac_n "(cached) $ac_c" 1>&6
6667 else
6668   cat > conftest.$ac_ext <<EOF
6669 #line 6670 "configure"
6670 #include "confdefs.h"
6671 /* System header to define __stub macros and hopefully few prototypes,
6672     which can conflict with char $ac_func(); below.  */
6673 #include <assert.h>
6674 /* Override any gcc2 internal prototype to avoid an error.  */
6675 /* We use char because int might match the return type of a gcc2
6676     builtin and then its argument prototype would still apply.  */
6677 char $ac_func();
6678
6679 int main() {
6680
6681 /* The GNU C library defines this for functions which it implements
6682     to always fail with ENOSYS.  Some functions are actually named
6683     something starting with __ and the normal name is an alias.  */
6684 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6685 choke me
6686 #else
6687 $ac_func();
6688 #endif
6689
6690 ; return 0; }
6691 EOF
6692 if { (eval echo configure:6693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6693   rm -rf conftest*
6694   eval "ac_cv_func_$ac_func=yes"
6695 else
6696   echo "configure: failed program was:" >&5
6697   cat conftest.$ac_ext >&5
6698   rm -rf conftest*
6699   eval "ac_cv_func_$ac_func=no"
6700 fi
6701 rm -f conftest*
6702 fi
6703
6704 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6705   echo "$ac_t""yes" 1>&6
6706     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6707   cat >> confdefs.h <<EOF
6708 #define $ac_tr_func 1
6709 EOF
6710  
6711 else
6712   echo "$ac_t""no" 1>&6
6713 fi
6714 done
6715
6716                 fi
6717         fi
6718
6719                 for ac_hdr in lwp/lwp.h
6720 do
6721 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6722 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6723 echo "configure:6724: checking for $ac_hdr" >&5
6724 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6725   echo $ac_n "(cached) $ac_c" 1>&6
6726 else
6727   cat > conftest.$ac_ext <<EOF
6728 #line 6729 "configure"
6729 #include "confdefs.h"
6730 #include <$ac_hdr>
6731 EOF
6732 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6733 { (eval echo configure:6734: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6734 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6735 if test -z "$ac_err"; then
6736   rm -rf conftest*
6737   eval "ac_cv_header_$ac_safe=yes"
6738 else
6739   echo "$ac_err" >&5
6740   echo "configure: failed program was:" >&5
6741   cat conftest.$ac_ext >&5
6742   rm -rf conftest*
6743   eval "ac_cv_header_$ac_safe=no"
6744 fi
6745 rm -f conftest*
6746 fi
6747 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6748   echo "$ac_t""yes" 1>&6
6749     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6750   cat >> confdefs.h <<EOF
6751 #define $ac_tr_hdr 1
6752 EOF
6753  
6754 else
6755   echo "$ac_t""no" 1>&6
6756 fi
6757 done
6758
6759         if test $ac_cv_header_lwp_lwp_h = yes ; then
6760                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
6761 echo "configure:6762: checking for lwp_create in -llwp" >&5
6762 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
6763 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6764   echo $ac_n "(cached) $ac_c" 1>&6
6765 else
6766   ac_save_LIBS="$LIBS"
6767 LIBS="-llwp  $LIBS"
6768 cat > conftest.$ac_ext <<EOF
6769 #line 6770 "configure"
6770 #include "confdefs.h"
6771 /* Override any gcc2 internal prototype to avoid an error.  */
6772 /* We use char because int might match the return type of a gcc2
6773     builtin and then its argument prototype would still apply.  */
6774 char lwp_create();
6775
6776 int main() {
6777 lwp_create()
6778 ; return 0; }
6779 EOF
6780 if { (eval echo configure:6781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6781   rm -rf conftest*
6782   eval "ac_cv_lib_$ac_lib_var=yes"
6783 else
6784   echo "configure: failed program was:" >&5
6785   cat conftest.$ac_ext >&5
6786   rm -rf conftest*
6787   eval "ac_cv_lib_$ac_lib_var=no"
6788 fi
6789 rm -f conftest*
6790 LIBS="$ac_save_LIBS"
6791
6792 fi
6793 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6794   echo "$ac_t""yes" 1>&6
6795   have_lwp=yes
6796 else
6797   echo "$ac_t""no" 1>&6
6798 have_lwp=no
6799 fi
6800
6801
6802                 if test $have_lwp = yes ; then
6803                         cat >> confdefs.h <<\EOF
6804 #define HAVE_LWP 1
6805 EOF
6806
6807                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
6808                         ol_link_threads=lwp
6809
6810                         if test $ol_with_yielding_select = auto ; then
6811                                 ol_with_yielding_select=no
6812                         fi
6813                 fi
6814         fi
6815 fi
6816
6817 if test $ol_with_yielding_select = yes ; then
6818         cat >> confdefs.h <<\EOF
6819 #define HAVE_YIELDING_SELECT 1
6820 EOF
6821
6822 fi
6823
6824 if test $ol_with_threads = manual ; then
6825                 ol_link_threads=yes
6826
6827         echo "configure: warning: thread defines and link options must be set manually" 1>&2
6828
6829         for ac_hdr in pthread.h sched.h
6830 do
6831 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6832 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6833 echo "configure:6834: checking for $ac_hdr" >&5
6834 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6835   echo $ac_n "(cached) $ac_c" 1>&6
6836 else
6837   cat > conftest.$ac_ext <<EOF
6838 #line 6839 "configure"
6839 #include "confdefs.h"
6840 #include <$ac_hdr>
6841 EOF
6842 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6843 { (eval echo configure:6844: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6844 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6845 if test -z "$ac_err"; then
6846   rm -rf conftest*
6847   eval "ac_cv_header_$ac_safe=yes"
6848 else
6849   echo "$ac_err" >&5
6850   echo "configure: failed program was:" >&5
6851   cat conftest.$ac_ext >&5
6852   rm -rf conftest*
6853   eval "ac_cv_header_$ac_safe=no"
6854 fi
6855 rm -f conftest*
6856 fi
6857 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6858   echo "$ac_t""yes" 1>&6
6859     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6860   cat >> confdefs.h <<EOF
6861 #define $ac_tr_hdr 1
6862 EOF
6863  
6864 else
6865   echo "$ac_t""no" 1>&6
6866 fi
6867 done
6868
6869         for ac_func in sched_yield pthread_yield
6870 do
6871 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6872 echo "configure:6873: checking for $ac_func" >&5
6873 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6874   echo $ac_n "(cached) $ac_c" 1>&6
6875 else
6876   cat > conftest.$ac_ext <<EOF
6877 #line 6878 "configure"
6878 #include "confdefs.h"
6879 /* System header to define __stub macros and hopefully few prototypes,
6880     which can conflict with char $ac_func(); below.  */
6881 #include <assert.h>
6882 /* Override any gcc2 internal prototype to avoid an error.  */
6883 /* We use char because int might match the return type of a gcc2
6884     builtin and then its argument prototype would still apply.  */
6885 char $ac_func();
6886
6887 int main() {
6888
6889 /* The GNU C library defines this for functions which it implements
6890     to always fail with ENOSYS.  Some functions are actually named
6891     something starting with __ and the normal name is an alias.  */
6892 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6893 choke me
6894 #else
6895 $ac_func();
6896 #endif
6897
6898 ; return 0; }
6899 EOF
6900 if { (eval echo configure:6901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6901   rm -rf conftest*
6902   eval "ac_cv_func_$ac_func=yes"
6903 else
6904   echo "configure: failed program was:" >&5
6905   cat conftest.$ac_ext >&5
6906   rm -rf conftest*
6907   eval "ac_cv_func_$ac_func=no"
6908 fi
6909 rm -f conftest*
6910 fi
6911
6912 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6913   echo "$ac_t""yes" 1>&6
6914     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6915   cat >> confdefs.h <<EOF
6916 #define $ac_tr_func 1
6917 EOF
6918  
6919 else
6920   echo "$ac_t""no" 1>&6
6921 fi
6922 done
6923
6924         
6925         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
6926 echo "configure:6927: checking for LinuxThreads pthread.h" >&5
6927 if eval "test \"`echo '$''{'ol_cv_header_linux_threads'+set}'`\" = set"; then
6928   echo $ac_n "(cached) $ac_c" 1>&6
6929 else
6930   cat > conftest.$ac_ext <<EOF
6931 #line 6932 "configure"
6932 #include "confdefs.h"
6933 #include <pthread.h>
6934 EOF
6935 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6936   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
6937   rm -rf conftest*
6938   ol_cv_header_linux_threads=yes
6939 else
6940   rm -rf conftest*
6941   ol_cv_header_linux_threads=no
6942 fi
6943 rm -f conftest*
6944
6945                 
6946 fi
6947
6948 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
6949         if test $ol_cv_header_linux_threads = yes; then
6950                 cat >> confdefs.h <<\EOF
6951 #define HAVE_LINUX_THREADS 1
6952 EOF
6953
6954         fi
6955
6956
6957         for ac_hdr in mach/cthreads.h
6958 do
6959 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6960 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6961 echo "configure:6962: checking for $ac_hdr" >&5
6962 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+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 <$ac_hdr>
6969 EOF
6970 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6971 { (eval echo configure:6972: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6972 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6973 if test -z "$ac_err"; then
6974   rm -rf conftest*
6975   eval "ac_cv_header_$ac_safe=yes"
6976 else
6977   echo "$ac_err" >&5
6978   echo "configure: failed program was:" >&5
6979   cat conftest.$ac_ext >&5
6980   rm -rf conftest*
6981   eval "ac_cv_header_$ac_safe=no"
6982 fi
6983 rm -f conftest*
6984 fi
6985 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6986   echo "$ac_t""yes" 1>&6
6987     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6988   cat >> confdefs.h <<EOF
6989 #define $ac_tr_hdr 1
6990 EOF
6991  
6992 else
6993   echo "$ac_t""no" 1>&6
6994 fi
6995 done
6996
6997         for ac_hdr in lwp/lwp.h
6998 do
6999 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7000 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7001 echo "configure:7002: checking for $ac_hdr" >&5
7002 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7003   echo $ac_n "(cached) $ac_c" 1>&6
7004 else
7005   cat > conftest.$ac_ext <<EOF
7006 #line 7007 "configure"
7007 #include "confdefs.h"
7008 #include <$ac_hdr>
7009 EOF
7010 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7011 { (eval echo configure:7012: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7012 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7013 if test -z "$ac_err"; then
7014   rm -rf conftest*
7015   eval "ac_cv_header_$ac_safe=yes"
7016 else
7017   echo "$ac_err" >&5
7018   echo "configure: failed program was:" >&5
7019   cat conftest.$ac_ext >&5
7020   rm -rf conftest*
7021   eval "ac_cv_header_$ac_safe=no"
7022 fi
7023 rm -f conftest*
7024 fi
7025 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7026   echo "$ac_t""yes" 1>&6
7027     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7028   cat >> confdefs.h <<EOF
7029 #define $ac_tr_hdr 1
7030 EOF
7031  
7032 else
7033   echo "$ac_t""no" 1>&6
7034 fi
7035 done
7036
7037         for ac_hdr in thread.h synch.h
7038 do
7039 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7040 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7041 echo "configure:7042: checking for $ac_hdr" >&5
7042 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7043   echo $ac_n "(cached) $ac_c" 1>&6
7044 else
7045   cat > conftest.$ac_ext <<EOF
7046 #line 7047 "configure"
7047 #include "confdefs.h"
7048 #include <$ac_hdr>
7049 EOF
7050 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7051 { (eval echo configure:7052: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7052 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7053 if test -z "$ac_err"; then
7054   rm -rf conftest*
7055   eval "ac_cv_header_$ac_safe=yes"
7056 else
7057   echo "$ac_err" >&5
7058   echo "configure: failed program was:" >&5
7059   cat conftest.$ac_ext >&5
7060   rm -rf conftest*
7061   eval "ac_cv_header_$ac_safe=no"
7062 fi
7063 rm -f conftest*
7064 fi
7065 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7066   echo "$ac_t""yes" 1>&6
7067     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7068   cat >> confdefs.h <<EOF
7069 #define $ac_tr_hdr 1
7070 EOF
7071  
7072 else
7073   echo "$ac_t""no" 1>&6
7074 fi
7075 done
7076
7077 fi
7078
7079 if test $ol_link_threads != no ; then  
7080                         cat >> confdefs.h <<\EOF
7081 #define REENTRANT 1
7082 EOF
7083
7084         cat >> confdefs.h <<\EOF
7085 #define _REENTRANT 1
7086 EOF
7087
7088         cat >> confdefs.h <<\EOF
7089 #define THREAD_SAFE 1
7090 EOF
7091
7092         cat >> confdefs.h <<\EOF
7093 #define _THREAD_SAFE 1
7094 EOF
7095
7096         cat >> confdefs.h <<\EOF
7097 #define THREADSAFE 1
7098 EOF
7099
7100         cat >> confdefs.h <<\EOF
7101 #define _THREADSAFE 1
7102 EOF
7103
7104
7105                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
7106 echo "configure:7107: checking for thread specific errno" >&5
7107 if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
7108   echo $ac_n "(cached) $ac_c" 1>&6
7109 else
7110   
7111                 cat > conftest.$ac_ext <<EOF
7112 #line 7113 "configure"
7113 #include "confdefs.h"
7114 #include <errno.h>
7115 int main() {
7116 errno = 0;
7117 ; return 0; }
7118 EOF
7119 if { (eval echo configure:7120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7120   rm -rf conftest*
7121   ol_cv_errno_thread_specific=yes
7122 else
7123   echo "configure: failed program was:" >&5
7124   cat conftest.$ac_ext >&5
7125   rm -rf conftest*
7126   ol_cv_errno_thread_specific=no
7127 fi
7128 rm -f conftest*
7129         
7130 fi
7131
7132 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
7133
7134         if test $ol_cv_errno_thread_specific != yes ; then
7135                 LIBS="$LTHREAD_LIBS $LIBS"
7136                 LTHREAD_LIBS=""
7137         fi
7138
7139 fi  
7140
7141 if test $ol_link_threads = no ; then
7142         if test $ol_with_threads = yes ; then
7143                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
7144         fi
7145
7146         if test $ol_with_threads = auto ; then
7147                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
7148                 ol_with_threads=no
7149         fi
7150
7151         cat >> confdefs.h <<\EOF
7152 #define NO_THREADS 1
7153 EOF
7154
7155         LTHREAD_LIBS=""
7156 fi
7157
7158 if test $ol_link_threads != no ; then
7159         cat >> confdefs.h <<\EOF
7160 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
7161 EOF
7162
7163 fi
7164
7165
7166 ol_link_ldbm=no 
7167 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
7168         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
7169 echo "configure:7170: checking for DB2 library" >&5
7170 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
7171   echo $ac_n "(cached) $ac_c" 1>&6
7172 else
7173         ol_LIBS="$LIBS"
7174         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
7175 echo "configure:7176: checking for db_open in -ldb" >&5
7176 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
7177 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7178   echo $ac_n "(cached) $ac_c" 1>&6
7179 else
7180   ac_save_LIBS="$LIBS"
7181 LIBS="-ldb  $LIBS"
7182 cat > conftest.$ac_ext <<EOF
7183 #line 7184 "configure"
7184 #include "confdefs.h"
7185 /* Override any gcc2 internal prototype to avoid an error.  */
7186 /* We use char because int might match the return type of a gcc2
7187     builtin and then its argument prototype would still apply.  */
7188 char db_open();
7189
7190 int main() {
7191 db_open()
7192 ; return 0; }
7193 EOF
7194 if { (eval echo configure:7195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7195   rm -rf conftest*
7196   eval "ac_cv_lib_$ac_lib_var=yes"
7197 else
7198   echo "configure: failed program was:" >&5
7199   cat conftest.$ac_ext >&5
7200   rm -rf conftest*
7201   eval "ac_cv_lib_$ac_lib_var=no"
7202 fi
7203 rm -f conftest*
7204 LIBS="$ac_save_LIBS"
7205
7206 fi
7207 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7208   echo "$ac_t""yes" 1>&6
7209   ol_cv_lib_db2=-ldb
7210 else
7211   echo "$ac_t""no" 1>&6
7212 ol_cv_lib_db2=no
7213 fi
7214
7215         LIBS="$ol_LIBS"
7216
7217 fi
7218
7219 echo "$ac_t""$ol_cv_lib_db2" 1>&6
7220
7221 for ac_hdr in db.h
7222 do
7223 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7224 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7225 echo "configure:7226: checking for $ac_hdr" >&5
7226 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7227   echo $ac_n "(cached) $ac_c" 1>&6
7228 else
7229   cat > conftest.$ac_ext <<EOF
7230 #line 7231 "configure"
7231 #include "confdefs.h"
7232 #include <$ac_hdr>
7233 EOF
7234 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7235 { (eval echo configure:7236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7236 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7237 if test -z "$ac_err"; then
7238   rm -rf conftest*
7239   eval "ac_cv_header_$ac_safe=yes"
7240 else
7241   echo "$ac_err" >&5
7242   echo "configure: failed program was:" >&5
7243   cat conftest.$ac_ext >&5
7244   rm -rf conftest*
7245   eval "ac_cv_header_$ac_safe=no"
7246 fi
7247 rm -f conftest*
7248 fi
7249 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7250   echo "$ac_t""yes" 1>&6
7251     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7252   cat >> confdefs.h <<EOF
7253 #define $ac_tr_hdr 1
7254 EOF
7255  
7256 else
7257   echo "$ac_t""no" 1>&6
7258 fi
7259 done
7260
7261 if test $ac_cv_header_db_h = yes ; then
7262         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
7263 echo "configure:7264: checking if db.h is DB2" >&5
7264 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
7265   echo $ac_n "(cached) $ac_c" 1>&6
7266 else
7267   
7268                 cat > conftest.$ac_ext <<EOF
7269 #line 7270 "configure"
7270 #include "confdefs.h"
7271
7272 #                       include <db.h>
7273                         /* this check could be improved */
7274 #                       ifdef DB_VERSION_MAJOR
7275 #                               if DB_VERSION_MAJOR == 2
7276                                         __db_version_2
7277 #                               endif
7278 #                       endif
7279                 
7280 EOF
7281 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7282   egrep "__db_version_2" >/dev/null 2>&1; then
7283   rm -rf conftest*
7284   ol_cv_header_db2=yes
7285 else
7286   rm -rf conftest*
7287   ol_cv_header_db2=no
7288 fi
7289 rm -f conftest*
7290
7291 fi
7292
7293 echo "$ac_t""$ol_cv_header_db2" 1>&6
7294 else
7295         ol_cv_header_db2=no
7296 fi
7297
7298
7299  
7300  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
7301 echo "configure:7302: checking for Berkeley DB2" >&5
7302 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
7303   echo $ac_n "(cached) $ac_c" 1>&6
7304 else
7305   
7306         if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then
7307                 ol_cv_berkeley_db2=no
7308         else
7309                 ol_cv_berkeley_db2=yes
7310         fi
7311
7312 fi
7313
7314 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
7315  if test $ol_cv_berkeley_db2 = yes ; then
7316         cat >> confdefs.h <<\EOF
7317 #define HAVE_BERKELEY_DB2 1
7318 EOF
7319
7320  fi
7321
7322
7323         if test $ol_cv_berkeley_db2 = yes ; then
7324                 ol_link_ldbm=db2
7325                 ol_with_ldbm_api=db2
7326
7327                 if test $ol_with_ldbm_type = hash ; then
7328                         cat >> confdefs.h <<\EOF
7329 #define LDBM_USE_DBHASH 1
7330 EOF
7331
7332                 else
7333                         cat >> confdefs.h <<\EOF
7334 #define LDBM_USE_DBBTREE 1
7335 EOF
7336
7337                 fi
7338
7339                                                 if test $ol_cv_lib_db2 != yes ; then
7340                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
7341                 fi
7342         fi
7343 fi
7344
7345 ol_link_bdb2=no
7346 if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
7347         ol_link_bdb2=yes
7348 fi
7349
7350 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
7351         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
7352 echo "configure:7353: checking for Berkeley DB library" >&5
7353 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
7354   echo $ac_n "(cached) $ac_c" 1>&6
7355 else
7356   
7357         for ac_hdr in db1/db.h
7358 do
7359 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7360 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7361 echo "configure:7362: checking for $ac_hdr" >&5
7362 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7363   echo $ac_n "(cached) $ac_c" 1>&6
7364 else
7365   cat > conftest.$ac_ext <<EOF
7366 #line 7367 "configure"
7367 #include "confdefs.h"
7368 #include <$ac_hdr>
7369 EOF
7370 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7371 { (eval echo configure:7372: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7372 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7373 if test -z "$ac_err"; then
7374   rm -rf conftest*
7375   eval "ac_cv_header_$ac_safe=yes"
7376 else
7377   echo "$ac_err" >&5
7378   echo "configure: failed program was:" >&5
7379   cat conftest.$ac_ext >&5
7380   rm -rf conftest*
7381   eval "ac_cv_header_$ac_safe=no"
7382 fi
7383 rm -f conftest*
7384 fi
7385 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7386   echo "$ac_t""yes" 1>&6
7387     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7388   cat >> confdefs.h <<EOF
7389 #define $ac_tr_hdr 1
7390 EOF
7391  
7392 else
7393   echo "$ac_t""no" 1>&6
7394 fi
7395 done
7396
7397         ol_LIBS="$LIBS"
7398         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
7399 echo "configure:7400: checking for dbopen" >&5
7400 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
7401   echo $ac_n "(cached) $ac_c" 1>&6
7402 else
7403   cat > conftest.$ac_ext <<EOF
7404 #line 7405 "configure"
7405 #include "confdefs.h"
7406 /* System header to define __stub macros and hopefully few prototypes,
7407     which can conflict with char dbopen(); below.  */
7408 #include <assert.h>
7409 /* Override any gcc2 internal prototype to avoid an error.  */
7410 /* We use char because int might match the return type of a gcc2
7411     builtin and then its argument prototype would still apply.  */
7412 char dbopen();
7413
7414 int main() {
7415
7416 /* The GNU C library defines this for functions which it implements
7417     to always fail with ENOSYS.  Some functions are actually named
7418     something starting with __ and the normal name is an alias.  */
7419 #if defined (__stub_dbopen) || defined (__stub___dbopen)
7420 choke me
7421 #else
7422 dbopen();
7423 #endif
7424
7425 ; return 0; }
7426 EOF
7427 if { (eval echo configure:7428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7428   rm -rf conftest*
7429   eval "ac_cv_func_dbopen=yes"
7430 else
7431   echo "configure: failed program was:" >&5
7432   cat conftest.$ac_ext >&5
7433   rm -rf conftest*
7434   eval "ac_cv_func_dbopen=no"
7435 fi
7436 rm -f conftest*
7437 fi
7438
7439 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
7440   echo "$ac_t""yes" 1>&6
7441   ol_cv_lib_db=yes
7442 else
7443   echo "$ac_t""no" 1>&6
7444
7445                 echo $ac_n "checking for dbopen in -ldb1""... $ac_c" 1>&6
7446 echo "configure:7447: checking for dbopen in -ldb1" >&5
7447 ac_lib_var=`echo db1'_'dbopen | sed 'y%./+-%__p_%'`
7448 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7449   echo $ac_n "(cached) $ac_c" 1>&6
7450 else
7451   ac_save_LIBS="$LIBS"
7452 LIBS="-ldb1  $LIBS"
7453 cat > conftest.$ac_ext <<EOF
7454 #line 7455 "configure"
7455 #include "confdefs.h"
7456 /* Override any gcc2 internal prototype to avoid an error.  */
7457 /* We use char because int might match the return type of a gcc2
7458     builtin and then its argument prototype would still apply.  */
7459 char dbopen();
7460
7461 int main() {
7462 dbopen()
7463 ; return 0; }
7464 EOF
7465 if { (eval echo configure:7466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7466   rm -rf conftest*
7467   eval "ac_cv_lib_$ac_lib_var=yes"
7468 else
7469   echo "configure: failed program was:" >&5
7470   cat conftest.$ac_ext >&5
7471   rm -rf conftest*
7472   eval "ac_cv_lib_$ac_lib_var=no"
7473 fi
7474 rm -f conftest*
7475 LIBS="$ac_save_LIBS"
7476
7477 fi
7478 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7479   echo "$ac_t""yes" 1>&6
7480   ol_cv_lib_db=-ldb1
7481 else
7482   echo "$ac_t""no" 1>&6
7483
7484                         echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
7485 echo "configure:7486: checking for dbopen in -ldb" >&5
7486 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
7487 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7488   echo $ac_n "(cached) $ac_c" 1>&6
7489 else
7490   ac_save_LIBS="$LIBS"
7491 LIBS="-ldb  $LIBS"
7492 cat > conftest.$ac_ext <<EOF
7493 #line 7494 "configure"
7494 #include "confdefs.h"
7495 /* Override any gcc2 internal prototype to avoid an error.  */
7496 /* We use char because int might match the return type of a gcc2
7497     builtin and then its argument prototype would still apply.  */
7498 char dbopen();
7499
7500 int main() {
7501 dbopen()
7502 ; return 0; }
7503 EOF
7504 if { (eval echo configure:7505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7505   rm -rf conftest*
7506   eval "ac_cv_lib_$ac_lib_var=yes"
7507 else
7508   echo "configure: failed program was:" >&5
7509   cat conftest.$ac_ext >&5
7510   rm -rf conftest*
7511   eval "ac_cv_lib_$ac_lib_var=no"
7512 fi
7513 rm -f conftest*
7514 LIBS="$ac_save_LIBS"
7515
7516 fi
7517 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7518   echo "$ac_t""yes" 1>&6
7519   ol_cv_lib_db=-ldb
7520 else
7521   echo "$ac_t""no" 1>&6
7522 ol_cv_lib_db=no
7523 fi
7524
7525                 
7526 fi
7527
7528         
7529 fi
7530
7531         LIBS="$ol_LIBS"
7532
7533 fi
7534
7535 echo "$ac_t""$ol_cv_lib_db" 1>&6
7536
7537
7538 for ac_hdr in db_185.h
7539 do
7540 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7541 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7542 echo "configure:7543: checking for $ac_hdr" >&5
7543 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7544   echo $ac_n "(cached) $ac_c" 1>&6
7545 else
7546   cat > conftest.$ac_ext <<EOF
7547 #line 7548 "configure"
7548 #include "confdefs.h"
7549 #include <$ac_hdr>
7550 EOF
7551 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7552 { (eval echo configure:7553: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7553 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7554 if test -z "$ac_err"; then
7555   rm -rf conftest*
7556   eval "ac_cv_header_$ac_safe=yes"
7557 else
7558   echo "$ac_err" >&5
7559   echo "configure: failed program was:" >&5
7560   cat conftest.$ac_ext >&5
7561   rm -rf conftest*
7562   eval "ac_cv_header_$ac_safe=no"
7563 fi
7564 rm -f conftest*
7565 fi
7566 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7567   echo "$ac_t""yes" 1>&6
7568     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7569   cat >> confdefs.h <<EOF
7570 #define $ac_tr_hdr 1
7571 EOF
7572  
7573 else
7574   echo "$ac_t""no" 1>&6
7575 fi
7576 done
7577
7578 if test "$ol_cv_header_db2" = yes ; then
7579         
7580         ol_cv_header_db=$ac_cv_header_db_185_h
7581 else
7582         ol_cv_header_db=$ac_cv_header_db_h
7583 fi
7584
7585
7586  
7587  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
7588 echo "configure:7589: checking for Berkeley DB" >&5
7589 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
7590   echo $ac_n "(cached) $ac_c" 1>&6
7591 else
7592   
7593         if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then
7594                 ol_cv_berkeley_db=no
7595         else
7596                 ol_cv_berkeley_db=yes
7597         fi
7598
7599 fi
7600
7601 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
7602  if test $ol_cv_berkeley_db = yes ; then
7603         cat >> confdefs.h <<\EOF
7604 #define HAVE_BERKELEY_DB 1
7605 EOF
7606
7607  fi
7608
7609
7610         if test $ol_cv_berkeley_db = yes ; then
7611                 ol_link_ldbm=db
7612                 ol_with_ldbm_api=db
7613
7614                 if test $ol_with_ldbm_type = hash ; then
7615                         cat >> confdefs.h <<\EOF
7616 #define LDBM_USE_DBHASH 1
7617 EOF
7618
7619                 else
7620                         cat >> confdefs.h <<\EOF
7621 #define LDBM_USE_DBBTREE 1
7622 EOF
7623
7624                 fi
7625
7626                                                 if test $ol_cv_lib_db != yes ; then
7627                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
7628                 fi
7629         fi
7630 fi
7631
7632 if test $ol_with_ldbm_api = manual ; then
7633                 ol_link_ldbm=yes
7634
7635         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
7636
7637         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
7638 do
7639 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7640 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7641 echo "configure:7642: checking for $ac_hdr" >&5
7642 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7643   echo $ac_n "(cached) $ac_c" 1>&6
7644 else
7645   cat > conftest.$ac_ext <<EOF
7646 #line 7647 "configure"
7647 #include "confdefs.h"
7648 #include <$ac_hdr>
7649 EOF
7650 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7651 { (eval echo configure:7652: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7652 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7653 if test -z "$ac_err"; then
7654   rm -rf conftest*
7655   eval "ac_cv_header_$ac_safe=yes"
7656 else
7657   echo "$ac_err" >&5
7658   echo "configure: failed program was:" >&5
7659   cat conftest.$ac_ext >&5
7660   rm -rf conftest*
7661   eval "ac_cv_header_$ac_safe=no"
7662 fi
7663 rm -f conftest*
7664 fi
7665 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7666   echo "$ac_t""yes" 1>&6
7667     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7668   cat >> confdefs.h <<EOF
7669 #define $ac_tr_hdr 1
7670 EOF
7671  
7672 else
7673   echo "$ac_t""no" 1>&6
7674 fi
7675 done
7676
7677 fi
7678
7679 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
7680         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
7681         ol_with_ldbm_api=none
7682 fi
7683
7684 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
7685         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
7686 echo "configure:7687: checking for MDBM library" >&5
7687 if eval "test \"`echo '$''{'ol_cv_lib_mdbm'+set}'`\" = set"; then
7688   echo $ac_n "(cached) $ac_c" 1>&6
7689 else
7690         ol_LIBS="$LIBS"
7691         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
7692 echo "configure:7693: checking for mdbm_set_chain" >&5
7693 if eval "test \"`echo '$''{'ac_cv_func_mdbm_set_chain'+set}'`\" = set"; then
7694   echo $ac_n "(cached) $ac_c" 1>&6
7695 else
7696   cat > conftest.$ac_ext <<EOF
7697 #line 7698 "configure"
7698 #include "confdefs.h"
7699 /* System header to define __stub macros and hopefully few prototypes,
7700     which can conflict with char mdbm_set_chain(); below.  */
7701 #include <assert.h>
7702 /* Override any gcc2 internal prototype to avoid an error.  */
7703 /* We use char because int might match the return type of a gcc2
7704     builtin and then its argument prototype would still apply.  */
7705 char mdbm_set_chain();
7706
7707 int main() {
7708
7709 /* The GNU C library defines this for functions which it implements
7710     to always fail with ENOSYS.  Some functions are actually named
7711     something starting with __ and the normal name is an alias.  */
7712 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
7713 choke me
7714 #else
7715 mdbm_set_chain();
7716 #endif
7717
7718 ; return 0; }
7719 EOF
7720 if { (eval echo configure:7721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7721   rm -rf conftest*
7722   eval "ac_cv_func_mdbm_set_chain=yes"
7723 else
7724   echo "configure: failed program was:" >&5
7725   cat conftest.$ac_ext >&5
7726   rm -rf conftest*
7727   eval "ac_cv_func_mdbm_set_chain=no"
7728 fi
7729 rm -f conftest*
7730 fi
7731
7732 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
7733   echo "$ac_t""yes" 1>&6
7734   ol_cv_lib_mdbm=yes
7735 else
7736   echo "$ac_t""no" 1>&6
7737
7738                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
7739 echo "configure:7740: checking for mdbm_set_chain in -lmdbm" >&5
7740 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-%__p_%'`
7741 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7742   echo $ac_n "(cached) $ac_c" 1>&6
7743 else
7744   ac_save_LIBS="$LIBS"
7745 LIBS="-lmdbm  $LIBS"
7746 cat > conftest.$ac_ext <<EOF
7747 #line 7748 "configure"
7748 #include "confdefs.h"
7749 /* Override any gcc2 internal prototype to avoid an error.  */
7750 /* We use char because int might match the return type of a gcc2
7751     builtin and then its argument prototype would still apply.  */
7752 char mdbm_set_chain();
7753
7754 int main() {
7755 mdbm_set_chain()
7756 ; return 0; }
7757 EOF
7758 if { (eval echo configure:7759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7759   rm -rf conftest*
7760   eval "ac_cv_lib_$ac_lib_var=yes"
7761 else
7762   echo "configure: failed program was:" >&5
7763   cat conftest.$ac_ext >&5
7764   rm -rf conftest*
7765   eval "ac_cv_lib_$ac_lib_var=no"
7766 fi
7767 rm -f conftest*
7768 LIBS="$ac_save_LIBS"
7769
7770 fi
7771 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7772   echo "$ac_t""yes" 1>&6
7773   ol_cv_lib_mdbm=-lmdbm
7774 else
7775   echo "$ac_t""no" 1>&6
7776 ol_cv_lib_mdbm=no
7777 fi
7778
7779         
7780 fi
7781
7782         LIBS="$ol_LIBS"
7783
7784 fi
7785
7786 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
7787
7788
7789  for ac_hdr in mdbm.h
7790 do
7791 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7792 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7793 echo "configure:7794: checking for $ac_hdr" >&5
7794 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7795   echo $ac_n "(cached) $ac_c" 1>&6
7796 else
7797   cat > conftest.$ac_ext <<EOF
7798 #line 7799 "configure"
7799 #include "confdefs.h"
7800 #include <$ac_hdr>
7801 EOF
7802 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7803 { (eval echo configure:7804: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7804 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7805 if test -z "$ac_err"; then
7806   rm -rf conftest*
7807   eval "ac_cv_header_$ac_safe=yes"
7808 else
7809   echo "$ac_err" >&5
7810   echo "configure: failed program was:" >&5
7811   cat conftest.$ac_ext >&5
7812   rm -rf conftest*
7813   eval "ac_cv_header_$ac_safe=no"
7814 fi
7815 rm -f conftest*
7816 fi
7817 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7818   echo "$ac_t""yes" 1>&6
7819     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7820   cat >> confdefs.h <<EOF
7821 #define $ac_tr_hdr 1
7822 EOF
7823  
7824 else
7825   echo "$ac_t""no" 1>&6
7826 fi
7827 done
7828
7829  echo $ac_n "checking for db""... $ac_c" 1>&6
7830 echo "configure:7831: checking for db" >&5
7831 if eval "test \"`echo '$''{'ol_cv_mdbm'+set}'`\" = set"; then
7832   echo $ac_n "(cached) $ac_c" 1>&6
7833 else
7834   
7835         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
7836                 ol_cv_mdbm=no
7837         else
7838                 ol_cv_mdbm=yes
7839         fi
7840
7841 fi
7842
7843 echo "$ac_t""$ol_cv_mdbm" 1>&6
7844  if test $ol_cv_mdbm = yes ; then
7845         cat >> confdefs.h <<\EOF
7846 #define HAVE_MDBM 1
7847 EOF
7848
7849  fi
7850
7851
7852         if test $ol_cv_mdbm = yes ; then
7853                 ol_link_ldbm=mdbm
7854                 ol_with_ldbm_api=mdbm
7855                 if test $ol_cv_lib_mdbm != yes ; then
7856                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
7857                 fi
7858         fi
7859 fi
7860
7861 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
7862         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
7863 echo "configure:7864: checking for GDBM library" >&5
7864 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
7865   echo $ac_n "(cached) $ac_c" 1>&6
7866 else
7867         ol_LIBS="$LIBS"
7868         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
7869 echo "configure:7870: checking for gdbm_open" >&5
7870 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
7871   echo $ac_n "(cached) $ac_c" 1>&6
7872 else
7873   cat > conftest.$ac_ext <<EOF
7874 #line 7875 "configure"
7875 #include "confdefs.h"
7876 /* System header to define __stub macros and hopefully few prototypes,
7877     which can conflict with char gdbm_open(); below.  */
7878 #include <assert.h>
7879 /* Override any gcc2 internal prototype to avoid an error.  */
7880 /* We use char because int might match the return type of a gcc2
7881     builtin and then its argument prototype would still apply.  */
7882 char gdbm_open();
7883
7884 int main() {
7885
7886 /* The GNU C library defines this for functions which it implements
7887     to always fail with ENOSYS.  Some functions are actually named
7888     something starting with __ and the normal name is an alias.  */
7889 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
7890 choke me
7891 #else
7892 gdbm_open();
7893 #endif
7894
7895 ; return 0; }
7896 EOF
7897 if { (eval echo configure:7898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7898   rm -rf conftest*
7899   eval "ac_cv_func_gdbm_open=yes"
7900 else
7901   echo "configure: failed program was:" >&5
7902   cat conftest.$ac_ext >&5
7903   rm -rf conftest*
7904   eval "ac_cv_func_gdbm_open=no"
7905 fi
7906 rm -f conftest*
7907 fi
7908
7909 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
7910   echo "$ac_t""yes" 1>&6
7911   ol_cv_lib_gdbm=yes
7912 else
7913   echo "$ac_t""no" 1>&6
7914
7915                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
7916 echo "configure:7917: checking for gdbm_open in -lgdbm" >&5
7917 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
7918 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7919   echo $ac_n "(cached) $ac_c" 1>&6
7920 else
7921   ac_save_LIBS="$LIBS"
7922 LIBS="-lgdbm  $LIBS"
7923 cat > conftest.$ac_ext <<EOF
7924 #line 7925 "configure"
7925 #include "confdefs.h"
7926 /* Override any gcc2 internal prototype to avoid an error.  */
7927 /* We use char because int might match the return type of a gcc2
7928     builtin and then its argument prototype would still apply.  */
7929 char gdbm_open();
7930
7931 int main() {
7932 gdbm_open()
7933 ; return 0; }
7934 EOF
7935 if { (eval echo configure:7936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7936   rm -rf conftest*
7937   eval "ac_cv_lib_$ac_lib_var=yes"
7938 else
7939   echo "configure: failed program was:" >&5
7940   cat conftest.$ac_ext >&5
7941   rm -rf conftest*
7942   eval "ac_cv_lib_$ac_lib_var=no"
7943 fi
7944 rm -f conftest*
7945 LIBS="$ac_save_LIBS"
7946
7947 fi
7948 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7949   echo "$ac_t""yes" 1>&6
7950   ol_cv_lib_gdbm=-lgdbm
7951 else
7952   echo "$ac_t""no" 1>&6
7953 ol_cv_lib_gdbm=no
7954 fi
7955
7956         
7957 fi
7958
7959         LIBS="$ol_LIBS"
7960
7961 fi
7962
7963 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
7964
7965
7966  for ac_hdr in gdbm.h
7967 do
7968 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7969 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7970 echo "configure:7971: checking for $ac_hdr" >&5
7971 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7972   echo $ac_n "(cached) $ac_c" 1>&6
7973 else
7974   cat > conftest.$ac_ext <<EOF
7975 #line 7976 "configure"
7976 #include "confdefs.h"
7977 #include <$ac_hdr>
7978 EOF
7979 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7980 { (eval echo configure:7981: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7981 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7982 if test -z "$ac_err"; then
7983   rm -rf conftest*
7984   eval "ac_cv_header_$ac_safe=yes"
7985 else
7986   echo "$ac_err" >&5
7987   echo "configure: failed program was:" >&5
7988   cat conftest.$ac_ext >&5
7989   rm -rf conftest*
7990   eval "ac_cv_header_$ac_safe=no"
7991 fi
7992 rm -f conftest*
7993 fi
7994 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7995   echo "$ac_t""yes" 1>&6
7996     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7997   cat >> confdefs.h <<EOF
7998 #define $ac_tr_hdr 1
7999 EOF
8000  
8001 else
8002   echo "$ac_t""no" 1>&6
8003 fi
8004 done
8005
8006  echo $ac_n "checking for db""... $ac_c" 1>&6
8007 echo "configure:8008: checking for db" >&5
8008 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
8009   echo $ac_n "(cached) $ac_c" 1>&6
8010 else
8011   
8012         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
8013                 ol_cv_gdbm=no
8014         else
8015                 ol_cv_gdbm=yes
8016         fi
8017
8018 fi
8019
8020 echo "$ac_t""$ol_cv_gdbm" 1>&6
8021  if test $ol_cv_gdbm = yes ; then
8022         cat >> confdefs.h <<\EOF
8023 #define HAVE_GDBM 1
8024 EOF
8025
8026  fi
8027
8028
8029         if test $ol_cv_gdbm = yes ; then
8030                 ol_link_ldbm=gdbm
8031                 ol_with_ldbm_api=gdbm
8032
8033                 if test $ol_cv_lib_gdbm != yes ; then
8034                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
8035                 fi
8036         fi
8037 fi
8038
8039 if test $ol_with_ldbm_api = auto ; then
8040         echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
8041 elif test $ol_with_ldbm_api = ndbm ; then
8042         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
8043 echo "configure:8044: checking for NDBM library" >&5
8044 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
8045   echo $ac_n "(cached) $ac_c" 1>&6
8046 else
8047         ol_LIBS="$LIBS"
8048         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
8049 echo "configure:8050: checking for dbm_open" >&5
8050 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
8051   echo $ac_n "(cached) $ac_c" 1>&6
8052 else
8053   cat > conftest.$ac_ext <<EOF
8054 #line 8055 "configure"
8055 #include "confdefs.h"
8056 /* System header to define __stub macros and hopefully few prototypes,
8057     which can conflict with char dbm_open(); below.  */
8058 #include <assert.h>
8059 /* Override any gcc2 internal prototype to avoid an error.  */
8060 /* We use char because int might match the return type of a gcc2
8061     builtin and then its argument prototype would still apply.  */
8062 char dbm_open();
8063
8064 int main() {
8065
8066 /* The GNU C library defines this for functions which it implements
8067     to always fail with ENOSYS.  Some functions are actually named
8068     something starting with __ and the normal name is an alias.  */
8069 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
8070 choke me
8071 #else
8072 dbm_open();
8073 #endif
8074
8075 ; return 0; }
8076 EOF
8077 if { (eval echo configure:8078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8078   rm -rf conftest*
8079   eval "ac_cv_func_dbm_open=yes"
8080 else
8081   echo "configure: failed program was:" >&5
8082   cat conftest.$ac_ext >&5
8083   rm -rf conftest*
8084   eval "ac_cv_func_dbm_open=no"
8085 fi
8086 rm -f conftest*
8087 fi
8088
8089 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
8090   echo "$ac_t""yes" 1>&6
8091   ol_cv_lib_ndbm=yes
8092 else
8093   echo "$ac_t""no" 1>&6
8094
8095                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
8096 echo "configure:8097: checking for dbm_open in -lndbm" >&5
8097 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
8098 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8099   echo $ac_n "(cached) $ac_c" 1>&6
8100 else
8101   ac_save_LIBS="$LIBS"
8102 LIBS="-lndbm  $LIBS"
8103 cat > conftest.$ac_ext <<EOF
8104 #line 8105 "configure"
8105 #include "confdefs.h"
8106 /* Override any gcc2 internal prototype to avoid an error.  */
8107 /* We use char because int might match the return type of a gcc2
8108     builtin and then its argument prototype would still apply.  */
8109 char dbm_open();
8110
8111 int main() {
8112 dbm_open()
8113 ; return 0; }
8114 EOF
8115 if { (eval echo configure:8116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8116   rm -rf conftest*
8117   eval "ac_cv_lib_$ac_lib_var=yes"
8118 else
8119   echo "configure: failed program was:" >&5
8120   cat conftest.$ac_ext >&5
8121   rm -rf conftest*
8122   eval "ac_cv_lib_$ac_lib_var=no"
8123 fi
8124 rm -f conftest*
8125 LIBS="$ac_save_LIBS"
8126
8127 fi
8128 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8129   echo "$ac_t""yes" 1>&6
8130   ol_cv_lib_ndbm=-lndbm
8131 else
8132   echo "$ac_t""no" 1>&6
8133
8134                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
8135 echo "configure:8136: checking for dbm_open in -ldbm" >&5
8136 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
8137 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8138   echo $ac_n "(cached) $ac_c" 1>&6
8139 else
8140   ac_save_LIBS="$LIBS"
8141 LIBS="-ldbm  $LIBS"
8142 cat > conftest.$ac_ext <<EOF
8143 #line 8144 "configure"
8144 #include "confdefs.h"
8145 /* Override any gcc2 internal prototype to avoid an error.  */
8146 /* We use char because int might match the return type of a gcc2
8147     builtin and then its argument prototype would still apply.  */
8148 char dbm_open();
8149
8150 int main() {
8151 dbm_open()
8152 ; return 0; }
8153 EOF
8154 if { (eval echo configure:8155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8155   rm -rf conftest*
8156   eval "ac_cv_lib_$ac_lib_var=yes"
8157 else
8158   echo "configure: failed program was:" >&5
8159   cat conftest.$ac_ext >&5
8160   rm -rf conftest*
8161   eval "ac_cv_lib_$ac_lib_var=no"
8162 fi
8163 rm -f conftest*
8164 LIBS="$ac_save_LIBS"
8165
8166 fi
8167 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8168   echo "$ac_t""yes" 1>&6
8169   ol_cv_lib_ndbm=-ldbm
8170 else
8171   echo "$ac_t""no" 1>&6
8172 ol_cv_lib_ndbm=no
8173 fi
8174                 
8175 fi
8176
8177         
8178 fi
8179
8180         LIBS="$ol_LIBS"
8181
8182 fi
8183
8184 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
8185
8186
8187  for ac_hdr in ndbm.h
8188 do
8189 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8190 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8191 echo "configure:8192: checking for $ac_hdr" >&5
8192 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8193   echo $ac_n "(cached) $ac_c" 1>&6
8194 else
8195   cat > conftest.$ac_ext <<EOF
8196 #line 8197 "configure"
8197 #include "confdefs.h"
8198 #include <$ac_hdr>
8199 EOF
8200 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8201 { (eval echo configure:8202: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8202 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8203 if test -z "$ac_err"; then
8204   rm -rf conftest*
8205   eval "ac_cv_header_$ac_safe=yes"
8206 else
8207   echo "$ac_err" >&5
8208   echo "configure: failed program was:" >&5
8209   cat conftest.$ac_ext >&5
8210   rm -rf conftest*
8211   eval "ac_cv_header_$ac_safe=no"
8212 fi
8213 rm -f conftest*
8214 fi
8215 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8216   echo "$ac_t""yes" 1>&6
8217     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8218   cat >> confdefs.h <<EOF
8219 #define $ac_tr_hdr 1
8220 EOF
8221  
8222 else
8223   echo "$ac_t""no" 1>&6
8224 fi
8225 done
8226
8227  echo $ac_n "checking for db""... $ac_c" 1>&6
8228 echo "configure:8229: checking for db" >&5
8229 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
8230   echo $ac_n "(cached) $ac_c" 1>&6
8231 else
8232   
8233         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
8234                 ol_cv_ndbm=no
8235         else
8236                 ol_cv_ndbm=yes
8237         fi
8238
8239 fi
8240
8241 echo "$ac_t""$ol_cv_ndbm" 1>&6
8242  if test $ol_cv_ndbm = yes ; then
8243         cat >> confdefs.h <<\EOF
8244 #define HAVE_NDBM 1
8245 EOF
8246
8247  fi
8248
8249
8250         if test $ol_cv_ndbm = yes ; then
8251                 ol_link_ldbm=ndbm
8252                 ol_with_ldbm_api=ndbm
8253
8254                 if test $ol_cv_lib_ndbm != yes ; then
8255                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
8256                 fi
8257         fi
8258 fi
8259
8260 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
8261         echo "configure: warning: could not find suitable LDBM backend" 1>&2
8262         if test $ol_enable_ldbm = yes ; then
8263                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
8264         fi
8265
8266         echo "configure: warning: disabling LDBM" 1>&2
8267         ol_enable_ldbm=no
8268 fi
8269
8270 if test $ol_enable_wrappers != no ; then
8271         for ac_hdr in tcpd.h
8272 do
8273 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8274 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8275 echo "configure:8276: checking for $ac_hdr" >&5
8276 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8277   echo $ac_n "(cached) $ac_c" 1>&6
8278 else
8279   cat > conftest.$ac_ext <<EOF
8280 #line 8281 "configure"
8281 #include "confdefs.h"
8282 #include <$ac_hdr>
8283 EOF
8284 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8285 { (eval echo configure:8286: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8286 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8287 if test -z "$ac_err"; then
8288   rm -rf conftest*
8289   eval "ac_cv_header_$ac_safe=yes"
8290 else
8291   echo "$ac_err" >&5
8292   echo "configure: failed program was:" >&5
8293   cat conftest.$ac_ext >&5
8294   rm -rf conftest*
8295   eval "ac_cv_header_$ac_safe=no"
8296 fi
8297 rm -f conftest*
8298 fi
8299 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8300   echo "$ac_t""yes" 1>&6
8301     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8302   cat >> confdefs.h <<EOF
8303 #define $ac_tr_hdr 1
8304 EOF
8305  
8306 else
8307   echo "$ac_t""no" 1>&6
8308 fi
8309 done
8310
8311
8312         if test $ac_cv_header_tcpd_h != yes ; then
8313                 have_wrappers=no
8314         else
8315                 echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
8316 echo "configure:8317: checking for main in -lwrap" >&5
8317 ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'`
8318 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8319   echo $ac_n "(cached) $ac_c" 1>&6
8320 else
8321   ac_save_LIBS="$LIBS"
8322 LIBS="-lwrap  $LIBS"
8323 cat > conftest.$ac_ext <<EOF
8324 #line 8325 "configure"
8325 #include "confdefs.h"
8326
8327 int main() {
8328 main()
8329 ; return 0; }
8330 EOF
8331 if { (eval echo configure:8332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8332   rm -rf conftest*
8333   eval "ac_cv_lib_$ac_lib_var=yes"
8334 else
8335   echo "configure: failed program was:" >&5
8336   cat conftest.$ac_ext >&5
8337   rm -rf conftest*
8338   eval "ac_cv_lib_$ac_lib_var=no"
8339 fi
8340 rm -f conftest*
8341 LIBS="$ac_save_LIBS"
8342
8343 fi
8344 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8345   echo "$ac_t""yes" 1>&6
8346   have_wrappers=yes
8347 else
8348   echo "$ac_t""no" 1>&6
8349 have_wrappers=no
8350 fi
8351
8352         fi
8353
8354         if test $have_wrappers = yes ; then
8355                 cat >> confdefs.h <<\EOF
8356 #define HAVE_TCPD 1
8357 EOF
8358
8359                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
8360
8361                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
8362 echo "configure:8363: checking for main in -lnsl" >&5
8363 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
8364 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8365   echo $ac_n "(cached) $ac_c" 1>&6
8366 else
8367   ac_save_LIBS="$LIBS"
8368 LIBS="-lnsl  $LIBS"
8369 cat > conftest.$ac_ext <<EOF
8370 #line 8371 "configure"
8371 #include "confdefs.h"
8372
8373 int main() {
8374 main()
8375 ; return 0; }
8376 EOF
8377 if { (eval echo configure:8378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8378   rm -rf conftest*
8379   eval "ac_cv_lib_$ac_lib_var=yes"
8380 else
8381   echo "configure: failed program was:" >&5
8382   cat conftest.$ac_ext >&5
8383   rm -rf conftest*
8384   eval "ac_cv_lib_$ac_lib_var=no"
8385 fi
8386 rm -f conftest*
8387 LIBS="$ac_save_LIBS"
8388
8389 fi
8390 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8391   echo "$ac_t""yes" 1>&6
8392     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8393     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8394   cat >> confdefs.h <<EOF
8395 #define $ac_tr_lib 1
8396 EOF
8397
8398   LIBS="-lnsl $LIBS"
8399
8400 else
8401   echo "$ac_t""no" 1>&6
8402 fi
8403
8404         else
8405                 echo "configure: warning: could not find -lwrap" 1>&2
8406                 if test $ol_enable_wrappers = yes ; then
8407                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
8408                 fi
8409
8410                 echo "configure: warning: disabling wrappers support" 1>&2
8411                 ol_enable_wrappers=no
8412         fi
8413 fi
8414
8415 if test $ol_enable_syslog != no ; then
8416         echo $ac_n "checking for openlog""... $ac_c" 1>&6
8417 echo "configure:8418: checking for openlog" >&5
8418 if eval "test \"`echo '$''{'ac_cv_func_openlog'+set}'`\" = set"; then
8419   echo $ac_n "(cached) $ac_c" 1>&6
8420 else
8421   cat > conftest.$ac_ext <<EOF
8422 #line 8423 "configure"
8423 #include "confdefs.h"
8424 /* System header to define __stub macros and hopefully few prototypes,
8425     which can conflict with char openlog(); below.  */
8426 #include <assert.h>
8427 /* Override any gcc2 internal prototype to avoid an error.  */
8428 /* We use char because int might match the return type of a gcc2
8429     builtin and then its argument prototype would still apply.  */
8430 char openlog();
8431
8432 int main() {
8433
8434 /* The GNU C library defines this for functions which it implements
8435     to always fail with ENOSYS.  Some functions are actually named
8436     something starting with __ and the normal name is an alias.  */
8437 #if defined (__stub_openlog) || defined (__stub___openlog)
8438 choke me
8439 #else
8440 openlog();
8441 #endif
8442
8443 ; return 0; }
8444 EOF
8445 if { (eval echo configure:8446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8446   rm -rf conftest*
8447   eval "ac_cv_func_openlog=yes"
8448 else
8449   echo "configure: failed program was:" >&5
8450   cat conftest.$ac_ext >&5
8451   rm -rf conftest*
8452   eval "ac_cv_func_openlog=no"
8453 fi
8454 rm -f conftest*
8455 fi
8456
8457 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
8458   echo "$ac_t""yes" 1>&6
8459   :
8460 else
8461   echo "$ac_t""no" 1>&6
8462 fi
8463
8464         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
8465                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
8466         fi
8467         ol_enable_syslog=$ac_cv_func_openlog
8468 fi
8469
8470 if test $ol_enable_dmalloc != no ; then
8471         for ac_hdr in dmalloc.h
8472 do
8473 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8474 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8475 echo "configure:8476: checking for $ac_hdr" >&5
8476 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8477   echo $ac_n "(cached) $ac_c" 1>&6
8478 else
8479   cat > conftest.$ac_ext <<EOF
8480 #line 8481 "configure"
8481 #include "confdefs.h"
8482 #include <$ac_hdr>
8483 EOF
8484 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8485 { (eval echo configure:8486: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8486 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8487 if test -z "$ac_err"; then
8488   rm -rf conftest*
8489   eval "ac_cv_header_$ac_safe=yes"
8490 else
8491   echo "$ac_err" >&5
8492   echo "configure: failed program was:" >&5
8493   cat conftest.$ac_ext >&5
8494   rm -rf conftest*
8495   eval "ac_cv_header_$ac_safe=no"
8496 fi
8497 rm -f conftest*
8498 fi
8499 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8500   echo "$ac_t""yes" 1>&6
8501     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8502   cat >> confdefs.h <<EOF
8503 #define $ac_tr_hdr 1
8504 EOF
8505  
8506 else
8507   echo "$ac_t""no" 1>&6
8508 fi
8509 done
8510
8511         echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
8512 echo "configure:8513: checking for dmalloc_shutdown in -ldmalloc" >&5
8513 ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-%__p_%'`
8514 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8515   echo $ac_n "(cached) $ac_c" 1>&6
8516 else
8517   ac_save_LIBS="$LIBS"
8518 LIBS="-ldmalloc  $LIBS"
8519 cat > conftest.$ac_ext <<EOF
8520 #line 8521 "configure"
8521 #include "confdefs.h"
8522 /* Override any gcc2 internal prototype to avoid an error.  */
8523 /* We use char because int might match the return type of a gcc2
8524     builtin and then its argument prototype would still apply.  */
8525 char dmalloc_shutdown();
8526
8527 int main() {
8528 dmalloc_shutdown()
8529 ; return 0; }
8530 EOF
8531 if { (eval echo configure:8532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8532   rm -rf conftest*
8533   eval "ac_cv_lib_$ac_lib_var=yes"
8534 else
8535   echo "configure: failed program was:" >&5
8536   cat conftest.$ac_ext >&5
8537   rm -rf conftest*
8538   eval "ac_cv_lib_$ac_lib_var=no"
8539 fi
8540 rm -f conftest*
8541 LIBS="$ac_save_LIBS"
8542
8543 fi
8544 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8545   echo "$ac_t""yes" 1>&6
8546     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8547     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8548   cat >> confdefs.h <<EOF
8549 #define $ac_tr_lib 1
8550 EOF
8551
8552   LIBS="-ldmalloc $LIBS"
8553
8554 else
8555   echo "$ac_t""no" 1>&6
8556 fi
8557
8558 fi
8559
8560 if test $ol_enable_tcl != no ; then
8561         for ac_hdr in tcl.h
8562 do
8563 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8564 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8565 echo "configure:8566: checking for $ac_hdr" >&5
8566 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8567   echo $ac_n "(cached) $ac_c" 1>&6
8568 else
8569   cat > conftest.$ac_ext <<EOF
8570 #line 8571 "configure"
8571 #include "confdefs.h"
8572 #include <$ac_hdr>
8573 EOF
8574 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8575 { (eval echo configure:8576: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8576 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8577 if test -z "$ac_err"; then
8578   rm -rf conftest*
8579   eval "ac_cv_header_$ac_safe=yes"
8580 else
8581   echo "$ac_err" >&5
8582   echo "configure: failed program was:" >&5
8583   cat conftest.$ac_ext >&5
8584   rm -rf conftest*
8585   eval "ac_cv_header_$ac_safe=no"
8586 fi
8587 rm -f conftest*
8588 fi
8589 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8590   echo "$ac_t""yes" 1>&6
8591     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8592   cat >> confdefs.h <<EOF
8593 #define $ac_tr_hdr 1
8594 EOF
8595  
8596 else
8597   echo "$ac_t""no" 1>&6
8598 fi
8599 done
8600
8601
8602         if test $ac_cv_header_tcl_h != yes ; then
8603                 have_tcl=no
8604         else
8605                 echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6
8606 echo "configure:8607: checking for main in -ltcl" >&5
8607 ac_lib_var=`echo tcl'_'main | sed 'y%./+-%__p_%'`
8608 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8609   echo $ac_n "(cached) $ac_c" 1>&6
8610 else
8611   ac_save_LIBS="$LIBS"
8612 LIBS="-ltcl  $LIBS"
8613 cat > conftest.$ac_ext <<EOF
8614 #line 8615 "configure"
8615 #include "confdefs.h"
8616
8617 int main() {
8618 main()
8619 ; return 0; }
8620 EOF
8621 if { (eval echo configure:8622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8622   rm -rf conftest*
8623   eval "ac_cv_lib_$ac_lib_var=yes"
8624 else
8625   echo "configure: failed program was:" >&5
8626   cat conftest.$ac_ext >&5
8627   rm -rf conftest*
8628   eval "ac_cv_lib_$ac_lib_var=no"
8629 fi
8630 rm -f conftest*
8631 LIBS="$ac_save_LIBS"
8632
8633 fi
8634 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8635   echo "$ac_t""yes" 1>&6
8636   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"
8637 else
8638   echo "$ac_t""no" 1>&6
8639 have_tcl=no
8640 fi
8641
8642
8643                 if test $have_tcl != yes; then
8644                         echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6
8645 echo "configure:8646: checking for main in -ltcl7.6" >&5
8646 ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-%__p_%'`
8647 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8648   echo $ac_n "(cached) $ac_c" 1>&6
8649 else
8650   ac_save_LIBS="$LIBS"
8651 LIBS="-ltcl7.6  $LIBS"
8652 cat > conftest.$ac_ext <<EOF
8653 #line 8654 "configure"
8654 #include "confdefs.h"
8655
8656 int main() {
8657 main()
8658 ; return 0; }
8659 EOF
8660 if { (eval echo configure:8661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8661   rm -rf conftest*
8662   eval "ac_cv_lib_$ac_lib_var=yes"
8663 else
8664   echo "configure: failed program was:" >&5
8665   cat conftest.$ac_ext >&5
8666   rm -rf conftest*
8667   eval "ac_cv_lib_$ac_lib_var=no"
8668 fi
8669 rm -f conftest*
8670 LIBS="$ac_save_LIBS"
8671
8672 fi
8673 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8674   echo "$ac_t""yes" 1>&6
8675   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"
8676 else
8677   echo "$ac_t""no" 1>&6
8678 have_tcl=no
8679 fi
8680
8681                 fi
8682
8683                 if test $have_tcl != yes; then
8684                         echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6
8685 echo "configure:8686: checking for main in -ltcl8.0" >&5
8686 ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-%__p_%'`
8687 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8688   echo $ac_n "(cached) $ac_c" 1>&6
8689 else
8690   ac_save_LIBS="$LIBS"
8691 LIBS="-ltcl8.0  $LIBS"
8692 cat > conftest.$ac_ext <<EOF
8693 #line 8694 "configure"
8694 #include "confdefs.h"
8695
8696 int main() {
8697 main()
8698 ; return 0; }
8699 EOF
8700 if { (eval echo configure:8701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8701   rm -rf conftest*
8702   eval "ac_cv_lib_$ac_lib_var=yes"
8703 else
8704   echo "configure: failed program was:" >&5
8705   cat conftest.$ac_ext >&5
8706   rm -rf conftest*
8707   eval "ac_cv_lib_$ac_lib_var=no"
8708 fi
8709 rm -f conftest*
8710 LIBS="$ac_save_LIBS"
8711
8712 fi
8713 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8714   echo "$ac_t""yes" 1>&6
8715   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"
8716 else
8717   echo "$ac_t""no" 1>&6
8718 have_tcl=no
8719 fi
8720
8721                 fi
8722         fi
8723
8724         if test $have_tcl != yes ; then
8725                 echo "configure: warning: could not find -ltcl" 1>&2
8726                 if test $ol_enable_tcl = yes ; then
8727                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
8728                 fi
8729
8730                 ol_enable_tcl=no
8731         fi
8732 fi
8733
8734 # ud needs termcap (should insert check here)
8735 ol_link_termcap=no
8736 for ac_hdr in termcap.h ncurses.h
8737 do
8738 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8739 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8740 echo "configure:8741: checking for $ac_hdr" >&5
8741 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8742   echo $ac_n "(cached) $ac_c" 1>&6
8743 else
8744   cat > conftest.$ac_ext <<EOF
8745 #line 8746 "configure"
8746 #include "confdefs.h"
8747 #include <$ac_hdr>
8748 EOF
8749 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8750 { (eval echo configure:8751: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8751 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8752 if test -z "$ac_err"; then
8753   rm -rf conftest*
8754   eval "ac_cv_header_$ac_safe=yes"
8755 else
8756   echo "$ac_err" >&5
8757   echo "configure: failed program was:" >&5
8758   cat conftest.$ac_ext >&5
8759   rm -rf conftest*
8760   eval "ac_cv_header_$ac_safe=no"
8761 fi
8762 rm -f conftest*
8763 fi
8764 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8765   echo "$ac_t""yes" 1>&6
8766     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8767   cat >> confdefs.h <<EOF
8768 #define $ac_tr_hdr 1
8769 EOF
8770  
8771 else
8772   echo "$ac_t""no" 1>&6
8773 fi
8774 done
8775
8776
8777 if test $ol_link_termcap = no ; then
8778         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
8779 echo "configure:8780: checking for tputs in -ltermcap" >&5
8780 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
8781 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8782   echo $ac_n "(cached) $ac_c" 1>&6
8783 else
8784   ac_save_LIBS="$LIBS"
8785 LIBS="-ltermcap  $LIBS"
8786 cat > conftest.$ac_ext <<EOF
8787 #line 8788 "configure"
8788 #include "confdefs.h"
8789 /* Override any gcc2 internal prototype to avoid an error.  */
8790 /* We use char because int might match the return type of a gcc2
8791     builtin and then its argument prototype would still apply.  */
8792 char tputs();
8793
8794 int main() {
8795 tputs()
8796 ; return 0; }
8797 EOF
8798 if { (eval echo configure:8799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8799   rm -rf conftest*
8800   eval "ac_cv_lib_$ac_lib_var=yes"
8801 else
8802   echo "configure: failed program was:" >&5
8803   cat conftest.$ac_ext >&5
8804   rm -rf conftest*
8805   eval "ac_cv_lib_$ac_lib_var=no"
8806 fi
8807 rm -f conftest*
8808 LIBS="$ac_save_LIBS"
8809
8810 fi
8811 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8812   echo "$ac_t""yes" 1>&6
8813   have_termcap=yes
8814 else
8815   echo "$ac_t""no" 1>&6
8816 have_termcap=no
8817 fi
8818
8819         if test $have_termcap = yes ; then
8820                 cat >> confdefs.h <<\EOF
8821 #define HAVE_TERMCAP 1
8822 EOF
8823
8824                 ol_link_termcap=yes
8825                 TERMCAP_LIBS=-ltermcap
8826         fi
8827 fi
8828
8829 if test $ol_link_termcap = no ; then
8830         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
8831 echo "configure:8832: checking for initscr in -lncurses" >&5
8832 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
8833 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8834   echo $ac_n "(cached) $ac_c" 1>&6
8835 else
8836   ac_save_LIBS="$LIBS"
8837 LIBS="-lncurses  $LIBS"
8838 cat > conftest.$ac_ext <<EOF
8839 #line 8840 "configure"
8840 #include "confdefs.h"
8841 /* Override any gcc2 internal prototype to avoid an error.  */
8842 /* We use char because int might match the return type of a gcc2
8843     builtin and then its argument prototype would still apply.  */
8844 char initscr();
8845
8846 int main() {
8847 initscr()
8848 ; return 0; }
8849 EOF
8850 if { (eval echo configure:8851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8851   rm -rf conftest*
8852   eval "ac_cv_lib_$ac_lib_var=yes"
8853 else
8854   echo "configure: failed program was:" >&5
8855   cat conftest.$ac_ext >&5
8856   rm -rf conftest*
8857   eval "ac_cv_lib_$ac_lib_var=no"
8858 fi
8859 rm -f conftest*
8860 LIBS="$ac_save_LIBS"
8861
8862 fi
8863 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8864   echo "$ac_t""yes" 1>&6
8865   have_ncurses=yes
8866 else
8867   echo "$ac_t""no" 1>&6
8868 have_ncurses=no
8869 fi
8870
8871         if test $have_ncurses = yes ; then
8872                 cat >> confdefs.h <<\EOF
8873 #define HAVE_NCURSES 1
8874 EOF
8875
8876                 ol_link_termcap=yes
8877                 TERMCAP_LIBS=-lncurses
8878         fi
8879 fi
8880
8881 if test $ol_link_termcap = no ; then
8882         cat >> confdefs.h <<\EOF
8883 #define NO_TERMCAP 1
8884 EOF
8885
8886         TERMCAP_LIBS=
8887 fi
8888
8889 ol_link_readline=no
8890 if test $ol_with_readline != no ; then
8891         for ac_hdr in readline/readline.h readline/history.h
8892 do
8893 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8894 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8895 echo "configure:8896: checking for $ac_hdr" >&5
8896 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8897   echo $ac_n "(cached) $ac_c" 1>&6
8898 else
8899   cat > conftest.$ac_ext <<EOF
8900 #line 8901 "configure"
8901 #include "confdefs.h"
8902 #include <$ac_hdr>
8903 EOF
8904 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8905 { (eval echo configure:8906: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8906 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8907 if test -z "$ac_err"; then
8908   rm -rf conftest*
8909   eval "ac_cv_header_$ac_safe=yes"
8910 else
8911   echo "$ac_err" >&5
8912   echo "configure: failed program was:" >&5
8913   cat conftest.$ac_ext >&5
8914   rm -rf conftest*
8915   eval "ac_cv_header_$ac_safe=no"
8916 fi
8917 rm -f conftest*
8918 fi
8919 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8920   echo "$ac_t""yes" 1>&6
8921     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8922   cat >> confdefs.h <<EOF
8923 #define $ac_tr_hdr 1
8924 EOF
8925  
8926 else
8927   echo "$ac_t""no" 1>&6
8928 fi
8929 done
8930
8931
8932         if test $ac_cv_header_readline_readline_h = yes ; then
8933                 save_LIBS="$LIBS"
8934                 LIBS="$TERMCAP_LIBS $LIBS"
8935                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
8936 echo "configure:8937: checking for readline in -lreadline" >&5
8937 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`
8938 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8939   echo $ac_n "(cached) $ac_c" 1>&6
8940 else
8941   ac_save_LIBS="$LIBS"
8942 LIBS="-lreadline  $LIBS"
8943 cat > conftest.$ac_ext <<EOF
8944 #line 8945 "configure"
8945 #include "confdefs.h"
8946 /* Override any gcc2 internal prototype to avoid an error.  */
8947 /* We use char because int might match the return type of a gcc2
8948     builtin and then its argument prototype would still apply.  */
8949 char readline();
8950
8951 int main() {
8952 readline()
8953 ; return 0; }
8954 EOF
8955 if { (eval echo configure:8956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8956   rm -rf conftest*
8957   eval "ac_cv_lib_$ac_lib_var=yes"
8958 else
8959   echo "configure: failed program was:" >&5
8960   cat conftest.$ac_ext >&5
8961   rm -rf conftest*
8962   eval "ac_cv_lib_$ac_lib_var=no"
8963 fi
8964 rm -f conftest*
8965 LIBS="$ac_save_LIBS"
8966
8967 fi
8968 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8969   echo "$ac_t""yes" 1>&6
8970   have_readline=yes
8971 else
8972   echo "$ac_t""no" 1>&6
8973 have_readline=no
8974 fi
8975
8976                 LIBS="$save_LIBS"
8977                         
8978                 if test $have_readline = yes ; then
8979                         ol_with_readline=found
8980                         ol_link_readline=yes
8981
8982                         READLINE_LIBS="-lreadline"
8983                 fi
8984         fi
8985 fi
8986
8987 if test $ol_link_readline = yes ; then
8988         cat >> confdefs.h <<\EOF
8989 #define HAVE_READLINE 1
8990 EOF
8991
8992 fi
8993
8994
8995 # FreeBSD (and others) have crypt(3) in -lcrypt
8996 if test $ol_enable_crypt != no ; then
8997         echo $ac_n "checking for crypt""... $ac_c" 1>&6
8998 echo "configure:8999: checking for crypt" >&5
8999 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
9000   echo $ac_n "(cached) $ac_c" 1>&6
9001 else
9002   cat > conftest.$ac_ext <<EOF
9003 #line 9004 "configure"
9004 #include "confdefs.h"
9005 /* System header to define __stub macros and hopefully few prototypes,
9006     which can conflict with char crypt(); below.  */
9007 #include <assert.h>
9008 /* Override any gcc2 internal prototype to avoid an error.  */
9009 /* We use char because int might match the return type of a gcc2
9010     builtin and then its argument prototype would still apply.  */
9011 char crypt();
9012
9013 int main() {
9014
9015 /* The GNU C library defines this for functions which it implements
9016     to always fail with ENOSYS.  Some functions are actually named
9017     something starting with __ and the normal name is an alias.  */
9018 #if defined (__stub_crypt) || defined (__stub___crypt)
9019 choke me
9020 #else
9021 crypt();
9022 #endif
9023
9024 ; return 0; }
9025 EOF
9026 if { (eval echo configure:9027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9027   rm -rf conftest*
9028   eval "ac_cv_func_crypt=yes"
9029 else
9030   echo "configure: failed program was:" >&5
9031   cat conftest.$ac_ext >&5
9032   rm -rf conftest*
9033   eval "ac_cv_func_crypt=no"
9034 fi
9035 rm -f conftest*
9036 fi
9037
9038 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
9039   echo "$ac_t""yes" 1>&6
9040   have_crypt=yes
9041 else
9042   echo "$ac_t""no" 1>&6
9043
9044                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
9045 echo "configure:9046: checking for crypt in -lcrypt" >&5
9046 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
9047 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9048   echo $ac_n "(cached) $ac_c" 1>&6
9049 else
9050   ac_save_LIBS="$LIBS"
9051 LIBS="-lcrypt  $LIBS"
9052 cat > conftest.$ac_ext <<EOF
9053 #line 9054 "configure"
9054 #include "confdefs.h"
9055 /* Override any gcc2 internal prototype to avoid an error.  */
9056 /* We use char because int might match the return type of a gcc2
9057     builtin and then its argument prototype would still apply.  */
9058 char crypt();
9059
9060 int main() {
9061 crypt()
9062 ; return 0; }
9063 EOF
9064 if { (eval echo configure:9065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9065   rm -rf conftest*
9066   eval "ac_cv_lib_$ac_lib_var=yes"
9067 else
9068   echo "configure: failed program was:" >&5
9069   cat conftest.$ac_ext >&5
9070   rm -rf conftest*
9071   eval "ac_cv_lib_$ac_lib_var=no"
9072 fi
9073 rm -f conftest*
9074 LIBS="$ac_save_LIBS"
9075
9076 fi
9077 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9078   echo "$ac_t""yes" 1>&6
9079   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
9080                         have_crypt=yes
9081 else
9082   echo "$ac_t""no" 1>&6
9083 have_crypt=no
9084 fi
9085
9086 fi
9087
9088
9089         if test $have_crypt = yes ; then
9090                 cat >> confdefs.h <<\EOF
9091 #define HAVE_CRYPT 1
9092 EOF
9093
9094         else
9095                 echo "configure: warning: could not find crypt" 1>&2
9096                 if test $ol_enable_crypt = yes ; then
9097                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
9098                 fi
9099
9100                 echo "configure: warning: disabling crypt support" 1>&2
9101                 ol_enable_crypt=no
9102         fi
9103 fi
9104
9105 # FreeBSD (and others) have setproctitle(3) in -lutil
9106 if test $ol_enable_proctitle != no ; then
9107         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
9108 echo "configure:9109: checking for setproctitle" >&5
9109 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
9110   echo $ac_n "(cached) $ac_c" 1>&6
9111 else
9112   cat > conftest.$ac_ext <<EOF
9113 #line 9114 "configure"
9114 #include "confdefs.h"
9115 /* System header to define __stub macros and hopefully few prototypes,
9116     which can conflict with char setproctitle(); below.  */
9117 #include <assert.h>
9118 /* Override any gcc2 internal prototype to avoid an error.  */
9119 /* We use char because int might match the return type of a gcc2
9120     builtin and then its argument prototype would still apply.  */
9121 char setproctitle();
9122
9123 int main() {
9124
9125 /* The GNU C library defines this for functions which it implements
9126     to always fail with ENOSYS.  Some functions are actually named
9127     something starting with __ and the normal name is an alias.  */
9128 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
9129 choke me
9130 #else
9131 setproctitle();
9132 #endif
9133
9134 ; return 0; }
9135 EOF
9136 if { (eval echo configure:9137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9137   rm -rf conftest*
9138   eval "ac_cv_func_setproctitle=yes"
9139 else
9140   echo "configure: failed program was:" >&5
9141   cat conftest.$ac_ext >&5
9142   rm -rf conftest*
9143   eval "ac_cv_func_setproctitle=no"
9144 fi
9145 rm -f conftest*
9146 fi
9147
9148 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
9149   echo "$ac_t""yes" 1>&6
9150   have_setproctitle=yes
9151 else
9152   echo "$ac_t""no" 1>&6
9153
9154                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
9155 echo "configure:9156: checking for setproctitle in -lutil" >&5
9156 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
9157 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9158   echo $ac_n "(cached) $ac_c" 1>&6
9159 else
9160   ac_save_LIBS="$LIBS"
9161 LIBS="-lutil  $LIBS"
9162 cat > conftest.$ac_ext <<EOF
9163 #line 9164 "configure"
9164 #include "confdefs.h"
9165 /* Override any gcc2 internal prototype to avoid an error.  */
9166 /* We use char because int might match the return type of a gcc2
9167     builtin and then its argument prototype would still apply.  */
9168 char setproctitle();
9169
9170 int main() {
9171 setproctitle()
9172 ; return 0; }
9173 EOF
9174 if { (eval echo configure:9175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9175   rm -rf conftest*
9176   eval "ac_cv_lib_$ac_lib_var=yes"
9177 else
9178   echo "configure: failed program was:" >&5
9179   cat conftest.$ac_ext >&5
9180   rm -rf conftest*
9181   eval "ac_cv_lib_$ac_lib_var=no"
9182 fi
9183 rm -f conftest*
9184 LIBS="$ac_save_LIBS"
9185
9186 fi
9187 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9188   echo "$ac_t""yes" 1>&6
9189   have_setproctitle=yes
9190                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
9191 else
9192   echo "$ac_t""no" 1>&6
9193 have_setproctitle=no
9194                         LIBOBJS="$LIBOBJS setproctitle.o"
9195 fi
9196
9197 fi
9198
9199
9200         if test $have_setproctitle = yes ; then
9201                 cat >> confdefs.h <<\EOF
9202 #define HAVE_SETPROCTITLE 1
9203 EOF
9204
9205         fi
9206 fi
9207
9208 # test for EBCDIC
9209 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
9210 echo "configure:9211: checking for EBCDIC" >&5
9211 if eval "test \"`echo '$''{'ol_cv_cpp_ebcdic'+set}'`\" = set"; then
9212   echo $ac_n "(cached) $ac_c" 1>&6
9213 else
9214   
9215         cat > conftest.$ac_ext <<EOF
9216 #line 9217 "configure"
9217 #include "confdefs.h"
9218
9219 #if !('M' == 0xd4)
9220 #include <__ASCII__/generate_error.h>
9221 #endif
9222
9223 EOF
9224 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9225 { (eval echo configure:9226: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9226 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9227 if test -z "$ac_err"; then
9228   rm -rf conftest*
9229   ol_cv_cpp_ebcdic=yes
9230 else
9231   echo "$ac_err" >&5
9232   echo "configure: failed program was:" >&5
9233   cat conftest.$ac_ext >&5
9234   rm -rf conftest*
9235   ol_cv_cpp_ebcdic=no
9236 fi
9237 rm -f conftest*
9238 fi
9239
9240 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
9241 if test $ol_cv_cpp_ebcdic = yes ; then
9242         cat >> confdefs.h <<\EOF
9243 #define HAVE_EBCDIC 1
9244 EOF
9245
9246 fi
9247
9248 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
9249 echo "configure:9250: checking for ANSI C header files" >&5
9250 if eval "test \"`echo '$''{'ol_cv_header_stdc'+set}'`\" = set"; then
9251   echo $ac_n "(cached) $ac_c" 1>&6
9252 else
9253   cat > conftest.$ac_ext <<EOF
9254 #line 9255 "configure"
9255 #include "confdefs.h"
9256 #include <stdlib.h>
9257 #include <stdarg.h>
9258 #include <string.h>
9259 #include <float.h>
9260 EOF
9261 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9262 { (eval echo configure:9263: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9263 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9264 if test -z "$ac_err"; then
9265   rm -rf conftest*
9266   ol_cv_header_stdc=yes
9267 else
9268   echo "$ac_err" >&5
9269   echo "configure: failed program was:" >&5
9270   cat conftest.$ac_ext >&5
9271   rm -rf conftest*
9272   ol_cv_header_stdc=no
9273 fi
9274 rm -f conftest*
9275
9276 if test $ol_cv_header_stdc = yes; then
9277   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
9278 cat > conftest.$ac_ext <<EOF
9279 #line 9280 "configure"
9280 #include "confdefs.h"
9281 #include <string.h>
9282 EOF
9283 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9284   egrep "memchr" >/dev/null 2>&1; then
9285   :
9286 else
9287   rm -rf conftest*
9288   ol_cv_header_stdc=no
9289 fi
9290 rm -f conftest*
9291
9292 fi
9293
9294 if test $ol_cv_header_stdc = yes; then
9295   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
9296 cat > conftest.$ac_ext <<EOF
9297 #line 9298 "configure"
9298 #include "confdefs.h"
9299 #include <stdlib.h>
9300 EOF
9301 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9302   egrep "free" >/dev/null 2>&1; then
9303   :
9304 else
9305   rm -rf conftest*
9306   ol_cv_header_stdc=no
9307 fi
9308 rm -f conftest*
9309
9310 fi
9311
9312 if test $ol_cv_header_stdc = yes; then
9313   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
9314 if test "$cross_compiling" = yes; then
9315   :
9316 else
9317   cat > conftest.$ac_ext <<EOF
9318 #line 9319 "configure"
9319 #include "confdefs.h"
9320 #include <ctype.h>
9321 #ifndef HAVE_EBCDIC
9322 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
9323 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
9324 #else
9325 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
9326                 || ('j' <= (c) && (c) <= 'r') \
9327                 || ('s' <= (c) && (c) <= 'z'))
9328 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
9329 #endif
9330 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
9331 int main () { int i; for (i = 0; i < 256; i++)
9332 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
9333 exit (0); }
9334
9335 EOF
9336 if { (eval echo configure:9337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9337 then
9338   :
9339 else
9340   echo "configure: failed program was:" >&5
9341   cat conftest.$ac_ext >&5
9342   rm -fr conftest*
9343   ol_cv_header_stdc=no
9344 fi
9345 rm -fr conftest*
9346 fi
9347
9348 fi
9349 fi
9350
9351 echo "$ac_t""$ol_cv_header_stdc" 1>&6
9352 if test $ol_cv_header_stdc = yes; then
9353   cat >> confdefs.h <<\EOF
9354 #define STDC_HEADERS 1
9355 EOF
9356
9357 fi
9358 ac_cv_header_stdc=disable
9359
9360
9361 if test $ol_cv_header_stdc != yes; then
9362         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
9363 fi
9364
9365 ac_header_dirent=no
9366 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
9367 do
9368 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9369 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
9370 echo "configure:9371: checking for $ac_hdr that defines DIR" >&5
9371 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
9372   echo $ac_n "(cached) $ac_c" 1>&6
9373 else
9374   cat > conftest.$ac_ext <<EOF
9375 #line 9376 "configure"
9376 #include "confdefs.h"
9377 #include <sys/types.h>
9378 #include <$ac_hdr>
9379 int main() {
9380 DIR *dirp = 0;
9381 ; return 0; }
9382 EOF
9383 if { (eval echo configure:9384: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9384   rm -rf conftest*
9385   eval "ac_cv_header_dirent_$ac_safe=yes"
9386 else
9387   echo "configure: failed program was:" >&5
9388   cat conftest.$ac_ext >&5
9389   rm -rf conftest*
9390   eval "ac_cv_header_dirent_$ac_safe=no"
9391 fi
9392 rm -f conftest*
9393 fi
9394 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
9395   echo "$ac_t""yes" 1>&6
9396     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9397   cat >> confdefs.h <<EOF
9398 #define $ac_tr_hdr 1
9399 EOF
9400  ac_header_dirent=$ac_hdr; break
9401 else
9402   echo "$ac_t""no" 1>&6
9403 fi
9404 done
9405 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
9406 if test $ac_header_dirent = dirent.h; then
9407 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
9408 echo "configure:9409: checking for opendir in -ldir" >&5
9409 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
9410 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9411   echo $ac_n "(cached) $ac_c" 1>&6
9412 else
9413   ac_save_LIBS="$LIBS"
9414 LIBS="-ldir  $LIBS"
9415 cat > conftest.$ac_ext <<EOF
9416 #line 9417 "configure"
9417 #include "confdefs.h"
9418 /* Override any gcc2 internal prototype to avoid an error.  */
9419 /* We use char because int might match the return type of a gcc2
9420     builtin and then its argument prototype would still apply.  */
9421 char opendir();
9422
9423 int main() {
9424 opendir()
9425 ; return 0; }
9426 EOF
9427 if { (eval echo configure:9428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9428   rm -rf conftest*
9429   eval "ac_cv_lib_$ac_lib_var=yes"
9430 else
9431   echo "configure: failed program was:" >&5
9432   cat conftest.$ac_ext >&5
9433   rm -rf conftest*
9434   eval "ac_cv_lib_$ac_lib_var=no"
9435 fi
9436 rm -f conftest*
9437 LIBS="$ac_save_LIBS"
9438
9439 fi
9440 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9441   echo "$ac_t""yes" 1>&6
9442   LIBS="$LIBS -ldir"
9443 else
9444   echo "$ac_t""no" 1>&6
9445 fi
9446
9447 else
9448 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
9449 echo "configure:9450: checking for opendir in -lx" >&5
9450 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
9451 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9452   echo $ac_n "(cached) $ac_c" 1>&6
9453 else
9454   ac_save_LIBS="$LIBS"
9455 LIBS="-lx  $LIBS"
9456 cat > conftest.$ac_ext <<EOF
9457 #line 9458 "configure"
9458 #include "confdefs.h"
9459 /* Override any gcc2 internal prototype to avoid an error.  */
9460 /* We use char because int might match the return type of a gcc2
9461     builtin and then its argument prototype would still apply.  */
9462 char opendir();
9463
9464 int main() {
9465 opendir()
9466 ; return 0; }
9467 EOF
9468 if { (eval echo configure:9469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9469   rm -rf conftest*
9470   eval "ac_cv_lib_$ac_lib_var=yes"
9471 else
9472   echo "configure: failed program was:" >&5
9473   cat conftest.$ac_ext >&5
9474   rm -rf conftest*
9475   eval "ac_cv_lib_$ac_lib_var=no"
9476 fi
9477 rm -f conftest*
9478 LIBS="$ac_save_LIBS"
9479
9480 fi
9481 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9482   echo "$ac_t""yes" 1>&6
9483   LIBS="$LIBS -lx"
9484 else
9485   echo "$ac_t""no" 1>&6
9486 fi
9487
9488 fi
9489
9490 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
9491 echo "configure:9492: checking for sys/wait.h that is POSIX.1 compatible" >&5
9492 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
9493   echo $ac_n "(cached) $ac_c" 1>&6
9494 else
9495   cat > conftest.$ac_ext <<EOF
9496 #line 9497 "configure"
9497 #include "confdefs.h"
9498 #include <sys/types.h>
9499 #include <sys/wait.h>
9500 #ifndef WEXITSTATUS
9501 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
9502 #endif
9503 #ifndef WIFEXITED
9504 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
9505 #endif
9506 int main() {
9507 int s;
9508 wait (&s);
9509 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
9510 ; return 0; }
9511 EOF
9512 if { (eval echo configure:9513: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9513   rm -rf conftest*
9514   ac_cv_header_sys_wait_h=yes
9515 else
9516   echo "configure: failed program was:" >&5
9517   cat conftest.$ac_ext >&5
9518   rm -rf conftest*
9519   ac_cv_header_sys_wait_h=no
9520 fi
9521 rm -f conftest*
9522 fi
9523
9524 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
9525 if test $ac_cv_header_sys_wait_h = yes; then
9526   cat >> confdefs.h <<\EOF
9527 #define HAVE_SYS_WAIT_H 1
9528 EOF
9529
9530 fi
9531
9532 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
9533 echo "configure:9534: checking POSIX termios" >&5
9534 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
9535   echo $ac_n "(cached) $ac_c" 1>&6
9536 else
9537   cat > conftest.$ac_ext <<EOF
9538 #line 9539 "configure"
9539 #include "confdefs.h"
9540 #include <sys/types.h>
9541 #include <unistd.h>
9542 #include <termios.h>
9543 int main() {
9544 /* SunOS 4.0.3 has termios.h but not the library calls.  */
9545    tcgetattr(0, 0);
9546 ; return 0; }
9547 EOF
9548 if { (eval echo configure:9549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9549   rm -rf conftest*
9550   am_cv_sys_posix_termios=yes
9551 else
9552   echo "configure: failed program was:" >&5
9553   cat conftest.$ac_ext >&5
9554   rm -rf conftest*
9555   am_cv_sys_posix_termios=no
9556 fi
9557 rm -f conftest*
9558 fi
9559
9560 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
9561
9562
9563  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
9564 echo "configure:9565: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
9565 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
9566   echo $ac_n "(cached) $ac_c" 1>&6
9567 else
9568   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
9569
9570   gwinsz_in_termios_h=no
9571   if test $am_cv_sys_posix_termios = yes; then
9572     cat > conftest.$ac_ext <<EOF
9573 #line 9574 "configure"
9574 #include "confdefs.h"
9575 #include <sys/types.h>
9576 #     include <termios.h>
9577 #     ifdef TIOCGWINSZ
9578         yes
9579 #     endif
9580     
9581 EOF
9582 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9583   egrep "yes" >/dev/null 2>&1; then
9584   rm -rf conftest*
9585   gwinsz_in_termios_h=yes
9586 fi
9587 rm -f conftest*
9588
9589   fi
9590
9591   if test $gwinsz_in_termios_h = no; then
9592     cat > conftest.$ac_ext <<EOF
9593 #line 9594 "configure"
9594 #include "confdefs.h"
9595 #include <sys/types.h>
9596 #     include <sys/ioctl.h>
9597 #     ifdef TIOCGWINSZ
9598         yes
9599 #     endif
9600     
9601 EOF
9602 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9603   egrep "yes" >/dev/null 2>&1; then
9604   rm -rf conftest*
9605   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
9606 fi
9607 rm -f conftest*
9608
9609   fi
9610   
9611 fi
9612
9613 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
9614   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
9615     cat >> confdefs.h <<\EOF
9616 #define GWINSZ_IN_SYS_IOCTL 1
9617 EOF
9618
9619   fi
9620
9621 if test $am_cv_sys_posix_termios = yes ; then
9622         cat >> confdefs.h <<\EOF
9623 #define HAVE_POSIX_TERMIOS 1
9624 EOF
9625
9626 fi
9627
9628 for ac_hdr in \
9629         arpa/inet.h             \
9630         arpa/nameser.h  \
9631         assert.h                \
9632         crypt.h                 \
9633         errno.h                 \
9634         fcntl.h                 \
9635         filio.h                 \
9636         getopt.h                \
9637         grp.h                   \
9638         libutil.h               \
9639         limits.h                \
9640         locale.h                \
9641         malloc.h                \
9642         memory.h                \
9643         regex.h                 \
9644         psap.h                  \
9645         pwd.h                   \
9646         resolv.h                \
9647         sgtty.h                 \
9648         stdarg.h                \
9649         stddef.h                \
9650         string.h                \
9651         strings.h               \
9652         sysexits.h              \
9653         sys/file.h              \
9654         sys/filio.h             \
9655         sys/errno.h             \
9656         sys/ioctl.h             \
9657         sys/param.h             \
9658         sys/resource.h  \
9659         sys/select.h    \
9660         sys/socket.h    \
9661         sys/syslog.h    \
9662         sys/time.h              \
9663         sys/types.h             \
9664         syslog.h                \
9665         termios.h               \
9666         unistd.h                \
9667
9668 do
9669 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9670 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9671 echo "configure:9672: checking for $ac_hdr" >&5
9672 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9673   echo $ac_n "(cached) $ac_c" 1>&6
9674 else
9675   cat > conftest.$ac_ext <<EOF
9676 #line 9677 "configure"
9677 #include "confdefs.h"
9678 #include <$ac_hdr>
9679 EOF
9680 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9681 { (eval echo configure:9682: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9682 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9683 if test -z "$ac_err"; then
9684   rm -rf conftest*
9685   eval "ac_cv_header_$ac_safe=yes"
9686 else
9687   echo "$ac_err" >&5
9688   echo "configure: failed program was:" >&5
9689   cat conftest.$ac_ext >&5
9690   rm -rf conftest*
9691   eval "ac_cv_header_$ac_safe=no"
9692 fi
9693 rm -f conftest*
9694 fi
9695 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9696   echo "$ac_t""yes" 1>&6
9697     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9698   cat >> confdefs.h <<EOF
9699 #define $ac_tr_hdr 1
9700 EOF
9701  
9702 else
9703   echo "$ac_t""no" 1>&6
9704 fi
9705 done
9706
9707
9708 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
9709 echo "configure:9710: checking for uid_t in sys/types.h" >&5
9710 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
9711   echo $ac_n "(cached) $ac_c" 1>&6
9712 else
9713   cat > conftest.$ac_ext <<EOF
9714 #line 9715 "configure"
9715 #include "confdefs.h"
9716 #include <sys/types.h>
9717 EOF
9718 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9719   egrep "uid_t" >/dev/null 2>&1; then
9720   rm -rf conftest*
9721   ac_cv_type_uid_t=yes
9722 else
9723   rm -rf conftest*
9724   ac_cv_type_uid_t=no
9725 fi
9726 rm -f conftest*
9727
9728 fi
9729
9730 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
9731 if test $ac_cv_type_uid_t = no; then
9732   cat >> confdefs.h <<\EOF
9733 #define uid_t int
9734 EOF
9735
9736   cat >> confdefs.h <<\EOF
9737 #define gid_t int
9738 EOF
9739
9740 fi
9741
9742 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
9743 echo "configure:9744: checking type of array argument to getgroups" >&5
9744 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
9745   echo $ac_n "(cached) $ac_c" 1>&6
9746 else
9747   if test "$cross_compiling" = yes; then
9748   ac_cv_type_getgroups=cross
9749 else
9750   cat > conftest.$ac_ext <<EOF
9751 #line 9752 "configure"
9752 #include "confdefs.h"
9753
9754 /* Thanks to Mike Rendell for this test.  */
9755 #include <sys/types.h>
9756 #define NGID 256
9757 #undef MAX
9758 #define MAX(x, y) ((x) > (y) ? (x) : (y))
9759 main()
9760 {
9761   gid_t gidset[NGID];
9762   int i, n;
9763   union { gid_t gval; long lval; }  val;
9764
9765   val.lval = -1;
9766   for (i = 0; i < NGID; i++)
9767     gidset[i] = val.gval;
9768   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
9769                  gidset);
9770   /* Exit non-zero if getgroups seems to require an array of ints.  This
9771      happens when gid_t is short but getgroups modifies an array of ints.  */
9772   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
9773 }
9774
9775 EOF
9776 if { (eval echo configure:9777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9777 then
9778     ac_cv_type_getgroups=gid_t
9779 else
9780   echo "configure: failed program was:" >&5
9781   cat conftest.$ac_ext >&5
9782   rm -fr conftest*
9783   ac_cv_type_getgroups=int
9784 fi
9785 rm -fr conftest*
9786 fi
9787
9788 if test $ac_cv_type_getgroups = cross; then
9789         cat > conftest.$ac_ext <<EOF
9790 #line 9791 "configure"
9791 #include "confdefs.h"
9792 #include <unistd.h>
9793 EOF
9794 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9795   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
9796   rm -rf conftest*
9797   ac_cv_type_getgroups=gid_t
9798 else
9799   rm -rf conftest*
9800   ac_cv_type_getgroups=int
9801 fi
9802 rm -f conftest*
9803
9804 fi
9805 fi
9806
9807 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
9808 cat >> confdefs.h <<EOF
9809 #define GETGROUPS_T $ac_cv_type_getgroups
9810 EOF
9811
9812  echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
9813 echo "configure:9814: checking for ANSI C header files" >&5
9814 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
9815   echo $ac_n "(cached) $ac_c" 1>&6
9816 else
9817   cat > conftest.$ac_ext <<EOF
9818 #line 9819 "configure"
9819 #include "confdefs.h"
9820 #include <stdlib.h>
9821 #include <stdarg.h>
9822 #include <string.h>
9823 #include <float.h>
9824 EOF
9825 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9826 { (eval echo configure:9827: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9827 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9828 if test -z "$ac_err"; then
9829   rm -rf conftest*
9830   ac_cv_header_stdc=yes
9831 else
9832   echo "$ac_err" >&5
9833   echo "configure: failed program was:" >&5
9834   cat conftest.$ac_ext >&5
9835   rm -rf conftest*
9836   ac_cv_header_stdc=no
9837 fi
9838 rm -f conftest*
9839
9840 if test $ac_cv_header_stdc = yes; then
9841   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
9842 cat > conftest.$ac_ext <<EOF
9843 #line 9844 "configure"
9844 #include "confdefs.h"
9845 #include <string.h>
9846 EOF
9847 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9848   egrep "memchr" >/dev/null 2>&1; then
9849   :
9850 else
9851   rm -rf conftest*
9852   ac_cv_header_stdc=no
9853 fi
9854 rm -f conftest*
9855
9856 fi
9857
9858 if test $ac_cv_header_stdc = yes; then
9859   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
9860 cat > conftest.$ac_ext <<EOF
9861 #line 9862 "configure"
9862 #include "confdefs.h"
9863 #include <stdlib.h>
9864 EOF
9865 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9866   egrep "free" >/dev/null 2>&1; then
9867   :
9868 else
9869   rm -rf conftest*
9870   ac_cv_header_stdc=no
9871 fi
9872 rm -f conftest*
9873
9874 fi
9875
9876 if test $ac_cv_header_stdc = yes; then
9877   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
9878 if test "$cross_compiling" = yes; then
9879   :
9880 else
9881   cat > conftest.$ac_ext <<EOF
9882 #line 9883 "configure"
9883 #include "confdefs.h"
9884 #include <ctype.h>
9885 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
9886 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
9887 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
9888 int main () { int i; for (i = 0; i < 256; i++)
9889 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
9890 exit (0); }
9891
9892 EOF
9893 if { (eval echo configure:9894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9894 then
9895   :
9896 else
9897   echo "configure: failed program was:" >&5
9898   cat conftest.$ac_ext >&5
9899   rm -fr conftest*
9900   ac_cv_header_stdc=no
9901 fi
9902 rm -fr conftest*
9903 fi
9904
9905 fi
9906 fi
9907
9908 echo "$ac_t""$ac_cv_header_stdc" 1>&6
9909 if test $ac_cv_header_stdc = yes; then
9910   cat >> confdefs.h <<\EOF
9911 #define STDC_HEADERS 1
9912 EOF
9913
9914 fi
9915
9916 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
9917 echo "configure:9918: checking for mode_t" >&5
9918 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
9919   echo $ac_n "(cached) $ac_c" 1>&6
9920 else
9921   cat > conftest.$ac_ext <<EOF
9922 #line 9923 "configure"
9923 #include "confdefs.h"
9924 #include <sys/types.h>
9925 #if STDC_HEADERS
9926 #include <stdlib.h>
9927 #include <stddef.h>
9928 #endif
9929 EOF
9930 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9931   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
9932   rm -rf conftest*
9933   ac_cv_type_mode_t=yes
9934 else
9935   rm -rf conftest*
9936   ac_cv_type_mode_t=no
9937 fi
9938 rm -f conftest*
9939
9940 fi
9941 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
9942 if test $ac_cv_type_mode_t = no; then
9943   cat >> confdefs.h <<\EOF
9944 #define mode_t int
9945 EOF
9946
9947 fi
9948
9949 echo $ac_n "checking for off_t""... $ac_c" 1>&6
9950 echo "configure:9951: checking for off_t" >&5
9951 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
9952   echo $ac_n "(cached) $ac_c" 1>&6
9953 else
9954   cat > conftest.$ac_ext <<EOF
9955 #line 9956 "configure"
9956 #include "confdefs.h"
9957 #include <sys/types.h>
9958 #if STDC_HEADERS
9959 #include <stdlib.h>
9960 #include <stddef.h>
9961 #endif
9962 EOF
9963 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9964   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
9965   rm -rf conftest*
9966   ac_cv_type_off_t=yes
9967 else
9968   rm -rf conftest*
9969   ac_cv_type_off_t=no
9970 fi
9971 rm -f conftest*
9972
9973 fi
9974 echo "$ac_t""$ac_cv_type_off_t" 1>&6
9975 if test $ac_cv_type_off_t = no; then
9976   cat >> confdefs.h <<\EOF
9977 #define off_t long
9978 EOF
9979
9980 fi
9981
9982 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
9983 echo "configure:9984: checking for pid_t" >&5
9984 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
9985   echo $ac_n "(cached) $ac_c" 1>&6
9986 else
9987   cat > conftest.$ac_ext <<EOF
9988 #line 9989 "configure"
9989 #include "confdefs.h"
9990 #include <sys/types.h>
9991 #if STDC_HEADERS
9992 #include <stdlib.h>
9993 #include <stddef.h>
9994 #endif
9995 EOF
9996 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9997   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
9998   rm -rf conftest*
9999   ac_cv_type_pid_t=yes
10000 else
10001   rm -rf conftest*
10002   ac_cv_type_pid_t=no
10003 fi
10004 rm -f conftest*
10005
10006 fi
10007 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
10008 if test $ac_cv_type_pid_t = no; then
10009   cat >> confdefs.h <<\EOF
10010 #define pid_t int
10011 EOF
10012
10013 fi
10014
10015 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
10016 echo "configure:10017: checking for ptrdiff_t" >&5
10017 if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then
10018   echo $ac_n "(cached) $ac_c" 1>&6
10019 else
10020   cat > conftest.$ac_ext <<EOF
10021 #line 10022 "configure"
10022 #include "confdefs.h"
10023 #include <stddef.h>
10024 int main() {
10025 ptrdiff_t p
10026 ; return 0; }
10027 EOF
10028 if { (eval echo configure:10029: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10029   rm -rf conftest*
10030   am_cv_type_ptrdiff_t=yes
10031 else
10032   echo "configure: failed program was:" >&5
10033   cat conftest.$ac_ext >&5
10034   rm -rf conftest*
10035   am_cv_type_ptrdiff_t=no
10036 fi
10037 rm -f conftest*
10038 fi
10039
10040 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
10041    if test $am_cv_type_ptrdiff_t = yes; then
10042      cat >> confdefs.h <<\EOF
10043 #define HAVE_PTRDIFF_T 1
10044 EOF
10045
10046    fi
10047
10048 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
10049 echo "configure:10050: checking return type of signal handlers" >&5
10050 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
10051   echo $ac_n "(cached) $ac_c" 1>&6
10052 else
10053   cat > conftest.$ac_ext <<EOF
10054 #line 10055 "configure"
10055 #include "confdefs.h"
10056 #include <sys/types.h>
10057 #include <signal.h>
10058 #ifdef signal
10059 #undef signal
10060 #endif
10061 #ifdef __cplusplus
10062 extern "C" void (*signal (int, void (*)(int)))(int);
10063 #else
10064 void (*signal ()) ();
10065 #endif
10066
10067 int main() {
10068 int i;
10069 ; return 0; }
10070 EOF
10071 if { (eval echo configure:10072: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10072   rm -rf conftest*
10073   ac_cv_type_signal=void
10074 else
10075   echo "configure: failed program was:" >&5
10076   cat conftest.$ac_ext >&5
10077   rm -rf conftest*
10078   ac_cv_type_signal=int
10079 fi
10080 rm -f conftest*
10081 fi
10082
10083 echo "$ac_t""$ac_cv_type_signal" 1>&6
10084 cat >> confdefs.h <<EOF
10085 #define RETSIGTYPE $ac_cv_type_signal
10086 EOF
10087
10088
10089 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
10090 echo "configure:10091: checking for sig_atomic_t" >&5
10091 if eval "test \"`echo '$''{'ol_cv_type_sig_atomic_t'+set}'`\" = set"; then
10092   echo $ac_n "(cached) $ac_c" 1>&6
10093 else
10094   cat > conftest.$ac_ext <<EOF
10095 #line 10096 "configure"
10096 #include "confdefs.h"
10097 #include <signal.h>
10098 int main() {
10099 sig_atomic_t atomic;
10100 ; return 0; }
10101 EOF
10102 if { (eval echo configure:10103: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10103   rm -rf conftest*
10104   ol_cv_type_sig_atomic_t=yes
10105 else
10106   echo "configure: failed program was:" >&5
10107   cat conftest.$ac_ext >&5
10108   rm -rf conftest*
10109   ol_cv_type_sig_atomic_t=no
10110 fi
10111 rm -f conftest*
10112 fi
10113
10114 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
10115   if test $ol_cv_type_sig_atomic_t = no; then
10116     cat >> confdefs.h <<\EOF
10117 #define sig_atomic_t int
10118 EOF
10119
10120   fi
10121  
10122 echo $ac_n "checking for size_t""... $ac_c" 1>&6
10123 echo "configure:10124: checking for size_t" >&5
10124 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
10125   echo $ac_n "(cached) $ac_c" 1>&6
10126 else
10127   cat > conftest.$ac_ext <<EOF
10128 #line 10129 "configure"
10129 #include "confdefs.h"
10130 #include <sys/types.h>
10131 #if STDC_HEADERS
10132 #include <stdlib.h>
10133 #include <stddef.h>
10134 #endif
10135 EOF
10136 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10137   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10138   rm -rf conftest*
10139   ac_cv_type_size_t=yes
10140 else
10141   rm -rf conftest*
10142   ac_cv_type_size_t=no
10143 fi
10144 rm -f conftest*
10145
10146 fi
10147 echo "$ac_t""$ac_cv_type_size_t" 1>&6
10148 if test $ac_cv_type_size_t = no; then
10149   cat >> confdefs.h <<\EOF
10150 #define size_t unsigned
10151 EOF
10152
10153 fi
10154
10155 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
10156 echo "configure:10157: checking for st_blksize in struct stat" >&5
10157 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
10158   echo $ac_n "(cached) $ac_c" 1>&6
10159 else
10160   cat > conftest.$ac_ext <<EOF
10161 #line 10162 "configure"
10162 #include "confdefs.h"
10163 #include <sys/types.h>
10164 #include <sys/stat.h>
10165 int main() {
10166 struct stat s; s.st_blksize;
10167 ; return 0; }
10168 EOF
10169 if { (eval echo configure:10170: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10170   rm -rf conftest*
10171   ac_cv_struct_st_blksize=yes
10172 else
10173   echo "configure: failed program was:" >&5
10174   cat conftest.$ac_ext >&5
10175   rm -rf conftest*
10176   ac_cv_struct_st_blksize=no
10177 fi
10178 rm -f conftest*
10179 fi
10180
10181 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
10182 if test $ac_cv_struct_st_blksize = yes; then
10183   cat >> confdefs.h <<\EOF
10184 #define HAVE_ST_BLKSIZE 1
10185 EOF
10186
10187 fi
10188
10189 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
10190 echo "configure:10191: checking whether time.h and sys/time.h may both be included" >&5
10191 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
10192   echo $ac_n "(cached) $ac_c" 1>&6
10193 else
10194   cat > conftest.$ac_ext <<EOF
10195 #line 10196 "configure"
10196 #include "confdefs.h"
10197 #include <sys/types.h>
10198 #include <sys/time.h>
10199 #include <time.h>
10200 int main() {
10201 struct tm *tp;
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_header_time=yes
10207 else
10208   echo "configure: failed program was:" >&5
10209   cat conftest.$ac_ext >&5
10210   rm -rf conftest*
10211   ac_cv_header_time=no
10212 fi
10213 rm -f conftest*
10214 fi
10215
10216 echo "$ac_t""$ac_cv_header_time" 1>&6
10217 if test $ac_cv_header_time = yes; then
10218   cat >> confdefs.h <<\EOF
10219 #define TIME_WITH_SYS_TIME 1
10220 EOF
10221
10222 fi
10223
10224 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
10225 echo "configure:10226: checking whether struct tm is in sys/time.h or time.h" >&5
10226 if eval "test \"`echo '$''{'ac_cv_struct_tm'+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 <time.h>
10234 int main() {
10235 struct tm *tp; tp->tm_sec;
10236 ; return 0; }
10237 EOF
10238 if { (eval echo configure:10239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10239   rm -rf conftest*
10240   ac_cv_struct_tm=time.h
10241 else
10242   echo "configure: failed program was:" >&5
10243   cat conftest.$ac_ext >&5
10244   rm -rf conftest*
10245   ac_cv_struct_tm=sys/time.h
10246 fi
10247 rm -f conftest*
10248 fi
10249
10250 echo "$ac_t""$ac_cv_struct_tm" 1>&6
10251 if test $ac_cv_struct_tm = sys/time.h; then
10252   cat >> confdefs.h <<\EOF
10253 #define TM_IN_SYS_TIME 1
10254 EOF
10255
10256 fi
10257
10258 # test for pw_gecos in struct passwd
10259 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
10260 echo "configure:10261: checking struct passwd for pw_gecos" >&5
10261 if eval "test \"`echo '$''{'ol_cv_struct_passwd_pw_gecos'+set}'`\" = set"; then
10262   echo $ac_n "(cached) $ac_c" 1>&6
10263 else
10264   
10265         cat > conftest.$ac_ext <<EOF
10266 #line 10267 "configure"
10267 #include "confdefs.h"
10268 #include <pwd.h>
10269 int main() {
10270
10271         struct passwd pwd;
10272         pwd.pw_gecos = pwd.pw_name;
10273
10274 ; return 0; }
10275 EOF
10276 if { (eval echo configure:10277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10277   rm -rf conftest*
10278   ol_cv_struct_passwd_pw_gecos=yes
10279 else
10280   echo "configure: failed program was:" >&5
10281   cat conftest.$ac_ext >&5
10282   rm -rf conftest*
10283   ol_cv_struct_passwd_pw_gecos=no
10284 fi
10285 rm -f conftest*
10286 fi
10287
10288 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
10289 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
10290         cat >> confdefs.h <<\EOF
10291 #define HAVE_PW_GECOS 1
10292 EOF
10293
10294 fi
10295
10296
10297
10298 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
10299 echo "configure:10300: checking if toupper() requires islower()" >&5
10300 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
10301   echo $ac_n "(cached) $ac_c" 1>&6
10302 else
10303   
10304         if test "$cross_compiling" = yes; then
10305   ol_cv_c_upper_lower=safe
10306 else
10307   cat > conftest.$ac_ext <<EOF
10308 #line 10309 "configure"
10309 #include "confdefs.h"
10310
10311 #include <ctype.h>
10312 main()
10313 {
10314         if ('C' == toupper('C'))
10315                 exit(0);
10316         else
10317                 exit(1);
10318 }
10319 EOF
10320 if { (eval echo configure:10321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10321 then
10322   ol_cv_c_upper_lower=no
10323 else
10324   echo "configure: failed program was:" >&5
10325   cat conftest.$ac_ext >&5
10326   rm -fr conftest*
10327   ol_cv_c_upper_lower=yes
10328 fi
10329 rm -fr conftest*
10330 fi
10331
10332 fi
10333
10334 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
10335 if test $ol_cv_c_upper_lower != no ; then
10336         cat >> confdefs.h <<\EOF
10337 #define C_UPPER_LOWER 1
10338 EOF
10339
10340 fi
10341
10342 echo $ac_n "checking for working const""... $ac_c" 1>&6
10343 echo "configure:10344: checking for working const" >&5
10344 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
10345   echo $ac_n "(cached) $ac_c" 1>&6
10346 else
10347   cat > conftest.$ac_ext <<EOF
10348 #line 10349 "configure"
10349 #include "confdefs.h"
10350
10351 int main() {
10352
10353 /* Ultrix mips cc rejects this.  */
10354 typedef int charset[2]; const charset x;
10355 /* SunOS 4.1.1 cc rejects this.  */
10356 char const *const *ccp;
10357 char **p;
10358 /* NEC SVR4.0.2 mips cc rejects this.  */
10359 struct point {int x, y;};
10360 static struct point const zero = {0,0};
10361 /* AIX XL C 1.02.0.0 rejects this.
10362    It does not let you subtract one const X* pointer from another in an arm
10363    of an if-expression whose if-part is not a constant expression */
10364 const char *g = "string";
10365 ccp = &g + (g ? g-g : 0);
10366 /* HPUX 7.0 cc rejects these. */
10367 ++ccp;
10368 p = (char**) ccp;
10369 ccp = (char const *const *) p;
10370 { /* SCO 3.2v4 cc rejects this.  */
10371   char *t;
10372   char const *s = 0 ? (char *) 0 : (char const *) 0;
10373
10374   *t++ = 0;
10375 }
10376 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
10377   int x[] = {25, 17};
10378   const int *foo = &x[0];
10379   ++foo;
10380 }
10381 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
10382   typedef const int *iptr;
10383   iptr p = 0;
10384   ++p;
10385 }
10386 { /* AIX XL C 1.02.0.0 rejects this saying
10387      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
10388   struct s { int j; const int *ap[3]; };
10389   struct s *b; b->j = 5;
10390 }
10391 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
10392   const int foo = 10;
10393 }
10394
10395 ; return 0; }
10396 EOF
10397 if { (eval echo configure:10398: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10398   rm -rf conftest*
10399   ac_cv_c_const=yes
10400 else
10401   echo "configure: failed program was:" >&5
10402   cat conftest.$ac_ext >&5
10403   rm -rf conftest*
10404   ac_cv_c_const=no
10405 fi
10406 rm -f conftest*
10407 fi
10408
10409 echo "$ac_t""$ac_cv_c_const" 1>&6
10410 if test $ac_cv_c_const = no; then
10411   cat >> confdefs.h <<\EOF
10412 #define const 
10413 EOF
10414
10415 fi
10416
10417 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
10418 echo "configure:10419: checking if compiler understands volatile" >&5
10419 if eval "test \"`echo '$''{'ol_cv_c_volatile'+set}'`\" = set"; then
10420   echo $ac_n "(cached) $ac_c" 1>&6
10421 else
10422   cat > conftest.$ac_ext <<EOF
10423 #line 10424 "configure"
10424 #include "confdefs.h"
10425 int x, y, z;
10426 int main() {
10427 volatile int a; int * volatile b = x ? &y : &z;
10428       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
10429       *b = 0;
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   ol_cv_c_volatile=yes
10435 else
10436   echo "configure: failed program was:" >&5
10437   cat conftest.$ac_ext >&5
10438   rm -rf conftest*
10439   ol_cv_c_volatile=no
10440 fi
10441 rm -f conftest*
10442 fi
10443
10444 echo "$ac_t""$ol_cv_c_volatile" 1>&6
10445   if test $ol_cv_c_volatile = yes; then
10446     : 
10447   else
10448     cat >> confdefs.h <<\EOF
10449 #define volatile 
10450 EOF
10451
10452   fi
10453  
10454
10455 if test $cross_compiling = yes ; then
10456         cat >> confdefs.h <<\EOF
10457 #define CROSS_COMPILING 1
10458 EOF
10459
10460 else
10461         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
10462 echo "configure:10463: checking whether byte ordering is bigendian" >&5
10463 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
10464   echo $ac_n "(cached) $ac_c" 1>&6
10465 else
10466   ac_cv_c_bigendian=unknown
10467 # See if sys/param.h defines the BYTE_ORDER macro.
10468 cat > conftest.$ac_ext <<EOF
10469 #line 10470 "configure"
10470 #include "confdefs.h"
10471 #include <sys/types.h>
10472 #include <sys/param.h>
10473 int main() {
10474
10475 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
10476  bogus endian macros
10477 #endif
10478 ; return 0; }
10479 EOF
10480 if { (eval echo configure:10481: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10481   rm -rf conftest*
10482   # It does; now see whether it defined to BIG_ENDIAN or not.
10483 cat > conftest.$ac_ext <<EOF
10484 #line 10485 "configure"
10485 #include "confdefs.h"
10486 #include <sys/types.h>
10487 #include <sys/param.h>
10488 int main() {
10489
10490 #if BYTE_ORDER != BIG_ENDIAN
10491  not big endian
10492 #endif
10493 ; return 0; }
10494 EOF
10495 if { (eval echo configure:10496: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10496   rm -rf conftest*
10497   ac_cv_c_bigendian=yes
10498 else
10499   echo "configure: failed program was:" >&5
10500   cat conftest.$ac_ext >&5
10501   rm -rf conftest*
10502   ac_cv_c_bigendian=no
10503 fi
10504 rm -f conftest*
10505 else
10506   echo "configure: failed program was:" >&5
10507   cat conftest.$ac_ext >&5
10508 fi
10509 rm -f conftest*
10510 if test $ac_cv_c_bigendian = unknown; then
10511 if test "$cross_compiling" = yes; then
10512     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10513 else
10514   cat > conftest.$ac_ext <<EOF
10515 #line 10516 "configure"
10516 #include "confdefs.h"
10517 main () {
10518   /* Are we little or big endian?  From Harbison&Steele.  */
10519   union
10520   {
10521     long l;
10522     char c[sizeof (long)];
10523   } u;
10524   u.l = 1;
10525   exit (u.c[sizeof (long) - 1] == 1);
10526 }
10527 EOF
10528 if { (eval echo configure:10529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10529 then
10530   ac_cv_c_bigendian=no
10531 else
10532   echo "configure: failed program was:" >&5
10533   cat conftest.$ac_ext >&5
10534   rm -fr conftest*
10535   ac_cv_c_bigendian=yes
10536 fi
10537 rm -fr conftest*
10538 fi
10539
10540 fi
10541 fi
10542
10543 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
10544 if test $ac_cv_c_bigendian = yes; then
10545   cat >> confdefs.h <<\EOF
10546 #define WORDS_BIGENDIAN 1
10547 EOF
10548
10549 fi
10550
10551         echo $ac_n "checking size of short""... $ac_c" 1>&6
10552 echo "configure:10553: checking size of short" >&5
10553 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
10554   echo $ac_n "(cached) $ac_c" 1>&6
10555 else
10556   if test "$cross_compiling" = yes; then
10557     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10558 else
10559   cat > conftest.$ac_ext <<EOF
10560 #line 10561 "configure"
10561 #include "confdefs.h"
10562 #include <stdio.h>
10563 main()
10564 {
10565   FILE *f=fopen("conftestval", "w");
10566   if (!f) exit(1);
10567   fprintf(f, "%d\n", sizeof(short));
10568   exit(0);
10569 }
10570 EOF
10571 if { (eval echo configure:10572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10572 then
10573   ac_cv_sizeof_short=`cat conftestval`
10574 else
10575   echo "configure: failed program was:" >&5
10576   cat conftest.$ac_ext >&5
10577   rm -fr conftest*
10578   ac_cv_sizeof_short=0
10579 fi
10580 rm -fr conftest*
10581 fi
10582
10583 fi
10584 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
10585 cat >> confdefs.h <<EOF
10586 #define SIZEOF_SHORT $ac_cv_sizeof_short
10587 EOF
10588
10589  
10590         echo $ac_n "checking size of int""... $ac_c" 1>&6
10591 echo "configure:10592: checking size of int" >&5
10592 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
10593   echo $ac_n "(cached) $ac_c" 1>&6
10594 else
10595   if test "$cross_compiling" = yes; then
10596     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10597 else
10598   cat > conftest.$ac_ext <<EOF
10599 #line 10600 "configure"
10600 #include "confdefs.h"
10601 #include <stdio.h>
10602 main()
10603 {
10604   FILE *f=fopen("conftestval", "w");
10605   if (!f) exit(1);
10606   fprintf(f, "%d\n", sizeof(int));
10607   exit(0);
10608 }
10609 EOF
10610 if { (eval echo configure:10611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10611 then
10612   ac_cv_sizeof_int=`cat conftestval`
10613 else
10614   echo "configure: failed program was:" >&5
10615   cat conftest.$ac_ext >&5
10616   rm -fr conftest*
10617   ac_cv_sizeof_int=0
10618 fi
10619 rm -fr conftest*
10620 fi
10621
10622 fi
10623 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
10624 cat >> confdefs.h <<EOF
10625 #define SIZEOF_INT $ac_cv_sizeof_int
10626 EOF
10627
10628  
10629         echo $ac_n "checking size of long""... $ac_c" 1>&6
10630 echo "configure:10631: checking size of long" >&5
10631 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
10632   echo $ac_n "(cached) $ac_c" 1>&6
10633 else
10634   if test "$cross_compiling" = yes; then
10635     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10636 else
10637   cat > conftest.$ac_ext <<EOF
10638 #line 10639 "configure"
10639 #include "confdefs.h"
10640 #include <stdio.h>
10641 main()
10642 {
10643   FILE *f=fopen("conftestval", "w");
10644   if (!f) exit(1);
10645   fprintf(f, "%d\n", sizeof(long));
10646   exit(0);
10647 }
10648 EOF
10649 if { (eval echo configure:10650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10650 then
10651   ac_cv_sizeof_long=`cat conftestval`
10652 else
10653   echo "configure: failed program was:" >&5
10654   cat conftest.$ac_ext >&5
10655   rm -fr conftest*
10656   ac_cv_sizeof_long=0
10657 fi
10658 rm -fr conftest*
10659 fi
10660
10661 fi
10662 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
10663 cat >> confdefs.h <<EOF
10664 #define SIZEOF_LONG $ac_cv_sizeof_long
10665 EOF
10666
10667
10668 fi
10669
10670 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
10671 echo "configure:10672: checking for 8-bit clean memcmp" >&5
10672 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
10673   echo $ac_n "(cached) $ac_c" 1>&6
10674 else
10675   if test "$cross_compiling" = yes; then
10676   ac_cv_func_memcmp_clean=no
10677 else
10678   cat > conftest.$ac_ext <<EOF
10679 #line 10680 "configure"
10680 #include "confdefs.h"
10681
10682 main()
10683 {
10684   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
10685   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
10686 }
10687
10688 EOF
10689 if { (eval echo configure:10690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10690 then
10691   ac_cv_func_memcmp_clean=yes
10692 else
10693   echo "configure: failed program was:" >&5
10694   cat conftest.$ac_ext >&5
10695   rm -fr conftest*
10696   ac_cv_func_memcmp_clean=no
10697 fi
10698 rm -fr conftest*
10699 fi
10700
10701 fi
10702
10703 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
10704 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
10705
10706 echo $ac_n "checking for strftime""... $ac_c" 1>&6
10707 echo "configure:10708: checking for strftime" >&5
10708 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
10709   echo $ac_n "(cached) $ac_c" 1>&6
10710 else
10711   cat > conftest.$ac_ext <<EOF
10712 #line 10713 "configure"
10713 #include "confdefs.h"
10714 /* System header to define __stub macros and hopefully few prototypes,
10715     which can conflict with char strftime(); below.  */
10716 #include <assert.h>
10717 /* Override any gcc2 internal prototype to avoid an error.  */
10718 /* We use char because int might match the return type of a gcc2
10719     builtin and then its argument prototype would still apply.  */
10720 char strftime();
10721
10722 int main() {
10723
10724 /* The GNU C library defines this for functions which it implements
10725     to always fail with ENOSYS.  Some functions are actually named
10726     something starting with __ and the normal name is an alias.  */
10727 #if defined (__stub_strftime) || defined (__stub___strftime)
10728 choke me
10729 #else
10730 strftime();
10731 #endif
10732
10733 ; return 0; }
10734 EOF
10735 if { (eval echo configure:10736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10736   rm -rf conftest*
10737   eval "ac_cv_func_strftime=yes"
10738 else
10739   echo "configure: failed program was:" >&5
10740   cat conftest.$ac_ext >&5
10741   rm -rf conftest*
10742   eval "ac_cv_func_strftime=no"
10743 fi
10744 rm -f conftest*
10745 fi
10746
10747 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
10748   echo "$ac_t""yes" 1>&6
10749   cat >> confdefs.h <<\EOF
10750 #define HAVE_STRFTIME 1
10751 EOF
10752
10753 else
10754   echo "$ac_t""no" 1>&6
10755 # strftime is in -lintl on SCO UNIX.
10756 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
10757 echo "configure:10758: checking for strftime in -lintl" >&5
10758 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
10759 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
10760   echo $ac_n "(cached) $ac_c" 1>&6
10761 else
10762   ac_save_LIBS="$LIBS"
10763 LIBS="-lintl  $LIBS"
10764 cat > conftest.$ac_ext <<EOF
10765 #line 10766 "configure"
10766 #include "confdefs.h"
10767 /* Override any gcc2 internal prototype to avoid an error.  */
10768 /* We use char because int might match the return type of a gcc2
10769     builtin and then its argument prototype would still apply.  */
10770 char strftime();
10771
10772 int main() {
10773 strftime()
10774 ; return 0; }
10775 EOF
10776 if { (eval echo configure:10777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10777   rm -rf conftest*
10778   eval "ac_cv_lib_$ac_lib_var=yes"
10779 else
10780   echo "configure: failed program was:" >&5
10781   cat conftest.$ac_ext >&5
10782   rm -rf conftest*
10783   eval "ac_cv_lib_$ac_lib_var=no"
10784 fi
10785 rm -f conftest*
10786 LIBS="$ac_save_LIBS"
10787
10788 fi
10789 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10790   echo "$ac_t""yes" 1>&6
10791   cat >> confdefs.h <<\EOF
10792 #define HAVE_STRFTIME 1
10793 EOF
10794
10795 LIBS="-lintl $LIBS"
10796 else
10797   echo "$ac_t""no" 1>&6
10798 fi
10799
10800 fi
10801
10802
10803 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
10804 echo "configure:10805: checking for vprintf" >&5
10805 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
10806   echo $ac_n "(cached) $ac_c" 1>&6
10807 else
10808   cat > conftest.$ac_ext <<EOF
10809 #line 10810 "configure"
10810 #include "confdefs.h"
10811 /* System header to define __stub macros and hopefully few prototypes,
10812     which can conflict with char vprintf(); below.  */
10813 #include <assert.h>
10814 /* Override any gcc2 internal prototype to avoid an error.  */
10815 /* We use char because int might match the return type of a gcc2
10816     builtin and then its argument prototype would still apply.  */
10817 char vprintf();
10818
10819 int main() {
10820
10821 /* The GNU C library defines this for functions which it implements
10822     to always fail with ENOSYS.  Some functions are actually named
10823     something starting with __ and the normal name is an alias.  */
10824 #if defined (__stub_vprintf) || defined (__stub___vprintf)
10825 choke me
10826 #else
10827 vprintf();
10828 #endif
10829
10830 ; return 0; }
10831 EOF
10832 if { (eval echo configure:10833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10833   rm -rf conftest*
10834   eval "ac_cv_func_vprintf=yes"
10835 else
10836   echo "configure: failed program was:" >&5
10837   cat conftest.$ac_ext >&5
10838   rm -rf conftest*
10839   eval "ac_cv_func_vprintf=no"
10840 fi
10841 rm -f conftest*
10842 fi
10843
10844 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
10845   echo "$ac_t""yes" 1>&6
10846   cat >> confdefs.h <<\EOF
10847 #define HAVE_VPRINTF 1
10848 EOF
10849
10850 else
10851   echo "$ac_t""no" 1>&6
10852 fi
10853
10854 if test "$ac_cv_func_vprintf" != yes; then
10855 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
10856 echo "configure:10857: checking for _doprnt" >&5
10857 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
10858   echo $ac_n "(cached) $ac_c" 1>&6
10859 else
10860   cat > conftest.$ac_ext <<EOF
10861 #line 10862 "configure"
10862 #include "confdefs.h"
10863 /* System header to define __stub macros and hopefully few prototypes,
10864     which can conflict with char _doprnt(); below.  */
10865 #include <assert.h>
10866 /* Override any gcc2 internal prototype to avoid an error.  */
10867 /* We use char because int might match the return type of a gcc2
10868     builtin and then its argument prototype would still apply.  */
10869 char _doprnt();
10870
10871 int main() {
10872
10873 /* The GNU C library defines this for functions which it implements
10874     to always fail with ENOSYS.  Some functions are actually named
10875     something starting with __ and the normal name is an alias.  */
10876 #if defined (__stub__doprnt) || defined (__stub____doprnt)
10877 choke me
10878 #else
10879 _doprnt();
10880 #endif
10881
10882 ; return 0; }
10883 EOF
10884 if { (eval echo configure:10885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10885   rm -rf conftest*
10886   eval "ac_cv_func__doprnt=yes"
10887 else
10888   echo "configure: failed program was:" >&5
10889   cat conftest.$ac_ext >&5
10890   rm -rf conftest*
10891   eval "ac_cv_func__doprnt=no"
10892 fi
10893 rm -f conftest*
10894 fi
10895
10896 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
10897   echo "$ac_t""yes" 1>&6
10898   cat >> confdefs.h <<\EOF
10899 #define HAVE_DOPRNT 1
10900 EOF
10901
10902 else
10903   echo "$ac_t""no" 1>&6
10904 fi
10905
10906 fi
10907
10908
10909 if test $ac_cv_func_vprintf = yes ; then
10910                 for ac_func in vsnprintf vsprintf
10911 do
10912 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10913 echo "configure:10914: checking for $ac_func" >&5
10914 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
10915   echo $ac_n "(cached) $ac_c" 1>&6
10916 else
10917   cat > conftest.$ac_ext <<EOF
10918 #line 10919 "configure"
10919 #include "confdefs.h"
10920 /* System header to define __stub macros and hopefully few prototypes,
10921     which can conflict with char $ac_func(); below.  */
10922 #include <assert.h>
10923 /* Override any gcc2 internal prototype to avoid an error.  */
10924 /* We use char because int might match the return type of a gcc2
10925     builtin and then its argument prototype would still apply.  */
10926 char $ac_func();
10927
10928 int main() {
10929
10930 /* The GNU C library defines this for functions which it implements
10931     to always fail with ENOSYS.  Some functions are actually named
10932     something starting with __ and the normal name is an alias.  */
10933 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10934 choke me
10935 #else
10936 $ac_func();
10937 #endif
10938
10939 ; return 0; }
10940 EOF
10941 if { (eval echo configure:10942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10942   rm -rf conftest*
10943   eval "ac_cv_func_$ac_func=yes"
10944 else
10945   echo "configure: failed program was:" >&5
10946   cat conftest.$ac_ext >&5
10947   rm -rf conftest*
10948   eval "ac_cv_func_$ac_func=no"
10949 fi
10950 rm -f conftest*
10951 fi
10952
10953 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10954   echo "$ac_t""yes" 1>&6
10955     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10956   cat >> confdefs.h <<EOF
10957 #define $ac_tr_func 1
10958 EOF
10959  
10960 else
10961   echo "$ac_t""no" 1>&6
10962 fi
10963 done
10964
10965 fi
10966
10967 for ac_func in \
10968         bcopy                   \
10969         endgrent                \
10970         endpwent                \
10971         flock                   \
10972         getdtablesize   \
10973         getgrgid                \
10974         gethostname             \
10975         getpass                 \
10976         getpwuid                \
10977         gettimeofday    \
10978         initgroups              \
10979         lockf                   \
10980         memcpy                  \
10981         memmove                 \
10982         mkstemp                 \
10983         recv                    \
10984         recvfrom                \
10985         setpwfile               \
10986         setgid                  \
10987         setegid                 \
10988         setsid                  \
10989         setuid                  \
10990         seteuid                 \
10991         signal                  \
10992         sigset                  \
10993         snprintf                \
10994         strdup                  \
10995         strerror                \
10996         strpbrk                 \
10997         strrchr                 \
10998         strsep                  \
10999         strstr                  \
11000         strtol                  \
11001         strtoul                 \
11002         strspn                  \
11003         sysconf                 \
11004         waitpid                 \
11005         wait4                   \
11006
11007 do
11008 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11009 echo "configure:11010: checking for $ac_func" >&5
11010 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11011   echo $ac_n "(cached) $ac_c" 1>&6
11012 else
11013   cat > conftest.$ac_ext <<EOF
11014 #line 11015 "configure"
11015 #include "confdefs.h"
11016 /* System header to define __stub macros and hopefully few prototypes,
11017     which can conflict with char $ac_func(); below.  */
11018 #include <assert.h>
11019 /* Override any gcc2 internal prototype to avoid an error.  */
11020 /* We use char because int might match the return type of a gcc2
11021     builtin and then its argument prototype would still apply.  */
11022 char $ac_func();
11023
11024 int main() {
11025
11026 /* The GNU C library defines this for functions which it implements
11027     to always fail with ENOSYS.  Some functions are actually named
11028     something starting with __ and the normal name is an alias.  */
11029 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11030 choke me
11031 #else
11032 $ac_func();
11033 #endif
11034
11035 ; return 0; }
11036 EOF
11037 if { (eval echo configure:11038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11038   rm -rf conftest*
11039   eval "ac_cv_func_$ac_func=yes"
11040 else
11041   echo "configure: failed program was:" >&5
11042   cat conftest.$ac_ext >&5
11043   rm -rf conftest*
11044   eval "ac_cv_func_$ac_func=no"
11045 fi
11046 rm -f conftest*
11047 fi
11048
11049 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11050   echo "$ac_t""yes" 1>&6
11051     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11052   cat >> confdefs.h <<EOF
11053 #define $ac_tr_func 1
11054 EOF
11055  
11056 else
11057   echo "$ac_t""no" 1>&6
11058 fi
11059 done
11060
11061
11062 for ac_func in getopt tempnam
11063 do
11064 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11065 echo "configure:11066: checking for $ac_func" >&5
11066 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11067   echo $ac_n "(cached) $ac_c" 1>&6
11068 else
11069   cat > conftest.$ac_ext <<EOF
11070 #line 11071 "configure"
11071 #include "confdefs.h"
11072 /* System header to define __stub macros and hopefully few prototypes,
11073     which can conflict with char $ac_func(); below.  */
11074 #include <assert.h>
11075 /* Override any gcc2 internal prototype to avoid an error.  */
11076 /* We use char because int might match the return type of a gcc2
11077     builtin and then its argument prototype would still apply.  */
11078 char $ac_func();
11079
11080 int main() {
11081
11082 /* The GNU C library defines this for functions which it implements
11083     to always fail with ENOSYS.  Some functions are actually named
11084     something starting with __ and the normal name is an alias.  */
11085 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11086 choke me
11087 #else
11088 $ac_func();
11089 #endif
11090
11091 ; return 0; }
11092 EOF
11093 if { (eval echo configure:11094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11094   rm -rf conftest*
11095   eval "ac_cv_func_$ac_func=yes"
11096 else
11097   echo "configure: failed program was:" >&5
11098   cat conftest.$ac_ext >&5
11099   rm -rf conftest*
11100   eval "ac_cv_func_$ac_func=no"
11101 fi
11102 rm -f conftest*
11103 fi
11104
11105 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11106   echo "$ac_t""yes" 1>&6
11107     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11108   cat >> confdefs.h <<EOF
11109 #define $ac_tr_func 1
11110 EOF
11111  
11112 else
11113   echo "$ac_t""no" 1>&6
11114 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
11115 fi
11116 done
11117
11118
11119
11120 # Check Configuration
11121
11122 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
11123 echo "configure:11124: checking declaration of sys_errlist" >&5
11124 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
11125   echo $ac_n "(cached) $ac_c" 1>&6
11126 else
11127   
11128         cat > conftest.$ac_ext <<EOF
11129 #line 11130 "configure"
11130 #include "confdefs.h"
11131
11132 #include <stdio.h>
11133 #include <sys/types.h>
11134 #include <errno.h> 
11135 int main() {
11136 char *c = (char *) *sys_errlist
11137 ; return 0; }
11138 EOF
11139 if { (eval echo configure:11140: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11140   rm -rf conftest*
11141   ol_cv_dcl_sys_errlist=yes
11142 else
11143   echo "configure: failed program was:" >&5
11144   cat conftest.$ac_ext >&5
11145   rm -rf conftest*
11146   ol_cv_dcl_sys_errlist=no
11147 fi
11148 rm -f conftest*
11149 fi
11150
11151 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
11152 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
11153 if test $ol_cv_dcl_sys_errlist = no ; then
11154         cat >> confdefs.h <<\EOF
11155 #define DECL_SYS_ERRLIST 1
11156 EOF
11157
11158         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
11159 echo "configure:11160: checking existence of sys_errlist" >&5
11160         if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
11161   echo $ac_n "(cached) $ac_c" 1>&6
11162 else
11163   
11164                 cat > conftest.$ac_ext <<EOF
11165 #line 11166 "configure"
11166 #include "confdefs.h"
11167 #include <errno.h>
11168 int main() {
11169 char *c = (char *) *sys_errlist
11170 ; return 0; }
11171 EOF
11172 if { (eval echo configure:11173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11173   rm -rf conftest*
11174   ol_cv_have_sys_errlist=yes
11175 else
11176   echo "configure: failed program was:" >&5
11177   cat conftest.$ac_ext >&5
11178   rm -rf conftest*
11179   ol_cv_have_sys_errlist=no
11180 fi
11181 rm -f conftest*
11182 fi
11183
11184         echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
11185         if test $ol_cv_have_sys_errlist = yes ; then
11186                 cat >> confdefs.h <<\EOF
11187 #define HAVE_SYS_ERRLIST 1
11188 EOF
11189
11190         fi
11191 fi
11192
11193
11194
11195 if test "$ol_enable_debug" != no ; then
11196         cat >> confdefs.h <<\EOF
11197 #define LDAP_DEBUG 1
11198 EOF
11199
11200 fi
11201 if test "$ol_enable_syslog" = yes ; then
11202         cat >> confdefs.h <<\EOF
11203 #define LDAP_SYSLOG 1
11204 EOF
11205
11206 fi
11207 if test "$ol_enable_libui" = yes ; then
11208         cat >> confdefs.h <<\EOF
11209 #define LDAP_LIBUI 1
11210 EOF
11211
11212 fi
11213 if test "$ol_enable_cache" = no ; then
11214         cat >> confdefs.h <<\EOF
11215 #define LDAP_NOCACHE 1
11216 EOF
11217
11218 fi
11219 if test "$ol_enable_dns" != no ; then
11220         cat >> confdefs.h <<\EOF
11221 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS LDAP_VENDOR_VERSION
11222 EOF
11223
11224 fi
11225 if test "$ol_enable_proctitle" != no ; then
11226         cat >> confdefs.h <<\EOF
11227 #define LDAP_PROCTITLE 1
11228 EOF
11229
11230 fi
11231 if test "$ol_enable_referrals" != no ; then
11232         cat >> confdefs.h <<\EOF
11233 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
11234 EOF
11235
11236 fi
11237 if test "$ol_enable_cldap" != no ; then
11238         cat >> confdefs.h <<\EOF
11239 #define LDAP_CONNECTIONLESS 1
11240 EOF
11241
11242 fi
11243
11244 if test "$ol_enable_aclgroups" != no ; then
11245         cat >> confdefs.h <<\EOF
11246 #define SLAPD_ACLGROUPS 1
11247 EOF
11248
11249 fi
11250 if test "$ol_enable_crypt" != no ; then
11251         cat >> confdefs.h <<\EOF
11252 #define SLAPD_CRYPT 1
11253 EOF
11254
11255 fi
11256 if test "$ol_enable_cleartext" != no ; then
11257         cat >> confdefs.h <<\EOF
11258 #define SLAPD_CLEARTEXT 1
11259 EOF
11260
11261 fi
11262 if test "$ol_enable_phonetic" != no ; then
11263         cat >> confdefs.h <<\EOF
11264 #define SLAPD_PHONETIC 1
11265 EOF
11266
11267 fi
11268 if test "$ol_enable_rlookups" != no ; then
11269         cat >> confdefs.h <<\EOF
11270 #define SLAPD_RLOOKUPS 1
11271 EOF
11272
11273 fi
11274
11275 if test "$ol_link_modules" != no ; then
11276         cat >> confdefs.h <<\EOF
11277 #define SLAPD_MODULES 1
11278 EOF
11279
11280         BUILD_SLAPD=yes
11281 fi
11282
11283 if test "$ol_link_bdb2" != no ; then
11284         cat >> confdefs.h <<\EOF
11285 #define SLAPD_BDB2 1
11286 EOF
11287
11288         BUILD_SLAPD=yes
11289         BUILD_BDB2=yes
11290 fi
11291
11292 if test "$ol_link_ldap" != no ; then
11293         cat >> confdefs.h <<\EOF
11294 #define SLAPD_LDAP 1
11295 EOF
11296
11297         BUILD_SLAPD=yes
11298         BUILD_LDAP=yes
11299 fi
11300
11301 if test "$ol_link_ldbm" != no ; then
11302         cat >> confdefs.h <<\EOF
11303 #define SLAPD_LDBM 1
11304 EOF
11305
11306         BUILD_SLAPD=yes
11307         BUILD_LDBM=yes
11308 fi
11309
11310 if test "$ol_enable_passwd" != no ; then
11311         cat >> confdefs.h <<\EOF
11312 #define SLAPD_PASSWD 1
11313 EOF
11314
11315         BUILD_SLAPD=yes
11316         BUILD_PASSWD=yes
11317 fi
11318
11319 if test "$ol_link_perl" != no ; then
11320         cat >> confdefs.h <<\EOF
11321 #define SLAPD_PERL 1
11322 EOF
11323
11324         BUILD_SLAPD=yes
11325         BUILD_PERL=yes
11326 fi
11327
11328 if test "$ol_enable_shell" != no ; then
11329         cat >> confdefs.h <<\EOF
11330 #define SLAPD_SHELL 1
11331 EOF
11332
11333         BUILD_SLAPD=yes
11334         BUILD_SHELL=yes
11335 fi
11336
11337 if test "$ol_enable_tcl" != no ; then
11338         cat >> confdefs.h <<\EOF
11339 #define SLAPD_TCL 1
11340 EOF
11341
11342         BUILD_SLAPD=yes
11343         BUILD_TCL=yes
11344 fi
11345
11346 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
11347         $BUILD_SLAPD = yes ; then
11348         BUILD_SLURPD=yes
11349 fi
11350
11351 if test "$ol_link_isode" != no ; then
11352         BUILD_LDAPD=yes
11353 fi
11354
11355
11356
11357
11358   
11359   
11360   
11361   
11362   
11363   
11364   
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387 trap '' 1 2 15
11388
11389 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
11390
11391 test "x$prefix" = xNONE && prefix=$ac_default_prefix
11392 # Let make expand exec_prefix.
11393 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
11394
11395 # Any assignment to VPATH causes Sun make to only execute
11396 # the first set of double-colon rules, so remove it if not needed.
11397 # If there is a colon in the path, we need to keep it.
11398 if test "x$srcdir" = x.; then
11399   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
11400 fi
11401
11402 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
11403
11404 DEFS=-DHAVE_CONFIG_H
11405
11406 # Without the "./", some shells look in PATH for config.status.
11407 : ${CONFIG_STATUS=./config.status}
11408
11409 echo creating $CONFIG_STATUS
11410 rm -f $CONFIG_STATUS
11411 cat > $CONFIG_STATUS <<EOF
11412 #! /bin/sh
11413 # Generated automatically by configure.
11414 # Run this file to recreate the current configuration.
11415 # This directory was configured as follows,
11416 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
11417 #
11418 # $0 $ac_configure_args
11419 #
11420 # Compiler output produced by configure, useful for debugging
11421 # configure, is in ./config.log if it exists.
11422
11423 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
11424 for ac_option
11425 do
11426   case "\$ac_option" in
11427   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
11428     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
11429     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
11430   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
11431     echo "$CONFIG_STATUS generated by autoconf version 2.13"
11432     exit 0 ;;
11433   -help | --help | --hel | --he | --h)
11434     echo "\$ac_cs_usage"; exit 0 ;;
11435   *) echo "\$ac_cs_usage"; exit 1 ;;
11436   esac
11437 done
11438
11439 ac_given_srcdir=$srcdir
11440 ac_given_INSTALL="$INSTALL"
11441
11442 trap 'rm -fr `echo "\
11443 Makefile:build/top.mk:Makefile.in:build/dir.mk \
11444 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
11445 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
11446 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
11447 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
11448 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
11449 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
11450 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
11451 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
11452 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
11453 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
11454 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
11455 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
11456 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
11457 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
11458 include/Makefile:build/top.mk:include/Makefile.in \
11459 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
11460 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
11461 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11462 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11463 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
11464 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
11465 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
11466 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
11467 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
11468 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
11469 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
11470 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
11471 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \
11472 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
11473 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
11474 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
11475 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
11476 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
11477 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
11478 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
11479 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
11480 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
11481 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
11482 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
11483 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
11484 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
11485  include/portable.h include/ldap_features.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
11486 EOF
11487 cat >> $CONFIG_STATUS <<EOF
11488
11489 # Protect against being on the right side of a sed subst in config.status.
11490 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
11491  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
11492 $ac_vpsub
11493 $extrasub
11494 s%@SHELL@%$SHELL%g
11495 s%@CFLAGS@%$CFLAGS%g
11496 s%@CPPFLAGS@%$CPPFLAGS%g
11497 s%@CXXFLAGS@%$CXXFLAGS%g
11498 s%@FFLAGS@%$FFLAGS%g
11499 s%@DEFS@%$DEFS%g
11500 s%@LDFLAGS@%$LDFLAGS%g
11501 s%@LIBS@%$LIBS%g
11502 s%@exec_prefix@%$exec_prefix%g
11503 s%@prefix@%$prefix%g
11504 s%@program_transform_name@%$program_transform_name%g
11505 s%@bindir@%$bindir%g
11506 s%@sbindir@%$sbindir%g
11507 s%@libexecdir@%$libexecdir%g
11508 s%@datadir@%$datadir%g
11509 s%@sysconfdir@%$sysconfdir%g
11510 s%@sharedstatedir@%$sharedstatedir%g
11511 s%@localstatedir@%$localstatedir%g
11512 s%@libdir@%$libdir%g
11513 s%@includedir@%$includedir%g
11514 s%@oldincludedir@%$oldincludedir%g
11515 s%@infodir@%$infodir%g
11516 s%@mandir@%$mandir%g
11517 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
11518 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
11519 s%@INSTALL_DATA@%$INSTALL_DATA%g
11520 s%@PACKAGE@%$PACKAGE%g
11521 s%@VERSION@%$VERSION%g
11522 s%@ACLOCAL@%$ACLOCAL%g
11523 s%@AUTOCONF@%$AUTOCONF%g
11524 s%@AUTOMAKE@%$AUTOMAKE%g
11525 s%@AUTOHEADER@%$AUTOHEADER%g
11526 s%@MAKEINFO@%$MAKEINFO%g
11527 s%@SET_MAKE@%$SET_MAKE%g
11528 s%@top_builddir@%$top_builddir%g
11529 s%@ldap_subdir@%$ldap_subdir%g
11530 s%@host@%$host%g
11531 s%@host_alias@%$host_alias%g
11532 s%@host_cpu@%$host_cpu%g
11533 s%@host_vendor@%$host_vendor%g
11534 s%@host_os@%$host_os%g
11535 s%@RANLIB@%$RANLIB%g
11536 s%@CC@%$CC%g
11537 s%@LD@%$LD%g
11538 s%@NM@%$NM%g
11539 s%@LN_S@%$LN_S%g
11540 s%@LIBTOOL@%$LIBTOOL%g
11541 s%@AWK@%$AWK%g
11542 s%@LN_H@%$LN_H%g
11543 s%@SENDMAIL@%$SENDMAIL%g
11544 s%@EDITOR@%$EDITOR%g
11545 s%@FINGER@%$FINGER%g
11546 s%@GLIBCONFIG@%$GLIBCONFIG%g
11547 s%@PERLBIN@%$PERLBIN%g
11548 s%@CPP@%$CPP%g
11549 s%@EXEEXT@%$EXEEXT%g
11550 s%@OBJEXT@%$OBJEXT%g
11551 s%@PEPSY@%$PEPSY%g
11552 s%@LIBOBJS@%$LIBOBJS%g
11553 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
11554 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
11555 s%@BUILD_BDB2@%$BUILD_BDB2%g
11556 s%@BUILD_LDAP@%$BUILD_LDAP%g
11557 s%@BUILD_LDBM@%$BUILD_LDBM%g
11558 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
11559 s%@BUILD_PERL@%$BUILD_PERL%g
11560 s%@BUILD_SHELL@%$BUILD_SHELL%g
11561 s%@BUILD_TCL@%$BUILD_TCL%g
11562 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
11563 s%@LDAP_LIBS@%$LDAP_LIBS%g
11564 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
11565 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
11566 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
11567 s%@LDBM_LIBS@%$LDBM_LIBS%g
11568 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
11569 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
11570 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
11571 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
11572 s%@SLAPD_PERL_CPPFLAGS@%$SLAPD_PERL_CPPFLAGS%g
11573 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
11574 s%@KRB_LIBS@%$KRB_LIBS%g
11575 s%@READLINE_LIBS@%$READLINE_LIBS%g
11576 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
11577 s%@TLS_LIBS@%$TLS_LIBS%g
11578
11579 CEOF
11580 EOF
11581
11582 cat >> $CONFIG_STATUS <<\EOF
11583
11584 # Split the substitutions into bite-sized pieces for seds with
11585 # small command number limits, like on Digital OSF/1 and HP-UX.
11586 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
11587 ac_file=1 # Number of current file.
11588 ac_beg=1 # First line for current file.
11589 ac_end=$ac_max_sed_cmds # Line after last line for current file.
11590 ac_more_lines=:
11591 ac_sed_cmds=""
11592 while $ac_more_lines; do
11593   if test $ac_beg -gt 1; then
11594     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
11595   else
11596     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
11597   fi
11598   if test ! -s conftest.s$ac_file; then
11599     ac_more_lines=false
11600     rm -f conftest.s$ac_file
11601   else
11602     if test -z "$ac_sed_cmds"; then
11603       ac_sed_cmds="sed -f conftest.s$ac_file"
11604     else
11605       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
11606     fi
11607     ac_file=`expr $ac_file + 1`
11608     ac_beg=$ac_end
11609     ac_end=`expr $ac_end + $ac_max_sed_cmds`
11610   fi
11611 done
11612 if test -z "$ac_sed_cmds"; then
11613   ac_sed_cmds=cat
11614 fi
11615 EOF
11616
11617 cat >> $CONFIG_STATUS <<EOF
11618
11619 CONFIG_FILES=\${CONFIG_FILES-"\
11620 Makefile:build/top.mk:Makefile.in:build/dir.mk \
11621 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
11622 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
11623 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
11624 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
11625 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
11626 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
11627 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
11628 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
11629 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
11630 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
11631 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
11632 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
11633 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
11634 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
11635 include/Makefile:build/top.mk:include/Makefile.in \
11636 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
11637 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
11638 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11639 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11640 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
11641 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
11642 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
11643 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
11644 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
11645 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
11646 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
11647 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
11648 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \
11649 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
11650 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
11651 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
11652 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
11653 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
11654 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
11655 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
11656 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
11657 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
11658 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
11659 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
11660 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
11661 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
11662 "}
11663 EOF
11664 cat >> $CONFIG_STATUS <<\EOF
11665 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
11666   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
11667   case "$ac_file" in
11668   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
11669        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
11670   *) ac_file_in="${ac_file}.in" ;;
11671   esac
11672
11673   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
11674
11675   # Remove last slash and all that follows it.  Not all systems have dirname.
11676   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
11677   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
11678     # The file is in a subdirectory.
11679     test ! -d "$ac_dir" && mkdir "$ac_dir"
11680     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
11681     # A "../" for each directory in $ac_dir_suffix.
11682     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
11683   else
11684     ac_dir_suffix= ac_dots=
11685   fi
11686
11687   case "$ac_given_srcdir" in
11688   .)  srcdir=.
11689       if test -z "$ac_dots"; then top_srcdir=.
11690       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
11691   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
11692   *) # Relative path.
11693     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
11694     top_srcdir="$ac_dots$ac_given_srcdir" ;;
11695   esac
11696
11697   case "$ac_given_INSTALL" in
11698   [/$]*) INSTALL="$ac_given_INSTALL" ;;
11699   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
11700   esac
11701
11702   echo creating "$ac_file"
11703   rm -f "$ac_file"
11704   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
11705   case "$ac_file" in
11706   *Makefile*) ac_comsub="1i\\
11707 # $configure_input" ;;
11708   *) ac_comsub= ;;
11709   esac
11710
11711   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
11712   sed -e "$ac_comsub
11713 s%@configure_input@%$configure_input%g
11714 s%@srcdir@%$srcdir%g
11715 s%@top_srcdir@%$top_srcdir%g
11716 s%@INSTALL@%$INSTALL%g
11717 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
11718 fi; done
11719 rm -f conftest.s*
11720
11721 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
11722 # NAME is the cpp macro being defined and VALUE is the value it is being given.
11723 #
11724 # ac_d sets the value in "#define NAME VALUE" lines.
11725 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
11726 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
11727 ac_dC='\3'
11728 ac_dD='%g'
11729 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
11730 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
11731 ac_uB='\([      ]\)%\1#\2define\3'
11732 ac_uC=' '
11733 ac_uD='\4%g'
11734 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
11735 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
11736 ac_eB='$%\1#\2define\3'
11737 ac_eC=' '
11738 ac_eD='%g'
11739
11740 if test "${CONFIG_HEADERS+set}" != set; then
11741 EOF
11742 cat >> $CONFIG_STATUS <<EOF
11743   CONFIG_HEADERS="include/portable.h include/ldap_features.h"
11744 EOF
11745 cat >> $CONFIG_STATUS <<\EOF
11746 fi
11747 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
11748   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
11749   case "$ac_file" in
11750   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
11751        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
11752   *) ac_file_in="${ac_file}.in" ;;
11753   esac
11754
11755   echo creating $ac_file
11756
11757   rm -f conftest.frag conftest.in conftest.out
11758   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
11759   cat $ac_file_inputs > conftest.in
11760
11761 EOF
11762
11763 # Transform confdefs.h into a sed script conftest.vals that substitutes
11764 # the proper values into config.h.in to produce config.h.  And first:
11765 # Protect against being on the right side of a sed subst in config.status.
11766 # Protect against being in an unquoted here document in config.status.
11767 rm -f conftest.vals
11768 cat > conftest.hdr <<\EOF
11769 s/[\\&%]/\\&/g
11770 s%[\\$`]%\\&%g
11771 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
11772 s%ac_d%ac_u%gp
11773 s%ac_u%ac_e%gp
11774 EOF
11775 sed -n -f conftest.hdr confdefs.h > conftest.vals
11776 rm -f conftest.hdr
11777
11778 # This sed command replaces #undef with comments.  This is necessary, for
11779 # example, in the case of _POSIX_SOURCE, which is predefined and required
11780 # on some systems where configure will not decide to define it.
11781 cat >> conftest.vals <<\EOF
11782 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
11783 EOF
11784
11785 # Break up conftest.vals because some shells have a limit on
11786 # the size of here documents, and old seds have small limits too.
11787
11788 rm -f conftest.tail
11789 while :
11790 do
11791   ac_lines=`grep -c . conftest.vals`
11792   # grep -c gives empty output for an empty file on some AIX systems.
11793   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
11794   # Write a limited-size here document to conftest.frag.
11795   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
11796   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
11797   echo 'CEOF
11798   sed -f conftest.frag conftest.in > conftest.out
11799   rm -f conftest.in
11800   mv conftest.out conftest.in
11801 ' >> $CONFIG_STATUS
11802   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
11803   rm -f conftest.vals
11804   mv conftest.tail conftest.vals
11805 done
11806 rm -f conftest.vals
11807
11808 cat >> $CONFIG_STATUS <<\EOF
11809   rm -f conftest.frag conftest.h
11810   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
11811   cat conftest.in >> conftest.h
11812   rm -f conftest.in
11813   if cmp -s $ac_file conftest.h 2>/dev/null; then
11814     echo "$ac_file is unchanged"
11815     rm -f conftest.h
11816   else
11817     # Remove last slash and all that follows it.  Not all systems have dirname.
11818       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
11819       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
11820       # The file is in a subdirectory.
11821       test ! -d "$ac_dir" && mkdir "$ac_dir"
11822     fi
11823     rm -f $ac_file
11824     mv conftest.h $ac_file
11825   fi
11826 fi; done
11827
11828 EOF
11829 cat >> $CONFIG_STATUS <<EOF
11830
11831 EOF
11832 cat >> $CONFIG_STATUS <<\EOF
11833
11834 date > stamp-h
11835 echo Please \"make depend\" to build dependencies
11836
11837 exit 0
11838 EOF
11839 chmod +x $CONFIG_STATUS
11840 rm -fr confdefs* $ac_clean_files
11841 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
11842