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