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