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