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