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