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