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