]> git.sur5r.net Git - openldap/blob - configure
Replaced PREEMPTIVE_THREADS with HAVE_YIELDING_SELECT to clarify
[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
3209                         KRB_LIBS="-lkrb -ldes"
3210                 fi
3211         fi
3212 fi
3213
3214 ol_link_threads=no
3215 if test $ol_with_threads = auto -o $ol_with_threads = posix ; then
3216         for ac_hdr in pthread.h sched.h
3217 do
3218 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3219 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3220 echo "configure:3221: checking for $ac_hdr" >&5
3221 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3222   echo $ac_n "(cached) $ac_c" 1>&6
3223 else
3224   cat > conftest.$ac_ext <<EOF
3225 #line 3226 "configure"
3226 #include "confdefs.h"
3227 #include <$ac_hdr>
3228 EOF
3229 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3230 { (eval echo configure:3231: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3231 ac_err=`grep -v '^ *+' conftest.out`
3232 if test -z "$ac_err"; then
3233   rm -rf conftest*
3234   eval "ac_cv_header_$ac_safe=yes"
3235 else
3236   echo "$ac_err" >&5
3237   echo "configure: failed program was:" >&5
3238   cat conftest.$ac_ext >&5
3239   rm -rf conftest*
3240   eval "ac_cv_header_$ac_safe=no"
3241 fi
3242 rm -f conftest*
3243 fi
3244 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3245   echo "$ac_t""yes" 1>&6
3246     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3247   cat >> confdefs.h <<EOF
3248 #define $ac_tr_hdr 1
3249 EOF
3250  
3251 else
3252   echo "$ac_t""no" 1>&6
3253 fi
3254 done
3255
3256
3257         if test $ac_cv_header_pthread_h = yes ; then
3258                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
3259 echo "configure:3260: checking POSIX thread version" >&5
3260 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
3261   echo $ac_n "(cached) $ac_c" 1>&6
3262 else
3263   
3264         cat > conftest.$ac_ext <<EOF
3265 #line 3266 "configure"
3266 #include "confdefs.h"
3267
3268 #               include <pthread.h>
3269                 /* this check could be improved */
3270 #               ifdef PTHREAD_ONCE_INIT
3271                         final
3272 #               endif
3273         
3274 EOF
3275 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3276   egrep "final" >/dev/null 2>&1; then
3277   rm -rf conftest*
3278   ol_pthread_final=yes
3279 else
3280   rm -rf conftest*
3281   ol_pthread_final=no
3282 fi
3283 rm -f conftest*
3284
3285
3286         cat > conftest.$ac_ext <<EOF
3287 #line 3288 "configure"
3288 #include "confdefs.h"
3289
3290 #               include <pthread.h>
3291                 /* this check could be improved */
3292 #               ifdef pthread_once_init
3293                         draft4
3294 #               endif
3295         
3296 EOF
3297 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3298   egrep "draft4" >/dev/null 2>&1; then
3299   rm -rf conftest*
3300   ol_pthread_draft4=yes
3301 else
3302   rm -rf conftest*
3303   ol_pthread_draft4=no
3304 fi
3305 rm -f conftest*
3306
3307
3308         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
3309                 ol_cv_pthread_version=final
3310         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
3311                 ol_cv_pthread_version=draft4
3312         else
3313                 ol_cv_pthread_version=unknown
3314         fi
3315
3316 fi
3317
3318 echo "$ac_t""$ol_cv_pthread_version" 1>&6
3319
3320
3321                 if test $ol_cv_pthread_version = final ; then
3322                         cat >> confdefs.h <<\EOF
3323 #define HAVE_PTHREADS_FINAL 1
3324 EOF
3325
3326                 elif test $ol_cv_pthread_version = draft4 ; then
3327                         cat >> confdefs.h <<\EOF
3328 #define HAVE_PTHREADS_D4 1
3329 EOF
3330
3331                 else
3332                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
3333                 fi
3334
3335                 # consider threads found
3336                 ol_with_threads=found
3337
3338                 
3339 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
3340 echo "configure:3341: checking for LinuxThreads" >&5
3341 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
3342   echo $ac_n "(cached) $ac_c" 1>&6
3343 else
3344   
3345         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
3346         if test "$res" -gt 0 ; then
3347                 ol_cv_linux_threads=yes
3348         else
3349                 ol_cv_linux_threads=no
3350         fi
3351
3352 fi
3353
3354 echo "$ac_t""$ol_cv_linux_threads" 1>&6
3355
3356
3357                 if test $ol_cv_linux_threads = yes ; then
3358                         cat >> confdefs.h <<\EOF
3359 #define HAVE_LINUX_THREADS 1
3360 EOF
3361
3362                 fi
3363
3364                 
3365                                 echo $ac_n "checking for pthread_create""... $ac_c" 1>&6
3366 echo "configure:3367: checking for pthread_create" >&5
3367 if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then
3368   echo $ac_n "(cached) $ac_c" 1>&6
3369 else
3370   cat > conftest.$ac_ext <<EOF
3371 #line 3372 "configure"
3372 #include "confdefs.h"
3373 /* System header to define __stub macros and hopefully few prototypes,
3374     which can conflict with char pthread_create(); below.  */
3375 #include <assert.h>
3376 /* Override any gcc2 internal prototype to avoid an error.  */
3377 /* We use char because int might match the return type of a gcc2
3378     builtin and then its argument prototype would still apply.  */
3379 char pthread_create();
3380
3381 int main() {
3382
3383 /* The GNU C library defines this for functions which it implements
3384     to always fail with ENOSYS.  Some functions are actually named
3385     something starting with __ and the normal name is an alias.  */
3386 #if defined (__stub_pthread_create) || defined (__stub___pthread_create)
3387 choke me
3388 #else
3389 pthread_create();
3390 #endif
3391
3392 ; return 0; }
3393 EOF
3394 if { (eval echo configure:3395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3395   rm -rf conftest*
3396   eval "ac_cv_func_pthread_create=yes"
3397 else
3398   echo "configure: failed program was:" >&5
3399   cat conftest.$ac_ext >&5
3400   rm -rf conftest*
3401   eval "ac_cv_func_pthread_create=no"
3402 fi
3403 rm -f conftest*
3404 fi
3405
3406 if eval "test \"`echo '$ac_cv_func_'pthread_create`\" = yes"; then
3407   echo "$ac_t""yes" 1>&6
3408   ol_link_threads=yes
3409 else
3410   echo "$ac_t""no" 1>&6
3411 fi
3412
3413
3414                 if test $ol_link_threads = no ; then
3415                                                 echo $ac_n "checking for pthread_create with -pthread""... $ac_c" 1>&6
3416 echo "configure:3417: checking for pthread_create with -pthread" >&5
3417 if eval "test \"`echo '$''{'ol_cv_pthread_flag'+set}'`\" = set"; then
3418   echo $ac_n "(cached) $ac_c" 1>&6
3419 else
3420   
3421                                                                 save_LIBS="$LIBS"
3422                                 LIBS="-pthread $LIBS"
3423                                 cat > conftest.$ac_ext <<EOF
3424 #line 3425 "configure"
3425 #include "confdefs.h"
3426 char pthread();
3427 int main() {
3428
3429                                         pthread_create();
3430                                         
3431 ; return 0; }
3432 EOF
3433 if { (eval echo configure:3434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3434   rm -rf conftest*
3435   ol_cv_pthread_flag=yes
3436 else
3437   echo "configure: failed program was:" >&5
3438   cat conftest.$ac_ext >&5
3439   rm -rf conftest*
3440   ol_cv_pthread_flag=no
3441 fi
3442 rm -f conftest*
3443                                                                 LIBS="$save_LIBS"
3444                         
3445 fi
3446
3447 echo "$ac_t""$ol_cv_pthread_flag" 1>&6
3448
3449                         if test $ol_cv_pthread_flag = yes ; then
3450                                 LTHREAD_LIBS="$LTHREAD_LIBS -pthread"
3451                                 ol_link_threads=posix
3452                         fi
3453                 fi
3454
3455                 if test $ol_link_threads = no ; then
3456                                                 echo $ac_n "checking for pthread_create with -thread""... $ac_c" 1>&6
3457 echo "configure:3458: checking for pthread_create with -thread" >&5
3458 if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
3459   echo $ac_n "(cached) $ac_c" 1>&6
3460 else
3461   
3462                                                                 save_LIBS="$LIBS"
3463                                 LIBS="-thread $LIBS"
3464                                 cat > conftest.$ac_ext <<EOF
3465 #line 3466 "configure"
3466 #include "confdefs.h"
3467 char pthread();
3468 int main() {
3469
3470                                         pthread_create();
3471                                         
3472 ; return 0; }
3473 EOF
3474 if { (eval echo configure:3475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3475   rm -rf conftest*
3476   ol_cv_thread_flag=yes
3477 else
3478   echo "configure: failed program was:" >&5
3479   cat conftest.$ac_ext >&5
3480   rm -rf conftest*
3481   ol_cv_thread_flag=no
3482 fi
3483 rm -f conftest*
3484                                                                 LIBS="$save_LIBS"
3485                         
3486 fi
3487
3488 echo "$ac_t""$ol_cv_thread_flag" 1>&6
3489
3490                         if test $ol_cv_thread_flag = yes ; then
3491                                 LTHREAD_LIBS="$LTHREAD_LIBS -thread"
3492                                 ol_link_threads=posix
3493                         fi
3494                 fi
3495
3496                 if test $ol_link_threads = no ; then
3497                                                 save_LIBS="$LIBS"
3498                         echo $ac_n "checking for pthread_join in -lpthread""... $ac_c" 1>&6
3499 echo "configure:3500: checking for pthread_join in -lpthread" >&5
3500 ac_lib_var=`echo pthread'_'pthread_join | sed 'y%./+-%__p_%'`
3501 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3502   echo $ac_n "(cached) $ac_c" 1>&6
3503 else
3504   ac_save_LIBS="$LIBS"
3505 LIBS="-lpthread -lexc $LIBS"
3506 cat > conftest.$ac_ext <<EOF
3507 #line 3508 "configure"
3508 #include "confdefs.h"
3509 /* Override any gcc2 internal prototype to avoid an error.  */
3510 /* We use char because int might match the return type of a gcc2
3511     builtin and then its argument prototype would still apply.  */
3512 char pthread_join();
3513
3514 int main() {
3515 pthread_join()
3516 ; return 0; }
3517 EOF
3518 if { (eval echo configure:3519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3519   rm -rf conftest*
3520   eval "ac_cv_lib_$ac_lib_var=yes"
3521 else
3522   echo "configure: failed program was:" >&5
3523   cat conftest.$ac_ext >&5
3524   rm -rf conftest*
3525   eval "ac_cv_lib_$ac_lib_var=no"
3526 fi
3527 rm -f conftest*
3528 LIBS="$ac_save_LIBS"
3529
3530 fi
3531 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3532   echo "$ac_t""yes" 1>&6
3533   
3534                                 ol_link_threads=posix
3535                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lexc"
3536                                 if test $ol_with_yielding_select = auto ; then
3537                                         ol_with_yielding_select=yes
3538                                 fi
3539                                 
3540 else
3541   echo "$ac_t""no" 1>&6
3542 fi
3543
3544                         LIBS="$save_LIBS"
3545                 fi
3546
3547                 if test $ol_link_threads = no ; then
3548                                                 save_LIBS="$LIBS"
3549                         echo $ac_n "checking for pthread_join in -lpthreads""... $ac_c" 1>&6
3550 echo "configure:3551: checking for pthread_join in -lpthreads" >&5
3551 ac_lib_var=`echo pthreads'_'pthread_join | sed 'y%./+-%__p_%'`
3552 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3553   echo $ac_n "(cached) $ac_c" 1>&6
3554 else
3555   ac_save_LIBS="$LIBS"
3556 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
3557 cat > conftest.$ac_ext <<EOF
3558 #line 3559 "configure"
3559 #include "confdefs.h"
3560 /* Override any gcc2 internal prototype to avoid an error.  */
3561 /* We use char because int might match the return type of a gcc2
3562     builtin and then its argument prototype would still apply.  */
3563 char pthread_join();
3564
3565 int main() {
3566 pthread_join()
3567 ; return 0; }
3568 EOF
3569 if { (eval echo configure:3570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3570   rm -rf conftest*
3571   eval "ac_cv_lib_$ac_lib_var=yes"
3572 else
3573   echo "configure: failed program was:" >&5
3574   cat conftest.$ac_ext >&5
3575   rm -rf conftest*
3576   eval "ac_cv_lib_$ac_lib_var=no"
3577 fi
3578 rm -f conftest*
3579 LIBS="$ac_save_LIBS"
3580
3581 fi
3582 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3583   echo "$ac_t""yes" 1>&6
3584   
3585                                 ol_link_threads=posix
3586                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc -lc_r"
3587                                 if test $ol_with_yielding_select = auto ; then
3588                                         ol_with_yielding_select=yes
3589                                 fi
3590                                 
3591 else
3592   echo "$ac_t""no" 1>&6
3593 fi
3594
3595                         LIBS="$save_LIBS"
3596                 fi
3597
3598                 if test $ol_link_threads = no ; then
3599                                                 save_LIBS="$LIBS"
3600                         echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
3601 echo "configure:3602: checking for pthread_create in -lpthread" >&5
3602 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
3603 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3604   echo $ac_n "(cached) $ac_c" 1>&6
3605 else
3606   ac_save_LIBS="$LIBS"
3607 LIBS="-lpthread  $LIBS"
3608 cat > conftest.$ac_ext <<EOF
3609 #line 3610 "configure"
3610 #include "confdefs.h"
3611 /* Override any gcc2 internal prototype to avoid an error.  */
3612 /* We use char because int might match the return type of a gcc2
3613     builtin and then its argument prototype would still apply.  */
3614 char pthread_create();
3615
3616 int main() {
3617 pthread_create()
3618 ; return 0; }
3619 EOF
3620 if { (eval echo configure:3621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3621   rm -rf conftest*
3622   eval "ac_cv_lib_$ac_lib_var=yes"
3623 else
3624   echo "configure: failed program was:" >&5
3625   cat conftest.$ac_ext >&5
3626   rm -rf conftest*
3627   eval "ac_cv_lib_$ac_lib_var=no"
3628 fi
3629 rm -f conftest*
3630 LIBS="$ac_save_LIBS"
3631
3632 fi
3633 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3634   echo "$ac_t""yes" 1>&6
3635   
3636                                 ol_link_threads=posix
3637                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
3638 else
3639   echo "$ac_t""no" 1>&6
3640 fi
3641
3642                         LIBS="$save_LIBS"
3643                 fi
3644
3645                 if test $ol_link_threads = no ; then
3646                                                 save_LIBS="$LIBS"
3647                         echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
3648 echo "configure:3649: checking for pthread_create in -lc_r" >&5
3649 ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
3650 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3651   echo $ac_n "(cached) $ac_c" 1>&6
3652 else
3653   ac_save_LIBS="$LIBS"
3654 LIBS="-lc_r  $LIBS"
3655 cat > conftest.$ac_ext <<EOF
3656 #line 3657 "configure"
3657 #include "confdefs.h"
3658 /* Override any gcc2 internal prototype to avoid an error.  */
3659 /* We use char because int might match the return type of a gcc2
3660     builtin and then its argument prototype would still apply.  */
3661 char pthread_create();
3662
3663 int main() {
3664 pthread_create()
3665 ; return 0; }
3666 EOF
3667 if { (eval echo configure:3668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3668   rm -rf conftest*
3669   eval "ac_cv_lib_$ac_lib_var=yes"
3670 else
3671   echo "configure: failed program was:" >&5
3672   cat conftest.$ac_ext >&5
3673   rm -rf conftest*
3674   eval "ac_cv_lib_$ac_lib_var=no"
3675 fi
3676 rm -f conftest*
3677 LIBS="$ac_save_LIBS"
3678
3679 fi
3680 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3681   echo "$ac_t""yes" 1>&6
3682   
3683                                 ol_link_threads=posix
3684                                 LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"
3685 else
3686   echo "$ac_t""no" 1>&6
3687 fi
3688
3689                         LIBS="$save_LIBS"
3690                 fi
3691
3692                 if test $ol_link_threads != no ; then
3693                         cat >> confdefs.h <<\EOF
3694 #define HAVE_PTHREADS 1
3695 EOF
3696
3697
3698                                                 save_CPPFLAGS="$CPPFLAGS"
3699                         save_LIBS="$LIBS"
3700                         LIBS="$LTHREAD_LIBS $LIBS"
3701
3702                                                                                                 for ac_func in sched_yield pthread_yield
3703 do
3704 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3705 echo "configure:3706: checking for $ac_func" >&5
3706 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3707   echo $ac_n "(cached) $ac_c" 1>&6
3708 else
3709   cat > conftest.$ac_ext <<EOF
3710 #line 3711 "configure"
3711 #include "confdefs.h"
3712 /* System header to define __stub macros and hopefully few prototypes,
3713     which can conflict with char $ac_func(); below.  */
3714 #include <assert.h>
3715 /* Override any gcc2 internal prototype to avoid an error.  */
3716 /* We use char because int might match the return type of a gcc2
3717     builtin and then its argument prototype would still apply.  */
3718 char $ac_func();
3719
3720 int main() {
3721
3722 /* The GNU C library defines this for functions which it implements
3723     to always fail with ENOSYS.  Some functions are actually named
3724     something starting with __ and the normal name is an alias.  */
3725 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3726 choke me
3727 #else
3728 $ac_func();
3729 #endif
3730
3731 ; return 0; }
3732 EOF
3733 if { (eval echo configure:3734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3734   rm -rf conftest*
3735   eval "ac_cv_func_$ac_func=yes"
3736 else
3737   echo "configure: failed program was:" >&5
3738   cat conftest.$ac_ext >&5
3739   rm -rf conftest*
3740   eval "ac_cv_func_$ac_func=no"
3741 fi
3742 rm -f conftest*
3743 fi
3744
3745 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3746   echo "$ac_t""yes" 1>&6
3747     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3748   cat >> confdefs.h <<EOF
3749 #define $ac_tr_func 1
3750 EOF
3751  
3752 else
3753   echo "$ac_t""no" 1>&6
3754 fi
3755 done
3756
3757
3758                         if test $ac_cv_func_sched_yield = no -a \
3759                                 $ac_cv_func_pthread_yield = no ; then
3760                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
3761 echo "configure:3762: checking for sched_yield in -lrt" >&5
3762 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
3763 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3764   echo $ac_n "(cached) $ac_c" 1>&6
3765 else
3766   ac_save_LIBS="$LIBS"
3767 LIBS="-lrt  $LIBS"
3768 cat > conftest.$ac_ext <<EOF
3769 #line 3770 "configure"
3770 #include "confdefs.h"
3771 /* Override any gcc2 internal prototype to avoid an error.  */
3772 /* We use char because int might match the return type of a gcc2
3773     builtin and then its argument prototype would still apply.  */
3774 char sched_yield();
3775
3776 int main() {
3777 sched_yield()
3778 ; return 0; }
3779 EOF
3780 if { (eval echo configure:3781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3781   rm -rf conftest*
3782   eval "ac_cv_lib_$ac_lib_var=yes"
3783 else
3784   echo "configure: failed program was:" >&5
3785   cat conftest.$ac_ext >&5
3786   rm -rf conftest*
3787   eval "ac_cv_lib_$ac_lib_var=no"
3788 fi
3789 rm -f conftest*
3790 LIBS="$ac_save_LIBS"
3791
3792 fi
3793 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3794   echo "$ac_t""yes" 1>&6
3795   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
3796                                         cat >> confdefs.h <<\EOF
3797 #define HAVE_SCHED_YIELD 1
3798 EOF
3799
3800                                         ac_cv_func_sched_yield=yes
3801 else
3802   echo "$ac_t""no" 1>&6
3803 ac_cv_func_sched_yield=no
3804 fi
3805
3806                         fi
3807                         if test $ac_cv_func_sched_yield = no -a \
3808                                 $ac_cv_func_pthread_yield = no ; then
3809                                                                 echo $ac_n "checking for sched_yield in -lposix4""... $ac_c" 1>&6
3810 echo "configure:3811: checking for sched_yield in -lposix4" >&5
3811 ac_lib_var=`echo posix4'_'sched_yield | sed 'y%./+-%__p_%'`
3812 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3813   echo $ac_n "(cached) $ac_c" 1>&6
3814 else
3815   ac_save_LIBS="$LIBS"
3816 LIBS="-lposix4  $LIBS"
3817 cat > conftest.$ac_ext <<EOF
3818 #line 3819 "configure"
3819 #include "confdefs.h"
3820 /* Override any gcc2 internal prototype to avoid an error.  */
3821 /* We use char because int might match the return type of a gcc2
3822     builtin and then its argument prototype would still apply.  */
3823 char sched_yield();
3824
3825 int main() {
3826 sched_yield()
3827 ; return 0; }
3828 EOF
3829 if { (eval echo configure:3830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3830   rm -rf conftest*
3831   eval "ac_cv_lib_$ac_lib_var=yes"
3832 else
3833   echo "configure: failed program was:" >&5
3834   cat conftest.$ac_ext >&5
3835   rm -rf conftest*
3836   eval "ac_cv_lib_$ac_lib_var=no"
3837 fi
3838 rm -f conftest*
3839 LIBS="$ac_save_LIBS"
3840
3841 fi
3842 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3843   echo "$ac_t""yes" 1>&6
3844   LTHREAD_LIBS="$LTHREAD_LIBS -lposix4"
3845                                         cat >> confdefs.h <<\EOF
3846 #define HAVE_SCHED_YIELD 1
3847 EOF
3848
3849                                         ac_cv_func_sched_yield=yes
3850 else
3851   echo "$ac_t""no" 1>&6
3852 ac_cv_func_sched_yield=no
3853 fi
3854
3855                         fi
3856                         if test $ac_cv_func_sched_yield = no -a \
3857                                 $ac_cv_func_pthread_yield = no ; then
3858                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
3859                                 { echo "configure: error: POSIX Threads are not usable" 1>&2; exit 1; }
3860                         fi
3861
3862                                                 for ac_func in pthread_kill
3863 do
3864 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3865 echo "configure:3866: checking for $ac_func" >&5
3866 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3867   echo $ac_n "(cached) $ac_c" 1>&6
3868 else
3869   cat > conftest.$ac_ext <<EOF
3870 #line 3871 "configure"
3871 #include "confdefs.h"
3872 /* System header to define __stub macros and hopefully few prototypes,
3873     which can conflict with char $ac_func(); below.  */
3874 #include <assert.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 $ac_func();
3879
3880 int main() {
3881
3882 /* The GNU C library defines this for functions which it implements
3883     to always fail with ENOSYS.  Some functions are actually named
3884     something starting with __ and the normal name is an alias.  */
3885 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3886 choke me
3887 #else
3888 $ac_func();
3889 #endif
3890
3891 ; return 0; }
3892 EOF
3893 if { (eval echo configure:3894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3894   rm -rf conftest*
3895   eval "ac_cv_func_$ac_func=yes"
3896 else
3897   echo "configure: failed program was:" >&5
3898   cat conftest.$ac_ext >&5
3899   rm -rf conftest*
3900   eval "ac_cv_func_$ac_func=no"
3901 fi
3902 rm -f conftest*
3903 fi
3904
3905 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3906   echo "$ac_t""yes" 1>&6
3907     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3908   cat >> confdefs.h <<EOF
3909 #define $ac_tr_func 1
3910 EOF
3911  
3912 else
3913   echo "$ac_t""no" 1>&6
3914 fi
3915 done
3916
3917                         for ac_func in \
3918                                 pthread_attr_create pthread_attr_init \
3919                                 pthread_attr_destroy pthread_attr_delete \
3920                                 pthread_attr_setdetachstate pthread_attr_setdetach_np \
3921                         
3922 do
3923 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3924 echo "configure:3925: checking for $ac_func" >&5
3925 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3926   echo $ac_n "(cached) $ac_c" 1>&6
3927 else
3928   cat > conftest.$ac_ext <<EOF
3929 #line 3930 "configure"
3930 #include "confdefs.h"
3931 /* System header to define __stub macros and hopefully few prototypes,
3932     which can conflict with char $ac_func(); below.  */
3933 #include <assert.h>
3934 /* Override any gcc2 internal prototype to avoid an error.  */
3935 /* We use char because int might match the return type of a gcc2
3936     builtin and then its argument prototype would still apply.  */
3937 char $ac_func();
3938
3939 int main() {
3940
3941 /* The GNU C library defines this for functions which it implements
3942     to always fail with ENOSYS.  Some functions are actually named
3943     something starting with __ and the normal name is an alias.  */
3944 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3945 choke me
3946 #else
3947 $ac_func();
3948 #endif
3949
3950 ; return 0; }
3951 EOF
3952 if { (eval echo configure:3953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3953   rm -rf conftest*
3954   eval "ac_cv_func_$ac_func=yes"
3955 else
3956   echo "configure: failed program was:" >&5
3957   cat conftest.$ac_ext >&5
3958   rm -rf conftest*
3959   eval "ac_cv_func_$ac_func=no"
3960 fi
3961 rm -f conftest*
3962 fi
3963
3964 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3965   echo "$ac_t""yes" 1>&6
3966     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3967   cat >> confdefs.h <<EOF
3968 #define $ac_tr_func 1
3969 EOF
3970  
3971 else
3972   echo "$ac_t""no" 1>&6
3973 fi
3974 done
3975
3976
3977                                                 for ac_func in \
3978                                 pthread_setconcurrency \
3979                                 thr_setconcurrency \
3980                         
3981 do
3982 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3983 echo "configure:3984: checking for $ac_func" >&5
3984 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3985   echo $ac_n "(cached) $ac_c" 1>&6
3986 else
3987   cat > conftest.$ac_ext <<EOF
3988 #line 3989 "configure"
3989 #include "confdefs.h"
3990 /* System header to define __stub macros and hopefully few prototypes,
3991     which can conflict with char $ac_func(); below.  */
3992 #include <assert.h>
3993 /* Override any gcc2 internal prototype to avoid an error.  */
3994 /* We use char because int might match the return type of a gcc2
3995     builtin and then its argument prototype would still apply.  */
3996 char $ac_func();
3997
3998 int main() {
3999
4000 /* The GNU C library defines this for functions which it implements
4001     to always fail with ENOSYS.  Some functions are actually named
4002     something starting with __ and the normal name is an alias.  */
4003 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4004 choke me
4005 #else
4006 $ac_func();
4007 #endif
4008
4009 ; return 0; }
4010 EOF
4011 if { (eval echo configure:4012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4012   rm -rf conftest*
4013   eval "ac_cv_func_$ac_func=yes"
4014 else
4015   echo "configure: failed program was:" >&5
4016   cat conftest.$ac_ext >&5
4017   rm -rf conftest*
4018   eval "ac_cv_func_$ac_func=no"
4019 fi
4020 rm -f conftest*
4021 fi
4022
4023 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4024   echo "$ac_t""yes" 1>&6
4025     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4026   cat >> confdefs.h <<EOF
4027 #define $ac_tr_func 1
4028 EOF
4029  
4030 else
4031   echo "$ac_t""no" 1>&6
4032 fi
4033 done
4034
4035
4036                                                 if test $ol_with_yielding_select = auto ; then
4037                                 echo $ac_n "checking if select yields""... $ac_c" 1>&6
4038 echo "configure:4039: checking if select yields" >&5
4039                                 if test "$cross_compiling" = yes; then
4040   
4041                                 { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
4042 else
4043   cat > conftest.$ac_ext <<EOF
4044 #line 4045 "configure"
4045 #include "confdefs.h"
4046
4047 #include <sys/types.h>
4048 #include <sys/time.h>
4049 #include <unistd.h>
4050 #include <pthread.h>
4051 #ifndef NULL
4052 #define NULL 0
4053 #endif
4054
4055 int task(arg)
4056         int *arg;
4057 {
4058         int i;
4059         struct timeval tv;
4060
4061         tv.tv_sec=5;
4062         tv.tv_usec=0;
4063
4064         /* we're not interested in any fds */
4065         i = select(FD_SETSIZE, NULL, NULL, NULL, &tv);
4066
4067         if(i < 0) {
4068                 perror("select");
4069         }
4070
4071         exit(1); /* if we exit here, the select blocked the whole process */
4072 }
4073
4074 main(argc, argv)
4075 int argc; char **argv;
4076 {
4077         pthread_t t;
4078
4079 #ifdef HAVE_PTHREAD_SETCONCURRENCY
4080         (void) pthread_setconcurrency(2);
4081 #else
4082 #ifdef HAVE_THR_SETCONCURRENCY
4083         /* Set Solaris LWP concurrency to 2 */
4084         thr_setconcurrency(2);
4085 #endif
4086 #endif
4087
4088         pthread_create(&t, NULL, (void *) task, NULL);
4089
4090 #if HAVE_SCHED_YIELD
4091         sched_yield();  /* make sure task runs first */
4092 #else
4093 #ifdef HAVE_PTHREAD_YIELD
4094         pthread_yield();        /* make sure task runs first */
4095 #endif
4096 #endif
4097         exit(0);
4098 }
4099                                 
4100 EOF
4101 if { (eval echo configure:4102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
4102 then
4103   ol_pthread_select_yields=yes
4104 else
4105   echo "configure: failed program was:" >&5
4106   cat conftest.$ac_ext >&5
4107   rm -fr conftest*
4108   ol_pthread_select_yields=no
4109 fi
4110 rm -fr conftest*
4111 fi
4112
4113                                 echo "$ac_t""$ol_pthread_select_yields" 1>&6
4114
4115                                 if test $ol_pthread_select_yields = yes ; then
4116                                         ol_with_yielding_select=yes
4117                                 fi
4118                         fi
4119
4120
4121                                                 CPPFLAGS="$save_CPPFLAGS"
4122                         LIBS="$save_LIBS"
4123                 else
4124                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
4125                 fi
4126         fi
4127
4128         if test $ol_with_threads = posix ; then
4129                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
4130         fi
4131 fi
4132
4133 if test $ol_with_threads = auto -o $ol_with_threads = mach ; then
4134                 for ac_hdr in mach/cthreads.h
4135 do
4136 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4137 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4138 echo "configure:4139: checking for $ac_hdr" >&5
4139 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4140   echo $ac_n "(cached) $ac_c" 1>&6
4141 else
4142   cat > conftest.$ac_ext <<EOF
4143 #line 4144 "configure"
4144 #include "confdefs.h"
4145 #include <$ac_hdr>
4146 EOF
4147 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4148 { (eval echo configure:4149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4149 ac_err=`grep -v '^ *+' conftest.out`
4150 if test -z "$ac_err"; then
4151   rm -rf conftest*
4152   eval "ac_cv_header_$ac_safe=yes"
4153 else
4154   echo "$ac_err" >&5
4155   echo "configure: failed program was:" >&5
4156   cat conftest.$ac_ext >&5
4157   rm -rf conftest*
4158   eval "ac_cv_header_$ac_safe=no"
4159 fi
4160 rm -f conftest*
4161 fi
4162 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4163   echo "$ac_t""yes" 1>&6
4164     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4165   cat >> confdefs.h <<EOF
4166 #define $ac_tr_hdr 1
4167 EOF
4168  
4169 else
4170   echo "$ac_t""no" 1>&6
4171 fi
4172 done
4173
4174         if test $ac_cv_header_mach_cthreads_h = yes ; then
4175                 ol_with_threads=found
4176
4177                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
4178 echo "configure:4179: checking for cthread_fork" >&5
4179 if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
4180   echo $ac_n "(cached) $ac_c" 1>&6
4181 else
4182   cat > conftest.$ac_ext <<EOF
4183 #line 4184 "configure"
4184 #include "confdefs.h"
4185 /* System header to define __stub macros and hopefully few prototypes,
4186     which can conflict with char cthread_fork(); below.  */
4187 #include <assert.h>
4188 /* Override any gcc2 internal prototype to avoid an error.  */
4189 /* We use char because int might match the return type of a gcc2
4190     builtin and then its argument prototype would still apply.  */
4191 char cthread_fork();
4192
4193 int main() {
4194
4195 /* The GNU C library defines this for functions which it implements
4196     to always fail with ENOSYS.  Some functions are actually named
4197     something starting with __ and the normal name is an alias.  */
4198 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
4199 choke me
4200 #else
4201 cthread_fork();
4202 #endif
4203
4204 ; return 0; }
4205 EOF
4206 if { (eval echo configure:4207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4207   rm -rf conftest*
4208   eval "ac_cv_func_cthread_fork=yes"
4209 else
4210   echo "configure: failed program was:" >&5
4211   cat conftest.$ac_ext >&5
4212   rm -rf conftest*
4213   eval "ac_cv_func_cthread_fork=no"
4214 fi
4215 rm -f conftest*
4216 fi
4217
4218 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
4219   echo "$ac_t""yes" 1>&6
4220   ol_link_threads=yes
4221 else
4222   echo "$ac_t""no" 1>&6
4223 fi
4224
4225
4226                 if test $ol_link_threads = no ; then
4227                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
4228 echo "configure:4229: checking for cthread_fork with -all_load" >&5
4229 if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
4230   echo $ac_n "(cached) $ac_c" 1>&6
4231 else
4232   
4233                                                                 save_LIBS="$LIBS"
4234                                 LIBS="-all_load $LIBS"
4235                                 cat > conftest.$ac_ext <<EOF
4236 #line 4237 "configure"
4237 #include "confdefs.h"
4238 #include <mach/cthreads.h>
4239 int main() {
4240
4241                                         cthread_fork((void *)0, (void *)0);
4242                                         
4243 ; return 0; }
4244 EOF
4245 if { (eval echo configure:4246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4246   rm -rf conftest*
4247   ol_cv_cthread_all_load=yes
4248 else
4249   echo "configure: failed program was:" >&5
4250   cat conftest.$ac_ext >&5
4251   rm -rf conftest*
4252   ol_cv_cthread_all_load=no
4253 fi
4254 rm -f conftest*
4255                                                                 LIBS="$save_LIBS"
4256                         
4257 fi
4258
4259 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
4260
4261                         if test $ol_cv_cthread_all_load = yes ; then
4262                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
4263                                 ol_link_threads=mach
4264                         fi
4265                 fi
4266
4267                 if test $ol_link_threads != no ; then
4268                         : check for cthread specific functionality here
4269                         cat >> confdefs.h <<\EOF
4270 #define HAVE_MACH_CTHREADS 1
4271 EOF
4272
4273                 else
4274                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
4275                 fi
4276         fi
4277
4278         if test $ol_with_threads = mach ; then
4279                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
4280         fi
4281 fi
4282
4283 if test $ol_with_threads = auto -o $ol_with_threads = lwp ; then
4284                 for ac_hdr in thread.h synch.h
4285 do
4286 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4287 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4288 echo "configure:4289: checking for $ac_hdr" >&5
4289 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4290   echo $ac_n "(cached) $ac_c" 1>&6
4291 else
4292   cat > conftest.$ac_ext <<EOF
4293 #line 4294 "configure"
4294 #include "confdefs.h"
4295 #include <$ac_hdr>
4296 EOF
4297 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4298 { (eval echo configure:4299: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4299 ac_err=`grep -v '^ *+' conftest.out`
4300 if test -z "$ac_err"; then
4301   rm -rf conftest*
4302   eval "ac_cv_header_$ac_safe=yes"
4303 else
4304   echo "$ac_err" >&5
4305   echo "configure: failed program was:" >&5
4306   cat conftest.$ac_ext >&5
4307   rm -rf conftest*
4308   eval "ac_cv_header_$ac_safe=no"
4309 fi
4310 rm -f conftest*
4311 fi
4312 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4313   echo "$ac_t""yes" 1>&6
4314     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4315   cat >> confdefs.h <<EOF
4316 #define $ac_tr_hdr 1
4317 EOF
4318  
4319 else
4320   echo "$ac_t""no" 1>&6
4321 fi
4322 done
4323
4324         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
4325                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
4326 echo "configure:4327: checking for thr_create in -lthread" >&5
4327 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
4328 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4329   echo $ac_n "(cached) $ac_c" 1>&6
4330 else
4331   ac_save_LIBS="$LIBS"
4332 LIBS="-lthread  $LIBS"
4333 cat > conftest.$ac_ext <<EOF
4334 #line 4335 "configure"
4335 #include "confdefs.h"
4336 /* Override any gcc2 internal prototype to avoid an error.  */
4337 /* We use char because int might match the return type of a gcc2
4338     builtin and then its argument prototype would still apply.  */
4339 char thr_create();
4340
4341 int main() {
4342 thr_create()
4343 ; return 0; }
4344 EOF
4345 if { (eval echo configure:4346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4346   rm -rf conftest*
4347   eval "ac_cv_lib_$ac_lib_var=yes"
4348 else
4349   echo "configure: failed program was:" >&5
4350   cat conftest.$ac_ext >&5
4351   rm -rf conftest*
4352   eval "ac_cv_lib_$ac_lib_var=no"
4353 fi
4354 rm -f conftest*
4355 LIBS="$ac_save_LIBS"
4356
4357 fi
4358 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4359   echo "$ac_t""yes" 1>&6
4360   have_thr=yes
4361 else
4362   echo "$ac_t""no" 1>&6
4363 have_thr=no
4364 fi
4365
4366
4367                 if test $have_thr = yes ; then
4368                         cat >> confdefs.h <<\EOF
4369 #define HAVE_THR 1
4370 EOF
4371
4372                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
4373                         ol_link_threads=thr
4374
4375                         if test $ol_with_yielding_select = auto ; then
4376                                 ol_with_yielding_select=yes
4377                         fi
4378                 fi
4379         fi
4380
4381                 for ac_hdr in lwp/lwp.h
4382 do
4383 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4384 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4385 echo "configure:4386: checking for $ac_hdr" >&5
4386 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4387   echo $ac_n "(cached) $ac_c" 1>&6
4388 else
4389   cat > conftest.$ac_ext <<EOF
4390 #line 4391 "configure"
4391 #include "confdefs.h"
4392 #include <$ac_hdr>
4393 EOF
4394 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4395 { (eval echo configure:4396: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4396 ac_err=`grep -v '^ *+' conftest.out`
4397 if test -z "$ac_err"; then
4398   rm -rf conftest*
4399   eval "ac_cv_header_$ac_safe=yes"
4400 else
4401   echo "$ac_err" >&5
4402   echo "configure: failed program was:" >&5
4403   cat conftest.$ac_ext >&5
4404   rm -rf conftest*
4405   eval "ac_cv_header_$ac_safe=no"
4406 fi
4407 rm -f conftest*
4408 fi
4409 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4410   echo "$ac_t""yes" 1>&6
4411     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4412   cat >> confdefs.h <<EOF
4413 #define $ac_tr_hdr 1
4414 EOF
4415  
4416 else
4417   echo "$ac_t""no" 1>&6
4418 fi
4419 done
4420
4421         if test $ac_cv_header_lwp_lwp_h = yes ; then
4422                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
4423 echo "configure:4424: checking for lwp_create in -llwp" >&5
4424 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
4425 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4426   echo $ac_n "(cached) $ac_c" 1>&6
4427 else
4428   ac_save_LIBS="$LIBS"
4429 LIBS="-llwp  $LIBS"
4430 cat > conftest.$ac_ext <<EOF
4431 #line 4432 "configure"
4432 #include "confdefs.h"
4433 /* Override any gcc2 internal prototype to avoid an error.  */
4434 /* We use char because int might match the return type of a gcc2
4435     builtin and then its argument prototype would still apply.  */
4436 char lwp_create();
4437
4438 int main() {
4439 lwp_create()
4440 ; return 0; }
4441 EOF
4442 if { (eval echo configure:4443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4443   rm -rf conftest*
4444   eval "ac_cv_lib_$ac_lib_var=yes"
4445 else
4446   echo "configure: failed program was:" >&5
4447   cat conftest.$ac_ext >&5
4448   rm -rf conftest*
4449   eval "ac_cv_lib_$ac_lib_var=no"
4450 fi
4451 rm -f conftest*
4452 LIBS="$ac_save_LIBS"
4453
4454 fi
4455 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4456   echo "$ac_t""yes" 1>&6
4457   have_lwp=yes
4458 else
4459   echo "$ac_t""no" 1>&6
4460 have_lwp=no
4461 fi
4462
4463
4464                 if test $have_lwp = yes ; then
4465                         cat >> confdefs.h <<\EOF
4466 #define HAVE_LWP 1
4467 EOF
4468
4469                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
4470                         ol_link_threads=lwp
4471
4472                         if test $ol_with_yielding_select = auto ; then
4473                                 ol_with_yielding_select=no
4474                         fi
4475                 fi
4476         fi
4477 fi
4478
4479 if test $ol_with_yielding_select = yes ; then
4480         cat >> confdefs.h <<\EOF
4481 #define HAVE_YIELDING_SELECT 1
4482 EOF
4483
4484 fi
4485
4486 if test $ol_with_threads = manual ; then
4487                 ol_link_threads=yes
4488
4489         echo "configure: warning: thread defines and link options must be set manually" 1>&2
4490
4491         for ac_hdr in pthread.h sched.h
4492 do
4493 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4494 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4495 echo "configure:4496: checking for $ac_hdr" >&5
4496 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4497   echo $ac_n "(cached) $ac_c" 1>&6
4498 else
4499   cat > conftest.$ac_ext <<EOF
4500 #line 4501 "configure"
4501 #include "confdefs.h"
4502 #include <$ac_hdr>
4503 EOF
4504 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4505 { (eval echo configure:4506: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4506 ac_err=`grep -v '^ *+' conftest.out`
4507 if test -z "$ac_err"; then
4508   rm -rf conftest*
4509   eval "ac_cv_header_$ac_safe=yes"
4510 else
4511   echo "$ac_err" >&5
4512   echo "configure: failed program was:" >&5
4513   cat conftest.$ac_ext >&5
4514   rm -rf conftest*
4515   eval "ac_cv_header_$ac_safe=no"
4516 fi
4517 rm -f conftest*
4518 fi
4519 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4520   echo "$ac_t""yes" 1>&6
4521     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4522   cat >> confdefs.h <<EOF
4523 #define $ac_tr_hdr 1
4524 EOF
4525  
4526 else
4527   echo "$ac_t""no" 1>&6
4528 fi
4529 done
4530
4531         for ac_func in sched_yield pthread_yield
4532 do
4533 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4534 echo "configure:4535: checking for $ac_func" >&5
4535 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4536   echo $ac_n "(cached) $ac_c" 1>&6
4537 else
4538   cat > conftest.$ac_ext <<EOF
4539 #line 4540 "configure"
4540 #include "confdefs.h"
4541 /* System header to define __stub macros and hopefully few prototypes,
4542     which can conflict with char $ac_func(); below.  */
4543 #include <assert.h>
4544 /* Override any gcc2 internal prototype to avoid an error.  */
4545 /* We use char because int might match the return type of a gcc2
4546     builtin and then its argument prototype would still apply.  */
4547 char $ac_func();
4548
4549 int main() {
4550
4551 /* The GNU C library defines this for functions which it implements
4552     to always fail with ENOSYS.  Some functions are actually named
4553     something starting with __ and the normal name is an alias.  */
4554 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4555 choke me
4556 #else
4557 $ac_func();
4558 #endif
4559
4560 ; return 0; }
4561 EOF
4562 if { (eval echo configure:4563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4563   rm -rf conftest*
4564   eval "ac_cv_func_$ac_func=yes"
4565 else
4566   echo "configure: failed program was:" >&5
4567   cat conftest.$ac_ext >&5
4568   rm -rf conftest*
4569   eval "ac_cv_func_$ac_func=no"
4570 fi
4571 rm -f conftest*
4572 fi
4573
4574 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4575   echo "$ac_t""yes" 1>&6
4576     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4577   cat >> confdefs.h <<EOF
4578 #define $ac_tr_func 1
4579 EOF
4580  
4581 else
4582   echo "$ac_t""no" 1>&6
4583 fi
4584 done
4585
4586         
4587 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
4588 echo "configure:4589: checking for LinuxThreads" >&5
4589 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
4590   echo $ac_n "(cached) $ac_c" 1>&6
4591 else
4592   
4593         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
4594         if test "$res" -gt 0 ; then
4595                 ol_cv_linux_threads=yes
4596         else
4597                 ol_cv_linux_threads=no
4598         fi
4599
4600 fi
4601
4602 echo "$ac_t""$ol_cv_linux_threads" 1>&6
4603
4604
4605         for ac_hdr in mach/cthreads.h
4606 do
4607 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4608 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4609 echo "configure:4610: checking for $ac_hdr" >&5
4610 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4611   echo $ac_n "(cached) $ac_c" 1>&6
4612 else
4613   cat > conftest.$ac_ext <<EOF
4614 #line 4615 "configure"
4615 #include "confdefs.h"
4616 #include <$ac_hdr>
4617 EOF
4618 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4619 { (eval echo configure:4620: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4620 ac_err=`grep -v '^ *+' conftest.out`
4621 if test -z "$ac_err"; then
4622   rm -rf conftest*
4623   eval "ac_cv_header_$ac_safe=yes"
4624 else
4625   echo "$ac_err" >&5
4626   echo "configure: failed program was:" >&5
4627   cat conftest.$ac_ext >&5
4628   rm -rf conftest*
4629   eval "ac_cv_header_$ac_safe=no"
4630 fi
4631 rm -f conftest*
4632 fi
4633 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4634   echo "$ac_t""yes" 1>&6
4635     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4636   cat >> confdefs.h <<EOF
4637 #define $ac_tr_hdr 1
4638 EOF
4639  
4640 else
4641   echo "$ac_t""no" 1>&6
4642 fi
4643 done
4644
4645         for ac_hdr in lwp/lwp.h
4646 do
4647 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4648 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4649 echo "configure:4650: checking for $ac_hdr" >&5
4650 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4651   echo $ac_n "(cached) $ac_c" 1>&6
4652 else
4653   cat > conftest.$ac_ext <<EOF
4654 #line 4655 "configure"
4655 #include "confdefs.h"
4656 #include <$ac_hdr>
4657 EOF
4658 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4659 { (eval echo configure:4660: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4660 ac_err=`grep -v '^ *+' conftest.out`
4661 if test -z "$ac_err"; then
4662   rm -rf conftest*
4663   eval "ac_cv_header_$ac_safe=yes"
4664 else
4665   echo "$ac_err" >&5
4666   echo "configure: failed program was:" >&5
4667   cat conftest.$ac_ext >&5
4668   rm -rf conftest*
4669   eval "ac_cv_header_$ac_safe=no"
4670 fi
4671 rm -f conftest*
4672 fi
4673 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4674   echo "$ac_t""yes" 1>&6
4675     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4676   cat >> confdefs.h <<EOF
4677 #define $ac_tr_hdr 1
4678 EOF
4679  
4680 else
4681   echo "$ac_t""no" 1>&6
4682 fi
4683 done
4684
4685         for ac_hdr in thread.h synch.h
4686 do
4687 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4688 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4689 echo "configure:4690: checking for $ac_hdr" >&5
4690 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4691   echo $ac_n "(cached) $ac_c" 1>&6
4692 else
4693   cat > conftest.$ac_ext <<EOF
4694 #line 4695 "configure"
4695 #include "confdefs.h"
4696 #include <$ac_hdr>
4697 EOF
4698 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4699 { (eval echo configure:4700: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4700 ac_err=`grep -v '^ *+' conftest.out`
4701 if test -z "$ac_err"; then
4702   rm -rf conftest*
4703   eval "ac_cv_header_$ac_safe=yes"
4704 else
4705   echo "$ac_err" >&5
4706   echo "configure: failed program was:" >&5
4707   cat conftest.$ac_ext >&5
4708   rm -rf conftest*
4709   eval "ac_cv_header_$ac_safe=no"
4710 fi
4711 rm -f conftest*
4712 fi
4713 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4714   echo "$ac_t""yes" 1>&6
4715     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4716   cat >> confdefs.h <<EOF
4717 #define $ac_tr_hdr 1
4718 EOF
4719  
4720 else
4721   echo "$ac_t""no" 1>&6
4722 fi
4723 done
4724
4725 fi
4726
4727 if test $ol_with_threads != no ; then  
4728                         cat >> confdefs.h <<\EOF
4729 #define _REENTRANT 1
4730 EOF
4731
4732         cat >> confdefs.h <<\EOF
4733 #define _THREAD_SAFE 1
4734 EOF
4735
4736         cat >> confdefs.h <<\EOF
4737 #define _THREADSAFE 1
4738 EOF
4739
4740
4741                                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
4742 echo "configure:4743: checking for thread specific errno" >&5
4743 if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
4744   echo $ac_n "(cached) $ac_c" 1>&6
4745 else
4746   
4747                 cat > conftest.$ac_ext <<EOF
4748 #line 4749 "configure"
4749 #include "confdefs.h"
4750
4751 #include <errno.h>
4752                         
4753 int main() {
4754
4755 int x = errno;
4756                         
4757 ; return 0; }
4758 EOF
4759 if { (eval echo configure:4760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4760   rm -rf conftest*
4761   ol_cv_errno_thread_specific=yes
4762 else
4763   echo "configure: failed program was:" >&5
4764   cat conftest.$ac_ext >&5
4765   rm -rf conftest*
4766   ol_cv_errno_thread_specific=no
4767 fi
4768 rm -f conftest*
4769         
4770 fi
4771
4772 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
4773
4774         if test $ol_cv_errno_thread_specific != yes ; then
4775                 LIBS="$LTHREAD_LIBS $LIBS"
4776                 LTHREAD_LIBS=""
4777         fi
4778 fi  
4779
4780
4781 if test $ol_link_threads = no ; then
4782         if test $ol_with_threads = yes ; then
4783                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
4784         fi
4785
4786         if test $ol_with_threads = auto ; then
4787                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
4788                 ol_with_threads=no
4789         fi
4790
4791         cat >> confdefs.h <<\EOF
4792 #define NO_THREADS 1
4793 EOF
4794
4795         LTHREAD_LIBS=""
4796 fi
4797
4798 ol_link_ldbm=no 
4799 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
4800         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
4801 echo "configure:4802: checking for DB2 library" >&5
4802 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
4803   echo $ac_n "(cached) $ac_c" 1>&6
4804 else
4805         ol_LIBS="$LIBS"
4806         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
4807 echo "configure:4808: checking for db_open in -ldb" >&5
4808 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
4809 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4810   echo $ac_n "(cached) $ac_c" 1>&6
4811 else
4812   ac_save_LIBS="$LIBS"
4813 LIBS="-ldb  $LIBS"
4814 cat > conftest.$ac_ext <<EOF
4815 #line 4816 "configure"
4816 #include "confdefs.h"
4817 /* Override any gcc2 internal prototype to avoid an error.  */
4818 /* We use char because int might match the return type of a gcc2
4819     builtin and then its argument prototype would still apply.  */
4820 char db_open();
4821
4822 int main() {
4823 db_open()
4824 ; return 0; }
4825 EOF
4826 if { (eval echo configure:4827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4827   rm -rf conftest*
4828   eval "ac_cv_lib_$ac_lib_var=yes"
4829 else
4830   echo "configure: failed program was:" >&5
4831   cat conftest.$ac_ext >&5
4832   rm -rf conftest*
4833   eval "ac_cv_lib_$ac_lib_var=no"
4834 fi
4835 rm -f conftest*
4836 LIBS="$ac_save_LIBS"
4837
4838 fi
4839 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4840   echo "$ac_t""yes" 1>&6
4841   ol_cv_lib_db2=-ldb
4842 else
4843   echo "$ac_t""no" 1>&6
4844 ol_cv_lib_db2=no
4845 fi
4846
4847         LIBS="$ol_LIBS"
4848
4849 fi
4850
4851 echo "$ac_t""$ol_cv_lib_db2" 1>&6
4852
4853 for ac_hdr in db.h
4854 do
4855 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4856 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4857 echo "configure:4858: checking for $ac_hdr" >&5
4858 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4859   echo $ac_n "(cached) $ac_c" 1>&6
4860 else
4861   cat > conftest.$ac_ext <<EOF
4862 #line 4863 "configure"
4863 #include "confdefs.h"
4864 #include <$ac_hdr>
4865 EOF
4866 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4867 { (eval echo configure:4868: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4868 ac_err=`grep -v '^ *+' conftest.out`
4869 if test -z "$ac_err"; then
4870   rm -rf conftest*
4871   eval "ac_cv_header_$ac_safe=yes"
4872 else
4873   echo "$ac_err" >&5
4874   echo "configure: failed program was:" >&5
4875   cat conftest.$ac_ext >&5
4876   rm -rf conftest*
4877   eval "ac_cv_header_$ac_safe=no"
4878 fi
4879 rm -f conftest*
4880 fi
4881 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4882   echo "$ac_t""yes" 1>&6
4883     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4884   cat >> confdefs.h <<EOF
4885 #define $ac_tr_hdr 1
4886 EOF
4887  
4888 else
4889   echo "$ac_t""no" 1>&6
4890 fi
4891 done
4892
4893 if test $ac_cv_header_db_h = yes ; then
4894         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
4895 echo "configure:4896: checking if db.h is DB2" >&5
4896 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
4897   echo $ac_n "(cached) $ac_c" 1>&6
4898 else
4899   
4900                 cat > conftest.$ac_ext <<EOF
4901 #line 4902 "configure"
4902 #include "confdefs.h"
4903
4904 #                       include <db.h>
4905                         /* this check could be improved */
4906 #                       ifdef DB_VERSION_MAJOR
4907 #                               if DB_VERSION_MAJOR == 2
4908                                         __db_version_2
4909 #                               endif
4910 #                       endif
4911                 
4912 EOF
4913 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4914   egrep "__db_version_2" >/dev/null 2>&1; then
4915   rm -rf conftest*
4916   ol_cv_header_db2=yes
4917 else
4918   rm -rf conftest*
4919   ol_cv_header_db2=no
4920 fi
4921 rm -f conftest*
4922
4923 fi
4924
4925 echo "$ac_t""$ol_cv_header_db2" 1>&6
4926 else
4927         ol_cv_header_db2=no
4928 fi
4929
4930
4931  
4932  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
4933 echo "configure:4934: checking for Berkeley DB2" >&5
4934 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
4935   echo $ac_n "(cached) $ac_c" 1>&6
4936 else
4937   
4938         if test $ol_cv_lib_db2 = no -o $ol_cv_header_db2 = no ; then
4939                 ol_cv_berkeley_db2=no
4940         else
4941                 ol_cv_berkeley_db2=yes
4942         fi
4943
4944 fi
4945
4946 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
4947  if test $ol_cv_berkeley_db2 = yes ; then
4948         cat >> confdefs.h <<\EOF
4949 #define HAVE_BERKELEY_DB2 1
4950 EOF
4951
4952  fi
4953
4954
4955         if test $ol_cv_berkeley_db2 = yes ; then
4956                 ol_link_ldbm=db2
4957                 ol_with_ldbm_api=db2
4958
4959                 if test $ol_with_ldbm_type = hash ; then
4960                         cat >> confdefs.h <<\EOF
4961 #define LDBM_USE_DBHASH 1
4962 EOF
4963
4964                 else
4965                         cat >> confdefs.h <<\EOF
4966 #define LDBM_USE_DBBTREE 1
4967 EOF
4968
4969                 fi
4970
4971                                                 if test $ol_cv_lib_db2 != yes ; then
4972                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
4973                 fi
4974         fi
4975 fi
4976
4977 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
4978         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
4979 echo "configure:4980: checking for Berkeley DB library" >&5
4980 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
4981   echo $ac_n "(cached) $ac_c" 1>&6
4982 else
4983         ol_LIBS="$LIBS"
4984         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
4985 echo "configure:4986: checking for dbopen" >&5
4986 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
4987   echo $ac_n "(cached) $ac_c" 1>&6
4988 else
4989   cat > conftest.$ac_ext <<EOF
4990 #line 4991 "configure"
4991 #include "confdefs.h"
4992 /* System header to define __stub macros and hopefully few prototypes,
4993     which can conflict with char dbopen(); below.  */
4994 #include <assert.h>
4995 /* Override any gcc2 internal prototype to avoid an error.  */
4996 /* We use char because int might match the return type of a gcc2
4997     builtin and then its argument prototype would still apply.  */
4998 char dbopen();
4999
5000 int main() {
5001
5002 /* The GNU C library defines this for functions which it implements
5003     to always fail with ENOSYS.  Some functions are actually named
5004     something starting with __ and the normal name is an alias.  */
5005 #if defined (__stub_dbopen) || defined (__stub___dbopen)
5006 choke me
5007 #else
5008 dbopen();
5009 #endif
5010
5011 ; return 0; }
5012 EOF
5013 if { (eval echo configure:5014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5014   rm -rf conftest*
5015   eval "ac_cv_func_dbopen=yes"
5016 else
5017   echo "configure: failed program was:" >&5
5018   cat conftest.$ac_ext >&5
5019   rm -rf conftest*
5020   eval "ac_cv_func_dbopen=no"
5021 fi
5022 rm -f conftest*
5023 fi
5024
5025 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
5026   echo "$ac_t""yes" 1>&6
5027   ol_cv_lib_db=yes
5028 else
5029   echo "$ac_t""no" 1>&6
5030
5031                 echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
5032 echo "configure:5033: checking for dbopen in -ldb" >&5
5033 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
5034 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5035   echo $ac_n "(cached) $ac_c" 1>&6
5036 else
5037   ac_save_LIBS="$LIBS"
5038 LIBS="-ldb  $LIBS"
5039 cat > conftest.$ac_ext <<EOF
5040 #line 5041 "configure"
5041 #include "confdefs.h"
5042 /* Override any gcc2 internal prototype to avoid an error.  */
5043 /* We use char because int might match the return type of a gcc2
5044     builtin and then its argument prototype would still apply.  */
5045 char dbopen();
5046
5047 int main() {
5048 dbopen()
5049 ; return 0; }
5050 EOF
5051 if { (eval echo configure:5052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5052   rm -rf conftest*
5053   eval "ac_cv_lib_$ac_lib_var=yes"
5054 else
5055   echo "configure: failed program was:" >&5
5056   cat conftest.$ac_ext >&5
5057   rm -rf conftest*
5058   eval "ac_cv_lib_$ac_lib_var=no"
5059 fi
5060 rm -f conftest*
5061 LIBS="$ac_save_LIBS"
5062
5063 fi
5064 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5065   echo "$ac_t""yes" 1>&6
5066   ol_cv_lib_db=-ldb
5067 else
5068   echo "$ac_t""no" 1>&6
5069 ol_cv_lib_db=no
5070 fi
5071
5072         
5073 fi
5074
5075         LIBS="$ol_LIBS"
5076
5077 fi
5078
5079 echo "$ac_t""$ol_cv_lib_db" 1>&6
5080
5081
5082 for ac_hdr in db_185.h
5083 do
5084 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5085 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5086 echo "configure:5087: checking for $ac_hdr" >&5
5087 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5088   echo $ac_n "(cached) $ac_c" 1>&6
5089 else
5090   cat > conftest.$ac_ext <<EOF
5091 #line 5092 "configure"
5092 #include "confdefs.h"
5093 #include <$ac_hdr>
5094 EOF
5095 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5096 { (eval echo configure:5097: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5097 ac_err=`grep -v '^ *+' conftest.out`
5098 if test -z "$ac_err"; then
5099   rm -rf conftest*
5100   eval "ac_cv_header_$ac_safe=yes"
5101 else
5102   echo "$ac_err" >&5
5103   echo "configure: failed program was:" >&5
5104   cat conftest.$ac_ext >&5
5105   rm -rf conftest*
5106   eval "ac_cv_header_$ac_safe=no"
5107 fi
5108 rm -f conftest*
5109 fi
5110 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5111   echo "$ac_t""yes" 1>&6
5112     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5113   cat >> confdefs.h <<EOF
5114 #define $ac_tr_hdr 1
5115 EOF
5116  
5117 else
5118   echo "$ac_t""no" 1>&6
5119 fi
5120 done
5121
5122 if test $ol_cv_header_db2 = yes ; then
5123         
5124         ol_cv_header_db=$ac_cv_header_db_185_h
5125 else
5126         ol_cv_header_db=$ac_cv_header_db_h
5127 fi
5128
5129
5130  
5131  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
5132 echo "configure:5133: checking for Berkeley DB" >&5
5133 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
5134   echo $ac_n "(cached) $ac_c" 1>&6
5135 else
5136   
5137         if test $ol_cv_lib_db = no -o $ol_cv_header_db = no ; then
5138                 ol_cv_berkeley_db=no
5139         else
5140                 ol_cv_berkeley_db=yes
5141         fi
5142
5143 fi
5144
5145 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
5146  if test $ol_cv_berkeley_db = yes ; then
5147         cat >> confdefs.h <<\EOF
5148 #define HAVE_BERKELEY_DB 1
5149 EOF
5150
5151  fi
5152
5153
5154         if test $ol_cv_berkeley_db = yes ; then
5155                 ol_link_ldbm=db
5156                 ol_with_ldbm_api=db
5157
5158                 if test $ol_with_ldbm_type = hash ; then
5159                         cat >> confdefs.h <<\EOF
5160 #define LDBM_USE_DBHASH 1
5161 EOF
5162
5163                 else
5164                         cat >> confdefs.h <<\EOF
5165 #define LDBM_USE_DBBTREE 1
5166 EOF
5167
5168                 fi
5169
5170                                                 if test $ol_cv_lib_db != yes ; then
5171                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
5172                 fi
5173         fi
5174 fi
5175
5176 if test $ol_with_ldbm_api = manual ; then
5177                 ol_link_ldbm=yes
5178
5179         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
5180
5181         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
5182 do
5183 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5184 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5185 echo "configure:5186: checking for $ac_hdr" >&5
5186 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5187   echo $ac_n "(cached) $ac_c" 1>&6
5188 else
5189   cat > conftest.$ac_ext <<EOF
5190 #line 5191 "configure"
5191 #include "confdefs.h"
5192 #include <$ac_hdr>
5193 EOF
5194 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5195 { (eval echo configure:5196: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5196 ac_err=`grep -v '^ *+' conftest.out`
5197 if test -z "$ac_err"; then
5198   rm -rf conftest*
5199   eval "ac_cv_header_$ac_safe=yes"
5200 else
5201   echo "$ac_err" >&5
5202   echo "configure: failed program was:" >&5
5203   cat conftest.$ac_ext >&5
5204   rm -rf conftest*
5205   eval "ac_cv_header_$ac_safe=no"
5206 fi
5207 rm -f conftest*
5208 fi
5209 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5210   echo "$ac_t""yes" 1>&6
5211     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5212   cat >> confdefs.h <<EOF
5213 #define $ac_tr_hdr 1
5214 EOF
5215  
5216 else
5217   echo "$ac_t""no" 1>&6
5218 fi
5219 done
5220
5221 fi
5222
5223 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
5224         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
5225         ol_with_ldbm_api=none
5226 fi
5227
5228 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
5229         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
5230 echo "configure:5231: checking for GDBM library" >&5
5231 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
5232   echo $ac_n "(cached) $ac_c" 1>&6
5233 else
5234         ol_LIBS="$LIBS"
5235         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
5236 echo "configure:5237: checking for gdbm_open" >&5
5237 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
5238   echo $ac_n "(cached) $ac_c" 1>&6
5239 else
5240   cat > conftest.$ac_ext <<EOF
5241 #line 5242 "configure"
5242 #include "confdefs.h"
5243 /* System header to define __stub macros and hopefully few prototypes,
5244     which can conflict with char gdbm_open(); below.  */
5245 #include <assert.h>
5246 /* Override any gcc2 internal prototype to avoid an error.  */
5247 /* We use char because int might match the return type of a gcc2
5248     builtin and then its argument prototype would still apply.  */
5249 char gdbm_open();
5250
5251 int main() {
5252
5253 /* The GNU C library defines this for functions which it implements
5254     to always fail with ENOSYS.  Some functions are actually named
5255     something starting with __ and the normal name is an alias.  */
5256 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
5257 choke me
5258 #else
5259 gdbm_open();
5260 #endif
5261
5262 ; return 0; }
5263 EOF
5264 if { (eval echo configure:5265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5265   rm -rf conftest*
5266   eval "ac_cv_func_gdbm_open=yes"
5267 else
5268   echo "configure: failed program was:" >&5
5269   cat conftest.$ac_ext >&5
5270   rm -rf conftest*
5271   eval "ac_cv_func_gdbm_open=no"
5272 fi
5273 rm -f conftest*
5274 fi
5275
5276 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
5277   echo "$ac_t""yes" 1>&6
5278   ol_cv_lib_gdbm=yes
5279 else
5280   echo "$ac_t""no" 1>&6
5281
5282                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
5283 echo "configure:5284: checking for gdbm_open in -lgdbm" >&5
5284 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
5285 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5286   echo $ac_n "(cached) $ac_c" 1>&6
5287 else
5288   ac_save_LIBS="$LIBS"
5289 LIBS="-lgdbm  $LIBS"
5290 cat > conftest.$ac_ext <<EOF
5291 #line 5292 "configure"
5292 #include "confdefs.h"
5293 /* Override any gcc2 internal prototype to avoid an error.  */
5294 /* We use char because int might match the return type of a gcc2
5295     builtin and then its argument prototype would still apply.  */
5296 char gdbm_open();
5297
5298 int main() {
5299 gdbm_open()
5300 ; return 0; }
5301 EOF
5302 if { (eval echo configure:5303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5303   rm -rf conftest*
5304   eval "ac_cv_lib_$ac_lib_var=yes"
5305 else
5306   echo "configure: failed program was:" >&5
5307   cat conftest.$ac_ext >&5
5308   rm -rf conftest*
5309   eval "ac_cv_lib_$ac_lib_var=no"
5310 fi
5311 rm -f conftest*
5312 LIBS="$ac_save_LIBS"
5313
5314 fi
5315 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5316   echo "$ac_t""yes" 1>&6
5317   ol_cv_lib_gdbm=-lgdbm
5318 else
5319   echo "$ac_t""no" 1>&6
5320 ol_cv_lib_gdbm=no
5321 fi
5322
5323         
5324 fi
5325
5326         LIBS="$ol_LIBS"
5327
5328 fi
5329
5330 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
5331
5332
5333  for ac_hdr in gdbm.h
5334 do
5335 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5336 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5337 echo "configure:5338: checking for $ac_hdr" >&5
5338 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5339   echo $ac_n "(cached) $ac_c" 1>&6
5340 else
5341   cat > conftest.$ac_ext <<EOF
5342 #line 5343 "configure"
5343 #include "confdefs.h"
5344 #include <$ac_hdr>
5345 EOF
5346 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5347 { (eval echo configure:5348: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5348 ac_err=`grep -v '^ *+' conftest.out`
5349 if test -z "$ac_err"; then
5350   rm -rf conftest*
5351   eval "ac_cv_header_$ac_safe=yes"
5352 else
5353   echo "$ac_err" >&5
5354   echo "configure: failed program was:" >&5
5355   cat conftest.$ac_ext >&5
5356   rm -rf conftest*
5357   eval "ac_cv_header_$ac_safe=no"
5358 fi
5359 rm -f conftest*
5360 fi
5361 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5362   echo "$ac_t""yes" 1>&6
5363     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5364   cat >> confdefs.h <<EOF
5365 #define $ac_tr_hdr 1
5366 EOF
5367  
5368 else
5369   echo "$ac_t""no" 1>&6
5370 fi
5371 done
5372
5373  echo $ac_n "checking for db""... $ac_c" 1>&6
5374 echo "configure:5375: checking for db" >&5
5375 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
5376   echo $ac_n "(cached) $ac_c" 1>&6
5377 else
5378   
5379         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
5380                 ol_cv_gdbm=no
5381         else
5382                 ol_cv_gdbm=yes
5383         fi
5384
5385 fi
5386
5387 echo "$ac_t""$ol_cv_gdbm" 1>&6
5388  if test $ol_cv_gdbm = yes ; then
5389         cat >> confdefs.h <<\EOF
5390 #define HAVE_GDBM 1
5391 EOF
5392
5393  fi
5394
5395
5396         if test $ol_cv_gdbm = yes ; then
5397                 ol_link_ldbm=gdbm
5398                 ol_with_ldbm_api=gdbm
5399
5400                 if test $ol_cv_lib_gdbm != yes ; then
5401                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
5402                 fi
5403         fi
5404 fi
5405
5406 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = ndbm ; then
5407         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
5408 echo "configure:5409: checking for NDBM library" >&5
5409 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
5410   echo $ac_n "(cached) $ac_c" 1>&6
5411 else
5412         ol_LIBS="$LIBS"
5413         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
5414 echo "configure:5415: checking for dbm_open" >&5
5415 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
5416   echo $ac_n "(cached) $ac_c" 1>&6
5417 else
5418   cat > conftest.$ac_ext <<EOF
5419 #line 5420 "configure"
5420 #include "confdefs.h"
5421 /* System header to define __stub macros and hopefully few prototypes,
5422     which can conflict with char dbm_open(); below.  */
5423 #include <assert.h>
5424 /* Override any gcc2 internal prototype to avoid an error.  */
5425 /* We use char because int might match the return type of a gcc2
5426     builtin and then its argument prototype would still apply.  */
5427 char dbm_open();
5428
5429 int main() {
5430
5431 /* The GNU C library defines this for functions which it implements
5432     to always fail with ENOSYS.  Some functions are actually named
5433     something starting with __ and the normal name is an alias.  */
5434 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
5435 choke me
5436 #else
5437 dbm_open();
5438 #endif
5439
5440 ; return 0; }
5441 EOF
5442 if { (eval echo configure:5443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5443   rm -rf conftest*
5444   eval "ac_cv_func_dbm_open=yes"
5445 else
5446   echo "configure: failed program was:" >&5
5447   cat conftest.$ac_ext >&5
5448   rm -rf conftest*
5449   eval "ac_cv_func_dbm_open=no"
5450 fi
5451 rm -f conftest*
5452 fi
5453
5454 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
5455   echo "$ac_t""yes" 1>&6
5456   ol_cv_lib_ndbm=yes
5457 else
5458   echo "$ac_t""no" 1>&6
5459
5460                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
5461 echo "configure:5462: checking for dbm_open in -lndbm" >&5
5462 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
5463 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5464   echo $ac_n "(cached) $ac_c" 1>&6
5465 else
5466   ac_save_LIBS="$LIBS"
5467 LIBS="-lndbm  $LIBS"
5468 cat > conftest.$ac_ext <<EOF
5469 #line 5470 "configure"
5470 #include "confdefs.h"
5471 /* Override any gcc2 internal prototype to avoid an error.  */
5472 /* We use char because int might match the return type of a gcc2
5473     builtin and then its argument prototype would still apply.  */
5474 char dbm_open();
5475
5476 int main() {
5477 dbm_open()
5478 ; return 0; }
5479 EOF
5480 if { (eval echo configure:5481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5481   rm -rf conftest*
5482   eval "ac_cv_lib_$ac_lib_var=yes"
5483 else
5484   echo "configure: failed program was:" >&5
5485   cat conftest.$ac_ext >&5
5486   rm -rf conftest*
5487   eval "ac_cv_lib_$ac_lib_var=no"
5488 fi
5489 rm -f conftest*
5490 LIBS="$ac_save_LIBS"
5491
5492 fi
5493 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5494   echo "$ac_t""yes" 1>&6
5495   ol_cv_lib_ndbm=-lndbm
5496 else
5497   echo "$ac_t""no" 1>&6
5498
5499                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
5500 echo "configure:5501: checking for dbm_open in -ldbm" >&5
5501 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
5502 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5503   echo $ac_n "(cached) $ac_c" 1>&6
5504 else
5505   ac_save_LIBS="$LIBS"
5506 LIBS="-ldbm  $LIBS"
5507 cat > conftest.$ac_ext <<EOF
5508 #line 5509 "configure"
5509 #include "confdefs.h"
5510 /* Override any gcc2 internal prototype to avoid an error.  */
5511 /* We use char because int might match the return type of a gcc2
5512     builtin and then its argument prototype would still apply.  */
5513 char dbm_open();
5514
5515 int main() {
5516 dbm_open()
5517 ; return 0; }
5518 EOF
5519 if { (eval echo configure:5520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5520   rm -rf conftest*
5521   eval "ac_cv_lib_$ac_lib_var=yes"
5522 else
5523   echo "configure: failed program was:" >&5
5524   cat conftest.$ac_ext >&5
5525   rm -rf conftest*
5526   eval "ac_cv_lib_$ac_lib_var=no"
5527 fi
5528 rm -f conftest*
5529 LIBS="$ac_save_LIBS"
5530
5531 fi
5532 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5533   echo "$ac_t""yes" 1>&6
5534   ol_cv_lib_ndbm=-ldbm
5535 else
5536   echo "$ac_t""no" 1>&6
5537 ol_cv_lib_ndbm=no
5538 fi
5539                 
5540 fi
5541
5542         
5543 fi
5544
5545         LIBS="$ol_LIBS"
5546
5547 fi
5548
5549 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
5550
5551
5552  for ac_hdr in ndbm.h
5553 do
5554 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5555 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5556 echo "configure:5557: checking for $ac_hdr" >&5
5557 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5558   echo $ac_n "(cached) $ac_c" 1>&6
5559 else
5560   cat > conftest.$ac_ext <<EOF
5561 #line 5562 "configure"
5562 #include "confdefs.h"
5563 #include <$ac_hdr>
5564 EOF
5565 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5566 { (eval echo configure:5567: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5567 ac_err=`grep -v '^ *+' conftest.out`
5568 if test -z "$ac_err"; then
5569   rm -rf conftest*
5570   eval "ac_cv_header_$ac_safe=yes"
5571 else
5572   echo "$ac_err" >&5
5573   echo "configure: failed program was:" >&5
5574   cat conftest.$ac_ext >&5
5575   rm -rf conftest*
5576   eval "ac_cv_header_$ac_safe=no"
5577 fi
5578 rm -f conftest*
5579 fi
5580 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5581   echo "$ac_t""yes" 1>&6
5582     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5583   cat >> confdefs.h <<EOF
5584 #define $ac_tr_hdr 1
5585 EOF
5586  
5587 else
5588   echo "$ac_t""no" 1>&6
5589 fi
5590 done
5591
5592  echo $ac_n "checking for db""... $ac_c" 1>&6
5593 echo "configure:5594: checking for db" >&5
5594 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
5595   echo $ac_n "(cached) $ac_c" 1>&6
5596 else
5597   
5598         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
5599                 ol_cv_ndbm=no
5600         else
5601                 ol_cv_ndbm=yes
5602         fi
5603
5604 fi
5605
5606 echo "$ac_t""$ol_cv_ndbm" 1>&6
5607  if test $ol_cv_ndbm = yes ; then
5608         cat >> confdefs.h <<\EOF
5609 #define HAVE_NDBM 1
5610 EOF
5611
5612  fi
5613
5614
5615         if test $ol_cv_ndbm = yes ; then
5616                 if test $ol_with_ldbm_api = auto ; then
5617                         echo "configure: warning: Attempting to use NDBM.  Functionality will be limited." 1>&2
5618                 fi
5619
5620                 ol_link_ldbm=ndbm
5621                 ol_with_ldbm_api=ndbm
5622
5623                 if test $ol_cv_lib_ndbm != yes ; then
5624                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
5625                 fi
5626         fi
5627 fi
5628
5629 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
5630         echo "configure: warning: could not find suitable LDBM backend" 1>&2
5631         if test $ol_enable_ldbm = yes ; then
5632                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
5633         fi
5634
5635         echo "configure: warning: disabling LDBM" 1>&2
5636         ol_enable_ldbm=no
5637 fi
5638
5639 if test $ol_enable_wrappers = yes ; then
5640         echo $ac_n "checking for hosts_access in -lwrap""... $ac_c" 1>&6
5641 echo "configure:5642: checking for hosts_access in -lwrap" >&5
5642 ac_lib_var=`echo wrap'_'hosts_access | sed 'y%./+-%__p_%'`
5643 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5644   echo $ac_n "(cached) $ac_c" 1>&6
5645 else
5646   ac_save_LIBS="$LIBS"
5647 LIBS="-lwrap  $LIBS"
5648 cat > conftest.$ac_ext <<EOF
5649 #line 5650 "configure"
5650 #include "confdefs.h"
5651 /* Override any gcc2 internal prototype to avoid an error.  */
5652 /* We use char because int might match the return type of a gcc2
5653     builtin and then its argument prototype would still apply.  */
5654 char hosts_access();
5655
5656 int main() {
5657 hosts_access()
5658 ; return 0; }
5659 EOF
5660 if { (eval echo configure:5661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5661   rm -rf conftest*
5662   eval "ac_cv_lib_$ac_lib_var=yes"
5663 else
5664   echo "configure: failed program was:" >&5
5665   cat conftest.$ac_ext >&5
5666   rm -rf conftest*
5667   eval "ac_cv_lib_$ac_lib_var=no"
5668 fi
5669 rm -f conftest*
5670 LIBS="$ac_save_LIBS"
5671
5672 fi
5673 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5674   echo "$ac_t""yes" 1>&6
5675   have_wrappers=yes
5676 else
5677   echo "$ac_t""no" 1>&6
5678 have_wrappers=no
5679 fi
5680
5681
5682         if test $have_wrappers = yes ; then
5683                 cat >> confdefs.h <<\EOF
5684 #define HAVE_TCPD 1
5685 EOF
5686
5687                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
5688         else
5689                 echo "configure: warning: could not find -lwrap" 1>&2
5690                 if test $ol_enable_wrappers = yes ; then
5691                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
5692                 fi
5693
5694                 echo "configure: warning: disabling wrappers support" 1>&2
5695                 ol_enable_wrappers=no
5696         fi
5697
5698 fi
5699
5700 # ud needs termcap (should insert check here)
5701 ol_link_termcap=no
5702 for ac_hdr in termcap.h ncurses.h
5703 do
5704 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5705 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5706 echo "configure:5707: checking for $ac_hdr" >&5
5707 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5708   echo $ac_n "(cached) $ac_c" 1>&6
5709 else
5710   cat > conftest.$ac_ext <<EOF
5711 #line 5712 "configure"
5712 #include "confdefs.h"
5713 #include <$ac_hdr>
5714 EOF
5715 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5716 { (eval echo configure:5717: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5717 ac_err=`grep -v '^ *+' conftest.out`
5718 if test -z "$ac_err"; then
5719   rm -rf conftest*
5720   eval "ac_cv_header_$ac_safe=yes"
5721 else
5722   echo "$ac_err" >&5
5723   echo "configure: failed program was:" >&5
5724   cat conftest.$ac_ext >&5
5725   rm -rf conftest*
5726   eval "ac_cv_header_$ac_safe=no"
5727 fi
5728 rm -f conftest*
5729 fi
5730 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5731   echo "$ac_t""yes" 1>&6
5732     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5733   cat >> confdefs.h <<EOF
5734 #define $ac_tr_hdr 1
5735 EOF
5736  
5737 else
5738   echo "$ac_t""no" 1>&6
5739 fi
5740 done
5741
5742
5743 if test $ol_link_termcap = no ; then
5744         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
5745 echo "configure:5746: checking for tputs in -ltermcap" >&5
5746 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
5747 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5748   echo $ac_n "(cached) $ac_c" 1>&6
5749 else
5750   ac_save_LIBS="$LIBS"
5751 LIBS="-ltermcap  $LIBS"
5752 cat > conftest.$ac_ext <<EOF
5753 #line 5754 "configure"
5754 #include "confdefs.h"
5755 /* Override any gcc2 internal prototype to avoid an error.  */
5756 /* We use char because int might match the return type of a gcc2
5757     builtin and then its argument prototype would still apply.  */
5758 char tputs();
5759
5760 int main() {
5761 tputs()
5762 ; return 0; }
5763 EOF
5764 if { (eval echo configure:5765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5765   rm -rf conftest*
5766   eval "ac_cv_lib_$ac_lib_var=yes"
5767 else
5768   echo "configure: failed program was:" >&5
5769   cat conftest.$ac_ext >&5
5770   rm -rf conftest*
5771   eval "ac_cv_lib_$ac_lib_var=no"
5772 fi
5773 rm -f conftest*
5774 LIBS="$ac_save_LIBS"
5775
5776 fi
5777 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5778   echo "$ac_t""yes" 1>&6
5779   have_termcap=yes
5780 else
5781   echo "$ac_t""no" 1>&6
5782 have_termcap=no
5783 fi
5784
5785         if test $have_termcap = yes ; then
5786                 cat >> confdefs.h <<\EOF
5787 #define HAVE_TERMCAP 1
5788 EOF
5789
5790                 ol_link_termcap=yes
5791                 TERMCAP_LIBS=-ltermcap
5792         fi
5793 fi
5794
5795 if test $ol_link_termcap = no ; then
5796         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
5797 echo "configure:5798: checking for initscr in -lncurses" >&5
5798 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
5799 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5800   echo $ac_n "(cached) $ac_c" 1>&6
5801 else
5802   ac_save_LIBS="$LIBS"
5803 LIBS="-lncurses  $LIBS"
5804 cat > conftest.$ac_ext <<EOF
5805 #line 5806 "configure"
5806 #include "confdefs.h"
5807 /* Override any gcc2 internal prototype to avoid an error.  */
5808 /* We use char because int might match the return type of a gcc2
5809     builtin and then its argument prototype would still apply.  */
5810 char initscr();
5811
5812 int main() {
5813 initscr()
5814 ; return 0; }
5815 EOF
5816 if { (eval echo configure:5817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5817   rm -rf conftest*
5818   eval "ac_cv_lib_$ac_lib_var=yes"
5819 else
5820   echo "configure: failed program was:" >&5
5821   cat conftest.$ac_ext >&5
5822   rm -rf conftest*
5823   eval "ac_cv_lib_$ac_lib_var=no"
5824 fi
5825 rm -f conftest*
5826 LIBS="$ac_save_LIBS"
5827
5828 fi
5829 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5830   echo "$ac_t""yes" 1>&6
5831   have_ncurses=yes
5832 else
5833   echo "$ac_t""no" 1>&6
5834 have_ncurses=no
5835 fi
5836
5837         if test $have_ncurses = yes ; then
5838                 cat >> confdefs.h <<\EOF
5839 #define HAVE_NCURSES 1
5840 EOF
5841
5842                 ol_link_termcap=yes
5843                 TERMCAP_LIBS=-lncurses
5844         fi
5845 fi
5846
5847 if test $ol_link_termcap = no ; then
5848         cat >> confdefs.h <<\EOF
5849 #define NO_TERMCAP 1
5850 EOF
5851
5852         TERMCAP_LIBS=
5853 fi
5854
5855 # FreeBSD (and others) have crypt(3) in -lcrypt
5856 if test $ol_enable_crypt != no ; then
5857         echo $ac_n "checking for crypt""... $ac_c" 1>&6
5858 echo "configure:5859: checking for crypt" >&5
5859 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
5860   echo $ac_n "(cached) $ac_c" 1>&6
5861 else
5862   cat > conftest.$ac_ext <<EOF
5863 #line 5864 "configure"
5864 #include "confdefs.h"
5865 /* System header to define __stub macros and hopefully few prototypes,
5866     which can conflict with char crypt(); below.  */
5867 #include <assert.h>
5868 /* Override any gcc2 internal prototype to avoid an error.  */
5869 /* We use char because int might match the return type of a gcc2
5870     builtin and then its argument prototype would still apply.  */
5871 char crypt();
5872
5873 int main() {
5874
5875 /* The GNU C library defines this for functions which it implements
5876     to always fail with ENOSYS.  Some functions are actually named
5877     something starting with __ and the normal name is an alias.  */
5878 #if defined (__stub_crypt) || defined (__stub___crypt)
5879 choke me
5880 #else
5881 crypt();
5882 #endif
5883
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_func_crypt=yes"
5889 else
5890   echo "configure: failed program was:" >&5
5891   cat conftest.$ac_ext >&5
5892   rm -rf conftest*
5893   eval "ac_cv_func_crypt=no"
5894 fi
5895 rm -f conftest*
5896 fi
5897
5898 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
5899   echo "$ac_t""yes" 1>&6
5900   have_crypt=yes
5901 else
5902   echo "$ac_t""no" 1>&6
5903
5904                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
5905 echo "configure:5906: checking for crypt in -lcrypt" >&5
5906 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
5907 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5908   echo $ac_n "(cached) $ac_c" 1>&6
5909 else
5910   ac_save_LIBS="$LIBS"
5911 LIBS="-lcrypt  $LIBS"
5912 cat > conftest.$ac_ext <<EOF
5913 #line 5914 "configure"
5914 #include "confdefs.h"
5915 /* Override any gcc2 internal prototype to avoid an error.  */
5916 /* We use char because int might match the return type of a gcc2
5917     builtin and then its argument prototype would still apply.  */
5918 char crypt();
5919
5920 int main() {
5921 crypt()
5922 ; return 0; }
5923 EOF
5924 if { (eval echo configure:5925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5925   rm -rf conftest*
5926   eval "ac_cv_lib_$ac_lib_var=yes"
5927 else
5928   echo "configure: failed program was:" >&5
5929   cat conftest.$ac_ext >&5
5930   rm -rf conftest*
5931   eval "ac_cv_lib_$ac_lib_var=no"
5932 fi
5933 rm -f conftest*
5934 LIBS="$ac_save_LIBS"
5935
5936 fi
5937 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5938   echo "$ac_t""yes" 1>&6
5939   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
5940                         have_crypt=yes
5941 else
5942   echo "$ac_t""no" 1>&6
5943 have_crypt=no
5944 fi
5945
5946 fi
5947
5948
5949         if test $have_crypt = yes ; then
5950                 cat >> confdefs.h <<\EOF
5951 #define HAVE_CRYPT 1
5952 EOF
5953
5954         else
5955                 echo "configure: warning: could not find crypt" 1>&2
5956                 if test $ol_enable_crypt = yes ; then
5957                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
5958                 fi
5959
5960                 echo "configure: warning: disabling crypt support" 1>&2
5961                 ol_enable_crypt=no
5962         fi
5963 fi
5964
5965 # FreeBSD (and others) have setproctitle(3) in -lutil
5966 if test $ol_enable_proctitle != no ; then
5967         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
5968 echo "configure:5969: checking for setproctitle" >&5
5969 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
5970   echo $ac_n "(cached) $ac_c" 1>&6
5971 else
5972   cat > conftest.$ac_ext <<EOF
5973 #line 5974 "configure"
5974 #include "confdefs.h"
5975 /* System header to define __stub macros and hopefully few prototypes,
5976     which can conflict with char setproctitle(); below.  */
5977 #include <assert.h>
5978 /* Override any gcc2 internal prototype to avoid an error.  */
5979 /* We use char because int might match the return type of a gcc2
5980     builtin and then its argument prototype would still apply.  */
5981 char setproctitle();
5982
5983 int main() {
5984
5985 /* The GNU C library defines this for functions which it implements
5986     to always fail with ENOSYS.  Some functions are actually named
5987     something starting with __ and the normal name is an alias.  */
5988 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
5989 choke me
5990 #else
5991 setproctitle();
5992 #endif
5993
5994 ; return 0; }
5995 EOF
5996 if { (eval echo configure:5997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5997   rm -rf conftest*
5998   eval "ac_cv_func_setproctitle=yes"
5999 else
6000   echo "configure: failed program was:" >&5
6001   cat conftest.$ac_ext >&5
6002   rm -rf conftest*
6003   eval "ac_cv_func_setproctitle=no"
6004 fi
6005 rm -f conftest*
6006 fi
6007
6008 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
6009   echo "$ac_t""yes" 1>&6
6010   have_setproctitle=yes
6011 else
6012   echo "$ac_t""no" 1>&6
6013
6014                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
6015 echo "configure:6016: checking for setproctitle in -lutil" >&5
6016 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
6017 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6018   echo $ac_n "(cached) $ac_c" 1>&6
6019 else
6020   ac_save_LIBS="$LIBS"
6021 LIBS="-lutil  $LIBS"
6022 cat > conftest.$ac_ext <<EOF
6023 #line 6024 "configure"
6024 #include "confdefs.h"
6025 /* Override any gcc2 internal prototype to avoid an error.  */
6026 /* We use char because int might match the return type of a gcc2
6027     builtin and then its argument prototype would still apply.  */
6028 char setproctitle();
6029
6030 int main() {
6031 setproctitle()
6032 ; return 0; }
6033 EOF
6034 if { (eval echo configure:6035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6035   rm -rf conftest*
6036   eval "ac_cv_lib_$ac_lib_var=yes"
6037 else
6038   echo "configure: failed program was:" >&5
6039   cat conftest.$ac_ext >&5
6040   rm -rf conftest*
6041   eval "ac_cv_lib_$ac_lib_var=no"
6042 fi
6043 rm -f conftest*
6044 LIBS="$ac_save_LIBS"
6045
6046 fi
6047 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6048   echo "$ac_t""yes" 1>&6
6049   have_setproctitle=yes
6050                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
6051 else
6052   echo "$ac_t""no" 1>&6
6053 have_setproctitle=no
6054                         LIBOBJS="$LIBOBJS setproctitle.o"
6055 fi
6056
6057 fi
6058
6059
6060         if test $have_setproctitle = yes ; then
6061                 cat >> confdefs.h <<\EOF
6062 #define HAVE_SETPROCTITLE 1
6063 EOF
6064
6065         fi
6066 fi
6067
6068 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
6069 echo "configure:6070: checking for ANSI C header files" >&5
6070 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
6071   echo $ac_n "(cached) $ac_c" 1>&6
6072 else
6073   cat > conftest.$ac_ext <<EOF
6074 #line 6075 "configure"
6075 #include "confdefs.h"
6076 #include <stdlib.h>
6077 #include <stdarg.h>
6078 #include <string.h>
6079 #include <float.h>
6080 EOF
6081 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6082 { (eval echo configure:6083: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6083 ac_err=`grep -v '^ *+' conftest.out`
6084 if test -z "$ac_err"; then
6085   rm -rf conftest*
6086   ac_cv_header_stdc=yes
6087 else
6088   echo "$ac_err" >&5
6089   echo "configure: failed program was:" >&5
6090   cat conftest.$ac_ext >&5
6091   rm -rf conftest*
6092   ac_cv_header_stdc=no
6093 fi
6094 rm -f conftest*
6095
6096 if test $ac_cv_header_stdc = yes; then
6097   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
6098 cat > conftest.$ac_ext <<EOF
6099 #line 6100 "configure"
6100 #include "confdefs.h"
6101 #include <string.h>
6102 EOF
6103 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6104   egrep "memchr" >/dev/null 2>&1; then
6105   :
6106 else
6107   rm -rf conftest*
6108   ac_cv_header_stdc=no
6109 fi
6110 rm -f conftest*
6111
6112 fi
6113
6114 if test $ac_cv_header_stdc = yes; then
6115   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
6116 cat > conftest.$ac_ext <<EOF
6117 #line 6118 "configure"
6118 #include "confdefs.h"
6119 #include <stdlib.h>
6120 EOF
6121 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6122   egrep "free" >/dev/null 2>&1; then
6123   :
6124 else
6125   rm -rf conftest*
6126   ac_cv_header_stdc=no
6127 fi
6128 rm -f conftest*
6129
6130 fi
6131
6132 if test $ac_cv_header_stdc = yes; then
6133   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
6134 if test "$cross_compiling" = yes; then
6135   :
6136 else
6137   cat > conftest.$ac_ext <<EOF
6138 #line 6139 "configure"
6139 #include "confdefs.h"
6140 #include <ctype.h>
6141 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
6142 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
6143 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
6144 int main () { int i; for (i = 0; i < 256; i++)
6145 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
6146 exit (0); }
6147
6148 EOF
6149 if { (eval echo configure:6150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
6150 then
6151   :
6152 else
6153   echo "configure: failed program was:" >&5
6154   cat conftest.$ac_ext >&5
6155   rm -fr conftest*
6156   ac_cv_header_stdc=no
6157 fi
6158 rm -fr conftest*
6159 fi
6160
6161 fi
6162 fi
6163
6164 echo "$ac_t""$ac_cv_header_stdc" 1>&6
6165 if test $ac_cv_header_stdc = yes; then
6166   cat >> confdefs.h <<\EOF
6167 #define STDC_HEADERS 1
6168 EOF
6169
6170 fi
6171
6172
6173 if test $ac_cv_header_stdc != yes; then
6174         echo "configure: warning: could not Standard C compliant headers" 1>&2
6175 fi
6176
6177 ac_header_dirent=no
6178 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
6179 do
6180 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6181 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
6182 echo "configure:6183: checking for $ac_hdr that defines DIR" >&5
6183 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
6184   echo $ac_n "(cached) $ac_c" 1>&6
6185 else
6186   cat > conftest.$ac_ext <<EOF
6187 #line 6188 "configure"
6188 #include "confdefs.h"
6189 #include <sys/types.h>
6190 #include <$ac_hdr>
6191 int main() {
6192 DIR *dirp = 0;
6193 ; return 0; }
6194 EOF
6195 if { (eval echo configure:6196: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6196   rm -rf conftest*
6197   eval "ac_cv_header_dirent_$ac_safe=yes"
6198 else
6199   echo "configure: failed program was:" >&5
6200   cat conftest.$ac_ext >&5
6201   rm -rf conftest*
6202   eval "ac_cv_header_dirent_$ac_safe=no"
6203 fi
6204 rm -f conftest*
6205 fi
6206 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
6207   echo "$ac_t""yes" 1>&6
6208     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6209   cat >> confdefs.h <<EOF
6210 #define $ac_tr_hdr 1
6211 EOF
6212  ac_header_dirent=$ac_hdr; break
6213 else
6214   echo "$ac_t""no" 1>&6
6215 fi
6216 done
6217 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
6218 if test $ac_header_dirent = dirent.h; then
6219 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
6220 echo "configure:6221: checking for opendir in -ldir" >&5
6221 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
6222 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6223   echo $ac_n "(cached) $ac_c" 1>&6
6224 else
6225   ac_save_LIBS="$LIBS"
6226 LIBS="-ldir  $LIBS"
6227 cat > conftest.$ac_ext <<EOF
6228 #line 6229 "configure"
6229 #include "confdefs.h"
6230 /* Override any gcc2 internal prototype to avoid an error.  */
6231 /* We use char because int might match the return type of a gcc2
6232     builtin and then its argument prototype would still apply.  */
6233 char opendir();
6234
6235 int main() {
6236 opendir()
6237 ; return 0; }
6238 EOF
6239 if { (eval echo configure:6240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6240   rm -rf conftest*
6241   eval "ac_cv_lib_$ac_lib_var=yes"
6242 else
6243   echo "configure: failed program was:" >&5
6244   cat conftest.$ac_ext >&5
6245   rm -rf conftest*
6246   eval "ac_cv_lib_$ac_lib_var=no"
6247 fi
6248 rm -f conftest*
6249 LIBS="$ac_save_LIBS"
6250
6251 fi
6252 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6253   echo "$ac_t""yes" 1>&6
6254   LIBS="$LIBS -ldir"
6255 else
6256   echo "$ac_t""no" 1>&6
6257 fi
6258
6259 else
6260 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
6261 echo "configure:6262: checking for opendir in -lx" >&5
6262 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
6263 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6264   echo $ac_n "(cached) $ac_c" 1>&6
6265 else
6266   ac_save_LIBS="$LIBS"
6267 LIBS="-lx  $LIBS"
6268 cat > conftest.$ac_ext <<EOF
6269 #line 6270 "configure"
6270 #include "confdefs.h"
6271 /* Override any gcc2 internal prototype to avoid an error.  */
6272 /* We use char because int might match the return type of a gcc2
6273     builtin and then its argument prototype would still apply.  */
6274 char opendir();
6275
6276 int main() {
6277 opendir()
6278 ; return 0; }
6279 EOF
6280 if { (eval echo configure:6281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6281   rm -rf conftest*
6282   eval "ac_cv_lib_$ac_lib_var=yes"
6283 else
6284   echo "configure: failed program was:" >&5
6285   cat conftest.$ac_ext >&5
6286   rm -rf conftest*
6287   eval "ac_cv_lib_$ac_lib_var=no"
6288 fi
6289 rm -f conftest*
6290 LIBS="$ac_save_LIBS"
6291
6292 fi
6293 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6294   echo "$ac_t""yes" 1>&6
6295   LIBS="$LIBS -lx"
6296 else
6297   echo "$ac_t""no" 1>&6
6298 fi
6299
6300 fi
6301
6302 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
6303 echo "configure:6304: checking for sys/wait.h that is POSIX.1 compatible" >&5
6304 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
6305   echo $ac_n "(cached) $ac_c" 1>&6
6306 else
6307   cat > conftest.$ac_ext <<EOF
6308 #line 6309 "configure"
6309 #include "confdefs.h"
6310 #include <sys/types.h>
6311 #include <sys/wait.h>
6312 #ifndef WEXITSTATUS
6313 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
6314 #endif
6315 #ifndef WIFEXITED
6316 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
6317 #endif
6318 int main() {
6319 int s;
6320 wait (&s);
6321 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
6322 ; return 0; }
6323 EOF
6324 if { (eval echo configure:6325: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6325   rm -rf conftest*
6326   ac_cv_header_sys_wait_h=yes
6327 else
6328   echo "configure: failed program was:" >&5
6329   cat conftest.$ac_ext >&5
6330   rm -rf conftest*
6331   ac_cv_header_sys_wait_h=no
6332 fi
6333 rm -f conftest*
6334 fi
6335
6336 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
6337 if test $ac_cv_header_sys_wait_h = yes; then
6338   cat >> confdefs.h <<\EOF
6339 #define HAVE_SYS_WAIT_H 1
6340 EOF
6341
6342 fi
6343
6344 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
6345 echo "configure:6346: checking POSIX termios" >&5
6346 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
6347   echo $ac_n "(cached) $ac_c" 1>&6
6348 else
6349   cat > conftest.$ac_ext <<EOF
6350 #line 6351 "configure"
6351 #include "confdefs.h"
6352 #include <sys/types.h>
6353 #include <unistd.h>
6354 #include <termios.h>
6355 int main() {
6356 /* SunOS 4.0.3 has termios.h but not the library calls.  */
6357    tcgetattr(0, 0);
6358 ; return 0; }
6359 EOF
6360 if { (eval echo configure:6361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6361   rm -rf conftest*
6362   am_cv_sys_posix_termios=yes
6363 else
6364   echo "configure: failed program was:" >&5
6365   cat conftest.$ac_ext >&5
6366   rm -rf conftest*
6367   am_cv_sys_posix_termios=no
6368 fi
6369 rm -f conftest*
6370 fi
6371
6372 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
6373
6374
6375  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
6376 echo "configure:6377: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
6377 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
6378   echo $ac_n "(cached) $ac_c" 1>&6
6379 else
6380   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
6381
6382   gwinsz_in_termios_h=no
6383   if test $am_cv_sys_posix_termios = yes; then
6384     cat > conftest.$ac_ext <<EOF
6385 #line 6386 "configure"
6386 #include "confdefs.h"
6387 #include <sys/types.h>
6388 #     include <termios.h>
6389 #     ifdef TIOCGWINSZ
6390         yes
6391 #     endif
6392     
6393 EOF
6394 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6395   egrep "yes" >/dev/null 2>&1; then
6396   rm -rf conftest*
6397   gwinsz_in_termios_h=yes
6398 fi
6399 rm -f conftest*
6400
6401   fi
6402
6403   if test $gwinsz_in_termios_h = no; then
6404     cat > conftest.$ac_ext <<EOF
6405 #line 6406 "configure"
6406 #include "confdefs.h"
6407 #include <sys/types.h>
6408 #     include <sys/ioctl.h>
6409 #     ifdef TIOCGWINSZ
6410         yes
6411 #     endif
6412     
6413 EOF
6414 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6415   egrep "yes" >/dev/null 2>&1; then
6416   rm -rf conftest*
6417   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
6418 fi
6419 rm -f conftest*
6420
6421   fi
6422   
6423 fi
6424
6425 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
6426   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
6427     cat >> confdefs.h <<\EOF
6428 #define GWINSZ_IN_SYS_IOCTL 1
6429 EOF
6430
6431   fi
6432
6433 if test $am_cv_sys_posix_termios = yes ; then
6434         cat >> confdefs.h <<\EOF
6435 #define HAVE_POSIX_TERMIOS 1
6436 EOF
6437
6438 fi
6439
6440 for ac_hdr in \
6441         crypt.h                 \
6442         errno.h                 \
6443         fcntl.h                 \
6444         filio.h                 \
6445         getopt.h                \
6446         libutil.h               \
6447         limits.h                \
6448         malloc.h                \
6449         memory.h                \
6450         regex.h                 \
6451         psap.h                  \
6452         pwd.h                   \
6453         sgtty.h                 \
6454         stdarg.h                \
6455         stddef.h                \
6456         string.h                \
6457         strings.h               \
6458         sys/file.h              \
6459         sys/filio.h             \
6460         sys/errno.h             \
6461         sys/ioctl.h             \
6462         sys/param.h             \
6463         sys/resource.h  \
6464         sys/socket.h    \
6465         sys/syslog.h    \
6466         sys/types.h             \
6467         syslog.h                \
6468         termios.h               \
6469
6470 do
6471 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6472 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6473 echo "configure:6474: checking for $ac_hdr" >&5
6474 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6475   echo $ac_n "(cached) $ac_c" 1>&6
6476 else
6477   cat > conftest.$ac_ext <<EOF
6478 #line 6479 "configure"
6479 #include "confdefs.h"
6480 #include <$ac_hdr>
6481 EOF
6482 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6483 { (eval echo configure:6484: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6484 ac_err=`grep -v '^ *+' conftest.out`
6485 if test -z "$ac_err"; then
6486   rm -rf conftest*
6487   eval "ac_cv_header_$ac_safe=yes"
6488 else
6489   echo "$ac_err" >&5
6490   echo "configure: failed program was:" >&5
6491   cat conftest.$ac_ext >&5
6492   rm -rf conftest*
6493   eval "ac_cv_header_$ac_safe=no"
6494 fi
6495 rm -f conftest*
6496 fi
6497 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6498   echo "$ac_t""yes" 1>&6
6499     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6500   cat >> confdefs.h <<EOF
6501 #define $ac_tr_hdr 1
6502 EOF
6503  
6504 else
6505   echo "$ac_t""no" 1>&6
6506 fi
6507 done
6508
6509
6510 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
6511 echo "configure:6512: checking for uid_t in sys/types.h" >&5
6512 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
6513   echo $ac_n "(cached) $ac_c" 1>&6
6514 else
6515   cat > conftest.$ac_ext <<EOF
6516 #line 6517 "configure"
6517 #include "confdefs.h"
6518 #include <sys/types.h>
6519 EOF
6520 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6521   egrep "uid_t" >/dev/null 2>&1; then
6522   rm -rf conftest*
6523   ac_cv_type_uid_t=yes
6524 else
6525   rm -rf conftest*
6526   ac_cv_type_uid_t=no
6527 fi
6528 rm -f conftest*
6529
6530 fi
6531
6532 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
6533 if test $ac_cv_type_uid_t = no; then
6534   cat >> confdefs.h <<\EOF
6535 #define uid_t int
6536 EOF
6537
6538   cat >> confdefs.h <<\EOF
6539 #define gid_t int
6540 EOF
6541
6542 fi
6543
6544 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
6545 echo "configure:6546: checking type of array argument to getgroups" >&5
6546 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
6547   echo $ac_n "(cached) $ac_c" 1>&6
6548 else
6549   if test "$cross_compiling" = yes; then
6550   ac_cv_type_getgroups=cross
6551 else
6552   cat > conftest.$ac_ext <<EOF
6553 #line 6554 "configure"
6554 #include "confdefs.h"
6555
6556 /* Thanks to Mike Rendell for this test.  */
6557 #include <sys/types.h>
6558 #define NGID 256
6559 #undef MAX
6560 #define MAX(x, y) ((x) > (y) ? (x) : (y))
6561 main()
6562 {
6563   gid_t gidset[NGID];
6564   int i, n;
6565   union { gid_t gval; long lval; }  val;
6566
6567   val.lval = -1;
6568   for (i = 0; i < NGID; i++)
6569     gidset[i] = val.gval;
6570   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
6571                  gidset);
6572   /* Exit non-zero if getgroups seems to require an array of ints.  This
6573      happens when gid_t is short but getgroups modifies an array of ints.  */
6574   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
6575 }
6576
6577 EOF
6578 if { (eval echo configure:6579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
6579 then
6580     ac_cv_type_getgroups=gid_t
6581 else
6582   echo "configure: failed program was:" >&5
6583   cat conftest.$ac_ext >&5
6584   rm -fr conftest*
6585   ac_cv_type_getgroups=int
6586 fi
6587 rm -fr conftest*
6588 fi
6589
6590 if test $ac_cv_type_getgroups = cross; then
6591         cat > conftest.$ac_ext <<EOF
6592 #line 6593 "configure"
6593 #include "confdefs.h"
6594 #include <unistd.h>
6595 EOF
6596 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6597   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
6598   rm -rf conftest*
6599   ac_cv_type_getgroups=gid_t
6600 else
6601   rm -rf conftest*
6602   ac_cv_type_getgroups=int
6603 fi
6604 rm -f conftest*
6605
6606 fi
6607 fi
6608
6609 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
6610 cat >> confdefs.h <<EOF
6611 #define GETGROUPS_T $ac_cv_type_getgroups
6612 EOF
6613
6614  echo $ac_n "checking for mode_t""... $ac_c" 1>&6
6615 echo "configure:6616: checking for mode_t" >&5
6616 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
6617   echo $ac_n "(cached) $ac_c" 1>&6
6618 else
6619   cat > conftest.$ac_ext <<EOF
6620 #line 6621 "configure"
6621 #include "confdefs.h"
6622 #include <sys/types.h>
6623 #if STDC_HEADERS
6624 #include <stdlib.h>
6625 #include <stddef.h>
6626 #endif
6627 EOF
6628 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6629   egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
6630   rm -rf conftest*
6631   ac_cv_type_mode_t=yes
6632 else
6633   rm -rf conftest*
6634   ac_cv_type_mode_t=no
6635 fi
6636 rm -f conftest*
6637
6638 fi
6639 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
6640 if test $ac_cv_type_mode_t = no; then
6641   cat >> confdefs.h <<\EOF
6642 #define mode_t int
6643 EOF
6644
6645 fi
6646
6647 echo $ac_n "checking for off_t""... $ac_c" 1>&6
6648 echo "configure:6649: checking for off_t" >&5
6649 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
6650   echo $ac_n "(cached) $ac_c" 1>&6
6651 else
6652   cat > conftest.$ac_ext <<EOF
6653 #line 6654 "configure"
6654 #include "confdefs.h"
6655 #include <sys/types.h>
6656 #if STDC_HEADERS
6657 #include <stdlib.h>
6658 #include <stddef.h>
6659 #endif
6660 EOF
6661 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6662   egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
6663   rm -rf conftest*
6664   ac_cv_type_off_t=yes
6665 else
6666   rm -rf conftest*
6667   ac_cv_type_off_t=no
6668 fi
6669 rm -f conftest*
6670
6671 fi
6672 echo "$ac_t""$ac_cv_type_off_t" 1>&6
6673 if test $ac_cv_type_off_t = no; then
6674   cat >> confdefs.h <<\EOF
6675 #define off_t long
6676 EOF
6677
6678 fi
6679
6680 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
6681 echo "configure:6682: checking for pid_t" >&5
6682 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
6683   echo $ac_n "(cached) $ac_c" 1>&6
6684 else
6685   cat > conftest.$ac_ext <<EOF
6686 #line 6687 "configure"
6687 #include "confdefs.h"
6688 #include <sys/types.h>
6689 #if STDC_HEADERS
6690 #include <stdlib.h>
6691 #include <stddef.h>
6692 #endif
6693 EOF
6694 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6695   egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
6696   rm -rf conftest*
6697   ac_cv_type_pid_t=yes
6698 else
6699   rm -rf conftest*
6700   ac_cv_type_pid_t=no
6701 fi
6702 rm -f conftest*
6703
6704 fi
6705 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
6706 if test $ac_cv_type_pid_t = no; then
6707   cat >> confdefs.h <<\EOF
6708 #define pid_t int
6709 EOF
6710
6711 fi
6712
6713 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
6714 echo "configure:6715: checking for ptrdiff_t" >&5
6715 if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then
6716   echo $ac_n "(cached) $ac_c" 1>&6
6717 else
6718   cat > conftest.$ac_ext <<EOF
6719 #line 6720 "configure"
6720 #include "confdefs.h"
6721 #include <stddef.h>
6722 int main() {
6723 ptrdiff_t p
6724 ; return 0; }
6725 EOF
6726 if { (eval echo configure:6727: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6727   rm -rf conftest*
6728   am_cv_type_ptrdiff_t=yes
6729 else
6730   echo "configure: failed program was:" >&5
6731   cat conftest.$ac_ext >&5
6732   rm -rf conftest*
6733   am_cv_type_ptrdiff_t=no
6734 fi
6735 rm -f conftest*
6736 fi
6737
6738 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
6739    if test $am_cv_type_ptrdiff_t = yes; then
6740      cat >> confdefs.h <<\EOF
6741 #define HAVE_PTRDIFF_T 1
6742 EOF
6743
6744    fi
6745
6746 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
6747 echo "configure:6748: checking return type of signal handlers" >&5
6748 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
6749   echo $ac_n "(cached) $ac_c" 1>&6
6750 else
6751   cat > conftest.$ac_ext <<EOF
6752 #line 6753 "configure"
6753 #include "confdefs.h"
6754 #include <sys/types.h>
6755 #include <signal.h>
6756 #ifdef signal
6757 #undef signal
6758 #endif
6759 #ifdef __cplusplus
6760 extern "C" void (*signal (int, void (*)(int)))(int);
6761 #else
6762 void (*signal ()) ();
6763 #endif
6764
6765 int main() {
6766 int i;
6767 ; return 0; }
6768 EOF
6769 if { (eval echo configure:6770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6770   rm -rf conftest*
6771   ac_cv_type_signal=void
6772 else
6773   echo "configure: failed program was:" >&5
6774   cat conftest.$ac_ext >&5
6775   rm -rf conftest*
6776   ac_cv_type_signal=int
6777 fi
6778 rm -f conftest*
6779 fi
6780
6781 echo "$ac_t""$ac_cv_type_signal" 1>&6
6782 cat >> confdefs.h <<EOF
6783 #define RETSIGTYPE $ac_cv_type_signal
6784 EOF
6785
6786
6787 echo $ac_n "checking for size_t""... $ac_c" 1>&6
6788 echo "configure:6789: checking for size_t" >&5
6789 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
6790   echo $ac_n "(cached) $ac_c" 1>&6
6791 else
6792   cat > conftest.$ac_ext <<EOF
6793 #line 6794 "configure"
6794 #include "confdefs.h"
6795 #include <sys/types.h>
6796 #if STDC_HEADERS
6797 #include <stdlib.h>
6798 #include <stddef.h>
6799 #endif
6800 EOF
6801 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6802   egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
6803   rm -rf conftest*
6804   ac_cv_type_size_t=yes
6805 else
6806   rm -rf conftest*
6807   ac_cv_type_size_t=no
6808 fi
6809 rm -f conftest*
6810
6811 fi
6812 echo "$ac_t""$ac_cv_type_size_t" 1>&6
6813 if test $ac_cv_type_size_t = no; then
6814   cat >> confdefs.h <<\EOF
6815 #define size_t unsigned
6816 EOF
6817
6818 fi
6819
6820 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
6821 echo "configure:6822: checking for st_blksize in struct stat" >&5
6822 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
6823   echo $ac_n "(cached) $ac_c" 1>&6
6824 else
6825   cat > conftest.$ac_ext <<EOF
6826 #line 6827 "configure"
6827 #include "confdefs.h"
6828 #include <sys/types.h>
6829 #include <sys/stat.h>
6830 int main() {
6831 struct stat s; s.st_blksize;
6832 ; return 0; }
6833 EOF
6834 if { (eval echo configure:6835: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6835   rm -rf conftest*
6836   ac_cv_struct_st_blksize=yes
6837 else
6838   echo "configure: failed program was:" >&5
6839   cat conftest.$ac_ext >&5
6840   rm -rf conftest*
6841   ac_cv_struct_st_blksize=no
6842 fi
6843 rm -f conftest*
6844 fi
6845
6846 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
6847 if test $ac_cv_struct_st_blksize = yes; then
6848   cat >> confdefs.h <<\EOF
6849 #define HAVE_ST_BLKSIZE 1
6850 EOF
6851
6852 fi
6853
6854 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
6855 echo "configure:6856: checking whether time.h and sys/time.h may both be included" >&5
6856 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
6857   echo $ac_n "(cached) $ac_c" 1>&6
6858 else
6859   cat > conftest.$ac_ext <<EOF
6860 #line 6861 "configure"
6861 #include "confdefs.h"
6862 #include <sys/types.h>
6863 #include <sys/time.h>
6864 #include <time.h>
6865 int main() {
6866 struct tm *tp;
6867 ; return 0; }
6868 EOF
6869 if { (eval echo configure:6870: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6870   rm -rf conftest*
6871   ac_cv_header_time=yes
6872 else
6873   echo "configure: failed program was:" >&5
6874   cat conftest.$ac_ext >&5
6875   rm -rf conftest*
6876   ac_cv_header_time=no
6877 fi
6878 rm -f conftest*
6879 fi
6880
6881 echo "$ac_t""$ac_cv_header_time" 1>&6
6882 if test $ac_cv_header_time = yes; then
6883   cat >> confdefs.h <<\EOF
6884 #define TIME_WITH_SYS_TIME 1
6885 EOF
6886
6887 fi
6888
6889 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
6890 echo "configure:6891: checking whether struct tm is in sys/time.h or time.h" >&5
6891 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
6892   echo $ac_n "(cached) $ac_c" 1>&6
6893 else
6894   cat > conftest.$ac_ext <<EOF
6895 #line 6896 "configure"
6896 #include "confdefs.h"
6897 #include <sys/types.h>
6898 #include <time.h>
6899 int main() {
6900 struct tm *tp; tp->tm_sec;
6901 ; return 0; }
6902 EOF
6903 if { (eval echo configure:6904: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6904   rm -rf conftest*
6905   ac_cv_struct_tm=time.h
6906 else
6907   echo "configure: failed program was:" >&5
6908   cat conftest.$ac_ext >&5
6909   rm -rf conftest*
6910   ac_cv_struct_tm=sys/time.h
6911 fi
6912 rm -f conftest*
6913 fi
6914
6915 echo "$ac_t""$ac_cv_struct_tm" 1>&6
6916 if test $ac_cv_struct_tm = sys/time.h; then
6917   cat >> confdefs.h <<\EOF
6918 #define TM_IN_SYS_TIME 1
6919 EOF
6920
6921 fi
6922
6923
6924
6925 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
6926 echo "configure:6927: checking if toupper() requires islower()" >&5
6927 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
6928   echo $ac_n "(cached) $ac_c" 1>&6
6929 else
6930   
6931         if test "$cross_compiling" = yes; then
6932   ol_cv_c_upper_lower=safe
6933 else
6934   cat > conftest.$ac_ext <<EOF
6935 #line 6936 "configure"
6936 #include "confdefs.h"
6937
6938 #include <ctype.h>
6939 main()
6940 {
6941         if ('C' == toupper('C'))
6942                 exit(0);
6943         else
6944                 exit(1);
6945 }
6946 EOF
6947 if { (eval echo configure:6948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
6948 then
6949   ol_cv_c_upper_lower=no
6950 else
6951   echo "configure: failed program was:" >&5
6952   cat conftest.$ac_ext >&5
6953   rm -fr conftest*
6954   ol_cv_c_upper_lower=yes
6955 fi
6956 rm -fr conftest*
6957 fi
6958
6959 fi
6960
6961 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
6962 if test $ol_cv_c_upper_lower != no ; then
6963         cat >> confdefs.h <<\EOF
6964 #define C_UPPER_LOWER 1
6965 EOF
6966
6967 fi
6968
6969 echo $ac_n "checking for working const""... $ac_c" 1>&6
6970 echo "configure:6971: checking for working const" >&5
6971 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
6972   echo $ac_n "(cached) $ac_c" 1>&6
6973 else
6974   cat > conftest.$ac_ext <<EOF
6975 #line 6976 "configure"
6976 #include "confdefs.h"
6977
6978 int main() {
6979
6980 /* Ultrix mips cc rejects this.  */
6981 typedef int charset[2]; const charset x;
6982 /* SunOS 4.1.1 cc rejects this.  */
6983 char const *const *ccp;
6984 char **p;
6985 /* NEC SVR4.0.2 mips cc rejects this.  */
6986 struct point {int x, y;};
6987 static struct point const zero = {0,0};
6988 /* AIX XL C 1.02.0.0 rejects this.
6989    It does not let you subtract one const X* pointer from another in an arm
6990    of an if-expression whose if-part is not a constant expression */
6991 const char *g = "string";
6992 ccp = &g + (g ? g-g : 0);
6993 /* HPUX 7.0 cc rejects these. */
6994 ++ccp;
6995 p = (char**) ccp;
6996 ccp = (char const *const *) p;
6997 { /* SCO 3.2v4 cc rejects this.  */
6998   char *t;
6999   char const *s = 0 ? (char *) 0 : (char const *) 0;
7000
7001   *t++ = 0;
7002 }
7003 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
7004   int x[] = {25, 17};
7005   const int *foo = &x[0];
7006   ++foo;
7007 }
7008 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
7009   typedef const int *iptr;
7010   iptr p = 0;
7011   ++p;
7012 }
7013 { /* AIX XL C 1.02.0.0 rejects this saying
7014      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
7015   struct s { int j; const int *ap[3]; };
7016   struct s *b; b->j = 5;
7017 }
7018 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
7019   const int foo = 10;
7020 }
7021
7022 ; return 0; }
7023 EOF
7024 if { (eval echo configure:7025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7025   rm -rf conftest*
7026   ac_cv_c_const=yes
7027 else
7028   echo "configure: failed program was:" >&5
7029   cat conftest.$ac_ext >&5
7030   rm -rf conftest*
7031   ac_cv_c_const=no
7032 fi
7033 rm -f conftest*
7034 fi
7035
7036 echo "$ac_t""$ac_cv_c_const" 1>&6
7037 if test $ac_cv_c_const = no; then
7038   cat >> confdefs.h <<\EOF
7039 #define const 
7040 EOF
7041
7042 fi
7043
7044
7045 if test $cross_compiling = yes ; then
7046         cat >> confdefs.h <<\EOF
7047 #define CROSS_COMPILING 1
7048 EOF
7049
7050 else
7051         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
7052 echo "configure:7053: checking whether byte ordering is bigendian" >&5
7053 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
7054   echo $ac_n "(cached) $ac_c" 1>&6
7055 else
7056   ac_cv_c_bigendian=unknown
7057 # See if sys/param.h defines the BYTE_ORDER macro.
7058 cat > conftest.$ac_ext <<EOF
7059 #line 7060 "configure"
7060 #include "confdefs.h"
7061 #include <sys/types.h>
7062 #include <sys/param.h>
7063 int main() {
7064
7065 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
7066  bogus endian macros
7067 #endif
7068 ; return 0; }
7069 EOF
7070 if { (eval echo configure:7071: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7071   rm -rf conftest*
7072   # It does; now see whether it defined to BIG_ENDIAN or not.
7073 cat > conftest.$ac_ext <<EOF
7074 #line 7075 "configure"
7075 #include "confdefs.h"
7076 #include <sys/types.h>
7077 #include <sys/param.h>
7078 int main() {
7079
7080 #if BYTE_ORDER != BIG_ENDIAN
7081  not big endian
7082 #endif
7083 ; return 0; }
7084 EOF
7085 if { (eval echo configure:7086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7086   rm -rf conftest*
7087   ac_cv_c_bigendian=yes
7088 else
7089   echo "configure: failed program was:" >&5
7090   cat conftest.$ac_ext >&5
7091   rm -rf conftest*
7092   ac_cv_c_bigendian=no
7093 fi
7094 rm -f conftest*
7095 else
7096   echo "configure: failed program was:" >&5
7097   cat conftest.$ac_ext >&5
7098 fi
7099 rm -f conftest*
7100 if test $ac_cv_c_bigendian = unknown; then
7101 if test "$cross_compiling" = yes; then
7102     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
7103 else
7104   cat > conftest.$ac_ext <<EOF
7105 #line 7106 "configure"
7106 #include "confdefs.h"
7107 main () {
7108   /* Are we little or big endian?  From Harbison&Steele.  */
7109   union
7110   {
7111     long l;
7112     char c[sizeof (long)];
7113   } u;
7114   u.l = 1;
7115   exit (u.c[sizeof (long) - 1] == 1);
7116 }
7117 EOF
7118 if { (eval echo configure:7119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
7119 then
7120   ac_cv_c_bigendian=no
7121 else
7122   echo "configure: failed program was:" >&5
7123   cat conftest.$ac_ext >&5
7124   rm -fr conftest*
7125   ac_cv_c_bigendian=yes
7126 fi
7127 rm -fr conftest*
7128 fi
7129
7130 fi
7131 fi
7132
7133 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
7134 if test $ac_cv_c_bigendian = yes; then
7135   cat >> confdefs.h <<\EOF
7136 #define WORDS_BIGENDIAN 1
7137 EOF
7138
7139 fi
7140
7141         echo $ac_n "checking size of short""... $ac_c" 1>&6
7142 echo "configure:7143: checking size of short" >&5
7143 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
7144   echo $ac_n "(cached) $ac_c" 1>&6
7145 else
7146   if test "$cross_compiling" = yes; then
7147     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
7148 else
7149   cat > conftest.$ac_ext <<EOF
7150 #line 7151 "configure"
7151 #include "confdefs.h"
7152 #include <stdio.h>
7153 main()
7154 {
7155   FILE *f=fopen("conftestval", "w");
7156   if (!f) exit(1);
7157   fprintf(f, "%d\n", sizeof(short));
7158   exit(0);
7159 }
7160 EOF
7161 if { (eval echo configure:7162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
7162 then
7163   ac_cv_sizeof_short=`cat conftestval`
7164 else
7165   echo "configure: failed program was:" >&5
7166   cat conftest.$ac_ext >&5
7167   rm -fr conftest*
7168   ac_cv_sizeof_short=0
7169 fi
7170 rm -fr conftest*
7171 fi
7172
7173 fi
7174 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
7175 cat >> confdefs.h <<EOF
7176 #define SIZEOF_SHORT $ac_cv_sizeof_short
7177 EOF
7178
7179  
7180         echo $ac_n "checking size of int""... $ac_c" 1>&6
7181 echo "configure:7182: checking size of int" >&5
7182 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
7183   echo $ac_n "(cached) $ac_c" 1>&6
7184 else
7185   if test "$cross_compiling" = yes; then
7186     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
7187 else
7188   cat > conftest.$ac_ext <<EOF
7189 #line 7190 "configure"
7190 #include "confdefs.h"
7191 #include <stdio.h>
7192 main()
7193 {
7194   FILE *f=fopen("conftestval", "w");
7195   if (!f) exit(1);
7196   fprintf(f, "%d\n", sizeof(int));
7197   exit(0);
7198 }
7199 EOF
7200 if { (eval echo configure:7201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
7201 then
7202   ac_cv_sizeof_int=`cat conftestval`
7203 else
7204   echo "configure: failed program was:" >&5
7205   cat conftest.$ac_ext >&5
7206   rm -fr conftest*
7207   ac_cv_sizeof_int=0
7208 fi
7209 rm -fr conftest*
7210 fi
7211
7212 fi
7213 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
7214 cat >> confdefs.h <<EOF
7215 #define SIZEOF_INT $ac_cv_sizeof_int
7216 EOF
7217
7218  
7219         echo $ac_n "checking size of long""... $ac_c" 1>&6
7220 echo "configure:7221: checking size of long" >&5
7221 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
7222   echo $ac_n "(cached) $ac_c" 1>&6
7223 else
7224   if test "$cross_compiling" = yes; then
7225     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
7226 else
7227   cat > conftest.$ac_ext <<EOF
7228 #line 7229 "configure"
7229 #include "confdefs.h"
7230 #include <stdio.h>
7231 main()
7232 {
7233   FILE *f=fopen("conftestval", "w");
7234   if (!f) exit(1);
7235   fprintf(f, "%d\n", sizeof(long));
7236   exit(0);
7237 }
7238 EOF
7239 if { (eval echo configure:7240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
7240 then
7241   ac_cv_sizeof_long=`cat conftestval`
7242 else
7243   echo "configure: failed program was:" >&5
7244   cat conftest.$ac_ext >&5
7245   rm -fr conftest*
7246   ac_cv_sizeof_long=0
7247 fi
7248 rm -fr conftest*
7249 fi
7250
7251 fi
7252 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
7253 cat >> confdefs.h <<EOF
7254 #define SIZEOF_LONG $ac_cv_sizeof_long
7255 EOF
7256
7257
7258 fi
7259
7260 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
7261 echo "configure:7262: checking for 8-bit clean memcmp" >&5
7262 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
7263   echo $ac_n "(cached) $ac_c" 1>&6
7264 else
7265   if test "$cross_compiling" = yes; then
7266   ac_cv_func_memcmp_clean=no
7267 else
7268   cat > conftest.$ac_ext <<EOF
7269 #line 7270 "configure"
7270 #include "confdefs.h"
7271
7272 main()
7273 {
7274   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
7275   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
7276 }
7277
7278 EOF
7279 if { (eval echo configure:7280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
7280 then
7281   ac_cv_func_memcmp_clean=yes
7282 else
7283   echo "configure: failed program was:" >&5
7284   cat conftest.$ac_ext >&5
7285   rm -fr conftest*
7286   ac_cv_func_memcmp_clean=no
7287 fi
7288 rm -fr conftest*
7289 fi
7290
7291 fi
7292
7293 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
7294 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o"
7295
7296  for ac_hdr in sys/time.h unistd.h
7297 do
7298 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7299 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7300 echo "configure:7301: checking for $ac_hdr" >&5
7301 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7302   echo $ac_n "(cached) $ac_c" 1>&6
7303 else
7304   cat > conftest.$ac_ext <<EOF
7305 #line 7306 "configure"
7306 #include "confdefs.h"
7307 #include <$ac_hdr>
7308 EOF
7309 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7310 { (eval echo configure:7311: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7311 ac_err=`grep -v '^ *+' conftest.out`
7312 if test -z "$ac_err"; then
7313   rm -rf conftest*
7314   eval "ac_cv_header_$ac_safe=yes"
7315 else
7316   echo "$ac_err" >&5
7317   echo "configure: failed program was:" >&5
7318   cat conftest.$ac_ext >&5
7319   rm -rf conftest*
7320   eval "ac_cv_header_$ac_safe=no"
7321 fi
7322 rm -f conftest*
7323 fi
7324 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7325   echo "$ac_t""yes" 1>&6
7326     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7327   cat >> confdefs.h <<EOF
7328 #define $ac_tr_hdr 1
7329 EOF
7330  
7331 else
7332   echo "$ac_t""no" 1>&6
7333 fi
7334 done
7335
7336  for ac_func in alarm
7337 do
7338 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7339 echo "configure:7340: checking for $ac_func" >&5
7340 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
7341   echo $ac_n "(cached) $ac_c" 1>&6
7342 else
7343   cat > conftest.$ac_ext <<EOF
7344 #line 7345 "configure"
7345 #include "confdefs.h"
7346 /* System header to define __stub macros and hopefully few prototypes,
7347     which can conflict with char $ac_func(); below.  */
7348 #include <assert.h>
7349 /* Override any gcc2 internal prototype to avoid an error.  */
7350 /* We use char because int might match the return type of a gcc2
7351     builtin and then its argument prototype would still apply.  */
7352 char $ac_func();
7353
7354 int main() {
7355
7356 /* The GNU C library defines this for functions which it implements
7357     to always fail with ENOSYS.  Some functions are actually named
7358     something starting with __ and the normal name is an alias.  */
7359 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7360 choke me
7361 #else
7362 $ac_func();
7363 #endif
7364
7365 ; return 0; }
7366 EOF
7367 if { (eval echo configure:7368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7368   rm -rf conftest*
7369   eval "ac_cv_func_$ac_func=yes"
7370 else
7371   echo "configure: failed program was:" >&5
7372   cat conftest.$ac_ext >&5
7373   rm -rf conftest*
7374   eval "ac_cv_func_$ac_func=no"
7375 fi
7376 rm -f conftest*
7377 fi
7378
7379 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7380   echo "$ac_t""yes" 1>&6
7381     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7382   cat >> confdefs.h <<EOF
7383 #define $ac_tr_func 1
7384 EOF
7385  
7386 else
7387   echo "$ac_t""no" 1>&6
7388 fi
7389 done
7390
7391  echo $ac_n "checking for working mktime""... $ac_c" 1>&6
7392 echo "configure:7393: checking for working mktime" >&5
7393 if eval "test \"`echo '$''{'am_cv_func_working_mktime'+set}'`\" = set"; then
7394   echo $ac_n "(cached) $ac_c" 1>&6
7395 else
7396   if test "$cross_compiling" = yes; then
7397              am_cv_func_working_mktime=no
7398 else
7399   cat > conftest.$ac_ext <<EOF
7400 #line 7401 "configure"
7401 #include "confdefs.h"
7402 /* Test program from Paul Eggert (eggert@twinsun.com)
7403    and Tony Leneis (tony@plaza.ds.adp.com).  */
7404 #if TIME_WITH_SYS_TIME
7405 # include <sys/time.h>
7406 # include <time.h>
7407 #else
7408 # if HAVE_SYS_TIME_H
7409 #  include <sys/time.h>
7410 # else
7411 #  include <time.h>
7412 # endif
7413 #endif
7414
7415 #if HAVE_UNISTD_H
7416 # include <unistd.h>
7417 #endif
7418
7419 #if !HAVE_ALARM
7420 # define alarm(X) /* empty */
7421 #endif
7422
7423 /* Work around redefinition to rpl_putenv by other config tests.  */
7424 #undef putenv
7425
7426 static time_t time_t_max;
7427
7428 /* Values we'll use to set the TZ environment variable.  */
7429 static const char *const tz_strings[] = {
7430   (const char *) 0, "GMT0", "JST-9",
7431   "EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
7432 };
7433 #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
7434
7435 static void
7436 mktime_test (now)
7437      time_t now;
7438 {
7439   struct tm *lt;
7440   if ((lt = localtime (&now)) && mktime (lt) != now)
7441     exit (1);
7442   now = time_t_max - now;
7443   if ((lt = localtime (&now)) && mktime (lt) != now)
7444     exit (1);
7445 }
7446
7447 static void
7448 irix_6_4_bug ()
7449 {
7450   /* Based on code from Ariel Faigon.  */
7451   struct tm tm;
7452   tm.tm_year = 96;
7453   tm.tm_mon = 3;
7454   tm.tm_mday = 0;
7455   tm.tm_hour = 0;
7456   tm.tm_min = 0;
7457   tm.tm_sec = 0;
7458   tm.tm_isdst = -1;
7459   mktime (&tm);
7460   if (tm.tm_mon != 2 || tm.tm_mday != 31)
7461     exit (1);
7462 }
7463
7464 static void
7465 bigtime_test (j)
7466      int j;
7467 {
7468   struct tm tm;
7469   time_t now;
7470   tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
7471   /* This test makes some buggy mktime implementations loop.
7472      Give up after 10 seconds.  */
7473   alarm (10);
7474   now = mktime (&tm);
7475   alarm (0);
7476   if (now != (time_t) -1)
7477     {
7478       struct tm *lt = localtime (&now);
7479       if (! (lt
7480              && lt->tm_year == tm.tm_year
7481              && lt->tm_mon == tm.tm_mon
7482              && lt->tm_mday == tm.tm_mday
7483              && lt->tm_hour == tm.tm_hour
7484              && lt->tm_min == tm.tm_min
7485              && lt->tm_sec == tm.tm_sec
7486              && lt->tm_yday == tm.tm_yday
7487              && lt->tm_wday == tm.tm_wday
7488              && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
7489                   == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
7490         exit (1);
7491     }
7492 }
7493
7494 int
7495 main ()
7496 {
7497   time_t t, delta;
7498   int i, j;
7499
7500   for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
7501     continue;
7502   time_t_max--;
7503   delta = time_t_max / 997; /* a suitable prime number */
7504   for (i = 0; i < N_STRINGS; i++)
7505     {
7506       if (tz_strings[i])
7507         putenv (tz_strings[i]);
7508
7509       for (t = 0; t <= time_t_max - delta; t += delta)
7510         mktime_test (t);
7511       mktime_test ((time_t) 60 * 60);
7512       mktime_test ((time_t) 60 * 60 * 24);
7513
7514       for (j = 1; 0 < j; j *= 2)
7515         bigtime_test (j);
7516       bigtime_test (j - 1);
7517     }
7518   irix_6_4_bug ();
7519   exit (0);
7520 }
7521               
7522 EOF
7523 if { (eval echo configure:7524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
7524 then
7525              am_cv_func_working_mktime=yes
7526 else
7527   echo "configure: failed program was:" >&5
7528   cat conftest.$ac_ext >&5
7529   rm -fr conftest*
7530   am_cv_func_working_mktime=no
7531 fi
7532 rm -fr conftest*
7533 fi
7534
7535   
7536 fi
7537
7538 echo "$ac_t""$am_cv_func_working_mktime" 1>&6
7539   if test $am_cv_func_working_mktime = no; then
7540     LIBOBJS="$LIBOBJS mktime.o"
7541   fi
7542  echo $ac_n "checking for strftime""... $ac_c" 1>&6
7543 echo "configure:7544: checking for strftime" >&5
7544 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
7545   echo $ac_n "(cached) $ac_c" 1>&6
7546 else
7547   cat > conftest.$ac_ext <<EOF
7548 #line 7549 "configure"
7549 #include "confdefs.h"
7550 /* System header to define __stub macros and hopefully few prototypes,
7551     which can conflict with char strftime(); below.  */
7552 #include <assert.h>
7553 /* Override any gcc2 internal prototype to avoid an error.  */
7554 /* We use char because int might match the return type of a gcc2
7555     builtin and then its argument prototype would still apply.  */
7556 char strftime();
7557
7558 int main() {
7559
7560 /* The GNU C library defines this for functions which it implements
7561     to always fail with ENOSYS.  Some functions are actually named
7562     something starting with __ and the normal name is an alias.  */
7563 #if defined (__stub_strftime) || defined (__stub___strftime)
7564 choke me
7565 #else
7566 strftime();
7567 #endif
7568
7569 ; return 0; }
7570 EOF
7571 if { (eval echo configure:7572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7572   rm -rf conftest*
7573   eval "ac_cv_func_strftime=yes"
7574 else
7575   echo "configure: failed program was:" >&5
7576   cat conftest.$ac_ext >&5
7577   rm -rf conftest*
7578   eval "ac_cv_func_strftime=no"
7579 fi
7580 rm -f conftest*
7581 fi
7582
7583 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
7584   echo "$ac_t""yes" 1>&6
7585   cat >> confdefs.h <<\EOF
7586 #define HAVE_STRFTIME 1
7587 EOF
7588
7589 else
7590   echo "$ac_t""no" 1>&6
7591 # strftime is in -lintl on SCO UNIX.
7592 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
7593 echo "configure:7594: checking for strftime in -lintl" >&5
7594 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
7595 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7596   echo $ac_n "(cached) $ac_c" 1>&6
7597 else
7598   ac_save_LIBS="$LIBS"
7599 LIBS="-lintl  $LIBS"
7600 cat > conftest.$ac_ext <<EOF
7601 #line 7602 "configure"
7602 #include "confdefs.h"
7603 /* Override any gcc2 internal prototype to avoid an error.  */
7604 /* We use char because int might match the return type of a gcc2
7605     builtin and then its argument prototype would still apply.  */
7606 char strftime();
7607
7608 int main() {
7609 strftime()
7610 ; return 0; }
7611 EOF
7612 if { (eval echo configure:7613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7613   rm -rf conftest*
7614   eval "ac_cv_lib_$ac_lib_var=yes"
7615 else
7616   echo "configure: failed program was:" >&5
7617   cat conftest.$ac_ext >&5
7618   rm -rf conftest*
7619   eval "ac_cv_lib_$ac_lib_var=no"
7620 fi
7621 rm -f conftest*
7622 LIBS="$ac_save_LIBS"
7623
7624 fi
7625 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7626   echo "$ac_t""yes" 1>&6
7627   cat >> confdefs.h <<\EOF
7628 #define HAVE_STRFTIME 1
7629 EOF
7630
7631 LIBS="-lintl $LIBS"
7632 else
7633   echo "$ac_t""no" 1>&6
7634 fi
7635
7636 fi
7637
7638 echo $ac_n "checking for working strtod""... $ac_c" 1>&6
7639 echo "configure:7640: checking for working strtod" >&5
7640 if eval "test \"`echo '$''{'am_cv_func_strtod'+set}'`\" = set"; then
7641   echo $ac_n "(cached) $ac_c" 1>&6
7642 else
7643   if test "$cross_compiling" = yes; then
7644   am_cv_func_strtod=no
7645 else
7646   cat > conftest.$ac_ext <<EOF
7647 #line 7648 "configure"
7648 #include "confdefs.h"
7649
7650 double strtod ();
7651 int
7652 main()
7653 {
7654   {
7655     /* Some versions of Linux strtod mis-parse strings with leading '+'.  */
7656     char *string = " +69";
7657     char *term;
7658     double value;
7659     value = strtod (string, &term);
7660     if (value != 69 || term != (string + 4))
7661       exit (1);
7662   }
7663
7664   {
7665     /* Under Solaris 2.4, strtod returns the wrong value for the
7666        terminating character under some conditions.  */
7667     char *string = "NaN";
7668     char *term;
7669     strtod (string, &term);
7670     if (term != string && *(term - 1) == 0)
7671       exit (1);
7672   }
7673   exit (0);
7674 }
7675
7676 EOF
7677 if { (eval echo configure:7678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
7678 then
7679   am_cv_func_strtod=yes
7680 else
7681   echo "configure: failed program was:" >&5
7682   cat conftest.$ac_ext >&5
7683   rm -fr conftest*
7684   am_cv_func_strtod=no
7685 fi
7686 rm -fr conftest*
7687 fi
7688
7689 fi
7690
7691 echo "$ac_t""$am_cv_func_strtod" 1>&6
7692 test $am_cv_func_strtod = no && LIBOBJS="$LIBOBJS strtod.o"
7693 am_cv_func_strtod_needs_libm=no
7694 if test $am_cv_func_strtod = no; then
7695   for ac_func in pow
7696 do
7697 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7698 echo "configure:7699: checking for $ac_func" >&5
7699 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
7700   echo $ac_n "(cached) $ac_c" 1>&6
7701 else
7702   cat > conftest.$ac_ext <<EOF
7703 #line 7704 "configure"
7704 #include "confdefs.h"
7705 /* System header to define __stub macros and hopefully few prototypes,
7706     which can conflict with char $ac_func(); below.  */
7707 #include <assert.h>
7708 /* Override any gcc2 internal prototype to avoid an error.  */
7709 /* We use char because int might match the return type of a gcc2
7710     builtin and then its argument prototype would still apply.  */
7711 char $ac_func();
7712
7713 int main() {
7714
7715 /* The GNU C library defines this for functions which it implements
7716     to always fail with ENOSYS.  Some functions are actually named
7717     something starting with __ and the normal name is an alias.  */
7718 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7719 choke me
7720 #else
7721 $ac_func();
7722 #endif
7723
7724 ; return 0; }
7725 EOF
7726 if { (eval echo configure:7727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7727   rm -rf conftest*
7728   eval "ac_cv_func_$ac_func=yes"
7729 else
7730   echo "configure: failed program was:" >&5
7731   cat conftest.$ac_ext >&5
7732   rm -rf conftest*
7733   eval "ac_cv_func_$ac_func=no"
7734 fi
7735 rm -f conftest*
7736 fi
7737
7738 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7739   echo "$ac_t""yes" 1>&6
7740     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7741   cat >> confdefs.h <<EOF
7742 #define $ac_tr_func 1
7743 EOF
7744  
7745 else
7746   echo "$ac_t""no" 1>&6
7747 fi
7748 done
7749
7750   if test $ac_cv_func_pow = no; then
7751     echo $ac_n "checking for pow in -lm""... $ac_c" 1>&6
7752 echo "configure:7753: checking for pow in -lm" >&5
7753 ac_lib_var=`echo m'_'pow | sed 'y%./+-%__p_%'`
7754 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7755   echo $ac_n "(cached) $ac_c" 1>&6
7756 else
7757   ac_save_LIBS="$LIBS"
7758 LIBS="-lm  $LIBS"
7759 cat > conftest.$ac_ext <<EOF
7760 #line 7761 "configure"
7761 #include "confdefs.h"
7762 /* Override any gcc2 internal prototype to avoid an error.  */
7763 /* We use char because int might match the return type of a gcc2
7764     builtin and then its argument prototype would still apply.  */
7765 char pow();
7766
7767 int main() {
7768 pow()
7769 ; return 0; }
7770 EOF
7771 if { (eval echo configure:7772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7772   rm -rf conftest*
7773   eval "ac_cv_lib_$ac_lib_var=yes"
7774 else
7775   echo "configure: failed program was:" >&5
7776   cat conftest.$ac_ext >&5
7777   rm -rf conftest*
7778   eval "ac_cv_lib_$ac_lib_var=no"
7779 fi
7780 rm -f conftest*
7781 LIBS="$ac_save_LIBS"
7782
7783 fi
7784 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7785   echo "$ac_t""yes" 1>&6
7786   am_cv_func_strtod_needs_libm=yes
7787 else
7788   echo "$ac_t""no" 1>&6
7789 echo "configure: warning: can't find library containing definition of pow" 1>&2
7790 fi
7791
7792   fi
7793 fi
7794
7795 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
7796 echo "configure:7797: checking for vprintf" >&5
7797 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
7798   echo $ac_n "(cached) $ac_c" 1>&6
7799 else
7800   cat > conftest.$ac_ext <<EOF
7801 #line 7802 "configure"
7802 #include "confdefs.h"
7803 /* System header to define __stub macros and hopefully few prototypes,
7804     which can conflict with char vprintf(); below.  */
7805 #include <assert.h>
7806 /* Override any gcc2 internal prototype to avoid an error.  */
7807 /* We use char because int might match the return type of a gcc2
7808     builtin and then its argument prototype would still apply.  */
7809 char vprintf();
7810
7811 int main() {
7812
7813 /* The GNU C library defines this for functions which it implements
7814     to always fail with ENOSYS.  Some functions are actually named
7815     something starting with __ and the normal name is an alias.  */
7816 #if defined (__stub_vprintf) || defined (__stub___vprintf)
7817 choke me
7818 #else
7819 vprintf();
7820 #endif
7821
7822 ; return 0; }
7823 EOF
7824 if { (eval echo configure:7825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7825   rm -rf conftest*
7826   eval "ac_cv_func_vprintf=yes"
7827 else
7828   echo "configure: failed program was:" >&5
7829   cat conftest.$ac_ext >&5
7830   rm -rf conftest*
7831   eval "ac_cv_func_vprintf=no"
7832 fi
7833 rm -f conftest*
7834 fi
7835
7836 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
7837   echo "$ac_t""yes" 1>&6
7838   cat >> confdefs.h <<\EOF
7839 #define HAVE_VPRINTF 1
7840 EOF
7841
7842 else
7843   echo "$ac_t""no" 1>&6
7844 fi
7845
7846 if test "$ac_cv_func_vprintf" != yes; then
7847 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
7848 echo "configure:7849: checking for _doprnt" >&5
7849 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
7850   echo $ac_n "(cached) $ac_c" 1>&6
7851 else
7852   cat > conftest.$ac_ext <<EOF
7853 #line 7854 "configure"
7854 #include "confdefs.h"
7855 /* System header to define __stub macros and hopefully few prototypes,
7856     which can conflict with char _doprnt(); below.  */
7857 #include <assert.h>
7858 /* Override any gcc2 internal prototype to avoid an error.  */
7859 /* We use char because int might match the return type of a gcc2
7860     builtin and then its argument prototype would still apply.  */
7861 char _doprnt();
7862
7863 int main() {
7864
7865 /* The GNU C library defines this for functions which it implements
7866     to always fail with ENOSYS.  Some functions are actually named
7867     something starting with __ and the normal name is an alias.  */
7868 #if defined (__stub__doprnt) || defined (__stub____doprnt)
7869 choke me
7870 #else
7871 _doprnt();
7872 #endif
7873
7874 ; return 0; }
7875 EOF
7876 if { (eval echo configure:7877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7877   rm -rf conftest*
7878   eval "ac_cv_func__doprnt=yes"
7879 else
7880   echo "configure: failed program was:" >&5
7881   cat conftest.$ac_ext >&5
7882   rm -rf conftest*
7883   eval "ac_cv_func__doprnt=no"
7884 fi
7885 rm -f conftest*
7886 fi
7887
7888 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
7889   echo "$ac_t""yes" 1>&6
7890   cat >> confdefs.h <<\EOF
7891 #define HAVE_DOPRNT 1
7892 EOF
7893
7894 else
7895   echo "$ac_t""no" 1>&6
7896 fi
7897
7898 fi
7899
7900
7901 if test $ac_cv_func_vprintf = yes ; then
7902                 for ac_func in vsnprintf
7903 do
7904 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7905 echo "configure:7906: checking for $ac_func" >&5
7906 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
7907   echo $ac_n "(cached) $ac_c" 1>&6
7908 else
7909   cat > conftest.$ac_ext <<EOF
7910 #line 7911 "configure"
7911 #include "confdefs.h"
7912 /* System header to define __stub macros and hopefully few prototypes,
7913     which can conflict with char $ac_func(); below.  */
7914 #include <assert.h>
7915 /* Override any gcc2 internal prototype to avoid an error.  */
7916 /* We use char because int might match the return type of a gcc2
7917     builtin and then its argument prototype would still apply.  */
7918 char $ac_func();
7919
7920 int main() {
7921
7922 /* The GNU C library defines this for functions which it implements
7923     to always fail with ENOSYS.  Some functions are actually named
7924     something starting with __ and the normal name is an alias.  */
7925 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7926 choke me
7927 #else
7928 $ac_func();
7929 #endif
7930
7931 ; return 0; }
7932 EOF
7933 if { (eval echo configure:7934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7934   rm -rf conftest*
7935   eval "ac_cv_func_$ac_func=yes"
7936 else
7937   echo "configure: failed program was:" >&5
7938   cat conftest.$ac_ext >&5
7939   rm -rf conftest*
7940   eval "ac_cv_func_$ac_func=no"
7941 fi
7942 rm -f conftest*
7943 fi
7944
7945 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7946   echo "$ac_t""yes" 1>&6
7947     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7948   cat >> confdefs.h <<EOF
7949 #define $ac_tr_func 1
7950 EOF
7951  
7952 else
7953   echo "$ac_t""no" 1>&6
7954 fi
7955 done
7956
7957 fi
7958
7959 echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6
7960 echo "configure:7961: checking for wait3 that fills in rusage" >&5
7961 if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then
7962   echo $ac_n "(cached) $ac_c" 1>&6
7963 else
7964   if test "$cross_compiling" = yes; then
7965   ac_cv_func_wait3_rusage=no
7966 else
7967   cat > conftest.$ac_ext <<EOF
7968 #line 7969 "configure"
7969 #include "confdefs.h"
7970 #include <sys/types.h>
7971 #include <sys/time.h>
7972 #include <sys/resource.h>
7973 #include <stdio.h>
7974 /* HP-UX has wait3 but does not fill in rusage at all.  */
7975 main() {
7976   struct rusage r;
7977   int i;
7978   /* Use a field that we can force nonzero --
7979      voluntary context switches.
7980      For systems like NeXT and OSF/1 that don't set it,
7981      also use the system CPU time.  And page faults (I/O) for Linux.  */
7982   r.ru_nvcsw = 0;
7983   r.ru_stime.tv_sec = 0;
7984   r.ru_stime.tv_usec = 0;
7985   r.ru_majflt = r.ru_minflt = 0;
7986   switch (fork()) {
7987   case 0: /* Child.  */
7988     sleep(1); /* Give up the CPU.  */
7989     _exit(0);
7990   case -1: _exit(0); /* What can we do?  */
7991   default: /* Parent.  */
7992     wait3(&i, 0, &r);
7993     sleep(2); /* Avoid "text file busy" from rm on fast HP-UX machines.  */
7994     exit(r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0
7995          && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
7996   }
7997 }
7998 EOF
7999 if { (eval echo configure:8000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
8000 then
8001   ac_cv_func_wait3_rusage=yes
8002 else
8003   echo "configure: failed program was:" >&5
8004   cat conftest.$ac_ext >&5
8005   rm -fr conftest*
8006   ac_cv_func_wait3_rusage=no
8007 fi
8008 rm -fr conftest*
8009 fi
8010
8011 fi
8012
8013 echo "$ac_t""$ac_cv_func_wait3_rusage" 1>&6
8014 if test $ac_cv_func_wait3_rusage = yes; then
8015   cat >> confdefs.h <<\EOF
8016 #define HAVE_WAIT3 1
8017 EOF
8018
8019 fi
8020
8021
8022 for ac_func in \
8023         bcopy                   \
8024         flock                   \
8025         getdtablesize   \
8026         gethostname             \
8027         getpwuid                \
8028         gettimeofday    \
8029         lockf                   \
8030         memcpy                  \
8031         memmove                 \
8032         mkstemp                 \
8033         res_search              \
8034         select                  \
8035         setpwfile               \
8036         setsid                  \
8037         signal                  \
8038         sigset                  \
8039         snprintf                \
8040         socket                  \
8041         strerror                \
8042         strpbrk                 \
8043         strrchr                 \
8044         strsep                  \
8045         strstr                  \
8046         strtok                  \
8047         strtol                  \
8048         strtoul                 \
8049         sysconf                 \
8050         waitpid                 \
8051
8052 do
8053 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8054 echo "configure:8055: checking for $ac_func" >&5
8055 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
8056   echo $ac_n "(cached) $ac_c" 1>&6
8057 else
8058   cat > conftest.$ac_ext <<EOF
8059 #line 8060 "configure"
8060 #include "confdefs.h"
8061 /* System header to define __stub macros and hopefully few prototypes,
8062     which can conflict with char $ac_func(); below.  */
8063 #include <assert.h>
8064 /* Override any gcc2 internal prototype to avoid an error.  */
8065 /* We use char because int might match the return type of a gcc2
8066     builtin and then its argument prototype would still apply.  */
8067 char $ac_func();
8068
8069 int main() {
8070
8071 /* The GNU C library defines this for functions which it implements
8072     to always fail with ENOSYS.  Some functions are actually named
8073     something starting with __ and the normal name is an alias.  */
8074 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8075 choke me
8076 #else
8077 $ac_func();
8078 #endif
8079
8080 ; return 0; }
8081 EOF
8082 if { (eval echo configure:8083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8083   rm -rf conftest*
8084   eval "ac_cv_func_$ac_func=yes"
8085 else
8086   echo "configure: failed program was:" >&5
8087   cat conftest.$ac_ext >&5
8088   rm -rf conftest*
8089   eval "ac_cv_func_$ac_func=no"
8090 fi
8091 rm -f conftest*
8092 fi
8093
8094 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8095   echo "$ac_t""yes" 1>&6
8096     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8097   cat >> confdefs.h <<EOF
8098 #define $ac_tr_func 1
8099 EOF
8100  
8101 else
8102   echo "$ac_t""no" 1>&6
8103 fi
8104 done
8105
8106
8107 for ac_func in getopt strdup tempnam
8108 do
8109 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8110 echo "configure:8111: checking for $ac_func" >&5
8111 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
8112   echo $ac_n "(cached) $ac_c" 1>&6
8113 else
8114   cat > conftest.$ac_ext <<EOF
8115 #line 8116 "configure"
8116 #include "confdefs.h"
8117 /* System header to define __stub macros and hopefully few prototypes,
8118     which can conflict with char $ac_func(); below.  */
8119 #include <assert.h>
8120 /* Override any gcc2 internal prototype to avoid an error.  */
8121 /* We use char because int might match the return type of a gcc2
8122     builtin and then its argument prototype would still apply.  */
8123 char $ac_func();
8124
8125 int main() {
8126
8127 /* The GNU C library defines this for functions which it implements
8128     to always fail with ENOSYS.  Some functions are actually named
8129     something starting with __ and the normal name is an alias.  */
8130 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8131 choke me
8132 #else
8133 $ac_func();
8134 #endif
8135
8136 ; return 0; }
8137 EOF
8138 if { (eval echo configure:8139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8139   rm -rf conftest*
8140   eval "ac_cv_func_$ac_func=yes"
8141 else
8142   echo "configure: failed program was:" >&5
8143   cat conftest.$ac_ext >&5
8144   rm -rf conftest*
8145   eval "ac_cv_func_$ac_func=no"
8146 fi
8147 rm -f conftest*
8148 fi
8149
8150 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8151   echo "$ac_t""yes" 1>&6
8152     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8153   cat >> confdefs.h <<EOF
8154 #define $ac_tr_func 1
8155 EOF
8156  
8157 else
8158   echo "$ac_t""no" 1>&6
8159 LIBOBJS="$LIBOBJS ${ac_func}.o"
8160 fi
8161 done
8162
8163
8164
8165 # Check Configuration
8166
8167 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
8168 echo "configure:8169: checking declaration of sys_errlist" >&5
8169 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
8170   echo $ac_n "(cached) $ac_c" 1>&6
8171 else
8172   
8173         cat > conftest.$ac_ext <<EOF
8174 #line 8175 "configure"
8175 #include "confdefs.h"
8176
8177 #include <stdio.h>
8178 #include <sys/types.h>
8179 #include <errno.h> 
8180 int main() {
8181 char *c = (char *) *sys_errlist
8182 ; return 0; }
8183 EOF
8184 if { (eval echo configure:8185: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8185   rm -rf conftest*
8186   ol_cv_dcl_sys_errlist=yes
8187 else
8188   echo "configure: failed program was:" >&5
8189   cat conftest.$ac_ext >&5
8190   rm -rf conftest*
8191   ol_cv_dcl_sys_errlist=no
8192 fi
8193 rm -f conftest*
8194 fi
8195
8196 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
8197
8198 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
8199 if test $ol_cv_dcl_sys_errlist = no ; then
8200         cat >> confdefs.h <<\EOF
8201 #define DECL_SYS_ERRLIST 1
8202 EOF
8203
8204         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
8205 echo "configure:8206: checking existence of sys_errlist" >&5
8206         if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
8207   echo $ac_n "(cached) $ac_c" 1>&6
8208 else
8209   
8210                 cat > conftest.$ac_ext <<EOF
8211 #line 8212 "configure"
8212 #include "confdefs.h"
8213 #include <errno.h>
8214 int main() {
8215 char *c = (char *) *sys_errlist
8216 ; return 0; }
8217 EOF
8218 if { (eval echo configure:8219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8219   rm -rf conftest*
8220   ol_cv_have_sys_errlist=yes
8221 else
8222   echo "configure: failed program was:" >&5
8223   cat conftest.$ac_ext >&5
8224   rm -rf conftest*
8225   ol_cv_have_sys_errlist=no
8226 fi
8227 rm -f conftest*
8228 fi
8229
8230         echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
8231 fi
8232
8233
8234
8235 if test $ol_enable_debug != no ; then
8236         cat >> confdefs.h <<\EOF
8237 #define LDAP_DEBUG 1
8238 EOF
8239
8240 fi
8241 if test $ol_enable_libui = yes ; then
8242         cat >> confdefs.h <<\EOF
8243 #define LDAP_LIBUI 1
8244 EOF
8245
8246 fi
8247 if test $ol_enable_cache = no ; then
8248         cat >> confdefs.h <<\EOF
8249 #define LDAP_NOCACHE 1
8250 EOF
8251
8252 fi
8253 if test $ol_enable_dns != no ; then
8254         cat >> confdefs.h <<\EOF
8255 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS 1
8256 EOF
8257
8258 fi
8259 if test $ol_enable_proctitle != no ; then
8260         cat >> confdefs.h <<\EOF
8261 #define LDAP_PROCTITLE 1
8262 EOF
8263
8264 fi
8265 if test $ol_enable_referrals != no ; then
8266         cat >> confdefs.h <<\EOF
8267 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS 1
8268 EOF
8269
8270 fi
8271 if test $ol_enable_cldap != no ; then
8272         cat >> confdefs.h <<\EOF
8273 #define LDAP_CONNECTIONLESS 1
8274 EOF
8275
8276 fi
8277
8278 if test $ol_enable_aclgroups != no ; then
8279         cat >> confdefs.h <<\EOF
8280 #define SLAPD_ACLGROUPS 1
8281 EOF
8282
8283 fi
8284 if test $ol_enable_crypt != no ; then
8285         cat >> confdefs.h <<\EOF
8286 #define SLAPD_CRYPT 1
8287 EOF
8288
8289 fi
8290 if test $ol_enable_md5 != no ; then
8291         cat >> confdefs.h <<\EOF
8292 #define SLAPD_MD5 1
8293 EOF
8294
8295 fi
8296 if test $ol_enable_sha1 != no ; then
8297         cat >> confdefs.h <<\EOF
8298 #define SLAPD_SHA1 1
8299 EOF
8300
8301 fi
8302 if test $ol_enable_phonetic != no ; then
8303         cat >> confdefs.h <<\EOF
8304 #define SLAPD_PHONETIC 1
8305 EOF
8306
8307 fi
8308 if test $ol_enable_rlookups != no ; then
8309         cat >> confdefs.h <<\EOF
8310 #define SLAPD_RLOOKUPS 1
8311 EOF
8312
8313 fi
8314
8315 if test $ol_link_ldbm != no ; then
8316         cat >> confdefs.h <<\EOF
8317 #define SLAPD_LDBM 1
8318 EOF
8319
8320         BUILD_SLAPD=yes
8321         BUILD_LDBM=yes
8322 fi
8323
8324 if test $ol_enable_passwd != no ; then
8325         cat >> confdefs.h <<\EOF
8326 #define SLAPD_PASSWD 1
8327 EOF
8328
8329         BUILD_SLAPD=yes
8330         BUILD_PASSWD=yes
8331 fi
8332
8333 if test $ol_enable_shell != no ; then
8334         cat >> confdefs.h <<\EOF
8335 #define SLAPD_SHELL 1
8336 EOF
8337
8338         BUILD_SLAPD=yes
8339         BUILD_SHELL=yes
8340 fi
8341
8342 if test $ol_enable_slurpd != no -a $ol_link_threads != no -a \
8343         $BUILD_SLAPD = yes ; then
8344         BUILD_SLURPD=yes
8345 fi
8346
8347 if test $ol_link_isode != no ; then
8348         BUILD_LDAPD=yes
8349 fi
8350
8351
8352
8353
8354   
8355   
8356   
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372 trap '' 1 2 15
8373 cat > confcache <<\EOF
8374 # This file is a shell script that caches the results of configure
8375 # tests run on this system so they can be shared between configure
8376 # scripts and configure runs.  It is not useful on other systems.
8377 # If it contains results you don't want to keep, you may remove or edit it.
8378 #
8379 # By default, configure uses ./config.cache as the cache file,
8380 # creating it if it does not exist already.  You can give configure
8381 # the --cache-file=FILE option to use a different cache file; that is
8382 # what configure does when it calls configure scripts in
8383 # subdirectories, so they share the cache.
8384 # Giving --cache-file=/dev/null disables caching, for debugging configure.
8385 # config.status only pays attention to the cache file if you give it the
8386 # --recheck option to rerun configure.
8387 #
8388 EOF
8389 # The following way of writing the cache mishandles newlines in values,
8390 # but we know of no workaround that is simple, portable, and efficient.
8391 # So, don't put newlines in cache variables' values.
8392 # Ultrix sh set writes to stderr and can't be redirected directly,
8393 # and sets the high bit in the cache file unless we assign to the vars.
8394 (set) 2>&1 |
8395   case `(ac_space=' '; set) 2>&1` in
8396   *ac_space=\ *)
8397     # `set' does not quote correctly, so add quotes (double-quote substitution
8398     # turns \\\\ into \\, and sed turns \\ into \).
8399     sed -n \
8400       -e "s/'/'\\\\''/g" \
8401       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
8402     ;;
8403   *)
8404     # `set' quotes correctly as required by POSIX, so do not add quotes.
8405     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
8406     ;;
8407   esac >> confcache
8408 if cmp -s $cache_file confcache; then
8409   :
8410 else
8411   if test -w $cache_file; then
8412     echo "updating cache $cache_file"
8413     cat confcache > $cache_file
8414   else
8415     echo "not updating unwritable cache $cache_file"
8416   fi
8417 fi
8418 rm -f confcache
8419
8420 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
8421
8422 test "x$prefix" = xNONE && prefix=$ac_default_prefix
8423 # Let make expand exec_prefix.
8424 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
8425
8426 # Any assignment to VPATH causes Sun make to only execute
8427 # the first set of double-colon rules, so remove it if not needed.
8428 # If there is a colon in the path, we need to keep it.
8429 if test "x$srcdir" = x.; then
8430   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
8431 fi
8432
8433 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
8434
8435 DEFS=-DHAVE_CONFIG_H
8436
8437 # Without the "./", some shells look in PATH for config.status.
8438 : ${CONFIG_STATUS=./config.status}
8439
8440 echo creating $CONFIG_STATUS
8441 rm -f $CONFIG_STATUS
8442 cat > $CONFIG_STATUS <<EOF
8443 #! /bin/sh
8444 # Generated automatically by configure.
8445 # Run this file to recreate the current configuration.
8446 # This directory was configured as follows,
8447 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
8448 #
8449 # $0 $ac_configure_args
8450 #
8451 # Compiler output produced by configure, useful for debugging
8452 # configure, is in ./config.log if it exists.
8453
8454 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
8455 for ac_option
8456 do
8457   case "\$ac_option" in
8458   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
8459     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
8460     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
8461   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
8462     echo "$CONFIG_STATUS generated by autoconf version 2.12"
8463     exit 0 ;;
8464   -help | --help | --hel | --he | --h)
8465     echo "\$ac_cs_usage"; exit 0 ;;
8466   *) echo "\$ac_cs_usage"; exit 1 ;;
8467   esac
8468 done
8469
8470 ac_given_srcdir=$srcdir
8471 ac_given_INSTALL="$INSTALL"
8472
8473 trap 'rm -fr `echo "\
8474 Makefile:build/top.mk:Makefile.in:build/dir.mk \
8475 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
8476 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
8477 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
8478 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
8479 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
8480 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
8481 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
8482 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
8483 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
8484 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
8485 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
8486 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
8487 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
8488 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
8489 include/Makefile:build/top.mk:include/Makefile.in \
8490 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
8491 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
8492 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
8493 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
8494 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
8495 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
8496 libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk:build/lib-static.mk    \
8497 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
8498 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
8499 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
8500 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
8501 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
8502 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
8503 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
8504 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
8505 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
8506 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
8507 tests/Makefile:build/top.mk:tests/Makefile.in \
8508  include/portable.h include/ldap_features.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
8509 EOF
8510 cat >> $CONFIG_STATUS <<EOF
8511
8512 # Protect against being on the right side of a sed subst in config.status.
8513 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
8514  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
8515 $ac_vpsub
8516 $extrasub
8517 s%@CFLAGS@%$CFLAGS%g
8518 s%@CPPFLAGS@%$CPPFLAGS%g
8519 s%@CXXFLAGS@%$CXXFLAGS%g
8520 s%@DEFS@%$DEFS%g
8521 s%@LDFLAGS@%$LDFLAGS%g
8522 s%@LIBS@%$LIBS%g
8523 s%@exec_prefix@%$exec_prefix%g
8524 s%@prefix@%$prefix%g
8525 s%@program_transform_name@%$program_transform_name%g
8526 s%@bindir@%$bindir%g
8527 s%@sbindir@%$sbindir%g
8528 s%@libexecdir@%$libexecdir%g
8529 s%@datadir@%$datadir%g
8530 s%@sysconfdir@%$sysconfdir%g
8531 s%@sharedstatedir@%$sharedstatedir%g
8532 s%@localstatedir@%$localstatedir%g
8533 s%@libdir@%$libdir%g
8534 s%@includedir@%$includedir%g
8535 s%@oldincludedir@%$oldincludedir%g
8536 s%@infodir@%$infodir%g
8537 s%@mandir@%$mandir%g
8538 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
8539 s%@INSTALL_DATA@%$INSTALL_DATA%g
8540 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
8541 s%@PACKAGE@%$PACKAGE%g
8542 s%@VERSION@%$VERSION%g
8543 s%@ACLOCAL@%$ACLOCAL%g
8544 s%@AUTOCONF@%$AUTOCONF%g
8545 s%@AUTOMAKE@%$AUTOMAKE%g
8546 s%@AUTOHEADER@%$AUTOHEADER%g
8547 s%@MAKEINFO@%$MAKEINFO%g
8548 s%@SET_MAKE@%$SET_MAKE%g
8549 s%@top_builddir@%$top_builddir%g
8550 s%@host@%$host%g
8551 s%@host_alias@%$host_alias%g
8552 s%@host_cpu@%$host_cpu%g
8553 s%@host_vendor@%$host_vendor%g
8554 s%@host_os@%$host_os%g
8555 s%@RANLIB@%$RANLIB%g
8556 s%@CC@%$CC%g
8557 s%@LD@%$LD%g
8558 s%@NM@%$NM%g
8559 s%@LN_S@%$LN_S%g
8560 s%@LIBTOOL@%$LIBTOOL%g
8561 s%@SENDMAIL@%$SENDMAIL%g
8562 s%@EDITOR@%$EDITOR%g
8563 s%@FINGER@%$FINGER%g
8564 s%@CPP@%$CPP%g
8565 s%@PEPSY@%$PEPSY%g
8566 s%@LIBOBJS@%$LIBOBJS%g
8567 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
8568 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
8569 s%@BUILD_LDBM@%$BUILD_LDBM%g
8570 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
8571 s%@BUILD_SHELL@%$BUILD_SHELL%g
8572 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
8573 s%@LDAP_LIBS@%$LDAP_LIBS%g
8574 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
8575 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
8576 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
8577 s%@LDBM_LIBS@%$LDBM_LIBS%g
8578 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
8579 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
8580 s%@KRB_LIBS@%$KRB_LIBS%g
8581 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
8582
8583 CEOF
8584 EOF
8585
8586 cat >> $CONFIG_STATUS <<\EOF
8587
8588 # Split the substitutions into bite-sized pieces for seds with
8589 # small command number limits, like on Digital OSF/1 and HP-UX.
8590 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
8591 ac_file=1 # Number of current file.
8592 ac_beg=1 # First line for current file.
8593 ac_end=$ac_max_sed_cmds # Line after last line for current file.
8594 ac_more_lines=:
8595 ac_sed_cmds=""
8596 while $ac_more_lines; do
8597   if test $ac_beg -gt 1; then
8598     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
8599   else
8600     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
8601   fi
8602   if test ! -s conftest.s$ac_file; then
8603     ac_more_lines=false
8604     rm -f conftest.s$ac_file
8605   else
8606     if test -z "$ac_sed_cmds"; then
8607       ac_sed_cmds="sed -f conftest.s$ac_file"
8608     else
8609       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
8610     fi
8611     ac_file=`expr $ac_file + 1`
8612     ac_beg=$ac_end
8613     ac_end=`expr $ac_end + $ac_max_sed_cmds`
8614   fi
8615 done
8616 if test -z "$ac_sed_cmds"; then
8617   ac_sed_cmds=cat
8618 fi
8619 EOF
8620
8621 cat >> $CONFIG_STATUS <<EOF
8622
8623 CONFIG_FILES=\${CONFIG_FILES-"\
8624 Makefile:build/top.mk:Makefile.in:build/dir.mk \
8625 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
8626 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
8627 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
8628 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
8629 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
8630 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
8631 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
8632 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
8633 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
8634 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
8635 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
8636 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
8637 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
8638 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
8639 include/Makefile:build/top.mk:include/Makefile.in \
8640 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
8641 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
8642 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
8643 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
8644 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
8645 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
8646 libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk:build/lib-static.mk    \
8647 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
8648 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
8649 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
8650 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
8651 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
8652 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
8653 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
8654 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
8655 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
8656 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
8657 tests/Makefile:build/top.mk:tests/Makefile.in \
8658 "}
8659 EOF
8660 cat >> $CONFIG_STATUS <<\EOF
8661 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
8662   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
8663   case "$ac_file" in
8664   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
8665        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
8666   *) ac_file_in="${ac_file}.in" ;;
8667   esac
8668
8669   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
8670
8671   # Remove last slash and all that follows it.  Not all systems have dirname.
8672   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
8673   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
8674     # The file is in a subdirectory.
8675     test ! -d "$ac_dir" && mkdir "$ac_dir"
8676     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
8677     # A "../" for each directory in $ac_dir_suffix.
8678     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
8679   else
8680     ac_dir_suffix= ac_dots=
8681   fi
8682
8683   case "$ac_given_srcdir" in
8684   .)  srcdir=.
8685       if test -z "$ac_dots"; then top_srcdir=.
8686       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
8687   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
8688   *) # Relative path.
8689     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
8690     top_srcdir="$ac_dots$ac_given_srcdir" ;;
8691   esac
8692
8693   case "$ac_given_INSTALL" in
8694   [/$]*) INSTALL="$ac_given_INSTALL" ;;
8695   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
8696   esac
8697
8698   echo creating "$ac_file"
8699   rm -f "$ac_file"
8700   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
8701   case "$ac_file" in
8702   *Makefile*) ac_comsub="1i\\
8703 # $configure_input" ;;
8704   *) ac_comsub= ;;
8705   esac
8706
8707   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
8708   sed -e "$ac_comsub
8709 s%@configure_input@%$configure_input%g
8710 s%@srcdir@%$srcdir%g
8711 s%@top_srcdir@%$top_srcdir%g
8712 s%@INSTALL@%$INSTALL%g
8713 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
8714 fi; done
8715 rm -f conftest.s*
8716
8717 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
8718 # NAME is the cpp macro being defined and VALUE is the value it is being given.
8719 #
8720 # ac_d sets the value in "#define NAME VALUE" lines.
8721 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
8722 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
8723 ac_dC='\3'
8724 ac_dD='%g'
8725 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
8726 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
8727 ac_uB='\([      ]\)%\1#\2define\3'
8728 ac_uC=' '
8729 ac_uD='\4%g'
8730 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
8731 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
8732 ac_eB='$%\1#\2define\3'
8733 ac_eC=' '
8734 ac_eD='%g'
8735
8736 if test "${CONFIG_HEADERS+set}" != set; then
8737 EOF
8738 cat >> $CONFIG_STATUS <<EOF
8739   CONFIG_HEADERS="include/portable.h include/ldap_features.h"
8740 EOF
8741 cat >> $CONFIG_STATUS <<\EOF
8742 fi
8743 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
8744   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
8745   case "$ac_file" in
8746   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
8747        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
8748   *) ac_file_in="${ac_file}.in" ;;
8749   esac
8750
8751   echo creating $ac_file
8752
8753   rm -f conftest.frag conftest.in conftest.out
8754   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
8755   cat $ac_file_inputs > conftest.in
8756
8757 EOF
8758
8759 # Transform confdefs.h into a sed script conftest.vals that substitutes
8760 # the proper values into config.h.in to produce config.h.  And first:
8761 # Protect against being on the right side of a sed subst in config.status.
8762 # Protect against being in an unquoted here document in config.status.
8763 rm -f conftest.vals
8764 cat > conftest.hdr <<\EOF
8765 s/[\\&%]/\\&/g
8766 s%[\\$`]%\\&%g
8767 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
8768 s%ac_d%ac_u%gp
8769 s%ac_u%ac_e%gp
8770 EOF
8771 sed -n -f conftest.hdr confdefs.h > conftest.vals
8772 rm -f conftest.hdr
8773
8774 # This sed command replaces #undef with comments.  This is necessary, for
8775 # example, in the case of _POSIX_SOURCE, which is predefined and required
8776 # on some systems where configure will not decide to define it.
8777 cat >> conftest.vals <<\EOF
8778 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
8779 EOF
8780
8781 # Break up conftest.vals because some shells have a limit on
8782 # the size of here documents, and old seds have small limits too.
8783
8784 rm -f conftest.tail
8785 while :
8786 do
8787   ac_lines=`grep -c . conftest.vals`
8788   # grep -c gives empty output for an empty file on some AIX systems.
8789   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
8790   # Write a limited-size here document to conftest.frag.
8791   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
8792   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
8793   echo 'CEOF
8794   sed -f conftest.frag conftest.in > conftest.out
8795   rm -f conftest.in
8796   mv conftest.out conftest.in
8797 ' >> $CONFIG_STATUS
8798   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
8799   rm -f conftest.vals
8800   mv conftest.tail conftest.vals
8801 done
8802 rm -f conftest.vals
8803
8804 cat >> $CONFIG_STATUS <<\EOF
8805   rm -f conftest.frag conftest.h
8806   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
8807   cat conftest.in >> conftest.h
8808   rm -f conftest.in
8809   if cmp -s $ac_file conftest.h 2>/dev/null; then
8810     echo "$ac_file is unchanged"
8811     rm -f conftest.h
8812   else
8813     # Remove last slash and all that follows it.  Not all systems have dirname.
8814       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
8815       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
8816       # The file is in a subdirectory.
8817       test ! -d "$ac_dir" && mkdir "$ac_dir"
8818     fi
8819     rm -f $ac_file
8820     mv conftest.h $ac_file
8821   fi
8822 fi; done
8823
8824 EOF
8825 cat >> $CONFIG_STATUS <<EOF
8826
8827 EOF
8828 cat >> $CONFIG_STATUS <<\EOF
8829
8830 date > stamp-h
8831 echo Please \"make depend\" to build dependencies
8832
8833 exit 0
8834 EOF
8835 chmod +x $CONFIG_STATUS
8836 rm -fr confdefs* $ac_clean_files
8837 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
8838