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