]> git.sur5r.net Git - openldap/blob - configure
Update pthread detection.
[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                         cat >> confdefs.h <<\EOF
3335 #define HAVE_KERBEROS 1
3336 EOF
3337
3338                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
3339                 fi
3340         fi
3341 fi
3342
3343 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
3344         for ac_hdr in krb.h des.h
3345 do
3346 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3347 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3348 echo "configure:3349: checking for $ac_hdr" >&5
3349 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3350   echo $ac_n "(cached) $ac_c" 1>&6
3351 else
3352   cat > conftest.$ac_ext <<EOF
3353 #line 3354 "configure"
3354 #include "confdefs.h"
3355 #include <$ac_hdr>
3356 EOF
3357 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3358 { (eval echo configure:3359: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3359 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3360 if test -z "$ac_err"; then
3361   rm -rf conftest*
3362   eval "ac_cv_header_$ac_safe=yes"
3363 else
3364   echo "$ac_err" >&5
3365   echo "configure: failed program was:" >&5
3366   cat conftest.$ac_ext >&5
3367   rm -rf conftest*
3368   eval "ac_cv_header_$ac_safe=no"
3369 fi
3370 rm -f conftest*
3371 fi
3372 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3373   echo "$ac_t""yes" 1>&6
3374     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3375   cat >> confdefs.h <<EOF
3376 #define $ac_tr_hdr 1
3377 EOF
3378  
3379 else
3380   echo "$ac_t""no" 1>&6
3381 fi
3382 done
3383
3384
3385         if test $ac_cv_header_krb_h = yes ; then
3386                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
3387 echo "configure:3388: checking for main in -lkrb" >&5
3388 ac_lib_var=`echo krb'_'main | sed 'y%./+-%__p_%'`
3389 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3390   echo $ac_n "(cached) $ac_c" 1>&6
3391 else
3392   ac_save_LIBS="$LIBS"
3393 LIBS="-lkrb -ldes $LIBS"
3394 cat > conftest.$ac_ext <<EOF
3395 #line 3396 "configure"
3396 #include "confdefs.h"
3397
3398 int main() {
3399 main()
3400 ; return 0; }
3401 EOF
3402 if { (eval echo configure:3403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3403   rm -rf conftest*
3404   eval "ac_cv_lib_$ac_lib_var=yes"
3405 else
3406   echo "configure: failed program was:" >&5
3407   cat conftest.$ac_ext >&5
3408   rm -rf conftest*
3409   eval "ac_cv_lib_$ac_lib_var=no"
3410 fi
3411 rm -f conftest*
3412 LIBS="$ac_save_LIBS"
3413
3414 fi
3415 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3416   echo "$ac_t""yes" 1>&6
3417   have_k4=yes
3418 else
3419   echo "$ac_t""no" 1>&6
3420 have_k4=no
3421 fi
3422
3423
3424                 if test $have_k4 = yes ; then
3425                         ol_with_kerberos=found
3426                         ol_link_kerberos=yes
3427
3428                         cat >> confdefs.h <<\EOF
3429 #define HAVE_KERBEROS 1
3430 EOF
3431
3432                         KRB_LIBS="-lkrb -ldes"
3433                 fi
3434         fi
3435 fi
3436
3437
3438 ol_link_threads=no
3439 if test $ol_with_threads = auto -o $ol_with_threads = yes \
3440         -o $ol_with_threads = posix ; then
3441
3442         for ac_hdr in pthread.h sched.h
3443 do
3444 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3445 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3446 echo "configure:3447: checking for $ac_hdr" >&5
3447 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3448   echo $ac_n "(cached) $ac_c" 1>&6
3449 else
3450   cat > conftest.$ac_ext <<EOF
3451 #line 3452 "configure"
3452 #include "confdefs.h"
3453 #include <$ac_hdr>
3454 EOF
3455 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3456 { (eval echo configure:3457: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3457 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3458 if test -z "$ac_err"; then
3459   rm -rf conftest*
3460   eval "ac_cv_header_$ac_safe=yes"
3461 else
3462   echo "$ac_err" >&5
3463   echo "configure: failed program was:" >&5
3464   cat conftest.$ac_ext >&5
3465   rm -rf conftest*
3466   eval "ac_cv_header_$ac_safe=no"
3467 fi
3468 rm -f conftest*
3469 fi
3470 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3471   echo "$ac_t""yes" 1>&6
3472     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3473   cat >> confdefs.h <<EOF
3474 #define $ac_tr_hdr 1
3475 EOF
3476  
3477 else
3478   echo "$ac_t""no" 1>&6
3479 fi
3480 done
3481
3482
3483         if test $ac_cv_header_pthread_h = yes ; then
3484                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
3485 echo "configure:3486: checking POSIX thread version" >&5
3486 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
3487   echo $ac_n "(cached) $ac_c" 1>&6
3488 else
3489   
3490         cat > conftest.$ac_ext <<EOF
3491 #line 3492 "configure"
3492 #include "confdefs.h"
3493
3494 #               include <pthread.h>
3495                 /* this check could be improved */
3496 #               ifdef PTHREAD_ONCE_INIT
3497                         pthread_version_final
3498 #               endif
3499         
3500 EOF
3501 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3502   egrep "pthread_version_final" >/dev/null 2>&1; then
3503   rm -rf conftest*
3504   ol_pthread_final=yes
3505 else
3506   rm -rf conftest*
3507   ol_pthread_final=no
3508 fi
3509 rm -f conftest*
3510
3511
3512         cat > conftest.$ac_ext <<EOF
3513 #line 3514 "configure"
3514 #include "confdefs.h"
3515
3516 #               include <pthread.h>
3517                 /* this check could be improved */
3518 #               ifdef pthread_once_init
3519                         pthread_version_draft4
3520 #               endif
3521         
3522 EOF
3523 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3524   egrep "pthread_version_draft4" >/dev/null 2>&1; then
3525   rm -rf conftest*
3526   ol_pthread_draft4=yes
3527 else
3528   rm -rf conftest*
3529   ol_pthread_draft4=no
3530 fi
3531 rm -f conftest*
3532
3533
3534         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
3535                 ol_cv_pthread_version=final
3536         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
3537                 ol_cv_pthread_version=draft4
3538         else
3539                 ol_cv_pthread_version=unknown
3540         fi
3541
3542 fi
3543
3544 echo "$ac_t""$ol_cv_pthread_version" 1>&6
3545
3546
3547                 if test $ol_cv_pthread_version = final ; then
3548                         cat >> confdefs.h <<\EOF
3549 #define HAVE_PTHREADS_FINAL 1
3550 EOF
3551
3552                 elif test $ol_cv_pthread_version = draft4 ; then
3553                         cat >> confdefs.h <<\EOF
3554 #define HAVE_PTHREADS_D4 1
3555 EOF
3556
3557                 else
3558                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
3559                 fi
3560
3561                 # consider threads found
3562                 ol_with_threads=found
3563
3564                 
3565 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
3566 echo "configure:3567: checking for LinuxThreads" >&5
3567 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
3568   echo $ac_n "(cached) $ac_c" 1>&6
3569 else
3570   
3571         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
3572         if test "$res" -gt 0 ; then
3573                 ol_cv_linux_threads=yes
3574         else
3575                 ol_cv_linux_threads=no
3576         fi
3577
3578 fi
3579
3580 echo "$ac_t""$ol_cv_linux_threads" 1>&6
3581
3582
3583                 if test $ol_cv_linux_threads = yes ; then
3584                         cat >> confdefs.h <<\EOF
3585 #define HAVE_LINUX_THREADS 1
3586 EOF
3587
3588                 fi
3589
3590                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
3591                                 echo $ac_n "checking for pthread_create""... $ac_c" 1>&6
3592 echo "configure:3593: checking for pthread_create" >&5
3593 if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then
3594   echo $ac_n "(cached) $ac_c" 1>&6
3595 else
3596   cat > conftest.$ac_ext <<EOF
3597 #line 3598 "configure"
3598 #include "confdefs.h"
3599 /* System header to define __stub macros and hopefully few prototypes,
3600     which can conflict with char pthread_create(); below.  */
3601 #include <assert.h>
3602 /* Override any gcc2 internal prototype to avoid an error.  */
3603 /* We use char because int might match the return type of a gcc2
3604     builtin and then its argument prototype would still apply.  */
3605 char pthread_create();
3606
3607 int main() {
3608
3609 /* The GNU C library defines this for functions which it implements
3610     to always fail with ENOSYS.  Some functions are actually named
3611     something starting with __ and the normal name is an alias.  */
3612 #if defined (__stub_pthread_create) || defined (__stub___pthread_create)
3613 choke me
3614 #else
3615 pthread_create();
3616 #endif
3617
3618 ; return 0; }
3619 EOF
3620 if { (eval echo configure:3621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3621   rm -rf conftest*
3622   eval "ac_cv_func_pthread_create=yes"
3623 else
3624   echo "configure: failed program was:" >&5
3625   cat conftest.$ac_ext >&5
3626   rm -rf conftest*
3627   eval "ac_cv_func_pthread_create=no"
3628 fi
3629 rm -f conftest*
3630 fi
3631
3632 if eval "test \"`echo '$ac_cv_func_'pthread_create`\" = yes"; then
3633   echo "$ac_t""yes" 1>&6
3634   ol_link_threads=yes
3635 else
3636   echo "$ac_t""no" 1>&6
3637 fi
3638
3639
3640                 if test $ol_link_threads = no ; then
3641                                                 echo $ac_n "checking for pthread_create with -kthread""... $ac_c" 1>&6
3642 echo "configure:3643: checking for pthread_create with -kthread" >&5
3643 if eval "test \"`echo '$''{'ol_cv_kthread_flag'+set}'`\" = set"; then
3644   echo $ac_n "(cached) $ac_c" 1>&6
3645 else
3646   
3647                                                                 save_LIBS="$LIBS"
3648                                 LIBS="-kthread $LIBS"
3649                                 cat > conftest.$ac_ext <<EOF
3650 #line 3651 "configure"
3651 #include "confdefs.h"
3652 char pthread();
3653 int main() {
3654
3655                                         pthread_create();
3656                                         
3657 ; return 0; }
3658 EOF
3659 if { (eval echo configure:3660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3660   rm -rf conftest*
3661   ol_cv_kthread_flag=yes
3662 else
3663   echo "configure: failed program was:" >&5
3664   cat conftest.$ac_ext >&5
3665   rm -rf conftest*
3666   ol_cv_kthread_flag=no
3667 fi
3668 rm -f conftest*
3669                                                                 LIBS="$save_LIBS"
3670                         
3671 fi
3672
3673 echo "$ac_t""$ol_cv_kthread_flag" 1>&6
3674
3675                         if test $ol_cv_kthread_flag = yes ; then
3676                                 LTHREAD_LIBS="$LTHREAD_LIBS -kthread"
3677                                 ol_link_threads=posix
3678                         fi
3679                 fi
3680
3681                 if test $ol_link_threads = no ; then
3682                                                 echo $ac_n "checking for pthread_create with -pthread""... $ac_c" 1>&6
3683 echo "configure:3684: checking for pthread_create with -pthread" >&5
3684 if eval "test \"`echo '$''{'ol_cv_pthread_flag'+set}'`\" = set"; then
3685   echo $ac_n "(cached) $ac_c" 1>&6
3686 else
3687   
3688                                                                 save_LIBS="$LIBS"
3689                                 LIBS="-pthread $LIBS"
3690                                 cat > conftest.$ac_ext <<EOF
3691 #line 3692 "configure"
3692 #include "confdefs.h"
3693 char pthread();
3694 int main() {
3695
3696                                         pthread_create();
3697                                         
3698 ; return 0; }
3699 EOF
3700 if { (eval echo configure:3701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3701   rm -rf conftest*
3702   ol_cv_pthread_flag=yes
3703 else
3704   echo "configure: failed program was:" >&5
3705   cat conftest.$ac_ext >&5
3706   rm -rf conftest*
3707   ol_cv_pthread_flag=no
3708 fi
3709 rm -f conftest*
3710                                                                 LIBS="$save_LIBS"
3711                         
3712 fi
3713
3714 echo "$ac_t""$ol_cv_pthread_flag" 1>&6
3715
3716                         if test $ol_cv_pthread_flag = yes ; then
3717                                 LTHREAD_LIBS="$LTHREAD_LIBS -pthread"
3718                                 ol_link_threads=posix
3719                         fi
3720                 fi
3721
3722                 if test $ol_link_threads = no ; then
3723                                                 echo $ac_n "checking for pthread_create with -pthreads""... $ac_c" 1>&6
3724 echo "configure:3725: checking for pthread_create with -pthreads" >&5
3725 if eval "test \"`echo '$''{'ol_cv_pthreads_flag'+set}'`\" = set"; then
3726   echo $ac_n "(cached) $ac_c" 1>&6
3727 else
3728   
3729                                                                 save_LIBS="$LIBS"
3730                                 LIBS="-pthreads $LIBS"
3731                                 cat > conftest.$ac_ext <<EOF
3732 #line 3733 "configure"
3733 #include "confdefs.h"
3734 char pthread();
3735 int main() {
3736
3737                                         pthread_create();
3738                                         
3739 ; return 0; }
3740 EOF
3741 if { (eval echo configure:3742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3742   rm -rf conftest*
3743   ol_cv_pthreads_flag=yes
3744 else
3745   echo "configure: failed program was:" >&5
3746   cat conftest.$ac_ext >&5
3747   rm -rf conftest*
3748   ol_cv_pthreads_flag=no
3749 fi
3750 rm -f conftest*
3751                                                                 LIBS="$save_LIBS"
3752                         
3753 fi
3754
3755 echo "$ac_t""$ol_cv_pthreads_flag" 1>&6
3756
3757                         if test $ol_cv_pthreads_flag = yes ; then
3758                                 LTHREAD_LIBS="$LTHREAD_LIBS -pthreads"
3759                                 ol_link_threads=posix
3760                         fi
3761                 fi
3762
3763                 if test $ol_link_threads = no ; then
3764                                                 echo $ac_n "checking for pthread_create with -thread""... $ac_c" 1>&6
3765 echo "configure:3766: checking for pthread_create with -thread" >&5
3766 if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
3767   echo $ac_n "(cached) $ac_c" 1>&6
3768 else
3769   
3770                                                                 save_LIBS="$LIBS"
3771                                 LIBS="-thread $LIBS"
3772                                 cat > conftest.$ac_ext <<EOF
3773 #line 3774 "configure"
3774 #include "confdefs.h"
3775 char pthread();
3776 int main() {
3777
3778                                         pthread_create();
3779                                         
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_thread_flag=yes
3785 else
3786   echo "configure: failed program was:" >&5
3787   cat conftest.$ac_ext >&5
3788   rm -rf conftest*
3789   ol_cv_thread_flag=no
3790 fi
3791 rm -f conftest*
3792                                                                 LIBS="$save_LIBS"
3793                         
3794 fi
3795
3796 echo "$ac_t""$ol_cv_thread_flag" 1>&6
3797
3798                         if test $ol_cv_thread_flag = yes ; then
3799                                 LTHREAD_LIBS="$LTHREAD_LIBS -thread"
3800                                 ol_link_threads=posix
3801                         fi
3802                 fi
3803
3804                 if test $ol_link_threads = no ; then
3805                                                 save_LIBS="$LIBS"
3806                         echo $ac_n "checking for pthread_mutex_lock in -lpthread""... $ac_c" 1>&6
3807 echo "configure:3808: checking for pthread_mutex_lock in -lpthread" >&5
3808 ac_lib_var=`echo pthread'_'pthread_mutex_lock | sed 'y%./+-%__p_%'`
3809 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3810   echo $ac_n "(cached) $ac_c" 1>&6
3811 else
3812   ac_save_LIBS="$LIBS"
3813 LIBS="-lpthread -lexc $LIBS"
3814 cat > conftest.$ac_ext <<EOF
3815 #line 3816 "configure"
3816 #include "confdefs.h"
3817 /* Override any gcc2 internal prototype to avoid an error.  */
3818 /* We use char because int might match the return type of a gcc2
3819     builtin and then its argument prototype would still apply.  */
3820 char pthread_mutex_lock();
3821
3822 int main() {
3823 pthread_mutex_lock()
3824 ; return 0; }
3825 EOF
3826 if { (eval echo configure:3827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3827   rm -rf conftest*
3828   eval "ac_cv_lib_$ac_lib_var=yes"
3829 else
3830   echo "configure: failed program was:" >&5
3831   cat conftest.$ac_ext >&5
3832   rm -rf conftest*
3833   eval "ac_cv_lib_$ac_lib_var=no"
3834 fi
3835 rm -f conftest*
3836 LIBS="$ac_save_LIBS"
3837
3838 fi
3839 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3840   echo "$ac_t""yes" 1>&6
3841   
3842                                 ol_link_threads=posix
3843                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lexc"
3844                                 if test $ol_with_yielding_select = auto ; then
3845                                         ol_with_yielding_select=yes
3846                                 fi
3847                                 
3848 else
3849   echo "$ac_t""no" 1>&6
3850 :
3851 fi
3852
3853                         LIBS="$save_LIBS"
3854                 fi
3855
3856                 if test $ol_link_threads = no ; then
3857                                                 save_LIBS="$LIBS"
3858                         echo $ac_n "checking for pthread_mutex_unlock in -lpthread""... $ac_c" 1>&6
3859 echo "configure:3860: checking for pthread_mutex_unlock in -lpthread" >&5
3860 ac_lib_var=`echo pthread'_'pthread_mutex_unlock | sed 'y%./+-%__p_%'`
3861 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3862   echo $ac_n "(cached) $ac_c" 1>&6
3863 else
3864   ac_save_LIBS="$LIBS"
3865 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
3866 cat > conftest.$ac_ext <<EOF
3867 #line 3868 "configure"
3868 #include "confdefs.h"
3869 /* Override any gcc2 internal prototype to avoid an error.  */
3870 /* We use char because int might match the return type of a gcc2
3871     builtin and then its argument prototype would still apply.  */
3872 char pthread_mutex_unlock();
3873
3874 int main() {
3875 pthread_mutex_unlock()
3876 ; return 0; }
3877 EOF
3878 if { (eval echo configure:3879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3879   rm -rf conftest*
3880   eval "ac_cv_lib_$ac_lib_var=yes"
3881 else
3882   echo "configure: failed program was:" >&5
3883   cat conftest.$ac_ext >&5
3884   rm -rf conftest*
3885   eval "ac_cv_lib_$ac_lib_var=no"
3886 fi
3887 rm -f conftest*
3888 LIBS="$ac_save_LIBS"
3889
3890 fi
3891 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3892   echo "$ac_t""yes" 1>&6
3893   
3894                                 ol_link_threads=posix
3895                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc -lc_r"
3896                                 if test $ol_with_yielding_select = auto ; then
3897                                         ol_with_yielding_select=yes
3898                                 fi
3899                                 
3900 else
3901   echo "$ac_t""no" 1>&6
3902 :
3903 fi
3904
3905                         LIBS="$save_LIBS"
3906                 fi
3907
3908                 if test $ol_link_threads = no ; then
3909                                                 save_LIBS="$LIBS"
3910                         echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
3911 echo "configure:3912: checking for pthread_create in -lpthread" >&5
3912 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
3913 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3914   echo $ac_n "(cached) $ac_c" 1>&6
3915 else
3916   ac_save_LIBS="$LIBS"
3917 LIBS="-lpthread  $LIBS"
3918 cat > conftest.$ac_ext <<EOF
3919 #line 3920 "configure"
3920 #include "confdefs.h"
3921 /* Override any gcc2 internal prototype to avoid an error.  */
3922 /* We use char because int might match the return type of a gcc2
3923     builtin and then its argument prototype would still apply.  */
3924 char pthread_create();
3925
3926 int main() {
3927 pthread_create()
3928 ; return 0; }
3929 EOF
3930 if { (eval echo configure:3931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3931   rm -rf conftest*
3932   eval "ac_cv_lib_$ac_lib_var=yes"
3933 else
3934   echo "configure: failed program was:" >&5
3935   cat conftest.$ac_ext >&5
3936   rm -rf conftest*
3937   eval "ac_cv_lib_$ac_lib_var=no"
3938 fi
3939 rm -f conftest*
3940 LIBS="$ac_save_LIBS"
3941
3942 fi
3943 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3944   echo "$ac_t""yes" 1>&6
3945   
3946                                 ol_link_threads=posix
3947                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
3948 else
3949   echo "$ac_t""no" 1>&6
3950 :
3951 fi
3952
3953                         LIBS="$save_LIBS"
3954                 fi
3955
3956                 if test $ol_link_threads = no ; then
3957                                                 save_LIBS="$LIBS"
3958                         echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
3959 echo "configure:3960: checking for pthread_create in -lc_r" >&5
3960 ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
3961 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3962   echo $ac_n "(cached) $ac_c" 1>&6
3963 else
3964   ac_save_LIBS="$LIBS"
3965 LIBS="-lc_r  $LIBS"
3966 cat > conftest.$ac_ext <<EOF
3967 #line 3968 "configure"
3968 #include "confdefs.h"
3969 /* Override any gcc2 internal prototype to avoid an error.  */
3970 /* We use char because int might match the return type of a gcc2
3971     builtin and then its argument prototype would still apply.  */
3972 char pthread_create();
3973
3974 int main() {
3975 pthread_create()
3976 ; return 0; }
3977 EOF
3978 if { (eval echo configure:3979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3979   rm -rf conftest*
3980   eval "ac_cv_lib_$ac_lib_var=yes"
3981 else
3982   echo "configure: failed program was:" >&5
3983   cat conftest.$ac_ext >&5
3984   rm -rf conftest*
3985   eval "ac_cv_lib_$ac_lib_var=no"
3986 fi
3987 rm -f conftest*
3988 LIBS="$ac_save_LIBS"
3989
3990 fi
3991 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3992   echo "$ac_t""yes" 1>&6
3993   
3994                                 ol_link_threads=posix
3995                                 LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"
3996 else
3997   echo "$ac_t""no" 1>&6
3998 :
3999 fi
4000
4001                         LIBS="$save_LIBS"
4002                 fi
4003
4004                 if test $ol_link_threads = no ; then
4005                                                 save_LIBS="$LIBS"
4006                         echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
4007 echo "configure:4008: checking for pthread_create in -lpthreads" >&5
4008 ac_lib_var=`echo pthreads'_'pthread_create | sed 'y%./+-%__p_%'`
4009 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4010   echo $ac_n "(cached) $ac_c" 1>&6
4011 else
4012   ac_save_LIBS="$LIBS"
4013 LIBS="-lpthreads  $LIBS"
4014 cat > conftest.$ac_ext <<EOF
4015 #line 4016 "configure"
4016 #include "confdefs.h"
4017 /* Override any gcc2 internal prototype to avoid an error.  */
4018 /* We use char because int might match the return type of a gcc2
4019     builtin and then its argument prototype would still apply.  */
4020 char pthread_create();
4021
4022 int main() {
4023 pthread_create()
4024 ; return 0; }
4025 EOF
4026 if { (eval echo configure:4027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4027   rm -rf conftest*
4028   eval "ac_cv_lib_$ac_lib_var=yes"
4029 else
4030   echo "configure: failed program was:" >&5
4031   cat conftest.$ac_ext >&5
4032   rm -rf conftest*
4033   eval "ac_cv_lib_$ac_lib_var=no"
4034 fi
4035 rm -f conftest*
4036 LIBS="$ac_save_LIBS"
4037
4038 fi
4039 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4040   echo "$ac_t""yes" 1>&6
4041   
4042                                 ol_link_threads=posix
4043                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads"
4044 else
4045   echo "$ac_t""no" 1>&6
4046 :
4047 fi
4048
4049                         LIBS="$save_LIBS"
4050                 fi
4051
4052                                 if test $ol_link_threads = no ; then
4053                                                 save_LIBS="$LIBS"
4054                         echo $ac_n "checking for pthread_join in -lpthreads""... $ac_c" 1>&6
4055 echo "configure:4056: checking for pthread_join in -lpthreads" >&5
4056 ac_lib_var=`echo pthreads'_'pthread_join | sed 'y%./+-%__p_%'`
4057 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4058   echo $ac_n "(cached) $ac_c" 1>&6
4059 else
4060   ac_save_LIBS="$LIBS"
4061 LIBS="-lpthreads -Wl,-woff,85 $LIBS"
4062 cat > conftest.$ac_ext <<EOF
4063 #line 4064 "configure"
4064 #include "confdefs.h"
4065 /* Override any gcc2 internal prototype to avoid an error.  */
4066 /* We use char because int might match the return type of a gcc2
4067     builtin and then its argument prototype would still apply.  */
4068 char pthread_join();
4069
4070 int main() {
4071 pthread_join()
4072 ; return 0; }
4073 EOF
4074 if { (eval echo configure:4075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4075   rm -rf conftest*
4076   eval "ac_cv_lib_$ac_lib_var=yes"
4077 else
4078   echo "configure: failed program was:" >&5
4079   cat conftest.$ac_ext >&5
4080   rm -rf conftest*
4081   eval "ac_cv_lib_$ac_lib_var=no"
4082 fi
4083 rm -f conftest*
4084 LIBS="$ac_save_LIBS"
4085
4086 fi
4087 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4088   echo "$ac_t""yes" 1>&6
4089   
4090                                 ol_link_threads=posix
4091                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads"
4092                                 
4093 else
4094   echo "$ac_t""no" 1>&6
4095 :
4096 fi
4097
4098                         LIBS="$save_LIBS"
4099                 fi
4100
4101                                 if test $ol_link_threads = no; then
4102                         save_LIBS="$LIBS"
4103                         LIBS="$LIBS -lpthread"
4104                         echo $ac_n "checking for pthread_create() in HP-UX -lpthread""... $ac_c" 1>&6
4105 echo "configure:4106: checking for pthread_create() in HP-UX -lpthread" >&5
4106                         ol_try_pthread_hpux_11=no
4107                         if eval "test \"`echo '$''{'ol_cv_pthread_hpux_11'+set}'`\" = set"; then
4108   echo $ac_n "(cached) $ac_c" 1>&6
4109 else
4110   
4111                                 cat > conftest.$ac_ext <<EOF
4112 #line 4113 "configure"
4113 #include "confdefs.h"
4114
4115 #include <pthread.h>
4116 #include <elf.h>
4117 #ifndef ELFABI_HPUX_REL11
4118         die horribly
4119 #endif
4120                                 
4121 int main() {
4122 pthread_create(NULL, NULL, NULL, NULL);
4123 ; return 0; }
4124 EOF
4125 if { (eval echo configure:4126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4126   rm -rf conftest*
4127   ol_try_pthread_hpux_11=yes
4128                                         ol_cv_pthread_hpux_11=yes
4129 else
4130   echo "configure: failed program was:" >&5
4131   cat conftest.$ac_ext >&5
4132   rm -rf conftest*
4133   ol_cv_pthread_hpux_11=no
4134 fi
4135 rm -f conftest*
4136 fi
4137
4138                         echo "$ac_t""yes" 1>&6
4139                         LIBS="$save_LIBS"
4140
4141                         if test $ol_cv_pthread_hpux_11=yes ; then
4142                                 ol_link_threads=posix
4143                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
4144                                 if test $ol_try_pthread_hpux_11=yes ; then
4145                                                                                                                         ac_cv_func_pthread_attr_init=yes
4146                                 fi
4147                         fi
4148                 fi
4149
4150                 if test $ol_link_threads = no ; then
4151                                                 echo $ac_n "checking for pthread_create with -threads""... $ac_c" 1>&6
4152 echo "configure:4153: checking for pthread_create with -threads" >&5
4153 if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
4154   echo $ac_n "(cached) $ac_c" 1>&6
4155 else
4156   
4157                                                                 save_LIBS="$LIBS"
4158                                 LIBS="-threads $LIBS"
4159                                 cat > conftest.$ac_ext <<EOF
4160 #line 4161 "configure"
4161 #include "confdefs.h"
4162 char pthread();
4163 int main() {
4164
4165                                         pthread_create();
4166                                         
4167 ; return 0; }
4168 EOF
4169 if { (eval echo configure:4170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4170   rm -rf conftest*
4171   ol_cv_thread_flag=yes
4172 else
4173   echo "configure: failed program was:" >&5
4174   cat conftest.$ac_ext >&5
4175   rm -rf conftest*
4176   ol_cv_thread_flag=no
4177 fi
4178 rm -f conftest*
4179                                                                 LIBS="$save_LIBS"
4180                         
4181 fi
4182
4183 echo "$ac_t""$ol_cv_thread_flag" 1>&6
4184
4185                         if test $ol_cv_thread_flag = yes ; then
4186                                 LTHREAD_LIBS="$LTHREAD_LIBS -threads"
4187                                 ol_link_threads=posix
4188                         fi
4189                 fi
4190
4191                 if test $ol_link_threads = no ; then
4192                                                 save_LIBS="$LIBS"
4193                         echo $ac_n "checking for pthread_mutex_lock in -lpthreads""... $ac_c" 1>&6
4194 echo "configure:4195: checking for pthread_mutex_lock in -lpthreads" >&5
4195 ac_lib_var=`echo pthreads'_'pthread_mutex_lock | sed 'y%./+-%__p_%'`
4196 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4197   echo $ac_n "(cached) $ac_c" 1>&6
4198 else
4199   ac_save_LIBS="$LIBS"
4200 LIBS="-lpthreads -lexc $LIBS"
4201 cat > conftest.$ac_ext <<EOF
4202 #line 4203 "configure"
4203 #include "confdefs.h"
4204 /* Override any gcc2 internal prototype to avoid an error.  */
4205 /* We use char because int might match the return type of a gcc2
4206     builtin and then its argument prototype would still apply.  */
4207 char pthread_mutex_lock();
4208
4209 int main() {
4210 pthread_mutex_lock()
4211 ; return 0; }
4212 EOF
4213 if { (eval echo configure:4214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4214   rm -rf conftest*
4215   eval "ac_cv_lib_$ac_lib_var=yes"
4216 else
4217   echo "configure: failed program was:" >&5
4218   cat conftest.$ac_ext >&5
4219   rm -rf conftest*
4220   eval "ac_cv_lib_$ac_lib_var=no"
4221 fi
4222 rm -f conftest*
4223 LIBS="$ac_save_LIBS"
4224
4225 fi
4226 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4227   echo "$ac_t""yes" 1>&6
4228   
4229                                 ol_link_threads=posix
4230                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lexc"
4231                                 if test $ol_with_yielding_select = auto ; then
4232                                         ol_with_yielding_select=yes
4233                                 fi
4234                                 
4235 else
4236   echo "$ac_t""no" 1>&6
4237 :
4238 fi
4239
4240                         LIBS="$save_LIBS"
4241                 fi
4242
4243                 if test $ol_link_threads = no ; then
4244                                                 save_LIBS="$LIBS"
4245                         echo $ac_n "checking for pthread_mutex_unlock in -lpthreads""... $ac_c" 1>&6
4246 echo "configure:4247: checking for pthread_mutex_unlock in -lpthreads" >&5
4247 ac_lib_var=`echo pthreads'_'pthread_mutex_unlock | sed 'y%./+-%__p_%'`
4248 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4249   echo $ac_n "(cached) $ac_c" 1>&6
4250 else
4251   ac_save_LIBS="$LIBS"
4252 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
4253 cat > conftest.$ac_ext <<EOF
4254 #line 4255 "configure"
4255 #include "confdefs.h"
4256 /* Override any gcc2 internal prototype to avoid an error.  */
4257 /* We use char because int might match the return type of a gcc2
4258     builtin and then its argument prototype would still apply.  */
4259 char pthread_mutex_unlock();
4260
4261 int main() {
4262 pthread_mutex_unlock()
4263 ; return 0; }
4264 EOF
4265 if { (eval echo configure:4266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4266   rm -rf conftest*
4267   eval "ac_cv_lib_$ac_lib_var=yes"
4268 else
4269   echo "configure: failed program was:" >&5
4270   cat conftest.$ac_ext >&5
4271   rm -rf conftest*
4272   eval "ac_cv_lib_$ac_lib_var=no"
4273 fi
4274 rm -f conftest*
4275 LIBS="$ac_save_LIBS"
4276
4277 fi
4278 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4279   echo "$ac_t""yes" 1>&6
4280   
4281                                 ol_link_threads=posix
4282                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc -lc_r"
4283                                 if test $ol_with_yielding_select = auto ; then
4284                                         ol_with_yielding_select=yes
4285                                 fi
4286                                 
4287 else
4288   echo "$ac_t""no" 1>&6
4289 :
4290 fi
4291
4292                         LIBS="$save_LIBS"
4293                 fi
4294
4295                 if test $ol_link_threads != no ; then
4296                         cat >> confdefs.h <<\EOF
4297 #define HAVE_PTHREADS 1
4298 EOF
4299
4300
4301                                                 save_CPPFLAGS="$CPPFLAGS"
4302                         save_LIBS="$LIBS"
4303                         LIBS="$LTHREAD_LIBS $LIBS"
4304
4305                                                                                                 for ac_func in sched_yield pthread_yield
4306 do
4307 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4308 echo "configure:4309: checking for $ac_func" >&5
4309 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4310   echo $ac_n "(cached) $ac_c" 1>&6
4311 else
4312   cat > conftest.$ac_ext <<EOF
4313 #line 4314 "configure"
4314 #include "confdefs.h"
4315 /* System header to define __stub macros and hopefully few prototypes,
4316     which can conflict with char $ac_func(); below.  */
4317 #include <assert.h>
4318 /* Override any gcc2 internal prototype to avoid an error.  */
4319 /* We use char because int might match the return type of a gcc2
4320     builtin and then its argument prototype would still apply.  */
4321 char $ac_func();
4322
4323 int main() {
4324
4325 /* The GNU C library defines this for functions which it implements
4326     to always fail with ENOSYS.  Some functions are actually named
4327     something starting with __ and the normal name is an alias.  */
4328 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4329 choke me
4330 #else
4331 $ac_func();
4332 #endif
4333
4334 ; return 0; }
4335 EOF
4336 if { (eval echo configure:4337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4337   rm -rf conftest*
4338   eval "ac_cv_func_$ac_func=yes"
4339 else
4340   echo "configure: failed program was:" >&5
4341   cat conftest.$ac_ext >&5
4342   rm -rf conftest*
4343   eval "ac_cv_func_$ac_func=no"
4344 fi
4345 rm -f conftest*
4346 fi
4347
4348 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4349   echo "$ac_t""yes" 1>&6
4350     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4351   cat >> confdefs.h <<EOF
4352 #define $ac_tr_func 1
4353 EOF
4354  
4355 else
4356   echo "$ac_t""no" 1>&6
4357 fi
4358 done
4359
4360
4361                         if test $ac_cv_func_sched_yield = no -a \
4362                                 $ac_cv_func_pthread_yield = no ; then
4363                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
4364 echo "configure:4365: checking for sched_yield in -lrt" >&5
4365 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
4366 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4367   echo $ac_n "(cached) $ac_c" 1>&6
4368 else
4369   ac_save_LIBS="$LIBS"
4370 LIBS="-lrt  $LIBS"
4371 cat > conftest.$ac_ext <<EOF
4372 #line 4373 "configure"
4373 #include "confdefs.h"
4374 /* Override any gcc2 internal prototype to avoid an error.  */
4375 /* We use char because int might match the return type of a gcc2
4376     builtin and then its argument prototype would still apply.  */
4377 char sched_yield();
4378
4379 int main() {
4380 sched_yield()
4381 ; return 0; }
4382 EOF
4383 if { (eval echo configure:4384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4384   rm -rf conftest*
4385   eval "ac_cv_lib_$ac_lib_var=yes"
4386 else
4387   echo "configure: failed program was:" >&5
4388   cat conftest.$ac_ext >&5
4389   rm -rf conftest*
4390   eval "ac_cv_lib_$ac_lib_var=no"
4391 fi
4392 rm -f conftest*
4393 LIBS="$ac_save_LIBS"
4394
4395 fi
4396 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4397   echo "$ac_t""yes" 1>&6
4398   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
4399                                         cat >> confdefs.h <<\EOF
4400 #define HAVE_SCHED_YIELD 1
4401 EOF
4402
4403                                         ac_cv_func_sched_yield=yes
4404 else
4405   echo "$ac_t""no" 1>&6
4406 ac_cv_func_sched_yield=no
4407 fi
4408
4409                         fi
4410                         if test $ac_cv_func_sched_yield = no -a \
4411                                 $ac_cv_func_pthread_yield = no ; then
4412                                                                                                 for ac_func in thr_yield
4413 do
4414 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4415 echo "configure:4416: checking for $ac_func" >&5
4416 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4417   echo $ac_n "(cached) $ac_c" 1>&6
4418 else
4419   cat > conftest.$ac_ext <<EOF
4420 #line 4421 "configure"
4421 #include "confdefs.h"
4422 /* System header to define __stub macros and hopefully few prototypes,
4423     which can conflict with char $ac_func(); below.  */
4424 #include <assert.h>
4425 /* Override any gcc2 internal prototype to avoid an error.  */
4426 /* We use char because int might match the return type of a gcc2
4427     builtin and then its argument prototype would still apply.  */
4428 char $ac_func();
4429
4430 int main() {
4431
4432 /* The GNU C library defines this for functions which it implements
4433     to always fail with ENOSYS.  Some functions are actually named
4434     something starting with __ and the normal name is an alias.  */
4435 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4436 choke me
4437 #else
4438 $ac_func();
4439 #endif
4440
4441 ; return 0; }
4442 EOF
4443 if { (eval echo configure:4444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4444   rm -rf conftest*
4445   eval "ac_cv_func_$ac_func=yes"
4446 else
4447   echo "configure: failed program was:" >&5
4448   cat conftest.$ac_ext >&5
4449   rm -rf conftest*
4450   eval "ac_cv_func_$ac_func=no"
4451 fi
4452 rm -f conftest*
4453 fi
4454
4455 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4456   echo "$ac_t""yes" 1>&6
4457     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4458   cat >> confdefs.h <<EOF
4459 #define $ac_tr_func 1
4460 EOF
4461  
4462 else
4463   echo "$ac_t""no" 1>&6
4464 fi
4465 done
4466
4467                         fi
4468                         if test $ac_cv_func_sched_yield = no -a \
4469                                 $ac_cv_func_pthread_yield = no -a \
4470                                 "$ac_cv_func_thr_yield" = no ; then
4471                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
4472                         fi
4473
4474                                                 for ac_func in pthread_kill pthread_detach
4475 do
4476 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4477 echo "configure:4478: checking for $ac_func" >&5
4478 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4479   echo $ac_n "(cached) $ac_c" 1>&6
4480 else
4481   cat > conftest.$ac_ext <<EOF
4482 #line 4483 "configure"
4483 #include "confdefs.h"
4484 /* System header to define __stub macros and hopefully few prototypes,
4485     which can conflict with char $ac_func(); below.  */
4486 #include <assert.h>
4487 /* Override any gcc2 internal prototype to avoid an error.  */
4488 /* We use char because int might match the return type of a gcc2
4489     builtin and then its argument prototype would still apply.  */
4490 char $ac_func();
4491
4492 int main() {
4493
4494 /* The GNU C library defines this for functions which it implements
4495     to always fail with ENOSYS.  Some functions are actually named
4496     something starting with __ and the normal name is an alias.  */
4497 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4498 choke me
4499 #else
4500 $ac_func();
4501 #endif
4502
4503 ; return 0; }
4504 EOF
4505 if { (eval echo configure:4506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4506   rm -rf conftest*
4507   eval "ac_cv_func_$ac_func=yes"
4508 else
4509   echo "configure: failed program was:" >&5
4510   cat conftest.$ac_ext >&5
4511   rm -rf conftest*
4512   eval "ac_cv_func_$ac_func=no"
4513 fi
4514 rm -f conftest*
4515 fi
4516
4517 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4518   echo "$ac_t""yes" 1>&6
4519     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4520   cat >> confdefs.h <<EOF
4521 #define $ac_tr_func 1
4522 EOF
4523  
4524 else
4525   echo "$ac_t""no" 1>&6
4526 fi
4527 done
4528
4529
4530                         if test $ac_cv_func_pthread_detach = no ; then
4531                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
4532                         fi
4533
4534                                                 for ac_func in \
4535                                 pthread_setconcurrency \
4536                                 pthread_getconcurrency \
4537                                 thr_setconcurrency \
4538                                 thr_getconcurrency \
4539                         
4540 do
4541 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4542 echo "configure:4543: checking for $ac_func" >&5
4543 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4544   echo $ac_n "(cached) $ac_c" 1>&6
4545 else
4546   cat > conftest.$ac_ext <<EOF
4547 #line 4548 "configure"
4548 #include "confdefs.h"
4549 /* System header to define __stub macros and hopefully few prototypes,
4550     which can conflict with char $ac_func(); below.  */
4551 #include <assert.h>
4552 /* Override any gcc2 internal prototype to avoid an error.  */
4553 /* We use char because int might match the return type of a gcc2
4554     builtin and then its argument prototype would still apply.  */
4555 char $ac_func();
4556
4557 int main() {
4558
4559 /* The GNU C library defines this for functions which it implements
4560     to always fail with ENOSYS.  Some functions are actually named
4561     something starting with __ and the normal name is an alias.  */
4562 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4563 choke me
4564 #else
4565 $ac_func();
4566 #endif
4567
4568 ; return 0; }
4569 EOF
4570 if { (eval echo configure:4571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4571   rm -rf conftest*
4572   eval "ac_cv_func_$ac_func=yes"
4573 else
4574   echo "configure: failed program was:" >&5
4575   cat conftest.$ac_ext >&5
4576   rm -rf conftest*
4577   eval "ac_cv_func_$ac_func=no"
4578 fi
4579 rm -f conftest*
4580 fi
4581
4582 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4583   echo "$ac_t""yes" 1>&6
4584     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4585   cat >> confdefs.h <<EOF
4586 #define $ac_tr_func 1
4587 EOF
4588  
4589 else
4590   echo "$ac_t""no" 1>&6
4591 fi
4592 done
4593
4594
4595                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
4596 echo "configure:4597: checking if pthread_create() works" >&5
4597                         if eval "test \"`echo '$''{'ol_cv_pthread_create_works'+set}'`\" = set"; then
4598   echo $ac_n "(cached) $ac_c" 1>&6
4599 else
4600   
4601                         if test "$cross_compiling" = yes; then
4602                                 ol_cv_pthread_create_works=yes
4603 else
4604   cat > conftest.$ac_ext <<EOF
4605 #line 4606 "configure"
4606 #include "confdefs.h"
4607
4608 #include <pthread.h>
4609 #ifndef NULL
4610 #define NULL (void*)0
4611 #endif
4612
4613 static void *task(p)
4614         void *p;
4615 {
4616         return (void *) (p == NULL);
4617 }
4618
4619 int main(argc, argv)
4620         int argc;
4621         char **argv;
4622 {
4623         pthread_t t;
4624         exit(pthread_create(&t, NULL, task, NULL));
4625 }
4626
4627 EOF
4628 if { (eval echo configure:4629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4629 then
4630   ol_cv_pthread_create_works=yes
4631 else
4632   echo "configure: failed program was:" >&5
4633   cat conftest.$ac_ext >&5
4634   rm -fr conftest*
4635   ol_cv_pthread_create_works=no
4636 fi
4637 rm -fr conftest*
4638 fi
4639
4640 fi
4641
4642                         echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
4643
4644                         if test $ol_cv_pthread_create_works = no ; then
4645                                 { echo "configure: error: pthread.h and pthread_create are not compatible" 1>&2; exit 1; }
4646                         fi
4647
4648                                                 if test $ol_with_yielding_select = auto ; then
4649                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
4650 echo "configure:4651: checking if select yields when using pthreads" >&5
4651                                 if eval "test \"`echo '$''{'ol_cv_pthread_select_yields'+set}'`\" = set"; then
4652   echo $ac_n "(cached) $ac_c" 1>&6
4653 else
4654   
4655                                 if test "$cross_compiling" = yes; then
4656   
4657                                 { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
4658 else
4659   cat > conftest.$ac_ext <<EOF
4660 #line 4661 "configure"
4661 #include "confdefs.h"
4662
4663 #include <sys/types.h>
4664 #include <sys/time.h>
4665 #include <unistd.h>
4666 #include <pthread.h>
4667 #ifndef NULL
4668 #define NULL (void*) 0
4669 #endif
4670
4671 static int fildes[2];
4672
4673 static void *task(p)
4674         void *p;
4675 {
4676         int i;
4677         struct timeval tv;
4678
4679         fd_set rfds;
4680
4681         tv.tv_sec=10;
4682         tv.tv_usec=0;
4683
4684         FD_ZERO(&rfds);
4685         FD_SET(fildes[0], &rfds);
4686
4687         /* we're not interested in any fds */
4688         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
4689
4690         if(i < 0) {
4691                 perror("select");
4692                 exit(10);
4693         }
4694
4695         exit(0); /* if we exit here, the select blocked the whole process */
4696 }
4697
4698 int main(argc, argv)
4699         int argc;
4700         char **argv;
4701 {
4702         pthread_t t;
4703
4704         /* create a pipe to select */
4705         if(pipe(&fildes[0])) {
4706                 perror("select");
4707                 exit(1);
4708         }
4709
4710 #ifdef HAVE_PTHREAD_SETCONCURRENCY
4711         (void) pthread_setconcurrency(2);
4712 #else
4713 #ifdef HAVE_THR_SETCONCURRENCY
4714         /* Set Solaris LWP concurrency to 2 */
4715         thr_setconcurrency(2);
4716 #endif
4717 #endif
4718
4719         pthread_create(&t, NULL, task, NULL);
4720
4721 #if HAVE_SCHED_YIELD
4722         sched_yield();  /* make sure task runs first */
4723 #else
4724 #ifdef HAVE_PTHREAD_YIELD
4725         pthread_yield();        /* make sure task runs first */
4726 #endif
4727 #endif
4728
4729         exit(2);
4730 }
4731 EOF
4732 if { (eval echo configure:4733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4733 then
4734   ol_cv_pthread_select_yields=no
4735 else
4736   echo "configure: failed program was:" >&5
4737   cat conftest.$ac_ext >&5
4738   rm -fr conftest*
4739   ol_cv_pthread_select_yields=yes
4740 fi
4741 rm -fr conftest*
4742 fi
4743
4744 fi
4745
4746                                 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
4747
4748                                 if test $ol_cv_pthread_select_yields = yes ; then
4749                                         ol_with_yielding_select=yes
4750                                 fi
4751                         fi
4752
4753                                                 CPPFLAGS="$save_CPPFLAGS"
4754                         LIBS="$save_LIBS"
4755                 else
4756                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
4757                 fi
4758         fi
4759
4760         if test $ol_with_threads = posix ; then
4761                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
4762         fi
4763 fi
4764
4765 if test $ol_with_threads = auto -o $ol_with_threads = yes \
4766         -o $ol_with_threads = mach ; then
4767
4768                 for ac_hdr in mach/cthreads.h
4769 do
4770 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4771 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4772 echo "configure:4773: checking for $ac_hdr" >&5
4773 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4774   echo $ac_n "(cached) $ac_c" 1>&6
4775 else
4776   cat > conftest.$ac_ext <<EOF
4777 #line 4778 "configure"
4778 #include "confdefs.h"
4779 #include <$ac_hdr>
4780 EOF
4781 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4782 { (eval echo configure:4783: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4783 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4784 if test -z "$ac_err"; then
4785   rm -rf conftest*
4786   eval "ac_cv_header_$ac_safe=yes"
4787 else
4788   echo "$ac_err" >&5
4789   echo "configure: failed program was:" >&5
4790   cat conftest.$ac_ext >&5
4791   rm -rf conftest*
4792   eval "ac_cv_header_$ac_safe=no"
4793 fi
4794 rm -f conftest*
4795 fi
4796 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4797   echo "$ac_t""yes" 1>&6
4798     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4799   cat >> confdefs.h <<EOF
4800 #define $ac_tr_hdr 1
4801 EOF
4802  
4803 else
4804   echo "$ac_t""no" 1>&6
4805 fi
4806 done
4807
4808         if test $ac_cv_header_mach_cthreads_h = yes ; then
4809                 ol_with_threads=found
4810
4811                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
4812 echo "configure:4813: checking for cthread_fork" >&5
4813 if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
4814   echo $ac_n "(cached) $ac_c" 1>&6
4815 else
4816   cat > conftest.$ac_ext <<EOF
4817 #line 4818 "configure"
4818 #include "confdefs.h"
4819 /* System header to define __stub macros and hopefully few prototypes,
4820     which can conflict with char cthread_fork(); below.  */
4821 #include <assert.h>
4822 /* Override any gcc2 internal prototype to avoid an error.  */
4823 /* We use char because int might match the return type of a gcc2
4824     builtin and then its argument prototype would still apply.  */
4825 char cthread_fork();
4826
4827 int main() {
4828
4829 /* The GNU C library defines this for functions which it implements
4830     to always fail with ENOSYS.  Some functions are actually named
4831     something starting with __ and the normal name is an alias.  */
4832 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
4833 choke me
4834 #else
4835 cthread_fork();
4836 #endif
4837
4838 ; return 0; }
4839 EOF
4840 if { (eval echo configure:4841: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4841   rm -rf conftest*
4842   eval "ac_cv_func_cthread_fork=yes"
4843 else
4844   echo "configure: failed program was:" >&5
4845   cat conftest.$ac_ext >&5
4846   rm -rf conftest*
4847   eval "ac_cv_func_cthread_fork=no"
4848 fi
4849 rm -f conftest*
4850 fi
4851
4852 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
4853   echo "$ac_t""yes" 1>&6
4854   ol_link_threads=yes
4855 else
4856   echo "$ac_t""no" 1>&6
4857 fi
4858
4859
4860                 if test $ol_link_threads = no ; then
4861                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
4862 echo "configure:4863: checking for cthread_fork with -all_load" >&5
4863 if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
4864   echo $ac_n "(cached) $ac_c" 1>&6
4865 else
4866   
4867                                                                 save_LIBS="$LIBS"
4868                                 LIBS="-all_load $LIBS"
4869                                 cat > conftest.$ac_ext <<EOF
4870 #line 4871 "configure"
4871 #include "confdefs.h"
4872 #include <mach/cthreads.h>
4873 int main() {
4874
4875                                         cthread_fork((void *)0, (void *)0);
4876                                         
4877 ; return 0; }
4878 EOF
4879 if { (eval echo configure:4880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4880   rm -rf conftest*
4881   ol_cv_cthread_all_load=yes
4882 else
4883   echo "configure: failed program was:" >&5
4884   cat conftest.$ac_ext >&5
4885   rm -rf conftest*
4886   ol_cv_cthread_all_load=no
4887 fi
4888 rm -f conftest*
4889                                                                 LIBS="$save_LIBS"
4890                         
4891 fi
4892
4893 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
4894
4895                         if test $ol_cv_cthread_all_load = yes ; then
4896                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
4897                                 ol_link_threads=mach
4898                         fi
4899                 fi
4900
4901                 if test $ol_link_threads != no ; then
4902                         : check for cthread specific functionality here
4903                         cat >> confdefs.h <<\EOF
4904 #define HAVE_MACH_CTHREADS 1
4905 EOF
4906
4907                 else
4908                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
4909                 fi
4910         fi
4911
4912         if test $ol_with_threads = mach ; then
4913                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
4914         fi
4915 fi
4916
4917 if test $ol_with_threads = auto -o $ol_with_threads = yes \
4918         -o $ol_with_threads = lwp ; then
4919
4920                 for ac_hdr in thread.h synch.h
4921 do
4922 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4923 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4924 echo "configure:4925: checking for $ac_hdr" >&5
4925 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4926   echo $ac_n "(cached) $ac_c" 1>&6
4927 else
4928   cat > conftest.$ac_ext <<EOF
4929 #line 4930 "configure"
4930 #include "confdefs.h"
4931 #include <$ac_hdr>
4932 EOF
4933 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4934 { (eval echo configure:4935: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4935 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4936 if test -z "$ac_err"; then
4937   rm -rf conftest*
4938   eval "ac_cv_header_$ac_safe=yes"
4939 else
4940   echo "$ac_err" >&5
4941   echo "configure: failed program was:" >&5
4942   cat conftest.$ac_ext >&5
4943   rm -rf conftest*
4944   eval "ac_cv_header_$ac_safe=no"
4945 fi
4946 rm -f conftest*
4947 fi
4948 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4949   echo "$ac_t""yes" 1>&6
4950     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4951   cat >> confdefs.h <<EOF
4952 #define $ac_tr_hdr 1
4953 EOF
4954  
4955 else
4956   echo "$ac_t""no" 1>&6
4957 fi
4958 done
4959
4960         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
4961                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
4962 echo "configure:4963: checking for thr_create in -lthread" >&5
4963 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
4964 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4965   echo $ac_n "(cached) $ac_c" 1>&6
4966 else
4967   ac_save_LIBS="$LIBS"
4968 LIBS="-lthread  $LIBS"
4969 cat > conftest.$ac_ext <<EOF
4970 #line 4971 "configure"
4971 #include "confdefs.h"
4972 /* Override any gcc2 internal prototype to avoid an error.  */
4973 /* We use char because int might match the return type of a gcc2
4974     builtin and then its argument prototype would still apply.  */
4975 char thr_create();
4976
4977 int main() {
4978 thr_create()
4979 ; return 0; }
4980 EOF
4981 if { (eval echo configure:4982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4982   rm -rf conftest*
4983   eval "ac_cv_lib_$ac_lib_var=yes"
4984 else
4985   echo "configure: failed program was:" >&5
4986   cat conftest.$ac_ext >&5
4987   rm -rf conftest*
4988   eval "ac_cv_lib_$ac_lib_var=no"
4989 fi
4990 rm -f conftest*
4991 LIBS="$ac_save_LIBS"
4992
4993 fi
4994 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4995   echo "$ac_t""yes" 1>&6
4996   have_thr=yes
4997 else
4998   echo "$ac_t""no" 1>&6
4999 have_thr=no
5000 fi
5001
5002
5003                 if test $have_thr = yes ; then
5004                         cat >> confdefs.h <<\EOF
5005 #define HAVE_THR 1
5006 EOF
5007
5008                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
5009                         ol_link_threads=thr
5010
5011                         if test $ol_with_yielding_select = auto ; then
5012                                 ol_with_yielding_select=yes
5013                         fi
5014
5015                                                 for ac_func in \
5016                                 thr_setconcurrency \
5017                                 thr_getconcurrency \
5018                         
5019 do
5020 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5021 echo "configure:5022: checking for $ac_func" >&5
5022 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5023   echo $ac_n "(cached) $ac_c" 1>&6
5024 else
5025   cat > conftest.$ac_ext <<EOF
5026 #line 5027 "configure"
5027 #include "confdefs.h"
5028 /* System header to define __stub macros and hopefully few prototypes,
5029     which can conflict with char $ac_func(); below.  */
5030 #include <assert.h>
5031 /* Override any gcc2 internal prototype to avoid an error.  */
5032 /* We use char because int might match the return type of a gcc2
5033     builtin and then its argument prototype would still apply.  */
5034 char $ac_func();
5035
5036 int main() {
5037
5038 /* The GNU C library defines this for functions which it implements
5039     to always fail with ENOSYS.  Some functions are actually named
5040     something starting with __ and the normal name is an alias.  */
5041 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5042 choke me
5043 #else
5044 $ac_func();
5045 #endif
5046
5047 ; return 0; }
5048 EOF
5049 if { (eval echo configure:5050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5050   rm -rf conftest*
5051   eval "ac_cv_func_$ac_func=yes"
5052 else
5053   echo "configure: failed program was:" >&5
5054   cat conftest.$ac_ext >&5
5055   rm -rf conftest*
5056   eval "ac_cv_func_$ac_func=no"
5057 fi
5058 rm -f conftest*
5059 fi
5060
5061 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5062   echo "$ac_t""yes" 1>&6
5063     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5064   cat >> confdefs.h <<EOF
5065 #define $ac_tr_func 1
5066 EOF
5067  
5068 else
5069   echo "$ac_t""no" 1>&6
5070 fi
5071 done
5072
5073                 fi
5074         fi
5075
5076                 for ac_hdr in lwp/lwp.h
5077 do
5078 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5079 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5080 echo "configure:5081: checking for $ac_hdr" >&5
5081 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5082   echo $ac_n "(cached) $ac_c" 1>&6
5083 else
5084   cat > conftest.$ac_ext <<EOF
5085 #line 5086 "configure"
5086 #include "confdefs.h"
5087 #include <$ac_hdr>
5088 EOF
5089 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5090 { (eval echo configure:5091: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5091 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5092 if test -z "$ac_err"; then
5093   rm -rf conftest*
5094   eval "ac_cv_header_$ac_safe=yes"
5095 else
5096   echo "$ac_err" >&5
5097   echo "configure: failed program was:" >&5
5098   cat conftest.$ac_ext >&5
5099   rm -rf conftest*
5100   eval "ac_cv_header_$ac_safe=no"
5101 fi
5102 rm -f conftest*
5103 fi
5104 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5105   echo "$ac_t""yes" 1>&6
5106     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5107   cat >> confdefs.h <<EOF
5108 #define $ac_tr_hdr 1
5109 EOF
5110  
5111 else
5112   echo "$ac_t""no" 1>&6
5113 fi
5114 done
5115
5116         if test $ac_cv_header_lwp_lwp_h = yes ; then
5117                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
5118 echo "configure:5119: checking for lwp_create in -llwp" >&5
5119 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
5120 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5121   echo $ac_n "(cached) $ac_c" 1>&6
5122 else
5123   ac_save_LIBS="$LIBS"
5124 LIBS="-llwp  $LIBS"
5125 cat > conftest.$ac_ext <<EOF
5126 #line 5127 "configure"
5127 #include "confdefs.h"
5128 /* Override any gcc2 internal prototype to avoid an error.  */
5129 /* We use char because int might match the return type of a gcc2
5130     builtin and then its argument prototype would still apply.  */
5131 char lwp_create();
5132
5133 int main() {
5134 lwp_create()
5135 ; return 0; }
5136 EOF
5137 if { (eval echo configure:5138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5138   rm -rf conftest*
5139   eval "ac_cv_lib_$ac_lib_var=yes"
5140 else
5141   echo "configure: failed program was:" >&5
5142   cat conftest.$ac_ext >&5
5143   rm -rf conftest*
5144   eval "ac_cv_lib_$ac_lib_var=no"
5145 fi
5146 rm -f conftest*
5147 LIBS="$ac_save_LIBS"
5148
5149 fi
5150 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5151   echo "$ac_t""yes" 1>&6
5152   have_lwp=yes
5153 else
5154   echo "$ac_t""no" 1>&6
5155 have_lwp=no
5156 fi
5157
5158
5159                 if test $have_lwp = yes ; then
5160                         cat >> confdefs.h <<\EOF
5161 #define HAVE_LWP 1
5162 EOF
5163
5164                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
5165                         ol_link_threads=lwp
5166
5167                         if test $ol_with_yielding_select = auto ; then
5168                                 ol_with_yielding_select=no
5169                         fi
5170                 fi
5171         fi
5172 fi
5173
5174 if test $ol_with_yielding_select = yes ; then
5175         cat >> confdefs.h <<\EOF
5176 #define HAVE_YIELDING_SELECT 1
5177 EOF
5178
5179 fi
5180
5181 if test $ol_with_threads = manual ; then
5182                 ol_link_threads=yes
5183
5184         echo "configure: warning: thread defines and link options must be set manually" 1>&2
5185
5186         for ac_hdr in pthread.h sched.h
5187 do
5188 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5189 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5190 echo "configure:5191: checking for $ac_hdr" >&5
5191 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5192   echo $ac_n "(cached) $ac_c" 1>&6
5193 else
5194   cat > conftest.$ac_ext <<EOF
5195 #line 5196 "configure"
5196 #include "confdefs.h"
5197 #include <$ac_hdr>
5198 EOF
5199 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5200 { (eval echo configure:5201: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5201 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5202 if test -z "$ac_err"; then
5203   rm -rf conftest*
5204   eval "ac_cv_header_$ac_safe=yes"
5205 else
5206   echo "$ac_err" >&5
5207   echo "configure: failed program was:" >&5
5208   cat conftest.$ac_ext >&5
5209   rm -rf conftest*
5210   eval "ac_cv_header_$ac_safe=no"
5211 fi
5212 rm -f conftest*
5213 fi
5214 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5215   echo "$ac_t""yes" 1>&6
5216     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5217   cat >> confdefs.h <<EOF
5218 #define $ac_tr_hdr 1
5219 EOF
5220  
5221 else
5222   echo "$ac_t""no" 1>&6
5223 fi
5224 done
5225
5226         for ac_func in sched_yield pthread_yield
5227 do
5228 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5229 echo "configure:5230: checking for $ac_func" >&5
5230 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5231   echo $ac_n "(cached) $ac_c" 1>&6
5232 else
5233   cat > conftest.$ac_ext <<EOF
5234 #line 5235 "configure"
5235 #include "confdefs.h"
5236 /* System header to define __stub macros and hopefully few prototypes,
5237     which can conflict with char $ac_func(); below.  */
5238 #include <assert.h>
5239 /* Override any gcc2 internal prototype to avoid an error.  */
5240 /* We use char because int might match the return type of a gcc2
5241     builtin and then its argument prototype would still apply.  */
5242 char $ac_func();
5243
5244 int main() {
5245
5246 /* The GNU C library defines this for functions which it implements
5247     to always fail with ENOSYS.  Some functions are actually named
5248     something starting with __ and the normal name is an alias.  */
5249 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5250 choke me
5251 #else
5252 $ac_func();
5253 #endif
5254
5255 ; return 0; }
5256 EOF
5257 if { (eval echo configure:5258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5258   rm -rf conftest*
5259   eval "ac_cv_func_$ac_func=yes"
5260 else
5261   echo "configure: failed program was:" >&5
5262   cat conftest.$ac_ext >&5
5263   rm -rf conftest*
5264   eval "ac_cv_func_$ac_func=no"
5265 fi
5266 rm -f conftest*
5267 fi
5268
5269 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5270   echo "$ac_t""yes" 1>&6
5271     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5272   cat >> confdefs.h <<EOF
5273 #define $ac_tr_func 1
5274 EOF
5275  
5276 else
5277   echo "$ac_t""no" 1>&6
5278 fi
5279 done
5280
5281         
5282 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
5283 echo "configure:5284: checking for LinuxThreads" >&5
5284 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
5285   echo $ac_n "(cached) $ac_c" 1>&6
5286 else
5287   
5288         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
5289         if test "$res" -gt 0 ; then
5290                 ol_cv_linux_threads=yes
5291         else
5292                 ol_cv_linux_threads=no
5293         fi
5294
5295 fi
5296
5297 echo "$ac_t""$ol_cv_linux_threads" 1>&6
5298
5299
5300         for ac_hdr in mach/cthreads.h
5301 do
5302 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5303 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5304 echo "configure:5305: checking for $ac_hdr" >&5
5305 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5306   echo $ac_n "(cached) $ac_c" 1>&6
5307 else
5308   cat > conftest.$ac_ext <<EOF
5309 #line 5310 "configure"
5310 #include "confdefs.h"
5311 #include <$ac_hdr>
5312 EOF
5313 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5314 { (eval echo configure:5315: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5315 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5316 if test -z "$ac_err"; then
5317   rm -rf conftest*
5318   eval "ac_cv_header_$ac_safe=yes"
5319 else
5320   echo "$ac_err" >&5
5321   echo "configure: failed program was:" >&5
5322   cat conftest.$ac_ext >&5
5323   rm -rf conftest*
5324   eval "ac_cv_header_$ac_safe=no"
5325 fi
5326 rm -f conftest*
5327 fi
5328 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5329   echo "$ac_t""yes" 1>&6
5330     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5331   cat >> confdefs.h <<EOF
5332 #define $ac_tr_hdr 1
5333 EOF
5334  
5335 else
5336   echo "$ac_t""no" 1>&6
5337 fi
5338 done
5339
5340         for ac_hdr in lwp/lwp.h
5341 do
5342 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5343 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5344 echo "configure:5345: checking for $ac_hdr" >&5
5345 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5346   echo $ac_n "(cached) $ac_c" 1>&6
5347 else
5348   cat > conftest.$ac_ext <<EOF
5349 #line 5350 "configure"
5350 #include "confdefs.h"
5351 #include <$ac_hdr>
5352 EOF
5353 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5354 { (eval echo configure:5355: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5355 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5356 if test -z "$ac_err"; then
5357   rm -rf conftest*
5358   eval "ac_cv_header_$ac_safe=yes"
5359 else
5360   echo "$ac_err" >&5
5361   echo "configure: failed program was:" >&5
5362   cat conftest.$ac_ext >&5
5363   rm -rf conftest*
5364   eval "ac_cv_header_$ac_safe=no"
5365 fi
5366 rm -f conftest*
5367 fi
5368 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5369   echo "$ac_t""yes" 1>&6
5370     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5371   cat >> confdefs.h <<EOF
5372 #define $ac_tr_hdr 1
5373 EOF
5374  
5375 else
5376   echo "$ac_t""no" 1>&6
5377 fi
5378 done
5379
5380         for ac_hdr in thread.h synch.h
5381 do
5382 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5383 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5384 echo "configure:5385: checking for $ac_hdr" >&5
5385 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5386   echo $ac_n "(cached) $ac_c" 1>&6
5387 else
5388   cat > conftest.$ac_ext <<EOF
5389 #line 5390 "configure"
5390 #include "confdefs.h"
5391 #include <$ac_hdr>
5392 EOF
5393 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5394 { (eval echo configure:5395: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5395 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5396 if test -z "$ac_err"; then
5397   rm -rf conftest*
5398   eval "ac_cv_header_$ac_safe=yes"
5399 else
5400   echo "$ac_err" >&5
5401   echo "configure: failed program was:" >&5
5402   cat conftest.$ac_ext >&5
5403   rm -rf conftest*
5404   eval "ac_cv_header_$ac_safe=no"
5405 fi
5406 rm -f conftest*
5407 fi
5408 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5409   echo "$ac_t""yes" 1>&6
5410     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5411   cat >> confdefs.h <<EOF
5412 #define $ac_tr_hdr 1
5413 EOF
5414  
5415 else
5416   echo "$ac_t""no" 1>&6
5417 fi
5418 done
5419
5420 fi
5421
5422 if test $ol_link_threads != no ; then  
5423                         cat >> confdefs.h <<\EOF
5424 #define REENTRANT 1
5425 EOF
5426
5427         cat >> confdefs.h <<\EOF
5428 #define _REENTRANT 1
5429 EOF
5430
5431         cat >> confdefs.h <<\EOF
5432 #define THREAD_SAFE 1
5433 EOF
5434
5435         cat >> confdefs.h <<\EOF
5436 #define _THREAD_SAFE 1
5437 EOF
5438
5439         cat >> confdefs.h <<\EOF
5440 #define THREADSAFE 1
5441 EOF
5442
5443         cat >> confdefs.h <<\EOF
5444 #define _THREADSAFE 1
5445 EOF
5446
5447
5448                                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
5449 echo "configure:5450: checking for thread specific errno" >&5
5450 if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
5451   echo $ac_n "(cached) $ac_c" 1>&6
5452 else
5453   
5454                 cat > conftest.$ac_ext <<EOF
5455 #line 5456 "configure"
5456 #include "confdefs.h"
5457
5458 #include <errno.h>
5459                         
5460 int main() {
5461
5462 int x = errno;
5463                         
5464 ; return 0; }
5465 EOF
5466 if { (eval echo configure:5467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5467   rm -rf conftest*
5468   ol_cv_errno_thread_specific=yes
5469 else
5470   echo "configure: failed program was:" >&5
5471   cat conftest.$ac_ext >&5
5472   rm -rf conftest*
5473   ol_cv_errno_thread_specific=no
5474 fi
5475 rm -f conftest*
5476         
5477 fi
5478
5479 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
5480
5481         if test $ol_cv_errno_thread_specific != yes ; then
5482                 LIBS="$LTHREAD_LIBS $LIBS"
5483                 LTHREAD_LIBS=""
5484         fi
5485 fi  
5486
5487
5488 if test $ol_link_threads = no ; then
5489         if test $ol_with_threads = yes ; then
5490                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
5491         fi
5492
5493         if test $ol_with_threads = auto ; then
5494                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
5495                 ol_with_threads=no
5496         fi
5497
5498         cat >> confdefs.h <<\EOF
5499 #define NO_THREADS 1
5500 EOF
5501
5502         LTHREAD_LIBS=""
5503 fi
5504
5505 ol_link_ldbm=no 
5506 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
5507         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
5508 echo "configure:5509: checking for DB2 library" >&5
5509 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
5510   echo $ac_n "(cached) $ac_c" 1>&6
5511 else
5512         ol_LIBS="$LIBS"
5513         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
5514 echo "configure:5515: checking for db_open in -ldb" >&5
5515 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
5516 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5517   echo $ac_n "(cached) $ac_c" 1>&6
5518 else
5519   ac_save_LIBS="$LIBS"
5520 LIBS="-ldb  $LIBS"
5521 cat > conftest.$ac_ext <<EOF
5522 #line 5523 "configure"
5523 #include "confdefs.h"
5524 /* Override any gcc2 internal prototype to avoid an error.  */
5525 /* We use char because int might match the return type of a gcc2
5526     builtin and then its argument prototype would still apply.  */
5527 char db_open();
5528
5529 int main() {
5530 db_open()
5531 ; return 0; }
5532 EOF
5533 if { (eval echo configure:5534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5534   rm -rf conftest*
5535   eval "ac_cv_lib_$ac_lib_var=yes"
5536 else
5537   echo "configure: failed program was:" >&5
5538   cat conftest.$ac_ext >&5
5539   rm -rf conftest*
5540   eval "ac_cv_lib_$ac_lib_var=no"
5541 fi
5542 rm -f conftest*
5543 LIBS="$ac_save_LIBS"
5544
5545 fi
5546 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5547   echo "$ac_t""yes" 1>&6
5548   ol_cv_lib_db2=-ldb
5549 else
5550   echo "$ac_t""no" 1>&6
5551 ol_cv_lib_db2=no
5552 fi
5553
5554         LIBS="$ol_LIBS"
5555
5556 fi
5557
5558 echo "$ac_t""$ol_cv_lib_db2" 1>&6
5559
5560 for ac_hdr in db.h
5561 do
5562 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5563 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5564 echo "configure:5565: checking for $ac_hdr" >&5
5565 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5566   echo $ac_n "(cached) $ac_c" 1>&6
5567 else
5568   cat > conftest.$ac_ext <<EOF
5569 #line 5570 "configure"
5570 #include "confdefs.h"
5571 #include <$ac_hdr>
5572 EOF
5573 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5574 { (eval echo configure:5575: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5575 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5576 if test -z "$ac_err"; then
5577   rm -rf conftest*
5578   eval "ac_cv_header_$ac_safe=yes"
5579 else
5580   echo "$ac_err" >&5
5581   echo "configure: failed program was:" >&5
5582   cat conftest.$ac_ext >&5
5583   rm -rf conftest*
5584   eval "ac_cv_header_$ac_safe=no"
5585 fi
5586 rm -f conftest*
5587 fi
5588 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5589   echo "$ac_t""yes" 1>&6
5590     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5591   cat >> confdefs.h <<EOF
5592 #define $ac_tr_hdr 1
5593 EOF
5594  
5595 else
5596   echo "$ac_t""no" 1>&6
5597 fi
5598 done
5599
5600 if test $ac_cv_header_db_h = yes ; then
5601         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
5602 echo "configure:5603: checking if db.h is DB2" >&5
5603 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
5604   echo $ac_n "(cached) $ac_c" 1>&6
5605 else
5606   
5607                 cat > conftest.$ac_ext <<EOF
5608 #line 5609 "configure"
5609 #include "confdefs.h"
5610
5611 #                       include <db.h>
5612                         /* this check could be improved */
5613 #                       ifdef DB_VERSION_MAJOR
5614 #                               if DB_VERSION_MAJOR == 2
5615                                         __db_version_2
5616 #                               endif
5617 #                       endif
5618                 
5619 EOF
5620 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5621   egrep "__db_version_2" >/dev/null 2>&1; then
5622   rm -rf conftest*
5623   ol_cv_header_db2=yes
5624 else
5625   rm -rf conftest*
5626   ol_cv_header_db2=no
5627 fi
5628 rm -f conftest*
5629
5630 fi
5631
5632 echo "$ac_t""$ol_cv_header_db2" 1>&6
5633 else
5634         ol_cv_header_db2=no
5635 fi
5636
5637
5638  
5639  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
5640 echo "configure:5641: checking for Berkeley DB2" >&5
5641 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
5642   echo $ac_n "(cached) $ac_c" 1>&6
5643 else
5644   
5645         if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then
5646                 ol_cv_berkeley_db2=no
5647         else
5648                 ol_cv_berkeley_db2=yes
5649         fi
5650
5651 fi
5652
5653 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
5654  if test $ol_cv_berkeley_db2 = yes ; then
5655         cat >> confdefs.h <<\EOF
5656 #define HAVE_BERKELEY_DB2 1
5657 EOF
5658
5659  fi
5660
5661
5662         if test $ol_cv_berkeley_db2 = yes ; then
5663                 ol_link_ldbm=db2
5664                 ol_with_ldbm_api=db2
5665
5666                 if test $ol_with_ldbm_type = hash ; then
5667                         cat >> confdefs.h <<\EOF
5668 #define LDBM_USE_DBHASH 1
5669 EOF
5670
5671                 else
5672                         cat >> confdefs.h <<\EOF
5673 #define LDBM_USE_DBBTREE 1
5674 EOF
5675
5676                 fi
5677
5678                                                 if test $ol_cv_lib_db2 != yes ; then
5679                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
5680                 fi
5681         fi
5682 fi
5683
5684 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
5685         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
5686 echo "configure:5687: checking for Berkeley DB library" >&5
5687 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
5688   echo $ac_n "(cached) $ac_c" 1>&6
5689 else
5690         ol_LIBS="$LIBS"
5691         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
5692 echo "configure:5693: checking for dbopen" >&5
5693 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
5694   echo $ac_n "(cached) $ac_c" 1>&6
5695 else
5696   cat > conftest.$ac_ext <<EOF
5697 #line 5698 "configure"
5698 #include "confdefs.h"
5699 /* System header to define __stub macros and hopefully few prototypes,
5700     which can conflict with char dbopen(); below.  */
5701 #include <assert.h>
5702 /* Override any gcc2 internal prototype to avoid an error.  */
5703 /* We use char because int might match the return type of a gcc2
5704     builtin and then its argument prototype would still apply.  */
5705 char dbopen();
5706
5707 int main() {
5708
5709 /* The GNU C library defines this for functions which it implements
5710     to always fail with ENOSYS.  Some functions are actually named
5711     something starting with __ and the normal name is an alias.  */
5712 #if defined (__stub_dbopen) || defined (__stub___dbopen)
5713 choke me
5714 #else
5715 dbopen();
5716 #endif
5717
5718 ; return 0; }
5719 EOF
5720 if { (eval echo configure:5721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5721   rm -rf conftest*
5722   eval "ac_cv_func_dbopen=yes"
5723 else
5724   echo "configure: failed program was:" >&5
5725   cat conftest.$ac_ext >&5
5726   rm -rf conftest*
5727   eval "ac_cv_func_dbopen=no"
5728 fi
5729 rm -f conftest*
5730 fi
5731
5732 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
5733   echo "$ac_t""yes" 1>&6
5734   ol_cv_lib_db=yes
5735 else
5736   echo "$ac_t""no" 1>&6
5737
5738                 echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
5739 echo "configure:5740: checking for dbopen in -ldb" >&5
5740 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
5741 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5742   echo $ac_n "(cached) $ac_c" 1>&6
5743 else
5744   ac_save_LIBS="$LIBS"
5745 LIBS="-ldb  $LIBS"
5746 cat > conftest.$ac_ext <<EOF
5747 #line 5748 "configure"
5748 #include "confdefs.h"
5749 /* Override any gcc2 internal prototype to avoid an error.  */
5750 /* We use char because int might match the return type of a gcc2
5751     builtin and then its argument prototype would still apply.  */
5752 char dbopen();
5753
5754 int main() {
5755 dbopen()
5756 ; return 0; }
5757 EOF
5758 if { (eval echo configure:5759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5759   rm -rf conftest*
5760   eval "ac_cv_lib_$ac_lib_var=yes"
5761 else
5762   echo "configure: failed program was:" >&5
5763   cat conftest.$ac_ext >&5
5764   rm -rf conftest*
5765   eval "ac_cv_lib_$ac_lib_var=no"
5766 fi
5767 rm -f conftest*
5768 LIBS="$ac_save_LIBS"
5769
5770 fi
5771 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5772   echo "$ac_t""yes" 1>&6
5773   ol_cv_lib_db=-ldb
5774 else
5775   echo "$ac_t""no" 1>&6
5776 ol_cv_lib_db=no
5777 fi
5778
5779         
5780 fi
5781
5782         LIBS="$ol_LIBS"
5783
5784 fi
5785
5786 echo "$ac_t""$ol_cv_lib_db" 1>&6
5787
5788
5789 for ac_hdr in db_185.h
5790 do
5791 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5792 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5793 echo "configure:5794: checking for $ac_hdr" >&5
5794 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5795   echo $ac_n "(cached) $ac_c" 1>&6
5796 else
5797   cat > conftest.$ac_ext <<EOF
5798 #line 5799 "configure"
5799 #include "confdefs.h"
5800 #include <$ac_hdr>
5801 EOF
5802 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5803 { (eval echo configure:5804: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5804 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5805 if test -z "$ac_err"; then
5806   rm -rf conftest*
5807   eval "ac_cv_header_$ac_safe=yes"
5808 else
5809   echo "$ac_err" >&5
5810   echo "configure: failed program was:" >&5
5811   cat conftest.$ac_ext >&5
5812   rm -rf conftest*
5813   eval "ac_cv_header_$ac_safe=no"
5814 fi
5815 rm -f conftest*
5816 fi
5817 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5818   echo "$ac_t""yes" 1>&6
5819     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5820   cat >> confdefs.h <<EOF
5821 #define $ac_tr_hdr 1
5822 EOF
5823  
5824 else
5825   echo "$ac_t""no" 1>&6
5826 fi
5827 done
5828
5829 if test "$ol_cv_header_db2" = yes ; then
5830         
5831         ol_cv_header_db=$ac_cv_header_db_185_h
5832 else
5833         ol_cv_header_db=$ac_cv_header_db_h
5834 fi
5835
5836
5837  
5838  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
5839 echo "configure:5840: checking for Berkeley DB" >&5
5840 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
5841   echo $ac_n "(cached) $ac_c" 1>&6
5842 else
5843   
5844         if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then
5845                 ol_cv_berkeley_db=no
5846         else
5847                 ol_cv_berkeley_db=yes
5848         fi
5849
5850 fi
5851
5852 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
5853  if test $ol_cv_berkeley_db = yes ; then
5854         cat >> confdefs.h <<\EOF
5855 #define HAVE_BERKELEY_DB 1
5856 EOF
5857
5858  fi
5859
5860
5861         if test $ol_cv_berkeley_db = yes ; then
5862                 ol_link_ldbm=db
5863                 ol_with_ldbm_api=db
5864
5865                 if test $ol_with_ldbm_type = hash ; then
5866                         cat >> confdefs.h <<\EOF
5867 #define LDBM_USE_DBHASH 1
5868 EOF
5869
5870                 else
5871                         cat >> confdefs.h <<\EOF
5872 #define LDBM_USE_DBBTREE 1
5873 EOF
5874
5875                 fi
5876
5877                                                 if test $ol_cv_lib_db != yes ; then
5878                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
5879                 fi
5880         fi
5881 fi
5882
5883 if test $ol_with_ldbm_api = manual ; then
5884                 ol_link_ldbm=yes
5885
5886         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
5887
5888         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
5889 do
5890 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5891 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5892 echo "configure:5893: checking for $ac_hdr" >&5
5893 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5894   echo $ac_n "(cached) $ac_c" 1>&6
5895 else
5896   cat > conftest.$ac_ext <<EOF
5897 #line 5898 "configure"
5898 #include "confdefs.h"
5899 #include <$ac_hdr>
5900 EOF
5901 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5902 { (eval echo configure:5903: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5903 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5904 if test -z "$ac_err"; then
5905   rm -rf conftest*
5906   eval "ac_cv_header_$ac_safe=yes"
5907 else
5908   echo "$ac_err" >&5
5909   echo "configure: failed program was:" >&5
5910   cat conftest.$ac_ext >&5
5911   rm -rf conftest*
5912   eval "ac_cv_header_$ac_safe=no"
5913 fi
5914 rm -f conftest*
5915 fi
5916 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5917   echo "$ac_t""yes" 1>&6
5918     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5919   cat >> confdefs.h <<EOF
5920 #define $ac_tr_hdr 1
5921 EOF
5922  
5923 else
5924   echo "$ac_t""no" 1>&6
5925 fi
5926 done
5927
5928 fi
5929
5930 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
5931         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
5932         ol_with_ldbm_api=none
5933 fi
5934
5935 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
5936         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
5937 echo "configure:5938: checking for GDBM library" >&5
5938 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
5939   echo $ac_n "(cached) $ac_c" 1>&6
5940 else
5941         ol_LIBS="$LIBS"
5942         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
5943 echo "configure:5944: checking for gdbm_open" >&5
5944 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
5945   echo $ac_n "(cached) $ac_c" 1>&6
5946 else
5947   cat > conftest.$ac_ext <<EOF
5948 #line 5949 "configure"
5949 #include "confdefs.h"
5950 /* System header to define __stub macros and hopefully few prototypes,
5951     which can conflict with char gdbm_open(); below.  */
5952 #include <assert.h>
5953 /* Override any gcc2 internal prototype to avoid an error.  */
5954 /* We use char because int might match the return type of a gcc2
5955     builtin and then its argument prototype would still apply.  */
5956 char gdbm_open();
5957
5958 int main() {
5959
5960 /* The GNU C library defines this for functions which it implements
5961     to always fail with ENOSYS.  Some functions are actually named
5962     something starting with __ and the normal name is an alias.  */
5963 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
5964 choke me
5965 #else
5966 gdbm_open();
5967 #endif
5968
5969 ; return 0; }
5970 EOF
5971 if { (eval echo configure:5972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5972   rm -rf conftest*
5973   eval "ac_cv_func_gdbm_open=yes"
5974 else
5975   echo "configure: failed program was:" >&5
5976   cat conftest.$ac_ext >&5
5977   rm -rf conftest*
5978   eval "ac_cv_func_gdbm_open=no"
5979 fi
5980 rm -f conftest*
5981 fi
5982
5983 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
5984   echo "$ac_t""yes" 1>&6
5985   ol_cv_lib_gdbm=yes
5986 else
5987   echo "$ac_t""no" 1>&6
5988
5989                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
5990 echo "configure:5991: checking for gdbm_open in -lgdbm" >&5
5991 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
5992 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5993   echo $ac_n "(cached) $ac_c" 1>&6
5994 else
5995   ac_save_LIBS="$LIBS"
5996 LIBS="-lgdbm  $LIBS"
5997 cat > conftest.$ac_ext <<EOF
5998 #line 5999 "configure"
5999 #include "confdefs.h"
6000 /* Override any gcc2 internal prototype to avoid an error.  */
6001 /* We use char because int might match the return type of a gcc2
6002     builtin and then its argument prototype would still apply.  */
6003 char gdbm_open();
6004
6005 int main() {
6006 gdbm_open()
6007 ; return 0; }
6008 EOF
6009 if { (eval echo configure:6010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6010   rm -rf conftest*
6011   eval "ac_cv_lib_$ac_lib_var=yes"
6012 else
6013   echo "configure: failed program was:" >&5
6014   cat conftest.$ac_ext >&5
6015   rm -rf conftest*
6016   eval "ac_cv_lib_$ac_lib_var=no"
6017 fi
6018 rm -f conftest*
6019 LIBS="$ac_save_LIBS"
6020
6021 fi
6022 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6023   echo "$ac_t""yes" 1>&6
6024   ol_cv_lib_gdbm=-lgdbm
6025 else
6026   echo "$ac_t""no" 1>&6
6027 ol_cv_lib_gdbm=no
6028 fi
6029
6030         
6031 fi
6032
6033         LIBS="$ol_LIBS"
6034
6035 fi
6036
6037 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
6038
6039
6040  for ac_hdr in gdbm.h
6041 do
6042 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6043 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6044 echo "configure:6045: checking for $ac_hdr" >&5
6045 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6046   echo $ac_n "(cached) $ac_c" 1>&6
6047 else
6048   cat > conftest.$ac_ext <<EOF
6049 #line 6050 "configure"
6050 #include "confdefs.h"
6051 #include <$ac_hdr>
6052 EOF
6053 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6054 { (eval echo configure:6055: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6055 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6056 if test -z "$ac_err"; then
6057   rm -rf conftest*
6058   eval "ac_cv_header_$ac_safe=yes"
6059 else
6060   echo "$ac_err" >&5
6061   echo "configure: failed program was:" >&5
6062   cat conftest.$ac_ext >&5
6063   rm -rf conftest*
6064   eval "ac_cv_header_$ac_safe=no"
6065 fi
6066 rm -f conftest*
6067 fi
6068 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6069   echo "$ac_t""yes" 1>&6
6070     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6071   cat >> confdefs.h <<EOF
6072 #define $ac_tr_hdr 1
6073 EOF
6074  
6075 else
6076   echo "$ac_t""no" 1>&6
6077 fi
6078 done
6079
6080  echo $ac_n "checking for db""... $ac_c" 1>&6
6081 echo "configure:6082: checking for db" >&5
6082 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
6083   echo $ac_n "(cached) $ac_c" 1>&6
6084 else
6085   
6086         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
6087                 ol_cv_gdbm=no
6088         else
6089                 ol_cv_gdbm=yes
6090         fi
6091
6092 fi
6093
6094 echo "$ac_t""$ol_cv_gdbm" 1>&6
6095  if test $ol_cv_gdbm = yes ; then
6096         cat >> confdefs.h <<\EOF
6097 #define HAVE_GDBM 1
6098 EOF
6099
6100  fi
6101
6102
6103         if test $ol_cv_gdbm = yes ; then
6104                 ol_link_ldbm=gdbm
6105                 ol_with_ldbm_api=gdbm
6106
6107                 if test $ol_cv_lib_gdbm != yes ; then
6108                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
6109                 fi
6110         fi
6111 fi
6112
6113 if test $ol_with_ldbm_api = auto ; then
6114         echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
6115 elif test $ol_with_ldbm_api = ndbm ; then
6116         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
6117 echo "configure:6118: checking for NDBM library" >&5
6118 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
6119   echo $ac_n "(cached) $ac_c" 1>&6
6120 else
6121         ol_LIBS="$LIBS"
6122         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
6123 echo "configure:6124: checking for dbm_open" >&5
6124 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
6125   echo $ac_n "(cached) $ac_c" 1>&6
6126 else
6127   cat > conftest.$ac_ext <<EOF
6128 #line 6129 "configure"
6129 #include "confdefs.h"
6130 /* System header to define __stub macros and hopefully few prototypes,
6131     which can conflict with char dbm_open(); below.  */
6132 #include <assert.h>
6133 /* Override any gcc2 internal prototype to avoid an error.  */
6134 /* We use char because int might match the return type of a gcc2
6135     builtin and then its argument prototype would still apply.  */
6136 char dbm_open();
6137
6138 int main() {
6139
6140 /* The GNU C library defines this for functions which it implements
6141     to always fail with ENOSYS.  Some functions are actually named
6142     something starting with __ and the normal name is an alias.  */
6143 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
6144 choke me
6145 #else
6146 dbm_open();
6147 #endif
6148
6149 ; return 0; }
6150 EOF
6151 if { (eval echo configure:6152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6152   rm -rf conftest*
6153   eval "ac_cv_func_dbm_open=yes"
6154 else
6155   echo "configure: failed program was:" >&5
6156   cat conftest.$ac_ext >&5
6157   rm -rf conftest*
6158   eval "ac_cv_func_dbm_open=no"
6159 fi
6160 rm -f conftest*
6161 fi
6162
6163 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
6164   echo "$ac_t""yes" 1>&6
6165   ol_cv_lib_ndbm=yes
6166 else
6167   echo "$ac_t""no" 1>&6
6168
6169                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
6170 echo "configure:6171: checking for dbm_open in -lndbm" >&5
6171 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
6172 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6173   echo $ac_n "(cached) $ac_c" 1>&6
6174 else
6175   ac_save_LIBS="$LIBS"
6176 LIBS="-lndbm  $LIBS"
6177 cat > conftest.$ac_ext <<EOF
6178 #line 6179 "configure"
6179 #include "confdefs.h"
6180 /* Override any gcc2 internal prototype to avoid an error.  */
6181 /* We use char because int might match the return type of a gcc2
6182     builtin and then its argument prototype would still apply.  */
6183 char dbm_open();
6184
6185 int main() {
6186 dbm_open()
6187 ; return 0; }
6188 EOF
6189 if { (eval echo configure:6190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6190   rm -rf conftest*
6191   eval "ac_cv_lib_$ac_lib_var=yes"
6192 else
6193   echo "configure: failed program was:" >&5
6194   cat conftest.$ac_ext >&5
6195   rm -rf conftest*
6196   eval "ac_cv_lib_$ac_lib_var=no"
6197 fi
6198 rm -f conftest*
6199 LIBS="$ac_save_LIBS"
6200
6201 fi
6202 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6203   echo "$ac_t""yes" 1>&6
6204   ol_cv_lib_ndbm=-lndbm
6205 else
6206   echo "$ac_t""no" 1>&6
6207
6208                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
6209 echo "configure:6210: checking for dbm_open in -ldbm" >&5
6210 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
6211 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6212   echo $ac_n "(cached) $ac_c" 1>&6
6213 else
6214   ac_save_LIBS="$LIBS"
6215 LIBS="-ldbm  $LIBS"
6216 cat > conftest.$ac_ext <<EOF
6217 #line 6218 "configure"
6218 #include "confdefs.h"
6219 /* Override any gcc2 internal prototype to avoid an error.  */
6220 /* We use char because int might match the return type of a gcc2
6221     builtin and then its argument prototype would still apply.  */
6222 char dbm_open();
6223
6224 int main() {
6225 dbm_open()
6226 ; return 0; }
6227 EOF
6228 if { (eval echo configure:6229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6229   rm -rf conftest*
6230   eval "ac_cv_lib_$ac_lib_var=yes"
6231 else
6232   echo "configure: failed program was:" >&5
6233   cat conftest.$ac_ext >&5
6234   rm -rf conftest*
6235   eval "ac_cv_lib_$ac_lib_var=no"
6236 fi
6237 rm -f conftest*
6238 LIBS="$ac_save_LIBS"
6239
6240 fi
6241 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6242   echo "$ac_t""yes" 1>&6
6243   ol_cv_lib_ndbm=-ldbm
6244 else
6245   echo "$ac_t""no" 1>&6
6246 ol_cv_lib_ndbm=no
6247 fi
6248                 
6249 fi
6250
6251         
6252 fi
6253
6254         LIBS="$ol_LIBS"
6255
6256 fi
6257
6258 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
6259
6260
6261  for ac_hdr in ndbm.h
6262 do
6263 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6264 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6265 echo "configure:6266: checking for $ac_hdr" >&5
6266 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6267   echo $ac_n "(cached) $ac_c" 1>&6
6268 else
6269   cat > conftest.$ac_ext <<EOF
6270 #line 6271 "configure"
6271 #include "confdefs.h"
6272 #include <$ac_hdr>
6273 EOF
6274 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6275 { (eval echo configure:6276: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6276 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6277 if test -z "$ac_err"; then
6278   rm -rf conftest*
6279   eval "ac_cv_header_$ac_safe=yes"
6280 else
6281   echo "$ac_err" >&5
6282   echo "configure: failed program was:" >&5
6283   cat conftest.$ac_ext >&5
6284   rm -rf conftest*
6285   eval "ac_cv_header_$ac_safe=no"
6286 fi
6287 rm -f conftest*
6288 fi
6289 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6290   echo "$ac_t""yes" 1>&6
6291     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6292   cat >> confdefs.h <<EOF
6293 #define $ac_tr_hdr 1
6294 EOF
6295  
6296 else
6297   echo "$ac_t""no" 1>&6
6298 fi
6299 done
6300
6301  echo $ac_n "checking for db""... $ac_c" 1>&6
6302 echo "configure:6303: checking for db" >&5
6303 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
6304   echo $ac_n "(cached) $ac_c" 1>&6
6305 else
6306   
6307         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
6308                 ol_cv_ndbm=no
6309         else
6310                 ol_cv_ndbm=yes
6311         fi
6312
6313 fi
6314
6315 echo "$ac_t""$ol_cv_ndbm" 1>&6
6316  if test $ol_cv_ndbm = yes ; then
6317         cat >> confdefs.h <<\EOF
6318 #define HAVE_NDBM 1
6319 EOF
6320
6321  fi
6322
6323
6324         if test $ol_cv_ndbm = yes ; then
6325                 ol_link_ldbm=ndbm
6326                 ol_with_ldbm_api=ndbm
6327
6328                 if test $ol_cv_lib_ndbm != yes ; then
6329                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
6330                 fi
6331         fi
6332 fi
6333
6334 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
6335         echo "configure: warning: could not find suitable LDBM backend" 1>&2
6336         if test $ol_enable_ldbm = yes ; then
6337                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
6338         fi
6339
6340         echo "configure: warning: disabling LDBM" 1>&2
6341         ol_enable_ldbm=no
6342 fi
6343
6344 if test $ol_enable_wrappers != no ; then
6345         for ac_hdr in tcpd.h
6346 do
6347 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6348 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6349 echo "configure:6350: checking for $ac_hdr" >&5
6350 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6351   echo $ac_n "(cached) $ac_c" 1>&6
6352 else
6353   cat > conftest.$ac_ext <<EOF
6354 #line 6355 "configure"
6355 #include "confdefs.h"
6356 #include <$ac_hdr>
6357 EOF
6358 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6359 { (eval echo configure:6360: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6360 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6361 if test -z "$ac_err"; then
6362   rm -rf conftest*
6363   eval "ac_cv_header_$ac_safe=yes"
6364 else
6365   echo "$ac_err" >&5
6366   echo "configure: failed program was:" >&5
6367   cat conftest.$ac_ext >&5
6368   rm -rf conftest*
6369   eval "ac_cv_header_$ac_safe=no"
6370 fi
6371 rm -f conftest*
6372 fi
6373 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6374   echo "$ac_t""yes" 1>&6
6375     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6376   cat >> confdefs.h <<EOF
6377 #define $ac_tr_hdr 1
6378 EOF
6379  
6380 else
6381   echo "$ac_t""no" 1>&6
6382 fi
6383 done
6384
6385
6386         if test $ac_cv_header_tcpd_h != yes ; then
6387                 have_wrappers=no
6388         else
6389                 echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
6390 echo "configure:6391: checking for main in -lwrap" >&5
6391 ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'`
6392 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6393   echo $ac_n "(cached) $ac_c" 1>&6
6394 else
6395   ac_save_LIBS="$LIBS"
6396 LIBS="-lwrap  $LIBS"
6397 cat > conftest.$ac_ext <<EOF
6398 #line 6399 "configure"
6399 #include "confdefs.h"
6400
6401 int main() {
6402 main()
6403 ; return 0; }
6404 EOF
6405 if { (eval echo configure:6406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6406   rm -rf conftest*
6407   eval "ac_cv_lib_$ac_lib_var=yes"
6408 else
6409   echo "configure: failed program was:" >&5
6410   cat conftest.$ac_ext >&5
6411   rm -rf conftest*
6412   eval "ac_cv_lib_$ac_lib_var=no"
6413 fi
6414 rm -f conftest*
6415 LIBS="$ac_save_LIBS"
6416
6417 fi
6418 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6419   echo "$ac_t""yes" 1>&6
6420   have_wrappers=yes
6421 else
6422   echo "$ac_t""no" 1>&6
6423 have_wrappers=no
6424 fi
6425
6426         fi
6427
6428         if test $have_wrappers = yes ; then
6429                 cat >> confdefs.h <<\EOF
6430 #define HAVE_TCPD 1
6431 EOF
6432
6433                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
6434         else
6435                 echo "configure: warning: could not find -lwrap" 1>&2
6436                 if test $ol_enable_wrappers = yes ; then
6437                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
6438                 fi
6439
6440                 echo "configure: warning: disabling wrappers support" 1>&2
6441                 ol_enable_wrappers=no
6442         fi
6443 fi
6444
6445 if test $ol_enable_dmalloc != no ; then
6446         for ac_hdr in dmalloc.h
6447 do
6448 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6449 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6450 echo "configure:6451: checking for $ac_hdr" >&5
6451 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6452   echo $ac_n "(cached) $ac_c" 1>&6
6453 else
6454   cat > conftest.$ac_ext <<EOF
6455 #line 6456 "configure"
6456 #include "confdefs.h"
6457 #include <$ac_hdr>
6458 EOF
6459 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6460 { (eval echo configure:6461: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6461 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6462 if test -z "$ac_err"; then
6463   rm -rf conftest*
6464   eval "ac_cv_header_$ac_safe=yes"
6465 else
6466   echo "$ac_err" >&5
6467   echo "configure: failed program was:" >&5
6468   cat conftest.$ac_ext >&5
6469   rm -rf conftest*
6470   eval "ac_cv_header_$ac_safe=no"
6471 fi
6472 rm -f conftest*
6473 fi
6474 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6475   echo "$ac_t""yes" 1>&6
6476     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6477   cat >> confdefs.h <<EOF
6478 #define $ac_tr_hdr 1
6479 EOF
6480  
6481 else
6482   echo "$ac_t""no" 1>&6
6483 fi
6484 done
6485
6486         echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
6487 echo "configure:6488: checking for dmalloc_shutdown in -ldmalloc" >&5
6488 ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-%__p_%'`
6489 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6490   echo $ac_n "(cached) $ac_c" 1>&6
6491 else
6492   ac_save_LIBS="$LIBS"
6493 LIBS="-ldmalloc  $LIBS"
6494 cat > conftest.$ac_ext <<EOF
6495 #line 6496 "configure"
6496 #include "confdefs.h"
6497 /* Override any gcc2 internal prototype to avoid an error.  */
6498 /* We use char because int might match the return type of a gcc2
6499     builtin and then its argument prototype would still apply.  */
6500 char dmalloc_shutdown();
6501
6502 int main() {
6503 dmalloc_shutdown()
6504 ; return 0; }
6505 EOF
6506 if { (eval echo configure:6507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6507   rm -rf conftest*
6508   eval "ac_cv_lib_$ac_lib_var=yes"
6509 else
6510   echo "configure: failed program was:" >&5
6511   cat conftest.$ac_ext >&5
6512   rm -rf conftest*
6513   eval "ac_cv_lib_$ac_lib_var=no"
6514 fi
6515 rm -f conftest*
6516 LIBS="$ac_save_LIBS"
6517
6518 fi
6519 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6520   echo "$ac_t""yes" 1>&6
6521     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6522     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6523   cat >> confdefs.h <<EOF
6524 #define $ac_tr_lib 1
6525 EOF
6526
6527   LIBS="-ldmalloc $LIBS"
6528
6529 else
6530   echo "$ac_t""no" 1>&6
6531 fi
6532
6533 fi
6534
6535 # ud needs termcap (should insert check here)
6536 ol_link_termcap=no
6537 for ac_hdr in termcap.h ncurses.h
6538 do
6539 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6540 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6541 echo "configure:6542: checking for $ac_hdr" >&5
6542 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6543   echo $ac_n "(cached) $ac_c" 1>&6
6544 else
6545   cat > conftest.$ac_ext <<EOF
6546 #line 6547 "configure"
6547 #include "confdefs.h"
6548 #include <$ac_hdr>
6549 EOF
6550 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6551 { (eval echo configure:6552: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6552 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6553 if test -z "$ac_err"; then
6554   rm -rf conftest*
6555   eval "ac_cv_header_$ac_safe=yes"
6556 else
6557   echo "$ac_err" >&5
6558   echo "configure: failed program was:" >&5
6559   cat conftest.$ac_ext >&5
6560   rm -rf conftest*
6561   eval "ac_cv_header_$ac_safe=no"
6562 fi
6563 rm -f conftest*
6564 fi
6565 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6566   echo "$ac_t""yes" 1>&6
6567     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6568   cat >> confdefs.h <<EOF
6569 #define $ac_tr_hdr 1
6570 EOF
6571  
6572 else
6573   echo "$ac_t""no" 1>&6
6574 fi
6575 done
6576
6577
6578 if test $ol_link_termcap = no ; then
6579         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
6580 echo "configure:6581: checking for tputs in -ltermcap" >&5
6581 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
6582 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6583   echo $ac_n "(cached) $ac_c" 1>&6
6584 else
6585   ac_save_LIBS="$LIBS"
6586 LIBS="-ltermcap  $LIBS"
6587 cat > conftest.$ac_ext <<EOF
6588 #line 6589 "configure"
6589 #include "confdefs.h"
6590 /* Override any gcc2 internal prototype to avoid an error.  */
6591 /* We use char because int might match the return type of a gcc2
6592     builtin and then its argument prototype would still apply.  */
6593 char tputs();
6594
6595 int main() {
6596 tputs()
6597 ; return 0; }
6598 EOF
6599 if { (eval echo configure:6600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6600   rm -rf conftest*
6601   eval "ac_cv_lib_$ac_lib_var=yes"
6602 else
6603   echo "configure: failed program was:" >&5
6604   cat conftest.$ac_ext >&5
6605   rm -rf conftest*
6606   eval "ac_cv_lib_$ac_lib_var=no"
6607 fi
6608 rm -f conftest*
6609 LIBS="$ac_save_LIBS"
6610
6611 fi
6612 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6613   echo "$ac_t""yes" 1>&6
6614   have_termcap=yes
6615 else
6616   echo "$ac_t""no" 1>&6
6617 have_termcap=no
6618 fi
6619
6620         if test $have_termcap = yes ; then
6621                 cat >> confdefs.h <<\EOF
6622 #define HAVE_TERMCAP 1
6623 EOF
6624
6625                 ol_link_termcap=yes
6626                 TERMCAP_LIBS=-ltermcap
6627         fi
6628 fi
6629
6630 if test $ol_link_termcap = no ; then
6631         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
6632 echo "configure:6633: checking for initscr in -lncurses" >&5
6633 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
6634 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6635   echo $ac_n "(cached) $ac_c" 1>&6
6636 else
6637   ac_save_LIBS="$LIBS"
6638 LIBS="-lncurses  $LIBS"
6639 cat > conftest.$ac_ext <<EOF
6640 #line 6641 "configure"
6641 #include "confdefs.h"
6642 /* Override any gcc2 internal prototype to avoid an error.  */
6643 /* We use char because int might match the return type of a gcc2
6644     builtin and then its argument prototype would still apply.  */
6645 char initscr();
6646
6647 int main() {
6648 initscr()
6649 ; return 0; }
6650 EOF
6651 if { (eval echo configure:6652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6652   rm -rf conftest*
6653   eval "ac_cv_lib_$ac_lib_var=yes"
6654 else
6655   echo "configure: failed program was:" >&5
6656   cat conftest.$ac_ext >&5
6657   rm -rf conftest*
6658   eval "ac_cv_lib_$ac_lib_var=no"
6659 fi
6660 rm -f conftest*
6661 LIBS="$ac_save_LIBS"
6662
6663 fi
6664 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6665   echo "$ac_t""yes" 1>&6
6666   have_ncurses=yes
6667 else
6668   echo "$ac_t""no" 1>&6
6669 have_ncurses=no
6670 fi
6671
6672         if test $have_ncurses = yes ; then
6673                 cat >> confdefs.h <<\EOF
6674 #define HAVE_NCURSES 1
6675 EOF
6676
6677                 ol_link_termcap=yes
6678                 TERMCAP_LIBS=-lncurses
6679         fi
6680 fi
6681
6682 if test $ol_link_termcap = no ; then
6683         cat >> confdefs.h <<\EOF
6684 #define NO_TERMCAP 1
6685 EOF
6686
6687         TERMCAP_LIBS=
6688 fi
6689
6690 # FreeBSD (and others) have crypt(3) in -lcrypt
6691 if test $ol_enable_crypt != no ; then
6692         echo $ac_n "checking for crypt""... $ac_c" 1>&6
6693 echo "configure:6694: checking for crypt" >&5
6694 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
6695   echo $ac_n "(cached) $ac_c" 1>&6
6696 else
6697   cat > conftest.$ac_ext <<EOF
6698 #line 6699 "configure"
6699 #include "confdefs.h"
6700 /* System header to define __stub macros and hopefully few prototypes,
6701     which can conflict with char crypt(); below.  */
6702 #include <assert.h>
6703 /* Override any gcc2 internal prototype to avoid an error.  */
6704 /* We use char because int might match the return type of a gcc2
6705     builtin and then its argument prototype would still apply.  */
6706 char crypt();
6707
6708 int main() {
6709
6710 /* The GNU C library defines this for functions which it implements
6711     to always fail with ENOSYS.  Some functions are actually named
6712     something starting with __ and the normal name is an alias.  */
6713 #if defined (__stub_crypt) || defined (__stub___crypt)
6714 choke me
6715 #else
6716 crypt();
6717 #endif
6718
6719 ; return 0; }
6720 EOF
6721 if { (eval echo configure:6722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6722   rm -rf conftest*
6723   eval "ac_cv_func_crypt=yes"
6724 else
6725   echo "configure: failed program was:" >&5
6726   cat conftest.$ac_ext >&5
6727   rm -rf conftest*
6728   eval "ac_cv_func_crypt=no"
6729 fi
6730 rm -f conftest*
6731 fi
6732
6733 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
6734   echo "$ac_t""yes" 1>&6
6735   have_crypt=yes
6736 else
6737   echo "$ac_t""no" 1>&6
6738
6739                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
6740 echo "configure:6741: checking for crypt in -lcrypt" >&5
6741 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
6742 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6743   echo $ac_n "(cached) $ac_c" 1>&6
6744 else
6745   ac_save_LIBS="$LIBS"
6746 LIBS="-lcrypt  $LIBS"
6747 cat > conftest.$ac_ext <<EOF
6748 #line 6749 "configure"
6749 #include "confdefs.h"
6750 /* Override any gcc2 internal prototype to avoid an error.  */
6751 /* We use char because int might match the return type of a gcc2
6752     builtin and then its argument prototype would still apply.  */
6753 char crypt();
6754
6755 int main() {
6756 crypt()
6757 ; return 0; }
6758 EOF
6759 if { (eval echo configure:6760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6760   rm -rf conftest*
6761   eval "ac_cv_lib_$ac_lib_var=yes"
6762 else
6763   echo "configure: failed program was:" >&5
6764   cat conftest.$ac_ext >&5
6765   rm -rf conftest*
6766   eval "ac_cv_lib_$ac_lib_var=no"
6767 fi
6768 rm -f conftest*
6769 LIBS="$ac_save_LIBS"
6770
6771 fi
6772 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6773   echo "$ac_t""yes" 1>&6
6774   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
6775                         have_crypt=yes
6776 else
6777   echo "$ac_t""no" 1>&6
6778 have_crypt=no
6779 fi
6780
6781 fi
6782
6783
6784         if test $have_crypt = yes ; then
6785                 cat >> confdefs.h <<\EOF
6786 #define HAVE_CRYPT 1
6787 EOF
6788
6789         else
6790                 echo "configure: warning: could not find crypt" 1>&2
6791                 if test $ol_enable_crypt = yes ; then
6792                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
6793                 fi
6794
6795                 echo "configure: warning: disabling crypt support" 1>&2
6796                 ol_enable_crypt=no
6797         fi
6798 fi
6799
6800 # FreeBSD (and others) have setproctitle(3) in -lutil
6801 if test $ol_enable_proctitle != no ; then
6802         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
6803 echo "configure:6804: checking for setproctitle" >&5
6804 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
6805   echo $ac_n "(cached) $ac_c" 1>&6
6806 else
6807   cat > conftest.$ac_ext <<EOF
6808 #line 6809 "configure"
6809 #include "confdefs.h"
6810 /* System header to define __stub macros and hopefully few prototypes,
6811     which can conflict with char setproctitle(); below.  */
6812 #include <assert.h>
6813 /* Override any gcc2 internal prototype to avoid an error.  */
6814 /* We use char because int might match the return type of a gcc2
6815     builtin and then its argument prototype would still apply.  */
6816 char setproctitle();
6817
6818 int main() {
6819
6820 /* The GNU C library defines this for functions which it implements
6821     to always fail with ENOSYS.  Some functions are actually named
6822     something starting with __ and the normal name is an alias.  */
6823 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
6824 choke me
6825 #else
6826 setproctitle();
6827 #endif
6828
6829 ; return 0; }
6830 EOF
6831 if { (eval echo configure:6832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6832   rm -rf conftest*
6833   eval "ac_cv_func_setproctitle=yes"
6834 else
6835   echo "configure: failed program was:" >&5
6836   cat conftest.$ac_ext >&5
6837   rm -rf conftest*
6838   eval "ac_cv_func_setproctitle=no"
6839 fi
6840 rm -f conftest*
6841 fi
6842
6843 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
6844   echo "$ac_t""yes" 1>&6
6845   have_setproctitle=yes
6846 else
6847   echo "$ac_t""no" 1>&6
6848
6849                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
6850 echo "configure:6851: checking for setproctitle in -lutil" >&5
6851 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
6852 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6853   echo $ac_n "(cached) $ac_c" 1>&6
6854 else
6855   ac_save_LIBS="$LIBS"
6856 LIBS="-lutil  $LIBS"
6857 cat > conftest.$ac_ext <<EOF
6858 #line 6859 "configure"
6859 #include "confdefs.h"
6860 /* Override any gcc2 internal prototype to avoid an error.  */
6861 /* We use char because int might match the return type of a gcc2
6862     builtin and then its argument prototype would still apply.  */
6863 char setproctitle();
6864
6865 int main() {
6866 setproctitle()
6867 ; return 0; }
6868 EOF
6869 if { (eval echo configure:6870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6870   rm -rf conftest*
6871   eval "ac_cv_lib_$ac_lib_var=yes"
6872 else
6873   echo "configure: failed program was:" >&5
6874   cat conftest.$ac_ext >&5
6875   rm -rf conftest*
6876   eval "ac_cv_lib_$ac_lib_var=no"
6877 fi
6878 rm -f conftest*
6879 LIBS="$ac_save_LIBS"
6880
6881 fi
6882 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6883   echo "$ac_t""yes" 1>&6
6884   have_setproctitle=yes
6885                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
6886 else
6887   echo "$ac_t""no" 1>&6
6888 have_setproctitle=no
6889                         LIBOBJS="$LIBOBJS setproctitle.o"
6890 fi
6891
6892 fi
6893
6894
6895         if test $have_setproctitle = yes ; then
6896                 cat >> confdefs.h <<\EOF
6897 #define HAVE_SETPROCTITLE 1
6898 EOF
6899
6900         fi
6901 fi
6902
6903 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
6904 echo "configure:6905: checking for ANSI C header files" >&5
6905 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
6906   echo $ac_n "(cached) $ac_c" 1>&6
6907 else
6908   cat > conftest.$ac_ext <<EOF
6909 #line 6910 "configure"
6910 #include "confdefs.h"
6911 #include <stdlib.h>
6912 #include <stdarg.h>
6913 #include <string.h>
6914 #include <float.h>
6915 EOF
6916 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6917 { (eval echo configure:6918: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6918 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6919 if test -z "$ac_err"; then
6920   rm -rf conftest*
6921   ac_cv_header_stdc=yes
6922 else
6923   echo "$ac_err" >&5
6924   echo "configure: failed program was:" >&5
6925   cat conftest.$ac_ext >&5
6926   rm -rf conftest*
6927   ac_cv_header_stdc=no
6928 fi
6929 rm -f conftest*
6930
6931 if test $ac_cv_header_stdc = yes; then
6932   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
6933 cat > conftest.$ac_ext <<EOF
6934 #line 6935 "configure"
6935 #include "confdefs.h"
6936 #include <string.h>
6937 EOF
6938 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6939   egrep "memchr" >/dev/null 2>&1; then
6940   :
6941 else
6942   rm -rf conftest*
6943   ac_cv_header_stdc=no
6944 fi
6945 rm -f conftest*
6946
6947 fi
6948
6949 if test $ac_cv_header_stdc = yes; then
6950   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
6951 cat > conftest.$ac_ext <<EOF
6952 #line 6953 "configure"
6953 #include "confdefs.h"
6954 #include <stdlib.h>
6955 EOF
6956 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6957   egrep "free" >/dev/null 2>&1; then
6958   :
6959 else
6960   rm -rf conftest*
6961   ac_cv_header_stdc=no
6962 fi
6963 rm -f conftest*
6964
6965 fi
6966
6967 if test $ac_cv_header_stdc = yes; then
6968   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
6969 if test "$cross_compiling" = yes; then
6970   :
6971 else
6972   cat > conftest.$ac_ext <<EOF
6973 #line 6974 "configure"
6974 #include "confdefs.h"
6975 #include <ctype.h>
6976 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
6977 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
6978 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
6979 int main () { int i; for (i = 0; i < 256; i++)
6980 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
6981 exit (0); }
6982
6983 EOF
6984 if { (eval echo configure:6985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6985 then
6986   :
6987 else
6988   echo "configure: failed program was:" >&5
6989   cat conftest.$ac_ext >&5
6990   rm -fr conftest*
6991   ac_cv_header_stdc=no
6992 fi
6993 rm -fr conftest*
6994 fi
6995
6996 fi
6997 fi
6998
6999 echo "$ac_t""$ac_cv_header_stdc" 1>&6
7000 if test $ac_cv_header_stdc = yes; then
7001   cat >> confdefs.h <<\EOF
7002 #define STDC_HEADERS 1
7003 EOF
7004
7005 fi
7006
7007
7008 if test $ac_cv_header_stdc != yes; then
7009         echo "configure: warning: could not Standard C compliant headers" 1>&2
7010 fi
7011
7012 ac_header_dirent=no
7013 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
7014 do
7015 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7016 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
7017 echo "configure:7018: checking for $ac_hdr that defines DIR" >&5
7018 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
7019   echo $ac_n "(cached) $ac_c" 1>&6
7020 else
7021   cat > conftest.$ac_ext <<EOF
7022 #line 7023 "configure"
7023 #include "confdefs.h"
7024 #include <sys/types.h>
7025 #include <$ac_hdr>
7026 int main() {
7027 DIR *dirp = 0;
7028 ; return 0; }
7029 EOF
7030 if { (eval echo configure:7031: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7031   rm -rf conftest*
7032   eval "ac_cv_header_dirent_$ac_safe=yes"
7033 else
7034   echo "configure: failed program was:" >&5
7035   cat conftest.$ac_ext >&5
7036   rm -rf conftest*
7037   eval "ac_cv_header_dirent_$ac_safe=no"
7038 fi
7039 rm -f conftest*
7040 fi
7041 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
7042   echo "$ac_t""yes" 1>&6
7043     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7044   cat >> confdefs.h <<EOF
7045 #define $ac_tr_hdr 1
7046 EOF
7047  ac_header_dirent=$ac_hdr; break
7048 else
7049   echo "$ac_t""no" 1>&6
7050 fi
7051 done
7052 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
7053 if test $ac_header_dirent = dirent.h; then
7054 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
7055 echo "configure:7056: checking for opendir in -ldir" >&5
7056 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
7057 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7058   echo $ac_n "(cached) $ac_c" 1>&6
7059 else
7060   ac_save_LIBS="$LIBS"
7061 LIBS="-ldir  $LIBS"
7062 cat > conftest.$ac_ext <<EOF
7063 #line 7064 "configure"
7064 #include "confdefs.h"
7065 /* Override any gcc2 internal prototype to avoid an error.  */
7066 /* We use char because int might match the return type of a gcc2
7067     builtin and then its argument prototype would still apply.  */
7068 char opendir();
7069
7070 int main() {
7071 opendir()
7072 ; return 0; }
7073 EOF
7074 if { (eval echo configure:7075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7075   rm -rf conftest*
7076   eval "ac_cv_lib_$ac_lib_var=yes"
7077 else
7078   echo "configure: failed program was:" >&5
7079   cat conftest.$ac_ext >&5
7080   rm -rf conftest*
7081   eval "ac_cv_lib_$ac_lib_var=no"
7082 fi
7083 rm -f conftest*
7084 LIBS="$ac_save_LIBS"
7085
7086 fi
7087 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7088   echo "$ac_t""yes" 1>&6
7089   LIBS="$LIBS -ldir"
7090 else
7091   echo "$ac_t""no" 1>&6
7092 fi
7093
7094 else
7095 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
7096 echo "configure:7097: checking for opendir in -lx" >&5
7097 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
7098 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7099   echo $ac_n "(cached) $ac_c" 1>&6
7100 else
7101   ac_save_LIBS="$LIBS"
7102 LIBS="-lx  $LIBS"
7103 cat > conftest.$ac_ext <<EOF
7104 #line 7105 "configure"
7105 #include "confdefs.h"
7106 /* Override any gcc2 internal prototype to avoid an error.  */
7107 /* We use char because int might match the return type of a gcc2
7108     builtin and then its argument prototype would still apply.  */
7109 char opendir();
7110
7111 int main() {
7112 opendir()
7113 ; return 0; }
7114 EOF
7115 if { (eval echo configure:7116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7116   rm -rf conftest*
7117   eval "ac_cv_lib_$ac_lib_var=yes"
7118 else
7119   echo "configure: failed program was:" >&5
7120   cat conftest.$ac_ext >&5
7121   rm -rf conftest*
7122   eval "ac_cv_lib_$ac_lib_var=no"
7123 fi
7124 rm -f conftest*
7125 LIBS="$ac_save_LIBS"
7126
7127 fi
7128 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7129   echo "$ac_t""yes" 1>&6
7130   LIBS="$LIBS -lx"
7131 else
7132   echo "$ac_t""no" 1>&6
7133 fi
7134
7135 fi
7136
7137 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
7138 echo "configure:7139: checking for sys/wait.h that is POSIX.1 compatible" >&5
7139 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
7140   echo $ac_n "(cached) $ac_c" 1>&6
7141 else
7142   cat > conftest.$ac_ext <<EOF
7143 #line 7144 "configure"
7144 #include "confdefs.h"
7145 #include <sys/types.h>
7146 #include <sys/wait.h>
7147 #ifndef WEXITSTATUS
7148 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
7149 #endif
7150 #ifndef WIFEXITED
7151 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
7152 #endif
7153 int main() {
7154 int s;
7155 wait (&s);
7156 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
7157 ; return 0; }
7158 EOF
7159 if { (eval echo configure:7160: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7160   rm -rf conftest*
7161   ac_cv_header_sys_wait_h=yes
7162 else
7163   echo "configure: failed program was:" >&5
7164   cat conftest.$ac_ext >&5
7165   rm -rf conftest*
7166   ac_cv_header_sys_wait_h=no
7167 fi
7168 rm -f conftest*
7169 fi
7170
7171 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
7172 if test $ac_cv_header_sys_wait_h = yes; then
7173   cat >> confdefs.h <<\EOF
7174 #define HAVE_SYS_WAIT_H 1
7175 EOF
7176
7177 fi
7178
7179 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
7180 echo "configure:7181: checking POSIX termios" >&5
7181 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
7182   echo $ac_n "(cached) $ac_c" 1>&6
7183 else
7184   cat > conftest.$ac_ext <<EOF
7185 #line 7186 "configure"
7186 #include "confdefs.h"
7187 #include <sys/types.h>
7188 #include <unistd.h>
7189 #include <termios.h>
7190 int main() {
7191 /* SunOS 4.0.3 has termios.h but not the library calls.  */
7192    tcgetattr(0, 0);
7193 ; return 0; }
7194 EOF
7195 if { (eval echo configure:7196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7196   rm -rf conftest*
7197   am_cv_sys_posix_termios=yes
7198 else
7199   echo "configure: failed program was:" >&5
7200   cat conftest.$ac_ext >&5
7201   rm -rf conftest*
7202   am_cv_sys_posix_termios=no
7203 fi
7204 rm -f conftest*
7205 fi
7206
7207 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
7208
7209
7210  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
7211 echo "configure:7212: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
7212 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
7213   echo $ac_n "(cached) $ac_c" 1>&6
7214 else
7215   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
7216
7217   gwinsz_in_termios_h=no
7218   if test $am_cv_sys_posix_termios = yes; then
7219     cat > conftest.$ac_ext <<EOF
7220 #line 7221 "configure"
7221 #include "confdefs.h"
7222 #include <sys/types.h>
7223 #     include <termios.h>
7224 #     ifdef TIOCGWINSZ
7225         yes
7226 #     endif
7227     
7228 EOF
7229 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7230   egrep "yes" >/dev/null 2>&1; then
7231   rm -rf conftest*
7232   gwinsz_in_termios_h=yes
7233 fi
7234 rm -f conftest*
7235
7236   fi
7237
7238   if test $gwinsz_in_termios_h = no; then
7239     cat > conftest.$ac_ext <<EOF
7240 #line 7241 "configure"
7241 #include "confdefs.h"
7242 #include <sys/types.h>
7243 #     include <sys/ioctl.h>
7244 #     ifdef TIOCGWINSZ
7245         yes
7246 #     endif
7247     
7248 EOF
7249 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7250   egrep "yes" >/dev/null 2>&1; then
7251   rm -rf conftest*
7252   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
7253 fi
7254 rm -f conftest*
7255
7256   fi
7257   
7258 fi
7259
7260 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
7261   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
7262     cat >> confdefs.h <<\EOF
7263 #define GWINSZ_IN_SYS_IOCTL 1
7264 EOF
7265
7266   fi
7267
7268 if test $am_cv_sys_posix_termios = yes ; then
7269         cat >> confdefs.h <<\EOF
7270 #define HAVE_POSIX_TERMIOS 1
7271 EOF
7272
7273 fi
7274
7275 for ac_hdr in \
7276         crypt.h                 \
7277         errno.h                 \
7278         fcntl.h                 \
7279         filio.h                 \
7280         getopt.h                \
7281         libutil.h               \
7282         limits.h                \
7283         malloc.h                \
7284         memory.h                \
7285         regex.h                 \
7286         psap.h                  \
7287         pwd.h                   \
7288         sgtty.h                 \
7289         stdarg.h                \
7290         stddef.h                \
7291         string.h                \
7292         strings.h               \
7293         sys/file.h              \
7294         sys/filio.h             \
7295         sys/errno.h             \
7296         sys/ioctl.h             \
7297         sys/param.h             \
7298         sys/resource.h  \
7299         sys/socket.h    \
7300         sys/syslog.h    \
7301         sys/time.h              \
7302         sys/types.h             \
7303         syslog.h                \
7304         termios.h               \
7305         unistd.h                \
7306
7307 do
7308 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7309 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7310 echo "configure:7311: checking for $ac_hdr" >&5
7311 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7312   echo $ac_n "(cached) $ac_c" 1>&6
7313 else
7314   cat > conftest.$ac_ext <<EOF
7315 #line 7316 "configure"
7316 #include "confdefs.h"
7317 #include <$ac_hdr>
7318 EOF
7319 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7320 { (eval echo configure:7321: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7321 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7322 if test -z "$ac_err"; then
7323   rm -rf conftest*
7324   eval "ac_cv_header_$ac_safe=yes"
7325 else
7326   echo "$ac_err" >&5
7327   echo "configure: failed program was:" >&5
7328   cat conftest.$ac_ext >&5
7329   rm -rf conftest*
7330   eval "ac_cv_header_$ac_safe=no"
7331 fi
7332 rm -f conftest*
7333 fi
7334 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7335   echo "$ac_t""yes" 1>&6
7336     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7337   cat >> confdefs.h <<EOF
7338 #define $ac_tr_hdr 1
7339 EOF
7340  
7341 else
7342   echo "$ac_t""no" 1>&6
7343 fi
7344 done
7345
7346
7347 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
7348 echo "configure:7349: checking for uid_t in sys/types.h" >&5
7349 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
7350   echo $ac_n "(cached) $ac_c" 1>&6
7351 else
7352   cat > conftest.$ac_ext <<EOF
7353 #line 7354 "configure"
7354 #include "confdefs.h"
7355 #include <sys/types.h>
7356 EOF
7357 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7358   egrep "uid_t" >/dev/null 2>&1; then
7359   rm -rf conftest*
7360   ac_cv_type_uid_t=yes
7361 else
7362   rm -rf conftest*
7363   ac_cv_type_uid_t=no
7364 fi
7365 rm -f conftest*
7366
7367 fi
7368
7369 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
7370 if test $ac_cv_type_uid_t = no; then
7371   cat >> confdefs.h <<\EOF
7372 #define uid_t int
7373 EOF
7374
7375   cat >> confdefs.h <<\EOF
7376 #define gid_t int
7377 EOF
7378
7379 fi
7380
7381 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
7382 echo "configure:7383: checking type of array argument to getgroups" >&5
7383 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
7384   echo $ac_n "(cached) $ac_c" 1>&6
7385 else
7386   if test "$cross_compiling" = yes; then
7387   ac_cv_type_getgroups=cross
7388 else
7389   cat > conftest.$ac_ext <<EOF
7390 #line 7391 "configure"
7391 #include "confdefs.h"
7392
7393 /* Thanks to Mike Rendell for this test.  */
7394 #include <sys/types.h>
7395 #define NGID 256
7396 #undef MAX
7397 #define MAX(x, y) ((x) > (y) ? (x) : (y))
7398 main()
7399 {
7400   gid_t gidset[NGID];
7401   int i, n;
7402   union { gid_t gval; long lval; }  val;
7403
7404   val.lval = -1;
7405   for (i = 0; i < NGID; i++)
7406     gidset[i] = val.gval;
7407   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
7408                  gidset);
7409   /* Exit non-zero if getgroups seems to require an array of ints.  This
7410      happens when gid_t is short but getgroups modifies an array of ints.  */
7411   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
7412 }
7413
7414 EOF
7415 if { (eval echo configure:7416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7416 then
7417     ac_cv_type_getgroups=gid_t
7418 else
7419   echo "configure: failed program was:" >&5
7420   cat conftest.$ac_ext >&5
7421   rm -fr conftest*
7422   ac_cv_type_getgroups=int
7423 fi
7424 rm -fr conftest*
7425 fi
7426
7427 if test $ac_cv_type_getgroups = cross; then
7428         cat > conftest.$ac_ext <<EOF
7429 #line 7430 "configure"
7430 #include "confdefs.h"
7431 #include <unistd.h>
7432 EOF
7433 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7434   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
7435   rm -rf conftest*
7436   ac_cv_type_getgroups=gid_t
7437 else
7438   rm -rf conftest*
7439   ac_cv_type_getgroups=int
7440 fi
7441 rm -f conftest*
7442
7443 fi
7444 fi
7445
7446 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
7447 cat >> confdefs.h <<EOF
7448 #define GETGROUPS_T $ac_cv_type_getgroups
7449 EOF
7450
7451  echo $ac_n "checking for mode_t""... $ac_c" 1>&6
7452 echo "configure:7453: checking for mode_t" >&5
7453 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
7454   echo $ac_n "(cached) $ac_c" 1>&6
7455 else
7456   cat > conftest.$ac_ext <<EOF
7457 #line 7458 "configure"
7458 #include "confdefs.h"
7459 #include <sys/types.h>
7460 #if STDC_HEADERS
7461 #include <stdlib.h>
7462 #include <stddef.h>
7463 #endif
7464 EOF
7465 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7466   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
7467   rm -rf conftest*
7468   ac_cv_type_mode_t=yes
7469 else
7470   rm -rf conftest*
7471   ac_cv_type_mode_t=no
7472 fi
7473 rm -f conftest*
7474
7475 fi
7476 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
7477 if test $ac_cv_type_mode_t = no; then
7478   cat >> confdefs.h <<\EOF
7479 #define mode_t int
7480 EOF
7481
7482 fi
7483
7484 echo $ac_n "checking for off_t""... $ac_c" 1>&6
7485 echo "configure:7486: checking for off_t" >&5
7486 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
7487   echo $ac_n "(cached) $ac_c" 1>&6
7488 else
7489   cat > conftest.$ac_ext <<EOF
7490 #line 7491 "configure"
7491 #include "confdefs.h"
7492 #include <sys/types.h>
7493 #if STDC_HEADERS
7494 #include <stdlib.h>
7495 #include <stddef.h>
7496 #endif
7497 EOF
7498 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7499   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
7500   rm -rf conftest*
7501   ac_cv_type_off_t=yes
7502 else
7503   rm -rf conftest*
7504   ac_cv_type_off_t=no
7505 fi
7506 rm -f conftest*
7507
7508 fi
7509 echo "$ac_t""$ac_cv_type_off_t" 1>&6
7510 if test $ac_cv_type_off_t = no; then
7511   cat >> confdefs.h <<\EOF
7512 #define off_t long
7513 EOF
7514
7515 fi
7516
7517 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
7518 echo "configure:7519: checking for pid_t" >&5
7519 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
7520   echo $ac_n "(cached) $ac_c" 1>&6
7521 else
7522   cat > conftest.$ac_ext <<EOF
7523 #line 7524 "configure"
7524 #include "confdefs.h"
7525 #include <sys/types.h>
7526 #if STDC_HEADERS
7527 #include <stdlib.h>
7528 #include <stddef.h>
7529 #endif
7530 EOF
7531 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7532   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
7533   rm -rf conftest*
7534   ac_cv_type_pid_t=yes
7535 else
7536   rm -rf conftest*
7537   ac_cv_type_pid_t=no
7538 fi
7539 rm -f conftest*
7540
7541 fi
7542 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
7543 if test $ac_cv_type_pid_t = no; then
7544   cat >> confdefs.h <<\EOF
7545 #define pid_t int
7546 EOF
7547
7548 fi
7549
7550 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
7551 echo "configure:7552: checking for ptrdiff_t" >&5
7552 if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then
7553   echo $ac_n "(cached) $ac_c" 1>&6
7554 else
7555   cat > conftest.$ac_ext <<EOF
7556 #line 7557 "configure"
7557 #include "confdefs.h"
7558 #include <stddef.h>
7559 int main() {
7560 ptrdiff_t p
7561 ; return 0; }
7562 EOF
7563 if { (eval echo configure:7564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7564   rm -rf conftest*
7565   am_cv_type_ptrdiff_t=yes
7566 else
7567   echo "configure: failed program was:" >&5
7568   cat conftest.$ac_ext >&5
7569   rm -rf conftest*
7570   am_cv_type_ptrdiff_t=no
7571 fi
7572 rm -f conftest*
7573 fi
7574
7575 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
7576    if test $am_cv_type_ptrdiff_t = yes; then
7577      cat >> confdefs.h <<\EOF
7578 #define HAVE_PTRDIFF_T 1
7579 EOF
7580
7581    fi
7582
7583 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
7584 echo "configure:7585: checking return type of signal handlers" >&5
7585 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
7586   echo $ac_n "(cached) $ac_c" 1>&6
7587 else
7588   cat > conftest.$ac_ext <<EOF
7589 #line 7590 "configure"
7590 #include "confdefs.h"
7591 #include <sys/types.h>
7592 #include <signal.h>
7593 #ifdef signal
7594 #undef signal
7595 #endif
7596 #ifdef __cplusplus
7597 extern "C" void (*signal (int, void (*)(int)))(int);
7598 #else
7599 void (*signal ()) ();
7600 #endif
7601
7602 int main() {
7603 int i;
7604 ; return 0; }
7605 EOF
7606 if { (eval echo configure:7607: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7607   rm -rf conftest*
7608   ac_cv_type_signal=void
7609 else
7610   echo "configure: failed program was:" >&5
7611   cat conftest.$ac_ext >&5
7612   rm -rf conftest*
7613   ac_cv_type_signal=int
7614 fi
7615 rm -f conftest*
7616 fi
7617
7618 echo "$ac_t""$ac_cv_type_signal" 1>&6
7619 cat >> confdefs.h <<EOF
7620 #define RETSIGTYPE $ac_cv_type_signal
7621 EOF
7622
7623
7624 echo $ac_n "checking for size_t""... $ac_c" 1>&6
7625 echo "configure:7626: checking for size_t" >&5
7626 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
7627   echo $ac_n "(cached) $ac_c" 1>&6
7628 else
7629   cat > conftest.$ac_ext <<EOF
7630 #line 7631 "configure"
7631 #include "confdefs.h"
7632 #include <sys/types.h>
7633 #if STDC_HEADERS
7634 #include <stdlib.h>
7635 #include <stddef.h>
7636 #endif
7637 EOF
7638 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7639   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
7640   rm -rf conftest*
7641   ac_cv_type_size_t=yes
7642 else
7643   rm -rf conftest*
7644   ac_cv_type_size_t=no
7645 fi
7646 rm -f conftest*
7647
7648 fi
7649 echo "$ac_t""$ac_cv_type_size_t" 1>&6
7650 if test $ac_cv_type_size_t = no; then
7651   cat >> confdefs.h <<\EOF
7652 #define size_t unsigned
7653 EOF
7654
7655 fi
7656
7657 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
7658 echo "configure:7659: checking for st_blksize in struct stat" >&5
7659 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
7660   echo $ac_n "(cached) $ac_c" 1>&6
7661 else
7662   cat > conftest.$ac_ext <<EOF
7663 #line 7664 "configure"
7664 #include "confdefs.h"
7665 #include <sys/types.h>
7666 #include <sys/stat.h>
7667 int main() {
7668 struct stat s; s.st_blksize;
7669 ; return 0; }
7670 EOF
7671 if { (eval echo configure:7672: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7672   rm -rf conftest*
7673   ac_cv_struct_st_blksize=yes
7674 else
7675   echo "configure: failed program was:" >&5
7676   cat conftest.$ac_ext >&5
7677   rm -rf conftest*
7678   ac_cv_struct_st_blksize=no
7679 fi
7680 rm -f conftest*
7681 fi
7682
7683 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
7684 if test $ac_cv_struct_st_blksize = yes; then
7685   cat >> confdefs.h <<\EOF
7686 #define HAVE_ST_BLKSIZE 1
7687 EOF
7688
7689 fi
7690
7691 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
7692 echo "configure:7693: checking whether time.h and sys/time.h may both be included" >&5
7693 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
7694   echo $ac_n "(cached) $ac_c" 1>&6
7695 else
7696   cat > conftest.$ac_ext <<EOF
7697 #line 7698 "configure"
7698 #include "confdefs.h"
7699 #include <sys/types.h>
7700 #include <sys/time.h>
7701 #include <time.h>
7702 int main() {
7703 struct tm *tp;
7704 ; return 0; }
7705 EOF
7706 if { (eval echo configure:7707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7707   rm -rf conftest*
7708   ac_cv_header_time=yes
7709 else
7710   echo "configure: failed program was:" >&5
7711   cat conftest.$ac_ext >&5
7712   rm -rf conftest*
7713   ac_cv_header_time=no
7714 fi
7715 rm -f conftest*
7716 fi
7717
7718 echo "$ac_t""$ac_cv_header_time" 1>&6
7719 if test $ac_cv_header_time = yes; then
7720   cat >> confdefs.h <<\EOF
7721 #define TIME_WITH_SYS_TIME 1
7722 EOF
7723
7724 fi
7725
7726 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
7727 echo "configure:7728: checking whether struct tm is in sys/time.h or time.h" >&5
7728 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
7729   echo $ac_n "(cached) $ac_c" 1>&6
7730 else
7731   cat > conftest.$ac_ext <<EOF
7732 #line 7733 "configure"
7733 #include "confdefs.h"
7734 #include <sys/types.h>
7735 #include <time.h>
7736 int main() {
7737 struct tm *tp; tp->tm_sec;
7738 ; return 0; }
7739 EOF
7740 if { (eval echo configure:7741: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7741   rm -rf conftest*
7742   ac_cv_struct_tm=time.h
7743 else
7744   echo "configure: failed program was:" >&5
7745   cat conftest.$ac_ext >&5
7746   rm -rf conftest*
7747   ac_cv_struct_tm=sys/time.h
7748 fi
7749 rm -f conftest*
7750 fi
7751
7752 echo "$ac_t""$ac_cv_struct_tm" 1>&6
7753 if test $ac_cv_struct_tm = sys/time.h; then
7754   cat >> confdefs.h <<\EOF
7755 #define TM_IN_SYS_TIME 1
7756 EOF
7757
7758 fi
7759
7760
7761
7762 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
7763 echo "configure:7764: checking if toupper() requires islower()" >&5
7764 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
7765   echo $ac_n "(cached) $ac_c" 1>&6
7766 else
7767   
7768         if test "$cross_compiling" = yes; then
7769   ol_cv_c_upper_lower=safe
7770 else
7771   cat > conftest.$ac_ext <<EOF
7772 #line 7773 "configure"
7773 #include "confdefs.h"
7774
7775 #include <ctype.h>
7776 main()
7777 {
7778         if ('C' == toupper('C'))
7779                 exit(0);
7780         else
7781                 exit(1);
7782 }
7783 EOF
7784 if { (eval echo configure:7785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7785 then
7786   ol_cv_c_upper_lower=no
7787 else
7788   echo "configure: failed program was:" >&5
7789   cat conftest.$ac_ext >&5
7790   rm -fr conftest*
7791   ol_cv_c_upper_lower=yes
7792 fi
7793 rm -fr conftest*
7794 fi
7795
7796 fi
7797
7798 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
7799 if test $ol_cv_c_upper_lower != no ; then
7800         cat >> confdefs.h <<\EOF
7801 #define C_UPPER_LOWER 1
7802 EOF
7803
7804 fi
7805
7806 echo $ac_n "checking for working const""... $ac_c" 1>&6
7807 echo "configure:7808: checking for working const" >&5
7808 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
7809   echo $ac_n "(cached) $ac_c" 1>&6
7810 else
7811   cat > conftest.$ac_ext <<EOF
7812 #line 7813 "configure"
7813 #include "confdefs.h"
7814
7815 int main() {
7816
7817 /* Ultrix mips cc rejects this.  */
7818 typedef int charset[2]; const charset x;
7819 /* SunOS 4.1.1 cc rejects this.  */
7820 char const *const *ccp;
7821 char **p;
7822 /* NEC SVR4.0.2 mips cc rejects this.  */
7823 struct point {int x, y;};
7824 static struct point const zero = {0,0};
7825 /* AIX XL C 1.02.0.0 rejects this.
7826    It does not let you subtract one const X* pointer from another in an arm
7827    of an if-expression whose if-part is not a constant expression */
7828 const char *g = "string";
7829 ccp = &g + (g ? g-g : 0);
7830 /* HPUX 7.0 cc rejects these. */
7831 ++ccp;
7832 p = (char**) ccp;
7833 ccp = (char const *const *) p;
7834 { /* SCO 3.2v4 cc rejects this.  */
7835   char *t;
7836   char const *s = 0 ? (char *) 0 : (char const *) 0;
7837
7838   *t++ = 0;
7839 }
7840 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
7841   int x[] = {25, 17};
7842   const int *foo = &x[0];
7843   ++foo;
7844 }
7845 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
7846   typedef const int *iptr;
7847   iptr p = 0;
7848   ++p;
7849 }
7850 { /* AIX XL C 1.02.0.0 rejects this saying
7851      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
7852   struct s { int j; const int *ap[3]; };
7853   struct s *b; b->j = 5;
7854 }
7855 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
7856   const int foo = 10;
7857 }
7858
7859 ; return 0; }
7860 EOF
7861 if { (eval echo configure:7862: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7862   rm -rf conftest*
7863   ac_cv_c_const=yes
7864 else
7865   echo "configure: failed program was:" >&5
7866   cat conftest.$ac_ext >&5
7867   rm -rf conftest*
7868   ac_cv_c_const=no
7869 fi
7870 rm -f conftest*
7871 fi
7872
7873 echo "$ac_t""$ac_cv_c_const" 1>&6
7874 if test $ac_cv_c_const = no; then
7875   cat >> confdefs.h <<\EOF
7876 #define const 
7877 EOF
7878
7879 fi
7880
7881
7882 if test $cross_compiling = yes ; then
7883         cat >> confdefs.h <<\EOF
7884 #define CROSS_COMPILING 1
7885 EOF
7886
7887 else
7888         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
7889 echo "configure:7890: checking whether byte ordering is bigendian" >&5
7890 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
7891   echo $ac_n "(cached) $ac_c" 1>&6
7892 else
7893   ac_cv_c_bigendian=unknown
7894 # See if sys/param.h defines the BYTE_ORDER macro.
7895 cat > conftest.$ac_ext <<EOF
7896 #line 7897 "configure"
7897 #include "confdefs.h"
7898 #include <sys/types.h>
7899 #include <sys/param.h>
7900 int main() {
7901
7902 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
7903  bogus endian macros
7904 #endif
7905 ; return 0; }
7906 EOF
7907 if { (eval echo configure:7908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7908   rm -rf conftest*
7909   # It does; now see whether it defined to BIG_ENDIAN or not.
7910 cat > conftest.$ac_ext <<EOF
7911 #line 7912 "configure"
7912 #include "confdefs.h"
7913 #include <sys/types.h>
7914 #include <sys/param.h>
7915 int main() {
7916
7917 #if BYTE_ORDER != BIG_ENDIAN
7918  not big endian
7919 #endif
7920 ; return 0; }
7921 EOF
7922 if { (eval echo configure:7923: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7923   rm -rf conftest*
7924   ac_cv_c_bigendian=yes
7925 else
7926   echo "configure: failed program was:" >&5
7927   cat conftest.$ac_ext >&5
7928   rm -rf conftest*
7929   ac_cv_c_bigendian=no
7930 fi
7931 rm -f conftest*
7932 else
7933   echo "configure: failed program was:" >&5
7934   cat conftest.$ac_ext >&5
7935 fi
7936 rm -f conftest*
7937 if test $ac_cv_c_bigendian = unknown; then
7938 if test "$cross_compiling" = yes; then
7939     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
7940 else
7941   cat > conftest.$ac_ext <<EOF
7942 #line 7943 "configure"
7943 #include "confdefs.h"
7944 main () {
7945   /* Are we little or big endian?  From Harbison&Steele.  */
7946   union
7947   {
7948     long l;
7949     char c[sizeof (long)];
7950   } u;
7951   u.l = 1;
7952   exit (u.c[sizeof (long) - 1] == 1);
7953 }
7954 EOF
7955 if { (eval echo configure:7956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7956 then
7957   ac_cv_c_bigendian=no
7958 else
7959   echo "configure: failed program was:" >&5
7960   cat conftest.$ac_ext >&5
7961   rm -fr conftest*
7962   ac_cv_c_bigendian=yes
7963 fi
7964 rm -fr conftest*
7965 fi
7966
7967 fi
7968 fi
7969
7970 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
7971 if test $ac_cv_c_bigendian = yes; then
7972   cat >> confdefs.h <<\EOF
7973 #define WORDS_BIGENDIAN 1
7974 EOF
7975
7976 fi
7977
7978         echo $ac_n "checking size of short""... $ac_c" 1>&6
7979 echo "configure:7980: checking size of short" >&5
7980 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
7981   echo $ac_n "(cached) $ac_c" 1>&6
7982 else
7983   if test "$cross_compiling" = yes; then
7984     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
7985 else
7986   cat > conftest.$ac_ext <<EOF
7987 #line 7988 "configure"
7988 #include "confdefs.h"
7989 #include <stdio.h>
7990 main()
7991 {
7992   FILE *f=fopen("conftestval", "w");
7993   if (!f) exit(1);
7994   fprintf(f, "%d\n", sizeof(short));
7995   exit(0);
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   ac_cv_sizeof_short=`cat conftestval`
8001 else
8002   echo "configure: failed program was:" >&5
8003   cat conftest.$ac_ext >&5
8004   rm -fr conftest*
8005   ac_cv_sizeof_short=0
8006 fi
8007 rm -fr conftest*
8008 fi
8009
8010 fi
8011 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
8012 cat >> confdefs.h <<EOF
8013 #define SIZEOF_SHORT $ac_cv_sizeof_short
8014 EOF
8015
8016  
8017         echo $ac_n "checking size of int""... $ac_c" 1>&6
8018 echo "configure:8019: checking size of int" >&5
8019 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
8020   echo $ac_n "(cached) $ac_c" 1>&6
8021 else
8022   if test "$cross_compiling" = yes; then
8023     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
8024 else
8025   cat > conftest.$ac_ext <<EOF
8026 #line 8027 "configure"
8027 #include "confdefs.h"
8028 #include <stdio.h>
8029 main()
8030 {
8031   FILE *f=fopen("conftestval", "w");
8032   if (!f) exit(1);
8033   fprintf(f, "%d\n", sizeof(int));
8034   exit(0);
8035 }
8036 EOF
8037 if { (eval echo configure:8038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8038 then
8039   ac_cv_sizeof_int=`cat conftestval`
8040 else
8041   echo "configure: failed program was:" >&5
8042   cat conftest.$ac_ext >&5
8043   rm -fr conftest*
8044   ac_cv_sizeof_int=0
8045 fi
8046 rm -fr conftest*
8047 fi
8048
8049 fi
8050 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
8051 cat >> confdefs.h <<EOF
8052 #define SIZEOF_INT $ac_cv_sizeof_int
8053 EOF
8054
8055  
8056         echo $ac_n "checking size of long""... $ac_c" 1>&6
8057 echo "configure:8058: checking size of long" >&5
8058 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
8059   echo $ac_n "(cached) $ac_c" 1>&6
8060 else
8061   if test "$cross_compiling" = yes; then
8062     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
8063 else
8064   cat > conftest.$ac_ext <<EOF
8065 #line 8066 "configure"
8066 #include "confdefs.h"
8067 #include <stdio.h>
8068 main()
8069 {
8070   FILE *f=fopen("conftestval", "w");
8071   if (!f) exit(1);
8072   fprintf(f, "%d\n", sizeof(long));
8073   exit(0);
8074 }
8075 EOF
8076 if { (eval echo configure:8077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8077 then
8078   ac_cv_sizeof_long=`cat conftestval`
8079 else
8080   echo "configure: failed program was:" >&5
8081   cat conftest.$ac_ext >&5
8082   rm -fr conftest*
8083   ac_cv_sizeof_long=0
8084 fi
8085 rm -fr conftest*
8086 fi
8087
8088 fi
8089 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
8090 cat >> confdefs.h <<EOF
8091 #define SIZEOF_LONG $ac_cv_sizeof_long
8092 EOF
8093
8094
8095 fi
8096
8097 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
8098 echo "configure:8099: checking for 8-bit clean memcmp" >&5
8099 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
8100   echo $ac_n "(cached) $ac_c" 1>&6
8101 else
8102   if test "$cross_compiling" = yes; then
8103   ac_cv_func_memcmp_clean=no
8104 else
8105   cat > conftest.$ac_ext <<EOF
8106 #line 8107 "configure"
8107 #include "confdefs.h"
8108
8109 main()
8110 {
8111   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
8112   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
8113 }
8114
8115 EOF
8116 if { (eval echo configure:8117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8117 then
8118   ac_cv_func_memcmp_clean=yes
8119 else
8120   echo "configure: failed program was:" >&5
8121   cat conftest.$ac_ext >&5
8122   rm -fr conftest*
8123   ac_cv_func_memcmp_clean=no
8124 fi
8125 rm -fr conftest*
8126 fi
8127
8128 fi
8129
8130 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
8131 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
8132
8133 echo $ac_n "checking for strftime""... $ac_c" 1>&6
8134 echo "configure:8135: checking for strftime" >&5
8135 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
8136   echo $ac_n "(cached) $ac_c" 1>&6
8137 else
8138   cat > conftest.$ac_ext <<EOF
8139 #line 8140 "configure"
8140 #include "confdefs.h"
8141 /* System header to define __stub macros and hopefully few prototypes,
8142     which can conflict with char strftime(); below.  */
8143 #include <assert.h>
8144 /* Override any gcc2 internal prototype to avoid an error.  */
8145 /* We use char because int might match the return type of a gcc2
8146     builtin and then its argument prototype would still apply.  */
8147 char strftime();
8148
8149 int main() {
8150
8151 /* The GNU C library defines this for functions which it implements
8152     to always fail with ENOSYS.  Some functions are actually named
8153     something starting with __ and the normal name is an alias.  */
8154 #if defined (__stub_strftime) || defined (__stub___strftime)
8155 choke me
8156 #else
8157 strftime();
8158 #endif
8159
8160 ; return 0; }
8161 EOF
8162 if { (eval echo configure:8163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8163   rm -rf conftest*
8164   eval "ac_cv_func_strftime=yes"
8165 else
8166   echo "configure: failed program was:" >&5
8167   cat conftest.$ac_ext >&5
8168   rm -rf conftest*
8169   eval "ac_cv_func_strftime=no"
8170 fi
8171 rm -f conftest*
8172 fi
8173
8174 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
8175   echo "$ac_t""yes" 1>&6
8176   cat >> confdefs.h <<\EOF
8177 #define HAVE_STRFTIME 1
8178 EOF
8179
8180 else
8181   echo "$ac_t""no" 1>&6
8182 # strftime is in -lintl on SCO UNIX.
8183 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
8184 echo "configure:8185: checking for strftime in -lintl" >&5
8185 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
8186 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8187   echo $ac_n "(cached) $ac_c" 1>&6
8188 else
8189   ac_save_LIBS="$LIBS"
8190 LIBS="-lintl  $LIBS"
8191 cat > conftest.$ac_ext <<EOF
8192 #line 8193 "configure"
8193 #include "confdefs.h"
8194 /* Override any gcc2 internal prototype to avoid an error.  */
8195 /* We use char because int might match the return type of a gcc2
8196     builtin and then its argument prototype would still apply.  */
8197 char strftime();
8198
8199 int main() {
8200 strftime()
8201 ; return 0; }
8202 EOF
8203 if { (eval echo configure:8204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8204   rm -rf conftest*
8205   eval "ac_cv_lib_$ac_lib_var=yes"
8206 else
8207   echo "configure: failed program was:" >&5
8208   cat conftest.$ac_ext >&5
8209   rm -rf conftest*
8210   eval "ac_cv_lib_$ac_lib_var=no"
8211 fi
8212 rm -f conftest*
8213 LIBS="$ac_save_LIBS"
8214
8215 fi
8216 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8217   echo "$ac_t""yes" 1>&6
8218   cat >> confdefs.h <<\EOF
8219 #define HAVE_STRFTIME 1
8220 EOF
8221
8222 LIBS="-lintl $LIBS"
8223 else
8224   echo "$ac_t""no" 1>&6
8225 fi
8226
8227 fi
8228
8229 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
8230 echo "configure:8231: checking for vprintf" >&5
8231 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
8232   echo $ac_n "(cached) $ac_c" 1>&6
8233 else
8234   cat > conftest.$ac_ext <<EOF
8235 #line 8236 "configure"
8236 #include "confdefs.h"
8237 /* System header to define __stub macros and hopefully few prototypes,
8238     which can conflict with char vprintf(); below.  */
8239 #include <assert.h>
8240 /* Override any gcc2 internal prototype to avoid an error.  */
8241 /* We use char because int might match the return type of a gcc2
8242     builtin and then its argument prototype would still apply.  */
8243 char vprintf();
8244
8245 int main() {
8246
8247 /* The GNU C library defines this for functions which it implements
8248     to always fail with ENOSYS.  Some functions are actually named
8249     something starting with __ and the normal name is an alias.  */
8250 #if defined (__stub_vprintf) || defined (__stub___vprintf)
8251 choke me
8252 #else
8253 vprintf();
8254 #endif
8255
8256 ; return 0; }
8257 EOF
8258 if { (eval echo configure:8259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8259   rm -rf conftest*
8260   eval "ac_cv_func_vprintf=yes"
8261 else
8262   echo "configure: failed program was:" >&5
8263   cat conftest.$ac_ext >&5
8264   rm -rf conftest*
8265   eval "ac_cv_func_vprintf=no"
8266 fi
8267 rm -f conftest*
8268 fi
8269
8270 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
8271   echo "$ac_t""yes" 1>&6
8272   cat >> confdefs.h <<\EOF
8273 #define HAVE_VPRINTF 1
8274 EOF
8275
8276 else
8277   echo "$ac_t""no" 1>&6
8278 fi
8279
8280 if test "$ac_cv_func_vprintf" != yes; then
8281 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
8282 echo "configure:8283: checking for _doprnt" >&5
8283 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
8284   echo $ac_n "(cached) $ac_c" 1>&6
8285 else
8286   cat > conftest.$ac_ext <<EOF
8287 #line 8288 "configure"
8288 #include "confdefs.h"
8289 /* System header to define __stub macros and hopefully few prototypes,
8290     which can conflict with char _doprnt(); below.  */
8291 #include <assert.h>
8292 /* Override any gcc2 internal prototype to avoid an error.  */
8293 /* We use char because int might match the return type of a gcc2
8294     builtin and then its argument prototype would still apply.  */
8295 char _doprnt();
8296
8297 int main() {
8298
8299 /* The GNU C library defines this for functions which it implements
8300     to always fail with ENOSYS.  Some functions are actually named
8301     something starting with __ and the normal name is an alias.  */
8302 #if defined (__stub__doprnt) || defined (__stub____doprnt)
8303 choke me
8304 #else
8305 _doprnt();
8306 #endif
8307
8308 ; return 0; }
8309 EOF
8310 if { (eval echo configure:8311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8311   rm -rf conftest*
8312   eval "ac_cv_func__doprnt=yes"
8313 else
8314   echo "configure: failed program was:" >&5
8315   cat conftest.$ac_ext >&5
8316   rm -rf conftest*
8317   eval "ac_cv_func__doprnt=no"
8318 fi
8319 rm -f conftest*
8320 fi
8321
8322 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
8323   echo "$ac_t""yes" 1>&6
8324   cat >> confdefs.h <<\EOF
8325 #define HAVE_DOPRNT 1
8326 EOF
8327
8328 else
8329   echo "$ac_t""no" 1>&6
8330 fi
8331
8332 fi
8333
8334
8335 if test $ac_cv_func_vprintf = yes ; then
8336                 for ac_func in vsnprintf vsprintf
8337 do
8338 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8339 echo "configure:8340: checking for $ac_func" >&5
8340 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
8341   echo $ac_n "(cached) $ac_c" 1>&6
8342 else
8343   cat > conftest.$ac_ext <<EOF
8344 #line 8345 "configure"
8345 #include "confdefs.h"
8346 /* System header to define __stub macros and hopefully few prototypes,
8347     which can conflict with char $ac_func(); below.  */
8348 #include <assert.h>
8349 /* Override any gcc2 internal prototype to avoid an error.  */
8350 /* We use char because int might match the return type of a gcc2
8351     builtin and then its argument prototype would still apply.  */
8352 char $ac_func();
8353
8354 int main() {
8355
8356 /* The GNU C library defines this for functions which it implements
8357     to always fail with ENOSYS.  Some functions are actually named
8358     something starting with __ and the normal name is an alias.  */
8359 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8360 choke me
8361 #else
8362 $ac_func();
8363 #endif
8364
8365 ; return 0; }
8366 EOF
8367 if { (eval echo configure:8368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8368   rm -rf conftest*
8369   eval "ac_cv_func_$ac_func=yes"
8370 else
8371   echo "configure: failed program was:" >&5
8372   cat conftest.$ac_ext >&5
8373   rm -rf conftest*
8374   eval "ac_cv_func_$ac_func=no"
8375 fi
8376 rm -f conftest*
8377 fi
8378
8379 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8380   echo "$ac_t""yes" 1>&6
8381     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8382   cat >> confdefs.h <<EOF
8383 #define $ac_tr_func 1
8384 EOF
8385  
8386 else
8387   echo "$ac_t""no" 1>&6
8388 fi
8389 done
8390
8391 fi
8392
8393 for ac_func in \
8394         bcopy                   \
8395         flock                   \
8396         getdtablesize   \
8397         gethostname             \
8398         getpwuid                \
8399         gettimeofday    \
8400         lockf                   \
8401         memcpy                  \
8402         memmove                 \
8403         mkstemp                 \
8404         select                  \
8405         setpwfile               \
8406         setsid                  \
8407         signal                  \
8408         sigset                  \
8409         snprintf                \
8410         socket                  \
8411         strerror                \
8412         strpbrk                 \
8413         strrchr                 \
8414         strsep                  \
8415         strstr                  \
8416         strtok                  \
8417         strtol                  \
8418         strtoul                 \
8419         sysconf                 \
8420         waitpid                 \
8421
8422 do
8423 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8424 echo "configure:8425: checking for $ac_func" >&5
8425 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
8426   echo $ac_n "(cached) $ac_c" 1>&6
8427 else
8428   cat > conftest.$ac_ext <<EOF
8429 #line 8430 "configure"
8430 #include "confdefs.h"
8431 /* System header to define __stub macros and hopefully few prototypes,
8432     which can conflict with char $ac_func(); below.  */
8433 #include <assert.h>
8434 /* Override any gcc2 internal prototype to avoid an error.  */
8435 /* We use char because int might match the return type of a gcc2
8436     builtin and then its argument prototype would still apply.  */
8437 char $ac_func();
8438
8439 int main() {
8440
8441 /* The GNU C library defines this for functions which it implements
8442     to always fail with ENOSYS.  Some functions are actually named
8443     something starting with __ and the normal name is an alias.  */
8444 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8445 choke me
8446 #else
8447 $ac_func();
8448 #endif
8449
8450 ; return 0; }
8451 EOF
8452 if { (eval echo configure:8453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8453   rm -rf conftest*
8454   eval "ac_cv_func_$ac_func=yes"
8455 else
8456   echo "configure: failed program was:" >&5
8457   cat conftest.$ac_ext >&5
8458   rm -rf conftest*
8459   eval "ac_cv_func_$ac_func=no"
8460 fi
8461 rm -f conftest*
8462 fi
8463
8464 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8465   echo "$ac_t""yes" 1>&6
8466     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8467   cat >> confdefs.h <<EOF
8468 #define $ac_tr_func 1
8469 EOF
8470  
8471 else
8472   echo "$ac_t""no" 1>&6
8473 fi
8474 done
8475
8476
8477 for ac_func in getopt strdup tempnam
8478 do
8479 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8480 echo "configure:8481: checking for $ac_func" >&5
8481 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
8482   echo $ac_n "(cached) $ac_c" 1>&6
8483 else
8484   cat > conftest.$ac_ext <<EOF
8485 #line 8486 "configure"
8486 #include "confdefs.h"
8487 /* System header to define __stub macros and hopefully few prototypes,
8488     which can conflict with char $ac_func(); below.  */
8489 #include <assert.h>
8490 /* Override any gcc2 internal prototype to avoid an error.  */
8491 /* We use char because int might match the return type of a gcc2
8492     builtin and then its argument prototype would still apply.  */
8493 char $ac_func();
8494
8495 int main() {
8496
8497 /* The GNU C library defines this for functions which it implements
8498     to always fail with ENOSYS.  Some functions are actually named
8499     something starting with __ and the normal name is an alias.  */
8500 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8501 choke me
8502 #else
8503 $ac_func();
8504 #endif
8505
8506 ; return 0; }
8507 EOF
8508 if { (eval echo configure:8509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8509   rm -rf conftest*
8510   eval "ac_cv_func_$ac_func=yes"
8511 else
8512   echo "configure: failed program was:" >&5
8513   cat conftest.$ac_ext >&5
8514   rm -rf conftest*
8515   eval "ac_cv_func_$ac_func=no"
8516 fi
8517 rm -f conftest*
8518 fi
8519
8520 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8521   echo "$ac_t""yes" 1>&6
8522     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8523   cat >> confdefs.h <<EOF
8524 #define $ac_tr_func 1
8525 EOF
8526  
8527 else
8528   echo "$ac_t""no" 1>&6
8529 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
8530 fi
8531 done
8532
8533
8534
8535 # Check Configuration
8536
8537 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
8538 echo "configure:8539: checking declaration of sys_errlist" >&5
8539 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
8540   echo $ac_n "(cached) $ac_c" 1>&6
8541 else
8542   
8543         cat > conftest.$ac_ext <<EOF
8544 #line 8545 "configure"
8545 #include "confdefs.h"
8546
8547 #include <stdio.h>
8548 #include <sys/types.h>
8549 #include <errno.h> 
8550 int main() {
8551 char *c = (char *) *sys_errlist
8552 ; return 0; }
8553 EOF
8554 if { (eval echo configure:8555: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8555   rm -rf conftest*
8556   ol_cv_dcl_sys_errlist=yes
8557 else
8558   echo "configure: failed program was:" >&5
8559   cat conftest.$ac_ext >&5
8560   rm -rf conftest*
8561   ol_cv_dcl_sys_errlist=no
8562 fi
8563 rm -f conftest*
8564 fi
8565
8566 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
8567
8568 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
8569 if test $ol_cv_dcl_sys_errlist = no ; then
8570         cat >> confdefs.h <<\EOF
8571 #define DECL_SYS_ERRLIST 1
8572 EOF
8573
8574         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
8575 echo "configure:8576: checking existence of sys_errlist" >&5
8576         if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
8577   echo $ac_n "(cached) $ac_c" 1>&6
8578 else
8579   
8580                 cat > conftest.$ac_ext <<EOF
8581 #line 8582 "configure"
8582 #include "confdefs.h"
8583 #include <errno.h>
8584 int main() {
8585 char *c = (char *) *sys_errlist
8586 ; return 0; }
8587 EOF
8588 if { (eval echo configure:8589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8589   rm -rf conftest*
8590   ol_cv_have_sys_errlist=yes
8591 else
8592   echo "configure: failed program was:" >&5
8593   cat conftest.$ac_ext >&5
8594   rm -rf conftest*
8595   ol_cv_have_sys_errlist=no
8596 fi
8597 rm -f conftest*
8598 fi
8599
8600         echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
8601 fi
8602
8603
8604
8605 if test "$ol_enable_debug" != no ; then
8606         cat >> confdefs.h <<\EOF
8607 #define LDAP_DEBUG 1
8608 EOF
8609
8610 fi
8611 if test "$ol_enable_libui" = yes ; then
8612         cat >> confdefs.h <<\EOF
8613 #define LDAP_LIBUI 1
8614 EOF
8615
8616 fi
8617 if test "$ol_enable_cache" = no ; then
8618         cat >> confdefs.h <<\EOF
8619 #define LDAP_NOCACHE 1
8620 EOF
8621
8622 fi
8623 if test "$ol_enable_dns" != no ; then
8624         cat >> confdefs.h <<\EOF
8625 #define LDAP_DNS 1
8626 EOF
8627
8628 fi
8629 if test "$ol_enable_proctitle" != no ; then
8630         cat >> confdefs.h <<\EOF
8631 #define LDAP_PROCTITLE 1
8632 EOF
8633
8634 fi
8635 if test "$ol_enable_referrals" != no ; then
8636         cat >> confdefs.h <<\EOF
8637 #define LDAP_REFERRALS 1
8638 EOF
8639
8640 fi
8641 if test "$ol_enable_cldap" != no ; then
8642         cat >> confdefs.h <<\EOF
8643 #define LDAP_CONNECTIONLESS 1
8644 EOF
8645
8646 fi
8647
8648 if test "$ol_enable_aclgroups" != no ; then
8649         cat >> confdefs.h <<\EOF
8650 #define SLAPD_ACLGROUPS 1
8651 EOF
8652
8653 fi
8654 if test "$ol_enable_crypt" != no ; then
8655         cat >> confdefs.h <<\EOF
8656 #define SLAPD_CRYPT 1
8657 EOF
8658
8659 fi
8660 if test "$ol_enable_cleartext" != no ; then
8661         cat >> confdefs.h <<\EOF
8662 #define SLAPD_CLEARTEXT 1
8663 EOF
8664
8665 fi
8666 if test "$ol_enable_phonetic" != no ; then
8667         cat >> confdefs.h <<\EOF
8668 #define SLAPD_PHONETIC 1
8669 EOF
8670
8671 fi
8672 if test "$ol_enable_rlookups" != no ; then
8673         cat >> confdefs.h <<\EOF
8674 #define SLAPD_RLOOKUPS 1
8675 EOF
8676
8677 fi
8678
8679 if test "$ol_link_ldbm" != no ; then
8680         cat >> confdefs.h <<\EOF
8681 #define SLAPD_LDBM 1
8682 EOF
8683
8684         BUILD_SLAPD=yes
8685         BUILD_LDBM=yes
8686 fi
8687
8688 if test "$ol_enable_passwd" != no ; then
8689         cat >> confdefs.h <<\EOF
8690 #define SLAPD_PASSWD 1
8691 EOF
8692
8693         BUILD_SLAPD=yes
8694         BUILD_PASSWD=yes
8695 fi
8696
8697 if test "$ol_enable_shell" != no ; then
8698         cat >> confdefs.h <<\EOF
8699 #define SLAPD_SHELL 1
8700 EOF
8701
8702         BUILD_SLAPD=yes
8703         BUILD_SHELL=yes
8704 fi
8705
8706 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
8707         $BUILD_SLAPD = yes ; then
8708         BUILD_SLURPD=yes
8709 fi
8710
8711 if test "$ol_link_isode" != no ; then
8712         BUILD_LDAPD=yes
8713 fi
8714
8715
8716
8717
8718   
8719   
8720   
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735 trap '' 1 2 15
8736 cat > confcache <<\EOF
8737 # This file is a shell script that caches the results of configure
8738 # tests run on this system so they can be shared between configure
8739 # scripts and configure runs.  It is not useful on other systems.
8740 # If it contains results you don't want to keep, you may remove or edit it.
8741 #
8742 # By default, configure uses ./config.cache as the cache file,
8743 # creating it if it does not exist already.  You can give configure
8744 # the --cache-file=FILE option to use a different cache file; that is
8745 # what configure does when it calls configure scripts in
8746 # subdirectories, so they share the cache.
8747 # Giving --cache-file=/dev/null disables caching, for debugging configure.
8748 # config.status only pays attention to the cache file if you give it the
8749 # --recheck option to rerun configure.
8750 #
8751 EOF
8752 # The following way of writing the cache mishandles newlines in values,
8753 # but we know of no workaround that is simple, portable, and efficient.
8754 # So, don't put newlines in cache variables' values.
8755 # Ultrix sh set writes to stderr and can't be redirected directly,
8756 # and sets the high bit in the cache file unless we assign to the vars.
8757 (set) 2>&1 |
8758   case `(ac_space=' '; set | grep ac_space) 2>&1` in
8759   *ac_space=\ *)
8760     # `set' does not quote correctly, so add quotes (double-quote substitution
8761     # turns \\\\ into \\, and sed turns \\ into \).
8762     sed -n \
8763       -e "s/'/'\\\\''/g" \
8764       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
8765     ;;
8766   *)
8767     # `set' quotes correctly as required by POSIX, so do not add quotes.
8768     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
8769     ;;
8770   esac >> confcache
8771 if cmp -s $cache_file confcache; then
8772   :
8773 else
8774   if test -w $cache_file; then
8775     echo "updating cache $cache_file"
8776     cat confcache > $cache_file
8777   else
8778     echo "not updating unwritable cache $cache_file"
8779   fi
8780 fi
8781 rm -f confcache
8782
8783 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
8784
8785 test "x$prefix" = xNONE && prefix=$ac_default_prefix
8786 # Let make expand exec_prefix.
8787 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
8788
8789 # Any assignment to VPATH causes Sun make to only execute
8790 # the first set of double-colon rules, so remove it if not needed.
8791 # If there is a colon in the path, we need to keep it.
8792 if test "x$srcdir" = x.; then
8793   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
8794 fi
8795
8796 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
8797
8798 DEFS=-DHAVE_CONFIG_H
8799
8800 # Without the "./", some shells look in PATH for config.status.
8801 : ${CONFIG_STATUS=./config.status}
8802
8803 echo creating $CONFIG_STATUS
8804 rm -f $CONFIG_STATUS
8805 cat > $CONFIG_STATUS <<EOF
8806 #! /bin/sh
8807 # Generated automatically by configure.
8808 # Run this file to recreate the current configuration.
8809 # This directory was configured as follows,
8810 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
8811 #
8812 # $0 $ac_configure_args
8813 #
8814 # Compiler output produced by configure, useful for debugging
8815 # configure, is in ./config.log if it exists.
8816
8817 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
8818 for ac_option
8819 do
8820   case "\$ac_option" in
8821   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
8822     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
8823     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
8824   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
8825     echo "$CONFIG_STATUS generated by autoconf version 2.13"
8826     exit 0 ;;
8827   -help | --help | --hel | --he | --h)
8828     echo "\$ac_cs_usage"; exit 0 ;;
8829   *) echo "\$ac_cs_usage"; exit 1 ;;
8830   esac
8831 done
8832
8833 ac_given_srcdir=$srcdir
8834 ac_given_INSTALL="$INSTALL"
8835
8836 trap 'rm -fr `echo "\
8837 Makefile:build/top.mk:Makefile.in:build/dir.mk \
8838 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
8839 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
8840 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
8841 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
8842 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
8843 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
8844 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
8845 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
8846 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
8847 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
8848 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
8849 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
8850 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
8851 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
8852 include/Makefile:build/top.mk:include/Makefile.in \
8853 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
8854 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
8855 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
8856 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
8857 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
8858 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
8859 libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk:build/lib-static.mk    \
8860 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
8861 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
8862 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
8863 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
8864 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
8865 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
8866 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
8867 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
8868 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
8869 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
8870 tests/Makefile:build/top.mk:tests/Makefile.in \
8871  include/portable.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
8872 EOF
8873 cat >> $CONFIG_STATUS <<EOF
8874
8875 # Protect against being on the right side of a sed subst in config.status.
8876 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
8877  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
8878 $ac_vpsub
8879 $extrasub
8880 s%@SHELL@%$SHELL%g
8881 s%@CFLAGS@%$CFLAGS%g
8882 s%@CPPFLAGS@%$CPPFLAGS%g
8883 s%@CXXFLAGS@%$CXXFLAGS%g
8884 s%@FFLAGS@%$FFLAGS%g
8885 s%@DEFS@%$DEFS%g
8886 s%@LDFLAGS@%$LDFLAGS%g
8887 s%@LIBS@%$LIBS%g
8888 s%@exec_prefix@%$exec_prefix%g
8889 s%@prefix@%$prefix%g
8890 s%@program_transform_name@%$program_transform_name%g
8891 s%@bindir@%$bindir%g
8892 s%@sbindir@%$sbindir%g
8893 s%@libexecdir@%$libexecdir%g
8894 s%@datadir@%$datadir%g
8895 s%@sysconfdir@%$sysconfdir%g
8896 s%@sharedstatedir@%$sharedstatedir%g
8897 s%@localstatedir@%$localstatedir%g
8898 s%@libdir@%$libdir%g
8899 s%@includedir@%$includedir%g
8900 s%@oldincludedir@%$oldincludedir%g
8901 s%@infodir@%$infodir%g
8902 s%@mandir@%$mandir%g
8903 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
8904 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
8905 s%@INSTALL_DATA@%$INSTALL_DATA%g
8906 s%@PACKAGE@%$PACKAGE%g
8907 s%@VERSION@%$VERSION%g
8908 s%@ACLOCAL@%$ACLOCAL%g
8909 s%@AUTOCONF@%$AUTOCONF%g
8910 s%@AUTOMAKE@%$AUTOMAKE%g
8911 s%@AUTOHEADER@%$AUTOHEADER%g
8912 s%@MAKEINFO@%$MAKEINFO%g
8913 s%@SET_MAKE@%$SET_MAKE%g
8914 s%@top_builddir@%$top_builddir%g
8915 s%@ldap_subdir@%$ldap_subdir%g
8916 s%@host@%$host%g
8917 s%@host_alias@%$host_alias%g
8918 s%@host_cpu@%$host_cpu%g
8919 s%@host_vendor@%$host_vendor%g
8920 s%@host_os@%$host_os%g
8921 s%@RANLIB@%$RANLIB%g
8922 s%@CC@%$CC%g
8923 s%@LD@%$LD%g
8924 s%@NM@%$NM%g
8925 s%@LN_S@%$LN_S%g
8926 s%@LIBTOOL@%$LIBTOOL%g
8927 s%@SENDMAIL@%$SENDMAIL%g
8928 s%@EDITOR@%$EDITOR%g
8929 s%@FINGER@%$FINGER%g
8930 s%@CPP@%$CPP%g
8931 s%@PEPSY@%$PEPSY%g
8932 s%@LIBOBJS@%$LIBOBJS%g
8933 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
8934 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
8935 s%@BUILD_LDBM@%$BUILD_LDBM%g
8936 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
8937 s%@BUILD_SHELL@%$BUILD_SHELL%g
8938 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
8939 s%@LDAP_LIBS@%$LDAP_LIBS%g
8940 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
8941 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
8942 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
8943 s%@LDBM_LIBS@%$LDBM_LIBS%g
8944 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
8945 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
8946 s%@KRB_LIBS@%$KRB_LIBS%g
8947 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
8948
8949 CEOF
8950 EOF
8951
8952 cat >> $CONFIG_STATUS <<\EOF
8953
8954 # Split the substitutions into bite-sized pieces for seds with
8955 # small command number limits, like on Digital OSF/1 and HP-UX.
8956 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
8957 ac_file=1 # Number of current file.
8958 ac_beg=1 # First line for current file.
8959 ac_end=$ac_max_sed_cmds # Line after last line for current file.
8960 ac_more_lines=:
8961 ac_sed_cmds=""
8962 while $ac_more_lines; do
8963   if test $ac_beg -gt 1; then
8964     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
8965   else
8966     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
8967   fi
8968   if test ! -s conftest.s$ac_file; then
8969     ac_more_lines=false
8970     rm -f conftest.s$ac_file
8971   else
8972     if test -z "$ac_sed_cmds"; then
8973       ac_sed_cmds="sed -f conftest.s$ac_file"
8974     else
8975       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
8976     fi
8977     ac_file=`expr $ac_file + 1`
8978     ac_beg=$ac_end
8979     ac_end=`expr $ac_end + $ac_max_sed_cmds`
8980   fi
8981 done
8982 if test -z "$ac_sed_cmds"; then
8983   ac_sed_cmds=cat
8984 fi
8985 EOF
8986
8987 cat >> $CONFIG_STATUS <<EOF
8988
8989 CONFIG_FILES=\${CONFIG_FILES-"\
8990 Makefile:build/top.mk:Makefile.in:build/dir.mk \
8991 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
8992 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
8993 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
8994 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
8995 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
8996 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
8997 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
8998 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
8999 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
9000 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
9001 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
9002 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
9003 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
9004 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
9005 include/Makefile:build/top.mk:include/Makefile.in \
9006 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
9007 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
9008 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
9009 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
9010 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
9011 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
9012 libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk:build/lib-static.mk    \
9013 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
9014 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
9015 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
9016 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
9017 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
9018 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
9019 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
9020 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
9021 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
9022 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
9023 tests/Makefile:build/top.mk:tests/Makefile.in \
9024 "}
9025 EOF
9026 cat >> $CONFIG_STATUS <<\EOF
9027 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
9028   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
9029   case "$ac_file" in
9030   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
9031        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
9032   *) ac_file_in="${ac_file}.in" ;;
9033   esac
9034
9035   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
9036
9037   # Remove last slash and all that follows it.  Not all systems have dirname.
9038   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
9039   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
9040     # The file is in a subdirectory.
9041     test ! -d "$ac_dir" && mkdir "$ac_dir"
9042     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
9043     # A "../" for each directory in $ac_dir_suffix.
9044     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
9045   else
9046     ac_dir_suffix= ac_dots=
9047   fi
9048
9049   case "$ac_given_srcdir" in
9050   .)  srcdir=.
9051       if test -z "$ac_dots"; then top_srcdir=.
9052       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
9053   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
9054   *) # Relative path.
9055     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
9056     top_srcdir="$ac_dots$ac_given_srcdir" ;;
9057   esac
9058
9059   case "$ac_given_INSTALL" in
9060   [/$]*) INSTALL="$ac_given_INSTALL" ;;
9061   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
9062   esac
9063
9064   echo creating "$ac_file"
9065   rm -f "$ac_file"
9066   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
9067   case "$ac_file" in
9068   *Makefile*) ac_comsub="1i\\
9069 # $configure_input" ;;
9070   *) ac_comsub= ;;
9071   esac
9072
9073   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
9074   sed -e "$ac_comsub
9075 s%@configure_input@%$configure_input%g
9076 s%@srcdir@%$srcdir%g
9077 s%@top_srcdir@%$top_srcdir%g
9078 s%@INSTALL@%$INSTALL%g
9079 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
9080 fi; done
9081 rm -f conftest.s*
9082
9083 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
9084 # NAME is the cpp macro being defined and VALUE is the value it is being given.
9085 #
9086 # ac_d sets the value in "#define NAME VALUE" lines.
9087 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
9088 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
9089 ac_dC='\3'
9090 ac_dD='%g'
9091 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
9092 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
9093 ac_uB='\([      ]\)%\1#\2define\3'
9094 ac_uC=' '
9095 ac_uD='\4%g'
9096 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
9097 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
9098 ac_eB='$%\1#\2define\3'
9099 ac_eC=' '
9100 ac_eD='%g'
9101
9102 if test "${CONFIG_HEADERS+set}" != set; then
9103 EOF
9104 cat >> $CONFIG_STATUS <<EOF
9105   CONFIG_HEADERS="include/portable.h"
9106 EOF
9107 cat >> $CONFIG_STATUS <<\EOF
9108 fi
9109 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
9110   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
9111   case "$ac_file" in
9112   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
9113        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
9114   *) ac_file_in="${ac_file}.in" ;;
9115   esac
9116
9117   echo creating $ac_file
9118
9119   rm -f conftest.frag conftest.in conftest.out
9120   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
9121   cat $ac_file_inputs > conftest.in
9122
9123 EOF
9124
9125 # Transform confdefs.h into a sed script conftest.vals that substitutes
9126 # the proper values into config.h.in to produce config.h.  And first:
9127 # Protect against being on the right side of a sed subst in config.status.
9128 # Protect against being in an unquoted here document in config.status.
9129 rm -f conftest.vals
9130 cat > conftest.hdr <<\EOF
9131 s/[\\&%]/\\&/g
9132 s%[\\$`]%\\&%g
9133 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
9134 s%ac_d%ac_u%gp
9135 s%ac_u%ac_e%gp
9136 EOF
9137 sed -n -f conftest.hdr confdefs.h > conftest.vals
9138 rm -f conftest.hdr
9139
9140 # This sed command replaces #undef with comments.  This is necessary, for
9141 # example, in the case of _POSIX_SOURCE, which is predefined and required
9142 # on some systems where configure will not decide to define it.
9143 cat >> conftest.vals <<\EOF
9144 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
9145 EOF
9146
9147 # Break up conftest.vals because some shells have a limit on
9148 # the size of here documents, and old seds have small limits too.
9149
9150 rm -f conftest.tail
9151 while :
9152 do
9153   ac_lines=`grep -c . conftest.vals`
9154   # grep -c gives empty output for an empty file on some AIX systems.
9155   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
9156   # Write a limited-size here document to conftest.frag.
9157   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
9158   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
9159   echo 'CEOF
9160   sed -f conftest.frag conftest.in > conftest.out
9161   rm -f conftest.in
9162   mv conftest.out conftest.in
9163 ' >> $CONFIG_STATUS
9164   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
9165   rm -f conftest.vals
9166   mv conftest.tail conftest.vals
9167 done
9168 rm -f conftest.vals
9169
9170 cat >> $CONFIG_STATUS <<\EOF
9171   rm -f conftest.frag conftest.h
9172   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
9173   cat conftest.in >> conftest.h
9174   rm -f conftest.in
9175   if cmp -s $ac_file conftest.h 2>/dev/null; then
9176     echo "$ac_file is unchanged"
9177     rm -f conftest.h
9178   else
9179     # Remove last slash and all that follows it.  Not all systems have dirname.
9180       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
9181       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
9182       # The file is in a subdirectory.
9183       test ! -d "$ac_dir" && mkdir "$ac_dir"
9184     fi
9185     rm -f $ac_file
9186     mv conftest.h $ac_file
9187   fi
9188 fi; done
9189
9190 EOF
9191 cat >> $CONFIG_STATUS <<EOF
9192
9193 EOF
9194 cat >> $CONFIG_STATUS <<\EOF
9195
9196 date > stamp-h
9197 echo Please \"make depend\" to build dependencies
9198
9199 exit 0
9200 EOF
9201 chmod +x $CONFIG_STATUS
9202 rm -fr confdefs* $ac_clean_files
9203 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
9204