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