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