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