]> git.sur5r.net Git - openldap/blob - configure
96e7e028fdc25f59ef77a1ab758901e1d68ea1d4
[openldap] / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13 
5 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
6 #
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Defaults:
11 ac_help=
12 ac_default_prefix=/usr/local
13 # Any additions from configure.in:
14 ac_default_prefix=/usr/local
15 ac_help="$ac_help
16   --with-subdir=DIR change default subdirectory used for installs"
17 ac_help="$ac_help
18   --enable-debug        enable debugging (yes)"
19 ac_help="$ac_help
20   --enable-syslog       enable syslog support (auto)"
21 ac_help="$ac_help
22   --enable-proctitle    enable proctitle support (yes)"
23 ac_help="$ac_help
24   --enable-cache        enable caching (yes)"
25 ac_help="$ac_help
26   --enable-dns          enable V2 DNS  extension (no)"
27 ac_help="$ac_help
28   --enable-referrals    enable V2 Referrals extension (yes)"
29 ac_help="$ac_help
30   --enable-cldap        enable connectionless ldap (no)"
31 ac_help="$ac_help
32   --enable-x-compile    enable cross compiling (no)"
33 ac_help="$ac_help
34   --enable-dmalloc      enable debug malloc support (no)"
35 ac_help="$ac_help
36   --with-kerberos       with Kerberos support (auto)"
37 ac_help="$ac_help
38   --with-readline  with readline support (auto)"
39 ac_help="$ac_help
40   --with-threads        use threads (auto)"
41 ac_help="$ac_help
42   --with-tls  with TLS/SSL support (auto)"
43 ac_help="$ac_help
44   --with-yielding-select        with implicitly yielding select (auto)"
45 ac_help="$ac_help
46 LDAPD Options:"
47 ac_help="$ac_help
48   --enable-ldapd        enable building ldapd (no)"
49 ac_help="$ac_help
50 SLAPD Options:"
51 ac_help="$ac_help
52   --enable-slapd        enable building slapd (yes)"
53 ac_help="$ac_help
54     --enable-aclgroups  enable ACL group support (auto)"
55 ac_help="$ac_help
56     --enable-cleartext  enable cleartext passwords (yes)"
57 ac_help="$ac_help
58     --enable-crypt      enable crypt(3) passwords (auto)"
59 ac_help="$ac_help
60     --enable-modules    enable dynamic module support (no)"
61 ac_help="$ac_help
62     --enable-phonetic   enable phonetic/soundex (no)"
63 ac_help="$ac_help
64     --enable-rlookups   enable reverse lookups (auto)"
65 ac_help="$ac_help
66     --enable-wrappers   enable tcp wrapper support (no)"
67 ac_help="$ac_help
68     --enable-bdb2       enable bdb2 backend (no)"
69 ac_help="$ac_help
70     --enable-ldap       enable ldap backend (no)"
71 ac_help="$ac_help
72     --enable-ldbm       enable ldbm backend (yes)"
73 ac_help="$ac_help
74       --with-ldbm-api   use LDBM API (auto)"
75 ac_help="$ac_help
76       --with-ldbm-type  use LDBM type (auto)"
77 ac_help="$ac_help
78     --enable-passwd     enable passwd backend (no)"
79 ac_help="$ac_help
80     --enable-perl       enable perl backend (no)"
81 ac_help="$ac_help
82     --enable-shell      enable shell backend (no)"
83 ac_help="$ac_help
84     --enable-tcl        enable tcl backend (no)"
85 ac_help="$ac_help
86 SLURPD Options:"
87 ac_help="$ac_help
88   --enable-slurpd       enable building slurpd (auto)"
89 ac_help="$ac_help
90 Library Generation & Linking Options"
91 ac_help="$ac_help
92   --enable-static         build static libraries [default=yes]
93   --enable-static=PKGS    only build shared libraries if the current package
94                           appears as an element in the PKGS list"
95 ac_help="$ac_help
96   --enable-shared         build shared libraries [default=yes]
97   --enable-shared=PKGS    only build shared libraries if the current package
98                           appears as an element in the PKGS list"
99 ac_help="$ac_help
100   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
101
102 # Initialize some variables set by options.
103 # The variables have the same names as the options, with
104 # dashes changed to underlines.
105 build=NONE
106 cache_file=./config.cache
107 exec_prefix=NONE
108 host=NONE
109 no_create=
110 nonopt=NONE
111 no_recursion=
112 prefix=NONE
113 program_prefix=NONE
114 program_suffix=NONE
115 program_transform_name=s,x,x,
116 silent=
117 site=
118 srcdir=
119 target=NONE
120 verbose=
121 x_includes=NONE
122 x_libraries=NONE
123 bindir='${exec_prefix}/bin'
124 sbindir='${exec_prefix}/sbin'
125 libexecdir='${exec_prefix}/libexec'
126 datadir='${prefix}/share'
127 sysconfdir='${prefix}/etc'
128 sharedstatedir='${prefix}/com'
129 localstatedir='${prefix}/var'
130 libdir='${exec_prefix}/lib'
131 includedir='${prefix}/include'
132 oldincludedir='/usr/include'
133 infodir='${prefix}/info'
134 mandir='${prefix}/man'
135
136 # Initialize some other variables.
137 subdirs=
138 MFLAGS= MAKEFLAGS=
139 SHELL=${CONFIG_SHELL-/bin/sh}
140 # Maximum number of lines to put in a shell here document.
141 ac_max_here_lines=12
142
143 ac_prev=
144 for ac_option
145 do
146
147   # If the previous option needs an argument, assign it.
148   if test -n "$ac_prev"; then
149     eval "$ac_prev=\$ac_option"
150     ac_prev=
151     continue
152   fi
153
154   case "$ac_option" in
155   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
156   *) ac_optarg= ;;
157   esac
158
159   # Accept the important Cygnus configure options, so we can diagnose typos.
160
161   case "$ac_option" in
162
163   -bindir | --bindir | --bindi | --bind | --bin | --bi)
164     ac_prev=bindir ;;
165   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
166     bindir="$ac_optarg" ;;
167
168   -build | --build | --buil | --bui | --bu)
169     ac_prev=build ;;
170   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
171     build="$ac_optarg" ;;
172
173   -cache-file | --cache-file | --cache-fil | --cache-fi \
174   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
175     ac_prev=cache_file ;;
176   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
177   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
178     cache_file="$ac_optarg" ;;
179
180   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
181     ac_prev=datadir ;;
182   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
183   | --da=*)
184     datadir="$ac_optarg" ;;
185
186   -disable-* | --disable-*)
187     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
188     # Reject names that are not valid shell variable names.
189     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
190       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
191     fi
192     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
193     eval "enable_${ac_feature}=no" ;;
194
195   -enable-* | --enable-*)
196     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
197     # Reject names that are not valid shell variable names.
198     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
199       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
200     fi
201     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
202     case "$ac_option" in
203       *=*) ;;
204       *) ac_optarg=yes ;;
205     esac
206     eval "enable_${ac_feature}='$ac_optarg'" ;;
207
208   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
209   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
210   | --exec | --exe | --ex)
211     ac_prev=exec_prefix ;;
212   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
213   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
214   | --exec=* | --exe=* | --ex=*)
215     exec_prefix="$ac_optarg" ;;
216
217   -gas | --gas | --ga | --g)
218     # Obsolete; use --with-gas.
219     with_gas=yes ;;
220
221   -help | --help | --hel | --he)
222     # Omit some internal or obsolete options to make the list less imposing.
223     # This message is too long to be a string in the A/UX 3.1 sh.
224     cat << EOF
225 Usage: configure [options] [host]
226 Options: [defaults in brackets after descriptions]
227 Configuration:
228   --cache-file=FILE       cache test results in FILE
229   --help                  print this message
230   --no-create             do not create output files
231   --quiet, --silent       do not print \`checking...' messages
232   --version               print the version of autoconf that created configure
233 Directory and file names:
234   --prefix=PREFIX         install architecture-independent files in PREFIX
235                           [$ac_default_prefix]
236   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
237                           [same as prefix]
238   --bindir=DIR            user executables in DIR [EPREFIX/bin]
239   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
240   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
241   --datadir=DIR           read-only architecture-independent data in DIR
242                           [PREFIX/share]
243   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
244   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
245                           [PREFIX/com]
246   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
247   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
248   --includedir=DIR        C header files in DIR [PREFIX/include]
249   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
250   --infodir=DIR           info documentation in DIR [PREFIX/info]
251   --mandir=DIR            man documentation in DIR [PREFIX/man]
252   --srcdir=DIR            find the sources in DIR [configure dir or ..]
253   --program-prefix=PREFIX prepend PREFIX to installed program names
254   --program-suffix=SUFFIX append SUFFIX to installed program names
255   --program-transform-name=PROGRAM
256                           run sed PROGRAM on installed program names
257 EOF
258     cat << EOF
259 Host type:
260   --build=BUILD           configure for building on BUILD [BUILD=HOST]
261   --host=HOST             configure for HOST [guessed]
262   --target=TARGET         configure for TARGET [TARGET=HOST]
263 Features and packages:
264   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
265   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
266   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
267   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
268   --x-includes=DIR        X include files are in DIR
269   --x-libraries=DIR       X library files are in DIR
270 EOF
271     if test -n "$ac_help"; then
272       echo "--enable and --with options recognized:$ac_help"
273     fi
274     exit 0 ;;
275
276   -host | --host | --hos | --ho)
277     ac_prev=host ;;
278   -host=* | --host=* | --hos=* | --ho=*)
279     host="$ac_optarg" ;;
280
281   -includedir | --includedir | --includedi | --included | --include \
282   | --includ | --inclu | --incl | --inc)
283     ac_prev=includedir ;;
284   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
285   | --includ=* | --inclu=* | --incl=* | --inc=*)
286     includedir="$ac_optarg" ;;
287
288   -infodir | --infodir | --infodi | --infod | --info | --inf)
289     ac_prev=infodir ;;
290   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
291     infodir="$ac_optarg" ;;
292
293   -libdir | --libdir | --libdi | --libd)
294     ac_prev=libdir ;;
295   -libdir=* | --libdir=* | --libdi=* | --libd=*)
296     libdir="$ac_optarg" ;;
297
298   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
299   | --libexe | --libex | --libe)
300     ac_prev=libexecdir ;;
301   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
302   | --libexe=* | --libex=* | --libe=*)
303     libexecdir="$ac_optarg" ;;
304
305   -localstatedir | --localstatedir | --localstatedi | --localstated \
306   | --localstate | --localstat | --localsta | --localst \
307   | --locals | --local | --loca | --loc | --lo)
308     ac_prev=localstatedir ;;
309   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
310   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
311   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
312     localstatedir="$ac_optarg" ;;
313
314   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
315     ac_prev=mandir ;;
316   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
317     mandir="$ac_optarg" ;;
318
319   -nfp | --nfp | --nf)
320     # Obsolete; use --without-fp.
321     with_fp=no ;;
322
323   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
324   | --no-cr | --no-c)
325     no_create=yes ;;
326
327   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
328   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
329     no_recursion=yes ;;
330
331   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
332   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
333   | --oldin | --oldi | --old | --ol | --o)
334     ac_prev=oldincludedir ;;
335   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
336   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
337   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
338     oldincludedir="$ac_optarg" ;;
339
340   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
341     ac_prev=prefix ;;
342   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
343     prefix="$ac_optarg" ;;
344
345   -program-prefix | --program-prefix | --program-prefi | --program-pref \
346   | --program-pre | --program-pr | --program-p)
347     ac_prev=program_prefix ;;
348   -program-prefix=* | --program-prefix=* | --program-prefi=* \
349   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
350     program_prefix="$ac_optarg" ;;
351
352   -program-suffix | --program-suffix | --program-suffi | --program-suff \
353   | --program-suf | --program-su | --program-s)
354     ac_prev=program_suffix ;;
355   -program-suffix=* | --program-suffix=* | --program-suffi=* \
356   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
357     program_suffix="$ac_optarg" ;;
358
359   -program-transform-name | --program-transform-name \
360   | --program-transform-nam | --program-transform-na \
361   | --program-transform-n | --program-transform- \
362   | --program-transform | --program-transfor \
363   | --program-transfo | --program-transf \
364   | --program-trans | --program-tran \
365   | --progr-tra | --program-tr | --program-t)
366     ac_prev=program_transform_name ;;
367   -program-transform-name=* | --program-transform-name=* \
368   | --program-transform-nam=* | --program-transform-na=* \
369   | --program-transform-n=* | --program-transform-=* \
370   | --program-transform=* | --program-transfor=* \
371   | --program-transfo=* | --program-transf=* \
372   | --program-trans=* | --program-tran=* \
373   | --progr-tra=* | --program-tr=* | --program-t=*)
374     program_transform_name="$ac_optarg" ;;
375
376   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
377   | -silent | --silent | --silen | --sile | --sil)
378     silent=yes ;;
379
380   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
381     ac_prev=sbindir ;;
382   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
383   | --sbi=* | --sb=*)
384     sbindir="$ac_optarg" ;;
385
386   -sharedstatedir | --sharedstatedir | --sharedstatedi \
387   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
388   | --sharedst | --shareds | --shared | --share | --shar \
389   | --sha | --sh)
390     ac_prev=sharedstatedir ;;
391   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
392   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
393   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
394   | --sha=* | --sh=*)
395     sharedstatedir="$ac_optarg" ;;
396
397   -site | --site | --sit)
398     ac_prev=site ;;
399   -site=* | --site=* | --sit=*)
400     site="$ac_optarg" ;;
401
402   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
403     ac_prev=srcdir ;;
404   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
405     srcdir="$ac_optarg" ;;
406
407   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
408   | --syscon | --sysco | --sysc | --sys | --sy)
409     ac_prev=sysconfdir ;;
410   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
411   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
412     sysconfdir="$ac_optarg" ;;
413
414   -target | --target | --targe | --targ | --tar | --ta | --t)
415     ac_prev=target ;;
416   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
417     target="$ac_optarg" ;;
418
419   -v | -verbose | --verbose | --verbos | --verbo | --verb)
420     verbose=yes ;;
421
422   -version | --version | --versio | --versi | --vers)
423     echo "configure generated by autoconf version 2.13"
424     exit 0 ;;
425
426   -with-* | --with-*)
427     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
428     # Reject names that are not valid shell variable names.
429     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
430       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
431     fi
432     ac_package=`echo $ac_package| sed 's/-/_/g'`
433     case "$ac_option" in
434       *=*) ;;
435       *) ac_optarg=yes ;;
436     esac
437     eval "with_${ac_package}='$ac_optarg'" ;;
438
439   -without-* | --without-*)
440     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
441     # Reject names that are not valid shell variable names.
442     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
443       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
444     fi
445     ac_package=`echo $ac_package| sed 's/-/_/g'`
446     eval "with_${ac_package}=no" ;;
447
448   --x)
449     # Obsolete; use --with-x.
450     with_x=yes ;;
451
452   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
453   | --x-incl | --x-inc | --x-in | --x-i)
454     ac_prev=x_includes ;;
455   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
456   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
457     x_includes="$ac_optarg" ;;
458
459   -x-libraries | --x-libraries | --x-librarie | --x-librari \
460   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
461     ac_prev=x_libraries ;;
462   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
463   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
464     x_libraries="$ac_optarg" ;;
465
466   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
467     ;;
468
469   *)
470     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
471       echo "configure: warning: $ac_option: invalid host type" 1>&2
472     fi
473     if test "x$nonopt" != xNONE; then
474       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
475     fi
476     nonopt="$ac_option"
477     ;;
478
479   esac
480 done
481
482 if test -n "$ac_prev"; then
483   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
484 fi
485
486 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
487
488 # File descriptor usage:
489 # 0 standard input
490 # 1 file creation
491 # 2 errors and warnings
492 # 3 some systems may open it to /dev/tty
493 # 4 used on the Kubota Titan
494 # 6 checking for... messages and results
495 # 5 compiler messages saved in config.log
496 if test "$silent" = yes; then
497   exec 6>/dev/null
498 else
499   exec 6>&1
500 fi
501 exec 5>./config.log
502
503 echo "\
504 This file contains any messages produced by compilers while
505 running configure, to aid debugging if configure makes a mistake.
506 " 1>&5
507
508 # Strip out --no-create and --no-recursion so they do not pile up.
509 # Also quote any args containing shell metacharacters.
510 ac_configure_args=
511 for ac_arg
512 do
513   case "$ac_arg" in
514   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
515   | --no-cr | --no-c) ;;
516   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
517   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
518   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
519   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
520   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
521   esac
522 done
523
524 # NLS nuisances.
525 # Only set these to C if already set.  These must not be set unconditionally
526 # because not all systems understand e.g. LANG=C (notably SCO).
527 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
528 # Non-C LC_CTYPE values break the ctype check.
529 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
530 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
531 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
532 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
533
534 # confdefs.h avoids OS command line length limits that DEFS can exceed.
535 rm -rf conftest* confdefs.h
536 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
537 echo > confdefs.h
538
539 # A filename unique to this package, relative to the directory that
540 # configure is in, which we can look for to find out if srcdir is correct.
541 ac_unique_file=build/version
542
543 # Find the source files, if location was not specified.
544 if test -z "$srcdir"; then
545   ac_srcdir_defaulted=yes
546   # Try the directory containing this script, then its parent.
547   ac_prog=$0
548   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
549   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
550   srcdir=$ac_confdir
551   if test ! -r $srcdir/$ac_unique_file; then
552     srcdir=..
553   fi
554 else
555   ac_srcdir_defaulted=no
556 fi
557 if test ! -r $srcdir/$ac_unique_file; then
558   if test "$ac_srcdir_defaulted" = yes; then
559     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
560   else
561     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
562   fi
563 fi
564 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
565
566 # Prefer explicitly selected file to automatically selected ones.
567 if test -z "$CONFIG_SITE"; then
568   if test "x$prefix" != xNONE; then
569     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
570   else
571     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
572   fi
573 fi
574 for ac_site_file in $CONFIG_SITE; do
575   if test -r "$ac_site_file"; then
576     echo "loading site script $ac_site_file"
577     . "$ac_site_file"
578   fi
579 done
580
581
582 ac_ext=c
583 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
584 ac_cpp='$CPP $CPPFLAGS'
585 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
586 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
587 cross_compiling=$ac_cv_prog_cc_cross
588
589 ac_exeext=
590 ac_objext=o
591 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
592   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
593   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
594     ac_n= ac_c='
595 ' ac_t='        '
596   else
597     ac_n=-n ac_c= ac_t=
598   fi
599 else
600   ac_n= ac_c='\c' ac_t=
601 fi
602
603 ac_aux_dir=
604 for ac_dir in build $srcdir/build; do
605   if test -f $ac_dir/install-sh; then
606     ac_aux_dir=$ac_dir
607     ac_install_sh="$ac_aux_dir/install-sh -c"
608     break
609   elif test -f $ac_dir/install.sh; then
610     ac_aux_dir=$ac_dir
611     ac_install_sh="$ac_aux_dir/install.sh -c"
612     break
613   fi
614 done
615 if test -z "$ac_aux_dir"; then
616   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
617 fi
618 ac_config_guess=$ac_aux_dir/config.guess
619 ac_config_sub=$ac_aux_dir/config.sub
620 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
621
622 OL_VERSION=`cat $ac_aux_dir/version`
623 if test -z "$OL_VERSION"; then
624         { echo "configure: error: could not determine version" 1>&2; exit 1; }
625 fi
626
627 # Find a good install program.  We prefer a C program (faster),
628 # so one script is as good as another.  But avoid the broken or
629 # incompatible versions:
630 # SysV /etc/install, /usr/sbin/install
631 # SunOS /usr/etc/install
632 # IRIX /sbin/install
633 # AIX /bin/install
634 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
635 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
636 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
637 # ./install, which can be erroneously created by make from ./install.sh.
638 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
639 echo "configure:640: checking for a BSD compatible install" >&5
640 if test -z "$INSTALL"; then
641 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
642   echo $ac_n "(cached) $ac_c" 1>&6
643 else
644     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
645   for ac_dir in $PATH; do
646     # Account for people who put trailing slashes in PATH elements.
647     case "$ac_dir/" in
648     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
649     *)
650       # OSF1 and SCO ODT 3.0 have their own names for install.
651       # Don't use installbsd from OSF since it installs stuff as root
652       # by default.
653       for ac_prog in ginstall scoinst install; do
654         if test -f $ac_dir/$ac_prog; then
655           if test $ac_prog = install &&
656             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
657             # AIX install.  It has an incompatible calling convention.
658             :
659           else
660             ac_cv_path_install="$ac_dir/$ac_prog -c"
661             break 2
662           fi
663         fi
664       done
665       ;;
666     esac
667   done
668   IFS="$ac_save_IFS"
669
670 fi
671   if test "${ac_cv_path_install+set}" = set; then
672     INSTALL="$ac_cv_path_install"
673   else
674     # As a last resort, use the slow shell script.  We don't cache a
675     # path for INSTALL within a source directory, because that will
676     # break other packages using the cache if that directory is
677     # removed, or if the path is relative.
678     INSTALL="$ac_install_sh"
679   fi
680 fi
681 echo "$ac_t""$INSTALL" 1>&6
682
683 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
684 # It thinks the first close brace ends the variable substitution.
685 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
686
687 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
688
689 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
690
691 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
692 echo "configure:693: checking whether build environment is sane" >&5
693 # Just in case
694 sleep 1
695 echo timestamp > conftestfile
696 # Do `set' in a subshell so we don't clobber the current shell's
697 # arguments.  Must try -L first in case configure is actually a
698 # symlink; some systems play weird games with the mod time of symlinks
699 # (eg FreeBSD returns the mod time of the symlink's containing
700 # directory).
701 if (
702    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
703    if test "$*" = "X"; then
704       # -L didn't work.
705       set X `ls -t $srcdir/configure conftestfile`
706    fi
707    if test "$*" != "X $srcdir/configure conftestfile" \
708       && test "$*" != "X conftestfile $srcdir/configure"; then
709
710       # If neither matched, then we have a broken ls.  This can happen
711       # if, for instance, CONFIG_SHELL is bash and it inherits a
712       # broken ls alias from the environment.  This has actually
713       # happened.  Such a system could not be considered "sane".
714       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
715 alias in your environment" 1>&2; exit 1; }
716    fi
717
718    test "$2" = conftestfile
719    )
720 then
721    # Ok.
722    :
723 else
724    { echo "configure: error: newly created file is older than distributed files!
725 Check your system clock" 1>&2; exit 1; }
726 fi
727 rm -f conftest*
728 echo "$ac_t""yes" 1>&6
729 if test "$program_transform_name" = s,x,x,; then
730   program_transform_name=
731 else
732   # Double any \ or $.  echo might interpret backslashes.
733   cat <<\EOF_SED > conftestsed
734 s,\\,\\\\,g; s,\$,$$,g
735 EOF_SED
736   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
737   rm -f conftestsed
738 fi
739 test "$program_prefix" != NONE &&
740   program_transform_name="s,^,${program_prefix},; $program_transform_name"
741 # Use a double $ so make ignores it.
742 test "$program_suffix" != NONE &&
743   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
744
745 # sed with no file args requires a program.
746 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
747
748 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
749 echo "configure:750: checking whether ${MAKE-make} sets \${MAKE}" >&5
750 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
751 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
752   echo $ac_n "(cached) $ac_c" 1>&6
753 else
754   cat > conftestmake <<\EOF
755 all:
756         @echo 'ac_maketemp="${MAKE}"'
757 EOF
758 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
759 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
760 if test -n "$ac_maketemp"; then
761   eval ac_cv_prog_make_${ac_make}_set=yes
762 else
763   eval ac_cv_prog_make_${ac_make}_set=no
764 fi
765 rm -f conftestmake
766 fi
767 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
768   echo "$ac_t""yes" 1>&6
769   SET_MAKE=
770 else
771   echo "$ac_t""no" 1>&6
772   SET_MAKE="MAKE=${MAKE-make}"
773 fi
774
775
776 PACKAGE=OpenLDAP
777
778 VERSION=$OL_VERSION
779
780 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
781   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
782 fi
783
784
785
786 missing_dir=`cd $ac_aux_dir && pwd`
787 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
788 echo "configure:789: checking for working aclocal" >&5
789 # Run test in a subshell; some versions of sh will print an error if
790 # an executable is not found, even if stderr is redirected.
791 # Redirect stdin to placate older versions of autoconf.  Sigh.
792 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
793    ACLOCAL=aclocal
794    echo "$ac_t""found" 1>&6
795 else
796    ACLOCAL="$missing_dir/missing aclocal"
797    echo "$ac_t""missing" 1>&6
798 fi
799
800 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
801 echo "configure:802: checking for working autoconf" >&5
802 # Run test in a subshell; some versions of sh will print an error if
803 # an executable is not found, even if stderr is redirected.
804 # Redirect stdin to placate older versions of autoconf.  Sigh.
805 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
806    AUTOCONF=autoconf
807    echo "$ac_t""found" 1>&6
808 else
809    AUTOCONF="$missing_dir/missing autoconf"
810    echo "$ac_t""missing" 1>&6
811 fi
812
813 echo $ac_n "checking for working automake""... $ac_c" 1>&6
814 echo "configure:815: checking for working automake" >&5
815 # Run test in a subshell; some versions of sh will print an error if
816 # an executable is not found, even if stderr is redirected.
817 # Redirect stdin to placate older versions of autoconf.  Sigh.
818 if (automake --version) < /dev/null > /dev/null 2>&1; then
819    AUTOMAKE=automake
820    echo "$ac_t""found" 1>&6
821 else
822    AUTOMAKE="$missing_dir/missing automake"
823    echo "$ac_t""missing" 1>&6
824 fi
825
826 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
827 echo "configure:828: checking for working autoheader" >&5
828 # Run test in a subshell; some versions of sh will print an error if
829 # an executable is not found, even if stderr is redirected.
830 # Redirect stdin to placate older versions of autoconf.  Sigh.
831 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
832    AUTOHEADER=autoheader
833    echo "$ac_t""found" 1>&6
834 else
835    AUTOHEADER="$missing_dir/missing autoheader"
836    echo "$ac_t""missing" 1>&6
837 fi
838
839 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
840 echo "configure:841: checking for working makeinfo" >&5
841 # Run test in a subshell; some versions of sh will print an error if
842 # an executable is not found, even if stderr is redirected.
843 # Redirect stdin to placate older versions of autoconf.  Sigh.
844 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
845    MAKEINFO=makeinfo
846    echo "$ac_t""found" 1>&6
847 else
848    MAKEINFO="$missing_dir/missing makeinfo"
849    echo "$ac_t""missing" 1>&6
850 fi
851
852
853
854 cat >> confdefs.h <<EOF
855 #define OPENLDAP_PACKAGE "$PACKAGE"
856 EOF
857
858 cat >> confdefs.h <<EOF
859 #define OPENLDAP_VERSION "$VERSION"
860 EOF
861
862
863
864
865 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
866 echo "configure:867: checking configure arguments" >&5
867
868
869 top_builddir=`pwd`
870
871 cat >> confdefs.h <<\EOF
872 #define HAVE_MKVERSION 1
873 EOF
874
875
876 ldap_subdir="openldap"
877
878 # Check whether --with-subdir or --without-subdir was given.
879 if test "${with_subdir+set}" = set; then
880   withval="$with_subdir"
881   
882         if test "$withval" = "no"; then
883                 ldap_subdir=""
884         elif test "$withval" != "yes"; then
885                 ldap_subdir="$withval"
886         fi
887
888 fi
889
890
891 # OpenLDAP --enable-debug
892         # Check whether --enable-debug or --disable-debug was given.
893 if test "${enable_debug+set}" = set; then
894   enableval="$enable_debug"
895   
896         ol_arg=invalid
897         for ol_val in auto yes no ; do
898                 if test "$enableval" = "$ol_val" ; then
899                         ol_arg="$ol_val"
900                 fi
901         done
902         if test "$ol_arg" = "invalid" ; then
903                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
904         fi
905         ol_enable_debug="$ol_arg"
906
907 else
908         ol_enable_debug="yes"
909 fi
910 # end --enable-debug
911 # OpenLDAP --enable-syslog
912         # Check whether --enable-syslog or --disable-syslog was given.
913 if test "${enable_syslog+set}" = set; then
914   enableval="$enable_syslog"
915   
916         ol_arg=invalid
917         for ol_val in auto yes no ; do
918                 if test "$enableval" = "$ol_val" ; then
919                         ol_arg="$ol_val"
920                 fi
921         done
922         if test "$ol_arg" = "invalid" ; then
923                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
924         fi
925         ol_enable_syslog="$ol_arg"
926
927 else
928         ol_enable_syslog="auto"
929 fi
930 # end --enable-syslog
931 # OpenLDAP --enable-proctitle
932         # Check whether --enable-proctitle or --disable-proctitle was given.
933 if test "${enable_proctitle+set}" = set; then
934   enableval="$enable_proctitle"
935   
936         ol_arg=invalid
937         for ol_val in auto yes no ; do
938                 if test "$enableval" = "$ol_val" ; then
939                         ol_arg="$ol_val"
940                 fi
941         done
942         if test "$ol_arg" = "invalid" ; then
943                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
944         fi
945         ol_enable_proctitle="$ol_arg"
946
947 else
948         ol_enable_proctitle="yes"
949 fi
950 # end --enable-proctitle
951 # OpenLDAP --enable-cache
952         # Check whether --enable-cache or --disable-cache was given.
953 if test "${enable_cache+set}" = set; then
954   enableval="$enable_cache"
955   
956         ol_arg=invalid
957         for ol_val in auto yes no ; do
958                 if test "$enableval" = "$ol_val" ; then
959                         ol_arg="$ol_val"
960                 fi
961         done
962         if test "$ol_arg" = "invalid" ; then
963                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
964         fi
965         ol_enable_cache="$ol_arg"
966
967 else
968         ol_enable_cache="yes"
969 fi
970 # end --enable-cache
971 # OpenLDAP --enable-dns
972         # Check whether --enable-dns or --disable-dns was given.
973 if test "${enable_dns+set}" = set; then
974   enableval="$enable_dns"
975   
976         ol_arg=invalid
977         for ol_val in auto yes no ; do
978                 if test "$enableval" = "$ol_val" ; then
979                         ol_arg="$ol_val"
980                 fi
981         done
982         if test "$ol_arg" = "invalid" ; then
983                 { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; }
984         fi
985         ol_enable_dns="$ol_arg"
986
987 else
988         ol_enable_dns="no"
989 fi
990 # end --enable-dns
991 # OpenLDAP --enable-referrals
992         # Check whether --enable-referrals or --disable-referrals was given.
993 if test "${enable_referrals+set}" = set; then
994   enableval="$enable_referrals"
995   
996         ol_arg=invalid
997         for ol_val in auto yes no ; do
998                 if test "$enableval" = "$ol_val" ; then
999                         ol_arg="$ol_val"
1000                 fi
1001         done
1002         if test "$ol_arg" = "invalid" ; then
1003                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1004         fi
1005         ol_enable_referrals="$ol_arg"
1006
1007 else
1008         ol_enable_referrals="yes"
1009 fi
1010 # end --enable-referrals
1011 # OpenLDAP --enable-cldap
1012         # Check whether --enable-cldap or --disable-cldap was given.
1013 if test "${enable_cldap+set}" = set; then
1014   enableval="$enable_cldap"
1015   
1016         ol_arg=invalid
1017         for ol_val in auto yes no ; do
1018                 if test "$enableval" = "$ol_val" ; then
1019                         ol_arg="$ol_val"
1020                 fi
1021         done
1022         if test "$ol_arg" = "invalid" ; then
1023                 { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; }
1024         fi
1025         ol_enable_cldap="$ol_arg"
1026
1027 else
1028         ol_enable_cldap="no"
1029 fi
1030 # end --enable-cldap
1031 # OpenLDAP --enable-x_compile
1032         # Check whether --enable-x_compile or --disable-x_compile was given.
1033 if test "${enable_x_compile+set}" = set; then
1034   enableval="$enable_x_compile"
1035   
1036         ol_arg=invalid
1037         for ol_val in yes no ; do
1038                 if test "$enableval" = "$ol_val" ; then
1039                         ol_arg="$ol_val"
1040                 fi
1041         done
1042         if test "$ol_arg" = "invalid" ; then
1043                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1044         fi
1045         ol_enable_x_compile="$ol_arg"
1046
1047 else
1048         ol_enable_x_compile="no"
1049 fi
1050 # end --enable-x_compile
1051
1052 # OpenLDAP --enable-dmalloc
1053         # Check whether --enable-dmalloc or --disable-dmalloc was given.
1054 if test "${enable_dmalloc+set}" = set; then
1055   enableval="$enable_dmalloc"
1056   
1057         ol_arg=invalid
1058         for ol_val in auto yes no ; do
1059                 if test "$enableval" = "$ol_val" ; then
1060                         ol_arg="$ol_val"
1061                 fi
1062         done
1063         if test "$ol_arg" = "invalid" ; then
1064                 { echo "configure: error: bad value $enableval for --enable-dmalloc" 1>&2; exit 1; }
1065         fi
1066         ol_enable_dmalloc="$ol_arg"
1067
1068 else
1069         ol_enable_dmalloc="no"
1070 fi
1071 # end --enable-dmalloc
1072
1073 # OpenLDAP --with-kerberos
1074         # Check whether --with-kerberos or --without-kerberos was given.
1075 if test "${with_kerberos+set}" = set; then
1076   withval="$with_kerberos"
1077   
1078         ol_arg=invalid
1079         for ol_val in auto k5 k4 afs yes no ; do
1080                 if test "$withval" = "$ol_val" ; then
1081                         ol_arg="$ol_val"
1082                 fi
1083         done
1084         if test "$ol_arg" = "invalid" ; then
1085                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1086         fi
1087         ol_with_kerberos="$ol_arg"
1088
1089 else
1090         ol_with_kerberos="auto"
1091 fi
1092 # end --with-kerberos
1093
1094 # OpenLDAP --with-readline
1095         # Check whether --with-readline or --without-readline was given.
1096 if test "${with_readline+set}" = set; then
1097   withval="$with_readline"
1098   
1099         ol_arg=invalid
1100         for ol_val in auto yes no  ; do
1101                 if test "$withval" = "$ol_val" ; then
1102                         ol_arg="$ol_val"
1103                 fi
1104         done
1105         if test "$ol_arg" = "invalid" ; then
1106                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1107         fi
1108         ol_with_readline="$ol_arg"
1109
1110 else
1111         ol_with_readline="auto"
1112 fi
1113 # end --with-readline
1114
1115 # OpenLDAP --with-threads
1116         # Check whether --with-threads or --without-threads was given.
1117 if test "${with_threads+set}" = set; then
1118   withval="$with_threads"
1119   
1120         ol_arg=invalid
1121         for ol_val in auto posix mach lwp yes no manual  ; do
1122                 if test "$withval" = "$ol_val" ; then
1123                         ol_arg="$ol_val"
1124                 fi
1125         done
1126         if test "$ol_arg" = "invalid" ; then
1127                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1128         fi
1129         ol_with_threads="$ol_arg"
1130
1131 else
1132         ol_with_threads="auto"
1133 fi
1134 # end --with-threads
1135
1136 # OpenLDAP --with-tls
1137         # Check whether --with-tls or --without-tls was given.
1138 if test "${with_tls+set}" = set; then
1139   withval="$with_tls"
1140   
1141         ol_arg=invalid
1142         for ol_val in auto ssleay openssl yes no  ; do
1143                 if test "$withval" = "$ol_val" ; then
1144                         ol_arg="$ol_val"
1145                 fi
1146         done
1147         if test "$ol_arg" = "invalid" ; then
1148                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1149         fi
1150         ol_with_tls="$ol_arg"
1151
1152 else
1153         ol_with_tls="auto"
1154 fi
1155 # end --with-tls
1156
1157 # OpenLDAP --with-yielding_select
1158         # Check whether --with-yielding_select or --without-yielding_select was given.
1159 if test "${with_yielding_select+set}" = set; then
1160   withval="$with_yielding_select"
1161   
1162         ol_arg=invalid
1163         for ol_val in auto yes no manual  ; do
1164                 if test "$withval" = "$ol_val" ; then
1165                         ol_arg="$ol_val"
1166                 fi
1167         done
1168         if test "$ol_arg" = "invalid" ; then
1169                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1170         fi
1171         ol_with_yielding_select="$ol_arg"
1172
1173 else
1174         ol_with_yielding_select="auto"
1175 fi
1176 # end --with-yielding_select
1177
1178
1179
1180 # Check whether --with-xxldapdoptions or --without-xxldapdoptions was given.
1181 if test "${with_xxldapdoptions+set}" = set; then
1182   withval="$with_xxldapdoptions"
1183   :
1184 fi
1185
1186 # OpenLDAP --enable-ldapd
1187         # Check whether --enable-ldapd or --disable-ldapd was given.
1188 if test "${enable_ldapd+set}" = set; then
1189   enableval="$enable_ldapd"
1190   
1191         ol_arg=invalid
1192         for ol_val in auto yes no ; do
1193                 if test "$enableval" = "$ol_val" ; then
1194                         ol_arg="$ol_val"
1195                 fi
1196         done
1197         if test "$ol_arg" = "invalid" ; then
1198                 { echo "configure: error: bad value $enableval for --enable-ldapd" 1>&2; exit 1; }
1199         fi
1200         ol_enable_ldapd="$ol_arg"
1201
1202 else
1203         ol_enable_ldapd="no"
1204 fi
1205 # end --enable-ldapd
1206
1207 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1208 if test "${with_xxslapdoptions+set}" = set; then
1209   withval="$with_xxslapdoptions"
1210   :
1211 fi
1212
1213 # OpenLDAP --enable-slapd
1214         # Check whether --enable-slapd or --disable-slapd was given.
1215 if test "${enable_slapd+set}" = set; then
1216   enableval="$enable_slapd"
1217   
1218         ol_arg=invalid
1219         for ol_val in auto yes no ; do
1220                 if test "$enableval" = "$ol_val" ; then
1221                         ol_arg="$ol_val"
1222                 fi
1223         done
1224         if test "$ol_arg" = "invalid" ; then
1225                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1226         fi
1227         ol_enable_slapd="$ol_arg"
1228
1229 else
1230         ol_enable_slapd="yes"
1231 fi
1232 # end --enable-slapd
1233 # OpenLDAP --enable-aclgroups
1234         # Check whether --enable-aclgroups or --disable-aclgroups was given.
1235 if test "${enable_aclgroups+set}" = set; then
1236   enableval="$enable_aclgroups"
1237   
1238         ol_arg=invalid
1239         for ol_val in auto yes no ; do
1240                 if test "$enableval" = "$ol_val" ; then
1241                         ol_arg="$ol_val"
1242                 fi
1243         done
1244         if test "$ol_arg" = "invalid" ; then
1245                 { echo "configure: error: bad value $enableval for --enable-aclgroups" 1>&2; exit 1; }
1246         fi
1247         ol_enable_aclgroups="$ol_arg"
1248
1249 else
1250         ol_enable_aclgroups="auto"
1251 fi
1252 # end --enable-aclgroups
1253 # OpenLDAP --enable-cleartext
1254         # Check whether --enable-cleartext or --disable-cleartext was given.
1255 if test "${enable_cleartext+set}" = set; then
1256   enableval="$enable_cleartext"
1257   
1258         ol_arg=invalid
1259         for ol_val in auto yes no ; do
1260                 if test "$enableval" = "$ol_val" ; then
1261                         ol_arg="$ol_val"
1262                 fi
1263         done
1264         if test "$ol_arg" = "invalid" ; then
1265                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1266         fi
1267         ol_enable_cleartext="$ol_arg"
1268
1269 else
1270         ol_enable_cleartext="yes"
1271 fi
1272 # end --enable-cleartext
1273 # OpenLDAP --enable-crypt
1274         # Check whether --enable-crypt or --disable-crypt was given.
1275 if test "${enable_crypt+set}" = set; then
1276   enableval="$enable_crypt"
1277   
1278         ol_arg=invalid
1279         for ol_val in auto yes no ; do
1280                 if test "$enableval" = "$ol_val" ; then
1281                         ol_arg="$ol_val"
1282                 fi
1283         done
1284         if test "$ol_arg" = "invalid" ; then
1285                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1286         fi
1287         ol_enable_crypt="$ol_arg"
1288
1289 else
1290         ol_enable_crypt="auto"
1291 fi
1292 # end --enable-crypt
1293 # OpenLDAP --enable-modules
1294         # Check whether --enable-modules or --disable-modules was given.
1295 if test "${enable_modules+set}" = set; then
1296   enableval="$enable_modules"
1297   
1298         ol_arg=invalid
1299         for ol_val in auto yes no ; do
1300                 if test "$enableval" = "$ol_val" ; then
1301                         ol_arg="$ol_val"
1302                 fi
1303         done
1304         if test "$ol_arg" = "invalid" ; then
1305                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1306         fi
1307         ol_enable_modules="$ol_arg"
1308
1309 else
1310         ol_enable_modules="no"
1311 fi
1312 # end --enable-modules
1313 # OpenLDAP --enable-phonetic
1314         # Check whether --enable-phonetic or --disable-phonetic was given.
1315 if test "${enable_phonetic+set}" = set; then
1316   enableval="$enable_phonetic"
1317   
1318         ol_arg=invalid
1319         for ol_val in auto yes no ; do
1320                 if test "$enableval" = "$ol_val" ; then
1321                         ol_arg="$ol_val"
1322                 fi
1323         done
1324         if test "$ol_arg" = "invalid" ; then
1325                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1326         fi
1327         ol_enable_phonetic="$ol_arg"
1328
1329 else
1330         ol_enable_phonetic="no"
1331 fi
1332 # end --enable-phonetic
1333 # OpenLDAP --enable-rlookups
1334         # Check whether --enable-rlookups or --disable-rlookups was given.
1335 if test "${enable_rlookups+set}" = set; then
1336   enableval="$enable_rlookups"
1337   
1338         ol_arg=invalid
1339         for ol_val in auto yes no ; do
1340                 if test "$enableval" = "$ol_val" ; then
1341                         ol_arg="$ol_val"
1342                 fi
1343         done
1344         if test "$ol_arg" = "invalid" ; then
1345                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1346         fi
1347         ol_enable_rlookups="$ol_arg"
1348
1349 else
1350         ol_enable_rlookups="auto"
1351 fi
1352 # end --enable-rlookups
1353 # OpenLDAP --enable-wrappers
1354         # Check whether --enable-wrappers or --disable-wrappers was given.
1355 if test "${enable_wrappers+set}" = set; then
1356   enableval="$enable_wrappers"
1357   
1358         ol_arg=invalid
1359         for ol_val in auto yes no ; do
1360                 if test "$enableval" = "$ol_val" ; then
1361                         ol_arg="$ol_val"
1362                 fi
1363         done
1364         if test "$ol_arg" = "invalid" ; then
1365                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1366         fi
1367         ol_enable_wrappers="$ol_arg"
1368
1369 else
1370         ol_enable_wrappers="no"
1371 fi
1372 # end --enable-wrappers
1373
1374 # OpenLDAP --enable-bdb2
1375         # Check whether --enable-bdb2 or --disable-bdb2 was given.
1376 if test "${enable_bdb2+set}" = set; then
1377   enableval="$enable_bdb2"
1378   
1379         ol_arg=invalid
1380         for ol_val in auto yes no ; do
1381                 if test "$enableval" = "$ol_val" ; then
1382                         ol_arg="$ol_val"
1383                 fi
1384         done
1385         if test "$ol_arg" = "invalid" ; then
1386                 { echo "configure: error: bad value $enableval for --enable-bdb2" 1>&2; exit 1; }
1387         fi
1388         ol_enable_bdb2="$ol_arg"
1389
1390 else
1391         ol_enable_bdb2="no"
1392 fi
1393 # end --enable-bdb2
1394 # OpenLDAP --enable-ldap
1395         # Check whether --enable-ldap or --disable-ldap was given.
1396 if test "${enable_ldap+set}" = set; then
1397   enableval="$enable_ldap"
1398   
1399         ol_arg=invalid
1400         for ol_val in auto yes no ; do
1401                 if test "$enableval" = "$ol_val" ; then
1402                         ol_arg="$ol_val"
1403                 fi
1404         done
1405         if test "$ol_arg" = "invalid" ; then
1406                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1407         fi
1408         ol_enable_ldap="$ol_arg"
1409
1410 else
1411         ol_enable_ldap="no"
1412 fi
1413 # end --enable-ldap
1414 # OpenLDAP --enable-ldbm
1415         # Check whether --enable-ldbm or --disable-ldbm was given.
1416 if test "${enable_ldbm+set}" = set; then
1417   enableval="$enable_ldbm"
1418   
1419         ol_arg=invalid
1420         for ol_val in auto yes no ; do
1421                 if test "$enableval" = "$ol_val" ; then
1422                         ol_arg="$ol_val"
1423                 fi
1424         done
1425         if test "$ol_arg" = "invalid" ; then
1426                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1427         fi
1428         ol_enable_ldbm="$ol_arg"
1429
1430 else
1431         ol_enable_ldbm="yes"
1432 fi
1433 # end --enable-ldbm
1434 # OpenLDAP --with-ldbm_api
1435         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1436 if test "${with_ldbm_api+set}" = set; then
1437   withval="$with_ldbm_api"
1438   
1439         ol_arg=invalid
1440         for ol_val in auto db2 db mdbm gdbm ndbm manual ; do
1441                 if test "$withval" = "$ol_val" ; then
1442                         ol_arg="$ol_val"
1443                 fi
1444         done
1445         if test "$ol_arg" = "invalid" ; then
1446                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1447         fi
1448         ol_with_ldbm_api="$ol_arg"
1449
1450 else
1451         ol_with_ldbm_api="auto"
1452 fi
1453 # end --with-ldbm_api
1454
1455 # OpenLDAP --with-ldbm_type
1456         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1457 if test "${with_ldbm_type+set}" = set; then
1458   withval="$with_ldbm_type"
1459   
1460         ol_arg=invalid
1461         for ol_val in auto btree hash ; do
1462                 if test "$withval" = "$ol_val" ; then
1463                         ol_arg="$ol_val"
1464                 fi
1465         done
1466         if test "$ol_arg" = "invalid" ; then
1467                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1468         fi
1469         ol_with_ldbm_type="$ol_arg"
1470
1471 else
1472         ol_with_ldbm_type="auto"
1473 fi
1474 # end --with-ldbm_type
1475
1476
1477 # OpenLDAP --enable-passwd
1478         # Check whether --enable-passwd or --disable-passwd was given.
1479 if test "${enable_passwd+set}" = set; then
1480   enableval="$enable_passwd"
1481   
1482         ol_arg=invalid
1483         for ol_val in auto yes no ; do
1484                 if test "$enableval" = "$ol_val" ; then
1485                         ol_arg="$ol_val"
1486                 fi
1487         done
1488         if test "$ol_arg" = "invalid" ; then
1489                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1490         fi
1491         ol_enable_passwd="$ol_arg"
1492
1493 else
1494         ol_enable_passwd="no"
1495 fi
1496 # end --enable-passwd
1497 # OpenLDAP --enable-perl
1498         # Check whether --enable-perl or --disable-perl was given.
1499 if test "${enable_perl+set}" = set; then
1500   enableval="$enable_perl"
1501   
1502         ol_arg=invalid
1503         for ol_val in auto yes no ; do
1504                 if test "$enableval" = "$ol_val" ; then
1505                         ol_arg="$ol_val"
1506                 fi
1507         done
1508         if test "$ol_arg" = "invalid" ; then
1509                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
1510         fi
1511         ol_enable_perl="$ol_arg"
1512
1513 else
1514         ol_enable_perl="no"
1515 fi
1516 # end --enable-perl
1517 # OpenLDAP --enable-shell
1518         # Check whether --enable-shell or --disable-shell was given.
1519 if test "${enable_shell+set}" = set; then
1520   enableval="$enable_shell"
1521   
1522         ol_arg=invalid
1523         for ol_val in auto yes no ; do
1524                 if test "$enableval" = "$ol_val" ; then
1525                         ol_arg="$ol_val"
1526                 fi
1527         done
1528         if test "$ol_arg" = "invalid" ; then
1529                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
1530         fi
1531         ol_enable_shell="$ol_arg"
1532
1533 else
1534         ol_enable_shell="no"
1535 fi
1536 # end --enable-shell
1537 # OpenLDAP --enable-tcl
1538         # Check whether --enable-tcl or --disable-tcl was given.
1539 if test "${enable_tcl+set}" = set; then
1540   enableval="$enable_tcl"
1541   
1542         ol_arg=invalid
1543         for ol_val in auto yes no ; do
1544                 if test "$enableval" = "$ol_val" ; then
1545                         ol_arg="$ol_val"
1546                 fi
1547         done
1548         if test "$ol_arg" = "invalid" ; then
1549                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
1550         fi
1551         ol_enable_tcl="$ol_arg"
1552
1553 else
1554         ol_enable_tcl="no"
1555 fi
1556 # end --enable-tcl
1557
1558 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
1559 if test "${with_xxslurpdoptions+set}" = set; then
1560   withval="$with_xxslurpdoptions"
1561   :
1562 fi
1563
1564 # OpenLDAP --enable-slurpd
1565         # Check whether --enable-slurpd or --disable-slurpd was given.
1566 if test "${enable_slurpd+set}" = set; then
1567   enableval="$enable_slurpd"
1568   
1569         ol_arg=invalid
1570         for ol_val in auto yes no ; do
1571                 if test "$enableval" = "$ol_val" ; then
1572                         ol_arg="$ol_val"
1573                 fi
1574         done
1575         if test "$ol_arg" = "invalid" ; then
1576                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
1577         fi
1578         ol_enable_slurpd="$ol_arg"
1579
1580 else
1581         ol_enable_slurpd="auto"
1582 fi
1583 # end --enable-slurpd
1584
1585 # Check whether --with-xxliboptions or --without-xxliboptions was given.
1586 if test "${with_xxliboptions+set}" = set; then
1587   withval="$with_xxliboptions"
1588   :
1589 fi
1590
1591 # Check whether --enable-static or --disable-static was given.
1592 if test "${enable_static+set}" = set; then
1593   enableval="$enable_static"
1594   p=${PACKAGE-default}
1595 case "$enableval" in
1596 yes) enable_static=yes ;;
1597 no) enable_static=no ;;
1598 *)
1599   enable_static=no
1600   # Look at the argument we got.  We use all the common list separators.
1601   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1602   for pkg in $enableval; do
1603     if test "X$pkg" = "X$p"; then
1604       enable_static=yes
1605     fi
1606   done
1607   IFS="$ac_save_ifs"
1608   ;;
1609 esac
1610 else
1611   enable_static=yes
1612 fi
1613
1614 # Check whether --enable-shared or --disable-shared was given.
1615 if test "${enable_shared+set}" = set; then
1616   enableval="$enable_shared"
1617   p=${PACKAGE-default}
1618 case "$enableval" in
1619 yes) enable_shared=yes ;;
1620 no) enable_shared=no ;;
1621 *)
1622   enable_shared=no
1623   # Look at the argument we got.  We use all the common list separators.
1624   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1625   for pkg in $enableval; do
1626     if test "X$pkg" = "X$p"; then
1627       enable_shared=yes
1628     fi
1629   done
1630   IFS="$ac_save_ifs"
1631   ;;
1632 esac
1633 else
1634   enable_shared=yes
1635 fi
1636
1637
1638 # validate options
1639 if test $ol_enable_dns = yes ; then
1640         if test $ol_enable_referrals = no ; then
1641                 { echo "configure: error: DNS requires --enable-referrals" 1>&2; exit 1; }
1642         fi
1643         if test $ol_enable_referrals = auto ; then
1644                 echo "configure: warning: DNS requires referrals, adding --enable-referrals" 1>&2
1645                 ol_enable_referrals=yes
1646         fi
1647 fi
1648
1649 if test $ol_enable_slapd = no ; then
1650                 if test $ol_enable_bdb2 = yes ; then
1651                 echo "configure: warning: slapd disabled, ignoring --enable-bdb2 argument" 1>&2
1652         fi
1653         if test $ol_enable_ldap = yes ; then
1654                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
1655         fi
1656         if test $ol_enable_ldbm = yes ; then
1657                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
1658         fi
1659         if test $ol_enable_passwd = yes ; then
1660                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
1661         fi
1662         if test $ol_enable_perl = yes ; then
1663                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
1664         fi
1665         if test $ol_enable_shell = yes ; then
1666                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
1667         fi
1668         if test $ol_enable_tcl = yes ; then
1669                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
1670         fi
1671         if test $ol_enable_aclgroups = yes ; then
1672                 echo "configure: warning: slapd disabled, ignoring --enable-aclgroups argument" 1>&2
1673         fi
1674         if test $ol_enable_modules = yes ; then
1675                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
1676         fi
1677         if test $ol_enable_wrappers = yes ; then
1678                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
1679         fi
1680         if test $ol_enable_phonetic = yes ; then
1681                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
1682         fi
1683         if test $ol_enable_rlookups = yes ; then
1684                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
1685         fi
1686         if test $ol_with_ldbm_api != auto ; then
1687                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
1688         fi
1689         if test $ol_with_ldbm_type != auto ; then
1690                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
1691         fi
1692         if test $ol_enable_slurpd = yes ; then
1693                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
1694         fi
1695
1696         # force settings to no
1697         ol_enable_bdb2=no
1698         ol_enable_ldap=no
1699         ol_enable_ldbm=no
1700         ol_enable_passwd=no
1701         ol_enable_perl=no
1702         ol_enable_shell=no
1703         ol_enable_tcl=no
1704
1705         ol_enable_aclgroups=no
1706         ol_enable_modules=no
1707         ol_enable_phonetic=no
1708         ol_enable_rlookups=no
1709         ol_enable_wrappers=no
1710
1711         ol_with_ldbm_api=no
1712         ol_with_ldbm_type=no
1713
1714         ol_enable_slurpd=no
1715
1716 elif test $ol_enable_ldbm = no ; then
1717         
1718         if test $ol_with_ldbm_api != auto ; then
1719                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
1720         fi
1721
1722         if test $ol_with_ldbm_type != auto ; then
1723                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
1724         fi
1725
1726         if test $ol_enable_bdb2 = yes ; then
1727                 { echo "configure: error: BDB2 requires --enable-ldbm" 1>&2; exit 1; }
1728         fi
1729
1730         if test $ol_enable_modules != yes -a \
1731                 $ol_enable_ldap = no -a \
1732                 $ol_enable_passwd = no -a \
1733                 $ol_enable_perl = no -a \
1734                 $ol_enable_shell = no -a \
1735                 $ol_enable_tcl = no ; then
1736                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
1737         fi
1738
1739         ol_with_ldbm_api=no
1740         ol_with_ldbm_type=no
1741
1742 elif test $ol_enable_bdb2 = yes ; then
1743         
1744         if test $ol_with_ldbm_api != auto -a \
1745                 $ol_with_ldbm_api != db2 ; then
1746                 { echo "configure: error: BDB2 requires LDBM API DB2" 1>&2; exit 1; }
1747         fi
1748
1749         ol_with_ldbm_api=db2
1750
1751 else
1752         
1753         if test $ol_enable_bdb2 != no ; then
1754                 if test $ol_with_ldbm_api != auto -a \
1755                         $ol_with_ldbm_api != db2 ; then
1756                         echo "configure: warning: BDB2 requires LDBM api db2 or auto" 1>&2
1757                         ol_enable_bdb2=no
1758                 fi
1759         fi
1760
1761         if test $ol_with_ldbm_api = gdbm -a \
1762                 $ol_with_ldbm_type = btree ; then
1763                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
1764         fi
1765         if test $ol_with_ldbm_api = mdbm -a \
1766                 $ol_with_ldbm_type = btree ; then
1767                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
1768         fi
1769         if test $ol_with_ldbm_api = ndbm -a \
1770                 $ol_with_ldbm_type = btree ; then
1771                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
1772         fi
1773 fi
1774
1775 if test $ol_enable_slurpd = yes ; then
1776                 if test $ol_with_threads = no ; then
1777                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
1778         fi
1779 fi
1780
1781 echo "$ac_t""done" 1>&6
1782
1783 ## Initialize vars
1784 LDAP_LIBS=
1785 LDBM_LIBS=
1786 LTHREAD_LIBS=
1787 LUTIL_LIBS=
1788
1789 LDAPD_LIBS=
1790 SLAPD_LIBS=
1791 SLURPD_LIBS=
1792
1793 BUILD_LDAPD=no
1794 BUILD_SLAPD=no
1795 BUILD_SLURPD=no
1796
1797 BUILD_BDB2=no
1798 BUILD_LDAP=no
1799 BUILD_LDBM=no
1800 BUILD_PASSWD=no
1801 BUILD_PERL=no
1802 BUILD_SHELL=no
1803 BUILD_TCL=no
1804 BUILD_THREAD=no
1805
1806 SLAPD_MODULES_LDFLAGS=
1807 SLAPD_MODULES_CPPFLAGS=
1808
1809 SLAPD_PERL_LDFLAGS=
1810 SLAPD_PERL_CPPFLAGS=
1811
1812 KRB_LIBS=
1813 READLINE_LIBS=
1814 TERMCAP_LIBS=
1815 TLS_LIBS=
1816
1817
1818
1819 save_CC="$CC"
1820 if test -z "${CC}"; then
1821         for ac_prog in cc
1822 do
1823 # Extract the first word of "$ac_prog", so it can be a program name with args.
1824 set dummy $ac_prog; ac_word=$2
1825 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1826 echo "configure:1827: checking for $ac_word" >&5
1827 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1828   echo $ac_n "(cached) $ac_c" 1>&6
1829 else
1830   if test -n "$CC"; then
1831   ac_cv_prog_CC="$CC" # Let the user override the test.
1832 else
1833   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1834   ac_dummy="$PATH"
1835   for ac_dir in $ac_dummy; do
1836     test -z "$ac_dir" && ac_dir=.
1837     if test -f $ac_dir/$ac_word; then
1838       ac_cv_prog_CC="$ac_prog"
1839       break
1840     fi
1841   done
1842   IFS="$ac_save_ifs"
1843 fi
1844 fi
1845 CC="$ac_cv_prog_CC"
1846 if test -n "$CC"; then
1847   echo "$ac_t""$CC" 1>&6
1848 else
1849   echo "$ac_t""no" 1>&6
1850 fi
1851
1852 test -n "$CC" && break
1853 done
1854
1855 fi
1856
1857
1858
1859 # Make sure we can run config.sub.
1860 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
1861 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
1862 fi
1863
1864 echo $ac_n "checking host system type""... $ac_c" 1>&6
1865 echo "configure:1866: checking host system type" >&5
1866
1867 host_alias=$host
1868 case "$host_alias" in
1869 NONE)
1870   case $nonopt in
1871   NONE)
1872     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
1873     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
1874     fi ;;
1875   *) host_alias=$nonopt ;;
1876   esac ;;
1877 esac
1878
1879 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
1880 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1881 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1882 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1883 echo "$ac_t""$host" 1>&6
1884
1885
1886 case "$host" in
1887         *-*-aix*) $ol_host_os=aix ;;
1888 esac
1889
1890 ol_aix_threads=no
1891 if test -z "$save_CC" -a "$CC" = cc -a "$ol_host_os" = aix ; then
1892         case "$ol_with_threads" in
1893                 auto | yes |  posix) ol_aix_threads=yes ;;
1894         esac
1895 fi
1896
1897 if test ol_aix_threads = yes ; then
1898         for ac_prog in cc_r x1c_r
1899 do
1900 # Extract the first word of "$ac_prog", so it can be a program name with args.
1901 set dummy $ac_prog; ac_word=$2
1902 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1903 echo "configure:1904: checking for $ac_word" >&5
1904 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1905   echo $ac_n "(cached) $ac_c" 1>&6
1906 else
1907   if test -n "$CC"; then
1908   ac_cv_prog_CC="$CC" # Let the user override the test.
1909 else
1910   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1911   ac_dummy="$PATH"
1912   for ac_dir in $ac_dummy; do
1913     test -z "$ac_dir" && ac_dir=.
1914     if test -f $ac_dir/$ac_word; then
1915       ac_cv_prog_CC="$ac_prog"
1916       break
1917     fi
1918   done
1919   IFS="$ac_save_ifs"
1920 fi
1921 fi
1922 CC="$ac_cv_prog_CC"
1923 if test -n "$CC"; then
1924   echo "$ac_t""$CC" 1>&6
1925 else
1926   echo "$ac_t""no" 1>&6
1927 fi
1928
1929 test -n "$CC" && break
1930 done
1931
1932
1933         if test "$CC" ; then
1934                 if test $ol_with_threads != auto ; then
1935                         { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
1936                 else
1937                         echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
1938                 fi
1939                 ol_with_threads=no
1940         else
1941                 ol_with_threads=posix
1942                 ol_cv_pthread_create=yes
1943         fi
1944 fi
1945
1946 # Extract the first word of "ranlib", so it can be a program name with args.
1947 set dummy ranlib; ac_word=$2
1948 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1949 echo "configure:1950: checking for $ac_word" >&5
1950 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1951   echo $ac_n "(cached) $ac_c" 1>&6
1952 else
1953   if test -n "$RANLIB"; then
1954   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1955 else
1956   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1957   ac_dummy="$PATH"
1958   for ac_dir in $ac_dummy; do
1959     test -z "$ac_dir" && ac_dir=.
1960     if test -f $ac_dir/$ac_word; then
1961       ac_cv_prog_RANLIB="ranlib"
1962       break
1963     fi
1964   done
1965   IFS="$ac_save_ifs"
1966   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1967 fi
1968 fi
1969 RANLIB="$ac_cv_prog_RANLIB"
1970 if test -n "$RANLIB"; then
1971   echo "$ac_t""$RANLIB" 1>&6
1972 else
1973   echo "$ac_t""no" 1>&6
1974 fi
1975
1976 # Extract the first word of "gcc", so it can be a program name with args.
1977 set dummy gcc; ac_word=$2
1978 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1979 echo "configure:1980: checking for $ac_word" >&5
1980 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1981   echo $ac_n "(cached) $ac_c" 1>&6
1982 else
1983   if test -n "$CC"; then
1984   ac_cv_prog_CC="$CC" # Let the user override the test.
1985 else
1986   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1987   ac_dummy="$PATH"
1988   for ac_dir in $ac_dummy; do
1989     test -z "$ac_dir" && ac_dir=.
1990     if test -f $ac_dir/$ac_word; then
1991       ac_cv_prog_CC="gcc"
1992       break
1993     fi
1994   done
1995   IFS="$ac_save_ifs"
1996 fi
1997 fi
1998 CC="$ac_cv_prog_CC"
1999 if test -n "$CC"; then
2000   echo "$ac_t""$CC" 1>&6
2001 else
2002   echo "$ac_t""no" 1>&6
2003 fi
2004
2005 if test -z "$CC"; then
2006   # Extract the first word of "cc", so it can be a program name with args.
2007 set dummy cc; ac_word=$2
2008 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2009 echo "configure:2010: checking for $ac_word" >&5
2010 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
2011   echo $ac_n "(cached) $ac_c" 1>&6
2012 else
2013   if test -n "$CC"; then
2014   ac_cv_prog_CC="$CC" # Let the user override the test.
2015 else
2016   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2017   ac_prog_rejected=no
2018   ac_dummy="$PATH"
2019   for ac_dir in $ac_dummy; do
2020     test -z "$ac_dir" && ac_dir=.
2021     if test -f $ac_dir/$ac_word; then
2022       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2023         ac_prog_rejected=yes
2024         continue
2025       fi
2026       ac_cv_prog_CC="cc"
2027       break
2028     fi
2029   done
2030   IFS="$ac_save_ifs"
2031 if test $ac_prog_rejected = yes; then
2032   # We found a bogon in the path, so make sure we never use it.
2033   set dummy $ac_cv_prog_CC
2034   shift
2035   if test $# -gt 0; then
2036     # We chose a different compiler from the bogus one.
2037     # However, it has the same basename, so the bogon will be chosen
2038     # first if we set CC to just the basename; use the full file name.
2039     shift
2040     set dummy "$ac_dir/$ac_word" "$@"
2041     shift
2042     ac_cv_prog_CC="$@"
2043   fi
2044 fi
2045 fi
2046 fi
2047 CC="$ac_cv_prog_CC"
2048 if test -n "$CC"; then
2049   echo "$ac_t""$CC" 1>&6
2050 else
2051   echo "$ac_t""no" 1>&6
2052 fi
2053
2054   if test -z "$CC"; then
2055     case "`uname -s`" in
2056     *win32* | *WIN32*)
2057       # Extract the first word of "cl", so it can be a program name with args.
2058 set dummy cl; ac_word=$2
2059 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2060 echo "configure:2061: checking for $ac_word" >&5
2061 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
2062   echo $ac_n "(cached) $ac_c" 1>&6
2063 else
2064   if test -n "$CC"; then
2065   ac_cv_prog_CC="$CC" # Let the user override the test.
2066 else
2067   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2068   ac_dummy="$PATH"
2069   for ac_dir in $ac_dummy; do
2070     test -z "$ac_dir" && ac_dir=.
2071     if test -f $ac_dir/$ac_word; then
2072       ac_cv_prog_CC="cl"
2073       break
2074     fi
2075   done
2076   IFS="$ac_save_ifs"
2077 fi
2078 fi
2079 CC="$ac_cv_prog_CC"
2080 if test -n "$CC"; then
2081   echo "$ac_t""$CC" 1>&6
2082 else
2083   echo "$ac_t""no" 1>&6
2084 fi
2085  ;;
2086     esac
2087   fi
2088   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2089 fi
2090
2091 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2092 echo "configure:2093: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
2093
2094 ac_ext=c
2095 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2096 ac_cpp='$CPP $CPPFLAGS'
2097 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2098 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2099 cross_compiling=$ac_cv_prog_cc_cross
2100
2101 cat > conftest.$ac_ext << EOF
2102
2103 #line 2104 "configure"
2104 #include "confdefs.h"
2105
2106 main(){return(0);}
2107 EOF
2108 if { (eval echo configure:2109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2109   ac_cv_prog_cc_works=yes
2110   # If we can't run a trivial program, we are probably using a cross compiler.
2111   if (./conftest; exit) 2>/dev/null; then
2112     ac_cv_prog_cc_cross=no
2113   else
2114     ac_cv_prog_cc_cross=yes
2115   fi
2116 else
2117   echo "configure: failed program was:" >&5
2118   cat conftest.$ac_ext >&5
2119   ac_cv_prog_cc_works=no
2120 fi
2121 rm -fr conftest*
2122 ac_ext=c
2123 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2124 ac_cpp='$CPP $CPPFLAGS'
2125 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2126 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2127 cross_compiling=$ac_cv_prog_cc_cross
2128
2129 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2130 if test $ac_cv_prog_cc_works = no; then
2131   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2132 fi
2133 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2134 echo "configure:2135: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
2135 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2136 cross_compiling=$ac_cv_prog_cc_cross
2137
2138 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2139 echo "configure:2140: checking whether we are using GNU C" >&5
2140 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
2141   echo $ac_n "(cached) $ac_c" 1>&6
2142 else
2143   cat > conftest.c <<EOF
2144 #ifdef __GNUC__
2145   yes;
2146 #endif
2147 EOF
2148 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2149   ac_cv_prog_gcc=yes
2150 else
2151   ac_cv_prog_gcc=no
2152 fi
2153 fi
2154
2155 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2156
2157 if test $ac_cv_prog_gcc = yes; then
2158   GCC=yes
2159 else
2160   GCC=
2161 fi
2162
2163 ac_test_CFLAGS="${CFLAGS+set}"
2164 ac_save_CFLAGS="$CFLAGS"
2165 CFLAGS=
2166 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2167 echo "configure:2168: checking whether ${CC-cc} accepts -g" >&5
2168 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
2169   echo $ac_n "(cached) $ac_c" 1>&6
2170 else
2171   echo 'void f(){}' > conftest.c
2172 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2173   ac_cv_prog_cc_g=yes
2174 else
2175   ac_cv_prog_cc_g=no
2176 fi
2177 rm -f conftest*
2178
2179 fi
2180
2181 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2182 if test "$ac_test_CFLAGS" = set; then
2183   CFLAGS="$ac_save_CFLAGS"
2184 elif test $ac_cv_prog_cc_g = yes; then
2185   if test "$GCC" = yes; then
2186     CFLAGS="-g -O2"
2187   else
2188     CFLAGS="-g"
2189   fi
2190 else
2191   if test "$GCC" = yes; then
2192     CFLAGS="-O2"
2193   else
2194     CFLAGS=
2195   fi
2196 fi
2197
2198 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2199 if test "${with_gnu_ld+set}" = set; then
2200   withval="$with_gnu_ld"
2201   test "$withval" = no || with_gnu_ld=yes
2202 else
2203   with_gnu_ld=no
2204 fi
2205
2206
2207 ac_prog=ld
2208 if test "$ac_cv_prog_gcc" = yes; then
2209   # Check if gcc -print-prog-name=ld gives a path.
2210   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2211 echo "configure:2212: checking for ld used by GCC" >&5
2212   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2213   case "$ac_prog" in
2214   # Accept absolute paths.
2215   /* | A-Za-z:\\*)
2216     test -z "$LD" && LD="$ac_prog"
2217     ;;
2218   "")
2219     # If it fails, then pretend we aren't using GCC.
2220     ac_prog=ld
2221     ;;
2222   *)
2223     # If it is relative, then search for the first ld in PATH.
2224     with_gnu_ld=unknown
2225     ;;
2226   esac
2227 elif test "$with_gnu_ld" = yes; then
2228   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2229 echo "configure:2230: checking for GNU ld" >&5
2230 else
2231   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2232 echo "configure:2233: checking for non-GNU ld" >&5
2233 fi
2234 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
2235   echo $ac_n "(cached) $ac_c" 1>&6
2236 else
2237   if test -z "$LD"; then
2238   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2239   for ac_dir in $PATH; do
2240     test -z "$ac_dir" && ac_dir=.
2241     if test -f "$ac_dir/$ac_prog"; then
2242       ac_cv_path_LD="$ac_dir/$ac_prog"
2243       # Check to see if the program is GNU ld.  I'd rather use --version,
2244       # but apparently some GNU ld's only accept -v.
2245       # Break only if it was the GNU/non-GNU ld that we prefer.
2246       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2247         test "$with_gnu_ld" != no && break
2248       else
2249         test "$with_gnu_ld" != yes && break
2250       fi
2251     fi
2252   done
2253   IFS="$ac_save_ifs"
2254 else
2255   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2256 fi
2257 fi
2258
2259 LD="$ac_cv_path_LD"
2260 if test -n "$LD"; then
2261   echo "$ac_t""$LD" 1>&6
2262 else
2263   echo "$ac_t""no" 1>&6
2264 fi
2265 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2266
2267 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2268 echo "configure:2269: checking if the linker ($LD) is GNU ld" >&5
2269 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
2270   echo $ac_n "(cached) $ac_c" 1>&6
2271 else
2272   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2273 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2274   ac_cv_prog_gnu_ld=yes
2275 else
2276   ac_cv_prog_gnu_ld=no
2277 fi
2278 fi
2279
2280 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2281
2282
2283 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2284 echo "configure:2285: checking for BSD-compatible nm" >&5
2285 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
2286   echo $ac_n "(cached) $ac_c" 1>&6
2287 else
2288   case "$NM" in
2289 /* | A-Za-z:\\*)
2290   ac_cv_path_NM="$NM" # Let the user override the test with a path.
2291   ;;
2292 *)
2293   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2294   for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
2295     test -z "$ac_dir" && ac_dir=.
2296     if test -f $ac_dir/nm; then
2297       # Check to see if the nm accepts a BSD-compat flag.
2298       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2299       #   nm: unknown option "B" ignored
2300       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2301         ac_cv_path_NM="$ac_dir/nm -B"
2302       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2303         ac_cv_path_NM="$ac_dir/nm -p"
2304       else
2305         ac_cv_path_NM="$ac_dir/nm"
2306       fi
2307       break
2308     fi
2309   done
2310   IFS="$ac_save_ifs"
2311   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2312   ;;
2313 esac
2314 fi
2315
2316 NM="$ac_cv_path_NM"
2317 echo "$ac_t""$NM" 1>&6
2318
2319
2320 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2321 echo "configure:2322: checking whether ln -s works" >&5
2322 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2323   echo $ac_n "(cached) $ac_c" 1>&6
2324 else
2325   rm -f conftestdata
2326 if ln -s X conftestdata 2>/dev/null
2327 then
2328   rm -f conftestdata
2329   ac_cv_prog_LN_S="ln -s"
2330 else
2331   ac_cv_prog_LN_S=ln
2332 fi
2333 fi
2334 LN_S="$ac_cv_prog_LN_S"
2335 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2336   echo "$ac_t""yes" 1>&6
2337 else
2338   echo "$ac_t""no" 1>&6
2339 fi
2340
2341 # Always use our own libtool.
2342 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
2343
2344 # Check for any special flags to pass to ltconfig.
2345 libtool_flags=
2346 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2347 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2348 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
2349 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2350 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2351
2352 # Some flags need to be propagated to the compiler or linker for good
2353 # libtool support.
2354 case "$host" in
2355 *-*-irix6*)
2356   # Find out which ABI we are using.
2357   echo '#line 2358 "configure"' > conftest.$ac_ext
2358   if { (eval echo configure:2359: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2359     case "`/usr/bin/file conftest.o`" in
2360     *32-bit*)
2361       LD="${LD-ld} -32"
2362       ;;
2363     *N32*)
2364       LD="${LD-ld} -n32"
2365       ;;
2366     *64-bit*)
2367       LD="${LD-ld} -64"
2368       ;;
2369     esac
2370   fi
2371   rm -rf conftest*
2372   ;;
2373
2374 *-*-sco3.2v5*)
2375   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2376   CFLAGS="$CFLAGS -belf"
2377   ;;
2378 esac
2379
2380 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
2381 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
2382 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
2383 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
2384 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
2385 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
2386
2387
2388 for ac_prog in mawk gawk nawk awk
2389 do
2390 # Extract the first word of "$ac_prog", so it can be a program name with args.
2391 set dummy $ac_prog; ac_word=$2
2392 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2393 echo "configure:2394: checking for $ac_word" >&5
2394 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
2395   echo $ac_n "(cached) $ac_c" 1>&6
2396 else
2397   if test -n "$AWK"; then
2398   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2399 else
2400   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2401   ac_dummy="$PATH"
2402   for ac_dir in $ac_dummy; do
2403     test -z "$ac_dir" && ac_dir=.
2404     if test -f $ac_dir/$ac_word; then
2405       ac_cv_prog_AWK="$ac_prog"
2406       break
2407     fi
2408   done
2409   IFS="$ac_save_ifs"
2410 fi
2411 fi
2412 AWK="$ac_cv_prog_AWK"
2413 if test -n "$AWK"; then
2414   echo "$ac_t""$AWK" 1>&6
2415 else
2416   echo "$ac_t""no" 1>&6
2417 fi
2418
2419 test -n "$AWK" && break
2420 done
2421
2422 # test for ln hardlink support
2423 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
2424 echo "configure:2425: checking whether ln works" >&5
2425 if eval "test \"`echo '$''{'ol_cv_prog_LN_H'+set}'`\" = set"; then
2426   echo $ac_n "(cached) $ac_c" 1>&6
2427 else
2428   rm -f conftest.src conftest.dst
2429 echo "conftest" > conftest.src
2430 if ln conftest.src conftest.dst 2>/dev/null
2431 then
2432   ol_cv_prog_LN_H="ln"
2433 else
2434   ol_cv_prog_LN_H="cp"
2435 fi
2436 rm -f conftest.src conftest.dst
2437
2438 fi
2439 LN_H="$ol_cv_prog_LN_H"
2440 if test "$ol_cv_prog_LN_H" = "ln"; then
2441         echo "$ac_t""yes" 1>&6
2442 else
2443         echo "$ac_t""no" 1>&6
2444 fi
2445
2446 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2447 echo "configure:2448: checking whether ln -s works" >&5
2448 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2449   echo $ac_n "(cached) $ac_c" 1>&6
2450 else
2451   rm -f conftestdata
2452 if ln -s X conftestdata 2>/dev/null
2453 then
2454   rm -f conftestdata
2455   ac_cv_prog_LN_S="ln -s"
2456 else
2457   ac_cv_prog_LN_S=ln
2458 fi
2459 fi
2460 LN_S="$ac_cv_prog_LN_S"
2461 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2462   echo "$ac_t""yes" 1>&6
2463 else
2464   echo "$ac_t""no" 1>&6
2465 fi
2466
2467
2468 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
2469         LN_S="$LN_H"
2470 fi
2471
2472 # Extract the first word of "sendmail", so it can be a program name with args.
2473 set dummy sendmail; ac_word=$2
2474 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2475 echo "configure:2476: checking for $ac_word" >&5
2476 if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then
2477   echo $ac_n "(cached) $ac_c" 1>&6
2478 else
2479   case "$SENDMAIL" in
2480   /*)
2481   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
2482   ;;
2483   ?:/*)                  
2484   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
2485   ;;
2486   *)
2487   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2488   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
2489   for ac_dir in $ac_dummy; do 
2490     test -z "$ac_dir" && ac_dir=.
2491     if test -f $ac_dir/$ac_word; then
2492       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
2493       break
2494     fi
2495   done
2496   IFS="$ac_save_ifs"
2497   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
2498   ;;
2499 esac
2500 fi
2501 SENDMAIL="$ac_cv_path_SENDMAIL"
2502 if test -n "$SENDMAIL"; then
2503   echo "$ac_t""$SENDMAIL" 1>&6
2504 else
2505   echo "$ac_t""no" 1>&6
2506 fi
2507
2508 # Extract the first word of "vi", so it can be a program name with args.
2509 set dummy vi; ac_word=$2
2510 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2511 echo "configure:2512: checking for $ac_word" >&5
2512 if eval "test \"`echo '$''{'ac_cv_path_EDITOR'+set}'`\" = set"; then
2513   echo $ac_n "(cached) $ac_c" 1>&6
2514 else
2515   case "$EDITOR" in
2516   /*)
2517   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
2518   ;;
2519   ?:/*)                  
2520   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
2521   ;;
2522   *)
2523   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2524   ac_dummy="$PATH:/usr/ucb"
2525   for ac_dir in $ac_dummy; do 
2526     test -z "$ac_dir" && ac_dir=.
2527     if test -f $ac_dir/$ac_word; then
2528       ac_cv_path_EDITOR="$ac_dir/$ac_word"
2529       break
2530     fi
2531   done
2532   IFS="$ac_save_ifs"
2533   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
2534   ;;
2535 esac
2536 fi
2537 EDITOR="$ac_cv_path_EDITOR"
2538 if test -n "$EDITOR"; then
2539   echo "$ac_t""$EDITOR" 1>&6
2540 else
2541   echo "$ac_t""no" 1>&6
2542 fi
2543
2544 # Extract the first word of "finger", so it can be a program name with args.
2545 set dummy finger; ac_word=$2
2546 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2547 echo "configure:2548: checking for $ac_word" >&5
2548 if eval "test \"`echo '$''{'ac_cv_path_FINGER'+set}'`\" = set"; then
2549   echo $ac_n "(cached) $ac_c" 1>&6
2550 else
2551   case "$FINGER" in
2552   /*)
2553   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
2554   ;;
2555   ?:/*)                  
2556   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
2557   ;;
2558   *)
2559   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2560   ac_dummy="$PATH:/usr/ucb"
2561   for ac_dir in $ac_dummy; do 
2562     test -z "$ac_dir" && ac_dir=.
2563     if test -f $ac_dir/$ac_word; then
2564       ac_cv_path_FINGER="$ac_dir/$ac_word"
2565       break
2566     fi
2567   done
2568   IFS="$ac_save_ifs"
2569   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
2570   ;;
2571 esac
2572 fi
2573 FINGER="$ac_cv_path_FINGER"
2574 if test -n "$FINGER"; then
2575   echo "$ac_t""$FINGER" 1>&6
2576 else
2577   echo "$ac_t""no" 1>&6
2578 fi
2579
2580
2581 ol_link_modules=no
2582 if test $ol_enable_modules != no ; then
2583         # Extract the first word of "glib-config", so it can be a program name with args.
2584 set dummy glib-config; ac_word=$2
2585 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2586 echo "configure:2587: checking for $ac_word" >&5
2587 if eval "test \"`echo '$''{'ac_cv_path_GLIBCONFIG'+set}'`\" = set"; then
2588   echo $ac_n "(cached) $ac_c" 1>&6
2589 else
2590   case "$GLIBCONFIG" in
2591   /*)
2592   ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a path.
2593   ;;
2594   ?:/*)                  
2595   ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a dos path.
2596   ;;
2597   *)
2598   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2599   ac_dummy="$PATH"
2600   for ac_dir in $ac_dummy; do 
2601     test -z "$ac_dir" && ac_dir=.
2602     if test -f $ac_dir/$ac_word; then
2603       ac_cv_path_GLIBCONFIG="$ac_dir/$ac_word"
2604       break
2605     fi
2606   done
2607   IFS="$ac_save_ifs"
2608   ;;
2609 esac
2610 fi
2611 GLIBCONFIG="$ac_cv_path_GLIBCONFIG"
2612 if test -n "$GLIBCONFIG"; then
2613   echo "$ac_t""$GLIBCONFIG" 1>&6
2614 else
2615   echo "$ac_t""no" 1>&6
2616 fi
2617
2618
2619         if test "no$GLIBCONFIG" = "no" ; then
2620                 if test $ol_enable_modules = yes ; then
2621                         { echo "configure: error: could not locate glib-config" 1>&2; exit 1; }
2622                 fi
2623
2624         else
2625                 SLAPD_MODULES_VERSION="`$GLIBCONFIG --version gmodule`"
2626                 SLAPD_MODULES_CPPFLAGS="`$GLIBCONFIG --cflags gmodule`"
2627                 SLAPD_MODULES_LDFLAGS="`$GLIBCONFIG --libs gmodule`"
2628
2629                                 ol_link_modules=yes
2630         fi
2631 fi
2632
2633 ol_link_perl=no
2634 if test $ol_enable_perl != no ; then
2635         # Extract the first word of "perl", so it can be a program name with args.
2636 set dummy perl; ac_word=$2
2637 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2638 echo "configure:2639: checking for $ac_word" >&5
2639 if eval "test \"`echo '$''{'ac_cv_path_PERLBIN'+set}'`\" = set"; then
2640   echo $ac_n "(cached) $ac_c" 1>&6
2641 else
2642   case "$PERLBIN" in
2643   /*)
2644   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
2645   ;;
2646   ?:/*)                  
2647   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
2648   ;;
2649   *)
2650   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2651   ac_dummy="$PATH"
2652   for ac_dir in $ac_dummy; do 
2653     test -z "$ac_dir" && ac_dir=.
2654     if test -f $ac_dir/$ac_word; then
2655       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
2656       break
2657     fi
2658   done
2659   IFS="$ac_save_ifs"
2660   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
2661   ;;
2662 esac
2663 fi
2664 PERLBIN="$ac_cv_path_PERLBIN"
2665 if test -n "$PERLBIN"; then
2666   echo "$ac_t""$PERLBIN" 1>&6
2667 else
2668   echo "$ac_t""no" 1>&6
2669 fi
2670
2671
2672         if test "no$PERLBIN" = "no" ; then
2673                 if test $ol_enable_perl = yes ; then
2674                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
2675                 fi
2676
2677         else
2678                 SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
2679                 SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
2680
2681                                 ol_link_perl=yes
2682         fi
2683 fi
2684
2685 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2686 echo "configure:2687: checking how to run the C preprocessor" >&5
2687 # On Suns, sometimes $CPP names a directory.
2688 if test -n "$CPP" && test -d "$CPP"; then
2689   CPP=
2690 fi
2691 if test -z "$CPP"; then
2692 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
2693   echo $ac_n "(cached) $ac_c" 1>&6
2694 else
2695     # This must be in double quotes, not single quotes, because CPP may get
2696   # substituted into the Makefile and "${CC-cc}" will confuse make.
2697   CPP="${CC-cc} -E"
2698   # On the NeXT, cc -E runs the code through the compiler's parser,
2699   # not just through cpp.
2700   cat > conftest.$ac_ext <<EOF
2701 #line 2702 "configure"
2702 #include "confdefs.h"
2703 #include <assert.h>
2704 Syntax Error
2705 EOF
2706 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2707 { (eval echo configure:2708: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2708 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2709 if test -z "$ac_err"; then
2710   :
2711 else
2712   echo "$ac_err" >&5
2713   echo "configure: failed program was:" >&5
2714   cat conftest.$ac_ext >&5
2715   rm -rf conftest*
2716   CPP="${CC-cc} -E -traditional-cpp"
2717   cat > conftest.$ac_ext <<EOF
2718 #line 2719 "configure"
2719 #include "confdefs.h"
2720 #include <assert.h>
2721 Syntax Error
2722 EOF
2723 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2724 { (eval echo configure:2725: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2725 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2726 if test -z "$ac_err"; then
2727   :
2728 else
2729   echo "$ac_err" >&5
2730   echo "configure: failed program was:" >&5
2731   cat conftest.$ac_ext >&5
2732   rm -rf conftest*
2733   CPP="${CC-cc} -nologo -E"
2734   cat > conftest.$ac_ext <<EOF
2735 #line 2736 "configure"
2736 #include "confdefs.h"
2737 #include <assert.h>
2738 Syntax Error
2739 EOF
2740 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2741 { (eval echo configure:2742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2742 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2743 if test -z "$ac_err"; then
2744   :
2745 else
2746   echo "$ac_err" >&5
2747   echo "configure: failed program was:" >&5
2748   cat conftest.$ac_ext >&5
2749   rm -rf conftest*
2750   CPP=/lib/cpp
2751 fi
2752 rm -f conftest*
2753 fi
2754 rm -f conftest*
2755 fi
2756 rm -f conftest*
2757   ac_cv_prog_CPP="$CPP"
2758 fi
2759   CPP="$ac_cv_prog_CPP"
2760 else
2761   ac_cv_prog_CPP="$CPP"
2762 fi
2763 echo "$ac_t""$CPP" 1>&6
2764
2765
2766 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
2767         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
2768
2769 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
2770         echo "configure: warning: programs compiled here do run here..." 1>&2
2771         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
2772
2773 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
2774         echo "configure: warning: programs compiled here do not run here..." 1>&2
2775         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
2776 fi
2777
2778 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2779 echo "configure:2780: checking for AIX" >&5
2780 cat > conftest.$ac_ext <<EOF
2781 #line 2782 "configure"
2782 #include "confdefs.h"
2783 #ifdef _AIX
2784   yes
2785 #endif
2786
2787 EOF
2788 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2789   egrep "yes" >/dev/null 2>&1; then
2790   rm -rf conftest*
2791   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
2792 #define _ALL_SOURCE 1
2793 EOF
2794
2795 else
2796   rm -rf conftest*
2797   echo "$ac_t""no" 1>&6
2798 fi
2799 rm -f conftest*
2800
2801
2802 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
2803 echo "configure:2804: checking for POSIXized ISC" >&5
2804 if test -d /etc/conf/kconfig.d &&
2805   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
2806 then
2807   echo "$ac_t""yes" 1>&6
2808   ISC=yes # If later tests want to check for ISC.
2809   cat >> confdefs.h <<\EOF
2810 #define _POSIX_SOURCE 1
2811 EOF
2812
2813   if test "$GCC" = yes; then
2814     CC="$CC -posix"
2815   else
2816     CC="$CC -Xp"
2817   fi
2818 else
2819   echo "$ac_t""no" 1>&6
2820   ISC=
2821 fi
2822
2823 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
2824 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
2825 echo "configure:2826: checking for minix/config.h" >&5
2826 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2827   echo $ac_n "(cached) $ac_c" 1>&6
2828 else
2829   cat > conftest.$ac_ext <<EOF
2830 #line 2831 "configure"
2831 #include "confdefs.h"
2832 #include <minix/config.h>
2833 EOF
2834 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2835 { (eval echo configure:2836: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2836 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2837 if test -z "$ac_err"; then
2838   rm -rf conftest*
2839   eval "ac_cv_header_$ac_safe=yes"
2840 else
2841   echo "$ac_err" >&5
2842   echo "configure: failed program was:" >&5
2843   cat conftest.$ac_ext >&5
2844   rm -rf conftest*
2845   eval "ac_cv_header_$ac_safe=no"
2846 fi
2847 rm -f conftest*
2848 fi
2849 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2850   echo "$ac_t""yes" 1>&6
2851   MINIX=yes
2852 else
2853   echo "$ac_t""no" 1>&6
2854 MINIX=
2855 fi
2856
2857 if test "$MINIX" = yes; then
2858   cat >> confdefs.h <<\EOF
2859 #define _POSIX_SOURCE 1
2860 EOF
2861
2862   cat >> confdefs.h <<\EOF
2863 #define _POSIX_1_SOURCE 2
2864 EOF
2865
2866   cat >> confdefs.h <<\EOF
2867 #define _MINIX 1
2868 EOF
2869
2870 fi
2871
2872
2873 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
2874 echo "configure:2875: checking for be_app in -lbe" >&5
2875 ac_lib_var=`echo be'_'be_app | sed 'y%./+-%__p_%'`
2876 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2877   echo $ac_n "(cached) $ac_c" 1>&6
2878 else
2879   ac_save_LIBS="$LIBS"
2880 LIBS="-lbe -lroot -lnet $LIBS"
2881 cat > conftest.$ac_ext <<EOF
2882 #line 2883 "configure"
2883 #include "confdefs.h"
2884 /* Override any gcc2 internal prototype to avoid an error.  */
2885 /* We use char because int might match the return type of a gcc2
2886     builtin and then its argument prototype would still apply.  */
2887 char be_app();
2888
2889 int main() {
2890 be_app()
2891 ; return 0; }
2892 EOF
2893 if { (eval echo configure:2894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2894   rm -rf conftest*
2895   eval "ac_cv_lib_$ac_lib_var=yes"
2896 else
2897   echo "configure: failed program was:" >&5
2898   cat conftest.$ac_ext >&5
2899   rm -rf conftest*
2900   eval "ac_cv_lib_$ac_lib_var=no"
2901 fi
2902 rm -f conftest*
2903 LIBS="$ac_save_LIBS"
2904
2905 fi
2906 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2907   echo "$ac_t""yes" 1>&6
2908   LIBS="$LIBS -lbe -lroot -lnet"
2909 else
2910   echo "$ac_t""no" 1>&6
2911 :
2912 fi
2913
2914
2915 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
2916 echo "configure:2917: checking for Cygwin environment" >&5
2917 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
2918   echo $ac_n "(cached) $ac_c" 1>&6
2919 else
2920   cat > conftest.$ac_ext <<EOF
2921 #line 2922 "configure"
2922 #include "confdefs.h"
2923
2924 int main() {
2925
2926 #ifndef __CYGWIN__
2927 #define __CYGWIN__ __CYGWIN32__
2928 #endif
2929 return __CYGWIN__;
2930 ; return 0; }
2931 EOF
2932 if { (eval echo configure:2933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2933   rm -rf conftest*
2934   ac_cv_cygwin=yes
2935 else
2936   echo "configure: failed program was:" >&5
2937   cat conftest.$ac_ext >&5
2938   rm -rf conftest*
2939   ac_cv_cygwin=no
2940 fi
2941 rm -f conftest*
2942 rm -f conftest*
2943 fi
2944
2945 echo "$ac_t""$ac_cv_cygwin" 1>&6
2946 CYGWIN=
2947 test "$ac_cv_cygwin" = yes && CYGWIN=yes
2948 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
2949 echo "configure:2950: checking for mingw32 environment" >&5
2950 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
2951   echo $ac_n "(cached) $ac_c" 1>&6
2952 else
2953   cat > conftest.$ac_ext <<EOF
2954 #line 2955 "configure"
2955 #include "confdefs.h"
2956
2957 int main() {
2958 return __MINGW32__;
2959 ; return 0; }
2960 EOF
2961 if { (eval echo configure:2962: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2962   rm -rf conftest*
2963   ac_cv_mingw32=yes
2964 else
2965   echo "configure: failed program was:" >&5
2966   cat conftest.$ac_ext >&5
2967   rm -rf conftest*
2968   ac_cv_mingw32=no
2969 fi
2970 rm -f conftest*
2971 rm -f conftest*
2972 fi
2973
2974 echo "$ac_t""$ac_cv_mingw32" 1>&6
2975 MINGW32=
2976 test "$ac_cv_mingw32" = yes && MINGW32=yes
2977
2978
2979 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
2980 echo "configure:2981: checking for executable suffix" >&5
2981 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
2982   echo $ac_n "(cached) $ac_c" 1>&6
2983 else
2984   if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
2985   ac_cv_exeext=.exe
2986 else
2987   rm -f conftest*
2988   echo 'int main () { return 0; }' > conftest.$ac_ext
2989   ac_cv_exeext=
2990   if { (eval echo configure:2991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
2991     for file in conftest.*; do
2992       case $file in
2993       *.c | *.o | *.obj) ;;
2994       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
2995       esac
2996     done
2997   else
2998     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
2999   fi
3000   rm -f conftest*
3001   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
3002 fi
3003 fi
3004
3005 EXEEXT=""
3006 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
3007 echo "$ac_t""${ac_cv_exeext}" 1>&6
3008 ac_exeext=$EXEEXT
3009
3010 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3011 echo "configure:3012: checking for object suffix" >&5
3012 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
3013   echo $ac_n "(cached) $ac_c" 1>&6
3014 else
3015   rm -f conftest*
3016 echo 'int i = 1;' > conftest.$ac_ext
3017 if { (eval echo configure:3018: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3018   for ac_file in conftest.*; do
3019     case $ac_file in
3020     *.c) ;;
3021     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
3022     esac
3023   done
3024 else
3025   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
3026 fi
3027 rm -f conftest*
3028 fi
3029
3030 echo "$ac_t""$ac_cv_objext" 1>&6
3031 OBJEXT=$ac_cv_objext
3032 ac_objext=$ac_cv_objext
3033
3034
3035 cat >> confdefs.h <<EOF
3036 #define EXEEXT "${EXEEXT}"
3037 EOF
3038
3039
3040
3041
3042
3043 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
3044 echo "configure:3045: checking for ${CC-cc} option to accept ANSI C" >&5
3045 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
3046   echo $ac_n "(cached) $ac_c" 1>&6
3047 else
3048   am_cv_prog_cc_stdc=no
3049 ac_save_CC="$CC"
3050 # Don't try gcc -ansi; that turns off useful extensions and
3051 # breaks some systems' header files.
3052 # AIX                   -qlanglvl=ansi
3053 # Ultrix and OSF/1      -std1
3054 # HP-UX                 -Aa -D_HPUX_SOURCE
3055 # SVR4                  -Xc -D__EXTENSIONS__
3056 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3057 do
3058   CC="$ac_save_CC $ac_arg"
3059   cat > conftest.$ac_ext <<EOF
3060 #line 3061 "configure"
3061 #include "confdefs.h"
3062 #include <stdarg.h>
3063 #include <stdio.h>
3064 #include <sys/types.h>
3065 #include <sys/stat.h>
3066 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3067 struct buf { int x; };
3068 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3069 static char *e (p, i)
3070      char **p;
3071      int i;
3072 {
3073   return p[i];
3074 }
3075 static char *f (char * (*g) (char **, int), char **p, ...)
3076 {
3077   char *s;
3078   va_list v;
3079   va_start (v,p);
3080   s = g (p, va_arg (v,int));
3081   va_end (v);
3082   return s;
3083 }
3084 int test (int i, double x);
3085 struct s1 {int (*f) (int a);};
3086 struct s2 {int (*f) (double a);};
3087 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3088 int argc;
3089 char **argv;
3090
3091 int main() {
3092
3093 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3094
3095 ; return 0; }
3096 EOF
3097 if { (eval echo configure:3098: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3098   rm -rf conftest*
3099   am_cv_prog_cc_stdc="$ac_arg"; break
3100 else
3101   echo "configure: failed program was:" >&5
3102   cat conftest.$ac_ext >&5
3103 fi
3104 rm -f conftest*
3105 done
3106 CC="$ac_save_CC"
3107
3108 fi
3109
3110 if test -z "$am_cv_prog_cc_stdc"; then
3111   echo "$ac_t""none needed" 1>&6
3112 else
3113   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
3114 fi
3115 case "x$am_cv_prog_cc_stdc" in
3116   x|xno) ;;
3117   *) CC="$CC $am_cv_prog_cc_stdc" ;;
3118 esac
3119
3120 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
3121         { echo "configure: error: OpenLDAP requires compiler to support STDC prototypes." 1>&2; exit 1; }
3122 fi
3123
3124
3125 # test for make depend flag
3126 OL_MKDEP=
3127 OL_MKDEP_FLAGS=
3128 if test -z "${MKDEP}"; then
3129         OL_MKDEP="${CC-cc}"
3130         if test -z "${MKDEP_FLAGS}"; then
3131                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
3132 echo "configure:3133: checking for ${OL_MKDEP} depend flag" >&5
3133 if eval "test \"`echo '$''{'ol_cv_mkdep'+set}'`\" = set"; then
3134   echo $ac_n "(cached) $ac_c" 1>&6
3135 else
3136   
3137                         ol_cv_mkdep=no
3138                         for flag in "-M" "-xM"; do
3139                                 cat > conftest.c <<EOF
3140  noCode;
3141 EOF
3142                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3143: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
3143                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
3144                                 then
3145                                         ol_cv_mkdep=$flag
3146                                         OL_MKDEP_FLAGS="$flag"
3147                                         break
3148                                 fi
3149                         done
3150                         rm -f conftest*
3151                 
3152 fi
3153
3154 echo "$ac_t""$ol_cv_mkdep" 1>&6
3155         else
3156                 cc_cv_mkdep=yes
3157                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3158         fi
3159 else
3160         cc_cv_mkdep=yes
3161         OL_MKDEP="${MKDEP}"
3162         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3163 fi
3164
3165
3166
3167 if test "${ol_cv_mkdep}" = no ; then
3168         # this will soon become an error
3169         echo "configure: warning: do not know how to generate dependencies" 1>&2
3170 fi
3171
3172
3173
3174 echo $ac_n "checking for socket""... $ac_c" 1>&6
3175 echo "configure:3176: checking for socket" >&5
3176 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
3177   echo $ac_n "(cached) $ac_c" 1>&6
3178 else
3179   cat > conftest.$ac_ext <<EOF
3180 #line 3181 "configure"
3181 #include "confdefs.h"
3182 /* System header to define __stub macros and hopefully few prototypes,
3183     which can conflict with char socket(); below.  */
3184 #include <assert.h>
3185 /* Override any gcc2 internal prototype to avoid an error.  */
3186 /* We use char because int might match the return type of a gcc2
3187     builtin and then its argument prototype would still apply.  */
3188 char socket();
3189
3190 int main() {
3191
3192 /* The GNU C library defines this for functions which it implements
3193     to always fail with ENOSYS.  Some functions are actually named
3194     something starting with __ and the normal name is an alias.  */
3195 #if defined (__stub_socket) || defined (__stub___socket)
3196 choke me
3197 #else
3198 socket();
3199 #endif
3200
3201 ; return 0; }
3202 EOF
3203 if { (eval echo configure:3204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3204   rm -rf conftest*
3205   eval "ac_cv_func_socket=yes"
3206 else
3207   echo "configure: failed program was:" >&5
3208   cat conftest.$ac_ext >&5
3209   rm -rf conftest*
3210   eval "ac_cv_func_socket=no"
3211 fi
3212 rm -f conftest*
3213 fi
3214
3215 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
3216   echo "$ac_t""yes" 1>&6
3217   :
3218 else
3219   echo "$ac_t""no" 1>&6
3220         
3221         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
3222 echo "configure:3223: checking for main in -lsocket" >&5
3223 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
3224 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3225   echo $ac_n "(cached) $ac_c" 1>&6
3226 else
3227   ac_save_LIBS="$LIBS"
3228 LIBS="-lsocket  $LIBS"
3229 cat > conftest.$ac_ext <<EOF
3230 #line 3231 "configure"
3231 #include "confdefs.h"
3232
3233 int main() {
3234 main()
3235 ; return 0; }
3236 EOF
3237 if { (eval echo configure:3238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3238   rm -rf conftest*
3239   eval "ac_cv_lib_$ac_lib_var=yes"
3240 else
3241   echo "configure: failed program was:" >&5
3242   cat conftest.$ac_ext >&5
3243   rm -rf conftest*
3244   eval "ac_cv_lib_$ac_lib_var=no"
3245 fi
3246 rm -f conftest*
3247 LIBS="$ac_save_LIBS"
3248
3249 fi
3250 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3251   echo "$ac_t""yes" 1>&6
3252     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3253     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3254   cat >> confdefs.h <<EOF
3255 #define $ac_tr_lib 1
3256 EOF
3257
3258   LIBS="-lsocket $LIBS"
3259
3260 else
3261   echo "$ac_t""no" 1>&6
3262 fi
3263
3264         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
3265 echo "configure:3266: checking for main in -lnet" >&5
3266 ac_lib_var=`echo net'_'main | sed 'y%./+-%__p_%'`
3267 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3268   echo $ac_n "(cached) $ac_c" 1>&6
3269 else
3270   ac_save_LIBS="$LIBS"
3271 LIBS="-lnet  $LIBS"
3272 cat > conftest.$ac_ext <<EOF
3273 #line 3274 "configure"
3274 #include "confdefs.h"
3275
3276 int main() {
3277 main()
3278 ; return 0; }
3279 EOF
3280 if { (eval echo configure:3281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3281   rm -rf conftest*
3282   eval "ac_cv_lib_$ac_lib_var=yes"
3283 else
3284   echo "configure: failed program was:" >&5
3285   cat conftest.$ac_ext >&5
3286   rm -rf conftest*
3287   eval "ac_cv_lib_$ac_lib_var=no"
3288 fi
3289 rm -f conftest*
3290 LIBS="$ac_save_LIBS"
3291
3292 fi
3293 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3294   echo "$ac_t""yes" 1>&6
3295     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3296     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3297   cat >> confdefs.h <<EOF
3298 #define $ac_tr_lib 1
3299 EOF
3300
3301   LIBS="-lnet $LIBS"
3302
3303 else
3304   echo "$ac_t""no" 1>&6
3305 fi
3306
3307         echo $ac_n "checking for socket in -lnet""... $ac_c" 1>&6
3308 echo "configure:3309: checking for socket in -lnet" >&5
3309 ac_lib_var=`echo net'_'socket | sed 'y%./+-%__p_%'`
3310 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3311   echo $ac_n "(cached) $ac_c" 1>&6
3312 else
3313   ac_save_LIBS="$LIBS"
3314 LIBS="-lnet  $LIBS"
3315 cat > conftest.$ac_ext <<EOF
3316 #line 3317 "configure"
3317 #include "confdefs.h"
3318 /* Override any gcc2 internal prototype to avoid an error.  */
3319 /* We use char because int might match the return type of a gcc2
3320     builtin and then its argument prototype would still apply.  */
3321 char socket();
3322
3323 int main() {
3324 socket()
3325 ; return 0; }
3326 EOF
3327 if { (eval echo configure:3328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3328   rm -rf conftest*
3329   eval "ac_cv_lib_$ac_lib_var=yes"
3330 else
3331   echo "configure: failed program was:" >&5
3332   cat conftest.$ac_ext >&5
3333   rm -rf conftest*
3334   eval "ac_cv_lib_$ac_lib_var=no"
3335 fi
3336 rm -f conftest*
3337 LIBS="$ac_save_LIBS"
3338
3339 fi
3340 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3341   echo "$ac_t""yes" 1>&6
3342     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3343     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3344   cat >> confdefs.h <<EOF
3345 #define $ac_tr_lib 1
3346 EOF
3347
3348   LIBS="-lnet $LIBS"
3349
3350 else
3351   echo "$ac_t""no" 1>&6
3352 fi
3353
3354         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
3355 echo "configure:3356: checking for main in -lnsl_s" >&5
3356 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-%__p_%'`
3357 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3358   echo $ac_n "(cached) $ac_c" 1>&6
3359 else
3360   ac_save_LIBS="$LIBS"
3361 LIBS="-lnsl_s  $LIBS"
3362 cat > conftest.$ac_ext <<EOF
3363 #line 3364 "configure"
3364 #include "confdefs.h"
3365
3366 int main() {
3367 main()
3368 ; return 0; }
3369 EOF
3370 if { (eval echo configure:3371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3371   rm -rf conftest*
3372   eval "ac_cv_lib_$ac_lib_var=yes"
3373 else
3374   echo "configure: failed program was:" >&5
3375   cat conftest.$ac_ext >&5
3376   rm -rf conftest*
3377   eval "ac_cv_lib_$ac_lib_var=no"
3378 fi
3379 rm -f conftest*
3380 LIBS="$ac_save_LIBS"
3381
3382 fi
3383 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3384   echo "$ac_t""yes" 1>&6
3385     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3386     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3387   cat >> confdefs.h <<EOF
3388 #define $ac_tr_lib 1
3389 EOF
3390
3391   LIBS="-lnsl_s $LIBS"
3392
3393 else
3394   echo "$ac_t""no" 1>&6
3395 fi
3396
3397         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
3398 echo "configure:3399: checking for main in -lnsl" >&5
3399 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
3400 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3401   echo $ac_n "(cached) $ac_c" 1>&6
3402 else
3403   ac_save_LIBS="$LIBS"
3404 LIBS="-lnsl  $LIBS"
3405 cat > conftest.$ac_ext <<EOF
3406 #line 3407 "configure"
3407 #include "confdefs.h"
3408
3409 int main() {
3410 main()
3411 ; return 0; }
3412 EOF
3413 if { (eval echo configure:3414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3414   rm -rf conftest*
3415   eval "ac_cv_lib_$ac_lib_var=yes"
3416 else
3417   echo "configure: failed program was:" >&5
3418   cat conftest.$ac_ext >&5
3419   rm -rf conftest*
3420   eval "ac_cv_lib_$ac_lib_var=no"
3421 fi
3422 rm -f conftest*
3423 LIBS="$ac_save_LIBS"
3424
3425 fi
3426 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3427   echo "$ac_t""yes" 1>&6
3428     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3429     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3430   cat >> confdefs.h <<EOF
3431 #define $ac_tr_lib 1
3432 EOF
3433
3434   LIBS="-lnsl $LIBS"
3435
3436 else
3437   echo "$ac_t""no" 1>&6
3438 fi
3439
3440         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
3441 echo "configure:3442: checking for socket in -linet" >&5
3442 ac_lib_var=`echo inet'_'socket | 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="-linet  $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 socket();
3455
3456 int main() {
3457 socket()
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 inet | 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="-linet $LIBS"
3482
3483 else
3484   echo "$ac_t""no" 1>&6
3485 fi
3486
3487         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
3488 echo "configure:3489: checking for main in -lgen" >&5
3489 ac_lib_var=`echo gen'_'main | sed 'y%./+-%__p_%'`
3490 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3491   echo $ac_n "(cached) $ac_c" 1>&6
3492 else
3493   ac_save_LIBS="$LIBS"
3494 LIBS="-lgen  $LIBS"
3495 cat > conftest.$ac_ext <<EOF
3496 #line 3497 "configure"
3497 #include "confdefs.h"
3498
3499 int main() {
3500 main()
3501 ; return 0; }
3502 EOF
3503 if { (eval echo configure:3504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3504   rm -rf conftest*
3505   eval "ac_cv_lib_$ac_lib_var=yes"
3506 else
3507   echo "configure: failed program was:" >&5
3508   cat conftest.$ac_ext >&5
3509   rm -rf conftest*
3510   eval "ac_cv_lib_$ac_lib_var=no"
3511 fi
3512 rm -f conftest*
3513 LIBS="$ac_save_LIBS"
3514
3515 fi
3516 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3517   echo "$ac_t""yes" 1>&6
3518     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3519     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3520   cat >> confdefs.h <<EOF
3521 #define $ac_tr_lib 1
3522 EOF
3523
3524   LIBS="-lgen $LIBS"
3525
3526 else
3527   echo "$ac_t""no" 1>&6
3528 fi
3529
3530
3531 fi
3532
3533
3534 for ac_func in res_search
3535 do
3536 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3537 echo "configure:3538: checking for $ac_func" >&5
3538 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3539   echo $ac_n "(cached) $ac_c" 1>&6
3540 else
3541   cat > conftest.$ac_ext <<EOF
3542 #line 3543 "configure"
3543 #include "confdefs.h"
3544 /* System header to define __stub macros and hopefully few prototypes,
3545     which can conflict with char $ac_func(); below.  */
3546 #include <assert.h>
3547 /* Override any gcc2 internal prototype to avoid an error.  */
3548 /* We use char because int might match the return type of a gcc2
3549     builtin and then its argument prototype would still apply.  */
3550 char $ac_func();
3551
3552 int main() {
3553
3554 /* The GNU C library defines this for functions which it implements
3555     to always fail with ENOSYS.  Some functions are actually named
3556     something starting with __ and the normal name is an alias.  */
3557 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3558 choke me
3559 #else
3560 $ac_func();
3561 #endif
3562
3563 ; return 0; }
3564 EOF
3565 if { (eval echo configure:3566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3566   rm -rf conftest*
3567   eval "ac_cv_func_$ac_func=yes"
3568 else
3569   echo "configure: failed program was:" >&5
3570   cat conftest.$ac_ext >&5
3571   rm -rf conftest*
3572   eval "ac_cv_func_$ac_func=no"
3573 fi
3574 rm -f conftest*
3575 fi
3576
3577 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3578   echo "$ac_t""yes" 1>&6
3579     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3580   cat >> confdefs.h <<EOF
3581 #define $ac_tr_func 1
3582 EOF
3583  
3584 else
3585   echo "$ac_t""no" 1>&6
3586 fi
3587 done
3588
3589 if test $ac_cv_func_res_search = "no" ; then 
3590         echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
3591 echo "configure:3592: checking for res_search in -lbind" >&5
3592 ac_lib_var=`echo bind'_'res_search | sed 'y%./+-%__p_%'`
3593 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3594   echo $ac_n "(cached) $ac_c" 1>&6
3595 else
3596   ac_save_LIBS="$LIBS"
3597 LIBS="-lbind  $LIBS"
3598 cat > conftest.$ac_ext <<EOF
3599 #line 3600 "configure"
3600 #include "confdefs.h"
3601 /* Override any gcc2 internal prototype to avoid an error.  */
3602 /* We use char because int might match the return type of a gcc2
3603     builtin and then its argument prototype would still apply.  */
3604 char res_search();
3605
3606 int main() {
3607 res_search()
3608 ; return 0; }
3609 EOF
3610 if { (eval echo configure:3611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3611   rm -rf conftest*
3612   eval "ac_cv_lib_$ac_lib_var=yes"
3613 else
3614   echo "configure: failed program was:" >&5
3615   cat conftest.$ac_ext >&5
3616   rm -rf conftest*
3617   eval "ac_cv_lib_$ac_lib_var=no"
3618 fi
3619 rm -f conftest*
3620 LIBS="$ac_save_LIBS"
3621
3622 fi
3623 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3624   echo "$ac_t""yes" 1>&6
3625     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3626     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3627   cat >> confdefs.h <<EOF
3628 #define $ac_tr_lib 1
3629 EOF
3630
3631   LIBS="-lbind $LIBS"
3632
3633 else
3634   echo "$ac_t""no" 1>&6
3635 fi
3636
3637         if test "$ac_cv_lib_bind_res_search" = "yes" ; then
3638                 cat >> confdefs.h <<\EOF
3639 #define HAVE_RES_SEARCH 1
3640 EOF
3641
3642         else
3643                 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
3644 echo "configure:3645: checking for res_search in -lresolv" >&5
3645 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
3646 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3647   echo $ac_n "(cached) $ac_c" 1>&6
3648 else
3649   ac_save_LIBS="$LIBS"
3650 LIBS="-lresolv  $LIBS"
3651 cat > conftest.$ac_ext <<EOF
3652 #line 3653 "configure"
3653 #include "confdefs.h"
3654 /* Override any gcc2 internal prototype to avoid an error.  */
3655 /* We use char because int might match the return type of a gcc2
3656     builtin and then its argument prototype would still apply.  */
3657 char res_search();
3658
3659 int main() {
3660 res_search()
3661 ; return 0; }
3662 EOF
3663 if { (eval echo configure:3664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3664   rm -rf conftest*
3665   eval "ac_cv_lib_$ac_lib_var=yes"
3666 else
3667   echo "configure: failed program was:" >&5
3668   cat conftest.$ac_ext >&5
3669   rm -rf conftest*
3670   eval "ac_cv_lib_$ac_lib_var=no"
3671 fi
3672 rm -f conftest*
3673 LIBS="$ac_save_LIBS"
3674
3675 fi
3676 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3677   echo "$ac_t""yes" 1>&6
3678     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3679     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3680   cat >> confdefs.h <<EOF
3681 #define $ac_tr_lib 1
3682 EOF
3683
3684   LIBS="-lresolv $LIBS"
3685
3686 else
3687   echo "$ac_t""no" 1>&6
3688 fi
3689
3690                 if test "$ac_cv_lib_resolv_res_search" = "yes" ; then
3691                         cat >> confdefs.h <<\EOF
3692 #define HAVE_RES_SEARCH 1
3693 EOF
3694
3695                 fi
3696         fi
3697 fi
3698
3699 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
3700 echo "configure:3701: checking for sigset in -lV3" >&5
3701 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-%__p_%'`
3702 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3703   echo $ac_n "(cached) $ac_c" 1>&6
3704 else
3705   ac_save_LIBS="$LIBS"
3706 LIBS="-lV3  $LIBS"
3707 cat > conftest.$ac_ext <<EOF
3708 #line 3709 "configure"
3709 #include "confdefs.h"
3710 /* Override any gcc2 internal prototype to avoid an error.  */
3711 /* We use char because int might match the return type of a gcc2
3712     builtin and then its argument prototype would still apply.  */
3713 char sigset();
3714
3715 int main() {
3716 sigset()
3717 ; return 0; }
3718 EOF
3719 if { (eval echo configure:3720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3720   rm -rf conftest*
3721   eval "ac_cv_lib_$ac_lib_var=yes"
3722 else
3723   echo "configure: failed program was:" >&5
3724   cat conftest.$ac_ext >&5
3725   rm -rf conftest*
3726   eval "ac_cv_lib_$ac_lib_var=no"
3727 fi
3728 rm -f conftest*
3729 LIBS="$ac_save_LIBS"
3730
3731 fi
3732 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3733   echo "$ac_t""yes" 1>&6
3734     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3735     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3736   cat >> confdefs.h <<EOF
3737 #define $ac_tr_lib 1
3738 EOF
3739
3740   LIBS="-lV3 $LIBS"
3741
3742 else
3743   echo "$ac_t""no" 1>&6
3744 fi
3745
3746
3747 for ac_hdr in regex.h 
3748 do
3749 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3750 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3751 echo "configure:3752: checking for $ac_hdr" >&5
3752 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3753   echo $ac_n "(cached) $ac_c" 1>&6
3754 else
3755   cat > conftest.$ac_ext <<EOF
3756 #line 3757 "configure"
3757 #include "confdefs.h"
3758 #include <$ac_hdr>
3759 EOF
3760 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3761 { (eval echo configure:3762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3762 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3763 if test -z "$ac_err"; then
3764   rm -rf conftest*
3765   eval "ac_cv_header_$ac_safe=yes"
3766 else
3767   echo "$ac_err" >&5
3768   echo "configure: failed program was:" >&5
3769   cat conftest.$ac_ext >&5
3770   rm -rf conftest*
3771   eval "ac_cv_header_$ac_safe=no"
3772 fi
3773 rm -f conftest*
3774 fi
3775 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3776   echo "$ac_t""yes" 1>&6
3777     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3778   cat >> confdefs.h <<EOF
3779 #define $ac_tr_hdr 1
3780 EOF
3781  
3782 else
3783   echo "$ac_t""no" 1>&6
3784 fi
3785 done
3786
3787 if test "$ac_cv_header_regex_h" != yes ; then
3788         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
3789 fi
3790 echo $ac_n "checking for regfree""... $ac_c" 1>&6
3791 echo "configure:3792: checking for regfree" >&5
3792 if eval "test \"`echo '$''{'ac_cv_func_regfree'+set}'`\" = set"; then
3793   echo $ac_n "(cached) $ac_c" 1>&6
3794 else
3795   cat > conftest.$ac_ext <<EOF
3796 #line 3797 "configure"
3797 #include "confdefs.h"
3798 /* System header to define __stub macros and hopefully few prototypes,
3799     which can conflict with char regfree(); below.  */
3800 #include <assert.h>
3801 /* Override any gcc2 internal prototype to avoid an error.  */
3802 /* We use char because int might match the return type of a gcc2
3803     builtin and then its argument prototype would still apply.  */
3804 char regfree();
3805
3806 int main() {
3807
3808 /* The GNU C library defines this for functions which it implements
3809     to always fail with ENOSYS.  Some functions are actually named
3810     something starting with __ and the normal name is an alias.  */
3811 #if defined (__stub_regfree) || defined (__stub___regfree)
3812 choke me
3813 #else
3814 regfree();
3815 #endif
3816
3817 ; return 0; }
3818 EOF
3819 if { (eval echo configure:3820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3820   rm -rf conftest*
3821   eval "ac_cv_func_regfree=yes"
3822 else
3823   echo "configure: failed program was:" >&5
3824   cat conftest.$ac_ext >&5
3825   rm -rf conftest*
3826   eval "ac_cv_func_regfree=no"
3827 fi
3828 rm -f conftest*
3829 fi
3830
3831 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
3832   echo "$ac_t""yes" 1>&6
3833   :
3834 else
3835   echo "$ac_t""no" 1>&6
3836 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
3837 fi
3838
3839
3840 echo $ac_n "checking for select""... $ac_c" 1>&6
3841 echo "configure:3842: checking for select" >&5
3842 if eval "test \"`echo '$''{'ac_cv_func_select'+set}'`\" = set"; then
3843   echo $ac_n "(cached) $ac_c" 1>&6
3844 else
3845   cat > conftest.$ac_ext <<EOF
3846 #line 3847 "configure"
3847 #include "confdefs.h"
3848 /* System header to define __stub macros and hopefully few prototypes,
3849     which can conflict with char select(); below.  */
3850 #include <assert.h>
3851 /* Override any gcc2 internal prototype to avoid an error.  */
3852 /* We use char because int might match the return type of a gcc2
3853     builtin and then its argument prototype would still apply.  */
3854 char select();
3855
3856 int main() {
3857
3858 /* The GNU C library defines this for functions which it implements
3859     to always fail with ENOSYS.  Some functions are actually named
3860     something starting with __ and the normal name is an alias.  */
3861 #if defined (__stub_select) || defined (__stub___select)
3862 choke me
3863 #else
3864 select();
3865 #endif
3866
3867 ; return 0; }
3868 EOF
3869 if { (eval echo configure:3870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3870   rm -rf conftest*
3871   eval "ac_cv_func_select=yes"
3872 else
3873   echo "configure: failed program was:" >&5
3874   cat conftest.$ac_ext >&5
3875   rm -rf conftest*
3876   eval "ac_cv_func_select=no"
3877 fi
3878 rm -f conftest*
3879 fi
3880
3881 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
3882   echo "$ac_t""yes" 1>&6
3883   :
3884 else
3885   echo "$ac_t""no" 1>&6
3886 { echo "configure: error: select() required." 1>&2; exit 1; }
3887 fi
3888
3889
3890 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
3891 echo "configure:3892: checking types of arguments for select()" >&5
3892  if eval "test \"`echo '$''{'ac_cv_func_select_arg234'+set}'`\" = set"; then
3893   echo $ac_n "(cached) $ac_c" 1>&6
3894 else
3895    if eval "test \"`echo '$''{'ac_cv_func_select_arg1'+set}'`\" = set"; then
3896   echo $ac_n "(cached) $ac_c" 1>&6
3897 else
3898     if eval "test \"`echo '$''{'ac_cv_func_select_arg5'+set}'`\" = set"; then
3899   echo $ac_n "(cached) $ac_c" 1>&6
3900 else
3901      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
3902      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
3903       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
3904        cat > conftest.$ac_ext <<EOF
3905 #line 3906 "configure"
3906 #include "confdefs.h"
3907 #ifdef HAVE_SYS_TYPES_H
3908 #include <sys/types.h>
3909 #endif
3910 #ifdef HAVE_SYS_TIME_H
3911 #include <sys/time.h>
3912 #endif
3913 #ifdef HAVE_SYS_SELECT_H
3914 #include <sys/select.h>
3915 #endif
3916 #ifdef HAVE_SYS_SOCKET_H
3917 #include <sys/socket.h>
3918 #endif
3919 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);
3920 int main() {
3921
3922 ; return 0; }
3923 EOF
3924 if { (eval echo configure:3925: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3925   rm -rf conftest*
3926           ac_not_found=no ; break 3
3927 else
3928   echo "configure: failed program was:" >&5
3929   cat conftest.$ac_ext >&5
3930   rm -rf conftest*
3931   ac_not_found=yes
3932 fi
3933 rm -f conftest*
3934       done
3935      done
3936     done
3937    
3938 fi
3939   
3940 fi
3941  
3942 fi
3943  if test "$ac_not_found" = yes; then
3944   ac_cv_func_select_arg1=int 
3945   ac_cv_func_select_arg234='int *' 
3946   ac_cv_func_select_arg5='struct timeval *'
3947  fi
3948  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
3949  cat >> confdefs.h <<EOF
3950 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
3951 EOF
3952
3953  cat >> confdefs.h <<EOF
3954 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
3955 EOF
3956
3957  cat >> confdefs.h <<EOF
3958 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
3959 EOF
3960
3961
3962
3963 # ISODE tests
3964 ol_link_isode=no
3965 if test $ol_enable_ldapd != no ; then
3966         echo "configure: warning: ldapd support deprecated.  Manual intervention required." 1>&2
3967
3968                 echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
3969 echo "configure:3970: checking for main in -lxtpp" >&5
3970 ac_lib_var=`echo xtpp'_'main | sed 'y%./+-%__p_%'`
3971 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3972   echo $ac_n "(cached) $ac_c" 1>&6
3973 else
3974   ac_save_LIBS="$LIBS"
3975 LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
3976 cat > conftest.$ac_ext <<EOF
3977 #line 3978 "configure"
3978 #include "confdefs.h"
3979
3980 int main() {
3981 main()
3982 ; return 0; }
3983 EOF
3984 if { (eval echo configure:3985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3985   rm -rf conftest*
3986   eval "ac_cv_lib_$ac_lib_var=yes"
3987 else
3988   echo "configure: failed program was:" >&5
3989   cat conftest.$ac_ext >&5
3990   rm -rf conftest*
3991   eval "ac_cv_lib_$ac_lib_var=no"
3992 fi
3993 rm -f conftest*
3994 LIBS="$ac_save_LIBS"
3995
3996 fi
3997 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3998   echo "$ac_t""yes" 1>&6
3999   
4000                 ol_link_isode=yes
4001                 cat >> confdefs.h <<\EOF
4002 #define HAVE_XTPP 1
4003 EOF
4004
4005                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
4006                 
4007 else
4008   echo "$ac_t""no" 1>&6
4009 :
4010 fi
4011
4012         echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
4013 echo "configure:4014: checking for main in -ldsap" >&5
4014 ac_lib_var=`echo dsap'_'main | sed 'y%./+-%__p_%'`
4015 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4016   echo $ac_n "(cached) $ac_c" 1>&6
4017 else
4018   ac_save_LIBS="$LIBS"
4019 LIBS="-ldsap -lisode $LIBS"
4020 cat > conftest.$ac_ext <<EOF
4021 #line 4022 "configure"
4022 #include "confdefs.h"
4023
4024 int main() {
4025 main()
4026 ; return 0; }
4027 EOF
4028 if { (eval echo configure:4029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4029   rm -rf conftest*
4030   eval "ac_cv_lib_$ac_lib_var=yes"
4031 else
4032   echo "configure: failed program was:" >&5
4033   cat conftest.$ac_ext >&5
4034   rm -rf conftest*
4035   eval "ac_cv_lib_$ac_lib_var=no"
4036 fi
4037 rm -f conftest*
4038 LIBS="$ac_save_LIBS"
4039
4040 fi
4041 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4042   echo "$ac_t""yes" 1>&6
4043   
4044                 ol_link_isode=yes
4045                 cat >> confdefs.h <<\EOF
4046 #define HAVE_DSAP 1
4047 EOF
4048
4049                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
4050                 
4051 else
4052   echo "$ac_t""no" 1>&6
4053 :
4054 fi
4055
4056         echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
4057 echo "configure:4058: checking for main in -lisode" >&5
4058 ac_lib_var=`echo isode'_'main | sed 'y%./+-%__p_%'`
4059 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4060   echo $ac_n "(cached) $ac_c" 1>&6
4061 else
4062   ac_save_LIBS="$LIBS"
4063 LIBS="-lisode  $LIBS"
4064 cat > conftest.$ac_ext <<EOF
4065 #line 4066 "configure"
4066 #include "confdefs.h"
4067
4068 int main() {
4069 main()
4070 ; return 0; }
4071 EOF
4072 if { (eval echo configure:4073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4073   rm -rf conftest*
4074   eval "ac_cv_lib_$ac_lib_var=yes"
4075 else
4076   echo "configure: failed program was:" >&5
4077   cat conftest.$ac_ext >&5
4078   rm -rf conftest*
4079   eval "ac_cv_lib_$ac_lib_var=no"
4080 fi
4081 rm -f conftest*
4082 LIBS="$ac_save_LIBS"
4083
4084 fi
4085 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4086   echo "$ac_t""yes" 1>&6
4087   
4088                 ol_link_isode=yes
4089                 cat >> confdefs.h <<\EOF
4090 #define HAVE_ISODE 1
4091 EOF
4092
4093                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
4094                 
4095 else
4096   echo "$ac_t""no" 1>&6
4097 :
4098 fi
4099
4100 fi
4101
4102 if test $ol_link_isode != no; then
4103         echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
4104 echo "configure:4105: checking for main in -lpp" >&5
4105 ac_lib_var=`echo pp'_'main | sed 'y%./+-%__p_%'`
4106 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4107   echo $ac_n "(cached) $ac_c" 1>&6
4108 else
4109   ac_save_LIBS="$LIBS"
4110 LIBS="-lpp  $LIBS"
4111 cat > conftest.$ac_ext <<EOF
4112 #line 4113 "configure"
4113 #include "confdefs.h"
4114
4115 int main() {
4116 main()
4117 ; return 0; }
4118 EOF
4119 if { (eval echo configure:4120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4120   rm -rf conftest*
4121   eval "ac_cv_lib_$ac_lib_var=yes"
4122 else
4123   echo "configure: failed program was:" >&5
4124   cat conftest.$ac_ext >&5
4125   rm -rf conftest*
4126   eval "ac_cv_lib_$ac_lib_var=no"
4127 fi
4128 rm -f conftest*
4129 LIBS="$ac_save_LIBS"
4130
4131 fi
4132 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4133   echo "$ac_t""yes" 1>&6
4134   
4135                 cat >> confdefs.h <<\EOF
4136 #define HAVE_PP 1
4137 EOF
4138
4139                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
4140                 
4141 else
4142   echo "$ac_t""no" 1>&6
4143 :
4144 fi
4145
4146
4147         # Extract the first word of "pepsy", so it can be a program name with args.
4148 set dummy pepsy; ac_word=$2
4149 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4150 echo "configure:4151: checking for $ac_word" >&5
4151 if eval "test \"`echo '$''{'ac_cv_path_PEPSY'+set}'`\" = set"; then
4152   echo $ac_n "(cached) $ac_c" 1>&6
4153 else
4154   case "$PEPSY" in
4155   /*)
4156   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a path.
4157   ;;
4158   ?:/*)                  
4159   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a dos path.
4160   ;;
4161   *)
4162   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4163   ac_dummy="$PATH"
4164   for ac_dir in $ac_dummy; do 
4165     test -z "$ac_dir" && ac_dir=.
4166     if test -f $ac_dir/$ac_word; then
4167       ac_cv_path_PEPSY="$ac_dir/$ac_word"
4168       break
4169     fi
4170   done
4171   IFS="$ac_save_ifs"
4172   ;;
4173 esac
4174 fi
4175 PEPSY="$ac_cv_path_PEPSY"
4176 if test -n "$PEPSY"; then
4177   echo "$ac_t""$PEPSY" 1>&6
4178 else
4179   echo "$ac_t""no" 1>&6
4180 fi
4181
4182 fi
4183
4184 ol_link_kerberos=no
4185
4186 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
4187         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
4188 do
4189 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4190 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4191 echo "configure:4192: checking for $ac_hdr" >&5
4192 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4193   echo $ac_n "(cached) $ac_c" 1>&6
4194 else
4195   cat > conftest.$ac_ext <<EOF
4196 #line 4197 "configure"
4197 #include "confdefs.h"
4198 #include <$ac_hdr>
4199 EOF
4200 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4201 { (eval echo configure:4202: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4202 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4203 if test -z "$ac_err"; then
4204   rm -rf conftest*
4205   eval "ac_cv_header_$ac_safe=yes"
4206 else
4207   echo "$ac_err" >&5
4208   echo "configure: failed program was:" >&5
4209   cat conftest.$ac_ext >&5
4210   rm -rf conftest*
4211   eval "ac_cv_header_$ac_safe=no"
4212 fi
4213 rm -f conftest*
4214 fi
4215 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4216   echo "$ac_t""yes" 1>&6
4217     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4218   cat >> confdefs.h <<EOF
4219 #define $ac_tr_hdr 1
4220 EOF
4221  
4222 else
4223   echo "$ac_t""no" 1>&6
4224 fi
4225 done
4226
4227
4228         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
4229                 echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
4230 echo "configure:4231: checking for main in -lkrb4" >&5
4231 ac_lib_var=`echo krb4'_'main | sed 'y%./+-%__p_%'`
4232 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4233   echo $ac_n "(cached) $ac_c" 1>&6
4234 else
4235   ac_save_LIBS="$LIBS"
4236 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
4237 cat > conftest.$ac_ext <<EOF
4238 #line 4239 "configure"
4239 #include "confdefs.h"
4240
4241 int main() {
4242 main()
4243 ; return 0; }
4244 EOF
4245 if { (eval echo configure:4246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4246   rm -rf conftest*
4247   eval "ac_cv_lib_$ac_lib_var=yes"
4248 else
4249   echo "configure: failed program was:" >&5
4250   cat conftest.$ac_ext >&5
4251   rm -rf conftest*
4252   eval "ac_cv_lib_$ac_lib_var=no"
4253 fi
4254 rm -f conftest*
4255 LIBS="$ac_save_LIBS"
4256
4257 fi
4258 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4259   echo "$ac_t""yes" 1>&6
4260   have_k5=yes
4261 else
4262   echo "$ac_t""no" 1>&6
4263 have_k5=no
4264 fi
4265
4266
4267                 if test $have_k5 = yes ; then
4268                         ol_with_kerberos=found
4269                         ol_link_kerberos=yes
4270
4271                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
4272
4273                         LIBS="$KRB_LIBS $LIBS"
4274
4275                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
4276 echo "configure:4277: checking for des_debug in Kerberos libraries" >&5
4277 if eval "test \"`echo '$''{'ol_cv_var_des_debug'+set}'`\" = set"; then
4278   echo $ac_n "(cached) $ac_c" 1>&6
4279 else
4280   
4281                                                                 save_LIBS="$LIBS"
4282                                 LIBS="$KRB_LIBS $LIBS"
4283                                 cat > conftest.$ac_ext <<EOF
4284 #line 4285 "configure"
4285 #include "confdefs.h"
4286
4287 #include <kerberosIV/krb.h>
4288 #include <kerberosIV/des.h>
4289 extern int des_debug;
4290
4291 int main() {
4292
4293 des_debug = 1;
4294
4295 ; return 0; }
4296 EOF
4297 if { (eval echo configure:4298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4298   rm -rf conftest*
4299   ol_cv_var_des_debug=yes
4300 else
4301   echo "configure: failed program was:" >&5
4302   cat conftest.$ac_ext >&5
4303   rm -rf conftest*
4304   ol_cv_var_des_debug=no
4305 fi
4306 rm -f conftest*
4307                                                                 LIBS="$save_LIBS"
4308                         
4309 fi
4310
4311 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
4312
4313                         if test $ol_cv_var_des_debug = yes ; then
4314                                 cat >> confdefs.h <<\EOF
4315 #define HAVE_DES_DEBUG 1
4316 EOF
4317
4318                         fi
4319
4320                         LIBS="$save_LIBS"
4321                 fi
4322         fi
4323 fi
4324
4325 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
4326         for ac_hdr in krb.h des.h
4327 do
4328 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4329 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4330 echo "configure:4331: checking for $ac_hdr" >&5
4331 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4332   echo $ac_n "(cached) $ac_c" 1>&6
4333 else
4334   cat > conftest.$ac_ext <<EOF
4335 #line 4336 "configure"
4336 #include "confdefs.h"
4337 #include <$ac_hdr>
4338 EOF
4339 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4340 { (eval echo configure:4341: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4341 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4342 if test -z "$ac_err"; then
4343   rm -rf conftest*
4344   eval "ac_cv_header_$ac_safe=yes"
4345 else
4346   echo "$ac_err" >&5
4347   echo "configure: failed program was:" >&5
4348   cat conftest.$ac_ext >&5
4349   rm -rf conftest*
4350   eval "ac_cv_header_$ac_safe=no"
4351 fi
4352 rm -f conftest*
4353 fi
4354 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4355   echo "$ac_t""yes" 1>&6
4356     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4357   cat >> confdefs.h <<EOF
4358 #define $ac_tr_hdr 1
4359 EOF
4360  
4361 else
4362   echo "$ac_t""no" 1>&6
4363 fi
4364 done
4365
4366
4367         if test $ac_cv_header_krb_h = yes ; then
4368                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
4369 echo "configure:4370: checking for main in -lkrb" >&5
4370 ac_lib_var=`echo krb'_'main | sed 'y%./+-%__p_%'`
4371 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4372   echo $ac_n "(cached) $ac_c" 1>&6
4373 else
4374   ac_save_LIBS="$LIBS"
4375 LIBS="-lkrb -ldes $LIBS"
4376 cat > conftest.$ac_ext <<EOF
4377 #line 4378 "configure"
4378 #include "confdefs.h"
4379
4380 int main() {
4381 main()
4382 ; return 0; }
4383 EOF
4384 if { (eval echo configure:4385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4385   rm -rf conftest*
4386   eval "ac_cv_lib_$ac_lib_var=yes"
4387 else
4388   echo "configure: failed program was:" >&5
4389   cat conftest.$ac_ext >&5
4390   rm -rf conftest*
4391   eval "ac_cv_lib_$ac_lib_var=no"
4392 fi
4393 rm -f conftest*
4394 LIBS="$ac_save_LIBS"
4395
4396 fi
4397 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4398   echo "$ac_t""yes" 1>&6
4399   have_k4=yes
4400 else
4401   echo "$ac_t""no" 1>&6
4402 have_k4=no
4403 fi
4404
4405
4406                 if test $have_k4 = yes ; then
4407                         ol_with_kerberos=found
4408                         ol_link_kerberos=yes
4409
4410                         KRB_LIBS="-lkrb -ldes"
4411                 fi
4412         fi
4413 fi
4414
4415 if test $ol_link_kerberos = yes ; then
4416         cat >> confdefs.h <<\EOF
4417 #define HAVE_KERBEROS 1
4418 EOF
4419
4420 fi
4421
4422 ol_link_tls=no
4423 if test $ol_with_tls != no ; then
4424         
4425         for ac_hdr in ssl.h
4426 do
4427 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4428 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4429 echo "configure:4430: checking for $ac_hdr" >&5
4430 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4431   echo $ac_n "(cached) $ac_c" 1>&6
4432 else
4433   cat > conftest.$ac_ext <<EOF
4434 #line 4435 "configure"
4435 #include "confdefs.h"
4436 #include <$ac_hdr>
4437 EOF
4438 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4439 { (eval echo configure:4440: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4440 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4441 if test -z "$ac_err"; then
4442   rm -rf conftest*
4443   eval "ac_cv_header_$ac_safe=yes"
4444 else
4445   echo "$ac_err" >&5
4446   echo "configure: failed program was:" >&5
4447   cat conftest.$ac_ext >&5
4448   rm -rf conftest*
4449   eval "ac_cv_header_$ac_safe=no"
4450 fi
4451 rm -f conftest*
4452 fi
4453 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4454   echo "$ac_t""yes" 1>&6
4455     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4456   cat >> confdefs.h <<EOF
4457 #define $ac_tr_hdr 1
4458 EOF
4459  
4460 else
4461   echo "$ac_t""no" 1>&6
4462 fi
4463 done
4464
4465         
4466         if test $ac_cv_header_ssl_h = yes ; then
4467                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
4468 echo "configure:4469: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
4469 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-%__p_%'`
4470 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4471   echo $ac_n "(cached) $ac_c" 1>&6
4472 else
4473   ac_save_LIBS="$LIBS"
4474 LIBS="-lssl -lcrypto $LIBS"
4475 cat > conftest.$ac_ext <<EOF
4476 #line 4477 "configure"
4477 #include "confdefs.h"
4478 /* Override any gcc2 internal prototype to avoid an error.  */
4479 /* We use char because int might match the return type of a gcc2
4480     builtin and then its argument prototype would still apply.  */
4481 char SSLeay_add_ssl_algorithms();
4482
4483 int main() {
4484 SSLeay_add_ssl_algorithms()
4485 ; return 0; }
4486 EOF
4487 if { (eval echo configure:4488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4488   rm -rf conftest*
4489   eval "ac_cv_lib_$ac_lib_var=yes"
4490 else
4491   echo "configure: failed program was:" >&5
4492   cat conftest.$ac_ext >&5
4493   rm -rf conftest*
4494   eval "ac_cv_lib_$ac_lib_var=no"
4495 fi
4496 rm -f conftest*
4497 LIBS="$ac_save_LIBS"
4498
4499 fi
4500 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4501   echo "$ac_t""yes" 1>&6
4502   have_ssleay=yes
4503                         need_rsaref=no
4504 else
4505   echo "$ac_t""no" 1>&6
4506 have_ssleay=no
4507 fi
4508
4509                         
4510                 if test $have_ssleay = no ; then
4511                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
4512 echo "configure:4513: checking for ssl3_accept in -lssl" >&5
4513 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-%__p_%'`
4514 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4515   echo $ac_n "(cached) $ac_c" 1>&6
4516 else
4517   ac_save_LIBS="$LIBS"
4518 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
4519 cat > conftest.$ac_ext <<EOF
4520 #line 4521 "configure"
4521 #include "confdefs.h"
4522 /* Override any gcc2 internal prototype to avoid an error.  */
4523 /* We use char because int might match the return type of a gcc2
4524     builtin and then its argument prototype would still apply.  */
4525 char ssl3_accept();
4526
4527 int main() {
4528 ssl3_accept()
4529 ; return 0; }
4530 EOF
4531 if { (eval echo configure:4532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4532   rm -rf conftest*
4533   eval "ac_cv_lib_$ac_lib_var=yes"
4534 else
4535   echo "configure: failed program was:" >&5
4536   cat conftest.$ac_ext >&5
4537   rm -rf conftest*
4538   eval "ac_cv_lib_$ac_lib_var=no"
4539 fi
4540 rm -f conftest*
4541 LIBS="$ac_save_LIBS"
4542
4543 fi
4544 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4545   echo "$ac_t""yes" 1>&6
4546   have_ssleay=yes
4547                                 need_rsaref=yes
4548 else
4549   echo "$ac_t""no" 1>&6
4550 have_ssleay=no
4551 fi
4552
4553                 fi
4554
4555                 if test $have_ssleay = yes ; then
4556                         ol_with_tls=found
4557                         ol_link_tls=yes
4558
4559                         cat >> confdefs.h <<\EOF
4560 #define HAVE_SSLEAY 1
4561 EOF
4562
4563
4564                         if test $need_rsaref = yes; then
4565                                 cat >> confdefs.h <<\EOF
4566 #define HAVE_RSAREF 1
4567 EOF
4568
4569
4570                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
4571                         else
4572                                 TLS_LIBS="-lssl -lcrypto"
4573                         fi
4574                 fi
4575         fi
4576 fi
4577
4578 if test $ol_link_tls = yes ; then
4579         cat >> confdefs.h <<\EOF
4580 #define HAVE_TLS 1
4581 EOF
4582
4583 fi      
4584
4585 for ac_func in \
4586         ctime_r                 \
4587         gethostbyname_r gethostbyaddr_r \
4588
4589 do
4590 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4591 echo "configure:4592: checking for $ac_func" >&5
4592 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4593   echo $ac_n "(cached) $ac_c" 1>&6
4594 else
4595   cat > conftest.$ac_ext <<EOF
4596 #line 4597 "configure"
4597 #include "confdefs.h"
4598 /* System header to define __stub macros and hopefully few prototypes,
4599     which can conflict with char $ac_func(); below.  */
4600 #include <assert.h>
4601 /* Override any gcc2 internal prototype to avoid an error.  */
4602 /* We use char because int might match the return type of a gcc2
4603     builtin and then its argument prototype would still apply.  */
4604 char $ac_func();
4605
4606 int main() {
4607
4608 /* The GNU C library defines this for functions which it implements
4609     to always fail with ENOSYS.  Some functions are actually named
4610     something starting with __ and the normal name is an alias.  */
4611 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4612 choke me
4613 #else
4614 $ac_func();
4615 #endif
4616
4617 ; return 0; }
4618 EOF
4619 if { (eval echo configure:4620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4620   rm -rf conftest*
4621   eval "ac_cv_func_$ac_func=yes"
4622 else
4623   echo "configure: failed program was:" >&5
4624   cat conftest.$ac_ext >&5
4625   rm -rf conftest*
4626   eval "ac_cv_func_$ac_func=no"
4627 fi
4628 rm -f conftest*
4629 fi
4630
4631 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4632   echo "$ac_t""yes" 1>&6
4633     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4634   cat >> confdefs.h <<EOF
4635 #define $ac_tr_func 1
4636 EOF
4637  
4638 else
4639   echo "$ac_t""no" 1>&6
4640 fi
4641 done
4642
4643
4644 if test "$ac_cv_func_ctime_r" = no ; then
4645         ol_cv_func_ctime_r_nargs=0
4646 else
4647         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
4648 echo "configure:4649: checking number of arguments of ctime_r" >&5
4649 if eval "test \"`echo '$''{'ol_cv_func_ctime_r_nargs'+set}'`\" = set"; then
4650   echo $ac_n "(cached) $ac_c" 1>&6
4651 else
4652   cat > conftest.$ac_ext <<EOF
4653 #line 4654 "configure"
4654 #include "confdefs.h"
4655 #include <time.h>
4656 int main() {
4657 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
4658 ; return 0; }
4659 EOF
4660 if { (eval echo configure:4661: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4661   rm -rf conftest*
4662   ol_cv_func_ctime_r_nargs=3
4663 else
4664   echo "configure: failed program was:" >&5
4665   cat conftest.$ac_ext >&5
4666   rm -rf conftest*
4667   cat > conftest.$ac_ext <<EOF
4668 #line 4669 "configure"
4669 #include "confdefs.h"
4670 #include <time.h>
4671 int main() {
4672 time_t ti; char *buffer; ctime_r(&ti,buffer);
4673 ; return 0; }
4674 EOF
4675 if { (eval echo configure:4676: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4676   rm -rf conftest*
4677   ol_cv_func_ctime_r_nargs=2
4678 else
4679   echo "configure: failed program was:" >&5
4680   cat conftest.$ac_ext >&5
4681   rm -rf conftest*
4682   ol_cv_func_ctime_r_nargs=0
4683 fi
4684 rm -f conftest*
4685 fi
4686 rm -f conftest*
4687 fi
4688
4689 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
4690   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
4691     cat >> confdefs.h <<EOF
4692 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
4693 EOF
4694
4695   fi
4696
4697 fi
4698
4699 if test "$ac_cv_func_gethostbyname_r" = yes ; then
4700         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
4701 echo "configure:4702: checking number of arguments of gethostbyname_r" >&5
4702 if eval "test \"`echo '$''{'ol_cv_func_gethostbyname_r_nargs'+set}'`\" = set"; then
4703   echo $ac_n "(cached) $ac_c" 1>&6
4704 else
4705   cat > conftest.$ac_ext <<EOF
4706 #line 4707 "configure"
4707 #include "confdefs.h"
4708 #include <sys/types.h>
4709 #include <sys/socket.h>
4710 #include <netinet/in.h>
4711 #include <netdb.h>
4712 #define BUFSIZE (sizeof(struct hostent)+10)
4713 int main() {
4714 struct hostent hent; char buffer[BUFSIZE];
4715                 int bufsize=BUFSIZE;int h_errno;
4716                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
4717                         buffer, bufsize, &h_errno);
4718 ; return 0; }
4719 EOF
4720 if { (eval echo configure:4721: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4721   rm -rf conftest*
4722   ol_cv_func_gethostbyname_r_nargs=5
4723 else
4724   echo "configure: failed program was:" >&5
4725   cat conftest.$ac_ext >&5
4726   rm -rf conftest*
4727   cat > conftest.$ac_ext <<EOF
4728 #line 4729 "configure"
4729 #include "confdefs.h"
4730 #include <sys/types.h>
4731 #include <sys/socket.h>
4732 #include <netinet/in.h>
4733 #include <netdb.h>
4734 #define BUFSIZE (sizeof(struct hostent)+10)
4735 int main() {
4736 struct hostent hent;struct hostent *rhent;
4737                         char buffer[BUFSIZE];
4738                         int bufsize=BUFSIZE;int h_errno;
4739                         (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
4740                                 &rhent, &h_errno);
4741 ; return 0; }
4742 EOF
4743 if { (eval echo configure:4744: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4744   rm -rf conftest*
4745   ol_cv_func_gethostbyname_r_nargs=6
4746 else
4747   echo "configure: failed program was:" >&5
4748   cat conftest.$ac_ext >&5
4749   rm -rf conftest*
4750   ol_cv_func_gethostbyname_r_nargs=0
4751 fi
4752 rm -f conftest*
4753 fi
4754 rm -f conftest*
4755 fi
4756
4757 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
4758   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
4759         cat >> confdefs.h <<EOF
4760 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
4761 EOF
4762
4763   fi
4764
4765 else
4766         ol_cv_func_gethostbyname_r_nargs=0
4767 fi
4768  
4769 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
4770         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
4771 echo "configure:4772: checking number of arguments of gethostbyaddr_r" >&5
4772 if eval "test \"`echo '$''{'ol_cv_func_gethostbyaddr_r_nargs'+set}'`\" = set"; then
4773   echo $ac_n "(cached) $ac_c" 1>&6
4774 else
4775   cat > conftest.$ac_ext <<EOF
4776 #line 4777 "configure"
4777 #include "confdefs.h"
4778 #include <sys/types.h>
4779 #include <sys/socket.h>
4780 #include <netinet/in.h>
4781 #include <netdb.h>
4782 #define BUFSIZE (sizeof(struct hostent)+10)
4783 int main() {
4784 struct hostent hent; char buffer[BUFSIZE]; 
4785             struct in_addr add;
4786             size_t alen=sizeof(struct in_addr);
4787             int bufsize=BUFSIZE;int h_errno;
4788                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
4789                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
4790 ; return 0; }
4791 EOF
4792 if { (eval echo configure:4793: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4793   rm -rf conftest*
4794   ol_cv_func_gethostbyaddr_r_nargs=7
4795 else
4796   echo "configure: failed program was:" >&5
4797   cat conftest.$ac_ext >&5
4798   rm -rf conftest*
4799   cat > conftest.$ac_ext <<EOF
4800 #line 4801 "configure"
4801 #include "confdefs.h"
4802 #include <sys/types.h>
4803 #include <sys/socket.h>
4804 #include <netinet/in.h>
4805 #include <netdb.h>
4806 #define BUFSIZE (sizeof(struct hostent)+10)
4807 int main() {
4808 struct hostent hent;
4809                         struct hostent *rhent; char buffer[BUFSIZE]; 
4810                         struct in_addr add;
4811                         size_t alen=sizeof(struct in_addr);
4812                         int bufsize=BUFSIZE;int h_errno;
4813                         (void)gethostbyaddr_r( (void *)&(add.s_addr),
4814                                 alen, AF_INET, &hent, buffer, bufsize, 
4815                                 &rhent, &h_errno);
4816 ; return 0; }
4817 EOF
4818 if { (eval echo configure:4819: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4819   rm -rf conftest*
4820   ol_cv_func_gethostbyaddr_r_nargs=8
4821 else
4822   echo "configure: failed program was:" >&5
4823   cat conftest.$ac_ext >&5
4824   rm -rf conftest*
4825   ol_cv_func_gethostbyaddr_r_nargs=0
4826 fi
4827 rm -f conftest*
4828 fi
4829 rm -f conftest*
4830 fi
4831
4832 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
4833   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
4834     cat >> confdefs.h <<EOF
4835 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
4836 EOF
4837
4838   fi
4839
4840 else
4841         ol_cv_func_gethostbyaddr_r_nargs=0
4842 fi
4843
4844 if test "$ac_cv_func_ctime_r" = yes \
4845         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
4846         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
4847         -a "$ac_cv_func_gethostbyname_r" = yes \
4848         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
4849         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
4850         -a "$ac_cv_func_gethostbyaddr_r" = yes \
4851         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
4852         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
4853         ; then
4854  
4855         cat >> confdefs.h <<\EOF
4856 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
4857 EOF
4858
4859 fi
4860
4861 ol_link_threads=no
4862 if test $ol_with_threads = auto -o $ol_with_threads = yes \
4863         -o $ol_with_threads = posix ; then
4864
4865         for ac_hdr in pthread.h sched.h
4866 do
4867 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4868 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4869 echo "configure:4870: checking for $ac_hdr" >&5
4870 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4871   echo $ac_n "(cached) $ac_c" 1>&6
4872 else
4873   cat > conftest.$ac_ext <<EOF
4874 #line 4875 "configure"
4875 #include "confdefs.h"
4876 #include <$ac_hdr>
4877 EOF
4878 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4879 { (eval echo configure:4880: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4880 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4881 if test -z "$ac_err"; then
4882   rm -rf conftest*
4883   eval "ac_cv_header_$ac_safe=yes"
4884 else
4885   echo "$ac_err" >&5
4886   echo "configure: failed program was:" >&5
4887   cat conftest.$ac_ext >&5
4888   rm -rf conftest*
4889   eval "ac_cv_header_$ac_safe=no"
4890 fi
4891 rm -f conftest*
4892 fi
4893 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4894   echo "$ac_t""yes" 1>&6
4895     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4896   cat >> confdefs.h <<EOF
4897 #define $ac_tr_hdr 1
4898 EOF
4899  
4900 else
4901   echo "$ac_t""no" 1>&6
4902 fi
4903 done
4904
4905
4906         if test $ac_cv_header_pthread_h = yes ; then
4907                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
4908 echo "configure:4909: checking POSIX thread version" >&5
4909 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
4910   echo $ac_n "(cached) $ac_c" 1>&6
4911 else
4912   
4913         cat > conftest.$ac_ext <<EOF
4914 #line 4915 "configure"
4915 #include "confdefs.h"
4916
4917 #               include <pthread.h>
4918                 /* this check could be improved */
4919 #               ifdef PTHREAD_ONCE_INIT
4920                         pthread_version_final
4921 #               endif
4922         
4923 EOF
4924 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4925   egrep "pthread_version_final" >/dev/null 2>&1; then
4926   rm -rf conftest*
4927   ol_pthread_final=yes
4928 else
4929   rm -rf conftest*
4930   ol_pthread_final=no
4931 fi
4932 rm -f conftest*
4933
4934
4935         cat > conftest.$ac_ext <<EOF
4936 #line 4937 "configure"
4937 #include "confdefs.h"
4938
4939 #               include <pthread.h>
4940                 /* this check could be improved */
4941 #               ifdef pthread_once_init
4942                         pthread_version_draft4
4943 #               endif
4944         
4945 EOF
4946 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4947   egrep "pthread_version_draft4" >/dev/null 2>&1; then
4948   rm -rf conftest*
4949   ol_pthread_draft4=yes
4950 else
4951   rm -rf conftest*
4952   ol_pthread_draft4=no
4953 fi
4954 rm -f conftest*
4955
4956
4957         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
4958                 ol_cv_pthread_version=final
4959         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
4960                 ol_cv_pthread_version=draft4
4961         else
4962                 ol_cv_pthread_version=unknown
4963         fi
4964
4965 fi
4966
4967 echo "$ac_t""$ol_cv_pthread_version" 1>&6
4968
4969
4970                 if test $ol_cv_pthread_version = final ; then
4971                         cat >> confdefs.h <<\EOF
4972 #define HAVE_PTHREADS_FINAL 1
4973 EOF
4974
4975                 elif test $ol_cv_pthread_version = draft4 ; then
4976                         cat >> confdefs.h <<\EOF
4977 #define HAVE_PTHREADS_D4 1
4978 EOF
4979
4980                 else
4981                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
4982                 fi
4983
4984                 # consider threads found
4985                 ol_with_threads=found
4986
4987                 
4988         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
4989 echo "configure:4990: checking for LinuxThreads pthread.h" >&5
4990 if eval "test \"`echo '$''{'ol_cv_header_linux_threads'+set}'`\" = set"; then
4991   echo $ac_n "(cached) $ac_c" 1>&6
4992 else
4993   cat > conftest.$ac_ext <<EOF
4994 #line 4995 "configure"
4995 #include "confdefs.h"
4996 #include <pthread.h>
4997 EOF
4998 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4999   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
5000   rm -rf conftest*
5001   ol_cv_header_linux_threads=yes
5002 else
5003   rm -rf conftest*
5004   ol_cv_header_linux_threads=no
5005 fi
5006 rm -f conftest*
5007
5008                 
5009 fi
5010
5011 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
5012         if test $ol_cv_header_linux_threads = yes; then
5013                 cat >> confdefs.h <<\EOF
5014 #define HAVE_LINUX_THREADS 1
5015 EOF
5016
5017         fi
5018
5019
5020                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
5021                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
5022 echo "configure:5023: checking for pthread_create in default libraries" >&5
5023                 if eval "test \"`echo '$''{'ol_cv_pthread_create'+set}'`\" = set"; then
5024   echo $ac_n "(cached) $ac_c" 1>&6
5025 else
5026   
5027                 if test "$cross_compiling" = yes; then
5028                         ol_cv_pthread_create=yes
5029 else
5030   cat > conftest.$ac_ext <<EOF
5031 #line 5032 "configure"
5032 #include "confdefs.h"
5033
5034 #include <pthread.h>
5035 #ifndef NULL
5036 #define NULL (void*)0
5037 #endif
5038
5039 static void *task(p)
5040         void *p;
5041 {
5042         return (void *) (p == NULL);
5043 }
5044
5045 int main(argc, argv)
5046         int argc;
5047         char **argv;
5048 {
5049         pthread_t t;
5050         int status;
5051
5052         /* make sure pthread_create() isn't just a stub */
5053 #if HAVE_PTHREADS_D4
5054         status = pthread_create(&t, pthread_attr_default, task, NULL);
5055 #else
5056         status = pthread_create(&t, NULL, task, NULL);
5057 #endif
5058
5059         if( status ) return status;
5060
5061         /* make sure pthread_detach() isn't just a stub */
5062 #if HAVE_PTHREADS_D4
5063         status = pthread_detach( &t );
5064 #else
5065         status = pthread_detach( t );
5066 #endif
5067
5068         if( status ) return status;
5069
5070         return status;
5071 }
5072
5073 EOF
5074 if { (eval echo configure:5075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5075 then
5076   ol_cv_pthread_create=yes
5077 else
5078   echo "configure: failed program was:" >&5
5079   cat conftest.$ac_ext >&5
5080   rm -fr conftest*
5081   ol_cv_pthread_create=no
5082 fi
5083 rm -fr conftest*
5084 fi
5085
5086 fi
5087
5088                 echo "$ac_t""$ol_cv_pthread_create" 1>&6
5089
5090                 if test $ol_cv_pthread_create != no ; then
5091                         ol_link_threads=posix
5092                         ol_link_pthreads=""
5093                 fi
5094                 
5095                 # Pthread try link: -mt (ol_cv_pthread_mt)
5096         if test "$ol_link_threads" = no ; then
5097                 # try -mt
5098                 echo $ac_n "checking for pthread link with -mt""... $ac_c" 1>&6
5099 echo "configure:5100: checking for pthread link with -mt" >&5
5100 if eval "test \"`echo '$''{'ol_cv_pthread_mt'+set}'`\" = set"; then
5101   echo $ac_n "(cached) $ac_c" 1>&6
5102 else
5103   
5104                         # save the flags
5105                         ol_LIBS="$LIBS"
5106                         LIBS="-mt $LIBS"
5107
5108                         cat > conftest.$ac_ext <<EOF
5109 #line 5110 "configure"
5110 #include "confdefs.h"
5111
5112 #include <pthread.h>
5113 #ifndef NULL
5114 #define NULL (void*)0
5115 #endif
5116
5117 int main() {
5118
5119         pthread_t t;
5120
5121 #if HAVE_PTHREADS_D4
5122         pthread_create(&t, pthread_attr_default, NULL, NULL);
5123         pthread_detach( &t );
5124 #else
5125         pthread_create(&t, NULL, NULL, NULL);
5126         pthread_detach( t );
5127 #endif
5128 #ifdef HAVE_LINUX_THREADS
5129         pthread_kill_other_threads_np();
5130 #endif
5131
5132 ; return 0; }
5133 EOF
5134 if { (eval echo configure:5135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5135   rm -rf conftest*
5136   ol_cv_pthread_mt=yes
5137 else
5138   echo "configure: failed program was:" >&5
5139   cat conftest.$ac_ext >&5
5140   rm -rf conftest*
5141   ol_cv_pthread_mt=no
5142 fi
5143 rm -f conftest*
5144
5145                 # restore the LIBS
5146                 LIBS="$ol_LIBS"
5147                 
5148 fi
5149
5150 echo "$ac_t""$ol_cv_pthread_mt" 1>&6
5151
5152                 if test $ol_cv_pthread_mt = yes ; then
5153                         ol_link_pthreads="-mt"
5154                         ol_link_threads=posix
5155                 fi
5156         fi
5157
5158                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
5159         if test "$ol_link_threads" = no ; then
5160                 # try -kthread
5161                 echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
5162 echo "configure:5163: checking for pthread link with -kthread" >&5
5163 if eval "test \"`echo '$''{'ol_cv_pthread_kthread'+set}'`\" = set"; then
5164   echo $ac_n "(cached) $ac_c" 1>&6
5165 else
5166   
5167                         # save the flags
5168                         ol_LIBS="$LIBS"
5169                         LIBS="-kthread $LIBS"
5170
5171                         cat > conftest.$ac_ext <<EOF
5172 #line 5173 "configure"
5173 #include "confdefs.h"
5174
5175 #include <pthread.h>
5176 #ifndef NULL
5177 #define NULL (void*)0
5178 #endif
5179
5180 int main() {
5181
5182         pthread_t t;
5183
5184 #if HAVE_PTHREADS_D4
5185         pthread_create(&t, pthread_attr_default, NULL, NULL);
5186         pthread_detach( &t );
5187 #else
5188         pthread_create(&t, NULL, NULL, NULL);
5189         pthread_detach( t );
5190 #endif
5191 #ifdef HAVE_LINUX_THREADS
5192         pthread_kill_other_threads_np();
5193 #endif
5194
5195 ; return 0; }
5196 EOF
5197 if { (eval echo configure:5198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5198   rm -rf conftest*
5199   ol_cv_pthread_kthread=yes
5200 else
5201   echo "configure: failed program was:" >&5
5202   cat conftest.$ac_ext >&5
5203   rm -rf conftest*
5204   ol_cv_pthread_kthread=no
5205 fi
5206 rm -f conftest*
5207
5208                 # restore the LIBS
5209                 LIBS="$ol_LIBS"
5210                 
5211 fi
5212
5213 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
5214
5215                 if test $ol_cv_pthread_kthread = yes ; then
5216                         ol_link_pthreads="-kthread"
5217                         ol_link_threads=posix
5218                 fi
5219         fi
5220
5221                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
5222         if test "$ol_link_threads" = no ; then
5223                 # try -pthread
5224                 echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
5225 echo "configure:5226: checking for pthread link with -pthread" >&5
5226 if eval "test \"`echo '$''{'ol_cv_pthread_pthread'+set}'`\" = set"; then
5227   echo $ac_n "(cached) $ac_c" 1>&6
5228 else
5229   
5230                         # save the flags
5231                         ol_LIBS="$LIBS"
5232                         LIBS="-pthread $LIBS"
5233
5234                         cat > conftest.$ac_ext <<EOF
5235 #line 5236 "configure"
5236 #include "confdefs.h"
5237
5238 #include <pthread.h>
5239 #ifndef NULL
5240 #define NULL (void*)0
5241 #endif
5242
5243 int main() {
5244
5245         pthread_t t;
5246
5247 #if HAVE_PTHREADS_D4
5248         pthread_create(&t, pthread_attr_default, NULL, NULL);
5249         pthread_detach( &t );
5250 #else
5251         pthread_create(&t, NULL, NULL, NULL);
5252         pthread_detach( t );
5253 #endif
5254 #ifdef HAVE_LINUX_THREADS
5255         pthread_kill_other_threads_np();
5256 #endif
5257
5258 ; return 0; }
5259 EOF
5260 if { (eval echo configure:5261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5261   rm -rf conftest*
5262   ol_cv_pthread_pthread=yes
5263 else
5264   echo "configure: failed program was:" >&5
5265   cat conftest.$ac_ext >&5
5266   rm -rf conftest*
5267   ol_cv_pthread_pthread=no
5268 fi
5269 rm -f conftest*
5270
5271                 # restore the LIBS
5272                 LIBS="$ol_LIBS"
5273                 
5274 fi
5275
5276 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
5277
5278                 if test $ol_cv_pthread_pthread = yes ; then
5279                         ol_link_pthreads="-pthread"
5280                         ol_link_threads=posix
5281                 fi
5282         fi
5283
5284                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
5285         if test "$ol_link_threads" = no ; then
5286                 # try -pthreads
5287                 echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
5288 echo "configure:5289: checking for pthread link with -pthreads" >&5
5289 if eval "test \"`echo '$''{'ol_cv_pthread_pthreads'+set}'`\" = set"; then
5290   echo $ac_n "(cached) $ac_c" 1>&6
5291 else
5292   
5293                         # save the flags
5294                         ol_LIBS="$LIBS"
5295                         LIBS="-pthreads $LIBS"
5296
5297                         cat > conftest.$ac_ext <<EOF
5298 #line 5299 "configure"
5299 #include "confdefs.h"
5300
5301 #include <pthread.h>
5302 #ifndef NULL
5303 #define NULL (void*)0
5304 #endif
5305
5306 int main() {
5307
5308         pthread_t t;
5309
5310 #if HAVE_PTHREADS_D4
5311         pthread_create(&t, pthread_attr_default, NULL, NULL);
5312         pthread_detach( &t );
5313 #else
5314         pthread_create(&t, NULL, NULL, NULL);
5315         pthread_detach( t );
5316 #endif
5317 #ifdef HAVE_LINUX_THREADS
5318         pthread_kill_other_threads_np();
5319 #endif
5320
5321 ; return 0; }
5322 EOF
5323 if { (eval echo configure:5324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5324   rm -rf conftest*
5325   ol_cv_pthread_pthreads=yes
5326 else
5327   echo "configure: failed program was:" >&5
5328   cat conftest.$ac_ext >&5
5329   rm -rf conftest*
5330   ol_cv_pthread_pthreads=no
5331 fi
5332 rm -f conftest*
5333
5334                 # restore the LIBS
5335                 LIBS="$ol_LIBS"
5336                 
5337 fi
5338
5339 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
5340
5341                 if test $ol_cv_pthread_pthreads = yes ; then
5342                         ol_link_pthreads="-pthreads"
5343                         ol_link_threads=posix
5344                 fi
5345         fi
5346
5347                 # Pthread try link: -thread (ol_cv_pthread_thread)
5348         if test "$ol_link_threads" = no ; then
5349                 # try -thread
5350                 echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
5351 echo "configure:5352: checking for pthread link with -thread" >&5
5352 if eval "test \"`echo '$''{'ol_cv_pthread_thread'+set}'`\" = set"; then
5353   echo $ac_n "(cached) $ac_c" 1>&6
5354 else
5355   
5356                         # save the flags
5357                         ol_LIBS="$LIBS"
5358                         LIBS="-thread $LIBS"
5359
5360                         cat > conftest.$ac_ext <<EOF
5361 #line 5362 "configure"
5362 #include "confdefs.h"
5363
5364 #include <pthread.h>
5365 #ifndef NULL
5366 #define NULL (void*)0
5367 #endif
5368
5369 int main() {
5370
5371         pthread_t t;
5372
5373 #if HAVE_PTHREADS_D4
5374         pthread_create(&t, pthread_attr_default, NULL, NULL);
5375         pthread_detach( &t );
5376 #else
5377         pthread_create(&t, NULL, NULL, NULL);
5378         pthread_detach( t );
5379 #endif
5380 #ifdef HAVE_LINUX_THREADS
5381         pthread_kill_other_threads_np();
5382 #endif
5383
5384 ; return 0; }
5385 EOF
5386 if { (eval echo configure:5387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5387   rm -rf conftest*
5388   ol_cv_pthread_thread=yes
5389 else
5390   echo "configure: failed program was:" >&5
5391   cat conftest.$ac_ext >&5
5392   rm -rf conftest*
5393   ol_cv_pthread_thread=no
5394 fi
5395 rm -f conftest*
5396
5397                 # restore the LIBS
5398                 LIBS="$ol_LIBS"
5399                 
5400 fi
5401
5402 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
5403
5404                 if test $ol_cv_pthread_thread = yes ; then
5405                         ol_link_pthreads="-thread"
5406                         ol_link_threads=posix
5407                 fi
5408         fi
5409
5410
5411                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
5412         if test "$ol_link_threads" = no ; then
5413                 # try -lpthread -lmach -lexc -lc_r
5414                 echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
5415 echo "configure:5416: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
5416 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread_lmach_lexc_lc_r'+set}'`\" = set"; then
5417   echo $ac_n "(cached) $ac_c" 1>&6
5418 else
5419   
5420                         # save the flags
5421                         ol_LIBS="$LIBS"
5422                         LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
5423
5424                         cat > conftest.$ac_ext <<EOF
5425 #line 5426 "configure"
5426 #include "confdefs.h"
5427
5428 #include <pthread.h>
5429 #ifndef NULL
5430 #define NULL (void*)0
5431 #endif
5432
5433 int main() {
5434
5435         pthread_t t;
5436
5437 #if HAVE_PTHREADS_D4
5438         pthread_create(&t, pthread_attr_default, NULL, NULL);
5439         pthread_detach( &t );
5440 #else
5441         pthread_create(&t, NULL, NULL, NULL);
5442         pthread_detach( t );
5443 #endif
5444 #ifdef HAVE_LINUX_THREADS
5445         pthread_kill_other_threads_np();
5446 #endif
5447
5448 ; return 0; }
5449 EOF
5450 if { (eval echo configure:5451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5451   rm -rf conftest*
5452   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
5453 else
5454   echo "configure: failed program was:" >&5
5455   cat conftest.$ac_ext >&5
5456   rm -rf conftest*
5457   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
5458 fi
5459 rm -f conftest*
5460
5461                 # restore the LIBS
5462                 LIBS="$ol_LIBS"
5463                 
5464 fi
5465
5466 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
5467
5468                 if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
5469                         ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
5470                         ol_link_threads=posix
5471                 fi
5472         fi
5473
5474                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
5475         if test "$ol_link_threads" = no ; then
5476                 # try -lpthread -lmach -lexc
5477                 echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
5478 echo "configure:5479: checking for pthread link with -lpthread -lmach -lexc" >&5
5479 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread_lmach_lexc'+set}'`\" = set"; then
5480   echo $ac_n "(cached) $ac_c" 1>&6
5481 else
5482   
5483                         # save the flags
5484                         ol_LIBS="$LIBS"
5485                         LIBS="-lpthread -lmach -lexc $LIBS"
5486
5487                         cat > conftest.$ac_ext <<EOF
5488 #line 5489 "configure"
5489 #include "confdefs.h"
5490
5491 #include <pthread.h>
5492 #ifndef NULL
5493 #define NULL (void*)0
5494 #endif
5495
5496 int main() {
5497
5498         pthread_t t;
5499
5500 #if HAVE_PTHREADS_D4
5501         pthread_create(&t, pthread_attr_default, NULL, NULL);
5502         pthread_detach( &t );
5503 #else
5504         pthread_create(&t, NULL, NULL, NULL);
5505         pthread_detach( t );
5506 #endif
5507 #ifdef HAVE_LINUX_THREADS
5508         pthread_kill_other_threads_np();
5509 #endif
5510
5511 ; return 0; }
5512 EOF
5513 if { (eval echo configure:5514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5514   rm -rf conftest*
5515   ol_cv_pthread_lpthread_lmach_lexc=yes
5516 else
5517   echo "configure: failed program was:" >&5
5518   cat conftest.$ac_ext >&5
5519   rm -rf conftest*
5520   ol_cv_pthread_lpthread_lmach_lexc=no
5521 fi
5522 rm -f conftest*
5523
5524                 # restore the LIBS
5525                 LIBS="$ol_LIBS"
5526                 
5527 fi
5528
5529 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
5530
5531                 if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
5532                         ol_link_pthreads="-lpthread -lmach -lexc"
5533                         ol_link_threads=posix
5534                 fi
5535         fi
5536
5537
5538                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
5539         if test "$ol_link_threads" = no ; then
5540                 # try -lpthread -Wl,-woff,85
5541                 echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
5542 echo "configure:5543: checking for pthread link with -lpthread -Wl,-woff,85" >&5
5543 if eval "test \"`echo '$''{'ol_cv_pthread_lib_lpthread_woff'+set}'`\" = set"; then
5544   echo $ac_n "(cached) $ac_c" 1>&6
5545 else
5546   
5547                         # save the flags
5548                         ol_LIBS="$LIBS"
5549                         LIBS="-lpthread -Wl,-woff,85 $LIBS"
5550
5551                         cat > conftest.$ac_ext <<EOF
5552 #line 5553 "configure"
5553 #include "confdefs.h"
5554
5555 #include <pthread.h>
5556 #ifndef NULL
5557 #define NULL (void*)0
5558 #endif
5559
5560 int main() {
5561
5562         pthread_t t;
5563
5564 #if HAVE_PTHREADS_D4
5565         pthread_create(&t, pthread_attr_default, NULL, NULL);
5566         pthread_detach( &t );
5567 #else
5568         pthread_create(&t, NULL, NULL, NULL);
5569         pthread_detach( t );
5570 #endif
5571 #ifdef HAVE_LINUX_THREADS
5572         pthread_kill_other_threads_np();
5573 #endif
5574
5575 ; return 0; }
5576 EOF
5577 if { (eval echo configure:5578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5578   rm -rf conftest*
5579   ol_cv_pthread_lib_lpthread_woff=yes
5580 else
5581   echo "configure: failed program was:" >&5
5582   cat conftest.$ac_ext >&5
5583   rm -rf conftest*
5584   ol_cv_pthread_lib_lpthread_woff=no
5585 fi
5586 rm -f conftest*
5587
5588                 # restore the LIBS
5589                 LIBS="$ol_LIBS"
5590                 
5591 fi
5592
5593 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
5594
5595                 if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
5596                         ol_link_pthreads="-lpthread -Wl,-woff,85"
5597                         ol_link_threads=posix
5598                 fi
5599         fi
5600
5601
5602                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
5603         if test "$ol_link_threads" = no ; then
5604                 # try -lpthread
5605                 echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
5606 echo "configure:5607: checking for pthread link with -lpthread" >&5
5607 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread'+set}'`\" = set"; then
5608   echo $ac_n "(cached) $ac_c" 1>&6
5609 else
5610   
5611                         # save the flags
5612                         ol_LIBS="$LIBS"
5613                         LIBS="-lpthread $LIBS"
5614
5615                         cat > conftest.$ac_ext <<EOF
5616 #line 5617 "configure"
5617 #include "confdefs.h"
5618
5619 #include <pthread.h>
5620 #ifndef NULL
5621 #define NULL (void*)0
5622 #endif
5623
5624 int main() {
5625
5626         pthread_t t;
5627
5628 #if HAVE_PTHREADS_D4
5629         pthread_create(&t, pthread_attr_default, NULL, NULL);
5630         pthread_detach( &t );
5631 #else
5632         pthread_create(&t, NULL, NULL, NULL);
5633         pthread_detach( t );
5634 #endif
5635 #ifdef HAVE_LINUX_THREADS
5636         pthread_kill_other_threads_np();
5637 #endif
5638
5639 ; return 0; }
5640 EOF
5641 if { (eval echo configure:5642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5642   rm -rf conftest*
5643   ol_cv_pthread_lpthread=yes
5644 else
5645   echo "configure: failed program was:" >&5
5646   cat conftest.$ac_ext >&5
5647   rm -rf conftest*
5648   ol_cv_pthread_lpthread=no
5649 fi
5650 rm -f conftest*
5651
5652                 # restore the LIBS
5653                 LIBS="$ol_LIBS"
5654                 
5655 fi
5656
5657 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
5658
5659                 if test $ol_cv_pthread_lpthread = yes ; then
5660                         ol_link_pthreads="-lpthread"
5661                         ol_link_threads=posix
5662                 fi
5663         fi
5664
5665                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
5666         if test "$ol_link_threads" = no ; then
5667                 # try -lc_r
5668                 echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
5669 echo "configure:5670: checking for pthread link with -lc_r" >&5
5670 if eval "test \"`echo '$''{'ol_cv_pthread_lc_r'+set}'`\" = set"; then
5671   echo $ac_n "(cached) $ac_c" 1>&6
5672 else
5673   
5674                         # save the flags
5675                         ol_LIBS="$LIBS"
5676                         LIBS="-lc_r $LIBS"
5677
5678                         cat > conftest.$ac_ext <<EOF
5679 #line 5680 "configure"
5680 #include "confdefs.h"
5681
5682 #include <pthread.h>
5683 #ifndef NULL
5684 #define NULL (void*)0
5685 #endif
5686
5687 int main() {
5688
5689         pthread_t t;
5690
5691 #if HAVE_PTHREADS_D4
5692         pthread_create(&t, pthread_attr_default, NULL, NULL);
5693         pthread_detach( &t );
5694 #else
5695         pthread_create(&t, NULL, NULL, NULL);
5696         pthread_detach( t );
5697 #endif
5698 #ifdef HAVE_LINUX_THREADS
5699         pthread_kill_other_threads_np();
5700 #endif
5701
5702 ; return 0; }
5703 EOF
5704 if { (eval echo configure:5705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5705   rm -rf conftest*
5706   ol_cv_pthread_lc_r=yes
5707 else
5708   echo "configure: failed program was:" >&5
5709   cat conftest.$ac_ext >&5
5710   rm -rf conftest*
5711   ol_cv_pthread_lc_r=no
5712 fi
5713 rm -f conftest*
5714
5715                 # restore the LIBS
5716                 LIBS="$ol_LIBS"
5717                 
5718 fi
5719
5720 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
5721
5722                 if test $ol_cv_pthread_lc_r = yes ; then
5723                         ol_link_pthreads="-lc_r"
5724                         ol_link_threads=posix
5725                 fi
5726         fi
5727
5728
5729                 # Pthread try link: -threads (ol_cv_pthread_threads)
5730         if test "$ol_link_threads" = no ; then
5731                 # try -threads
5732                 echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
5733 echo "configure:5734: checking for pthread link with -threads" >&5
5734 if eval "test \"`echo '$''{'ol_cv_pthread_threads'+set}'`\" = set"; then
5735   echo $ac_n "(cached) $ac_c" 1>&6
5736 else
5737   
5738                         # save the flags
5739                         ol_LIBS="$LIBS"
5740                         LIBS="-threads $LIBS"
5741
5742                         cat > conftest.$ac_ext <<EOF
5743 #line 5744 "configure"
5744 #include "confdefs.h"
5745
5746 #include <pthread.h>
5747 #ifndef NULL
5748 #define NULL (void*)0
5749 #endif
5750
5751 int main() {
5752
5753         pthread_t t;
5754
5755 #if HAVE_PTHREADS_D4
5756         pthread_create(&t, pthread_attr_default, NULL, NULL);
5757         pthread_detach( &t );
5758 #else
5759         pthread_create(&t, NULL, NULL, NULL);
5760         pthread_detach( t );
5761 #endif
5762 #ifdef HAVE_LINUX_THREADS
5763         pthread_kill_other_threads_np();
5764 #endif
5765
5766 ; return 0; }
5767 EOF
5768 if { (eval echo configure:5769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5769   rm -rf conftest*
5770   ol_cv_pthread_threads=yes
5771 else
5772   echo "configure: failed program was:" >&5
5773   cat conftest.$ac_ext >&5
5774   rm -rf conftest*
5775   ol_cv_pthread_threads=no
5776 fi
5777 rm -f conftest*
5778
5779                 # restore the LIBS
5780                 LIBS="$ol_LIBS"
5781                 
5782 fi
5783
5784 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
5785
5786                 if test $ol_cv_pthread_threads = yes ; then
5787                         ol_link_pthreads="-threads"
5788                         ol_link_threads=posix
5789                 fi
5790         fi
5791
5792
5793                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
5794         if test "$ol_link_threads" = no ; then
5795                 # try -lpthreads -lmach -lexc -lc_r
5796                 echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
5797 echo "configure:5798: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
5798 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lmach_lexc_lc_r'+set}'`\" = set"; then
5799   echo $ac_n "(cached) $ac_c" 1>&6
5800 else
5801   
5802                         # save the flags
5803                         ol_LIBS="$LIBS"
5804                         LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
5805
5806                         cat > conftest.$ac_ext <<EOF
5807 #line 5808 "configure"
5808 #include "confdefs.h"
5809
5810 #include <pthread.h>
5811 #ifndef NULL
5812 #define NULL (void*)0
5813 #endif
5814
5815 int main() {
5816
5817         pthread_t t;
5818
5819 #if HAVE_PTHREADS_D4
5820         pthread_create(&t, pthread_attr_default, NULL, NULL);
5821         pthread_detach( &t );
5822 #else
5823         pthread_create(&t, NULL, NULL, NULL);
5824         pthread_detach( t );
5825 #endif
5826 #ifdef HAVE_LINUX_THREADS
5827         pthread_kill_other_threads_np();
5828 #endif
5829
5830 ; return 0; }
5831 EOF
5832 if { (eval echo configure:5833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5833   rm -rf conftest*
5834   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
5835 else
5836   echo "configure: failed program was:" >&5
5837   cat conftest.$ac_ext >&5
5838   rm -rf conftest*
5839   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
5840 fi
5841 rm -f conftest*
5842
5843                 # restore the LIBS
5844                 LIBS="$ol_LIBS"
5845                 
5846 fi
5847
5848 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
5849
5850                 if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
5851                         ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
5852                         ol_link_threads=posix
5853                 fi
5854         fi
5855
5856                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
5857         if test "$ol_link_threads" = no ; then
5858                 # try -lpthreads -lmach -lexc
5859                 echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
5860 echo "configure:5861: checking for pthread link with -lpthreads -lmach -lexc" >&5
5861 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lmach_lexc'+set}'`\" = set"; then
5862   echo $ac_n "(cached) $ac_c" 1>&6
5863 else
5864   
5865                         # save the flags
5866                         ol_LIBS="$LIBS"
5867                         LIBS="-lpthreads -lmach -lexc $LIBS"
5868
5869                         cat > conftest.$ac_ext <<EOF
5870 #line 5871 "configure"
5871 #include "confdefs.h"
5872
5873 #include <pthread.h>
5874 #ifndef NULL
5875 #define NULL (void*)0
5876 #endif
5877
5878 int main() {
5879
5880         pthread_t t;
5881
5882 #if HAVE_PTHREADS_D4
5883         pthread_create(&t, pthread_attr_default, NULL, NULL);
5884         pthread_detach( &t );
5885 #else
5886         pthread_create(&t, NULL, NULL, NULL);
5887         pthread_detach( t );
5888 #endif
5889 #ifdef HAVE_LINUX_THREADS
5890         pthread_kill_other_threads_np();
5891 #endif
5892
5893 ; return 0; }
5894 EOF
5895 if { (eval echo configure:5896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5896   rm -rf conftest*
5897   ol_cv_pthread_lpthreads_lmach_lexc=yes
5898 else
5899   echo "configure: failed program was:" >&5
5900   cat conftest.$ac_ext >&5
5901   rm -rf conftest*
5902   ol_cv_pthread_lpthreads_lmach_lexc=no
5903 fi
5904 rm -f conftest*
5905
5906                 # restore the LIBS
5907                 LIBS="$ol_LIBS"
5908                 
5909 fi
5910
5911 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
5912
5913                 if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
5914                         ol_link_pthreads="-lpthreads -lmach -lexc"
5915                         ol_link_threads=posix
5916                 fi
5917         fi
5918
5919                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
5920         if test "$ol_link_threads" = no ; then
5921                 # try -lpthreads -lexc
5922                 echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
5923 echo "configure:5924: checking for pthread link with -lpthreads -lexc" >&5
5924 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lexc'+set}'`\" = set"; then
5925   echo $ac_n "(cached) $ac_c" 1>&6
5926 else
5927   
5928                         # save the flags
5929                         ol_LIBS="$LIBS"
5930                         LIBS="-lpthreads -lexc $LIBS"
5931
5932                         cat > conftest.$ac_ext <<EOF
5933 #line 5934 "configure"
5934 #include "confdefs.h"
5935
5936 #include <pthread.h>
5937 #ifndef NULL
5938 #define NULL (void*)0
5939 #endif
5940
5941 int main() {
5942
5943         pthread_t t;
5944
5945 #if HAVE_PTHREADS_D4
5946         pthread_create(&t, pthread_attr_default, NULL, NULL);
5947         pthread_detach( &t );
5948 #else
5949         pthread_create(&t, NULL, NULL, NULL);
5950         pthread_detach( t );
5951 #endif
5952 #ifdef HAVE_LINUX_THREADS
5953         pthread_kill_other_threads_np();
5954 #endif
5955
5956 ; return 0; }
5957 EOF
5958 if { (eval echo configure:5959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5959   rm -rf conftest*
5960   ol_cv_pthread_lpthreads_lexc=yes
5961 else
5962   echo "configure: failed program was:" >&5
5963   cat conftest.$ac_ext >&5
5964   rm -rf conftest*
5965   ol_cv_pthread_lpthreads_lexc=no
5966 fi
5967 rm -f conftest*
5968
5969                 # restore the LIBS
5970                 LIBS="$ol_LIBS"
5971                 
5972 fi
5973
5974 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
5975
5976                 if test $ol_cv_pthread_lpthreads_lexc = yes ; then
5977                         ol_link_pthreads="-lpthreads -lexc"
5978                         ol_link_threads=posix
5979                 fi
5980         fi
5981
5982
5983                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
5984         if test "$ol_link_threads" = no ; then
5985                 # try -lpthreads
5986                 echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
5987 echo "configure:5988: checking for pthread link with -lpthreads" >&5
5988 if eval "test \"`echo '$''{'ol_cv_pthread_lib_lpthreads'+set}'`\" = set"; then
5989   echo $ac_n "(cached) $ac_c" 1>&6
5990 else
5991   
5992                         # save the flags
5993                         ol_LIBS="$LIBS"
5994                         LIBS="-lpthreads $LIBS"
5995
5996                         cat > conftest.$ac_ext <<EOF
5997 #line 5998 "configure"
5998 #include "confdefs.h"
5999
6000 #include <pthread.h>
6001 #ifndef NULL
6002 #define NULL (void*)0
6003 #endif
6004
6005 int main() {
6006
6007         pthread_t t;
6008
6009 #if HAVE_PTHREADS_D4
6010         pthread_create(&t, pthread_attr_default, NULL, NULL);
6011         pthread_detach( &t );
6012 #else
6013         pthread_create(&t, NULL, NULL, NULL);
6014         pthread_detach( t );
6015 #endif
6016 #ifdef HAVE_LINUX_THREADS
6017         pthread_kill_other_threads_np();
6018 #endif
6019
6020 ; return 0; }
6021 EOF
6022 if { (eval echo configure:6023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6023   rm -rf conftest*
6024   ol_cv_pthread_lib_lpthreads=yes
6025 else
6026   echo "configure: failed program was:" >&5
6027   cat conftest.$ac_ext >&5
6028   rm -rf conftest*
6029   ol_cv_pthread_lib_lpthreads=no
6030 fi
6031 rm -f conftest*
6032
6033                 # restore the LIBS
6034                 LIBS="$ol_LIBS"
6035                 
6036 fi
6037
6038 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
6039
6040                 if test $ol_cv_pthread_lib_lpthreads = yes ; then
6041                         ol_link_pthreads="-lpthreads"
6042                         ol_link_threads=posix
6043                 fi
6044         fi
6045
6046
6047                 if test $ol_link_threads != no ; then
6048                         cat >> confdefs.h <<\EOF
6049 #define HAVE_PTHREADS 1
6050 EOF
6051
6052
6053                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
6054
6055                                                 save_CPPFLAGS="$CPPFLAGS"
6056                         save_LIBS="$LIBS"
6057                         LIBS="$LTHREAD_LIBS $LIBS"
6058
6059                                                                                                 for ac_func in sched_yield pthread_yield
6060 do
6061 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6062 echo "configure:6063: checking for $ac_func" >&5
6063 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6064   echo $ac_n "(cached) $ac_c" 1>&6
6065 else
6066   cat > conftest.$ac_ext <<EOF
6067 #line 6068 "configure"
6068 #include "confdefs.h"
6069 /* System header to define __stub macros and hopefully few prototypes,
6070     which can conflict with char $ac_func(); below.  */
6071 #include <assert.h>
6072 /* Override any gcc2 internal prototype to avoid an error.  */
6073 /* We use char because int might match the return type of a gcc2
6074     builtin and then its argument prototype would still apply.  */
6075 char $ac_func();
6076
6077 int main() {
6078
6079 /* The GNU C library defines this for functions which it implements
6080     to always fail with ENOSYS.  Some functions are actually named
6081     something starting with __ and the normal name is an alias.  */
6082 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6083 choke me
6084 #else
6085 $ac_func();
6086 #endif
6087
6088 ; return 0; }
6089 EOF
6090 if { (eval echo configure:6091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6091   rm -rf conftest*
6092   eval "ac_cv_func_$ac_func=yes"
6093 else
6094   echo "configure: failed program was:" >&5
6095   cat conftest.$ac_ext >&5
6096   rm -rf conftest*
6097   eval "ac_cv_func_$ac_func=no"
6098 fi
6099 rm -f conftest*
6100 fi
6101
6102 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6103   echo "$ac_t""yes" 1>&6
6104     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6105   cat >> confdefs.h <<EOF
6106 #define $ac_tr_func 1
6107 EOF
6108  
6109 else
6110   echo "$ac_t""no" 1>&6
6111 fi
6112 done
6113
6114
6115                         if test $ac_cv_func_sched_yield = no -a \
6116                                 $ac_cv_func_pthread_yield = no ; then
6117                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
6118 echo "configure:6119: checking for sched_yield in -lrt" >&5
6119 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
6120 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6121   echo $ac_n "(cached) $ac_c" 1>&6
6122 else
6123   ac_save_LIBS="$LIBS"
6124 LIBS="-lrt  $LIBS"
6125 cat > conftest.$ac_ext <<EOF
6126 #line 6127 "configure"
6127 #include "confdefs.h"
6128 /* Override any gcc2 internal prototype to avoid an error.  */
6129 /* We use char because int might match the return type of a gcc2
6130     builtin and then its argument prototype would still apply.  */
6131 char sched_yield();
6132
6133 int main() {
6134 sched_yield()
6135 ; return 0; }
6136 EOF
6137 if { (eval echo configure:6138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6138   rm -rf conftest*
6139   eval "ac_cv_lib_$ac_lib_var=yes"
6140 else
6141   echo "configure: failed program was:" >&5
6142   cat conftest.$ac_ext >&5
6143   rm -rf conftest*
6144   eval "ac_cv_lib_$ac_lib_var=no"
6145 fi
6146 rm -f conftest*
6147 LIBS="$ac_save_LIBS"
6148
6149 fi
6150 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6151   echo "$ac_t""yes" 1>&6
6152   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
6153                                         cat >> confdefs.h <<\EOF
6154 #define HAVE_SCHED_YIELD 1
6155 EOF
6156
6157                                         ac_cv_func_sched_yield=yes
6158 else
6159   echo "$ac_t""no" 1>&6
6160 ac_cv_func_sched_yield=no
6161 fi
6162
6163                         fi
6164                         if test $ac_cv_func_sched_yield = no -a \
6165                                 $ac_cv_func_pthread_yield = no ; then
6166                                                                                                 for ac_func in thr_yield
6167 do
6168 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6169 echo "configure:6170: checking for $ac_func" >&5
6170 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6171   echo $ac_n "(cached) $ac_c" 1>&6
6172 else
6173   cat > conftest.$ac_ext <<EOF
6174 #line 6175 "configure"
6175 #include "confdefs.h"
6176 /* System header to define __stub macros and hopefully few prototypes,
6177     which can conflict with char $ac_func(); below.  */
6178 #include <assert.h>
6179 /* Override any gcc2 internal prototype to avoid an error.  */
6180 /* We use char because int might match the return type of a gcc2
6181     builtin and then its argument prototype would still apply.  */
6182 char $ac_func();
6183
6184 int main() {
6185
6186 /* The GNU C library defines this for functions which it implements
6187     to always fail with ENOSYS.  Some functions are actually named
6188     something starting with __ and the normal name is an alias.  */
6189 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6190 choke me
6191 #else
6192 $ac_func();
6193 #endif
6194
6195 ; return 0; }
6196 EOF
6197 if { (eval echo configure:6198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6198   rm -rf conftest*
6199   eval "ac_cv_func_$ac_func=yes"
6200 else
6201   echo "configure: failed program was:" >&5
6202   cat conftest.$ac_ext >&5
6203   rm -rf conftest*
6204   eval "ac_cv_func_$ac_func=no"
6205 fi
6206 rm -f conftest*
6207 fi
6208
6209 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6210   echo "$ac_t""yes" 1>&6
6211     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6212   cat >> confdefs.h <<EOF
6213 #define $ac_tr_func 1
6214 EOF
6215  
6216 else
6217   echo "$ac_t""no" 1>&6
6218 fi
6219 done
6220
6221                         fi
6222                         if test $ac_cv_func_sched_yield = no -a \
6223                                 $ac_cv_func_pthread_yield = no -a \
6224                                 "$ac_cv_func_thr_yield" = no ; then
6225                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
6226                         fi
6227
6228                                                 for ac_func in pthread_kill
6229 do
6230 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6231 echo "configure:6232: checking for $ac_func" >&5
6232 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6233   echo $ac_n "(cached) $ac_c" 1>&6
6234 else
6235   cat > conftest.$ac_ext <<EOF
6236 #line 6237 "configure"
6237 #include "confdefs.h"
6238 /* System header to define __stub macros and hopefully few prototypes,
6239     which can conflict with char $ac_func(); below.  */
6240 #include <assert.h>
6241 /* Override any gcc2 internal prototype to avoid an error.  */
6242 /* We use char because int might match the return type of a gcc2
6243     builtin and then its argument prototype would still apply.  */
6244 char $ac_func();
6245
6246 int main() {
6247
6248 /* The GNU C library defines this for functions which it implements
6249     to always fail with ENOSYS.  Some functions are actually named
6250     something starting with __ and the normal name is an alias.  */
6251 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6252 choke me
6253 #else
6254 $ac_func();
6255 #endif
6256
6257 ; return 0; }
6258 EOF
6259 if { (eval echo configure:6260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6260   rm -rf conftest*
6261   eval "ac_cv_func_$ac_func=yes"
6262 else
6263   echo "configure: failed program was:" >&5
6264   cat conftest.$ac_ext >&5
6265   rm -rf conftest*
6266   eval "ac_cv_func_$ac_func=no"
6267 fi
6268 rm -f conftest*
6269 fi
6270
6271 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6272   echo "$ac_t""yes" 1>&6
6273     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6274   cat >> confdefs.h <<EOF
6275 #define $ac_tr_func 1
6276 EOF
6277  
6278 else
6279   echo "$ac_t""no" 1>&6
6280 fi
6281 done
6282
6283
6284                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
6285 echo "configure:6286: checking for pthread_detach with <pthread.h>" >&5
6286 if eval "test \"`echo '$''{'ol_cv_func_pthread_detach'+set}'`\" = set"; then
6287   echo $ac_n "(cached) $ac_c" 1>&6
6288 else
6289   
6290                                                                 cat > conftest.$ac_ext <<EOF
6291 #line 6292 "configure"
6292 #include "confdefs.h"
6293
6294 #include <pthread.h>
6295 #ifndef NULL
6296 #define NULL (void*)0
6297 #endif
6298
6299 int main() {
6300 pthread_detach(NULL);
6301 ; return 0; }
6302 EOF
6303 if { (eval echo configure:6304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6304   rm -rf conftest*
6305   ol_cv_func_pthread_detach=yes
6306 else
6307   echo "configure: failed program was:" >&5
6308   cat conftest.$ac_ext >&5
6309   rm -rf conftest*
6310   ol_cv_func_pthread_detach=no
6311 fi
6312 rm -f conftest*
6313                         
6314 fi
6315
6316 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
6317
6318                         if test $ol_cv_func_pthread_detach = no ; then
6319                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
6320                         fi
6321
6322                         cat >> confdefs.h <<\EOF
6323 #define HAVE_PTHREAD_DETACH 1
6324 EOF
6325
6326
6327                                                 for ac_func in \
6328                                 pthread_setconcurrency \
6329                                 pthread_getconcurrency \
6330                                 thr_setconcurrency \
6331                                 thr_getconcurrency \
6332                         
6333 do
6334 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6335 echo "configure:6336: checking for $ac_func" >&5
6336 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6337   echo $ac_n "(cached) $ac_c" 1>&6
6338 else
6339   cat > conftest.$ac_ext <<EOF
6340 #line 6341 "configure"
6341 #include "confdefs.h"
6342 /* System header to define __stub macros and hopefully few prototypes,
6343     which can conflict with char $ac_func(); below.  */
6344 #include <assert.h>
6345 /* Override any gcc2 internal prototype to avoid an error.  */
6346 /* We use char because int might match the return type of a gcc2
6347     builtin and then its argument prototype would still apply.  */
6348 char $ac_func();
6349
6350 int main() {
6351
6352 /* The GNU C library defines this for functions which it implements
6353     to always fail with ENOSYS.  Some functions are actually named
6354     something starting with __ and the normal name is an alias.  */
6355 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6356 choke me
6357 #else
6358 $ac_func();
6359 #endif
6360
6361 ; return 0; }
6362 EOF
6363 if { (eval echo configure:6364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6364   rm -rf conftest*
6365   eval "ac_cv_func_$ac_func=yes"
6366 else
6367   echo "configure: failed program was:" >&5
6368   cat conftest.$ac_ext >&5
6369   rm -rf conftest*
6370   eval "ac_cv_func_$ac_func=no"
6371 fi
6372 rm -f conftest*
6373 fi
6374
6375 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6376   echo "$ac_t""yes" 1>&6
6377     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6378   cat >> confdefs.h <<EOF
6379 #define $ac_tr_func 1
6380 EOF
6381  
6382 else
6383   echo "$ac_t""no" 1>&6
6384 fi
6385 done
6386
6387
6388                         
6389         echo $ac_n "checking for pthread_kill_other_threads_np""... $ac_c" 1>&6
6390 echo "configure:6391: checking for pthread_kill_other_threads_np" >&5
6391 if eval "test \"`echo '$''{'ac_cv_func_pthread_kill_other_threads_np'+set}'`\" = set"; then
6392   echo $ac_n "(cached) $ac_c" 1>&6
6393 else
6394   cat > conftest.$ac_ext <<EOF
6395 #line 6396 "configure"
6396 #include "confdefs.h"
6397 /* System header to define __stub macros and hopefully few prototypes,
6398     which can conflict with char pthread_kill_other_threads_np(); below.  */
6399 #include <assert.h>
6400 /* Override any gcc2 internal prototype to avoid an error.  */
6401 /* We use char because int might match the return type of a gcc2
6402     builtin and then its argument prototype would still apply.  */
6403 char pthread_kill_other_threads_np();
6404
6405 int main() {
6406
6407 /* The GNU C library defines this for functions which it implements
6408     to always fail with ENOSYS.  Some functions are actually named
6409     something starting with __ and the normal name is an alias.  */
6410 #if defined (__stub_pthread_kill_other_threads_np) || defined (__stub___pthread_kill_other_threads_np)
6411 choke me
6412 #else
6413 pthread_kill_other_threads_np();
6414 #endif
6415
6416 ; return 0; }
6417 EOF
6418 if { (eval echo configure:6419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6419   rm -rf conftest*
6420   eval "ac_cv_func_pthread_kill_other_threads_np=yes"
6421 else
6422   echo "configure: failed program was:" >&5
6423   cat conftest.$ac_ext >&5
6424   rm -rf conftest*
6425   eval "ac_cv_func_pthread_kill_other_threads_np=no"
6426 fi
6427 rm -f conftest*
6428 fi
6429
6430 if eval "test \"`echo '$ac_cv_func_'pthread_kill_other_threads_np`\" = yes"; then
6431   echo "$ac_t""yes" 1>&6
6432   :
6433 else
6434   echo "$ac_t""no" 1>&6
6435 fi
6436
6437         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
6438 echo "configure:6439: checking for LinuxThreads implementation" >&5
6439 if eval "test \"`echo '$''{'ol_cv_sys_linux_threads'+set}'`\" = set"; then
6440   echo $ac_n "(cached) $ac_c" 1>&6
6441 else
6442   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
6443 fi
6444
6445 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
6446
6447                         
6448         
6449         
6450         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
6451 echo "configure:6452: checking for LinuxThreads consistency" >&5
6452 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
6453   echo $ac_n "(cached) $ac_c" 1>&6
6454 else
6455   
6456                 if test $ol_cv_header_linux_threads = yes -a \
6457                         $ol_cv_sys_linux_threads = yes; then
6458                         ol_cv_linux_threads=yes
6459                 elif test $ol_cv_header_linux_threads = no -a \
6460                         $ol_cv_sys_linux_threads = no; then
6461                         ol_cv_linux_threads=no
6462                 else
6463                         ol_cv_linux_threads=error
6464                 fi
6465         
6466 fi
6467
6468 echo "$ac_t""$ol_cv_linux_threads" 1>&6
6469
6470
6471                         if test $ol_cv_linux_threads = error; then
6472                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
6473                         fi
6474
6475                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
6476 echo "configure:6477: checking if pthread_create() works" >&5
6477                         if eval "test \"`echo '$''{'ol_cv_pthread_create_works'+set}'`\" = set"; then
6478   echo $ac_n "(cached) $ac_c" 1>&6
6479 else
6480   
6481                         if test "$cross_compiling" = yes; then
6482                                 ol_cv_pthread_create_works=yes
6483 else
6484   cat > conftest.$ac_ext <<EOF
6485 #line 6486 "configure"
6486 #include "confdefs.h"
6487
6488 #include <pthread.h>
6489 #ifndef NULL
6490 #define NULL (void*)0
6491 #endif
6492
6493 static void *task(p)
6494         void *p;
6495 {
6496         return (void *) (p == NULL);
6497 }
6498
6499 int main(argc, argv)
6500         int argc;
6501         char **argv;
6502 {
6503         pthread_t t;
6504 #if HAVE_PTHREADS_D4
6505         exit(pthread_create(&t, pthread_attr_default, task, NULL));
6506 #else
6507         exit(pthread_create(&t, NULL, task, NULL));
6508 #endif
6509 }
6510
6511 EOF
6512 if { (eval echo configure:6513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6513 then
6514   ol_cv_pthread_create_works=yes
6515 else
6516   echo "configure: failed program was:" >&5
6517   cat conftest.$ac_ext >&5
6518   rm -fr conftest*
6519   ol_cv_pthread_create_works=no
6520 fi
6521 rm -fr conftest*
6522 fi
6523
6524 fi
6525
6526                         echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
6527
6528                         if test $ol_cv_pthread_create_works = no ; then
6529                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
6530                         fi
6531
6532                                                 if test $ol_with_yielding_select = auto ; then
6533                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
6534 echo "configure:6535: checking if select yields when using pthreads" >&5
6535                                 if eval "test \"`echo '$''{'ol_cv_pthread_select_yields'+set}'`\" = set"; then
6536   echo $ac_n "(cached) $ac_c" 1>&6
6537 else
6538   
6539                                 if test "$cross_compiling" = yes; then
6540   
6541                                 { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
6542 else
6543   cat > conftest.$ac_ext <<EOF
6544 #line 6545 "configure"
6545 #include "confdefs.h"
6546
6547 #include <sys/types.h>
6548 #include <sys/time.h>
6549 #include <unistd.h>
6550 #include <pthread.h>
6551 #ifndef NULL
6552 #define NULL (void*) 0
6553 #endif
6554
6555 static int fildes[2];
6556
6557 static void *task(p)
6558         void *p;
6559 {
6560         int i;
6561         struct timeval tv;
6562
6563         fd_set rfds;
6564
6565         tv.tv_sec=10;
6566         tv.tv_usec=0;
6567
6568         FD_ZERO(&rfds);
6569         FD_SET(fildes[0], &rfds);
6570
6571         /* we're not interested in any fds */
6572         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
6573
6574         if(i < 0) {
6575                 perror("select");
6576                 exit(10);
6577         }
6578
6579         exit(0); /* if we exit here, the select blocked the whole process */
6580 }
6581
6582 int main(argc, argv)
6583         int argc;
6584         char **argv;
6585 {
6586         pthread_t t;
6587
6588         /* create a pipe to select */
6589         if(pipe(&fildes[0])) {
6590                 perror("select");
6591                 exit(1);
6592         }
6593
6594 #ifdef HAVE_PTHREAD_SETCONCURRENCY
6595         (void) pthread_setconcurrency(2);
6596 #else
6597 #ifdef HAVE_THR_SETCONCURRENCY
6598         /* Set Solaris LWP concurrency to 2 */
6599         thr_setconcurrency(2);
6600 #endif
6601 #endif
6602
6603 #if HAVE_PTHREADS_D4
6604         pthread_create(&t, pthread_attr_default, task, NULL);
6605 #else
6606         pthread_create(&t, NULL, task, NULL);
6607 #endif
6608
6609 #if HAVE_SCHED_YIELD
6610         sched_yield();  /* make sure task runs first */
6611 #else
6612 #ifdef HAVE_PTHREAD_YIELD
6613         pthread_yield();        /* make sure task runs first */
6614 #endif
6615 #endif
6616
6617         exit(2);
6618 }
6619 EOF
6620 if { (eval echo configure:6621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6621 then
6622   ol_cv_pthread_select_yields=no
6623 else
6624   echo "configure: failed program was:" >&5
6625   cat conftest.$ac_ext >&5
6626   rm -fr conftest*
6627   ol_cv_pthread_select_yields=yes
6628 fi
6629 rm -fr conftest*
6630 fi
6631
6632 fi
6633
6634                                 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
6635
6636                                 if test $ol_cv_pthread_select_yields = yes ; then
6637                                         ol_with_yielding_select=yes
6638                                 fi
6639                         fi
6640
6641                                                 CPPFLAGS="$save_CPPFLAGS"
6642                         LIBS="$save_LIBS"
6643                 else
6644                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
6645                 fi
6646         fi
6647
6648         if test $ol_with_threads = posix ; then
6649                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
6650         fi
6651 fi
6652
6653 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6654         -o $ol_with_threads = mach ; then
6655
6656                 for ac_hdr in mach/cthreads.h
6657 do
6658 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6659 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6660 echo "configure:6661: checking for $ac_hdr" >&5
6661 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6662   echo $ac_n "(cached) $ac_c" 1>&6
6663 else
6664   cat > conftest.$ac_ext <<EOF
6665 #line 6666 "configure"
6666 #include "confdefs.h"
6667 #include <$ac_hdr>
6668 EOF
6669 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6670 { (eval echo configure:6671: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6671 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6672 if test -z "$ac_err"; then
6673   rm -rf conftest*
6674   eval "ac_cv_header_$ac_safe=yes"
6675 else
6676   echo "$ac_err" >&5
6677   echo "configure: failed program was:" >&5
6678   cat conftest.$ac_ext >&5
6679   rm -rf conftest*
6680   eval "ac_cv_header_$ac_safe=no"
6681 fi
6682 rm -f conftest*
6683 fi
6684 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6685   echo "$ac_t""yes" 1>&6
6686     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6687   cat >> confdefs.h <<EOF
6688 #define $ac_tr_hdr 1
6689 EOF
6690  
6691 else
6692   echo "$ac_t""no" 1>&6
6693 fi
6694 done
6695
6696         if test $ac_cv_header_mach_cthreads_h = yes ; then
6697                 ol_with_threads=found
6698
6699                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
6700 echo "configure:6701: checking for cthread_fork" >&5
6701 if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
6702   echo $ac_n "(cached) $ac_c" 1>&6
6703 else
6704   cat > conftest.$ac_ext <<EOF
6705 #line 6706 "configure"
6706 #include "confdefs.h"
6707 /* System header to define __stub macros and hopefully few prototypes,
6708     which can conflict with char cthread_fork(); below.  */
6709 #include <assert.h>
6710 /* Override any gcc2 internal prototype to avoid an error.  */
6711 /* We use char because int might match the return type of a gcc2
6712     builtin and then its argument prototype would still apply.  */
6713 char cthread_fork();
6714
6715 int main() {
6716
6717 /* The GNU C library defines this for functions which it implements
6718     to always fail with ENOSYS.  Some functions are actually named
6719     something starting with __ and the normal name is an alias.  */
6720 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
6721 choke me
6722 #else
6723 cthread_fork();
6724 #endif
6725
6726 ; return 0; }
6727 EOF
6728 if { (eval echo configure:6729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6729   rm -rf conftest*
6730   eval "ac_cv_func_cthread_fork=yes"
6731 else
6732   echo "configure: failed program was:" >&5
6733   cat conftest.$ac_ext >&5
6734   rm -rf conftest*
6735   eval "ac_cv_func_cthread_fork=no"
6736 fi
6737 rm -f conftest*
6738 fi
6739
6740 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
6741   echo "$ac_t""yes" 1>&6
6742   ol_link_threads=yes
6743 else
6744   echo "$ac_t""no" 1>&6
6745 fi
6746
6747
6748                 if test $ol_link_threads = no ; then
6749                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
6750 echo "configure:6751: checking for cthread_fork with -all_load" >&5
6751 if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
6752   echo $ac_n "(cached) $ac_c" 1>&6
6753 else
6754   
6755                                                                 save_LIBS="$LIBS"
6756                                 LIBS="-all_load $LIBS"
6757                                 cat > conftest.$ac_ext <<EOF
6758 #line 6759 "configure"
6759 #include "confdefs.h"
6760 #include <mach/cthreads.h>
6761 int main() {
6762
6763                                         cthread_fork((void *)0, (void *)0);
6764                                         
6765 ; return 0; }
6766 EOF
6767 if { (eval echo configure:6768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6768   rm -rf conftest*
6769   ol_cv_cthread_all_load=yes
6770 else
6771   echo "configure: failed program was:" >&5
6772   cat conftest.$ac_ext >&5
6773   rm -rf conftest*
6774   ol_cv_cthread_all_load=no
6775 fi
6776 rm -f conftest*
6777                                                                 LIBS="$save_LIBS"
6778                         
6779 fi
6780
6781 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
6782
6783                         if test $ol_cv_cthread_all_load = yes ; then
6784                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
6785                                 ol_link_threads=mach
6786                         fi
6787                 fi
6788
6789                 if test $ol_link_threads != no ; then
6790                         : check for cthread specific functionality here
6791                         cat >> confdefs.h <<\EOF
6792 #define HAVE_MACH_CTHREADS 1
6793 EOF
6794
6795                 else
6796                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
6797                 fi
6798         fi
6799
6800         if test $ol_with_threads = mach ; then
6801                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
6802         fi
6803 fi
6804
6805 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6806         -o $ol_with_threads = lwp ; then
6807
6808                 for ac_hdr in thread.h synch.h
6809 do
6810 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6811 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6812 echo "configure:6813: checking for $ac_hdr" >&5
6813 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6814   echo $ac_n "(cached) $ac_c" 1>&6
6815 else
6816   cat > conftest.$ac_ext <<EOF
6817 #line 6818 "configure"
6818 #include "confdefs.h"
6819 #include <$ac_hdr>
6820 EOF
6821 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6822 { (eval echo configure:6823: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6823 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6824 if test -z "$ac_err"; then
6825   rm -rf conftest*
6826   eval "ac_cv_header_$ac_safe=yes"
6827 else
6828   echo "$ac_err" >&5
6829   echo "configure: failed program was:" >&5
6830   cat conftest.$ac_ext >&5
6831   rm -rf conftest*
6832   eval "ac_cv_header_$ac_safe=no"
6833 fi
6834 rm -f conftest*
6835 fi
6836 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6837   echo "$ac_t""yes" 1>&6
6838     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6839   cat >> confdefs.h <<EOF
6840 #define $ac_tr_hdr 1
6841 EOF
6842  
6843 else
6844   echo "$ac_t""no" 1>&6
6845 fi
6846 done
6847
6848         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
6849                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
6850 echo "configure:6851: checking for thr_create in -lthread" >&5
6851 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
6852 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6853   echo $ac_n "(cached) $ac_c" 1>&6
6854 else
6855   ac_save_LIBS="$LIBS"
6856 LIBS="-lthread  $LIBS"
6857 cat > conftest.$ac_ext <<EOF
6858 #line 6859 "configure"
6859 #include "confdefs.h"
6860 /* Override any gcc2 internal prototype to avoid an error.  */
6861 /* We use char because int might match the return type of a gcc2
6862     builtin and then its argument prototype would still apply.  */
6863 char thr_create();
6864
6865 int main() {
6866 thr_create()
6867 ; return 0; }
6868 EOF
6869 if { (eval echo configure:6870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6870   rm -rf conftest*
6871   eval "ac_cv_lib_$ac_lib_var=yes"
6872 else
6873   echo "configure: failed program was:" >&5
6874   cat conftest.$ac_ext >&5
6875   rm -rf conftest*
6876   eval "ac_cv_lib_$ac_lib_var=no"
6877 fi
6878 rm -f conftest*
6879 LIBS="$ac_save_LIBS"
6880
6881 fi
6882 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6883   echo "$ac_t""yes" 1>&6
6884   have_thr=yes
6885 else
6886   echo "$ac_t""no" 1>&6
6887 have_thr=no
6888 fi
6889
6890
6891                 if test $have_thr = yes ; then
6892                         cat >> confdefs.h <<\EOF
6893 #define HAVE_THR 1
6894 EOF
6895
6896                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
6897                         ol_link_threads=thr
6898
6899                         if test $ol_with_yielding_select = auto ; then
6900                                 ol_with_yielding_select=yes
6901                         fi
6902
6903                                                 for ac_func in \
6904                                 thr_setconcurrency \
6905                                 thr_getconcurrency \
6906                         
6907 do
6908 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6909 echo "configure:6910: checking for $ac_func" >&5
6910 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6911   echo $ac_n "(cached) $ac_c" 1>&6
6912 else
6913   cat > conftest.$ac_ext <<EOF
6914 #line 6915 "configure"
6915 #include "confdefs.h"
6916 /* System header to define __stub macros and hopefully few prototypes,
6917     which can conflict with char $ac_func(); below.  */
6918 #include <assert.h>
6919 /* Override any gcc2 internal prototype to avoid an error.  */
6920 /* We use char because int might match the return type of a gcc2
6921     builtin and then its argument prototype would still apply.  */
6922 char $ac_func();
6923
6924 int main() {
6925
6926 /* The GNU C library defines this for functions which it implements
6927     to always fail with ENOSYS.  Some functions are actually named
6928     something starting with __ and the normal name is an alias.  */
6929 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6930 choke me
6931 #else
6932 $ac_func();
6933 #endif
6934
6935 ; return 0; }
6936 EOF
6937 if { (eval echo configure:6938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6938   rm -rf conftest*
6939   eval "ac_cv_func_$ac_func=yes"
6940 else
6941   echo "configure: failed program was:" >&5
6942   cat conftest.$ac_ext >&5
6943   rm -rf conftest*
6944   eval "ac_cv_func_$ac_func=no"
6945 fi
6946 rm -f conftest*
6947 fi
6948
6949 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6950   echo "$ac_t""yes" 1>&6
6951     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6952   cat >> confdefs.h <<EOF
6953 #define $ac_tr_func 1
6954 EOF
6955  
6956 else
6957   echo "$ac_t""no" 1>&6
6958 fi
6959 done
6960
6961                 fi
6962         fi
6963
6964                 for ac_hdr in lwp/lwp.h
6965 do
6966 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6967 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6968 echo "configure:6969: checking for $ac_hdr" >&5
6969 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6970   echo $ac_n "(cached) $ac_c" 1>&6
6971 else
6972   cat > conftest.$ac_ext <<EOF
6973 #line 6974 "configure"
6974 #include "confdefs.h"
6975 #include <$ac_hdr>
6976 EOF
6977 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6978 { (eval echo configure:6979: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6979 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6980 if test -z "$ac_err"; then
6981   rm -rf conftest*
6982   eval "ac_cv_header_$ac_safe=yes"
6983 else
6984   echo "$ac_err" >&5
6985   echo "configure: failed program was:" >&5
6986   cat conftest.$ac_ext >&5
6987   rm -rf conftest*
6988   eval "ac_cv_header_$ac_safe=no"
6989 fi
6990 rm -f conftest*
6991 fi
6992 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6993   echo "$ac_t""yes" 1>&6
6994     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6995   cat >> confdefs.h <<EOF
6996 #define $ac_tr_hdr 1
6997 EOF
6998  
6999 else
7000   echo "$ac_t""no" 1>&6
7001 fi
7002 done
7003
7004         if test $ac_cv_header_lwp_lwp_h = yes ; then
7005                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
7006 echo "configure:7007: checking for lwp_create in -llwp" >&5
7007 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
7008 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7009   echo $ac_n "(cached) $ac_c" 1>&6
7010 else
7011   ac_save_LIBS="$LIBS"
7012 LIBS="-llwp  $LIBS"
7013 cat > conftest.$ac_ext <<EOF
7014 #line 7015 "configure"
7015 #include "confdefs.h"
7016 /* Override any gcc2 internal prototype to avoid an error.  */
7017 /* We use char because int might match the return type of a gcc2
7018     builtin and then its argument prototype would still apply.  */
7019 char lwp_create();
7020
7021 int main() {
7022 lwp_create()
7023 ; return 0; }
7024 EOF
7025 if { (eval echo configure:7026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7026   rm -rf conftest*
7027   eval "ac_cv_lib_$ac_lib_var=yes"
7028 else
7029   echo "configure: failed program was:" >&5
7030   cat conftest.$ac_ext >&5
7031   rm -rf conftest*
7032   eval "ac_cv_lib_$ac_lib_var=no"
7033 fi
7034 rm -f conftest*
7035 LIBS="$ac_save_LIBS"
7036
7037 fi
7038 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7039   echo "$ac_t""yes" 1>&6
7040   have_lwp=yes
7041 else
7042   echo "$ac_t""no" 1>&6
7043 have_lwp=no
7044 fi
7045
7046
7047                 if test $have_lwp = yes ; then
7048                         cat >> confdefs.h <<\EOF
7049 #define HAVE_LWP 1
7050 EOF
7051
7052                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
7053                         ol_link_threads=lwp
7054
7055                         if test $ol_with_yielding_select = auto ; then
7056                                 ol_with_yielding_select=no
7057                         fi
7058                 fi
7059         fi
7060 fi
7061
7062 if test $ol_with_yielding_select = yes ; then
7063         cat >> confdefs.h <<\EOF
7064 #define HAVE_YIELDING_SELECT 1
7065 EOF
7066
7067 fi
7068
7069 if test $ol_with_threads = manual ; then
7070                 ol_link_threads=yes
7071
7072         echo "configure: warning: thread defines and link options must be set manually" 1>&2
7073
7074         for ac_hdr in pthread.h sched.h
7075 do
7076 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7077 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7078 echo "configure:7079: checking for $ac_hdr" >&5
7079 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7080   echo $ac_n "(cached) $ac_c" 1>&6
7081 else
7082   cat > conftest.$ac_ext <<EOF
7083 #line 7084 "configure"
7084 #include "confdefs.h"
7085 #include <$ac_hdr>
7086 EOF
7087 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7088 { (eval echo configure:7089: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7089 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7090 if test -z "$ac_err"; then
7091   rm -rf conftest*
7092   eval "ac_cv_header_$ac_safe=yes"
7093 else
7094   echo "$ac_err" >&5
7095   echo "configure: failed program was:" >&5
7096   cat conftest.$ac_ext >&5
7097   rm -rf conftest*
7098   eval "ac_cv_header_$ac_safe=no"
7099 fi
7100 rm -f conftest*
7101 fi
7102 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7103   echo "$ac_t""yes" 1>&6
7104     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7105   cat >> confdefs.h <<EOF
7106 #define $ac_tr_hdr 1
7107 EOF
7108  
7109 else
7110   echo "$ac_t""no" 1>&6
7111 fi
7112 done
7113
7114         for ac_func in sched_yield pthread_yield
7115 do
7116 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7117 echo "configure:7118: checking for $ac_func" >&5
7118 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
7119   echo $ac_n "(cached) $ac_c" 1>&6
7120 else
7121   cat > conftest.$ac_ext <<EOF
7122 #line 7123 "configure"
7123 #include "confdefs.h"
7124 /* System header to define __stub macros and hopefully few prototypes,
7125     which can conflict with char $ac_func(); below.  */
7126 #include <assert.h>
7127 /* Override any gcc2 internal prototype to avoid an error.  */
7128 /* We use char because int might match the return type of a gcc2
7129     builtin and then its argument prototype would still apply.  */
7130 char $ac_func();
7131
7132 int main() {
7133
7134 /* The GNU C library defines this for functions which it implements
7135     to always fail with ENOSYS.  Some functions are actually named
7136     something starting with __ and the normal name is an alias.  */
7137 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7138 choke me
7139 #else
7140 $ac_func();
7141 #endif
7142
7143 ; return 0; }
7144 EOF
7145 if { (eval echo configure:7146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7146   rm -rf conftest*
7147   eval "ac_cv_func_$ac_func=yes"
7148 else
7149   echo "configure: failed program was:" >&5
7150   cat conftest.$ac_ext >&5
7151   rm -rf conftest*
7152   eval "ac_cv_func_$ac_func=no"
7153 fi
7154 rm -f conftest*
7155 fi
7156
7157 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7158   echo "$ac_t""yes" 1>&6
7159     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7160   cat >> confdefs.h <<EOF
7161 #define $ac_tr_func 1
7162 EOF
7163  
7164 else
7165   echo "$ac_t""no" 1>&6
7166 fi
7167 done
7168
7169         
7170         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
7171 echo "configure:7172: checking for LinuxThreads pthread.h" >&5
7172 if eval "test \"`echo '$''{'ol_cv_header_linux_threads'+set}'`\" = set"; then
7173   echo $ac_n "(cached) $ac_c" 1>&6
7174 else
7175   cat > conftest.$ac_ext <<EOF
7176 #line 7177 "configure"
7177 #include "confdefs.h"
7178 #include <pthread.h>
7179 EOF
7180 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7181   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
7182   rm -rf conftest*
7183   ol_cv_header_linux_threads=yes
7184 else
7185   rm -rf conftest*
7186   ol_cv_header_linux_threads=no
7187 fi
7188 rm -f conftest*
7189
7190                 
7191 fi
7192
7193 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
7194         if test $ol_cv_header_linux_threads = yes; then
7195                 cat >> confdefs.h <<\EOF
7196 #define HAVE_LINUX_THREADS 1
7197 EOF
7198
7199         fi
7200
7201
7202         for ac_hdr in mach/cthreads.h
7203 do
7204 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7205 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7206 echo "configure:7207: checking for $ac_hdr" >&5
7207 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7208   echo $ac_n "(cached) $ac_c" 1>&6
7209 else
7210   cat > conftest.$ac_ext <<EOF
7211 #line 7212 "configure"
7212 #include "confdefs.h"
7213 #include <$ac_hdr>
7214 EOF
7215 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7216 { (eval echo configure:7217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7217 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7218 if test -z "$ac_err"; then
7219   rm -rf conftest*
7220   eval "ac_cv_header_$ac_safe=yes"
7221 else
7222   echo "$ac_err" >&5
7223   echo "configure: failed program was:" >&5
7224   cat conftest.$ac_ext >&5
7225   rm -rf conftest*
7226   eval "ac_cv_header_$ac_safe=no"
7227 fi
7228 rm -f conftest*
7229 fi
7230 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7231   echo "$ac_t""yes" 1>&6
7232     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7233   cat >> confdefs.h <<EOF
7234 #define $ac_tr_hdr 1
7235 EOF
7236  
7237 else
7238   echo "$ac_t""no" 1>&6
7239 fi
7240 done
7241
7242         for ac_hdr in lwp/lwp.h
7243 do
7244 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7245 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7246 echo "configure:7247: checking for $ac_hdr" >&5
7247 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7248   echo $ac_n "(cached) $ac_c" 1>&6
7249 else
7250   cat > conftest.$ac_ext <<EOF
7251 #line 7252 "configure"
7252 #include "confdefs.h"
7253 #include <$ac_hdr>
7254 EOF
7255 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7256 { (eval echo configure:7257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7257 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7258 if test -z "$ac_err"; then
7259   rm -rf conftest*
7260   eval "ac_cv_header_$ac_safe=yes"
7261 else
7262   echo "$ac_err" >&5
7263   echo "configure: failed program was:" >&5
7264   cat conftest.$ac_ext >&5
7265   rm -rf conftest*
7266   eval "ac_cv_header_$ac_safe=no"
7267 fi
7268 rm -f conftest*
7269 fi
7270 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7271   echo "$ac_t""yes" 1>&6
7272     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7273   cat >> confdefs.h <<EOF
7274 #define $ac_tr_hdr 1
7275 EOF
7276  
7277 else
7278   echo "$ac_t""no" 1>&6
7279 fi
7280 done
7281
7282         for ac_hdr in thread.h synch.h
7283 do
7284 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7285 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7286 echo "configure:7287: checking for $ac_hdr" >&5
7287 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7288   echo $ac_n "(cached) $ac_c" 1>&6
7289 else
7290   cat > conftest.$ac_ext <<EOF
7291 #line 7292 "configure"
7292 #include "confdefs.h"
7293 #include <$ac_hdr>
7294 EOF
7295 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7296 { (eval echo configure:7297: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7297 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7298 if test -z "$ac_err"; then
7299   rm -rf conftest*
7300   eval "ac_cv_header_$ac_safe=yes"
7301 else
7302   echo "$ac_err" >&5
7303   echo "configure: failed program was:" >&5
7304   cat conftest.$ac_ext >&5
7305   rm -rf conftest*
7306   eval "ac_cv_header_$ac_safe=no"
7307 fi
7308 rm -f conftest*
7309 fi
7310 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7311   echo "$ac_t""yes" 1>&6
7312     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7313   cat >> confdefs.h <<EOF
7314 #define $ac_tr_hdr 1
7315 EOF
7316  
7317 else
7318   echo "$ac_t""no" 1>&6
7319 fi
7320 done
7321
7322 fi
7323
7324 if test $ol_link_threads != no ; then  
7325                         cat >> confdefs.h <<\EOF
7326 #define REENTRANT 1
7327 EOF
7328
7329         cat >> confdefs.h <<\EOF
7330 #define _REENTRANT 1
7331 EOF
7332
7333         cat >> confdefs.h <<\EOF
7334 #define THREAD_SAFE 1
7335 EOF
7336
7337         cat >> confdefs.h <<\EOF
7338 #define _THREAD_SAFE 1
7339 EOF
7340
7341         cat >> confdefs.h <<\EOF
7342 #define THREADSAFE 1
7343 EOF
7344
7345         cat >> confdefs.h <<\EOF
7346 #define _THREADSAFE 1
7347 EOF
7348
7349
7350                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
7351 echo "configure:7352: checking for thread specific errno" >&5
7352 if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
7353   echo $ac_n "(cached) $ac_c" 1>&6
7354 else
7355   
7356                 cat > conftest.$ac_ext <<EOF
7357 #line 7358 "configure"
7358 #include "confdefs.h"
7359 #include <errno.h>
7360 int main() {
7361 errno = 0;
7362 ; return 0; }
7363 EOF
7364 if { (eval echo configure:7365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7365   rm -rf conftest*
7366   ol_cv_errno_thread_specific=yes
7367 else
7368   echo "configure: failed program was:" >&5
7369   cat conftest.$ac_ext >&5
7370   rm -rf conftest*
7371   ol_cv_errno_thread_specific=no
7372 fi
7373 rm -f conftest*
7374         
7375 fi
7376
7377 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
7378
7379                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
7380 echo "configure:7381: checking for thread specific h_errno" >&5
7381 if eval "test \"`echo '$''{'ol_cv_h_errno_thread_specific'+set}'`\" = set"; then
7382   echo $ac_n "(cached) $ac_c" 1>&6
7383 else
7384   
7385                 cat > conftest.$ac_ext <<EOF
7386 #line 7387 "configure"
7387 #include "confdefs.h"
7388 #include <netdb.h>
7389 int main() {
7390 h_errno = 0;
7391 ; return 0; }
7392 EOF
7393 if { (eval echo configure:7394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7394   rm -rf conftest*
7395   ol_cv_h_errno_thread_specific=yes
7396 else
7397   echo "configure: failed program was:" >&5
7398   cat conftest.$ac_ext >&5
7399   rm -rf conftest*
7400   ol_cv_h_errno_thread_specific=no
7401 fi
7402 rm -f conftest*
7403         
7404 fi
7405
7406 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
7407
7408         if test $ol_cv_errno_thread_specific != yes \
7409                 -o $ol_cv_h_errno_thread_specific != yes ; then
7410                 LIBS="$LTHREAD_LIBS $LIBS"
7411                 LTHREAD_LIBS=""
7412         fi
7413
7414 fi  
7415
7416 if test $ol_link_threads = no ; then
7417         if test $ol_with_threads = yes ; then
7418                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
7419         fi
7420
7421         if test $ol_with_threads = auto ; then
7422                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
7423                 ol_with_threads=no
7424         fi
7425
7426         cat >> confdefs.h <<\EOF
7427 #define NO_THREADS 1
7428 EOF
7429
7430         LTHREAD_LIBS=""
7431 fi
7432
7433 if test $ol_link_threads != no ; then
7434         cat >> confdefs.h <<\EOF
7435 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
7436 EOF
7437
7438 fi
7439
7440
7441 ol_link_ldbm=no 
7442 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
7443         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
7444 echo "configure:7445: checking for DB2 library" >&5
7445 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
7446   echo $ac_n "(cached) $ac_c" 1>&6
7447 else
7448         ol_LIBS="$LIBS"
7449         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
7450 echo "configure:7451: checking for db_open in -ldb" >&5
7451 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
7452 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7453   echo $ac_n "(cached) $ac_c" 1>&6
7454 else
7455   ac_save_LIBS="$LIBS"
7456 LIBS="-ldb  $LIBS"
7457 cat > conftest.$ac_ext <<EOF
7458 #line 7459 "configure"
7459 #include "confdefs.h"
7460 /* Override any gcc2 internal prototype to avoid an error.  */
7461 /* We use char because int might match the return type of a gcc2
7462     builtin and then its argument prototype would still apply.  */
7463 char db_open();
7464
7465 int main() {
7466 db_open()
7467 ; return 0; }
7468 EOF
7469 if { (eval echo configure:7470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7470   rm -rf conftest*
7471   eval "ac_cv_lib_$ac_lib_var=yes"
7472 else
7473   echo "configure: failed program was:" >&5
7474   cat conftest.$ac_ext >&5
7475   rm -rf conftest*
7476   eval "ac_cv_lib_$ac_lib_var=no"
7477 fi
7478 rm -f conftest*
7479 LIBS="$ac_save_LIBS"
7480
7481 fi
7482 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7483   echo "$ac_t""yes" 1>&6
7484   ol_cv_lib_db2=-ldb
7485 else
7486   echo "$ac_t""no" 1>&6
7487 ol_cv_lib_db2=no
7488 fi
7489
7490         LIBS="$ol_LIBS"
7491
7492 fi
7493
7494 echo "$ac_t""$ol_cv_lib_db2" 1>&6
7495
7496 for ac_hdr in db.h
7497 do
7498 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7499 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7500 echo "configure:7501: checking for $ac_hdr" >&5
7501 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7502   echo $ac_n "(cached) $ac_c" 1>&6
7503 else
7504   cat > conftest.$ac_ext <<EOF
7505 #line 7506 "configure"
7506 #include "confdefs.h"
7507 #include <$ac_hdr>
7508 EOF
7509 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7510 { (eval echo configure:7511: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7511 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7512 if test -z "$ac_err"; then
7513   rm -rf conftest*
7514   eval "ac_cv_header_$ac_safe=yes"
7515 else
7516   echo "$ac_err" >&5
7517   echo "configure: failed program was:" >&5
7518   cat conftest.$ac_ext >&5
7519   rm -rf conftest*
7520   eval "ac_cv_header_$ac_safe=no"
7521 fi
7522 rm -f conftest*
7523 fi
7524 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7525   echo "$ac_t""yes" 1>&6
7526     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7527   cat >> confdefs.h <<EOF
7528 #define $ac_tr_hdr 1
7529 EOF
7530  
7531 else
7532   echo "$ac_t""no" 1>&6
7533 fi
7534 done
7535
7536 if test $ac_cv_header_db_h = yes ; then
7537         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
7538 echo "configure:7539: checking if db.h is DB2" >&5
7539 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
7540   echo $ac_n "(cached) $ac_c" 1>&6
7541 else
7542   
7543                 cat > conftest.$ac_ext <<EOF
7544 #line 7545 "configure"
7545 #include "confdefs.h"
7546
7547 #                       include <db.h>
7548                         /* this check could be improved */
7549 #                       ifdef DB_VERSION_MAJOR
7550 #                               if DB_VERSION_MAJOR == 2
7551                                         __db_version_2
7552 #                               endif
7553 #                       endif
7554                 
7555 EOF
7556 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7557   egrep "__db_version_2" >/dev/null 2>&1; then
7558   rm -rf conftest*
7559   ol_cv_header_db2=yes
7560 else
7561   rm -rf conftest*
7562   ol_cv_header_db2=no
7563 fi
7564 rm -f conftest*
7565
7566 fi
7567
7568 echo "$ac_t""$ol_cv_header_db2" 1>&6
7569 else
7570         ol_cv_header_db2=no
7571 fi
7572
7573
7574  
7575  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
7576 echo "configure:7577: checking for Berkeley DB2" >&5
7577 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
7578   echo $ac_n "(cached) $ac_c" 1>&6
7579 else
7580   
7581         if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then
7582                 ol_cv_berkeley_db2=no
7583         else
7584                 ol_cv_berkeley_db2=yes
7585         fi
7586
7587 fi
7588
7589 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
7590  if test $ol_cv_berkeley_db2 = yes ; then
7591         cat >> confdefs.h <<\EOF
7592 #define HAVE_BERKELEY_DB2 1
7593 EOF
7594
7595  fi
7596
7597
7598         if test $ol_cv_berkeley_db2 = yes ; then
7599                 ol_link_ldbm=db2
7600                 ol_with_ldbm_api=db2
7601
7602                 if test $ol_with_ldbm_type = hash ; then
7603                         cat >> confdefs.h <<\EOF
7604 #define LDBM_USE_DBHASH 1
7605 EOF
7606
7607                 else
7608                         cat >> confdefs.h <<\EOF
7609 #define LDBM_USE_DBBTREE 1
7610 EOF
7611
7612                 fi
7613
7614                                                 if test $ol_cv_lib_db2 != yes ; then
7615                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
7616                 fi
7617         fi
7618 fi
7619
7620 ol_link_bdb2=no
7621 if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
7622         ol_link_bdb2=yes
7623 fi
7624
7625 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
7626         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
7627 echo "configure:7628: checking for Berkeley DB library" >&5
7628 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
7629   echo $ac_n "(cached) $ac_c" 1>&6
7630 else
7631   
7632         for ac_hdr in db1/db.h
7633 do
7634 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7635 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7636 echo "configure:7637: checking for $ac_hdr" >&5
7637 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7638   echo $ac_n "(cached) $ac_c" 1>&6
7639 else
7640   cat > conftest.$ac_ext <<EOF
7641 #line 7642 "configure"
7642 #include "confdefs.h"
7643 #include <$ac_hdr>
7644 EOF
7645 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7646 { (eval echo configure:7647: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7647 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7648 if test -z "$ac_err"; then
7649   rm -rf conftest*
7650   eval "ac_cv_header_$ac_safe=yes"
7651 else
7652   echo "$ac_err" >&5
7653   echo "configure: failed program was:" >&5
7654   cat conftest.$ac_ext >&5
7655   rm -rf conftest*
7656   eval "ac_cv_header_$ac_safe=no"
7657 fi
7658 rm -f conftest*
7659 fi
7660 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7661   echo "$ac_t""yes" 1>&6
7662     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7663   cat >> confdefs.h <<EOF
7664 #define $ac_tr_hdr 1
7665 EOF
7666  
7667 else
7668   echo "$ac_t""no" 1>&6
7669 fi
7670 done
7671
7672         ol_LIBS="$LIBS"
7673         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
7674 echo "configure:7675: checking for dbopen" >&5
7675 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
7676   echo $ac_n "(cached) $ac_c" 1>&6
7677 else
7678   cat > conftest.$ac_ext <<EOF
7679 #line 7680 "configure"
7680 #include "confdefs.h"
7681 /* System header to define __stub macros and hopefully few prototypes,
7682     which can conflict with char dbopen(); below.  */
7683 #include <assert.h>
7684 /* Override any gcc2 internal prototype to avoid an error.  */
7685 /* We use char because int might match the return type of a gcc2
7686     builtin and then its argument prototype would still apply.  */
7687 char dbopen();
7688
7689 int main() {
7690
7691 /* The GNU C library defines this for functions which it implements
7692     to always fail with ENOSYS.  Some functions are actually named
7693     something starting with __ and the normal name is an alias.  */
7694 #if defined (__stub_dbopen) || defined (__stub___dbopen)
7695 choke me
7696 #else
7697 dbopen();
7698 #endif
7699
7700 ; return 0; }
7701 EOF
7702 if { (eval echo configure:7703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7703   rm -rf conftest*
7704   eval "ac_cv_func_dbopen=yes"
7705 else
7706   echo "configure: failed program was:" >&5
7707   cat conftest.$ac_ext >&5
7708   rm -rf conftest*
7709   eval "ac_cv_func_dbopen=no"
7710 fi
7711 rm -f conftest*
7712 fi
7713
7714 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
7715   echo "$ac_t""yes" 1>&6
7716   ol_cv_lib_db=yes
7717 else
7718   echo "$ac_t""no" 1>&6
7719
7720                 echo $ac_n "checking for dbopen in -ldb1""... $ac_c" 1>&6
7721 echo "configure:7722: checking for dbopen in -ldb1" >&5
7722 ac_lib_var=`echo db1'_'dbopen | sed 'y%./+-%__p_%'`
7723 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7724   echo $ac_n "(cached) $ac_c" 1>&6
7725 else
7726   ac_save_LIBS="$LIBS"
7727 LIBS="-ldb1  $LIBS"
7728 cat > conftest.$ac_ext <<EOF
7729 #line 7730 "configure"
7730 #include "confdefs.h"
7731 /* Override any gcc2 internal prototype to avoid an error.  */
7732 /* We use char because int might match the return type of a gcc2
7733     builtin and then its argument prototype would still apply.  */
7734 char dbopen();
7735
7736 int main() {
7737 dbopen()
7738 ; return 0; }
7739 EOF
7740 if { (eval echo configure:7741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7741   rm -rf conftest*
7742   eval "ac_cv_lib_$ac_lib_var=yes"
7743 else
7744   echo "configure: failed program was:" >&5
7745   cat conftest.$ac_ext >&5
7746   rm -rf conftest*
7747   eval "ac_cv_lib_$ac_lib_var=no"
7748 fi
7749 rm -f conftest*
7750 LIBS="$ac_save_LIBS"
7751
7752 fi
7753 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7754   echo "$ac_t""yes" 1>&6
7755   ol_cv_lib_db=-ldb1
7756 else
7757   echo "$ac_t""no" 1>&6
7758
7759                         echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
7760 echo "configure:7761: checking for dbopen in -ldb" >&5
7761 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
7762 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7763   echo $ac_n "(cached) $ac_c" 1>&6
7764 else
7765   ac_save_LIBS="$LIBS"
7766 LIBS="-ldb  $LIBS"
7767 cat > conftest.$ac_ext <<EOF
7768 #line 7769 "configure"
7769 #include "confdefs.h"
7770 /* Override any gcc2 internal prototype to avoid an error.  */
7771 /* We use char because int might match the return type of a gcc2
7772     builtin and then its argument prototype would still apply.  */
7773 char dbopen();
7774
7775 int main() {
7776 dbopen()
7777 ; return 0; }
7778 EOF
7779 if { (eval echo configure:7780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7780   rm -rf conftest*
7781   eval "ac_cv_lib_$ac_lib_var=yes"
7782 else
7783   echo "configure: failed program was:" >&5
7784   cat conftest.$ac_ext >&5
7785   rm -rf conftest*
7786   eval "ac_cv_lib_$ac_lib_var=no"
7787 fi
7788 rm -f conftest*
7789 LIBS="$ac_save_LIBS"
7790
7791 fi
7792 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7793   echo "$ac_t""yes" 1>&6
7794   ol_cv_lib_db=-ldb
7795 else
7796   echo "$ac_t""no" 1>&6
7797 ol_cv_lib_db=no
7798 fi
7799
7800                 
7801 fi
7802
7803         
7804 fi
7805
7806         LIBS="$ol_LIBS"
7807
7808 fi
7809
7810 echo "$ac_t""$ol_cv_lib_db" 1>&6
7811
7812
7813 for ac_hdr in db_185.h
7814 do
7815 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7816 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7817 echo "configure:7818: checking for $ac_hdr" >&5
7818 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7819   echo $ac_n "(cached) $ac_c" 1>&6
7820 else
7821   cat > conftest.$ac_ext <<EOF
7822 #line 7823 "configure"
7823 #include "confdefs.h"
7824 #include <$ac_hdr>
7825 EOF
7826 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7827 { (eval echo configure:7828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7828 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7829 if test -z "$ac_err"; then
7830   rm -rf conftest*
7831   eval "ac_cv_header_$ac_safe=yes"
7832 else
7833   echo "$ac_err" >&5
7834   echo "configure: failed program was:" >&5
7835   cat conftest.$ac_ext >&5
7836   rm -rf conftest*
7837   eval "ac_cv_header_$ac_safe=no"
7838 fi
7839 rm -f conftest*
7840 fi
7841 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7842   echo "$ac_t""yes" 1>&6
7843     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7844   cat >> confdefs.h <<EOF
7845 #define $ac_tr_hdr 1
7846 EOF
7847  
7848 else
7849   echo "$ac_t""no" 1>&6
7850 fi
7851 done
7852
7853 if test "$ol_cv_header_db2" = yes ; then
7854         
7855         ol_cv_header_db=$ac_cv_header_db_185_h
7856 else
7857         ol_cv_header_db=$ac_cv_header_db_h
7858 fi
7859
7860
7861  
7862  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
7863 echo "configure:7864: checking for Berkeley DB" >&5
7864 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
7865   echo $ac_n "(cached) $ac_c" 1>&6
7866 else
7867   
7868         if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then
7869                 ol_cv_berkeley_db=no
7870         else
7871                 ol_cv_berkeley_db=yes
7872         fi
7873
7874 fi
7875
7876 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
7877  if test $ol_cv_berkeley_db = yes ; then
7878         cat >> confdefs.h <<\EOF
7879 #define HAVE_BERKELEY_DB 1
7880 EOF
7881
7882  fi
7883
7884
7885         if test $ol_cv_berkeley_db = yes ; then
7886                 ol_link_ldbm=db
7887                 ol_with_ldbm_api=db
7888
7889                 if test $ol_with_ldbm_type = hash ; then
7890                         cat >> confdefs.h <<\EOF
7891 #define LDBM_USE_DBHASH 1
7892 EOF
7893
7894                 else
7895                         cat >> confdefs.h <<\EOF
7896 #define LDBM_USE_DBBTREE 1
7897 EOF
7898
7899                 fi
7900
7901                                                 if test $ol_cv_lib_db != yes ; then
7902                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
7903                 fi
7904         fi
7905 fi
7906
7907 if test $ol_with_ldbm_api = manual ; then
7908                 ol_link_ldbm=yes
7909
7910         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
7911
7912         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
7913 do
7914 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7915 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7916 echo "configure:7917: checking for $ac_hdr" >&5
7917 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7918   echo $ac_n "(cached) $ac_c" 1>&6
7919 else
7920   cat > conftest.$ac_ext <<EOF
7921 #line 7922 "configure"
7922 #include "confdefs.h"
7923 #include <$ac_hdr>
7924 EOF
7925 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7926 { (eval echo configure:7927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7927 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7928 if test -z "$ac_err"; then
7929   rm -rf conftest*
7930   eval "ac_cv_header_$ac_safe=yes"
7931 else
7932   echo "$ac_err" >&5
7933   echo "configure: failed program was:" >&5
7934   cat conftest.$ac_ext >&5
7935   rm -rf conftest*
7936   eval "ac_cv_header_$ac_safe=no"
7937 fi
7938 rm -f conftest*
7939 fi
7940 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7941   echo "$ac_t""yes" 1>&6
7942     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7943   cat >> confdefs.h <<EOF
7944 #define $ac_tr_hdr 1
7945 EOF
7946  
7947 else
7948   echo "$ac_t""no" 1>&6
7949 fi
7950 done
7951
7952 fi
7953
7954 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
7955         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
7956         ol_with_ldbm_api=none
7957 fi
7958
7959 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
7960         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
7961 echo "configure:7962: checking for MDBM library" >&5
7962 if eval "test \"`echo '$''{'ol_cv_lib_mdbm'+set}'`\" = set"; then
7963   echo $ac_n "(cached) $ac_c" 1>&6
7964 else
7965         ol_LIBS="$LIBS"
7966         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
7967 echo "configure:7968: checking for mdbm_set_chain" >&5
7968 if eval "test \"`echo '$''{'ac_cv_func_mdbm_set_chain'+set}'`\" = set"; then
7969   echo $ac_n "(cached) $ac_c" 1>&6
7970 else
7971   cat > conftest.$ac_ext <<EOF
7972 #line 7973 "configure"
7973 #include "confdefs.h"
7974 /* System header to define __stub macros and hopefully few prototypes,
7975     which can conflict with char mdbm_set_chain(); below.  */
7976 #include <assert.h>
7977 /* Override any gcc2 internal prototype to avoid an error.  */
7978 /* We use char because int might match the return type of a gcc2
7979     builtin and then its argument prototype would still apply.  */
7980 char mdbm_set_chain();
7981
7982 int main() {
7983
7984 /* The GNU C library defines this for functions which it implements
7985     to always fail with ENOSYS.  Some functions are actually named
7986     something starting with __ and the normal name is an alias.  */
7987 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
7988 choke me
7989 #else
7990 mdbm_set_chain();
7991 #endif
7992
7993 ; return 0; }
7994 EOF
7995 if { (eval echo configure:7996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7996   rm -rf conftest*
7997   eval "ac_cv_func_mdbm_set_chain=yes"
7998 else
7999   echo "configure: failed program was:" >&5
8000   cat conftest.$ac_ext >&5
8001   rm -rf conftest*
8002   eval "ac_cv_func_mdbm_set_chain=no"
8003 fi
8004 rm -f conftest*
8005 fi
8006
8007 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
8008   echo "$ac_t""yes" 1>&6
8009   ol_cv_lib_mdbm=yes
8010 else
8011   echo "$ac_t""no" 1>&6
8012
8013                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
8014 echo "configure:8015: checking for mdbm_set_chain in -lmdbm" >&5
8015 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-%__p_%'`
8016 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8017   echo $ac_n "(cached) $ac_c" 1>&6
8018 else
8019   ac_save_LIBS="$LIBS"
8020 LIBS="-lmdbm  $LIBS"
8021 cat > conftest.$ac_ext <<EOF
8022 #line 8023 "configure"
8023 #include "confdefs.h"
8024 /* Override any gcc2 internal prototype to avoid an error.  */
8025 /* We use char because int might match the return type of a gcc2
8026     builtin and then its argument prototype would still apply.  */
8027 char mdbm_set_chain();
8028
8029 int main() {
8030 mdbm_set_chain()
8031 ; return 0; }
8032 EOF
8033 if { (eval echo configure:8034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8034   rm -rf conftest*
8035   eval "ac_cv_lib_$ac_lib_var=yes"
8036 else
8037   echo "configure: failed program was:" >&5
8038   cat conftest.$ac_ext >&5
8039   rm -rf conftest*
8040   eval "ac_cv_lib_$ac_lib_var=no"
8041 fi
8042 rm -f conftest*
8043 LIBS="$ac_save_LIBS"
8044
8045 fi
8046 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8047   echo "$ac_t""yes" 1>&6
8048   ol_cv_lib_mdbm=-lmdbm
8049 else
8050   echo "$ac_t""no" 1>&6
8051 ol_cv_lib_mdbm=no
8052 fi
8053
8054         
8055 fi
8056
8057         LIBS="$ol_LIBS"
8058
8059 fi
8060
8061 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
8062
8063
8064  for ac_hdr in mdbm.h
8065 do
8066 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8067 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8068 echo "configure:8069: checking for $ac_hdr" >&5
8069 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8070   echo $ac_n "(cached) $ac_c" 1>&6
8071 else
8072   cat > conftest.$ac_ext <<EOF
8073 #line 8074 "configure"
8074 #include "confdefs.h"
8075 #include <$ac_hdr>
8076 EOF
8077 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8078 { (eval echo configure:8079: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8079 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8080 if test -z "$ac_err"; then
8081   rm -rf conftest*
8082   eval "ac_cv_header_$ac_safe=yes"
8083 else
8084   echo "$ac_err" >&5
8085   echo "configure: failed program was:" >&5
8086   cat conftest.$ac_ext >&5
8087   rm -rf conftest*
8088   eval "ac_cv_header_$ac_safe=no"
8089 fi
8090 rm -f conftest*
8091 fi
8092 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8093   echo "$ac_t""yes" 1>&6
8094     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8095   cat >> confdefs.h <<EOF
8096 #define $ac_tr_hdr 1
8097 EOF
8098  
8099 else
8100   echo "$ac_t""no" 1>&6
8101 fi
8102 done
8103
8104  echo $ac_n "checking for db""... $ac_c" 1>&6
8105 echo "configure:8106: checking for db" >&5
8106 if eval "test \"`echo '$''{'ol_cv_mdbm'+set}'`\" = set"; then
8107   echo $ac_n "(cached) $ac_c" 1>&6
8108 else
8109   
8110         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
8111                 ol_cv_mdbm=no
8112         else
8113                 ol_cv_mdbm=yes
8114         fi
8115
8116 fi
8117
8118 echo "$ac_t""$ol_cv_mdbm" 1>&6
8119  if test $ol_cv_mdbm = yes ; then
8120         cat >> confdefs.h <<\EOF
8121 #define HAVE_MDBM 1
8122 EOF
8123
8124  fi
8125
8126
8127         if test $ol_cv_mdbm = yes ; then
8128                 ol_link_ldbm=mdbm
8129                 ol_with_ldbm_api=mdbm
8130                 if test $ol_cv_lib_mdbm != yes ; then
8131                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
8132                 fi
8133         fi
8134 fi
8135
8136 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
8137         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
8138 echo "configure:8139: checking for GDBM library" >&5
8139 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
8140   echo $ac_n "(cached) $ac_c" 1>&6
8141 else
8142         ol_LIBS="$LIBS"
8143         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
8144 echo "configure:8145: checking for gdbm_open" >&5
8145 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
8146   echo $ac_n "(cached) $ac_c" 1>&6
8147 else
8148   cat > conftest.$ac_ext <<EOF
8149 #line 8150 "configure"
8150 #include "confdefs.h"
8151 /* System header to define __stub macros and hopefully few prototypes,
8152     which can conflict with char gdbm_open(); below.  */
8153 #include <assert.h>
8154 /* Override any gcc2 internal prototype to avoid an error.  */
8155 /* We use char because int might match the return type of a gcc2
8156     builtin and then its argument prototype would still apply.  */
8157 char gdbm_open();
8158
8159 int main() {
8160
8161 /* The GNU C library defines this for functions which it implements
8162     to always fail with ENOSYS.  Some functions are actually named
8163     something starting with __ and the normal name is an alias.  */
8164 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
8165 choke me
8166 #else
8167 gdbm_open();
8168 #endif
8169
8170 ; return 0; }
8171 EOF
8172 if { (eval echo configure:8173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8173   rm -rf conftest*
8174   eval "ac_cv_func_gdbm_open=yes"
8175 else
8176   echo "configure: failed program was:" >&5
8177   cat conftest.$ac_ext >&5
8178   rm -rf conftest*
8179   eval "ac_cv_func_gdbm_open=no"
8180 fi
8181 rm -f conftest*
8182 fi
8183
8184 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
8185   echo "$ac_t""yes" 1>&6
8186   ol_cv_lib_gdbm=yes
8187 else
8188   echo "$ac_t""no" 1>&6
8189
8190                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
8191 echo "configure:8192: checking for gdbm_open in -lgdbm" >&5
8192 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
8193 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8194   echo $ac_n "(cached) $ac_c" 1>&6
8195 else
8196   ac_save_LIBS="$LIBS"
8197 LIBS="-lgdbm  $LIBS"
8198 cat > conftest.$ac_ext <<EOF
8199 #line 8200 "configure"
8200 #include "confdefs.h"
8201 /* Override any gcc2 internal prototype to avoid an error.  */
8202 /* We use char because int might match the return type of a gcc2
8203     builtin and then its argument prototype would still apply.  */
8204 char gdbm_open();
8205
8206 int main() {
8207 gdbm_open()
8208 ; return 0; }
8209 EOF
8210 if { (eval echo configure:8211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8211   rm -rf conftest*
8212   eval "ac_cv_lib_$ac_lib_var=yes"
8213 else
8214   echo "configure: failed program was:" >&5
8215   cat conftest.$ac_ext >&5
8216   rm -rf conftest*
8217   eval "ac_cv_lib_$ac_lib_var=no"
8218 fi
8219 rm -f conftest*
8220 LIBS="$ac_save_LIBS"
8221
8222 fi
8223 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8224   echo "$ac_t""yes" 1>&6
8225   ol_cv_lib_gdbm=-lgdbm
8226 else
8227   echo "$ac_t""no" 1>&6
8228 ol_cv_lib_gdbm=no
8229 fi
8230
8231         
8232 fi
8233
8234         LIBS="$ol_LIBS"
8235
8236 fi
8237
8238 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
8239
8240
8241  for ac_hdr in gdbm.h
8242 do
8243 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8244 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8245 echo "configure:8246: checking for $ac_hdr" >&5
8246 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8247   echo $ac_n "(cached) $ac_c" 1>&6
8248 else
8249   cat > conftest.$ac_ext <<EOF
8250 #line 8251 "configure"
8251 #include "confdefs.h"
8252 #include <$ac_hdr>
8253 EOF
8254 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8255 { (eval echo configure:8256: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8256 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8257 if test -z "$ac_err"; then
8258   rm -rf conftest*
8259   eval "ac_cv_header_$ac_safe=yes"
8260 else
8261   echo "$ac_err" >&5
8262   echo "configure: failed program was:" >&5
8263   cat conftest.$ac_ext >&5
8264   rm -rf conftest*
8265   eval "ac_cv_header_$ac_safe=no"
8266 fi
8267 rm -f conftest*
8268 fi
8269 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8270   echo "$ac_t""yes" 1>&6
8271     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8272   cat >> confdefs.h <<EOF
8273 #define $ac_tr_hdr 1
8274 EOF
8275  
8276 else
8277   echo "$ac_t""no" 1>&6
8278 fi
8279 done
8280
8281  echo $ac_n "checking for db""... $ac_c" 1>&6
8282 echo "configure:8283: checking for db" >&5
8283 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
8284   echo $ac_n "(cached) $ac_c" 1>&6
8285 else
8286   
8287         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
8288                 ol_cv_gdbm=no
8289         else
8290                 ol_cv_gdbm=yes
8291         fi
8292
8293 fi
8294
8295 echo "$ac_t""$ol_cv_gdbm" 1>&6
8296  if test $ol_cv_gdbm = yes ; then
8297         cat >> confdefs.h <<\EOF
8298 #define HAVE_GDBM 1
8299 EOF
8300
8301  fi
8302
8303
8304         if test $ol_cv_gdbm = yes ; then
8305                 ol_link_ldbm=gdbm
8306                 ol_with_ldbm_api=gdbm
8307
8308                 if test $ol_cv_lib_gdbm != yes ; then
8309                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
8310                 fi
8311         fi
8312 fi
8313
8314 if test $ol_with_ldbm_api = auto ; then
8315         echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
8316 elif test $ol_with_ldbm_api = ndbm ; then
8317         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
8318 echo "configure:8319: checking for NDBM library" >&5
8319 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
8320   echo $ac_n "(cached) $ac_c" 1>&6
8321 else
8322         ol_LIBS="$LIBS"
8323         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
8324 echo "configure:8325: checking for dbm_open" >&5
8325 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
8326   echo $ac_n "(cached) $ac_c" 1>&6
8327 else
8328   cat > conftest.$ac_ext <<EOF
8329 #line 8330 "configure"
8330 #include "confdefs.h"
8331 /* System header to define __stub macros and hopefully few prototypes,
8332     which can conflict with char dbm_open(); below.  */
8333 #include <assert.h>
8334 /* Override any gcc2 internal prototype to avoid an error.  */
8335 /* We use char because int might match the return type of a gcc2
8336     builtin and then its argument prototype would still apply.  */
8337 char dbm_open();
8338
8339 int main() {
8340
8341 /* The GNU C library defines this for functions which it implements
8342     to always fail with ENOSYS.  Some functions are actually named
8343     something starting with __ and the normal name is an alias.  */
8344 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
8345 choke me
8346 #else
8347 dbm_open();
8348 #endif
8349
8350 ; return 0; }
8351 EOF
8352 if { (eval echo configure:8353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8353   rm -rf conftest*
8354   eval "ac_cv_func_dbm_open=yes"
8355 else
8356   echo "configure: failed program was:" >&5
8357   cat conftest.$ac_ext >&5
8358   rm -rf conftest*
8359   eval "ac_cv_func_dbm_open=no"
8360 fi
8361 rm -f conftest*
8362 fi
8363
8364 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
8365   echo "$ac_t""yes" 1>&6
8366   ol_cv_lib_ndbm=yes
8367 else
8368   echo "$ac_t""no" 1>&6
8369
8370                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
8371 echo "configure:8372: checking for dbm_open in -lndbm" >&5
8372 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
8373 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8374   echo $ac_n "(cached) $ac_c" 1>&6
8375 else
8376   ac_save_LIBS="$LIBS"
8377 LIBS="-lndbm  $LIBS"
8378 cat > conftest.$ac_ext <<EOF
8379 #line 8380 "configure"
8380 #include "confdefs.h"
8381 /* Override any gcc2 internal prototype to avoid an error.  */
8382 /* We use char because int might match the return type of a gcc2
8383     builtin and then its argument prototype would still apply.  */
8384 char dbm_open();
8385
8386 int main() {
8387 dbm_open()
8388 ; return 0; }
8389 EOF
8390 if { (eval echo configure:8391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8391   rm -rf conftest*
8392   eval "ac_cv_lib_$ac_lib_var=yes"
8393 else
8394   echo "configure: failed program was:" >&5
8395   cat conftest.$ac_ext >&5
8396   rm -rf conftest*
8397   eval "ac_cv_lib_$ac_lib_var=no"
8398 fi
8399 rm -f conftest*
8400 LIBS="$ac_save_LIBS"
8401
8402 fi
8403 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8404   echo "$ac_t""yes" 1>&6
8405   ol_cv_lib_ndbm=-lndbm
8406 else
8407   echo "$ac_t""no" 1>&6
8408
8409                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
8410 echo "configure:8411: checking for dbm_open in -ldbm" >&5
8411 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
8412 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8413   echo $ac_n "(cached) $ac_c" 1>&6
8414 else
8415   ac_save_LIBS="$LIBS"
8416 LIBS="-ldbm  $LIBS"
8417 cat > conftest.$ac_ext <<EOF
8418 #line 8419 "configure"
8419 #include "confdefs.h"
8420 /* Override any gcc2 internal prototype to avoid an error.  */
8421 /* We use char because int might match the return type of a gcc2
8422     builtin and then its argument prototype would still apply.  */
8423 char dbm_open();
8424
8425 int main() {
8426 dbm_open()
8427 ; return 0; }
8428 EOF
8429 if { (eval echo configure:8430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8430   rm -rf conftest*
8431   eval "ac_cv_lib_$ac_lib_var=yes"
8432 else
8433   echo "configure: failed program was:" >&5
8434   cat conftest.$ac_ext >&5
8435   rm -rf conftest*
8436   eval "ac_cv_lib_$ac_lib_var=no"
8437 fi
8438 rm -f conftest*
8439 LIBS="$ac_save_LIBS"
8440
8441 fi
8442 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8443   echo "$ac_t""yes" 1>&6
8444   ol_cv_lib_ndbm=-ldbm
8445 else
8446   echo "$ac_t""no" 1>&6
8447 ol_cv_lib_ndbm=no
8448 fi
8449                 
8450 fi
8451
8452         
8453 fi
8454
8455         LIBS="$ol_LIBS"
8456
8457 fi
8458
8459 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
8460
8461
8462  for ac_hdr in ndbm.h
8463 do
8464 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8465 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8466 echo "configure:8467: checking for $ac_hdr" >&5
8467 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8468   echo $ac_n "(cached) $ac_c" 1>&6
8469 else
8470   cat > conftest.$ac_ext <<EOF
8471 #line 8472 "configure"
8472 #include "confdefs.h"
8473 #include <$ac_hdr>
8474 EOF
8475 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8476 { (eval echo configure:8477: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8477 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8478 if test -z "$ac_err"; then
8479   rm -rf conftest*
8480   eval "ac_cv_header_$ac_safe=yes"
8481 else
8482   echo "$ac_err" >&5
8483   echo "configure: failed program was:" >&5
8484   cat conftest.$ac_ext >&5
8485   rm -rf conftest*
8486   eval "ac_cv_header_$ac_safe=no"
8487 fi
8488 rm -f conftest*
8489 fi
8490 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8491   echo "$ac_t""yes" 1>&6
8492     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8493   cat >> confdefs.h <<EOF
8494 #define $ac_tr_hdr 1
8495 EOF
8496  
8497 else
8498   echo "$ac_t""no" 1>&6
8499 fi
8500 done
8501
8502  echo $ac_n "checking for db""... $ac_c" 1>&6
8503 echo "configure:8504: checking for db" >&5
8504 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
8505   echo $ac_n "(cached) $ac_c" 1>&6
8506 else
8507   
8508         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
8509                 ol_cv_ndbm=no
8510         else
8511                 ol_cv_ndbm=yes
8512         fi
8513
8514 fi
8515
8516 echo "$ac_t""$ol_cv_ndbm" 1>&6
8517  if test $ol_cv_ndbm = yes ; then
8518         cat >> confdefs.h <<\EOF
8519 #define HAVE_NDBM 1
8520 EOF
8521
8522  fi
8523
8524
8525         if test $ol_cv_ndbm = yes ; then
8526                 ol_link_ldbm=ndbm
8527                 ol_with_ldbm_api=ndbm
8528
8529                 if test $ol_cv_lib_ndbm != yes ; then
8530                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
8531                 fi
8532         fi
8533 fi
8534
8535 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
8536         echo "configure: warning: could not find suitable LDBM backend" 1>&2
8537         if test $ol_enable_ldbm = yes ; then
8538                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
8539         fi
8540
8541         echo "configure: warning: disabling LDBM" 1>&2
8542         ol_enable_ldbm=no
8543 fi
8544
8545 if test $ol_enable_wrappers != no ; then
8546         for ac_hdr in tcpd.h
8547 do
8548 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8549 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8550 echo "configure:8551: checking for $ac_hdr" >&5
8551 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8552   echo $ac_n "(cached) $ac_c" 1>&6
8553 else
8554   cat > conftest.$ac_ext <<EOF
8555 #line 8556 "configure"
8556 #include "confdefs.h"
8557 #include <$ac_hdr>
8558 EOF
8559 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8560 { (eval echo configure:8561: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8561 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8562 if test -z "$ac_err"; then
8563   rm -rf conftest*
8564   eval "ac_cv_header_$ac_safe=yes"
8565 else
8566   echo "$ac_err" >&5
8567   echo "configure: failed program was:" >&5
8568   cat conftest.$ac_ext >&5
8569   rm -rf conftest*
8570   eval "ac_cv_header_$ac_safe=no"
8571 fi
8572 rm -f conftest*
8573 fi
8574 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8575   echo "$ac_t""yes" 1>&6
8576     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8577   cat >> confdefs.h <<EOF
8578 #define $ac_tr_hdr 1
8579 EOF
8580  
8581 else
8582   echo "$ac_t""no" 1>&6
8583 fi
8584 done
8585
8586
8587         if test $ac_cv_header_tcpd_h != yes ; then
8588                 have_wrappers=no
8589         else
8590                 echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
8591 echo "configure:8592: checking for main in -lwrap" >&5
8592 ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'`
8593 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8594   echo $ac_n "(cached) $ac_c" 1>&6
8595 else
8596   ac_save_LIBS="$LIBS"
8597 LIBS="-lwrap  $LIBS"
8598 cat > conftest.$ac_ext <<EOF
8599 #line 8600 "configure"
8600 #include "confdefs.h"
8601
8602 int main() {
8603 main()
8604 ; return 0; }
8605 EOF
8606 if { (eval echo configure:8607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8607   rm -rf conftest*
8608   eval "ac_cv_lib_$ac_lib_var=yes"
8609 else
8610   echo "configure: failed program was:" >&5
8611   cat conftest.$ac_ext >&5
8612   rm -rf conftest*
8613   eval "ac_cv_lib_$ac_lib_var=no"
8614 fi
8615 rm -f conftest*
8616 LIBS="$ac_save_LIBS"
8617
8618 fi
8619 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8620   echo "$ac_t""yes" 1>&6
8621   have_wrappers=yes
8622 else
8623   echo "$ac_t""no" 1>&6
8624 have_wrappers=no
8625 fi
8626
8627         fi
8628
8629         if test $have_wrappers = yes ; then
8630                 cat >> confdefs.h <<\EOF
8631 #define HAVE_TCPD 1
8632 EOF
8633
8634                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
8635
8636                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
8637 echo "configure:8638: checking for main in -lnsl" >&5
8638 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
8639 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8640   echo $ac_n "(cached) $ac_c" 1>&6
8641 else
8642   ac_save_LIBS="$LIBS"
8643 LIBS="-lnsl  $LIBS"
8644 cat > conftest.$ac_ext <<EOF
8645 #line 8646 "configure"
8646 #include "confdefs.h"
8647
8648 int main() {
8649 main()
8650 ; return 0; }
8651 EOF
8652 if { (eval echo configure:8653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8653   rm -rf conftest*
8654   eval "ac_cv_lib_$ac_lib_var=yes"
8655 else
8656   echo "configure: failed program was:" >&5
8657   cat conftest.$ac_ext >&5
8658   rm -rf conftest*
8659   eval "ac_cv_lib_$ac_lib_var=no"
8660 fi
8661 rm -f conftest*
8662 LIBS="$ac_save_LIBS"
8663
8664 fi
8665 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8666   echo "$ac_t""yes" 1>&6
8667     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8668     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8669   cat >> confdefs.h <<EOF
8670 #define $ac_tr_lib 1
8671 EOF
8672
8673   LIBS="-lnsl $LIBS"
8674
8675 else
8676   echo "$ac_t""no" 1>&6
8677 fi
8678
8679         else
8680                 echo "configure: warning: could not find -lwrap" 1>&2
8681                 if test $ol_enable_wrappers = yes ; then
8682                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
8683                 fi
8684
8685                 echo "configure: warning: disabling wrappers support" 1>&2
8686                 ol_enable_wrappers=no
8687         fi
8688 fi
8689
8690 if test $ol_enable_syslog != no ; then
8691         echo $ac_n "checking for openlog""... $ac_c" 1>&6
8692 echo "configure:8693: checking for openlog" >&5
8693 if eval "test \"`echo '$''{'ac_cv_func_openlog'+set}'`\" = set"; then
8694   echo $ac_n "(cached) $ac_c" 1>&6
8695 else
8696   cat > conftest.$ac_ext <<EOF
8697 #line 8698 "configure"
8698 #include "confdefs.h"
8699 /* System header to define __stub macros and hopefully few prototypes,
8700     which can conflict with char openlog(); below.  */
8701 #include <assert.h>
8702 /* Override any gcc2 internal prototype to avoid an error.  */
8703 /* We use char because int might match the return type of a gcc2
8704     builtin and then its argument prototype would still apply.  */
8705 char openlog();
8706
8707 int main() {
8708
8709 /* The GNU C library defines this for functions which it implements
8710     to always fail with ENOSYS.  Some functions are actually named
8711     something starting with __ and the normal name is an alias.  */
8712 #if defined (__stub_openlog) || defined (__stub___openlog)
8713 choke me
8714 #else
8715 openlog();
8716 #endif
8717
8718 ; return 0; }
8719 EOF
8720 if { (eval echo configure:8721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8721   rm -rf conftest*
8722   eval "ac_cv_func_openlog=yes"
8723 else
8724   echo "configure: failed program was:" >&5
8725   cat conftest.$ac_ext >&5
8726   rm -rf conftest*
8727   eval "ac_cv_func_openlog=no"
8728 fi
8729 rm -f conftest*
8730 fi
8731
8732 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
8733   echo "$ac_t""yes" 1>&6
8734   :
8735 else
8736   echo "$ac_t""no" 1>&6
8737 fi
8738
8739         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
8740                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
8741         fi
8742         ol_enable_syslog=$ac_cv_func_openlog
8743 fi
8744
8745 if test $ol_enable_dmalloc != no ; then
8746         for ac_hdr in dmalloc.h
8747 do
8748 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8749 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8750 echo "configure:8751: checking for $ac_hdr" >&5
8751 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8752   echo $ac_n "(cached) $ac_c" 1>&6
8753 else
8754   cat > conftest.$ac_ext <<EOF
8755 #line 8756 "configure"
8756 #include "confdefs.h"
8757 #include <$ac_hdr>
8758 EOF
8759 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8760 { (eval echo configure:8761: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8761 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8762 if test -z "$ac_err"; then
8763   rm -rf conftest*
8764   eval "ac_cv_header_$ac_safe=yes"
8765 else
8766   echo "$ac_err" >&5
8767   echo "configure: failed program was:" >&5
8768   cat conftest.$ac_ext >&5
8769   rm -rf conftest*
8770   eval "ac_cv_header_$ac_safe=no"
8771 fi
8772 rm -f conftest*
8773 fi
8774 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8775   echo "$ac_t""yes" 1>&6
8776     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8777   cat >> confdefs.h <<EOF
8778 #define $ac_tr_hdr 1
8779 EOF
8780  
8781 else
8782   echo "$ac_t""no" 1>&6
8783 fi
8784 done
8785
8786         echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
8787 echo "configure:8788: checking for dmalloc_shutdown in -ldmalloc" >&5
8788 ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-%__p_%'`
8789 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8790   echo $ac_n "(cached) $ac_c" 1>&6
8791 else
8792   ac_save_LIBS="$LIBS"
8793 LIBS="-ldmalloc  $LIBS"
8794 cat > conftest.$ac_ext <<EOF
8795 #line 8796 "configure"
8796 #include "confdefs.h"
8797 /* Override any gcc2 internal prototype to avoid an error.  */
8798 /* We use char because int might match the return type of a gcc2
8799     builtin and then its argument prototype would still apply.  */
8800 char dmalloc_shutdown();
8801
8802 int main() {
8803 dmalloc_shutdown()
8804 ; return 0; }
8805 EOF
8806 if { (eval echo configure:8807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8807   rm -rf conftest*
8808   eval "ac_cv_lib_$ac_lib_var=yes"
8809 else
8810   echo "configure: failed program was:" >&5
8811   cat conftest.$ac_ext >&5
8812   rm -rf conftest*
8813   eval "ac_cv_lib_$ac_lib_var=no"
8814 fi
8815 rm -f conftest*
8816 LIBS="$ac_save_LIBS"
8817
8818 fi
8819 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8820   echo "$ac_t""yes" 1>&6
8821     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8822     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8823   cat >> confdefs.h <<EOF
8824 #define $ac_tr_lib 1
8825 EOF
8826
8827   LIBS="-ldmalloc $LIBS"
8828
8829 else
8830   echo "$ac_t""no" 1>&6
8831 fi
8832
8833 fi
8834
8835 if test $ol_enable_tcl != no ; then
8836         for ac_hdr in tcl.h
8837 do
8838 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8839 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8840 echo "configure:8841: checking for $ac_hdr" >&5
8841 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8842   echo $ac_n "(cached) $ac_c" 1>&6
8843 else
8844   cat > conftest.$ac_ext <<EOF
8845 #line 8846 "configure"
8846 #include "confdefs.h"
8847 #include <$ac_hdr>
8848 EOF
8849 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8850 { (eval echo configure:8851: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8851 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8852 if test -z "$ac_err"; then
8853   rm -rf conftest*
8854   eval "ac_cv_header_$ac_safe=yes"
8855 else
8856   echo "$ac_err" >&5
8857   echo "configure: failed program was:" >&5
8858   cat conftest.$ac_ext >&5
8859   rm -rf conftest*
8860   eval "ac_cv_header_$ac_safe=no"
8861 fi
8862 rm -f conftest*
8863 fi
8864 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8865   echo "$ac_t""yes" 1>&6
8866     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8867   cat >> confdefs.h <<EOF
8868 #define $ac_tr_hdr 1
8869 EOF
8870  
8871 else
8872   echo "$ac_t""no" 1>&6
8873 fi
8874 done
8875
8876
8877         if test $ac_cv_header_tcl_h != yes ; then
8878                 have_tcl=no
8879         else
8880                 echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6
8881 echo "configure:8882: checking for main in -ltcl" >&5
8882 ac_lib_var=`echo tcl'_'main | sed 'y%./+-%__p_%'`
8883 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8884   echo $ac_n "(cached) $ac_c" 1>&6
8885 else
8886   ac_save_LIBS="$LIBS"
8887 LIBS="-ltcl  $LIBS"
8888 cat > conftest.$ac_ext <<EOF
8889 #line 8890 "configure"
8890 #include "confdefs.h"
8891
8892 int main() {
8893 main()
8894 ; return 0; }
8895 EOF
8896 if { (eval echo configure:8897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8897   rm -rf conftest*
8898   eval "ac_cv_lib_$ac_lib_var=yes"
8899 else
8900   echo "configure: failed program was:" >&5
8901   cat conftest.$ac_ext >&5
8902   rm -rf conftest*
8903   eval "ac_cv_lib_$ac_lib_var=no"
8904 fi
8905 rm -f conftest*
8906 LIBS="$ac_save_LIBS"
8907
8908 fi
8909 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8910   echo "$ac_t""yes" 1>&6
8911   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"
8912 else
8913   echo "$ac_t""no" 1>&6
8914 have_tcl=no
8915 fi
8916
8917
8918                 if test $have_tcl != yes; then
8919                         echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6
8920 echo "configure:8921: checking for main in -ltcl7.6" >&5
8921 ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-%__p_%'`
8922 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8923   echo $ac_n "(cached) $ac_c" 1>&6
8924 else
8925   ac_save_LIBS="$LIBS"
8926 LIBS="-ltcl7.6  $LIBS"
8927 cat > conftest.$ac_ext <<EOF
8928 #line 8929 "configure"
8929 #include "confdefs.h"
8930
8931 int main() {
8932 main()
8933 ; return 0; }
8934 EOF
8935 if { (eval echo configure:8936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8936   rm -rf conftest*
8937   eval "ac_cv_lib_$ac_lib_var=yes"
8938 else
8939   echo "configure: failed program was:" >&5
8940   cat conftest.$ac_ext >&5
8941   rm -rf conftest*
8942   eval "ac_cv_lib_$ac_lib_var=no"
8943 fi
8944 rm -f conftest*
8945 LIBS="$ac_save_LIBS"
8946
8947 fi
8948 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8949   echo "$ac_t""yes" 1>&6
8950   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"
8951 else
8952   echo "$ac_t""no" 1>&6
8953 have_tcl=no
8954 fi
8955
8956                 fi
8957
8958                 if test $have_tcl != yes; then
8959                         echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6
8960 echo "configure:8961: checking for main in -ltcl8.0" >&5
8961 ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-%__p_%'`
8962 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8963   echo $ac_n "(cached) $ac_c" 1>&6
8964 else
8965   ac_save_LIBS="$LIBS"
8966 LIBS="-ltcl8.0  $LIBS"
8967 cat > conftest.$ac_ext <<EOF
8968 #line 8969 "configure"
8969 #include "confdefs.h"
8970
8971 int main() {
8972 main()
8973 ; return 0; }
8974 EOF
8975 if { (eval echo configure:8976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8976   rm -rf conftest*
8977   eval "ac_cv_lib_$ac_lib_var=yes"
8978 else
8979   echo "configure: failed program was:" >&5
8980   cat conftest.$ac_ext >&5
8981   rm -rf conftest*
8982   eval "ac_cv_lib_$ac_lib_var=no"
8983 fi
8984 rm -f conftest*
8985 LIBS="$ac_save_LIBS"
8986
8987 fi
8988 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8989   echo "$ac_t""yes" 1>&6
8990   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"
8991 else
8992   echo "$ac_t""no" 1>&6
8993 have_tcl=no
8994 fi
8995
8996                 fi
8997         fi
8998
8999         if test $have_tcl != yes ; then
9000                 echo "configure: warning: could not find -ltcl" 1>&2
9001                 if test $ol_enable_tcl = yes ; then
9002                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
9003                 fi
9004
9005                 ol_enable_tcl=no
9006         fi
9007 fi
9008
9009 # ud needs termcap (should insert check here)
9010 ol_link_termcap=no
9011 for ac_hdr in termcap.h ncurses.h
9012 do
9013 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9014 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9015 echo "configure:9016: checking for $ac_hdr" >&5
9016 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9017   echo $ac_n "(cached) $ac_c" 1>&6
9018 else
9019   cat > conftest.$ac_ext <<EOF
9020 #line 9021 "configure"
9021 #include "confdefs.h"
9022 #include <$ac_hdr>
9023 EOF
9024 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9025 { (eval echo configure:9026: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9026 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9027 if test -z "$ac_err"; then
9028   rm -rf conftest*
9029   eval "ac_cv_header_$ac_safe=yes"
9030 else
9031   echo "$ac_err" >&5
9032   echo "configure: failed program was:" >&5
9033   cat conftest.$ac_ext >&5
9034   rm -rf conftest*
9035   eval "ac_cv_header_$ac_safe=no"
9036 fi
9037 rm -f conftest*
9038 fi
9039 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9040   echo "$ac_t""yes" 1>&6
9041     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9042   cat >> confdefs.h <<EOF
9043 #define $ac_tr_hdr 1
9044 EOF
9045  
9046 else
9047   echo "$ac_t""no" 1>&6
9048 fi
9049 done
9050
9051
9052 if test $ol_link_termcap = no ; then
9053         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
9054 echo "configure:9055: checking for tputs in -ltermcap" >&5
9055 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
9056 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9057   echo $ac_n "(cached) $ac_c" 1>&6
9058 else
9059   ac_save_LIBS="$LIBS"
9060 LIBS="-ltermcap  $LIBS"
9061 cat > conftest.$ac_ext <<EOF
9062 #line 9063 "configure"
9063 #include "confdefs.h"
9064 /* Override any gcc2 internal prototype to avoid an error.  */
9065 /* We use char because int might match the return type of a gcc2
9066     builtin and then its argument prototype would still apply.  */
9067 char tputs();
9068
9069 int main() {
9070 tputs()
9071 ; return 0; }
9072 EOF
9073 if { (eval echo configure:9074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9074   rm -rf conftest*
9075   eval "ac_cv_lib_$ac_lib_var=yes"
9076 else
9077   echo "configure: failed program was:" >&5
9078   cat conftest.$ac_ext >&5
9079   rm -rf conftest*
9080   eval "ac_cv_lib_$ac_lib_var=no"
9081 fi
9082 rm -f conftest*
9083 LIBS="$ac_save_LIBS"
9084
9085 fi
9086 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9087   echo "$ac_t""yes" 1>&6
9088   have_termcap=yes
9089 else
9090   echo "$ac_t""no" 1>&6
9091 have_termcap=no
9092 fi
9093
9094         if test $have_termcap = yes ; then
9095                 cat >> confdefs.h <<\EOF
9096 #define HAVE_TERMCAP 1
9097 EOF
9098
9099                 ol_link_termcap=yes
9100                 TERMCAP_LIBS=-ltermcap
9101         fi
9102 fi
9103
9104 if test $ol_link_termcap = no ; then
9105         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
9106 echo "configure:9107: checking for initscr in -lncurses" >&5
9107 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
9108 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9109   echo $ac_n "(cached) $ac_c" 1>&6
9110 else
9111   ac_save_LIBS="$LIBS"
9112 LIBS="-lncurses  $LIBS"
9113 cat > conftest.$ac_ext <<EOF
9114 #line 9115 "configure"
9115 #include "confdefs.h"
9116 /* Override any gcc2 internal prototype to avoid an error.  */
9117 /* We use char because int might match the return type of a gcc2
9118     builtin and then its argument prototype would still apply.  */
9119 char initscr();
9120
9121 int main() {
9122 initscr()
9123 ; return 0; }
9124 EOF
9125 if { (eval echo configure:9126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9126   rm -rf conftest*
9127   eval "ac_cv_lib_$ac_lib_var=yes"
9128 else
9129   echo "configure: failed program was:" >&5
9130   cat conftest.$ac_ext >&5
9131   rm -rf conftest*
9132   eval "ac_cv_lib_$ac_lib_var=no"
9133 fi
9134 rm -f conftest*
9135 LIBS="$ac_save_LIBS"
9136
9137 fi
9138 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9139   echo "$ac_t""yes" 1>&6
9140   have_ncurses=yes
9141 else
9142   echo "$ac_t""no" 1>&6
9143 have_ncurses=no
9144 fi
9145
9146         if test $have_ncurses = yes ; then
9147                 cat >> confdefs.h <<\EOF
9148 #define HAVE_NCURSES 1
9149 EOF
9150
9151                 ol_link_termcap=yes
9152                 TERMCAP_LIBS=-lncurses
9153         fi
9154 fi
9155
9156 if test $ol_link_termcap = no ; then
9157         cat >> confdefs.h <<\EOF
9158 #define NO_TERMCAP 1
9159 EOF
9160
9161         TERMCAP_LIBS=
9162 fi
9163
9164 ol_link_readline=no
9165 if test $ol_with_readline != no ; then
9166         for ac_hdr in readline/readline.h readline/history.h
9167 do
9168 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9169 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9170 echo "configure:9171: checking for $ac_hdr" >&5
9171 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9172   echo $ac_n "(cached) $ac_c" 1>&6
9173 else
9174   cat > conftest.$ac_ext <<EOF
9175 #line 9176 "configure"
9176 #include "confdefs.h"
9177 #include <$ac_hdr>
9178 EOF
9179 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9180 { (eval echo configure:9181: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9181 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9182 if test -z "$ac_err"; then
9183   rm -rf conftest*
9184   eval "ac_cv_header_$ac_safe=yes"
9185 else
9186   echo "$ac_err" >&5
9187   echo "configure: failed program was:" >&5
9188   cat conftest.$ac_ext >&5
9189   rm -rf conftest*
9190   eval "ac_cv_header_$ac_safe=no"
9191 fi
9192 rm -f conftest*
9193 fi
9194 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9195   echo "$ac_t""yes" 1>&6
9196     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9197   cat >> confdefs.h <<EOF
9198 #define $ac_tr_hdr 1
9199 EOF
9200  
9201 else
9202   echo "$ac_t""no" 1>&6
9203 fi
9204 done
9205
9206
9207         if test $ac_cv_header_readline_readline_h = yes ; then
9208                 save_LIBS="$LIBS"
9209                 LIBS="$TERMCAP_LIBS $LIBS"
9210                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
9211 echo "configure:9212: checking for readline in -lreadline" >&5
9212 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`
9213 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9214   echo $ac_n "(cached) $ac_c" 1>&6
9215 else
9216   ac_save_LIBS="$LIBS"
9217 LIBS="-lreadline  $LIBS"
9218 cat > conftest.$ac_ext <<EOF
9219 #line 9220 "configure"
9220 #include "confdefs.h"
9221 /* Override any gcc2 internal prototype to avoid an error.  */
9222 /* We use char because int might match the return type of a gcc2
9223     builtin and then its argument prototype would still apply.  */
9224 char readline();
9225
9226 int main() {
9227 readline()
9228 ; return 0; }
9229 EOF
9230 if { (eval echo configure:9231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9231   rm -rf conftest*
9232   eval "ac_cv_lib_$ac_lib_var=yes"
9233 else
9234   echo "configure: failed program was:" >&5
9235   cat conftest.$ac_ext >&5
9236   rm -rf conftest*
9237   eval "ac_cv_lib_$ac_lib_var=no"
9238 fi
9239 rm -f conftest*
9240 LIBS="$ac_save_LIBS"
9241
9242 fi
9243 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9244   echo "$ac_t""yes" 1>&6
9245   have_readline=yes
9246 else
9247   echo "$ac_t""no" 1>&6
9248 have_readline=no
9249 fi
9250
9251                 LIBS="$save_LIBS"
9252                         
9253                 if test $have_readline = yes ; then
9254                         ol_with_readline=found
9255                         ol_link_readline=yes
9256
9257                         READLINE_LIBS="-lreadline"
9258                 fi
9259         fi
9260 fi
9261
9262 if test $ol_link_readline = yes ; then
9263         cat >> confdefs.h <<\EOF
9264 #define HAVE_READLINE 1
9265 EOF
9266
9267 fi
9268
9269
9270 # FreeBSD (and others) have crypt(3) in -lcrypt
9271 if test $ol_enable_crypt != no ; then
9272         echo $ac_n "checking for crypt""... $ac_c" 1>&6
9273 echo "configure:9274: checking for crypt" >&5
9274 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
9275   echo $ac_n "(cached) $ac_c" 1>&6
9276 else
9277   cat > conftest.$ac_ext <<EOF
9278 #line 9279 "configure"
9279 #include "confdefs.h"
9280 /* System header to define __stub macros and hopefully few prototypes,
9281     which can conflict with char crypt(); below.  */
9282 #include <assert.h>
9283 /* Override any gcc2 internal prototype to avoid an error.  */
9284 /* We use char because int might match the return type of a gcc2
9285     builtin and then its argument prototype would still apply.  */
9286 char crypt();
9287
9288 int main() {
9289
9290 /* The GNU C library defines this for functions which it implements
9291     to always fail with ENOSYS.  Some functions are actually named
9292     something starting with __ and the normal name is an alias.  */
9293 #if defined (__stub_crypt) || defined (__stub___crypt)
9294 choke me
9295 #else
9296 crypt();
9297 #endif
9298
9299 ; return 0; }
9300 EOF
9301 if { (eval echo configure:9302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9302   rm -rf conftest*
9303   eval "ac_cv_func_crypt=yes"
9304 else
9305   echo "configure: failed program was:" >&5
9306   cat conftest.$ac_ext >&5
9307   rm -rf conftest*
9308   eval "ac_cv_func_crypt=no"
9309 fi
9310 rm -f conftest*
9311 fi
9312
9313 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
9314   echo "$ac_t""yes" 1>&6
9315   have_crypt=yes
9316 else
9317   echo "$ac_t""no" 1>&6
9318
9319                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
9320 echo "configure:9321: checking for crypt in -lcrypt" >&5
9321 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
9322 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9323   echo $ac_n "(cached) $ac_c" 1>&6
9324 else
9325   ac_save_LIBS="$LIBS"
9326 LIBS="-lcrypt  $LIBS"
9327 cat > conftest.$ac_ext <<EOF
9328 #line 9329 "configure"
9329 #include "confdefs.h"
9330 /* Override any gcc2 internal prototype to avoid an error.  */
9331 /* We use char because int might match the return type of a gcc2
9332     builtin and then its argument prototype would still apply.  */
9333 char crypt();
9334
9335 int main() {
9336 crypt()
9337 ; return 0; }
9338 EOF
9339 if { (eval echo configure:9340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9340   rm -rf conftest*
9341   eval "ac_cv_lib_$ac_lib_var=yes"
9342 else
9343   echo "configure: failed program was:" >&5
9344   cat conftest.$ac_ext >&5
9345   rm -rf conftest*
9346   eval "ac_cv_lib_$ac_lib_var=no"
9347 fi
9348 rm -f conftest*
9349 LIBS="$ac_save_LIBS"
9350
9351 fi
9352 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9353   echo "$ac_t""yes" 1>&6
9354   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
9355                         have_crypt=yes
9356 else
9357   echo "$ac_t""no" 1>&6
9358 have_crypt=no
9359 fi
9360
9361 fi
9362
9363
9364         if test $have_crypt = yes ; then
9365                 cat >> confdefs.h <<\EOF
9366 #define HAVE_CRYPT 1
9367 EOF
9368
9369         else
9370                 echo "configure: warning: could not find crypt" 1>&2
9371                 if test $ol_enable_crypt = yes ; then
9372                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
9373                 fi
9374
9375                 echo "configure: warning: disabling crypt support" 1>&2
9376                 ol_enable_crypt=no
9377         fi
9378 fi
9379
9380 # FreeBSD (and others) have setproctitle(3) in -lutil
9381 if test $ol_enable_proctitle != no ; then
9382         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
9383 echo "configure:9384: checking for setproctitle" >&5
9384 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
9385   echo $ac_n "(cached) $ac_c" 1>&6
9386 else
9387   cat > conftest.$ac_ext <<EOF
9388 #line 9389 "configure"
9389 #include "confdefs.h"
9390 /* System header to define __stub macros and hopefully few prototypes,
9391     which can conflict with char setproctitle(); below.  */
9392 #include <assert.h>
9393 /* Override any gcc2 internal prototype to avoid an error.  */
9394 /* We use char because int might match the return type of a gcc2
9395     builtin and then its argument prototype would still apply.  */
9396 char setproctitle();
9397
9398 int main() {
9399
9400 /* The GNU C library defines this for functions which it implements
9401     to always fail with ENOSYS.  Some functions are actually named
9402     something starting with __ and the normal name is an alias.  */
9403 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
9404 choke me
9405 #else
9406 setproctitle();
9407 #endif
9408
9409 ; return 0; }
9410 EOF
9411 if { (eval echo configure:9412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9412   rm -rf conftest*
9413   eval "ac_cv_func_setproctitle=yes"
9414 else
9415   echo "configure: failed program was:" >&5
9416   cat conftest.$ac_ext >&5
9417   rm -rf conftest*
9418   eval "ac_cv_func_setproctitle=no"
9419 fi
9420 rm -f conftest*
9421 fi
9422
9423 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
9424   echo "$ac_t""yes" 1>&6
9425   have_setproctitle=yes
9426 else
9427   echo "$ac_t""no" 1>&6
9428
9429                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
9430 echo "configure:9431: checking for setproctitle in -lutil" >&5
9431 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
9432 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9433   echo $ac_n "(cached) $ac_c" 1>&6
9434 else
9435   ac_save_LIBS="$LIBS"
9436 LIBS="-lutil  $LIBS"
9437 cat > conftest.$ac_ext <<EOF
9438 #line 9439 "configure"
9439 #include "confdefs.h"
9440 /* Override any gcc2 internal prototype to avoid an error.  */
9441 /* We use char because int might match the return type of a gcc2
9442     builtin and then its argument prototype would still apply.  */
9443 char setproctitle();
9444
9445 int main() {
9446 setproctitle()
9447 ; return 0; }
9448 EOF
9449 if { (eval echo configure:9450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9450   rm -rf conftest*
9451   eval "ac_cv_lib_$ac_lib_var=yes"
9452 else
9453   echo "configure: failed program was:" >&5
9454   cat conftest.$ac_ext >&5
9455   rm -rf conftest*
9456   eval "ac_cv_lib_$ac_lib_var=no"
9457 fi
9458 rm -f conftest*
9459 LIBS="$ac_save_LIBS"
9460
9461 fi
9462 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9463   echo "$ac_t""yes" 1>&6
9464   have_setproctitle=yes
9465                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
9466 else
9467   echo "$ac_t""no" 1>&6
9468 have_setproctitle=no
9469                         LIBOBJS="$LIBOBJS setproctitle.o"
9470 fi
9471
9472 fi
9473
9474
9475         if test $have_setproctitle = yes ; then
9476                 cat >> confdefs.h <<\EOF
9477 #define HAVE_SETPROCTITLE 1
9478 EOF
9479
9480         fi
9481 fi
9482
9483 # test for EBCDIC
9484 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
9485 echo "configure:9486: checking for EBCDIC" >&5
9486 if eval "test \"`echo '$''{'ol_cv_cpp_ebcdic'+set}'`\" = set"; then
9487   echo $ac_n "(cached) $ac_c" 1>&6
9488 else
9489   
9490         cat > conftest.$ac_ext <<EOF
9491 #line 9492 "configure"
9492 #include "confdefs.h"
9493
9494 #if !('M' == 0xd4)
9495 #include <__ASCII__/generate_error.h>
9496 #endif
9497
9498 EOF
9499 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9500 { (eval echo configure:9501: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9501 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9502 if test -z "$ac_err"; then
9503   rm -rf conftest*
9504   ol_cv_cpp_ebcdic=yes
9505 else
9506   echo "$ac_err" >&5
9507   echo "configure: failed program was:" >&5
9508   cat conftest.$ac_ext >&5
9509   rm -rf conftest*
9510   ol_cv_cpp_ebcdic=no
9511 fi
9512 rm -f conftest*
9513 fi
9514
9515 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
9516 if test $ol_cv_cpp_ebcdic = yes ; then
9517         cat >> confdefs.h <<\EOF
9518 #define HAVE_EBCDIC 1
9519 EOF
9520
9521 fi
9522
9523 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
9524 echo "configure:9525: checking for ANSI C header files" >&5
9525 if eval "test \"`echo '$''{'ol_cv_header_stdc'+set}'`\" = set"; then
9526   echo $ac_n "(cached) $ac_c" 1>&6
9527 else
9528   cat > conftest.$ac_ext <<EOF
9529 #line 9530 "configure"
9530 #include "confdefs.h"
9531 #include <stdlib.h>
9532 #include <stdarg.h>
9533 #include <string.h>
9534 #include <float.h>
9535 EOF
9536 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9537 { (eval echo configure:9538: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9538 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9539 if test -z "$ac_err"; then
9540   rm -rf conftest*
9541   ol_cv_header_stdc=yes
9542 else
9543   echo "$ac_err" >&5
9544   echo "configure: failed program was:" >&5
9545   cat conftest.$ac_ext >&5
9546   rm -rf conftest*
9547   ol_cv_header_stdc=no
9548 fi
9549 rm -f conftest*
9550
9551 if test $ol_cv_header_stdc = yes; then
9552   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
9553 cat > conftest.$ac_ext <<EOF
9554 #line 9555 "configure"
9555 #include "confdefs.h"
9556 #include <string.h>
9557 EOF
9558 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9559   egrep "memchr" >/dev/null 2>&1; then
9560   :
9561 else
9562   rm -rf conftest*
9563   ol_cv_header_stdc=no
9564 fi
9565 rm -f conftest*
9566
9567 fi
9568
9569 if test $ol_cv_header_stdc = yes; then
9570   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
9571 cat > conftest.$ac_ext <<EOF
9572 #line 9573 "configure"
9573 #include "confdefs.h"
9574 #include <stdlib.h>
9575 EOF
9576 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9577   egrep "free" >/dev/null 2>&1; then
9578   :
9579 else
9580   rm -rf conftest*
9581   ol_cv_header_stdc=no
9582 fi
9583 rm -f conftest*
9584
9585 fi
9586
9587 if test $ol_cv_header_stdc = yes; then
9588   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
9589 if test "$cross_compiling" = yes; then
9590   :
9591 else
9592   cat > conftest.$ac_ext <<EOF
9593 #line 9594 "configure"
9594 #include "confdefs.h"
9595 #include <ctype.h>
9596 #ifndef HAVE_EBCDIC
9597 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
9598 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
9599 #else
9600 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
9601                 || ('j' <= (c) && (c) <= 'r') \
9602                 || ('s' <= (c) && (c) <= 'z'))
9603 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
9604 #endif
9605 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
9606 int main () { int i; for (i = 0; i < 256; i++)
9607 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
9608 exit (0); }
9609
9610 EOF
9611 if { (eval echo configure:9612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9612 then
9613   :
9614 else
9615   echo "configure: failed program was:" >&5
9616   cat conftest.$ac_ext >&5
9617   rm -fr conftest*
9618   ol_cv_header_stdc=no
9619 fi
9620 rm -fr conftest*
9621 fi
9622
9623 fi
9624 fi
9625
9626 echo "$ac_t""$ol_cv_header_stdc" 1>&6
9627 if test $ol_cv_header_stdc = yes; then
9628   cat >> confdefs.h <<\EOF
9629 #define STDC_HEADERS 1
9630 EOF
9631
9632 fi
9633 ac_cv_header_stdc=disable
9634
9635
9636 if test $ol_cv_header_stdc != yes; then
9637         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
9638 fi
9639
9640 ac_header_dirent=no
9641 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
9642 do
9643 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9644 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
9645 echo "configure:9646: checking for $ac_hdr that defines DIR" >&5
9646 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
9647   echo $ac_n "(cached) $ac_c" 1>&6
9648 else
9649   cat > conftest.$ac_ext <<EOF
9650 #line 9651 "configure"
9651 #include "confdefs.h"
9652 #include <sys/types.h>
9653 #include <$ac_hdr>
9654 int main() {
9655 DIR *dirp = 0;
9656 ; return 0; }
9657 EOF
9658 if { (eval echo configure:9659: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9659   rm -rf conftest*
9660   eval "ac_cv_header_dirent_$ac_safe=yes"
9661 else
9662   echo "configure: failed program was:" >&5
9663   cat conftest.$ac_ext >&5
9664   rm -rf conftest*
9665   eval "ac_cv_header_dirent_$ac_safe=no"
9666 fi
9667 rm -f conftest*
9668 fi
9669 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
9670   echo "$ac_t""yes" 1>&6
9671     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9672   cat >> confdefs.h <<EOF
9673 #define $ac_tr_hdr 1
9674 EOF
9675  ac_header_dirent=$ac_hdr; break
9676 else
9677   echo "$ac_t""no" 1>&6
9678 fi
9679 done
9680 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
9681 if test $ac_header_dirent = dirent.h; then
9682 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
9683 echo "configure:9684: checking for opendir in -ldir" >&5
9684 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
9685 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9686   echo $ac_n "(cached) $ac_c" 1>&6
9687 else
9688   ac_save_LIBS="$LIBS"
9689 LIBS="-ldir  $LIBS"
9690 cat > conftest.$ac_ext <<EOF
9691 #line 9692 "configure"
9692 #include "confdefs.h"
9693 /* Override any gcc2 internal prototype to avoid an error.  */
9694 /* We use char because int might match the return type of a gcc2
9695     builtin and then its argument prototype would still apply.  */
9696 char opendir();
9697
9698 int main() {
9699 opendir()
9700 ; return 0; }
9701 EOF
9702 if { (eval echo configure:9703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9703   rm -rf conftest*
9704   eval "ac_cv_lib_$ac_lib_var=yes"
9705 else
9706   echo "configure: failed program was:" >&5
9707   cat conftest.$ac_ext >&5
9708   rm -rf conftest*
9709   eval "ac_cv_lib_$ac_lib_var=no"
9710 fi
9711 rm -f conftest*
9712 LIBS="$ac_save_LIBS"
9713
9714 fi
9715 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9716   echo "$ac_t""yes" 1>&6
9717   LIBS="$LIBS -ldir"
9718 else
9719   echo "$ac_t""no" 1>&6
9720 fi
9721
9722 else
9723 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
9724 echo "configure:9725: checking for opendir in -lx" >&5
9725 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
9726 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9727   echo $ac_n "(cached) $ac_c" 1>&6
9728 else
9729   ac_save_LIBS="$LIBS"
9730 LIBS="-lx  $LIBS"
9731 cat > conftest.$ac_ext <<EOF
9732 #line 9733 "configure"
9733 #include "confdefs.h"
9734 /* Override any gcc2 internal prototype to avoid an error.  */
9735 /* We use char because int might match the return type of a gcc2
9736     builtin and then its argument prototype would still apply.  */
9737 char opendir();
9738
9739 int main() {
9740 opendir()
9741 ; return 0; }
9742 EOF
9743 if { (eval echo configure:9744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9744   rm -rf conftest*
9745   eval "ac_cv_lib_$ac_lib_var=yes"
9746 else
9747   echo "configure: failed program was:" >&5
9748   cat conftest.$ac_ext >&5
9749   rm -rf conftest*
9750   eval "ac_cv_lib_$ac_lib_var=no"
9751 fi
9752 rm -f conftest*
9753 LIBS="$ac_save_LIBS"
9754
9755 fi
9756 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9757   echo "$ac_t""yes" 1>&6
9758   LIBS="$LIBS -lx"
9759 else
9760   echo "$ac_t""no" 1>&6
9761 fi
9762
9763 fi
9764
9765 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
9766 echo "configure:9767: checking for sys/wait.h that is POSIX.1 compatible" >&5
9767 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
9768   echo $ac_n "(cached) $ac_c" 1>&6
9769 else
9770   cat > conftest.$ac_ext <<EOF
9771 #line 9772 "configure"
9772 #include "confdefs.h"
9773 #include <sys/types.h>
9774 #include <sys/wait.h>
9775 #ifndef WEXITSTATUS
9776 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
9777 #endif
9778 #ifndef WIFEXITED
9779 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
9780 #endif
9781 int main() {
9782 int s;
9783 wait (&s);
9784 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
9785 ; return 0; }
9786 EOF
9787 if { (eval echo configure:9788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9788   rm -rf conftest*
9789   ac_cv_header_sys_wait_h=yes
9790 else
9791   echo "configure: failed program was:" >&5
9792   cat conftest.$ac_ext >&5
9793   rm -rf conftest*
9794   ac_cv_header_sys_wait_h=no
9795 fi
9796 rm -f conftest*
9797 fi
9798
9799 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
9800 if test $ac_cv_header_sys_wait_h = yes; then
9801   cat >> confdefs.h <<\EOF
9802 #define HAVE_SYS_WAIT_H 1
9803 EOF
9804
9805 fi
9806
9807 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
9808 echo "configure:9809: checking POSIX termios" >&5
9809 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
9810   echo $ac_n "(cached) $ac_c" 1>&6
9811 else
9812   cat > conftest.$ac_ext <<EOF
9813 #line 9814 "configure"
9814 #include "confdefs.h"
9815 #include <sys/types.h>
9816 #include <unistd.h>
9817 #include <termios.h>
9818 int main() {
9819 /* SunOS 4.0.3 has termios.h but not the library calls.  */
9820    tcgetattr(0, 0);
9821 ; return 0; }
9822 EOF
9823 if { (eval echo configure:9824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9824   rm -rf conftest*
9825   am_cv_sys_posix_termios=yes
9826 else
9827   echo "configure: failed program was:" >&5
9828   cat conftest.$ac_ext >&5
9829   rm -rf conftest*
9830   am_cv_sys_posix_termios=no
9831 fi
9832 rm -f conftest*
9833 fi
9834
9835 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
9836
9837
9838  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
9839 echo "configure:9840: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
9840 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
9841   echo $ac_n "(cached) $ac_c" 1>&6
9842 else
9843   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
9844
9845   gwinsz_in_termios_h=no
9846   if test $am_cv_sys_posix_termios = yes; then
9847     cat > conftest.$ac_ext <<EOF
9848 #line 9849 "configure"
9849 #include "confdefs.h"
9850 #include <sys/types.h>
9851 #     include <termios.h>
9852 #     ifdef TIOCGWINSZ
9853         yes
9854 #     endif
9855     
9856 EOF
9857 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9858   egrep "yes" >/dev/null 2>&1; then
9859   rm -rf conftest*
9860   gwinsz_in_termios_h=yes
9861 fi
9862 rm -f conftest*
9863
9864   fi
9865
9866   if test $gwinsz_in_termios_h = no; then
9867     cat > conftest.$ac_ext <<EOF
9868 #line 9869 "configure"
9869 #include "confdefs.h"
9870 #include <sys/types.h>
9871 #     include <sys/ioctl.h>
9872 #     ifdef TIOCGWINSZ
9873         yes
9874 #     endif
9875     
9876 EOF
9877 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9878   egrep "yes" >/dev/null 2>&1; then
9879   rm -rf conftest*
9880   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
9881 fi
9882 rm -f conftest*
9883
9884   fi
9885   
9886 fi
9887
9888 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
9889   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
9890     cat >> confdefs.h <<\EOF
9891 #define GWINSZ_IN_SYS_IOCTL 1
9892 EOF
9893
9894   fi
9895
9896 if test $am_cv_sys_posix_termios = yes ; then
9897         cat >> confdefs.h <<\EOF
9898 #define HAVE_POSIX_TERMIOS 1
9899 EOF
9900
9901 fi
9902
9903 for ac_hdr in \
9904         arpa/inet.h             \
9905         arpa/nameser.h  \
9906         assert.h                \
9907         crypt.h                 \
9908         errno.h                 \
9909         fcntl.h                 \
9910         filio.h                 \
9911         getopt.h                \
9912         grp.h                   \
9913         libutil.h               \
9914         limits.h                \
9915         locale.h                \
9916         malloc.h                \
9917         memory.h                \
9918         psap.h                  \
9919         pwd.h                   \
9920         resolv.h                \
9921         sgtty.h                 \
9922         stdarg.h                \
9923         stddef.h                \
9924         string.h                \
9925         strings.h               \
9926         sysexits.h              \
9927         sys/file.h              \
9928         sys/filio.h             \
9929         sys/errno.h             \
9930         sys/ioctl.h             \
9931         sys/param.h             \
9932         sys/resource.h  \
9933         sys/select.h    \
9934         sys/socket.h    \
9935         sys/syslog.h    \
9936         sys/time.h              \
9937         sys/types.h             \
9938         syslog.h                \
9939         termios.h               \
9940         unistd.h                \
9941
9942 do
9943 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9944 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9945 echo "configure:9946: checking for $ac_hdr" >&5
9946 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9947   echo $ac_n "(cached) $ac_c" 1>&6
9948 else
9949   cat > conftest.$ac_ext <<EOF
9950 #line 9951 "configure"
9951 #include "confdefs.h"
9952 #include <$ac_hdr>
9953 EOF
9954 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9955 { (eval echo configure:9956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9956 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9957 if test -z "$ac_err"; then
9958   rm -rf conftest*
9959   eval "ac_cv_header_$ac_safe=yes"
9960 else
9961   echo "$ac_err" >&5
9962   echo "configure: failed program was:" >&5
9963   cat conftest.$ac_ext >&5
9964   rm -rf conftest*
9965   eval "ac_cv_header_$ac_safe=no"
9966 fi
9967 rm -f conftest*
9968 fi
9969 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9970   echo "$ac_t""yes" 1>&6
9971     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9972   cat >> confdefs.h <<EOF
9973 #define $ac_tr_hdr 1
9974 EOF
9975  
9976 else
9977   echo "$ac_t""no" 1>&6
9978 fi
9979 done
9980
9981
9982 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
9983 echo "configure:9984: checking for uid_t in sys/types.h" >&5
9984 if eval "test \"`echo '$''{'ac_cv_type_uid_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 EOF
9992 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9993   egrep "uid_t" >/dev/null 2>&1; then
9994   rm -rf conftest*
9995   ac_cv_type_uid_t=yes
9996 else
9997   rm -rf conftest*
9998   ac_cv_type_uid_t=no
9999 fi
10000 rm -f conftest*
10001
10002 fi
10003
10004 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
10005 if test $ac_cv_type_uid_t = no; then
10006   cat >> confdefs.h <<\EOF
10007 #define uid_t int
10008 EOF
10009
10010   cat >> confdefs.h <<\EOF
10011 #define gid_t int
10012 EOF
10013
10014 fi
10015
10016 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
10017 echo "configure:10018: checking type of array argument to getgroups" >&5
10018 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
10019   echo $ac_n "(cached) $ac_c" 1>&6
10020 else
10021   if test "$cross_compiling" = yes; then
10022   ac_cv_type_getgroups=cross
10023 else
10024   cat > conftest.$ac_ext <<EOF
10025 #line 10026 "configure"
10026 #include "confdefs.h"
10027
10028 /* Thanks to Mike Rendell for this test.  */
10029 #include <sys/types.h>
10030 #define NGID 256
10031 #undef MAX
10032 #define MAX(x, y) ((x) > (y) ? (x) : (y))
10033 main()
10034 {
10035   gid_t gidset[NGID];
10036   int i, n;
10037   union { gid_t gval; long lval; }  val;
10038
10039   val.lval = -1;
10040   for (i = 0; i < NGID; i++)
10041     gidset[i] = val.gval;
10042   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
10043                  gidset);
10044   /* Exit non-zero if getgroups seems to require an array of ints.  This
10045      happens when gid_t is short but getgroups modifies an array of ints.  */
10046   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
10047 }
10048
10049 EOF
10050 if { (eval echo configure:10051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10051 then
10052     ac_cv_type_getgroups=gid_t
10053 else
10054   echo "configure: failed program was:" >&5
10055   cat conftest.$ac_ext >&5
10056   rm -fr conftest*
10057   ac_cv_type_getgroups=int
10058 fi
10059 rm -fr conftest*
10060 fi
10061
10062 if test $ac_cv_type_getgroups = cross; then
10063         cat > conftest.$ac_ext <<EOF
10064 #line 10065 "configure"
10065 #include "confdefs.h"
10066 #include <unistd.h>
10067 EOF
10068 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10069   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
10070   rm -rf conftest*
10071   ac_cv_type_getgroups=gid_t
10072 else
10073   rm -rf conftest*
10074   ac_cv_type_getgroups=int
10075 fi
10076 rm -f conftest*
10077
10078 fi
10079 fi
10080
10081 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
10082 cat >> confdefs.h <<EOF
10083 #define GETGROUPS_T $ac_cv_type_getgroups
10084 EOF
10085
10086  echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
10087 echo "configure:10088: checking for ANSI C header files" >&5
10088 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
10089   echo $ac_n "(cached) $ac_c" 1>&6
10090 else
10091   cat > conftest.$ac_ext <<EOF
10092 #line 10093 "configure"
10093 #include "confdefs.h"
10094 #include <stdlib.h>
10095 #include <stdarg.h>
10096 #include <string.h>
10097 #include <float.h>
10098 EOF
10099 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10100 { (eval echo configure:10101: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10101 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10102 if test -z "$ac_err"; then
10103   rm -rf conftest*
10104   ac_cv_header_stdc=yes
10105 else
10106   echo "$ac_err" >&5
10107   echo "configure: failed program was:" >&5
10108   cat conftest.$ac_ext >&5
10109   rm -rf conftest*
10110   ac_cv_header_stdc=no
10111 fi
10112 rm -f conftest*
10113
10114 if test $ac_cv_header_stdc = yes; then
10115   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
10116 cat > conftest.$ac_ext <<EOF
10117 #line 10118 "configure"
10118 #include "confdefs.h"
10119 #include <string.h>
10120 EOF
10121 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10122   egrep "memchr" >/dev/null 2>&1; then
10123   :
10124 else
10125   rm -rf conftest*
10126   ac_cv_header_stdc=no
10127 fi
10128 rm -f conftest*
10129
10130 fi
10131
10132 if test $ac_cv_header_stdc = yes; then
10133   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
10134 cat > conftest.$ac_ext <<EOF
10135 #line 10136 "configure"
10136 #include "confdefs.h"
10137 #include <stdlib.h>
10138 EOF
10139 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10140   egrep "free" >/dev/null 2>&1; then
10141   :
10142 else
10143   rm -rf conftest*
10144   ac_cv_header_stdc=no
10145 fi
10146 rm -f conftest*
10147
10148 fi
10149
10150 if test $ac_cv_header_stdc = yes; then
10151   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
10152 if test "$cross_compiling" = yes; then
10153   :
10154 else
10155   cat > conftest.$ac_ext <<EOF
10156 #line 10157 "configure"
10157 #include "confdefs.h"
10158 #include <ctype.h>
10159 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
10160 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
10161 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
10162 int main () { int i; for (i = 0; i < 256; i++)
10163 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
10164 exit (0); }
10165
10166 EOF
10167 if { (eval echo configure:10168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10168 then
10169   :
10170 else
10171   echo "configure: failed program was:" >&5
10172   cat conftest.$ac_ext >&5
10173   rm -fr conftest*
10174   ac_cv_header_stdc=no
10175 fi
10176 rm -fr conftest*
10177 fi
10178
10179 fi
10180 fi
10181
10182 echo "$ac_t""$ac_cv_header_stdc" 1>&6
10183 if test $ac_cv_header_stdc = yes; then
10184   cat >> confdefs.h <<\EOF
10185 #define STDC_HEADERS 1
10186 EOF
10187
10188 fi
10189
10190 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
10191 echo "configure:10192: checking for mode_t" >&5
10192 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
10193   echo $ac_n "(cached) $ac_c" 1>&6
10194 else
10195   cat > conftest.$ac_ext <<EOF
10196 #line 10197 "configure"
10197 #include "confdefs.h"
10198 #include <sys/types.h>
10199 #if STDC_HEADERS
10200 #include <stdlib.h>
10201 #include <stddef.h>
10202 #endif
10203 EOF
10204 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10205   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10206   rm -rf conftest*
10207   ac_cv_type_mode_t=yes
10208 else
10209   rm -rf conftest*
10210   ac_cv_type_mode_t=no
10211 fi
10212 rm -f conftest*
10213
10214 fi
10215 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
10216 if test $ac_cv_type_mode_t = no; then
10217   cat >> confdefs.h <<\EOF
10218 #define mode_t int
10219 EOF
10220
10221 fi
10222
10223 echo $ac_n "checking for off_t""... $ac_c" 1>&6
10224 echo "configure:10225: checking for off_t" >&5
10225 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
10226   echo $ac_n "(cached) $ac_c" 1>&6
10227 else
10228   cat > conftest.$ac_ext <<EOF
10229 #line 10230 "configure"
10230 #include "confdefs.h"
10231 #include <sys/types.h>
10232 #if STDC_HEADERS
10233 #include <stdlib.h>
10234 #include <stddef.h>
10235 #endif
10236 EOF
10237 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10238   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10239   rm -rf conftest*
10240   ac_cv_type_off_t=yes
10241 else
10242   rm -rf conftest*
10243   ac_cv_type_off_t=no
10244 fi
10245 rm -f conftest*
10246
10247 fi
10248 echo "$ac_t""$ac_cv_type_off_t" 1>&6
10249 if test $ac_cv_type_off_t = no; then
10250   cat >> confdefs.h <<\EOF
10251 #define off_t long
10252 EOF
10253
10254 fi
10255
10256 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
10257 echo "configure:10258: checking for pid_t" >&5
10258 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
10259   echo $ac_n "(cached) $ac_c" 1>&6
10260 else
10261   cat > conftest.$ac_ext <<EOF
10262 #line 10263 "configure"
10263 #include "confdefs.h"
10264 #include <sys/types.h>
10265 #if STDC_HEADERS
10266 #include <stdlib.h>
10267 #include <stddef.h>
10268 #endif
10269 EOF
10270 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10271   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10272   rm -rf conftest*
10273   ac_cv_type_pid_t=yes
10274 else
10275   rm -rf conftest*
10276   ac_cv_type_pid_t=no
10277 fi
10278 rm -f conftest*
10279
10280 fi
10281 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
10282 if test $ac_cv_type_pid_t = no; then
10283   cat >> confdefs.h <<\EOF
10284 #define pid_t int
10285 EOF
10286
10287 fi
10288
10289 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
10290 echo "configure:10291: checking for ptrdiff_t" >&5
10291 if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then
10292   echo $ac_n "(cached) $ac_c" 1>&6
10293 else
10294   cat > conftest.$ac_ext <<EOF
10295 #line 10296 "configure"
10296 #include "confdefs.h"
10297 #include <stddef.h>
10298 int main() {
10299 ptrdiff_t p
10300 ; return 0; }
10301 EOF
10302 if { (eval echo configure:10303: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10303   rm -rf conftest*
10304   am_cv_type_ptrdiff_t=yes
10305 else
10306   echo "configure: failed program was:" >&5
10307   cat conftest.$ac_ext >&5
10308   rm -rf conftest*
10309   am_cv_type_ptrdiff_t=no
10310 fi
10311 rm -f conftest*
10312 fi
10313
10314 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
10315    if test $am_cv_type_ptrdiff_t = yes; then
10316      cat >> confdefs.h <<\EOF
10317 #define HAVE_PTRDIFF_T 1
10318 EOF
10319
10320    fi
10321
10322 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
10323 echo "configure:10324: checking return type of signal handlers" >&5
10324 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
10325   echo $ac_n "(cached) $ac_c" 1>&6
10326 else
10327   cat > conftest.$ac_ext <<EOF
10328 #line 10329 "configure"
10329 #include "confdefs.h"
10330 #include <sys/types.h>
10331 #include <signal.h>
10332 #ifdef signal
10333 #undef signal
10334 #endif
10335 #ifdef __cplusplus
10336 extern "C" void (*signal (int, void (*)(int)))(int);
10337 #else
10338 void (*signal ()) ();
10339 #endif
10340
10341 int main() {
10342 int i;
10343 ; return 0; }
10344 EOF
10345 if { (eval echo configure:10346: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10346   rm -rf conftest*
10347   ac_cv_type_signal=void
10348 else
10349   echo "configure: failed program was:" >&5
10350   cat conftest.$ac_ext >&5
10351   rm -rf conftest*
10352   ac_cv_type_signal=int
10353 fi
10354 rm -f conftest*
10355 fi
10356
10357 echo "$ac_t""$ac_cv_type_signal" 1>&6
10358 cat >> confdefs.h <<EOF
10359 #define RETSIGTYPE $ac_cv_type_signal
10360 EOF
10361
10362
10363 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
10364 echo "configure:10365: checking for sig_atomic_t" >&5
10365 if eval "test \"`echo '$''{'ol_cv_type_sig_atomic_t'+set}'`\" = set"; then
10366   echo $ac_n "(cached) $ac_c" 1>&6
10367 else
10368   cat > conftest.$ac_ext <<EOF
10369 #line 10370 "configure"
10370 #include "confdefs.h"
10371 #include <signal.h>
10372 int main() {
10373 sig_atomic_t atomic;
10374 ; return 0; }
10375 EOF
10376 if { (eval echo configure:10377: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10377   rm -rf conftest*
10378   ol_cv_type_sig_atomic_t=yes
10379 else
10380   echo "configure: failed program was:" >&5
10381   cat conftest.$ac_ext >&5
10382   rm -rf conftest*
10383   ol_cv_type_sig_atomic_t=no
10384 fi
10385 rm -f conftest*
10386 fi
10387
10388 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
10389   if test $ol_cv_type_sig_atomic_t = no; then
10390     cat >> confdefs.h <<\EOF
10391 #define sig_atomic_t int
10392 EOF
10393
10394   fi
10395  
10396 echo $ac_n "checking for size_t""... $ac_c" 1>&6
10397 echo "configure:10398: checking for size_t" >&5
10398 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
10399   echo $ac_n "(cached) $ac_c" 1>&6
10400 else
10401   cat > conftest.$ac_ext <<EOF
10402 #line 10403 "configure"
10403 #include "confdefs.h"
10404 #include <sys/types.h>
10405 #if STDC_HEADERS
10406 #include <stdlib.h>
10407 #include <stddef.h>
10408 #endif
10409 EOF
10410 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10411   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10412   rm -rf conftest*
10413   ac_cv_type_size_t=yes
10414 else
10415   rm -rf conftest*
10416   ac_cv_type_size_t=no
10417 fi
10418 rm -f conftest*
10419
10420 fi
10421 echo "$ac_t""$ac_cv_type_size_t" 1>&6
10422 if test $ac_cv_type_size_t = no; then
10423   cat >> confdefs.h <<\EOF
10424 #define size_t unsigned
10425 EOF
10426
10427 fi
10428
10429 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
10430 echo "configure:10431: checking for st_blksize in struct stat" >&5
10431 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
10432   echo $ac_n "(cached) $ac_c" 1>&6
10433 else
10434   cat > conftest.$ac_ext <<EOF
10435 #line 10436 "configure"
10436 #include "confdefs.h"
10437 #include <sys/types.h>
10438 #include <sys/stat.h>
10439 int main() {
10440 struct stat s; s.st_blksize;
10441 ; return 0; }
10442 EOF
10443 if { (eval echo configure:10444: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10444   rm -rf conftest*
10445   ac_cv_struct_st_blksize=yes
10446 else
10447   echo "configure: failed program was:" >&5
10448   cat conftest.$ac_ext >&5
10449   rm -rf conftest*
10450   ac_cv_struct_st_blksize=no
10451 fi
10452 rm -f conftest*
10453 fi
10454
10455 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
10456 if test $ac_cv_struct_st_blksize = yes; then
10457   cat >> confdefs.h <<\EOF
10458 #define HAVE_ST_BLKSIZE 1
10459 EOF
10460
10461 fi
10462
10463 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
10464 echo "configure:10465: checking whether time.h and sys/time.h may both be included" >&5
10465 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
10466   echo $ac_n "(cached) $ac_c" 1>&6
10467 else
10468   cat > conftest.$ac_ext <<EOF
10469 #line 10470 "configure"
10470 #include "confdefs.h"
10471 #include <sys/types.h>
10472 #include <sys/time.h>
10473 #include <time.h>
10474 int main() {
10475 struct tm *tp;
10476 ; return 0; }
10477 EOF
10478 if { (eval echo configure:10479: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10479   rm -rf conftest*
10480   ac_cv_header_time=yes
10481 else
10482   echo "configure: failed program was:" >&5
10483   cat conftest.$ac_ext >&5
10484   rm -rf conftest*
10485   ac_cv_header_time=no
10486 fi
10487 rm -f conftest*
10488 fi
10489
10490 echo "$ac_t""$ac_cv_header_time" 1>&6
10491 if test $ac_cv_header_time = yes; then
10492   cat >> confdefs.h <<\EOF
10493 #define TIME_WITH_SYS_TIME 1
10494 EOF
10495
10496 fi
10497
10498 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
10499 echo "configure:10500: checking whether struct tm is in sys/time.h or time.h" >&5
10500 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
10501   echo $ac_n "(cached) $ac_c" 1>&6
10502 else
10503   cat > conftest.$ac_ext <<EOF
10504 #line 10505 "configure"
10505 #include "confdefs.h"
10506 #include <sys/types.h>
10507 #include <time.h>
10508 int main() {
10509 struct tm *tp; tp->tm_sec;
10510 ; return 0; }
10511 EOF
10512 if { (eval echo configure:10513: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10513   rm -rf conftest*
10514   ac_cv_struct_tm=time.h
10515 else
10516   echo "configure: failed program was:" >&5
10517   cat conftest.$ac_ext >&5
10518   rm -rf conftest*
10519   ac_cv_struct_tm=sys/time.h
10520 fi
10521 rm -f conftest*
10522 fi
10523
10524 echo "$ac_t""$ac_cv_struct_tm" 1>&6
10525 if test $ac_cv_struct_tm = sys/time.h; then
10526   cat >> confdefs.h <<\EOF
10527 #define TM_IN_SYS_TIME 1
10528 EOF
10529
10530 fi
10531
10532 # test for pw_gecos in struct passwd
10533 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
10534 echo "configure:10535: checking struct passwd for pw_gecos" >&5
10535 if eval "test \"`echo '$''{'ol_cv_struct_passwd_pw_gecos'+set}'`\" = set"; then
10536   echo $ac_n "(cached) $ac_c" 1>&6
10537 else
10538   
10539         cat > conftest.$ac_ext <<EOF
10540 #line 10541 "configure"
10541 #include "confdefs.h"
10542 #include <pwd.h>
10543 int main() {
10544
10545         struct passwd pwd;
10546         pwd.pw_gecos = pwd.pw_name;
10547
10548 ; return 0; }
10549 EOF
10550 if { (eval echo configure:10551: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10551   rm -rf conftest*
10552   ol_cv_struct_passwd_pw_gecos=yes
10553 else
10554   echo "configure: failed program was:" >&5
10555   cat conftest.$ac_ext >&5
10556   rm -rf conftest*
10557   ol_cv_struct_passwd_pw_gecos=no
10558 fi
10559 rm -f conftest*
10560 fi
10561
10562 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
10563 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
10564         cat >> confdefs.h <<\EOF
10565 #define HAVE_PW_GECOS 1
10566 EOF
10567
10568 fi
10569
10570
10571
10572 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
10573 echo "configure:10574: checking if toupper() requires islower()" >&5
10574 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
10575   echo $ac_n "(cached) $ac_c" 1>&6
10576 else
10577   
10578         if test "$cross_compiling" = yes; then
10579   ol_cv_c_upper_lower=safe
10580 else
10581   cat > conftest.$ac_ext <<EOF
10582 #line 10583 "configure"
10583 #include "confdefs.h"
10584
10585 #include <ctype.h>
10586 main()
10587 {
10588         if ('C' == toupper('C'))
10589                 exit(0);
10590         else
10591                 exit(1);
10592 }
10593 EOF
10594 if { (eval echo configure:10595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10595 then
10596   ol_cv_c_upper_lower=no
10597 else
10598   echo "configure: failed program was:" >&5
10599   cat conftest.$ac_ext >&5
10600   rm -fr conftest*
10601   ol_cv_c_upper_lower=yes
10602 fi
10603 rm -fr conftest*
10604 fi
10605
10606 fi
10607
10608 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
10609 if test $ol_cv_c_upper_lower != no ; then
10610         cat >> confdefs.h <<\EOF
10611 #define C_UPPER_LOWER 1
10612 EOF
10613
10614 fi
10615
10616 echo $ac_n "checking for working const""... $ac_c" 1>&6
10617 echo "configure:10618: checking for working const" >&5
10618 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
10619   echo $ac_n "(cached) $ac_c" 1>&6
10620 else
10621   cat > conftest.$ac_ext <<EOF
10622 #line 10623 "configure"
10623 #include "confdefs.h"
10624
10625 int main() {
10626
10627 /* Ultrix mips cc rejects this.  */
10628 typedef int charset[2]; const charset x;
10629 /* SunOS 4.1.1 cc rejects this.  */
10630 char const *const *ccp;
10631 char **p;
10632 /* NEC SVR4.0.2 mips cc rejects this.  */
10633 struct point {int x, y;};
10634 static struct point const zero = {0,0};
10635 /* AIX XL C 1.02.0.0 rejects this.
10636    It does not let you subtract one const X* pointer from another in an arm
10637    of an if-expression whose if-part is not a constant expression */
10638 const char *g = "string";
10639 ccp = &g + (g ? g-g : 0);
10640 /* HPUX 7.0 cc rejects these. */
10641 ++ccp;
10642 p = (char**) ccp;
10643 ccp = (char const *const *) p;
10644 { /* SCO 3.2v4 cc rejects this.  */
10645   char *t;
10646   char const *s = 0 ? (char *) 0 : (char const *) 0;
10647
10648   *t++ = 0;
10649 }
10650 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
10651   int x[] = {25, 17};
10652   const int *foo = &x[0];
10653   ++foo;
10654 }
10655 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
10656   typedef const int *iptr;
10657   iptr p = 0;
10658   ++p;
10659 }
10660 { /* AIX XL C 1.02.0.0 rejects this saying
10661      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
10662   struct s { int j; const int *ap[3]; };
10663   struct s *b; b->j = 5;
10664 }
10665 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
10666   const int foo = 10;
10667 }
10668
10669 ; return 0; }
10670 EOF
10671 if { (eval echo configure:10672: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10672   rm -rf conftest*
10673   ac_cv_c_const=yes
10674 else
10675   echo "configure: failed program was:" >&5
10676   cat conftest.$ac_ext >&5
10677   rm -rf conftest*
10678   ac_cv_c_const=no
10679 fi
10680 rm -f conftest*
10681 fi
10682
10683 echo "$ac_t""$ac_cv_c_const" 1>&6
10684 if test $ac_cv_c_const = no; then
10685   cat >> confdefs.h <<\EOF
10686 #define const 
10687 EOF
10688
10689 fi
10690
10691 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
10692 echo "configure:10693: checking if compiler understands volatile" >&5
10693 if eval "test \"`echo '$''{'ol_cv_c_volatile'+set}'`\" = set"; then
10694   echo $ac_n "(cached) $ac_c" 1>&6
10695 else
10696   cat > conftest.$ac_ext <<EOF
10697 #line 10698 "configure"
10698 #include "confdefs.h"
10699 int x, y, z;
10700 int main() {
10701 volatile int a; int * volatile b = x ? &y : &z;
10702       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
10703       *b = 0;
10704 ; return 0; }
10705 EOF
10706 if { (eval echo configure:10707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10707   rm -rf conftest*
10708   ol_cv_c_volatile=yes
10709 else
10710   echo "configure: failed program was:" >&5
10711   cat conftest.$ac_ext >&5
10712   rm -rf conftest*
10713   ol_cv_c_volatile=no
10714 fi
10715 rm -f conftest*
10716 fi
10717
10718 echo "$ac_t""$ol_cv_c_volatile" 1>&6
10719   if test $ol_cv_c_volatile = yes; then
10720     : 
10721   else
10722     cat >> confdefs.h <<\EOF
10723 #define volatile 
10724 EOF
10725
10726   fi
10727  
10728
10729 if test $cross_compiling = yes ; then
10730         cat >> confdefs.h <<\EOF
10731 #define CROSS_COMPILING 1
10732 EOF
10733
10734 else
10735         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
10736 echo "configure:10737: checking whether byte ordering is bigendian" >&5
10737 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
10738   echo $ac_n "(cached) $ac_c" 1>&6
10739 else
10740   ac_cv_c_bigendian=unknown
10741 # See if sys/param.h defines the BYTE_ORDER macro.
10742 cat > conftest.$ac_ext <<EOF
10743 #line 10744 "configure"
10744 #include "confdefs.h"
10745 #include <sys/types.h>
10746 #include <sys/param.h>
10747 int main() {
10748
10749 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
10750  bogus endian macros
10751 #endif
10752 ; return 0; }
10753 EOF
10754 if { (eval echo configure:10755: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10755   rm -rf conftest*
10756   # It does; now see whether it defined to BIG_ENDIAN or not.
10757 cat > conftest.$ac_ext <<EOF
10758 #line 10759 "configure"
10759 #include "confdefs.h"
10760 #include <sys/types.h>
10761 #include <sys/param.h>
10762 int main() {
10763
10764 #if BYTE_ORDER != BIG_ENDIAN
10765  not big endian
10766 #endif
10767 ; return 0; }
10768 EOF
10769 if { (eval echo configure:10770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10770   rm -rf conftest*
10771   ac_cv_c_bigendian=yes
10772 else
10773   echo "configure: failed program was:" >&5
10774   cat conftest.$ac_ext >&5
10775   rm -rf conftest*
10776   ac_cv_c_bigendian=no
10777 fi
10778 rm -f conftest*
10779 else
10780   echo "configure: failed program was:" >&5
10781   cat conftest.$ac_ext >&5
10782 fi
10783 rm -f conftest*
10784 if test $ac_cv_c_bigendian = unknown; then
10785 if test "$cross_compiling" = yes; then
10786     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10787 else
10788   cat > conftest.$ac_ext <<EOF
10789 #line 10790 "configure"
10790 #include "confdefs.h"
10791 main () {
10792   /* Are we little or big endian?  From Harbison&Steele.  */
10793   union
10794   {
10795     long l;
10796     char c[sizeof (long)];
10797   } u;
10798   u.l = 1;
10799   exit (u.c[sizeof (long) - 1] == 1);
10800 }
10801 EOF
10802 if { (eval echo configure:10803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10803 then
10804   ac_cv_c_bigendian=no
10805 else
10806   echo "configure: failed program was:" >&5
10807   cat conftest.$ac_ext >&5
10808   rm -fr conftest*
10809   ac_cv_c_bigendian=yes
10810 fi
10811 rm -fr conftest*
10812 fi
10813
10814 fi
10815 fi
10816
10817 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
10818 if test $ac_cv_c_bigendian = yes; then
10819   cat >> confdefs.h <<\EOF
10820 #define WORDS_BIGENDIAN 1
10821 EOF
10822
10823 fi
10824
10825         echo $ac_n "checking size of short""... $ac_c" 1>&6
10826 echo "configure:10827: checking size of short" >&5
10827 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
10828   echo $ac_n "(cached) $ac_c" 1>&6
10829 else
10830   if test "$cross_compiling" = yes; then
10831     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10832 else
10833   cat > conftest.$ac_ext <<EOF
10834 #line 10835 "configure"
10835 #include "confdefs.h"
10836 #include <stdio.h>
10837 main()
10838 {
10839   FILE *f=fopen("conftestval", "w");
10840   if (!f) exit(1);
10841   fprintf(f, "%d\n", sizeof(short));
10842   exit(0);
10843 }
10844 EOF
10845 if { (eval echo configure:10846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10846 then
10847   ac_cv_sizeof_short=`cat conftestval`
10848 else
10849   echo "configure: failed program was:" >&5
10850   cat conftest.$ac_ext >&5
10851   rm -fr conftest*
10852   ac_cv_sizeof_short=0
10853 fi
10854 rm -fr conftest*
10855 fi
10856
10857 fi
10858 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
10859 cat >> confdefs.h <<EOF
10860 #define SIZEOF_SHORT $ac_cv_sizeof_short
10861 EOF
10862
10863  
10864         echo $ac_n "checking size of int""... $ac_c" 1>&6
10865 echo "configure:10866: checking size of int" >&5
10866 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
10867   echo $ac_n "(cached) $ac_c" 1>&6
10868 else
10869   if test "$cross_compiling" = yes; then
10870     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10871 else
10872   cat > conftest.$ac_ext <<EOF
10873 #line 10874 "configure"
10874 #include "confdefs.h"
10875 #include <stdio.h>
10876 main()
10877 {
10878   FILE *f=fopen("conftestval", "w");
10879   if (!f) exit(1);
10880   fprintf(f, "%d\n", sizeof(int));
10881   exit(0);
10882 }
10883 EOF
10884 if { (eval echo configure:10885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10885 then
10886   ac_cv_sizeof_int=`cat conftestval`
10887 else
10888   echo "configure: failed program was:" >&5
10889   cat conftest.$ac_ext >&5
10890   rm -fr conftest*
10891   ac_cv_sizeof_int=0
10892 fi
10893 rm -fr conftest*
10894 fi
10895
10896 fi
10897 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
10898 cat >> confdefs.h <<EOF
10899 #define SIZEOF_INT $ac_cv_sizeof_int
10900 EOF
10901
10902  
10903         echo $ac_n "checking size of long""... $ac_c" 1>&6
10904 echo "configure:10905: checking size of long" >&5
10905 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
10906   echo $ac_n "(cached) $ac_c" 1>&6
10907 else
10908   if test "$cross_compiling" = yes; then
10909     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10910 else
10911   cat > conftest.$ac_ext <<EOF
10912 #line 10913 "configure"
10913 #include "confdefs.h"
10914 #include <stdio.h>
10915 main()
10916 {
10917   FILE *f=fopen("conftestval", "w");
10918   if (!f) exit(1);
10919   fprintf(f, "%d\n", sizeof(long));
10920   exit(0);
10921 }
10922 EOF
10923 if { (eval echo configure:10924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10924 then
10925   ac_cv_sizeof_long=`cat conftestval`
10926 else
10927   echo "configure: failed program was:" >&5
10928   cat conftest.$ac_ext >&5
10929   rm -fr conftest*
10930   ac_cv_sizeof_long=0
10931 fi
10932 rm -fr conftest*
10933 fi
10934
10935 fi
10936 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
10937 cat >> confdefs.h <<EOF
10938 #define SIZEOF_LONG $ac_cv_sizeof_long
10939 EOF
10940
10941
10942 fi
10943
10944 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
10945 echo "configure:10946: checking for 8-bit clean memcmp" >&5
10946 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
10947   echo $ac_n "(cached) $ac_c" 1>&6
10948 else
10949   if test "$cross_compiling" = yes; then
10950   ac_cv_func_memcmp_clean=no
10951 else
10952   cat > conftest.$ac_ext <<EOF
10953 #line 10954 "configure"
10954 #include "confdefs.h"
10955
10956 main()
10957 {
10958   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
10959   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
10960 }
10961
10962 EOF
10963 if { (eval echo configure:10964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10964 then
10965   ac_cv_func_memcmp_clean=yes
10966 else
10967   echo "configure: failed program was:" >&5
10968   cat conftest.$ac_ext >&5
10969   rm -fr conftest*
10970   ac_cv_func_memcmp_clean=no
10971 fi
10972 rm -fr conftest*
10973 fi
10974
10975 fi
10976
10977 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
10978 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
10979
10980 echo $ac_n "checking for strftime""... $ac_c" 1>&6
10981 echo "configure:10982: checking for strftime" >&5
10982 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
10983   echo $ac_n "(cached) $ac_c" 1>&6
10984 else
10985   cat > conftest.$ac_ext <<EOF
10986 #line 10987 "configure"
10987 #include "confdefs.h"
10988 /* System header to define __stub macros and hopefully few prototypes,
10989     which can conflict with char strftime(); below.  */
10990 #include <assert.h>
10991 /* Override any gcc2 internal prototype to avoid an error.  */
10992 /* We use char because int might match the return type of a gcc2
10993     builtin and then its argument prototype would still apply.  */
10994 char strftime();
10995
10996 int main() {
10997
10998 /* The GNU C library defines this for functions which it implements
10999     to always fail with ENOSYS.  Some functions are actually named
11000     something starting with __ and the normal name is an alias.  */
11001 #if defined (__stub_strftime) || defined (__stub___strftime)
11002 choke me
11003 #else
11004 strftime();
11005 #endif
11006
11007 ; return 0; }
11008 EOF
11009 if { (eval echo configure:11010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11010   rm -rf conftest*
11011   eval "ac_cv_func_strftime=yes"
11012 else
11013   echo "configure: failed program was:" >&5
11014   cat conftest.$ac_ext >&5
11015   rm -rf conftest*
11016   eval "ac_cv_func_strftime=no"
11017 fi
11018 rm -f conftest*
11019 fi
11020
11021 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
11022   echo "$ac_t""yes" 1>&6
11023   cat >> confdefs.h <<\EOF
11024 #define HAVE_STRFTIME 1
11025 EOF
11026
11027 else
11028   echo "$ac_t""no" 1>&6
11029 # strftime is in -lintl on SCO UNIX.
11030 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
11031 echo "configure:11032: checking for strftime in -lintl" >&5
11032 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
11033 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
11034   echo $ac_n "(cached) $ac_c" 1>&6
11035 else
11036   ac_save_LIBS="$LIBS"
11037 LIBS="-lintl  $LIBS"
11038 cat > conftest.$ac_ext <<EOF
11039 #line 11040 "configure"
11040 #include "confdefs.h"
11041 /* Override any gcc2 internal prototype to avoid an error.  */
11042 /* We use char because int might match the return type of a gcc2
11043     builtin and then its argument prototype would still apply.  */
11044 char strftime();
11045
11046 int main() {
11047 strftime()
11048 ; return 0; }
11049 EOF
11050 if { (eval echo configure:11051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11051   rm -rf conftest*
11052   eval "ac_cv_lib_$ac_lib_var=yes"
11053 else
11054   echo "configure: failed program was:" >&5
11055   cat conftest.$ac_ext >&5
11056   rm -rf conftest*
11057   eval "ac_cv_lib_$ac_lib_var=no"
11058 fi
11059 rm -f conftest*
11060 LIBS="$ac_save_LIBS"
11061
11062 fi
11063 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11064   echo "$ac_t""yes" 1>&6
11065   cat >> confdefs.h <<\EOF
11066 #define HAVE_STRFTIME 1
11067 EOF
11068
11069 LIBS="-lintl $LIBS"
11070 else
11071   echo "$ac_t""no" 1>&6
11072 fi
11073
11074 fi
11075
11076
11077 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
11078 echo "configure:11079: checking for vprintf" >&5
11079 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
11080   echo $ac_n "(cached) $ac_c" 1>&6
11081 else
11082   cat > conftest.$ac_ext <<EOF
11083 #line 11084 "configure"
11084 #include "confdefs.h"
11085 /* System header to define __stub macros and hopefully few prototypes,
11086     which can conflict with char vprintf(); below.  */
11087 #include <assert.h>
11088 /* Override any gcc2 internal prototype to avoid an error.  */
11089 /* We use char because int might match the return type of a gcc2
11090     builtin and then its argument prototype would still apply.  */
11091 char vprintf();
11092
11093 int main() {
11094
11095 /* The GNU C library defines this for functions which it implements
11096     to always fail with ENOSYS.  Some functions are actually named
11097     something starting with __ and the normal name is an alias.  */
11098 #if defined (__stub_vprintf) || defined (__stub___vprintf)
11099 choke me
11100 #else
11101 vprintf();
11102 #endif
11103
11104 ; return 0; }
11105 EOF
11106 if { (eval echo configure:11107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11107   rm -rf conftest*
11108   eval "ac_cv_func_vprintf=yes"
11109 else
11110   echo "configure: failed program was:" >&5
11111   cat conftest.$ac_ext >&5
11112   rm -rf conftest*
11113   eval "ac_cv_func_vprintf=no"
11114 fi
11115 rm -f conftest*
11116 fi
11117
11118 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
11119   echo "$ac_t""yes" 1>&6
11120   cat >> confdefs.h <<\EOF
11121 #define HAVE_VPRINTF 1
11122 EOF
11123
11124 else
11125   echo "$ac_t""no" 1>&6
11126 fi
11127
11128 if test "$ac_cv_func_vprintf" != yes; then
11129 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
11130 echo "configure:11131: checking for _doprnt" >&5
11131 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
11132   echo $ac_n "(cached) $ac_c" 1>&6
11133 else
11134   cat > conftest.$ac_ext <<EOF
11135 #line 11136 "configure"
11136 #include "confdefs.h"
11137 /* System header to define __stub macros and hopefully few prototypes,
11138     which can conflict with char _doprnt(); below.  */
11139 #include <assert.h>
11140 /* Override any gcc2 internal prototype to avoid an error.  */
11141 /* We use char because int might match the return type of a gcc2
11142     builtin and then its argument prototype would still apply.  */
11143 char _doprnt();
11144
11145 int main() {
11146
11147 /* The GNU C library defines this for functions which it implements
11148     to always fail with ENOSYS.  Some functions are actually named
11149     something starting with __ and the normal name is an alias.  */
11150 #if defined (__stub__doprnt) || defined (__stub____doprnt)
11151 choke me
11152 #else
11153 _doprnt();
11154 #endif
11155
11156 ; return 0; }
11157 EOF
11158 if { (eval echo configure:11159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11159   rm -rf conftest*
11160   eval "ac_cv_func__doprnt=yes"
11161 else
11162   echo "configure: failed program was:" >&5
11163   cat conftest.$ac_ext >&5
11164   rm -rf conftest*
11165   eval "ac_cv_func__doprnt=no"
11166 fi
11167 rm -f conftest*
11168 fi
11169
11170 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
11171   echo "$ac_t""yes" 1>&6
11172   cat >> confdefs.h <<\EOF
11173 #define HAVE_DOPRNT 1
11174 EOF
11175
11176 else
11177   echo "$ac_t""no" 1>&6
11178 fi
11179
11180 fi
11181
11182
11183 if test $ac_cv_func_vprintf = yes ; then
11184                 for ac_func in vsnprintf vsprintf
11185 do
11186 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11187 echo "configure:11188: checking for $ac_func" >&5
11188 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11189   echo $ac_n "(cached) $ac_c" 1>&6
11190 else
11191   cat > conftest.$ac_ext <<EOF
11192 #line 11193 "configure"
11193 #include "confdefs.h"
11194 /* System header to define __stub macros and hopefully few prototypes,
11195     which can conflict with char $ac_func(); below.  */
11196 #include <assert.h>
11197 /* Override any gcc2 internal prototype to avoid an error.  */
11198 /* We use char because int might match the return type of a gcc2
11199     builtin and then its argument prototype would still apply.  */
11200 char $ac_func();
11201
11202 int main() {
11203
11204 /* The GNU C library defines this for functions which it implements
11205     to always fail with ENOSYS.  Some functions are actually named
11206     something starting with __ and the normal name is an alias.  */
11207 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11208 choke me
11209 #else
11210 $ac_func();
11211 #endif
11212
11213 ; return 0; }
11214 EOF
11215 if { (eval echo configure:11216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11216   rm -rf conftest*
11217   eval "ac_cv_func_$ac_func=yes"
11218 else
11219   echo "configure: failed program was:" >&5
11220   cat conftest.$ac_ext >&5
11221   rm -rf conftest*
11222   eval "ac_cv_func_$ac_func=no"
11223 fi
11224 rm -f conftest*
11225 fi
11226
11227 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11228   echo "$ac_t""yes" 1>&6
11229     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11230   cat >> confdefs.h <<EOF
11231 #define $ac_tr_func 1
11232 EOF
11233  
11234 else
11235   echo "$ac_t""no" 1>&6
11236 fi
11237 done
11238
11239 fi
11240
11241 for ac_func in \
11242         bcopy                   \
11243         endgrent                \
11244         endpwent                \
11245         flock                   \
11246         getdtablesize   \
11247         getgrgid                \
11248         gethostname             \
11249         getpass                 \
11250         getpwuid                \
11251         gettimeofday    \
11252         initgroups              \
11253         lockf                   \
11254         memcpy                  \
11255         memmove                 \
11256         mkstemp                 \
11257         recv                    \
11258         recvfrom                \
11259         setpwfile               \
11260         setgid                  \
11261         setegid                 \
11262         setsid                  \
11263         setuid                  \
11264         seteuid                 \
11265         signal                  \
11266         sigset                  \
11267         snprintf                \
11268         strdup                  \
11269         strerror                \
11270         strpbrk                 \
11271         strrchr                 \
11272         strsep                  \
11273         strstr                  \
11274         strtol                  \
11275         strtoul                 \
11276         strspn                  \
11277         sysconf                 \
11278         waitpid                 \
11279         wait4                   \
11280
11281 do
11282 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11283 echo "configure:11284: checking for $ac_func" >&5
11284 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11285   echo $ac_n "(cached) $ac_c" 1>&6
11286 else
11287   cat > conftest.$ac_ext <<EOF
11288 #line 11289 "configure"
11289 #include "confdefs.h"
11290 /* System header to define __stub macros and hopefully few prototypes,
11291     which can conflict with char $ac_func(); below.  */
11292 #include <assert.h>
11293 /* Override any gcc2 internal prototype to avoid an error.  */
11294 /* We use char because int might match the return type of a gcc2
11295     builtin and then its argument prototype would still apply.  */
11296 char $ac_func();
11297
11298 int main() {
11299
11300 /* The GNU C library defines this for functions which it implements
11301     to always fail with ENOSYS.  Some functions are actually named
11302     something starting with __ and the normal name is an alias.  */
11303 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11304 choke me
11305 #else
11306 $ac_func();
11307 #endif
11308
11309 ; return 0; }
11310 EOF
11311 if { (eval echo configure:11312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11312   rm -rf conftest*
11313   eval "ac_cv_func_$ac_func=yes"
11314 else
11315   echo "configure: failed program was:" >&5
11316   cat conftest.$ac_ext >&5
11317   rm -rf conftest*
11318   eval "ac_cv_func_$ac_func=no"
11319 fi
11320 rm -f conftest*
11321 fi
11322
11323 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11324   echo "$ac_t""yes" 1>&6
11325     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11326   cat >> confdefs.h <<EOF
11327 #define $ac_tr_func 1
11328 EOF
11329  
11330 else
11331   echo "$ac_t""no" 1>&6
11332 fi
11333 done
11334
11335
11336 for ac_func in getopt tempnam
11337 do
11338 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11339 echo "configure:11340: checking for $ac_func" >&5
11340 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11341   echo $ac_n "(cached) $ac_c" 1>&6
11342 else
11343   cat > conftest.$ac_ext <<EOF
11344 #line 11345 "configure"
11345 #include "confdefs.h"
11346 /* System header to define __stub macros and hopefully few prototypes,
11347     which can conflict with char $ac_func(); below.  */
11348 #include <assert.h>
11349 /* Override any gcc2 internal prototype to avoid an error.  */
11350 /* We use char because int might match the return type of a gcc2
11351     builtin and then its argument prototype would still apply.  */
11352 char $ac_func();
11353
11354 int main() {
11355
11356 /* The GNU C library defines this for functions which it implements
11357     to always fail with ENOSYS.  Some functions are actually named
11358     something starting with __ and the normal name is an alias.  */
11359 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11360 choke me
11361 #else
11362 $ac_func();
11363 #endif
11364
11365 ; return 0; }
11366 EOF
11367 if { (eval echo configure:11368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11368   rm -rf conftest*
11369   eval "ac_cv_func_$ac_func=yes"
11370 else
11371   echo "configure: failed program was:" >&5
11372   cat conftest.$ac_ext >&5
11373   rm -rf conftest*
11374   eval "ac_cv_func_$ac_func=no"
11375 fi
11376 rm -f conftest*
11377 fi
11378
11379 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11380   echo "$ac_t""yes" 1>&6
11381     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11382   cat >> confdefs.h <<EOF
11383 #define $ac_tr_func 1
11384 EOF
11385  
11386 else
11387   echo "$ac_t""no" 1>&6
11388 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
11389 fi
11390 done
11391
11392
11393
11394 # Check Configuration
11395
11396 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
11397 echo "configure:11398: checking declaration of sys_errlist" >&5
11398 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
11399   echo $ac_n "(cached) $ac_c" 1>&6
11400 else
11401   
11402         cat > conftest.$ac_ext <<EOF
11403 #line 11404 "configure"
11404 #include "confdefs.h"
11405
11406 #include <stdio.h>
11407 #include <sys/types.h>
11408 #include <errno.h> 
11409 int main() {
11410 char *c = (char *) *sys_errlist
11411 ; return 0; }
11412 EOF
11413 if { (eval echo configure:11414: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11414   rm -rf conftest*
11415   ol_cv_dcl_sys_errlist=yes
11416 else
11417   echo "configure: failed program was:" >&5
11418   cat conftest.$ac_ext >&5
11419   rm -rf conftest*
11420   ol_cv_dcl_sys_errlist=no
11421 fi
11422 rm -f conftest*
11423 fi
11424
11425 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
11426 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
11427 if test $ol_cv_dcl_sys_errlist = no ; then
11428         cat >> confdefs.h <<\EOF
11429 #define DECL_SYS_ERRLIST 1
11430 EOF
11431
11432         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
11433 echo "configure:11434: checking existence of sys_errlist" >&5
11434         if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
11435   echo $ac_n "(cached) $ac_c" 1>&6
11436 else
11437   
11438                 cat > conftest.$ac_ext <<EOF
11439 #line 11440 "configure"
11440 #include "confdefs.h"
11441 #include <errno.h>
11442 int main() {
11443 char *c = (char *) *sys_errlist
11444 ; return 0; }
11445 EOF
11446 if { (eval echo configure:11447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11447   rm -rf conftest*
11448   ol_cv_have_sys_errlist=yes
11449 else
11450   echo "configure: failed program was:" >&5
11451   cat conftest.$ac_ext >&5
11452   rm -rf conftest*
11453   ol_cv_have_sys_errlist=no
11454 fi
11455 rm -f conftest*
11456 fi
11457
11458         echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
11459         if test $ol_cv_have_sys_errlist = yes ; then
11460                 cat >> confdefs.h <<\EOF
11461 #define HAVE_SYS_ERRLIST 1
11462 EOF
11463
11464         fi
11465 fi
11466
11467
11468
11469 if test "$ol_enable_debug" != no ; then
11470         cat >> confdefs.h <<\EOF
11471 #define LDAP_DEBUG 1
11472 EOF
11473
11474 fi
11475 if test "$ol_enable_syslog" = yes ; then
11476         cat >> confdefs.h <<\EOF
11477 #define LDAP_SYSLOG 1
11478 EOF
11479
11480 fi
11481 if test "$ol_enable_libui" = yes ; then
11482         cat >> confdefs.h <<\EOF
11483 #define LDAP_LIBUI 1
11484 EOF
11485
11486 fi
11487 if test "$ol_enable_cache" = no ; then
11488         cat >> confdefs.h <<\EOF
11489 #define LDAP_NOCACHE 1
11490 EOF
11491
11492 fi
11493 if test "$ol_enable_dns" != no ; then
11494         cat >> confdefs.h <<\EOF
11495 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS LDAP_VENDOR_VERSION
11496 EOF
11497
11498 fi
11499 if test "$ol_enable_proctitle" != no ; then
11500         cat >> confdefs.h <<\EOF
11501 #define LDAP_PROCTITLE 1
11502 EOF
11503
11504 fi
11505 if test "$ol_enable_referrals" != no ; then
11506         cat >> confdefs.h <<\EOF
11507 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
11508 EOF
11509
11510 fi
11511 if test "$ol_enable_cldap" != no ; then
11512         cat >> confdefs.h <<\EOF
11513 #define LDAP_CONNECTIONLESS 1
11514 EOF
11515
11516 fi
11517
11518 if test "$ol_enable_aclgroups" != no ; then
11519         cat >> confdefs.h <<\EOF
11520 #define SLAPD_ACLGROUPS 1
11521 EOF
11522
11523 fi
11524 if test "$ol_enable_crypt" != no ; then
11525         cat >> confdefs.h <<\EOF
11526 #define SLAPD_CRYPT 1
11527 EOF
11528
11529 fi
11530 if test "$ol_enable_cleartext" != no ; then
11531         cat >> confdefs.h <<\EOF
11532 #define SLAPD_CLEARTEXT 1
11533 EOF
11534
11535 fi
11536 if test "$ol_enable_phonetic" != no ; then
11537         cat >> confdefs.h <<\EOF
11538 #define SLAPD_PHONETIC 1
11539 EOF
11540
11541 fi
11542 if test "$ol_enable_rlookups" != no ; then
11543         cat >> confdefs.h <<\EOF
11544 #define SLAPD_RLOOKUPS 1
11545 EOF
11546
11547 fi
11548
11549 if test "$ol_link_modules" != no ; then
11550         cat >> confdefs.h <<\EOF
11551 #define SLAPD_MODULES 1
11552 EOF
11553
11554         BUILD_SLAPD=yes
11555 fi
11556
11557 if test "$ol_link_bdb2" != no ; then
11558         cat >> confdefs.h <<\EOF
11559 #define SLAPD_BDB2 1
11560 EOF
11561
11562         BUILD_SLAPD=yes
11563         BUILD_BDB2=yes
11564 fi
11565
11566 if test "$ol_enable_ldap" != no ; then
11567         cat >> confdefs.h <<\EOF
11568 #define SLAPD_LDAP 1
11569 EOF
11570
11571         BUILD_SLAPD=yes
11572         BUILD_LDAP=yes
11573 fi
11574
11575 if test "$ol_link_ldbm" != no ; then
11576         cat >> confdefs.h <<\EOF
11577 #define SLAPD_LDBM 1
11578 EOF
11579
11580         BUILD_SLAPD=yes
11581         BUILD_LDBM=yes
11582 fi
11583
11584 if test "$ol_enable_passwd" != no ; then
11585         cat >> confdefs.h <<\EOF
11586 #define SLAPD_PASSWD 1
11587 EOF
11588
11589         BUILD_SLAPD=yes
11590         BUILD_PASSWD=yes
11591 fi
11592
11593 if test "$ol_link_perl" != no ; then
11594         cat >> confdefs.h <<\EOF
11595 #define SLAPD_PERL 1
11596 EOF
11597
11598         BUILD_SLAPD=yes
11599         BUILD_PERL=yes
11600 fi
11601
11602 if test "$ol_enable_shell" != no ; then
11603         cat >> confdefs.h <<\EOF
11604 #define SLAPD_SHELL 1
11605 EOF
11606
11607         BUILD_SLAPD=yes
11608         BUILD_SHELL=yes
11609 fi
11610
11611 if test "$ol_enable_tcl" != no ; then
11612         cat >> confdefs.h <<\EOF
11613 #define SLAPD_TCL 1
11614 EOF
11615
11616         BUILD_SLAPD=yes
11617         BUILD_TCL=yes
11618 fi
11619
11620 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
11621         $BUILD_SLAPD = yes ; then
11622         BUILD_SLURPD=yes
11623 fi
11624
11625 if test "$ol_link_isode" != no ; then
11626         BUILD_LDAPD=yes
11627 fi
11628
11629
11630
11631
11632   
11633   
11634   
11635   
11636   
11637   
11638   
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661 trap '' 1 2 15
11662
11663 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
11664
11665 test "x$prefix" = xNONE && prefix=$ac_default_prefix
11666 # Let make expand exec_prefix.
11667 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
11668
11669 # Any assignment to VPATH causes Sun make to only execute
11670 # the first set of double-colon rules, so remove it if not needed.
11671 # If there is a colon in the path, we need to keep it.
11672 if test "x$srcdir" = x.; then
11673   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
11674 fi
11675
11676 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
11677
11678 DEFS=-DHAVE_CONFIG_H
11679
11680 # Without the "./", some shells look in PATH for config.status.
11681 : ${CONFIG_STATUS=./config.status}
11682
11683 echo creating $CONFIG_STATUS
11684 rm -f $CONFIG_STATUS
11685 cat > $CONFIG_STATUS <<EOF
11686 #! /bin/sh
11687 # Generated automatically by configure.
11688 # Run this file to recreate the current configuration.
11689 # This directory was configured as follows,
11690 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
11691 #
11692 # $0 $ac_configure_args
11693 #
11694 # Compiler output produced by configure, useful for debugging
11695 # configure, is in ./config.log if it exists.
11696
11697 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
11698 for ac_option
11699 do
11700   case "\$ac_option" in
11701   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
11702     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
11703     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
11704   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
11705     echo "$CONFIG_STATUS generated by autoconf version 2.13"
11706     exit 0 ;;
11707   -help | --help | --hel | --he | --h)
11708     echo "\$ac_cs_usage"; exit 0 ;;
11709   *) echo "\$ac_cs_usage"; exit 1 ;;
11710   esac
11711 done
11712
11713 ac_given_srcdir=$srcdir
11714 ac_given_INSTALL="$INSTALL"
11715
11716 trap 'rm -fr `echo "\
11717 Makefile:build/top.mk:Makefile.in:build/dir.mk \
11718 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
11719 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
11720 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
11721 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
11722 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
11723 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
11724 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
11725 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
11726 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
11727 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
11728 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
11729 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
11730 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
11731 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
11732 include/Makefile:build/top.mk:include/Makefile.in \
11733 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
11734 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
11735 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11736 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11737 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
11738 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
11739 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
11740 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
11741 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
11742 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
11743 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
11744 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
11745 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \
11746 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
11747 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
11748 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
11749 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
11750 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
11751 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
11752 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
11753 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
11754 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
11755 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
11756 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
11757 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
11758 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
11759  include/portable.h include/ldap_features.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
11760 EOF
11761 cat >> $CONFIG_STATUS <<EOF
11762
11763 # Protect against being on the right side of a sed subst in config.status.
11764 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
11765  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
11766 $ac_vpsub
11767 $extrasub
11768 s%@SHELL@%$SHELL%g
11769 s%@CFLAGS@%$CFLAGS%g
11770 s%@CPPFLAGS@%$CPPFLAGS%g
11771 s%@CXXFLAGS@%$CXXFLAGS%g
11772 s%@FFLAGS@%$FFLAGS%g
11773 s%@DEFS@%$DEFS%g
11774 s%@LDFLAGS@%$LDFLAGS%g
11775 s%@LIBS@%$LIBS%g
11776 s%@exec_prefix@%$exec_prefix%g
11777 s%@prefix@%$prefix%g
11778 s%@program_transform_name@%$program_transform_name%g
11779 s%@bindir@%$bindir%g
11780 s%@sbindir@%$sbindir%g
11781 s%@libexecdir@%$libexecdir%g
11782 s%@datadir@%$datadir%g
11783 s%@sysconfdir@%$sysconfdir%g
11784 s%@sharedstatedir@%$sharedstatedir%g
11785 s%@localstatedir@%$localstatedir%g
11786 s%@libdir@%$libdir%g
11787 s%@includedir@%$includedir%g
11788 s%@oldincludedir@%$oldincludedir%g
11789 s%@infodir@%$infodir%g
11790 s%@mandir@%$mandir%g
11791 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
11792 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
11793 s%@INSTALL_DATA@%$INSTALL_DATA%g
11794 s%@PACKAGE@%$PACKAGE%g
11795 s%@VERSION@%$VERSION%g
11796 s%@ACLOCAL@%$ACLOCAL%g
11797 s%@AUTOCONF@%$AUTOCONF%g
11798 s%@AUTOMAKE@%$AUTOMAKE%g
11799 s%@AUTOHEADER@%$AUTOHEADER%g
11800 s%@MAKEINFO@%$MAKEINFO%g
11801 s%@SET_MAKE@%$SET_MAKE%g
11802 s%@top_builddir@%$top_builddir%g
11803 s%@ldap_subdir@%$ldap_subdir%g
11804 s%@CC@%$CC%g
11805 s%@host@%$host%g
11806 s%@host_alias@%$host_alias%g
11807 s%@host_cpu@%$host_cpu%g
11808 s%@host_vendor@%$host_vendor%g
11809 s%@host_os@%$host_os%g
11810 s%@RANLIB@%$RANLIB%g
11811 s%@LD@%$LD%g
11812 s%@NM@%$NM%g
11813 s%@LN_S@%$LN_S%g
11814 s%@LIBTOOL@%$LIBTOOL%g
11815 s%@AWK@%$AWK%g
11816 s%@LN_H@%$LN_H%g
11817 s%@SENDMAIL@%$SENDMAIL%g
11818 s%@EDITOR@%$EDITOR%g
11819 s%@FINGER@%$FINGER%g
11820 s%@GLIBCONFIG@%$GLIBCONFIG%g
11821 s%@PERLBIN@%$PERLBIN%g
11822 s%@CPP@%$CPP%g
11823 s%@EXEEXT@%$EXEEXT%g
11824 s%@OBJEXT@%$OBJEXT%g
11825 s%@OL_MKDEP@%$OL_MKDEP%g
11826 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
11827 s%@PEPSY@%$PEPSY%g
11828 s%@LIBOBJS@%$LIBOBJS%g
11829 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
11830 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
11831 s%@BUILD_BDB2@%$BUILD_BDB2%g
11832 s%@BUILD_LDAP@%$BUILD_LDAP%g
11833 s%@BUILD_LDBM@%$BUILD_LDBM%g
11834 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
11835 s%@BUILD_PERL@%$BUILD_PERL%g
11836 s%@BUILD_SHELL@%$BUILD_SHELL%g
11837 s%@BUILD_TCL@%$BUILD_TCL%g
11838 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
11839 s%@LDAP_LIBS@%$LDAP_LIBS%g
11840 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
11841 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
11842 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
11843 s%@LDBM_LIBS@%$LDBM_LIBS%g
11844 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
11845 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
11846 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
11847 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
11848 s%@SLAPD_PERL_CPPFLAGS@%$SLAPD_PERL_CPPFLAGS%g
11849 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
11850 s%@KRB_LIBS@%$KRB_LIBS%g
11851 s%@READLINE_LIBS@%$READLINE_LIBS%g
11852 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
11853 s%@TLS_LIBS@%$TLS_LIBS%g
11854
11855 CEOF
11856 EOF
11857
11858 cat >> $CONFIG_STATUS <<\EOF
11859
11860 # Split the substitutions into bite-sized pieces for seds with
11861 # small command number limits, like on Digital OSF/1 and HP-UX.
11862 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
11863 ac_file=1 # Number of current file.
11864 ac_beg=1 # First line for current file.
11865 ac_end=$ac_max_sed_cmds # Line after last line for current file.
11866 ac_more_lines=:
11867 ac_sed_cmds=""
11868 while $ac_more_lines; do
11869   if test $ac_beg -gt 1; then
11870     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
11871   else
11872     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
11873   fi
11874   if test ! -s conftest.s$ac_file; then
11875     ac_more_lines=false
11876     rm -f conftest.s$ac_file
11877   else
11878     if test -z "$ac_sed_cmds"; then
11879       ac_sed_cmds="sed -f conftest.s$ac_file"
11880     else
11881       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
11882     fi
11883     ac_file=`expr $ac_file + 1`
11884     ac_beg=$ac_end
11885     ac_end=`expr $ac_end + $ac_max_sed_cmds`
11886   fi
11887 done
11888 if test -z "$ac_sed_cmds"; then
11889   ac_sed_cmds=cat
11890 fi
11891 EOF
11892
11893 cat >> $CONFIG_STATUS <<EOF
11894
11895 CONFIG_FILES=\${CONFIG_FILES-"\
11896 Makefile:build/top.mk:Makefile.in:build/dir.mk \
11897 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
11898 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
11899 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
11900 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
11901 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
11902 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
11903 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
11904 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
11905 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
11906 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
11907 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
11908 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
11909 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
11910 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
11911 include/Makefile:build/top.mk:include/Makefile.in \
11912 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
11913 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
11914 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11915 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11916 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
11917 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
11918 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
11919 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
11920 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
11921 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
11922 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
11923 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
11924 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \
11925 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
11926 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
11927 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
11928 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
11929 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
11930 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
11931 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
11932 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
11933 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
11934 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
11935 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
11936 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
11937 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
11938 "}
11939 EOF
11940 cat >> $CONFIG_STATUS <<\EOF
11941 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
11942   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
11943   case "$ac_file" in
11944   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
11945        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
11946   *) ac_file_in="${ac_file}.in" ;;
11947   esac
11948
11949   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
11950
11951   # Remove last slash and all that follows it.  Not all systems have dirname.
11952   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
11953   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
11954     # The file is in a subdirectory.
11955     test ! -d "$ac_dir" && mkdir "$ac_dir"
11956     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
11957     # A "../" for each directory in $ac_dir_suffix.
11958     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
11959   else
11960     ac_dir_suffix= ac_dots=
11961   fi
11962
11963   case "$ac_given_srcdir" in
11964   .)  srcdir=.
11965       if test -z "$ac_dots"; then top_srcdir=.
11966       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
11967   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
11968   *) # Relative path.
11969     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
11970     top_srcdir="$ac_dots$ac_given_srcdir" ;;
11971   esac
11972
11973   case "$ac_given_INSTALL" in
11974   [/$]*) INSTALL="$ac_given_INSTALL" ;;
11975   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
11976   esac
11977
11978   echo creating "$ac_file"
11979   rm -f "$ac_file"
11980   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
11981   case "$ac_file" in
11982   *Makefile*) ac_comsub="1i\\
11983 # $configure_input" ;;
11984   *) ac_comsub= ;;
11985   esac
11986
11987   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
11988   sed -e "$ac_comsub
11989 s%@configure_input@%$configure_input%g
11990 s%@srcdir@%$srcdir%g
11991 s%@top_srcdir@%$top_srcdir%g
11992 s%@INSTALL@%$INSTALL%g
11993 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
11994 fi; done
11995 rm -f conftest.s*
11996
11997 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
11998 # NAME is the cpp macro being defined and VALUE is the value it is being given.
11999 #
12000 # ac_d sets the value in "#define NAME VALUE" lines.
12001 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
12002 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
12003 ac_dC='\3'
12004 ac_dD='%g'
12005 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
12006 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12007 ac_uB='\([      ]\)%\1#\2define\3'
12008 ac_uC=' '
12009 ac_uD='\4%g'
12010 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
12011 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12012 ac_eB='$%\1#\2define\3'
12013 ac_eC=' '
12014 ac_eD='%g'
12015
12016 if test "${CONFIG_HEADERS+set}" != set; then
12017 EOF
12018 cat >> $CONFIG_STATUS <<EOF
12019   CONFIG_HEADERS="include/portable.h include/ldap_features.h"
12020 EOF
12021 cat >> $CONFIG_STATUS <<\EOF
12022 fi
12023 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
12024   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12025   case "$ac_file" in
12026   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
12027        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
12028   *) ac_file_in="${ac_file}.in" ;;
12029   esac
12030
12031   echo creating $ac_file
12032
12033   rm -f conftest.frag conftest.in conftest.out
12034   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
12035   cat $ac_file_inputs > conftest.in
12036
12037 EOF
12038
12039 # Transform confdefs.h into a sed script conftest.vals that substitutes
12040 # the proper values into config.h.in to produce config.h.  And first:
12041 # Protect against being on the right side of a sed subst in config.status.
12042 # Protect against being in an unquoted here document in config.status.
12043 rm -f conftest.vals
12044 cat > conftest.hdr <<\EOF
12045 s/[\\&%]/\\&/g
12046 s%[\\$`]%\\&%g
12047 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
12048 s%ac_d%ac_u%gp
12049 s%ac_u%ac_e%gp
12050 EOF
12051 sed -n -f conftest.hdr confdefs.h > conftest.vals
12052 rm -f conftest.hdr
12053
12054 # This sed command replaces #undef with comments.  This is necessary, for
12055 # example, in the case of _POSIX_SOURCE, which is predefined and required
12056 # on some systems where configure will not decide to define it.
12057 cat >> conftest.vals <<\EOF
12058 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
12059 EOF
12060
12061 # Break up conftest.vals because some shells have a limit on
12062 # the size of here documents, and old seds have small limits too.
12063
12064 rm -f conftest.tail
12065 while :
12066 do
12067   ac_lines=`grep -c . conftest.vals`
12068   # grep -c gives empty output for an empty file on some AIX systems.
12069   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
12070   # Write a limited-size here document to conftest.frag.
12071   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
12072   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
12073   echo 'CEOF
12074   sed -f conftest.frag conftest.in > conftest.out
12075   rm -f conftest.in
12076   mv conftest.out conftest.in
12077 ' >> $CONFIG_STATUS
12078   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
12079   rm -f conftest.vals
12080   mv conftest.tail conftest.vals
12081 done
12082 rm -f conftest.vals
12083
12084 cat >> $CONFIG_STATUS <<\EOF
12085   rm -f conftest.frag conftest.h
12086   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
12087   cat conftest.in >> conftest.h
12088   rm -f conftest.in
12089   if cmp -s $ac_file conftest.h 2>/dev/null; then
12090     echo "$ac_file is unchanged"
12091     rm -f conftest.h
12092   else
12093     # Remove last slash and all that follows it.  Not all systems have dirname.
12094       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
12095       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12096       # The file is in a subdirectory.
12097       test ! -d "$ac_dir" && mkdir "$ac_dir"
12098     fi
12099     rm -f $ac_file
12100     mv conftest.h $ac_file
12101   fi
12102 fi; done
12103
12104 EOF
12105 cat >> $CONFIG_STATUS <<EOF
12106
12107 EOF
12108 cat >> $CONFIG_STATUS <<\EOF
12109
12110 date > stamp-h
12111 echo Please \"make depend\" to build dependencies
12112
12113 exit 0
12114 EOF
12115 chmod +x $CONFIG_STATUS
12116 rm -fr confdefs* $ac_clean_files
12117 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
12118