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