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