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