]> git.sur5r.net Git - openldap/blob - configure
Apply Hallvard's D4 pthread detection patch.
[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  with TLS/SSL support (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 != no ; then
3819         
3820         for ac_hdr in ssl.h
3821 do
3822 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3823 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3824 echo "configure:3825: checking for $ac_hdr" >&5
3825 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3826   echo $ac_n "(cached) $ac_c" 1>&6
3827 else
3828   cat > conftest.$ac_ext <<EOF
3829 #line 3830 "configure"
3830 #include "confdefs.h"
3831 #include <$ac_hdr>
3832 EOF
3833 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3834 { (eval echo configure:3835: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3835 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3836 if test -z "$ac_err"; then
3837   rm -rf conftest*
3838   eval "ac_cv_header_$ac_safe=yes"
3839 else
3840   echo "$ac_err" >&5
3841   echo "configure: failed program was:" >&5
3842   cat conftest.$ac_ext >&5
3843   rm -rf conftest*
3844   eval "ac_cv_header_$ac_safe=no"
3845 fi
3846 rm -f conftest*
3847 fi
3848 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3849   echo "$ac_t""yes" 1>&6
3850     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3851   cat >> confdefs.h <<EOF
3852 #define $ac_tr_hdr 1
3853 EOF
3854  
3855 else
3856   echo "$ac_t""no" 1>&6
3857 fi
3858 done
3859
3860         
3861         if test $ac_cv_header_ssl_h = yes ; then
3862                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
3863 echo "configure:3864: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
3864 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-%__p_%'`
3865 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3866   echo $ac_n "(cached) $ac_c" 1>&6
3867 else
3868   ac_save_LIBS="$LIBS"
3869 LIBS="-lssl -lcrypto $LIBS"
3870 cat > conftest.$ac_ext <<EOF
3871 #line 3872 "configure"
3872 #include "confdefs.h"
3873 /* Override any gcc2 internal prototype to avoid an error.  */
3874 /* We use char because int might match the return type of a gcc2
3875     builtin and then its argument prototype would still apply.  */
3876 char SSLeay_add_ssl_algorithms();
3877
3878 int main() {
3879 SSLeay_add_ssl_algorithms()
3880 ; return 0; }
3881 EOF
3882 if { (eval echo configure:3883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3883   rm -rf conftest*
3884   eval "ac_cv_lib_$ac_lib_var=yes"
3885 else
3886   echo "configure: failed program was:" >&5
3887   cat conftest.$ac_ext >&5
3888   rm -rf conftest*
3889   eval "ac_cv_lib_$ac_lib_var=no"
3890 fi
3891 rm -f conftest*
3892 LIBS="$ac_save_LIBS"
3893
3894 fi
3895 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3896   echo "$ac_t""yes" 1>&6
3897   have_ssleay=yes
3898                         need_rsaref=no
3899 else
3900   echo "$ac_t""no" 1>&6
3901 have_ssleay=no
3902 fi
3903
3904                         
3905                 if test $have_ssleay = no ; then
3906                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
3907 echo "configure:3908: checking for ssl3_accept in -lssl" >&5
3908 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-%__p_%'`
3909 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3910   echo $ac_n "(cached) $ac_c" 1>&6
3911 else
3912   ac_save_LIBS="$LIBS"
3913 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
3914 cat > conftest.$ac_ext <<EOF
3915 #line 3916 "configure"
3916 #include "confdefs.h"
3917 /* Override any gcc2 internal prototype to avoid an error.  */
3918 /* We use char because int might match the return type of a gcc2
3919     builtin and then its argument prototype would still apply.  */
3920 char ssl3_accept();
3921
3922 int main() {
3923 ssl3_accept()
3924 ; return 0; }
3925 EOF
3926 if { (eval echo configure:3927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3927   rm -rf conftest*
3928   eval "ac_cv_lib_$ac_lib_var=yes"
3929 else
3930   echo "configure: failed program was:" >&5
3931   cat conftest.$ac_ext >&5
3932   rm -rf conftest*
3933   eval "ac_cv_lib_$ac_lib_var=no"
3934 fi
3935 rm -f conftest*
3936 LIBS="$ac_save_LIBS"
3937
3938 fi
3939 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3940   echo "$ac_t""yes" 1>&6
3941   have_ssleay=yes
3942                                 need_rsaref=yes
3943 else
3944   echo "$ac_t""no" 1>&6
3945 have_ssleay=no
3946 fi
3947
3948                 fi
3949
3950                 if test $have_ssleay = yes ; then
3951                         ol_with_tls=found
3952                         ol_link_tls=yes
3953
3954                         cat >> confdefs.h <<\EOF
3955 #define HAVE_SSLEAY 1
3956 EOF
3957
3958
3959                         if test $need_rsaref = yes; then
3960                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
3961                         else
3962                                 TLS_LIBS="-lssl -lcrypto"
3963                         fi
3964                 fi
3965         fi
3966 fi
3967
3968 if test $ol_link_tls = yes ; then
3969         cat >> confdefs.h <<\EOF
3970 #define HAVE_TLS 1
3971 EOF
3972
3973 fi      
3974
3975 ol_link_threads=no
3976 if test $ol_with_threads = auto -o $ol_with_threads = yes \
3977         -o $ol_with_threads = posix ; then
3978
3979         for ac_hdr in pthread.h sched.h
3980 do
3981 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3982 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3983 echo "configure:3984: checking for $ac_hdr" >&5
3984 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3985   echo $ac_n "(cached) $ac_c" 1>&6
3986 else
3987   cat > conftest.$ac_ext <<EOF
3988 #line 3989 "configure"
3989 #include "confdefs.h"
3990 #include <$ac_hdr>
3991 EOF
3992 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3993 { (eval echo configure:3994: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3994 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3995 if test -z "$ac_err"; then
3996   rm -rf conftest*
3997   eval "ac_cv_header_$ac_safe=yes"
3998 else
3999   echo "$ac_err" >&5
4000   echo "configure: failed program was:" >&5
4001   cat conftest.$ac_ext >&5
4002   rm -rf conftest*
4003   eval "ac_cv_header_$ac_safe=no"
4004 fi
4005 rm -f conftest*
4006 fi
4007 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4008   echo "$ac_t""yes" 1>&6
4009     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4010   cat >> confdefs.h <<EOF
4011 #define $ac_tr_hdr 1
4012 EOF
4013  
4014 else
4015   echo "$ac_t""no" 1>&6
4016 fi
4017 done
4018
4019
4020         if test $ac_cv_header_pthread_h = yes ; then
4021                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
4022 echo "configure:4023: checking POSIX thread version" >&5
4023 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
4024   echo $ac_n "(cached) $ac_c" 1>&6
4025 else
4026   
4027         cat > conftest.$ac_ext <<EOF
4028 #line 4029 "configure"
4029 #include "confdefs.h"
4030
4031 #               include <pthread.h>
4032                 /* this check could be improved */
4033 #               ifdef PTHREAD_ONCE_INIT
4034                         pthread_version_final
4035 #               endif
4036         
4037 EOF
4038 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4039   egrep "pthread_version_final" >/dev/null 2>&1; then
4040   rm -rf conftest*
4041   ol_pthread_final=yes
4042 else
4043   rm -rf conftest*
4044   ol_pthread_final=no
4045 fi
4046 rm -f conftest*
4047
4048
4049         cat > conftest.$ac_ext <<EOF
4050 #line 4051 "configure"
4051 #include "confdefs.h"
4052
4053 #               include <pthread.h>
4054                 /* this check could be improved */
4055 #               ifdef pthread_once_init
4056                         pthread_version_draft4
4057 #               endif
4058         
4059 EOF
4060 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4061   egrep "pthread_version_draft4" >/dev/null 2>&1; then
4062   rm -rf conftest*
4063   ol_pthread_draft4=yes
4064 else
4065   rm -rf conftest*
4066   ol_pthread_draft4=no
4067 fi
4068 rm -f conftest*
4069
4070
4071         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
4072                 ol_cv_pthread_version=final
4073         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
4074                 ol_cv_pthread_version=draft4
4075         else
4076                 ol_cv_pthread_version=unknown
4077         fi
4078
4079 fi
4080
4081 echo "$ac_t""$ol_cv_pthread_version" 1>&6
4082
4083
4084                 if test $ol_cv_pthread_version = final ; then
4085                         cat >> confdefs.h <<\EOF
4086 #define HAVE_PTHREADS_FINAL 1
4087 EOF
4088
4089                 elif test $ol_cv_pthread_version = draft4 ; then
4090                         cat >> confdefs.h <<\EOF
4091 #define HAVE_PTHREADS_D4 1
4092 EOF
4093
4094                 else
4095                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
4096                 fi
4097
4098                 # consider threads found
4099                 ol_with_threads=found
4100
4101                 
4102 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
4103 echo "configure:4104: checking for LinuxThreads" >&5
4104 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
4105   echo $ac_n "(cached) $ac_c" 1>&6
4106 else
4107   
4108         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
4109         if test "$res" -gt 0 ; then
4110                 ol_cv_linux_threads=yes
4111         else
4112                 ol_cv_linux_threads=no
4113         fi
4114
4115 fi
4116
4117 echo "$ac_t""$ol_cv_linux_threads" 1>&6
4118
4119
4120                 if test $ol_cv_linux_threads = yes ; then
4121                         cat >> confdefs.h <<\EOF
4122 #define HAVE_LINUX_THREADS 1
4123 EOF
4124
4125                 fi
4126
4127                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
4128                                 echo $ac_n "checking for pthread_create""... $ac_c" 1>&6
4129 echo "configure:4130: checking for pthread_create" >&5
4130 if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then
4131   echo $ac_n "(cached) $ac_c" 1>&6
4132 else
4133   cat > conftest.$ac_ext <<EOF
4134 #line 4135 "configure"
4135 #include "confdefs.h"
4136 /* System header to define __stub macros and hopefully few prototypes,
4137     which can conflict with char pthread_create(); below.  */
4138 #include <assert.h>
4139 /* Override any gcc2 internal prototype to avoid an error.  */
4140 /* We use char because int might match the return type of a gcc2
4141     builtin and then its argument prototype would still apply.  */
4142 char pthread_create();
4143
4144 int main() {
4145
4146 /* The GNU C library defines this for functions which it implements
4147     to always fail with ENOSYS.  Some functions are actually named
4148     something starting with __ and the normal name is an alias.  */
4149 #if defined (__stub_pthread_create) || defined (__stub___pthread_create)
4150 choke me
4151 #else
4152 pthread_create();
4153 #endif
4154
4155 ; return 0; }
4156 EOF
4157 if { (eval echo configure:4158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4158   rm -rf conftest*
4159   eval "ac_cv_func_pthread_create=yes"
4160 else
4161   echo "configure: failed program was:" >&5
4162   cat conftest.$ac_ext >&5
4163   rm -rf conftest*
4164   eval "ac_cv_func_pthread_create=no"
4165 fi
4166 rm -f conftest*
4167 fi
4168
4169 if eval "test \"`echo '$ac_cv_func_'pthread_create`\" = yes"; then
4170   echo "$ac_t""yes" 1>&6
4171   ol_link_threads=yes
4172 else
4173   echo "$ac_t""no" 1>&6
4174 fi
4175
4176
4177                 if test $ol_link_threads = no ; then
4178                                                 echo $ac_n "checking for pthread_create with -kthread""... $ac_c" 1>&6
4179 echo "configure:4180: checking for pthread_create with -kthread" >&5
4180 if eval "test \"`echo '$''{'ol_cv_kthread_flag'+set}'`\" = set"; then
4181   echo $ac_n "(cached) $ac_c" 1>&6
4182 else
4183   
4184                                                                 save_LIBS="$LIBS"
4185                                 LIBS="-kthread $LIBS"
4186                                 cat > conftest.$ac_ext <<EOF
4187 #line 4188 "configure"
4188 #include "confdefs.h"
4189 #include <pthread.h>
4190 int main() {
4191
4192 #if HAVE_PTHREADS_D4
4193         pthread_create(NULL,pthread_attr_default,NULL,NULL);
4194 #else
4195         pthread_create(NULL,NULL,NULL,NULL);
4196 #endif
4197
4198 ; return 0; }
4199 EOF
4200 if { (eval echo configure:4201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4201   rm -rf conftest*
4202   ol_cv_kthread_flag=yes
4203 else
4204   echo "configure: failed program was:" >&5
4205   cat conftest.$ac_ext >&5
4206   rm -rf conftest*
4207   ol_cv_kthread_flag=no
4208 fi
4209 rm -f conftest*
4210                                                                 LIBS="$save_LIBS"
4211                         
4212 fi
4213
4214 echo "$ac_t""$ol_cv_kthread_flag" 1>&6
4215
4216                         if test $ol_cv_kthread_flag = yes ; then
4217                                 LTHREAD_LIBS="$LTHREAD_LIBS -kthread"
4218                                 ol_link_threads=posix
4219                         fi
4220                 fi
4221
4222                 if test $ol_link_threads = no ; then
4223                                                 echo $ac_n "checking for pthread_create with -pthread""... $ac_c" 1>&6
4224 echo "configure:4225: checking for pthread_create with -pthread" >&5
4225 if eval "test \"`echo '$''{'ol_cv_pthread_flag'+set}'`\" = set"; then
4226   echo $ac_n "(cached) $ac_c" 1>&6
4227 else
4228   
4229                                                                 save_LIBS="$LIBS"
4230                                 LIBS="-pthread $LIBS"
4231                                 cat > conftest.$ac_ext <<EOF
4232 #line 4233 "configure"
4233 #include "confdefs.h"
4234 #include <pthread.h>
4235 int main() {
4236
4237 #if HAVE_PTHREADS_D4
4238         pthread_create(NULL,pthread_attr_default,NULL,NULL);
4239 #else
4240         pthread_create(NULL,NULL,NULL,NULL);
4241 #endif
4242
4243 ; return 0; }
4244 EOF
4245 if { (eval echo configure:4246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4246   rm -rf conftest*
4247   ol_cv_pthread_flag=yes
4248 else
4249   echo "configure: failed program was:" >&5
4250   cat conftest.$ac_ext >&5
4251   rm -rf conftest*
4252   ol_cv_pthread_flag=no
4253 fi
4254 rm -f conftest*
4255                                                                 LIBS="$save_LIBS"
4256                         
4257 fi
4258
4259 echo "$ac_t""$ol_cv_pthread_flag" 1>&6
4260
4261                         if test $ol_cv_pthread_flag = yes ; then
4262                                 LTHREAD_LIBS="$LTHREAD_LIBS -pthread"
4263                                 ol_link_threads=posix
4264                         fi
4265                 fi
4266
4267                 if test $ol_link_threads = no ; then
4268                                                 echo $ac_n "checking for pthread_create with -pthreads""... $ac_c" 1>&6
4269 echo "configure:4270: checking for pthread_create with -pthreads" >&5
4270 if eval "test \"`echo '$''{'ol_cv_pthreads_flag'+set}'`\" = set"; then
4271   echo $ac_n "(cached) $ac_c" 1>&6
4272 else
4273   
4274                                                                 save_LIBS="$LIBS"
4275                                 LIBS="-pthreads $LIBS"
4276                                 cat > conftest.$ac_ext <<EOF
4277 #line 4278 "configure"
4278 #include "confdefs.h"
4279 #include <pthread.h>
4280 int main() {
4281
4282 #if HAVE_PTHREADS_D4
4283         pthread_create(NULL,pthread_attr_default,NULL,NULL);
4284 #else
4285         pthread_create(NULL,NULL,NULL,NULL);
4286 #endif
4287
4288 ; return 0; }
4289 EOF
4290 if { (eval echo configure:4291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4291   rm -rf conftest*
4292   ol_cv_pthreads_flag=yes
4293 else
4294   echo "configure: failed program was:" >&5
4295   cat conftest.$ac_ext >&5
4296   rm -rf conftest*
4297   ol_cv_pthreads_flag=no
4298 fi
4299 rm -f conftest*
4300                                                                 LIBS="$save_LIBS"
4301                         
4302 fi
4303
4304 echo "$ac_t""$ol_cv_pthreads_flag" 1>&6
4305
4306                         if test $ol_cv_pthreads_flag = yes ; then
4307                                 LTHREAD_LIBS="$LTHREAD_LIBS -pthreads"
4308                                 ol_link_threads=posix
4309                         fi
4310                 fi
4311
4312                 if test $ol_link_threads = no ; then
4313                                                 echo $ac_n "checking for pthread_create with -thread""... $ac_c" 1>&6
4314 echo "configure:4315: checking for pthread_create with -thread" >&5
4315 if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
4316   echo $ac_n "(cached) $ac_c" 1>&6
4317 else
4318   
4319                                                                 save_LIBS="$LIBS"
4320                                 LIBS="-thread $LIBS"
4321                                 cat > conftest.$ac_ext <<EOF
4322 #line 4323 "configure"
4323 #include "confdefs.h"
4324 char pthread_create();
4325 int main() {
4326 pthread_create();
4327 ; return 0; }
4328 EOF
4329 if { (eval echo configure:4330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4330   rm -rf conftest*
4331   ol_cv_thread_flag=yes
4332 else
4333   echo "configure: failed program was:" >&5
4334   cat conftest.$ac_ext >&5
4335   rm -rf conftest*
4336   ol_cv_thread_flag=no
4337 fi
4338 rm -f conftest*
4339                                                                 LIBS="$save_LIBS"
4340                         
4341 fi
4342
4343 echo "$ac_t""$ol_cv_thread_flag" 1>&6
4344
4345                         if test $ol_cv_thread_flag = yes ; then
4346                                 LTHREAD_LIBS="$LTHREAD_LIBS -thread"
4347                                 ol_link_threads=posix
4348                         fi
4349                 fi
4350
4351                 if test $ol_link_threads = no ; then
4352                                                 echo $ac_n "checking for pthread_create with -mt""... $ac_c" 1>&6
4353 echo "configure:4354: checking for pthread_create with -mt" >&5
4354 if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
4355   echo $ac_n "(cached) $ac_c" 1>&6
4356 else
4357   
4358                                                                 save_LIBS="$LIBS"
4359                                 LIBS="-mt $LIBS"
4360                                 cat > conftest.$ac_ext <<EOF
4361 #line 4362 "configure"
4362 #include "confdefs.h"
4363 char pthread_create();
4364 int main() {
4365 pthread_create();
4366 ; return 0; }
4367 EOF
4368 if { (eval echo configure:4369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4369   rm -rf conftest*
4370   ol_cv_thread_flag=yes
4371 else
4372   echo "configure: failed program was:" >&5
4373   cat conftest.$ac_ext >&5
4374   rm -rf conftest*
4375   ol_cv_thread_flag=no
4376 fi
4377 rm -f conftest*
4378                                                                 LIBS="$save_LIBS"
4379                         
4380 fi
4381
4382 echo "$ac_t""$ol_cv_thread_flag" 1>&6
4383
4384                         if test $ol_cv_thread_flag = yes ; then
4385                                 LTHREAD_LIBS="$LTHREAD_LIBS -mt"
4386                                 ol_link_threads=posix
4387                         fi
4388                 fi
4389
4390                 if test $ol_link_threads = no ; then
4391                                                 save_LIBS="$LIBS"
4392                         echo $ac_n "checking for pthread_mutex_unlock in -lpthread""... $ac_c" 1>&6
4393 echo "configure:4394: checking for pthread_mutex_unlock in -lpthread" >&5
4394 ac_lib_var=`echo pthread'_'pthread_mutex_unlock | sed 'y%./+-%__p_%'`
4395 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4396   echo $ac_n "(cached) $ac_c" 1>&6
4397 else
4398   ac_save_LIBS="$LIBS"
4399 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
4400 cat > conftest.$ac_ext <<EOF
4401 #line 4402 "configure"
4402 #include "confdefs.h"
4403 /* Override any gcc2 internal prototype to avoid an error.  */
4404 /* We use char because int might match the return type of a gcc2
4405     builtin and then its argument prototype would still apply.  */
4406 char pthread_mutex_unlock();
4407
4408 int main() {
4409 pthread_mutex_unlock()
4410 ; return 0; }
4411 EOF
4412 if { (eval echo configure:4413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4413   rm -rf conftest*
4414   eval "ac_cv_lib_$ac_lib_var=yes"
4415 else
4416   echo "configure: failed program was:" >&5
4417   cat conftest.$ac_ext >&5
4418   rm -rf conftest*
4419   eval "ac_cv_lib_$ac_lib_var=no"
4420 fi
4421 rm -f conftest*
4422 LIBS="$ac_save_LIBS"
4423
4424 fi
4425 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4426   echo "$ac_t""yes" 1>&6
4427   
4428                                 ol_link_threads=posix
4429                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc -lc_r"
4430                                 if test $ol_with_yielding_select = auto ; then
4431                                         ol_with_yielding_select=yes
4432                                 fi
4433                                 
4434 else
4435   echo "$ac_t""no" 1>&6
4436 :
4437 fi
4438
4439                         LIBS="$save_LIBS"
4440                 fi
4441
4442                 if test $ol_link_threads = no ; then
4443                                                 save_LIBS="$LIBS"
4444                         echo $ac_n "checking for pthread_mutex_lock in -lpthread""... $ac_c" 1>&6
4445 echo "configure:4446: checking for pthread_mutex_lock in -lpthread" >&5
4446 ac_lib_var=`echo pthread'_'pthread_mutex_lock | sed 'y%./+-%__p_%'`
4447 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4448   echo $ac_n "(cached) $ac_c" 1>&6
4449 else
4450   ac_save_LIBS="$LIBS"
4451 LIBS="-lpthread -lmach -lexc $LIBS"
4452 cat > conftest.$ac_ext <<EOF
4453 #line 4454 "configure"
4454 #include "confdefs.h"
4455 /* Override any gcc2 internal prototype to avoid an error.  */
4456 /* We use char because int might match the return type of a gcc2
4457     builtin and then its argument prototype would still apply.  */
4458 char pthread_mutex_lock();
4459
4460 int main() {
4461 pthread_mutex_lock()
4462 ; return 0; }
4463 EOF
4464 if { (eval echo configure:4465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4465   rm -rf conftest*
4466   eval "ac_cv_lib_$ac_lib_var=yes"
4467 else
4468   echo "configure: failed program was:" >&5
4469   cat conftest.$ac_ext >&5
4470   rm -rf conftest*
4471   eval "ac_cv_lib_$ac_lib_var=no"
4472 fi
4473 rm -f conftest*
4474 LIBS="$ac_save_LIBS"
4475
4476 fi
4477 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4478   echo "$ac_t""yes" 1>&6
4479   
4480                                 ol_link_threads=posix
4481                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc"
4482                                 if test $ol_with_yielding_select = auto ; then
4483                                         ol_with_yielding_select=yes
4484                                 fi
4485                                 
4486 else
4487   echo "$ac_t""no" 1>&6
4488 :
4489 fi
4490
4491                         LIBS="$save_LIBS"
4492                 fi
4493
4494                 if test $ol_link_threads = no ; then
4495                                                 save_LIBS="$LIBS"
4496                         echo $ac_n "checking for pthread_mutex_trylock in -lpthread""... $ac_c" 1>&6
4497 echo "configure:4498: checking for pthread_mutex_trylock in -lpthread" >&5
4498 ac_lib_var=`echo pthread'_'pthread_mutex_trylock | sed 'y%./+-%__p_%'`
4499 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4500   echo $ac_n "(cached) $ac_c" 1>&6
4501 else
4502   ac_save_LIBS="$LIBS"
4503 LIBS="-lpthread -lexc $LIBS"
4504 cat > conftest.$ac_ext <<EOF
4505 #line 4506 "configure"
4506 #include "confdefs.h"
4507 /* Override any gcc2 internal prototype to avoid an error.  */
4508 /* We use char because int might match the return type of a gcc2
4509     builtin and then its argument prototype would still apply.  */
4510 char pthread_mutex_trylock();
4511
4512 int main() {
4513 pthread_mutex_trylock()
4514 ; return 0; }
4515 EOF
4516 if { (eval echo configure:4517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4517   rm -rf conftest*
4518   eval "ac_cv_lib_$ac_lib_var=yes"
4519 else
4520   echo "configure: failed program was:" >&5
4521   cat conftest.$ac_ext >&5
4522   rm -rf conftest*
4523   eval "ac_cv_lib_$ac_lib_var=no"
4524 fi
4525 rm -f conftest*
4526 LIBS="$ac_save_LIBS"
4527
4528 fi
4529 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4530   echo "$ac_t""yes" 1>&6
4531   
4532                                 ol_link_threads=posix
4533                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lexc"
4534                                 if test $ol_with_yielding_select = auto ; then
4535                                         ol_with_yielding_select=yes
4536                                 fi
4537                                 
4538 else
4539   echo "$ac_t""no" 1>&6
4540 :
4541 fi
4542
4543                         LIBS="$save_LIBS"
4544                 fi
4545
4546                 if test $ol_link_threads = no ; then
4547                                                 save_LIBS="$LIBS"
4548                         echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
4549 echo "configure:4550: checking for pthread_create in -lpthread" >&5
4550 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
4551 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4552   echo $ac_n "(cached) $ac_c" 1>&6
4553 else
4554   ac_save_LIBS="$LIBS"
4555 LIBS="-lpthread  $LIBS"
4556 cat > conftest.$ac_ext <<EOF
4557 #line 4558 "configure"
4558 #include "confdefs.h"
4559 /* Override any gcc2 internal prototype to avoid an error.  */
4560 /* We use char because int might match the return type of a gcc2
4561     builtin and then its argument prototype would still apply.  */
4562 char pthread_create();
4563
4564 int main() {
4565 pthread_create()
4566 ; return 0; }
4567 EOF
4568 if { (eval echo configure:4569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4569   rm -rf conftest*
4570   eval "ac_cv_lib_$ac_lib_var=yes"
4571 else
4572   echo "configure: failed program was:" >&5
4573   cat conftest.$ac_ext >&5
4574   rm -rf conftest*
4575   eval "ac_cv_lib_$ac_lib_var=no"
4576 fi
4577 rm -f conftest*
4578 LIBS="$ac_save_LIBS"
4579
4580 fi
4581 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4582   echo "$ac_t""yes" 1>&6
4583   
4584                                 ol_link_threads=posix
4585                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
4586 else
4587   echo "$ac_t""no" 1>&6
4588 :
4589 fi
4590
4591                         LIBS="$save_LIBS"
4592                 fi
4593
4594                 if test $ol_link_threads = no ; then
4595                                                 save_LIBS="$LIBS"
4596                         echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
4597 echo "configure:4598: checking for pthread_create in -lc_r" >&5
4598 ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
4599 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4600   echo $ac_n "(cached) $ac_c" 1>&6
4601 else
4602   ac_save_LIBS="$LIBS"
4603 LIBS="-lc_r  $LIBS"
4604 cat > conftest.$ac_ext <<EOF
4605 #line 4606 "configure"
4606 #include "confdefs.h"
4607 /* Override any gcc2 internal prototype to avoid an error.  */
4608 /* We use char because int might match the return type of a gcc2
4609     builtin and then its argument prototype would still apply.  */
4610 char pthread_create();
4611
4612 int main() {
4613 pthread_create()
4614 ; return 0; }
4615 EOF
4616 if { (eval echo configure:4617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4617   rm -rf conftest*
4618   eval "ac_cv_lib_$ac_lib_var=yes"
4619 else
4620   echo "configure: failed program was:" >&5
4621   cat conftest.$ac_ext >&5
4622   rm -rf conftest*
4623   eval "ac_cv_lib_$ac_lib_var=no"
4624 fi
4625 rm -f conftest*
4626 LIBS="$ac_save_LIBS"
4627
4628 fi
4629 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4630   echo "$ac_t""yes" 1>&6
4631   
4632                                 ol_link_threads=posix
4633                                 LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"
4634 else
4635   echo "$ac_t""no" 1>&6
4636 :
4637 fi
4638
4639                         LIBS="$save_LIBS"
4640                 fi
4641
4642                 if test $ol_link_threads = no ; then
4643                                                 save_LIBS="$LIBS"
4644                         echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
4645 echo "configure:4646: checking for pthread_create in -lpthreads" >&5
4646 ac_lib_var=`echo pthreads'_'pthread_create | sed 'y%./+-%__p_%'`
4647 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4648   echo $ac_n "(cached) $ac_c" 1>&6
4649 else
4650   ac_save_LIBS="$LIBS"
4651 LIBS="-lpthreads  $LIBS"
4652 cat > conftest.$ac_ext <<EOF
4653 #line 4654 "configure"
4654 #include "confdefs.h"
4655 /* Override any gcc2 internal prototype to avoid an error.  */
4656 /* We use char because int might match the return type of a gcc2
4657     builtin and then its argument prototype would still apply.  */
4658 char pthread_create();
4659
4660 int main() {
4661 pthread_create()
4662 ; return 0; }
4663 EOF
4664 if { (eval echo configure:4665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4665   rm -rf conftest*
4666   eval "ac_cv_lib_$ac_lib_var=yes"
4667 else
4668   echo "configure: failed program was:" >&5
4669   cat conftest.$ac_ext >&5
4670   rm -rf conftest*
4671   eval "ac_cv_lib_$ac_lib_var=no"
4672 fi
4673 rm -f conftest*
4674 LIBS="$ac_save_LIBS"
4675
4676 fi
4677 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4678   echo "$ac_t""yes" 1>&6
4679   
4680                                 ol_link_threads=posix
4681                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads"
4682 else
4683   echo "$ac_t""no" 1>&6
4684 :
4685 fi
4686
4687                         LIBS="$save_LIBS"
4688                 fi
4689
4690                                 if test $ol_link_threads = no ; then
4691                                                 save_LIBS="$LIBS"
4692                         echo $ac_n "checking for pthread_join in -lpthreads""... $ac_c" 1>&6
4693 echo "configure:4694: checking for pthread_join in -lpthreads" >&5
4694 ac_lib_var=`echo pthreads'_'pthread_join | sed 'y%./+-%__p_%'`
4695 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4696   echo $ac_n "(cached) $ac_c" 1>&6
4697 else
4698   ac_save_LIBS="$LIBS"
4699 LIBS="-lpthreads -Wl,-woff,85 $LIBS"
4700 cat > conftest.$ac_ext <<EOF
4701 #line 4702 "configure"
4702 #include "confdefs.h"
4703 /* Override any gcc2 internal prototype to avoid an error.  */
4704 /* We use char because int might match the return type of a gcc2
4705     builtin and then its argument prototype would still apply.  */
4706 char pthread_join();
4707
4708 int main() {
4709 pthread_join()
4710 ; return 0; }
4711 EOF
4712 if { (eval echo configure:4713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4713   rm -rf conftest*
4714   eval "ac_cv_lib_$ac_lib_var=yes"
4715 else
4716   echo "configure: failed program was:" >&5
4717   cat conftest.$ac_ext >&5
4718   rm -rf conftest*
4719   eval "ac_cv_lib_$ac_lib_var=no"
4720 fi
4721 rm -f conftest*
4722 LIBS="$ac_save_LIBS"
4723
4724 fi
4725 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4726   echo "$ac_t""yes" 1>&6
4727   
4728                                 ol_link_threads=posix
4729                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads"
4730                                 
4731 else
4732   echo "$ac_t""no" 1>&6
4733 :
4734 fi
4735
4736                         LIBS="$save_LIBS"
4737                 fi
4738
4739                 if test $ol_link_threads = no ; then
4740                                                 echo $ac_n "checking for pthread_create with -threads""... $ac_c" 1>&6
4741 echo "configure:4742: checking for pthread_create with -threads" >&5
4742 if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
4743   echo $ac_n "(cached) $ac_c" 1>&6
4744 else
4745   
4746                                                                 save_LIBS="$LIBS"
4747                                 LIBS="-threads $LIBS"
4748                                 cat > conftest.$ac_ext <<EOF
4749 #line 4750 "configure"
4750 #include "confdefs.h"
4751 char pthread_create();
4752 int main() {
4753
4754                                         pthread_create();
4755                                         
4756 ; return 0; }
4757 EOF
4758 if { (eval echo configure:4759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4759   rm -rf conftest*
4760   ol_cv_thread_flag=yes
4761 else
4762   echo "configure: failed program was:" >&5
4763   cat conftest.$ac_ext >&5
4764   rm -rf conftest*
4765   ol_cv_thread_flag=no
4766 fi
4767 rm -f conftest*
4768                                                                 LIBS="$save_LIBS"
4769                         
4770 fi
4771
4772 echo "$ac_t""$ol_cv_thread_flag" 1>&6
4773
4774                         if test $ol_cv_thread_flag = yes ; then
4775                                 LTHREAD_LIBS="$LTHREAD_LIBS -threads"
4776                                 ol_link_threads=posix
4777                         fi
4778                 fi
4779
4780                 if test $ol_link_threads = no ; then
4781                                                 save_LIBS="$LIBS"
4782                         echo $ac_n "checking for pthread_mutex_unlock in -lpthreads""... $ac_c" 1>&6
4783 echo "configure:4784: checking for pthread_mutex_unlock in -lpthreads" >&5
4784 ac_lib_var=`echo pthreads'_'pthread_mutex_unlock | sed 'y%./+-%__p_%'`
4785 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4786   echo $ac_n "(cached) $ac_c" 1>&6
4787 else
4788   ac_save_LIBS="$LIBS"
4789 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
4790 cat > conftest.$ac_ext <<EOF
4791 #line 4792 "configure"
4792 #include "confdefs.h"
4793 /* Override any gcc2 internal prototype to avoid an error.  */
4794 /* We use char because int might match the return type of a gcc2
4795     builtin and then its argument prototype would still apply.  */
4796 char pthread_mutex_unlock();
4797
4798 int main() {
4799 pthread_mutex_unlock()
4800 ; return 0; }
4801 EOF
4802 if { (eval echo configure:4803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4803   rm -rf conftest*
4804   eval "ac_cv_lib_$ac_lib_var=yes"
4805 else
4806   echo "configure: failed program was:" >&5
4807   cat conftest.$ac_ext >&5
4808   rm -rf conftest*
4809   eval "ac_cv_lib_$ac_lib_var=no"
4810 fi
4811 rm -f conftest*
4812 LIBS="$ac_save_LIBS"
4813
4814 fi
4815 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4816   echo "$ac_t""yes" 1>&6
4817   
4818                                 ol_link_threads=posix
4819                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc -lc_r"
4820                                 if test $ol_with_yielding_select = auto ; then
4821                                         ol_with_yielding_select=yes
4822                                 fi
4823                                 
4824 else
4825   echo "$ac_t""no" 1>&6
4826 :
4827 fi
4828
4829                         LIBS="$save_LIBS"
4830                 fi
4831
4832                 if test $ol_link_threads = no ; then
4833                                                 save_LIBS="$LIBS"
4834                         echo $ac_n "checking for pthread_mutex_lock in -lpthreads""... $ac_c" 1>&6
4835 echo "configure:4836: checking for pthread_mutex_lock in -lpthreads" >&5
4836 ac_lib_var=`echo pthreads'_'pthread_mutex_lock | sed 'y%./+-%__p_%'`
4837 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4838   echo $ac_n "(cached) $ac_c" 1>&6
4839 else
4840   ac_save_LIBS="$LIBS"
4841 LIBS="-lpthreads -lmach -lexc $LIBS"
4842 cat > conftest.$ac_ext <<EOF
4843 #line 4844 "configure"
4844 #include "confdefs.h"
4845 /* Override any gcc2 internal prototype to avoid an error.  */
4846 /* We use char because int might match the return type of a gcc2
4847     builtin and then its argument prototype would still apply.  */
4848 char pthread_mutex_lock();
4849
4850 int main() {
4851 pthread_mutex_lock()
4852 ; return 0; }
4853 EOF
4854 if { (eval echo configure:4855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4855   rm -rf conftest*
4856   eval "ac_cv_lib_$ac_lib_var=yes"
4857 else
4858   echo "configure: failed program was:" >&5
4859   cat conftest.$ac_ext >&5
4860   rm -rf conftest*
4861   eval "ac_cv_lib_$ac_lib_var=no"
4862 fi
4863 rm -f conftest*
4864 LIBS="$ac_save_LIBS"
4865
4866 fi
4867 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4868   echo "$ac_t""yes" 1>&6
4869   
4870                                 ol_link_threads=posix
4871                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc"
4872                                 if test $ol_with_yielding_select = auto ; then
4873                                         ol_with_yielding_select=yes
4874                                 fi
4875                                 
4876 else
4877   echo "$ac_t""no" 1>&6
4878 :
4879 fi
4880
4881                         LIBS="$save_LIBS"
4882                 fi
4883
4884                 if test $ol_link_threads = no ; then
4885                                                 save_LIBS="$LIBS"
4886                         echo $ac_n "checking for pthread_mutex_trylock in -lpthreads""... $ac_c" 1>&6
4887 echo "configure:4888: checking for pthread_mutex_trylock in -lpthreads" >&5
4888 ac_lib_var=`echo pthreads'_'pthread_mutex_trylock | sed 'y%./+-%__p_%'`
4889 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4890   echo $ac_n "(cached) $ac_c" 1>&6
4891 else
4892   ac_save_LIBS="$LIBS"
4893 LIBS="-lpthreads -lexc $LIBS"
4894 cat > conftest.$ac_ext <<EOF
4895 #line 4896 "configure"
4896 #include "confdefs.h"
4897 /* Override any gcc2 internal prototype to avoid an error.  */
4898 /* We use char because int might match the return type of a gcc2
4899     builtin and then its argument prototype would still apply.  */
4900 char pthread_mutex_trylock();
4901
4902 int main() {
4903 pthread_mutex_trylock()
4904 ; return 0; }
4905 EOF
4906 if { (eval echo configure:4907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4907   rm -rf conftest*
4908   eval "ac_cv_lib_$ac_lib_var=yes"
4909 else
4910   echo "configure: failed program was:" >&5
4911   cat conftest.$ac_ext >&5
4912   rm -rf conftest*
4913   eval "ac_cv_lib_$ac_lib_var=no"
4914 fi
4915 rm -f conftest*
4916 LIBS="$ac_save_LIBS"
4917
4918 fi
4919 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4920   echo "$ac_t""yes" 1>&6
4921   
4922                                 ol_link_threads=posix
4923                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lexc"
4924                                 if test $ol_with_yielding_select = auto ; then
4925                                         ol_with_yielding_select=yes
4926                                 fi
4927                                 
4928 else
4929   echo "$ac_t""no" 1>&6
4930 :
4931 fi
4932
4933                         LIBS="$save_LIBS"
4934                 fi
4935
4936                 if test $ol_link_threads != no ; then
4937                         cat >> confdefs.h <<\EOF
4938 #define HAVE_PTHREADS 1
4939 EOF
4940
4941
4942                                                 save_CPPFLAGS="$CPPFLAGS"
4943                         save_LIBS="$LIBS"
4944                         LIBS="$LTHREAD_LIBS $LIBS"
4945
4946                                                                                                 for ac_func in sched_yield pthread_yield
4947 do
4948 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4949 echo "configure:4950: checking for $ac_func" >&5
4950 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4951   echo $ac_n "(cached) $ac_c" 1>&6
4952 else
4953   cat > conftest.$ac_ext <<EOF
4954 #line 4955 "configure"
4955 #include "confdefs.h"
4956 /* System header to define __stub macros and hopefully few prototypes,
4957     which can conflict with char $ac_func(); below.  */
4958 #include <assert.h>
4959 /* Override any gcc2 internal prototype to avoid an error.  */
4960 /* We use char because int might match the return type of a gcc2
4961     builtin and then its argument prototype would still apply.  */
4962 char $ac_func();
4963
4964 int main() {
4965
4966 /* The GNU C library defines this for functions which it implements
4967     to always fail with ENOSYS.  Some functions are actually named
4968     something starting with __ and the normal name is an alias.  */
4969 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4970 choke me
4971 #else
4972 $ac_func();
4973 #endif
4974
4975 ; return 0; }
4976 EOF
4977 if { (eval echo configure:4978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4978   rm -rf conftest*
4979   eval "ac_cv_func_$ac_func=yes"
4980 else
4981   echo "configure: failed program was:" >&5
4982   cat conftest.$ac_ext >&5
4983   rm -rf conftest*
4984   eval "ac_cv_func_$ac_func=no"
4985 fi
4986 rm -f conftest*
4987 fi
4988
4989 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4990   echo "$ac_t""yes" 1>&6
4991     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4992   cat >> confdefs.h <<EOF
4993 #define $ac_tr_func 1
4994 EOF
4995  
4996 else
4997   echo "$ac_t""no" 1>&6
4998 fi
4999 done
5000
5001
5002                         if test $ac_cv_func_sched_yield = no -a \
5003                                 $ac_cv_func_pthread_yield = no ; then
5004                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
5005 echo "configure:5006: checking for sched_yield in -lrt" >&5
5006 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
5007 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5008   echo $ac_n "(cached) $ac_c" 1>&6
5009 else
5010   ac_save_LIBS="$LIBS"
5011 LIBS="-lrt  $LIBS"
5012 cat > conftest.$ac_ext <<EOF
5013 #line 5014 "configure"
5014 #include "confdefs.h"
5015 /* Override any gcc2 internal prototype to avoid an error.  */
5016 /* We use char because int might match the return type of a gcc2
5017     builtin and then its argument prototype would still apply.  */
5018 char sched_yield();
5019
5020 int main() {
5021 sched_yield()
5022 ; return 0; }
5023 EOF
5024 if { (eval echo configure:5025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5025   rm -rf conftest*
5026   eval "ac_cv_lib_$ac_lib_var=yes"
5027 else
5028   echo "configure: failed program was:" >&5
5029   cat conftest.$ac_ext >&5
5030   rm -rf conftest*
5031   eval "ac_cv_lib_$ac_lib_var=no"
5032 fi
5033 rm -f conftest*
5034 LIBS="$ac_save_LIBS"
5035
5036 fi
5037 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5038   echo "$ac_t""yes" 1>&6
5039   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
5040                                         cat >> confdefs.h <<\EOF
5041 #define HAVE_SCHED_YIELD 1
5042 EOF
5043
5044                                         ac_cv_func_sched_yield=yes
5045 else
5046   echo "$ac_t""no" 1>&6
5047 ac_cv_func_sched_yield=no
5048 fi
5049
5050                         fi
5051                         if test $ac_cv_func_sched_yield = no -a \
5052                                 $ac_cv_func_pthread_yield = no ; then
5053                                                                                                 for ac_func in thr_yield
5054 do
5055 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5056 echo "configure:5057: checking for $ac_func" >&5
5057 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5058   echo $ac_n "(cached) $ac_c" 1>&6
5059 else
5060   cat > conftest.$ac_ext <<EOF
5061 #line 5062 "configure"
5062 #include "confdefs.h"
5063 /* System header to define __stub macros and hopefully few prototypes,
5064     which can conflict with char $ac_func(); below.  */
5065 #include <assert.h>
5066 /* Override any gcc2 internal prototype to avoid an error.  */
5067 /* We use char because int might match the return type of a gcc2
5068     builtin and then its argument prototype would still apply.  */
5069 char $ac_func();
5070
5071 int main() {
5072
5073 /* The GNU C library defines this for functions which it implements
5074     to always fail with ENOSYS.  Some functions are actually named
5075     something starting with __ and the normal name is an alias.  */
5076 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5077 choke me
5078 #else
5079 $ac_func();
5080 #endif
5081
5082 ; return 0; }
5083 EOF
5084 if { (eval echo configure:5085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5085   rm -rf conftest*
5086   eval "ac_cv_func_$ac_func=yes"
5087 else
5088   echo "configure: failed program was:" >&5
5089   cat conftest.$ac_ext >&5
5090   rm -rf conftest*
5091   eval "ac_cv_func_$ac_func=no"
5092 fi
5093 rm -f conftest*
5094 fi
5095
5096 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5097   echo "$ac_t""yes" 1>&6
5098     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5099   cat >> confdefs.h <<EOF
5100 #define $ac_tr_func 1
5101 EOF
5102  
5103 else
5104   echo "$ac_t""no" 1>&6
5105 fi
5106 done
5107
5108                         fi
5109                         if test $ac_cv_func_sched_yield = no -a \
5110                                 $ac_cv_func_pthread_yield = no -a \
5111                                 "$ac_cv_func_thr_yield" = no ; then
5112                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
5113                         fi
5114
5115                                                 for ac_func in pthread_kill
5116 do
5117 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5118 echo "configure:5119: checking for $ac_func" >&5
5119 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5120   echo $ac_n "(cached) $ac_c" 1>&6
5121 else
5122   cat > conftest.$ac_ext <<EOF
5123 #line 5124 "configure"
5124 #include "confdefs.h"
5125 /* System header to define __stub macros and hopefully few prototypes,
5126     which can conflict with char $ac_func(); below.  */
5127 #include <assert.h>
5128 /* Override any gcc2 internal prototype to avoid an error.  */
5129 /* We use char because int might match the return type of a gcc2
5130     builtin and then its argument prototype would still apply.  */
5131 char $ac_func();
5132
5133 int main() {
5134
5135 /* The GNU C library defines this for functions which it implements
5136     to always fail with ENOSYS.  Some functions are actually named
5137     something starting with __ and the normal name is an alias.  */
5138 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5139 choke me
5140 #else
5141 $ac_func();
5142 #endif
5143
5144 ; return 0; }
5145 EOF
5146 if { (eval echo configure:5147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5147   rm -rf conftest*
5148   eval "ac_cv_func_$ac_func=yes"
5149 else
5150   echo "configure: failed program was:" >&5
5151   cat conftest.$ac_ext >&5
5152   rm -rf conftest*
5153   eval "ac_cv_func_$ac_func=no"
5154 fi
5155 rm -f conftest*
5156 fi
5157
5158 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5159   echo "$ac_t""yes" 1>&6
5160     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5161   cat >> confdefs.h <<EOF
5162 #define $ac_tr_func 1
5163 EOF
5164  
5165 else
5166   echo "$ac_t""no" 1>&6
5167 fi
5168 done
5169
5170
5171                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
5172 echo "configure:5173: checking for pthread_detach with <pthread.h>" >&5
5173 if eval "test \"`echo '$''{'ol_cv_func_pthread_detach'+set}'`\" = set"; then
5174   echo $ac_n "(cached) $ac_c" 1>&6
5175 else
5176   
5177                                                                 cat > conftest.$ac_ext <<EOF
5178 #line 5179 "configure"
5179 #include "confdefs.h"
5180 #include <pthread.h>
5181 int main() {
5182 pthread_detach(NULL);
5183 ; return 0; }
5184 EOF
5185 if { (eval echo configure:5186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5186   rm -rf conftest*
5187   ol_cv_func_pthread_detach=yes
5188 else
5189   echo "configure: failed program was:" >&5
5190   cat conftest.$ac_ext >&5
5191   rm -rf conftest*
5192   ol_cv_func_pthread_detach=no
5193 fi
5194 rm -f conftest*
5195                         
5196 fi
5197
5198 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
5199
5200                         if test $ol_cv_func_pthread_detach = no ; then
5201                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
5202                         fi
5203
5204                         cat >> confdefs.h <<\EOF
5205 #define HAVE_PTHREAD_DETACH 1
5206 EOF
5207
5208
5209                                                 for ac_func in \
5210                                 pthread_setconcurrency \
5211                                 pthread_getconcurrency \
5212                                 thr_setconcurrency \
5213                                 thr_getconcurrency \
5214                         
5215 do
5216 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5217 echo "configure:5218: checking for $ac_func" >&5
5218 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5219   echo $ac_n "(cached) $ac_c" 1>&6
5220 else
5221   cat > conftest.$ac_ext <<EOF
5222 #line 5223 "configure"
5223 #include "confdefs.h"
5224 /* System header to define __stub macros and hopefully few prototypes,
5225     which can conflict with char $ac_func(); below.  */
5226 #include <assert.h>
5227 /* Override any gcc2 internal prototype to avoid an error.  */
5228 /* We use char because int might match the return type of a gcc2
5229     builtin and then its argument prototype would still apply.  */
5230 char $ac_func();
5231
5232 int main() {
5233
5234 /* The GNU C library defines this for functions which it implements
5235     to always fail with ENOSYS.  Some functions are actually named
5236     something starting with __ and the normal name is an alias.  */
5237 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5238 choke me
5239 #else
5240 $ac_func();
5241 #endif
5242
5243 ; return 0; }
5244 EOF
5245 if { (eval echo configure:5246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5246   rm -rf conftest*
5247   eval "ac_cv_func_$ac_func=yes"
5248 else
5249   echo "configure: failed program was:" >&5
5250   cat conftest.$ac_ext >&5
5251   rm -rf conftest*
5252   eval "ac_cv_func_$ac_func=no"
5253 fi
5254 rm -f conftest*
5255 fi
5256
5257 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5258   echo "$ac_t""yes" 1>&6
5259     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5260   cat >> confdefs.h <<EOF
5261 #define $ac_tr_func 1
5262 EOF
5263  
5264 else
5265   echo "$ac_t""no" 1>&6
5266 fi
5267 done
5268
5269
5270                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
5271 echo "configure:5272: checking if pthread_create() works" >&5
5272                         if eval "test \"`echo '$''{'ol_cv_pthread_create_works'+set}'`\" = set"; then
5273   echo $ac_n "(cached) $ac_c" 1>&6
5274 else
5275   
5276                         if test "$cross_compiling" = yes; then
5277                                 ol_cv_pthread_create_works=yes
5278 else
5279   cat > conftest.$ac_ext <<EOF
5280 #line 5281 "configure"
5281 #include "confdefs.h"
5282
5283 #include <pthread.h>
5284 #ifndef NULL
5285 #define NULL (void*)0
5286 #endif
5287
5288 static void *task(p)
5289         void *p;
5290 {
5291         return (void *) (p == NULL);
5292 }
5293
5294 int main(argc, argv)
5295         int argc;
5296         char **argv;
5297 {
5298         pthread_t t;
5299 #if HAVE_PTHREADS_D4
5300         exit(pthread_create(&t, pthread_attr_default, task, NULL));
5301 #else
5302         exit(pthread_create(&t, NULL, task, NULL));
5303 #endif
5304 }
5305
5306 EOF
5307 if { (eval echo configure:5308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5308 then
5309   ol_cv_pthread_create_works=yes
5310 else
5311   echo "configure: failed program was:" >&5
5312   cat conftest.$ac_ext >&5
5313   rm -fr conftest*
5314   ol_cv_pthread_create_works=no
5315 fi
5316 rm -fr conftest*
5317 fi
5318
5319 fi
5320
5321                         echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
5322
5323                         if test $ol_cv_pthread_create_works = no ; then
5324                                 { echo "configure: error: pthread.h and pthread_create are not compatible" 1>&2; exit 1; }
5325                         fi
5326
5327                                                 if test $ol_with_yielding_select = auto ; then
5328                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
5329 echo "configure:5330: checking if select yields when using pthreads" >&5
5330                                 if eval "test \"`echo '$''{'ol_cv_pthread_select_yields'+set}'`\" = set"; then
5331   echo $ac_n "(cached) $ac_c" 1>&6
5332 else
5333   
5334                                 if test "$cross_compiling" = yes; then
5335   
5336                                 { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
5337 else
5338   cat > conftest.$ac_ext <<EOF
5339 #line 5340 "configure"
5340 #include "confdefs.h"
5341
5342 #include <sys/types.h>
5343 #include <sys/time.h>
5344 #include <unistd.h>
5345 #include <pthread.h>
5346 #ifndef NULL
5347 #define NULL (void*) 0
5348 #endif
5349
5350 static int fildes[2];
5351
5352 static void *task(p)
5353         void *p;
5354 {
5355         int i;
5356         struct timeval tv;
5357
5358         fd_set rfds;
5359
5360         tv.tv_sec=10;
5361         tv.tv_usec=0;
5362
5363         FD_ZERO(&rfds);
5364         FD_SET(fildes[0], &rfds);
5365
5366         /* we're not interested in any fds */
5367         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
5368
5369         if(i < 0) {
5370                 perror("select");
5371                 exit(10);
5372         }
5373
5374         exit(0); /* if we exit here, the select blocked the whole process */
5375 }
5376
5377 int main(argc, argv)
5378         int argc;
5379         char **argv;
5380 {
5381         pthread_t t;
5382
5383         /* create a pipe to select */
5384         if(pipe(&fildes[0])) {
5385                 perror("select");
5386                 exit(1);
5387         }
5388
5389 #ifdef HAVE_PTHREAD_SETCONCURRENCY
5390         (void) pthread_setconcurrency(2);
5391 #else
5392 #ifdef HAVE_THR_SETCONCURRENCY
5393         /* Set Solaris LWP concurrency to 2 */
5394         thr_setconcurrency(2);
5395 #endif
5396 #endif
5397
5398 #if HAVE_PTHREADS_D4
5399         pthread_create(&t, pthread_attr_default, task, NULL);
5400 #else
5401         pthread_create(&t, NULL, task, NULL);
5402 #endif
5403
5404 #if HAVE_SCHED_YIELD
5405         sched_yield();  /* make sure task runs first */
5406 #else
5407 #ifdef HAVE_PTHREAD_YIELD
5408         pthread_yield();        /* make sure task runs first */
5409 #endif
5410 #endif
5411
5412         exit(2);
5413 }
5414 EOF
5415 if { (eval echo configure:5416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5416 then
5417   ol_cv_pthread_select_yields=no
5418 else
5419   echo "configure: failed program was:" >&5
5420   cat conftest.$ac_ext >&5
5421   rm -fr conftest*
5422   ol_cv_pthread_select_yields=yes
5423 fi
5424 rm -fr conftest*
5425 fi
5426
5427 fi
5428
5429                                 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
5430
5431                                 if test $ol_cv_pthread_select_yields = yes ; then
5432                                         ol_with_yielding_select=yes
5433                                 fi
5434                         fi
5435
5436                                                 CPPFLAGS="$save_CPPFLAGS"
5437                         LIBS="$save_LIBS"
5438                 else
5439                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
5440                 fi
5441         fi
5442
5443         if test $ol_with_threads = posix ; then
5444                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
5445         fi
5446 fi
5447
5448 if test $ol_with_threads = auto -o $ol_with_threads = yes \
5449         -o $ol_with_threads = mach ; then
5450
5451                 for ac_hdr in mach/cthreads.h
5452 do
5453 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5454 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5455 echo "configure:5456: checking for $ac_hdr" >&5
5456 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5457   echo $ac_n "(cached) $ac_c" 1>&6
5458 else
5459   cat > conftest.$ac_ext <<EOF
5460 #line 5461 "configure"
5461 #include "confdefs.h"
5462 #include <$ac_hdr>
5463 EOF
5464 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5465 { (eval echo configure:5466: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5466 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5467 if test -z "$ac_err"; then
5468   rm -rf conftest*
5469   eval "ac_cv_header_$ac_safe=yes"
5470 else
5471   echo "$ac_err" >&5
5472   echo "configure: failed program was:" >&5
5473   cat conftest.$ac_ext >&5
5474   rm -rf conftest*
5475   eval "ac_cv_header_$ac_safe=no"
5476 fi
5477 rm -f conftest*
5478 fi
5479 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5480   echo "$ac_t""yes" 1>&6
5481     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5482   cat >> confdefs.h <<EOF
5483 #define $ac_tr_hdr 1
5484 EOF
5485  
5486 else
5487   echo "$ac_t""no" 1>&6
5488 fi
5489 done
5490
5491         if test $ac_cv_header_mach_cthreads_h = yes ; then
5492                 ol_with_threads=found
5493
5494                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
5495 echo "configure:5496: checking for cthread_fork" >&5
5496 if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
5497   echo $ac_n "(cached) $ac_c" 1>&6
5498 else
5499   cat > conftest.$ac_ext <<EOF
5500 #line 5501 "configure"
5501 #include "confdefs.h"
5502 /* System header to define __stub macros and hopefully few prototypes,
5503     which can conflict with char cthread_fork(); below.  */
5504 #include <assert.h>
5505 /* Override any gcc2 internal prototype to avoid an error.  */
5506 /* We use char because int might match the return type of a gcc2
5507     builtin and then its argument prototype would still apply.  */
5508 char cthread_fork();
5509
5510 int main() {
5511
5512 /* The GNU C library defines this for functions which it implements
5513     to always fail with ENOSYS.  Some functions are actually named
5514     something starting with __ and the normal name is an alias.  */
5515 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
5516 choke me
5517 #else
5518 cthread_fork();
5519 #endif
5520
5521 ; return 0; }
5522 EOF
5523 if { (eval echo configure:5524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5524   rm -rf conftest*
5525   eval "ac_cv_func_cthread_fork=yes"
5526 else
5527   echo "configure: failed program was:" >&5
5528   cat conftest.$ac_ext >&5
5529   rm -rf conftest*
5530   eval "ac_cv_func_cthread_fork=no"
5531 fi
5532 rm -f conftest*
5533 fi
5534
5535 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
5536   echo "$ac_t""yes" 1>&6
5537   ol_link_threads=yes
5538 else
5539   echo "$ac_t""no" 1>&6
5540 fi
5541
5542
5543                 if test $ol_link_threads = no ; then
5544                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
5545 echo "configure:5546: checking for cthread_fork with -all_load" >&5
5546 if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
5547   echo $ac_n "(cached) $ac_c" 1>&6
5548 else
5549   
5550                                                                 save_LIBS="$LIBS"
5551                                 LIBS="-all_load $LIBS"
5552                                 cat > conftest.$ac_ext <<EOF
5553 #line 5554 "configure"
5554 #include "confdefs.h"
5555 #include <mach/cthreads.h>
5556 int main() {
5557
5558                                         cthread_fork((void *)0, (void *)0);
5559                                         
5560 ; return 0; }
5561 EOF
5562 if { (eval echo configure:5563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5563   rm -rf conftest*
5564   ol_cv_cthread_all_load=yes
5565 else
5566   echo "configure: failed program was:" >&5
5567   cat conftest.$ac_ext >&5
5568   rm -rf conftest*
5569   ol_cv_cthread_all_load=no
5570 fi
5571 rm -f conftest*
5572                                                                 LIBS="$save_LIBS"
5573                         
5574 fi
5575
5576 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
5577
5578                         if test $ol_cv_cthread_all_load = yes ; then
5579                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
5580                                 ol_link_threads=mach
5581                         fi
5582                 fi
5583
5584                 if test $ol_link_threads != no ; then
5585                         : check for cthread specific functionality here
5586                         cat >> confdefs.h <<\EOF
5587 #define HAVE_MACH_CTHREADS 1
5588 EOF
5589
5590                 else
5591                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
5592                 fi
5593         fi
5594
5595         if test $ol_with_threads = mach ; then
5596                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
5597         fi
5598 fi
5599
5600 if test $ol_with_threads = auto -o $ol_with_threads = yes \
5601         -o $ol_with_threads = lwp ; then
5602
5603                 for ac_hdr in thread.h synch.h
5604 do
5605 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5606 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5607 echo "configure:5608: checking for $ac_hdr" >&5
5608 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5609   echo $ac_n "(cached) $ac_c" 1>&6
5610 else
5611   cat > conftest.$ac_ext <<EOF
5612 #line 5613 "configure"
5613 #include "confdefs.h"
5614 #include <$ac_hdr>
5615 EOF
5616 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5617 { (eval echo configure:5618: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5618 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5619 if test -z "$ac_err"; then
5620   rm -rf conftest*
5621   eval "ac_cv_header_$ac_safe=yes"
5622 else
5623   echo "$ac_err" >&5
5624   echo "configure: failed program was:" >&5
5625   cat conftest.$ac_ext >&5
5626   rm -rf conftest*
5627   eval "ac_cv_header_$ac_safe=no"
5628 fi
5629 rm -f conftest*
5630 fi
5631 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5632   echo "$ac_t""yes" 1>&6
5633     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5634   cat >> confdefs.h <<EOF
5635 #define $ac_tr_hdr 1
5636 EOF
5637  
5638 else
5639   echo "$ac_t""no" 1>&6
5640 fi
5641 done
5642
5643         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
5644                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
5645 echo "configure:5646: checking for thr_create in -lthread" >&5
5646 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
5647 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5648   echo $ac_n "(cached) $ac_c" 1>&6
5649 else
5650   ac_save_LIBS="$LIBS"
5651 LIBS="-lthread  $LIBS"
5652 cat > conftest.$ac_ext <<EOF
5653 #line 5654 "configure"
5654 #include "confdefs.h"
5655 /* Override any gcc2 internal prototype to avoid an error.  */
5656 /* We use char because int might match the return type of a gcc2
5657     builtin and then its argument prototype would still apply.  */
5658 char thr_create();
5659
5660 int main() {
5661 thr_create()
5662 ; return 0; }
5663 EOF
5664 if { (eval echo configure:5665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5665   rm -rf conftest*
5666   eval "ac_cv_lib_$ac_lib_var=yes"
5667 else
5668   echo "configure: failed program was:" >&5
5669   cat conftest.$ac_ext >&5
5670   rm -rf conftest*
5671   eval "ac_cv_lib_$ac_lib_var=no"
5672 fi
5673 rm -f conftest*
5674 LIBS="$ac_save_LIBS"
5675
5676 fi
5677 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5678   echo "$ac_t""yes" 1>&6
5679   have_thr=yes
5680 else
5681   echo "$ac_t""no" 1>&6
5682 have_thr=no
5683 fi
5684
5685
5686                 if test $have_thr = yes ; then
5687                         cat >> confdefs.h <<\EOF
5688 #define HAVE_THR 1
5689 EOF
5690
5691                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
5692                         ol_link_threads=thr
5693
5694                         if test $ol_with_yielding_select = auto ; then
5695                                 ol_with_yielding_select=yes
5696                         fi
5697
5698                                                 for ac_func in \
5699                                 thr_setconcurrency \
5700                                 thr_getconcurrency \
5701                         
5702 do
5703 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5704 echo "configure:5705: checking for $ac_func" >&5
5705 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5706   echo $ac_n "(cached) $ac_c" 1>&6
5707 else
5708   cat > conftest.$ac_ext <<EOF
5709 #line 5710 "configure"
5710 #include "confdefs.h"
5711 /* System header to define __stub macros and hopefully few prototypes,
5712     which can conflict with char $ac_func(); below.  */
5713 #include <assert.h>
5714 /* Override any gcc2 internal prototype to avoid an error.  */
5715 /* We use char because int might match the return type of a gcc2
5716     builtin and then its argument prototype would still apply.  */
5717 char $ac_func();
5718
5719 int main() {
5720
5721 /* The GNU C library defines this for functions which it implements
5722     to always fail with ENOSYS.  Some functions are actually named
5723     something starting with __ and the normal name is an alias.  */
5724 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5725 choke me
5726 #else
5727 $ac_func();
5728 #endif
5729
5730 ; return 0; }
5731 EOF
5732 if { (eval echo configure:5733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5733   rm -rf conftest*
5734   eval "ac_cv_func_$ac_func=yes"
5735 else
5736   echo "configure: failed program was:" >&5
5737   cat conftest.$ac_ext >&5
5738   rm -rf conftest*
5739   eval "ac_cv_func_$ac_func=no"
5740 fi
5741 rm -f conftest*
5742 fi
5743
5744 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5745   echo "$ac_t""yes" 1>&6
5746     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5747   cat >> confdefs.h <<EOF
5748 #define $ac_tr_func 1
5749 EOF
5750  
5751 else
5752   echo "$ac_t""no" 1>&6
5753 fi
5754 done
5755
5756                 fi
5757         fi
5758
5759                 for ac_hdr in lwp/lwp.h
5760 do
5761 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5762 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5763 echo "configure:5764: checking for $ac_hdr" >&5
5764 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5765   echo $ac_n "(cached) $ac_c" 1>&6
5766 else
5767   cat > conftest.$ac_ext <<EOF
5768 #line 5769 "configure"
5769 #include "confdefs.h"
5770 #include <$ac_hdr>
5771 EOF
5772 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5773 { (eval echo configure:5774: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5774 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5775 if test -z "$ac_err"; then
5776   rm -rf conftest*
5777   eval "ac_cv_header_$ac_safe=yes"
5778 else
5779   echo "$ac_err" >&5
5780   echo "configure: failed program was:" >&5
5781   cat conftest.$ac_ext >&5
5782   rm -rf conftest*
5783   eval "ac_cv_header_$ac_safe=no"
5784 fi
5785 rm -f conftest*
5786 fi
5787 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5788   echo "$ac_t""yes" 1>&6
5789     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5790   cat >> confdefs.h <<EOF
5791 #define $ac_tr_hdr 1
5792 EOF
5793  
5794 else
5795   echo "$ac_t""no" 1>&6
5796 fi
5797 done
5798
5799         if test $ac_cv_header_lwp_lwp_h = yes ; then
5800                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
5801 echo "configure:5802: checking for lwp_create in -llwp" >&5
5802 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
5803 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5804   echo $ac_n "(cached) $ac_c" 1>&6
5805 else
5806   ac_save_LIBS="$LIBS"
5807 LIBS="-llwp  $LIBS"
5808 cat > conftest.$ac_ext <<EOF
5809 #line 5810 "configure"
5810 #include "confdefs.h"
5811 /* Override any gcc2 internal prototype to avoid an error.  */
5812 /* We use char because int might match the return type of a gcc2
5813     builtin and then its argument prototype would still apply.  */
5814 char lwp_create();
5815
5816 int main() {
5817 lwp_create()
5818 ; return 0; }
5819 EOF
5820 if { (eval echo configure:5821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5821   rm -rf conftest*
5822   eval "ac_cv_lib_$ac_lib_var=yes"
5823 else
5824   echo "configure: failed program was:" >&5
5825   cat conftest.$ac_ext >&5
5826   rm -rf conftest*
5827   eval "ac_cv_lib_$ac_lib_var=no"
5828 fi
5829 rm -f conftest*
5830 LIBS="$ac_save_LIBS"
5831
5832 fi
5833 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5834   echo "$ac_t""yes" 1>&6
5835   have_lwp=yes
5836 else
5837   echo "$ac_t""no" 1>&6
5838 have_lwp=no
5839 fi
5840
5841
5842                 if test $have_lwp = yes ; then
5843                         cat >> confdefs.h <<\EOF
5844 #define HAVE_LWP 1
5845 EOF
5846
5847                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
5848                         ol_link_threads=lwp
5849
5850                         if test $ol_with_yielding_select = auto ; then
5851                                 ol_with_yielding_select=no
5852                         fi
5853                 fi
5854         fi
5855 fi
5856
5857 if test $ol_with_yielding_select = yes ; then
5858         cat >> confdefs.h <<\EOF
5859 #define HAVE_YIELDING_SELECT 1
5860 EOF
5861
5862 fi
5863
5864 if test $ol_with_threads = manual ; then
5865                 ol_link_threads=yes
5866
5867         echo "configure: warning: thread defines and link options must be set manually" 1>&2
5868
5869         for ac_hdr in pthread.h sched.h
5870 do
5871 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5872 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5873 echo "configure:5874: checking for $ac_hdr" >&5
5874 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5875   echo $ac_n "(cached) $ac_c" 1>&6
5876 else
5877   cat > conftest.$ac_ext <<EOF
5878 #line 5879 "configure"
5879 #include "confdefs.h"
5880 #include <$ac_hdr>
5881 EOF
5882 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5883 { (eval echo configure:5884: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5884 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5885 if test -z "$ac_err"; then
5886   rm -rf conftest*
5887   eval "ac_cv_header_$ac_safe=yes"
5888 else
5889   echo "$ac_err" >&5
5890   echo "configure: failed program was:" >&5
5891   cat conftest.$ac_ext >&5
5892   rm -rf conftest*
5893   eval "ac_cv_header_$ac_safe=no"
5894 fi
5895 rm -f conftest*
5896 fi
5897 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5898   echo "$ac_t""yes" 1>&6
5899     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5900   cat >> confdefs.h <<EOF
5901 #define $ac_tr_hdr 1
5902 EOF
5903  
5904 else
5905   echo "$ac_t""no" 1>&6
5906 fi
5907 done
5908
5909         for ac_func in sched_yield pthread_yield
5910 do
5911 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5912 echo "configure:5913: checking for $ac_func" >&5
5913 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+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 /* System header to define __stub macros and hopefully few prototypes,
5920     which can conflict with char $ac_func(); below.  */
5921 #include <assert.h>
5922 /* Override any gcc2 internal prototype to avoid an error.  */
5923 /* We use char because int might match the return type of a gcc2
5924     builtin and then its argument prototype would still apply.  */
5925 char $ac_func();
5926
5927 int main() {
5928
5929 /* The GNU C library defines this for functions which it implements
5930     to always fail with ENOSYS.  Some functions are actually named
5931     something starting with __ and the normal name is an alias.  */
5932 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5933 choke me
5934 #else
5935 $ac_func();
5936 #endif
5937
5938 ; return 0; }
5939 EOF
5940 if { (eval echo configure:5941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5941   rm -rf conftest*
5942   eval "ac_cv_func_$ac_func=yes"
5943 else
5944   echo "configure: failed program was:" >&5
5945   cat conftest.$ac_ext >&5
5946   rm -rf conftest*
5947   eval "ac_cv_func_$ac_func=no"
5948 fi
5949 rm -f conftest*
5950 fi
5951
5952 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5953   echo "$ac_t""yes" 1>&6
5954     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5955   cat >> confdefs.h <<EOF
5956 #define $ac_tr_func 1
5957 EOF
5958  
5959 else
5960   echo "$ac_t""no" 1>&6
5961 fi
5962 done
5963
5964         
5965 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
5966 echo "configure:5967: checking for LinuxThreads" >&5
5967 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
5968   echo $ac_n "(cached) $ac_c" 1>&6
5969 else
5970   
5971         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
5972         if test "$res" -gt 0 ; then
5973                 ol_cv_linux_threads=yes
5974         else
5975                 ol_cv_linux_threads=no
5976         fi
5977
5978 fi
5979
5980 echo "$ac_t""$ol_cv_linux_threads" 1>&6
5981
5982
5983         for ac_hdr in mach/cthreads.h
5984 do
5985 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5986 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5987 echo "configure:5988: checking for $ac_hdr" >&5
5988 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5989   echo $ac_n "(cached) $ac_c" 1>&6
5990 else
5991   cat > conftest.$ac_ext <<EOF
5992 #line 5993 "configure"
5993 #include "confdefs.h"
5994 #include <$ac_hdr>
5995 EOF
5996 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5997 { (eval echo configure:5998: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5998 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5999 if test -z "$ac_err"; then
6000   rm -rf conftest*
6001   eval "ac_cv_header_$ac_safe=yes"
6002 else
6003   echo "$ac_err" >&5
6004   echo "configure: failed program was:" >&5
6005   cat conftest.$ac_ext >&5
6006   rm -rf conftest*
6007   eval "ac_cv_header_$ac_safe=no"
6008 fi
6009 rm -f conftest*
6010 fi
6011 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6012   echo "$ac_t""yes" 1>&6
6013     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6014   cat >> confdefs.h <<EOF
6015 #define $ac_tr_hdr 1
6016 EOF
6017  
6018 else
6019   echo "$ac_t""no" 1>&6
6020 fi
6021 done
6022
6023         for ac_hdr in lwp/lwp.h
6024 do
6025 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6026 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6027 echo "configure:6028: checking for $ac_hdr" >&5
6028 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6029   echo $ac_n "(cached) $ac_c" 1>&6
6030 else
6031   cat > conftest.$ac_ext <<EOF
6032 #line 6033 "configure"
6033 #include "confdefs.h"
6034 #include <$ac_hdr>
6035 EOF
6036 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6037 { (eval echo configure:6038: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6038 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6039 if test -z "$ac_err"; then
6040   rm -rf conftest*
6041   eval "ac_cv_header_$ac_safe=yes"
6042 else
6043   echo "$ac_err" >&5
6044   echo "configure: failed program was:" >&5
6045   cat conftest.$ac_ext >&5
6046   rm -rf conftest*
6047   eval "ac_cv_header_$ac_safe=no"
6048 fi
6049 rm -f conftest*
6050 fi
6051 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6052   echo "$ac_t""yes" 1>&6
6053     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6054   cat >> confdefs.h <<EOF
6055 #define $ac_tr_hdr 1
6056 EOF
6057  
6058 else
6059   echo "$ac_t""no" 1>&6
6060 fi
6061 done
6062
6063         for ac_hdr in thread.h synch.h
6064 do
6065 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6066 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6067 echo "configure:6068: checking for $ac_hdr" >&5
6068 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6069   echo $ac_n "(cached) $ac_c" 1>&6
6070 else
6071   cat > conftest.$ac_ext <<EOF
6072 #line 6073 "configure"
6073 #include "confdefs.h"
6074 #include <$ac_hdr>
6075 EOF
6076 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6077 { (eval echo configure:6078: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6078 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6079 if test -z "$ac_err"; then
6080   rm -rf conftest*
6081   eval "ac_cv_header_$ac_safe=yes"
6082 else
6083   echo "$ac_err" >&5
6084   echo "configure: failed program was:" >&5
6085   cat conftest.$ac_ext >&5
6086   rm -rf conftest*
6087   eval "ac_cv_header_$ac_safe=no"
6088 fi
6089 rm -f conftest*
6090 fi
6091 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6092   echo "$ac_t""yes" 1>&6
6093     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6094   cat >> confdefs.h <<EOF
6095 #define $ac_tr_hdr 1
6096 EOF
6097  
6098 else
6099   echo "$ac_t""no" 1>&6
6100 fi
6101 done
6102
6103 fi
6104
6105 if test $ol_link_threads != no ; then  
6106                         cat >> confdefs.h <<\EOF
6107 #define REENTRANT 1
6108 EOF
6109
6110         cat >> confdefs.h <<\EOF
6111 #define _REENTRANT 1
6112 EOF
6113
6114         cat >> confdefs.h <<\EOF
6115 #define THREAD_SAFE 1
6116 EOF
6117
6118         cat >> confdefs.h <<\EOF
6119 #define _THREAD_SAFE 1
6120 EOF
6121
6122         cat >> confdefs.h <<\EOF
6123 #define THREADSAFE 1
6124 EOF
6125
6126         cat >> confdefs.h <<\EOF
6127 #define _THREADSAFE 1
6128 EOF
6129
6130
6131                                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
6132 echo "configure:6133: checking for thread specific errno" >&5
6133 if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
6134   echo $ac_n "(cached) $ac_c" 1>&6
6135 else
6136   
6137                 cat > conftest.$ac_ext <<EOF
6138 #line 6139 "configure"
6139 #include "confdefs.h"
6140 #include <errno.h>
6141 int main() {
6142 int x = errno;
6143 ; return 0; }
6144 EOF
6145 if { (eval echo configure:6146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6146   rm -rf conftest*
6147   ol_cv_errno_thread_specific=yes
6148 else
6149   echo "configure: failed program was:" >&5
6150   cat conftest.$ac_ext >&5
6151   rm -rf conftest*
6152   ol_cv_errno_thread_specific=no
6153 fi
6154 rm -f conftest*
6155         
6156 fi
6157
6158 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
6159
6160         if test $ol_cv_errno_thread_specific != yes ; then
6161                 LIBS="$LTHREAD_LIBS $LIBS"
6162                 LTHREAD_LIBS=""
6163         fi
6164
6165 fi  
6166
6167
6168 if test $ol_link_threads = no ; then
6169         if test $ol_with_threads = yes ; then
6170                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
6171         fi
6172
6173         if test $ol_with_threads = auto ; then
6174                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
6175                 ol_with_threads=no
6176         fi
6177
6178         cat >> confdefs.h <<\EOF
6179 #define NO_THREADS 1
6180 EOF
6181
6182         LTHREAD_LIBS=""
6183 fi
6184
6185 ol_link_ldbm=no 
6186 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
6187         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
6188 echo "configure:6189: checking for DB2 library" >&5
6189 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
6190   echo $ac_n "(cached) $ac_c" 1>&6
6191 else
6192         ol_LIBS="$LIBS"
6193         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
6194 echo "configure:6195: checking for db_open in -ldb" >&5
6195 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
6196 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6197   echo $ac_n "(cached) $ac_c" 1>&6
6198 else
6199   ac_save_LIBS="$LIBS"
6200 LIBS="-ldb  $LIBS"
6201 cat > conftest.$ac_ext <<EOF
6202 #line 6203 "configure"
6203 #include "confdefs.h"
6204 /* Override any gcc2 internal prototype to avoid an error.  */
6205 /* We use char because int might match the return type of a gcc2
6206     builtin and then its argument prototype would still apply.  */
6207 char db_open();
6208
6209 int main() {
6210 db_open()
6211 ; return 0; }
6212 EOF
6213 if { (eval echo configure:6214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6214   rm -rf conftest*
6215   eval "ac_cv_lib_$ac_lib_var=yes"
6216 else
6217   echo "configure: failed program was:" >&5
6218   cat conftest.$ac_ext >&5
6219   rm -rf conftest*
6220   eval "ac_cv_lib_$ac_lib_var=no"
6221 fi
6222 rm -f conftest*
6223 LIBS="$ac_save_LIBS"
6224
6225 fi
6226 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6227   echo "$ac_t""yes" 1>&6
6228   ol_cv_lib_db2=-ldb
6229 else
6230   echo "$ac_t""no" 1>&6
6231 ol_cv_lib_db2=no
6232 fi
6233
6234         LIBS="$ol_LIBS"
6235
6236 fi
6237
6238 echo "$ac_t""$ol_cv_lib_db2" 1>&6
6239
6240 for ac_hdr in db.h
6241 do
6242 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6243 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6244 echo "configure:6245: checking for $ac_hdr" >&5
6245 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6246   echo $ac_n "(cached) $ac_c" 1>&6
6247 else
6248   cat > conftest.$ac_ext <<EOF
6249 #line 6250 "configure"
6250 #include "confdefs.h"
6251 #include <$ac_hdr>
6252 EOF
6253 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6254 { (eval echo configure:6255: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6255 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6256 if test -z "$ac_err"; then
6257   rm -rf conftest*
6258   eval "ac_cv_header_$ac_safe=yes"
6259 else
6260   echo "$ac_err" >&5
6261   echo "configure: failed program was:" >&5
6262   cat conftest.$ac_ext >&5
6263   rm -rf conftest*
6264   eval "ac_cv_header_$ac_safe=no"
6265 fi
6266 rm -f conftest*
6267 fi
6268 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6269   echo "$ac_t""yes" 1>&6
6270     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6271   cat >> confdefs.h <<EOF
6272 #define $ac_tr_hdr 1
6273 EOF
6274  
6275 else
6276   echo "$ac_t""no" 1>&6
6277 fi
6278 done
6279
6280 if test $ac_cv_header_db_h = yes ; then
6281         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
6282 echo "configure:6283: checking if db.h is DB2" >&5
6283 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
6284   echo $ac_n "(cached) $ac_c" 1>&6
6285 else
6286   
6287                 cat > conftest.$ac_ext <<EOF
6288 #line 6289 "configure"
6289 #include "confdefs.h"
6290
6291 #                       include <db.h>
6292                         /* this check could be improved */
6293 #                       ifdef DB_VERSION_MAJOR
6294 #                               if DB_VERSION_MAJOR == 2
6295                                         __db_version_2
6296 #                               endif
6297 #                       endif
6298                 
6299 EOF
6300 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6301   egrep "__db_version_2" >/dev/null 2>&1; then
6302   rm -rf conftest*
6303   ol_cv_header_db2=yes
6304 else
6305   rm -rf conftest*
6306   ol_cv_header_db2=no
6307 fi
6308 rm -f conftest*
6309
6310 fi
6311
6312 echo "$ac_t""$ol_cv_header_db2" 1>&6
6313 else
6314         ol_cv_header_db2=no
6315 fi
6316
6317
6318  
6319  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
6320 echo "configure:6321: checking for Berkeley DB2" >&5
6321 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
6322   echo $ac_n "(cached) $ac_c" 1>&6
6323 else
6324   
6325         if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then
6326                 ol_cv_berkeley_db2=no
6327         else
6328                 ol_cv_berkeley_db2=yes
6329         fi
6330
6331 fi
6332
6333 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
6334  if test $ol_cv_berkeley_db2 = yes ; then
6335         cat >> confdefs.h <<\EOF
6336 #define HAVE_BERKELEY_DB2 1
6337 EOF
6338
6339  fi
6340
6341
6342         if test $ol_cv_berkeley_db2 = yes ; then
6343                 ol_link_ldbm=db2
6344                 ol_with_ldbm_api=db2
6345
6346                 if test $ol_with_ldbm_type = hash ; then
6347                         cat >> confdefs.h <<\EOF
6348 #define LDBM_USE_DBHASH 1
6349 EOF
6350
6351                 else
6352                         cat >> confdefs.h <<\EOF
6353 #define LDBM_USE_DBBTREE 1
6354 EOF
6355
6356                 fi
6357
6358                                                 if test $ol_cv_lib_db2 != yes ; then
6359                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
6360                 fi
6361         fi
6362 fi
6363
6364 ol_link_bdb2=no
6365 if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
6366         ol_link_bdb2=yes
6367 fi
6368
6369 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
6370         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
6371 echo "configure:6372: checking for Berkeley DB library" >&5
6372 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
6373   echo $ac_n "(cached) $ac_c" 1>&6
6374 else
6375         ol_LIBS="$LIBS"
6376         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
6377 echo "configure:6378: checking for dbopen" >&5
6378 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
6379   echo $ac_n "(cached) $ac_c" 1>&6
6380 else
6381   cat > conftest.$ac_ext <<EOF
6382 #line 6383 "configure"
6383 #include "confdefs.h"
6384 /* System header to define __stub macros and hopefully few prototypes,
6385     which can conflict with char dbopen(); below.  */
6386 #include <assert.h>
6387 /* Override any gcc2 internal prototype to avoid an error.  */
6388 /* We use char because int might match the return type of a gcc2
6389     builtin and then its argument prototype would still apply.  */
6390 char dbopen();
6391
6392 int main() {
6393
6394 /* The GNU C library defines this for functions which it implements
6395     to always fail with ENOSYS.  Some functions are actually named
6396     something starting with __ and the normal name is an alias.  */
6397 #if defined (__stub_dbopen) || defined (__stub___dbopen)
6398 choke me
6399 #else
6400 dbopen();
6401 #endif
6402
6403 ; return 0; }
6404 EOF
6405 if { (eval echo configure:6406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6406   rm -rf conftest*
6407   eval "ac_cv_func_dbopen=yes"
6408 else
6409   echo "configure: failed program was:" >&5
6410   cat conftest.$ac_ext >&5
6411   rm -rf conftest*
6412   eval "ac_cv_func_dbopen=no"
6413 fi
6414 rm -f conftest*
6415 fi
6416
6417 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
6418   echo "$ac_t""yes" 1>&6
6419   ol_cv_lib_db=yes
6420 else
6421   echo "$ac_t""no" 1>&6
6422
6423                 echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
6424 echo "configure:6425: checking for dbopen in -ldb" >&5
6425 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
6426 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6427   echo $ac_n "(cached) $ac_c" 1>&6
6428 else
6429   ac_save_LIBS="$LIBS"
6430 LIBS="-ldb  $LIBS"
6431 cat > conftest.$ac_ext <<EOF
6432 #line 6433 "configure"
6433 #include "confdefs.h"
6434 /* Override any gcc2 internal prototype to avoid an error.  */
6435 /* We use char because int might match the return type of a gcc2
6436     builtin and then its argument prototype would still apply.  */
6437 char dbopen();
6438
6439 int main() {
6440 dbopen()
6441 ; return 0; }
6442 EOF
6443 if { (eval echo configure:6444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6444   rm -rf conftest*
6445   eval "ac_cv_lib_$ac_lib_var=yes"
6446 else
6447   echo "configure: failed program was:" >&5
6448   cat conftest.$ac_ext >&5
6449   rm -rf conftest*
6450   eval "ac_cv_lib_$ac_lib_var=no"
6451 fi
6452 rm -f conftest*
6453 LIBS="$ac_save_LIBS"
6454
6455 fi
6456 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6457   echo "$ac_t""yes" 1>&6
6458   ol_cv_lib_db=-ldb
6459 else
6460   echo "$ac_t""no" 1>&6
6461 ol_cv_lib_db=no
6462 fi
6463
6464         
6465 fi
6466
6467         LIBS="$ol_LIBS"
6468
6469 fi
6470
6471 echo "$ac_t""$ol_cv_lib_db" 1>&6
6472
6473
6474 for ac_hdr in db_185.h
6475 do
6476 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6477 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6478 echo "configure:6479: checking for $ac_hdr" >&5
6479 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6480   echo $ac_n "(cached) $ac_c" 1>&6
6481 else
6482   cat > conftest.$ac_ext <<EOF
6483 #line 6484 "configure"
6484 #include "confdefs.h"
6485 #include <$ac_hdr>
6486 EOF
6487 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6488 { (eval echo configure:6489: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6489 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6490 if test -z "$ac_err"; then
6491   rm -rf conftest*
6492   eval "ac_cv_header_$ac_safe=yes"
6493 else
6494   echo "$ac_err" >&5
6495   echo "configure: failed program was:" >&5
6496   cat conftest.$ac_ext >&5
6497   rm -rf conftest*
6498   eval "ac_cv_header_$ac_safe=no"
6499 fi
6500 rm -f conftest*
6501 fi
6502 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6503   echo "$ac_t""yes" 1>&6
6504     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6505   cat >> confdefs.h <<EOF
6506 #define $ac_tr_hdr 1
6507 EOF
6508  
6509 else
6510   echo "$ac_t""no" 1>&6
6511 fi
6512 done
6513
6514 if test "$ol_cv_header_db2" = yes ; then
6515         
6516         ol_cv_header_db=$ac_cv_header_db_185_h
6517 else
6518         ol_cv_header_db=$ac_cv_header_db_h
6519 fi
6520
6521
6522  
6523  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
6524 echo "configure:6525: checking for Berkeley DB" >&5
6525 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
6526   echo $ac_n "(cached) $ac_c" 1>&6
6527 else
6528   
6529         if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then
6530                 ol_cv_berkeley_db=no
6531         else
6532                 ol_cv_berkeley_db=yes
6533         fi
6534
6535 fi
6536
6537 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
6538  if test $ol_cv_berkeley_db = yes ; then
6539         cat >> confdefs.h <<\EOF
6540 #define HAVE_BERKELEY_DB 1
6541 EOF
6542
6543  fi
6544
6545
6546         if test $ol_cv_berkeley_db = yes ; then
6547                 ol_link_ldbm=db
6548                 ol_with_ldbm_api=db
6549
6550                 if test $ol_with_ldbm_type = hash ; then
6551                         cat >> confdefs.h <<\EOF
6552 #define LDBM_USE_DBHASH 1
6553 EOF
6554
6555                 else
6556                         cat >> confdefs.h <<\EOF
6557 #define LDBM_USE_DBBTREE 1
6558 EOF
6559
6560                 fi
6561
6562                                                 if test $ol_cv_lib_db != yes ; then
6563                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
6564                 fi
6565         fi
6566 fi
6567
6568 if test $ol_with_ldbm_api = manual ; then
6569                 ol_link_ldbm=yes
6570
6571         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
6572
6573         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
6574 do
6575 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6576 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6577 echo "configure:6578: checking for $ac_hdr" >&5
6578 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6579   echo $ac_n "(cached) $ac_c" 1>&6
6580 else
6581   cat > conftest.$ac_ext <<EOF
6582 #line 6583 "configure"
6583 #include "confdefs.h"
6584 #include <$ac_hdr>
6585 EOF
6586 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6587 { (eval echo configure:6588: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6588 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6589 if test -z "$ac_err"; then
6590   rm -rf conftest*
6591   eval "ac_cv_header_$ac_safe=yes"
6592 else
6593   echo "$ac_err" >&5
6594   echo "configure: failed program was:" >&5
6595   cat conftest.$ac_ext >&5
6596   rm -rf conftest*
6597   eval "ac_cv_header_$ac_safe=no"
6598 fi
6599 rm -f conftest*
6600 fi
6601 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6602   echo "$ac_t""yes" 1>&6
6603     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6604   cat >> confdefs.h <<EOF
6605 #define $ac_tr_hdr 1
6606 EOF
6607  
6608 else
6609   echo "$ac_t""no" 1>&6
6610 fi
6611 done
6612
6613 fi
6614
6615 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
6616         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
6617         ol_with_ldbm_api=none
6618 fi
6619
6620 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
6621         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
6622 echo "configure:6623: checking for GDBM library" >&5
6623 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
6624   echo $ac_n "(cached) $ac_c" 1>&6
6625 else
6626         ol_LIBS="$LIBS"
6627         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
6628 echo "configure:6629: checking for gdbm_open" >&5
6629 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
6630   echo $ac_n "(cached) $ac_c" 1>&6
6631 else
6632   cat > conftest.$ac_ext <<EOF
6633 #line 6634 "configure"
6634 #include "confdefs.h"
6635 /* System header to define __stub macros and hopefully few prototypes,
6636     which can conflict with char gdbm_open(); below.  */
6637 #include <assert.h>
6638 /* Override any gcc2 internal prototype to avoid an error.  */
6639 /* We use char because int might match the return type of a gcc2
6640     builtin and then its argument prototype would still apply.  */
6641 char gdbm_open();
6642
6643 int main() {
6644
6645 /* The GNU C library defines this for functions which it implements
6646     to always fail with ENOSYS.  Some functions are actually named
6647     something starting with __ and the normal name is an alias.  */
6648 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
6649 choke me
6650 #else
6651 gdbm_open();
6652 #endif
6653
6654 ; return 0; }
6655 EOF
6656 if { (eval echo configure:6657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6657   rm -rf conftest*
6658   eval "ac_cv_func_gdbm_open=yes"
6659 else
6660   echo "configure: failed program was:" >&5
6661   cat conftest.$ac_ext >&5
6662   rm -rf conftest*
6663   eval "ac_cv_func_gdbm_open=no"
6664 fi
6665 rm -f conftest*
6666 fi
6667
6668 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
6669   echo "$ac_t""yes" 1>&6
6670   ol_cv_lib_gdbm=yes
6671 else
6672   echo "$ac_t""no" 1>&6
6673
6674                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
6675 echo "configure:6676: checking for gdbm_open in -lgdbm" >&5
6676 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
6677 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6678   echo $ac_n "(cached) $ac_c" 1>&6
6679 else
6680   ac_save_LIBS="$LIBS"
6681 LIBS="-lgdbm  $LIBS"
6682 cat > conftest.$ac_ext <<EOF
6683 #line 6684 "configure"
6684 #include "confdefs.h"
6685 /* Override any gcc2 internal prototype to avoid an error.  */
6686 /* We use char because int might match the return type of a gcc2
6687     builtin and then its argument prototype would still apply.  */
6688 char gdbm_open();
6689
6690 int main() {
6691 gdbm_open()
6692 ; return 0; }
6693 EOF
6694 if { (eval echo configure:6695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6695   rm -rf conftest*
6696   eval "ac_cv_lib_$ac_lib_var=yes"
6697 else
6698   echo "configure: failed program was:" >&5
6699   cat conftest.$ac_ext >&5
6700   rm -rf conftest*
6701   eval "ac_cv_lib_$ac_lib_var=no"
6702 fi
6703 rm -f conftest*
6704 LIBS="$ac_save_LIBS"
6705
6706 fi
6707 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6708   echo "$ac_t""yes" 1>&6
6709   ol_cv_lib_gdbm=-lgdbm
6710 else
6711   echo "$ac_t""no" 1>&6
6712 ol_cv_lib_gdbm=no
6713 fi
6714
6715         
6716 fi
6717
6718         LIBS="$ol_LIBS"
6719
6720 fi
6721
6722 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
6723
6724
6725  for ac_hdr in gdbm.h
6726 do
6727 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6728 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6729 echo "configure:6730: checking for $ac_hdr" >&5
6730 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6731   echo $ac_n "(cached) $ac_c" 1>&6
6732 else
6733   cat > conftest.$ac_ext <<EOF
6734 #line 6735 "configure"
6735 #include "confdefs.h"
6736 #include <$ac_hdr>
6737 EOF
6738 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6739 { (eval echo configure:6740: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6740 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6741 if test -z "$ac_err"; then
6742   rm -rf conftest*
6743   eval "ac_cv_header_$ac_safe=yes"
6744 else
6745   echo "$ac_err" >&5
6746   echo "configure: failed program was:" >&5
6747   cat conftest.$ac_ext >&5
6748   rm -rf conftest*
6749   eval "ac_cv_header_$ac_safe=no"
6750 fi
6751 rm -f conftest*
6752 fi
6753 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6754   echo "$ac_t""yes" 1>&6
6755     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6756   cat >> confdefs.h <<EOF
6757 #define $ac_tr_hdr 1
6758 EOF
6759  
6760 else
6761   echo "$ac_t""no" 1>&6
6762 fi
6763 done
6764
6765  echo $ac_n "checking for db""... $ac_c" 1>&6
6766 echo "configure:6767: checking for db" >&5
6767 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
6768   echo $ac_n "(cached) $ac_c" 1>&6
6769 else
6770   
6771         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
6772                 ol_cv_gdbm=no
6773         else
6774                 ol_cv_gdbm=yes
6775         fi
6776
6777 fi
6778
6779 echo "$ac_t""$ol_cv_gdbm" 1>&6
6780  if test $ol_cv_gdbm = yes ; then
6781         cat >> confdefs.h <<\EOF
6782 #define HAVE_GDBM 1
6783 EOF
6784
6785  fi
6786
6787
6788         if test $ol_cv_gdbm = yes ; then
6789                 ol_link_ldbm=gdbm
6790                 ol_with_ldbm_api=gdbm
6791
6792                 if test $ol_cv_lib_gdbm != yes ; then
6793                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
6794                 fi
6795         fi
6796 fi
6797
6798 if test $ol_with_ldbm_api = auto ; then
6799         echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
6800 elif test $ol_with_ldbm_api = ndbm ; then
6801         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
6802 echo "configure:6803: checking for NDBM library" >&5
6803 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
6804   echo $ac_n "(cached) $ac_c" 1>&6
6805 else
6806         ol_LIBS="$LIBS"
6807         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
6808 echo "configure:6809: checking for dbm_open" >&5
6809 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
6810   echo $ac_n "(cached) $ac_c" 1>&6
6811 else
6812   cat > conftest.$ac_ext <<EOF
6813 #line 6814 "configure"
6814 #include "confdefs.h"
6815 /* System header to define __stub macros and hopefully few prototypes,
6816     which can conflict with char dbm_open(); below.  */
6817 #include <assert.h>
6818 /* Override any gcc2 internal prototype to avoid an error.  */
6819 /* We use char because int might match the return type of a gcc2
6820     builtin and then its argument prototype would still apply.  */
6821 char dbm_open();
6822
6823 int main() {
6824
6825 /* The GNU C library defines this for functions which it implements
6826     to always fail with ENOSYS.  Some functions are actually named
6827     something starting with __ and the normal name is an alias.  */
6828 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
6829 choke me
6830 #else
6831 dbm_open();
6832 #endif
6833
6834 ; return 0; }
6835 EOF
6836 if { (eval echo configure:6837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6837   rm -rf conftest*
6838   eval "ac_cv_func_dbm_open=yes"
6839 else
6840   echo "configure: failed program was:" >&5
6841   cat conftest.$ac_ext >&5
6842   rm -rf conftest*
6843   eval "ac_cv_func_dbm_open=no"
6844 fi
6845 rm -f conftest*
6846 fi
6847
6848 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
6849   echo "$ac_t""yes" 1>&6
6850   ol_cv_lib_ndbm=yes
6851 else
6852   echo "$ac_t""no" 1>&6
6853
6854                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
6855 echo "configure:6856: checking for dbm_open in -lndbm" >&5
6856 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
6857 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6858   echo $ac_n "(cached) $ac_c" 1>&6
6859 else
6860   ac_save_LIBS="$LIBS"
6861 LIBS="-lndbm  $LIBS"
6862 cat > conftest.$ac_ext <<EOF
6863 #line 6864 "configure"
6864 #include "confdefs.h"
6865 /* Override any gcc2 internal prototype to avoid an error.  */
6866 /* We use char because int might match the return type of a gcc2
6867     builtin and then its argument prototype would still apply.  */
6868 char dbm_open();
6869
6870 int main() {
6871 dbm_open()
6872 ; return 0; }
6873 EOF
6874 if { (eval echo configure:6875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6875   rm -rf conftest*
6876   eval "ac_cv_lib_$ac_lib_var=yes"
6877 else
6878   echo "configure: failed program was:" >&5
6879   cat conftest.$ac_ext >&5
6880   rm -rf conftest*
6881   eval "ac_cv_lib_$ac_lib_var=no"
6882 fi
6883 rm -f conftest*
6884 LIBS="$ac_save_LIBS"
6885
6886 fi
6887 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6888   echo "$ac_t""yes" 1>&6
6889   ol_cv_lib_ndbm=-lndbm
6890 else
6891   echo "$ac_t""no" 1>&6
6892
6893                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
6894 echo "configure:6895: checking for dbm_open in -ldbm" >&5
6895 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
6896 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6897   echo $ac_n "(cached) $ac_c" 1>&6
6898 else
6899   ac_save_LIBS="$LIBS"
6900 LIBS="-ldbm  $LIBS"
6901 cat > conftest.$ac_ext <<EOF
6902 #line 6903 "configure"
6903 #include "confdefs.h"
6904 /* Override any gcc2 internal prototype to avoid an error.  */
6905 /* We use char because int might match the return type of a gcc2
6906     builtin and then its argument prototype would still apply.  */
6907 char dbm_open();
6908
6909 int main() {
6910 dbm_open()
6911 ; return 0; }
6912 EOF
6913 if { (eval echo configure:6914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6914   rm -rf conftest*
6915   eval "ac_cv_lib_$ac_lib_var=yes"
6916 else
6917   echo "configure: failed program was:" >&5
6918   cat conftest.$ac_ext >&5
6919   rm -rf conftest*
6920   eval "ac_cv_lib_$ac_lib_var=no"
6921 fi
6922 rm -f conftest*
6923 LIBS="$ac_save_LIBS"
6924
6925 fi
6926 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6927   echo "$ac_t""yes" 1>&6
6928   ol_cv_lib_ndbm=-ldbm
6929 else
6930   echo "$ac_t""no" 1>&6
6931 ol_cv_lib_ndbm=no
6932 fi
6933                 
6934 fi
6935
6936         
6937 fi
6938
6939         LIBS="$ol_LIBS"
6940
6941 fi
6942
6943 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
6944
6945
6946  for ac_hdr in ndbm.h
6947 do
6948 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6949 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6950 echo "configure:6951: checking for $ac_hdr" >&5
6951 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6952   echo $ac_n "(cached) $ac_c" 1>&6
6953 else
6954   cat > conftest.$ac_ext <<EOF
6955 #line 6956 "configure"
6956 #include "confdefs.h"
6957 #include <$ac_hdr>
6958 EOF
6959 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6960 { (eval echo configure:6961: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6961 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6962 if test -z "$ac_err"; then
6963   rm -rf conftest*
6964   eval "ac_cv_header_$ac_safe=yes"
6965 else
6966   echo "$ac_err" >&5
6967   echo "configure: failed program was:" >&5
6968   cat conftest.$ac_ext >&5
6969   rm -rf conftest*
6970   eval "ac_cv_header_$ac_safe=no"
6971 fi
6972 rm -f conftest*
6973 fi
6974 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6975   echo "$ac_t""yes" 1>&6
6976     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6977   cat >> confdefs.h <<EOF
6978 #define $ac_tr_hdr 1
6979 EOF
6980  
6981 else
6982   echo "$ac_t""no" 1>&6
6983 fi
6984 done
6985
6986  echo $ac_n "checking for db""... $ac_c" 1>&6
6987 echo "configure:6988: checking for db" >&5
6988 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
6989   echo $ac_n "(cached) $ac_c" 1>&6
6990 else
6991   
6992         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
6993                 ol_cv_ndbm=no
6994         else
6995                 ol_cv_ndbm=yes
6996         fi
6997
6998 fi
6999
7000 echo "$ac_t""$ol_cv_ndbm" 1>&6
7001  if test $ol_cv_ndbm = yes ; then
7002         cat >> confdefs.h <<\EOF
7003 #define HAVE_NDBM 1
7004 EOF
7005
7006  fi
7007
7008
7009         if test $ol_cv_ndbm = yes ; then
7010                 ol_link_ldbm=ndbm
7011                 ol_with_ldbm_api=ndbm
7012
7013                 if test $ol_cv_lib_ndbm != yes ; then
7014                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
7015                 fi
7016         fi
7017 fi
7018
7019 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
7020         echo "configure: warning: could not find suitable LDBM backend" 1>&2
7021         if test $ol_enable_ldbm = yes ; then
7022                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
7023         fi
7024
7025         echo "configure: warning: disabling LDBM" 1>&2
7026         ol_enable_ldbm=no
7027 fi
7028
7029 if test $ol_enable_wrappers != no ; then
7030         for ac_hdr in tcpd.h
7031 do
7032 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7033 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7034 echo "configure:7035: checking for $ac_hdr" >&5
7035 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7036   echo $ac_n "(cached) $ac_c" 1>&6
7037 else
7038   cat > conftest.$ac_ext <<EOF
7039 #line 7040 "configure"
7040 #include "confdefs.h"
7041 #include <$ac_hdr>
7042 EOF
7043 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7044 { (eval echo configure:7045: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7045 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7046 if test -z "$ac_err"; then
7047   rm -rf conftest*
7048   eval "ac_cv_header_$ac_safe=yes"
7049 else
7050   echo "$ac_err" >&5
7051   echo "configure: failed program was:" >&5
7052   cat conftest.$ac_ext >&5
7053   rm -rf conftest*
7054   eval "ac_cv_header_$ac_safe=no"
7055 fi
7056 rm -f conftest*
7057 fi
7058 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7059   echo "$ac_t""yes" 1>&6
7060     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7061   cat >> confdefs.h <<EOF
7062 #define $ac_tr_hdr 1
7063 EOF
7064  
7065 else
7066   echo "$ac_t""no" 1>&6
7067 fi
7068 done
7069
7070
7071         if test $ac_cv_header_tcpd_h != yes ; then
7072                 have_wrappers=no
7073         else
7074                 echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
7075 echo "configure:7076: checking for main in -lwrap" >&5
7076 ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'`
7077 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7078   echo $ac_n "(cached) $ac_c" 1>&6
7079 else
7080   ac_save_LIBS="$LIBS"
7081 LIBS="-lwrap  $LIBS"
7082 cat > conftest.$ac_ext <<EOF
7083 #line 7084 "configure"
7084 #include "confdefs.h"
7085
7086 int main() {
7087 main()
7088 ; return 0; }
7089 EOF
7090 if { (eval echo configure:7091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7091   rm -rf conftest*
7092   eval "ac_cv_lib_$ac_lib_var=yes"
7093 else
7094   echo "configure: failed program was:" >&5
7095   cat conftest.$ac_ext >&5
7096   rm -rf conftest*
7097   eval "ac_cv_lib_$ac_lib_var=no"
7098 fi
7099 rm -f conftest*
7100 LIBS="$ac_save_LIBS"
7101
7102 fi
7103 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7104   echo "$ac_t""yes" 1>&6
7105   have_wrappers=yes
7106 else
7107   echo "$ac_t""no" 1>&6
7108 have_wrappers=no
7109 fi
7110
7111         fi
7112
7113         if test $have_wrappers = yes ; then
7114                 cat >> confdefs.h <<\EOF
7115 #define HAVE_TCPD 1
7116 EOF
7117
7118                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
7119         else
7120                 echo "configure: warning: could not find -lwrap" 1>&2
7121                 if test $ol_enable_wrappers = yes ; then
7122                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
7123                 fi
7124
7125                 echo "configure: warning: disabling wrappers support" 1>&2
7126                 ol_enable_wrappers=no
7127         fi
7128 fi
7129
7130 if test $ol_enable_syslog != no ; then
7131         echo $ac_n "checking for openlog""... $ac_c" 1>&6
7132 echo "configure:7133: checking for openlog" >&5
7133 if eval "test \"`echo '$''{'ac_cv_func_openlog'+set}'`\" = set"; then
7134   echo $ac_n "(cached) $ac_c" 1>&6
7135 else
7136   cat > conftest.$ac_ext <<EOF
7137 #line 7138 "configure"
7138 #include "confdefs.h"
7139 /* System header to define __stub macros and hopefully few prototypes,
7140     which can conflict with char openlog(); below.  */
7141 #include <assert.h>
7142 /* Override any gcc2 internal prototype to avoid an error.  */
7143 /* We use char because int might match the return type of a gcc2
7144     builtin and then its argument prototype would still apply.  */
7145 char openlog();
7146
7147 int main() {
7148
7149 /* The GNU C library defines this for functions which it implements
7150     to always fail with ENOSYS.  Some functions are actually named
7151     something starting with __ and the normal name is an alias.  */
7152 #if defined (__stub_openlog) || defined (__stub___openlog)
7153 choke me
7154 #else
7155 openlog();
7156 #endif
7157
7158 ; return 0; }
7159 EOF
7160 if { (eval echo configure:7161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7161   rm -rf conftest*
7162   eval "ac_cv_func_openlog=yes"
7163 else
7164   echo "configure: failed program was:" >&5
7165   cat conftest.$ac_ext >&5
7166   rm -rf conftest*
7167   eval "ac_cv_func_openlog=no"
7168 fi
7169 rm -f conftest*
7170 fi
7171
7172 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
7173   echo "$ac_t""yes" 1>&6
7174   :
7175 else
7176   echo "$ac_t""no" 1>&6
7177 fi
7178
7179         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
7180                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
7181         fi
7182         ol_enable_syslog=$ac_cv_func_openlog
7183 fi
7184
7185 if test $ol_enable_dmalloc != no ; then
7186         for ac_hdr in dmalloc.h
7187 do
7188 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7189 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7190 echo "configure:7191: checking for $ac_hdr" >&5
7191 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7192   echo $ac_n "(cached) $ac_c" 1>&6
7193 else
7194   cat > conftest.$ac_ext <<EOF
7195 #line 7196 "configure"
7196 #include "confdefs.h"
7197 #include <$ac_hdr>
7198 EOF
7199 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7200 { (eval echo configure:7201: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7201 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7202 if test -z "$ac_err"; then
7203   rm -rf conftest*
7204   eval "ac_cv_header_$ac_safe=yes"
7205 else
7206   echo "$ac_err" >&5
7207   echo "configure: failed program was:" >&5
7208   cat conftest.$ac_ext >&5
7209   rm -rf conftest*
7210   eval "ac_cv_header_$ac_safe=no"
7211 fi
7212 rm -f conftest*
7213 fi
7214 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7215   echo "$ac_t""yes" 1>&6
7216     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7217   cat >> confdefs.h <<EOF
7218 #define $ac_tr_hdr 1
7219 EOF
7220  
7221 else
7222   echo "$ac_t""no" 1>&6
7223 fi
7224 done
7225
7226         echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
7227 echo "configure:7228: checking for dmalloc_shutdown in -ldmalloc" >&5
7228 ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-%__p_%'`
7229 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7230   echo $ac_n "(cached) $ac_c" 1>&6
7231 else
7232   ac_save_LIBS="$LIBS"
7233 LIBS="-ldmalloc  $LIBS"
7234 cat > conftest.$ac_ext <<EOF
7235 #line 7236 "configure"
7236 #include "confdefs.h"
7237 /* Override any gcc2 internal prototype to avoid an error.  */
7238 /* We use char because int might match the return type of a gcc2
7239     builtin and then its argument prototype would still apply.  */
7240 char dmalloc_shutdown();
7241
7242 int main() {
7243 dmalloc_shutdown()
7244 ; return 0; }
7245 EOF
7246 if { (eval echo configure:7247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7247   rm -rf conftest*
7248   eval "ac_cv_lib_$ac_lib_var=yes"
7249 else
7250   echo "configure: failed program was:" >&5
7251   cat conftest.$ac_ext >&5
7252   rm -rf conftest*
7253   eval "ac_cv_lib_$ac_lib_var=no"
7254 fi
7255 rm -f conftest*
7256 LIBS="$ac_save_LIBS"
7257
7258 fi
7259 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7260   echo "$ac_t""yes" 1>&6
7261     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7262     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7263   cat >> confdefs.h <<EOF
7264 #define $ac_tr_lib 1
7265 EOF
7266
7267   LIBS="-ldmalloc $LIBS"
7268
7269 else
7270   echo "$ac_t""no" 1>&6
7271 fi
7272
7273 fi
7274
7275 if test $ol_enable_tcl != no ; then
7276         for ac_hdr in tcl.h
7277 do
7278 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7279 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7280 echo "configure:7281: checking for $ac_hdr" >&5
7281 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7282   echo $ac_n "(cached) $ac_c" 1>&6
7283 else
7284   cat > conftest.$ac_ext <<EOF
7285 #line 7286 "configure"
7286 #include "confdefs.h"
7287 #include <$ac_hdr>
7288 EOF
7289 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7290 { (eval echo configure:7291: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7291 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7292 if test -z "$ac_err"; then
7293   rm -rf conftest*
7294   eval "ac_cv_header_$ac_safe=yes"
7295 else
7296   echo "$ac_err" >&5
7297   echo "configure: failed program was:" >&5
7298   cat conftest.$ac_ext >&5
7299   rm -rf conftest*
7300   eval "ac_cv_header_$ac_safe=no"
7301 fi
7302 rm -f conftest*
7303 fi
7304 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7305   echo "$ac_t""yes" 1>&6
7306     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7307   cat >> confdefs.h <<EOF
7308 #define $ac_tr_hdr 1
7309 EOF
7310  
7311 else
7312   echo "$ac_t""no" 1>&6
7313 fi
7314 done
7315
7316
7317         if test $ac_cv_header_tcl_h != yes ; then
7318                 have_tcl=no
7319         else
7320                 echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6
7321 echo "configure:7322: checking for main in -ltcl" >&5
7322 ac_lib_var=`echo tcl'_'main | sed 'y%./+-%__p_%'`
7323 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7324   echo $ac_n "(cached) $ac_c" 1>&6
7325 else
7326   ac_save_LIBS="$LIBS"
7327 LIBS="-ltcl  $LIBS"
7328 cat > conftest.$ac_ext <<EOF
7329 #line 7330 "configure"
7330 #include "confdefs.h"
7331
7332 int main() {
7333 main()
7334 ; return 0; }
7335 EOF
7336 if { (eval echo configure:7337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7337   rm -rf conftest*
7338   eval "ac_cv_lib_$ac_lib_var=yes"
7339 else
7340   echo "configure: failed program was:" >&5
7341   cat conftest.$ac_ext >&5
7342   rm -rf conftest*
7343   eval "ac_cv_lib_$ac_lib_var=no"
7344 fi
7345 rm -f conftest*
7346 LIBS="$ac_save_LIBS"
7347
7348 fi
7349 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7350   echo "$ac_t""yes" 1>&6
7351   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"
7352 else
7353   echo "$ac_t""no" 1>&6
7354 have_tcl=no
7355 fi
7356
7357
7358                 if test $have_tcl != yes; then
7359                         echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6
7360 echo "configure:7361: checking for main in -ltcl7.6" >&5
7361 ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-%__p_%'`
7362 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7363   echo $ac_n "(cached) $ac_c" 1>&6
7364 else
7365   ac_save_LIBS="$LIBS"
7366 LIBS="-ltcl7.6  $LIBS"
7367 cat > conftest.$ac_ext <<EOF
7368 #line 7369 "configure"
7369 #include "confdefs.h"
7370
7371 int main() {
7372 main()
7373 ; return 0; }
7374 EOF
7375 if { (eval echo configure:7376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7376   rm -rf conftest*
7377   eval "ac_cv_lib_$ac_lib_var=yes"
7378 else
7379   echo "configure: failed program was:" >&5
7380   cat conftest.$ac_ext >&5
7381   rm -rf conftest*
7382   eval "ac_cv_lib_$ac_lib_var=no"
7383 fi
7384 rm -f conftest*
7385 LIBS="$ac_save_LIBS"
7386
7387 fi
7388 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7389   echo "$ac_t""yes" 1>&6
7390   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"
7391 else
7392   echo "$ac_t""no" 1>&6
7393 have_tcl=no
7394 fi
7395
7396                 fi
7397
7398                 if test $have_tcl != yes; then
7399                         echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6
7400 echo "configure:7401: checking for main in -ltcl8.0" >&5
7401 ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-%__p_%'`
7402 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7403   echo $ac_n "(cached) $ac_c" 1>&6
7404 else
7405   ac_save_LIBS="$LIBS"
7406 LIBS="-ltcl8.0  $LIBS"
7407 cat > conftest.$ac_ext <<EOF
7408 #line 7409 "configure"
7409 #include "confdefs.h"
7410
7411 int main() {
7412 main()
7413 ; return 0; }
7414 EOF
7415 if { (eval echo configure:7416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7416   rm -rf conftest*
7417   eval "ac_cv_lib_$ac_lib_var=yes"
7418 else
7419   echo "configure: failed program was:" >&5
7420   cat conftest.$ac_ext >&5
7421   rm -rf conftest*
7422   eval "ac_cv_lib_$ac_lib_var=no"
7423 fi
7424 rm -f conftest*
7425 LIBS="$ac_save_LIBS"
7426
7427 fi
7428 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7429   echo "$ac_t""yes" 1>&6
7430   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"
7431 else
7432   echo "$ac_t""no" 1>&6
7433 have_tcl=no
7434 fi
7435
7436                 fi
7437         fi
7438
7439         if test $have_tcl != yes ; then
7440                 echo "configure: warning: could not find -ltcl" 1>&2
7441                 if test $ol_enable_tcl = yes ; then
7442                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
7443                 fi
7444
7445                 ol_enable_tcl=no
7446         fi
7447 fi
7448
7449 # ud needs termcap (should insert check here)
7450 ol_link_termcap=no
7451 for ac_hdr in termcap.h ncurses.h
7452 do
7453 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7454 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7455 echo "configure:7456: checking for $ac_hdr" >&5
7456 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7457   echo $ac_n "(cached) $ac_c" 1>&6
7458 else
7459   cat > conftest.$ac_ext <<EOF
7460 #line 7461 "configure"
7461 #include "confdefs.h"
7462 #include <$ac_hdr>
7463 EOF
7464 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7465 { (eval echo configure:7466: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7466 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7467 if test -z "$ac_err"; then
7468   rm -rf conftest*
7469   eval "ac_cv_header_$ac_safe=yes"
7470 else
7471   echo "$ac_err" >&5
7472   echo "configure: failed program was:" >&5
7473   cat conftest.$ac_ext >&5
7474   rm -rf conftest*
7475   eval "ac_cv_header_$ac_safe=no"
7476 fi
7477 rm -f conftest*
7478 fi
7479 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7480   echo "$ac_t""yes" 1>&6
7481     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7482   cat >> confdefs.h <<EOF
7483 #define $ac_tr_hdr 1
7484 EOF
7485  
7486 else
7487   echo "$ac_t""no" 1>&6
7488 fi
7489 done
7490
7491
7492 if test $ol_link_termcap = no ; then
7493         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
7494 echo "configure:7495: checking for tputs in -ltermcap" >&5
7495 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
7496 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7497   echo $ac_n "(cached) $ac_c" 1>&6
7498 else
7499   ac_save_LIBS="$LIBS"
7500 LIBS="-ltermcap  $LIBS"
7501 cat > conftest.$ac_ext <<EOF
7502 #line 7503 "configure"
7503 #include "confdefs.h"
7504 /* Override any gcc2 internal prototype to avoid an error.  */
7505 /* We use char because int might match the return type of a gcc2
7506     builtin and then its argument prototype would still apply.  */
7507 char tputs();
7508
7509 int main() {
7510 tputs()
7511 ; return 0; }
7512 EOF
7513 if { (eval echo configure:7514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7514   rm -rf conftest*
7515   eval "ac_cv_lib_$ac_lib_var=yes"
7516 else
7517   echo "configure: failed program was:" >&5
7518   cat conftest.$ac_ext >&5
7519   rm -rf conftest*
7520   eval "ac_cv_lib_$ac_lib_var=no"
7521 fi
7522 rm -f conftest*
7523 LIBS="$ac_save_LIBS"
7524
7525 fi
7526 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7527   echo "$ac_t""yes" 1>&6
7528   have_termcap=yes
7529 else
7530   echo "$ac_t""no" 1>&6
7531 have_termcap=no
7532 fi
7533
7534         if test $have_termcap = yes ; then
7535                 cat >> confdefs.h <<\EOF
7536 #define HAVE_TERMCAP 1
7537 EOF
7538
7539                 ol_link_termcap=yes
7540                 TERMCAP_LIBS=-ltermcap
7541         fi
7542 fi
7543
7544 if test $ol_link_termcap = no ; then
7545         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
7546 echo "configure:7547: checking for initscr in -lncurses" >&5
7547 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
7548 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7549   echo $ac_n "(cached) $ac_c" 1>&6
7550 else
7551   ac_save_LIBS="$LIBS"
7552 LIBS="-lncurses  $LIBS"
7553 cat > conftest.$ac_ext <<EOF
7554 #line 7555 "configure"
7555 #include "confdefs.h"
7556 /* Override any gcc2 internal prototype to avoid an error.  */
7557 /* We use char because int might match the return type of a gcc2
7558     builtin and then its argument prototype would still apply.  */
7559 char initscr();
7560
7561 int main() {
7562 initscr()
7563 ; return 0; }
7564 EOF
7565 if { (eval echo configure:7566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7566   rm -rf conftest*
7567   eval "ac_cv_lib_$ac_lib_var=yes"
7568 else
7569   echo "configure: failed program was:" >&5
7570   cat conftest.$ac_ext >&5
7571   rm -rf conftest*
7572   eval "ac_cv_lib_$ac_lib_var=no"
7573 fi
7574 rm -f conftest*
7575 LIBS="$ac_save_LIBS"
7576
7577 fi
7578 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7579   echo "$ac_t""yes" 1>&6
7580   have_ncurses=yes
7581 else
7582   echo "$ac_t""no" 1>&6
7583 have_ncurses=no
7584 fi
7585
7586         if test $have_ncurses = yes ; then
7587                 cat >> confdefs.h <<\EOF
7588 #define HAVE_NCURSES 1
7589 EOF
7590
7591                 ol_link_termcap=yes
7592                 TERMCAP_LIBS=-lncurses
7593         fi
7594 fi
7595
7596 if test $ol_link_termcap = no ; then
7597         cat >> confdefs.h <<\EOF
7598 #define NO_TERMCAP 1
7599 EOF
7600
7601         TERMCAP_LIBS=
7602 fi
7603
7604 # FreeBSD (and others) have crypt(3) in -lcrypt
7605 if test $ol_enable_crypt != no ; then
7606         echo $ac_n "checking for crypt""... $ac_c" 1>&6
7607 echo "configure:7608: checking for crypt" >&5
7608 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
7609   echo $ac_n "(cached) $ac_c" 1>&6
7610 else
7611   cat > conftest.$ac_ext <<EOF
7612 #line 7613 "configure"
7613 #include "confdefs.h"
7614 /* System header to define __stub macros and hopefully few prototypes,
7615     which can conflict with char crypt(); below.  */
7616 #include <assert.h>
7617 /* Override any gcc2 internal prototype to avoid an error.  */
7618 /* We use char because int might match the return type of a gcc2
7619     builtin and then its argument prototype would still apply.  */
7620 char crypt();
7621
7622 int main() {
7623
7624 /* The GNU C library defines this for functions which it implements
7625     to always fail with ENOSYS.  Some functions are actually named
7626     something starting with __ and the normal name is an alias.  */
7627 #if defined (__stub_crypt) || defined (__stub___crypt)
7628 choke me
7629 #else
7630 crypt();
7631 #endif
7632
7633 ; return 0; }
7634 EOF
7635 if { (eval echo configure:7636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7636   rm -rf conftest*
7637   eval "ac_cv_func_crypt=yes"
7638 else
7639   echo "configure: failed program was:" >&5
7640   cat conftest.$ac_ext >&5
7641   rm -rf conftest*
7642   eval "ac_cv_func_crypt=no"
7643 fi
7644 rm -f conftest*
7645 fi
7646
7647 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
7648   echo "$ac_t""yes" 1>&6
7649   have_crypt=yes
7650 else
7651   echo "$ac_t""no" 1>&6
7652
7653                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
7654 echo "configure:7655: checking for crypt in -lcrypt" >&5
7655 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
7656 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7657   echo $ac_n "(cached) $ac_c" 1>&6
7658 else
7659   ac_save_LIBS="$LIBS"
7660 LIBS="-lcrypt  $LIBS"
7661 cat > conftest.$ac_ext <<EOF
7662 #line 7663 "configure"
7663 #include "confdefs.h"
7664 /* Override any gcc2 internal prototype to avoid an error.  */
7665 /* We use char because int might match the return type of a gcc2
7666     builtin and then its argument prototype would still apply.  */
7667 char crypt();
7668
7669 int main() {
7670 crypt()
7671 ; return 0; }
7672 EOF
7673 if { (eval echo configure:7674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7674   rm -rf conftest*
7675   eval "ac_cv_lib_$ac_lib_var=yes"
7676 else
7677   echo "configure: failed program was:" >&5
7678   cat conftest.$ac_ext >&5
7679   rm -rf conftest*
7680   eval "ac_cv_lib_$ac_lib_var=no"
7681 fi
7682 rm -f conftest*
7683 LIBS="$ac_save_LIBS"
7684
7685 fi
7686 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7687   echo "$ac_t""yes" 1>&6
7688   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
7689                         have_crypt=yes
7690 else
7691   echo "$ac_t""no" 1>&6
7692 have_crypt=no
7693 fi
7694
7695 fi
7696
7697
7698         if test $have_crypt = yes ; then
7699                 cat >> confdefs.h <<\EOF
7700 #define HAVE_CRYPT 1
7701 EOF
7702
7703         else
7704                 echo "configure: warning: could not find crypt" 1>&2
7705                 if test $ol_enable_crypt = yes ; then
7706                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
7707                 fi
7708
7709                 echo "configure: warning: disabling crypt support" 1>&2
7710                 ol_enable_crypt=no
7711         fi
7712 fi
7713
7714 # FreeBSD (and others) have setproctitle(3) in -lutil
7715 if test $ol_enable_proctitle != no ; then
7716         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
7717 echo "configure:7718: checking for setproctitle" >&5
7718 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
7719   echo $ac_n "(cached) $ac_c" 1>&6
7720 else
7721   cat > conftest.$ac_ext <<EOF
7722 #line 7723 "configure"
7723 #include "confdefs.h"
7724 /* System header to define __stub macros and hopefully few prototypes,
7725     which can conflict with char setproctitle(); below.  */
7726 #include <assert.h>
7727 /* Override any gcc2 internal prototype to avoid an error.  */
7728 /* We use char because int might match the return type of a gcc2
7729     builtin and then its argument prototype would still apply.  */
7730 char setproctitle();
7731
7732 int main() {
7733
7734 /* The GNU C library defines this for functions which it implements
7735     to always fail with ENOSYS.  Some functions are actually named
7736     something starting with __ and the normal name is an alias.  */
7737 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
7738 choke me
7739 #else
7740 setproctitle();
7741 #endif
7742
7743 ; return 0; }
7744 EOF
7745 if { (eval echo configure:7746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7746   rm -rf conftest*
7747   eval "ac_cv_func_setproctitle=yes"
7748 else
7749   echo "configure: failed program was:" >&5
7750   cat conftest.$ac_ext >&5
7751   rm -rf conftest*
7752   eval "ac_cv_func_setproctitle=no"
7753 fi
7754 rm -f conftest*
7755 fi
7756
7757 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
7758   echo "$ac_t""yes" 1>&6
7759   have_setproctitle=yes
7760 else
7761   echo "$ac_t""no" 1>&6
7762
7763                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
7764 echo "configure:7765: checking for setproctitle in -lutil" >&5
7765 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
7766 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7767   echo $ac_n "(cached) $ac_c" 1>&6
7768 else
7769   ac_save_LIBS="$LIBS"
7770 LIBS="-lutil  $LIBS"
7771 cat > conftest.$ac_ext <<EOF
7772 #line 7773 "configure"
7773 #include "confdefs.h"
7774 /* Override any gcc2 internal prototype to avoid an error.  */
7775 /* We use char because int might match the return type of a gcc2
7776     builtin and then its argument prototype would still apply.  */
7777 char setproctitle();
7778
7779 int main() {
7780 setproctitle()
7781 ; return 0; }
7782 EOF
7783 if { (eval echo configure:7784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7784   rm -rf conftest*
7785   eval "ac_cv_lib_$ac_lib_var=yes"
7786 else
7787   echo "configure: failed program was:" >&5
7788   cat conftest.$ac_ext >&5
7789   rm -rf conftest*
7790   eval "ac_cv_lib_$ac_lib_var=no"
7791 fi
7792 rm -f conftest*
7793 LIBS="$ac_save_LIBS"
7794
7795 fi
7796 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7797   echo "$ac_t""yes" 1>&6
7798   have_setproctitle=yes
7799                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
7800 else
7801   echo "$ac_t""no" 1>&6
7802 have_setproctitle=no
7803                         LIBOBJS="$LIBOBJS setproctitle.o"
7804 fi
7805
7806 fi
7807
7808
7809         if test $have_setproctitle = yes ; then
7810                 cat >> confdefs.h <<\EOF
7811 #define HAVE_SETPROCTITLE 1
7812 EOF
7813
7814         fi
7815 fi
7816
7817 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
7818 echo "configure:7819: checking for ANSI C header files" >&5
7819 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
7820   echo $ac_n "(cached) $ac_c" 1>&6
7821 else
7822   cat > conftest.$ac_ext <<EOF
7823 #line 7824 "configure"
7824 #include "confdefs.h"
7825 #include <stdlib.h>
7826 #include <stdarg.h>
7827 #include <string.h>
7828 #include <float.h>
7829 EOF
7830 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7831 { (eval echo configure:7832: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7832 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7833 if test -z "$ac_err"; then
7834   rm -rf conftest*
7835   ac_cv_header_stdc=yes
7836 else
7837   echo "$ac_err" >&5
7838   echo "configure: failed program was:" >&5
7839   cat conftest.$ac_ext >&5
7840   rm -rf conftest*
7841   ac_cv_header_stdc=no
7842 fi
7843 rm -f conftest*
7844
7845 if test $ac_cv_header_stdc = yes; then
7846   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
7847 cat > conftest.$ac_ext <<EOF
7848 #line 7849 "configure"
7849 #include "confdefs.h"
7850 #include <string.h>
7851 EOF
7852 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7853   egrep "memchr" >/dev/null 2>&1; then
7854   :
7855 else
7856   rm -rf conftest*
7857   ac_cv_header_stdc=no
7858 fi
7859 rm -f conftest*
7860
7861 fi
7862
7863 if test $ac_cv_header_stdc = yes; then
7864   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
7865 cat > conftest.$ac_ext <<EOF
7866 #line 7867 "configure"
7867 #include "confdefs.h"
7868 #include <stdlib.h>
7869 EOF
7870 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7871   egrep "free" >/dev/null 2>&1; then
7872   :
7873 else
7874   rm -rf conftest*
7875   ac_cv_header_stdc=no
7876 fi
7877 rm -f conftest*
7878
7879 fi
7880
7881 if test $ac_cv_header_stdc = yes; then
7882   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
7883 if test "$cross_compiling" = yes; then
7884   :
7885 else
7886   cat > conftest.$ac_ext <<EOF
7887 #line 7888 "configure"
7888 #include "confdefs.h"
7889 #include <ctype.h>
7890 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
7891 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
7892 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
7893 int main () { int i; for (i = 0; i < 256; i++)
7894 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
7895 exit (0); }
7896
7897 EOF
7898 if { (eval echo configure:7899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7899 then
7900   :
7901 else
7902   echo "configure: failed program was:" >&5
7903   cat conftest.$ac_ext >&5
7904   rm -fr conftest*
7905   ac_cv_header_stdc=no
7906 fi
7907 rm -fr conftest*
7908 fi
7909
7910 fi
7911 fi
7912
7913 echo "$ac_t""$ac_cv_header_stdc" 1>&6
7914 if test $ac_cv_header_stdc = yes; then
7915   cat >> confdefs.h <<\EOF
7916 #define STDC_HEADERS 1
7917 EOF
7918
7919 fi
7920
7921
7922 if test $ac_cv_header_stdc != yes; then
7923         echo "configure: warning: could not Standard C compliant headers" 1>&2
7924 fi
7925
7926 ac_header_dirent=no
7927 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
7928 do
7929 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7930 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
7931 echo "configure:7932: checking for $ac_hdr that defines DIR" >&5
7932 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
7933   echo $ac_n "(cached) $ac_c" 1>&6
7934 else
7935   cat > conftest.$ac_ext <<EOF
7936 #line 7937 "configure"
7937 #include "confdefs.h"
7938 #include <sys/types.h>
7939 #include <$ac_hdr>
7940 int main() {
7941 DIR *dirp = 0;
7942 ; return 0; }
7943 EOF
7944 if { (eval echo configure:7945: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7945   rm -rf conftest*
7946   eval "ac_cv_header_dirent_$ac_safe=yes"
7947 else
7948   echo "configure: failed program was:" >&5
7949   cat conftest.$ac_ext >&5
7950   rm -rf conftest*
7951   eval "ac_cv_header_dirent_$ac_safe=no"
7952 fi
7953 rm -f conftest*
7954 fi
7955 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
7956   echo "$ac_t""yes" 1>&6
7957     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7958   cat >> confdefs.h <<EOF
7959 #define $ac_tr_hdr 1
7960 EOF
7961  ac_header_dirent=$ac_hdr; break
7962 else
7963   echo "$ac_t""no" 1>&6
7964 fi
7965 done
7966 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
7967 if test $ac_header_dirent = dirent.h; then
7968 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
7969 echo "configure:7970: checking for opendir in -ldir" >&5
7970 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
7971 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7972   echo $ac_n "(cached) $ac_c" 1>&6
7973 else
7974   ac_save_LIBS="$LIBS"
7975 LIBS="-ldir  $LIBS"
7976 cat > conftest.$ac_ext <<EOF
7977 #line 7978 "configure"
7978 #include "confdefs.h"
7979 /* Override any gcc2 internal prototype to avoid an error.  */
7980 /* We use char because int might match the return type of a gcc2
7981     builtin and then its argument prototype would still apply.  */
7982 char opendir();
7983
7984 int main() {
7985 opendir()
7986 ; return 0; }
7987 EOF
7988 if { (eval echo configure:7989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7989   rm -rf conftest*
7990   eval "ac_cv_lib_$ac_lib_var=yes"
7991 else
7992   echo "configure: failed program was:" >&5
7993   cat conftest.$ac_ext >&5
7994   rm -rf conftest*
7995   eval "ac_cv_lib_$ac_lib_var=no"
7996 fi
7997 rm -f conftest*
7998 LIBS="$ac_save_LIBS"
7999
8000 fi
8001 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8002   echo "$ac_t""yes" 1>&6
8003   LIBS="$LIBS -ldir"
8004 else
8005   echo "$ac_t""no" 1>&6
8006 fi
8007
8008 else
8009 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
8010 echo "configure:8011: checking for opendir in -lx" >&5
8011 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
8012 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8013   echo $ac_n "(cached) $ac_c" 1>&6
8014 else
8015   ac_save_LIBS="$LIBS"
8016 LIBS="-lx  $LIBS"
8017 cat > conftest.$ac_ext <<EOF
8018 #line 8019 "configure"
8019 #include "confdefs.h"
8020 /* Override any gcc2 internal prototype to avoid an error.  */
8021 /* We use char because int might match the return type of a gcc2
8022     builtin and then its argument prototype would still apply.  */
8023 char opendir();
8024
8025 int main() {
8026 opendir()
8027 ; return 0; }
8028 EOF
8029 if { (eval echo configure:8030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8030   rm -rf conftest*
8031   eval "ac_cv_lib_$ac_lib_var=yes"
8032 else
8033   echo "configure: failed program was:" >&5
8034   cat conftest.$ac_ext >&5
8035   rm -rf conftest*
8036   eval "ac_cv_lib_$ac_lib_var=no"
8037 fi
8038 rm -f conftest*
8039 LIBS="$ac_save_LIBS"
8040
8041 fi
8042 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8043   echo "$ac_t""yes" 1>&6
8044   LIBS="$LIBS -lx"
8045 else
8046   echo "$ac_t""no" 1>&6
8047 fi
8048
8049 fi
8050
8051 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
8052 echo "configure:8053: checking for sys/wait.h that is POSIX.1 compatible" >&5
8053 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
8054   echo $ac_n "(cached) $ac_c" 1>&6
8055 else
8056   cat > conftest.$ac_ext <<EOF
8057 #line 8058 "configure"
8058 #include "confdefs.h"
8059 #include <sys/types.h>
8060 #include <sys/wait.h>
8061 #ifndef WEXITSTATUS
8062 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
8063 #endif
8064 #ifndef WIFEXITED
8065 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
8066 #endif
8067 int main() {
8068 int s;
8069 wait (&s);
8070 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
8071 ; return 0; }
8072 EOF
8073 if { (eval echo configure:8074: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8074   rm -rf conftest*
8075   ac_cv_header_sys_wait_h=yes
8076 else
8077   echo "configure: failed program was:" >&5
8078   cat conftest.$ac_ext >&5
8079   rm -rf conftest*
8080   ac_cv_header_sys_wait_h=no
8081 fi
8082 rm -f conftest*
8083 fi
8084
8085 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
8086 if test $ac_cv_header_sys_wait_h = yes; then
8087   cat >> confdefs.h <<\EOF
8088 #define HAVE_SYS_WAIT_H 1
8089 EOF
8090
8091 fi
8092
8093 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
8094 echo "configure:8095: checking POSIX termios" >&5
8095 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
8096   echo $ac_n "(cached) $ac_c" 1>&6
8097 else
8098   cat > conftest.$ac_ext <<EOF
8099 #line 8100 "configure"
8100 #include "confdefs.h"
8101 #include <sys/types.h>
8102 #include <unistd.h>
8103 #include <termios.h>
8104 int main() {
8105 /* SunOS 4.0.3 has termios.h but not the library calls.  */
8106    tcgetattr(0, 0);
8107 ; return 0; }
8108 EOF
8109 if { (eval echo configure:8110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8110   rm -rf conftest*
8111   am_cv_sys_posix_termios=yes
8112 else
8113   echo "configure: failed program was:" >&5
8114   cat conftest.$ac_ext >&5
8115   rm -rf conftest*
8116   am_cv_sys_posix_termios=no
8117 fi
8118 rm -f conftest*
8119 fi
8120
8121 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
8122
8123
8124  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
8125 echo "configure:8126: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
8126 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
8127   echo $ac_n "(cached) $ac_c" 1>&6
8128 else
8129   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
8130
8131   gwinsz_in_termios_h=no
8132   if test $am_cv_sys_posix_termios = yes; then
8133     cat > conftest.$ac_ext <<EOF
8134 #line 8135 "configure"
8135 #include "confdefs.h"
8136 #include <sys/types.h>
8137 #     include <termios.h>
8138 #     ifdef TIOCGWINSZ
8139         yes
8140 #     endif
8141     
8142 EOF
8143 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8144   egrep "yes" >/dev/null 2>&1; then
8145   rm -rf conftest*
8146   gwinsz_in_termios_h=yes
8147 fi
8148 rm -f conftest*
8149
8150   fi
8151
8152   if test $gwinsz_in_termios_h = no; then
8153     cat > conftest.$ac_ext <<EOF
8154 #line 8155 "configure"
8155 #include "confdefs.h"
8156 #include <sys/types.h>
8157 #     include <sys/ioctl.h>
8158 #     ifdef TIOCGWINSZ
8159         yes
8160 #     endif
8161     
8162 EOF
8163 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8164   egrep "yes" >/dev/null 2>&1; then
8165   rm -rf conftest*
8166   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
8167 fi
8168 rm -f conftest*
8169
8170   fi
8171   
8172 fi
8173
8174 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
8175   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
8176     cat >> confdefs.h <<\EOF
8177 #define GWINSZ_IN_SYS_IOCTL 1
8178 EOF
8179
8180   fi
8181
8182 if test $am_cv_sys_posix_termios = yes ; then
8183         cat >> confdefs.h <<\EOF
8184 #define HAVE_POSIX_TERMIOS 1
8185 EOF
8186
8187 fi
8188
8189 for ac_hdr in \
8190         arpa/nameser.h  \
8191         crypt.h                 \
8192         errno.h                 \
8193         fcntl.h                 \
8194         filio.h                 \
8195         getopt.h                \
8196         libutil.h               \
8197         limits.h                \
8198         locale.h                \
8199         malloc.h                \
8200         memory.h                \
8201         regex.h                 \
8202         psap.h                  \
8203         pwd.h                   \
8204         resolv.h                \
8205         sgtty.h                 \
8206         stdarg.h                \
8207         stddef.h                \
8208         string.h                \
8209         strings.h               \
8210         sysexits.h              \
8211         sys/file.h              \
8212         sys/filio.h             \
8213         sys/errno.h             \
8214         sys/ioctl.h             \
8215         sys/param.h             \
8216         sys/resource.h  \
8217         sys/socket.h    \
8218         sys/syslog.h    \
8219         sys/time.h              \
8220         sys/types.h             \
8221         syslog.h                \
8222         termios.h               \
8223         unistd.h                \
8224
8225 do
8226 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8227 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8228 echo "configure:8229: checking for $ac_hdr" >&5
8229 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8230   echo $ac_n "(cached) $ac_c" 1>&6
8231 else
8232   cat > conftest.$ac_ext <<EOF
8233 #line 8234 "configure"
8234 #include "confdefs.h"
8235 #include <$ac_hdr>
8236 EOF
8237 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8238 { (eval echo configure:8239: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8239 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8240 if test -z "$ac_err"; then
8241   rm -rf conftest*
8242   eval "ac_cv_header_$ac_safe=yes"
8243 else
8244   echo "$ac_err" >&5
8245   echo "configure: failed program was:" >&5
8246   cat conftest.$ac_ext >&5
8247   rm -rf conftest*
8248   eval "ac_cv_header_$ac_safe=no"
8249 fi
8250 rm -f conftest*
8251 fi
8252 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8253   echo "$ac_t""yes" 1>&6
8254     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8255   cat >> confdefs.h <<EOF
8256 #define $ac_tr_hdr 1
8257 EOF
8258  
8259 else
8260   echo "$ac_t""no" 1>&6
8261 fi
8262 done
8263
8264
8265 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
8266 echo "configure:8267: checking for uid_t in sys/types.h" >&5
8267 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
8268   echo $ac_n "(cached) $ac_c" 1>&6
8269 else
8270   cat > conftest.$ac_ext <<EOF
8271 #line 8272 "configure"
8272 #include "confdefs.h"
8273 #include <sys/types.h>
8274 EOF
8275 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8276   egrep "uid_t" >/dev/null 2>&1; then
8277   rm -rf conftest*
8278   ac_cv_type_uid_t=yes
8279 else
8280   rm -rf conftest*
8281   ac_cv_type_uid_t=no
8282 fi
8283 rm -f conftest*
8284
8285 fi
8286
8287 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
8288 if test $ac_cv_type_uid_t = no; then
8289   cat >> confdefs.h <<\EOF
8290 #define uid_t int
8291 EOF
8292
8293   cat >> confdefs.h <<\EOF
8294 #define gid_t int
8295 EOF
8296
8297 fi
8298
8299 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
8300 echo "configure:8301: checking type of array argument to getgroups" >&5
8301 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
8302   echo $ac_n "(cached) $ac_c" 1>&6
8303 else
8304   if test "$cross_compiling" = yes; then
8305   ac_cv_type_getgroups=cross
8306 else
8307   cat > conftest.$ac_ext <<EOF
8308 #line 8309 "configure"
8309 #include "confdefs.h"
8310
8311 /* Thanks to Mike Rendell for this test.  */
8312 #include <sys/types.h>
8313 #define NGID 256
8314 #undef MAX
8315 #define MAX(x, y) ((x) > (y) ? (x) : (y))
8316 main()
8317 {
8318   gid_t gidset[NGID];
8319   int i, n;
8320   union { gid_t gval; long lval; }  val;
8321
8322   val.lval = -1;
8323   for (i = 0; i < NGID; i++)
8324     gidset[i] = val.gval;
8325   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
8326                  gidset);
8327   /* Exit non-zero if getgroups seems to require an array of ints.  This
8328      happens when gid_t is short but getgroups modifies an array of ints.  */
8329   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
8330 }
8331
8332 EOF
8333 if { (eval echo configure:8334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8334 then
8335     ac_cv_type_getgroups=gid_t
8336 else
8337   echo "configure: failed program was:" >&5
8338   cat conftest.$ac_ext >&5
8339   rm -fr conftest*
8340   ac_cv_type_getgroups=int
8341 fi
8342 rm -fr conftest*
8343 fi
8344
8345 if test $ac_cv_type_getgroups = cross; then
8346         cat > conftest.$ac_ext <<EOF
8347 #line 8348 "configure"
8348 #include "confdefs.h"
8349 #include <unistd.h>
8350 EOF
8351 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8352   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
8353   rm -rf conftest*
8354   ac_cv_type_getgroups=gid_t
8355 else
8356   rm -rf conftest*
8357   ac_cv_type_getgroups=int
8358 fi
8359 rm -f conftest*
8360
8361 fi
8362 fi
8363
8364 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
8365 cat >> confdefs.h <<EOF
8366 #define GETGROUPS_T $ac_cv_type_getgroups
8367 EOF
8368
8369  echo $ac_n "checking for mode_t""... $ac_c" 1>&6
8370 echo "configure:8371: checking for mode_t" >&5
8371 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
8372   echo $ac_n "(cached) $ac_c" 1>&6
8373 else
8374   cat > conftest.$ac_ext <<EOF
8375 #line 8376 "configure"
8376 #include "confdefs.h"
8377 #include <sys/types.h>
8378 #if STDC_HEADERS
8379 #include <stdlib.h>
8380 #include <stddef.h>
8381 #endif
8382 EOF
8383 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8384   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
8385   rm -rf conftest*
8386   ac_cv_type_mode_t=yes
8387 else
8388   rm -rf conftest*
8389   ac_cv_type_mode_t=no
8390 fi
8391 rm -f conftest*
8392
8393 fi
8394 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
8395 if test $ac_cv_type_mode_t = no; then
8396   cat >> confdefs.h <<\EOF
8397 #define mode_t int
8398 EOF
8399
8400 fi
8401
8402 echo $ac_n "checking for off_t""... $ac_c" 1>&6
8403 echo "configure:8404: checking for off_t" >&5
8404 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
8405   echo $ac_n "(cached) $ac_c" 1>&6
8406 else
8407   cat > conftest.$ac_ext <<EOF
8408 #line 8409 "configure"
8409 #include "confdefs.h"
8410 #include <sys/types.h>
8411 #if STDC_HEADERS
8412 #include <stdlib.h>
8413 #include <stddef.h>
8414 #endif
8415 EOF
8416 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8417   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
8418   rm -rf conftest*
8419   ac_cv_type_off_t=yes
8420 else
8421   rm -rf conftest*
8422   ac_cv_type_off_t=no
8423 fi
8424 rm -f conftest*
8425
8426 fi
8427 echo "$ac_t""$ac_cv_type_off_t" 1>&6
8428 if test $ac_cv_type_off_t = no; then
8429   cat >> confdefs.h <<\EOF
8430 #define off_t long
8431 EOF
8432
8433 fi
8434
8435 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
8436 echo "configure:8437: checking for pid_t" >&5
8437 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
8438   echo $ac_n "(cached) $ac_c" 1>&6
8439 else
8440   cat > conftest.$ac_ext <<EOF
8441 #line 8442 "configure"
8442 #include "confdefs.h"
8443 #include <sys/types.h>
8444 #if STDC_HEADERS
8445 #include <stdlib.h>
8446 #include <stddef.h>
8447 #endif
8448 EOF
8449 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8450   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
8451   rm -rf conftest*
8452   ac_cv_type_pid_t=yes
8453 else
8454   rm -rf conftest*
8455   ac_cv_type_pid_t=no
8456 fi
8457 rm -f conftest*
8458
8459 fi
8460 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
8461 if test $ac_cv_type_pid_t = no; then
8462   cat >> confdefs.h <<\EOF
8463 #define pid_t int
8464 EOF
8465
8466 fi
8467
8468 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
8469 echo "configure:8470: checking for ptrdiff_t" >&5
8470 if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then
8471   echo $ac_n "(cached) $ac_c" 1>&6
8472 else
8473   cat > conftest.$ac_ext <<EOF
8474 #line 8475 "configure"
8475 #include "confdefs.h"
8476 #include <stddef.h>
8477 int main() {
8478 ptrdiff_t p
8479 ; return 0; }
8480 EOF
8481 if { (eval echo configure:8482: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8482   rm -rf conftest*
8483   am_cv_type_ptrdiff_t=yes
8484 else
8485   echo "configure: failed program was:" >&5
8486   cat conftest.$ac_ext >&5
8487   rm -rf conftest*
8488   am_cv_type_ptrdiff_t=no
8489 fi
8490 rm -f conftest*
8491 fi
8492
8493 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
8494    if test $am_cv_type_ptrdiff_t = yes; then
8495      cat >> confdefs.h <<\EOF
8496 #define HAVE_PTRDIFF_T 1
8497 EOF
8498
8499    fi
8500
8501 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
8502 echo "configure:8503: checking return type of signal handlers" >&5
8503 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
8504   echo $ac_n "(cached) $ac_c" 1>&6
8505 else
8506   cat > conftest.$ac_ext <<EOF
8507 #line 8508 "configure"
8508 #include "confdefs.h"
8509 #include <sys/types.h>
8510 #include <signal.h>
8511 #ifdef signal
8512 #undef signal
8513 #endif
8514 #ifdef __cplusplus
8515 extern "C" void (*signal (int, void (*)(int)))(int);
8516 #else
8517 void (*signal ()) ();
8518 #endif
8519
8520 int main() {
8521 int i;
8522 ; return 0; }
8523 EOF
8524 if { (eval echo configure:8525: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8525   rm -rf conftest*
8526   ac_cv_type_signal=void
8527 else
8528   echo "configure: failed program was:" >&5
8529   cat conftest.$ac_ext >&5
8530   rm -rf conftest*
8531   ac_cv_type_signal=int
8532 fi
8533 rm -f conftest*
8534 fi
8535
8536 echo "$ac_t""$ac_cv_type_signal" 1>&6
8537 cat >> confdefs.h <<EOF
8538 #define RETSIGTYPE $ac_cv_type_signal
8539 EOF
8540
8541
8542 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
8543 echo "configure:8544: checking for sig_atomic_t" >&5
8544 if eval "test \"`echo '$''{'ol_cv_type_sig_atomic_t'+set}'`\" = set"; then
8545   echo $ac_n "(cached) $ac_c" 1>&6
8546 else
8547   cat > conftest.$ac_ext <<EOF
8548 #line 8549 "configure"
8549 #include "confdefs.h"
8550 #include <signal.h>
8551 int main() {
8552 sig_atomic_t atomic;
8553 ; return 0; }
8554 EOF
8555 if { (eval echo configure:8556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8556   rm -rf conftest*
8557   ol_cv_type_sig_atomic_t=yes
8558 else
8559   echo "configure: failed program was:" >&5
8560   cat conftest.$ac_ext >&5
8561   rm -rf conftest*
8562   ol_cv_type_sig_atomic_t=no
8563 fi
8564 rm -f conftest*
8565 fi
8566
8567 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
8568   if test $ol_cv_type_sig_atomic_t = no; then
8569     cat >> confdefs.h <<\EOF
8570 #define sig_atomic_t int
8571 EOF
8572
8573   fi
8574  
8575 echo $ac_n "checking for size_t""... $ac_c" 1>&6
8576 echo "configure:8577: checking for size_t" >&5
8577 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
8578   echo $ac_n "(cached) $ac_c" 1>&6
8579 else
8580   cat > conftest.$ac_ext <<EOF
8581 #line 8582 "configure"
8582 #include "confdefs.h"
8583 #include <sys/types.h>
8584 #if STDC_HEADERS
8585 #include <stdlib.h>
8586 #include <stddef.h>
8587 #endif
8588 EOF
8589 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8590   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
8591   rm -rf conftest*
8592   ac_cv_type_size_t=yes
8593 else
8594   rm -rf conftest*
8595   ac_cv_type_size_t=no
8596 fi
8597 rm -f conftest*
8598
8599 fi
8600 echo "$ac_t""$ac_cv_type_size_t" 1>&6
8601 if test $ac_cv_type_size_t = no; then
8602   cat >> confdefs.h <<\EOF
8603 #define size_t unsigned
8604 EOF
8605
8606 fi
8607
8608 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
8609 echo "configure:8610: checking for st_blksize in struct stat" >&5
8610 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
8611   echo $ac_n "(cached) $ac_c" 1>&6
8612 else
8613   cat > conftest.$ac_ext <<EOF
8614 #line 8615 "configure"
8615 #include "confdefs.h"
8616 #include <sys/types.h>
8617 #include <sys/stat.h>
8618 int main() {
8619 struct stat s; s.st_blksize;
8620 ; return 0; }
8621 EOF
8622 if { (eval echo configure:8623: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8623   rm -rf conftest*
8624   ac_cv_struct_st_blksize=yes
8625 else
8626   echo "configure: failed program was:" >&5
8627   cat conftest.$ac_ext >&5
8628   rm -rf conftest*
8629   ac_cv_struct_st_blksize=no
8630 fi
8631 rm -f conftest*
8632 fi
8633
8634 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
8635 if test $ac_cv_struct_st_blksize = yes; then
8636   cat >> confdefs.h <<\EOF
8637 #define HAVE_ST_BLKSIZE 1
8638 EOF
8639
8640 fi
8641
8642 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
8643 echo "configure:8644: checking whether time.h and sys/time.h may both be included" >&5
8644 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
8645   echo $ac_n "(cached) $ac_c" 1>&6
8646 else
8647   cat > conftest.$ac_ext <<EOF
8648 #line 8649 "configure"
8649 #include "confdefs.h"
8650 #include <sys/types.h>
8651 #include <sys/time.h>
8652 #include <time.h>
8653 int main() {
8654 struct tm *tp;
8655 ; return 0; }
8656 EOF
8657 if { (eval echo configure:8658: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8658   rm -rf conftest*
8659   ac_cv_header_time=yes
8660 else
8661   echo "configure: failed program was:" >&5
8662   cat conftest.$ac_ext >&5
8663   rm -rf conftest*
8664   ac_cv_header_time=no
8665 fi
8666 rm -f conftest*
8667 fi
8668
8669 echo "$ac_t""$ac_cv_header_time" 1>&6
8670 if test $ac_cv_header_time = yes; then
8671   cat >> confdefs.h <<\EOF
8672 #define TIME_WITH_SYS_TIME 1
8673 EOF
8674
8675 fi
8676
8677 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
8678 echo "configure:8679: checking whether struct tm is in sys/time.h or time.h" >&5
8679 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
8680   echo $ac_n "(cached) $ac_c" 1>&6
8681 else
8682   cat > conftest.$ac_ext <<EOF
8683 #line 8684 "configure"
8684 #include "confdefs.h"
8685 #include <sys/types.h>
8686 #include <time.h>
8687 int main() {
8688 struct tm *tp; tp->tm_sec;
8689 ; return 0; }
8690 EOF
8691 if { (eval echo configure:8692: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8692   rm -rf conftest*
8693   ac_cv_struct_tm=time.h
8694 else
8695   echo "configure: failed program was:" >&5
8696   cat conftest.$ac_ext >&5
8697   rm -rf conftest*
8698   ac_cv_struct_tm=sys/time.h
8699 fi
8700 rm -f conftest*
8701 fi
8702
8703 echo "$ac_t""$ac_cv_struct_tm" 1>&6
8704 if test $ac_cv_struct_tm = sys/time.h; then
8705   cat >> confdefs.h <<\EOF
8706 #define TM_IN_SYS_TIME 1
8707 EOF
8708
8709 fi
8710
8711
8712
8713 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
8714 echo "configure:8715: checking if toupper() requires islower()" >&5
8715 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
8716   echo $ac_n "(cached) $ac_c" 1>&6
8717 else
8718   
8719         if test "$cross_compiling" = yes; then
8720   ol_cv_c_upper_lower=safe
8721 else
8722   cat > conftest.$ac_ext <<EOF
8723 #line 8724 "configure"
8724 #include "confdefs.h"
8725
8726 #include <ctype.h>
8727 main()
8728 {
8729         if ('C' == toupper('C'))
8730                 exit(0);
8731         else
8732                 exit(1);
8733 }
8734 EOF
8735 if { (eval echo configure:8736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8736 then
8737   ol_cv_c_upper_lower=no
8738 else
8739   echo "configure: failed program was:" >&5
8740   cat conftest.$ac_ext >&5
8741   rm -fr conftest*
8742   ol_cv_c_upper_lower=yes
8743 fi
8744 rm -fr conftest*
8745 fi
8746
8747 fi
8748
8749 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
8750 if test $ol_cv_c_upper_lower != no ; then
8751         cat >> confdefs.h <<\EOF
8752 #define C_UPPER_LOWER 1
8753 EOF
8754
8755 fi
8756
8757 echo $ac_n "checking for working const""... $ac_c" 1>&6
8758 echo "configure:8759: checking for working const" >&5
8759 if eval "test \"`echo '$''{'ac_cv_c_const'+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
8766 int main() {
8767
8768 /* Ultrix mips cc rejects this.  */
8769 typedef int charset[2]; const charset x;
8770 /* SunOS 4.1.1 cc rejects this.  */
8771 char const *const *ccp;
8772 char **p;
8773 /* NEC SVR4.0.2 mips cc rejects this.  */
8774 struct point {int x, y;};
8775 static struct point const zero = {0,0};
8776 /* AIX XL C 1.02.0.0 rejects this.
8777    It does not let you subtract one const X* pointer from another in an arm
8778    of an if-expression whose if-part is not a constant expression */
8779 const char *g = "string";
8780 ccp = &g + (g ? g-g : 0);
8781 /* HPUX 7.0 cc rejects these. */
8782 ++ccp;
8783 p = (char**) ccp;
8784 ccp = (char const *const *) p;
8785 { /* SCO 3.2v4 cc rejects this.  */
8786   char *t;
8787   char const *s = 0 ? (char *) 0 : (char const *) 0;
8788
8789   *t++ = 0;
8790 }
8791 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
8792   int x[] = {25, 17};
8793   const int *foo = &x[0];
8794   ++foo;
8795 }
8796 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
8797   typedef const int *iptr;
8798   iptr p = 0;
8799   ++p;
8800 }
8801 { /* AIX XL C 1.02.0.0 rejects this saying
8802      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
8803   struct s { int j; const int *ap[3]; };
8804   struct s *b; b->j = 5;
8805 }
8806 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
8807   const int foo = 10;
8808 }
8809
8810 ; return 0; }
8811 EOF
8812 if { (eval echo configure:8813: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8813   rm -rf conftest*
8814   ac_cv_c_const=yes
8815 else
8816   echo "configure: failed program was:" >&5
8817   cat conftest.$ac_ext >&5
8818   rm -rf conftest*
8819   ac_cv_c_const=no
8820 fi
8821 rm -f conftest*
8822 fi
8823
8824 echo "$ac_t""$ac_cv_c_const" 1>&6
8825 if test $ac_cv_c_const = no; then
8826   cat >> confdefs.h <<\EOF
8827 #define const 
8828 EOF
8829
8830 fi
8831
8832 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
8833 echo "configure:8834: checking if compiler understands volatile" >&5
8834 if eval "test \"`echo '$''{'ol_cv_c_volatile'+set}'`\" = set"; then
8835   echo $ac_n "(cached) $ac_c" 1>&6
8836 else
8837   cat > conftest.$ac_ext <<EOF
8838 #line 8839 "configure"
8839 #include "confdefs.h"
8840 int x, y, z;
8841 int main() {
8842 volatile int a; int * volatile b = x ? &y : &z;
8843       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
8844       *b = 0;
8845 ; return 0; }
8846 EOF
8847 if { (eval echo configure:8848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8848   rm -rf conftest*
8849   ol_cv_c_volatile=yes
8850 else
8851   echo "configure: failed program was:" >&5
8852   cat conftest.$ac_ext >&5
8853   rm -rf conftest*
8854   ol_cv_c_volatile=no
8855 fi
8856 rm -f conftest*
8857 fi
8858
8859 echo "$ac_t""$ol_cv_c_volatile" 1>&6
8860   if test $ol_cv_c_volatile = yes; then
8861     : 
8862   else
8863     cat >> confdefs.h <<\EOF
8864 #define volatile 
8865 EOF
8866
8867   fi
8868  
8869
8870 if test $cross_compiling = yes ; then
8871         cat >> confdefs.h <<\EOF
8872 #define CROSS_COMPILING 1
8873 EOF
8874
8875 else
8876         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
8877 echo "configure:8878: checking whether byte ordering is bigendian" >&5
8878 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
8879   echo $ac_n "(cached) $ac_c" 1>&6
8880 else
8881   ac_cv_c_bigendian=unknown
8882 # See if sys/param.h defines the BYTE_ORDER macro.
8883 cat > conftest.$ac_ext <<EOF
8884 #line 8885 "configure"
8885 #include "confdefs.h"
8886 #include <sys/types.h>
8887 #include <sys/param.h>
8888 int main() {
8889
8890 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
8891  bogus endian macros
8892 #endif
8893 ; return 0; }
8894 EOF
8895 if { (eval echo configure:8896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8896   rm -rf conftest*
8897   # It does; now see whether it defined to BIG_ENDIAN or not.
8898 cat > conftest.$ac_ext <<EOF
8899 #line 8900 "configure"
8900 #include "confdefs.h"
8901 #include <sys/types.h>
8902 #include <sys/param.h>
8903 int main() {
8904
8905 #if BYTE_ORDER != BIG_ENDIAN
8906  not big endian
8907 #endif
8908 ; return 0; }
8909 EOF
8910 if { (eval echo configure:8911: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8911   rm -rf conftest*
8912   ac_cv_c_bigendian=yes
8913 else
8914   echo "configure: failed program was:" >&5
8915   cat conftest.$ac_ext >&5
8916   rm -rf conftest*
8917   ac_cv_c_bigendian=no
8918 fi
8919 rm -f conftest*
8920 else
8921   echo "configure: failed program was:" >&5
8922   cat conftest.$ac_ext >&5
8923 fi
8924 rm -f conftest*
8925 if test $ac_cv_c_bigendian = unknown; then
8926 if test "$cross_compiling" = yes; then
8927     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
8928 else
8929   cat > conftest.$ac_ext <<EOF
8930 #line 8931 "configure"
8931 #include "confdefs.h"
8932 main () {
8933   /* Are we little or big endian?  From Harbison&Steele.  */
8934   union
8935   {
8936     long l;
8937     char c[sizeof (long)];
8938   } u;
8939   u.l = 1;
8940   exit (u.c[sizeof (long) - 1] == 1);
8941 }
8942 EOF
8943 if { (eval echo configure:8944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8944 then
8945   ac_cv_c_bigendian=no
8946 else
8947   echo "configure: failed program was:" >&5
8948   cat conftest.$ac_ext >&5
8949   rm -fr conftest*
8950   ac_cv_c_bigendian=yes
8951 fi
8952 rm -fr conftest*
8953 fi
8954
8955 fi
8956 fi
8957
8958 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
8959 if test $ac_cv_c_bigendian = yes; then
8960   cat >> confdefs.h <<\EOF
8961 #define WORDS_BIGENDIAN 1
8962 EOF
8963
8964 fi
8965
8966         echo $ac_n "checking size of short""... $ac_c" 1>&6
8967 echo "configure:8968: checking size of short" >&5
8968 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
8969   echo $ac_n "(cached) $ac_c" 1>&6
8970 else
8971   if test "$cross_compiling" = yes; then
8972     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
8973 else
8974   cat > conftest.$ac_ext <<EOF
8975 #line 8976 "configure"
8976 #include "confdefs.h"
8977 #include <stdio.h>
8978 main()
8979 {
8980   FILE *f=fopen("conftestval", "w");
8981   if (!f) exit(1);
8982   fprintf(f, "%d\n", sizeof(short));
8983   exit(0);
8984 }
8985 EOF
8986 if { (eval echo configure:8987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8987 then
8988   ac_cv_sizeof_short=`cat conftestval`
8989 else
8990   echo "configure: failed program was:" >&5
8991   cat conftest.$ac_ext >&5
8992   rm -fr conftest*
8993   ac_cv_sizeof_short=0
8994 fi
8995 rm -fr conftest*
8996 fi
8997
8998 fi
8999 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
9000 cat >> confdefs.h <<EOF
9001 #define SIZEOF_SHORT $ac_cv_sizeof_short
9002 EOF
9003
9004  
9005         echo $ac_n "checking size of int""... $ac_c" 1>&6
9006 echo "configure:9007: checking size of int" >&5
9007 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
9008   echo $ac_n "(cached) $ac_c" 1>&6
9009 else
9010   if test "$cross_compiling" = yes; then
9011     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
9012 else
9013   cat > conftest.$ac_ext <<EOF
9014 #line 9015 "configure"
9015 #include "confdefs.h"
9016 #include <stdio.h>
9017 main()
9018 {
9019   FILE *f=fopen("conftestval", "w");
9020   if (!f) exit(1);
9021   fprintf(f, "%d\n", sizeof(int));
9022   exit(0);
9023 }
9024 EOF
9025 if { (eval echo configure:9026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9026 then
9027   ac_cv_sizeof_int=`cat conftestval`
9028 else
9029   echo "configure: failed program was:" >&5
9030   cat conftest.$ac_ext >&5
9031   rm -fr conftest*
9032   ac_cv_sizeof_int=0
9033 fi
9034 rm -fr conftest*
9035 fi
9036
9037 fi
9038 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
9039 cat >> confdefs.h <<EOF
9040 #define SIZEOF_INT $ac_cv_sizeof_int
9041 EOF
9042
9043  
9044         echo $ac_n "checking size of long""... $ac_c" 1>&6
9045 echo "configure:9046: checking size of long" >&5
9046 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
9047   echo $ac_n "(cached) $ac_c" 1>&6
9048 else
9049   if test "$cross_compiling" = yes; then
9050     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
9051 else
9052   cat > conftest.$ac_ext <<EOF
9053 #line 9054 "configure"
9054 #include "confdefs.h"
9055 #include <stdio.h>
9056 main()
9057 {
9058   FILE *f=fopen("conftestval", "w");
9059   if (!f) exit(1);
9060   fprintf(f, "%d\n", sizeof(long));
9061   exit(0);
9062 }
9063 EOF
9064 if { (eval echo configure:9065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9065 then
9066   ac_cv_sizeof_long=`cat conftestval`
9067 else
9068   echo "configure: failed program was:" >&5
9069   cat conftest.$ac_ext >&5
9070   rm -fr conftest*
9071   ac_cv_sizeof_long=0
9072 fi
9073 rm -fr conftest*
9074 fi
9075
9076 fi
9077 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
9078 cat >> confdefs.h <<EOF
9079 #define SIZEOF_LONG $ac_cv_sizeof_long
9080 EOF
9081
9082
9083 fi
9084
9085 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
9086 echo "configure:9087: checking for 8-bit clean memcmp" >&5
9087 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
9088   echo $ac_n "(cached) $ac_c" 1>&6
9089 else
9090   if test "$cross_compiling" = yes; then
9091   ac_cv_func_memcmp_clean=no
9092 else
9093   cat > conftest.$ac_ext <<EOF
9094 #line 9095 "configure"
9095 #include "confdefs.h"
9096
9097 main()
9098 {
9099   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
9100   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
9101 }
9102
9103 EOF
9104 if { (eval echo configure:9105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9105 then
9106   ac_cv_func_memcmp_clean=yes
9107 else
9108   echo "configure: failed program was:" >&5
9109   cat conftest.$ac_ext >&5
9110   rm -fr conftest*
9111   ac_cv_func_memcmp_clean=no
9112 fi
9113 rm -fr conftest*
9114 fi
9115
9116 fi
9117
9118 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
9119 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
9120
9121 echo $ac_n "checking for strftime""... $ac_c" 1>&6
9122 echo "configure:9123: checking for strftime" >&5
9123 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
9124   echo $ac_n "(cached) $ac_c" 1>&6
9125 else
9126   cat > conftest.$ac_ext <<EOF
9127 #line 9128 "configure"
9128 #include "confdefs.h"
9129 /* System header to define __stub macros and hopefully few prototypes,
9130     which can conflict with char strftime(); below.  */
9131 #include <assert.h>
9132 /* Override any gcc2 internal prototype to avoid an error.  */
9133 /* We use char because int might match the return type of a gcc2
9134     builtin and then its argument prototype would still apply.  */
9135 char strftime();
9136
9137 int main() {
9138
9139 /* The GNU C library defines this for functions which it implements
9140     to always fail with ENOSYS.  Some functions are actually named
9141     something starting with __ and the normal name is an alias.  */
9142 #if defined (__stub_strftime) || defined (__stub___strftime)
9143 choke me
9144 #else
9145 strftime();
9146 #endif
9147
9148 ; return 0; }
9149 EOF
9150 if { (eval echo configure:9151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9151   rm -rf conftest*
9152   eval "ac_cv_func_strftime=yes"
9153 else
9154   echo "configure: failed program was:" >&5
9155   cat conftest.$ac_ext >&5
9156   rm -rf conftest*
9157   eval "ac_cv_func_strftime=no"
9158 fi
9159 rm -f conftest*
9160 fi
9161
9162 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
9163   echo "$ac_t""yes" 1>&6
9164   cat >> confdefs.h <<\EOF
9165 #define HAVE_STRFTIME 1
9166 EOF
9167
9168 else
9169   echo "$ac_t""no" 1>&6
9170 # strftime is in -lintl on SCO UNIX.
9171 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
9172 echo "configure:9173: checking for strftime in -lintl" >&5
9173 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
9174 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9175   echo $ac_n "(cached) $ac_c" 1>&6
9176 else
9177   ac_save_LIBS="$LIBS"
9178 LIBS="-lintl  $LIBS"
9179 cat > conftest.$ac_ext <<EOF
9180 #line 9181 "configure"
9181 #include "confdefs.h"
9182 /* Override any gcc2 internal prototype to avoid an error.  */
9183 /* We use char because int might match the return type of a gcc2
9184     builtin and then its argument prototype would still apply.  */
9185 char strftime();
9186
9187 int main() {
9188 strftime()
9189 ; return 0; }
9190 EOF
9191 if { (eval echo configure:9192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9192   rm -rf conftest*
9193   eval "ac_cv_lib_$ac_lib_var=yes"
9194 else
9195   echo "configure: failed program was:" >&5
9196   cat conftest.$ac_ext >&5
9197   rm -rf conftest*
9198   eval "ac_cv_lib_$ac_lib_var=no"
9199 fi
9200 rm -f conftest*
9201 LIBS="$ac_save_LIBS"
9202
9203 fi
9204 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9205   echo "$ac_t""yes" 1>&6
9206   cat >> confdefs.h <<\EOF
9207 #define HAVE_STRFTIME 1
9208 EOF
9209
9210 LIBS="-lintl $LIBS"
9211 else
9212   echo "$ac_t""no" 1>&6
9213 fi
9214
9215 fi
9216
9217 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
9218 echo "configure:9219: checking for vprintf" >&5
9219 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
9220   echo $ac_n "(cached) $ac_c" 1>&6
9221 else
9222   cat > conftest.$ac_ext <<EOF
9223 #line 9224 "configure"
9224 #include "confdefs.h"
9225 /* System header to define __stub macros and hopefully few prototypes,
9226     which can conflict with char vprintf(); below.  */
9227 #include <assert.h>
9228 /* Override any gcc2 internal prototype to avoid an error.  */
9229 /* We use char because int might match the return type of a gcc2
9230     builtin and then its argument prototype would still apply.  */
9231 char vprintf();
9232
9233 int main() {
9234
9235 /* The GNU C library defines this for functions which it implements
9236     to always fail with ENOSYS.  Some functions are actually named
9237     something starting with __ and the normal name is an alias.  */
9238 #if defined (__stub_vprintf) || defined (__stub___vprintf)
9239 choke me
9240 #else
9241 vprintf();
9242 #endif
9243
9244 ; return 0; }
9245 EOF
9246 if { (eval echo configure:9247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9247   rm -rf conftest*
9248   eval "ac_cv_func_vprintf=yes"
9249 else
9250   echo "configure: failed program was:" >&5
9251   cat conftest.$ac_ext >&5
9252   rm -rf conftest*
9253   eval "ac_cv_func_vprintf=no"
9254 fi
9255 rm -f conftest*
9256 fi
9257
9258 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
9259   echo "$ac_t""yes" 1>&6
9260   cat >> confdefs.h <<\EOF
9261 #define HAVE_VPRINTF 1
9262 EOF
9263
9264 else
9265   echo "$ac_t""no" 1>&6
9266 fi
9267
9268 if test "$ac_cv_func_vprintf" != yes; then
9269 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
9270 echo "configure:9271: checking for _doprnt" >&5
9271 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
9272   echo $ac_n "(cached) $ac_c" 1>&6
9273 else
9274   cat > conftest.$ac_ext <<EOF
9275 #line 9276 "configure"
9276 #include "confdefs.h"
9277 /* System header to define __stub macros and hopefully few prototypes,
9278     which can conflict with char _doprnt(); below.  */
9279 #include <assert.h>
9280 /* Override any gcc2 internal prototype to avoid an error.  */
9281 /* We use char because int might match the return type of a gcc2
9282     builtin and then its argument prototype would still apply.  */
9283 char _doprnt();
9284
9285 int main() {
9286
9287 /* The GNU C library defines this for functions which it implements
9288     to always fail with ENOSYS.  Some functions are actually named
9289     something starting with __ and the normal name is an alias.  */
9290 #if defined (__stub__doprnt) || defined (__stub____doprnt)
9291 choke me
9292 #else
9293 _doprnt();
9294 #endif
9295
9296 ; return 0; }
9297 EOF
9298 if { (eval echo configure:9299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9299   rm -rf conftest*
9300   eval "ac_cv_func__doprnt=yes"
9301 else
9302   echo "configure: failed program was:" >&5
9303   cat conftest.$ac_ext >&5
9304   rm -rf conftest*
9305   eval "ac_cv_func__doprnt=no"
9306 fi
9307 rm -f conftest*
9308 fi
9309
9310 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
9311   echo "$ac_t""yes" 1>&6
9312   cat >> confdefs.h <<\EOF
9313 #define HAVE_DOPRNT 1
9314 EOF
9315
9316 else
9317   echo "$ac_t""no" 1>&6
9318 fi
9319
9320 fi
9321
9322
9323 if test $ac_cv_func_vprintf = yes ; then
9324                 for ac_func in vsnprintf vsprintf
9325 do
9326 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9327 echo "configure:9328: checking for $ac_func" >&5
9328 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
9329   echo $ac_n "(cached) $ac_c" 1>&6
9330 else
9331   cat > conftest.$ac_ext <<EOF
9332 #line 9333 "configure"
9333 #include "confdefs.h"
9334 /* System header to define __stub macros and hopefully few prototypes,
9335     which can conflict with char $ac_func(); below.  */
9336 #include <assert.h>
9337 /* Override any gcc2 internal prototype to avoid an error.  */
9338 /* We use char because int might match the return type of a gcc2
9339     builtin and then its argument prototype would still apply.  */
9340 char $ac_func();
9341
9342 int main() {
9343
9344 /* The GNU C library defines this for functions which it implements
9345     to always fail with ENOSYS.  Some functions are actually named
9346     something starting with __ and the normal name is an alias.  */
9347 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9348 choke me
9349 #else
9350 $ac_func();
9351 #endif
9352
9353 ; return 0; }
9354 EOF
9355 if { (eval echo configure:9356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9356   rm -rf conftest*
9357   eval "ac_cv_func_$ac_func=yes"
9358 else
9359   echo "configure: failed program was:" >&5
9360   cat conftest.$ac_ext >&5
9361   rm -rf conftest*
9362   eval "ac_cv_func_$ac_func=no"
9363 fi
9364 rm -f conftest*
9365 fi
9366
9367 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9368   echo "$ac_t""yes" 1>&6
9369     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9370   cat >> confdefs.h <<EOF
9371 #define $ac_tr_func 1
9372 EOF
9373  
9374 else
9375   echo "$ac_t""no" 1>&6
9376 fi
9377 done
9378
9379 fi
9380
9381 for ac_func in \
9382         bcopy                   \
9383         flock                   \
9384         getdtablesize   \
9385         gethostname             \
9386         getpwuid                \
9387         gettimeofday    \
9388         lockf                   \
9389         memcpy                  \
9390         memmove                 \
9391         mkstemp                 \
9392         select                  \
9393         setpwfile               \
9394         setsid                  \
9395         signal                  \
9396         sigset                  \
9397         snprintf                \
9398         socket                  \
9399         strdup                  \
9400         strerror                \
9401         strpbrk                 \
9402         strrchr                 \
9403         strsep                  \
9404         strstr                  \
9405         strtol                  \
9406         strtoul                 \
9407         strspn                  \
9408         sysconf                 \
9409         waitpid                 \
9410
9411 do
9412 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9413 echo "configure:9414: checking for $ac_func" >&5
9414 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
9415   echo $ac_n "(cached) $ac_c" 1>&6
9416 else
9417   cat > conftest.$ac_ext <<EOF
9418 #line 9419 "configure"
9419 #include "confdefs.h"
9420 /* System header to define __stub macros and hopefully few prototypes,
9421     which can conflict with char $ac_func(); below.  */
9422 #include <assert.h>
9423 /* Override any gcc2 internal prototype to avoid an error.  */
9424 /* We use char because int might match the return type of a gcc2
9425     builtin and then its argument prototype would still apply.  */
9426 char $ac_func();
9427
9428 int main() {
9429
9430 /* The GNU C library defines this for functions which it implements
9431     to always fail with ENOSYS.  Some functions are actually named
9432     something starting with __ and the normal name is an alias.  */
9433 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9434 choke me
9435 #else
9436 $ac_func();
9437 #endif
9438
9439 ; return 0; }
9440 EOF
9441 if { (eval echo configure:9442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9442   rm -rf conftest*
9443   eval "ac_cv_func_$ac_func=yes"
9444 else
9445   echo "configure: failed program was:" >&5
9446   cat conftest.$ac_ext >&5
9447   rm -rf conftest*
9448   eval "ac_cv_func_$ac_func=no"
9449 fi
9450 rm -f conftest*
9451 fi
9452
9453 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9454   echo "$ac_t""yes" 1>&6
9455     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9456   cat >> confdefs.h <<EOF
9457 #define $ac_tr_func 1
9458 EOF
9459  
9460 else
9461   echo "$ac_t""no" 1>&6
9462 fi
9463 done
9464
9465
9466 # these functions are required to build a thread_safe -lldap
9467 for ac_func in \
9468         ctime_r                 \
9469         gethostbyaddr_r \
9470         gethostbyname_r \
9471
9472 do
9473 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9474 echo "configure:9475: checking for $ac_func" >&5
9475 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
9476   echo $ac_n "(cached) $ac_c" 1>&6
9477 else
9478   cat > conftest.$ac_ext <<EOF
9479 #line 9480 "configure"
9480 #include "confdefs.h"
9481 /* System header to define __stub macros and hopefully few prototypes,
9482     which can conflict with char $ac_func(); below.  */
9483 #include <assert.h>
9484 /* Override any gcc2 internal prototype to avoid an error.  */
9485 /* We use char because int might match the return type of a gcc2
9486     builtin and then its argument prototype would still apply.  */
9487 char $ac_func();
9488
9489 int main() {
9490
9491 /* The GNU C library defines this for functions which it implements
9492     to always fail with ENOSYS.  Some functions are actually named
9493     something starting with __ and the normal name is an alias.  */
9494 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9495 choke me
9496 #else
9497 $ac_func();
9498 #endif
9499
9500 ; return 0; }
9501 EOF
9502 if { (eval echo configure:9503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9503   rm -rf conftest*
9504   eval "ac_cv_func_$ac_func=yes"
9505 else
9506   echo "configure: failed program was:" >&5
9507   cat conftest.$ac_ext >&5
9508   rm -rf conftest*
9509   eval "ac_cv_func_$ac_func=no"
9510 fi
9511 rm -f conftest*
9512 fi
9513
9514 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9515   echo "$ac_t""yes" 1>&6
9516     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9517   cat >> confdefs.h <<EOF
9518 #define $ac_tr_func 1
9519 EOF
9520  
9521 else
9522   echo "$ac_t""no" 1>&6
9523 fi
9524 done
9525
9526
9527 if test "$ac_cv_func_ctime_r" = yes ; then
9528         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
9529 echo "configure:9530: checking number of arguments of ctime_r" >&5
9530 if eval "test \"`echo '$''{'ol_cv_func_ctime_r_nargs'+set}'`\" = set"; then
9531   echo $ac_n "(cached) $ac_c" 1>&6
9532 else
9533   cat > conftest.$ac_ext <<EOF
9534 #line 9535 "configure"
9535 #include "confdefs.h"
9536 #include <time.h>
9537 int main() {
9538 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
9539 ; return 0; }
9540 EOF
9541 if { (eval echo configure:9542: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9542   rm -rf conftest*
9543   ol_cv_func_ctime_r_nargs=3
9544 else
9545   echo "configure: failed program was:" >&5
9546   cat conftest.$ac_ext >&5
9547   rm -rf conftest*
9548   ol_cv_func_ctime_r_nargs=0
9549 fi
9550 rm -f conftest*
9551                 if test $ol_cv_func_ctime_r_nargs = 0 ; then
9552                         cat > conftest.$ac_ext <<EOF
9553 #line 9554 "configure"
9554 #include "confdefs.h"
9555 #include <time.h>
9556 int main() {
9557 time_t ti; char *buffer;
9558                                         ctime_r(&ti,buffer);
9559 ; return 0; }
9560 EOF
9561 if { (eval echo configure:9562: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9562   rm -rf conftest*
9563   ol_cv_func_ctime_r_nargs=2
9564 else
9565   echo "configure: failed program was:" >&5
9566   cat conftest.$ac_ext >&5
9567   rm -rf conftest*
9568   ol_cv_func_ctime_r_nargs=0
9569 fi
9570 rm -f conftest*
9571                 fi
9572         
9573 fi
9574
9575 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
9576   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
9577     cat >> confdefs.h <<EOF
9578 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
9579 EOF
9580
9581   fi
9582
9583         echo $ac_n "checking return type of ctime_r""... $ac_c" 1>&6
9584 echo "configure:9585: checking return type of ctime_r" >&5
9585 if eval "test \"`echo '$''{'ol_cv_func_ctime_r_type'+set}'`\" = set"; then
9586   echo $ac_n "(cached) $ac_c" 1>&6
9587 else
9588   cat > conftest.$ac_ext <<EOF
9589 #line 9590 "configure"
9590 #include "confdefs.h"
9591 #include <time.h>
9592 int main() {
9593 int ctime_r();
9594 ; return 0; }
9595 EOF
9596 if { (eval echo configure:9597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9597   rm -rf conftest*
9598   ol_cv_func_ctime_r_type="int"
9599 else
9600   echo "configure: failed program was:" >&5
9601   cat conftest.$ac_ext >&5
9602   rm -rf conftest*
9603   ol_cv_func_ctime_r_type="charp"
9604 fi
9605 rm -f conftest*
9606         
9607 fi
9608
9609 echo "$ac_t""$ol_cv_func_ctime_r_type" 1>&6
9610   if test $ol_cv_func_ctime_r_type = "int" ; then
9611         cat >> confdefs.h <<\EOF
9612 #define CTIME_R_RETURNS_INT 1
9613 EOF
9614
9615   fi
9616
9617 else
9618         ol_cv_func_ctime_r_nargs=0
9619 fi
9620
9621 if test "$ac_cv_func_gethostbyname_r" = yes ; then
9622         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
9623 echo "configure:9624: checking number of arguments of gethostbyname_r" >&5
9624 if eval "test \"`echo '$''{'ol_cv_func_gethostbyname_r_nargs'+set}'`\" = set"; then
9625   echo $ac_n "(cached) $ac_c" 1>&6
9626 else
9627   cat > conftest.$ac_ext <<EOF
9628 #line 9629 "configure"
9629 #include "confdefs.h"
9630 #include <sys/types.h>
9631                     #include <sys/socket.h>
9632                     #include <netinet/in.h>
9633                     #include <netdb.h>
9634                     #define BUFSIZE (sizeof(struct hostent)+10)
9635 int main() {
9636 struct hostent hent; char buffer[BUFSIZE];
9637                     int bufsize=BUFSIZE;int h_errno;
9638                     (void)gethostbyname_r( "segovia.cs.purdue.edu", &hent, buffer, bufsize, &h_errno);
9639                     return 0;
9640 ; return 0; }
9641 EOF
9642 if { (eval echo configure:9643: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9643   rm -rf conftest*
9644   ol_cv_func_gethostbyname_r_nargs=5
9645 else
9646   echo "configure: failed program was:" >&5
9647   cat conftest.$ac_ext >&5
9648   rm -rf conftest*
9649   ol_cv_func_gethostbyname_r_nargs=0
9650 fi
9651 rm -f conftest*
9652                 if test $ol_cv_func_gethostbyname_r_nargs = 0 ; then
9653                         cat > conftest.$ac_ext <<EOF
9654 #line 9655 "configure"
9655 #include "confdefs.h"
9656 #include <sys/types.h>
9657                     #include <sys/socket.h>
9658                     #include <netinet/in.h>
9659                     #include <netdb.h>
9660                     #define BUFSIZE (sizeof(struct hostent)+10)
9661 int main() {
9662 struct hostent hent;struct hostent *rhent;
9663                     char buffer[BUFSIZE];
9664                     int bufsize=BUFSIZE;int h_errno;
9665                      (void)gethostbyname_r( "segovia.cs.purdue.edu", &hent, buffer, bufsize, &rhent, &h_errno);
9666                     return 0;
9667 ; return 0; }
9668 EOF
9669 if { (eval echo configure:9670: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9670   rm -rf conftest*
9671   ol_cv_func_gethostbyname_r_nargs=6
9672 else
9673   echo "configure: failed program was:" >&5
9674   cat conftest.$ac_ext >&5
9675   rm -rf conftest*
9676   ol_cv_func_gethostbyname_r_nargs=0
9677 fi
9678 rm -f conftest*
9679                 fi
9680         
9681 fi
9682
9683 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
9684   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
9685     cat >> confdefs.h <<EOF
9686 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
9687 EOF
9688
9689   fi
9690
9691 else
9692         ol_cv_func_gethostbyname_r=0
9693 fi
9694  
9695 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
9696         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
9697 echo "configure:9698: checking number of arguments of gethostbyaddr_r" >&5
9698 if eval "test \"`echo '$''{'ol_cv_func_gethostbyaddr_r_nargs'+set}'`\" = set"; then
9699   echo $ac_n "(cached) $ac_c" 1>&6
9700 else
9701   cat > conftest.$ac_ext <<EOF
9702 #line 9703 "configure"
9703 #include "confdefs.h"
9704 #include <sys/types.h>
9705                     #include <sys/socket.h>
9706                     #include <netinet/in.h>
9707                     #include <netdb.h>
9708                     #define BUFSIZE (sizeof(struct hostent)+10)
9709 int main() {
9710 struct hostent hent; char buffer[BUFSIZE]; 
9711                     struct in_addr add={0x70707070};
9712                     size_t alen=sizeof(struct in_addr);
9713                     int bufsize=BUFSIZE;int h_errno;
9714                     (void)gethostbyaddr_r( (void *)&(add.s_addr),
9715                                 alen, AF_INET, &hent, buffer, bufsize, &h_errno);
9716                     return 0;
9717 ; return 0; }
9718 EOF
9719 if { (eval echo configure:9720: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9720   rm -rf conftest*
9721   ol_cv_func_gethostbyaddr_r_nargs=7
9722 else
9723   echo "configure: failed program was:" >&5
9724   cat conftest.$ac_ext >&5
9725   rm -rf conftest*
9726   ol_cv_func_gethostbyaddr_r_nargs=0
9727 fi
9728 rm -f conftest*
9729                 if test $ol_cv_func_gethostbyaddr_r_nargs = 0 ; then
9730                         cat > conftest.$ac_ext <<EOF
9731 #line 9732 "configure"
9732 #include "confdefs.h"
9733 #include <sys/types.h>
9734                     #include <sys/socket.h>
9735                     #include <netinet/in.h>
9736                     #include <netdb.h>
9737                     #define BUFSIZE (sizeof(struct hostent)+10)
9738 int main() {
9739 struct hostent hent; struct hostent *rhent; char buffer[BUFSIZE]; 
9740                     struct in_addr add={0x70707070};
9741                     size_t alen=sizeof(struct in_addr);
9742                     int bufsize=BUFSIZE;int h_errno;
9743                     (void)gethostbyaddr_r( (void *)&(add.s_addr),
9744                                 alen, AF_INET, &hent, buffer, bufsize, 
9745                                 &rhent, &h_errno);
9746                     return 0;
9747 ; return 0; }
9748 EOF
9749 if { (eval echo configure:9750: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9750   rm -rf conftest*
9751   ol_cv_func_gethostbyaddr_r_nargs=8
9752 else
9753   echo "configure: failed program was:" >&5
9754   cat conftest.$ac_ext >&5
9755   rm -rf conftest*
9756   ol_cv_func_gethostbyaddr_r_nargs=0
9757 fi
9758 rm -f conftest*
9759                 fi
9760         
9761 fi
9762
9763 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
9764   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
9765     cat >> confdefs.h <<EOF
9766 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
9767 EOF
9768
9769   fi
9770
9771 else
9772         ol_cv_func_gethostbyaddr_r=0
9773 fi
9774
9775 if test "$ac_cv_func_ctime_r" = yes \
9776         -a "$ol_cv_func_ctime_r_nargs" -ge 2 -a "$ol_cv_func_ctime_r_nargs" -le 3 \
9777         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
9778         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
9779         -a "$ac_cv_func_gethostbyaddr_r" = yes \
9780         -a "$ac_cv_func_gethostbyname_r" = yes \
9781         ; then
9782
9783         cat >> confdefs.h <<\EOF
9784 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
9785 EOF
9786
9787 fi
9788
9789 if test $ol_link_threads != no ; then
9790         cat >> confdefs.h <<\EOF
9791 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
9792 EOF
9793
9794 fi
9795
9796 for ac_func in getopt tempnam
9797 do
9798 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9799 echo "configure:9800: checking for $ac_func" >&5
9800 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
9801   echo $ac_n "(cached) $ac_c" 1>&6
9802 else
9803   cat > conftest.$ac_ext <<EOF
9804 #line 9805 "configure"
9805 #include "confdefs.h"
9806 /* System header to define __stub macros and hopefully few prototypes,
9807     which can conflict with char $ac_func(); below.  */
9808 #include <assert.h>
9809 /* Override any gcc2 internal prototype to avoid an error.  */
9810 /* We use char because int might match the return type of a gcc2
9811     builtin and then its argument prototype would still apply.  */
9812 char $ac_func();
9813
9814 int main() {
9815
9816 /* The GNU C library defines this for functions which it implements
9817     to always fail with ENOSYS.  Some functions are actually named
9818     something starting with __ and the normal name is an alias.  */
9819 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9820 choke me
9821 #else
9822 $ac_func();
9823 #endif
9824
9825 ; return 0; }
9826 EOF
9827 if { (eval echo configure:9828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9828   rm -rf conftest*
9829   eval "ac_cv_func_$ac_func=yes"
9830 else
9831   echo "configure: failed program was:" >&5
9832   cat conftest.$ac_ext >&5
9833   rm -rf conftest*
9834   eval "ac_cv_func_$ac_func=no"
9835 fi
9836 rm -f conftest*
9837 fi
9838
9839 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9840   echo "$ac_t""yes" 1>&6
9841     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9842   cat >> confdefs.h <<EOF
9843 #define $ac_tr_func 1
9844 EOF
9845  
9846 else
9847   echo "$ac_t""no" 1>&6
9848 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
9849 fi
9850 done
9851
9852
9853
9854 # Check Configuration
9855
9856 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
9857 echo "configure:9858: checking declaration of sys_errlist" >&5
9858 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
9859   echo $ac_n "(cached) $ac_c" 1>&6
9860 else
9861   
9862         cat > conftest.$ac_ext <<EOF
9863 #line 9864 "configure"
9864 #include "confdefs.h"
9865
9866 #include <stdio.h>
9867 #include <sys/types.h>
9868 #include <errno.h> 
9869 int main() {
9870 char *c = (char *) *sys_errlist
9871 ; return 0; }
9872 EOF
9873 if { (eval echo configure:9874: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9874   rm -rf conftest*
9875   ol_cv_dcl_sys_errlist=yes
9876 else
9877   echo "configure: failed program was:" >&5
9878   cat conftest.$ac_ext >&5
9879   rm -rf conftest*
9880   ol_cv_dcl_sys_errlist=no
9881 fi
9882 rm -f conftest*
9883 fi
9884
9885 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
9886
9887 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
9888 if test $ol_cv_dcl_sys_errlist = no ; then
9889         cat >> confdefs.h <<\EOF
9890 #define DECL_SYS_ERRLIST 1
9891 EOF
9892
9893         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
9894 echo "configure:9895: checking existence of sys_errlist" >&5
9895         if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
9896   echo $ac_n "(cached) $ac_c" 1>&6
9897 else
9898   
9899                 cat > conftest.$ac_ext <<EOF
9900 #line 9901 "configure"
9901 #include "confdefs.h"
9902 #include <errno.h>
9903 int main() {
9904 char *c = (char *) *sys_errlist
9905 ; return 0; }
9906 EOF
9907 if { (eval echo configure:9908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9908   rm -rf conftest*
9909   ol_cv_have_sys_errlist=yes
9910 else
9911   echo "configure: failed program was:" >&5
9912   cat conftest.$ac_ext >&5
9913   rm -rf conftest*
9914   ol_cv_have_sys_errlist=no
9915 fi
9916 rm -f conftest*
9917 fi
9918
9919         echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
9920 fi
9921
9922
9923
9924 if test "$ol_enable_debug" != no ; then
9925         cat >> confdefs.h <<\EOF
9926 #define LDAP_DEBUG 1
9927 EOF
9928
9929 fi
9930 if test "$ol_enable_syslog" = yes ; then
9931         cat >> confdefs.h <<\EOF
9932 #define LDAP_SYSLOG 1
9933 EOF
9934
9935 fi
9936 if test "$ol_enable_libui" = yes ; then
9937         cat >> confdefs.h <<\EOF
9938 #define LDAP_LIBUI 1
9939 EOF
9940
9941 fi
9942 if test "$ol_enable_cache" = no ; then
9943         cat >> confdefs.h <<\EOF
9944 #define LDAP_NOCACHE 1
9945 EOF
9946
9947 fi
9948 if test "$ol_enable_dns" != no ; then
9949         cat >> confdefs.h <<\EOF
9950 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS LDAP_VENDOR_VERSION
9951 EOF
9952
9953 fi
9954 if test "$ol_enable_proctitle" != no ; then
9955         cat >> confdefs.h <<\EOF
9956 #define LDAP_PROCTITLE 1
9957 EOF
9958
9959 fi
9960 if test "$ol_enable_referrals" != no ; then
9961         cat >> confdefs.h <<\EOF
9962 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
9963 EOF
9964
9965 fi
9966 if test "$ol_enable_cldap" != no ; then
9967         cat >> confdefs.h <<\EOF
9968 #define LDAP_CONNECTIONLESS 1
9969 EOF
9970
9971 fi
9972
9973 if test "$ol_enable_aclgroups" != no ; then
9974         cat >> confdefs.h <<\EOF
9975 #define SLAPD_ACLGROUPS 1
9976 EOF
9977
9978 fi
9979 if test "$ol_enable_crypt" != no ; then
9980         cat >> confdefs.h <<\EOF
9981 #define SLAPD_CRYPT 1
9982 EOF
9983
9984 fi
9985 if test "$ol_enable_cleartext" != no ; then
9986         cat >> confdefs.h <<\EOF
9987 #define SLAPD_CLEARTEXT 1
9988 EOF
9989
9990 fi
9991 if test "$ol_enable_phonetic" != no ; then
9992         cat >> confdefs.h <<\EOF
9993 #define SLAPD_PHONETIC 1
9994 EOF
9995
9996 fi
9997 if test "$ol_enable_rlookups" != no ; then
9998         cat >> confdefs.h <<\EOF
9999 #define SLAPD_RLOOKUPS 1
10000 EOF
10001
10002 fi
10003
10004 if test "$ol_link_bdb2" != no ; then
10005         cat >> confdefs.h <<\EOF
10006 #define SLAPD_BDB2 1
10007 EOF
10008
10009         BUILD_SLAPD=yes
10010         BUILD_BDB2=yes
10011 fi
10012
10013 if test "$ol_link_ldbm" != no ; then
10014         cat >> confdefs.h <<\EOF
10015 #define SLAPD_LDBM 1
10016 EOF
10017
10018         BUILD_SLAPD=yes
10019         BUILD_LDBM=yes
10020 fi
10021
10022 if test "$ol_enable_passwd" != no ; then
10023         cat >> confdefs.h <<\EOF
10024 #define SLAPD_PASSWD 1
10025 EOF
10026
10027         BUILD_SLAPD=yes
10028         BUILD_PASSWD=yes
10029 fi
10030
10031 if test "$ol_enable_perl" != no ; then
10032         cat >> confdefs.h <<\EOF
10033 #define SLAPD_PERL 1
10034 EOF
10035
10036         BUILD_SLAPD=yes
10037         BUILD_PERL=yes
10038 fi
10039
10040 if test "$ol_enable_shell" != no ; then
10041         cat >> confdefs.h <<\EOF
10042 #define SLAPD_SHELL 1
10043 EOF
10044
10045         BUILD_SLAPD=yes
10046         BUILD_SHELL=yes
10047 fi
10048
10049 if test "$ol_enable_tcl" != no ; then
10050         cat >> confdefs.h <<\EOF
10051 #define SLAPD_TCL 1
10052 EOF
10053
10054         BUILD_SLAPD=yes
10055         BUILD_TCL=yes
10056 fi
10057
10058 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
10059         $BUILD_SLAPD = yes ; then
10060         BUILD_SLURPD=yes
10061 fi
10062
10063 if test "$ol_link_isode" != no ; then
10064         BUILD_LDAPD=yes
10065 fi
10066
10067
10068
10069
10070   
10071   
10072   
10073   
10074   
10075   
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094 trap '' 1 2 15
10095 cat > confcache <<\EOF
10096 # This file is a shell script that caches the results of configure
10097 # tests run on this system so they can be shared between configure
10098 # scripts and configure runs.  It is not useful on other systems.
10099 # If it contains results you don't want to keep, you may remove or edit it.
10100 #
10101 # By default, configure uses ./config.cache as the cache file,
10102 # creating it if it does not exist already.  You can give configure
10103 # the --cache-file=FILE option to use a different cache file; that is
10104 # what configure does when it calls configure scripts in
10105 # subdirectories, so they share the cache.
10106 # Giving --cache-file=/dev/null disables caching, for debugging configure.
10107 # config.status only pays attention to the cache file if you give it the
10108 # --recheck option to rerun configure.
10109 #
10110 EOF
10111 # The following way of writing the cache mishandles newlines in values,
10112 # but we know of no workaround that is simple, portable, and efficient.
10113 # So, don't put newlines in cache variables' values.
10114 # Ultrix sh set writes to stderr and can't be redirected directly,
10115 # and sets the high bit in the cache file unless we assign to the vars.
10116 (set) 2>&1 |
10117   case `(ac_space=' '; set | grep ac_space) 2>&1` in
10118   *ac_space=\ *)
10119     # `set' does not quote correctly, so add quotes (double-quote substitution
10120     # turns \\\\ into \\, and sed turns \\ into \).
10121     sed -n \
10122       -e "s/'/'\\\\''/g" \
10123       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
10124     ;;
10125   *)
10126     # `set' quotes correctly as required by POSIX, so do not add quotes.
10127     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
10128     ;;
10129   esac >> confcache
10130 if cmp -s $cache_file confcache; then
10131   :
10132 else
10133   if test -w $cache_file; then
10134     echo "updating cache $cache_file"
10135     cat confcache > $cache_file
10136   else
10137     echo "not updating unwritable cache $cache_file"
10138   fi
10139 fi
10140 rm -f confcache
10141
10142 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
10143
10144 test "x$prefix" = xNONE && prefix=$ac_default_prefix
10145 # Let make expand exec_prefix.
10146 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
10147
10148 # Any assignment to VPATH causes Sun make to only execute
10149 # the first set of double-colon rules, so remove it if not needed.
10150 # If there is a colon in the path, we need to keep it.
10151 if test "x$srcdir" = x.; then
10152   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
10153 fi
10154
10155 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
10156
10157 DEFS=-DHAVE_CONFIG_H
10158
10159 # Without the "./", some shells look in PATH for config.status.
10160 : ${CONFIG_STATUS=./config.status}
10161
10162 echo creating $CONFIG_STATUS
10163 rm -f $CONFIG_STATUS
10164 cat > $CONFIG_STATUS <<EOF
10165 #! /bin/sh
10166 # Generated automatically by configure.
10167 # Run this file to recreate the current configuration.
10168 # This directory was configured as follows,
10169 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
10170 #
10171 # $0 $ac_configure_args
10172 #
10173 # Compiler output produced by configure, useful for debugging
10174 # configure, is in ./config.log if it exists.
10175
10176 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
10177 for ac_option
10178 do
10179   case "\$ac_option" in
10180   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
10181     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
10182     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
10183   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
10184     echo "$CONFIG_STATUS generated by autoconf version 2.13"
10185     exit 0 ;;
10186   -help | --help | --hel | --he | --h)
10187     echo "\$ac_cs_usage"; exit 0 ;;
10188   *) echo "\$ac_cs_usage"; exit 1 ;;
10189   esac
10190 done
10191
10192 ac_given_srcdir=$srcdir
10193 ac_given_INSTALL="$INSTALL"
10194
10195 trap 'rm -fr `echo "\
10196 Makefile:build/top.mk:Makefile.in:build/dir.mk \
10197 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
10198 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
10199 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
10200 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
10201 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
10202 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
10203 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
10204 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
10205 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
10206 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
10207 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
10208 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
10209 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
10210 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
10211 include/Makefile:build/top.mk:include/Makefile.in \
10212 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
10213 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
10214 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
10215 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
10216 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
10217 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
10218 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
10219 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
10220 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
10221 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
10222 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
10223 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
10224 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
10225 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
10226 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
10227 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
10228 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
10229 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
10230 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
10231 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
10232 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
10233 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
10234  include/portable.h include/ldap_features.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
10235 EOF
10236 cat >> $CONFIG_STATUS <<EOF
10237
10238 # Protect against being on the right side of a sed subst in config.status.
10239 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
10240  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
10241 $ac_vpsub
10242 $extrasub
10243 s%@SHELL@%$SHELL%g
10244 s%@CFLAGS@%$CFLAGS%g
10245 s%@CPPFLAGS@%$CPPFLAGS%g
10246 s%@CXXFLAGS@%$CXXFLAGS%g
10247 s%@FFLAGS@%$FFLAGS%g
10248 s%@DEFS@%$DEFS%g
10249 s%@LDFLAGS@%$LDFLAGS%g
10250 s%@LIBS@%$LIBS%g
10251 s%@exec_prefix@%$exec_prefix%g
10252 s%@prefix@%$prefix%g
10253 s%@program_transform_name@%$program_transform_name%g
10254 s%@bindir@%$bindir%g
10255 s%@sbindir@%$sbindir%g
10256 s%@libexecdir@%$libexecdir%g
10257 s%@datadir@%$datadir%g
10258 s%@sysconfdir@%$sysconfdir%g
10259 s%@sharedstatedir@%$sharedstatedir%g
10260 s%@localstatedir@%$localstatedir%g
10261 s%@libdir@%$libdir%g
10262 s%@includedir@%$includedir%g
10263 s%@oldincludedir@%$oldincludedir%g
10264 s%@infodir@%$infodir%g
10265 s%@mandir@%$mandir%g
10266 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
10267 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
10268 s%@INSTALL_DATA@%$INSTALL_DATA%g
10269 s%@PACKAGE@%$PACKAGE%g
10270 s%@VERSION@%$VERSION%g
10271 s%@ACLOCAL@%$ACLOCAL%g
10272 s%@AUTOCONF@%$AUTOCONF%g
10273 s%@AUTOMAKE@%$AUTOMAKE%g
10274 s%@AUTOHEADER@%$AUTOHEADER%g
10275 s%@MAKEINFO@%$MAKEINFO%g
10276 s%@SET_MAKE@%$SET_MAKE%g
10277 s%@top_builddir@%$top_builddir%g
10278 s%@ldap_subdir@%$ldap_subdir%g
10279 s%@host@%$host%g
10280 s%@host_alias@%$host_alias%g
10281 s%@host_cpu@%$host_cpu%g
10282 s%@host_vendor@%$host_vendor%g
10283 s%@host_os@%$host_os%g
10284 s%@RANLIB@%$RANLIB%g
10285 s%@CC@%$CC%g
10286 s%@LD@%$LD%g
10287 s%@NM@%$NM%g
10288 s%@LN_S@%$LN_S%g
10289 s%@LIBTOOL@%$LIBTOOL%g
10290 s%@AWK@%$AWK%g
10291 s%@SENDMAIL@%$SENDMAIL%g
10292 s%@EDITOR@%$EDITOR%g
10293 s%@FINGER@%$FINGER%g
10294 s%@PERLBIN@%$PERLBIN%g
10295 s%@CPP@%$CPP%g
10296 s%@EXEEXT@%$EXEEXT%g
10297 s%@OBJEXT@%$OBJEXT%g
10298 s%@PEPSY@%$PEPSY%g
10299 s%@LIBOBJS@%$LIBOBJS%g
10300 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
10301 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
10302 s%@BUILD_BDB2@%$BUILD_BDB2%g
10303 s%@BUILD_LDBM@%$BUILD_LDBM%g
10304 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
10305 s%@BUILD_PERL@%$BUILD_PERL%g
10306 s%@BUILD_SHELL@%$BUILD_SHELL%g
10307 s%@BUILD_TCL@%$BUILD_TCL%g
10308 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
10309 s%@LDAP_LIBS@%$LDAP_LIBS%g
10310 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
10311 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
10312 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
10313 s%@LDBM_LIBS@%$LDBM_LIBS%g
10314 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
10315 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
10316 s%@SLAPD_PERL_CPPFLAGS@%$SLAPD_PERL_CPPFLAGS%g
10317 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
10318 s%@KRB_LIBS@%$KRB_LIBS%g
10319 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
10320 s%@TLS_LIBS@%$TLS_LIBS%g
10321
10322 CEOF
10323 EOF
10324
10325 cat >> $CONFIG_STATUS <<\EOF
10326
10327 # Split the substitutions into bite-sized pieces for seds with
10328 # small command number limits, like on Digital OSF/1 and HP-UX.
10329 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
10330 ac_file=1 # Number of current file.
10331 ac_beg=1 # First line for current file.
10332 ac_end=$ac_max_sed_cmds # Line after last line for current file.
10333 ac_more_lines=:
10334 ac_sed_cmds=""
10335 while $ac_more_lines; do
10336   if test $ac_beg -gt 1; then
10337     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
10338   else
10339     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
10340   fi
10341   if test ! -s conftest.s$ac_file; then
10342     ac_more_lines=false
10343     rm -f conftest.s$ac_file
10344   else
10345     if test -z "$ac_sed_cmds"; then
10346       ac_sed_cmds="sed -f conftest.s$ac_file"
10347     else
10348       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
10349     fi
10350     ac_file=`expr $ac_file + 1`
10351     ac_beg=$ac_end
10352     ac_end=`expr $ac_end + $ac_max_sed_cmds`
10353   fi
10354 done
10355 if test -z "$ac_sed_cmds"; then
10356   ac_sed_cmds=cat
10357 fi
10358 EOF
10359
10360 cat >> $CONFIG_STATUS <<EOF
10361
10362 CONFIG_FILES=\${CONFIG_FILES-"\
10363 Makefile:build/top.mk:Makefile.in:build/dir.mk \
10364 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
10365 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
10366 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
10367 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
10368 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
10369 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
10370 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
10371 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
10372 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
10373 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
10374 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
10375 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
10376 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
10377 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
10378 include/Makefile:build/top.mk:include/Makefile.in \
10379 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
10380 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
10381 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
10382 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
10383 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
10384 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
10385 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
10386 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
10387 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
10388 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
10389 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
10390 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
10391 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
10392 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
10393 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
10394 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
10395 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
10396 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
10397 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
10398 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
10399 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
10400 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
10401 "}
10402 EOF
10403 cat >> $CONFIG_STATUS <<\EOF
10404 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
10405   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
10406   case "$ac_file" in
10407   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
10408        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
10409   *) ac_file_in="${ac_file}.in" ;;
10410   esac
10411
10412   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
10413
10414   # Remove last slash and all that follows it.  Not all systems have dirname.
10415   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
10416   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
10417     # The file is in a subdirectory.
10418     test ! -d "$ac_dir" && mkdir "$ac_dir"
10419     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
10420     # A "../" for each directory in $ac_dir_suffix.
10421     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
10422   else
10423     ac_dir_suffix= ac_dots=
10424   fi
10425
10426   case "$ac_given_srcdir" in
10427   .)  srcdir=.
10428       if test -z "$ac_dots"; then top_srcdir=.
10429       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
10430   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
10431   *) # Relative path.
10432     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
10433     top_srcdir="$ac_dots$ac_given_srcdir" ;;
10434   esac
10435
10436   case "$ac_given_INSTALL" in
10437   [/$]*) INSTALL="$ac_given_INSTALL" ;;
10438   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
10439   esac
10440
10441   echo creating "$ac_file"
10442   rm -f "$ac_file"
10443   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
10444   case "$ac_file" in
10445   *Makefile*) ac_comsub="1i\\
10446 # $configure_input" ;;
10447   *) ac_comsub= ;;
10448   esac
10449
10450   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
10451   sed -e "$ac_comsub
10452 s%@configure_input@%$configure_input%g
10453 s%@srcdir@%$srcdir%g
10454 s%@top_srcdir@%$top_srcdir%g
10455 s%@INSTALL@%$INSTALL%g
10456 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
10457 fi; done
10458 rm -f conftest.s*
10459
10460 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
10461 # NAME is the cpp macro being defined and VALUE is the value it is being given.
10462 #
10463 # ac_d sets the value in "#define NAME VALUE" lines.
10464 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
10465 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
10466 ac_dC='\3'
10467 ac_dD='%g'
10468 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
10469 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
10470 ac_uB='\([      ]\)%\1#\2define\3'
10471 ac_uC=' '
10472 ac_uD='\4%g'
10473 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
10474 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
10475 ac_eB='$%\1#\2define\3'
10476 ac_eC=' '
10477 ac_eD='%g'
10478
10479 if test "${CONFIG_HEADERS+set}" != set; then
10480 EOF
10481 cat >> $CONFIG_STATUS <<EOF
10482   CONFIG_HEADERS="include/portable.h include/ldap_features.h"
10483 EOF
10484 cat >> $CONFIG_STATUS <<\EOF
10485 fi
10486 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
10487   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
10488   case "$ac_file" in
10489   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
10490        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
10491   *) ac_file_in="${ac_file}.in" ;;
10492   esac
10493
10494   echo creating $ac_file
10495
10496   rm -f conftest.frag conftest.in conftest.out
10497   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
10498   cat $ac_file_inputs > conftest.in
10499
10500 EOF
10501
10502 # Transform confdefs.h into a sed script conftest.vals that substitutes
10503 # the proper values into config.h.in to produce config.h.  And first:
10504 # Protect against being on the right side of a sed subst in config.status.
10505 # Protect against being in an unquoted here document in config.status.
10506 rm -f conftest.vals
10507 cat > conftest.hdr <<\EOF
10508 s/[\\&%]/\\&/g
10509 s%[\\$`]%\\&%g
10510 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
10511 s%ac_d%ac_u%gp
10512 s%ac_u%ac_e%gp
10513 EOF
10514 sed -n -f conftest.hdr confdefs.h > conftest.vals
10515 rm -f conftest.hdr
10516
10517 # This sed command replaces #undef with comments.  This is necessary, for
10518 # example, in the case of _POSIX_SOURCE, which is predefined and required
10519 # on some systems where configure will not decide to define it.
10520 cat >> conftest.vals <<\EOF
10521 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
10522 EOF
10523
10524 # Break up conftest.vals because some shells have a limit on
10525 # the size of here documents, and old seds have small limits too.
10526
10527 rm -f conftest.tail
10528 while :
10529 do
10530   ac_lines=`grep -c . conftest.vals`
10531   # grep -c gives empty output for an empty file on some AIX systems.
10532   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
10533   # Write a limited-size here document to conftest.frag.
10534   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
10535   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
10536   echo 'CEOF
10537   sed -f conftest.frag conftest.in > conftest.out
10538   rm -f conftest.in
10539   mv conftest.out conftest.in
10540 ' >> $CONFIG_STATUS
10541   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
10542   rm -f conftest.vals
10543   mv conftest.tail conftest.vals
10544 done
10545 rm -f conftest.vals
10546
10547 cat >> $CONFIG_STATUS <<\EOF
10548   rm -f conftest.frag conftest.h
10549   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
10550   cat conftest.in >> conftest.h
10551   rm -f conftest.in
10552   if cmp -s $ac_file conftest.h 2>/dev/null; then
10553     echo "$ac_file is unchanged"
10554     rm -f conftest.h
10555   else
10556     # Remove last slash and all that follows it.  Not all systems have dirname.
10557       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
10558       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
10559       # The file is in a subdirectory.
10560       test ! -d "$ac_dir" && mkdir "$ac_dir"
10561     fi
10562     rm -f $ac_file
10563     mv conftest.h $ac_file
10564   fi
10565 fi; done
10566
10567 EOF
10568 cat >> $CONFIG_STATUS <<EOF
10569
10570 EOF
10571 cat >> $CONFIG_STATUS <<\EOF
10572
10573 date > stamp-h
10574 echo Please \"make depend\" to build dependencies
10575
10576 exit 0
10577 EOF
10578 chmod +x $CONFIG_STATUS
10579 rm -fr confdefs* $ac_clean_files
10580 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
10581