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