]> git.sur5r.net Git - openldap/blob - configure
99b79ca4cddf57b3a512c0e5a76b4b51d2f85424
[openldap] / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.12 
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-proctitle    enable proctitle support (yes)"
21 ac_help="$ac_help
22   --enable-libui        enable library user interface (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   --with-kerberos       use Kerberos (auto)"
35 ac_help="$ac_help
36   --with-threads        use threads (auto)"
37 ac_help="$ac_help
38   --with-yielding-select        with implicitly yielding select (auto)"
39 ac_help="$ac_help
40 LDAPD Options:"
41 ac_help="$ac_help
42   --enable-ldapd        enable building ldapd (no)"
43 ac_help="$ac_help
44 SLAPD Options:"
45 ac_help="$ac_help
46   --enable-slapd        enable building slapd (yes)"
47 ac_help="$ac_help
48     --enable-aclgroups  enable ACL group support (auto)"
49 ac_help="$ac_help
50     --enable-cleartext  enable cleartext passwords (yes)"
51 ac_help="$ac_help
52     --enable-crypt      enable crypt(3) passwords (auto)"
53 ac_help="$ac_help
54     --enable-wrappers   enable tcp wrapper support (no)"
55 ac_help="$ac_help
56     --enable-phonetic   enable phonetic/soundex (no)"
57 ac_help="$ac_help
58     --enable-rlookups   enable reverse lookups (auto)"
59 ac_help="$ac_help
60     --enable-ldbm       enable ldbm backend (yes)"
61 ac_help="$ac_help
62       --with-ldbm-api   use LDBM API (auto)"
63 ac_help="$ac_help
64       --with-ldbm-type  use LDBM type (auto)"
65 ac_help="$ac_help
66     --enable-passwd     enable passwd backend (no)"
67 ac_help="$ac_help
68     --enable-shell      enable shell backend (no)"
69 ac_help="$ac_help
70 SLURPD Options:"
71 ac_help="$ac_help
72   --enable-slurpd       enable building slurpd (auto)"
73 ac_help="$ac_help
74 Library Generation & Linking Options"
75 ac_help="$ac_help
76   --enable-static         build static libraries [default=yes]
77   --enable-static=PKGS    only build shared libraries if the current package
78                           appears as an element in the PKGS list"
79 ac_help="$ac_help
80   --enable-shared         build shared libraries [default=yes]
81   --enable-shared=PKGS    only build shared libraries if the current package
82                           appears as an element in the PKGS list"
83 ac_help="$ac_help
84   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
85
86 # Initialize some variables set by options.
87 # The variables have the same names as the options, with
88 # dashes changed to underlines.
89 build=NONE
90 cache_file=./config.cache
91 exec_prefix=NONE
92 host=NONE
93 no_create=
94 nonopt=NONE
95 no_recursion=
96 prefix=NONE
97 program_prefix=NONE
98 program_suffix=NONE
99 program_transform_name=s,x,x,
100 silent=
101 site=
102 srcdir=
103 target=NONE
104 verbose=
105 x_includes=NONE
106 x_libraries=NONE
107 bindir='${exec_prefix}/bin'
108 sbindir='${exec_prefix}/sbin'
109 libexecdir='${exec_prefix}/libexec'
110 datadir='${prefix}/share'
111 sysconfdir='${prefix}/etc'
112 sharedstatedir='${prefix}/com'
113 localstatedir='${prefix}/var'
114 libdir='${exec_prefix}/lib'
115 includedir='${prefix}/include'
116 oldincludedir='/usr/include'
117 infodir='${prefix}/info'
118 mandir='${prefix}/man'
119
120 # Initialize some other variables.
121 subdirs=
122 MFLAGS= MAKEFLAGS=
123 # Maximum number of lines to put in a shell here document.
124 ac_max_here_lines=12
125
126 ac_prev=
127 for ac_option
128 do
129
130   # If the previous option needs an argument, assign it.
131   if test -n "$ac_prev"; then
132     eval "$ac_prev=\$ac_option"
133     ac_prev=
134     continue
135   fi
136
137   case "$ac_option" in
138   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
139   *) ac_optarg= ;;
140   esac
141
142   # Accept the important Cygnus configure options, so we can diagnose typos.
143
144   case "$ac_option" in
145
146   -bindir | --bindir | --bindi | --bind | --bin | --bi)
147     ac_prev=bindir ;;
148   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
149     bindir="$ac_optarg" ;;
150
151   -build | --build | --buil | --bui | --bu)
152     ac_prev=build ;;
153   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
154     build="$ac_optarg" ;;
155
156   -cache-file | --cache-file | --cache-fil | --cache-fi \
157   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
158     ac_prev=cache_file ;;
159   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
160   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
161     cache_file="$ac_optarg" ;;
162
163   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
164     ac_prev=datadir ;;
165   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
166   | --da=*)
167     datadir="$ac_optarg" ;;
168
169   -disable-* | --disable-*)
170     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
171     # Reject names that are not valid shell variable names.
172     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
173       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
174     fi
175     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
176     eval "enable_${ac_feature}=no" ;;
177
178   -enable-* | --enable-*)
179     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
180     # Reject names that are not valid shell variable names.
181     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
182       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
183     fi
184     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
185     case "$ac_option" in
186       *=*) ;;
187       *) ac_optarg=yes ;;
188     esac
189     eval "enable_${ac_feature}='$ac_optarg'" ;;
190
191   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
192   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
193   | --exec | --exe | --ex)
194     ac_prev=exec_prefix ;;
195   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
196   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
197   | --exec=* | --exe=* | --ex=*)
198     exec_prefix="$ac_optarg" ;;
199
200   -gas | --gas | --ga | --g)
201     # Obsolete; use --with-gas.
202     with_gas=yes ;;
203
204   -help | --help | --hel | --he)
205     # Omit some internal or obsolete options to make the list less imposing.
206     # This message is too long to be a string in the A/UX 3.1 sh.
207     cat << EOF
208 Usage: configure [options] [host]
209 Options: [defaults in brackets after descriptions]
210 Configuration:
211   --cache-file=FILE       cache test results in FILE
212   --help                  print this message
213   --no-create             do not create output files
214   --quiet, --silent       do not print \`checking...' messages
215   --version               print the version of autoconf that created configure
216 Directory and file names:
217   --prefix=PREFIX         install architecture-independent files in PREFIX
218                           [$ac_default_prefix]
219   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
220                           [same as prefix]
221   --bindir=DIR            user executables in DIR [EPREFIX/bin]
222   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
223   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
224   --datadir=DIR           read-only architecture-independent data in DIR
225                           [PREFIX/share]
226   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
227   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
228                           [PREFIX/com]
229   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
230   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
231   --includedir=DIR        C header files in DIR [PREFIX/include]
232   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
233   --infodir=DIR           info documentation in DIR [PREFIX/info]
234   --mandir=DIR            man documentation in DIR [PREFIX/man]
235   --srcdir=DIR            find the sources in DIR [configure dir or ..]
236   --program-prefix=PREFIX prepend PREFIX to installed program names
237   --program-suffix=SUFFIX append SUFFIX to installed program names
238   --program-transform-name=PROGRAM
239                           run sed PROGRAM on installed program names
240 EOF
241     cat << EOF
242 Host type:
243   --build=BUILD           configure for building on BUILD [BUILD=HOST]
244   --host=HOST             configure for HOST [guessed]
245   --target=TARGET         configure for TARGET [TARGET=HOST]
246 Features and packages:
247   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
248   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
249   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
250   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
251   --x-includes=DIR        X include files are in DIR
252   --x-libraries=DIR       X library files are in DIR
253 EOF
254     if test -n "$ac_help"; then
255       echo "--enable and --with options recognized:$ac_help"
256     fi
257     exit 0 ;;
258
259   -host | --host | --hos | --ho)
260     ac_prev=host ;;
261   -host=* | --host=* | --hos=* | --ho=*)
262     host="$ac_optarg" ;;
263
264   -includedir | --includedir | --includedi | --included | --include \
265   | --includ | --inclu | --incl | --inc)
266     ac_prev=includedir ;;
267   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
268   | --includ=* | --inclu=* | --incl=* | --inc=*)
269     includedir="$ac_optarg" ;;
270
271   -infodir | --infodir | --infodi | --infod | --info | --inf)
272     ac_prev=infodir ;;
273   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
274     infodir="$ac_optarg" ;;
275
276   -libdir | --libdir | --libdi | --libd)
277     ac_prev=libdir ;;
278   -libdir=* | --libdir=* | --libdi=* | --libd=*)
279     libdir="$ac_optarg" ;;
280
281   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
282   | --libexe | --libex | --libe)
283     ac_prev=libexecdir ;;
284   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
285   | --libexe=* | --libex=* | --libe=*)
286     libexecdir="$ac_optarg" ;;
287
288   -localstatedir | --localstatedir | --localstatedi | --localstated \
289   | --localstate | --localstat | --localsta | --localst \
290   | --locals | --local | --loca | --loc | --lo)
291     ac_prev=localstatedir ;;
292   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
293   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
294   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
295     localstatedir="$ac_optarg" ;;
296
297   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
298     ac_prev=mandir ;;
299   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
300     mandir="$ac_optarg" ;;
301
302   -nfp | --nfp | --nf)
303     # Obsolete; use --without-fp.
304     with_fp=no ;;
305
306   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
307   | --no-cr | --no-c)
308     no_create=yes ;;
309
310   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
311   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
312     no_recursion=yes ;;
313
314   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
315   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
316   | --oldin | --oldi | --old | --ol | --o)
317     ac_prev=oldincludedir ;;
318   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
319   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
320   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
321     oldincludedir="$ac_optarg" ;;
322
323   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
324     ac_prev=prefix ;;
325   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
326     prefix="$ac_optarg" ;;
327
328   -program-prefix | --program-prefix | --program-prefi | --program-pref \
329   | --program-pre | --program-pr | --program-p)
330     ac_prev=program_prefix ;;
331   -program-prefix=* | --program-prefix=* | --program-prefi=* \
332   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
333     program_prefix="$ac_optarg" ;;
334
335   -program-suffix | --program-suffix | --program-suffi | --program-suff \
336   | --program-suf | --program-su | --program-s)
337     ac_prev=program_suffix ;;
338   -program-suffix=* | --program-suffix=* | --program-suffi=* \
339   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
340     program_suffix="$ac_optarg" ;;
341
342   -program-transform-name | --program-transform-name \
343   | --program-transform-nam | --program-transform-na \
344   | --program-transform-n | --program-transform- \
345   | --program-transform | --program-transfor \
346   | --program-transfo | --program-transf \
347   | --program-trans | --program-tran \
348   | --progr-tra | --program-tr | --program-t)
349     ac_prev=program_transform_name ;;
350   -program-transform-name=* | --program-transform-name=* \
351   | --program-transform-nam=* | --program-transform-na=* \
352   | --program-transform-n=* | --program-transform-=* \
353   | --program-transform=* | --program-transfor=* \
354   | --program-transfo=* | --program-transf=* \
355   | --program-trans=* | --program-tran=* \
356   | --progr-tra=* | --program-tr=* | --program-t=*)
357     program_transform_name="$ac_optarg" ;;
358
359   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
360   | -silent | --silent | --silen | --sile | --sil)
361     silent=yes ;;
362
363   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
364     ac_prev=sbindir ;;
365   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
366   | --sbi=* | --sb=*)
367     sbindir="$ac_optarg" ;;
368
369   -sharedstatedir | --sharedstatedir | --sharedstatedi \
370   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
371   | --sharedst | --shareds | --shared | --share | --shar \
372   | --sha | --sh)
373     ac_prev=sharedstatedir ;;
374   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
375   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
376   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
377   | --sha=* | --sh=*)
378     sharedstatedir="$ac_optarg" ;;
379
380   -site | --site | --sit)
381     ac_prev=site ;;
382   -site=* | --site=* | --sit=*)
383     site="$ac_optarg" ;;
384
385   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
386     ac_prev=srcdir ;;
387   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
388     srcdir="$ac_optarg" ;;
389
390   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
391   | --syscon | --sysco | --sysc | --sys | --sy)
392     ac_prev=sysconfdir ;;
393   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
394   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
395     sysconfdir="$ac_optarg" ;;
396
397   -target | --target | --targe | --targ | --tar | --ta | --t)
398     ac_prev=target ;;
399   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
400     target="$ac_optarg" ;;
401
402   -v | -verbose | --verbose | --verbos | --verbo | --verb)
403     verbose=yes ;;
404
405   -version | --version | --versio | --versi | --vers)
406     echo "configure generated by autoconf version 2.12"
407     exit 0 ;;
408
409   -with-* | --with-*)
410     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
411     # Reject names that are not valid shell variable names.
412     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
413       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
414     fi
415     ac_package=`echo $ac_package| sed 's/-/_/g'`
416     case "$ac_option" in
417       *=*) ;;
418       *) ac_optarg=yes ;;
419     esac
420     eval "with_${ac_package}='$ac_optarg'" ;;
421
422   -without-* | --without-*)
423     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
424     # Reject names that are not valid shell variable names.
425     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
426       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
427     fi
428     ac_package=`echo $ac_package| sed 's/-/_/g'`
429     eval "with_${ac_package}=no" ;;
430
431   --x)
432     # Obsolete; use --with-x.
433     with_x=yes ;;
434
435   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
436   | --x-incl | --x-inc | --x-in | --x-i)
437     ac_prev=x_includes ;;
438   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
439   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
440     x_includes="$ac_optarg" ;;
441
442   -x-libraries | --x-libraries | --x-librarie | --x-librari \
443   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
444     ac_prev=x_libraries ;;
445   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
446   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
447     x_libraries="$ac_optarg" ;;
448
449   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
450     ;;
451
452   *)
453     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
454       echo "configure: warning: $ac_option: invalid host type" 1>&2
455     fi
456     if test "x$nonopt" != xNONE; then
457       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
458     fi
459     nonopt="$ac_option"
460     ;;
461
462   esac
463 done
464
465 if test -n "$ac_prev"; then
466   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
467 fi
468
469 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
470
471 # File descriptor usage:
472 # 0 standard input
473 # 1 file creation
474 # 2 errors and warnings
475 # 3 some systems may open it to /dev/tty
476 # 4 used on the Kubota Titan
477 # 6 checking for... messages and results
478 # 5 compiler messages saved in config.log
479 if test "$silent" = yes; then
480   exec 6>/dev/null
481 else
482   exec 6>&1
483 fi
484 exec 5>./config.log
485
486 echo "\
487 This file contains any messages produced by compilers while
488 running configure, to aid debugging if configure makes a mistake.
489 " 1>&5
490
491 # Strip out --no-create and --no-recursion so they do not pile up.
492 # Also quote any args containing shell metacharacters.
493 ac_configure_args=
494 for ac_arg
495 do
496   case "$ac_arg" in
497   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
498   | --no-cr | --no-c) ;;
499   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
500   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
501   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
502   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
503   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
504   esac
505 done
506
507 # NLS nuisances.
508 # Only set these to C if already set.  These must not be set unconditionally
509 # because not all systems understand e.g. LANG=C (notably SCO).
510 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
511 # Non-C LC_CTYPE values break the ctype check.
512 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
513 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
514 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
515 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
516
517 # confdefs.h avoids OS command line length limits that DEFS can exceed.
518 rm -rf conftest* confdefs.h
519 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
520 echo > confdefs.h
521
522 # A filename unique to this package, relative to the directory that
523 # configure is in, which we can look for to find out if srcdir is correct.
524 ac_unique_file=include/ldap.h
525
526 # Find the source files, if location was not specified.
527 if test -z "$srcdir"; then
528   ac_srcdir_defaulted=yes
529   # Try the directory containing this script, then its parent.
530   ac_prog=$0
531   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
532   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
533   srcdir=$ac_confdir
534   if test ! -r $srcdir/$ac_unique_file; then
535     srcdir=..
536   fi
537 else
538   ac_srcdir_defaulted=no
539 fi
540 if test ! -r $srcdir/$ac_unique_file; then
541   if test "$ac_srcdir_defaulted" = yes; then
542     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
543   else
544     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
545   fi
546 fi
547 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
548
549 # Prefer explicitly selected file to automatically selected ones.
550 if test -z "$CONFIG_SITE"; then
551   if test "x$prefix" != xNONE; then
552     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
553   else
554     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
555   fi
556 fi
557 for ac_site_file in $CONFIG_SITE; do
558   if test -r "$ac_site_file"; then
559     echo "loading site script $ac_site_file"
560     . "$ac_site_file"
561   fi
562 done
563
564 if test -r "$cache_file"; then
565   echo "loading cache $cache_file"
566   . $cache_file
567 else
568   echo "creating cache $cache_file"
569   > $cache_file
570 fi
571
572 ac_ext=c
573 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
574 ac_cpp='$CPP $CPPFLAGS'
575 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
576 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
577 cross_compiling=$ac_cv_prog_cc_cross
578
579 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
580   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
581   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
582     ac_n= ac_c='
583 ' ac_t='        '
584   else
585     ac_n=-n ac_c= ac_t=
586   fi
587 else
588   ac_n= ac_c='\c' ac_t=
589 fi
590
591 ac_aux_dir=
592 for ac_dir in build $srcdir/build; do
593   if test -f $ac_dir/install-sh; then
594     ac_aux_dir=$ac_dir
595     ac_install_sh="$ac_aux_dir/install-sh -c"
596     break
597   elif test -f $ac_dir/install.sh; then
598     ac_aux_dir=$ac_dir
599     ac_install_sh="$ac_aux_dir/install.sh -c"
600     break
601   fi
602 done
603 if test -z "$ac_aux_dir"; then
604   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
605 fi
606 ac_config_guess=$ac_aux_dir/config.guess
607 ac_config_sub=$ac_aux_dir/config.sub
608 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
609 # Find a good install program.  We prefer a C program (faster),
610 # so one script is as good as another.  But avoid the broken or
611 # incompatible versions:
612 # SysV /etc/install, /usr/sbin/install
613 # SunOS /usr/etc/install
614 # IRIX /sbin/install
615 # AIX /bin/install
616 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
617 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
618 # ./install, which can be erroneously created by make from ./install.sh.
619 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
620 echo "configure:621: checking for a BSD compatible install" >&5
621 if test -z "$INSTALL"; then
622 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
623   echo $ac_n "(cached) $ac_c" 1>&6
624 else
625     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
626   for ac_dir in $PATH; do
627     # Account for people who put trailing slashes in PATH elements.
628     case "$ac_dir/" in
629     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
630     *)
631       # OSF1 and SCO ODT 3.0 have their own names for install.
632       for ac_prog in ginstall installbsd scoinst install; do
633         if test -f $ac_dir/$ac_prog; then
634           if test $ac_prog = install &&
635             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
636             # AIX install.  It has an incompatible calling convention.
637             # OSF/1 installbsd also uses dspmsg, but is usable.
638             :
639           else
640             ac_cv_path_install="$ac_dir/$ac_prog -c"
641             break 2
642           fi
643         fi
644       done
645       ;;
646     esac
647   done
648   IFS="$ac_save_IFS"
649
650 fi
651   if test "${ac_cv_path_install+set}" = set; then
652     INSTALL="$ac_cv_path_install"
653   else
654     # As a last resort, use the slow shell script.  We don't cache a
655     # path for INSTALL within a source directory, because that will
656     # break other packages using the cache if that directory is
657     # removed, or if the path is relative.
658     INSTALL="$ac_install_sh"
659   fi
660 fi
661 echo "$ac_t""$INSTALL" 1>&6
662
663 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
664 # It thinks the first close brace ends the variable substitution.
665 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
666
667 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
668
669
670 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
671
672 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
673 echo "configure:674: checking whether build environment is sane" >&5
674 # Just in case
675 sleep 1
676 echo timestamp > conftestfile
677 # Do `set' in a subshell so we don't clobber the current shell's
678 # arguments.  Must try -L first in case configure is actually a
679 # symlink; some systems play weird games with the mod time of symlinks
680 # (eg FreeBSD returns the mod time of the symlink's containing
681 # directory).
682 if (
683    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
684    if test "$*" = "X"; then
685       # -L didn't work.
686       set X `ls -t $srcdir/configure conftestfile`
687    fi
688    if test "$*" != "X $srcdir/configure conftestfile" \
689       && test "$*" != "X conftestfile $srcdir/configure"; then
690
691       # If neither matched, then we have a broken ls.  This can happen
692       # if, for instance, CONFIG_SHELL is bash and it inherits a
693       # broken ls alias from the environment.  This has actually
694       # happened.  Such a system could not be considered "sane".
695       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
696 alias in your environment" 1>&2; exit 1; }
697    fi
698
699    test "$2" = conftestfile
700    )
701 then
702    # Ok.
703    :
704 else
705    { echo "configure: error: newly created file is older than distributed files!
706 Check your system clock" 1>&2; exit 1; }
707 fi
708 rm -f conftest*
709 echo "$ac_t""yes" 1>&6
710 if test "$program_transform_name" = s,x,x,; then
711   program_transform_name=
712 else
713   # Double any \ or $.  echo might interpret backslashes.
714   cat <<\EOF_SED > conftestsed
715 s,\\,\\\\,g; s,\$,$$,g
716 EOF_SED
717   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
718   rm -f conftestsed
719 fi
720 test "$program_prefix" != NONE &&
721   program_transform_name="s,^,${program_prefix},; $program_transform_name"
722 # Use a double $ so make ignores it.
723 test "$program_suffix" != NONE &&
724   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
725
726 # sed with no file args requires a program.
727 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
728
729 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
730 echo "configure:731: checking whether ${MAKE-make} sets \${MAKE}" >&5
731 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
732 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
733   echo $ac_n "(cached) $ac_c" 1>&6
734 else
735   cat > conftestmake <<\EOF
736 all:
737         @echo 'ac_maketemp="${MAKE}"'
738 EOF
739 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
740 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
741 if test -n "$ac_maketemp"; then
742   eval ac_cv_prog_make_${ac_make}_set=yes
743 else
744   eval ac_cv_prog_make_${ac_make}_set=no
745 fi
746 rm -f conftestmake
747 fi
748 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
749   echo "$ac_t""yes" 1>&6
750   SET_MAKE=
751 else
752   echo "$ac_t""no" 1>&6
753   SET_MAKE="MAKE=${MAKE-make}"
754 fi
755
756
757 PACKAGE=OpenLDAP
758
759 VERSION=2.0-devel
760
761 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
762   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
763 fi
764
765
766
767 missing_dir=`cd $ac_aux_dir && pwd`
768 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
769 echo "configure:770: checking for working aclocal" >&5
770 # Run test in a subshell; some versions of sh will print an error if
771 # an executable is not found, even if stderr is redirected.
772 # Redirect stdin to placate older versions of autoconf.  Sigh.
773 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
774    ACLOCAL=aclocal
775    echo "$ac_t""found" 1>&6
776 else
777    ACLOCAL="$missing_dir/missing aclocal"
778    echo "$ac_t""missing" 1>&6
779 fi
780
781 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
782 echo "configure:783: checking for working autoconf" >&5
783 # Run test in a subshell; some versions of sh will print an error if
784 # an executable is not found, even if stderr is redirected.
785 # Redirect stdin to placate older versions of autoconf.  Sigh.
786 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
787    AUTOCONF=autoconf
788    echo "$ac_t""found" 1>&6
789 else
790    AUTOCONF="$missing_dir/missing autoconf"
791    echo "$ac_t""missing" 1>&6
792 fi
793
794 echo $ac_n "checking for working automake""... $ac_c" 1>&6
795 echo "configure:796: checking for working automake" >&5
796 # Run test in a subshell; some versions of sh will print an error if
797 # an executable is not found, even if stderr is redirected.
798 # Redirect stdin to placate older versions of autoconf.  Sigh.
799 if (automake --version) < /dev/null > /dev/null 2>&1; then
800    AUTOMAKE=automake
801    echo "$ac_t""found" 1>&6
802 else
803    AUTOMAKE="$missing_dir/missing automake"
804    echo "$ac_t""missing" 1>&6
805 fi
806
807 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
808 echo "configure:809: checking for working autoheader" >&5
809 # Run test in a subshell; some versions of sh will print an error if
810 # an executable is not found, even if stderr is redirected.
811 # Redirect stdin to placate older versions of autoconf.  Sigh.
812 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
813    AUTOHEADER=autoheader
814    echo "$ac_t""found" 1>&6
815 else
816    AUTOHEADER="$missing_dir/missing autoheader"
817    echo "$ac_t""missing" 1>&6
818 fi
819
820 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
821 echo "configure:822: checking for working makeinfo" >&5
822 # Run test in a subshell; some versions of sh will print an error if
823 # an executable is not found, even if stderr is redirected.
824 # Redirect stdin to placate older versions of autoconf.  Sigh.
825 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
826    MAKEINFO=makeinfo
827    echo "$ac_t""found" 1>&6
828 else
829    MAKEINFO="$missing_dir/missing makeinfo"
830    echo "$ac_t""missing" 1>&6
831 fi
832
833
834
835
836 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
837 echo "configure:838: checking configure arguments" >&5
838
839
840 top_builddir=`pwd`
841
842 ldap_subdir="openldap"
843
844 # Check whether --with-subdir or --without-subdir was given.
845 if test "${with_subdir+set}" = set; then
846   withval="$with_subdir"
847   
848         if test "$withval" = "no"; then
849                 ldap_subdir=""
850         elif test "$withval" != "yes"; then
851                 ldap_subdir="$withval"
852         fi
853
854 fi
855
856
857 # OpenLDAP --enable-debug
858         # Check whether --enable-debug or --disable-debug was given.
859 if test "${enable_debug+set}" = set; then
860   enableval="$enable_debug"
861   
862         ol_arg=invalid
863         for ol_val in auto yes no ; do
864                 if test "$enableval" = "$ol_val" ; then
865                         ol_arg="$ol_val"
866                 fi
867         done
868         if test "$ol_arg" = "invalid" ; then
869                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
870         fi
871         ol_enable_debug="$ol_arg"
872
873 else
874         ol_enable_debug="yes"
875 fi
876 # end --enable-debug
877 # OpenLDAP --enable-proctitle
878         # Check whether --enable-proctitle or --disable-proctitle was given.
879 if test "${enable_proctitle+set}" = set; then
880   enableval="$enable_proctitle"
881   
882         ol_arg=invalid
883         for ol_val in auto yes no ; do
884                 if test "$enableval" = "$ol_val" ; then
885                         ol_arg="$ol_val"
886                 fi
887         done
888         if test "$ol_arg" = "invalid" ; then
889                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
890         fi
891         ol_enable_proctitle="$ol_arg"
892
893 else
894         ol_enable_proctitle="yes"
895 fi
896 # end --enable-proctitle
897 # OpenLDAP --enable-libui
898         # Check whether --enable-libui or --disable-libui was given.
899 if test "${enable_libui+set}" = set; then
900   enableval="$enable_libui"
901   
902         ol_arg=invalid
903         for ol_val in auto yes no ; do
904                 if test "$enableval" = "$ol_val" ; then
905                         ol_arg="$ol_val"
906                 fi
907         done
908         if test "$ol_arg" = "invalid" ; then
909                 { echo "configure: error: bad value $enableval for --enable-libui" 1>&2; exit 1; }
910         fi
911         ol_enable_libui="$ol_arg"
912
913 else
914         ol_enable_libui="yes"
915 fi
916 # end --enable-libui
917 # OpenLDAP --enable-cache
918         # Check whether --enable-cache or --disable-cache was given.
919 if test "${enable_cache+set}" = set; then
920   enableval="$enable_cache"
921   
922         ol_arg=invalid
923         for ol_val in auto yes no ; do
924                 if test "$enableval" = "$ol_val" ; then
925                         ol_arg="$ol_val"
926                 fi
927         done
928         if test "$ol_arg" = "invalid" ; then
929                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
930         fi
931         ol_enable_cache="$ol_arg"
932
933 else
934         ol_enable_cache="yes"
935 fi
936 # end --enable-cache
937 # OpenLDAP --enable-dns
938         # Check whether --enable-dns or --disable-dns was given.
939 if test "${enable_dns+set}" = set; then
940   enableval="$enable_dns"
941   
942         ol_arg=invalid
943         for ol_val in auto yes no ; do
944                 if test "$enableval" = "$ol_val" ; then
945                         ol_arg="$ol_val"
946                 fi
947         done
948         if test "$ol_arg" = "invalid" ; then
949                 { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; }
950         fi
951         ol_enable_dns="$ol_arg"
952
953 else
954         ol_enable_dns="no"
955 fi
956 # end --enable-dns
957 # OpenLDAP --enable-referrals
958         # Check whether --enable-referrals or --disable-referrals was given.
959 if test "${enable_referrals+set}" = set; then
960   enableval="$enable_referrals"
961   
962         ol_arg=invalid
963         for ol_val in auto yes no ; do
964                 if test "$enableval" = "$ol_val" ; then
965                         ol_arg="$ol_val"
966                 fi
967         done
968         if test "$ol_arg" = "invalid" ; then
969                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
970         fi
971         ol_enable_referrals="$ol_arg"
972
973 else
974         ol_enable_referrals="yes"
975 fi
976 # end --enable-referrals
977 # OpenLDAP --enable-cldap
978         # Check whether --enable-cldap or --disable-cldap was given.
979 if test "${enable_cldap+set}" = set; then
980   enableval="$enable_cldap"
981   
982         ol_arg=invalid
983         for ol_val in auto yes no ; do
984                 if test "$enableval" = "$ol_val" ; then
985                         ol_arg="$ol_val"
986                 fi
987         done
988         if test "$ol_arg" = "invalid" ; then
989                 { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; }
990         fi
991         ol_enable_cldap="$ol_arg"
992
993 else
994         ol_enable_cldap="no"
995 fi
996 # end --enable-cldap
997 # OpenLDAP --enable-x_compile
998         # Check whether --enable-x_compile or --disable-x_compile was given.
999 if test "${enable_x_compile+set}" = set; then
1000   enableval="$enable_x_compile"
1001   
1002         ol_arg=invalid
1003         for ol_val in yes no ; do
1004                 if test "$enableval" = "$ol_val" ; then
1005                         ol_arg="$ol_val"
1006                 fi
1007         done
1008         if test "$ol_arg" = "invalid" ; then
1009                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1010         fi
1011         ol_enable_x_compile="$ol_arg"
1012
1013 else
1014         ol_enable_x_compile="no"
1015 fi
1016 # end --enable-x_compile
1017
1018 # OpenLDAP --with-kerberos
1019         # Check whether --with-kerberos or --without-kerberos was given.
1020 if test "${with_kerberos+set}" = set; then
1021   withval="$with_kerberos"
1022   
1023         ol_arg=invalid
1024         for ol_val in auto k5 k4 afs yes no ; do
1025                 if test "$withval" = "$ol_val" ; then
1026                         ol_arg="$ol_val"
1027                 fi
1028         done
1029         if test "$ol_arg" = "invalid" ; then
1030                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1031         fi
1032         ol_with_kerberos="$ol_arg"
1033
1034 else
1035         ol_with_kerberos="auto"
1036 fi
1037 # end --with-kerberos
1038
1039 # OpenLDAP --with-threads
1040         # Check whether --with-threads or --without-threads was given.
1041 if test "${with_threads+set}" = set; then
1042   withval="$with_threads"
1043   
1044         ol_arg=invalid
1045         for ol_val in auto posix mach lwp yes no manual  ; do
1046                 if test "$withval" = "$ol_val" ; then
1047                         ol_arg="$ol_val"
1048                 fi
1049         done
1050         if test "$ol_arg" = "invalid" ; then
1051                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1052         fi
1053         ol_with_threads="$ol_arg"
1054
1055 else
1056         ol_with_threads="auto"
1057 fi
1058 # end --with-threads
1059
1060 # OpenLDAP --with-yielding_select
1061         # Check whether --with-yielding_select or --without-yielding_select was given.
1062 if test "${with_yielding_select+set}" = set; then
1063   withval="$with_yielding_select"
1064   
1065         ol_arg=invalid
1066         for ol_val in auto yes no manual  ; do
1067                 if test "$withval" = "$ol_val" ; then
1068                         ol_arg="$ol_val"
1069                 fi
1070         done
1071         if test "$ol_arg" = "invalid" ; then
1072                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1073         fi
1074         ol_with_yielding_select="$ol_arg"
1075
1076 else
1077         ol_with_yielding_select="auto"
1078 fi
1079 # end --with-yielding_select
1080
1081
1082
1083 # Check whether --with-xxldapdoptions or --without-xxldapdoptions was given.
1084 if test "${with_xxldapdoptions+set}" = set; then
1085   withval="$with_xxldapdoptions"
1086   :
1087 fi
1088
1089 # OpenLDAP --enable-ldapd
1090         # Check whether --enable-ldapd or --disable-ldapd was given.
1091 if test "${enable_ldapd+set}" = set; then
1092   enableval="$enable_ldapd"
1093   
1094         ol_arg=invalid
1095         for ol_val in auto yes no ; do
1096                 if test "$enableval" = "$ol_val" ; then
1097                         ol_arg="$ol_val"
1098                 fi
1099         done
1100         if test "$ol_arg" = "invalid" ; then
1101                 { echo "configure: error: bad value $enableval for --enable-ldapd" 1>&2; exit 1; }
1102         fi
1103         ol_enable_ldapd="$ol_arg"
1104
1105 else
1106         ol_enable_ldapd="no"
1107 fi
1108 # end --enable-ldapd
1109
1110 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1111 if test "${with_xxslapdoptions+set}" = set; then
1112   withval="$with_xxslapdoptions"
1113   :
1114 fi
1115
1116 # OpenLDAP --enable-slapd
1117         # Check whether --enable-slapd or --disable-slapd was given.
1118 if test "${enable_slapd+set}" = set; then
1119   enableval="$enable_slapd"
1120   
1121         ol_arg=invalid
1122         for ol_val in auto yes no ; do
1123                 if test "$enableval" = "$ol_val" ; then
1124                         ol_arg="$ol_val"
1125                 fi
1126         done
1127         if test "$ol_arg" = "invalid" ; then
1128                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1129         fi
1130         ol_enable_slapd="$ol_arg"
1131
1132 else
1133         ol_enable_slapd="yes"
1134 fi
1135 # end --enable-slapd
1136 # OpenLDAP --enable-aclgroups
1137         # Check whether --enable-aclgroups or --disable-aclgroups was given.
1138 if test "${enable_aclgroups+set}" = set; then
1139   enableval="$enable_aclgroups"
1140   
1141         ol_arg=invalid
1142         for ol_val in auto yes no ; do
1143                 if test "$enableval" = "$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 $enableval for --enable-aclgroups" 1>&2; exit 1; }
1149         fi
1150         ol_enable_aclgroups="$ol_arg"
1151
1152 else
1153         ol_enable_aclgroups="auto"
1154 fi
1155 # end --enable-aclgroups
1156 # OpenLDAP --enable-cleartext
1157         # Check whether --enable-cleartext or --disable-cleartext was given.
1158 if test "${enable_cleartext+set}" = set; then
1159   enableval="$enable_cleartext"
1160   
1161         ol_arg=invalid
1162         for ol_val in auto yes no ; do
1163                 if test "$enableval" = "$ol_val" ; then
1164                         ol_arg="$ol_val"
1165                 fi
1166         done
1167         if test "$ol_arg" = "invalid" ; then
1168                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1169         fi
1170         ol_enable_cleartext="$ol_arg"
1171
1172 else
1173         ol_enable_cleartext="yes"
1174 fi
1175 # end --enable-cleartext
1176 # OpenLDAP --enable-crypt
1177         # Check whether --enable-crypt or --disable-crypt was given.
1178 if test "${enable_crypt+set}" = set; then
1179   enableval="$enable_crypt"
1180   
1181         ol_arg=invalid
1182         for ol_val in auto yes no ; do
1183                 if test "$enableval" = "$ol_val" ; then
1184                         ol_arg="$ol_val"
1185                 fi
1186         done
1187         if test "$ol_arg" = "invalid" ; then
1188                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1189         fi
1190         ol_enable_crypt="$ol_arg"
1191
1192 else
1193         ol_enable_crypt="auto"
1194 fi
1195 # end --enable-crypt
1196 # OpenLDAP --enable-wrappers
1197         # Check whether --enable-wrappers or --disable-wrappers was given.
1198 if test "${enable_wrappers+set}" = set; then
1199   enableval="$enable_wrappers"
1200   
1201         ol_arg=invalid
1202         for ol_val in auto yes no ; do
1203                 if test "$enableval" = "$ol_val" ; then
1204                         ol_arg="$ol_val"
1205                 fi
1206         done
1207         if test "$ol_arg" = "invalid" ; then
1208                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1209         fi
1210         ol_enable_wrappers="$ol_arg"
1211
1212 else
1213         ol_enable_wrappers="no"
1214 fi
1215 # end --enable-wrappers
1216 # OpenLDAP --enable-phonetic
1217         # Check whether --enable-phonetic or --disable-phonetic was given.
1218 if test "${enable_phonetic+set}" = set; then
1219   enableval="$enable_phonetic"
1220   
1221         ol_arg=invalid
1222         for ol_val in auto yes no ; do
1223                 if test "$enableval" = "$ol_val" ; then
1224                         ol_arg="$ol_val"
1225                 fi
1226         done
1227         if test "$ol_arg" = "invalid" ; then
1228                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1229         fi
1230         ol_enable_phonetic="$ol_arg"
1231
1232 else
1233         ol_enable_phonetic="no"
1234 fi
1235 # end --enable-phonetic
1236 # OpenLDAP --enable-rlookups
1237         # Check whether --enable-rlookups or --disable-rlookups was given.
1238 if test "${enable_rlookups+set}" = set; then
1239   enableval="$enable_rlookups"
1240   
1241         ol_arg=invalid
1242         for ol_val in auto yes no ; do
1243                 if test "$enableval" = "$ol_val" ; then
1244                         ol_arg="$ol_val"
1245                 fi
1246         done
1247         if test "$ol_arg" = "invalid" ; then
1248                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1249         fi
1250         ol_enable_rlookups="$ol_arg"
1251
1252 else
1253         ol_enable_rlookups="auto"
1254 fi
1255 # end --enable-rlookups
1256
1257 # OpenLDAP --enable-ldbm
1258         # Check whether --enable-ldbm or --disable-ldbm was given.
1259 if test "${enable_ldbm+set}" = set; then
1260   enableval="$enable_ldbm"
1261   
1262         ol_arg=invalid
1263         for ol_val in auto yes no ; do
1264                 if test "$enableval" = "$ol_val" ; then
1265                         ol_arg="$ol_val"
1266                 fi
1267         done
1268         if test "$ol_arg" = "invalid" ; then
1269                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1270         fi
1271         ol_enable_ldbm="$ol_arg"
1272
1273 else
1274         ol_enable_ldbm="yes"
1275 fi
1276 # end --enable-ldbm
1277 # OpenLDAP --with-ldbm_api
1278         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1279 if test "${with_ldbm_api+set}" = set; then
1280   withval="$with_ldbm_api"
1281   
1282         ol_arg=invalid
1283         for ol_val in auto db2 db gdbm ndbm manual ; do
1284                 if test "$withval" = "$ol_val" ; then
1285                         ol_arg="$ol_val"
1286                 fi
1287         done
1288         if test "$ol_arg" = "invalid" ; then
1289                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1290         fi
1291         ol_with_ldbm_api="$ol_arg"
1292
1293 else
1294         ol_with_ldbm_api="auto"
1295 fi
1296 # end --with-ldbm_api
1297
1298 # OpenLDAP --with-ldbm_type
1299         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1300 if test "${with_ldbm_type+set}" = set; then
1301   withval="$with_ldbm_type"
1302   
1303         ol_arg=invalid
1304         for ol_val in auto btree hash ; do
1305                 if test "$withval" = "$ol_val" ; then
1306                         ol_arg="$ol_val"
1307                 fi
1308         done
1309         if test "$ol_arg" = "invalid" ; then
1310                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1311         fi
1312         ol_with_ldbm_type="$ol_arg"
1313
1314 else
1315         ol_with_ldbm_type="auto"
1316 fi
1317 # end --with-ldbm_type
1318
1319
1320 # OpenLDAP --enable-passwd
1321         # Check whether --enable-passwd or --disable-passwd was given.
1322 if test "${enable_passwd+set}" = set; then
1323   enableval="$enable_passwd"
1324   
1325         ol_arg=invalid
1326         for ol_val in auto yes no ; do
1327                 if test "$enableval" = "$ol_val" ; then
1328                         ol_arg="$ol_val"
1329                 fi
1330         done
1331         if test "$ol_arg" = "invalid" ; then
1332                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1333         fi
1334         ol_enable_passwd="$ol_arg"
1335
1336 else
1337         ol_enable_passwd="no"
1338 fi
1339 # end --enable-passwd
1340 # OpenLDAP --enable-shell
1341         # Check whether --enable-shell or --disable-shell was given.
1342 if test "${enable_shell+set}" = set; then
1343   enableval="$enable_shell"
1344   
1345         ol_arg=invalid
1346         for ol_val in auto yes no ; do
1347                 if test "$enableval" = "$ol_val" ; then
1348                         ol_arg="$ol_val"
1349                 fi
1350         done
1351         if test "$ol_arg" = "invalid" ; then
1352                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
1353         fi
1354         ol_enable_shell="$ol_arg"
1355
1356 else
1357         ol_enable_shell="no"
1358 fi
1359 # end --enable-shell
1360
1361 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
1362 if test "${with_xxslurpdoptions+set}" = set; then
1363   withval="$with_xxslurpdoptions"
1364   :
1365 fi
1366
1367 # OpenLDAP --enable-slurpd
1368         # Check whether --enable-slurpd or --disable-slurpd was given.
1369 if test "${enable_slurpd+set}" = set; then
1370   enableval="$enable_slurpd"
1371   
1372         ol_arg=invalid
1373         for ol_val in auto yes no ; do
1374                 if test "$enableval" = "$ol_val" ; then
1375                         ol_arg="$ol_val"
1376                 fi
1377         done
1378         if test "$ol_arg" = "invalid" ; then
1379                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
1380         fi
1381         ol_enable_slurpd="$ol_arg"
1382
1383 else
1384         ol_enable_slurpd="auto"
1385 fi
1386 # end --enable-slurpd
1387
1388 # Check whether --with-xxliboptions or --without-xxliboptions was given.
1389 if test "${with_xxliboptions+set}" = set; then
1390   withval="$with_xxliboptions"
1391   :
1392 fi
1393
1394 # Check whether --enable-static or --disable-static was given.
1395 if test "${enable_static+set}" = set; then
1396   enableval="$enable_static"
1397   p=${PACKAGE-default}
1398 case "$enableval" in
1399 yes) enable_static=yes ;;
1400 no) enable_static=no ;;
1401 *)
1402   enable_static=no
1403   # Look at the argument we got.  We use all the common list separators.
1404   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1405   for pkg in $enableval; do
1406     if test "X$pkg" = "X$p"; then
1407       enable_static=yes
1408     fi
1409   done
1410   IFS="$ac_save_ifs"
1411   ;;
1412 esac
1413 else
1414   enable_static=yes
1415 fi
1416
1417 # Check whether --enable-shared or --disable-shared was given.
1418 if test "${enable_shared+set}" = set; then
1419   enableval="$enable_shared"
1420   p=${PACKAGE-default}
1421 case "$enableval" in
1422 yes) enable_shared=yes ;;
1423 no) enable_shared=no ;;
1424 *)
1425   enable_shared=no
1426   # Look at the argument we got.  We use all the common list separators.
1427   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1428   for pkg in $enableval; do
1429     if test "X$pkg" = "X$p"; then
1430       enable_shared=yes
1431     fi
1432   done
1433   IFS="$ac_save_ifs"
1434   ;;
1435 esac
1436 else
1437   enable_shared=yes
1438 fi
1439
1440
1441 # validate options
1442 if test $ol_enable_referrals = no ; then
1443         if test $ol_enable_dns = yes ; then
1444                 echo "configure: warning: dns disabled, ignoring --enable-dns argument" 1>&2
1445         fi
1446         ol_enable_dns=no
1447 fi
1448
1449 if test $ol_enable_slapd = no ; then
1450                 if test $ol_enable_ldbm = yes ; then
1451                 echo "configure: warning: slapd disabled, ignoring --enable_ldbm argument" 1>&2
1452         fi
1453         if test $ol_enable_passwd = yes ; then
1454                 echo "configure: warning: slapd disabled, ignoring --enable_passwd argument" 1>&2
1455         fi
1456         if test $ol_enable_shell = yes ; then
1457                 echo "configure: warning: slapd disabled, ignoring --enable_shell argument" 1>&2
1458         fi
1459         if test $ol_enable_aclgroups = yes ; then
1460                 echo "configure: warning: slapd disabled, ignoring --enable_aclgroups argument" 1>&2
1461         fi
1462         if test $ol_enable_wrappers = yes ; then
1463                 echo "configure: warning: slapd disabled, ignoring --enable_wrappers argument" 1>&2
1464         fi
1465         if test $ol_enable_phonetic = yes ; then
1466                 echo "configure: warning: slapd disabled, ignoring --enable_phonetic argument" 1>&2
1467         fi
1468         if test $ol_enable_rlookups = yes ; then
1469                 echo "configure: warning: slapd disabled, ignoring --enable_rlookups argument" 1>&2
1470         fi
1471         if test $ol_with_ldbm_api != auto ; then
1472                 echo "configure: warning: slapd disabled, ignoring --with_ldbm_api argument" 1>&2
1473         fi
1474         if test $ol_with_ldbm_type != auto ; then
1475                 echo "configure: warning: slapd disabled, ignoring --with_ldbm_type argument" 1>&2
1476         fi
1477         if test $ol_enable_slurpd = yes ; then
1478                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
1479         fi
1480
1481         # force settings to no
1482         ol_enable_ldbm=no
1483         ol_enable_shell=no
1484         ol_enable_passwd=no
1485         ol_enable_aclgroups=no
1486         ol_enable_wrappers=no
1487         ol_enable_phonetic=no
1488         ol_enable_rlookups=no
1489         ol_with_ldbm_api=no
1490         ol_with_ldbm_type=no
1491         ol_enable_slurpd=no
1492
1493 elif test $ol_enable_ldbm = no ; then
1494         
1495         if test $ol_with_ldbm_api != auto ; then
1496                 echo "configure: warning: LDBM disabled, ignoring --with_ldbm_api argument" 1>&2
1497         fi
1498
1499         if test $ol_with_ldbm_type != auto ; then
1500                 echo "configure: warning: LDBM disabled, ignoring --with_ldbm_type argument" 1>&2
1501         fi
1502
1503         if test $ol_enable_passwd = no -a $ol_enable_shell = no ; then
1504                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
1505         fi
1506
1507         ol_with_ldbm_api=no
1508         ol_with_ldbm_type=no
1509
1510 else
1511         
1512         if test $ol_with_ldbm_api = gdbm -a \
1513                 $ol_with_ldbm_type = btree ; then
1514                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
1515         fi
1516         if test $ol_with_ldbm_api = ndbm -a \
1517                 $ol_with_ldbm_type = btree ; then
1518                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
1519         fi
1520 fi
1521
1522 if test $ol_enable_slurpd = yes ; then
1523                 if test $ol_with_threads = no ; then
1524                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
1525         fi
1526 fi
1527
1528 echo "$ac_t""done" 1>&6
1529
1530
1531 # Make sure we can run config.sub.
1532 if $ac_config_sub sun4 >/dev/null 2>&1; then :
1533 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
1534 fi
1535
1536 echo $ac_n "checking host system type""... $ac_c" 1>&6
1537 echo "configure:1538: checking host system type" >&5
1538
1539 host_alias=$host
1540 case "$host_alias" in
1541 NONE)
1542   case $nonopt in
1543   NONE)
1544     if host_alias=`$ac_config_guess`; then :
1545     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
1546     fi ;;
1547   *) host_alias=$nonopt ;;
1548   esac ;;
1549 esac
1550
1551 host=`$ac_config_sub $host_alias`
1552 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1553 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1554 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1555 echo "$ac_t""$host" 1>&6
1556
1557
1558 ## Initialize vars
1559 LDAP_LIBS=
1560 LDBM_LIBS=
1561 LTHREAD_LIBS=
1562 LUTIL_LIBS=
1563
1564 LDAPD_LIBS=
1565 SLAPD_LIBS=
1566 SLURPD_LIBS=
1567
1568 BUILD_LDAPD=no
1569 BUILD_SLAPD=no
1570 BUILD_SLURPD=no
1571
1572 BUILD_LDBM=no
1573 BUILD_PASSWD=no
1574 BUILD_SHELL=no
1575 BUILD_THREAD=no
1576
1577 KRB_LIBS=
1578 TERMCAP_LIBS=
1579
1580
1581 # Find a good install program.  We prefer a C program (faster),
1582 # so one script is as good as another.  But avoid the broken or
1583 # incompatible versions:
1584 # SysV /etc/install, /usr/sbin/install
1585 # SunOS /usr/etc/install
1586 # IRIX /sbin/install
1587 # AIX /bin/install
1588 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1589 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1590 # ./install, which can be erroneously created by make from ./install.sh.
1591 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1592 echo "configure:1593: checking for a BSD compatible install" >&5
1593 if test -z "$INSTALL"; then
1594 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1595   echo $ac_n "(cached) $ac_c" 1>&6
1596 else
1597     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
1598   for ac_dir in $PATH; do
1599     # Account for people who put trailing slashes in PATH elements.
1600     case "$ac_dir/" in
1601     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1602     *)
1603       # OSF1 and SCO ODT 3.0 have their own names for install.
1604       for ac_prog in ginstall installbsd scoinst install; do
1605         if test -f $ac_dir/$ac_prog; then
1606           if test $ac_prog = install &&
1607             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1608             # AIX install.  It has an incompatible calling convention.
1609             # OSF/1 installbsd also uses dspmsg, but is usable.
1610             :
1611           else
1612             ac_cv_path_install="$ac_dir/$ac_prog -c"
1613             break 2
1614           fi
1615         fi
1616       done
1617       ;;
1618     esac
1619   done
1620   IFS="$ac_save_IFS"
1621
1622 fi
1623   if test "${ac_cv_path_install+set}" = set; then
1624     INSTALL="$ac_cv_path_install"
1625   else
1626     # As a last resort, use the slow shell script.  We don't cache a
1627     # path for INSTALL within a source directory, because that will
1628     # break other packages using the cache if that directory is
1629     # removed, or if the path is relative.
1630     INSTALL="$ac_install_sh"
1631   fi
1632 fi
1633 echo "$ac_t""$INSTALL" 1>&6
1634
1635 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1636 # It thinks the first close brace ends the variable substitution.
1637 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1638
1639 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1640
1641 # Extract the first word of "ranlib", so it can be a program name with args.
1642 set dummy ranlib; ac_word=$2
1643 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1644 echo "configure:1645: checking for $ac_word" >&5
1645 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1646   echo $ac_n "(cached) $ac_c" 1>&6
1647 else
1648   if test -n "$RANLIB"; then
1649   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1650 else
1651   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1652   for ac_dir in $PATH; do
1653     test -z "$ac_dir" && ac_dir=.
1654     if test -f $ac_dir/$ac_word; then
1655       ac_cv_prog_RANLIB="ranlib"
1656       break
1657     fi
1658   done
1659   IFS="$ac_save_ifs"
1660   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1661 fi
1662 fi
1663 RANLIB="$ac_cv_prog_RANLIB"
1664 if test -n "$RANLIB"; then
1665   echo "$ac_t""$RANLIB" 1>&6
1666 else
1667   echo "$ac_t""no" 1>&6
1668 fi
1669
1670 # Extract the first word of "gcc", so it can be a program name with args.
1671 set dummy gcc; ac_word=$2
1672 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1673 echo "configure:1674: checking for $ac_word" >&5
1674 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1675   echo $ac_n "(cached) $ac_c" 1>&6
1676 else
1677   if test -n "$CC"; then
1678   ac_cv_prog_CC="$CC" # Let the user override the test.
1679 else
1680   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1681   for ac_dir in $PATH; do
1682     test -z "$ac_dir" && ac_dir=.
1683     if test -f $ac_dir/$ac_word; then
1684       ac_cv_prog_CC="gcc"
1685       break
1686     fi
1687   done
1688   IFS="$ac_save_ifs"
1689 fi
1690 fi
1691 CC="$ac_cv_prog_CC"
1692 if test -n "$CC"; then
1693   echo "$ac_t""$CC" 1>&6
1694 else
1695   echo "$ac_t""no" 1>&6
1696 fi
1697
1698 if test -z "$CC"; then
1699   # Extract the first word of "cc", so it can be a program name with args.
1700 set dummy cc; ac_word=$2
1701 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1702 echo "configure:1703: checking for $ac_word" >&5
1703 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1704   echo $ac_n "(cached) $ac_c" 1>&6
1705 else
1706   if test -n "$CC"; then
1707   ac_cv_prog_CC="$CC" # Let the user override the test.
1708 else
1709   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1710   ac_prog_rejected=no
1711   for ac_dir in $PATH; do
1712     test -z "$ac_dir" && ac_dir=.
1713     if test -f $ac_dir/$ac_word; then
1714       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1715         ac_prog_rejected=yes
1716         continue
1717       fi
1718       ac_cv_prog_CC="cc"
1719       break
1720     fi
1721   done
1722   IFS="$ac_save_ifs"
1723 if test $ac_prog_rejected = yes; then
1724   # We found a bogon in the path, so make sure we never use it.
1725   set dummy $ac_cv_prog_CC
1726   shift
1727   if test $# -gt 0; then
1728     # We chose a different compiler from the bogus one.
1729     # However, it has the same basename, so the bogon will be chosen
1730     # first if we set CC to just the basename; use the full file name.
1731     shift
1732     set dummy "$ac_dir/$ac_word" "$@"
1733     shift
1734     ac_cv_prog_CC="$@"
1735   fi
1736 fi
1737 fi
1738 fi
1739 CC="$ac_cv_prog_CC"
1740 if test -n "$CC"; then
1741   echo "$ac_t""$CC" 1>&6
1742 else
1743   echo "$ac_t""no" 1>&6
1744 fi
1745
1746   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1747 fi
1748
1749 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1750 echo "configure:1751: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1751
1752 ac_ext=c
1753 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1754 ac_cpp='$CPP $CPPFLAGS'
1755 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1756 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1757 cross_compiling=$ac_cv_prog_cc_cross
1758
1759 cat > conftest.$ac_ext <<EOF
1760 #line 1761 "configure"
1761 #include "confdefs.h"
1762 main(){return(0);}
1763 EOF
1764 if { (eval echo configure:1765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1765   ac_cv_prog_cc_works=yes
1766   # If we can't run a trivial program, we are probably using a cross compiler.
1767   if (./conftest; exit) 2>/dev/null; then
1768     ac_cv_prog_cc_cross=no
1769   else
1770     ac_cv_prog_cc_cross=yes
1771   fi
1772 else
1773   echo "configure: failed program was:" >&5
1774   cat conftest.$ac_ext >&5
1775   ac_cv_prog_cc_works=no
1776 fi
1777 rm -fr conftest*
1778
1779 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1780 if test $ac_cv_prog_cc_works = no; then
1781   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1782 fi
1783 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1784 echo "configure:1785: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1785 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1786 cross_compiling=$ac_cv_prog_cc_cross
1787
1788 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1789 echo "configure:1790: checking whether we are using GNU C" >&5
1790 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1791   echo $ac_n "(cached) $ac_c" 1>&6
1792 else
1793   cat > conftest.c <<EOF
1794 #ifdef __GNUC__
1795   yes;
1796 #endif
1797 EOF
1798 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1799: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1799   ac_cv_prog_gcc=yes
1800 else
1801   ac_cv_prog_gcc=no
1802 fi
1803 fi
1804
1805 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1806
1807 if test $ac_cv_prog_gcc = yes; then
1808   GCC=yes
1809   ac_test_CFLAGS="${CFLAGS+set}"
1810   ac_save_CFLAGS="$CFLAGS"
1811   CFLAGS=
1812   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1813 echo "configure:1814: checking whether ${CC-cc} accepts -g" >&5
1814 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1815   echo $ac_n "(cached) $ac_c" 1>&6
1816 else
1817   echo 'void f(){}' > conftest.c
1818 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1819   ac_cv_prog_cc_g=yes
1820 else
1821   ac_cv_prog_cc_g=no
1822 fi
1823 rm -f conftest*
1824
1825 fi
1826
1827 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1828   if test "$ac_test_CFLAGS" = set; then
1829     CFLAGS="$ac_save_CFLAGS"
1830   elif test $ac_cv_prog_cc_g = yes; then
1831     CFLAGS="-g -O2"
1832   else
1833     CFLAGS="-O2"
1834   fi
1835 else
1836   GCC=
1837   test "${CFLAGS+set}" = set || CFLAGS="-g"
1838 fi
1839
1840 # Check whether --with-gnu-ld or --without-gnu-ld was given.
1841 if test "${with_gnu_ld+set}" = set; then
1842   withval="$with_gnu_ld"
1843   test "$withval" = no || with_gnu_ld=yes
1844 else
1845   with_gnu_ld=no
1846 fi
1847
1848
1849 ac_prog=ld
1850 if test "$ac_cv_prog_gcc" = yes; then
1851   # Check if gcc -print-prog-name=ld gives a path.
1852   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
1853 echo "configure:1854: checking for ld used by GCC" >&5
1854   ac_prog=`($CC -print-prog-name=ld) 2>&5`
1855   case "$ac_prog" in
1856   # Accept absolute paths.
1857   /* | A-Za-z:\\*)
1858     test -z "$LD" && LD="$ac_prog"
1859     ;;
1860   "")
1861     # If it fails, then pretend we aren't using GCC.
1862     ac_prog=ld
1863     ;;
1864   *)
1865     # If it is relative, then search for the first ld in PATH.
1866     with_gnu_ld=unknown
1867     ;;
1868   esac
1869 elif test "$with_gnu_ld" = yes; then
1870   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
1871 echo "configure:1872: checking for GNU ld" >&5
1872 else
1873   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
1874 echo "configure:1875: checking for non-GNU ld" >&5
1875 fi
1876 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
1877   echo $ac_n "(cached) $ac_c" 1>&6
1878 else
1879   if test -z "$LD"; then
1880   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1881   for ac_dir in $PATH; do
1882     test -z "$ac_dir" && ac_dir=.
1883     if test -f "$ac_dir/$ac_prog"; then
1884       ac_cv_path_LD="$ac_dir/$ac_prog"
1885       # Check to see if the program is GNU ld.  I'd rather use --version,
1886       # but apparently some GNU ld's only accept -v.
1887       # Break only if it was the GNU/non-GNU ld that we prefer.
1888       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
1889         test "$with_gnu_ld" != no && break
1890       else
1891         test "$with_gnu_ld" != yes && break
1892       fi
1893     fi
1894   done
1895   IFS="$ac_save_ifs"
1896 else
1897   ac_cv_path_LD="$LD" # Let the user override the test with a path.
1898 fi
1899 fi
1900
1901 LD="$ac_cv_path_LD"
1902 if test -n "$LD"; then
1903   echo "$ac_t""$LD" 1>&6
1904 else
1905   echo "$ac_t""no" 1>&6
1906 fi
1907 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
1908
1909 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
1910 echo "configure:1911: checking if the linker ($LD) is GNU ld" >&5
1911 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
1912   echo $ac_n "(cached) $ac_c" 1>&6
1913 else
1914   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
1915 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1916   ac_cv_prog_gnu_ld=yes
1917 else
1918   ac_cv_prog_gnu_ld=no
1919 fi
1920 fi
1921
1922 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
1923
1924
1925 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
1926 echo "configure:1927: checking for BSD-compatible nm" >&5
1927 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
1928   echo $ac_n "(cached) $ac_c" 1>&6
1929 else
1930   case "$NM" in
1931 /* | A-Za-z:\\*)
1932   ac_cv_path_NM="$NM" # Let the user override the test with a path.
1933   ;;
1934 *)
1935   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1936   for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
1937     test -z "$ac_dir" && ac_dir=.
1938     if test -f $ac_dir/nm; then
1939       # Check to see if the nm accepts a BSD-compat flag.
1940       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1941       #   nm: unknown option "B" ignored
1942       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1943         ac_cv_path_NM="$ac_dir/nm -B"
1944       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1945         ac_cv_path_NM="$ac_dir/nm -p"
1946       else
1947         ac_cv_path_NM="$ac_dir/nm"
1948       fi
1949       break
1950     fi
1951   done
1952   IFS="$ac_save_ifs"
1953   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
1954   ;;
1955 esac
1956 fi
1957
1958 NM="$ac_cv_path_NM"
1959 echo "$ac_t""$NM" 1>&6
1960
1961
1962 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
1963 echo "configure:1964: checking whether ln -s works" >&5
1964 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
1965   echo $ac_n "(cached) $ac_c" 1>&6
1966 else
1967   rm -f conftestdata
1968 if ln -s X conftestdata 2>/dev/null
1969 then
1970   rm -f conftestdata
1971   ac_cv_prog_LN_S="ln -s"
1972 else
1973   ac_cv_prog_LN_S=ln
1974 fi
1975 fi
1976 LN_S="$ac_cv_prog_LN_S"
1977 if test "$ac_cv_prog_LN_S" = "ln -s"; then
1978   echo "$ac_t""yes" 1>&6
1979 else
1980   echo "$ac_t""no" 1>&6
1981 fi
1982
1983 # Always use our own libtool.
1984 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1985
1986 # Check for any special flags to pass to ltconfig.
1987 libtool_flags=
1988 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
1989 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
1990 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
1991 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
1992 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
1993
1994 # Some flags need to be propagated to the compiler or linker for good
1995 # libtool support.
1996 case "$host" in
1997 *-*-irix6*)
1998   # Find out which ABI we are using.
1999   echo '#line 2000 "configure"' > conftest.$ac_ext
2000   if { (eval echo configure:2001: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2001     case "`/usr/bin/file conftest.o`" in
2002     *32-bit*)
2003       LD="${LD-ld} -32"
2004       ;;
2005     *N32*)
2006       LD="${LD-ld} -n32"
2007       ;;
2008     *64-bit*)
2009       LD="${LD-ld} -64"
2010       ;;
2011     esac
2012   fi
2013   rm -rf conftest*
2014   ;;
2015
2016 *-*-sco3.2v5*)
2017   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2018   CFLAGS="$CFLAGS -belf"
2019   ;;
2020 esac
2021
2022 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
2023 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
2024 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
2025 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
2026 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
2027 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
2028
2029
2030 # Extract the first word of "sendmail", so it can be a program name with args.
2031 set dummy sendmail; ac_word=$2
2032 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2033 echo "configure:2034: checking for $ac_word" >&5
2034 if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then
2035   echo $ac_n "(cached) $ac_c" 1>&6
2036 else
2037   case "$SENDMAIL" in
2038   /*)
2039   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
2040   ;;
2041   *)
2042   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2043   for ac_dir in $PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc$ac_dummy; do
2044     test -z "$ac_dir" && ac_dir=.
2045     if test -f $ac_dir/$ac_word; then
2046       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
2047       break
2048     fi
2049   done
2050   IFS="$ac_save_ifs"
2051   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
2052   ;;
2053 esac
2054 fi
2055 SENDMAIL="$ac_cv_path_SENDMAIL"
2056 if test -n "$SENDMAIL"; then
2057   echo "$ac_t""$SENDMAIL" 1>&6
2058 else
2059   echo "$ac_t""no" 1>&6
2060 fi
2061
2062 # Extract the first word of "vi", so it can be a program name with args.
2063 set dummy vi; ac_word=$2
2064 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2065 echo "configure:2066: checking for $ac_word" >&5
2066 if eval "test \"`echo '$''{'ac_cv_path_EDITOR'+set}'`\" = set"; then
2067   echo $ac_n "(cached) $ac_c" 1>&6
2068 else
2069   case "$EDITOR" in
2070   /*)
2071   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
2072   ;;
2073   *)
2074   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2075   for ac_dir in $PATH:/usr/ucb$ac_dummy; do
2076     test -z "$ac_dir" && ac_dir=.
2077     if test -f $ac_dir/$ac_word; then
2078       ac_cv_path_EDITOR="$ac_dir/$ac_word"
2079       break
2080     fi
2081   done
2082   IFS="$ac_save_ifs"
2083   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
2084   ;;
2085 esac
2086 fi
2087 EDITOR="$ac_cv_path_EDITOR"
2088 if test -n "$EDITOR"; then
2089   echo "$ac_t""$EDITOR" 1>&6
2090 else
2091   echo "$ac_t""no" 1>&6
2092 fi
2093
2094 # Extract the first word of "finger", so it can be a program name with args.
2095 set dummy finger; ac_word=$2
2096 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2097 echo "configure:2098: checking for $ac_word" >&5
2098 if eval "test \"`echo '$''{'ac_cv_path_FINGER'+set}'`\" = set"; then
2099   echo $ac_n "(cached) $ac_c" 1>&6
2100 else
2101   case "$FINGER" in
2102   /*)
2103   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
2104   ;;
2105   *)
2106   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2107   for ac_dir in $PATH:/usr/ucb$ac_dummy; do
2108     test -z "$ac_dir" && ac_dir=.
2109     if test -f $ac_dir/$ac_word; then
2110       ac_cv_path_FINGER="$ac_dir/$ac_word"
2111       break
2112     fi
2113   done
2114   IFS="$ac_save_ifs"
2115   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
2116   ;;
2117 esac
2118 fi
2119 FINGER="$ac_cv_path_FINGER"
2120 if test -n "$FINGER"; then
2121   echo "$ac_t""$FINGER" 1>&6
2122 else
2123   echo "$ac_t""no" 1>&6
2124 fi
2125
2126
2127
2128 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
2129         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
2130
2131 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
2132         echo "configure: warning: programs compiled here do run here..." 1>&2
2133         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
2134
2135 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
2136         echo "configure: warning: programs compiled here do not run here..." 1>&2
2137         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
2138 fi
2139
2140 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2141 echo "configure:2142: checking how to run the C preprocessor" >&5
2142 # On Suns, sometimes $CPP names a directory.
2143 if test -n "$CPP" && test -d "$CPP"; then
2144   CPP=
2145 fi
2146 if test -z "$CPP"; then
2147 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
2148   echo $ac_n "(cached) $ac_c" 1>&6
2149 else
2150     # This must be in double quotes, not single quotes, because CPP may get
2151   # substituted into the Makefile and "${CC-cc}" will confuse make.
2152   CPP="${CC-cc} -E"
2153   # On the NeXT, cc -E runs the code through the compiler's parser,
2154   # not just through cpp.
2155   cat > conftest.$ac_ext <<EOF
2156 #line 2157 "configure"
2157 #include "confdefs.h"
2158 #include <assert.h>
2159 Syntax Error
2160 EOF
2161 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2162 { (eval echo configure:2163: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2163 ac_err=`grep -v '^ *+' conftest.out`
2164 if test -z "$ac_err"; then
2165   :
2166 else
2167   echo "$ac_err" >&5
2168   echo "configure: failed program was:" >&5
2169   cat conftest.$ac_ext >&5
2170   rm -rf conftest*
2171   CPP="${CC-cc} -E -traditional-cpp"
2172   cat > conftest.$ac_ext <<EOF
2173 #line 2174 "configure"
2174 #include "confdefs.h"
2175 #include <assert.h>
2176 Syntax Error
2177 EOF
2178 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2179 { (eval echo configure:2180: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2180 ac_err=`grep -v '^ *+' conftest.out`
2181 if test -z "$ac_err"; then
2182   :
2183 else
2184   echo "$ac_err" >&5
2185   echo "configure: failed program was:" >&5
2186   cat conftest.$ac_ext >&5
2187   rm -rf conftest*
2188   CPP=/lib/cpp
2189 fi
2190 rm -f conftest*
2191 fi
2192 rm -f conftest*
2193   ac_cv_prog_CPP="$CPP"
2194 fi
2195   CPP="$ac_cv_prog_CPP"
2196 else
2197   ac_cv_prog_CPP="$CPP"
2198 fi
2199 echo "$ac_t""$CPP" 1>&6
2200
2201
2202 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2203 echo "configure:2204: checking for AIX" >&5
2204 cat > conftest.$ac_ext <<EOF
2205 #line 2206 "configure"
2206 #include "confdefs.h"
2207 #ifdef _AIX
2208   yes
2209 #endif
2210
2211 EOF
2212 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2213   egrep "yes" >/dev/null 2>&1; then
2214   rm -rf conftest*
2215   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
2216 #define _ALL_SOURCE 1
2217 EOF
2218
2219 else
2220   rm -rf conftest*
2221   echo "$ac_t""no" 1>&6
2222 fi
2223 rm -f conftest*
2224
2225
2226 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
2227 echo "configure:2228: checking for POSIXized ISC" >&5
2228 if test -d /etc/conf/kconfig.d &&
2229   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
2230 then
2231   echo "$ac_t""yes" 1>&6
2232   ISC=yes # If later tests want to check for ISC.
2233   cat >> confdefs.h <<\EOF
2234 #define _POSIX_SOURCE 1
2235 EOF
2236
2237   if test "$GCC" = yes; then
2238     CC="$CC -posix"
2239   else
2240     CC="$CC -Xp"
2241   fi
2242 else
2243   echo "$ac_t""no" 1>&6
2244   ISC=
2245 fi
2246
2247 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
2248 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
2249 echo "configure:2250: checking for minix/config.h" >&5
2250 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2251   echo $ac_n "(cached) $ac_c" 1>&6
2252 else
2253   cat > conftest.$ac_ext <<EOF
2254 #line 2255 "configure"
2255 #include "confdefs.h"
2256 #include <minix/config.h>
2257 EOF
2258 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2259 { (eval echo configure:2260: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2260 ac_err=`grep -v '^ *+' conftest.out`
2261 if test -z "$ac_err"; then
2262   rm -rf conftest*
2263   eval "ac_cv_header_$ac_safe=yes"
2264 else
2265   echo "$ac_err" >&5
2266   echo "configure: failed program was:" >&5
2267   cat conftest.$ac_ext >&5
2268   rm -rf conftest*
2269   eval "ac_cv_header_$ac_safe=no"
2270 fi
2271 rm -f conftest*
2272 fi
2273 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2274   echo "$ac_t""yes" 1>&6
2275   MINIX=yes
2276 else
2277   echo "$ac_t""no" 1>&6
2278 MINIX=
2279 fi
2280
2281 if test "$MINIX" = yes; then
2282   cat >> confdefs.h <<\EOF
2283 #define _POSIX_SOURCE 1
2284 EOF
2285
2286   cat >> confdefs.h <<\EOF
2287 #define _POSIX_1_SOURCE 2
2288 EOF
2289
2290   cat >> confdefs.h <<\EOF
2291 #define _MINIX 1
2292 EOF
2293
2294 fi
2295
2296
2297
2298
2299
2300 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
2301 echo "configure:2302: checking for ${CC-cc} option to accept ANSI C" >&5
2302 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
2303   echo $ac_n "(cached) $ac_c" 1>&6
2304 else
2305   am_cv_prog_cc_stdc=no
2306 ac_save_CC="$CC"
2307 # Don't try gcc -ansi; that turns off useful extensions and
2308 # breaks some systems' header files.
2309 # AIX                   -qlanglvl=ansi
2310 # Ultrix and OSF/1      -std1
2311 # HP-UX                 -Aa -D_HPUX_SOURCE
2312 # SVR4                  -Xc -D__EXTENSIONS__
2313 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2314 do
2315   CC="$ac_save_CC $ac_arg"
2316   cat > conftest.$ac_ext <<EOF
2317 #line 2318 "configure"
2318 #include "confdefs.h"
2319 #include <stdarg.h>
2320 #include <stdio.h>
2321 #include <sys/types.h>
2322 #include <sys/stat.h>
2323 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2324 struct buf { int x; };
2325 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2326 static char *e (p, i)
2327      char **p;
2328      int i;
2329 {
2330   return p[i];
2331 }
2332 static char *f (char * (*g) (char **, int), char **p, ...)
2333 {
2334   char *s;
2335   va_list v;
2336   va_start (v,p);
2337   s = g (p, va_arg (v,int));
2338   va_end (v);
2339   return s;
2340 }
2341 int test (int i, double x);
2342 struct s1 {int (*f) (int a);};
2343 struct s2 {int (*f) (double a);};
2344 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2345 int argc;
2346 char **argv;
2347
2348 int main() {
2349
2350 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2351
2352 ; return 0; }
2353 EOF
2354 if { (eval echo configure:2355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2355   rm -rf conftest*
2356   am_cv_prog_cc_stdc="$ac_arg"; break
2357 else
2358   echo "configure: failed program was:" >&5
2359   cat conftest.$ac_ext >&5
2360 fi
2361 rm -f conftest*
2362 done
2363 CC="$ac_save_CC"
2364
2365 fi
2366
2367 if test -z "$am_cv_prog_cc_stdc"; then
2368   echo "$ac_t""none needed" 1>&6
2369 else
2370   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
2371 fi
2372 case "x$am_cv_prog_cc_stdc" in
2373   x|xno) ;;
2374   *) CC="$CC $am_cv_prog_cc_stdc" ;;
2375 esac
2376
2377 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
2378         { echo "configure: error: OpenLDAP requires compiler to support STDC prototypes." 1>&2; exit 1; }
2379 fi
2380
2381
2382
2383
2384 echo $ac_n "checking for socket""... $ac_c" 1>&6
2385 echo "configure:2386: checking for socket" >&5
2386 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
2387   echo $ac_n "(cached) $ac_c" 1>&6
2388 else
2389   cat > conftest.$ac_ext <<EOF
2390 #line 2391 "configure"
2391 #include "confdefs.h"
2392 /* System header to define __stub macros and hopefully few prototypes,
2393     which can conflict with char socket(); below.  */
2394 #include <assert.h>
2395 /* Override any gcc2 internal prototype to avoid an error.  */
2396 /* We use char because int might match the return type of a gcc2
2397     builtin and then its argument prototype would still apply.  */
2398 char socket();
2399
2400 int main() {
2401
2402 /* The GNU C library defines this for functions which it implements
2403     to always fail with ENOSYS.  Some functions are actually named
2404     something starting with __ and the normal name is an alias.  */
2405 #if defined (__stub_socket) || defined (__stub___socket)
2406 choke me
2407 #else
2408 socket();
2409 #endif
2410
2411 ; return 0; }
2412 EOF
2413 if { (eval echo configure:2414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2414   rm -rf conftest*
2415   eval "ac_cv_func_socket=yes"
2416 else
2417   echo "configure: failed program was:" >&5
2418   cat conftest.$ac_ext >&5
2419   rm -rf conftest*
2420   eval "ac_cv_func_socket=no"
2421 fi
2422 rm -f conftest*
2423 fi
2424
2425 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
2426   echo "$ac_t""yes" 1>&6
2427   have_socket=yes
2428 else
2429   echo "$ac_t""no" 1>&6
2430         
2431         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
2432 echo "configure:2433: checking for main in -lsocket" >&5
2433 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
2434 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2435   echo $ac_n "(cached) $ac_c" 1>&6
2436 else
2437   ac_save_LIBS="$LIBS"
2438 LIBS="-lsocket  $LIBS"
2439 cat > conftest.$ac_ext <<EOF
2440 #line 2441 "configure"
2441 #include "confdefs.h"
2442
2443 int main() {
2444 main()
2445 ; return 0; }
2446 EOF
2447 if { (eval echo configure:2448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2448   rm -rf conftest*
2449   eval "ac_cv_lib_$ac_lib_var=yes"
2450 else
2451   echo "configure: failed program was:" >&5
2452   cat conftest.$ac_ext >&5
2453   rm -rf conftest*
2454   eval "ac_cv_lib_$ac_lib_var=no"
2455 fi
2456 rm -f conftest*
2457 LIBS="$ac_save_LIBS"
2458
2459 fi
2460 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2461   echo "$ac_t""yes" 1>&6
2462     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2463     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2464   cat >> confdefs.h <<EOF
2465 #define $ac_tr_lib 1
2466 EOF
2467
2468   LIBS="-lsocket $LIBS"
2469
2470 else
2471   echo "$ac_t""no" 1>&6
2472 fi
2473
2474         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
2475 echo "configure:2476: checking for main in -lnet" >&5
2476 ac_lib_var=`echo net'_'main | sed 'y%./+-%__p_%'`
2477 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2478   echo $ac_n "(cached) $ac_c" 1>&6
2479 else
2480   ac_save_LIBS="$LIBS"
2481 LIBS="-lnet  $LIBS"
2482 cat > conftest.$ac_ext <<EOF
2483 #line 2484 "configure"
2484 #include "confdefs.h"
2485
2486 int main() {
2487 main()
2488 ; return 0; }
2489 EOF
2490 if { (eval echo configure:2491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2491   rm -rf conftest*
2492   eval "ac_cv_lib_$ac_lib_var=yes"
2493 else
2494   echo "configure: failed program was:" >&5
2495   cat conftest.$ac_ext >&5
2496   rm -rf conftest*
2497   eval "ac_cv_lib_$ac_lib_var=no"
2498 fi
2499 rm -f conftest*
2500 LIBS="$ac_save_LIBS"
2501
2502 fi
2503 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2504   echo "$ac_t""yes" 1>&6
2505     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2506     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2507   cat >> confdefs.h <<EOF
2508 #define $ac_tr_lib 1
2509 EOF
2510
2511   LIBS="-lnet $LIBS"
2512
2513 else
2514   echo "$ac_t""no" 1>&6
2515 fi
2516
2517         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
2518 echo "configure:2519: checking for main in -lnsl_s" >&5
2519 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-%__p_%'`
2520 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2521   echo $ac_n "(cached) $ac_c" 1>&6
2522 else
2523   ac_save_LIBS="$LIBS"
2524 LIBS="-lnsl_s  $LIBS"
2525 cat > conftest.$ac_ext <<EOF
2526 #line 2527 "configure"
2527 #include "confdefs.h"
2528
2529 int main() {
2530 main()
2531 ; return 0; }
2532 EOF
2533 if { (eval echo configure:2534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2534   rm -rf conftest*
2535   eval "ac_cv_lib_$ac_lib_var=yes"
2536 else
2537   echo "configure: failed program was:" >&5
2538   cat conftest.$ac_ext >&5
2539   rm -rf conftest*
2540   eval "ac_cv_lib_$ac_lib_var=no"
2541 fi
2542 rm -f conftest*
2543 LIBS="$ac_save_LIBS"
2544
2545 fi
2546 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2547   echo "$ac_t""yes" 1>&6
2548     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2549     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2550   cat >> confdefs.h <<EOF
2551 #define $ac_tr_lib 1
2552 EOF
2553
2554   LIBS="-lnsl_s $LIBS"
2555
2556 else
2557   echo "$ac_t""no" 1>&6
2558 fi
2559
2560         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
2561 echo "configure:2562: checking for main in -lnsl" >&5
2562 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
2563 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2564   echo $ac_n "(cached) $ac_c" 1>&6
2565 else
2566   ac_save_LIBS="$LIBS"
2567 LIBS="-lnsl  $LIBS"
2568 cat > conftest.$ac_ext <<EOF
2569 #line 2570 "configure"
2570 #include "confdefs.h"
2571
2572 int main() {
2573 main()
2574 ; return 0; }
2575 EOF
2576 if { (eval echo configure:2577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2577   rm -rf conftest*
2578   eval "ac_cv_lib_$ac_lib_var=yes"
2579 else
2580   echo "configure: failed program was:" >&5
2581   cat conftest.$ac_ext >&5
2582   rm -rf conftest*
2583   eval "ac_cv_lib_$ac_lib_var=no"
2584 fi
2585 rm -f conftest*
2586 LIBS="$ac_save_LIBS"
2587
2588 fi
2589 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2590   echo "$ac_t""yes" 1>&6
2591     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2592     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2593   cat >> confdefs.h <<EOF
2594 #define $ac_tr_lib 1
2595 EOF
2596
2597   LIBS="-lnsl $LIBS"
2598
2599 else
2600   echo "$ac_t""no" 1>&6
2601 fi
2602
2603         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
2604 echo "configure:2605: checking for socket in -linet" >&5
2605 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
2606 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2607   echo $ac_n "(cached) $ac_c" 1>&6
2608 else
2609   ac_save_LIBS="$LIBS"
2610 LIBS="-linet  $LIBS"
2611 cat > conftest.$ac_ext <<EOF
2612 #line 2613 "configure"
2613 #include "confdefs.h"
2614 /* Override any gcc2 internal prototype to avoid an error.  */
2615 /* We use char because int might match the return type of a gcc2
2616     builtin and then its argument prototype would still apply.  */
2617 char socket();
2618
2619 int main() {
2620 socket()
2621 ; return 0; }
2622 EOF
2623 if { (eval echo configure:2624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2624   rm -rf conftest*
2625   eval "ac_cv_lib_$ac_lib_var=yes"
2626 else
2627   echo "configure: failed program was:" >&5
2628   cat conftest.$ac_ext >&5
2629   rm -rf conftest*
2630   eval "ac_cv_lib_$ac_lib_var=no"
2631 fi
2632 rm -f conftest*
2633 LIBS="$ac_save_LIBS"
2634
2635 fi
2636 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2637   echo "$ac_t""yes" 1>&6
2638     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2639     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2640   cat >> confdefs.h <<EOF
2641 #define $ac_tr_lib 1
2642 EOF
2643
2644   LIBS="-linet $LIBS"
2645
2646 else
2647   echo "$ac_t""no" 1>&6
2648 fi
2649
2650         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
2651 echo "configure:2652: checking for main in -lgen" >&5
2652 ac_lib_var=`echo gen'_'main | sed 'y%./+-%__p_%'`
2653 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2654   echo $ac_n "(cached) $ac_c" 1>&6
2655 else
2656   ac_save_LIBS="$LIBS"
2657 LIBS="-lgen  $LIBS"
2658 cat > conftest.$ac_ext <<EOF
2659 #line 2660 "configure"
2660 #include "confdefs.h"
2661
2662 int main() {
2663 main()
2664 ; return 0; }
2665 EOF
2666 if { (eval echo configure:2667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2667   rm -rf conftest*
2668   eval "ac_cv_lib_$ac_lib_var=yes"
2669 else
2670   echo "configure: failed program was:" >&5
2671   cat conftest.$ac_ext >&5
2672   rm -rf conftest*
2673   eval "ac_cv_lib_$ac_lib_var=no"
2674 fi
2675 rm -f conftest*
2676 LIBS="$ac_save_LIBS"
2677
2678 fi
2679 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2680   echo "$ac_t""yes" 1>&6
2681     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2682     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2683   cat >> confdefs.h <<EOF
2684 #define $ac_tr_lib 1
2685 EOF
2686
2687   LIBS="-lgen $LIBS"
2688
2689 else
2690   echo "$ac_t""no" 1>&6
2691 fi
2692
2693
2694 fi
2695
2696
2697 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
2698 echo "configure:2699: checking for res_search in -lresolv" >&5
2699 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
2700 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2701   echo $ac_n "(cached) $ac_c" 1>&6
2702 else
2703   ac_save_LIBS="$LIBS"
2704 LIBS="-lresolv  $LIBS"
2705 cat > conftest.$ac_ext <<EOF
2706 #line 2707 "configure"
2707 #include "confdefs.h"
2708 /* Override any gcc2 internal prototype to avoid an error.  */
2709 /* We use char because int might match the return type of a gcc2
2710     builtin and then its argument prototype would still apply.  */
2711 char res_search();
2712
2713 int main() {
2714 res_search()
2715 ; return 0; }
2716 EOF
2717 if { (eval echo configure:2718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2718   rm -rf conftest*
2719   eval "ac_cv_lib_$ac_lib_var=yes"
2720 else
2721   echo "configure: failed program was:" >&5
2722   cat conftest.$ac_ext >&5
2723   rm -rf conftest*
2724   eval "ac_cv_lib_$ac_lib_var=no"
2725 fi
2726 rm -f conftest*
2727 LIBS="$ac_save_LIBS"
2728
2729 fi
2730 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2731   echo "$ac_t""yes" 1>&6
2732     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2733     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2734   cat >> confdefs.h <<EOF
2735 #define $ac_tr_lib 1
2736 EOF
2737
2738   LIBS="-lresolv $LIBS"
2739
2740 else
2741   echo "$ac_t""no" 1>&6
2742 fi
2743
2744
2745 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
2746 echo "configure:2747: checking for sigset in -lV3" >&5
2747 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-%__p_%'`
2748 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2749   echo $ac_n "(cached) $ac_c" 1>&6
2750 else
2751   ac_save_LIBS="$LIBS"
2752 LIBS="-lV3  $LIBS"
2753 cat > conftest.$ac_ext <<EOF
2754 #line 2755 "configure"
2755 #include "confdefs.h"
2756 /* Override any gcc2 internal prototype to avoid an error.  */
2757 /* We use char because int might match the return type of a gcc2
2758     builtin and then its argument prototype would still apply.  */
2759 char sigset();
2760
2761 int main() {
2762 sigset()
2763 ; return 0; }
2764 EOF
2765 if { (eval echo configure:2766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2766   rm -rf conftest*
2767   eval "ac_cv_lib_$ac_lib_var=yes"
2768 else
2769   echo "configure: failed program was:" >&5
2770   cat conftest.$ac_ext >&5
2771   rm -rf conftest*
2772   eval "ac_cv_lib_$ac_lib_var=no"
2773 fi
2774 rm -f conftest*
2775 LIBS="$ac_save_LIBS"
2776
2777 fi
2778 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2779   echo "$ac_t""yes" 1>&6
2780     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2781     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2782   cat >> confdefs.h <<EOF
2783 #define $ac_tr_lib 1
2784 EOF
2785
2786   LIBS="-lV3 $LIBS"
2787
2788 else
2789   echo "$ac_t""no" 1>&6
2790 fi
2791
2792
2793 # ISODE tests
2794 ol_link_isode=no
2795 if test $ol_enable_ldapd != no ; then
2796                 echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
2797 echo "configure:2798: checking for main in -lxtpp" >&5
2798 ac_lib_var=`echo xtpp'_'main | sed 'y%./+-%__p_%'`
2799 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2800   echo $ac_n "(cached) $ac_c" 1>&6
2801 else
2802   ac_save_LIBS="$LIBS"
2803 LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
2804 cat > conftest.$ac_ext <<EOF
2805 #line 2806 "configure"
2806 #include "confdefs.h"
2807
2808 int main() {
2809 main()
2810 ; return 0; }
2811 EOF
2812 if { (eval echo configure:2813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2813   rm -rf conftest*
2814   eval "ac_cv_lib_$ac_lib_var=yes"
2815 else
2816   echo "configure: failed program was:" >&5
2817   cat conftest.$ac_ext >&5
2818   rm -rf conftest*
2819   eval "ac_cv_lib_$ac_lib_var=no"
2820 fi
2821 rm -f conftest*
2822 LIBS="$ac_save_LIBS"
2823
2824 fi
2825 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2826   echo "$ac_t""yes" 1>&6
2827   
2828                 ol_link_isode=yes
2829                 cat >> confdefs.h <<\EOF
2830 #define HAVE_XTPP 1
2831 EOF
2832
2833                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
2834                 
2835 else
2836   echo "$ac_t""no" 1>&6
2837 :
2838 fi
2839
2840         echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
2841 echo "configure:2842: checking for main in -ldsap" >&5
2842 ac_lib_var=`echo dsap'_'main | sed 'y%./+-%__p_%'`
2843 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2844   echo $ac_n "(cached) $ac_c" 1>&6
2845 else
2846   ac_save_LIBS="$LIBS"
2847 LIBS="-ldsap -lisode $LIBS"
2848 cat > conftest.$ac_ext <<EOF
2849 #line 2850 "configure"
2850 #include "confdefs.h"
2851
2852 int main() {
2853 main()
2854 ; return 0; }
2855 EOF
2856 if { (eval echo configure:2857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2857   rm -rf conftest*
2858   eval "ac_cv_lib_$ac_lib_var=yes"
2859 else
2860   echo "configure: failed program was:" >&5
2861   cat conftest.$ac_ext >&5
2862   rm -rf conftest*
2863   eval "ac_cv_lib_$ac_lib_var=no"
2864 fi
2865 rm -f conftest*
2866 LIBS="$ac_save_LIBS"
2867
2868 fi
2869 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2870   echo "$ac_t""yes" 1>&6
2871   
2872                 ol_link_isode=yes
2873                 cat >> confdefs.h <<\EOF
2874 #define HAVE_DSAP 1
2875 EOF
2876
2877                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
2878                 
2879 else
2880   echo "$ac_t""no" 1>&6
2881 :
2882 fi
2883
2884         echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
2885 echo "configure:2886: checking for main in -lisode" >&5
2886 ac_lib_var=`echo isode'_'main | sed 'y%./+-%__p_%'`
2887 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2888   echo $ac_n "(cached) $ac_c" 1>&6
2889 else
2890   ac_save_LIBS="$LIBS"
2891 LIBS="-lisode  $LIBS"
2892 cat > conftest.$ac_ext <<EOF
2893 #line 2894 "configure"
2894 #include "confdefs.h"
2895
2896 int main() {
2897 main()
2898 ; return 0; }
2899 EOF
2900 if { (eval echo configure:2901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2901   rm -rf conftest*
2902   eval "ac_cv_lib_$ac_lib_var=yes"
2903 else
2904   echo "configure: failed program was:" >&5
2905   cat conftest.$ac_ext >&5
2906   rm -rf conftest*
2907   eval "ac_cv_lib_$ac_lib_var=no"
2908 fi
2909 rm -f conftest*
2910 LIBS="$ac_save_LIBS"
2911
2912 fi
2913 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2914   echo "$ac_t""yes" 1>&6
2915   
2916                 ol_link_isode=yes
2917                 cat >> confdefs.h <<\EOF
2918 #define HAVE_ISODE 1
2919 EOF
2920
2921                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
2922                 
2923 else
2924   echo "$ac_t""no" 1>&6
2925 :
2926 fi
2927
2928 fi
2929
2930 if test $ol_link_isode != no; then
2931         echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
2932 echo "configure:2933: checking for main in -lpp" >&5
2933 ac_lib_var=`echo pp'_'main | sed 'y%./+-%__p_%'`
2934 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2935   echo $ac_n "(cached) $ac_c" 1>&6
2936 else
2937   ac_save_LIBS="$LIBS"
2938 LIBS="-lpp  $LIBS"
2939 cat > conftest.$ac_ext <<EOF
2940 #line 2941 "configure"
2941 #include "confdefs.h"
2942
2943 int main() {
2944 main()
2945 ; return 0; }
2946 EOF
2947 if { (eval echo configure:2948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2948   rm -rf conftest*
2949   eval "ac_cv_lib_$ac_lib_var=yes"
2950 else
2951   echo "configure: failed program was:" >&5
2952   cat conftest.$ac_ext >&5
2953   rm -rf conftest*
2954   eval "ac_cv_lib_$ac_lib_var=no"
2955 fi
2956 rm -f conftest*
2957 LIBS="$ac_save_LIBS"
2958
2959 fi
2960 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2961   echo "$ac_t""yes" 1>&6
2962   
2963                 cat >> confdefs.h <<\EOF
2964 #define HAVE_PP 1
2965 EOF
2966
2967                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
2968                 
2969 else
2970   echo "$ac_t""no" 1>&6
2971 :
2972 fi
2973
2974
2975         # Extract the first word of "pepsy", so it can be a program name with args.
2976 set dummy pepsy; ac_word=$2
2977 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2978 echo "configure:2979: checking for $ac_word" >&5
2979 if eval "test \"`echo '$''{'ac_cv_path_PEPSY'+set}'`\" = set"; then
2980   echo $ac_n "(cached) $ac_c" 1>&6
2981 else
2982   case "$PEPSY" in
2983   /*)
2984   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a path.
2985   ;;
2986   *)
2987   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2988   for ac_dir in $PATH; do
2989     test -z "$ac_dir" && ac_dir=.
2990     if test -f $ac_dir/$ac_word; then
2991       ac_cv_path_PEPSY="$ac_dir/$ac_word"
2992       break
2993     fi
2994   done
2995   IFS="$ac_save_ifs"
2996   ;;
2997 esac
2998 fi
2999 PEPSY="$ac_cv_path_PEPSY"
3000 if test -n "$PEPSY"; then
3001   echo "$ac_t""$PEPSY" 1>&6
3002 else
3003   echo "$ac_t""no" 1>&6
3004 fi
3005
3006 fi
3007
3008 ol_link_kerberos=no
3009
3010 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
3011         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
3012 do
3013 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3014 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3015 echo "configure:3016: checking for $ac_hdr" >&5
3016 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3017   echo $ac_n "(cached) $ac_c" 1>&6
3018 else
3019   cat > conftest.$ac_ext <<EOF
3020 #line 3021 "configure"
3021 #include "confdefs.h"
3022 #include <$ac_hdr>
3023 EOF
3024 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3025 { (eval echo configure:3026: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3026 ac_err=`grep -v '^ *+' conftest.out`
3027 if test -z "$ac_err"; then
3028   rm -rf conftest*
3029   eval "ac_cv_header_$ac_safe=yes"
3030 else
3031   echo "$ac_err" >&5
3032   echo "configure: failed program was:" >&5
3033   cat conftest.$ac_ext >&5
3034   rm -rf conftest*
3035   eval "ac_cv_header_$ac_safe=no"
3036 fi
3037 rm -f conftest*
3038 fi
3039 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3040   echo "$ac_t""yes" 1>&6
3041     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3042   cat >> confdefs.h <<EOF
3043 #define $ac_tr_hdr 1
3044 EOF
3045  
3046 else
3047   echo "$ac_t""no" 1>&6
3048 fi
3049 done
3050
3051
3052         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
3053                 echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
3054 echo "configure:3055: checking for main in -lkrb4" >&5
3055 ac_lib_var=`echo krb4'_'main | sed 'y%./+-%__p_%'`
3056 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3057   echo $ac_n "(cached) $ac_c" 1>&6
3058 else
3059   ac_save_LIBS="$LIBS"
3060 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
3061 cat > conftest.$ac_ext <<EOF
3062 #line 3063 "configure"
3063 #include "confdefs.h"
3064
3065 int main() {
3066 main()
3067 ; return 0; }
3068 EOF
3069 if { (eval echo configure:3070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3070   rm -rf conftest*
3071   eval "ac_cv_lib_$ac_lib_var=yes"
3072 else
3073   echo "configure: failed program was:" >&5
3074   cat conftest.$ac_ext >&5
3075   rm -rf conftest*
3076   eval "ac_cv_lib_$ac_lib_var=no"
3077 fi
3078 rm -f conftest*
3079 LIBS="$ac_save_LIBS"
3080
3081 fi
3082 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3083   echo "$ac_t""yes" 1>&6
3084   have_k5=yes
3085 else
3086   echo "$ac_t""no" 1>&6
3087 have_k5=no
3088 fi
3089
3090
3091                 if test $have_k5 = yes ; then
3092                         ol_with_kerberos=found
3093                         ol_link_kerberos=yes
3094
3095                         cat >> confdefs.h <<\EOF
3096 #define HAVE_KERBEROS 1
3097 EOF
3098
3099                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
3100                 fi
3101         fi
3102 fi
3103
3104 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
3105         for ac_hdr in krb.h des.h
3106 do
3107 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3108 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3109 echo "configure:3110: checking for $ac_hdr" >&5
3110 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3111   echo $ac_n "(cached) $ac_c" 1>&6
3112 else
3113   cat > conftest.$ac_ext <<EOF
3114 #line 3115 "configure"
3115 #include "confdefs.h"
3116 #include <$ac_hdr>
3117 EOF
3118 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3119 { (eval echo configure:3120: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3120 ac_err=`grep -v '^ *+' conftest.out`
3121 if test -z "$ac_err"; then
3122   rm -rf conftest*
3123   eval "ac_cv_header_$ac_safe=yes"
3124 else
3125   echo "$ac_err" >&5
3126   echo "configure: failed program was:" >&5
3127   cat conftest.$ac_ext >&5
3128   rm -rf conftest*
3129   eval "ac_cv_header_$ac_safe=no"
3130 fi
3131 rm -f conftest*
3132 fi
3133 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3134   echo "$ac_t""yes" 1>&6
3135     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3136   cat >> confdefs.h <<EOF
3137 #define $ac_tr_hdr 1
3138 EOF
3139  
3140 else
3141   echo "$ac_t""no" 1>&6
3142 fi
3143 done
3144
3145
3146         if test $ac_cv_header_krb_h = yes ; then
3147                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
3148 echo "configure:3149: checking for main in -lkrb" >&5
3149 ac_lib_var=`echo krb'_'main | sed 'y%./+-%__p_%'`
3150 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3151   echo $ac_n "(cached) $ac_c" 1>&6
3152 else
3153   ac_save_LIBS="$LIBS"
3154 LIBS="-lkrb -ldes $LIBS"
3155 cat > conftest.$ac_ext <<EOF
3156 #line 3157 "configure"
3157 #include "confdefs.h"
3158
3159 int main() {
3160 main()
3161 ; return 0; }
3162 EOF
3163 if { (eval echo configure:3164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3164   rm -rf conftest*
3165   eval "ac_cv_lib_$ac_lib_var=yes"
3166 else
3167   echo "configure: failed program was:" >&5
3168   cat conftest.$ac_ext >&5
3169   rm -rf conftest*
3170   eval "ac_cv_lib_$ac_lib_var=no"
3171 fi
3172 rm -f conftest*
3173 LIBS="$ac_save_LIBS"
3174
3175 fi
3176 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3177   echo "$ac_t""yes" 1>&6
3178   have_k4=yes
3179 else
3180   echo "$ac_t""no" 1>&6
3181 have_k4=no
3182 fi
3183
3184
3185                 if test $have_k4 = yes ; then
3186                         ol_with_kerberos=found
3187                         ol_link_kerberos=yes
3188
3189                         cat >> confdefs.h <<\EOF
3190 #define HAVE_KERBEROS 1
3191 EOF
3192
3193                         KRB_LIBS="-lkrb -ldes"
3194                 fi
3195         fi
3196 fi
3197
3198 if test $ol_link_kerberos = yes ; then
3199         save_LIBS=$LIBS
3200         $LIBS="$KRB_LIBS $LIBS"
3201         for ac_func in des_string_to_key
3202 do
3203 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3204 echo "configure:3205: checking for $ac_func" >&5
3205 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3206   echo $ac_n "(cached) $ac_c" 1>&6
3207 else
3208   cat > conftest.$ac_ext <<EOF
3209 #line 3210 "configure"
3210 #include "confdefs.h"
3211 /* System header to define __stub macros and hopefully few prototypes,
3212     which can conflict with char $ac_func(); below.  */
3213 #include <assert.h>
3214 /* Override any gcc2 internal prototype to avoid an error.  */
3215 /* We use char because int might match the return type of a gcc2
3216     builtin and then its argument prototype would still apply.  */
3217 char $ac_func();
3218
3219 int main() {
3220
3221 /* The GNU C library defines this for functions which it implements
3222     to always fail with ENOSYS.  Some functions are actually named
3223     something starting with __ and the normal name is an alias.  */
3224 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3225 choke me
3226 #else
3227 $ac_func();
3228 #endif
3229
3230 ; return 0; }
3231 EOF
3232 if { (eval echo configure:3233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3233   rm -rf conftest*
3234   eval "ac_cv_func_$ac_func=yes"
3235 else
3236   echo "configure: failed program was:" >&5
3237   cat conftest.$ac_ext >&5
3238   rm -rf conftest*
3239   eval "ac_cv_func_$ac_func=no"
3240 fi
3241 rm -f conftest*
3242 fi
3243
3244 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3245   echo "$ac_t""yes" 1>&6
3246     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3247   cat >> confdefs.h <<EOF
3248 #define $ac_tr_func 1
3249 EOF
3250  
3251 else
3252   echo "$ac_t""no" 1>&6
3253 fi
3254 done
3255
3256         LIBS=$save_LIBS
3257 fi
3258
3259 ol_link_threads=no
3260 if test $ol_with_threads = auto -o $ol_with_threads = yes \
3261         -o $ol_with_threads = posix ; then
3262
3263         for ac_hdr in pthread.h sched.h
3264 do
3265 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3266 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3267 echo "configure:3268: checking for $ac_hdr" >&5
3268 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3269   echo $ac_n "(cached) $ac_c" 1>&6
3270 else
3271   cat > conftest.$ac_ext <<EOF
3272 #line 3273 "configure"
3273 #include "confdefs.h"
3274 #include <$ac_hdr>
3275 EOF
3276 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3277 { (eval echo configure:3278: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3278 ac_err=`grep -v '^ *+' conftest.out`
3279 if test -z "$ac_err"; then
3280   rm -rf conftest*
3281   eval "ac_cv_header_$ac_safe=yes"
3282 else
3283   echo "$ac_err" >&5
3284   echo "configure: failed program was:" >&5
3285   cat conftest.$ac_ext >&5
3286   rm -rf conftest*
3287   eval "ac_cv_header_$ac_safe=no"
3288 fi
3289 rm -f conftest*
3290 fi
3291 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3292   echo "$ac_t""yes" 1>&6
3293     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3294   cat >> confdefs.h <<EOF
3295 #define $ac_tr_hdr 1
3296 EOF
3297  
3298 else
3299   echo "$ac_t""no" 1>&6
3300 fi
3301 done
3302
3303
3304         if test $ac_cv_header_pthread_h = yes ; then
3305                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
3306 echo "configure:3307: checking POSIX thread version" >&5
3307 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
3308   echo $ac_n "(cached) $ac_c" 1>&6
3309 else
3310   
3311         cat > conftest.$ac_ext <<EOF
3312 #line 3313 "configure"
3313 #include "confdefs.h"
3314
3315 #               include <pthread.h>
3316                 /* this check could be improved */
3317 #               ifdef PTHREAD_ONCE_INIT
3318                         pthread_version_final
3319 #               endif
3320         
3321 EOF
3322 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3323   egrep "pthread_version_final" >/dev/null 2>&1; then
3324   rm -rf conftest*
3325   ol_pthread_final=yes
3326 else
3327   rm -rf conftest*
3328   ol_pthread_final=no
3329 fi
3330 rm -f conftest*
3331
3332
3333         cat > conftest.$ac_ext <<EOF
3334 #line 3335 "configure"
3335 #include "confdefs.h"
3336
3337 #               include <pthread.h>
3338                 /* this check could be improved */
3339 #               ifdef pthread_once_init
3340                         pthread_version_draft4
3341 #               endif
3342         
3343 EOF
3344 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3345   egrep "pthread_version_draft4" >/dev/null 2>&1; then
3346   rm -rf conftest*
3347   ol_pthread_draft4=yes
3348 else
3349   rm -rf conftest*
3350   ol_pthread_draft4=no
3351 fi
3352 rm -f conftest*
3353
3354
3355         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
3356                 ol_cv_pthread_version=final
3357         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
3358                 ol_cv_pthread_version=draft4
3359         else
3360                 ol_cv_pthread_version=unknown
3361         fi
3362
3363 fi
3364
3365 echo "$ac_t""$ol_cv_pthread_version" 1>&6
3366
3367
3368                 if test $ol_cv_pthread_version = final ; then
3369                         cat >> confdefs.h <<\EOF
3370 #define HAVE_PTHREADS_FINAL 1
3371 EOF
3372
3373                 elif test $ol_cv_pthread_version = draft4 ; then
3374                         cat >> confdefs.h <<\EOF
3375 #define HAVE_PTHREADS_D4 1
3376 EOF
3377
3378                 else
3379                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
3380                 fi
3381
3382                 # consider threads found
3383                 ol_with_threads=found
3384
3385                 
3386 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
3387 echo "configure:3388: checking for LinuxThreads" >&5
3388 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
3389   echo $ac_n "(cached) $ac_c" 1>&6
3390 else
3391   
3392         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
3393         if test "$res" -gt 0 ; then
3394                 ol_cv_linux_threads=yes
3395         else
3396                 ol_cv_linux_threads=no
3397         fi
3398
3399 fi
3400
3401 echo "$ac_t""$ol_cv_linux_threads" 1>&6
3402
3403
3404                 if test $ol_cv_linux_threads = yes ; then
3405                         cat >> confdefs.h <<\EOF
3406 #define HAVE_LINUX_THREADS 1
3407 EOF
3408
3409                 fi
3410
3411                 
3412                                 echo $ac_n "checking for pthread_create""... $ac_c" 1>&6
3413 echo "configure:3414: checking for pthread_create" >&5
3414 if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then
3415   echo $ac_n "(cached) $ac_c" 1>&6
3416 else
3417   cat > conftest.$ac_ext <<EOF
3418 #line 3419 "configure"
3419 #include "confdefs.h"
3420 /* System header to define __stub macros and hopefully few prototypes,
3421     which can conflict with char pthread_create(); below.  */
3422 #include <assert.h>
3423 /* Override any gcc2 internal prototype to avoid an error.  */
3424 /* We use char because int might match the return type of a gcc2
3425     builtin and then its argument prototype would still apply.  */
3426 char pthread_create();
3427
3428 int main() {
3429
3430 /* The GNU C library defines this for functions which it implements
3431     to always fail with ENOSYS.  Some functions are actually named
3432     something starting with __ and the normal name is an alias.  */
3433 #if defined (__stub_pthread_create) || defined (__stub___pthread_create)
3434 choke me
3435 #else
3436 pthread_create();
3437 #endif
3438
3439 ; return 0; }
3440 EOF
3441 if { (eval echo configure:3442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3442   rm -rf conftest*
3443   eval "ac_cv_func_pthread_create=yes"
3444 else
3445   echo "configure: failed program was:" >&5
3446   cat conftest.$ac_ext >&5
3447   rm -rf conftest*
3448   eval "ac_cv_func_pthread_create=no"
3449 fi
3450 rm -f conftest*
3451 fi
3452
3453 if eval "test \"`echo '$ac_cv_func_'pthread_create`\" = yes"; then
3454   echo "$ac_t""yes" 1>&6
3455   ol_link_threads=yes
3456 else
3457   echo "$ac_t""no" 1>&6
3458 fi
3459
3460
3461                 if test $ol_link_threads = no ; then
3462                                                 echo $ac_n "checking for pthread_create with -pthread""... $ac_c" 1>&6
3463 echo "configure:3464: checking for pthread_create with -pthread" >&5
3464 if eval "test \"`echo '$''{'ol_cv_pthread_flag'+set}'`\" = set"; then
3465   echo $ac_n "(cached) $ac_c" 1>&6
3466 else
3467   
3468                                                                 save_LIBS="$LIBS"
3469                                 LIBS="-pthread $LIBS"
3470                                 cat > conftest.$ac_ext <<EOF
3471 #line 3472 "configure"
3472 #include "confdefs.h"
3473 char pthread();
3474 int main() {
3475
3476                                         pthread_create();
3477                                         
3478 ; return 0; }
3479 EOF
3480 if { (eval echo configure:3481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3481   rm -rf conftest*
3482   ol_cv_pthread_flag=yes
3483 else
3484   echo "configure: failed program was:" >&5
3485   cat conftest.$ac_ext >&5
3486   rm -rf conftest*
3487   ol_cv_pthread_flag=no
3488 fi
3489 rm -f conftest*
3490                                                                 LIBS="$save_LIBS"
3491                         
3492 fi
3493
3494 echo "$ac_t""$ol_cv_pthread_flag" 1>&6
3495
3496                         if test $ol_cv_pthread_flag = yes ; then
3497                                 LTHREAD_LIBS="$LTHREAD_LIBS -pthread"
3498                                 ol_link_threads=posix
3499                         fi
3500                 fi
3501
3502                 if test $ol_link_threads = no ; then
3503                                                 echo $ac_n "checking for pthread_create with -pthreads""... $ac_c" 1>&6
3504 echo "configure:3505: checking for pthread_create with -pthreads" >&5
3505 if eval "test \"`echo '$''{'ol_cv_pthreads_flag'+set}'`\" = set"; then
3506   echo $ac_n "(cached) $ac_c" 1>&6
3507 else
3508   
3509                                                                 save_LIBS="$LIBS"
3510                                 LIBS="-pthreads $LIBS"
3511                                 cat > conftest.$ac_ext <<EOF
3512 #line 3513 "configure"
3513 #include "confdefs.h"
3514 char pthread();
3515 int main() {
3516
3517                                         pthread_create();
3518                                         
3519 ; return 0; }
3520 EOF
3521 if { (eval echo configure:3522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3522   rm -rf conftest*
3523   ol_cv_pthreads_flag=yes
3524 else
3525   echo "configure: failed program was:" >&5
3526   cat conftest.$ac_ext >&5
3527   rm -rf conftest*
3528   ol_cv_pthreads_flag=no
3529 fi
3530 rm -f conftest*
3531                                                                 LIBS="$save_LIBS"
3532                         
3533 fi
3534
3535 echo "$ac_t""$ol_cv_pthreads_flag" 1>&6
3536
3537                         if test $ol_cv_pthreads_flag = yes ; then
3538                                 LTHREAD_LIBS="$LTHREAD_LIBS -pthreads"
3539                                 ol_link_threads=posix
3540                         fi
3541                 fi
3542
3543                 if test $ol_link_threads = no ; then
3544                                                 echo $ac_n "checking for pthread_create with -thread""... $ac_c" 1>&6
3545 echo "configure:3546: checking for pthread_create with -thread" >&5
3546 if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
3547   echo $ac_n "(cached) $ac_c" 1>&6
3548 else
3549   
3550                                                                 save_LIBS="$LIBS"
3551                                 LIBS="-thread $LIBS"
3552                                 cat > conftest.$ac_ext <<EOF
3553 #line 3554 "configure"
3554 #include "confdefs.h"
3555 char pthread();
3556 int main() {
3557
3558                                         pthread_create();
3559                                         
3560 ; return 0; }
3561 EOF
3562 if { (eval echo configure:3563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3563   rm -rf conftest*
3564   ol_cv_thread_flag=yes
3565 else
3566   echo "configure: failed program was:" >&5
3567   cat conftest.$ac_ext >&5
3568   rm -rf conftest*
3569   ol_cv_thread_flag=no
3570 fi
3571 rm -f conftest*
3572                                                                 LIBS="$save_LIBS"
3573                         
3574 fi
3575
3576 echo "$ac_t""$ol_cv_thread_flag" 1>&6
3577
3578                         if test $ol_cv_thread_flag = yes ; then
3579                                 LTHREAD_LIBS="$LTHREAD_LIBS -thread"
3580                                 ol_link_threads=posix
3581                         fi
3582                 fi
3583
3584                 if test $ol_link_threads = no ; then
3585                                                 save_LIBS="$LIBS"
3586                         echo $ac_n "checking for pthread_join in -lpthread""... $ac_c" 1>&6
3587 echo "configure:3588: checking for pthread_join in -lpthread" >&5
3588 ac_lib_var=`echo pthread'_'pthread_join | sed 'y%./+-%__p_%'`
3589 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3590   echo $ac_n "(cached) $ac_c" 1>&6
3591 else
3592   ac_save_LIBS="$LIBS"
3593 LIBS="-lpthread -lexc $LIBS"
3594 cat > conftest.$ac_ext <<EOF
3595 #line 3596 "configure"
3596 #include "confdefs.h"
3597 /* Override any gcc2 internal prototype to avoid an error.  */
3598 /* We use char because int might match the return type of a gcc2
3599     builtin and then its argument prototype would still apply.  */
3600 char pthread_join();
3601
3602 int main() {
3603 pthread_join()
3604 ; return 0; }
3605 EOF
3606 if { (eval echo configure:3607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3607   rm -rf conftest*
3608   eval "ac_cv_lib_$ac_lib_var=yes"
3609 else
3610   echo "configure: failed program was:" >&5
3611   cat conftest.$ac_ext >&5
3612   rm -rf conftest*
3613   eval "ac_cv_lib_$ac_lib_var=no"
3614 fi
3615 rm -f conftest*
3616 LIBS="$ac_save_LIBS"
3617
3618 fi
3619 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3620   echo "$ac_t""yes" 1>&6
3621   
3622                                 ol_link_threads=posix
3623                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lexc"
3624                                 if test $ol_with_yielding_select = auto ; then
3625                                         ol_with_yielding_select=yes
3626                                 fi
3627                                 
3628 else
3629   echo "$ac_t""no" 1>&6
3630 fi
3631
3632                         LIBS="$save_LIBS"
3633                 fi
3634
3635                 if test $ol_link_threads = no ; then
3636                                                 save_LIBS="$LIBS"
3637                         echo $ac_n "checking for pthread_join in -lpthreads""... $ac_c" 1>&6
3638 echo "configure:3639: checking for pthread_join in -lpthreads" >&5
3639 ac_lib_var=`echo pthreads'_'pthread_join | sed 'y%./+-%__p_%'`
3640 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3641   echo $ac_n "(cached) $ac_c" 1>&6
3642 else
3643   ac_save_LIBS="$LIBS"
3644 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
3645 cat > conftest.$ac_ext <<EOF
3646 #line 3647 "configure"
3647 #include "confdefs.h"
3648 /* Override any gcc2 internal prototype to avoid an error.  */
3649 /* We use char because int might match the return type of a gcc2
3650     builtin and then its argument prototype would still apply.  */
3651 char pthread_join();
3652
3653 int main() {
3654 pthread_join()
3655 ; return 0; }
3656 EOF
3657 if { (eval echo configure:3658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3658   rm -rf conftest*
3659   eval "ac_cv_lib_$ac_lib_var=yes"
3660 else
3661   echo "configure: failed program was:" >&5
3662   cat conftest.$ac_ext >&5
3663   rm -rf conftest*
3664   eval "ac_cv_lib_$ac_lib_var=no"
3665 fi
3666 rm -f conftest*
3667 LIBS="$ac_save_LIBS"
3668
3669 fi
3670 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3671   echo "$ac_t""yes" 1>&6
3672   
3673                                 ol_link_threads=posix
3674                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc -lc_r"
3675                                 if test $ol_with_yielding_select = auto ; then
3676                                         ol_with_yielding_select=yes
3677                                 fi
3678                                 
3679 else
3680   echo "$ac_t""no" 1>&6
3681 fi
3682
3683                         LIBS="$save_LIBS"
3684                 fi
3685
3686                 if test $ol_link_threads = no ; then
3687                                                 save_LIBS="$LIBS"
3688                         echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
3689 echo "configure:3690: checking for pthread_create in -lpthread" >&5
3690 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
3691 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3692   echo $ac_n "(cached) $ac_c" 1>&6
3693 else
3694   ac_save_LIBS="$LIBS"
3695 LIBS="-lpthread  $LIBS"
3696 cat > conftest.$ac_ext <<EOF
3697 #line 3698 "configure"
3698 #include "confdefs.h"
3699 /* Override any gcc2 internal prototype to avoid an error.  */
3700 /* We use char because int might match the return type of a gcc2
3701     builtin and then its argument prototype would still apply.  */
3702 char pthread_create();
3703
3704 int main() {
3705 pthread_create()
3706 ; return 0; }
3707 EOF
3708 if { (eval echo configure:3709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3709   rm -rf conftest*
3710   eval "ac_cv_lib_$ac_lib_var=yes"
3711 else
3712   echo "configure: failed program was:" >&5
3713   cat conftest.$ac_ext >&5
3714   rm -rf conftest*
3715   eval "ac_cv_lib_$ac_lib_var=no"
3716 fi
3717 rm -f conftest*
3718 LIBS="$ac_save_LIBS"
3719
3720 fi
3721 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3722   echo "$ac_t""yes" 1>&6
3723   
3724                                 ol_link_threads=posix
3725                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
3726 else
3727   echo "$ac_t""no" 1>&6
3728 fi
3729
3730                         LIBS="$save_LIBS"
3731                 fi
3732
3733                 if test $ol_link_threads = no ; then
3734                                                 save_LIBS="$LIBS"
3735                         echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
3736 echo "configure:3737: checking for pthread_create in -lc_r" >&5
3737 ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
3738 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3739   echo $ac_n "(cached) $ac_c" 1>&6
3740 else
3741   ac_save_LIBS="$LIBS"
3742 LIBS="-lc_r  $LIBS"
3743 cat > conftest.$ac_ext <<EOF
3744 #line 3745 "configure"
3745 #include "confdefs.h"
3746 /* Override any gcc2 internal prototype to avoid an error.  */
3747 /* We use char because int might match the return type of a gcc2
3748     builtin and then its argument prototype would still apply.  */
3749 char pthread_create();
3750
3751 int main() {
3752 pthread_create()
3753 ; return 0; }
3754 EOF
3755 if { (eval echo configure:3756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3756   rm -rf conftest*
3757   eval "ac_cv_lib_$ac_lib_var=yes"
3758 else
3759   echo "configure: failed program was:" >&5
3760   cat conftest.$ac_ext >&5
3761   rm -rf conftest*
3762   eval "ac_cv_lib_$ac_lib_var=no"
3763 fi
3764 rm -f conftest*
3765 LIBS="$ac_save_LIBS"
3766
3767 fi
3768 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3769   echo "$ac_t""yes" 1>&6
3770   
3771                                 ol_link_threads=posix
3772                                 LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"
3773 else
3774   echo "$ac_t""no" 1>&6
3775 fi
3776
3777                         LIBS="$save_LIBS"
3778                 fi
3779
3780                 if test $ol_link_threads != no ; then
3781                         cat >> confdefs.h <<\EOF
3782 #define HAVE_PTHREADS 1
3783 EOF
3784
3785
3786                                                 save_CPPFLAGS="$CPPFLAGS"
3787                         save_LIBS="$LIBS"
3788                         LIBS="$LTHREAD_LIBS $LIBS"
3789
3790                                                                                                 for ac_func in sched_yield pthread_yield
3791 do
3792 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3793 echo "configure:3794: checking for $ac_func" >&5
3794 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3795   echo $ac_n "(cached) $ac_c" 1>&6
3796 else
3797   cat > conftest.$ac_ext <<EOF
3798 #line 3799 "configure"
3799 #include "confdefs.h"
3800 /* System header to define __stub macros and hopefully few prototypes,
3801     which can conflict with char $ac_func(); below.  */
3802 #include <assert.h>
3803 /* Override any gcc2 internal prototype to avoid an error.  */
3804 /* We use char because int might match the return type of a gcc2
3805     builtin and then its argument prototype would still apply.  */
3806 char $ac_func();
3807
3808 int main() {
3809
3810 /* The GNU C library defines this for functions which it implements
3811     to always fail with ENOSYS.  Some functions are actually named
3812     something starting with __ and the normal name is an alias.  */
3813 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3814 choke me
3815 #else
3816 $ac_func();
3817 #endif
3818
3819 ; return 0; }
3820 EOF
3821 if { (eval echo configure:3822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3822   rm -rf conftest*
3823   eval "ac_cv_func_$ac_func=yes"
3824 else
3825   echo "configure: failed program was:" >&5
3826   cat conftest.$ac_ext >&5
3827   rm -rf conftest*
3828   eval "ac_cv_func_$ac_func=no"
3829 fi
3830 rm -f conftest*
3831 fi
3832
3833 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3834   echo "$ac_t""yes" 1>&6
3835     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3836   cat >> confdefs.h <<EOF
3837 #define $ac_tr_func 1
3838 EOF
3839  
3840 else
3841   echo "$ac_t""no" 1>&6
3842 fi
3843 done
3844
3845
3846                         if test $ac_cv_func_sched_yield = no -a \
3847                                 $ac_cv_func_pthread_yield = no ; then
3848                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
3849 echo "configure:3850: checking for sched_yield in -lrt" >&5
3850 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
3851 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3852   echo $ac_n "(cached) $ac_c" 1>&6
3853 else
3854   ac_save_LIBS="$LIBS"
3855 LIBS="-lrt  $LIBS"
3856 cat > conftest.$ac_ext <<EOF
3857 #line 3858 "configure"
3858 #include "confdefs.h"
3859 /* Override any gcc2 internal prototype to avoid an error.  */
3860 /* We use char because int might match the return type of a gcc2
3861     builtin and then its argument prototype would still apply.  */
3862 char sched_yield();
3863
3864 int main() {
3865 sched_yield()
3866 ; return 0; }
3867 EOF
3868 if { (eval echo configure:3869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3869   rm -rf conftest*
3870   eval "ac_cv_lib_$ac_lib_var=yes"
3871 else
3872   echo "configure: failed program was:" >&5
3873   cat conftest.$ac_ext >&5
3874   rm -rf conftest*
3875   eval "ac_cv_lib_$ac_lib_var=no"
3876 fi
3877 rm -f conftest*
3878 LIBS="$ac_save_LIBS"
3879
3880 fi
3881 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3882   echo "$ac_t""yes" 1>&6
3883   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
3884                                         cat >> confdefs.h <<\EOF
3885 #define HAVE_SCHED_YIELD 1
3886 EOF
3887
3888                                         ac_cv_func_sched_yield=yes
3889 else
3890   echo "$ac_t""no" 1>&6
3891 ac_cv_func_sched_yield=no
3892 fi
3893
3894                         fi
3895                         if test $ac_cv_func_sched_yield = no -a \
3896                                 $ac_cv_func_pthread_yield = no ; then
3897                                                                 echo $ac_n "checking for sched_yield in -lposix4""... $ac_c" 1>&6
3898 echo "configure:3899: checking for sched_yield in -lposix4" >&5
3899 ac_lib_var=`echo posix4'_'sched_yield | sed 'y%./+-%__p_%'`
3900 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3901   echo $ac_n "(cached) $ac_c" 1>&6
3902 else
3903   ac_save_LIBS="$LIBS"
3904 LIBS="-lposix4  $LIBS"
3905 cat > conftest.$ac_ext <<EOF
3906 #line 3907 "configure"
3907 #include "confdefs.h"
3908 /* Override any gcc2 internal prototype to avoid an error.  */
3909 /* We use char because int might match the return type of a gcc2
3910     builtin and then its argument prototype would still apply.  */
3911 char sched_yield();
3912
3913 int main() {
3914 sched_yield()
3915 ; return 0; }
3916 EOF
3917 if { (eval echo configure:3918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3918   rm -rf conftest*
3919   eval "ac_cv_lib_$ac_lib_var=yes"
3920 else
3921   echo "configure: failed program was:" >&5
3922   cat conftest.$ac_ext >&5
3923   rm -rf conftest*
3924   eval "ac_cv_lib_$ac_lib_var=no"
3925 fi
3926 rm -f conftest*
3927 LIBS="$ac_save_LIBS"
3928
3929 fi
3930 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3931   echo "$ac_t""yes" 1>&6
3932   LTHREAD_LIBS="$LTHREAD_LIBS -lposix4"
3933                                         cat >> confdefs.h <<\EOF
3934 #define HAVE_SCHED_YIELD 1
3935 EOF
3936
3937                                         ac_cv_func_sched_yield=yes
3938 else
3939   echo "$ac_t""no" 1>&6
3940 ac_cv_func_sched_yield=no
3941 fi
3942
3943                         fi
3944                         if test $ac_cv_func_sched_yield = no -a \
3945                                 $ac_cv_func_pthread_yield = no ; then
3946                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
3947                                 { echo "configure: error: POSIX Threads are not usable" 1>&2; exit 1; }
3948                         fi
3949
3950                                                 for ac_func in pthread_kill
3951 do
3952 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3953 echo "configure:3954: checking for $ac_func" >&5
3954 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+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 /* System header to define __stub macros and hopefully few prototypes,
3961     which can conflict with char $ac_func(); below.  */
3962 #include <assert.h>
3963 /* Override any gcc2 internal prototype to avoid an error.  */
3964 /* We use char because int might match the return type of a gcc2
3965     builtin and then its argument prototype would still apply.  */
3966 char $ac_func();
3967
3968 int main() {
3969
3970 /* The GNU C library defines this for functions which it implements
3971     to always fail with ENOSYS.  Some functions are actually named
3972     something starting with __ and the normal name is an alias.  */
3973 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3974 choke me
3975 #else
3976 $ac_func();
3977 #endif
3978
3979 ; return 0; }
3980 EOF
3981 if { (eval echo configure:3982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3982   rm -rf conftest*
3983   eval "ac_cv_func_$ac_func=yes"
3984 else
3985   echo "configure: failed program was:" >&5
3986   cat conftest.$ac_ext >&5
3987   rm -rf conftest*
3988   eval "ac_cv_func_$ac_func=no"
3989 fi
3990 rm -f conftest*
3991 fi
3992
3993 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3994   echo "$ac_t""yes" 1>&6
3995     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3996   cat >> confdefs.h <<EOF
3997 #define $ac_tr_func 1
3998 EOF
3999  
4000 else
4001   echo "$ac_t""no" 1>&6
4002 fi
4003 done
4004
4005                         for ac_func in \
4006                                 pthread_attr_create pthread_attr_init \
4007                                 pthread_attr_destroy pthread_attr_delete \
4008                                 pthread_attr_setdetachstate pthread_attr_setdetach_np \
4009                         
4010 do
4011 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4012 echo "configure:4013: checking for $ac_func" >&5
4013 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4014   echo $ac_n "(cached) $ac_c" 1>&6
4015 else
4016   cat > conftest.$ac_ext <<EOF
4017 #line 4018 "configure"
4018 #include "confdefs.h"
4019 /* System header to define __stub macros and hopefully few prototypes,
4020     which can conflict with char $ac_func(); below.  */
4021 #include <assert.h>
4022 /* Override any gcc2 internal prototype to avoid an error.  */
4023 /* We use char because int might match the return type of a gcc2
4024     builtin and then its argument prototype would still apply.  */
4025 char $ac_func();
4026
4027 int main() {
4028
4029 /* The GNU C library defines this for functions which it implements
4030     to always fail with ENOSYS.  Some functions are actually named
4031     something starting with __ and the normal name is an alias.  */
4032 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4033 choke me
4034 #else
4035 $ac_func();
4036 #endif
4037
4038 ; return 0; }
4039 EOF
4040 if { (eval echo configure:4041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4041   rm -rf conftest*
4042   eval "ac_cv_func_$ac_func=yes"
4043 else
4044   echo "configure: failed program was:" >&5
4045   cat conftest.$ac_ext >&5
4046   rm -rf conftest*
4047   eval "ac_cv_func_$ac_func=no"
4048 fi
4049 rm -f conftest*
4050 fi
4051
4052 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4053   echo "$ac_t""yes" 1>&6
4054     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4055   cat >> confdefs.h <<EOF
4056 #define $ac_tr_func 1
4057 EOF
4058  
4059 else
4060   echo "$ac_t""no" 1>&6
4061 fi
4062 done
4063
4064
4065                                                 for ac_func in \
4066                                 pthread_setconcurrency \
4067                                 thr_setconcurrency \
4068                         
4069 do
4070 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4071 echo "configure:4072: checking for $ac_func" >&5
4072 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4073   echo $ac_n "(cached) $ac_c" 1>&6
4074 else
4075   cat > conftest.$ac_ext <<EOF
4076 #line 4077 "configure"
4077 #include "confdefs.h"
4078 /* System header to define __stub macros and hopefully few prototypes,
4079     which can conflict with char $ac_func(); below.  */
4080 #include <assert.h>
4081 /* Override any gcc2 internal prototype to avoid an error.  */
4082 /* We use char because int might match the return type of a gcc2
4083     builtin and then its argument prototype would still apply.  */
4084 char $ac_func();
4085
4086 int main() {
4087
4088 /* The GNU C library defines this for functions which it implements
4089     to always fail with ENOSYS.  Some functions are actually named
4090     something starting with __ and the normal name is an alias.  */
4091 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4092 choke me
4093 #else
4094 $ac_func();
4095 #endif
4096
4097 ; return 0; }
4098 EOF
4099 if { (eval echo configure:4100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4100   rm -rf conftest*
4101   eval "ac_cv_func_$ac_func=yes"
4102 else
4103   echo "configure: failed program was:" >&5
4104   cat conftest.$ac_ext >&5
4105   rm -rf conftest*
4106   eval "ac_cv_func_$ac_func=no"
4107 fi
4108 rm -f conftest*
4109 fi
4110
4111 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4112   echo "$ac_t""yes" 1>&6
4113     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4114   cat >> confdefs.h <<EOF
4115 #define $ac_tr_func 1
4116 EOF
4117  
4118 else
4119   echo "$ac_t""no" 1>&6
4120 fi
4121 done
4122
4123
4124                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
4125 echo "configure:4126: checking if pthread_create() works" >&5
4126                         if eval "test \"`echo '$''{'ol_cv_pthread_create_works'+set}'`\" = set"; then
4127   echo $ac_n "(cached) $ac_c" 1>&6
4128 else
4129   
4130                         if test "$cross_compiling" = yes; then
4131                                 ol_cv_pthread_create_works=yes
4132 else
4133   cat > conftest.$ac_ext <<EOF
4134 #line 4135 "configure"
4135 #include "confdefs.h"
4136
4137 #include <pthread.h>
4138 #ifndef NULL
4139 #define NULL (void*)0
4140 #endif
4141
4142 static void *task(p)
4143         void *p;
4144 {
4145         return (void *) (p == NULL);
4146 }
4147
4148 int main(argc, argv)
4149         int argc;
4150         char **argv;
4151 {
4152         pthread_t t;
4153         exit(pthread_create(&t, NULL, task, NULL));
4154 }
4155
4156 EOF
4157 if { (eval echo configure:4158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
4158 then
4159   ol_cv_pthread_create_works=yes
4160 else
4161   echo "configure: failed program was:" >&5
4162   cat conftest.$ac_ext >&5
4163   rm -fr conftest*
4164   ol_cv_pthread_create_works=no
4165 fi
4166 rm -fr conftest*
4167 fi
4168
4169 fi
4170
4171                         echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
4172
4173                         if test $ol_cv_pthread_create_works = no ; then
4174                                 { echo "configure: error: pthread.h and pthread_create are not compatible" 1>&2; exit 1; }
4175                         fi
4176
4177                                                 if test $ol_with_yielding_select = auto ; then
4178                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
4179 echo "configure:4180: checking if select yields when using pthreads" >&5
4180                                 if eval "test \"`echo '$''{'ol_cv_pthread_select_yields'+set}'`\" = set"; then
4181   echo $ac_n "(cached) $ac_c" 1>&6
4182 else
4183   
4184                                 if test "$cross_compiling" = yes; then
4185   
4186                                 { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
4187 else
4188   cat > conftest.$ac_ext <<EOF
4189 #line 4190 "configure"
4190 #include "confdefs.h"
4191
4192 #include <sys/types.h>
4193 #include <sys/time.h>
4194 #include <unistd.h>
4195 #include <pthread.h>
4196 #ifndef NULL
4197 #define NULL (void*) 0
4198 #endif
4199
4200 static int fildes[2];
4201
4202 static void *task(p)
4203         void *p;
4204 {
4205         int i;
4206         struct timeval tv;
4207
4208         fd_set rfds;
4209
4210         tv.tv_sec=10;
4211         tv.tv_usec=0;
4212
4213         FD_ZERO(&rfds);
4214         FD_SET(fildes[0], &rfds);
4215
4216         /* we're not interested in any fds */
4217         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
4218
4219         if(i < 0) {
4220                 perror("select");
4221                 exit(0);
4222         }
4223
4224         exit(1); /* if we exit here, the select blocked the whole process */
4225 }
4226
4227 int main(argc, argv)
4228         int argc;
4229         char **argv;
4230 {
4231         pthread_t t;
4232
4233         /* create a pipe to select */
4234         if(pipe(&fildes[0])) {
4235                 perror("select");
4236                 exit(0);
4237         }
4238
4239 #ifdef HAVE_PTHREAD_SETCONCURRENCY
4240         (void) pthread_setconcurrency(2);
4241 #else
4242 #ifdef HAVE_THR_SETCONCURRENCY
4243         /* Set Solaris LWP concurrency to 2 */
4244         thr_setconcurrency(2);
4245 #endif
4246 #endif
4247
4248         pthread_create(&t, NULL, task, NULL);
4249
4250 #if HAVE_SCHED_YIELD
4251         sched_yield();  /* make sure task runs first */
4252 #else
4253 #ifdef HAVE_PTHREAD_YIELD
4254         pthread_yield();        /* make sure task runs first */
4255 #endif
4256 #endif
4257         exit(0);
4258 }
4259 EOF
4260 if { (eval echo configure:4261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
4261 then
4262   ol_cv_pthread_select_yields=yes
4263 else
4264   echo "configure: failed program was:" >&5
4265   cat conftest.$ac_ext >&5
4266   rm -fr conftest*
4267   ol_cv_pthread_select_yields=no
4268 fi
4269 rm -fr conftest*
4270 fi
4271
4272 fi
4273
4274                                 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
4275
4276                                 if test $ol_cv_pthread_select_yields = yes ; then
4277                                         ol_with_yielding_select=yes
4278                                 fi
4279                         fi
4280
4281                                                                                                                                                 for ac_func in \
4282                                 strtok_r \
4283                                 gmtime_r \
4284                                 gethostbyaddr_r gethostbyname_r \
4285                                 feof_unlocked unlocked_feof \
4286                                 putc_unlocked unlocked_putc \
4287                                 flockfile ftrylockfile \
4288                         
4289 do
4290 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4291 echo "configure:4292: checking for $ac_func" >&5
4292 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4293   echo $ac_n "(cached) $ac_c" 1>&6
4294 else
4295   cat > conftest.$ac_ext <<EOF
4296 #line 4297 "configure"
4297 #include "confdefs.h"
4298 /* System header to define __stub macros and hopefully few prototypes,
4299     which can conflict with char $ac_func(); below.  */
4300 #include <assert.h>
4301 /* Override any gcc2 internal prototype to avoid an error.  */
4302 /* We use char because int might match the return type of a gcc2
4303     builtin and then its argument prototype would still apply.  */
4304 char $ac_func();
4305
4306 int main() {
4307
4308 /* The GNU C library defines this for functions which it implements
4309     to always fail with ENOSYS.  Some functions are actually named
4310     something starting with __ and the normal name is an alias.  */
4311 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4312 choke me
4313 #else
4314 $ac_func();
4315 #endif
4316
4317 ; return 0; }
4318 EOF
4319 if { (eval echo configure:4320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4320   rm -rf conftest*
4321   eval "ac_cv_func_$ac_func=yes"
4322 else
4323   echo "configure: failed program was:" >&5
4324   cat conftest.$ac_ext >&5
4325   rm -rf conftest*
4326   eval "ac_cv_func_$ac_func=no"
4327 fi
4328 rm -f conftest*
4329 fi
4330
4331 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4332   echo "$ac_t""yes" 1>&6
4333     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4334   cat >> confdefs.h <<EOF
4335 #define $ac_tr_func 1
4336 EOF
4337  
4338 else
4339   echo "$ac_t""no" 1>&6
4340 fi
4341 done
4342
4343
4344                                                 CPPFLAGS="$save_CPPFLAGS"
4345                         LIBS="$save_LIBS"
4346                 else
4347                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
4348                 fi
4349         fi
4350
4351         if test $ol_with_threads = posix ; then
4352                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
4353         fi
4354 fi
4355
4356 if test $ol_with_threads = auto -o $ol_with_threads = yes \
4357         -o $ol_with_threads = mach ; then
4358
4359                 for ac_hdr in mach/cthreads.h
4360 do
4361 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4362 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4363 echo "configure:4364: checking for $ac_hdr" >&5
4364 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4365   echo $ac_n "(cached) $ac_c" 1>&6
4366 else
4367   cat > conftest.$ac_ext <<EOF
4368 #line 4369 "configure"
4369 #include "confdefs.h"
4370 #include <$ac_hdr>
4371 EOF
4372 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4373 { (eval echo configure:4374: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4374 ac_err=`grep -v '^ *+' conftest.out`
4375 if test -z "$ac_err"; then
4376   rm -rf conftest*
4377   eval "ac_cv_header_$ac_safe=yes"
4378 else
4379   echo "$ac_err" >&5
4380   echo "configure: failed program was:" >&5
4381   cat conftest.$ac_ext >&5
4382   rm -rf conftest*
4383   eval "ac_cv_header_$ac_safe=no"
4384 fi
4385 rm -f conftest*
4386 fi
4387 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4388   echo "$ac_t""yes" 1>&6
4389     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4390   cat >> confdefs.h <<EOF
4391 #define $ac_tr_hdr 1
4392 EOF
4393  
4394 else
4395   echo "$ac_t""no" 1>&6
4396 fi
4397 done
4398
4399         if test $ac_cv_header_mach_cthreads_h = yes ; then
4400                 ol_with_threads=found
4401
4402                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
4403 echo "configure:4404: checking for cthread_fork" >&5
4404 if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
4405   echo $ac_n "(cached) $ac_c" 1>&6
4406 else
4407   cat > conftest.$ac_ext <<EOF
4408 #line 4409 "configure"
4409 #include "confdefs.h"
4410 /* System header to define __stub macros and hopefully few prototypes,
4411     which can conflict with char cthread_fork(); below.  */
4412 #include <assert.h>
4413 /* Override any gcc2 internal prototype to avoid an error.  */
4414 /* We use char because int might match the return type of a gcc2
4415     builtin and then its argument prototype would still apply.  */
4416 char cthread_fork();
4417
4418 int main() {
4419
4420 /* The GNU C library defines this for functions which it implements
4421     to always fail with ENOSYS.  Some functions are actually named
4422     something starting with __ and the normal name is an alias.  */
4423 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
4424 choke me
4425 #else
4426 cthread_fork();
4427 #endif
4428
4429 ; return 0; }
4430 EOF
4431 if { (eval echo configure:4432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4432   rm -rf conftest*
4433   eval "ac_cv_func_cthread_fork=yes"
4434 else
4435   echo "configure: failed program was:" >&5
4436   cat conftest.$ac_ext >&5
4437   rm -rf conftest*
4438   eval "ac_cv_func_cthread_fork=no"
4439 fi
4440 rm -f conftest*
4441 fi
4442
4443 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
4444   echo "$ac_t""yes" 1>&6
4445   ol_link_threads=yes
4446 else
4447   echo "$ac_t""no" 1>&6
4448 fi
4449
4450
4451                 if test $ol_link_threads = no ; then
4452                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
4453 echo "configure:4454: checking for cthread_fork with -all_load" >&5
4454 if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
4455   echo $ac_n "(cached) $ac_c" 1>&6
4456 else
4457   
4458                                                                 save_LIBS="$LIBS"
4459                                 LIBS="-all_load $LIBS"
4460                                 cat > conftest.$ac_ext <<EOF
4461 #line 4462 "configure"
4462 #include "confdefs.h"
4463 #include <mach/cthreads.h>
4464 int main() {
4465
4466                                         cthread_fork((void *)0, (void *)0);
4467                                         
4468 ; return 0; }
4469 EOF
4470 if { (eval echo configure:4471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4471   rm -rf conftest*
4472   ol_cv_cthread_all_load=yes
4473 else
4474   echo "configure: failed program was:" >&5
4475   cat conftest.$ac_ext >&5
4476   rm -rf conftest*
4477   ol_cv_cthread_all_load=no
4478 fi
4479 rm -f conftest*
4480                                                                 LIBS="$save_LIBS"
4481                         
4482 fi
4483
4484 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
4485
4486                         if test $ol_cv_cthread_all_load = yes ; then
4487                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
4488                                 ol_link_threads=mach
4489                         fi
4490                 fi
4491
4492                 if test $ol_link_threads != no ; then
4493                         : check for cthread specific functionality here
4494                         cat >> confdefs.h <<\EOF
4495 #define HAVE_MACH_CTHREADS 1
4496 EOF
4497
4498                 else
4499                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
4500                 fi
4501         fi
4502
4503         if test $ol_with_threads = mach ; then
4504                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
4505         fi
4506 fi
4507
4508 if test $ol_with_threads = auto -o $ol_with_threads = yes \
4509         -o $ol_with_threads = lwp ; then
4510
4511                 for ac_hdr in thread.h synch.h
4512 do
4513 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4514 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4515 echo "configure:4516: checking for $ac_hdr" >&5
4516 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4517   echo $ac_n "(cached) $ac_c" 1>&6
4518 else
4519   cat > conftest.$ac_ext <<EOF
4520 #line 4521 "configure"
4521 #include "confdefs.h"
4522 #include <$ac_hdr>
4523 EOF
4524 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4525 { (eval echo configure:4526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4526 ac_err=`grep -v '^ *+' conftest.out`
4527 if test -z "$ac_err"; then
4528   rm -rf conftest*
4529   eval "ac_cv_header_$ac_safe=yes"
4530 else
4531   echo "$ac_err" >&5
4532   echo "configure: failed program was:" >&5
4533   cat conftest.$ac_ext >&5
4534   rm -rf conftest*
4535   eval "ac_cv_header_$ac_safe=no"
4536 fi
4537 rm -f conftest*
4538 fi
4539 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4540   echo "$ac_t""yes" 1>&6
4541     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4542   cat >> confdefs.h <<EOF
4543 #define $ac_tr_hdr 1
4544 EOF
4545  
4546 else
4547   echo "$ac_t""no" 1>&6
4548 fi
4549 done
4550
4551         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
4552                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
4553 echo "configure:4554: checking for thr_create in -lthread" >&5
4554 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
4555 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4556   echo $ac_n "(cached) $ac_c" 1>&6
4557 else
4558   ac_save_LIBS="$LIBS"
4559 LIBS="-lthread  $LIBS"
4560 cat > conftest.$ac_ext <<EOF
4561 #line 4562 "configure"
4562 #include "confdefs.h"
4563 /* Override any gcc2 internal prototype to avoid an error.  */
4564 /* We use char because int might match the return type of a gcc2
4565     builtin and then its argument prototype would still apply.  */
4566 char thr_create();
4567
4568 int main() {
4569 thr_create()
4570 ; return 0; }
4571 EOF
4572 if { (eval echo configure:4573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4573   rm -rf conftest*
4574   eval "ac_cv_lib_$ac_lib_var=yes"
4575 else
4576   echo "configure: failed program was:" >&5
4577   cat conftest.$ac_ext >&5
4578   rm -rf conftest*
4579   eval "ac_cv_lib_$ac_lib_var=no"
4580 fi
4581 rm -f conftest*
4582 LIBS="$ac_save_LIBS"
4583
4584 fi
4585 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4586   echo "$ac_t""yes" 1>&6
4587   have_thr=yes
4588 else
4589   echo "$ac_t""no" 1>&6
4590 have_thr=no
4591 fi
4592
4593
4594                 if test $have_thr = yes ; then
4595                         cat >> confdefs.h <<\EOF
4596 #define HAVE_THR 1
4597 EOF
4598
4599                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
4600                         ol_link_threads=thr
4601
4602                         if test $ol_with_yielding_select = auto ; then
4603                                 ol_with_yielding_select=yes
4604                         fi
4605                 fi
4606         fi
4607
4608                 for ac_hdr in lwp/lwp.h
4609 do
4610 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4611 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4612 echo "configure:4613: checking for $ac_hdr" >&5
4613 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4614   echo $ac_n "(cached) $ac_c" 1>&6
4615 else
4616   cat > conftest.$ac_ext <<EOF
4617 #line 4618 "configure"
4618 #include "confdefs.h"
4619 #include <$ac_hdr>
4620 EOF
4621 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4622 { (eval echo configure:4623: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4623 ac_err=`grep -v '^ *+' conftest.out`
4624 if test -z "$ac_err"; then
4625   rm -rf conftest*
4626   eval "ac_cv_header_$ac_safe=yes"
4627 else
4628   echo "$ac_err" >&5
4629   echo "configure: failed program was:" >&5
4630   cat conftest.$ac_ext >&5
4631   rm -rf conftest*
4632   eval "ac_cv_header_$ac_safe=no"
4633 fi
4634 rm -f conftest*
4635 fi
4636 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4637   echo "$ac_t""yes" 1>&6
4638     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4639   cat >> confdefs.h <<EOF
4640 #define $ac_tr_hdr 1
4641 EOF
4642  
4643 else
4644   echo "$ac_t""no" 1>&6
4645 fi
4646 done
4647
4648         if test $ac_cv_header_lwp_lwp_h = yes ; then
4649                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
4650 echo "configure:4651: checking for lwp_create in -llwp" >&5
4651 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
4652 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4653   echo $ac_n "(cached) $ac_c" 1>&6
4654 else
4655   ac_save_LIBS="$LIBS"
4656 LIBS="-llwp  $LIBS"
4657 cat > conftest.$ac_ext <<EOF
4658 #line 4659 "configure"
4659 #include "confdefs.h"
4660 /* Override any gcc2 internal prototype to avoid an error.  */
4661 /* We use char because int might match the return type of a gcc2
4662     builtin and then its argument prototype would still apply.  */
4663 char lwp_create();
4664
4665 int main() {
4666 lwp_create()
4667 ; return 0; }
4668 EOF
4669 if { (eval echo configure:4670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4670   rm -rf conftest*
4671   eval "ac_cv_lib_$ac_lib_var=yes"
4672 else
4673   echo "configure: failed program was:" >&5
4674   cat conftest.$ac_ext >&5
4675   rm -rf conftest*
4676   eval "ac_cv_lib_$ac_lib_var=no"
4677 fi
4678 rm -f conftest*
4679 LIBS="$ac_save_LIBS"
4680
4681 fi
4682 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4683   echo "$ac_t""yes" 1>&6
4684   have_lwp=yes
4685 else
4686   echo "$ac_t""no" 1>&6
4687 have_lwp=no
4688 fi
4689
4690
4691                 if test $have_lwp = yes ; then
4692                         cat >> confdefs.h <<\EOF
4693 #define HAVE_LWP 1
4694 EOF
4695
4696                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
4697                         ol_link_threads=lwp
4698
4699                         if test $ol_with_yielding_select = auto ; then
4700                                 ol_with_yielding_select=no
4701                         fi
4702                 fi
4703         fi
4704 fi
4705
4706 if test $ol_with_yielding_select = yes ; then
4707         cat >> confdefs.h <<\EOF
4708 #define HAVE_YIELDING_SELECT 1
4709 EOF
4710
4711 fi
4712
4713 if test $ol_with_threads = manual ; then
4714                 ol_link_threads=yes
4715
4716         echo "configure: warning: thread defines and link options must be set manually" 1>&2
4717
4718         for ac_hdr in pthread.h sched.h
4719 do
4720 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4721 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4722 echo "configure:4723: checking for $ac_hdr" >&5
4723 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4724   echo $ac_n "(cached) $ac_c" 1>&6
4725 else
4726   cat > conftest.$ac_ext <<EOF
4727 #line 4728 "configure"
4728 #include "confdefs.h"
4729 #include <$ac_hdr>
4730 EOF
4731 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4732 { (eval echo configure:4733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4733 ac_err=`grep -v '^ *+' conftest.out`
4734 if test -z "$ac_err"; then
4735   rm -rf conftest*
4736   eval "ac_cv_header_$ac_safe=yes"
4737 else
4738   echo "$ac_err" >&5
4739   echo "configure: failed program was:" >&5
4740   cat conftest.$ac_ext >&5
4741   rm -rf conftest*
4742   eval "ac_cv_header_$ac_safe=no"
4743 fi
4744 rm -f conftest*
4745 fi
4746 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4747   echo "$ac_t""yes" 1>&6
4748     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4749   cat >> confdefs.h <<EOF
4750 #define $ac_tr_hdr 1
4751 EOF
4752  
4753 else
4754   echo "$ac_t""no" 1>&6
4755 fi
4756 done
4757
4758         for ac_func in sched_yield pthread_yield
4759 do
4760 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4761 echo "configure:4762: checking for $ac_func" >&5
4762 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4763   echo $ac_n "(cached) $ac_c" 1>&6
4764 else
4765   cat > conftest.$ac_ext <<EOF
4766 #line 4767 "configure"
4767 #include "confdefs.h"
4768 /* System header to define __stub macros and hopefully few prototypes,
4769     which can conflict with char $ac_func(); below.  */
4770 #include <assert.h>
4771 /* Override any gcc2 internal prototype to avoid an error.  */
4772 /* We use char because int might match the return type of a gcc2
4773     builtin and then its argument prototype would still apply.  */
4774 char $ac_func();
4775
4776 int main() {
4777
4778 /* The GNU C library defines this for functions which it implements
4779     to always fail with ENOSYS.  Some functions are actually named
4780     something starting with __ and the normal name is an alias.  */
4781 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4782 choke me
4783 #else
4784 $ac_func();
4785 #endif
4786
4787 ; return 0; }
4788 EOF
4789 if { (eval echo configure:4790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4790   rm -rf conftest*
4791   eval "ac_cv_func_$ac_func=yes"
4792 else
4793   echo "configure: failed program was:" >&5
4794   cat conftest.$ac_ext >&5
4795   rm -rf conftest*
4796   eval "ac_cv_func_$ac_func=no"
4797 fi
4798 rm -f conftest*
4799 fi
4800
4801 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4802   echo "$ac_t""yes" 1>&6
4803     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4804   cat >> confdefs.h <<EOF
4805 #define $ac_tr_func 1
4806 EOF
4807  
4808 else
4809   echo "$ac_t""no" 1>&6
4810 fi
4811 done
4812
4813         
4814 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
4815 echo "configure:4816: checking for LinuxThreads" >&5
4816 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
4817   echo $ac_n "(cached) $ac_c" 1>&6
4818 else
4819   
4820         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
4821         if test "$res" -gt 0 ; then
4822                 ol_cv_linux_threads=yes
4823         else
4824                 ol_cv_linux_threads=no
4825         fi
4826
4827 fi
4828
4829 echo "$ac_t""$ol_cv_linux_threads" 1>&6
4830
4831
4832         for ac_hdr in mach/cthreads.h
4833 do
4834 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4835 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4836 echo "configure:4837: checking for $ac_hdr" >&5
4837 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4838   echo $ac_n "(cached) $ac_c" 1>&6
4839 else
4840   cat > conftest.$ac_ext <<EOF
4841 #line 4842 "configure"
4842 #include "confdefs.h"
4843 #include <$ac_hdr>
4844 EOF
4845 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4846 { (eval echo configure:4847: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4847 ac_err=`grep -v '^ *+' conftest.out`
4848 if test -z "$ac_err"; then
4849   rm -rf conftest*
4850   eval "ac_cv_header_$ac_safe=yes"
4851 else
4852   echo "$ac_err" >&5
4853   echo "configure: failed program was:" >&5
4854   cat conftest.$ac_ext >&5
4855   rm -rf conftest*
4856   eval "ac_cv_header_$ac_safe=no"
4857 fi
4858 rm -f conftest*
4859 fi
4860 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4861   echo "$ac_t""yes" 1>&6
4862     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4863   cat >> confdefs.h <<EOF
4864 #define $ac_tr_hdr 1
4865 EOF
4866  
4867 else
4868   echo "$ac_t""no" 1>&6
4869 fi
4870 done
4871
4872         for ac_hdr in lwp/lwp.h
4873 do
4874 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4875 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4876 echo "configure:4877: checking for $ac_hdr" >&5
4877 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4878   echo $ac_n "(cached) $ac_c" 1>&6
4879 else
4880   cat > conftest.$ac_ext <<EOF
4881 #line 4882 "configure"
4882 #include "confdefs.h"
4883 #include <$ac_hdr>
4884 EOF
4885 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4886 { (eval echo configure:4887: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4887 ac_err=`grep -v '^ *+' conftest.out`
4888 if test -z "$ac_err"; then
4889   rm -rf conftest*
4890   eval "ac_cv_header_$ac_safe=yes"
4891 else
4892   echo "$ac_err" >&5
4893   echo "configure: failed program was:" >&5
4894   cat conftest.$ac_ext >&5
4895   rm -rf conftest*
4896   eval "ac_cv_header_$ac_safe=no"
4897 fi
4898 rm -f conftest*
4899 fi
4900 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4901   echo "$ac_t""yes" 1>&6
4902     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4903   cat >> confdefs.h <<EOF
4904 #define $ac_tr_hdr 1
4905 EOF
4906  
4907 else
4908   echo "$ac_t""no" 1>&6
4909 fi
4910 done
4911
4912         for ac_hdr in thread.h synch.h
4913 do
4914 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4915 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4916 echo "configure:4917: checking for $ac_hdr" >&5
4917 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4918   echo $ac_n "(cached) $ac_c" 1>&6
4919 else
4920   cat > conftest.$ac_ext <<EOF
4921 #line 4922 "configure"
4922 #include "confdefs.h"
4923 #include <$ac_hdr>
4924 EOF
4925 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4926 { (eval echo configure:4927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4927 ac_err=`grep -v '^ *+' conftest.out`
4928 if test -z "$ac_err"; then
4929   rm -rf conftest*
4930   eval "ac_cv_header_$ac_safe=yes"
4931 else
4932   echo "$ac_err" >&5
4933   echo "configure: failed program was:" >&5
4934   cat conftest.$ac_ext >&5
4935   rm -rf conftest*
4936   eval "ac_cv_header_$ac_safe=no"
4937 fi
4938 rm -f conftest*
4939 fi
4940 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4941   echo "$ac_t""yes" 1>&6
4942     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4943   cat >> confdefs.h <<EOF
4944 #define $ac_tr_hdr 1
4945 EOF
4946  
4947 else
4948   echo "$ac_t""no" 1>&6
4949 fi
4950 done
4951
4952 fi
4953
4954 if test $ol_link_threads != no ; then  
4955                         cat >> confdefs.h <<\EOF
4956 #define REENTRANT 1
4957 EOF
4958
4959         cat >> confdefs.h <<\EOF
4960 #define _REENTRANT 1
4961 EOF
4962
4963         cat >> confdefs.h <<\EOF
4964 #define THREAD_SAFE 1
4965 EOF
4966
4967         cat >> confdefs.h <<\EOF
4968 #define _THREAD_SAFE 1
4969 EOF
4970
4971         cat >> confdefs.h <<\EOF
4972 #define THREADSAFE 1
4973 EOF
4974
4975         cat >> confdefs.h <<\EOF
4976 #define _THREADSAFE 1
4977 EOF
4978
4979
4980                                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
4981 echo "configure:4982: checking for thread specific errno" >&5
4982 if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
4983   echo $ac_n "(cached) $ac_c" 1>&6
4984 else
4985   
4986                 cat > conftest.$ac_ext <<EOF
4987 #line 4988 "configure"
4988 #include "confdefs.h"
4989
4990 #include <errno.h>
4991                         
4992 int main() {
4993
4994 int x = errno;
4995                         
4996 ; return 0; }
4997 EOF
4998 if { (eval echo configure:4999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4999   rm -rf conftest*
5000   ol_cv_errno_thread_specific=yes
5001 else
5002   echo "configure: failed program was:" >&5
5003   cat conftest.$ac_ext >&5
5004   rm -rf conftest*
5005   ol_cv_errno_thread_specific=no
5006 fi
5007 rm -f conftest*
5008         
5009 fi
5010
5011 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
5012
5013         if test $ol_cv_errno_thread_specific != yes ; then
5014                 LIBS="$LTHREAD_LIBS $LIBS"
5015                 LTHREAD_LIBS=""
5016         fi
5017 fi  
5018
5019
5020 if test $ol_link_threads = no ; then
5021         if test $ol_with_threads = yes ; then
5022                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
5023         fi
5024
5025         if test $ol_with_threads = auto ; then
5026                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
5027                 ol_with_threads=no
5028         fi
5029
5030         cat >> confdefs.h <<\EOF
5031 #define NO_THREADS 1
5032 EOF
5033
5034         LTHREAD_LIBS=""
5035 fi
5036
5037 ol_link_ldbm=no 
5038 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
5039         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
5040 echo "configure:5041: checking for DB2 library" >&5
5041 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
5042   echo $ac_n "(cached) $ac_c" 1>&6
5043 else
5044         ol_LIBS="$LIBS"
5045         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
5046 echo "configure:5047: checking for db_open in -ldb" >&5
5047 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
5048 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5049   echo $ac_n "(cached) $ac_c" 1>&6
5050 else
5051   ac_save_LIBS="$LIBS"
5052 LIBS="-ldb  $LIBS"
5053 cat > conftest.$ac_ext <<EOF
5054 #line 5055 "configure"
5055 #include "confdefs.h"
5056 /* Override any gcc2 internal prototype to avoid an error.  */
5057 /* We use char because int might match the return type of a gcc2
5058     builtin and then its argument prototype would still apply.  */
5059 char db_open();
5060
5061 int main() {
5062 db_open()
5063 ; return 0; }
5064 EOF
5065 if { (eval echo configure:5066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5066   rm -rf conftest*
5067   eval "ac_cv_lib_$ac_lib_var=yes"
5068 else
5069   echo "configure: failed program was:" >&5
5070   cat conftest.$ac_ext >&5
5071   rm -rf conftest*
5072   eval "ac_cv_lib_$ac_lib_var=no"
5073 fi
5074 rm -f conftest*
5075 LIBS="$ac_save_LIBS"
5076
5077 fi
5078 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5079   echo "$ac_t""yes" 1>&6
5080   ol_cv_lib_db2=-ldb
5081 else
5082   echo "$ac_t""no" 1>&6
5083 ol_cv_lib_db2=no
5084 fi
5085
5086         LIBS="$ol_LIBS"
5087
5088 fi
5089
5090 echo "$ac_t""$ol_cv_lib_db2" 1>&6
5091
5092 for ac_hdr in db.h
5093 do
5094 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5095 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5096 echo "configure:5097: checking for $ac_hdr" >&5
5097 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5098   echo $ac_n "(cached) $ac_c" 1>&6
5099 else
5100   cat > conftest.$ac_ext <<EOF
5101 #line 5102 "configure"
5102 #include "confdefs.h"
5103 #include <$ac_hdr>
5104 EOF
5105 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5106 { (eval echo configure:5107: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5107 ac_err=`grep -v '^ *+' conftest.out`
5108 if test -z "$ac_err"; then
5109   rm -rf conftest*
5110   eval "ac_cv_header_$ac_safe=yes"
5111 else
5112   echo "$ac_err" >&5
5113   echo "configure: failed program was:" >&5
5114   cat conftest.$ac_ext >&5
5115   rm -rf conftest*
5116   eval "ac_cv_header_$ac_safe=no"
5117 fi
5118 rm -f conftest*
5119 fi
5120 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5121   echo "$ac_t""yes" 1>&6
5122     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5123   cat >> confdefs.h <<EOF
5124 #define $ac_tr_hdr 1
5125 EOF
5126  
5127 else
5128   echo "$ac_t""no" 1>&6
5129 fi
5130 done
5131
5132 if test $ac_cv_header_db_h = yes ; then
5133         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
5134 echo "configure:5135: checking if db.h is DB2" >&5
5135 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
5136   echo $ac_n "(cached) $ac_c" 1>&6
5137 else
5138   
5139                 cat > conftest.$ac_ext <<EOF
5140 #line 5141 "configure"
5141 #include "confdefs.h"
5142
5143 #                       include <db.h>
5144                         /* this check could be improved */
5145 #                       ifdef DB_VERSION_MAJOR
5146 #                               if DB_VERSION_MAJOR == 2
5147                                         __db_version_2
5148 #                               endif
5149 #                       endif
5150                 
5151 EOF
5152 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5153   egrep "__db_version_2" >/dev/null 2>&1; then
5154   rm -rf conftest*
5155   ol_cv_header_db2=yes
5156 else
5157   rm -rf conftest*
5158   ol_cv_header_db2=no
5159 fi
5160 rm -f conftest*
5161
5162 fi
5163
5164 echo "$ac_t""$ol_cv_header_db2" 1>&6
5165 else
5166         ol_cv_header_db2=no
5167 fi
5168
5169
5170  
5171  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
5172 echo "configure:5173: checking for Berkeley DB2" >&5
5173 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
5174   echo $ac_n "(cached) $ac_c" 1>&6
5175 else
5176   
5177         if test $ol_cv_lib_db2 = no -o $ol_cv_header_db2 = no ; then
5178                 ol_cv_berkeley_db2=no
5179         else
5180                 ol_cv_berkeley_db2=yes
5181         fi
5182
5183 fi
5184
5185 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
5186  if test $ol_cv_berkeley_db2 = yes ; then
5187         cat >> confdefs.h <<\EOF
5188 #define HAVE_BERKELEY_DB2 1
5189 EOF
5190
5191  fi
5192
5193
5194         if test $ol_cv_berkeley_db2 = yes ; then
5195                 ol_link_ldbm=db2
5196                 ol_with_ldbm_api=db2
5197
5198                 if test $ol_with_ldbm_type = hash ; then
5199                         cat >> confdefs.h <<\EOF
5200 #define LDBM_USE_DBHASH 1
5201 EOF
5202
5203                 else
5204                         cat >> confdefs.h <<\EOF
5205 #define LDBM_USE_DBBTREE 1
5206 EOF
5207
5208                 fi
5209
5210                                                 if test $ol_cv_lib_db2 != yes ; then
5211                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
5212                 fi
5213         fi
5214 fi
5215
5216 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
5217         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
5218 echo "configure:5219: checking for Berkeley DB library" >&5
5219 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
5220   echo $ac_n "(cached) $ac_c" 1>&6
5221 else
5222         ol_LIBS="$LIBS"
5223         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
5224 echo "configure:5225: checking for dbopen" >&5
5225 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
5226   echo $ac_n "(cached) $ac_c" 1>&6
5227 else
5228   cat > conftest.$ac_ext <<EOF
5229 #line 5230 "configure"
5230 #include "confdefs.h"
5231 /* System header to define __stub macros and hopefully few prototypes,
5232     which can conflict with char dbopen(); below.  */
5233 #include <assert.h>
5234 /* Override any gcc2 internal prototype to avoid an error.  */
5235 /* We use char because int might match the return type of a gcc2
5236     builtin and then its argument prototype would still apply.  */
5237 char dbopen();
5238
5239 int main() {
5240
5241 /* The GNU C library defines this for functions which it implements
5242     to always fail with ENOSYS.  Some functions are actually named
5243     something starting with __ and the normal name is an alias.  */
5244 #if defined (__stub_dbopen) || defined (__stub___dbopen)
5245 choke me
5246 #else
5247 dbopen();
5248 #endif
5249
5250 ; return 0; }
5251 EOF
5252 if { (eval echo configure:5253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5253   rm -rf conftest*
5254   eval "ac_cv_func_dbopen=yes"
5255 else
5256   echo "configure: failed program was:" >&5
5257   cat conftest.$ac_ext >&5
5258   rm -rf conftest*
5259   eval "ac_cv_func_dbopen=no"
5260 fi
5261 rm -f conftest*
5262 fi
5263
5264 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
5265   echo "$ac_t""yes" 1>&6
5266   ol_cv_lib_db=yes
5267 else
5268   echo "$ac_t""no" 1>&6
5269
5270                 echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
5271 echo "configure:5272: checking for dbopen in -ldb" >&5
5272 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
5273 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5274   echo $ac_n "(cached) $ac_c" 1>&6
5275 else
5276   ac_save_LIBS="$LIBS"
5277 LIBS="-ldb  $LIBS"
5278 cat > conftest.$ac_ext <<EOF
5279 #line 5280 "configure"
5280 #include "confdefs.h"
5281 /* Override any gcc2 internal prototype to avoid an error.  */
5282 /* We use char because int might match the return type of a gcc2
5283     builtin and then its argument prototype would still apply.  */
5284 char dbopen();
5285
5286 int main() {
5287 dbopen()
5288 ; return 0; }
5289 EOF
5290 if { (eval echo configure:5291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5291   rm -rf conftest*
5292   eval "ac_cv_lib_$ac_lib_var=yes"
5293 else
5294   echo "configure: failed program was:" >&5
5295   cat conftest.$ac_ext >&5
5296   rm -rf conftest*
5297   eval "ac_cv_lib_$ac_lib_var=no"
5298 fi
5299 rm -f conftest*
5300 LIBS="$ac_save_LIBS"
5301
5302 fi
5303 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5304   echo "$ac_t""yes" 1>&6
5305   ol_cv_lib_db=-ldb
5306 else
5307   echo "$ac_t""no" 1>&6
5308 ol_cv_lib_db=no
5309 fi
5310
5311         
5312 fi
5313
5314         LIBS="$ol_LIBS"
5315
5316 fi
5317
5318 echo "$ac_t""$ol_cv_lib_db" 1>&6
5319
5320
5321 for ac_hdr in db_185.h
5322 do
5323 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5324 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5325 echo "configure:5326: checking for $ac_hdr" >&5
5326 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5327   echo $ac_n "(cached) $ac_c" 1>&6
5328 else
5329   cat > conftest.$ac_ext <<EOF
5330 #line 5331 "configure"
5331 #include "confdefs.h"
5332 #include <$ac_hdr>
5333 EOF
5334 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5335 { (eval echo configure:5336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5336 ac_err=`grep -v '^ *+' conftest.out`
5337 if test -z "$ac_err"; then
5338   rm -rf conftest*
5339   eval "ac_cv_header_$ac_safe=yes"
5340 else
5341   echo "$ac_err" >&5
5342   echo "configure: failed program was:" >&5
5343   cat conftest.$ac_ext >&5
5344   rm -rf conftest*
5345   eval "ac_cv_header_$ac_safe=no"
5346 fi
5347 rm -f conftest*
5348 fi
5349 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5350   echo "$ac_t""yes" 1>&6
5351     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5352   cat >> confdefs.h <<EOF
5353 #define $ac_tr_hdr 1
5354 EOF
5355  
5356 else
5357   echo "$ac_t""no" 1>&6
5358 fi
5359 done
5360
5361 if test $ol_cv_header_db2 = yes ; then
5362         
5363         ol_cv_header_db=$ac_cv_header_db_185_h
5364 else
5365         ol_cv_header_db=$ac_cv_header_db_h
5366 fi
5367
5368
5369  
5370  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
5371 echo "configure:5372: checking for Berkeley DB" >&5
5372 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
5373   echo $ac_n "(cached) $ac_c" 1>&6
5374 else
5375   
5376         if test $ol_cv_lib_db = no -o $ol_cv_header_db = no ; then
5377                 ol_cv_berkeley_db=no
5378         else
5379                 ol_cv_berkeley_db=yes
5380         fi
5381
5382 fi
5383
5384 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
5385  if test $ol_cv_berkeley_db = yes ; then
5386         cat >> confdefs.h <<\EOF
5387 #define HAVE_BERKELEY_DB 1
5388 EOF
5389
5390  fi
5391
5392
5393         if test $ol_cv_berkeley_db = yes ; then
5394                 ol_link_ldbm=db
5395                 ol_with_ldbm_api=db
5396
5397                 if test $ol_with_ldbm_type = hash ; then
5398                         cat >> confdefs.h <<\EOF
5399 #define LDBM_USE_DBHASH 1
5400 EOF
5401
5402                 else
5403                         cat >> confdefs.h <<\EOF
5404 #define LDBM_USE_DBBTREE 1
5405 EOF
5406
5407                 fi
5408
5409                                                 if test $ol_cv_lib_db != yes ; then
5410                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
5411                 fi
5412         fi
5413 fi
5414
5415 if test $ol_with_ldbm_api = manual ; then
5416                 ol_link_ldbm=yes
5417
5418         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
5419
5420         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
5421 do
5422 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5423 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5424 echo "configure:5425: checking for $ac_hdr" >&5
5425 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5426   echo $ac_n "(cached) $ac_c" 1>&6
5427 else
5428   cat > conftest.$ac_ext <<EOF
5429 #line 5430 "configure"
5430 #include "confdefs.h"
5431 #include <$ac_hdr>
5432 EOF
5433 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5434 { (eval echo configure:5435: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5435 ac_err=`grep -v '^ *+' conftest.out`
5436 if test -z "$ac_err"; then
5437   rm -rf conftest*
5438   eval "ac_cv_header_$ac_safe=yes"
5439 else
5440   echo "$ac_err" >&5
5441   echo "configure: failed program was:" >&5
5442   cat conftest.$ac_ext >&5
5443   rm -rf conftest*
5444   eval "ac_cv_header_$ac_safe=no"
5445 fi
5446 rm -f conftest*
5447 fi
5448 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5449   echo "$ac_t""yes" 1>&6
5450     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5451   cat >> confdefs.h <<EOF
5452 #define $ac_tr_hdr 1
5453 EOF
5454  
5455 else
5456   echo "$ac_t""no" 1>&6
5457 fi
5458 done
5459
5460 fi
5461
5462 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
5463         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
5464         ol_with_ldbm_api=none
5465 fi
5466
5467 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
5468         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
5469 echo "configure:5470: checking for GDBM library" >&5
5470 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
5471   echo $ac_n "(cached) $ac_c" 1>&6
5472 else
5473         ol_LIBS="$LIBS"
5474         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
5475 echo "configure:5476: checking for gdbm_open" >&5
5476 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
5477   echo $ac_n "(cached) $ac_c" 1>&6
5478 else
5479   cat > conftest.$ac_ext <<EOF
5480 #line 5481 "configure"
5481 #include "confdefs.h"
5482 /* System header to define __stub macros and hopefully few prototypes,
5483     which can conflict with char gdbm_open(); below.  */
5484 #include <assert.h>
5485 /* Override any gcc2 internal prototype to avoid an error.  */
5486 /* We use char because int might match the return type of a gcc2
5487     builtin and then its argument prototype would still apply.  */
5488 char gdbm_open();
5489
5490 int main() {
5491
5492 /* The GNU C library defines this for functions which it implements
5493     to always fail with ENOSYS.  Some functions are actually named
5494     something starting with __ and the normal name is an alias.  */
5495 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
5496 choke me
5497 #else
5498 gdbm_open();
5499 #endif
5500
5501 ; return 0; }
5502 EOF
5503 if { (eval echo configure:5504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5504   rm -rf conftest*
5505   eval "ac_cv_func_gdbm_open=yes"
5506 else
5507   echo "configure: failed program was:" >&5
5508   cat conftest.$ac_ext >&5
5509   rm -rf conftest*
5510   eval "ac_cv_func_gdbm_open=no"
5511 fi
5512 rm -f conftest*
5513 fi
5514
5515 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
5516   echo "$ac_t""yes" 1>&6
5517   ol_cv_lib_gdbm=yes
5518 else
5519   echo "$ac_t""no" 1>&6
5520
5521                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
5522 echo "configure:5523: checking for gdbm_open in -lgdbm" >&5
5523 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
5524 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5525   echo $ac_n "(cached) $ac_c" 1>&6
5526 else
5527   ac_save_LIBS="$LIBS"
5528 LIBS="-lgdbm  $LIBS"
5529 cat > conftest.$ac_ext <<EOF
5530 #line 5531 "configure"
5531 #include "confdefs.h"
5532 /* Override any gcc2 internal prototype to avoid an error.  */
5533 /* We use char because int might match the return type of a gcc2
5534     builtin and then its argument prototype would still apply.  */
5535 char gdbm_open();
5536
5537 int main() {
5538 gdbm_open()
5539 ; return 0; }
5540 EOF
5541 if { (eval echo configure:5542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5542   rm -rf conftest*
5543   eval "ac_cv_lib_$ac_lib_var=yes"
5544 else
5545   echo "configure: failed program was:" >&5
5546   cat conftest.$ac_ext >&5
5547   rm -rf conftest*
5548   eval "ac_cv_lib_$ac_lib_var=no"
5549 fi
5550 rm -f conftest*
5551 LIBS="$ac_save_LIBS"
5552
5553 fi
5554 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5555   echo "$ac_t""yes" 1>&6
5556   ol_cv_lib_gdbm=-lgdbm
5557 else
5558   echo "$ac_t""no" 1>&6
5559 ol_cv_lib_gdbm=no
5560 fi
5561
5562         
5563 fi
5564
5565         LIBS="$ol_LIBS"
5566
5567 fi
5568
5569 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
5570
5571
5572  for ac_hdr in gdbm.h
5573 do
5574 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5575 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5576 echo "configure:5577: checking for $ac_hdr" >&5
5577 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5578   echo $ac_n "(cached) $ac_c" 1>&6
5579 else
5580   cat > conftest.$ac_ext <<EOF
5581 #line 5582 "configure"
5582 #include "confdefs.h"
5583 #include <$ac_hdr>
5584 EOF
5585 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5586 { (eval echo configure:5587: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5587 ac_err=`grep -v '^ *+' conftest.out`
5588 if test -z "$ac_err"; then
5589   rm -rf conftest*
5590   eval "ac_cv_header_$ac_safe=yes"
5591 else
5592   echo "$ac_err" >&5
5593   echo "configure: failed program was:" >&5
5594   cat conftest.$ac_ext >&5
5595   rm -rf conftest*
5596   eval "ac_cv_header_$ac_safe=no"
5597 fi
5598 rm -f conftest*
5599 fi
5600 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5601   echo "$ac_t""yes" 1>&6
5602     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5603   cat >> confdefs.h <<EOF
5604 #define $ac_tr_hdr 1
5605 EOF
5606  
5607 else
5608   echo "$ac_t""no" 1>&6
5609 fi
5610 done
5611
5612  echo $ac_n "checking for db""... $ac_c" 1>&6
5613 echo "configure:5614: checking for db" >&5
5614 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
5615   echo $ac_n "(cached) $ac_c" 1>&6
5616 else
5617   
5618         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
5619                 ol_cv_gdbm=no
5620         else
5621                 ol_cv_gdbm=yes
5622         fi
5623
5624 fi
5625
5626 echo "$ac_t""$ol_cv_gdbm" 1>&6
5627  if test $ol_cv_gdbm = yes ; then
5628         cat >> confdefs.h <<\EOF
5629 #define HAVE_GDBM 1
5630 EOF
5631
5632  fi
5633
5634
5635         if test $ol_cv_gdbm = yes ; then
5636                 ol_link_ldbm=gdbm
5637                 ol_with_ldbm_api=gdbm
5638
5639                 if test $ol_cv_lib_gdbm != yes ; then
5640                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
5641                 fi
5642         fi
5643 fi
5644
5645 if test $ol_with_ldbm_api = auto ; then
5646         echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
5647 elif test $ol_with_ldbm_api = ndbm ; then
5648         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
5649 echo "configure:5650: checking for NDBM library" >&5
5650 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
5651   echo $ac_n "(cached) $ac_c" 1>&6
5652 else
5653         ol_LIBS="$LIBS"
5654         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
5655 echo "configure:5656: checking for dbm_open" >&5
5656 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
5657   echo $ac_n "(cached) $ac_c" 1>&6
5658 else
5659   cat > conftest.$ac_ext <<EOF
5660 #line 5661 "configure"
5661 #include "confdefs.h"
5662 /* System header to define __stub macros and hopefully few prototypes,
5663     which can conflict with char dbm_open(); below.  */
5664 #include <assert.h>
5665 /* Override any gcc2 internal prototype to avoid an error.  */
5666 /* We use char because int might match the return type of a gcc2
5667     builtin and then its argument prototype would still apply.  */
5668 char dbm_open();
5669
5670 int main() {
5671
5672 /* The GNU C library defines this for functions which it implements
5673     to always fail with ENOSYS.  Some functions are actually named
5674     something starting with __ and the normal name is an alias.  */
5675 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
5676 choke me
5677 #else
5678 dbm_open();
5679 #endif
5680
5681 ; return 0; }
5682 EOF
5683 if { (eval echo configure:5684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5684   rm -rf conftest*
5685   eval "ac_cv_func_dbm_open=yes"
5686 else
5687   echo "configure: failed program was:" >&5
5688   cat conftest.$ac_ext >&5
5689   rm -rf conftest*
5690   eval "ac_cv_func_dbm_open=no"
5691 fi
5692 rm -f conftest*
5693 fi
5694
5695 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
5696   echo "$ac_t""yes" 1>&6
5697   ol_cv_lib_ndbm=yes
5698 else
5699   echo "$ac_t""no" 1>&6
5700
5701                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
5702 echo "configure:5703: checking for dbm_open in -lndbm" >&5
5703 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
5704 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5705   echo $ac_n "(cached) $ac_c" 1>&6
5706 else
5707   ac_save_LIBS="$LIBS"
5708 LIBS="-lndbm  $LIBS"
5709 cat > conftest.$ac_ext <<EOF
5710 #line 5711 "configure"
5711 #include "confdefs.h"
5712 /* Override any gcc2 internal prototype to avoid an error.  */
5713 /* We use char because int might match the return type of a gcc2
5714     builtin and then its argument prototype would still apply.  */
5715 char dbm_open();
5716
5717 int main() {
5718 dbm_open()
5719 ; return 0; }
5720 EOF
5721 if { (eval echo configure:5722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5722   rm -rf conftest*
5723   eval "ac_cv_lib_$ac_lib_var=yes"
5724 else
5725   echo "configure: failed program was:" >&5
5726   cat conftest.$ac_ext >&5
5727   rm -rf conftest*
5728   eval "ac_cv_lib_$ac_lib_var=no"
5729 fi
5730 rm -f conftest*
5731 LIBS="$ac_save_LIBS"
5732
5733 fi
5734 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5735   echo "$ac_t""yes" 1>&6
5736   ol_cv_lib_ndbm=-lndbm
5737 else
5738   echo "$ac_t""no" 1>&6
5739
5740                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
5741 echo "configure:5742: checking for dbm_open in -ldbm" >&5
5742 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
5743 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5744   echo $ac_n "(cached) $ac_c" 1>&6
5745 else
5746   ac_save_LIBS="$LIBS"
5747 LIBS="-ldbm  $LIBS"
5748 cat > conftest.$ac_ext <<EOF
5749 #line 5750 "configure"
5750 #include "confdefs.h"
5751 /* Override any gcc2 internal prototype to avoid an error.  */
5752 /* We use char because int might match the return type of a gcc2
5753     builtin and then its argument prototype would still apply.  */
5754 char dbm_open();
5755
5756 int main() {
5757 dbm_open()
5758 ; return 0; }
5759 EOF
5760 if { (eval echo configure:5761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5761   rm -rf conftest*
5762   eval "ac_cv_lib_$ac_lib_var=yes"
5763 else
5764   echo "configure: failed program was:" >&5
5765   cat conftest.$ac_ext >&5
5766   rm -rf conftest*
5767   eval "ac_cv_lib_$ac_lib_var=no"
5768 fi
5769 rm -f conftest*
5770 LIBS="$ac_save_LIBS"
5771
5772 fi
5773 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5774   echo "$ac_t""yes" 1>&6
5775   ol_cv_lib_ndbm=-ldbm
5776 else
5777   echo "$ac_t""no" 1>&6
5778 ol_cv_lib_ndbm=no
5779 fi
5780                 
5781 fi
5782
5783         
5784 fi
5785
5786         LIBS="$ol_LIBS"
5787
5788 fi
5789
5790 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
5791
5792
5793  for ac_hdr in ndbm.h
5794 do
5795 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5796 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5797 echo "configure:5798: checking for $ac_hdr" >&5
5798 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5799   echo $ac_n "(cached) $ac_c" 1>&6
5800 else
5801   cat > conftest.$ac_ext <<EOF
5802 #line 5803 "configure"
5803 #include "confdefs.h"
5804 #include <$ac_hdr>
5805 EOF
5806 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5807 { (eval echo configure:5808: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5808 ac_err=`grep -v '^ *+' conftest.out`
5809 if test -z "$ac_err"; then
5810   rm -rf conftest*
5811   eval "ac_cv_header_$ac_safe=yes"
5812 else
5813   echo "$ac_err" >&5
5814   echo "configure: failed program was:" >&5
5815   cat conftest.$ac_ext >&5
5816   rm -rf conftest*
5817   eval "ac_cv_header_$ac_safe=no"
5818 fi
5819 rm -f conftest*
5820 fi
5821 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5822   echo "$ac_t""yes" 1>&6
5823     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5824   cat >> confdefs.h <<EOF
5825 #define $ac_tr_hdr 1
5826 EOF
5827  
5828 else
5829   echo "$ac_t""no" 1>&6
5830 fi
5831 done
5832
5833  echo $ac_n "checking for db""... $ac_c" 1>&6
5834 echo "configure:5835: checking for db" >&5
5835 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
5836   echo $ac_n "(cached) $ac_c" 1>&6
5837 else
5838   
5839         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
5840                 ol_cv_ndbm=no
5841         else
5842                 ol_cv_ndbm=yes
5843         fi
5844
5845 fi
5846
5847 echo "$ac_t""$ol_cv_ndbm" 1>&6
5848  if test $ol_cv_ndbm = yes ; then
5849         cat >> confdefs.h <<\EOF
5850 #define HAVE_NDBM 1
5851 EOF
5852
5853  fi
5854
5855
5856         if test $ol_cv_ndbm = yes ; then
5857                 ol_link_ldbm=ndbm
5858                 ol_with_ldbm_api=ndbm
5859
5860                 if test $ol_cv_lib_ndbm != yes ; then
5861                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
5862                 fi
5863         fi
5864 fi
5865
5866 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
5867         echo "configure: warning: could not find suitable LDBM backend" 1>&2
5868         if test $ol_enable_ldbm = yes ; then
5869                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
5870         fi
5871
5872         echo "configure: warning: disabling LDBM" 1>&2
5873         ol_enable_ldbm=no
5874 fi
5875
5876 if test $ol_enable_wrappers = yes ; then
5877         echo $ac_n "checking for hosts_access in -lwrap""... $ac_c" 1>&6
5878 echo "configure:5879: checking for hosts_access in -lwrap" >&5
5879 ac_lib_var=`echo wrap'_'hosts_access | sed 'y%./+-%__p_%'`
5880 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5881   echo $ac_n "(cached) $ac_c" 1>&6
5882 else
5883   ac_save_LIBS="$LIBS"
5884 LIBS="-lwrap  $LIBS"
5885 cat > conftest.$ac_ext <<EOF
5886 #line 5887 "configure"
5887 #include "confdefs.h"
5888 /* Override any gcc2 internal prototype to avoid an error.  */
5889 /* We use char because int might match the return type of a gcc2
5890     builtin and then its argument prototype would still apply.  */
5891 char hosts_access();
5892
5893 int main() {
5894 hosts_access()
5895 ; return 0; }
5896 EOF
5897 if { (eval echo configure:5898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5898   rm -rf conftest*
5899   eval "ac_cv_lib_$ac_lib_var=yes"
5900 else
5901   echo "configure: failed program was:" >&5
5902   cat conftest.$ac_ext >&5
5903   rm -rf conftest*
5904   eval "ac_cv_lib_$ac_lib_var=no"
5905 fi
5906 rm -f conftest*
5907 LIBS="$ac_save_LIBS"
5908
5909 fi
5910 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5911   echo "$ac_t""yes" 1>&6
5912   have_wrappers=yes
5913 else
5914   echo "$ac_t""no" 1>&6
5915 have_wrappers=no
5916 fi
5917
5918
5919         if test $have_wrappers = yes ; then
5920                 cat >> confdefs.h <<\EOF
5921 #define HAVE_TCPD 1
5922 EOF
5923
5924                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
5925         else
5926                 echo "configure: warning: could not find -lwrap" 1>&2
5927                 if test $ol_enable_wrappers = yes ; then
5928                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
5929                 fi
5930
5931                 echo "configure: warning: disabling wrappers support" 1>&2
5932                 ol_enable_wrappers=no
5933         fi
5934
5935 fi
5936
5937 # ud needs termcap (should insert check here)
5938 ol_link_termcap=no
5939 for ac_hdr in termcap.h ncurses.h
5940 do
5941 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5942 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5943 echo "configure:5944: checking for $ac_hdr" >&5
5944 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5945   echo $ac_n "(cached) $ac_c" 1>&6
5946 else
5947   cat > conftest.$ac_ext <<EOF
5948 #line 5949 "configure"
5949 #include "confdefs.h"
5950 #include <$ac_hdr>
5951 EOF
5952 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5953 { (eval echo configure:5954: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5954 ac_err=`grep -v '^ *+' conftest.out`
5955 if test -z "$ac_err"; then
5956   rm -rf conftest*
5957   eval "ac_cv_header_$ac_safe=yes"
5958 else
5959   echo "$ac_err" >&5
5960   echo "configure: failed program was:" >&5
5961   cat conftest.$ac_ext >&5
5962   rm -rf conftest*
5963   eval "ac_cv_header_$ac_safe=no"
5964 fi
5965 rm -f conftest*
5966 fi
5967 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5968   echo "$ac_t""yes" 1>&6
5969     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5970   cat >> confdefs.h <<EOF
5971 #define $ac_tr_hdr 1
5972 EOF
5973  
5974 else
5975   echo "$ac_t""no" 1>&6
5976 fi
5977 done
5978
5979
5980 if test $ol_link_termcap = no ; then
5981         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
5982 echo "configure:5983: checking for tputs in -ltermcap" >&5
5983 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
5984 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5985   echo $ac_n "(cached) $ac_c" 1>&6
5986 else
5987   ac_save_LIBS="$LIBS"
5988 LIBS="-ltermcap  $LIBS"
5989 cat > conftest.$ac_ext <<EOF
5990 #line 5991 "configure"
5991 #include "confdefs.h"
5992 /* Override any gcc2 internal prototype to avoid an error.  */
5993 /* We use char because int might match the return type of a gcc2
5994     builtin and then its argument prototype would still apply.  */
5995 char tputs();
5996
5997 int main() {
5998 tputs()
5999 ; return 0; }
6000 EOF
6001 if { (eval echo configure:6002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6002   rm -rf conftest*
6003   eval "ac_cv_lib_$ac_lib_var=yes"
6004 else
6005   echo "configure: failed program was:" >&5
6006   cat conftest.$ac_ext >&5
6007   rm -rf conftest*
6008   eval "ac_cv_lib_$ac_lib_var=no"
6009 fi
6010 rm -f conftest*
6011 LIBS="$ac_save_LIBS"
6012
6013 fi
6014 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6015   echo "$ac_t""yes" 1>&6
6016   have_termcap=yes
6017 else
6018   echo "$ac_t""no" 1>&6
6019 have_termcap=no
6020 fi
6021
6022         if test $have_termcap = yes ; then
6023                 cat >> confdefs.h <<\EOF
6024 #define HAVE_TERMCAP 1
6025 EOF
6026
6027                 ol_link_termcap=yes
6028                 TERMCAP_LIBS=-ltermcap
6029         fi
6030 fi
6031
6032 if test $ol_link_termcap = no ; then
6033         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
6034 echo "configure:6035: checking for initscr in -lncurses" >&5
6035 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
6036 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6037   echo $ac_n "(cached) $ac_c" 1>&6
6038 else
6039   ac_save_LIBS="$LIBS"
6040 LIBS="-lncurses  $LIBS"
6041 cat > conftest.$ac_ext <<EOF
6042 #line 6043 "configure"
6043 #include "confdefs.h"
6044 /* Override any gcc2 internal prototype to avoid an error.  */
6045 /* We use char because int might match the return type of a gcc2
6046     builtin and then its argument prototype would still apply.  */
6047 char initscr();
6048
6049 int main() {
6050 initscr()
6051 ; return 0; }
6052 EOF
6053 if { (eval echo configure:6054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6054   rm -rf conftest*
6055   eval "ac_cv_lib_$ac_lib_var=yes"
6056 else
6057   echo "configure: failed program was:" >&5
6058   cat conftest.$ac_ext >&5
6059   rm -rf conftest*
6060   eval "ac_cv_lib_$ac_lib_var=no"
6061 fi
6062 rm -f conftest*
6063 LIBS="$ac_save_LIBS"
6064
6065 fi
6066 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6067   echo "$ac_t""yes" 1>&6
6068   have_ncurses=yes
6069 else
6070   echo "$ac_t""no" 1>&6
6071 have_ncurses=no
6072 fi
6073
6074         if test $have_ncurses = yes ; then
6075                 cat >> confdefs.h <<\EOF
6076 #define HAVE_NCURSES 1
6077 EOF
6078
6079                 ol_link_termcap=yes
6080                 TERMCAP_LIBS=-lncurses
6081         fi
6082 fi
6083
6084 if test $ol_link_termcap = no ; then
6085         cat >> confdefs.h <<\EOF
6086 #define NO_TERMCAP 1
6087 EOF
6088
6089         TERMCAP_LIBS=
6090 fi
6091
6092 # FreeBSD (and others) have crypt(3) in -lcrypt
6093 if test $ol_enable_crypt != no ; then
6094         echo $ac_n "checking for crypt""... $ac_c" 1>&6
6095 echo "configure:6096: checking for crypt" >&5
6096 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
6097   echo $ac_n "(cached) $ac_c" 1>&6
6098 else
6099   cat > conftest.$ac_ext <<EOF
6100 #line 6101 "configure"
6101 #include "confdefs.h"
6102 /* System header to define __stub macros and hopefully few prototypes,
6103     which can conflict with char crypt(); below.  */
6104 #include <assert.h>
6105 /* Override any gcc2 internal prototype to avoid an error.  */
6106 /* We use char because int might match the return type of a gcc2
6107     builtin and then its argument prototype would still apply.  */
6108 char crypt();
6109
6110 int main() {
6111
6112 /* The GNU C library defines this for functions which it implements
6113     to always fail with ENOSYS.  Some functions are actually named
6114     something starting with __ and the normal name is an alias.  */
6115 #if defined (__stub_crypt) || defined (__stub___crypt)
6116 choke me
6117 #else
6118 crypt();
6119 #endif
6120
6121 ; return 0; }
6122 EOF
6123 if { (eval echo configure:6124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6124   rm -rf conftest*
6125   eval "ac_cv_func_crypt=yes"
6126 else
6127   echo "configure: failed program was:" >&5
6128   cat conftest.$ac_ext >&5
6129   rm -rf conftest*
6130   eval "ac_cv_func_crypt=no"
6131 fi
6132 rm -f conftest*
6133 fi
6134
6135 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
6136   echo "$ac_t""yes" 1>&6
6137   have_crypt=yes
6138 else
6139   echo "$ac_t""no" 1>&6
6140
6141                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
6142 echo "configure:6143: checking for crypt in -lcrypt" >&5
6143 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
6144 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6145   echo $ac_n "(cached) $ac_c" 1>&6
6146 else
6147   ac_save_LIBS="$LIBS"
6148 LIBS="-lcrypt  $LIBS"
6149 cat > conftest.$ac_ext <<EOF
6150 #line 6151 "configure"
6151 #include "confdefs.h"
6152 /* Override any gcc2 internal prototype to avoid an error.  */
6153 /* We use char because int might match the return type of a gcc2
6154     builtin and then its argument prototype would still apply.  */
6155 char crypt();
6156
6157 int main() {
6158 crypt()
6159 ; return 0; }
6160 EOF
6161 if { (eval echo configure:6162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6162   rm -rf conftest*
6163   eval "ac_cv_lib_$ac_lib_var=yes"
6164 else
6165   echo "configure: failed program was:" >&5
6166   cat conftest.$ac_ext >&5
6167   rm -rf conftest*
6168   eval "ac_cv_lib_$ac_lib_var=no"
6169 fi
6170 rm -f conftest*
6171 LIBS="$ac_save_LIBS"
6172
6173 fi
6174 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6175   echo "$ac_t""yes" 1>&6
6176   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
6177                         have_crypt=yes
6178 else
6179   echo "$ac_t""no" 1>&6
6180 have_crypt=no
6181 fi
6182
6183 fi
6184
6185
6186         if test $have_crypt = yes ; then
6187                 cat >> confdefs.h <<\EOF
6188 #define HAVE_CRYPT 1
6189 EOF
6190
6191         else
6192                 echo "configure: warning: could not find crypt" 1>&2
6193                 if test $ol_enable_crypt = yes ; then
6194                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
6195                 fi
6196
6197                 echo "configure: warning: disabling crypt support" 1>&2
6198                 ol_enable_crypt=no
6199         fi
6200 fi
6201
6202 # FreeBSD (and others) have setproctitle(3) in -lutil
6203 if test $ol_enable_proctitle != no ; then
6204         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
6205 echo "configure:6206: checking for setproctitle" >&5
6206 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
6207   echo $ac_n "(cached) $ac_c" 1>&6
6208 else
6209   cat > conftest.$ac_ext <<EOF
6210 #line 6211 "configure"
6211 #include "confdefs.h"
6212 /* System header to define __stub macros and hopefully few prototypes,
6213     which can conflict with char setproctitle(); below.  */
6214 #include <assert.h>
6215 /* Override any gcc2 internal prototype to avoid an error.  */
6216 /* We use char because int might match the return type of a gcc2
6217     builtin and then its argument prototype would still apply.  */
6218 char setproctitle();
6219
6220 int main() {
6221
6222 /* The GNU C library defines this for functions which it implements
6223     to always fail with ENOSYS.  Some functions are actually named
6224     something starting with __ and the normal name is an alias.  */
6225 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
6226 choke me
6227 #else
6228 setproctitle();
6229 #endif
6230
6231 ; return 0; }
6232 EOF
6233 if { (eval echo configure:6234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6234   rm -rf conftest*
6235   eval "ac_cv_func_setproctitle=yes"
6236 else
6237   echo "configure: failed program was:" >&5
6238   cat conftest.$ac_ext >&5
6239   rm -rf conftest*
6240   eval "ac_cv_func_setproctitle=no"
6241 fi
6242 rm -f conftest*
6243 fi
6244
6245 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
6246   echo "$ac_t""yes" 1>&6
6247   have_setproctitle=yes
6248 else
6249   echo "$ac_t""no" 1>&6
6250
6251                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
6252 echo "configure:6253: checking for setproctitle in -lutil" >&5
6253 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
6254 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6255   echo $ac_n "(cached) $ac_c" 1>&6
6256 else
6257   ac_save_LIBS="$LIBS"
6258 LIBS="-lutil  $LIBS"
6259 cat > conftest.$ac_ext <<EOF
6260 #line 6261 "configure"
6261 #include "confdefs.h"
6262 /* Override any gcc2 internal prototype to avoid an error.  */
6263 /* We use char because int might match the return type of a gcc2
6264     builtin and then its argument prototype would still apply.  */
6265 char setproctitle();
6266
6267 int main() {
6268 setproctitle()
6269 ; return 0; }
6270 EOF
6271 if { (eval echo configure:6272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6272   rm -rf conftest*
6273   eval "ac_cv_lib_$ac_lib_var=yes"
6274 else
6275   echo "configure: failed program was:" >&5
6276   cat conftest.$ac_ext >&5
6277   rm -rf conftest*
6278   eval "ac_cv_lib_$ac_lib_var=no"
6279 fi
6280 rm -f conftest*
6281 LIBS="$ac_save_LIBS"
6282
6283 fi
6284 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6285   echo "$ac_t""yes" 1>&6
6286   have_setproctitle=yes
6287                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
6288 else
6289   echo "$ac_t""no" 1>&6
6290 have_setproctitle=no
6291                         LIBOBJS="$LIBOBJS setproctitle.o"
6292 fi
6293
6294 fi
6295
6296
6297         if test $have_setproctitle = yes ; then
6298                 cat >> confdefs.h <<\EOF
6299 #define HAVE_SETPROCTITLE 1
6300 EOF
6301
6302         fi
6303 fi
6304
6305 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
6306 echo "configure:6307: checking for ANSI C header files" >&5
6307 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
6308   echo $ac_n "(cached) $ac_c" 1>&6
6309 else
6310   cat > conftest.$ac_ext <<EOF
6311 #line 6312 "configure"
6312 #include "confdefs.h"
6313 #include <stdlib.h>
6314 #include <stdarg.h>
6315 #include <string.h>
6316 #include <float.h>
6317 EOF
6318 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6319 { (eval echo configure:6320: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6320 ac_err=`grep -v '^ *+' conftest.out`
6321 if test -z "$ac_err"; then
6322   rm -rf conftest*
6323   ac_cv_header_stdc=yes
6324 else
6325   echo "$ac_err" >&5
6326   echo "configure: failed program was:" >&5
6327   cat conftest.$ac_ext >&5
6328   rm -rf conftest*
6329   ac_cv_header_stdc=no
6330 fi
6331 rm -f conftest*
6332
6333 if test $ac_cv_header_stdc = yes; then
6334   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
6335 cat > conftest.$ac_ext <<EOF
6336 #line 6337 "configure"
6337 #include "confdefs.h"
6338 #include <string.h>
6339 EOF
6340 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6341   egrep "memchr" >/dev/null 2>&1; then
6342   :
6343 else
6344   rm -rf conftest*
6345   ac_cv_header_stdc=no
6346 fi
6347 rm -f conftest*
6348
6349 fi
6350
6351 if test $ac_cv_header_stdc = yes; then
6352   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
6353 cat > conftest.$ac_ext <<EOF
6354 #line 6355 "configure"
6355 #include "confdefs.h"
6356 #include <stdlib.h>
6357 EOF
6358 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6359   egrep "free" >/dev/null 2>&1; then
6360   :
6361 else
6362   rm -rf conftest*
6363   ac_cv_header_stdc=no
6364 fi
6365 rm -f conftest*
6366
6367 fi
6368
6369 if test $ac_cv_header_stdc = yes; then
6370   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
6371 if test "$cross_compiling" = yes; then
6372   :
6373 else
6374   cat > conftest.$ac_ext <<EOF
6375 #line 6376 "configure"
6376 #include "confdefs.h"
6377 #include <ctype.h>
6378 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
6379 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
6380 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
6381 int main () { int i; for (i = 0; i < 256; i++)
6382 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
6383 exit (0); }
6384
6385 EOF
6386 if { (eval echo configure:6387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
6387 then
6388   :
6389 else
6390   echo "configure: failed program was:" >&5
6391   cat conftest.$ac_ext >&5
6392   rm -fr conftest*
6393   ac_cv_header_stdc=no
6394 fi
6395 rm -fr conftest*
6396 fi
6397
6398 fi
6399 fi
6400
6401 echo "$ac_t""$ac_cv_header_stdc" 1>&6
6402 if test $ac_cv_header_stdc = yes; then
6403   cat >> confdefs.h <<\EOF
6404 #define STDC_HEADERS 1
6405 EOF
6406
6407 fi
6408
6409
6410 if test $ac_cv_header_stdc != yes; then
6411         echo "configure: warning: could not Standard C compliant headers" 1>&2
6412 fi
6413
6414 ac_header_dirent=no
6415 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
6416 do
6417 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6418 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
6419 echo "configure:6420: checking for $ac_hdr that defines DIR" >&5
6420 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
6421   echo $ac_n "(cached) $ac_c" 1>&6
6422 else
6423   cat > conftest.$ac_ext <<EOF
6424 #line 6425 "configure"
6425 #include "confdefs.h"
6426 #include <sys/types.h>
6427 #include <$ac_hdr>
6428 int main() {
6429 DIR *dirp = 0;
6430 ; return 0; }
6431 EOF
6432 if { (eval echo configure:6433: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6433   rm -rf conftest*
6434   eval "ac_cv_header_dirent_$ac_safe=yes"
6435 else
6436   echo "configure: failed program was:" >&5
6437   cat conftest.$ac_ext >&5
6438   rm -rf conftest*
6439   eval "ac_cv_header_dirent_$ac_safe=no"
6440 fi
6441 rm -f conftest*
6442 fi
6443 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
6444   echo "$ac_t""yes" 1>&6
6445     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6446   cat >> confdefs.h <<EOF
6447 #define $ac_tr_hdr 1
6448 EOF
6449  ac_header_dirent=$ac_hdr; break
6450 else
6451   echo "$ac_t""no" 1>&6
6452 fi
6453 done
6454 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
6455 if test $ac_header_dirent = dirent.h; then
6456 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
6457 echo "configure:6458: checking for opendir in -ldir" >&5
6458 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
6459 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6460   echo $ac_n "(cached) $ac_c" 1>&6
6461 else
6462   ac_save_LIBS="$LIBS"
6463 LIBS="-ldir  $LIBS"
6464 cat > conftest.$ac_ext <<EOF
6465 #line 6466 "configure"
6466 #include "confdefs.h"
6467 /* Override any gcc2 internal prototype to avoid an error.  */
6468 /* We use char because int might match the return type of a gcc2
6469     builtin and then its argument prototype would still apply.  */
6470 char opendir();
6471
6472 int main() {
6473 opendir()
6474 ; return 0; }
6475 EOF
6476 if { (eval echo configure:6477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6477   rm -rf conftest*
6478   eval "ac_cv_lib_$ac_lib_var=yes"
6479 else
6480   echo "configure: failed program was:" >&5
6481   cat conftest.$ac_ext >&5
6482   rm -rf conftest*
6483   eval "ac_cv_lib_$ac_lib_var=no"
6484 fi
6485 rm -f conftest*
6486 LIBS="$ac_save_LIBS"
6487
6488 fi
6489 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6490   echo "$ac_t""yes" 1>&6
6491   LIBS="$LIBS -ldir"
6492 else
6493   echo "$ac_t""no" 1>&6
6494 fi
6495
6496 else
6497 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
6498 echo "configure:6499: checking for opendir in -lx" >&5
6499 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
6500 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6501   echo $ac_n "(cached) $ac_c" 1>&6
6502 else
6503   ac_save_LIBS="$LIBS"
6504 LIBS="-lx  $LIBS"
6505 cat > conftest.$ac_ext <<EOF
6506 #line 6507 "configure"
6507 #include "confdefs.h"
6508 /* Override any gcc2 internal prototype to avoid an error.  */
6509 /* We use char because int might match the return type of a gcc2
6510     builtin and then its argument prototype would still apply.  */
6511 char opendir();
6512
6513 int main() {
6514 opendir()
6515 ; return 0; }
6516 EOF
6517 if { (eval echo configure:6518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6518   rm -rf conftest*
6519   eval "ac_cv_lib_$ac_lib_var=yes"
6520 else
6521   echo "configure: failed program was:" >&5
6522   cat conftest.$ac_ext >&5
6523   rm -rf conftest*
6524   eval "ac_cv_lib_$ac_lib_var=no"
6525 fi
6526 rm -f conftest*
6527 LIBS="$ac_save_LIBS"
6528
6529 fi
6530 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6531   echo "$ac_t""yes" 1>&6
6532   LIBS="$LIBS -lx"
6533 else
6534   echo "$ac_t""no" 1>&6
6535 fi
6536
6537 fi
6538
6539 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
6540 echo "configure:6541: checking for sys/wait.h that is POSIX.1 compatible" >&5
6541 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
6542   echo $ac_n "(cached) $ac_c" 1>&6
6543 else
6544   cat > conftest.$ac_ext <<EOF
6545 #line 6546 "configure"
6546 #include "confdefs.h"
6547 #include <sys/types.h>
6548 #include <sys/wait.h>
6549 #ifndef WEXITSTATUS
6550 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
6551 #endif
6552 #ifndef WIFEXITED
6553 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
6554 #endif
6555 int main() {
6556 int s;
6557 wait (&s);
6558 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
6559 ; return 0; }
6560 EOF
6561 if { (eval echo configure:6562: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6562   rm -rf conftest*
6563   ac_cv_header_sys_wait_h=yes
6564 else
6565   echo "configure: failed program was:" >&5
6566   cat conftest.$ac_ext >&5
6567   rm -rf conftest*
6568   ac_cv_header_sys_wait_h=no
6569 fi
6570 rm -f conftest*
6571 fi
6572
6573 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
6574 if test $ac_cv_header_sys_wait_h = yes; then
6575   cat >> confdefs.h <<\EOF
6576 #define HAVE_SYS_WAIT_H 1
6577 EOF
6578
6579 fi
6580
6581 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
6582 echo "configure:6583: checking POSIX termios" >&5
6583 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
6584   echo $ac_n "(cached) $ac_c" 1>&6
6585 else
6586   cat > conftest.$ac_ext <<EOF
6587 #line 6588 "configure"
6588 #include "confdefs.h"
6589 #include <sys/types.h>
6590 #include <unistd.h>
6591 #include <termios.h>
6592 int main() {
6593 /* SunOS 4.0.3 has termios.h but not the library calls.  */
6594    tcgetattr(0, 0);
6595 ; return 0; }
6596 EOF
6597 if { (eval echo configure:6598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6598   rm -rf conftest*
6599   am_cv_sys_posix_termios=yes
6600 else
6601   echo "configure: failed program was:" >&5
6602   cat conftest.$ac_ext >&5
6603   rm -rf conftest*
6604   am_cv_sys_posix_termios=no
6605 fi
6606 rm -f conftest*
6607 fi
6608
6609 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
6610
6611
6612  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
6613 echo "configure:6614: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
6614 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
6615   echo $ac_n "(cached) $ac_c" 1>&6
6616 else
6617   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
6618
6619   gwinsz_in_termios_h=no
6620   if test $am_cv_sys_posix_termios = yes; then
6621     cat > conftest.$ac_ext <<EOF
6622 #line 6623 "configure"
6623 #include "confdefs.h"
6624 #include <sys/types.h>
6625 #     include <termios.h>
6626 #     ifdef TIOCGWINSZ
6627         yes
6628 #     endif
6629     
6630 EOF
6631 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6632   egrep "yes" >/dev/null 2>&1; then
6633   rm -rf conftest*
6634   gwinsz_in_termios_h=yes
6635 fi
6636 rm -f conftest*
6637
6638   fi
6639
6640   if test $gwinsz_in_termios_h = no; then
6641     cat > conftest.$ac_ext <<EOF
6642 #line 6643 "configure"
6643 #include "confdefs.h"
6644 #include <sys/types.h>
6645 #     include <sys/ioctl.h>
6646 #     ifdef TIOCGWINSZ
6647         yes
6648 #     endif
6649     
6650 EOF
6651 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6652   egrep "yes" >/dev/null 2>&1; then
6653   rm -rf conftest*
6654   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
6655 fi
6656 rm -f conftest*
6657
6658   fi
6659   
6660 fi
6661
6662 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
6663   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
6664     cat >> confdefs.h <<\EOF
6665 #define GWINSZ_IN_SYS_IOCTL 1
6666 EOF
6667
6668   fi
6669
6670 if test $am_cv_sys_posix_termios = yes ; then
6671         cat >> confdefs.h <<\EOF
6672 #define HAVE_POSIX_TERMIOS 1
6673 EOF
6674
6675 fi
6676
6677 for ac_hdr in \
6678         crypt.h                 \
6679         errno.h                 \
6680         fcntl.h                 \
6681         filio.h                 \
6682         getopt.h                \
6683         libutil.h               \
6684         limits.h                \
6685         malloc.h                \
6686         memory.h                \
6687         regex.h                 \
6688         psap.h                  \
6689         pwd.h                   \
6690         sgtty.h                 \
6691         stdarg.h                \
6692         stddef.h                \
6693         string.h                \
6694         strings.h               \
6695         sys/file.h              \
6696         sys/filio.h             \
6697         sys/errno.h             \
6698         sys/ioctl.h             \
6699         sys/param.h             \
6700         sys/resource.h  \
6701         sys/socket.h    \
6702         sys/syslog.h    \
6703         sys/time.h              \
6704         sys/types.h             \
6705         syslog.h                \
6706         termios.h               \
6707         unistd.h                \
6708
6709 do
6710 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6711 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6712 echo "configure:6713: checking for $ac_hdr" >&5
6713 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6714   echo $ac_n "(cached) $ac_c" 1>&6
6715 else
6716   cat > conftest.$ac_ext <<EOF
6717 #line 6718 "configure"
6718 #include "confdefs.h"
6719 #include <$ac_hdr>
6720 EOF
6721 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6722 { (eval echo configure:6723: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6723 ac_err=`grep -v '^ *+' conftest.out`
6724 if test -z "$ac_err"; then
6725   rm -rf conftest*
6726   eval "ac_cv_header_$ac_safe=yes"
6727 else
6728   echo "$ac_err" >&5
6729   echo "configure: failed program was:" >&5
6730   cat conftest.$ac_ext >&5
6731   rm -rf conftest*
6732   eval "ac_cv_header_$ac_safe=no"
6733 fi
6734 rm -f conftest*
6735 fi
6736 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6737   echo "$ac_t""yes" 1>&6
6738     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6739   cat >> confdefs.h <<EOF
6740 #define $ac_tr_hdr 1
6741 EOF
6742  
6743 else
6744   echo "$ac_t""no" 1>&6
6745 fi
6746 done
6747
6748
6749 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
6750 echo "configure:6751: checking for uid_t in sys/types.h" >&5
6751 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
6752   echo $ac_n "(cached) $ac_c" 1>&6
6753 else
6754   cat > conftest.$ac_ext <<EOF
6755 #line 6756 "configure"
6756 #include "confdefs.h"
6757 #include <sys/types.h>
6758 EOF
6759 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6760   egrep "uid_t" >/dev/null 2>&1; then
6761   rm -rf conftest*
6762   ac_cv_type_uid_t=yes
6763 else
6764   rm -rf conftest*
6765   ac_cv_type_uid_t=no
6766 fi
6767 rm -f conftest*
6768
6769 fi
6770
6771 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
6772 if test $ac_cv_type_uid_t = no; then
6773   cat >> confdefs.h <<\EOF
6774 #define uid_t int
6775 EOF
6776
6777   cat >> confdefs.h <<\EOF
6778 #define gid_t int
6779 EOF
6780
6781 fi
6782
6783 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
6784 echo "configure:6785: checking type of array argument to getgroups" >&5
6785 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
6786   echo $ac_n "(cached) $ac_c" 1>&6
6787 else
6788   if test "$cross_compiling" = yes; then
6789   ac_cv_type_getgroups=cross
6790 else
6791   cat > conftest.$ac_ext <<EOF
6792 #line 6793 "configure"
6793 #include "confdefs.h"
6794
6795 /* Thanks to Mike Rendell for this test.  */
6796 #include <sys/types.h>
6797 #define NGID 256
6798 #undef MAX
6799 #define MAX(x, y) ((x) > (y) ? (x) : (y))
6800 main()
6801 {
6802   gid_t gidset[NGID];
6803   int i, n;
6804   union { gid_t gval; long lval; }  val;
6805
6806   val.lval = -1;
6807   for (i = 0; i < NGID; i++)
6808     gidset[i] = val.gval;
6809   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
6810                  gidset);
6811   /* Exit non-zero if getgroups seems to require an array of ints.  This
6812      happens when gid_t is short but getgroups modifies an array of ints.  */
6813   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
6814 }
6815
6816 EOF
6817 if { (eval echo configure:6818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
6818 then
6819     ac_cv_type_getgroups=gid_t
6820 else
6821   echo "configure: failed program was:" >&5
6822   cat conftest.$ac_ext >&5
6823   rm -fr conftest*
6824   ac_cv_type_getgroups=int
6825 fi
6826 rm -fr conftest*
6827 fi
6828
6829 if test $ac_cv_type_getgroups = cross; then
6830         cat > conftest.$ac_ext <<EOF
6831 #line 6832 "configure"
6832 #include "confdefs.h"
6833 #include <unistd.h>
6834 EOF
6835 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6836   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
6837   rm -rf conftest*
6838   ac_cv_type_getgroups=gid_t
6839 else
6840   rm -rf conftest*
6841   ac_cv_type_getgroups=int
6842 fi
6843 rm -f conftest*
6844
6845 fi
6846 fi
6847
6848 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
6849 cat >> confdefs.h <<EOF
6850 #define GETGROUPS_T $ac_cv_type_getgroups
6851 EOF
6852
6853  echo $ac_n "checking for mode_t""... $ac_c" 1>&6
6854 echo "configure:6855: checking for mode_t" >&5
6855 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
6856   echo $ac_n "(cached) $ac_c" 1>&6
6857 else
6858   cat > conftest.$ac_ext <<EOF
6859 #line 6860 "configure"
6860 #include "confdefs.h"
6861 #include <sys/types.h>
6862 #if STDC_HEADERS
6863 #include <stdlib.h>
6864 #include <stddef.h>
6865 #endif
6866 EOF
6867 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6868   egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
6869   rm -rf conftest*
6870   ac_cv_type_mode_t=yes
6871 else
6872   rm -rf conftest*
6873   ac_cv_type_mode_t=no
6874 fi
6875 rm -f conftest*
6876
6877 fi
6878 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
6879 if test $ac_cv_type_mode_t = no; then
6880   cat >> confdefs.h <<\EOF
6881 #define mode_t int
6882 EOF
6883
6884 fi
6885
6886 echo $ac_n "checking for off_t""... $ac_c" 1>&6
6887 echo "configure:6888: checking for off_t" >&5
6888 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
6889   echo $ac_n "(cached) $ac_c" 1>&6
6890 else
6891   cat > conftest.$ac_ext <<EOF
6892 #line 6893 "configure"
6893 #include "confdefs.h"
6894 #include <sys/types.h>
6895 #if STDC_HEADERS
6896 #include <stdlib.h>
6897 #include <stddef.h>
6898 #endif
6899 EOF
6900 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6901   egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
6902   rm -rf conftest*
6903   ac_cv_type_off_t=yes
6904 else
6905   rm -rf conftest*
6906   ac_cv_type_off_t=no
6907 fi
6908 rm -f conftest*
6909
6910 fi
6911 echo "$ac_t""$ac_cv_type_off_t" 1>&6
6912 if test $ac_cv_type_off_t = no; then
6913   cat >> confdefs.h <<\EOF
6914 #define off_t long
6915 EOF
6916
6917 fi
6918
6919 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
6920 echo "configure:6921: checking for pid_t" >&5
6921 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
6922   echo $ac_n "(cached) $ac_c" 1>&6
6923 else
6924   cat > conftest.$ac_ext <<EOF
6925 #line 6926 "configure"
6926 #include "confdefs.h"
6927 #include <sys/types.h>
6928 #if STDC_HEADERS
6929 #include <stdlib.h>
6930 #include <stddef.h>
6931 #endif
6932 EOF
6933 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6934   egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
6935   rm -rf conftest*
6936   ac_cv_type_pid_t=yes
6937 else
6938   rm -rf conftest*
6939   ac_cv_type_pid_t=no
6940 fi
6941 rm -f conftest*
6942
6943 fi
6944 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
6945 if test $ac_cv_type_pid_t = no; then
6946   cat >> confdefs.h <<\EOF
6947 #define pid_t int
6948 EOF
6949
6950 fi
6951
6952 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
6953 echo "configure:6954: checking for ptrdiff_t" >&5
6954 if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then
6955   echo $ac_n "(cached) $ac_c" 1>&6
6956 else
6957   cat > conftest.$ac_ext <<EOF
6958 #line 6959 "configure"
6959 #include "confdefs.h"
6960 #include <stddef.h>
6961 int main() {
6962 ptrdiff_t p
6963 ; return 0; }
6964 EOF
6965 if { (eval echo configure:6966: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6966   rm -rf conftest*
6967   am_cv_type_ptrdiff_t=yes
6968 else
6969   echo "configure: failed program was:" >&5
6970   cat conftest.$ac_ext >&5
6971   rm -rf conftest*
6972   am_cv_type_ptrdiff_t=no
6973 fi
6974 rm -f conftest*
6975 fi
6976
6977 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
6978    if test $am_cv_type_ptrdiff_t = yes; then
6979      cat >> confdefs.h <<\EOF
6980 #define HAVE_PTRDIFF_T 1
6981 EOF
6982
6983    fi
6984
6985 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
6986 echo "configure:6987: checking return type of signal handlers" >&5
6987 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
6988   echo $ac_n "(cached) $ac_c" 1>&6
6989 else
6990   cat > conftest.$ac_ext <<EOF
6991 #line 6992 "configure"
6992 #include "confdefs.h"
6993 #include <sys/types.h>
6994 #include <signal.h>
6995 #ifdef signal
6996 #undef signal
6997 #endif
6998 #ifdef __cplusplus
6999 extern "C" void (*signal (int, void (*)(int)))(int);
7000 #else
7001 void (*signal ()) ();
7002 #endif
7003
7004 int main() {
7005 int i;
7006 ; return 0; }
7007 EOF
7008 if { (eval echo configure:7009: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7009   rm -rf conftest*
7010   ac_cv_type_signal=void
7011 else
7012   echo "configure: failed program was:" >&5
7013   cat conftest.$ac_ext >&5
7014   rm -rf conftest*
7015   ac_cv_type_signal=int
7016 fi
7017 rm -f conftest*
7018 fi
7019
7020 echo "$ac_t""$ac_cv_type_signal" 1>&6
7021 cat >> confdefs.h <<EOF
7022 #define RETSIGTYPE $ac_cv_type_signal
7023 EOF
7024
7025
7026 echo $ac_n "checking for size_t""... $ac_c" 1>&6
7027 echo "configure:7028: checking for size_t" >&5
7028 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
7029   echo $ac_n "(cached) $ac_c" 1>&6
7030 else
7031   cat > conftest.$ac_ext <<EOF
7032 #line 7033 "configure"
7033 #include "confdefs.h"
7034 #include <sys/types.h>
7035 #if STDC_HEADERS
7036 #include <stdlib.h>
7037 #include <stddef.h>
7038 #endif
7039 EOF
7040 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7041   egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
7042   rm -rf conftest*
7043   ac_cv_type_size_t=yes
7044 else
7045   rm -rf conftest*
7046   ac_cv_type_size_t=no
7047 fi
7048 rm -f conftest*
7049
7050 fi
7051 echo "$ac_t""$ac_cv_type_size_t" 1>&6
7052 if test $ac_cv_type_size_t = no; then
7053   cat >> confdefs.h <<\EOF
7054 #define size_t unsigned
7055 EOF
7056
7057 fi
7058
7059 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
7060 echo "configure:7061: checking for st_blksize in struct stat" >&5
7061 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
7062   echo $ac_n "(cached) $ac_c" 1>&6
7063 else
7064   cat > conftest.$ac_ext <<EOF
7065 #line 7066 "configure"
7066 #include "confdefs.h"
7067 #include <sys/types.h>
7068 #include <sys/stat.h>
7069 int main() {
7070 struct stat s; s.st_blksize;
7071 ; return 0; }
7072 EOF
7073 if { (eval echo configure:7074: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7074   rm -rf conftest*
7075   ac_cv_struct_st_blksize=yes
7076 else
7077   echo "configure: failed program was:" >&5
7078   cat conftest.$ac_ext >&5
7079   rm -rf conftest*
7080   ac_cv_struct_st_blksize=no
7081 fi
7082 rm -f conftest*
7083 fi
7084
7085 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
7086 if test $ac_cv_struct_st_blksize = yes; then
7087   cat >> confdefs.h <<\EOF
7088 #define HAVE_ST_BLKSIZE 1
7089 EOF
7090
7091 fi
7092
7093 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
7094 echo "configure:7095: checking whether time.h and sys/time.h may both be included" >&5
7095 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
7096   echo $ac_n "(cached) $ac_c" 1>&6
7097 else
7098   cat > conftest.$ac_ext <<EOF
7099 #line 7100 "configure"
7100 #include "confdefs.h"
7101 #include <sys/types.h>
7102 #include <sys/time.h>
7103 #include <time.h>
7104 int main() {
7105 struct tm *tp;
7106 ; return 0; }
7107 EOF
7108 if { (eval echo configure:7109: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7109   rm -rf conftest*
7110   ac_cv_header_time=yes
7111 else
7112   echo "configure: failed program was:" >&5
7113   cat conftest.$ac_ext >&5
7114   rm -rf conftest*
7115   ac_cv_header_time=no
7116 fi
7117 rm -f conftest*
7118 fi
7119
7120 echo "$ac_t""$ac_cv_header_time" 1>&6
7121 if test $ac_cv_header_time = yes; then
7122   cat >> confdefs.h <<\EOF
7123 #define TIME_WITH_SYS_TIME 1
7124 EOF
7125
7126 fi
7127
7128 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
7129 echo "configure:7130: checking whether struct tm is in sys/time.h or time.h" >&5
7130 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
7131   echo $ac_n "(cached) $ac_c" 1>&6
7132 else
7133   cat > conftest.$ac_ext <<EOF
7134 #line 7135 "configure"
7135 #include "confdefs.h"
7136 #include <sys/types.h>
7137 #include <time.h>
7138 int main() {
7139 struct tm *tp; tp->tm_sec;
7140 ; return 0; }
7141 EOF
7142 if { (eval echo configure:7143: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7143   rm -rf conftest*
7144   ac_cv_struct_tm=time.h
7145 else
7146   echo "configure: failed program was:" >&5
7147   cat conftest.$ac_ext >&5
7148   rm -rf conftest*
7149   ac_cv_struct_tm=sys/time.h
7150 fi
7151 rm -f conftest*
7152 fi
7153
7154 echo "$ac_t""$ac_cv_struct_tm" 1>&6
7155 if test $ac_cv_struct_tm = sys/time.h; then
7156   cat >> confdefs.h <<\EOF
7157 #define TM_IN_SYS_TIME 1
7158 EOF
7159
7160 fi
7161
7162
7163
7164 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
7165 echo "configure:7166: checking if toupper() requires islower()" >&5
7166 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
7167   echo $ac_n "(cached) $ac_c" 1>&6
7168 else
7169   
7170         if test "$cross_compiling" = yes; then
7171   ol_cv_c_upper_lower=safe
7172 else
7173   cat > conftest.$ac_ext <<EOF
7174 #line 7175 "configure"
7175 #include "confdefs.h"
7176
7177 #include <ctype.h>
7178 main()
7179 {
7180         if ('C' == toupper('C'))
7181                 exit(0);
7182         else
7183                 exit(1);
7184 }
7185 EOF
7186 if { (eval echo configure:7187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
7187 then
7188   ol_cv_c_upper_lower=no
7189 else
7190   echo "configure: failed program was:" >&5
7191   cat conftest.$ac_ext >&5
7192   rm -fr conftest*
7193   ol_cv_c_upper_lower=yes
7194 fi
7195 rm -fr conftest*
7196 fi
7197
7198 fi
7199
7200 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
7201 if test $ol_cv_c_upper_lower != no ; then
7202         cat >> confdefs.h <<\EOF
7203 #define C_UPPER_LOWER 1
7204 EOF
7205
7206 fi
7207
7208 echo $ac_n "checking for working const""... $ac_c" 1>&6
7209 echo "configure:7210: checking for working const" >&5
7210 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
7211   echo $ac_n "(cached) $ac_c" 1>&6
7212 else
7213   cat > conftest.$ac_ext <<EOF
7214 #line 7215 "configure"
7215 #include "confdefs.h"
7216
7217 int main() {
7218
7219 /* Ultrix mips cc rejects this.  */
7220 typedef int charset[2]; const charset x;
7221 /* SunOS 4.1.1 cc rejects this.  */
7222 char const *const *ccp;
7223 char **p;
7224 /* NEC SVR4.0.2 mips cc rejects this.  */
7225 struct point {int x, y;};
7226 static struct point const zero = {0,0};
7227 /* AIX XL C 1.02.0.0 rejects this.
7228    It does not let you subtract one const X* pointer from another in an arm
7229    of an if-expression whose if-part is not a constant expression */
7230 const char *g = "string";
7231 ccp = &g + (g ? g-g : 0);
7232 /* HPUX 7.0 cc rejects these. */
7233 ++ccp;
7234 p = (char**) ccp;
7235 ccp = (char const *const *) p;
7236 { /* SCO 3.2v4 cc rejects this.  */
7237   char *t;
7238   char const *s = 0 ? (char *) 0 : (char const *) 0;
7239
7240   *t++ = 0;
7241 }
7242 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
7243   int x[] = {25, 17};
7244   const int *foo = &x[0];
7245   ++foo;
7246 }
7247 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
7248   typedef const int *iptr;
7249   iptr p = 0;
7250   ++p;
7251 }
7252 { /* AIX XL C 1.02.0.0 rejects this saying
7253      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
7254   struct s { int j; const int *ap[3]; };
7255   struct s *b; b->j = 5;
7256 }
7257 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
7258   const int foo = 10;
7259 }
7260
7261 ; return 0; }
7262 EOF
7263 if { (eval echo configure:7264: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7264   rm -rf conftest*
7265   ac_cv_c_const=yes
7266 else
7267   echo "configure: failed program was:" >&5
7268   cat conftest.$ac_ext >&5
7269   rm -rf conftest*
7270   ac_cv_c_const=no
7271 fi
7272 rm -f conftest*
7273 fi
7274
7275 echo "$ac_t""$ac_cv_c_const" 1>&6
7276 if test $ac_cv_c_const = no; then
7277   cat >> confdefs.h <<\EOF
7278 #define const 
7279 EOF
7280
7281 fi
7282
7283
7284 if test $cross_compiling = yes ; then
7285         cat >> confdefs.h <<\EOF
7286 #define CROSS_COMPILING 1
7287 EOF
7288
7289 else
7290         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
7291 echo "configure:7292: checking whether byte ordering is bigendian" >&5
7292 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
7293   echo $ac_n "(cached) $ac_c" 1>&6
7294 else
7295   ac_cv_c_bigendian=unknown
7296 # See if sys/param.h defines the BYTE_ORDER macro.
7297 cat > conftest.$ac_ext <<EOF
7298 #line 7299 "configure"
7299 #include "confdefs.h"
7300 #include <sys/types.h>
7301 #include <sys/param.h>
7302 int main() {
7303
7304 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
7305  bogus endian macros
7306 #endif
7307 ; return 0; }
7308 EOF
7309 if { (eval echo configure:7310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7310   rm -rf conftest*
7311   # It does; now see whether it defined to BIG_ENDIAN or not.
7312 cat > conftest.$ac_ext <<EOF
7313 #line 7314 "configure"
7314 #include "confdefs.h"
7315 #include <sys/types.h>
7316 #include <sys/param.h>
7317 int main() {
7318
7319 #if BYTE_ORDER != BIG_ENDIAN
7320  not big endian
7321 #endif
7322 ; return 0; }
7323 EOF
7324 if { (eval echo configure:7325: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7325   rm -rf conftest*
7326   ac_cv_c_bigendian=yes
7327 else
7328   echo "configure: failed program was:" >&5
7329   cat conftest.$ac_ext >&5
7330   rm -rf conftest*
7331   ac_cv_c_bigendian=no
7332 fi
7333 rm -f conftest*
7334 else
7335   echo "configure: failed program was:" >&5
7336   cat conftest.$ac_ext >&5
7337 fi
7338 rm -f conftest*
7339 if test $ac_cv_c_bigendian = unknown; then
7340 if test "$cross_compiling" = yes; then
7341     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
7342 else
7343   cat > conftest.$ac_ext <<EOF
7344 #line 7345 "configure"
7345 #include "confdefs.h"
7346 main () {
7347   /* Are we little or big endian?  From Harbison&Steele.  */
7348   union
7349   {
7350     long l;
7351     char c[sizeof (long)];
7352   } u;
7353   u.l = 1;
7354   exit (u.c[sizeof (long) - 1] == 1);
7355 }
7356 EOF
7357 if { (eval echo configure:7358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
7358 then
7359   ac_cv_c_bigendian=no
7360 else
7361   echo "configure: failed program was:" >&5
7362   cat conftest.$ac_ext >&5
7363   rm -fr conftest*
7364   ac_cv_c_bigendian=yes
7365 fi
7366 rm -fr conftest*
7367 fi
7368
7369 fi
7370 fi
7371
7372 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
7373 if test $ac_cv_c_bigendian = yes; then
7374   cat >> confdefs.h <<\EOF
7375 #define WORDS_BIGENDIAN 1
7376 EOF
7377
7378 fi
7379
7380         echo $ac_n "checking size of short""... $ac_c" 1>&6
7381 echo "configure:7382: checking size of short" >&5
7382 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
7383   echo $ac_n "(cached) $ac_c" 1>&6
7384 else
7385   if test "$cross_compiling" = yes; then
7386     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
7387 else
7388   cat > conftest.$ac_ext <<EOF
7389 #line 7390 "configure"
7390 #include "confdefs.h"
7391 #include <stdio.h>
7392 main()
7393 {
7394   FILE *f=fopen("conftestval", "w");
7395   if (!f) exit(1);
7396   fprintf(f, "%d\n", sizeof(short));
7397   exit(0);
7398 }
7399 EOF
7400 if { (eval echo configure:7401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
7401 then
7402   ac_cv_sizeof_short=`cat conftestval`
7403 else
7404   echo "configure: failed program was:" >&5
7405   cat conftest.$ac_ext >&5
7406   rm -fr conftest*
7407   ac_cv_sizeof_short=0
7408 fi
7409 rm -fr conftest*
7410 fi
7411
7412 fi
7413 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
7414 cat >> confdefs.h <<EOF
7415 #define SIZEOF_SHORT $ac_cv_sizeof_short
7416 EOF
7417
7418  
7419         echo $ac_n "checking size of int""... $ac_c" 1>&6
7420 echo "configure:7421: checking size of int" >&5
7421 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
7422   echo $ac_n "(cached) $ac_c" 1>&6
7423 else
7424   if test "$cross_compiling" = yes; then
7425     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
7426 else
7427   cat > conftest.$ac_ext <<EOF
7428 #line 7429 "configure"
7429 #include "confdefs.h"
7430 #include <stdio.h>
7431 main()
7432 {
7433   FILE *f=fopen("conftestval", "w");
7434   if (!f) exit(1);
7435   fprintf(f, "%d\n", sizeof(int));
7436   exit(0);
7437 }
7438 EOF
7439 if { (eval echo configure:7440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
7440 then
7441   ac_cv_sizeof_int=`cat conftestval`
7442 else
7443   echo "configure: failed program was:" >&5
7444   cat conftest.$ac_ext >&5
7445   rm -fr conftest*
7446   ac_cv_sizeof_int=0
7447 fi
7448 rm -fr conftest*
7449 fi
7450
7451 fi
7452 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
7453 cat >> confdefs.h <<EOF
7454 #define SIZEOF_INT $ac_cv_sizeof_int
7455 EOF
7456
7457  
7458         echo $ac_n "checking size of long""... $ac_c" 1>&6
7459 echo "configure:7460: checking size of long" >&5
7460 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
7461   echo $ac_n "(cached) $ac_c" 1>&6
7462 else
7463   if test "$cross_compiling" = yes; then
7464     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
7465 else
7466   cat > conftest.$ac_ext <<EOF
7467 #line 7468 "configure"
7468 #include "confdefs.h"
7469 #include <stdio.h>
7470 main()
7471 {
7472   FILE *f=fopen("conftestval", "w");
7473   if (!f) exit(1);
7474   fprintf(f, "%d\n", sizeof(long));
7475   exit(0);
7476 }
7477 EOF
7478 if { (eval echo configure:7479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
7479 then
7480   ac_cv_sizeof_long=`cat conftestval`
7481 else
7482   echo "configure: failed program was:" >&5
7483   cat conftest.$ac_ext >&5
7484   rm -fr conftest*
7485   ac_cv_sizeof_long=0
7486 fi
7487 rm -fr conftest*
7488 fi
7489
7490 fi
7491 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
7492 cat >> confdefs.h <<EOF
7493 #define SIZEOF_LONG $ac_cv_sizeof_long
7494 EOF
7495
7496
7497 fi
7498
7499 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
7500 echo "configure:7501: checking for 8-bit clean memcmp" >&5
7501 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
7502   echo $ac_n "(cached) $ac_c" 1>&6
7503 else
7504   if test "$cross_compiling" = yes; then
7505   ac_cv_func_memcmp_clean=no
7506 else
7507   cat > conftest.$ac_ext <<EOF
7508 #line 7509 "configure"
7509 #include "confdefs.h"
7510
7511 main()
7512 {
7513   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
7514   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
7515 }
7516
7517 EOF
7518 if { (eval echo configure:7519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
7519 then
7520   ac_cv_func_memcmp_clean=yes
7521 else
7522   echo "configure: failed program was:" >&5
7523   cat conftest.$ac_ext >&5
7524   rm -fr conftest*
7525   ac_cv_func_memcmp_clean=no
7526 fi
7527 rm -fr conftest*
7528 fi
7529
7530 fi
7531
7532 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
7533 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o"
7534
7535 echo $ac_n "checking for strftime""... $ac_c" 1>&6
7536 echo "configure:7537: checking for strftime" >&5
7537 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
7538   echo $ac_n "(cached) $ac_c" 1>&6
7539 else
7540   cat > conftest.$ac_ext <<EOF
7541 #line 7542 "configure"
7542 #include "confdefs.h"
7543 /* System header to define __stub macros and hopefully few prototypes,
7544     which can conflict with char strftime(); below.  */
7545 #include <assert.h>
7546 /* Override any gcc2 internal prototype to avoid an error.  */
7547 /* We use char because int might match the return type of a gcc2
7548     builtin and then its argument prototype would still apply.  */
7549 char strftime();
7550
7551 int main() {
7552
7553 /* The GNU C library defines this for functions which it implements
7554     to always fail with ENOSYS.  Some functions are actually named
7555     something starting with __ and the normal name is an alias.  */
7556 #if defined (__stub_strftime) || defined (__stub___strftime)
7557 choke me
7558 #else
7559 strftime();
7560 #endif
7561
7562 ; return 0; }
7563 EOF
7564 if { (eval echo configure:7565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7565   rm -rf conftest*
7566   eval "ac_cv_func_strftime=yes"
7567 else
7568   echo "configure: failed program was:" >&5
7569   cat conftest.$ac_ext >&5
7570   rm -rf conftest*
7571   eval "ac_cv_func_strftime=no"
7572 fi
7573 rm -f conftest*
7574 fi
7575
7576 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
7577   echo "$ac_t""yes" 1>&6
7578   cat >> confdefs.h <<\EOF
7579 #define HAVE_STRFTIME 1
7580 EOF
7581
7582 else
7583   echo "$ac_t""no" 1>&6
7584 # strftime is in -lintl on SCO UNIX.
7585 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
7586 echo "configure:7587: checking for strftime in -lintl" >&5
7587 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
7588 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7589   echo $ac_n "(cached) $ac_c" 1>&6
7590 else
7591   ac_save_LIBS="$LIBS"
7592 LIBS="-lintl  $LIBS"
7593 cat > conftest.$ac_ext <<EOF
7594 #line 7595 "configure"
7595 #include "confdefs.h"
7596 /* Override any gcc2 internal prototype to avoid an error.  */
7597 /* We use char because int might match the return type of a gcc2
7598     builtin and then its argument prototype would still apply.  */
7599 char strftime();
7600
7601 int main() {
7602 strftime()
7603 ; return 0; }
7604 EOF
7605 if { (eval echo configure:7606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7606   rm -rf conftest*
7607   eval "ac_cv_lib_$ac_lib_var=yes"
7608 else
7609   echo "configure: failed program was:" >&5
7610   cat conftest.$ac_ext >&5
7611   rm -rf conftest*
7612   eval "ac_cv_lib_$ac_lib_var=no"
7613 fi
7614 rm -f conftest*
7615 LIBS="$ac_save_LIBS"
7616
7617 fi
7618 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7619   echo "$ac_t""yes" 1>&6
7620   cat >> confdefs.h <<\EOF
7621 #define HAVE_STRFTIME 1
7622 EOF
7623
7624 LIBS="-lintl $LIBS"
7625 else
7626   echo "$ac_t""no" 1>&6
7627 fi
7628
7629 fi
7630
7631 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
7632 echo "configure:7633: checking for vprintf" >&5
7633 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
7634   echo $ac_n "(cached) $ac_c" 1>&6
7635 else
7636   cat > conftest.$ac_ext <<EOF
7637 #line 7638 "configure"
7638 #include "confdefs.h"
7639 /* System header to define __stub macros and hopefully few prototypes,
7640     which can conflict with char vprintf(); below.  */
7641 #include <assert.h>
7642 /* Override any gcc2 internal prototype to avoid an error.  */
7643 /* We use char because int might match the return type of a gcc2
7644     builtin and then its argument prototype would still apply.  */
7645 char vprintf();
7646
7647 int main() {
7648
7649 /* The GNU C library defines this for functions which it implements
7650     to always fail with ENOSYS.  Some functions are actually named
7651     something starting with __ and the normal name is an alias.  */
7652 #if defined (__stub_vprintf) || defined (__stub___vprintf)
7653 choke me
7654 #else
7655 vprintf();
7656 #endif
7657
7658 ; return 0; }
7659 EOF
7660 if { (eval echo configure:7661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7661   rm -rf conftest*
7662   eval "ac_cv_func_vprintf=yes"
7663 else
7664   echo "configure: failed program was:" >&5
7665   cat conftest.$ac_ext >&5
7666   rm -rf conftest*
7667   eval "ac_cv_func_vprintf=no"
7668 fi
7669 rm -f conftest*
7670 fi
7671
7672 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
7673   echo "$ac_t""yes" 1>&6
7674   cat >> confdefs.h <<\EOF
7675 #define HAVE_VPRINTF 1
7676 EOF
7677
7678 else
7679   echo "$ac_t""no" 1>&6
7680 fi
7681
7682 if test "$ac_cv_func_vprintf" != yes; then
7683 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
7684 echo "configure:7685: checking for _doprnt" >&5
7685 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
7686   echo $ac_n "(cached) $ac_c" 1>&6
7687 else
7688   cat > conftest.$ac_ext <<EOF
7689 #line 7690 "configure"
7690 #include "confdefs.h"
7691 /* System header to define __stub macros and hopefully few prototypes,
7692     which can conflict with char _doprnt(); below.  */
7693 #include <assert.h>
7694 /* Override any gcc2 internal prototype to avoid an error.  */
7695 /* We use char because int might match the return type of a gcc2
7696     builtin and then its argument prototype would still apply.  */
7697 char _doprnt();
7698
7699 int main() {
7700
7701 /* The GNU C library defines this for functions which it implements
7702     to always fail with ENOSYS.  Some functions are actually named
7703     something starting with __ and the normal name is an alias.  */
7704 #if defined (__stub__doprnt) || defined (__stub____doprnt)
7705 choke me
7706 #else
7707 _doprnt();
7708 #endif
7709
7710 ; return 0; }
7711 EOF
7712 if { (eval echo configure:7713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7713   rm -rf conftest*
7714   eval "ac_cv_func__doprnt=yes"
7715 else
7716   echo "configure: failed program was:" >&5
7717   cat conftest.$ac_ext >&5
7718   rm -rf conftest*
7719   eval "ac_cv_func__doprnt=no"
7720 fi
7721 rm -f conftest*
7722 fi
7723
7724 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
7725   echo "$ac_t""yes" 1>&6
7726   cat >> confdefs.h <<\EOF
7727 #define HAVE_DOPRNT 1
7728 EOF
7729
7730 else
7731   echo "$ac_t""no" 1>&6
7732 fi
7733
7734 fi
7735
7736
7737 if test $ac_cv_func_vprintf = yes ; then
7738                 for ac_func in vsnprintf
7739 do
7740 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7741 echo "configure:7742: checking for $ac_func" >&5
7742 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
7743   echo $ac_n "(cached) $ac_c" 1>&6
7744 else
7745   cat > conftest.$ac_ext <<EOF
7746 #line 7747 "configure"
7747 #include "confdefs.h"
7748 /* System header to define __stub macros and hopefully few prototypes,
7749     which can conflict with char $ac_func(); below.  */
7750 #include <assert.h>
7751 /* Override any gcc2 internal prototype to avoid an error.  */
7752 /* We use char because int might match the return type of a gcc2
7753     builtin and then its argument prototype would still apply.  */
7754 char $ac_func();
7755
7756 int main() {
7757
7758 /* The GNU C library defines this for functions which it implements
7759     to always fail with ENOSYS.  Some functions are actually named
7760     something starting with __ and the normal name is an alias.  */
7761 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7762 choke me
7763 #else
7764 $ac_func();
7765 #endif
7766
7767 ; return 0; }
7768 EOF
7769 if { (eval echo configure:7770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7770   rm -rf conftest*
7771   eval "ac_cv_func_$ac_func=yes"
7772 else
7773   echo "configure: failed program was:" >&5
7774   cat conftest.$ac_ext >&5
7775   rm -rf conftest*
7776   eval "ac_cv_func_$ac_func=no"
7777 fi
7778 rm -f conftest*
7779 fi
7780
7781 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7782   echo "$ac_t""yes" 1>&6
7783     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7784   cat >> confdefs.h <<EOF
7785 #define $ac_tr_func 1
7786 EOF
7787  
7788 else
7789   echo "$ac_t""no" 1>&6
7790 fi
7791 done
7792
7793 fi
7794
7795 echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6
7796 echo "configure:7797: checking for wait3 that fills in rusage" >&5
7797 if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then
7798   echo $ac_n "(cached) $ac_c" 1>&6
7799 else
7800   if test "$cross_compiling" = yes; then
7801   ac_cv_func_wait3_rusage=no
7802 else
7803   cat > conftest.$ac_ext <<EOF
7804 #line 7805 "configure"
7805 #include "confdefs.h"
7806 #include <sys/types.h>
7807 #include <sys/time.h>
7808 #include <sys/resource.h>
7809 #include <stdio.h>
7810 /* HP-UX has wait3 but does not fill in rusage at all.  */
7811 main() {
7812   struct rusage r;
7813   int i;
7814   /* Use a field that we can force nonzero --
7815      voluntary context switches.
7816      For systems like NeXT and OSF/1 that don't set it,
7817      also use the system CPU time.  And page faults (I/O) for Linux.  */
7818   r.ru_nvcsw = 0;
7819   r.ru_stime.tv_sec = 0;
7820   r.ru_stime.tv_usec = 0;
7821   r.ru_majflt = r.ru_minflt = 0;
7822   switch (fork()) {
7823   case 0: /* Child.  */
7824     sleep(1); /* Give up the CPU.  */
7825     _exit(0);
7826   case -1: _exit(0); /* What can we do?  */
7827   default: /* Parent.  */
7828     wait3(&i, 0, &r);
7829     sleep(2); /* Avoid "text file busy" from rm on fast HP-UX machines.  */
7830     exit(r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0
7831          && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
7832   }
7833 }
7834 EOF
7835 if { (eval echo configure:7836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
7836 then
7837   ac_cv_func_wait3_rusage=yes
7838 else
7839   echo "configure: failed program was:" >&5
7840   cat conftest.$ac_ext >&5
7841   rm -fr conftest*
7842   ac_cv_func_wait3_rusage=no
7843 fi
7844 rm -fr conftest*
7845 fi
7846
7847 fi
7848
7849 echo "$ac_t""$ac_cv_func_wait3_rusage" 1>&6
7850 if test $ac_cv_func_wait3_rusage = yes; then
7851   cat >> confdefs.h <<\EOF
7852 #define HAVE_WAIT3 1
7853 EOF
7854
7855 fi
7856
7857
7858 for ac_func in \
7859         bcopy                   \
7860         flock                   \
7861         getdtablesize   \
7862         gethostname             \
7863         getpwuid                \
7864         gettimeofday    \
7865         lockf                   \
7866         memcpy                  \
7867         memmove                 \
7868         mkstemp                 \
7869         res_search              \
7870         select                  \
7871         setpwfile               \
7872         setsid                  \
7873         signal                  \
7874         sigset                  \
7875         snprintf                \
7876         socket                  \
7877         strerror                \
7878         strpbrk                 \
7879         strrchr                 \
7880         strsep                  \
7881         strstr                  \
7882         strtok                  \
7883         strtol                  \
7884         strtoul                 \
7885         sysconf                 \
7886         waitpid                 \
7887
7888 do
7889 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7890 echo "configure:7891: checking for $ac_func" >&5
7891 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
7892   echo $ac_n "(cached) $ac_c" 1>&6
7893 else
7894   cat > conftest.$ac_ext <<EOF
7895 #line 7896 "configure"
7896 #include "confdefs.h"
7897 /* System header to define __stub macros and hopefully few prototypes,
7898     which can conflict with char $ac_func(); below.  */
7899 #include <assert.h>
7900 /* Override any gcc2 internal prototype to avoid an error.  */
7901 /* We use char because int might match the return type of a gcc2
7902     builtin and then its argument prototype would still apply.  */
7903 char $ac_func();
7904
7905 int main() {
7906
7907 /* The GNU C library defines this for functions which it implements
7908     to always fail with ENOSYS.  Some functions are actually named
7909     something starting with __ and the normal name is an alias.  */
7910 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7911 choke me
7912 #else
7913 $ac_func();
7914 #endif
7915
7916 ; return 0; }
7917 EOF
7918 if { (eval echo configure:7919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7919   rm -rf conftest*
7920   eval "ac_cv_func_$ac_func=yes"
7921 else
7922   echo "configure: failed program was:" >&5
7923   cat conftest.$ac_ext >&5
7924   rm -rf conftest*
7925   eval "ac_cv_func_$ac_func=no"
7926 fi
7927 rm -f conftest*
7928 fi
7929
7930 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7931   echo "$ac_t""yes" 1>&6
7932     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7933   cat >> confdefs.h <<EOF
7934 #define $ac_tr_func 1
7935 EOF
7936  
7937 else
7938   echo "$ac_t""no" 1>&6
7939 fi
7940 done
7941
7942
7943 for ac_func in getopt strdup tempnam
7944 do
7945 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7946 echo "configure:7947: checking for $ac_func" >&5
7947 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
7948   echo $ac_n "(cached) $ac_c" 1>&6
7949 else
7950   cat > conftest.$ac_ext <<EOF
7951 #line 7952 "configure"
7952 #include "confdefs.h"
7953 /* System header to define __stub macros and hopefully few prototypes,
7954     which can conflict with char $ac_func(); below.  */
7955 #include <assert.h>
7956 /* Override any gcc2 internal prototype to avoid an error.  */
7957 /* We use char because int might match the return type of a gcc2
7958     builtin and then its argument prototype would still apply.  */
7959 char $ac_func();
7960
7961 int main() {
7962
7963 /* The GNU C library defines this for functions which it implements
7964     to always fail with ENOSYS.  Some functions are actually named
7965     something starting with __ and the normal name is an alias.  */
7966 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7967 choke me
7968 #else
7969 $ac_func();
7970 #endif
7971
7972 ; return 0; }
7973 EOF
7974 if { (eval echo configure:7975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7975   rm -rf conftest*
7976   eval "ac_cv_func_$ac_func=yes"
7977 else
7978   echo "configure: failed program was:" >&5
7979   cat conftest.$ac_ext >&5
7980   rm -rf conftest*
7981   eval "ac_cv_func_$ac_func=no"
7982 fi
7983 rm -f conftest*
7984 fi
7985
7986 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7987   echo "$ac_t""yes" 1>&6
7988     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7989   cat >> confdefs.h <<EOF
7990 #define $ac_tr_func 1
7991 EOF
7992  
7993 else
7994   echo "$ac_t""no" 1>&6
7995 LIBOBJS="$LIBOBJS ${ac_func}.o"
7996 fi
7997 done
7998
7999
8000
8001 # Check Configuration
8002
8003 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
8004 echo "configure:8005: checking declaration of sys_errlist" >&5
8005 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
8006   echo $ac_n "(cached) $ac_c" 1>&6
8007 else
8008   
8009         cat > conftest.$ac_ext <<EOF
8010 #line 8011 "configure"
8011 #include "confdefs.h"
8012
8013 #include <stdio.h>
8014 #include <sys/types.h>
8015 #include <errno.h> 
8016 int main() {
8017 char *c = (char *) *sys_errlist
8018 ; return 0; }
8019 EOF
8020 if { (eval echo configure:8021: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8021   rm -rf conftest*
8022   ol_cv_dcl_sys_errlist=yes
8023 else
8024   echo "configure: failed program was:" >&5
8025   cat conftest.$ac_ext >&5
8026   rm -rf conftest*
8027   ol_cv_dcl_sys_errlist=no
8028 fi
8029 rm -f conftest*
8030 fi
8031
8032 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
8033
8034 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
8035 if test $ol_cv_dcl_sys_errlist = no ; then
8036         cat >> confdefs.h <<\EOF
8037 #define DECL_SYS_ERRLIST 1
8038 EOF
8039
8040         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
8041 echo "configure:8042: checking existence of sys_errlist" >&5
8042         if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
8043   echo $ac_n "(cached) $ac_c" 1>&6
8044 else
8045   
8046                 cat > conftest.$ac_ext <<EOF
8047 #line 8048 "configure"
8048 #include "confdefs.h"
8049 #include <errno.h>
8050 int main() {
8051 char *c = (char *) *sys_errlist
8052 ; return 0; }
8053 EOF
8054 if { (eval echo configure:8055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8055   rm -rf conftest*
8056   ol_cv_have_sys_errlist=yes
8057 else
8058   echo "configure: failed program was:" >&5
8059   cat conftest.$ac_ext >&5
8060   rm -rf conftest*
8061   ol_cv_have_sys_errlist=no
8062 fi
8063 rm -f conftest*
8064 fi
8065
8066         echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
8067 fi
8068
8069
8070
8071 if test $ol_enable_debug != no ; then
8072         cat >> confdefs.h <<\EOF
8073 #define LDAP_DEBUG 1
8074 EOF
8075
8076 fi
8077 if test $ol_enable_libui = yes ; then
8078         cat >> confdefs.h <<\EOF
8079 #define LDAP_LIBUI 1
8080 EOF
8081
8082 fi
8083 if test $ol_enable_cache = no ; then
8084         cat >> confdefs.h <<\EOF
8085 #define LDAP_NOCACHE 1
8086 EOF
8087
8088 fi
8089 if test $ol_enable_dns != no ; then
8090         cat >> confdefs.h <<\EOF
8091 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS 1
8092 EOF
8093
8094 fi
8095 if test $ol_enable_proctitle != no ; then
8096         cat >> confdefs.h <<\EOF
8097 #define LDAP_PROCTITLE 1
8098 EOF
8099
8100 fi
8101 if test $ol_enable_referrals != no ; then
8102         cat >> confdefs.h <<\EOF
8103 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS 1
8104 EOF
8105
8106 fi
8107 if test $ol_enable_cldap != no ; then
8108         cat >> confdefs.h <<\EOF
8109 #define LDAP_CONNECTIONLESS 1
8110 EOF
8111
8112 fi
8113
8114 if test $ol_enable_aclgroups != no ; then
8115         cat >> confdefs.h <<\EOF
8116 #define SLAPD_ACLGROUPS 1
8117 EOF
8118
8119 fi
8120 if test $ol_enable_crypt != no ; then
8121         cat >> confdefs.h <<\EOF
8122 #define SLAPD_CRYPT 1
8123 EOF
8124
8125 fi
8126 if test $ol_enable_cleartext != no ; then
8127         cat >> confdefs.h <<\EOF
8128 #define SLAPD_CLEARTEXT 1
8129 EOF
8130
8131 fi
8132 if test $ol_enable_phonetic != no ; then
8133         cat >> confdefs.h <<\EOF
8134 #define SLAPD_PHONETIC 1
8135 EOF
8136
8137 fi
8138 if test $ol_enable_rlookups != no ; then
8139         cat >> confdefs.h <<\EOF
8140 #define SLAPD_RLOOKUPS 1
8141 EOF
8142
8143 fi
8144
8145 if test $ol_link_ldbm != no ; then
8146         cat >> confdefs.h <<\EOF
8147 #define SLAPD_LDBM 1
8148 EOF
8149
8150         BUILD_SLAPD=yes
8151         BUILD_LDBM=yes
8152 fi
8153
8154 if test $ol_enable_passwd != no ; then
8155         cat >> confdefs.h <<\EOF
8156 #define SLAPD_PASSWD 1
8157 EOF
8158
8159         BUILD_SLAPD=yes
8160         BUILD_PASSWD=yes
8161 fi
8162
8163 if test $ol_enable_shell != no ; then
8164         cat >> confdefs.h <<\EOF
8165 #define SLAPD_SHELL 1
8166 EOF
8167
8168         BUILD_SLAPD=yes
8169         BUILD_SHELL=yes
8170 fi
8171
8172 if test $ol_enable_slurpd != no -a $ol_link_threads != no -a \
8173         $BUILD_SLAPD = yes ; then
8174         BUILD_SLURPD=yes
8175 fi
8176
8177 if test $ol_link_isode != no ; then
8178         BUILD_LDAPD=yes
8179 fi
8180
8181
8182
8183
8184   
8185   
8186   
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202 trap '' 1 2 15
8203 cat > confcache <<\EOF
8204 # This file is a shell script that caches the results of configure
8205 # tests run on this system so they can be shared between configure
8206 # scripts and configure runs.  It is not useful on other systems.
8207 # If it contains results you don't want to keep, you may remove or edit it.
8208 #
8209 # By default, configure uses ./config.cache as the cache file,
8210 # creating it if it does not exist already.  You can give configure
8211 # the --cache-file=FILE option to use a different cache file; that is
8212 # what configure does when it calls configure scripts in
8213 # subdirectories, so they share the cache.
8214 # Giving --cache-file=/dev/null disables caching, for debugging configure.
8215 # config.status only pays attention to the cache file if you give it the
8216 # --recheck option to rerun configure.
8217 #
8218 EOF
8219 # The following way of writing the cache mishandles newlines in values,
8220 # but we know of no workaround that is simple, portable, and efficient.
8221 # So, don't put newlines in cache variables' values.
8222 # Ultrix sh set writes to stderr and can't be redirected directly,
8223 # and sets the high bit in the cache file unless we assign to the vars.
8224 (set) 2>&1 |
8225   case `(ac_space=' '; set) 2>&1` in
8226   *ac_space=\ *)
8227     # `set' does not quote correctly, so add quotes (double-quote substitution
8228     # turns \\\\ into \\, and sed turns \\ into \).
8229     sed -n \
8230       -e "s/'/'\\\\''/g" \
8231       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
8232     ;;
8233   *)
8234     # `set' quotes correctly as required by POSIX, so do not add quotes.
8235     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
8236     ;;
8237   esac >> confcache
8238 if cmp -s $cache_file confcache; then
8239   :
8240 else
8241   if test -w $cache_file; then
8242     echo "updating cache $cache_file"
8243     cat confcache > $cache_file
8244   else
8245     echo "not updating unwritable cache $cache_file"
8246   fi
8247 fi
8248 rm -f confcache
8249
8250 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
8251
8252 test "x$prefix" = xNONE && prefix=$ac_default_prefix
8253 # Let make expand exec_prefix.
8254 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
8255
8256 # Any assignment to VPATH causes Sun make to only execute
8257 # the first set of double-colon rules, so remove it if not needed.
8258 # If there is a colon in the path, we need to keep it.
8259 if test "x$srcdir" = x.; then
8260   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
8261 fi
8262
8263 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
8264
8265 DEFS=-DHAVE_CONFIG_H
8266
8267 # Without the "./", some shells look in PATH for config.status.
8268 : ${CONFIG_STATUS=./config.status}
8269
8270 echo creating $CONFIG_STATUS
8271 rm -f $CONFIG_STATUS
8272 cat > $CONFIG_STATUS <<EOF
8273 #! /bin/sh
8274 # Generated automatically by configure.
8275 # Run this file to recreate the current configuration.
8276 # This directory was configured as follows,
8277 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
8278 #
8279 # $0 $ac_configure_args
8280 #
8281 # Compiler output produced by configure, useful for debugging
8282 # configure, is in ./config.log if it exists.
8283
8284 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
8285 for ac_option
8286 do
8287   case "\$ac_option" in
8288   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
8289     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
8290     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
8291   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
8292     echo "$CONFIG_STATUS generated by autoconf version 2.12"
8293     exit 0 ;;
8294   -help | --help | --hel | --he | --h)
8295     echo "\$ac_cs_usage"; exit 0 ;;
8296   *) echo "\$ac_cs_usage"; exit 1 ;;
8297   esac
8298 done
8299
8300 ac_given_srcdir=$srcdir
8301 ac_given_INSTALL="$INSTALL"
8302
8303 trap 'rm -fr `echo "\
8304 Makefile:build/top.mk:Makefile.in:build/dir.mk \
8305 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
8306 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
8307 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
8308 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
8309 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
8310 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
8311 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
8312 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
8313 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
8314 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
8315 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
8316 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
8317 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
8318 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
8319 include/Makefile:build/top.mk:include/Makefile.in \
8320 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
8321 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
8322 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
8323 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
8324 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
8325 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
8326 libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk:build/lib-static.mk    \
8327 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
8328 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
8329 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
8330 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
8331 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
8332 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
8333 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
8334 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
8335 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
8336 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
8337 tests/Makefile:build/top.mk:tests/Makefile.in \
8338  include/portable.h include/ldap_features.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
8339 EOF
8340 cat >> $CONFIG_STATUS <<EOF
8341
8342 # Protect against being on the right side of a sed subst in config.status.
8343 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
8344  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
8345 $ac_vpsub
8346 $extrasub
8347 s%@CFLAGS@%$CFLAGS%g
8348 s%@CPPFLAGS@%$CPPFLAGS%g
8349 s%@CXXFLAGS@%$CXXFLAGS%g
8350 s%@DEFS@%$DEFS%g
8351 s%@LDFLAGS@%$LDFLAGS%g
8352 s%@LIBS@%$LIBS%g
8353 s%@exec_prefix@%$exec_prefix%g
8354 s%@prefix@%$prefix%g
8355 s%@program_transform_name@%$program_transform_name%g
8356 s%@bindir@%$bindir%g
8357 s%@sbindir@%$sbindir%g
8358 s%@libexecdir@%$libexecdir%g
8359 s%@datadir@%$datadir%g
8360 s%@sysconfdir@%$sysconfdir%g
8361 s%@sharedstatedir@%$sharedstatedir%g
8362 s%@localstatedir@%$localstatedir%g
8363 s%@libdir@%$libdir%g
8364 s%@includedir@%$includedir%g
8365 s%@oldincludedir@%$oldincludedir%g
8366 s%@infodir@%$infodir%g
8367 s%@mandir@%$mandir%g
8368 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
8369 s%@INSTALL_DATA@%$INSTALL_DATA%g
8370 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
8371 s%@PACKAGE@%$PACKAGE%g
8372 s%@VERSION@%$VERSION%g
8373 s%@ACLOCAL@%$ACLOCAL%g
8374 s%@AUTOCONF@%$AUTOCONF%g
8375 s%@AUTOMAKE@%$AUTOMAKE%g
8376 s%@AUTOHEADER@%$AUTOHEADER%g
8377 s%@MAKEINFO@%$MAKEINFO%g
8378 s%@SET_MAKE@%$SET_MAKE%g
8379 s%@top_builddir@%$top_builddir%g
8380 s%@ldap_subdir@%$ldap_subdir%g
8381 s%@host@%$host%g
8382 s%@host_alias@%$host_alias%g
8383 s%@host_cpu@%$host_cpu%g
8384 s%@host_vendor@%$host_vendor%g
8385 s%@host_os@%$host_os%g
8386 s%@RANLIB@%$RANLIB%g
8387 s%@CC@%$CC%g
8388 s%@LD@%$LD%g
8389 s%@NM@%$NM%g
8390 s%@LN_S@%$LN_S%g
8391 s%@LIBTOOL@%$LIBTOOL%g
8392 s%@SENDMAIL@%$SENDMAIL%g
8393 s%@EDITOR@%$EDITOR%g
8394 s%@FINGER@%$FINGER%g
8395 s%@CPP@%$CPP%g
8396 s%@PEPSY@%$PEPSY%g
8397 s%@LIBOBJS@%$LIBOBJS%g
8398 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
8399 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
8400 s%@BUILD_LDBM@%$BUILD_LDBM%g
8401 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
8402 s%@BUILD_SHELL@%$BUILD_SHELL%g
8403 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
8404 s%@LDAP_LIBS@%$LDAP_LIBS%g
8405 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
8406 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
8407 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
8408 s%@LDBM_LIBS@%$LDBM_LIBS%g
8409 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
8410 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
8411 s%@KRB_LIBS@%$KRB_LIBS%g
8412 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
8413
8414 CEOF
8415 EOF
8416
8417 cat >> $CONFIG_STATUS <<\EOF
8418
8419 # Split the substitutions into bite-sized pieces for seds with
8420 # small command number limits, like on Digital OSF/1 and HP-UX.
8421 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
8422 ac_file=1 # Number of current file.
8423 ac_beg=1 # First line for current file.
8424 ac_end=$ac_max_sed_cmds # Line after last line for current file.
8425 ac_more_lines=:
8426 ac_sed_cmds=""
8427 while $ac_more_lines; do
8428   if test $ac_beg -gt 1; then
8429     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
8430   else
8431     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
8432   fi
8433   if test ! -s conftest.s$ac_file; then
8434     ac_more_lines=false
8435     rm -f conftest.s$ac_file
8436   else
8437     if test -z "$ac_sed_cmds"; then
8438       ac_sed_cmds="sed -f conftest.s$ac_file"
8439     else
8440       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
8441     fi
8442     ac_file=`expr $ac_file + 1`
8443     ac_beg=$ac_end
8444     ac_end=`expr $ac_end + $ac_max_sed_cmds`
8445   fi
8446 done
8447 if test -z "$ac_sed_cmds"; then
8448   ac_sed_cmds=cat
8449 fi
8450 EOF
8451
8452 cat >> $CONFIG_STATUS <<EOF
8453
8454 CONFIG_FILES=\${CONFIG_FILES-"\
8455 Makefile:build/top.mk:Makefile.in:build/dir.mk \
8456 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
8457 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
8458 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
8459 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
8460 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
8461 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
8462 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
8463 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
8464 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
8465 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
8466 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
8467 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
8468 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
8469 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
8470 include/Makefile:build/top.mk:include/Makefile.in \
8471 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
8472 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
8473 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
8474 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
8475 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
8476 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
8477 libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk:build/lib-static.mk    \
8478 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
8479 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
8480 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
8481 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
8482 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
8483 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
8484 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
8485 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
8486 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
8487 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
8488 tests/Makefile:build/top.mk:tests/Makefile.in \
8489 "}
8490 EOF
8491 cat >> $CONFIG_STATUS <<\EOF
8492 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
8493   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
8494   case "$ac_file" in
8495   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
8496        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
8497   *) ac_file_in="${ac_file}.in" ;;
8498   esac
8499
8500   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
8501
8502   # Remove last slash and all that follows it.  Not all systems have dirname.
8503   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
8504   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
8505     # The file is in a subdirectory.
8506     test ! -d "$ac_dir" && mkdir "$ac_dir"
8507     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
8508     # A "../" for each directory in $ac_dir_suffix.
8509     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
8510   else
8511     ac_dir_suffix= ac_dots=
8512   fi
8513
8514   case "$ac_given_srcdir" in
8515   .)  srcdir=.
8516       if test -z "$ac_dots"; then top_srcdir=.
8517       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
8518   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
8519   *) # Relative path.
8520     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
8521     top_srcdir="$ac_dots$ac_given_srcdir" ;;
8522   esac
8523
8524   case "$ac_given_INSTALL" in
8525   [/$]*) INSTALL="$ac_given_INSTALL" ;;
8526   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
8527   esac
8528
8529   echo creating "$ac_file"
8530   rm -f "$ac_file"
8531   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
8532   case "$ac_file" in
8533   *Makefile*) ac_comsub="1i\\
8534 # $configure_input" ;;
8535   *) ac_comsub= ;;
8536   esac
8537
8538   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
8539   sed -e "$ac_comsub
8540 s%@configure_input@%$configure_input%g
8541 s%@srcdir@%$srcdir%g
8542 s%@top_srcdir@%$top_srcdir%g
8543 s%@INSTALL@%$INSTALL%g
8544 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
8545 fi; done
8546 rm -f conftest.s*
8547
8548 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
8549 # NAME is the cpp macro being defined and VALUE is the value it is being given.
8550 #
8551 # ac_d sets the value in "#define NAME VALUE" lines.
8552 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
8553 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
8554 ac_dC='\3'
8555 ac_dD='%g'
8556 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
8557 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
8558 ac_uB='\([      ]\)%\1#\2define\3'
8559 ac_uC=' '
8560 ac_uD='\4%g'
8561 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
8562 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
8563 ac_eB='$%\1#\2define\3'
8564 ac_eC=' '
8565 ac_eD='%g'
8566
8567 if test "${CONFIG_HEADERS+set}" != set; then
8568 EOF
8569 cat >> $CONFIG_STATUS <<EOF
8570   CONFIG_HEADERS="include/portable.h include/ldap_features.h"
8571 EOF
8572 cat >> $CONFIG_STATUS <<\EOF
8573 fi
8574 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
8575   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
8576   case "$ac_file" in
8577   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
8578        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
8579   *) ac_file_in="${ac_file}.in" ;;
8580   esac
8581
8582   echo creating $ac_file
8583
8584   rm -f conftest.frag conftest.in conftest.out
8585   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
8586   cat $ac_file_inputs > conftest.in
8587
8588 EOF
8589
8590 # Transform confdefs.h into a sed script conftest.vals that substitutes
8591 # the proper values into config.h.in to produce config.h.  And first:
8592 # Protect against being on the right side of a sed subst in config.status.
8593 # Protect against being in an unquoted here document in config.status.
8594 rm -f conftest.vals
8595 cat > conftest.hdr <<\EOF
8596 s/[\\&%]/\\&/g
8597 s%[\\$`]%\\&%g
8598 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
8599 s%ac_d%ac_u%gp
8600 s%ac_u%ac_e%gp
8601 EOF
8602 sed -n -f conftest.hdr confdefs.h > conftest.vals
8603 rm -f conftest.hdr
8604
8605 # This sed command replaces #undef with comments.  This is necessary, for
8606 # example, in the case of _POSIX_SOURCE, which is predefined and required
8607 # on some systems where configure will not decide to define it.
8608 cat >> conftest.vals <<\EOF
8609 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
8610 EOF
8611
8612 # Break up conftest.vals because some shells have a limit on
8613 # the size of here documents, and old seds have small limits too.
8614
8615 rm -f conftest.tail
8616 while :
8617 do
8618   ac_lines=`grep -c . conftest.vals`
8619   # grep -c gives empty output for an empty file on some AIX systems.
8620   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
8621   # Write a limited-size here document to conftest.frag.
8622   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
8623   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
8624   echo 'CEOF
8625   sed -f conftest.frag conftest.in > conftest.out
8626   rm -f conftest.in
8627   mv conftest.out conftest.in
8628 ' >> $CONFIG_STATUS
8629   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
8630   rm -f conftest.vals
8631   mv conftest.tail conftest.vals
8632 done
8633 rm -f conftest.vals
8634
8635 cat >> $CONFIG_STATUS <<\EOF
8636   rm -f conftest.frag conftest.h
8637   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
8638   cat conftest.in >> conftest.h
8639   rm -f conftest.in
8640   if cmp -s $ac_file conftest.h 2>/dev/null; then
8641     echo "$ac_file is unchanged"
8642     rm -f conftest.h
8643   else
8644     # Remove last slash and all that follows it.  Not all systems have dirname.
8645       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
8646       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
8647       # The file is in a subdirectory.
8648       test ! -d "$ac_dir" && mkdir "$ac_dir"
8649     fi
8650     rm -f $ac_file
8651     mv conftest.h $ac_file
8652   fi
8653 fi; done
8654
8655 EOF
8656 cat >> $CONFIG_STATUS <<EOF
8657
8658 EOF
8659 cat >> $CONFIG_STATUS <<\EOF
8660
8661 date > stamp-h
8662 echo Please \"make depend\" to build dependencies
8663
8664 exit 0
8665 EOF
8666 chmod +x $CONFIG_STATUS
8667 rm -fr confdefs* $ac_clean_files
8668 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
8669