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